@operato/app 1.0.0-beta.38 → 1.0.0-beta.40

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 (59) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/src/grist-editor/index.js +1 -9
  3. package/dist/src/grist-editor/index.js.map +1 -1
  4. package/dist/src/grist-editor/ox-popup-code-input.js +5 -4
  5. package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -1
  6. package/dist/src/grist-editor/ox-selector-resource-id.js +4 -3
  7. package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -1
  8. package/dist/src/grist-editor/ox-selector-resource-object.js +4 -3
  9. package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -1
  10. package/dist/src/input/ox-input-background-pattern.d.ts +3 -0
  11. package/dist/src/input/ox-input-background-pattern.js +35 -7
  12. package/dist/src/input/ox-input-background-pattern.js.map +1 -1
  13. package/dist/src/input/ox-input-fill-style.d.ts +4 -2
  14. package/dist/src/input/ox-input-fill-style.js +13 -7
  15. package/dist/src/input/ox-input-fill-style.js.map +1 -1
  16. package/dist/tsconfig.tsbuildinfo +1 -1
  17. package/package.json +15 -19
  18. package/src/grist-editor/index.ts +1 -9
  19. package/src/grist-editor/ox-popup-code-input.ts +5 -4
  20. package/src/grist-editor/ox-selector-resource-id.ts +4 -3
  21. package/src/grist-editor/ox-selector-resource-object.ts +4 -3
  22. package/src/input/ox-input-background-pattern.ts +37 -7
  23. package/src/input/ox-input-fill-style.ts +18 -8
  24. package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +0 -8
  25. package/dist/src/grist-editor/ox-grist-editor-crontab.js +0 -50
  26. package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +0 -1
  27. package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +0 -12
  28. package/dist/src/grist-editor/ox-grist-editor-parameters.js +0 -84
  29. package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +0 -1
  30. package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +0 -11
  31. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +0 -74
  32. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +0 -1
  33. package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +0 -11
  34. package/dist/src/grist-editor/ox-grist-editor-value-map.js +0 -74
  35. package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +0 -1
  36. package/dist/src/grist-editor/ox-parameters-builder.d.ts +0 -4
  37. package/dist/src/grist-editor/ox-parameters-builder.js +0 -118
  38. package/dist/src/grist-editor/ox-parameters-builder.js.map +0 -1
  39. package/dist/src/grist-editor/ox-popup-crontab-input.d.ts +0 -11
  40. package/dist/src/grist-editor/ox-popup-crontab-input.js +0 -74
  41. package/dist/src/grist-editor/ox-popup-crontab-input.js.map +0 -1
  42. package/dist/src/grist-editor/ox-popup-parameters-builder.d.ts +0 -13
  43. package/dist/src/grist-editor/ox-popup-parameters-builder.js +0 -111
  44. package/dist/src/grist-editor/ox-popup-parameters-builder.js.map +0 -1
  45. package/dist/src/grist-editor/ox-popup-partition-keys-input.d.ts +0 -12
  46. package/dist/src/grist-editor/ox-popup-partition-keys-input.js +0 -99
  47. package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +0 -1
  48. package/dist/src/grist-editor/ox-popup-value-map-input.d.ts +0 -12
  49. package/dist/src/grist-editor/ox-popup-value-map-input.js +0 -104
  50. package/dist/src/grist-editor/ox-popup-value-map-input.js.map +0 -1
  51. package/src/grist-editor/ox-grist-editor-crontab.ts +0 -62
  52. package/src/grist-editor/ox-grist-editor-parameters.ts +0 -99
  53. package/src/grist-editor/ox-grist-editor-partition-keys.ts +0 -86
  54. package/src/grist-editor/ox-grist-editor-value-map.ts +0 -86
  55. package/src/grist-editor/ox-parameters-builder.ts +0 -128
  56. package/src/grist-editor/ox-popup-crontab-input.ts +0 -74
  57. package/src/grist-editor/ox-popup-parameters-builder.ts +0 -106
  58. package/src/grist-editor/ox-popup-partition-keys-input.ts +0 -96
  59. package/src/grist-editor/ox-popup-value-map-input.ts +0 -101
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "WebApplication production supporting components following open-wc recommendations",
4
4
  "license": "MIT",
5
5
  "author": "heartyoh",
6
- "version": "1.0.0-beta.38",
6
+ "version": "1.0.0-beta.40",
7
7
  "main": "dist/src/index.js",
