@operato/grist-editor 8.0.0-beta.0 β†’ 8.0.0-beta.2

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 (36) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/package.json +9 -9
  3. package/.storybook/main.js +0 -3
  4. package/.storybook/preview.js +0 -52
  5. package/.storybook/server.mjs +0 -8
  6. package/src/index.ts +0 -40
  7. package/src/ox-grist-editor-crontab.ts +0 -63
  8. package/src/ox-grist-editor-duration.ts +0 -63
  9. package/src/ox-grist-editor-hashtags.ts +0 -68
  10. package/src/ox-grist-editor-i18n-label.ts +0 -101
  11. package/src/ox-grist-editor-parameters.ts +0 -100
  12. package/src/ox-grist-editor-partition-keys.ts +0 -88
  13. package/src/ox-grist-editor-quantifier.ts +0 -13
  14. package/src/ox-grist-editor-signature.ts +0 -13
  15. package/src/ox-grist-editor-value-map.ts +0 -97
  16. package/src/ox-grist-editor-value-ranges.ts +0 -96
  17. package/src/ox-grist-renderer-crontab.ts +0 -18
  18. package/src/ox-grist-renderer-duration.ts +0 -31
  19. package/src/ox-grist-renderer-hashtags.ts +0 -13
  20. package/src/ox-grist-renderer-i18n-label.ts +0 -12
  21. package/src/ox-grist-renderer-partition-keys.ts +0 -29
  22. package/src/ox-grist-renderer-quantifier.ts +0 -9
  23. package/src/ox-grist-renderer-signature.ts +0 -9
  24. package/src/ox-parameters-builder.ts +0 -134
  25. package/src/ox-popup-crontab-input.ts +0 -75
  26. package/src/ox-popup-duration-input.ts +0 -65
  27. package/src/ox-popup-hashtags-input.ts +0 -66
  28. package/src/ox-popup-i18n-label-input.ts +0 -98
  29. package/src/ox-popup-parameters-builder.ts +0 -112
  30. package/src/ox-popup-partition-keys-input.ts +0 -97
  31. package/src/ox-popup-value-map-input.ts +0 -105
  32. package/src/ox-popup-value-ranges-input.ts +0 -104
  33. package/stories/ox-grist-editor-crontab.stories.ts +0 -451
  34. package/tsconfig.json +0 -24
  35. package/web-dev-server.config.mjs +0 -28
  36. package/web-test-runner.config.mjs +0 -29
package/CHANGELOG.md CHANGED
@@ -3,6 +3,24 @@
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
+ ## [8.0.0-beta.2](https://github.com/hatiolab/operato/compare/v8.0.0-beta.1...v8.0.0-beta.2) (2025-01-08)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * typo .npmignore ([d9c0c8c](https://github.com/hatiolab/operato/commit/d9c0c8c79abc688c3c2cfb6c37fcb689483a5977))
12
+
13
+
14
+
15
+ ## [8.0.0-beta.1](https://github.com/hatiolab/operato/compare/v8.0.0-beta.0...v8.0.0-beta.1) (2025-01-08)
16
+
17
+
18
+ ### :bug: Bug Fix
19
+
20
+ * missing .npmignore ([be05985](https://github.com/hatiolab/operato/commit/be05985abfae4af53501f718dd52932099f7fbcb))
21
+
22
+
23
+
6
24
  ## [8.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.56...v8.0.0-beta.0) (2025-01-07)
7
25
 
8
26
  **Note:** Version bump only for package @operato/grist-editor
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@operato/grist-editor",
3
- "version": "8.0.0-beta.0",
3
+ "version": "8.0.0-beta.2",
4
4
  "description": "Webcomponent for grist-editor following open-wc recommendations",
5
5
  "author": "heartyoh",
6
6
  "main": "dist/src/index.js",
@@ -110,13 +110,13 @@
110
110
  },
111
111
  "dependencies": {
112
112
  "@material/web": "^2.0.0",
113
- "@operato/data-grist": "^8.0.0-beta.0",
114
- "@operato/help": "^8.0.0-beta.0",
115
- "@operato/i18n": "^8.0.0-beta.0",
116
- "@operato/input": "^8.0.0-beta.0",
117
- "@operato/popup": "^8.0.0-beta.0",
118
- "@operato/property-editor": "^8.0.0-beta.0",
119
- "@operato/styles": "^8.0.0-beta.0",
113
+ "@operato/data-grist": "^8.0.0-beta.2",
114
+ "@operato/help": "^8.0.0-beta.2",
115
+ "@operato/i18n": "^8.0.0-beta.2",
116
+ "@operato/input": "^8.0.0-beta.2",
117
+ "@operato/popup": "^8.0.0-beta.2",
118
+ "@operato/property-editor": "^8.0.0-beta.2",
119
+ "@operato/styles": "^8.0.0-beta.2",
120
120
  "cronstrue": "^2.2.0",
121
121
  "cross-fetch": "^3.1.5",
122
122
  "lit": "^3.1.2",
@@ -156,5 +156,5 @@
156
156
  "prettier --write"
157
157
  ]
158
158
  },
