@operato/app 1.0.0-beta.3 → 1.0.0-beta.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,275 @@
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.6](https://github.com/hatiolab/operato/compare/v0.4.5...v1.0.0-beta.6) (2022-04-22)
7
+
8
+ ## [1.0.0-beta.5](https://github.com/hatiolab/operato/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-04-18)
9
+
10
+ ## [1.0.0-beta.4](https://github.com/hatiolab/operato/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-04-14)
11
+
12
+
13
+ ### :rocket: New Features
14
+
15
+ * resource-object filter ([c70a727](https://github.com/hatiolab/operato/commit/c70a7270d9b28e51d78d3831bd2f563160d010ef))
16
+ * search for relation fields ([7dc99fd](https://github.com/hatiolab/operato/commit/7dc99fd6df1a96faab4f44ea65c3837934fabc5b))
17
+
18
+ ## [1.0.0-beta.3](https://github.com/hatiolab/operato/compare/v1.0.0-beta.2...v1.0.0-beta.3) (2022-04-12)
19
+
20
+ ## [1.0.0-beta.2](https://github.com/hatiolab/operato/compare/v1.0.0-beta.1...v1.0.0-beta.2) (2022-04-12)
21
+
22
+
23
+ ### :rocket: New Features
24
+
25
+ * add 'empty' button into ox-grist-editor-resource-object ([d739d23](https://github.com/hatiolab/operato/commit/d739d23686ea9487e2b9d887c451290638d3633e))
26
+
27
+ ## [1.0.0-beta.1](https://github.com/hatiolab/operato/compare/v1.0.0-beta.0...v1.0.0-beta.1) (2022-04-11)
28
+
29
+ ## [1.0.0-beta.0](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.53...v1.0.0-beta.0) (2022-04-10)
30
+
31
+ ## [1.0.0-alpha.53](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.52...v1.0.0-alpha.53) (2022-04-08)
32
+
33
+ ## [1.0.0-alpha.52](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.51...v1.0.0-alpha.52) (2022-04-08)
34
+
35
+ ## [1.0.0-alpha.51](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.50...v1.0.0-alpha.51) (2022-04-05)
36
+
37
+
38
+ ### :bug: Bug Fix
39
+
40
+ * crontab translation ([e87b431](https://github.com/hatiolab/operato/commit/e87b43145f5d01c4b71c4498578b4b172c50ae03))
41
+ * export ox-grist-renderer-crontab.js ([3615720](https://github.com/hatiolab/operato/commit/3615720d119526a17272db2369bd80340b6cbc31))
42
+
43
+ ## [1.0.0-alpha.50](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.49...v1.0.0-alpha.50) (2022-04-04)
44
+
45
+ ## [1.0.0-alpha.49](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.48...v1.0.0-alpha.49) (2022-04-04)
46
+
47
+
48
+ ### :bug: Bug Fix
49
+
50
+ * lit@2.2.1 ([6707752](https://github.com/hatiolab/operato/commit/6707752907d24f7ecbe248cba18a4b18cfda282f))
51
+
52
+
53
+ ### :rocket: New Features
54
+
55
+ * translation crontab for ox-grist-renderer-crontab ([c13d6ef](https://github.com/hatiolab/operato/commit/c13d6efab9ff02ceb4b4d244455a480070a80a3e))
56
+
57
+ ## [1.0.0-alpha.48](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.47...v1.0.0-alpha.48) (2022-04-03)
58
+
59
+
60
+ ### :rocket: New Features
61
+
62
+ * support copy and paste in data-grid ([9dd686f](https://github.com/hatiolab/operato/commit/9dd686f6817500863a1c36140ef01b39fcafef9f))
63
+
64
+ ## [1.0.0-alpha.47](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.46...v1.0.0-alpha.47) (2022-04-02)
65
+
66
+ ## [1.0.0-alpha.46](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.45...v1.0.0-alpha.46) (2022-04-02)
67
+
68
+ ## [1.0.0-alpha.45](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.44...v1.0.0-alpha.45) (2022-03-31)
69
+
70
+ ## [1.0.0-alpha.44](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.43...v1.0.0-alpha.44) (2022-03-31)
71
+
72
+ ## [1.0.0-alpha.43](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.42...v1.0.0-alpha.43) (2022-03-30)
73
+
74
+ ## [1.0.0-alpha.42](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.41...v1.0.0-alpha.42) (2022-03-29)
75
+
76
+ ## [1.0.0-alpha.41](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.40...v1.0.0-alpha.41) (2022-03-27)
77
+
78
+ ## [1.0.0-alpha.40](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.39...v1.0.0-alpha.40) (2022-03-26)
79
+
80
+ ## [1.0.0-alpha.39](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.38...v1.0.0-alpha.39) (2022-03-25)
81
+
82
+ ## [1.0.0-alpha.38](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.37...v1.0.0-alpha.38) (2022-03-25)
83
+
84
+ ## [1.0.0-alpha.37](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.36...v1.0.0-alpha.37) (2022-03-25)
85
+
86
+ ## [1.0.0-alpha.36](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.35...v1.0.0-alpha.36) (2022-03-21)
87
+
88
+ ## [1.0.0-alpha.35](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.34...v1.0.0-alpha.35) (2022-03-21)
89
+
90
+
91
+ ### :bug: Bug Fix
92
+
93
+ * prevent text overflow of grist-renderers ([73e7538](https://github.com/hatiolab/operato/commit/73e7538f9a0c8941689fefd3d4212529a75c413d))
94
+
95
+ ## [1.0.0-alpha.34](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.33...v1.0.0-alpha.34) (2022-03-20)
96
+
97
+ ## [1.0.0-alpha.33](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.32...v1.0.0-alpha.33) (2022-03-19)
98
+
99
+ ## [1.0.0-alpha.32](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.31...v1.0.0-alpha.32) (2022-03-19)
100
+
101
+
102
+ ### :bug: Bug Fix
103
+
104
+ * typo ([2f2e3fc](https://github.com/hatiolab/operato/commit/2f2e3fcce771dcbfe2f1d09cbd25638094a6dc99))
105
+
106
+ ## [1.0.0-alpha.31](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.30...v1.0.0-alpha.31) (2022-03-19)
107
+
108
+
109
+ ### :bug: Bug Fix
110
+
111
+ * ox-grist-renderer support class type renderer (refer ox-grist-renderer-progress) ([ad7c8e1](https://github.com/hatiolab/operato/commit/ad7c8e1b453d19af9daa13ae4eb7c2059d85dfbb))
112
+ * partition-keys related ui components ([c21b4d2](https://github.com/hatiolab/operato/commit/c21b4d292ca4a6d6b4bf774a570dbabd349528fc))
113
+
114
+ ## [1.0.0-alpha.30](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.29...v1.0.0-alpha.30) (2022-03-18)
115
+
116
+ ## [1.0.0-alpha.29](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.28...v1.0.0-alpha.29) (2022-03-17)
117
+
118
+
119
+ ### :bug: Bug Fix
120
+
121
+ * datalist in ox-input-partition-keys ([a25e3a6](https://github.com/hatiolab/operato/commit/a25e3a66cf5f7a25bca057be90ef336b29e915a7))
122
+ * typo ([1f8f2da](https://github.com/hatiolab/operato/commit/1f8f2da3b4780df9f747065a457f6cafb5d9e9cf))
123
+
124
+ ## [1.0.0-alpha.28](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.26...v1.0.0-alpha.28) (2022-03-17)
125
+
126
+
127
+ ### :rocket: New Features
128
+
129
+ * add ox-grist-editor for partition-keys ([7672a27](https://github.com/hatiolab/operato/commit/7672a2729f78475602733a83779f6a7a96e128fd))
130
+
131
+ ## [1.0.0-alpha.26](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.25...v1.0.0-alpha.26) (2022-03-17)
132
+
133
+ ## [1.0.0-alpha.25](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-03-17)
134
+
135
+
136
+ ### :bug: Bug Fix
137
+
138
+ * typo ([907aceb](https://github.com/hatiolab/operato/commit/907acebaf882613991bce064efea435c2d148543))
139
+
140
+ ## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17)
141
+
142
+
143
+ ### :bug: Bug Fix
144
+
145
+ * refactoring grist-editor, property-editor and input ([bdc3197](https://github.com/hatiolab/operato/commit/bdc31977d148c80a3ac0bea4b33160bac277df1e))
146
+ * refactoring grist-editor, property-editor and input ([ea7431a](https://github.com/hatiolab/operato/commit/ea7431a5e2dfd96ef392c1905e9622df7c2ef88c))
147
+
148
+ ## [1.0.0-alpha.23](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.22...v1.0.0-alpha.23) (2022-03-17)
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
+ ## [1.0.0-alpha.21](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.20...v1.0.0-alpha.21) (2022-03-16)
153
+
154
+
155
+ ### :rocket: New Features
156
+
157
+ * @operato/ccp module added ([f08ba5a](https://github.com/hatiolab/operato/commit/f08ba5a464c04b7fb132c6f18de975997087846a))
158
+
159
+ ## [1.0.0-alpha.20](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.19...v1.0.0-alpha.20) (2022-03-15)
160
+
161
+ ## [1.0.0-alpha.19](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.18...v1.0.0-alpha.19) (2022-03-14)
162
+
163
+
164
+ ### :bug: Bug Fix
165
+
166
+ * image-selector in ox-input-background-pattern ([b88c6e1](https://github.com/hatiolab/operato/commit/b88c6e141d5d636bff4b29fbae3c790d80b641bc))
167
+
168
+ ## [1.0.0-alpha.18](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.17...v1.0.0-alpha.18) (2022-03-14)
169
+
170
+
171
+ ### :bug: Bug Fix
172
+
173
+ * missing font module import ([a5348cf](https://github.com/hatiolab/operato/commit/a5348cf0d567927f18bf31bba09994f3fbf742f6))
174
+
175
+ ## [1.0.0-alpha.17](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.16...v1.0.0-alpha.17) (2022-03-13)
176
+
177
+
178
+ ### :bug: Bug Fix
179
+
180
+ * some missings in font module ([6c1ba6d](https://github.com/hatiolab/operato/commit/6c1ba6d89b8ff75b03c6b4ce813f5d3d09c7437b))
181
+
182
+ ## [1.0.0-alpha.16](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.15...v1.0.0-alpha.16) (2022-03-13)
183
+
184
+
185
+ ### :bug: Bug Fix
186
+
187
+ * downgrad graphql related libraries ([d26b80f](https://github.com/hatiolab/operato/commit/d26b80fc31b10bfd3bf31b6473151af52f857c66))
188
+
189
+ ## [1.0.0-alpha.15](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.14...v1.0.0-alpha.15) (2022-03-13)
190
+
191
+
192
+ ### :rocket: New Features
193
+
194
+ * migrate input, property-editor from things-factory ([dbd5e73](https://github.com/hatiolab/operato/commit/dbd5e73eac328e72c4bb7abd113a819532bc894d))
195
+
196
+ ## [1.0.0-alpha.14](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.13...v1.0.0-alpha.14) (2022-03-13)
197
+
198
+ ## [1.0.0-alpha.13](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.12...v1.0.0-alpha.13) (2022-03-13)
199
+
200
+ ## [1.0.0-alpha.12](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.11...v1.0.0-alpha.12) (2022-03-13)
201
+
202
+
203
+ ### :rocket: New Features
204
+
205
+ * migrate input, property-editor from things-factory ([4800d85](https://github.com/hatiolab/operato/commit/4800d859473bf623325233a7f2af851e5d093dcb))
206
+
207
+ ## [1.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.10...v1.0.0-alpha.11) (2022-03-12)
208
+
209
+
210
+ ### :bug: Bug Fix
211
+
212
+ * code-editor for grist ([cb80692](https://github.com/hatiolab/operato/commit/cb80692039e41d7b94b98ac1845822563e179e24))
213
+ * ox-property-editor-attachment-selector ([a1a2d20](https://github.com/hatiolab/operato/commit/a1a2d20640746c891248fdb729097614676c9cff))
214
+
215
+ ## [1.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.9...v1.0.0-alpha.10) (2022-03-12)
216
+
217
+ ## [1.0.0-alpha.9](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.8...v1.0.0-alpha.9) (2022-03-12)
218
+
219
+
220
+ ### :rocket: New Features
221
+
222
+ * settled concept for input, property-editor, grist-editor, so on ([0c9e1d0](https://github.com/hatiolab/operato/commit/0c9e1d054c7aef5d965868242cf471667af7a3c3))
223
+
224
+ ## [1.0.0-alpha.8](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.7...v1.0.0-alpha.8) (2022-03-11)
225
+
226
+ ## [1.0.0-alpha.7](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.6...v1.0.0-alpha.7) (2022-03-11)
227
+
228
+ ## [1.0.0-alpha.6](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.5...v1.0.0-alpha.6) (2022-03-11)
229
+
230
+ ## [1.0.0-alpha.5](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.4...v1.0.0-alpha.5) (2022-03-11)
231
+
232
+
233
+ ### :bug: Bug Fix
234
+
235
+ * migrate parameter-editor from things-factory ([019a30d](https://github.com/hatiolab/operato/commit/019a30df6fd4c8a273d4194d13f5784ed6f8d956))
236
+
237
+ ## [1.0.0-alpha.4](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.3...v1.0.0-alpha.4) (2022-03-11)
238
+
239
+
240
+ ### :rocket: New Features
241
+
242
+ * start migration grist editors from things-factory ([8b31c7f](https://github.com/hatiolab/operato/commit/8b31c7f00ae9b32e68f6860c559a768c3d456704))
243
+
244
+ ## [1.0.0-alpha.3](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.2...v1.0.0-alpha.3) (2022-03-10)
245
+
246
+ ## [1.0.0-alpha.2](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.1...v1.0.0-alpha.2) (2022-03-10)
247
+
248
+ ## [1.0.0-alpha.1](https://github.com/hatiolab/operato/compare/v0.4.3...v1.0.0-alpha.1) (2022-03-09)
249
+
250
+
251
+ ### :rocket: New Features
252
+
253
+ * 1.0-alpha ([42f87cf](https://github.com/hatiolab/operato/commit/42f87cf6a3cef0381db91ecb1179e63c64c01370))
254
+
255
+
256
+
257
+ ## [1.0.0-beta.5](https://github.com/hatiolab/operato/compare/v1.0.0-beta.4...v1.0.0-beta.5) (2022-04-18)
258
+
259
+ **Note:** Version bump only for package @operato/app
260
+
261
+
262
+
263
+
264
+
265
+ ## [1.0.0-beta.4](https://github.com/hatiolab/operato/compare/v1.0.0-beta.3...v1.0.0-beta.4) (2022-04-14)
266
+
267
+
268
+ ### :rocket: New Features
269
+
270
+ * resource-object filter ([c70a727](https://github.com/hatiolab/operato/commit/c70a7270d9b28e51d78d3831bd2f563160d010ef))
271
+ * search for relation fields ([7dc99fd](https://github.com/hatiolab/operato/commit/7dc99fd6df1a96faab4f44ea65c3837934fabc5b))
272
+
273
+
274
+
6
275
  ## [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
276
 
8
277
  **Note:** Version bump only for package @operato/app
@@ -0,0 +1,4 @@
1
+ import '@operato/input/ox-checkbox.js';
2
+ import '../grist-editor/ox-selector-resource-id';
3
+ import { FilterSelectRenderer } from '@operato/data-grist';
4
+ export declare const FilterResourceSelect: FilterSelectRenderer;
@@ -0,0 +1,79 @@
1
+ import '@operato/input/ox-checkbox.js';
2
+ import '../grist-editor/ox-selector-resource-id';
3
+ import { html } from 'lit-html';
4
+ import { i18next } from '@operato/i18n';
5
+ import { openPopup } from '@operato/layout';
6
+ function openResourceSelector(column, value, confirmCallback) {
7
+ const { queryName, select, list, basicArgs, valueField = 'id' } = column.record.options;
8
+ var actualValue;
9
+ if (typeof valueField === 'function') {
10
+ actualValue = valueField(value);
11
+ }
12
+ else {
13
+ actualValue = value === null || value === void 0 ? void 0 : value[valueField];
14
+ }
15
+ var template = html `
16
+ <ox-selector-resource-id
17
+ .value=${actualValue}
18
+ .confirmCallback=${confirmCallback}
19
+ .queryName=${queryName}
20
+ .select=${select}
21
+ .list=${list}
22
+ .basicArgs=${basicArgs}
23
+ .valueField=${valueField}
24
+ ></ox-selector-resource-id>
25
+ `;
26
+ const popup = openPopup(template, {
27
+ backdrop: true,
28
+ size: 'large',
29
+ title: i18next.t('title.select_item')
30
+ });
31
+ }
32
+ export const FilterResourceSelect = (column, value, owner) => {
33
+ const filter = column.filter;
34
+ const { operator = 'like' } = filter;
35
+ return operator === 'like'
36
+ ? html ` <input
37
+ type="text"
38
+ name=${column.name}
39
+ .value=${value}
40
+ @change=${(e) => {
41
+ const input = e.target;
42
+ input.dispatchEvent(new CustomEvent('filter-change', {
43
+ bubbles: true,
44
+ composed: true,
45
+ detail: {
46
+ name: column.name,
47
+ operator,
48
+ value: input.value
49
+ }
50
+ }));
51
+ }}
52
+ />`
53
+ : operator == 'in'
54
+ ? html ``
55
+ : operator === 'eq'
56
+ ? html `
57
+ <input
58
+ style="min-width: 100px; min-height: 24px"
59
+ type="text"
60
+ name=${column.name}
61
+ .value=${value}
62
+ readonly
63
+ @click=${(e) => {
64
+ e.stopPropagation();
65
+ const confirmCallback = (selected) => {
66
+ var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {};
67
+ owner.dispatchEvent(new CustomEvent('filter-change', {
68
+ bubbles: true,
69
+ composed: true,
70
+ detail: selected ? selected[idField] : ''
71
+ }));
72
+ };
73
+ openResourceSelector(column, value, confirmCallback);
74
+ }}
75
+ />
76
+ `
77
+ : html ``;
78
+ };
79
+ //# sourceMappingURL=filter-resource-select.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filter-renderer/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,SAAS,oBAAoB,CAAC,MAAoB,EAAE,KAAU,EAAE,eAAiC;IAC/F,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAA;IAEvF,IAAI,WAAW,CAAA;IACf,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QACpC,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;KAChC;SAAM;QACL,WAAW,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,UAAU,CAAC,CAAA;KAClC;IAED,IAAI,QAAQ,GAAG,IAAI,CAAA;;eAEN,WAAW;yBACD,eAAe;mBACrB,SAAS;gBACZ,MAAM;cACR,IAAI;mBACC,SAAS;oBACR,UAAU;;GAE3B,CAAA;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;QAChC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;KACtC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAyB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IACjF,MAAM,MAAM,GAAG,MAAM,CAAC,MAA4B,CAA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AAM,EAAE,KAAK,EAAE,eAAe,CAAC,CAAA;gBACtD,CAAC;;OAEJ;gBACH,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import '@operato/input/ox-checkbox.js'\nimport '../grist-editor/ox-selector-resource-id'\n\nimport { html } from 'lit-html'\n\nimport { ColumnConfig, FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\ntype SelectedCallback = (value: { id: string; name: string; description: string }) => void\n\nfunction openResourceSelector(column: ColumnConfig, value: any, confirmCallback: SelectedCallback) {\n const { queryName, select, list, basicArgs, valueField = 'id' } = column.record.options\n\n var actualValue\n if (typeof valueField === 'function') {\n actualValue = valueField(value)\n } else {\n actualValue = value?.[valueField]\n }\n\n var template = html`\n <ox-selector-resource-id\n .value=${actualValue}\n .confirmCallback=${confirmCallback}\n .queryName=${queryName}\n .select=${select}\n .list=${list}\n .basicArgs=${basicArgs}\n .valueField=${valueField}\n ></ox-selector-resource-id>\n `\n\n const popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.select_item')\n })\n}\n\nexport const FilterResourceSelect: FilterSelectRenderer = (column, value, owner) => {\n const filter = column.filter as FilterConfigObject\n const { operator = 'like' } = filter\n\n return operator === 'like'\n ? html` <input\n type=\"text\"\n name=${column.name}\n .value=${value}\n @change=${(e: CustomEvent) => {\n const input = e.target as HTMLInputElement\n input.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name: column.name,\n operator,\n value: input.value\n }\n })\n )\n }}\n />`\n : operator == 'in'\n ? html``\n : operator === 'eq'\n ? html`\n <input\n style=\"min-width: 100px; min-height: 24px\"\n type=\"text\"\n name=${column.name}\n .value=${value}\n readonly\n @click=${(e: Event) => {\n e.stopPropagation()\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}\n\n owner.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: selected ? selected[idField] : ''\n })\n )\n }\n\n openResourceSelector(column, value, confirmCallback)\n }}\n />\n `\n : html``\n}\n"]}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { registerFilterRenderer } from '@operato/data-grist';
2
+ import { FilterResourceSelect } from './filter-resource-select.js';
3
+ registerFilterRenderer('resource-object', [FilterResourceSelect]);
4
+ registerFilterRenderer('resource-id', [FilterResourceSelect]);
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filter-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAElE,sBAAsB,CAAC,iBAAiB,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;AACjE,sBAAsB,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA","sourcesContent":["import { registerFilterRenderer } from '@operato/data-grist'\n\nimport { FilterResourceSelect } from './filter-resource-select.js'\n\nregisterFilterRenderer('resource-object', [FilterResourceSelect])\nregisterFilterRenderer('resource-id', [FilterResourceSelect])\n"]}
@@ -0,0 +1,19 @@
1
+ import '@material/mwc-icon';
2
+ import './id-selector.js';
3
+ import { ColumnConfig, GristRecord, InputEditor } from '@operato/data-grist';
4
+ import { TemplateResult } from 'lit';
5
+ export declare class IdInput extends InputEditor {
6
+ static styles: import("lit").CSSResult;
7
+ value?: {
8
+ id?: string;
9
+ [propany: string]: any;
10
+ };
11
+ column: ColumnConfig;
12
+ record: GristRecord;
13
+ row: number;
14
+ private popup?;
15
+ private template?;
16
+ render(): TemplateResult<1>;
17
+ firstUpdated(): Promise<void>;
18
+ openSelector(): void;
19
+ }
@@ -0,0 +1,119 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import './id-selector.js';
4
+ import { InputEditor } from '@operato/data-grist';
5
+ import { css, html } from 'lit';
6
+ import { customElement, property } from 'lit/decorators.js';
7
+ import { openPopup } from '@operato/layout';
8
+ let IdInput = class IdInput extends InputEditor {
9
+ render() {
10
+ var { nameField = 'name', descriptionField = 'description' } = this.column.record.options || {};
11
+ var value = this.value;
12
+ return html `
13
+ ${!value ? html `` : html ` <span>${value[nameField]} (${value[descriptionField]})</span> `}
14
+ <mwc-icon>arrow_drop_down</mwc-icon>
15
+ `;
16
+ }
17
+ async firstUpdated() {
18
+ this.value = this.record[this.column.name];
19
+ this.template = ((this.column.record || {}).options || {}).template;
20
+ await this.updateComplete;
21
+ this.renderRoot.addEventListener('click', e => {
22
+ e.stopPropagation();
23
+ this.openSelector();
24
+ });
25
+ this.openSelector();
26
+ }
27
+ openSelector() {
28
+ if (this.popup) {
29
+ delete this.popup;
30
+ }
31
+ const confirmCallback = selected => {
32
+ if (!selected) {
33
+ return;
34
+ }
35
+ var { idField = 'id', nameField = 'name', descriptionField = 'description' } = this.column.record.options || {};
36
+ this.dispatchEvent(new CustomEvent('field-change', {
37
+ bubbles: true,
38
+ composed: true,
39
+ detail: {
40
+ before: this.value,
41
+ after: {
42
+ [idField]: selected[idField],
43
+ [nameField]: selected[nameField],
44
+ [descriptionField]: selected[descriptionField]
45
+ },
46
+ record: this.record,
47
+ column: this.column,
48
+ row: this.row
49
+ }
50
+ }));
51
+ };
52
+ var value = this.value || {};
53
+ var template = this.template ||
54
+ html `
55
+ <ox-id-selector
56
+ .value=${value.id}
57
+ .confirmCallback=${confirmCallback.bind(this)}
58
+ .queryName=${this.column.record.options.queryName}
59
+ .basicArgs=${this.column.record.options.basicArgs}
60
+ ></ox-id-selector>
61
+ `;
62
+ this.popup = openPopup(template, {
63
+ backdrop: true,
64
+ size: 'large',
65
+ title: 'select item'
66
+ });
67
+ }
68
+ };
69
+ IdInput.styles = css `
70
+ :host {
71
+ display: flex;
72
+ flex-flow: row nowrap;
73
+ align-items: center;
74
+
75
+ padding: 7px 0px;
76
+ box-sizing: border-box;
77
+
78
+ width: 100%;
79
+ height: 100%;
80
+
81
+ border: 0;
82
+ background-color: transparent;
83
+
84
+ font: var(--grist-object-editor-font);
85
+ color: var(--grist-object-editor-color);
86
+
87
+ justify-content: inherit;
88
+ }
89
+
90
+ span {
91
+ display: flex;
92
+ flex: auto;
93
+
94
+ justify-content: inherit;
95
+ }
96
+
97
+ mwc-icon {
98
+ width: 20px;
99
+ font-size: 1.5em;
100
+ margin-left: auto;
101
+ }
102
+ `;
103
+ __decorate([
104
+ property({ type: Object })
105
+ ], IdInput.prototype, "value", void 0);
106
+ __decorate([
107
+ property({ type: Object })
108
+ ], IdInput.prototype, "column", void 0);
109
+ __decorate([
110
+ property({ type: Object })
111
+ ], IdInput.prototype, "record", void 0);
112
+ __decorate([
113
+ property({ type: Number })
114
+ ], IdInput.prototype, "row", void 0);
115
+ IdInput = __decorate([
116
+ customElement('ox-id-input')
117
+ ], IdInput);
118
+ export { IdInput };
119
+ //# sourceMappingURL=id-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-input.js","sourceRoot":"","sources":["../../../src/grist/id-input.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAC3B,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAA6B,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAC5E,OAAO,EAAkB,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,IAAa,OAAO,GAApB,MAAa,OAAQ,SAAQ,WAAW;IAkDtC,MAAM;QACJ,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,gBAAgB,GAAG,aAAa,EAAE,GAAG,IAAI,CAAC,MAAM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AAqB;AACpB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oCAAa;AAvC7B,OAAO;IADnB,aAAa,CAAC,aAAa,CAAC;GAChB,OAAO,CA4HnB;SA5HY,OAAO","sourcesContent":["import '@material/mwc-icon'\nimport './id-selector.js'\n\nimport { ColumnConfig, GristRecord, InputEditor } from '@operato/data-grist'\nimport { TemplateResult, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-id-input')\nexport class IdInput extends InputEditor {\n static styles = css`\n :host {\n display: flex;\n flex-flow: row nowrap;\n align-items: center;\n\n padding: 7px 0px;\n box-sizing: border-box;\n\n width: 100%;\n height: 100%;\n\n border: 0;\n background-color: transparent;\n\n font: var(--grist-object-editor-font);\n color: var(--grist-object-editor-color);\n\n justify-content: inherit;\n }\n\n span {\n display: flex;\n flex: auto;\n\n justify-content: inherit;\n }\n\n mwc-icon {\n width: 20px;\n font-size: 1.5em;\n margin-left: auto;\n }\n `\n\n @property({ type: Object }) value?: { id?: string; [propany: string]: any }\n @property({ type: Object }) column!: ColumnConfig\n @property({ type: Object }) record!: GristRecord\n @property({ type: Number }) row!: number\n\n private popup?: {\n name: string\n close: () => void\n closed: boolean\n onclosed?: (() => void) | undefined\n }\n\n private template?: TemplateResult\n\n render() {\n var { nameField = 'name', descriptionField = 'description' } = this.column.record.options || {}\n var value = this.value\n\n return html`\n ${!value ? html`` : html` <span>${value[nameField]} (${value[descriptionField]})</span> `}\n <mwc-icon>arrow_drop_down</mwc-icon>\n `\n }\n\n async firstUpdated() {\n this.value = this.record[this.column.name]\n this.template = ((this.column.record || {}).options || {}).template\n\n await this.updateComplete\n\n this.renderRoot.addEventListener('click', e => {\n e.stopPropagation()\n\n this.openSelector()\n })\n\n this.openSelector()\n }\n\n openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback: (record: GristRecord | undefined) => void = selected => {\n if (!selected) {\n return\n }\n\n var { idField = 'id', nameField = 'name', descriptionField = 'description' } = this.column.record.options || {}\n\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: {\n [idField]: selected[idField],\n [nameField]: selected[nameField],\n [descriptionField]: selected[descriptionField]\n },\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n var value = this.value || {}\n var template =\n this.template ||\n html`\n <ox-id-selector\n .value=${value.id}\n .confirmCallback=${confirmCallback.bind(this)}\n .queryName=${this.column.record.options.queryName}\n .basicArgs=${this.column.record.options.basicArgs}\n ></ox-id-selector>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: 'select item'\n })\n }\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import { FieldRenderer } from '@operato/data-grist';
2
+ export declare const IdRenderer: FieldRenderer;
@@ -0,0 +1,9 @@
1
+ import { html } from 'lit';
2
+ export const IdRenderer = (value, column, record, rowIndex, field) => {
3
+ if (!value) {
4
+ return '';
5
+ }
6
+ var { nameField = 'name', descriptionField = 'description' } = column.record.options || {};
7
+ return html ` ${value[nameField] || ''}(${value[descriptionField] || ''}) `;
8
+ };
9
+ //# sourceMappingURL=id-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"id-renderer.js","sourceRoot":"","sources":["../../../src/grist/id-renderer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAE1B,MAAM,CAAC,MAAM,UAAU,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAClF,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,EAAE,CAAA;KACV;IAED,IAAI,EAAE,SAAS,GAAG,MAAM,EAAE,gBAAgB,GAAG,aAAa,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,IAAI,EAAE,CAAA;IAE1F,OAAO,IAAI,CAAA,IAAI,KAAK,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,KAAK,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,CAAA;AAC5E,CAAC,CAAA","sourcesContent":["import { FieldRenderer } from '@operato/data-grist'\nimport { html } from 'lit'\n\nexport const IdRenderer: FieldRenderer = (value, column, record, rowIndex, field) => {\n if (!value) {\n return ''\n }\n\n var { nameField = 'name', descriptionField = 'description' } = column.record.options || {}\n\n return html` ${value[nameField] || ''}(${value[descriptionField] || ''}) `\n}\n"]}
@@ -0,0 +1,23 @@
1
+ import '@operato/data-grist';
2
+ import { DataGrist, FetchOption, GristData, GristRecord } from '@operato/data-grist';
3
+ import { LitElement } from 'lit';
4
+ export declare class IdSelector extends LitElement {
5
+ static styles: import("lit").CSSResult;
6
+ value?: string;
7
+ config: any;
8
+ data: GristData;
9
+ queryName: string;
10
+ basicArgs: any;
11
+ confirmCallback?: (record: GristRecord | undefined) => void;
12
+ selectedRecords: GristRecord[];
13
+ grist: DataGrist;
14
+ render(): import("lit-html").TemplateResult<1>;
15
+ oncancel(): void;
16
+ onconfirm(): void;
17
+ firstUpdated(): Promise<void>;
18
+ fetchHandler({ page, limit, sorters, filters }: FetchOption): Promise<{
19
+ total: any;
20
+ records: any;
21
+ }>;
22
+ get selected(): GristRecord | undefined;
23
+ }