8
8
  "module": "dist/src/index.js",
9
9
  "exports": {
@@ -20,15 +20,11 @@
20
20
  "./grist-editor/ox-grist-renderer-resource-id.js": "./dist/src/grist-editor/ox-grist-renderer-resource-id.js",
21
21
  "./grist-editor/ox-selector-resource-object.js": "./dist/src/grist-editor/ox-selector-resource-object.js",
22
22
  "./grist-editor/ox-grist-renderer-resource-object.js": "./dist/src/grist-editor/ox-grist-renderer-resource-object.js",
23
- "./grist-editor/ox-grist-editor-crontab.js": "./dist/src/grist-editor/ox-grist-editor-crontab.js",
24
23
  "./grist-editor/ox-grist-renderer-crontab.js": "./dist/src/grist-editor/ox-grist-renderer-crontab.js",
25
24
  "./grist-editor/ox-grist-editor-json.js": "./dist/src/grist-editor/ox-grist-editor-json.js",
26
25
  "./grist-editor/ox-grist-editor-code.js": "./dist/src/grist-editor/ox-grist-editor-code.js",
27
26
  "./grist-editor/ox-grist-editor-resource-object.js": "./dist/src/grist-editor/ox-grist-editor-resource-object.js",
28
27
  "./grist-editor/ox-grist-editor-resource-code.js": "./dist/src/grist-editor/ox-grist-editor-resource-code.js",
29
- "./grist-editor/ox-grist-editor-parameters.js": "./dist/src/grist-editor/ox-grist-editor-parameters.js",
30
- "./grist-editor/ox-grist-editor-value-map.js": "./dist/src/grist-editor/ox-grist-editor-value-map.js",
31
- "./grist-editor/ox-grist-editor-partition-keys.js": "./dist/src/grist-editor/ox-grist-editor-partition-keys.js",
32
28
  "./filter-renderer.js": "./dist/src/filter-renderer/index.js"
33
29
  },
34
30
  "publishConfig": {
@@ -59,19 +55,19 @@
59
55
  "@material/mwc-button": "^0.25.3",
60
56
  "@material/mwc-icon": "^0.25.3",
61
57
  "@material/mwc-icon-button": "^0.25.3",
62
- "@operato/attachment": "^1.0.0-beta.38",
63
- "@operato/data-grist": "^1.0.0-beta.38",
64
- "@operato/font": "^1.0.0-beta.38",
65
- "@operato/form": "^1.0.0-beta.38",
66
- "@operato/graphql": "^1.0.0-beta.38",
67
- "@operato/i18n": "^1.0.0-beta.38",
68
- "@operato/input": "^1.0.0-beta.38",
69
- "@operato/layout": "^1.0.0-beta.38",
70
- "@operato/property-editor": "^1.0.0-beta.38",
71
- "@operato/shell": "^1.0.0-beta.38",
72
- "@operato/styles": "^1.0.0-beta.38",
73
- "@operato/utils": "^1.0.0-beta.38",
74
- "codemirror": "^5.59.1",
58
+ "@operato/attachment": "^1.0.0-beta.40",
59
+ "@operato/data-grist": "^1.0.0-beta.40",
60
+ "@operato/font": "^1.0.0-beta.40",
61
+ "@operato/form": "^1.0.0-beta.40",
62
+ "@operato/graphql": "^1.0.0-beta.40",
63
+ "@operato/i18n": "^1.0.0-beta.40",
64
+ "@operato/input": "^1.0.0-beta.40",
65
+ "@operato/layout": "^1.0.0-beta.40",
66
+ "@operato/property-editor": "^1.0.0-beta.40",
67
+ "@operato/shell": "^1.0.0-beta.40",
68
+ "@operato/styles": "^1.0.0-beta.40",
69
+ "@operato/utils": "^1.0.0-beta.40",
70
+ "codemirror": "^5.64.0",
75
71
  "codemirror-graphql": "^0.15.2",
76
72
  "cronstrue": "^2.2.0",
77
73
  "cross-fetch": "^3.1.5",
@@ -111,5 +107,5 @@
111
107
  "prettier --write"
112
108
  ]
113
109
  },
114
- "gitHead": "e5ca8bb81a52298eaf03c1d8f2829989379422c3"
110
+ "gitHead": "6f51f0b86e909ea850e6f185f737930daaec509e"
115
111
  }
@@ -1,14 +1,10 @@
1
1
  import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'
2
2
 
