@operato/app 1.0.0-alpha.9 → 1.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 (145) hide show
  1. package/@types/global/index.d.ts +2 -0
  2. package/CHANGELOG.md +335 -17
  3. package/demo/data-grist-test.html +15 -10
  4. package/demo/index.html +1 -10
  5. package/dist/src/{grist → grist-editor}/index.d.ts +0 -0
  6. package/dist/src/grist-editor/index.js +28 -0
  7. package/dist/src/grist-editor/index.js.map +1 -0
  8. package/dist/src/grist-editor/ox-grist-editor-code.d.ts +7 -0
  9. package/dist/src/grist-editor/ox-grist-editor-code.js +53 -0
  10. package/dist/src/grist-editor/ox-grist-editor-code.js.map +1 -0
  11. package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +8 -0
  12. package/dist/src/grist-editor/ox-grist-editor-crontab.js +50 -0
  13. package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +1 -0
  14. package/dist/src/grist-editor/ox-grist-editor-json.d.ts +7 -0
  15. package/dist/src/grist-editor/ox-grist-editor-json.js +54 -0
  16. package/dist/src/grist-editor/ox-grist-editor-json.js.map +1 -0
  17. package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +12 -0
  18. package/dist/src/{grist/parameters-editor.js → grist-editor/ox-grist-editor-parameters.js} +16 -37
  19. package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +1 -0
  20. package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +11 -0
  21. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +74 -0
  22. package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +1 -0
  23. package/dist/src/{grist/code-editor.d.ts → grist-editor/ox-grist-editor-resource-code.d.ts} +2 -2
  24. package/dist/src/{grist/code-editor.js → grist-editor/ox-grist-editor-resource-code.js} +10 -5
  25. package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -0
  26. package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +9 -0
  27. package/dist/src/grist-editor/ox-grist-editor-resource-id.js +72 -0
  28. package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -0
  29. package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +11 -0
  30. package/dist/src/{grist/object-editor.js → grist-editor/ox-grist-editor-resource-object.js} +30 -78
  31. package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -0
  32. package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +11 -0
  33. package/dist/src/grist-editor/ox-grist-editor-value-map.js +74 -0
  34. package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +1 -0
  35. package/dist/src/grist-editor/ox-grist-renderer-crontab.d.ts +2 -0
  36. package/dist/src/grist-editor/ox-grist-renderer-crontab.js +26 -0
  37. package/dist/src/grist-editor/ox-grist-renderer-crontab.js.map +1 -0
  38. package/dist/src/grist-editor/ox-grist-renderer-resource-id.d.ts +2 -0
  39. package/dist/src/grist-editor/ox-grist-renderer-resource-id.js +9 -0
  40. package/dist/src/grist-editor/ox-grist-renderer-resource-id.js.map +1 -0
  41. package/dist/src/grist-editor/ox-grist-renderer-resource-object.d.ts +2 -0
  42. package/dist/src/grist-editor/ox-grist-renderer-resource-object.js +22 -0
  43. package/dist/src/grist-editor/ox-grist-renderer-resource-object.js.map +1 -0
  44. package/dist/src/{grist/parameters-editor-builder.d.ts → grist-editor/ox-parameters-builder.d.ts} +1 -1
  45. package/dist/src/{grist/parameters-editor-builder.js → grist-editor/ox-parameters-builder.js} +10 -11
  46. package/dist/src/grist-editor/ox-parameters-builder.js.map +1 -0
  47. package/dist/src/grist-editor/ox-popup-code-input.d.ts +12 -0
  48. package/dist/src/grist-editor/ox-popup-code-input.js +71 -0
  49. package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -0
  50. package/dist/src/grist-editor/ox-popup-crontab-input.d.ts +11 -0
  51. package/dist/src/grist-editor/ox-popup-crontab-input.js +74 -0
  52. package/dist/src/grist-editor/ox-popup-crontab-input.js.map +1 -0
  53. package/dist/src/{grist/parameters-editor-popup.d.ts → grist-editor/ox-popup-parameters-builder.d.ts} +1 -1
  54. package/dist/src/{grist/parameters-editor-popup.js → grist-editor/ox-popup-parameters-builder.js} +15 -15
  55. package/dist/src/grist-editor/ox-popup-parameters-builder.js.map +1 -0
  56. package/dist/src/grist-editor/ox-popup-partition-keys-input.d.ts +12 -0
  57. package/dist/src/grist-editor/ox-popup-partition-keys-input.js +98 -0
  58. package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +1 -0
  59. package/dist/src/grist-editor/ox-popup-value-map-input.d.ts +12 -0
  60. package/dist/src/grist-editor/ox-popup-value-map-input.js +104 -0
  61. package/dist/src/grist-editor/ox-popup-value-map-input.js.map +1 -0
  62. package/dist/src/{grist/id-selector.d.ts → grist-editor/ox-selector-resource-id.d.ts} +4 -3
  63. package/dist/src/{grist/id-selector.js → grist-editor/ox-selector-resource-id.js} +23 -18
  64. package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -0
  65. package/dist/src/{grist/object-selector.d.ts → grist-editor/ox-selector-resource-object.d.ts} +4 -3
  66. package/dist/src/{grist/object-selector.js → grist-editor/ox-selector-resource-object.js} +30 -25
  67. package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -0
  68. package/dist/src/index.d.ts +3 -1
  69. package/dist/src/index.js +3 -1
  70. package/dist/src/index.js.map +1 -1
  71. package/dist/src/input/index.d.ts +3 -0
  72. package/dist/src/input/index.js +4 -0
  73. package/dist/src/input/index.js.map +1 -0
  74. package/dist/src/input/ox-input-background-pattern.d.ts +1 -1
  75. package/dist/src/input/ox-input-background-pattern.js +6 -3
  76. package/dist/src/input/ox-input-background-pattern.js.map +1 -1
  77. package/dist/src/input/ox-input-fill-style.d.ts +2 -3
  78. package/dist/src/input/ox-input-fill-style.js +2 -2
  79. package/dist/src/input/ox-input-fill-style.js.map +1 -1
  80. package/dist/src/input/ox-input-graphql.d.ts +36 -0
  81. package/dist/src/input/ox-input-graphql.js +161 -0
  82. package/dist/src/input/ox-input-graphql.js.map +1 -0
  83. package/dist/src/property-editor/index.d.ts +24 -0
  84. package/dist/src/property-editor/index.js +58 -0
  85. package/dist/src/property-editor/index.js.map +1 -0
  86. package/dist/src/property-editor/ox-property-editor-graphql.d.ts +5 -0
  87. package/dist/src/property-editor/ox-property-editor-graphql.js +15 -0
  88. package/dist/src/property-editor/ox-property-editor-graphql.js.map +1 -0
  89. package/dist/tsconfig.tsbuildinfo +1 -1
  90. package/package.json +44 -22
  91. package/src/grist-editor/index.ts +30 -0
  92. package/src/grist-editor/ox-grist-editor-code.ts +62 -0
  93. package/src/grist-editor/ox-grist-editor-crontab.ts +62 -0
  94. package/src/grist-editor/ox-grist-editor-json.ts +62 -0
  95. package/src/{grist/parameters-editor.ts → grist-editor/ox-grist-editor-parameters.ts} +13 -26
  96. package/src/grist-editor/ox-grist-editor-partition-keys.ts +86 -0
  97. package/src/{grist/code-editor.ts → grist-editor/ox-grist-editor-resource-code.ts} +4 -5
  98. package/src/grist-editor/ox-grist-editor-resource-id.ts +85 -0
  99. package/src/{grist/object-editor.ts → grist-editor/ox-grist-editor-resource-object.ts} +28 -63
  100. package/src/grist-editor/ox-grist-editor-value-map.ts +86 -0
  101. package/src/grist-editor/ox-grist-renderer-crontab.ts +30 -0
  102. package/src/{grist/id-renderer.ts → grist-editor/ox-grist-renderer-resource-id.ts} +4 -3
  103. package/src/grist-editor/ox-grist-renderer-resource-object.ts +26 -0
  104. package/src/{grist/parameters-editor-builder.ts → grist-editor/ox-parameters-builder.ts} +4 -6
  105. package/src/grist-editor/ox-popup-code-input.ts +65 -0
  106. package/src/grist-editor/ox-popup-crontab-input.ts +74 -0
  107. package/src/{grist/parameters-editor-popup.ts → grist-editor/ox-popup-parameters-builder.ts} +5 -5
  108. package/src/grist-editor/ox-popup-partition-keys-input.ts +95 -0
  109. package/src/grist-editor/ox-popup-value-map-input.ts +101 -0
  110. package/src/{grist/id-selector.ts → grist-editor/ox-selector-resource-id.ts} +12 -6
  111. package/src/{grist/object-selector.ts → grist-editor/ox-selector-resource-object.ts} +15 -9
  112. package/src/index.ts +3 -1
  113. package/src/input/index.ts +3 -0
  114. package/src/input/ox-input-background-pattern.ts +6 -3
  115. package/src/input/ox-input-fill-style.ts +3 -4
  116. package/src/input/ox-input-graphql.ts +169 -0
  117. package/src/property-editor/index.ts +59 -0
  118. package/src/property-editor/ox-property-editor-graphql.ts +12 -0
  119. package/themes/app-theme.css +142 -0
  120. package/themes/grist-theme.css +194 -0
  121. package/themes/oops-theme.css +26 -0
  122. package/themes/report-theme.css +47 -0
  123. package/dist/src/grist/code-editor.js.map +0 -1
  124. package/dist/src/grist/id-input.d.ts +0 -19
  125. package/dist/src/grist/id-input.js +0 -119
  126. package/dist/src/grist/id-input.js.map +0 -1
  127. package/dist/src/grist/id-renderer.d.ts +0 -2
  128. package/dist/src/grist/id-renderer.js +0 -9
  129. package/dist/src/grist/id-renderer.js.map +0 -1
  130. package/dist/src/grist/id-selector.js.map +0 -1
  131. package/dist/src/grist/index.js +0 -11
  132. package/dist/src/grist/index.js.map +0 -1
  133. package/dist/src/grist/object-editor.d.ts +0 -18
  134. package/dist/src/grist/object-editor.js.map +0 -1
  135. package/dist/src/grist/object-selector.js.map +0 -1
  136. package/dist/src/grist/parameters-editor-builder.js.map +0 -1
  137. package/dist/src/grist/parameters-editor-popup.js.map +0 -1
  138. package/dist/src/grist/parameters-editor.d.ts +0 -19
  139. package/dist/src/grist/parameters-editor.js.map +0 -1
  140. package/dist/src/input/ox-input-color-gradient.d.ts +0 -25
  141. package/dist/src/input/ox-input-color-gradient.js +0 -318
  142. package/dist/src/input/ox-input-color-gradient.js.map +0 -1
  143. package/src/grist/id-input.ts +0 -135
  144. package/src/grist/index.ts +0 -13
  145. package/src/input/ox-input-color-gradient.ts +0 -341
