@operato/help 0.3.22

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.
Files changed (49) hide show
  1. package/.editorconfig +29 -0
  2. package/.storybook/main.js +3 -0
  3. package/.storybook/server.mjs +8 -0
  4. package/CHANGELOG.md +260 -0
  5. package/LICENSE +21 -0
  6. package/README.md +75 -0
  7. package/demo/index.html +32 -0
  8. package/dist/src/components/ox-help-icon.d.ts +7 -0
  9. package/dist/src/components/ox-help-icon.js +35 -0
  10. package/dist/src/components/ox-help-icon.js.map +1 -0
  11. package/dist/src/components/ox-inline-help.d.ts +8 -0
  12. package/dist/src/components/ox-inline-help.js +32 -0
  13. package/dist/src/components/ox-inline-help.js.map +1 -0
  14. package/dist/src/components/ox-title-with-help.d.ts +10 -0
  15. package/dist/src/components/ox-title-with-help.js +40 -0
  16. package/dist/src/components/ox-title-with-help.js.map +1 -0
  17. package/dist/src/controller/help.d.ts +2 -0
  18. package/dist/src/controller/help.js +12 -0
  19. package/dist/src/controller/help.js.map +1 -0
  20. package/dist/src/grist/help-decorated-renderer.d.ts +3 -0
  21. package/dist/src/grist/help-decorated-renderer.js +10 -0
  22. package/dist/src/grist/help-decorated-renderer.js.map +1 -0
  23. package/dist/src/help-style.d.ts +1 -0
  24. package/dist/src/help-style.js +122 -0
  25. package/dist/src/help-style.js.map +1 -0
  26. package/dist/src/index.d.ts +5 -0
  27. package/dist/src/index.js +6 -0
  28. package/dist/src/index.js.map +1 -0
  29. package/dist/src/pages/ox-help-home.d.ts +1 -0
  30. package/dist/src/pages/ox-help-home.js +123 -0
  31. package/dist/src/pages/ox-help-home.js.map +1 -0
  32. package/dist/src/viewparts/ox-help-panel.d.ts +2 -0
  33. package/dist/src/viewparts/ox-help-panel.js +214 -0
  34. package/dist/src/viewparts/ox-help-panel.js.map +1 -0
  35. package/dist/tsconfig.tsbuildinfo +1 -0
  36. package/package.json +84 -0
  37. package/src/components/ox-help-icon.ts +34 -0
  38. package/src/components/ox-inline-help.ts +29 -0
  39. package/src/components/ox-title-with-help.ts +39 -0
  40. package/src/controller/help.ts +13 -0
  41. package/src/grist/help-decorated-renderer.ts +19 -0
  42. package/src/help-style.ts +122 -0
  43. package/src/index.ts +5 -0
  44. package/src/pages/ox-help-home.ts +127 -0
  45. package/src/themes/help-theme.css +57 -0
  46. package/src/viewparts/ox-help-panel.ts +213 -0
  47. package/tsconfig.json +23 -0
  48. package/web-dev-server.config.mjs +27 -0
  49. package/web-test-runner.config.mjs +41 -0
