@operato/app 1.0.0-alpha.24 → 1.0.0-alpha.25

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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,15 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.0.0-alpha.25](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.24...v1.0.0-alpha.25) (2022-03-17)
7
+
8
+
9
+ ### :bug: Bug Fix
10
+
11
+ * typo ([907aceb](https://github.com/hatiolab/operato/commit/907acebaf882613991bce064efea435c2d148543))
12
+
13
+
14
+
6
15
  ## [1.0.0-alpha.24](https://github.com/hatiolab/operato/compare/v1.0.0-alpha.23...v1.0.0-alpha.24) (2022-03-17)
7
16
 
8
17
 
@@ -0,0 +1,7 @@
1
+ import './ox-popup-code-input.js';
2
+ import { InputEditor } from '@operato/data-grist';
3
+ export declare class OxGristEditorCode extends InputEditor {
4
+ get editorTemplate(): import("lit-html").TemplateResult<1>;
5
+ firstUpdated(): Promise<void>;
6
+ showEditorPopup(): void;
7
+ }
@@ -0,0 +1,56 @@
1
+ import { __decorate } from "tslib";
2
+ import './ox-popup-code-input.js';
3
+ import { InputEditor } from '@operato/data-grist';
4
+ import { customElement } from 'lit/decorators.js';
5
+ import { html } from 'lit';
6
+ import { i18next } from '@operato/i18n';
7
+ import { openPopup } from '@operato/layout';
8
+ let OxGristEditorCode = class OxGristEditorCode extends InputEditor {
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
+ var _a;
22
+ var { mode } = ((_a = this.column.record) === null || _a === void 0 ? void 0 : _a.options) || {};
23
+ var change = (value) => {
24
+ this.dispatchEvent(new CustomEvent('change', {
25
+ bubbles: true,
26
+ composed: true,
27
+ detail: {
28
+ before: this.value,
29
+ after: value,
30
+ column: this.column,
31
+ record: this.record,
32
+ row: this.row
33
+ }
34
+ }));
35
+ };
36
+ var popup = openPopup(html `
37
+ <ox-popup-code-input
38
+ .value=${this.value}
39
+ mode=${mode}
40
+ @change=${(e) => {
41
+ change(e.detail.value);
42
+ popup.close();
43
+ }}
44
+ ></ox-popup-code-input>
45
+ `, {
46
+ backdrop: true,
47
+ title: i18next.t('title.setting schedule'),
48
+ help: 'data-grist/grist-editor/code'
49
+ });
50
+ }
51
+ };
52
+ OxGristEditorCode = __decorate([
53
+ customElement('ox-grist-editor-code')
54
+ ], OxGristEditorCode);
55
+ export { OxGristEditorCode };
56
+ //# sourceMappingURL=ox-grist-editor-code.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ox-grist-editor-code.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-code.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,WAAW;IAChD,IAAI,cAAc;QAChB,OAAO,IAAI,CAAA,8BAA8B,IAAI,CAAC,KAAK,IAAI,EAAE,MAAM,CAAA;IACjE,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,MAAM,IAAI,CAAC,cAAc,CAAA;QAEzB,IAAI,CAAC,UAAU,CAAC,gBAAgB,CAAC,OAAO,EAAE,CAAC,CAAC,EAAE;YAC5C,CAAC,CAAC,eAAe,EAAE,CAAA;YAEnB,IAAI,CAAC,eAAe,EAAE,CAAA;QACxB,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,eAAe,EAAE,CAAA;IACxB,CAAC;IAED,eAAe;;QACb,IAAI,EAAE,IAAI,EAAE,GAAG,CAAA,MAAA,IAAI,CAAC,MAAM,CAAC,MAAM,0CAAE,OAAO,KAAI,EAAE,CAAA;QAEhD,IAAI,MAAM,GAAG,CAAC,KAAa,EAAE,EAAE;YAC7B,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,QAAQ,EAAE;gBACxB,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,KAAK;oBACZ,MAAM,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,KAAK,GAAG,SAAS,CACnB,IAAI,CAAA;;mBAES,IAAI,CAAC,KAAK;iBACZ,IAAI;oBACD,CAAC,CAAc,EAAE,EAAE;YAC3B,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA;YACtB,KAAK,CAAC,KAAK,EAAE,CAAA;QACf,CAAC;;OAEJ,EACD;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;YAC1C,IAAI,EAAE,8BAA8B;SACrC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAtDY,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAsD7B;SAtDY,iBAAiB","sourcesContent":["import './ox-popup-code-input.js'\n\nimport { InputEditor } from '@operato/data-grist'\nimport { customElement } from 'lit/decorators.js'\nimport { html } from 'lit'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-grist-editor-code')\nexport class OxGristEditorCode extends InputEditor {\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 var { mode } = this.column.record?.options || {}\n\n var change = (value: string) => {\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: value,\n column: this.column,\n record: this.record,\n row: this.row\n }\n })\n )\n }\n\n var popup = openPopup(\n html`\n <ox-popup-code-input\n .value=${this.value}\n mode=${mode}\n @change=${(e: CustomEvent) => {\n change(e.detail.value)\n popup.close()\n }}\n ></ox-popup-code-input>\n `,\n {\n backdrop: true,\n title: i18next.t('title.setting schedule'),\n help: 'data-grist/grist-editor/code'\n }\n )\n }\n}\n"]}
@@ -49,16 +49,6 @@ OxPopupCodeInput.styles = [
49
49
  overflow-y: auto;
50
50
  }
51
51
 
52
- span {
53
- flex: 1;
54
-
55
- display: flex;
56
- align-items: center;
57
- justify-content: center;
58
-
59
- color: var(--primary-color);
60
- }
61
-
62
52
  .button-container {
63
53
  display: flex;
64
54
  margin-left: auto;
@@ -1 +1 @@
1
- {"version":3,"file":"ox-popup-code-input.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-code-input.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,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,gBAAgB,GAA7B,MAA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":["import '@operato/input/ox-input-code.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-code-input')\nexport class OxPopupCodeInput 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-code {\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 }) mode: string = 'javascript'\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-code .value=${this.value} .mode=${this.mode} @change=${this.onChange.bind(this)}> </ox-input-code>\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 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
+ {"version":3,"file":"ox-popup-code-input.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-code-input.ts"],"names":[],"mappings":";AAAA,OAAO,iCAAiC,CAAA;AAExC,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,OA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qBAAqB,CAAC;GACxB,gBAAgB,CAuD5B;SAvDY,gBAAgB","sourcesContent":["import '@operato/input/ox-input-code.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-code-input')\nexport class OxPopupCodeInput 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-code {\n flex: 1;\n overflow-y: auto;\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 }) mode: string = 'javascript'\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-code .value=${this.value} .mode=${this.mode} @change=${this.onChange.bind(this)}> </ox-input-code>\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 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"]}