@@ -3,20 +3,20 @@ import { LitElement, css, html } from 'lit';
3
3
  import { customElement, property } from 'lit/decorators.js';
4
4
  import { ScrollbarStyles } from '@operato/styles';
5
5
  import { i18next } from '@operato/i18n';
6
- let ParametersEditorPopup = class ParametersEditorPopup extends LitElement {
6
+ let OxPopupParametersBuilder = class OxPopupParametersBuilder extends LitElement {
7
7
  render() {
8
8
  var props = this.props instanceof Array ? this.props : [];
9
9
  return html `
10
10
  ${props.length > 0
11
11
  ? html `
12
- <ox-parameters-editor-builder
12
+ <ox-parameters-builder
13
13
  .value=${this.value}
14
14
  .props=${props}
15
15
  .host=${this.host}
16
16
  .context=${this.context}
17
17
  @property-change=${this.onChange.bind(this)}
18
18
  >
19
- </ox-parameters-editor-builder>
19
+ </ox-parameters-builder>
20
20
  `
21
21
  : html ` <span><i18n-msg msgid="text.no properties to set"></i18n-msg></span> `}
22
22
 
@@ -55,7 +55,7 @@ let ParametersEditorPopup = class ParametersEditorPopup extends LitElement {
55
55
  history.back();
56
56
  }
57
57
  };
58
- ParametersEditorPopup.styles = [
58
+ OxPopupParametersBuilder.styles = [
59
59
  ScrollbarStyles,
60
60
  css `
61
61
  :host {
@@ -68,7 +68,7 @@ ParametersEditorPopup.styles = [
68
68
  height: var(--overlay-center-normal-height, 50%);
69
69
  }
70
70
 
71
- ox-parameters-editor-builder {
71
+ ox-parameters-builder {
72
72
  flex: 1;
73
73
  overflow-y: auto;
74
74
  }
@@ -91,21 +91,21 @@ ParametersEditorPopup.styles = [
91
91
  ];
92
92
  __decorate([
93
93
  property({ type: Object })
94
- ], ParametersEditorPopup.prototype, "value", void 0);
94
+ ], OxPopupParametersBuilder.prototype, "value", void 0);
95
95
  __decorate([
96
96
  property({ type: Object })
97
- ], ParametersEditorPopup.prototype, "props", void 0);
97
+ ], OxPopupParametersBuilder.prototype, "props", void 0);
98
98
  __decorate([
99
99
  property({ type: Object })
100
- ], ParametersEditorPopup.prototype, "host", void 0);
100
+ ], OxPopupParametersBuilder.prototype, "host", void 0);
101
101
  __decorate([
102
102
  property({ type: Object })
103
- ], ParametersEditorPopup.prototype, "context", void 0);
103
+ ], OxPopupParametersBuilder.prototype, "context", void 0);
104
104
  __decorate([
105
105
  property({ type: Object })
106
- ], ParametersEditorPopup.prototype, "confirmCallback", void 0);
107
- ParametersEditorPopup = __decorate([
108
- customElement('ox-parameters-editor-popup')
109
- ], ParametersEditorPopup);
110
- export { ParametersEditorPopup };
111
- //# sourceMappingURL=parameters-editor-popup.js.map
106
+ ], OxPopupParametersBuilder.prototype, "confirmCallback", void 0);
107
+ OxPopupParametersBuilder = __decorate([
108
+ customElement('ox-popup-parameters-builder')
109
+ ], OxPopupParametersBuilder);
110
+ export { OxPopupParametersBuilder };
111
+ //# sourceMappingURL=ox-popup-parameters-builder.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-popup-parameters-builder.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-parameters-builder.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,wBAAwB,GAArC,MAAa,wBAAyB,SAAQ,UAAU;IA0CtD,MAAM;QACJ,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAA;QAEzD,OAAO,IAAI,CAAA;QACP,KAAK,CAAC,MAAM,GAAG,CAAC;YAChB,CAAC,CAAC,IAAI,CAAA;;uBAES,IAAI,CAAC,KAAK;uBACV,KAAK;sBACN,IAAI,CAAC,IAAI;yBACN,IAAI,CAAC,OAAO;iCACJ,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;WAG9C;YACH,CAAC,CAAC,IAAI,CAAA,wEAAwE;;;6BAGzD,IAAI,CAAC,QAAQ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AAE,IAAI,EAAE,MAAM,EAAE,CAAC;iEAAwC;AAxCxD,wBAAwB;IADpC,aAAa,CAAC,6BAA6B,CAAC;GAChC,wBAAwB,CAkGpC;SAlGY,wBAAwB","sourcesContent":["import { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-popup-parameters-builder')\nexport class OxPopupParametersBuilder extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-parameters-builder {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) props: any\n @property({ type: Object }) host: any\n @property({ type: Object }) context: any\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n var props = this.props instanceof Array ? this.props : []\n\n return html`\n ${props.length > 0\n ? html`\n <ox-parameters-builder\n .value=${this.value}\n .props=${props}\n .host=${this.host}\n .context=${this.context}\n @property-change=${this.onChange.bind(this)}\n >\n </ox-parameters-builder>\n `\n : html` <span><i18n-msg msgid=\"text.no properties to set\"></i18n-msg></span> `}\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n if (!this.value) {\n this.value = {}\n }\n\n for (let key in this.value) {\n delete this.value[key]\n }\n Object.assign(this.value, e.detail)\n }\n\n private onCancel(e: Event) {\n history.back()\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n history.back()\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import '@operato/input/ox-input-partition-keys.js';
2
+ import { LitElement } from 'lit';
3
+ export declare class OxPopupPartitionKeysInput extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ value: any;
6
+ valuetype: string;
7
+ confirmCallback: (newval: any) => void;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ private onChange;
10
+ private onCancel;
11
+ private onConfirm;
12
+ }
@@ -0,0 +1,98 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-partition-keys.js';
3
+ import { LitElement, css, html } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { ScrollbarStyles } from '@operato/styles';
6
+ import { i18next } from '@operato/i18n';
7
+ let OxPopupPartitionKeysInput = class OxPopupPartitionKeysInput extends LitElement {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.valuetype = 'string';
11
+ }
12
+ render() {
13
+ return html `
14
+ <ox-input-partition-keys .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-partition-keys>
15
+
16
+ <div class="button-container">
17
+ <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
18
+ <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
19
+ </div>
20
+ `;
21
+ }
22
+ onChange(e) {
23
+ e.stopPropagation();
24
+ /*
25
+ 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
26
+ layout의 구성에 변화가 발생하면, 다시 render된다.
27
+ 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
28
+ 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
29
+ 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
30
+ 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
31
+ (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
32
+ =>
33
+ 이런 이유로, Object.assign(...)을 사용하였다.
34
+ */
35
+ if (!this.value || typeof this.value !== 'object') {
36
+ this.value = {};
37
+ }
38
+ for (let key in this.value) {
39
+ delete this.value[key];
40
+ }
41
+ Object.assign(this.value, e.detail);
42
+ }
43
+ onCancel(e) {
44
+ history.back();
45
+ }
46
+ onConfirm(e) {
47
+ this.confirmCallback && this.confirmCallback(this.value);
48
+ history.back();
49
+ }
50
+ };
51
+ OxPopupPartitionKeysInput.styles = [
52
+ ScrollbarStyles,
53
+ css `
54
+ :host {
55
+ display: flex;
56
+ flex-direction: column;
57
+
58
+ background-color: #fff;
59
+
60
+ width: var(--overlay-center-normal-width, 50%);
61
+ height: var(--overlay-center-normal-height, 50%);
62
+ }
63
+
64
+ ox-input-partition-keys {
65
+ flex: 1;
66
+ overflow-y: auto;
67
+ }
68
+
69
+ span {
70
+ flex: 1;
71
+
72
+ display: flex;
73
+ align-items: center;
74
+ justify-content: center;
75
+
76
+ color: var(--primary-color);
77
+ }
78
+
79
+ .button-container {
80
+ display: flex;
81
+ margin-left: auto;
82
+ }
83
+ `
84
+ ];
85
+ __decorate([
86
+ property({ type: Object })
87
+ ], OxPopupPartitionKeysInput.prototype, "value", void 0);
88
+ __decorate([
89
+ property({ type: String })
90
+ ], OxPopupPartitionKeysInput.prototype, "valuetype", void 0);
91
+ __decorate([
92
+ property({ type: Object })
93
+ ], OxPopupPartitionKeysInput.prototype, "confirmCallback", void 0);
94
+ OxPopupPartitionKeysInput = __decorate([
95
+ customElement('ox-popup-partition-keys-input')
96
+ ], OxPopupPartitionKeysInput);
97
+ export { OxPopupPartitionKeysInput };
98
+ //# sourceMappingURL=ox-popup-partition-keys-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-popup-partition-keys-input.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-partition-keys-input.ts"],"names":[],"mappings":";AAAA,OAAO,2CAA2C,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAGvC,IAAa,yBAAyB,GAAtC,MAAa,yBAA0B,SAAQ,UAAU;IAAzD;;QAqC8B,cAAS,GAAW,QAAQ,CAAA;IAgD1D,CAAC;IA7CC,MAAM;QACJ,OAAO,IAAI,CAAA;wCACyB,IAAI,CAAC,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;6BAGzD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;6BACtD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAEhF,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,CAAc;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB;;;;;;;;;;UAUE;QAEF,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,OAAO,IAAI,CAAC,KAAK,KAAK,QAAQ,EAAE;YACjD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAA;SAChB;QAED,KAAK,IAAI,GAAG,IAAI,IAAI,CAAC,KAAK,EAAE;YAC1B,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;SACvB;QAED,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;IAEO,SAAS,CAAC,CAAQ;QACxB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;CACF,CAAA;AApFQ,gCAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;wDAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kEAAwC;AAtCxD,yBAAyB;IADrC,aAAa,CAAC,+BAA+B,CAAC;GAClC,yBAAyB,CAqFrC;SArFY,yBAAyB","sourcesContent":["import '@operato/input/ox-input-partition-keys.js'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-popup-partition-keys-input')\nexport class OxPopupPartitionKeysInput extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-partition-keys {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: String }) valuetype: string = 'string'\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-partition-keys .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-partition-keys>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n\n if (!this.value || typeof this.value !== 'object') {\n this.value = {}\n }\n\n for (let key in this.value) {\n delete this.value[key]\n }\n\n Object.assign(this.value, e.detail)\n }\n\n private onCancel(e: Event) {\n history.back()\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n history.back()\n }\n}\n"]}
@@ -0,0 +1,12 @@
1
+ import '@operato/input/ox-input-value-map.js';
2
+ import { LitElement } from 'lit';
3
+ export declare class OxPopupValueMapInput extends LitElement {
4
+ static styles: import("lit").CSSResult[];
5
+ value: any;
6
+ valuetype: string;
7
+ confirmCallback: (newval: any) => void;
8
+ render(): import("lit-html").TemplateResult<1>;
9
+ private onChange;
10
+ private onCancel;
11
+ private onConfirm;
12
+ }
@@ -0,0 +1,104 @@
1
+ import { __decorate } from "tslib";
2
+ import '@operato/input/ox-input-value-map.js';
3
+ import { LitElement, css, html } from 'lit';
4
+ import { customElement, property } from 'lit/decorators.js';
5
+ import { ScrollbarStyles } from '@operato/styles';
6
+ import { i18next } from '@operato/i18n';
7
+ let OxPopupValueMapInput = class OxPopupValueMapInput extends LitElement {
8
+ constructor() {
9
+ super(...arguments);
10
+ this.valuetype = 'string';
11
+ }
12
+ render() {
13
+ return html `
14
+ <ox-input-value-map
15
+ .value=${this.value}
16
+ keytype="string"
17
+ .valuetype=${this.valuetype}
18
+ @change=${this.onChange.bind(this)}
19
+ >
20
+ </ox-input-value-map>
21
+
22
+ <div class="button-container">
23
+ <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
24
+ <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
25
+ </div>
26
+ `;
27
+ }
28
+ onChange(e) {
29
+ e.stopPropagation();
30
+ /*
31
+ 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
32
+ layout의 구성에 변화가 발생하면, 다시 render된다.
33
+ 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
34
+ 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
35
+ 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
36
+ 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
37
+ (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
38
+ =>
39
+ 이런 이유로, Object.assign(...)을 사용하였다.
40
+ */
41
+ if (!this.value) {
42
+ this.value = {};
43
+ }
44
+ for (let key in this.value) {
45
+ delete this.value[key];
46
+ }
47
+ Object.assign(this.value, e.detail);
48
+ }
49
+ onCancel(e) {
50
+ history.back();
51
+ }
52
+ onConfirm(e) {
53
+ this.confirmCallback && this.confirmCallback(this.value);
54
+ history.back();
55
+ }
56
+ };
57
+ OxPopupValueMapInput.styles = [
58
+ ScrollbarStyles,
59
+ css `
60
+ :host {
61
+ display: flex;
62
+ flex-direction: column;
63
+
64
+ background-color: #fff;
65
+
66
+ width: var(--overlay-center-normal-width, 50%);
67
+ height: var(--overlay-center-normal-height, 50%);
68
+ }
69
+
70
+ ox-input-value-map {
71
+ flex: 1;
72
+ overflow-y: auto;
73
+ }
74
+
75
+ span {
76
+ flex: 1;
77
+
78
+ display: flex;
79
+ align-items: center;
80
+ justify-content: center;
81
+
82
+ color: var(--primary-color);
83
+ }
84
+
85
+ .button-container {
86
+ display: flex;
87
+ margin-left: auto;
88
+ }
89
+ `
90
+ ];
91
+ __decorate([
92
+ property({ type: Object })
93
+ ], OxPopupValueMapInput.prototype, "value", void 0);
94
+ __decorate([
95
+ property({ type: String })
96
+ ], OxPopupValueMapInput.prototype, "valuetype", void 0);
97
+ __decorate([
98
+ property({ type: Object })
99
+ ], OxPopupValueMapInput.prototype, "confirmCallback", void 0);
100
+ OxPopupValueMapInput = __decorate([
101
+ customElement('ox-popup-value-map-input')
102
+ ], OxPopupValueMapInput);
103
+ export { OxPopupValueMapInput };
104
+ //# sourceMappingURL=ox-popup-value-map-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-popup-value-map-input.js","sourceR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CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;IAEO,SAAS,CAAC,CAAQ;QACxB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,OAAO,CAAC,IAAI,EAAE,CAAA;IAChB,CAAC;CACF,CAAA;AA1FQ,2BAAM,GAAG;IACd,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA8BF;CACF,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAA6B;AAC5B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAwC;AAtCxD,oBAAoB;IADhC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,oBAAoB,CA2FhC;SA3FY,oBAAoB","sourcesContent":["import '@operato/input/ox-input-value-map.js'\n\nimport { LitElement, css, html } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { ScrollbarStyles } from '@operato/styles'\nimport { i18next } from '@operato/i18n'\n\n@customElement('ox-popup-value-map-input')\nexport class OxPopupValueMapInput extends LitElement {\n static styles = [\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-value-map {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: String }) valuetype: string = 'string'\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-value-map\n .value=${this.value}\n keytype=\"string\"\n .valuetype=${this.valuetype}\n @change=${this.onChange.bind(this)}\n >\n </ox-input-value-map>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onCancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onConfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n\n if (!this.value) {\n this.value = {}\n }\n\n for (let key in this.value) {\n delete this.value[key]\n }\n\n Object.assign(this.value, e.detail)\n }\n\n private onCancel(e: Event) {\n history.back()\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n history.back()\n }\n}\n"]}
@@ -1,17 +1,18 @@
1
1
  import '@operato/data-grist';
