@operato/app 2.0.0-beta.3 → 2.0.0-beta.31
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 +199 -0
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js +1 -12
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js.map +1 -1
- package/dist/src/grist-editor/ox-grist-renderer-resource-code.js +2 -13
- package/dist/src/grist-editor/ox-grist-renderer-resource-code.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +17 -15
- package/src/grist-editor/ox-grist-renderer-crontab.ts +1 -14
- package/src/grist-editor/ox-grist-renderer-resource-code.ts +2 -15
- package/themes/app-theme.css +6 -2
- package/themes/grist-theme.css +9 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,205 @@
|
|
|
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
|
+
## [2.0.0-beta.31](https://github.com/hatiolab/operato/compare/v2.0.0-beta.30...v2.0.0-beta.31) (2024-06-19)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* record-view style ([db87d4b](https://github.com/hatiolab/operato/commit/db87d4bb2ff97d47be77e86864f9371d3b824eb9))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [2.0.0-beta.30](https://github.com/hatiolab/operato/compare/v2.0.0-beta.29...v2.0.0-beta.30) (2024-06-18)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @operato/app
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [2.0.0-beta.28](https://github.com/hatiolab/operato/compare/v2.0.0-beta.27...v2.0.0-beta.28) (2024-06-18)
|
|
24
|
+
|
|
25
|
+
**Note:** Version bump only for package @operato/app
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
## [2.0.0-beta.26](https://github.com/hatiolab/operato/compare/v2.0.0-beta.25...v2.0.0-beta.26) (2024-06-18)
|
|
32
|
+
|
|
33
|
+
**Note:** Version bump only for package @operato/app
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
## [2.0.0-beta.25](https://github.com/hatiolab/operato/compare/v2.0.0-beta.24...v2.0.0-beta.25) (2024-06-17)
|
|
40
|
+
|
|
41
|
+
**Note:** Version bump only for package @operato/app
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
## [2.0.0-beta.24](https://github.com/hatiolab/operato/compare/v2.0.0-beta.23...v2.0.0-beta.24) (2024-06-15)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### :bug: Bug Fix
|
|
51
|
+
|
|
52
|
+
* remove default value for data property editor ([bf680c5](https://github.com/hatiolab/operato/commit/bf680c5da4856316e2a96f0231f2354cd305008f))
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
## [2.0.0-beta.23](https://github.com/hatiolab/operato/compare/v2.0.0-beta.22...v2.0.0-beta.23) (2024-06-13)
|
|
57
|
+
|
|
58
|
+
|
|
59
|
+
### :bug: Bug Fix
|
|
60
|
+
|
|
61
|
+
* export package.json ([538e6e0](https://github.com/hatiolab/operato/commit/538e6e050f5a3d77b8ed805968d66a9093a7d5e9))
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
## [2.0.0-beta.22](https://github.com/hatiolab/operato/compare/v2.0.0-beta.21...v2.0.0-beta.22) (2024-06-13)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
### :bug: Bug Fix
|
|
69
|
+
|
|
70
|
+
* operato tag for all package.json ([2334960](https://github.com/hatiolab/operato/commit/2334960db2186ade87ee590796a269fe5f5e9419))
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
## [2.0.0-beta.21](https://github.com/hatiolab/operato/compare/v2.0.0-beta.20...v2.0.0-beta.21) (2024-06-12)
|
|
75
|
+
|
|
76
|
+
**Note:** Version bump only for package @operato/app
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
## [2.0.0-beta.20](https://github.com/hatiolab/operato/compare/v2.0.0-beta.19...v2.0.0-beta.20) (2024-06-11)
|
|
83
|
+
|
|
84
|
+
**Note:** Version bump only for package @operato/app
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
## [2.0.0-beta.19](https://github.com/hatiolab/operato/compare/v2.0.0-beta.18...v2.0.0-beta.19) (2024-06-11)
|
|
91
|
+
|
|
92
|
+
**Note:** Version bump only for package @operato/app
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
|
|
98
|
+
## [2.0.0-beta.18](https://github.com/hatiolab/operato/compare/v2.0.0-beta.17...v2.0.0-beta.18) (2024-06-11)
|
|
99
|
+
|
|
100
|
+
**Note:** Version bump only for package @operato/app
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
## [2.0.0-beta.17](https://github.com/hatiolab/operato/compare/v2.0.0-beta.16...v2.0.0-beta.17) (2024-06-11)
|
|
107
|
+
|
|
108
|
+
**Note:** Version bump only for package @operato/app
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
## [2.0.0-beta.16](https://github.com/hatiolab/operato/compare/v2.0.0-beta.15...v2.0.0-beta.16) (2024-06-10)
|
|
115
|
+
|
|
116
|
+
**Note:** Version bump only for package @operato/app
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
## [2.0.0-beta.15](https://github.com/hatiolab/operato/compare/v2.0.0-beta.14...v2.0.0-beta.15) (2024-06-10)
|
|
123
|
+
|
|
124
|
+
**Note:** Version bump only for package @operato/app
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
## [2.0.0-beta.14](https://github.com/hatiolab/operato/compare/v2.0.0-beta.13...v2.0.0-beta.14) (2024-06-10)
|
|
131
|
+
|
|
132
|
+
**Note:** Version bump only for package @operato/app
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
## [2.0.0-beta.13](https://github.com/hatiolab/operato/compare/v2.0.0-beta.12...v2.0.0-beta.13) (2024-06-09)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
### :rocket: New Features
|
|
142
|
+
|
|
143
|
+
* tooltip-reactive-controller for mouse over/out ([73f069b](https://github.com/hatiolab/operato/commit/73f069b4e8c1472cc991010bbe7b3866035a05f0))
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
## [2.0.0-beta.12](https://github.com/hatiolab/operato/compare/v2.0.0-beta.11...v2.0.0-beta.12) (2024-06-09)
|
|
148
|
+
|
|
149
|
+
**Note:** Version bump only for package @operato/app
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
## [2.0.0-beta.9](https://github.com/hatiolab/operato/compare/v2.0.0-beta.8...v2.0.0-beta.9) (2024-06-08)
|
|
156
|
+
|
|
157
|
+
**Note:** Version bump only for package @operato/app
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
## [2.0.0-beta.8](https://github.com/hatiolab/operato/compare/v2.0.0-beta.7...v2.0.0-beta.8) (2024-06-07)
|
|
164
|
+
|
|
165
|
+
**Note:** Version bump only for package @operato/app
|
|
166
|
+
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
## [2.0.0-beta.7](https://github.com/hatiolab/operato/compare/v2.0.0-beta.6...v2.0.0-beta.7) (2024-06-07)
|
|
172
|
+
|
|
173
|
+
**Note:** Version bump only for package @operato/app
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
## [2.0.0-beta.6](https://github.com/hatiolab/operato/compare/v2.0.0-beta.5...v2.0.0-beta.6) (2024-06-06)
|
|
180
|
+
|
|
181
|
+
**Note:** Version bump only for package @operato/app
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
## [2.0.0-beta.5](https://github.com/hatiolab/operato/compare/v2.0.0-beta.4...v2.0.0-beta.5) (2024-06-04)
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
### :bug: Bug Fix
|
|
191
|
+
|
|
192
|
+
* theming design token : --border-dark-color => --border-dim-color ([eaf0866](https://github.com/hatiolab/operato/commit/eaf08667f6133cc4bcabf161bbe04305e0ff57e7))
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
|
|
196
|
+
## [2.0.0-beta.4](https://github.com/hatiolab/operato/compare/v2.0.0-beta.3...v2.0.0-beta.4) (2024-06-04)
|
|
197
|
+
|
|
198
|
+
|
|
199
|
+
### :bug: Bug Fix
|
|
200
|
+
|
|
201
|
+
* theming styles ([15fa201](https://github.com/hatiolab/operato/commit/15fa20198d7adc6b57f16e408f8dee94c40113f5))
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
|
|
6
205
|
## [2.0.0-beta.3](https://github.com/hatiolab/operato/compare/v2.0.0-beta.2...v2.0.0-beta.3) (2024-06-04)
|
|
7
206
|
|
|
8
207
|
**Note:** Version bump only for package @operato/app
|
|
@@ -1,17 +1,6 @@
|
|
|
1
1
|
import cronstrue from 'cronstrue/i18n';
|
|
2
2
|
import i18next from 'i18next';
|
|
3
3
|
import { html } from 'lit';
|
|
4
|
-
import { detectOverflow } from '@operato/utils';
|
|
5
|
-
function onmouseover(e) {
|
|
6
|
-
const element = e.target;
|
|
7
|
-
if (detectOverflow(element)) {
|
|
8
|
-
element.setAttribute('data-tooltip', element.textContent);
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
function onmouseout(e) {
|
|
12
|
-
const element = e.target;
|
|
13
|
-
element.removeAttribute('data-tooltip');
|
|
14
|
-
}
|
|
15
4
|
export const OxGristRendererCrontab = (value, column, record, rowIndex, field) => {
|
|
16
5
|
let text = '';
|
|
17
6
|
try {
|
|
@@ -21,6 +10,6 @@ export const OxGristRendererCrontab = (value, column, record, rowIndex, field) =
|
|
|
21
10
|
catch (e) {
|
|
22
11
|
console.error(e);
|
|
23
12
|
}
|
|
24
|
-
return html `<span
|
|
13
|
+
return html `<span data-reactive-tooltip>${text}</span>`;
|
|
25
14
|
};
|
|
26
15
|
//# sourceMappingURL=ox-grist-renderer-crontab.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-renderer-crontab.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-renderer-crontab.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-grist-renderer-crontab.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-renderer-crontab.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,gBAAgB,CAAA;AACtC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAI1B,MAAM,CAAC,MAAM,sBAAsB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC9F,IAAI,IAAI,GAAG,EAAE,CAAA;IAEb,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAC3D,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAA;IAC9E,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC;IAED,OAAO,IAAI,CAAA,+BAA+B,IAAI,SAAS,CAAA;AACzD,CAAC,CAAA","sourcesContent":["import cronstrue from 'cronstrue/i18n'\nimport i18next from 'i18next'\nimport { html } from 'lit'\n\nimport { FieldRenderer } from '@operato/data-grist'\n\nexport const OxGristRendererCrontab: FieldRenderer = (value, column, record, rowIndex, field) => {\n let text = ''\n\n try {\n const language = (i18next.language || 'en').substring(0, 2)\n text = !value ? '' : cronstrue.toString(value, { locale: language || 'en' })\n } catch (e) {\n console.error(e)\n }\n\n return html`<span data-reactive-tooltip>${text}</span>`\n}\n"]}
|
|
@@ -4,7 +4,6 @@ import { css, html } from 'lit';
|
|
|
4
4
|
import { client, gqlContext } from '@operato/graphql';
|
|
5
5
|
import { customElement } from 'lit/decorators.js';
|
|
6
6
|
import { OxGristRenderer } from '@operato/data-grist';
|
|
7
|
-
import { detectOverflow } from '@operato/utils';
|
|
8
7
|
const FETCH_COMMON_CODE_GQL = (codeName) => gql `
|
|
9
8
|
{
|
|
10
9
|
commonCode(name: "${codeName}") {
|
|
@@ -16,16 +15,6 @@ const FETCH_COMMON_CODE_GQL = (codeName) => gql `
|
|
|
16
15
|
}
|
|
17
16
|
}
|
|
18
17
|
`;
|
|
19
|
-
function onmouseover(e) {
|
|
20
|
-
const element = e.target;
|
|
21
|
-
if (detectOverflow(element)) {
|
|
22
|
-
element.setAttribute('data-tooltip', element.textContent);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
function onmouseout(e) {
|
|
26
|
-
const element = e.target;
|
|
27
|
-
element.removeAttribute('data-tooltip');
|
|
28
|
-
}
|
|
29
18
|
let OxGristRendererResourceCode = class OxGristRendererResourceCode extends OxGristRenderer {
|
|
30
19
|
async connectedCallback() {
|
|
31
20
|
var _a;
|
|
@@ -52,13 +41,13 @@ let OxGristRendererResourceCode = class OxGristRendererResourceCode extends OxGr
|
|
|
52
41
|
for (let idx = 0; idx < codes.length; idx++) {
|
|
53
42
|
let code = codes[idx];
|
|
54
43
|
if (code.name == this.value) {
|
|
55
|
-
return html `<span
|
|
44
|
+
return html `<span data-reactive-tooltip
|
|
56
45
|
>${code.name == '' ? '' : renderDispOpt.replace('name', code.description).replace('code', code.name)}</span
|
|
57
46
|
> `;
|
|
58
47
|
}
|
|
59
48
|
}
|
|
60
49
|
}
|
|
61
|
-
return html `<span
|
|
50
|
+
return html `<span data-reactive-tooltip>${this.value}</span> `;
|
|
62
51
|
}
|
|
63
52
|
};
|
|
64
53
|
OxGristRendererResourceCode.styles = css `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-renderer-resource-code.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-renderer-resource-code.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-grist-renderer-resource-code.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-renderer-resource-code.ts"],"names":[],"mappings":";AAAA,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAQrD,MAAM,qBAAqB,GAAG,CAAC,QAAgB,EAAE,EAAE,CAAC,GAAG,CAAA;;sBAEjC,QAAQ;;;;;;;;CAQ7B,CAAA;AAGM,IAAM,2BAA2B,GAAjC,MAAM,2BAA4B,SAAQ,eAAe;IAgB9D,KAAK,CAAC,iBAAiB;;QACrB,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAA;QAElD,IAAI,CAAC,KAAK,IAAI,QAAQ,EAAE,CAAC;YACvB,2DAA2D;YAC3D,IAAI,QAAQ,GAAG,MAAM,MAAM,CAAC,KAAK,CAAC;gBAChC,KAAK,EAAE,qBAAqB,CAAC,QAAQ,CAAC;gBACtC,OAAO,EAAE,UAAU,EAAE;aACtB,CAAC,CAAA;YAEF,IAAI,UAAU,GAAG,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,IAAI,0CAAE,UAAU,CAAA;YAE3C,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,GAAG,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,WAAW,EAAE,EAAE,EAAE,CAAC,CAAC,MAAM,CAC/D,CAAC,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,KAAI,EAAE,CAAC,CAAC,IAAI,CAAC,UAAU,CAAmB,EAAE,CAAmB;gBACjF,OAAO,CAAC,CAAC,IAAI,GAAG,CAAC,CAAC,IAAI,CAAA;YACxB,CAAC,CAAC,CACH,CAAA;QACH,CAAC;QAED,KAAK,CAAC,iBAAiB,EAAE,CAAA;IAC3B,CAAC;IAED,IAAI,gBAAgB;QAClB,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC;YAChB,OAAO,IAAI,CAAA,EAAE,CAAA;QACf,CAAC;QAED,IAAI,EAAE,KAAK,EAAE,aAAa,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,MAAM,CAAC,MAAM,IAAI,EAAE,CAAA;QAEhE,IAAI,KAAK,EAAE,CAAC;YACV,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE,GAAG,GAAG,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC;gBAC5C,IAAI,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAA;gBAErB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,CAAC;oBAC5B,OAAO,IAAI,CAAA;eACN,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC;aACnG,CAAA;gBACL,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,IAAI,CAAA,+BAA+B,IAAI,CAAC,KAAK,UAAU,CAAA;IAChE,CAAC;;AAzDM,kCAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;GAalB,AAbY,CAaZ;AAdU,2BAA2B;IADvC,aAAa,CAAC,iCAAiC,CAAC;GACpC,2BAA2B,CA2DvC","sourcesContent":["import gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { client, gqlContext } from '@operato/graphql'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristRenderer } from '@operato/data-grist'\n\ntype CommonCodeDetail = {\n name: string\n description: string\n rank: number\n}\n\nconst FETCH_COMMON_CODE_GQL = (codeName: string) => gql`\n{\n commonCode(name: \"${codeName}\") {\n details {\n name\n description\n rank\n }\n }\n}\n`\n\n@customElement('ox-grist-renderer-resource-code')\nexport class OxGristRendererResourceCode extends OxGristRenderer {\n static styles = css`\n :host {\n display: block;\n position: relative;\n\n width: 100%;\n }\n\n span {\n text-overflow: ellipsis;\n display: block;\n overflow: hidden;\n }\n `\n\n async connectedCallback() {\n var { codeName, codes } = this.column.record || {}\n\n if (!codes && codeName) {\n /* codeName으로 fetch 해와서, this.column.record.codes에 보관한다. */\n let response = await client.query({\n query: FETCH_COMMON_CODE_GQL(codeName),\n context: gqlContext()\n })\n\n var commonCode = response?.data?.commonCode\n\n this.column.record.codes = [{ name: '', description: '' }].concat(\n (commonCode?.details || []).sort(function (a: CommonCodeDetail, b: CommonCodeDetail) {\n return a.rank - b.rank\n })\n )\n }\n\n super.connectedCallback()\n }\n\n get rendererTemplate() {\n if (!this.value) {\n return html``\n }\n\n var { codes, renderDispOpt = 'name' } = this.column.record || {}\n\n if (codes) {\n for (let idx = 0; idx < codes.length; idx++) {\n let code = codes[idx]\n\n if (code.name == this.value) {\n return html`<span data-reactive-tooltip\n >${code.name == '' ? '' : renderDispOpt.replace('name', code.description).replace('code', code.name)}</span\n > `\n }\n }\n }\n\n return html`<span data-reactive-tooltip>${this.value}</span> `\n }\n}\n"]}
|