@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
@@ -1,98 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/input/ox-input-i18n-label.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { i18next } from '@operato/i18n'
8
- import { closePopup } from '@operato/popup'
9
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
10
-
11
- @customElement('ox-popup-i18n-label-input')
12
- export class OxPopupValueMapInput extends LitElement {
13
- static styles = [
14
- CommonHeaderStyles,
15
- ScrollbarStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
-
21
- background-color: var(--md-sys-color-surface);
22
-
23
- width: var(--overlay-center-normal-width, 50%);
24
- height: var(--overlay-center-normal-height, 50%);
25
- }
26
-
27
- ox-input-i18n-label {
28
- flex: 1;
29
- overflow-y: auto;
30
- padding: var(--padding-default);
31
- }
32
-
33
- span {
34
- flex: 1;
35
-
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
-
40
- color: var(--md-sys-color-on-primary-container);
41
- }
42
- `
43
- ]
44
-
45
- @property({ type: Object }) value: any
46
- @property({ type: Array }) languages: { code: string; display: string }[] = []
47
- @property({ type: Object }) confirmCallback!: (newval: any) => void
48
-
49
- render() {
50
- return html`
51
- <ox-input-i18n-label .value=${this.value} .languages=${this.languages} @change=${this.onChange.bind(this)}>
52
- </ox-input-i18n-label>
53
-
54
- <div class="footer">
55
- <div filler></div>
56
- <button @click=${this.onCancel.bind(this)} danger>
57
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
58
- </button>
59
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
60
- </div>
61
- `
62
- }
63
-
64
- private onChange(e: CustomEvent) {
65
- e.stopPropagation()
66
-
67
- /*
68
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
69
- layout의 구성에 변화가 발생하면, 다시 render된다.
70
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
71
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
72
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
73
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
74
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
75
- =>
76
- 이런 이유로, Object.assign(...)을 사용하였다.
77
- */
78
-
79
- if (!this.value || typeof this.value !== 'object') {
80
- this.value = {}
81
- }
82
-
83
- for (let key in this.value) {
84
- delete this.value[key]
85
- }
86
-
87
- Object.assign(this.value, e.detail)
88
- }
89
-
90
- private onCancel(e: Event) {
91
- closePopup(this)
92
- }
93
-
94
- private onConfirm(e: Event) {
95
- this.confirmCallback && this.confirmCallback(this.value)
96
- closePopup(this)
97
- }
98
- }
@@ -1,112 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/i18n/ox-i18n.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { i18next } from '@operato/i18n'
8
- import { closePopup } from '@operato/popup'
9
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
10
-
11
- @customElement('ox-popup-parameters-builder')
12
- export class OxPopupParametersBuilder extends LitElement {
13
- static styles = [
14
- CommonHeaderStyles,
15
- ScrollbarStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
-
21
- background-color: var(--md-sys-color-surface);
22
-
23
- width: var(--overlay-center-normal-width, 50%);
24
- height: var(--overlay-center-normal-height, 50%);
25
- }
26
-
27
- ox-parameters-builder {
28
- flex: 1;
29
- overflow-y: auto;
30
-
31
- display: flex;
32
- flex-direction: column;
33
- }
34
-
35
- span {
36
- flex: 1;
37
-
38
- display: flex;
39
- align-items: center;
40
- justify-content: center;
41
-
42
- color: var(--md-sys-color-on-primary-container);
43
- }
44
- `
45
- ]
46
-
47
- @property({ type: Object }) value: any
48
- @property({ type: Object }) props: any
49
- @property({ type: Object }) host: any
50
- @property({ type: Object }) context: any
51
- @property({ type: Object }) confirmCallback!: (newval: any) => void
52
-
53
- render() {
54
- var props = this.props instanceof Array ? this.props : []
55
-
56
- return html`
57
- ${props.length > 0
58
- ? html`
59
- <ox-parameters-builder
60
- .value=${this.value}
61
- .props=${props}
62
- .host=${this.host}
63
- .context=${this.context}
64
- @property-change=${this.onChange.bind(this)}
65
- >
66
- </ox-parameters-builder>
67
- `
68
- : html` <span><ox-i18n msgid="text.no properties to set"></ox-i18n></span> `}
69
-
70
- <div class="footer">
71
- <div filler></div>
72
- <button @click=${this.onCancel.bind(this)} danger>
73
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
74
- </button>
75
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
76
- </div>
77
- `
78
- }
79
-
80
- private onChange(e: CustomEvent) {
81
- e.stopPropagation()
82
-
83
- /*
84
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
85
- layout의 구성에 변화가 발생하면, 다시 render된다.
86
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
87
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
88
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
89
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
90
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
91
- =>
92
- 이런 이유로, Object.assign(...)을 사용하였다.
93
- */
94
- if (!this.value) {
95
- this.value = {}
96
- }
97
-
98
- for (let key in this.value) {
99
- delete this.value[key]
100
- }
101
- Object.assign(this.value, e.detail)
102
- }
103
-
104
- private onCancel(e: Event) {
105
- closePopup(this)
106
- }
107
-
108
- private onConfirm(e: Event) {
109
- this.confirmCallback && this.confirmCallback(this.value)
110
- closePopup(this)
111
- }
112
- }
@@ -1,97 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/input/ox-input-partition-keys.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { i18next } from '@operato/i18n'
8
- import { closePopup } from '@operato/popup'
9
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
10
-
11
- @customElement('ox-popup-partition-keys-input')
12
- export class OxPopupPartitionKeysInput extends LitElement {
13
- static styles = [
14
- CommonHeaderStyles,
15
- ScrollbarStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
-
21
- background-color: var(--md-sys-color-surface);
22
-
23
- width: var(--overlay-center-normal-width, 50%);
24
- height: var(--overlay-center-normal-height, 50%);
25
- }
26
-
27
- ox-input-partition-keys {
28
- flex: 1;
29
- overflow-y: auto;
30
- padding: 10px;
31
- }
32
-
33
- span {
34
- flex: 1;
35
-
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
-
40
- color: var(--md-sys-color-on-primary-container);
41
- }
42
- `
43
- ]
44
-
45
- @property({ type: Object }) value: any
46
- @property({ type: String }) valuetype: string = 'string'
47
- @property({ type: Object }) confirmCallback!: (newval: any) => void
48
-
49
- render() {
50
- return html`
51
- <ox-input-partition-keys .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-partition-keys>
52
-
53
- <div class="footer">
54
- <div filler></div>
55
- <button @click=${this.onCancel.bind(this)} danger>
56
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
57
- </button>
58
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
59
- </div>
60
- `
61
- }
62
-
63
- private onChange(e: CustomEvent) {
64
- e.stopPropagation()
65
-
66
- /*
67
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
68
- layout의 구성에 변화가 발생하면, 다시 render된다.
69
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
70
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
71
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
72
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
73
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
74
- =>
75
- 이런 이유로, Object.assign(...)을 사용하였다.
76
- */
77
-
78
- if (!this.value || typeof this.value !== 'object') {
79
- this.value = {}
80
- }
81
-
82
- for (let key in this.value) {
83
- delete this.value[key]
84
- }
85
-
86
- Object.assign(this.value, e.detail)
87
- }
88
-
89
- private onCancel(e: Event) {
90
- closePopup(this)
91
- }
92
-
93
- private onConfirm(e: Event) {
94
- this.confirmCallback && this.confirmCallback(this.value)
95
- closePopup(this)
96
- }
97
- }
@@ -1,105 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
-
3
- import '@operato/input/ox-input-value-map.js'
4
-
5
- import { css, html, LitElement } from 'lit'
6
- import { customElement, property } from 'lit/decorators.js'
7
-
8
- import { i18next } from '@operato/i18n'
9
- import { closePopup } from '@operato/popup'
10
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
11
-
12
- @customElement('ox-popup-value-map-input')
13
- export class OxPopupValueMapInput extends LitElement {
14
- static styles = [
15
- CommonHeaderStyles,
16
- ScrollbarStyles,
17
- css`
18
- :host {
19
- display: flex;
20
- flex-direction: column;
21
-
22
- background-color: var(--md-sys-color-surface);
23
-
24
- width: var(--overlay-center-normal-width, 50%);
25
- height: var(--overlay-center-normal-height, 50%);
26
- }
27
-
28
- ox-input-value-map {
29
- flex: 1;
30
- overflow-y: auto;
31
- }
32
-
33
- span {
34
- flex: 1;
35
-
36
- display: flex;
37
- align-items: center;
38
- justify-content: center;
39
-
40
- color: var(--md-sys-color-on-primary-container);
41
- }
42
- `
43
- ]
44
-
45
- @property({ type: Object }) value: any
46
- @property({ type: String }) valuetype: string = 'string'
47
- @property({ type: Object }) confirmCallback!: (newval: any) => void
48
- @property({ type: String, attribute: 'default-value' }) defaultValue?: string
49
-
50
- render() {
51
- return html`
52
- <ox-input-value-map
53
- .value=${this.value}
54
- keytype="string"
55
- .valuetype=${this.valuetype}
56
- .defaultValue=${this.defaultValue}
57
- @change=${this.onChange.bind(this)}
58
- >
59
- </ox-input-value-map>
60
-
61
- <div class="footer">
62
- <div filler></div>
63
- <button @click=${this.onCancel.bind(this)} danger>
64
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
65
- </button>
66
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
67
- </div>
68
- `
69
- }
70
-
71
- private onChange(e: CustomEvent) {
72
- e.stopPropagation()
73
-
74
- /*
75
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
76
- layout의 구성에 변화가 발생하면, 다시 render된다.
77
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
78
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
79
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
80
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
81
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
82
- =>
83
- 이런 이유로, Object.assign(...)을 사용하였다.
84
- */
85
-
86
- if (!this.value) {
87
- this.value = {}
88
- }
89
-
90
- for (let key in this.value) {
91
- delete this.value[key]
92
- }
93
-
94
- Object.assign(this.value, e.detail)
95
- }
96
-
97
- private onCancel(e: Event) {
98
- closePopup(this)
99
- }
100
-
101
- private onConfirm(e: Event) {
102
- this.confirmCallback && this.confirmCallback(this.value)
103
- closePopup(this)
104
- }
105
- }
@@ -1,104 +0,0 @@
1
- import '@material/web/icon/icon.js'
2
- import '@operato/input/ox-input-value-ranges.js'
3
-
4
- import { css, html, LitElement } from 'lit'
5
- import { customElement, property } from 'lit/decorators.js'
6
-
7
- import { i18next } from '@operato/i18n'
8
- import { closePopup } from '@operato/popup'
9
- import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'
10
-
11
- @customElement('ox-popup-value-ranges-input')
12
- export class OxPopupValueRangesInput extends LitElement {
13
- static styles = [
14
- CommonHeaderStyles,
15
- ScrollbarStyles,
16
- css`
17
- :host {
18
- display: flex;
19
- flex-direction: column;
20
-
21
- background-color: var(--md-sys-color-surface);
22
-
23
- width: var(--overlay-center-normal-width, 50%);
24
- height: var(--overlay-center-normal-height, 50%);
25
- }
26
-
27
- ox-input-value-ranges {
28
- flex: 1;
29
- overflow-y: auto;
30
- }
31
-
32
- span {
33
- flex: 1;
34
-
35
- display: flex;
36
- align-items: center;
37
- justify-content: center;
38
-
39
- color: var(--md-sys-color-on-primary-container);
40
- }
41
- `
42
- ]
43
-
44
- @property({ type: Object }) value: any
45
- @property({ type: String }) valuetype: string = 'string'
46
- @property({ type: Object }) confirmCallback!: (newval: any) => void
47
- @property({ type: String, attribute: 'default-value' }) defaultValue?: string
48
-
49
- render() {
50
- return html`
51
- <ox-input-value-ranges
52
- .value=${this.value}
53
- keytype="string"
54
- .valuetype=${this.valuetype}
55
- .defaultValue=${this.defaultValue}
56
- @change=${this.onChange.bind(this)}
57
- >
58
- </ox-input-value-ranges>
59
-
60
- <div class="footer">
61
- <div filler></div>
62
- <button @click=${this.onCancel.bind(this)} danger>
63
- <md-icon>cancel</md-icon>${i18next.t('button.cancel')}
64
- </button>
65
- <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
66
- </div>
67
- `
68
- }
69
-
70
- private onChange(e: CustomEvent) {
71
- e.stopPropagation()
72
-
73
- /*
74
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
75
- layout의 구성에 변화가 발생하면, 다시 render된다.
76
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
77
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
78
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
79
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
80
- (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
81
- =>
82
- 이런 이유로, Object.assign(...)을 사용하였다.
83
- */
84
-
85
- if (!this.value) {
86
- this.value = {}
87
- }
88
-
89
- for (let key in this.value) {
90
- delete this.value[key]
91
- }
92
-
93
- Object.assign(this.value, e.detail)
94
- }
95
-
96
- private onCancel(e: Event) {
97
- closePopup(this)
98
- }
99
-
100
- private onConfirm(e: Event) {
101
- this.confirmCallback && this.confirmCallback(this.value)
102
- closePopup(this)
103
- }
104
- }