@operato/attachment 1.0.0-alpha.4 → 1.0.0-alpha.40
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 +296 -0
- package/dist/src/ox-attachment-list.d.ts +5 -2
- package/dist/src/ox-attachment-list.js +9 -4
- package/dist/src/ox-attachment-list.js.map +1 -1
- package/dist/src/ox-attachment-selector.d.ts +16 -0
- package/dist/src/ox-attachment-selector.js +108 -0
- package/dist/src/ox-attachment-selector.js.map +1 -0
- package/dist/src/ox-property-editor-attachment-selector.d.ts +1 -0
- package/dist/src/ox-property-editor-attachment-selector.js +16 -0
- package/dist/src/ox-property-editor-attachment-selector.js.map +1 -0
- package/dist/src/ox-property-editor-image-selector.d.ts +1 -0
- package/dist/src/ox-property-editor-image-selector.js +23 -0
- package/dist/src/ox-property-editor-image-selector.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -8
- package/src/ox-attachment-list.ts +18 -6
- package/src/ox-attachment-selector.ts +111 -0
- package/src/ox-property-editor-attachment-selector.ts +14 -0
- package/src/ox-property-editor-image-selector.ts +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,302 @@
|
|
|
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-alpha.40](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2022-03-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/attachment
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## [1.0.0-alpha.39](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2022-03-25)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @operato/attachment
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
## [1.0.0-alpha.38](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2022-03-25)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @operato/attachment
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
## [1.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2022-03-25)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @operato/attachment
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
## [1.0.0-alpha.36](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-03-21)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @operato/attachment
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## [1.0.0-alpha.35](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2022-03-21)
|
|
47
|
+
|
|
48
|
+
**Note:** Version bump only for package @operato/attachment
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
## [1.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-03-20)
|
|
55
|
+
|
|
56
|
+
**Note:** Version bump only for package @operato/attachment
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
## [1.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2022-03-19)
|
|
63
|
+
|
|
64
|
+
**Note:** Version bump only for package @operato/attachment
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
## [1.0.0-alpha.32](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2022-03-19)
|
|
71
|
+
|
|
72
|
+
**Note:** Version bump only for package @operato/attachment
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
## [1.0.0-alpha.31](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-03-19)
|
|
79
|
+
|
|
80
|
+
**Note:** Version bump only for package @operato/attachment
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
## [1.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-03-18)
|
|
87
|
+
|
|
88
|
+
**Note:** Version bump only for package @operato/attachment
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
## [1.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.28...v1.0.0-alpha.29) (2022-03-17)
|
|
95
|
+
|
|
96
|
+
**Note:** Version bump only for package @operato/attachment
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
## [1.0.0-alpha.28](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.28) (2022-03-17)
|
|
103
|
+
|
|
104
|
+
**Note:** Version bump only for package @operato/attachment
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
## [1.0.0-alpha.27](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.27) (2022-03-17)
|
|
111
|
+
|
|
112
|
+
**Note:** Version bump only for package @operato/attachment
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
## [1.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2022-03-17)
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @operato/attachment
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
## [1.0.0-alpha.25](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-03-17)
|
|
127
|
+
|
|
128
|
+
**Note:** Version bump only for package @operato/attachment
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17)
|
|
135
|
+
|
|
136
|
+
**Note:** Version bump only for package @operato/attachment
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
## [1.0.0-alpha.23](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-03-17)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package @operato/attachment
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
## [1.0.0-alpha.22](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.21...v1.0.0-alpha.22) (2022-03-17)
|
|
151
|
+
|
|
152
|
+
**Note:** Version bump only for package @operato/attachment
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
## [1.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2022-03-16)
|
|
159
|
+
|
|
160
|
+
**Note:** Version bump only for package @operato/attachment
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## [1.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2022-03-15)
|
|
167
|
+
|
|
168
|
+
**Note:** Version bump only for package @operato/attachment
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
## [1.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-03-14)
|
|
175
|
+
|
|
176
|
+
**Note:** Version bump only for package @operato/attachment
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
## [1.0.0-alpha.18](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-03-14)
|
|
183
|
+
|
|
184
|
+
**Note:** Version bump only for package @operato/attachment
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
## [1.0.0-alpha.17](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-03-13)
|
|
191
|
+
|
|
192
|
+
**Note:** Version bump only for package @operato/attachment
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
## [1.0.0-alpha.16](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-03-13)
|
|
199
|
+
|
|
200
|
+
**Note:** Version bump only for package @operato/attachment
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
|
|
206
|
+
## [1.0.0-alpha.15](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2022-03-13)
|
|
207
|
+
|
|
208
|
+
**Note:** Version bump only for package @operato/attachment
|
|
209
|
+
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
## [1.0.0-alpha.14](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2022-03-13)
|
|
215
|
+
|
|
216
|
+
**Note:** Version bump only for package @operato/attachment
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
|
|
221
|
+
|
|
222
|
+
## [1.0.0-alpha.13](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-13)
|
|
223
|
+
|
|
224
|
+
**Note:** Version bump only for package @operato/attachment
|
|
225
|
+
|
|
226
|
+
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
## [1.0.0-alpha.12](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-03-13)
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
### :bug: Bug Fix
|
|
234
|
+
|
|
235
|
+
* missing import ([c9ed5f9](https://github.com/hatiolab/operato/commit/c9ed5f9c3566e899ebd40e920d9f08200ca5a5c6))
|
|
236
|
+
|
|
237
|
+
|
|
238
|
+
### :rocket: New Features
|
|
239
|
+
|
|
240
|
+
* migrate input, property-editor from things-factory ([4800d85](https://github.com/hatiolab/operato/commit/4800d859473bf623325233a7f2af851e5d093dcb))
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
|
|
244
|
+
## [1.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-03-12)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
### :bug: Bug Fix
|
|
248
|
+
|
|
249
|
+
* ox-property-editor-attachment-selector ([a1a2d20](https://github.com/hatiolab/operato/commit/a1a2d20640746c891248fdb729097614676c9cff))
|
|
250
|
+
|
|
251
|
+
|
|
252
|
+
|
|
253
|
+
## [1.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2022-03-12)
|
|
254
|
+
|
|
255
|
+
**Note:** Version bump only for package @operato/attachment
|
|
256
|
+
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
|
|
261
|
+
## [1.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2022-03-12)
|
|
262
|
+
|
|
263
|
+
|
|
264
|
+
### :rocket: New Features
|
|
265
|
+
|
|
266
|
+
* settled concept for input, property-editor, grist-editor, so on ([0c9e1d0](https://github.com/hatiolab/operato/commit/0c9e1d054c7aef5d965868242cf471667af7a3c3))
|
|
267
|
+
|
|
268
|
+
|
|
269
|
+
|
|
270
|
+
## [1.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-03-11)
|
|
271
|
+
|
|
272
|
+
**Note:** Version bump only for package @operato/attachment
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
|
|
277
|
+
|
|
278
|
+
## [1.0.0-alpha.7](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-03-11)
|
|
279
|
+
|
|
280
|
+
**Note:** Version bump only for package @operato/attachment
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
|
|
284
|
+
|
|
285
|
+
|
|
286
|
+
## [1.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2022-03-11)
|
|
287
|
+
|
|
288
|
+
**Note:** Version bump only for package @operato/attachment
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
|
|
293
|
+
|
|
294
|
+
## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
|
|
295
|
+
|
|
296
|
+
**Note:** Version bump only for package @operato/attachment
|
|
297
|
+
|
|
298
|
+
|
|
299
|
+
|
|
300
|
+
|
|
301
|
+
|
|
6
302
|
## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
|
|
7
303
|
|
|
8
304
|
**Note:** Version bump only for package @operato/attachment
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '@operato/data-grist';
|
|
2
2
|
import '@operato/input/ox-input-file.js';
|
|
3
|
-
import { LitElement, PropertyValues } from 'lit';
|
|
4
3
|
import { ColumnConfig, FieldRenderer, FiltersForm, GristData, GristRecord, QueryFilter, SortersConfig } from '@operato/data-grist';
|
|
4
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
5
5
|
export declare class OxAttachmentList extends LitElement {
|
|
6
6
|
static styles: import("lit").CSSResult[];
|
|
7
7
|
categories: any[];
|
|
@@ -108,9 +108,12 @@ export declare class OxAttachmentList extends LitElement {
|
|
|
108
108
|
renderer: FieldRenderer;
|
|
109
109
|
align?: undefined;
|
|
110
110
|
};
|
|
111
|
+
handlers: {
|
|
112
|
+
click: (columns: ColumnConfig[], data: GristData, column: ColumnConfig, record: GristRecord, rowIndex: number, target: HTMLElement) => void;
|
|
113
|
+
dblclick?: undefined;
|
|
114
|
+
};
|
|
111
115
|
gutterName?: undefined;
|
|
112
116
|
icon?: undefined;
|
|
113
|
-
handlers?: undefined;
|
|
114
117
|
header?: undefined;
|
|
115
118
|
width?: undefined;
|
|
116
119
|
filter?: undefined;
|
|
@@ -1,12 +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';
|
|
4
8
|
import gql from 'graphql-tag';
|
|
5
9
|
import i18next from 'i18next';
|
|
6
|
-
import { css, html, LitElement } from 'lit';
|
|
7
|
-
import { customElement, property, query } from 'lit/decorators.js';
|
|
8
|
-
import { buildArgs, client } from '@operato/graphql';
|
|
9
|
-
import { ScrollbarStyles, TooltipStyles } from '@operato/styles';
|
|
10
10
|
import { sleep } from '@operato/utils';
|
|
11
11
|
const FETCH_ATTACHMENT_LIST_GQL = (listParam) => {
|
|
12
12
|
return gql `
|
|
@@ -212,6 +212,11 @@ let OxAttachmentList = class OxAttachmentList extends LitElement {
|
|
|
212
212
|
</div>
|
|
213
213
|
`;
|
|
214
214
|
}
|
|
215
|
+
},
|
|
216
|
+
handlers: {
|
|
217
|
+
click: (columns, data, column, record, rowIndex, target) => {
|
|
218
|
+
this.onClickSelect(record);
|
|
219
|
+
}
|
|
215
220
|
}
|
|
216
221
|
},
|
|
217
222
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-attachment-list.js","sourceRoot":"","sources":["../../src/ox-attachment-list.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAalE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,MAAM,yBAAyB,GAAG,CAAC,SAAc,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;kBAEM,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;CAgBrC,CAAA;AACD,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;CAIhC,CAAA;AAED,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcjC,CAAA;AAGD,IAAa,gBAAgB,GAA7B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E,CAAA;gBACjB,CAAC,CAAC;aACH;YACD,OAAO,EAAE;gBACP,SAAS,EAAE,IAAI;aAChB;SACF,CAAC,CAAA;IACJ,CAAC;IAED,KAAK,CAAC,gBAAgB,CAAC,EAAU;QAC/B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE;gBACT,EAAE;aACH;SACF,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF,CAAA;AAtZQ,uBAAM,GAAG;IACd,eAAe;IACf,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+CF;CACF,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAAuE;AACrE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAsB;AACpB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAA2B;AAEpC;IAAlB,KAAK,CAAC,UAAU,CAAC;+CAA0B;AACpB;IAAvB,KAAK,CAAC,eAAe,CAAC;sDAAmB;AAChB;IAAzB,KAAK,CAAC,iBAAiB,CAAC;qDAA0B;AA5DxC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAuZ5B;SAvZY,gBAAgB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/input/ox-input-file.js'\n\nimport gql from 'graphql-tag'\nimport i18next from 'i18next'\nimport { css, html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport {\n ColumnConfig,\n DataGrist,\n FieldRenderer,\n FiltersForm,\n GristData,\n GristRecord,\n PaginationConfig,\n QueryFilter,\n SortersConfig\n} from '@operato/data-grist'\nimport { buildArgs, client } from '@operato/graphql'\nimport { ScrollbarStyles, TooltipStyles } from '@operato/styles'\nimport { sleep } from '@operato/utils'\n\nconst FETCH_ATTACHMENT_LIST_GQL = (listParam: any) => {\n return gql`\n {\n attachments(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n mimetype\n encoding\n category\n fullpath\n path\n createdAt\n updatedAt\n }\n total\n }\n }\n`\n}\n\nconst DELETE_ATTACHMENT_GQL = gql`\n mutation DeleteAttachment($id: String!) {\n deleteAttachment(id: $id)\n }\n`\n\nconst CREATE_ATTACHMENTS_GQL = gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n description\n mimetype\n encoding\n category\n path\n createdAt\n updatedAt\n }\n }\n`\n\n@customElement('ox-attachment-list')\nexport class OxAttachmentList extends LitElement {\n static styles = [\n ScrollbarStyles,\n TooltipStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n\n #filters > * {\n padding: var(--padding-default) var(--padding-wide);\n }\n\n select {\n border: 0;\n outline: none;\n text-align: right;\n }\n\n @media only screen and (max-width: 460px) {\n #filters {\n flex-direction: column;\n }\n }\n `\n ]\n\n @property({ type: Array }) categories: any[] = ['audio', 'video', 'image', 'text', 'application']\n @property({ type: String }) category: string = ''\n @property({ type: Boolean }) creatable: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-input-file') fileUploader!: any\n @query('ox-filters-form') filtersForm!: FiltersForm\n\n render() {\n return html`\n <ox-grist .config=${this.gristConfig} .mode=${'CARD'} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n \n <div id=\"filters\">\n <ox-filters-form\n slot=\"headroom\"\n @change=${(e: Event) => this.grist.fetch(true)}\n ></ox-filters-form>\n\n <select\n @change=${(e: Event) => {\n this.category = (e.currentTarget as HTMLInputElement)?.value\n this.requestUpdate()\n }}\n >\n <option value=\"\">${i18next.t('text.please choose a category')}</option>\n ${this.categories.map(\n category =>\n html` <option value=${category} ?selected=${this.category == category}>${category}</option> `\n )}\n </select>\n </div>\n\n <ox-input-file\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n @change=${this.onCreateAttachment.bind(this)}\n ></ox-input-file>\n </ox-grist>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n const filters: QueryFilter[] = await this.filtersForm.getQueryFilters()\n const { items: records, total } = await this.getAttachments({ page, limit, filters, sortings: sorters })\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'open_in_new',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): void => {\n window.open(record.fullpath, '_blank')\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'link',\n handlers: {\n click: async (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): Promise<void> => {\n var { protocol, hostname, port } = location\n await navigator.clipboard.writeText(`${protocol}//${hostname}:${port}${record.fullpath}`)\n\n target.setAttribute('data-tooltip', 'url copied!')\n await sleep(2000)\n target.removeAttribute('data-tooltip')\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'delete',\n handlers: {\n click: async (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): Promise<void> => {\n await this.deleteAttachment(record.id!)\n this.refreshAttachments()\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'save_alt',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): void => {\n const element = document.createElement('a')\n element.setAttribute('href', record.fullpath)\n element.setAttribute('download', record.name!)\n document.body.appendChild(element)\n element.click()\n }\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n filter: 'search',\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n filter: 'search',\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'image',\n name: 'thumbnail',\n hidden: true,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, owner) {\n return record.category == 'image'\n ? html` <img src=${record.fullpath} style=\"max-width: 100%; max-height: 100%;\" /> `\n : record.category == 'video'\n ? html` <video src=${record.fullpath} style=\"width: 100%; height: 100%;\" controls></video> `\n : html`\n <div style=\"width: 100%; height: 100%;\" etc>\n <mwc-icon outlined>insert_drive_file</mwc-icon>\n <span>${record.path.substr(record.path.lastIndexOf('.'))}</span>\n </div>\n `\n } as FieldRenderer\n }\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {\n click: 'select-row-toggle'\n },\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async firstUpdated() {\n this.refreshAttachments()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('category')) {\n this.refreshAttachments()\n }\n }\n\n onClickSelect(attachment: any) {\n this.dispatchEvent(\n new CustomEvent('attachment-selected', {\n composed: true,\n bubbles: true,\n detail: {\n attachment\n }\n })\n )\n }\n\n async onCreateAttachment(e: CustomEvent) {\n const files = e.detail\n\n await this.createAttachments(files)\n this.refreshAttachments()\n }\n\n async onDeleteAttachment(id: string) {\n await this.deleteAttachment(id)\n\n this.refreshAttachments()\n }\n\n async refreshAttachments() {\n this.grist.fetch()\n }\n\n async getAttachments({\n page = 1,\n limit = 30,\n filters = [],\n sortings = []\n }: { page?: number; limit?: number; filters?: QueryFilter[]; sortings?: SortersConfig } = {}) {\n var pagination: PaginationConfig = {\n limit,\n page\n }\n\n if (this.category)\n filters.push({\n name: 'category',\n operator: 'eq',\n value: this.category\n })\n\n var params = {\n filters,\n sortings,\n pagination\n }\n\n var attachmentListResponse = await client.query({\n query: FETCH_ATTACHMENT_LIST_GQL(params)\n })\n\n if (!attachmentListResponse || !attachmentListResponse.data) {\n return {}\n }\n\n return attachmentListResponse?.data?.attachments || {}\n }\n\n async createAttachments(files: File[]) {\n /*\n ref. https://github.com/jaydenseric/graphql-multipart-request-spec#client\n */\n\n const response = await client.mutate({\n mutation: CREATE_ATTACHMENTS_GQL,\n variables: {\n attachments: files.map(file => {\n return { file }\n })\n },\n context: {\n hasUpload: true\n }\n })\n }\n\n async deleteAttachment(id: string) {\n const response = await client.mutate({\n mutation: DELETE_ATTACHMENT_GQL,\n variables: {\n id\n }\n })\n\n return response.data\n }\n}\n"]}
|
|
1
|
+
{"version":3,"file":"ox-attachment-list.js","sourceRoot":"","sources":["../../src/ox-attachment-list.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAC5B,OAAO,iCAAiC,CAAA;AAaxC,OAAO,EAAE,UAAU,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAA;AAEtC,MAAM,yBAAyB,GAAG,CAAC,SAAc,EAAE,EAAE;IACnD,OAAO,GAAG,CAAA;;kBAEM,SAAS,CAAC,SAAS,CAAC;;;;;;;;;;;;;;;;CAgBrC,CAAA;AACD,CAAC,CAAA;AAED,MAAM,qBAAqB,GAAG,GAAG,CAAA;;;;CAIhC,CAAA;AAED,MAAM,sBAAsB,GAAG,GAAG,CAAA;;;;;;;;;;;;;;CAcjC,CAAA;AAGD,IAAa,gBAAgB,GAA7B,MAAa,gBAAiB,SAAQ,UAAU;IAAhD;;QAsD6B,eAAU,GAAU,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,aAAa,CAAC,CAAA;QACrE,aAAQ,GAAW,EAAE,CAAA;QACpB,cAAS,GAAY,KAAK,CAAA;IA2WzD,CAAC;IArWC,MAAM;QACJ,OAAO,IAAI,CAAA;0BACW,IAAI,CAAC,WAAW,UAAU,MAAM,6BAA6B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;;;;;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C/B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC;YACnC,QAAQ,EAAE,qBAAqB;YAC/B,SAAS,EAAE;gBACT,EAAE;aACH;SACF,CAAC,CAAA;QAEF,OAAO,QAAQ,CAAC,IAAI,CAAA;IACtB,CAAC;CACF,CAAA;AAlaQ,uBAAM,GAAG;IACd,eAAe;IACf,aAAa;IACb,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA+CF;CACF,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;oDAAuE;AACrE;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAsB;AACpB;IAA5B,QAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;mDAA2B;AAEpC;IAAlB,KAAK,CAAC,UAAU,CAAC;+CAA0B;AACpB;IAAvB,KAAK,CAAC,eAAe,CAAC;sDAAmB;AAChB;IAAzB,KAAK,CAAC,iBAAiB,CAAC;qDAA0B;AA5DxC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAma5B;SAnaY,gBAAgB","sourcesContent":["import '@operato/data-grist'\nimport '@operato/input/ox-input-file.js'\n\nimport {\n ColumnConfig,\n DataGrist,\n FieldRenderer,\n FiltersForm,\n GristData,\n GristRecord,\n PaginationConfig,\n QueryFilter,\n SortersConfig\n} from '@operato/data-grist'\nimport { LitElement, PropertyValues, css, html } from 'lit'\nimport { ScrollbarStyles, TooltipStyles } from '@operato/styles'\nimport { buildArgs, client } from '@operato/graphql'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport gql from 'graphql-tag'\nimport i18next from 'i18next'\nimport { sleep } from '@operato/utils'\n\nconst FETCH_ATTACHMENT_LIST_GQL = (listParam: any) => {\n return gql`\n {\n attachments(${buildArgs(listParam)}) {\n items {\n id\n name\n description\n mimetype\n encoding\n category\n fullpath\n path\n createdAt\n updatedAt\n }\n total\n }\n }\n`\n}\n\nconst DELETE_ATTACHMENT_GQL = gql`\n mutation DeleteAttachment($id: String!) {\n deleteAttachment(id: $id)\n }\n`\n\nconst CREATE_ATTACHMENTS_GQL = gql`\n mutation ($attachments: [NewAttachment!]!) {\n createAttachments(attachments: $attachments) {\n id\n name\n description\n mimetype\n encoding\n category\n path\n createdAt\n updatedAt\n }\n }\n`\n\n@customElement('ox-attachment-list')\nexport class OxAttachmentList extends LitElement {\n static styles = [\n ScrollbarStyles,\n TooltipStyles,\n css`\n :host {\n display: flex;\n\n width: 100%;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n ox-grist {\n flex: 1;\n overflow-y: auto;\n\n --grid-record-emphasized-background-color: red;\n --grid-record-emphasized-color: yellow;\n }\n\n #headroom {\n align-items: center;\n padding: var(--padding-default) var(--padding-wide);\n border-top: 2px solid rgba(0, 0, 0, 0.2);\n background-color: var(--theme-white-color);\n box-shadow: var(--box-shadow);\n }\n\n #filters {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n\n #filters > * {\n padding: var(--padding-default) var(--padding-wide);\n }\n\n select {\n border: 0;\n outline: none;\n text-align: right;\n }\n\n @media only screen and (max-width: 460px) {\n #filters {\n flex-direction: column;\n }\n }\n `\n ]\n\n @property({ type: Array }) categories: any[] = ['audio', 'video', 'image', 'text', 'application']\n @property({ type: String }) category: string = ''\n @property({ type: Boolean }) creatable: boolean = false\n\n @query('ox-grist') private grist!: DataGrist\n @query('ox-input-file') fileUploader!: any\n @query('ox-filters-form') filtersForm!: FiltersForm\n\n render() {\n return html`\n <ox-grist .config=${this.gristConfig} .mode=${'CARD'} auto-fetch .fetchHandler=${this.fetchHandler.bind(this)}>\n <div slot=\"headroom\" id=\"headroom\">\n \n <div id=\"filters\">\n <ox-filters-form\n slot=\"headroom\"\n @change=${(e: Event) => this.grist.fetch(true)}\n ></ox-filters-form>\n\n <select\n @change=${(e: Event) => {\n this.category = (e.currentTarget as HTMLInputElement)?.value\n this.requestUpdate()\n }}\n >\n <option value=\"\">${i18next.t('text.please choose a category')}</option>\n ${this.categories.map(\n category =>\n html` <option value=${category} ?selected=${this.category == category}>${category}</option> `\n )}\n </select>\n </div>\n\n <ox-input-file\n accept=\"*/*\"\n multiple=\"true\"\n hide-filelist\n @change=${this.onCreateAttachment.bind(this)}\n ></ox-input-file>\n </ox-grist>\n `\n }\n\n async fetchHandler({ page, limit, sorters = [] }: { page: number; limit: number; sorters: SortersConfig }) {\n const filters: QueryFilter[] = await this.filtersForm.getQueryFilters()\n const { items: records, total } = await this.getAttachments({ page, limit, filters, sortings: sorters })\n\n return {\n total,\n records\n }\n }\n\n get gristConfig() {\n return {\n list: {\n thumbnail: 'thumbnail',\n fields: ['name'],\n details: ['updatedAt']\n },\n columns: [\n {\n type: 'gutter',\n gutterName: 'dirty'\n },\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'open_in_new',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): void => {\n window.open(record.fullpath, '_blank')\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'link',\n handlers: {\n click: async (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): Promise<void> => {\n var { protocol, hostname, port } = location\n await navigator.clipboard.writeText(`${protocol}//${hostname}:${port}${record.fullpath}`)\n\n target.setAttribute('data-tooltip', 'url copied!')\n await sleep(2000)\n target.removeAttribute('data-tooltip')\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'delete',\n handlers: {\n click: async (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): Promise<void> => {\n await this.deleteAttachment(record.id!)\n this.refreshAttachments()\n }\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'save_alt',\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): void => {\n const element = document.createElement('a')\n element.setAttribute('href', record.fullpath)\n element.setAttribute('download', record.name!)\n document.body.appendChild(element)\n element.click()\n }\n }\n },\n {\n type: 'string',\n name: 'id',\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: 'name',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n filter: 'search',\n sortable: true\n },\n {\n type: 'string',\n name: 'description',\n header: 'description',\n record: {\n editable: true,\n align: 'left'\n },\n width: 200,\n filter: 'search',\n handlers: {\n dblclick: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number\n ): void => {\n alert(`${column.name} ${record[column.name]}, row : ${rowIndex}`)\n }\n }\n },\n {\n type: 'image',\n name: 'thumbnail',\n hidden: true,\n record: {\n editable: false,\n renderer: function (value, column, record, rowIndex, owner) {\n return record.category == 'image'\n ? html` <img src=${record.fullpath} style=\"max-width: 100%; max-height: 100%;\" /> `\n : record.category == 'video'\n ? html` <video src=${record.fullpath} style=\"width: 100%; height: 100%;\" controls></video> `\n : html`\n <div style=\"width: 100%; height: 100%;\" etc>\n <mwc-icon outlined>insert_drive_file</mwc-icon>\n <span>${record.path.substr(record.path.lastIndexOf('.'))}</span>\n </div>\n `\n } as FieldRenderer\n },\n handlers: {\n click: (\n columns: ColumnConfig[],\n data: GristData,\n column: ColumnConfig,\n record: GristRecord,\n rowIndex: number,\n target: HTMLElement\n ): void => {\n this.onClickSelect(record)\n }\n }\n },\n {\n type: 'datetime',\n name: 'updatedAt',\n header: 'updated at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n },\n {\n type: 'datetime',\n name: 'createdAt',\n header: 'created at',\n record: {\n editable: true\n },\n sortable: true,\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n },\n handlers: {\n click: 'select-row-toggle'\n },\n classifier: function (\n record: GristRecord,\n rowIndex: number\n ): { emphasized?: boolean | string | string[]; [key: string]: any } | void {}\n },\n sorters: [\n {\n name: 'name',\n desc: false\n }\n ],\n pagination: {\n pages: [20, 30, 50, 100, 200]\n }\n }\n }\n\n async firstUpdated() {\n this.refreshAttachments()\n }\n\n updated(changes: PropertyValues<this>) {\n if (changes.has('category')) {\n this.refreshAttachments()\n }\n }\n\n onClickSelect(attachment: any) {\n this.dispatchEvent(\n new CustomEvent('attachment-selected', {\n composed: true,\n bubbles: true,\n detail: {\n attachment\n }\n })\n )\n }\n\n async onCreateAttachment(e: CustomEvent) {\n const files = e.detail\n\n await this.createAttachments(files)\n this.refreshAttachments()\n }\n\n async onDeleteAttachment(id: string) {\n await this.deleteAttachment(id)\n\n this.refreshAttachments()\n }\n\n async refreshAttachments() {\n this.grist.fetch()\n }\n\n async getAttachments({\n page = 1,\n limit = 30,\n filters = [],\n sortings = []\n }: { page?: number; limit?: number; filters?: QueryFilter[]; sortings?: SortersConfig } = {}) {\n var pagination: PaginationConfig = {\n limit,\n page\n }\n\n if (this.category)\n filters.push({\n name: 'category',\n operator: 'eq',\n value: this.category\n })\n\n var params = {\n filters,\n sortings,\n pagination\n }\n\n var attachmentListResponse = await client.query({\n query: FETCH_ATTACHMENT_LIST_GQL(params)\n })\n\n if (!attachmentListResponse || !attachmentListResponse.data) {\n return {}\n }\n\n return attachmentListResponse?.data?.attachments || {}\n }\n\n async createAttachments(files: File[]) {\n /*\n ref. https://github.com/jaydenseric/graphql-multipart-request-spec#client\n */\n\n const response = await client.mutate({\n mutation: CREATE_ATTACHMENTS_GQL,\n variables: {\n attachments: files.map(file => {\n return { file }\n })\n },\n context: {\n hasUpload: true\n }\n })\n }\n\n async deleteAttachment(id: string) {\n const response = await client.mutate({\n mutation: DELETE_ATTACHMENT_GQL,\n variables: {\n id\n }\n })\n\n return response.data\n }\n}\n"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import '@material/mwc-icon';
|
|
5
|
+
import './ox-attachment-list.js';
|
|
6
|
+
import { LitElement } from 'lit';
|
|
7
|
+
export declare class OxPropertyEditorAttachmentSelector extends LitElement {
|
|
8
|
+
static styles: import("lit").CSSResult[];
|
|
9
|
+
value: string;
|
|
10
|
+
properties: any;
|
|
11
|
+
private popup?;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
getIconByCategory(): "image" | "library_music" | "video_library" | "attachment";
|
|
14
|
+
_onInputChanged(e: KeyboardEvent): void;
|
|
15
|
+
openSelector(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright © HatioLab Inc. All rights reserved.
|
|
3
|
+
*/
|
|
4
|
+
import { __decorate } from "tslib";
|
|
5
|
+
import '@material/mwc-icon';
|
|
6
|
+
import './ox-attachment-list.js';
|
|
7
|
+
import { LitElement, css, html } from 'lit';
|
|
8
|
+
import { openPopup } from '@operato/layout';
|
|
9
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
10
|
+
import { i18next } from '@operato/i18n';
|
|
11
|
+
let OxPropertyEditorAttachmentSelector = class OxPropertyEditorAttachmentSelector extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.value = '';
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<input
|
|
19
|
+
id="text"
|
|
20
|
+
type="text"
|
|
21
|
+
.value=${this.value || ''}
|
|
22
|
+
@change=${(e) => this._onInputChanged(e)}
|
|
23
|
+
/>
|
|
24
|
+
|
|
25
|
+
<mwc-icon @click=${() => this.openSelector()}>${this.getIconByCategory()}</mwc-icon>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
getIconByCategory() {
|
|
29
|
+
var { category } = this.properties || {};
|
|
30
|
+
switch (category) {
|
|
31
|
+
case 'audio':
|
|
32
|
+
return 'library_music';
|
|
33
|
+
case 'video':
|
|
34
|
+
return 'video_library';
|
|
35
|
+
case 'image':
|
|
36
|
+
return 'image';
|
|
37
|
+
case 'text':
|
|
38
|
+
case 'application':
|
|
39
|
+
default:
|
|
40
|
+
return 'attachment';
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
_onInputChanged(e) {
|
|
44
|
+
this.value = e.target.value;
|
|
45
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
46
|
+
}
|
|
47
|
+
openSelector() {
|
|
48
|
+
if (this.popup) {
|
|
49
|
+
delete this.popup;
|
|
50
|
+
}
|
|
51
|
+
/*
|
|
52
|
+
* 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.
|
|
53
|
+
* 주의. value는 object일 수도 있고, string일 수도 있다.
|
|
54
|
+
* string인 경우에는 해당 보드의 id로 해석한다.
|
|
55
|
+
*/
|
|
56
|
+
var value = this.value || {};
|
|
57
|
+
var { category = 'application' } = this.properties || {};
|
|
58
|
+
var template = html `
|
|
59
|
+
<ox-attachment-list
|
|
60
|
+
.creatable=${true}
|
|
61
|
+
.category=${category}
|
|
62
|
+
@attachment-selected=${async (e) => {
|
|
63
|
+
var attachment = e.detail.attachment;
|
|
64
|
+
this.value = `/attachment/${attachment.path}`;
|
|
65
|
+
this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }));
|
|
66
|
+
this.popup && this.popup.close();
|
|
67
|
+
}}
|
|
68
|
+
></ox-attachment-list>
|
|
69
|
+
`;
|
|
70
|
+
this.popup = openPopup(template, {
|
|
71
|
+
backdrop: true,
|
|
72
|
+
size: 'large',
|
|
73
|
+
title: i18next.t('title.select attachment')
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
OxPropertyEditorAttachmentSelector.styles = [
|
|
78
|
+
css `
|
|
79
|
+
:host {
|
|
80
|
+
position: relative;
|
|
81
|
+
display: inline-block;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
input[type='text'] {
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
width: 100%;
|
|
87
|
+
height: 100%;
|
|
88
|
+
border: 1px solid rgba(0, 0, 0, 0.2);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
mwc-icon {
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 0;
|
|
94
|
+
right: 3px;
|
|
95
|
+
}
|
|
96
|
+
`
|
|
97
|
+
];
|
|
98
|
+
__decorate([
|
|
99
|
+
property({ type: String })
|
|
100
|
+
], OxPropertyEditorAttachmentSelector.prototype, "value", void 0);
|
|
101
|
+
__decorate([
|
|
102
|
+
property({ type: Object })
|
|
103
|
+
], OxPropertyEditorAttachmentSelector.prototype, "properties", void 0);
|
|
104
|
+
OxPropertyEditorAttachmentSelector = __decorate([
|
|
105
|
+
customElement('ox-attachment-selector')
|
|
106
|
+
], OxPropertyEditorAttachmentSelector);
|
|
107
|
+
export { OxPropertyEditorAttachmentSelector };
|
|
108
|
+
//# sourceMappingURL=ox-attachment-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-attachment-selector.js","sourceRoot":"","sources":["../../src/ox-attachment-selector.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oBAAoB,CAAA;AAC3B,OAAO,yBAAyB,CAAA;AAEhC,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,kCAAkC,GAA/C,M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AAK,EAAE,CAAc,EAAE,EAAE;YAC9C,IAAI,UAAU,GAAG,CAAC,CAAC,MAAM,CAAC,UAAU,CAAA;YACpC,IAAI,CAAC,KAAK,GAAG,eAAe,UAAU,CAAC,IAAI,EAAE,CAAA;YAE7C,IAAI,CAAC,aAAa,CAAC,IAAI,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,CAAA;YAEhF,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAA;QAClC,CAAC;;KAEJ,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,yBAAyB,CAAC;SAC5C,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AA/FQ,yCAAM,GAAG;IACd,GAAG,CAAA;;;;;;;;;;;;;;;;;;KAkBF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;sEAAgB;AAxBhC,kCAAkC;IAD9C,aAAa,CAAC,wBAAwB,CAAC;GAC3B,kCAAkC,CAgG9C;SAhGY,kCAAkC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport '@material/mwc-icon'\nimport './ox-attachment-list.js'\n\nimport { LitElement, css, html } from 'lit'\nimport { PopupHandle, openPopup } from '@operato/layout'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-attachment-selector')\nexport class OxPropertyEditorAttachmentSelector extends LitElement {\n static styles = [\n css`\n :host {\n position: relative;\n display: inline-block;\n }\n\n input[type='text'] {\n box-sizing: border-box;\n width: 100%;\n height: 100%;\n border: 1px solid rgba(0, 0, 0, 0.2);\n }\n\n mwc-icon {\n position: absolute;\n top: 0;\n right: 3px;\n }\n `\n ]\n\n @property({ type: String }) value: string = ''\n @property({ type: Object }) properties: any\n\n private popup?: PopupHandle\n\n render() {\n return html`\n <input\n id=\"text\"\n type=\"text\"\n .value=${this.value || ''}\n @change=${(e: KeyboardEvent) => this._onInputChanged(e)}\n />\n\n <mwc-icon @click=${() => this.openSelector()}>${this.getIconByCategory()}</mwc-icon>\n `\n }\n\n getIconByCategory() {\n var { category } = this.properties || {}\n switch (category) {\n case 'audio':\n return 'library_music'\n case 'video':\n return 'video_library'\n case 'image':\n return 'image'\n case 'text':\n case 'application':\n default:\n return 'attachment'\n }\n }\n\n _onInputChanged(e: KeyboardEvent) {\n this.value = (e.target as HTMLInputElement).value\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n /*\n * 기존 설정된 이미지가 선택된 상태가 되게 하기 위해서는 selector에 value를 전달해줄 필요가 있음.\n * 주의. value는 object일 수도 있고, string일 수도 있다.\n * string인 경우에는 해당 보드의 id로 해석한다.\n */\n var value = this.value || {}\n var { category = 'application' } = this.properties || {}\n\n var template = html`\n <ox-attachment-list\n .creatable=${true}\n .category=${category}\n @attachment-selected=${async (e: CustomEvent) => {\n var attachment = e.detail.attachment\n this.value = `/attachment/${attachment.path}`\n\n this.dispatchEvent(new CustomEvent('change', { bubbles: true, composed: true }))\n\n this.popup && this.popup.close()\n }}\n ></ox-attachment-list>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.select attachment')\n })\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './ox-attachment-selector';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './ox-attachment-selector';
|
|
3
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
4
|
+
import { customElement } from 'lit/decorators.js';
|
|
5
|
+
import { html } from 'lit';
|
|
6
|
+
let OxPropertyEditorAttachmentSelector = class OxPropertyEditorAttachmentSelector extends OxPropertyEditor {
|
|
7
|
+
editorTemplate() {
|
|
8
|
+
return html `
|
|
9
|
+
<ox-attachment-selector id="editor" .value=${this.value} .properties=${this.property}></ox-attachment-selector>
|
|
10
|
+
`;
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
OxPropertyEditorAttachmentSelector = __decorate([
|
|
14
|
+
customElement('ox-property-editor-attachment-selector')
|
|
15
|
+
], OxPropertyEditorAttachmentSelector);
|
|
16
|
+
//# sourceMappingURL=ox-property-editor-attachment-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-property-editor-attachment-selector.js","sourceRoot":"","sources":["../../src/ox-property-editor-attachment-selector.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAM,kCAAkC,GAAxC,MAAM,kCAAmC,SAAQ,gBAAgB;IAC/D,cAAc;QACZ,OAAO,IAAI,CAAA;mDACoC,IAAI,CAAC,KAAK,gBAAgB,IAAI,CAAC,QAAQ;KACrF,CAAA;IACH,CAAC;CACF,CAAA;AANK,kCAAkC;IADvC,aAAa,CAAC,wCAAwC,CAAC;GAClD,kCAAkC,CAMvC","sourcesContent":["import './ox-attachment-selector'\n\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-attachment-selector')\nclass OxPropertyEditorAttachmentSelector extends OxPropertyEditor {\n editorTemplate() {\n return html`\n <ox-attachment-selector id=\"editor\" .value=${this.value} .properties=${this.property}></ox-attachment-selector>\n `\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './ox-attachment-selector';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './ox-attachment-selector';
|
|
3
|
+
import { OxPropertyEditor } from '@operato/property-editor';
|
|
4
|
+
import { customElement } from 'lit/decorators.js';
|
|
5
|
+
import { html } from 'lit';
|
|
6
|
+
let OxPropertyEditorImageSelector = class OxPropertyEditorImageSelector extends OxPropertyEditor {
|
|
7
|
+
editorTemplate() {
|
|
8
|
+
return html `
|
|
9
|
+
<ox-attachment-selector
|
|
10
|
+
id="editor"
|
|
11
|
+
.value=${this.value}
|
|
12
|
+
.properties=${{
|
|
13
|
+
...this.property,
|
|
14
|
+
category: 'image'
|
|
15
|
+
}}
|
|
16
|
+
></ox-attachment-selector>
|
|
17
|
+
`;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
OxPropertyEditorImageSelector = __decorate([
|
|
21
|
+
customElement('ox-property-editor-image-selector')
|
|
22
|
+
], OxPropertyEditorImageSelector);
|
|
23
|
+
//# sourceMappingURL=ox-property-editor-image-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-property-editor-image-selector.js","sourceRoot":"","sources":["../../src/ox-property-editor-image-selector.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,IAAM,6BAA6B,GAAnC,MAAM,6BAA8B,SAAQ,gBAAgB;IAC1D,cAAc;QACZ,OAAO,IAAI,CAAA;;;iBAGE,IAAI,CAAC,KAAK;sBACL;YACZ,GAAG,IAAI,CAAC,QAAQ;YAChB,QAAQ,EAAE,OAAO;SAClB;;KAEJ,CAAA;IACH,CAAC;CACF,CAAA;AAbK,6BAA6B;IADlC,aAAa,CAAC,mCAAmC,CAAC;GAC7C,6BAA6B,CAalC","sourcesContent":["import './ox-attachment-selector'\n\nimport { OxPropertyEditor } from '@operato/property-editor'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\n\n@customElement('ox-property-editor-image-selector')\nclass OxPropertyEditorImageSelector extends OxPropertyEditor {\n editorTemplate() {\n return html`\n <ox-attachment-selector\n id=\"editor\"\n .value=${this.value}\n .properties=${{\n ...this.property,\n category: 'image'\n }}\n ></ox-attachment-selector>\n `\n }\n}\n"]}
|