159
- "gitHead": "c4e9cc245659d050a9ffd66542083a6daad4bcb9"
159
+ "gitHead": "ee1b5124995accb99272d3b5854f3df1d8746dda"
160
160
  }
@@ -1,3 +0,0 @@
1
- module.exports = {
2
- stories: ['../dist/stories/**/*.stories.{js,md,mdx}']
3
- }
@@ -1,52 +0,0 @@
1
- import { i18next } from '@operato/i18n'
2
-
3
- export const globalTypes = {
4
- locale: {
5
- name: 'Locale',
6
- description: 'Internationalization locale',
7
- toolbar: {
8
- icon: 'globe',
9
- items: [
10
- { value: 'en', right: 'πŸ‡ΊπŸ‡Έ', title: 'English' },
11
- { value: 'ko', right: 'πŸ‡°πŸ‡·', title: 'ν•œκ΅­μ–΄' },
12
- { value: 'zh', right: 'πŸ‡¨πŸ‡³', title: 'δΈ­ζ–‡' },
13
- { value: 'ja', right: 'πŸ‡―πŸ‡΅', title: 'ζ—₯本θͺž' },
14
- { value: 'ms', right: 'πŸ‡²πŸ‡Ύ', title: 'Bahasa Melayu' }
15
- ],
16
- showName: true
17
- }
18
- },
19
- theme: {
20
- name: 'Theme',
21
- description: 'Global theme for components',
22
- toolbar: {
23
- icon: 'paintbrush',
24
- items: [
25
- { value: 'light', title: 'Light' },
26
- { value: 'dark', title: 'Dark' }
27
- ],
28
- showName: true
29
- }
30
- }
31
- }
32
-
33
- export const decorators = [
34
- (Story, context) => {
35
- const { locale, theme } = context.globals
36
-
37
- if (locale) {
38
- i18next.changeLanguage(locale)
39
- }
40
-
41
- // Set the theme class for the document
42
- if (theme === 'dark') {
43
- document.documentElement.classList.add('dark')
44
- document.documentElement.classList.remove('light')
45
- } else {
46
- document.documentElement.classList.add('light')
47
- document.documentElement.classList.remove('dark')
48
- }
49
-
50
- return Story()
51
- }
52
- ]
@@ -1,8 +0,0 @@
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/src/index.ts DELETED
@@ -1,40 +0,0 @@
1
- import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
2
-
3
- import { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'
4
- import { OxGristEditorDuration } from './ox-grist-editor-duration.js'
5
- import { OxGristEditorHashtags } from './ox-grist-editor-hashtags.js'
6
- import { OxGristEditorParameters } from './ox-grist-editor-parameters.js'
7
- import { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'
8
- import { OxGristEditorQuantifier } from './ox-grist-editor-quantifier.js'
9
- import { OxGristEditorValueMap } from './ox-grist-editor-value-map.js'
10
- import { OxGristRendererDuration } from './ox-grist-renderer-duration.js'
11
- import { OxGristRendererQuantifier } from './ox-grist-renderer-quantifier'
12
- import { OxGristRendererHashtags } from './ox-grist-renderer-hashtags'
13
- import { OxGristRendererPartitionKeys } from './ox-grist-renderer-partition-keys.js'
14
- import { OxGristEditorValueRanges } from './ox-grist-editor-value-ranges.js'
15
- import { OxGristEditorI18nLabel } from './ox-grist-editor-i18n-label.js'
16
- import { OxGristRendererI18nLabel } from './ox-grist-renderer-i18n-label.js'
17
- import { OxGristRendererSignature } from './ox-grist-renderer-signature.js'
18
- import { OxGristEditorSignature } from './ox-grist-editor-signature.js'
19
-
20
- /* register grist renderer/editor for id */
21
- registerEditor('parameters', OxGristEditorParameters)
22
- registerEditor('value-map', OxGristEditorValueMap)
23
- registerEditor('value-ranges', OxGristEditorValueRanges)
24
- registerEditor('partition-keys', OxGristEditorPartitionKeys)
25
- registerEditor('crontab', OxGristEditorCrontab)
26
- registerEditor('duration', OxGristEditorDuration)
27
- registerEditor('quantifier', OxGristEditorQuantifier)
28
- registerEditor('hashtags', OxGristEditorHashtags)
29
- registerEditor('i18n-label', OxGristEditorI18nLabel)
30
- registerEditor('signature', OxGristEditorSignature)
31
-
32
- registerRenderer('parameters', OxGristRendererJson5)
33
- registerRenderer('value-map', OxGristRendererJson5)
34
- registerRenderer('value-ranges', OxGristRendererJson5)
35
- registerRenderer('partition-keys', OxGristRendererPartitionKeys)
36
- registerRenderer('duration', OxGristRendererDuration)
37
- registerRenderer('quantifier', OxGristRendererQuantifier)
38
- registerRenderer('hashtags', OxGristRendererHashtags)
39
- registerRenderer('i18n-label', OxGristRendererI18nLabel)
40
- registerRenderer('signature', OxGristRendererSignature)
@@ -1,63 +0,0 @@
1
- import './ox-popup-crontab-input.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
-
6
- import { OxGristEditor } from '@operato/data-grist'
7
- import { i18next } from '@operato/i18n'
8
- import { openPopup, PopupHandle } from '@operato/popup'
9
-
10
- @customElement('ox-grist-editor-crontab')
11
- export class OxGristEditorCrontab extends OxGristEditor {
12
- private popup?: PopupHandle
13
-
14
- get editorTemplate() {
15
- return html` <div tabindex="0">${this.value || ''}</div> `
16
- }
17
-
18
- _onclick(e: Event): void {
19
- e.stopPropagation()
20
- this.showEditorPopup()
21
- }
22
-
23
- _onkeydown(e: KeyboardEvent): void {
24
- const key = e.key
25
- if (key == 'Enter') {
26
- e.stopPropagation()
27
- this.showEditorPopup()
28
- }
29
- }
30
-
31
- showEditorPopup() {
32
- if (this.popup) {
33
- delete this.popup
34
- }
35
-
36
- const confirmCallback = (newval: any) => {
37
- this.dispatchEvent(
38
- new CustomEvent('field-change', {
39
- bubbles: true,
40
- composed: true,
41
- detail: {
42
- before: this.value,
43
- after: newval,
44
- record: this.record,
45
- column: this.column,
46
- row: this.row
47
- }
48
- })
49
- )
50
- }
51
-
52
- this.popup = openPopup(
53
- html`
54
- <ox-popup-crontab-input .value=${this.value} .confirmCallback=${confirmCallback}></ox-popup-crontab-input>
55
- `,
56
- {
57
- backdrop: true,
58
- title: i18next.t('title.setting schedule'),
59
- help: 'data-grist/grist-editor/crontab'
60
- }
61
- )
62
- }
63
- }
@@ -1,63 +0,0 @@
1
- import './ox-popup-duration-input.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
-
6
- import { OxGristEditor } from '@operato/data-grist'
7
- import { i18next } from '@operato/i18n'
8
- import { openPopup, PopupHandle } from '@operato/popup'
9
-
10
- @customElement('ox-grist-editor-duration')
11
- export class OxGristEditorDuration extends OxGristEditor {
12
- private popup?: PopupHandle
13
-
14
- get editorTemplate() {
15
- return html` <div tabindex="0">${this.value || ''}</div> `
16
- }
17
-
18
- _onclick(e: Event): void {
19
- e.stopPropagation()
20
- this.showEditorPopup()
21
- }
22
-
23
- _onkeydown(e: KeyboardEvent): void {
24
- const key = e.key
25
- if (key == 'Enter') {
26
- e.stopPropagation()
27
- this.showEditorPopup()
28
- }
29
- }
30
-
31
- showEditorPopup() {
32
- if (this.popup) {
33
- delete this.popup
34
- }
35
-
36
- const confirmCallback = (newval: any) => {
37
- this.dispatchEvent(
38
- new CustomEvent('field-change', {
39
- bubbles: true,
40
- composed: true,
41
- detail: {
42
- before: this.value,
43
- after: newval,
44
- record: this.record,
45
- column: this.column,
46
- row: this.row
47
- }
48
- })
49
- )
50
- }
51
-
52
- this.popup = openPopup(
53
- html`
54
- <ox-popup-duration-input .value=${this.value} .confirmCallback=${confirmCallback}></ox-popup-duration-input>
55
- `,
56
- {
57
- backdrop: true,
58
- title: i18next.t('title.edit duration'),
59
- help: 'data-grist/grist-editor/duration'
60
- }
61
- )
62
- }
63
- }
@@ -1,68 +0,0 @@
1
- import './ox-popup-hashtags-input.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
-
6
- import { OxGristEditor } from '@operato/data-grist'
7
- import { i18next } from '@operato/i18n'
8
- import { openPopup, PopupHandle } from '@operato/popup'
9
-
10
- @customElement('ox-grist-editor-hashtags')
11
- export class OxGristEditorHashtags extends OxGristEditor {
12
- private popup?: PopupHandle
13
-
14
- get editorTemplate() {
15
- const value = this.value
16
-
17
- return html`
18
- <div tabindex="0">
19
- ${value && value.length > 0 ? (value as string[]).map(x => `#${x}`).join(' ') : '\u00A0' /* &nbsp; */}
20
- </div>
21
- `
22
- }
23
-
24
- _onclick(e: Event): void {
25
- e.stopPropagation()
26
- this.showEditorPopup()
27
- }
28
-
29
- _onkeydown(e: KeyboardEvent): void {
30
- const key = e.key
31
- if (key == 'Enter') {
32
- e.stopPropagation()
33
- this.showEditorPopup()
34
- }
35
- }
36
-
37
- showEditorPopup() {
38
- if (this.popup) {
39
- delete this.popup
40
- }
41
-
42
- const confirmCallback = (newval: any) => {
43
- this.dispatchEvent(
44
- new CustomEvent('field-change', {
45
- bubbles: true,
46
- composed: true,
47
- detail: {
48
- before: this.value,
49
- after: newval,
50
- record: this.record,
51
- column: this.column,
52
- row: this.row
53
- }
54
- })
55
- )
56
- }
57
-
58
- const value = Array.isArray(this.value) ? [...this.value] : []
59
-
60
- this.popup = openPopup(
61
- html` <ox-popup-hashtags-input .value=${value} .confirmCallback=${confirmCallback}></ox-popup-hashtags-input> `,
62
- {
63
- backdrop: true,
64
- title: i18next.t('title.edit hashtags')
65
- }
66
- )
67
- }
68
- }
@@ -1,101 +0,0 @@
1
- /**
2
- * @license Copyright Β© HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import './ox-popup-i18n-label-input.js'
6
-
7
- import { html } from 'lit'
8
- import { customElement } from 'lit/decorators.js'
9
- import json5 from 'json5'
10
-
11
- import { cloneDeep } from 'lodash-es'
12
-
13
- import { OxGristEditor } from '@operato/data-grist'
14
- import { i18next } from '@operato/i18n'
15
- import { openPopup, PopupHandle } from '@operato/popup'
16
-
17
- @customElement('ox-grist-editor-i18n-label')
18
- export class OxGristEditorI18nLabel extends OxGristEditor {
19
- private popup?: PopupHandle
20
-
21
- get options() {
22
- return this.column.record?.options || {}
23
- }
24
-
25
- get editorTemplate() {
26
- const { displayColumn } = this.column.record.options || {}
27
-
28
- const value =
29
- this.value && typeof this.value === 'object'
30
- ? this.value[i18next.language || 'en-US']
31
- : displayColumn
32
- ? this.record[displayColumn]
33
- : ''
34
-
35
- return html`<div tabindex="0">${value || ''}</div>`
36
- }
37
-
38
- _onclick(e: Event): void {
39
- e.stopPropagation()
40
- this.openSelector()
41
- }
42
-
43
- _onkeydown(e: KeyboardEvent): void {
44
- const key = e.key
45
- if (key == 'Enter') {
46
- e.stopPropagation()
47
- this.openSelector()
48
- }
49
- }
50
-
51
- async openSelector() {
52
- if (this.popup) {
53
- delete this.popup
54
- }
55
-
56
- const { name, help, languages, objectified = false } = this.options || {}
57
-
58
- const confirmCallback = (newval: any) => {
59
- this.dispatchEvent(
60
- new CustomEvent('field-change', {
61
- bubbles: true,
62
- composed: true,
63
- detail: {
64
- before: this.value,
65
- after: !objectified ? JSON.stringify(newval) : newval,
66
- record: this.record,
67
- column: this.column,
68
- row: this.row
69
- }
70
- })
71
- )
72
- }
73
-
74
- try {
75
- var value: any =
76
- !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})
77
- } catch (e) {
78
- var value: any = {}
79
- }
80
-
81
- /*
82
- 주의 : 이 νŒμ—… ν…œν”Œλ¦Ώμ€ layout λͺ¨λ“ˆμ— μ˜ν•΄μ„œ render λ˜λ―€λ‘œ,
83
- layout의 ꡬ성에 λ³€ν™”κ°€ λ°œμƒν•˜λ©΄, λ‹€μ‹œ renderλœλ‹€.
84
- 이 νŒμ—…μ΄ λ–  μžˆλŠ” μƒνƒœμ—μ„œ, 또 λ‹€λ₯Έ νŒμ—…μ΄ λœ¨λŠ” κ²½μš°λ„ layout κ΅¬μ„±μ˜ λ³€ν™”λ₯Ό μ•ΌκΈ°ν•œλ‹€. (overlay의 갯수의 증가)
85
- 이 경우 value, options, confirmCallback λ“± 클둜져λ₯Ό μ‚¬μš©ν•œ 것듀이 초기 λ°”μΈλ”©λœ κ°’μœΌλ‘œ λ‹€μ‹œ λ°”μΈλ”©λ˜κ²Œ λ˜λŠ”λ°,
86
- λ§Œμ•½, ν…œν”Œλ¦Ώ λ‚΄λΆ€μ—μ„œ 이듀 μ†μ„±μ˜ λ ˆνΌλŸ°μŠ€κ°€ λ³€ν™”ν–ˆλ‹€λ©΄, μ›λž˜ μƒνƒœλ‘œ λ˜λŒμ•„κ°€λŠ” ν˜„μƒμ΄ λ°œμƒν•˜κ²Œ λœλ‹€.
87
- λ”°λΌμ„œ, 가급적 이듀 μ†μ„±μ˜ 레퍼런슀λ₯Ό λ³€ν™”μ‹œν‚€μ§€ μ•ŠλŠ” 것이 μ’‹λ‹€.
88
- */
89
- var template = html`
90
- <ox-popup-i18n-label-input .value=${value} .languages=${languages} .confirmCallback=${confirmCallback}>
91
- </ox-popup-i18n-label-input>
92
- `
93
-
94
- this.popup = openPopup(template, {
95
- backdrop: true,
96
- size: 'large',
97
- title: `${name?.toUpperCase() || i18next.t('title.i18n-label')} `,
98
- help
99
- })
100
- }
101
- }
@@ -1,100 +0,0 @@
1
- /**
2
- * @license Copyright Β© HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import './ox-parameters-builder.js'
6
- import './ox-popup-parameters-builder.js'
7
-
8
- import { html } from 'lit'
9
- import { customElement } from 'lit/decorators.js'
10
- import { cloneDeep } from 'lodash-es'
11
-
12
- import { OxGristEditor } from '@operato/data-grist'
13
- import { i18next } from '@operato/i18n'
14
- import { openPopup, PopupHandle } from '@operato/popup'
15
-
16
- @customElement('ox-grist-editor-parameters')
17
- export class OxGristEditorParameters extends OxGristEditor {
18
- private popup?: PopupHandle
19
-
20
- get editorTemplate() {
21
- const value = this.value && typeof this.value === 'object' ? JSON.stringify(this.value) : this.value
22
- return html` <div tabindex="0">${value || ''}</div> `
23
- }
24
-
25
- _onclick(e: Event): void {
26
- e.stopPropagation()
27
- this.openSelector()
28
- }
29
-
30
- _onkeydown(e: KeyboardEvent): void {
31
- const key = e.key
32
- if (key == 'Enter') {
33
- e.stopPropagation()
34
- this.openSelector()
35
- }
36
- }
37
-
38
- async openSelector() {
39
- if (this.popup) {
40
- delete this.popup
41
- }
42
-
43
- var { options } = this.column.record
44
-
45
- if (typeof options === 'function') {
46
- options = await options.call(this, this.value, this.column, this.record, this.row, this.field)
47
- }
48
-
49
- const { name, help, spec, context, objectified = false } = options
50
-
51
- const confirmCallback = (newval: any) => {
52
- this.dispatchEvent(
53
- new CustomEvent('field-change', {
54
- bubbles: true,
55
- composed: true,
56
- detail: {
57
- before: this.value,
58
- after: !objectified ? JSON.stringify(newval) : newval,
59
- record: this.record,
60
- column: this.column,
61
- row: this.row
62
- }
63
- })
64
- )
65
- }
66
-
67
- try {
68
- var value: any =
69
- !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})
70
- } catch (e) {
71
- var value: any = {}
72
- }
73
-
74
- /*
75
- 주의 : 이 νŒμ—… ν…œν”Œλ¦Ώμ€ layout λͺ¨λ“ˆμ— μ˜ν•΄μ„œ render λ˜λ―€λ‘œ,
76
- layout의 ꡬ성에 λ³€ν™”κ°€ λ°œμƒν•˜λ©΄, λ‹€μ‹œ renderλœλ‹€.
77
- 이 νŒμ—…μ΄ λ–  μžˆλŠ” μƒνƒœμ—μ„œ, 또 λ‹€λ₯Έ νŒμ—…μ΄ λœ¨λŠ” κ²½μš°λ„ layout κ΅¬μ„±μ˜ λ³€ν™”λ₯Ό μ•ΌκΈ°ν•œλ‹€. (overlay의 갯수의 증가)
78
- 이 경우 value, options, confirmCallback λ“± 클둜져λ₯Ό μ‚¬μš©ν•œ 것듀이 초기 λ°”μΈλ”©λœ κ°’μœΌλ‘œ λ‹€μ‹œ λ°”μΈλ”©λ˜κ²Œ λ˜λŠ”λ°,
79
- λ§Œμ•½, ν…œν”Œλ¦Ώ λ‚΄λΆ€μ—μ„œ 이듀 μ†μ„±μ˜ λ ˆνΌλŸ°μŠ€κ°€ λ³€ν™”ν–ˆλ‹€λ©΄, μ›λž˜ μƒνƒœλ‘œ λ˜λŒμ•„κ°€λŠ” ν˜„μƒμ΄ λ°œμƒν•˜κ²Œ λœλ‹€.
80
- λ”°λΌμ„œ, 가급적 이듀 μ†μ„±μ˜ 레퍼런슀λ₯Ό λ³€ν™”μ‹œν‚€μ§€ μ•ŠλŠ” 것이 μ’‹λ‹€.
81
- */
82
- var template = html`
83
- <ox-popup-parameters-builder
84
- .value=${value}
85
- .props=${spec}
86
- .host=${this.record}
87
- .context=${context}
88
- .confirmCallback=${confirmCallback}
89
- >
90
- </ox-popup-parameters-builder>
91
- `
92
-
93
- this.popup = openPopup(template, {
94
- backdrop: true,
95
- size: 'large',
96
- title: `${name?.toUpperCase() || ''} ${i18next.t('field.params')}`,
97
- help
98
- })
99
- }
100
- }
@@ -1,88 +0,0 @@
1
- /**
2
- * @license Copyright Β© HatioLab Inc. All rights reserved.
3
- */
4
-
5
- import './ox-popup-partition-keys-input.js'
6
-
7
- import { html } from 'lit'
8
- import { customElement } from 'lit/decorators.js'
9
- import { cloneDeep } from 'lodash-es'
10
-
11
- import { OxGristEditor } from '@operato/data-grist'
12
- import { i18next } from '@operato/i18n'
13
- import { openPopup, PopupHandle } from '@operato/popup'
14
-
15
- @customElement('ox-grist-editor-partition-keys')
16
- export class OxGristEditorPartitionKeys extends OxGristEditor {
17
- private popup?: PopupHandle
18
-
19
- get editorTemplate() {
20
- return this.value && this.value instanceof Array && this.value.length > 0
21
- ? html`<md-icon style="--md-icon-size:1.3em">key</md-icon>`
22
- : html``
23
- }
24
-
25
- _onclick(e: Event): void {
26
- e.stopPropagation()
27
- this.openSelector()
28
- }
29
-
30
- _onkeydown(e: KeyboardEvent): void {
31
- const key = e.key
32
- if (key == 'Enter') {
33
- e.stopPropagation()
34
- this.openSelector()
35
- }
36
- }
37
-
38
- async openSelector() {
39
- if (this.popup) {
40
- delete this.popup
41
- }
42
-
43
- const { name, help, objectified = false } = this.column.record?.options || {}
44
-
45
- const confirmCallback = (newval: any) => {
46
- this.dispatchEvent(
47
- new CustomEvent('field-change', {
48
- bubbles: true,
49
- composed: true,
50
- detail: {
51
- before: this.value,
52
- after: !objectified ? JSON.stringify(newval) : newval,
53
- record: this.record,
54
- column: this.column,
55
- row: this.row
56
- }
57
- })
58
- )
59
- }
60
-
61
- try {
62
- var value: any =
63
- !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})
64
- } catch (e) {
65
- var value: any = {}
66
- }
67
-
68
- /*
69
- 주의 : 이 νŒμ—… ν…œν”Œλ¦Ώμ€ layout λͺ¨λ“ˆμ— μ˜ν•΄μ„œ render λ˜λ―€λ‘œ,
70
- layout의 ꡬ성에 λ³€ν™”κ°€ λ°œμƒν•˜λ©΄, λ‹€μ‹œ renderλœλ‹€.
71
- 이 νŒμ—…μ΄ λ–  μžˆλŠ” μƒνƒœμ—μ„œ, 또 λ‹€λ₯Έ νŒμ—…μ΄ λœ¨λŠ” κ²½μš°λ„ layout κ΅¬μ„±μ˜ λ³€ν™”λ₯Ό μ•ΌκΈ°ν•œλ‹€. (overlay의 갯수의 증가)
72
- 이 경우 value, options, confirmCallback λ“± 클둜져λ₯Ό μ‚¬μš©ν•œ 것듀이 초기 λ°”μΈλ”©λœ κ°’μœΌλ‘œ λ‹€μ‹œ λ°”μΈλ”©λ˜κ²Œ λ˜λŠ”λ°,
73
- λ§Œμ•½, ν…œν”Œλ¦Ώ λ‚΄λΆ€μ—μ„œ 이듀 μ†μ„±μ˜ λ ˆνΌλŸ°μŠ€κ°€ λ³€ν™”ν–ˆλ‹€λ©΄, μ›λž˜ μƒνƒœλ‘œ λ˜λŒμ•„κ°€λŠ” ν˜„μƒμ΄ λ°œμƒν•˜κ²Œ λœλ‹€.
74
- λ”°λΌμ„œ, 가급적 이듀 μ†μ„±μ˜ 레퍼런슀λ₯Ό λ³€ν™”μ‹œν‚€μ§€ μ•ŠλŠ” 것이 μ’‹λ‹€.
75
- */
76
- var template = html`
77
- <ox-popup-partition-keys-input .value=${value} .confirmCallback=${confirmCallback}>
78
- </ox-popup-partition-keys-input>
79
- `
80
-
81
- this.popup = openPopup(template, {
82
- backdrop: true,
83
- size: 'large',
84
- title: `${name?.toUpperCase() || i18next.t('field.partition-keys')} `,
85
- help
86
- })
87
- }
88
- }
@@ -1,13 +0,0 @@
1
- import '@operato/input/ox-input-quantifier.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
-
6
- import { OxGristEditor } from '@operato/data-grist'
7
-
8
- @customElement('ox-grist-editor-quantifier')
9
- export class OxGristEditorQuantifier extends OxGristEditor {
10
- get editorTemplate() {
11
- return html` <ox-input-quantifier .value=${this.value}></ox-input-quantifier> `
12
- }
13
- }
@@ -1,13 +0,0 @@
1
- import '@operato/input/ox-input-signature.js'
2
-
3
- import { html } from 'lit'
4
- import { customElement } from 'lit/decorators.js'
5
-
6
- import { OxGristEditor } from '@operato/data-grist'
7
-
8
- @customElement('ox-grist-editor-signature')
9
- export class OxGristEditorSignature extends OxGristEditor {
10
- get editorTemplate() {
11
- return html` <ox-input-signature .value=${this.value}></ox-input-signature> `
12
- }
13
- }