package/.editorconfig ADDED
@@ -0,0 +1,29 @@
1
+ # EditorConfig helps developers define and maintain consistent
2
+ # coding styles between different editors and IDEs
3
+ # editorconfig.org
4
+
5
+ root = true
6
+
7
+
8
+ [*]
9
+
10
+ # Change these settings to your own preference
11
+ indent_style = space
12
+ indent_size = 2
13
+
14
+ # We recommend you to keep these unchanged
15
+ end_of_line = lf
16
+ charset = utf-8
17
+ trim_trailing_whitespace = true
18
+ insert_final_newline = true
19
+
20
+ [*.md]
21
+ trim_trailing_whitespace = false
22
+
23
+ [*.json]
24
+ indent_size = 2
25
+
26
+ [*.{html,js,md}]
27
+ block_comment_start = /**
28
+ block_comment = *
29
+ block_comment_end = */
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ stories: ['../dist/stories/**/*.stories.{js,md,mdx}'],
3
+ };
@@ -0,0 +1,8 @@
1
+ import { storybookPlugin } from '@web/dev-server-storybook';
2
+ import baseConfig from '../web-dev-server.config.mjs';
3
+
4
+ export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
5
+ ...baseConfig,
6
+ open: '/',
7
+ plugins: [storybookPlugin({ type: 'web-components' }), ...baseConfig.plugins],
8
+ });
package/CHANGELOG.md ADDED
@@ -0,0 +1,260 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+ See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
+
6
+ ### [0.3.22](https://github.com/hatiolab/operato/compare/v0.3.21...v0.3.22) (2022-01-30)
7
+
8
+
9
+ ### :rocket: New Features
10
+
11
+ * started help and layout module ([08f875c](https://github.com/hatiolab/operato/commit/08f875cd30aa914901c249c8c0b462ce4a151c23))
12
+
13
+
14
+
15
+ ### [0.3.21](https://github.com/hatiolab/operato/compare/v0.3.20...v0.3.21) (2022-01-29)
16
+
17
+
18
+ ### :rocket: New Features
19
+
20
+ * i18n module added, shell module started to cover client core part ([a976dad](https://github.com/hatiolab/operato/commit/a976dad6353962e489d8e648af9598b6a51e5ec7))
21
+
22
+
23
+
24
+ ### [0.3.20](https://github.com/hatiolab/operato/compare/v0.3.19...v0.3.20) (2022-01-28)
25
+
26
+ **Note:** Version bump only for package @operato/layout
27
+
28
+
29
+
30
+
31
+
32
+ ### [0.3.19](https://github.com/hatiolab/operato/compare/v0.3.18...v0.3.19) (2022-01-25)
33
+
34
+ **Note:** Version bump only for package @operato/layout
35
+
36
+
37
+
38
+
39
+
40
+ ### [0.3.18](https://github.com/hatiolab/operato/compare/v0.3.17...v0.3.18) (2022-01-23)
41
+
42
+ **Note:** Version bump only for package @operato/layout
43
+
44
+
45
+
46
+
47
+
48
+ ### [0.3.17](https://github.com/hatiolab/operato/compare/v0.3.16...v0.3.17) (2022-01-20)
49
+
50
+ **Note:** Version bump only for package @operato/layout
51
+
52
+
53
+
54
+
55
+
56
+ ### [0.3.16](https://github.com/hatiolab/operato/compare/v0.3.15...v0.3.16) (2022-01-19)
57
+
58
+ **Note:** Version bump only for package @operato/layout
59
+
60
+
61
+
62
+
63
+
64
+ ### [0.3.15](https://github.com/hatiolab/operato/compare/v0.3.14...v0.3.15) (2022-01-17)
65
+
66
+ **Note:** Version bump only for package @operato/layout
67
+
68
+
69
+
70
+
71
+
72
+ ### [0.3.14](https://github.com/hatiolab/operato/compare/v0.3.13...v0.3.14) (2022-01-16)
73
+
74
+ **Note:** Version bump only for package @operato/layout
75
+
76
+
77
+
78
+
79
+
80
+ ### [0.3.13](https://github.com/hatiolab/operato/compare/v0.3.12...v0.3.13) (2022-01-15)
81
+
82
+ **Note:** Version bump only for package @operato/layout
83
+
84
+
85
+
86
+
87
+
88
+ ### [0.3.12](https://github.com/hatiolab/operato/compare/v0.3.11...v0.3.12) (2022-01-15)
89
+
90
+ **Note:** Version bump only for package @operato/layout
91
+
92
+
93
+
94
+
95
+
96
+ ### [0.3.11](https://github.com/hatiolab/operato/compare/v0.3.10...v0.3.11) (2022-01-15)
97
+
98
+ **Note:** Version bump only for package @operato/layout
99
+
100
+
101
+
102
+
103
+
104
+ ### [0.3.10](https://github.com/hatiolab/operato/compare/v0.3.9...v0.3.10) (2022-01-15)
105
+
106
+
107
+ ### :bug: Bug Fix
108
+
109
+ * data-grist record-view ([aa71ec5](https://github.com/hatiolab/operato/commit/aa71ec5600f4dbccd05fcbc249445c73a41d2168))
110
+ * layout dependencies ([0d04aa7](https://github.com/hatiolab/operato/commit/0d04aa7c44566f5f69602c7df72664edb4f9e643))
111
+
112
+
113
+
114
+ ### [0.3.9](https://github.com/hatiolab/operato/compare/v0.3.8...v0.3.9) (2022-01-15)
115
+
116
+ **Note:** Version bump only for package @operato/layout
117
+
118
+
119
+
120
+
121
+
122
+ ### [0.3.8](https://github.com/hatiolab/operato/compare/v0.3.7...v0.3.8) (2022-01-14)
123
+
124
+ **Note:** Version bump only for package @operato/layout
125
+
126
+
127
+
128
+
129
+
130
+ ### [0.3.7](https://github.com/hatiolab/operato/compare/v0.3.6...v0.3.7) (2022-01-09)
131
+
132
+ **Note:** Version bump only for package @operato/layout
133
+
134
+
135
+
136
+
137
+
138
+ ### [0.3.6](https://github.com/hatiolab/operato/compare/v0.3.5...v0.3.6) (2022-01-09)
139
+
140
+ **Note:** Version bump only for package @operato/layout
141
+
142
+
143
+
144
+
145
+
146
+ ### [0.3.5](https://github.com/hatiolab/operato/compare/v0.3.4...v0.3.5) (2022-01-09)
147
+
148
+ **Note:** Version bump only for package @operato/layout
149
+
150
+
151
+
152
+
153
+
154
+ ### [0.3.4](https://github.com/hatiolab/operato/compare/v0.3.3...v0.3.4) (2022-01-03)
155
+
156
+ **Note:** Version bump only for package @operato/layout
157
+
158
+
159
+
160
+
161
+
162
+ ### [0.3.3](https://github.com/hatiolab/operato/compare/v0.3.2...v0.3.3) (2022-01-03)
163
+
164
+
165
+ ### :bug: Bug Fix
166
+
167
+ * apply import.meta.url into @operato/board ([1262fbe](https://github.com/hatiolab/operato/commit/1262fbec19798ac5fb0f1a430cabb48c9d8f3f35))
168
+
169
+
170
+
171
+ ### [0.3.2](https://github.com/hatiolab/operato/compare/v0.3.1...v0.3.2) (2022-01-03)
172
+
173
+ **Note:** Version bump only for package @operato/layout
174
+
175
+
176
+
177
+
178
+
179
+ ### [0.3.1](https://github.com/hatiolab/operato/compare/v0.3.0...v0.3.1) (2021-12-31)
180
+
181
+ **Note:** Version bump only for package @operato/layout
182
+
183
+
184
+
185
+
186
+
187
+ ## [0.3.0](https://github.com/hatiolab/operato/compare/v0.2.52...v0.3.0) (2021-12-31)
188
+
189
+
190
+ ### :rocket: New Features
191
+
192
+ * add tsconfig option useDefineForClassFields ([6291438](https://github.com/hatiolab/operato/commit/6291438571eee0f095064e7d2ada1c620832e092))
193
+
194
+
195
+
196
+ ### [0.2.52](https://github.com/hatiolab/operato/compare/v0.2.51...v0.2.52) (2021-12-21)
197
+
198
+
199
+ ### :bug: Bug Fix
200
+
201
+ * upgrade dependencies ([3fde5e7](https://github.com/hatiolab/operato/commit/3fde5e7182bb4b502103bcb70de2f1bfab2bc1ff))
202
+
203
+
204
+ ### :rocket: New Features
205
+
206
+ * add @operato/utils and @operato/attachment ([15a9c19](https://github.com/hatiolab/operato/commit/15a9c19ff1237738abd3e3509ba9ede90280b766))
207
+
208
+
209
+
210
+ ### [0.2.51](https://github.com/hatiolab/operato/compare/v0.2.50...v0.2.51) (2021-12-16)
211
+
212
+ **Note:** Version bump only for package @operato/layout
213
+
214
+
215
+
216
+
217
+
218
+ ### [0.2.50](https://github.com/hatiolab/operato/compare/v0.2.49...v0.2.50) (2021-12-16)
219
+
220
+ **Note:** Version bump only for package @operato/layout
221
+
222
+
223
+
224
+
225
+
226
+ ### [0.2.49](https://github.com/hatiolab/operato/compare/v0.2.48...v0.2.49) (2021-12-14)
227
+
228
+ **Note:** Version bump only for package @operato/layout
229
+
230
+
231
+
232
+
233
+
234
+ ### [0.2.48](https://github.com/hatiolab/operato/compare/v0.2.47...v0.2.48) (2021-12-14)
235
+
236
+ **Note:** Version bump only for package @operato/layout
237
+
238
+
239
+
240
+
241
+
242
+ ### [0.2.47](https://github.com/hatiolab/operato/compare/v0.2.46...v0.2.47) (2021-12-13)
243
+
244
+ **Note:** Version bump only for package @operato/layout
245
+
246
+
247
+
248
+
249
+
250
+ ### [0.2.46](https://github.com/hatiolab/operato/compare/v0.2.45...v0.2.46) (2021-12-12)
251
+
252
+
253
+ ### :rocket: New Features
254
+
255
+ * add layout and oops ([56737fa](https://github.com/hatiolab/operato/commit/56737fa117ed2135e279ca0f1e4c969daddf7b34))
256
+
257
+
258
+ ### :bug: Bug Fix
259
+
260
+ * set all module version to 0.2.45 ([40cea11](https://github.com/hatiolab/operato/commit/40cea11fab09ab3fb96bcd7db797abd13b23c216))
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) hatiolab.com
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # \<mini-layout>
2
+
3
+ This webcomponent follows the [open-wc](https://github.com/open-wc/open-wc) recommendation.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm i mini-layout
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ ```html
14
+ <script type="module">
15
+ import 'mini-layout/mini-layout.js'
16
+ </script>
17
+
18
+ <mini-layout></mini-layout>
19
+ ```
20
+
21
+ ## Linting and formatting
22
+
23
+ To scan the project for linting and formatting errors, run
24
+
25
+ ```bash
26
+ npm run lint
27
+ ```
28
+
29
+ To automatically fix linting and formatting errors, run
30
+
31
+ ```bash
32
+ npm run format
33
+ ```
34
+
35
+ ## Testing with Web Test Runner
36
+
37
+ To execute a single test run:
38
+
39
+ ```bash
40
+ npm run test
41
+ ```
42
+
43
+ To run the tests in interactive watch mode run:
44
+
45
+ ```bash
46
+ npm run test:watch
47
+ ```
48
+
49
+ ## Demoing with Storybook
50
+
51
+ To run a local instance of Storybook for your component, run
52
+
53
+ ```bash
54
+ npm run storybook
55
+ ```
56
+
57
+ To build a production version of Storybook, run
58
+
59
+ ```bash
60
+ npm run storybook:build
61
+ ```
62
+
63
+ ## Tooling configs
64
+
65
+ For most of the tools, the configuration is in the `package.json` to reduce the amount of files in your project.
66
+
67
+ If you customize the configuration a lot, you can consider moving them to individual files.
68
+
69
+ ## Local Demo with `web-dev-server`
70
+
71
+ ```bash
72
+ npm start
73
+ ```
74
+
75
+ To run a local development server that serves the basic demo located in `demo/index.html`
@@ -0,0 +1,32 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en-GB">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <style>
6
+ body {
7
+ background: #fafafa;
8
+ --ox-checkbox-size: 12px;
9
+ }
10
+
11
+ #demo {
12
+ position: relative;
13
+ height: 300px;
14
+ background-color: lightgray;
15
+ vertical-align: middle;
16
+ }
17
+ </style>
18
+ <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500" rel="stylesheet" />
19
+ <link href="https://fonts.googleapis.com/css?family=Material+Icons&display=block" rel="stylesheet" />
20
+ </head>
21
+ <body>
22
+ <div id="demo"></div>
23
+
24
+ <script type="module">
25
+ import { html, render } from 'lit'
26
+
27
+ const parent = document.querySelector('#demo')
28
+
29
+ render(html`clike anywhere in this box to utils mini.`, parent)
30
+ </script>
31
+ </body>
32
+ </html>
@@ -0,0 +1,7 @@
1
+ import '@material/mwc-icon';
2
+ import { LitElement } from 'lit';
3
+ export declare class HelpIcon extends LitElement {
4
+ static styles: import("lit").CSSResult;
5
+ topic: string;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ }
@@ -0,0 +1,35 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { openHelp } from '../controller/help.js';
6
+ let HelpIcon = class HelpIcon extends LitElement {
7
+ render() {
8
+ const topic = this.topic;
9
+ return html `${topic ? html `<mwc-icon @click=${() => openHelp(topic)}>help</mwc-icon>` : html ``}`;
10
+ }
11
+ };
12
+ HelpIcon.styles = css `
13
+ mwc-icon {
14
+ position: relative;
15
+ top: 4px;
16
+ cursor: help;
17
+ opacity: var(--help-icon-opacity);
18
+ color: var(--help-icon-color);
19
+ font-size: var(--help-icon-size);
20
+ line-height: 0;
21
+ }
22
+
23
+ mwc-icon:hover {
24
+ opacity: var(--help-icon-hover-opacity);
25
+ color: var(--help-icon-hover-color);
26
+ }
27
+ `;
28
+ __decorate([
29
+ property({ type: String })
30
+ ], HelpIcon.prototype, "topic", void 0);
31
+ HelpIcon = __decorate([
32
+ customElement('ox-help-icon')
33
+ ], HelpIcon);
34
+ export { HelpIcon };
35
+ //# sourceMappingURL=ox-help-icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-help-icon.js","sourceRoot":"","sources":["../../../src/components/ox-help-icon.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,IAAa,QAAQ,GAArB,MAAa,QAAS,SAAQ,UAAU;IAoBtC,MAAM;QACJ,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,OAAO,IAAI,CAAA,GAAG,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA,oBAAoB,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,EAAE,CAAA;IAClG,CAAC;CACF,CAAA;AAxBQ,eAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;GAelB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uCAAe;AAlB/B,QAAQ;IADpB,aAAa,CAAC,cAAc,CAAC;GACjB,QAAQ,CAyBpB;SAzBY,QAAQ","sourcesContent":["import '@material/mwc-icon'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { openHelp } from '../controller/help.js'\n\n@customElement('ox-help-icon')\nexport class HelpIcon extends LitElement {\n static styles = css`\n mwc-icon {\n position: relative;\n top: 4px;\n cursor: help;\n opacity: var(--help-icon-opacity);\n color: var(--help-icon-color);\n font-size: var(--help-icon-size);\n line-height: 0;\n }\n\n mwc-icon:hover {\n opacity: var(--help-icon-hover-opacity);\n color: var(--help-icon-hover-color);\n }\n `\n\n @property({ type: String }) topic!: string\n\n render() {\n const topic = this.topic\n\n return html`${topic ? html`<mwc-icon @click=${() => openHelp(topic)}>help</mwc-icon>` : html``}`\n }\n}\n"]}
@@ -0,0 +1,8 @@
1
+ import { LitElement } from 'lit';
2
+ export declare class InlineHelp extends LitElement {
3
+ static styles: import("lit").CSSResult;
4
+ topic: string;
5
+ type: string;
6
+ render(): import("lit-html").TemplateResult<1>;
7
+ connectedCallback(): void;
8
+ }
@@ -0,0 +1,32 @@
1
+ import { __decorate } from "tslib";
2
+ import { css, html, LitElement } from 'lit';
3
+ import { customElement, property } from 'lit/decorators.js';
4
+ import { openHelp } from '../controller/help.js';
5
+ let InlineHelp = class InlineHelp extends LitElement {
6
+ render() {
7
+ return html ` <slot></slot> `;
8
+ }
9
+ connectedCallback() {
10
+ super.connectedCallback();
11
+ this.renderRoot.addEventListener('click', e => {
12
+ openHelp(this.topic);
13
+ });
14
+ }
15
+ };
16
+ InlineHelp.styles = css `
17
+ :host {
18
+ display: flex;
19
+ align-items: center;
20
+ }
21
+ `;
22
+ __decorate([
23
+ property({ type: String })
24
+ ], InlineHelp.prototype, "topic", void 0);
25
+ __decorate([
26
+ property({ type: String })
27
+ ], InlineHelp.prototype, "type", void 0);
28
+ InlineHelp = __decorate([
29
+ customElement('ox-inline-help')
30
+ ], InlineHelp);
31
+ export { InlineHelp };
32
+ //# sourceMappingURL=ox-inline-help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-inline-help.js","sourceRoot":"","sources":["../../../src/components/ox-inline-help.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,IAAa,UAAU,GAAvB,MAAa,UAAW,SAAQ,UAAU;IAWxC,MAAM;QACJ,OAAO,IAAI,CAAA,iBAAiB,CAAA;IAC9B,CAAC;IAED,iBAAiB;QACf,KAAK,CAAC,iBAAiB,EAAE,CAAA;QAEzB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YAC5C,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACtB,CAAC,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AArBQ,iBAAM,GAAG,GAAG,CAAA;;;;;GAKlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;yCAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wCAAc;AAT9B,UAAU;IADtB,aAAa,CAAC,gBAAgB,CAAC;GACnB,UAAU,CAsBtB;SAtBY,UAAU","sourcesContent":["import { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { openHelp } from '../controller/help.js'\n\n@customElement('ox-inline-help')\nexport class InlineHelp extends LitElement {\n static styles = css`\n :host {\n display: flex;\n align-items: center;\n }\n `\n\n @property({ type: String }) topic!: string\n @property({ type: String }) type!: string\n\n render() {\n return html` <slot></slot> `\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.renderRoot.addEventListener('click', e => {\n openHelp(this.topic)\n })\n }\n}\n"]}
@@ -0,0 +1,10 @@
1
+ import '@material/mwc-icon';
2
+ import { LitElement } from 'lit';
3
+ declare const TitleWithHelp_base: (new (...args: any[]) => LitElement) & typeof LitElement;
4
+ export declare class TitleWithHelp extends TitleWithHelp_base {
5
+ static styles: import("lit").CSSResult;
6
+ msgid: string;
7
+ topic: string;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ }
10
+ export {};
@@ -0,0 +1,40 @@
1
+ import { __decorate } from "tslib";
2
+ import '@material/mwc-icon';
3
+ import { css, html, LitElement } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { i18next, localize } from '@operato/i18n';
6
+ import { openHelp } from '../controller/help.js';
7
+ let TitleWithHelp = class TitleWithHelp extends localize(i18next)(LitElement) {
8
+ render() {
9
+ const title = i18next.t(this.msgid);
10
+ const topic = this.topic;
11
+ return html ` ${title} ${topic ? html `<mwc-icon @click=${() => openHelp(topic)}>help</mwc-icon>` : html ``} `;
12
+ }
13
+ };
14
+ TitleWithHelp.styles = css `
15
+ mwc-icon {
16
+ position: relative;
17
+ top: 4px;
18
+ cursor: help;
19
+ opacity: var(--help-icon-opacity);
20
+ color: var(--help-icon-color);
21
+ font-size: var(--help-icon-size);
22
+ line-height: 0;
23
+ }
24
+ mwc-icon:hover {
25
+ opacity: var(--help-icon-hover-opacity);
26
+ color: var(--help-icon-hover-color);
27
+ }
28
+ `;
29
+ __decorate([
30
+ property({ type: String })
31
+ ], TitleWithHelp.prototype, "msgid", void 0);
32
+ __decorate([
33
+ property({ type: String })
34
+ ], TitleWithHelp.prototype, "topic", void 0);
35
+ TitleWithHelp = __decorate([
36
+ customElement('ox-title-with-help')
37
+ ], TitleWithHelp);
38
+ export { TitleWithHelp };
39
+ customElements.define('title-with-help', TitleWithHelp);
40
+ //# sourceMappingURL=ox-title-with-help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-title-with-help.js","sourceRoot":"","sources":["../../../src/components/ox-title-with-help.ts"],"names":[],"mappings":";AAAA,OAAO,oBAAoB,CAAA;AAE3B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAEjD,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAGhD,IAAa,aAAa,GAA1B,MAAa,aAAc,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAoB9D,MAAM;QACJ,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACnC,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,OAAO,IAAI,CAAA,IAAI,KAAK,IAAI,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA,oBAAoB,GAAG,EAAE,CAAC,QAAQ,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,IAAI,CAAA,EAAE,GAAG,CAAA;IAC7G,CAAC;CACF,CAAA;AAzBQ,oBAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;GAclB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4CAAe;AAlB/B,aAAa;IADzB,aAAa,CAAC,oBAAoB,CAAC;GACvB,aAAa,CA0BzB;SA1BY,aAAa;AA4B1B,cAAc,CAAC,MAAM,CAAC,iBAAiB,EAAE,aAAa,CAAC,CAAA","sourcesContent":["import '@material/mwc-icon'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\n\nimport { openHelp } from '../controller/help.js'\n\n@customElement('ox-title-with-help')\nexport class TitleWithHelp extends localize(i18next)(LitElement) {\n static styles = css`\n mwc-icon {\n position: relative;\n top: 4px;\n cursor: help;\n opacity: var(--help-icon-opacity);\n color: var(--help-icon-color);\n font-size: var(--help-icon-size);\n line-height: 0;\n }\n mwc-icon:hover {\n opacity: var(--help-icon-hover-opacity);\n color: var(--help-icon-hover-color);\n }\n `\n\n @property({ type: String }) msgid!: string\n @property({ type: String }) topic!: string\n\n render() {\n const title = i18next.t(this.msgid)\n const topic = this.topic\n\n return html` ${title} ${topic ? html`<mwc-icon @click=${() => openHelp(topic)}>help</mwc-icon>` : html``} `\n }\n}\n\ncustomElements.define('title-with-help', TitleWithHelp)\n"]}
@@ -0,0 +1,2 @@
1
+ export declare function openHelp(topic: string): void;
2
+ export declare function closeHelp(): void;
@@ -0,0 +1,12 @@
1
+ import { closeOverlay, openOverlay } from '@operato/layout';
2
+ export function openHelp(topic) {
3
+ openOverlay('help', {
4
+ templateProperties: {
5
+ topic
6
+ }
7
+ });
8
+ }
9
+ export function closeHelp() {
10
+ closeOverlay('help');
11
+ }
12
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../../src/controller/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE3D,MAAM,UAAU,QAAQ,CAAC,KAAa;IACpC,WAAW,CAAC,MAAM,EAAE;QAClB,kBAAkB,EAAE;YAClB,KAAK;SACN;KACF,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,UAAU,SAAS;IACvB,YAAY,CAAC,MAAM,CAAC,CAAA;AACtB,CAAC","sourcesContent":["import { closeOverlay, openOverlay } from '@operato/layout'\n\nexport function openHelp(topic: string) {\n openOverlay('help', {\n templateProperties: {\n topic\n }\n })\n}\n\nexport function closeHelp() {\n closeOverlay('help')\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import '../components/ox-help-icon.js';
2
+ import { FieldRenderer } from '@operato/data-grist';
3
+ export declare const HelpDecoratedRenderer: FieldRenderer;
@@ -0,0 +1,10 @@
1
+ import '../components/ox-help-icon.js';
2
+ import { html } from 'lit-html';
3
+ const decoratorTemplate = (topic) => html `<ox-help-icon style="flex: 0;" .topic=${topic}>help</help-icon>`;
4
+ export const HelpDecoratedRenderer = (value, column, record, rowIndex, field) => {
5
+ const { help } = column === null || column === void 0 ? void 0 : column.record;
6
+ const text = value === undefined ? '' : value;
7
+ const topic = help && help(value, column, record, rowIndex, field);
8
+ return topic ? html `${text}&nbsp;${decoratorTemplate(topic)}` : text;
9
+ };
10
+ //# sourceMappingURL=help-decorated-renderer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help-decorated-renderer.js","sourceRoot":"","sources":["../../../src/grist/help-decorated-renderer.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAQ/B,MAAM,iBAAiB,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,IAAI,CAAA,yCAAyC,KAAK,mBAAmB,CAAA;AAElH,MAAM,CAAC,MAAM,qBAAqB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC7F,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,MAA4B,CAAA;IACrD,MAAM,IAAI,GAAG,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAA;IAE7C,MAAM,KAAK,GAAG,IAAI,IAAI,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,CAAA;IAClE,OAAO,KAAK,CAAC,CAAC,CAAC,IAAI,CAAA,GAAG,IAAI,SAAS,iBAAiB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AACtE,CAAC,CAAA","sourcesContent":["import '../components/ox-help-icon.js'\n\nimport { html } from 'lit-html'\n\nimport { ColumnConfig, FieldRenderer, GristRecord } from '@operato/data-grist'\n\ninterface HelpExtendedRecord extends GristRecord {\n help?: (value: any, column: ColumnConfig, record: GristRecord, rowIndex: number, owner: any) => string\n}\n\nconst decoratorTemplate = (topic: string) => html`<ox-help-icon style=\"flex: 0;\" .topic=${topic}>help</help-icon>`\n\nexport const HelpDecoratedRenderer: FieldRenderer = (value, column, record, rowIndex, field) => {\n const { help } = column?.record as HelpExtendedRecord\n const text = value === undefined ? '' : value\n\n const topic = help && help(value, column, record, rowIndex, field)\n return topic ? html`${text}&nbsp;${decoratorTemplate(topic)}` : text\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare const HelpStyle: import("lit").CSSResult;