3
- import { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'
4
3
  import { OxGristEditorJson } from './ox-grist-editor-json.js'
5
- import { OxGristEditorParameters } from './ox-grist-editor-parameters.js'
6
- import { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'
7
4
  import { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js'
8
5
  import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'
9
6
  import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'
10
- import { OxGristEditorValueMap } from './ox-grist-editor-value-map.js'
11
- import { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js'
7
+ import { OxGristRendererCrontab } from './ox-grist-renderer-crontab'
12
8
  import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'
13
9
  import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'
14
10
 
@@ -16,10 +12,6 @@ import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-obje
16
12
  registerEditor('resource-id', OxGristEditorResourceId)
17
13
  registerEditor('resource-object', OxGristEditorResourceObject)
18
14
  registerEditor('resource-code', OxGristEditorResourceCode)
19
- registerEditor('parameters', OxGristEditorParameters)
20
- registerEditor('value-map', OxGristEditorValueMap)
21
- registerEditor('partition-keys', OxGristEditorPartitionKeys)
22
- registerEditor('crontab', OxGristEditorCrontab)
23
15
  registerEditor('json', OxGristEditorJson)
24
16
 
25
17
  registerRenderer('resource-id', OxGristRendererResourceId)
@@ -1,10 +1,11 @@
1
1
  import '@operato/input/ox-input-code.js'
2
2
 
3
- import { LitElement, css, html } from 'lit'
3
+ import { css, html, LitElement } from 'lit'
4
4
  import { customElement, property } from 'lit/decorators.js'
5
5
 
6
- import { ScrollbarStyles } from '@operato/styles'
7
6
  import { i18next } from '@operato/i18n'
7
+ import { closePopup } from '@operato/popup'
8
+ import { ScrollbarStyles } from '@operato/styles'
8
9
 
9
10
  @customElement('ox-popup-code-input')
10
11
  export class OxPopupCodeInput extends LitElement {
@@ -55,11 +56,11 @@ export class OxPopupCodeInput extends LitElement {
55
56
  }
56
57
 
57
58
  private onCancel(e: Event) {
58
- history.back()
59
+ closePopup(this)
59
60
  }
60
61
 
61
62
  private onConfirm(e: Event) {
62
63
  this.confirmCallback && this.confirmCallback(this.value)
63
- history.back()
64
+ closePopup(this)
64
65
  }
65
66
  }
@@ -7,6 +7,7 @@ import { customElement, property, query } from 'lit/decorators.js'
7
7
  import { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'
8
8
  import { client } from '@operato/graphql'
9
9
  import { i18next } from '@operato/i18n'
10
+ import { closePopup } from '@operato/popup'
10
11
  import { isMobileDevice } from '@operato/utils'
11
12
 
12
13
  @customElement('ox-selector-resource-id')
@@ -75,16 +76,16 @@ export class OxSelectorResourceId extends LitElement {
75
76
 
76
77
  onempty() {
77
78
  this.confirmCallback && this.confirmCallback()
78
- history.back()
79
+ closePopup(this)
79
80
  }
80
81
 
81
82
  oncancel() {
82
- history.back()
83
+ closePopup(this)
83
84
  }
84
85
 
85
86
  onconfirm() {
86
87
  this.confirmCallback && this.confirmCallback(this.selected)
87
- history.back()
88
+ closePopup(this)
88
89
  }
89
90
 
90
91
  async firstUpdated() {
@@ -18,6 +18,7 @@ import {
18
18
  import { MultiColumnFormStyles, SearchForm } from '@operato/form'
19
19
  import { buildArgs, client, gqlContext } from '@operato/graphql'
20
20
  import { i18next } from '@operato/i18n'
21
+ import { closePopup } from '@operato/popup'
21
22
  import { isMobileDevice } from '@operato/utils'
22
23
 
23
24
  @customElement('ox-selector-resource-object')
@@ -108,16 +109,16 @@ export class OxSelectorResourceObject extends LitElement {
108
109
 
109
110
  onempty() {
110
111
  this.confirmCallback && this.confirmCallback()
111
- history.back()
112
+ closePopup(this)
112
113
  }
113
114
 
114
115
  oncancel() {
115
- history.back()
116
+ closePopup(this)
116
117
  }
117
118
 
118
119
  onconfirm() {
119
120
  this.confirmCallback && this.confirmCallback(this.selected)
120
- history.back()
121
+ closePopup(this)
121
122
  }
122
123
 
123
124
  fetchHandler: FetchHandler = async ({ filters, page, limit, sorters = [] }) => {
@@ -3,6 +3,7 @@
3
3
  */
4
4
 
5
5
  import '@operato/i18n/ox-i18n.js'
6
+ import '@operato/input/ox-input-color.js'
6
7
  import '@operato/attachment/ox-attachment-selector.js'
7
8
 
8
9
  import { css, html } from 'lit'
@@ -12,12 +13,14 @@ import { OxFormField } from '@operato/input'
12
13
 
13
14
  export type BackgroundPatternOption = {
14
15
  image?: HTMLImageElement | string
16
+ color?: string
15
17
  align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'
16
18
  offsetX?: number
17
19
  offsetY?: number
18
20
  width?: number
19
21
  height?: number
20
22
  fitPattern?: boolean
23
+ noRepeat?: boolean
21
24
  }
22
25
 
23
26
  /**
@@ -89,6 +92,23 @@ export class OxInputBackgroundPattern extends OxFormField {
89
92
  grid-column: span 2;
90
93
  text-align: right;
91
94
  }
95
+
96
+ .grid-10 > .icon-only-label {
97
+ grid-column: span 2;
98
+
99
+ background: var(--url-icon-properties-label) no-repeat;
100
+ float: left;
101
+ margin: 0;
102
+ align-self: stretch;
103
+ }
104
+
105
+ .icon-only-label.color {
106
+ background-position: 100% -500px;
107
+ }
108
+
109
+ .grid-10 > ox-input-color {
110
+ grid-column: span 8;
111
+ }
92
112
  `
93
113
 
94
114
  @property({ type: Object }) value?: BackgroundPatternOption
@@ -112,13 +132,13 @@ export class OxInputBackgroundPattern extends OxFormField {
112
132
 
113
133
  <select value-key="align" class="select-content" .value=${value.align}>
114
134
  <option value="left-top">Left Top</option>
115
- <option value="top">Top</option>
135
+ <option value="top">Center Top</option>
116
136
  <option value="right-top">Right Top</option>
117
- <option value="left">Left</option>
118
- <option value="center">Center</option>
119
- <option value="right">Right</option>
137
+ <option value="left">Left Center</option>
138
+ <option value="center">Center Center</option>
139
+ <option value="right">Right Center</option>
120
140
  <option value="left-bottom">Left Bottom</option>
121
- <option value="bottom">Bottom</option>
141
+ <option value="bottom">Center Bottom</option>
122
142
  <option value="right-bottom">Right Bottom</option>
123
143
  </select>
124
144
 
@@ -136,9 +156,19 @@ export class OxInputBackgroundPattern extends OxFormField {
136
156
  <input type="number" value-key="height" .value=${value.height} />
137
157
  </div>
138
158
 
159
+ <div class="grid-10">
160
+ <label class="icon-only-label color"></label>
161
+ <ox-input-color value-key="color" .value=${value.color}> </ox-input-color>
162
+ </div>
163
+
139
164
  <div class="grid-10">
140
165
  <input value-key="fitPattern" type="checkbox" .checked=${value.fitPattern} required />
141
- <label> <ox-i18n msgid="label.fit" auto="">Fit</ox-i18n> </label>
166
+ <label> <ox-i18n msgid="label.fit" auto="">fit</ox-i18n> </label>
167
+ </div>
168
+
169
+ <div class="grid-10">
170
+ <input value-key="noRepeat" type="checkbox" .checked=${value.noRepeat} required />
171
+ <label> <ox-i18n msgid="label.no-repeat" auto="">no repeat</ox-i18n> </label>
142
172
  </div>
143
173
  `
144
174
  }
@@ -152,7 +182,7 @@ export class OxInputBackgroundPattern extends OxFormField {
152
182
  var key = element.getAttribute('value-key')
153
183
  var value: any = element.value
154
184
 
155
- if (key == 'fitPattern') {
185
+ if (key === 'fitPattern' || key === 'noRepeat') {
156
186
  value = element.checked
157
187
  }
158
188
 
@@ -8,10 +8,12 @@ import '@operato/input/ox-input-color-stops.js'
8
8
  import '@operato/input/ox-input-color-gradient.js'
9
9
  import './ox-input-background-pattern.js'
10
10
 
11
- import { BackgroundPatternOption, OxInputBackgroundPattern } from './ox-input-background-pattern.js'
11
+ import { css, html, PropertyValues } from 'lit'
12
+ import { customElement, property } from 'lit/decorators.js'
13
+
12
14
  import { ColorStop, GradientOption, OxFormField, OxInputColorGradient } from '@operato/input'
13
- import { PropertyValues, css, html } from 'lit'
14
- import { customElement, property, query } from 'lit/decorators.js'
15
+
16
+ import { BackgroundPatternOption, OxInputBackgroundPattern } from './ox-input-background-pattern.js'
15
17
 
16
18
  export type FillStyle =
17
19
  | {
@@ -27,6 +29,8 @@ export type FillStyle =
27
29
  height?: number
28
30
  align?: 'left-top' | 'top' | 'right-top' | 'left' | 'center' | 'right' | 'left-bottom' | 'bottom' | 'right-bottom'
29
31
  fitPattern?: boolean
32
+ noRepeat?: boolean
33
+ color?: string
30
34
  }
31
35
  | 'no'
32
36
  | string
@@ -66,13 +70,13 @@ export class OxInputColorStyle extends OxFormField {
66
70
  .grid-10 > .icon-only-label {
67
71
  grid-column: span 1;
68
72
 
69
- background: url(/assets/images/icon-properties-label.png) no-repeat;
73
+ background: var(--url-icon-properties-label) no-repeat;
70
74
  float: left;
71
75
  margin: 0;
72
76
  }
73
77
 
74
78
  .icon-only-label.color {
75
- background-position: 70% -498px;
79
+ background-position: 100% -500px;
76
80
  }
77
81
 
78
82
  [editors] > :not([active]) {
@@ -206,7 +210,9 @@ export class OxInputColorStyle extends OxFormField {
206
210
  width: Number(value.width),
207
211
  height: Number(value.height),
208
212
  align: value.align,
209
- fitPattern: value.fitPattern
213
+ fitPattern: value.fitPattern,
214
+ noRepeat: value.noRepeat,
215
+ color: value.color
210
216
  }
211
217
 
212
218
  if (!this._block_reset) {
@@ -275,7 +281,9 @@ export class OxInputColorStyle extends OxFormField {
275
281
  width: Number(this.pattern.width),
276
282
  height: Number(this.pattern.height),
277
283
  align: this.pattern.align,
278
- fitPattern: this.pattern.fitPattern
284
+ fitPattern: this.pattern.fitPattern,
285
+ noRepeat: this.pattern.noRepeat,
286
+ color: this.pattern.color
279
287
  }
280
288
  break
281
289
 
@@ -350,7 +358,9 @@ export class OxInputColorStyle extends OxFormField {
350
358
  width: Number(this.pattern?.width),
351
359
  height: Number(this.pattern?.height),
352
360
  align: this.pattern?.align,
353
- fitPattern: this.pattern?.fitPattern
361
+ fitPattern: this.pattern?.fitPattern,
362
+ noRepeat: this.pattern?.noRepeat,
363
+ color: this.pattern?.color
354
364
  }
355
365
 
356
366
  this._block_reset = true
@@ -1,8 +0,0 @@
1
- import './ox-popup-crontab-input.js';
2
- import { OxGristEditor } from '@operato/data-grist';
3
- export declare class OxGristEditorCrontab extends OxGristEditor {
4
- private popup?;
5
- get editorTemplate(): import("lit-html").TemplateResult<1>;
6
- firstUpdated(): Promise<void>;
7
- showEditorPopup(): void;
8
- }
@@ -1,50 +0,0 @@
1
- import { __decorate } from "tslib";
2
- import './ox-popup-crontab-input.js';
3
- import { html } from 'lit';
4
- import { customElement } from 'lit/decorators.js';
5
- import { OxGristEditor } from '@operato/data-grist';
6
- import { i18next } from '@operato/i18n';
7
- import { openPopup } from '@operato/layout';
8
- let OxGristEditorCrontab = class OxGristEditorCrontab extends OxGristEditor {
9
- get editorTemplate() {
10
- return html ` <input type="text" .value=${this.value || ''} /> `;
11
- }
12
- async firstUpdated() {
13
- await this.updateComplete;
14
- this.renderRoot.addEventListener('click', e => {
15
- e.stopPropagation();
16
- this.showEditorPopup();
17
- });
18
- this.showEditorPopup();
19
- }
20
- showEditorPopup() {
21
- if (this.popup) {
22
- delete this.popup;
23
- }
24
- const confirmCallback = (newval) => {
25
- this.dispatchEvent(new CustomEvent('field-change', {
26
- bubbles: true,
27
- composed: true,
28
- detail: {
29
- before: this.value,
30
- after: newval,
31
- record: this.record,
32
- column: this.column,
33
- row: this.row
34
- }
35
- }));
36
- };
37
- this.popup = openPopup(html `
38
- <ox-popup-crontab-input .value=${this.value} .confirmCallback=${confirmCallback}></ox-popup-crontab-input>
39
- `, {
40
- backdrop: true,
41
- title: i18next.t('title.setting schedule'),
42
- help: 'data-grist/grist-editor/crontab'
43
- });
44
- }
45
- };
46
- OxGristEditorCrontab = __decorate([
47
- customElement('ox-grist-editor-crontab')
48
- ], OxGristEditorCrontab);
49
- export { OxGristEditorCrontab };
50
- //# sourceMappingURL=ox-grist-editor-crontab.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-grist-editor-crontab.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-crontab.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAA;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAA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AAK,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;YAC1C,IAAI,EAAE,iCAAiC;SACxC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAnDY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAmDhC;SAnDY,oBAAoB","sourcesContent":["import './ox-popup-crontab-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('ox-grist-editor-crontab')\nexport class OxGristEditorCrontab extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return html` <input type=\"text\" .value=${this.value || ''} /> `\n }\n\n async firstUpdated() {\n await this.updateComplete\n\n this.renderRoot.addEventListener('click', e => {\n e.stopPropagation()\n\n this.showEditorPopup()\n })\n\n this.showEditorPopup()\n }\n\n showEditorPopup() {\n if (this.popup) {\n delete this.popup\n }\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n this.popup = openPopup(\n html`\n <ox-popup-crontab-input .value=${this.value} .confirmCallback=${confirmCallback}></ox-popup-crontab-input>\n `,\n {\n backdrop: true,\n title: i18next.t('title.setting schedule'),\n help: 'data-grist/grist-editor/crontab'\n }\n )\n }\n}\n"]}
@@ -1,12 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import './ox-parameters-builder.js';
5
- import './ox-popup-parameters-builder.js';
6
- import { OxGristEditor } from '@operato/data-grist';
7
- export declare class OxGristEditorParameters extends OxGristEditor {
8
- private popup?;
9
- get editorTemplate(): import("lit-html").TemplateResult<1>;
10
- firstUpdated(): Promise<void>;
11
- openSelector(): Promise<void>;
12
- }
@@ -1,84 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import { __decorate } from "tslib";
5
- import './ox-parameters-builder.js';
6
- import './ox-popup-parameters-builder.js';
7
- import { OxGristEditor } from '@operato/data-grist';
8
- import { openPopup } from '@operato/layout';
9
- import { html } from 'lit';
10
- import { cloneDeep } from 'lodash-es';
11
- import { customElement } from 'lit/decorators.js';
12
- import { i18next } from '@operato/i18n';
13
- let OxGristEditorParameters = class OxGristEditorParameters extends OxGristEditor {
14
- get editorTemplate() {
15
- const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
16
- return html ` ${value || ''} `;
17
- }
18
- async firstUpdated() {
19
- await this.updateComplete;
20
- this.renderRoot.addEventListener('click', e => {
21
- e.stopPropagation();
22
- this.openSelector();
23
- });
24
- this.openSelector();
25
- }
26
- async openSelector() {
27
- if (this.popup) {
28
- delete this.popup;
29
- }
30
- var { options } = this.column.record;
31
- if (typeof options === 'function') {
32
- options = await options.call(this, this.value, this.column, this.record, this.row, this.field);
33
- }
34
- const { name, help, spec, context, objectified = false } = options;
35
- const confirmCallback = (newval) => {
36
- this.dispatchEvent(new CustomEvent('field-change', {
37
- bubbles: true,
38
- composed: true,
39
- detail: {
40
- before: this.value,
41
- after: !objectified ? JSON.stringify(newval) : newval,
42
- record: this.record,
43
- column: this.column,
44
- row: this.row
45
- }
46
- }));
47
- };
48
- try {
49
- var value = !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {});
50
- }
51
- catch (e) {
52
- var value = {};
53
- }
54
- /*
55
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
56
- layout의 구성에 변화가 발생하면, 다시 render된다.
57
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
58
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
59
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
60
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
61
- */
62
- var template = html `
63
- <ox-popup-parameters-builder
64
- .value=${value}
65
- .props=${spec}
66
- .host=${this.record}
67
- .context=${context}
68
- .confirmCallback=${confirmCallback}
69
- >
70
- </ox-popup-parameters-builder>
71
- `;
72
- this.popup = openPopup(template, {
73
- backdrop: true,
74
- size: 'large',
75
- title: `${(name === null || name === void 0 ? void 0 : name.toUpperCase()) || ''} ${i18next.t('field.params')}`,
76
- help
77
- });
78
- }
79
- };
80
- OxGristEditorParameters = __decorate([
81
- customElement('ox-grist-editor-parameters')
82
- ], OxGristEditorParameters);
83
- export { OxGristEditorParameters };
84
- //# sourceMappingURL=ox-grist-editor-parameters.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-grist-editor-parameters.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-parameters.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAA6B,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAC9E,OAAO,EAAe,SAAS,EAAE,MAAM,iBAAiB,CAAA;AACxD,OAAO,EAAO,IAAI,EAAE,MAAM,KAAK,CAAA;AAE/B,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,uBAAuB,GAApC,MAAa,uBAAwB,SAAQ,aAAa;IAGxD,IAAI,cAAc;QAChB,MAAM,KAAK,GAAG,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,C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AM,EAAE,IAAI,CAAC,MAAM;oBACnB,MAAM,EAAE,IAAI,CAAC,MAAM;oBACnB,GAAG,EAAE,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED,IAAI;YACF,IAAI,KAAK,GACP,CAAC,WAAW,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;SACxG;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,KAAK,GAAQ,EAAE,CAAA;SACpB;QAED;;;;;;;UAOE;QACF,IAAI,QAAQ,GAAG,IAAI,CAAA;;iBAEN,KAAK;iBACL,IAAI;gBACL,IAAI,CAAC,MAAM;mBACR,OAAO;2BACC,eAAe;;;KAGrC,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,KAAI,EAAE,IAAI,OAAO,CAAC,CAAC,CAAC,cAAc,CAAC,EAAE;YAClE,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAlFY,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAkFnC;SAlFY,uBAAuB","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-parameters-builder.js'\nimport './ox-popup-parameters-builder.js'\n\nimport { ColumnConfig, GristRecord, OxGristEditor } from '@operato/data-grist'\nimport { PopupHandle, openPopup } from '@operato/layout'\nimport { css, html } from 'lit'\n\nimport { cloneDeep } from 'lodash-es'\nimport { customElement } from 'lit/decorators.js'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-grist-editor-parameters')\nexport class OxGristEditorParameters extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html` ${value || ''} `\n }\n\n async firstUpdated() {\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 async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n var { options } = this.column.record\n\n if (typeof options === 'function') {\n options = await options.call(this, this.value, this.column, this.record, this.row, this.field)\n }\n\n const { name, help, spec, context, objectified = false } = options\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: !objectified ? JSON.stringify(newval) : newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n try {\n var value: any =\n !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})\n } catch (e) {\n var value: any = {}\n }\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n */\n var template = html`\n <ox-popup-parameters-builder\n .value=${value}\n .props=${spec}\n .host=${this.record}\n .context=${context}\n .confirmCallback=${confirmCallback}\n >\n </ox-popup-parameters-builder>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || ''} ${i18next.t('field.params')}`,\n help\n })\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import './ox-popup-partition-keys-input.js';
5
- import { OxGristEditor } from '@operato/data-grist';
6
- export declare class OxGristEditorPartitionKeys extends OxGristEditor {
7
- private popup?;
8
- get editorTemplate(): import("lit-html").TemplateResult<1>;
9
- firstUpdated(): Promise<void>;
10
- openSelector(): Promise<void>;
11
- }
@@ -1,74 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import { __decorate } from "tslib";
5
- import './ox-popup-partition-keys-input.js';
6
- import { html } from 'lit';
7
- import { customElement } from 'lit/decorators.js';
8
- import { cloneDeep } from 'lodash-es';
9
- import { OxGristEditor } from '@operato/data-grist';
10
- import { i18next } from '@operato/i18n';
11
- import { openPopup } from '@operato/layout';
12
- let OxGristEditorPartitionKeys = class OxGristEditorPartitionKeys extends OxGristEditor {
13
- get editorTemplate() {
14
- const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
15
- return html ` ${value || ''} `;
16
- }
17
- async firstUpdated() {
18
- await this.updateComplete;
19
- this.renderRoot.addEventListener('click', e => {
20
- e.stopPropagation();
21
- this.openSelector();
22
- });
23
- this.openSelector();
24
- }
25
- async openSelector() {
26
- var _a;
27
- if (this.popup) {
28
- delete this.popup;
29
- }
30
- const { name, help, objectified = false } = ((_a = this.column.record) === null || _a === void 0 ? void 0 : _a.options) || {};
31
- const confirmCallback = (newval) => {
32
- this.dispatchEvent(new CustomEvent('field-change', {
33
- bubbles: true,
34
- composed: true,
35
- detail: {
36
- before: this.value,
37
- after: !objectified ? JSON.stringify(newval) : newval,
38
- record: this.record,
39
- column: this.column,
40
- row: this.row
41
- }
42
- }));
43
- };
44
- try {
45
- var value = !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {});
46
- }
47
- catch (e) {
48
- var value = {};
49
- }
50
- /*
51
- 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
52
- layout의 구성에 변화가 발생하면, 다시 render된다.
53
- 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
54
- 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
55
- 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
56
- 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
57
- */
58
- var template = html `
59
- <ox-popup-partition-keys-input .value=${value} .confirmCallback=${confirmCallback}>
60
- </ox-popup-partition-keys-input>
61
- `;
62
- this.popup = openPopup(template, {
63
- backdrop: true,
64
- size: 'large',
65
- title: `${(name === null || name === void 0 ? void 0 : name.toUpperCase()) || i18next.t('field.partition-keys')} `,
66
- help
67
- });
68
- }
69
- };
70
- OxGristEditorPartitionKeys = __decorate([
71
- customElement('ox-grist-editor-partition-keys')
72
- ], OxGristEditorPartitionKeys);
73
- export { OxGristEditorPartitionKeys };
74
- //# sourceMappingURL=ox-grist-editor-partition-keys.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ox-grist-editor-partition-keys.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-partition-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,iBAAiB,CAAA;AAGxD,IAAa,0BAA0B,GAAvC,M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E,IAAI,CAAC,GAAG;iBACd;aACF,CAAC,CACH,CAAA;QACH,CAAC,CAAA;QAED,IAAI;YACF,IAAI,KAAK,GACP,CAAC,WAAW,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;SACxG;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,KAAK,GAAQ,EAAE,CAAA;SACpB;QAED;;;;;;;UAOE;QACF,IAAI,QAAQ,GAAG,IAAI,CAAA;8CACuB,KAAK,qBAAqB,eAAe;;KAElF,CAAA;QAED,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;YAC/B,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,KAAI,OAAO,CAAC,CAAC,CAAC,sBAAsB,CAAC,GAAG;YACrE,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAtEY,0BAA0B;IADtC,aAAa,CAAC,gCAAgC,CAAC;GACnC,0BAA0B,CAsEtC;SAtEY,0BAA0B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-popup-partition-keys-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport { cloneDeep } from 'lodash-es'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/layout'\n\n@customElement('ox-grist-editor-partition-keys')\nexport class OxGristEditorPartitionKeys extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html` ${value || ''} `\n }\n\n async firstUpdated() {\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 async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help, objectified = false } = this.column.record?.options || {}\n\n const confirmCallback = (newval: any) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: !objectified ? JSON.stringify(newval) : newval,\n record: this.record,\n column: this.column,\n row: this.row\n }\n })\n )\n }\n\n try {\n var value: any =\n !objectified && typeof this.value === 'string' ? JSON.parse(this.value) : cloneDeep(this.value || {})\n } catch (e) {\n var value: any = {}\n }\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n */\n var template = html`\n <ox-popup-partition-keys-input .value=${value} .confirmCallback=${confirmCallback}>\n </ox-popup-partition-keys-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('field.partition-keys')} `,\n help\n })\n }\n}\n"]}
@@ -1,11 +0,0 @@
1
- /**
2
- * @license Copyright © HatioLab Inc. All rights reserved.
3
- */
4
- import './ox-popup-value-map-input.js';
5
- import { OxGristEditor } from '@operato/data-grist';
6
- export declare class OxGristEditorValueMap extends OxGristEditor {
7
- private popup?;
8
- get editorTemplate(): import("lit-html").TemplateResult<1>;
9
- firstUpdated(): Promise<void>;
10
- openSelector(): Promise<void>;
11
- }