2
- import { DataGrist, FetchOption, GristData, GristRecord } from '@operato/data-grist';
3
2
  import { LitElement } from 'lit';
4
- export declare class IdSelector extends LitElement {
3
+ import { DataGrist, FetchOption, GristData, GristRecord } from '@operato/data-grist';
4
+ export declare class OxSelectorResourceId extends LitElement {
5
5
  static styles: import("lit").CSSResult;
6
6
  value?: string;
7
7
  config: any;
8
8
  data: GristData;
9
9
  queryName: string;
10
10
  basicArgs: any;
11
- confirmCallback?: (record: GristRecord | undefined) => void;
11
+ confirmCallback?: (record?: GristRecord) => void;
12
12
  selectedRecords: GristRecord[];
13
13
  grist: DataGrist;
14
14
  render(): import("lit-html").TemplateResult<1>;
15
+ onempty(): void;
15
16
  oncancel(): void;
16
17
  onconfirm(): void;
17
18
  firstUpdated(): Promise<void>;
@@ -1,13 +1,13 @@
1
1
  import { __decorate } from "tslib";
2
2
  import '@operato/data-grist';
3
- import { ZERO_DATA } from '@operato/data-grist';
4
- import { LitElement, css, html } from 'lit';
3
+ import gql from 'graphql-tag';
4
+ import { css, html, LitElement } from 'lit';
5
5
  import { customElement, property, query } from 'lit/decorators.js';
6
+ import { ZERO_DATA } from '@operato/data-grist';
6
7
  import { client } from '@operato/graphql';
7
- import gql from 'graphql-tag';
8
8
  import { i18next } from '@operato/i18n';
9
9
  import { isMobileDevice } from '@operato/utils';
10
- let IdSelector = class IdSelector extends LitElement {
10
+ let OxSelectorResourceId = class OxSelectorResourceId extends LitElement {
11
11
  constructor() {
12
12
  super(...arguments);
13
13
  this.data = ZERO_DATA;
@@ -27,11 +27,16 @@ let IdSelector = class IdSelector extends LitElement {
27
27
  </ox-grist>
28
28
 
29
29
  <div class="button-container">
30
+ <mwc-button @click=${this.onempty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
30
31
  <mwc-button @click=${this.oncancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
31
32
  <mwc-button @click=${this.onconfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
32
33
  </div>
33
34
  `;
34
35
  }
36
+ onempty() {
37
+ this.confirmCallback && this.confirmCallback();
38
+ history.back();
39
+ }
35
40
  oncancel() {
36
41
  history.back();
37
42
  }
@@ -136,7 +141,7 @@ let IdSelector = class IdSelector extends LitElement {
136
141
  return selected && selected.length > 0 ? selected[0] : undefined;
137
142
  }
138
143
  };
139
- IdSelector.styles = css `
144
+ OxSelectorResourceId.styles = css `
140
145
  :host {
141
146
  display: flex;
142
147
  flex-direction: column;
@@ -168,30 +173,30 @@ IdSelector.styles = css `
168
173
  `;
169
174
  __decorate([
170
175
  property({ type: String })
171
- ], IdSelector.prototype, "value", void 0);
176
+ ], OxSelectorResourceId.prototype, "value", void 0);
172
177
  __decorate([
173
178
  property({ type: Object })
174
- ], IdSelector.prototype, "config", void 0);
179
+ ], OxSelectorResourceId.prototype, "config", void 0);
175
180
  __decorate([
176
181
  property({ type: Object })
177
- ], IdSelector.prototype, "data", void 0);
182
+ ], OxSelectorResourceId.prototype, "data", void 0);
178
183
  __decorate([
179
184
  property({ type: String })
180
- ], IdSelector.prototype, "queryName", void 0);
185
+ ], OxSelectorResourceId.prototype, "queryName", void 0);
181
186
  __decorate([
182
187
  property({ type: Object })
183
- ], IdSelector.prototype, "basicArgs", void 0);
188
+ ], OxSelectorResourceId.prototype, "basicArgs", void 0);
184
189
  __decorate([
185
190
  property({ type: Object })
186
- ], IdSelector.prototype, "confirmCallback", void 0);
191
+ ], OxSelectorResourceId.prototype, "confirmCallback", void 0);
187
192
  __decorate([
188
193
  property({ type: Array })
189
- ], IdSelector.prototype, "selectedRecords", void 0);
194
+ ], OxSelectorResourceId.prototype, "selectedRecords", void 0);
190
195
  __decorate([
191
196
  query('ox-grist')
192
- ], IdSelector.prototype, "grist", void 0);
193
- IdSelector = __decorate([
194
- customElement('ox-id-selector')
195
- ], IdSelector);
196
- export { IdSelector };
197
- //# sourceMappingURL=id-selector.js.map
197
+ ], OxSelectorResourceId.prototype, "grist", void 0);
198
+ OxSelectorResourceId = __decorate([
199
+ customElement('ox-selector-resource-id')
200
+ ], OxSelectorResourceId);
201
+ export { OxSelectorResourceId };
202
+ //# sourceMappingURL=ox-selector-resource-id.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-selector-resource-id.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-selector-resource-id.ts"],"names":[],"mappings":";AAAA,OAAO,qBAAqB,CAAA;AAE5B,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE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AG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BlB,CAAA;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;mDAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAA4B;AAC3B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAmB;AAClB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;uDAAe;AACd;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAiD;AACjD;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;6DAAoC;AAE3C;IAAlB,KAAK,CAAC,UAAU,CAAC;mDAAkB;AAxCzB,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAsLhC;SAtLY,oBAAoB","sourcesContent":["import '@operato/data-grist'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { DataGrist, FetchOption, GristData, GristRecord, ZERO_DATA } from '@operato/data-grist'\nimport { client } from '@operato/graphql'\nimport { i18next } from '@operato/i18n'\nimport { isMobileDevice } from '@operato/utils'\n\n@customElement('ox-selector-resource-id')\nexport class OxSelectorResourceId extends LitElement {\n static styles = css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-grist {\n flex: 1;\n }\n\n #filters {\n display: flex;\n flex-direction: row;\n justify-content: space-between;\n }\n\n #filters > * {\n padding: var(--padding-default) var(--padding-wide);\n }\n\n .button-container {\n display: flex;\n margin-left: auto;\n }\n `\n\n @property({ type: String }) value?: string\n @property({ type: Object }) config: any\n @property({ type: Object }) data: GristData = ZERO_DATA\n @property({ type: String }) queryName!: string\n @property({ type: Object }) basicArgs: any\n @property({ type: Object }) confirmCallback?: (record?: GristRecord) => void\n @property({ type: Array }) selectedRecords: GristRecord[] = []\n\n @query('ox-grist') grist!: DataGrist\n\n render() {\n return html`\n <ox-grist\n .mode=${isMobileDevice() ? 'LIST' : 'GRID'}\n .config=${this.config}\n .fetchHandler=${this.fetchHandler.bind(this)}\n .selectedRecords=${this.selectedRecords}\n >\n <div id=\"filters\" slot=\"headroom\">\n <ox-filters-form></ox-filters-form>\n </div>\n </ox-grist>\n\n <div class=\"button-container\">\n <mwc-button @click=${this.onempty.bind(this)}>${i18next.t('button.empty')}</mwc-button>\n <mwc-button @click=${this.oncancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>\n <mwc-button @click=${this.onconfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>\n </div>\n `\n }\n\n onempty() {\n this.confirmCallback && this.confirmCallback()\n history.back()\n }\n\n oncancel() {\n history.back()\n }\n\n onconfirm() {\n this.confirmCallback && this.confirmCallback(this.selected)\n history.back()\n }\n\n async firstUpdated() {\n this.config = {\n columns: [\n {\n type: 'gutter',\n gutterName: 'sequence'\n },\n {\n type: 'gutter',\n gutterName: 'row-selector',\n multiple: false\n },\n {\n type: 'string',\n name: 'id',\n header: i18next.t('field.id'),\n hidden: true\n },\n {\n type: 'string',\n name: 'name',\n header: i18next.t('field.name'),\n record: {\n align: 'left'\n },\n filter: 'search',\n sortable: true,\n width: 160\n },\n {\n type: 'string',\n name: 'description',\n header: i18next.t('field.description'),\n record: {\n align: 'left'\n },\n filter: 'search',\n sortable: true,\n width: 300\n }\n ],\n rows: {\n selectable: {\n multiple: false\n },\n handlers: {\n click: 'select-row'\n }\n },\n pagination: {\n infinite: true\n }\n }\n\n await this.updateComplete\n\n /* TODO config가 설정될 때, fetch() 가 동작하므로, fetch 완료 이벤트를 받아서, selected를 설정해주는 것이 좋겠다. \n 현재는 fetch() 가 두번 일어난다.\n */\n await this.grist.fetch()\n\n var selected = this.grist.data.records.find(item => this.value == item.id)\n if (selected) {\n this.selectedRecords = [selected]\n }\n /* TODO config가 설정될 때, fetch() 가 동작하므로, fetch 완료 이벤트를 받아서, selected를 설정해주는 것이 좋겠다. */\n\n await this.updateComplete\n this.grist.focus()\n }\n\n async fetchHandler({ page = 1, limit = 100, sorters = [], filters = [] }: FetchOption) {\n const response = await client.query({\n query: gql`\n query ($filters: [Filter!], $pagination: Pagination, $sortings: [Sorting!]) {\n q: ${this.queryName}(filters: $filters, pagination: $pagination, sortings: $sortings) {\n items {\n id\n name\n description\n }\n total\n }\n }\n `,\n variables: {\n filters,\n pagination: { page, limit },\n sortings: sorters\n }\n })\n\n return {\n total: response.data.q.total || 0,\n records: response.data.q.items || []\n }\n }\n\n get selected() {\n var grist = this.renderRoot.querySelector('ox-grist') as DataGrist\n\n var selected = grist.selected\n\n return selected && selected.length > 0 ? selected[0] : undefined\n }\n}\n"]}
@@ -1,16 +1,16 @@
1
1
  import '@operato/data-grist';
2
2
  import '@operato/form/ox-search-form.js';
3
- import { DataGrist, FetchHandler, FetchOption, GristData, GristRecord } from '@operato/data-grist';
4
3
  import { LitElement } from 'lit';
4
+ import { DataGrist, FetchHandler, FetchOption, GristData, GristRecord } from '@operato/data-grist';
5
5
  import { SearchForm } from '@operato/form';
6
- export declare class ObjectSelector extends LitElement {
6
+ export declare class OxSelectorResourceObject extends LitElement {
7
7
  static styles: import("lit").CSSResult[];
8
8
  value?: string;
9
9
  config: any;
10
10
  data: GristData;
11
11
  queryName: string;
12
12
  basicArgs: any;
13
- confirmCallback?: (record: GristRecord | undefined) => void;
13
+ confirmCallback?: (record?: GristRecord | null) => void;
14
14
  selectedRecords: GristRecord[];
15
15
  searchFields: any;
16
16
  select: {
@@ -28,6 +28,7 @@ export declare class ObjectSelector extends LitElement {
28
28
  grist: DataGrist;
29
29
  searchForm: SearchForm;
30
30
  render(): import("lit-html").TemplateResult<1>;
31
+ onempty(): void;
31
32
  oncancel(): void;
32
33
  onconfirm(): void;
33
34
  fetchHandler: FetchHandler;
@@ -1,15 +1,15 @@
1
1
  import { __decorate } from "tslib";
2
2
  import '@operato/data-grist';
3
3
  import '@operato/form/ox-search-form.js';
4
+ import gql from 'graphql-tag';
5
+ import { css, html, LitElement } from 'lit';
6
+ import { customElement, property, query } from 'lit/decorators.js';
4
7
  import { ZERO_DATA } from '@operato/data-grist';
5
- import { LitElement, css, html } from 'lit';
6
8
  import { MultiColumnFormStyles } from '@operato/form';
7
9
  import { buildArgs, client, gqlContext } from '@operato/graphql';
8
- import { customElement, property, query } from 'lit/decorators.js';
9
- import gql from 'graphql-tag';
10
10
  import { i18next } from '@operato/i18n';
11
11
  import { isMobileDevice } from '@operato/utils';
12
- let ObjectSelector = class ObjectSelector extends LitElement {
12
+ let OxSelectorResourceObject = class OxSelectorResourceObject extends LitElement {
13
13
  constructor() {
14
14
  super(...arguments);
15
15
  this.data = ZERO_DATA;
@@ -60,7 +60,7 @@ let ObjectSelector = class ObjectSelector extends LitElement {
60
60
  <ox-search-form
61
61
  id="search-form"
62
62
  @keypress=${(e) => {
63
- if (e.keyCode === 13) {
63
+ if (e.key === 'Enter') {
64
64
  this.grist.fetch();
65
65
  }
66
66
  }}
@@ -77,11 +77,16 @@ let ObjectSelector = class ObjectSelector extends LitElement {
77
77
  ></ox-grist>
78
78
 
79
79
  <div class="button-container">
80
+ <mwc-button @click=${this.onempty.bind(this)}>${i18next.t('button.empty')}</mwc-button>
80
81
  <mwc-button @click=${this.oncancel.bind(this)}>${i18next.t('button.cancel')}</mwc-button>
81
82
  <mwc-button @click=${this.onconfirm.bind(this)}>${i18next.t('button.confirm')}</mwc-button>
82
83
  </div>
83
84
  `;
84
85
  }
86
+ onempty() {
87
+ this.confirmCallback && this.confirmCallback();
88
+ history.back();
89
+ }
85
90
  oncancel() {
86
91
  history.back();
87
92
  }
@@ -263,7 +268,7 @@ let ObjectSelector = class ObjectSelector extends LitElement {
263
268
  return selected && selected.length > 0 ? selected[0] : undefined;
264
269
  }
265
270
  };
266
- ObjectSelector.styles = [
271
+ OxSelectorResourceObject.styles = [
267
272
  MultiColumnFormStyles,
268
273
  css `
269
274
  :host {
@@ -273,7 +278,7 @@ ObjectSelector.styles = [
273
278
  background-color: #fff;
274
279
  }
275
280
 
276
- data-grist {
281
+ ox-grist {
277
282
  flex: 1;
278
283
  }
279
284
 
@@ -294,45 +299,45 @@ ObjectSelector.styles = [
294
299
  ];
295
300
  __decorate([
296
301
  property({ type: String })
297
- ], ObjectSelector.prototype, "value", void 0);
302
+ ], OxSelectorResourceObject.prototype, "value", void 0);
298
303
  __decorate([
299
304
  property({ type: Object })
300
- ], ObjectSelector.prototype, "config", void 0);
305
+ ], OxSelectorResourceObject.prototype, "config", void 0);
301
306
  __decorate([
302
307
  property({ type: Object })
303
- ], ObjectSelector.prototype, "data", void 0);
308
+ ], OxSelectorResourceObject.prototype, "data", void 0);
304
309
  __decorate([
305
310
  property({ type: String })
306
- ], ObjectSelector.prototype, "queryName", void 0);
311
+ ], OxSelectorResourceObject.prototype, "queryName", void 0);
307
312
  __decorate([
308
313
  property({ type: Object })
309
- ], ObjectSelector.prototype, "basicArgs", void 0);
314
+ ], OxSelectorResourceObject.prototype, "basicArgs", void 0);
310
315
  __decorate([
311
316
  property({ type: Object })
312
- ], ObjectSelector.prototype, "confirmCallback", void 0);
317
+ ], OxSelectorResourceObject.prototype, "confirmCallback", void 0);
313
318
  __decorate([
314
319
  property({ type: Array })
315
- ], ObjectSelector.prototype, "selectedRecords", void 0);
320
+ ], OxSelectorResourceObject.prototype, "selectedRecords", void 0);
316
321
  __decorate([
317
322
  property({ type: Array })
318
- ], ObjectSelector.prototype, "searchFields", void 0);
323
+ ], OxSelectorResourceObject.prototype, "searchFields", void 0);
319
324
  __decorate([
320
325
  property({ type: Array })
321
- ], ObjectSelector.prototype, "select", void 0);
326
+ ], OxSelectorResourceObject.prototype, "select", void 0);
322
327
  __decorate([
323
328
  property({ type: Object })
324
- ], ObjectSelector.prototype, "list", void 0);
329
+ ], OxSelectorResourceObject.prototype, "list", void 0);
325
330
  __decorate([
326
331
  property({ type: String })
327
- ], ObjectSelector.prototype, "valueField", void 0);
332
+ ], OxSelectorResourceObject.prototype, "valueField", void 0);
328
333
  __decorate([
329
334
  query('ox-grist')
330
- ], ObjectSelector.prototype, "grist", void 0);
335
+ ], OxSelectorResourceObject.prototype, "grist", void 0);
331
336
  __decorate([
332
337
  query('ox-search-form')
333
- ], ObjectSelector.prototype, "searchForm", void 0);
334
- ObjectSelector = __decorate([
335
- customElement('ox-object-selector')
336
- ], ObjectSelector);
337
- export { ObjectSelector };
338
- //# sourceMappingURL=object-selector.js.map
338
+ ], OxSelectorResourceObject.prototype, "searchForm", void 0);
339
+ OxSelectorResourceObject = __decorate([
340
+ customElement('ox-selector-resource-object')
341
+ ], OxSelectorResourceObject);
342
+ export { OxSelectorResourceObject };
343
+ //# sourceMappingURL=ox-selector-resource-object.js.map