@operato/app 0.4.3 → 0.4.4
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 +9 -0
- package/dist/src/filter-renderer/filter-resource-select.d.ts +4 -0
- package/dist/src/filter-renderer/filter-resource-select.js +79 -0
- package/dist/src/filter-renderer/filter-resource-select.js.map +1 -0
- package/dist/src/filter-renderer/index.d.ts +1 -0
- package/dist/src/filter-renderer/index.js +5 -0
- package/dist/src/filter-renderer/index.js.map +1 -0
- package/dist/src/grist-editor/index.d.ts +1 -0
- package/dist/src/grist-editor/index.js +28 -0
- package/dist/src/grist-editor/index.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-code.d.ts +7 -0
- package/dist/src/grist-editor/ox-grist-editor-code.js +53 -0
- package/dist/src/grist-editor/ox-grist-editor-code.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.d.ts +8 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.js +50 -0
- package/dist/src/grist-editor/ox-grist-editor-crontab.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-json.d.ts +7 -0
- package/dist/src/grist-editor/ox-grist-editor-json.js +54 -0
- package/dist/src/grist-editor/ox-grist-editor-json.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-parameters.d.ts +12 -0
- package/dist/src/grist-editor/ox-grist-editor-parameters.js +84 -0
- package/dist/src/grist-editor/ox-grist-editor-parameters.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.d.ts +11 -0
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js +74 -0
- package/dist/src/grist-editor/ox-grist-editor-partition-keys.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-code.d.ts +6 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js +55 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-code.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-id.d.ts +9 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js +72 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-id.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-object.d.ts +11 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js +104 -0
- package/dist/src/grist-editor/ox-grist-editor-resource-object.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.d.ts +11 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.js +74 -0
- package/dist/src/grist-editor/ox-grist-editor-value-map.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-renderer-crontab.d.ts +2 -0
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js +26 -0
- package/dist/src/grist-editor/ox-grist-renderer-crontab.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.d.ts +2 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.js +9 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-id.js.map +1 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.d.ts +2 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.js +22 -0
- package/dist/src/grist-editor/ox-grist-renderer-resource-object.js.map +1 -0
- package/dist/src/grist-editor/ox-parameters-builder.d.ts +4 -0
- package/dist/src/grist-editor/ox-parameters-builder.js +118 -0
- package/dist/src/grist-editor/ox-parameters-builder.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-code-input.d.ts +12 -0
- package/dist/src/grist-editor/ox-popup-code-input.js +71 -0
- package/dist/src/grist-editor/ox-popup-code-input.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.d.ts +11 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.js +74 -0
- package/dist/src/grist-editor/ox-popup-crontab-input.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-parameters-builder.d.ts +13 -0
- package/dist/src/grist-editor/ox-popup-parameters-builder.js +111 -0
- package/dist/src/grist-editor/ox-popup-parameters-builder.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-partition-keys-input.d.ts +12 -0
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js +98 -0
- package/dist/src/grist-editor/ox-popup-partition-keys-input.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.d.ts +12 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.js +104 -0
- package/dist/src/grist-editor/ox-popup-value-map-input.js.map +1 -0
- package/dist/src/grist-editor/ox-selector-resource-id.d.ts +24 -0
- package/dist/src/grist-editor/ox-selector-resource-id.js +202 -0
- package/dist/src/grist-editor/ox-selector-resource-id.js.map +1 -0
- package/dist/src/grist-editor/ox-selector-resource-object.d.ts +39 -0
- package/dist/src/grist-editor/ox-selector-resource-object.js +343 -0
- package/dist/src/grist-editor/ox-selector-resource-object.js.map +1 -0
- package/dist/src/input/index.d.ts +3 -0
- package/dist/src/input/index.js +4 -0
- package/dist/src/input/index.js.map +1 -0
- package/dist/src/input/ox-input-background-pattern.d.ts +31 -0
- package/dist/src/input/ox-input-background-pattern.js +150 -0
- package/dist/src/input/ox-input-background-pattern.js.map +1 -0
- package/dist/src/input/ox-input-fill-style.d.ts +41 -0
- package/dist/src/input/ox-input-fill-style.js +325 -0
- package/dist/src/input/ox-input-fill-style.js.map +1 -0
- package/dist/src/input/ox-input-graphql.d.ts +36 -0
- package/dist/src/input/ox-input-graphql.js +161 -0
- package/dist/src/input/ox-input-graphql.js.map +1 -0
- package/dist/src/input/ox-input-resource.d.ts +36 -0
- package/dist/src/input/ox-input-resource.js +161 -0
- package/dist/src/input/ox-input-resource.js.map +1 -0
- package/dist/src/property-editor/index.d.ts +24 -0
- package/dist/src/property-editor/index.js +58 -0
- package/dist/src/property-editor/index.js.map +1 -0
- package/dist/src/property-editor/ox-property-editor-graphql.d.ts +5 -0
- package/dist/src/property-editor/ox-property-editor-graphql.js +15 -0
- package/dist/src/property-editor/ox-property-editor-graphql.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -8
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
|
+
### [0.4.4](https://github.com/hatiolab/operato/compare/v0.4.3...v0.4.4) (2022-04-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :rocket: New Features
|
|
10
|
+
|
|
11
|
+
* clipboard API fallback ([bc6a555](https://github.com/hatiolab/operato/commit/bc6a555f84b7af77a8e3a862b0002f41e750913e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
### [0.4.3](https://github.com/hatiolab/operato/compare/v0.4.2...v0.4.3) (2022-03-06)
|
|
7
16
|
|
|
8
17
|
**Note:** Version bump only for package @operato/app
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import '@operato/input/ox-checkbox.js';
|
|
2
|
+
import '../grist-editor/ox-selector-resource-id';
|
|
3
|
+
import { html } from 'lit-html';
|
|
4
|
+
import { i18next } from '@operato/i18n';
|
|
5
|
+
import { openPopup } from '@operato/layout';
|
|
6
|
+
function openResourceSelector(column, value, confirmCallback) {
|
|
7
|
+
const { queryName, select, list, basicArgs, valueField = 'id' } = column.record.options;
|
|
8
|
+
var actualValue;
|
|
9
|
+
if (typeof valueField === 'function') {
|
|
10
|
+
actualValue = valueField(value);
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
actualValue = value === null || value === void 0 ? void 0 : value[valueField];
|
|
14
|
+
}
|
|
15
|
+
var template = html `
|
|
16
|
+
<ox-selector-resource-id
|
|
17
|
+
.value=${actualValue}
|
|
18
|
+
.confirmCallback=${confirmCallback}
|
|
19
|
+
.queryName=${queryName}
|
|
20
|
+
.select=${select}
|
|
21
|
+
.list=${list}
|
|
22
|
+
.basicArgs=${basicArgs}
|
|
23
|
+
.valueField=${valueField}
|
|
24
|
+
></ox-selector-resource-id>
|
|
25
|
+
`;
|
|
26
|
+
const popup = openPopup(template, {
|
|
27
|
+
backdrop: true,
|
|
28
|
+
size: 'large',
|
|
29
|
+
title: i18next.t('title.select_item')
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
export const FilterResourceSelect = (column, value, owner) => {
|
|
33
|
+
const filter = column.filter;
|
|
34
|
+
const { operator = 'like' } = filter;
|
|
35
|
+
return operator === 'like'
|
|
36
|
+
? html ` <input
|
|
37
|
+
type="text"
|
|
38
|
+
name=${column.name}
|
|
39
|
+
.value=${value}
|
|
40
|
+
@change=${(e) => {
|
|
41
|
+
const input = e.target;
|
|
42
|
+
input.dispatchEvent(new CustomEvent('filter-change', {
|
|
43
|
+
bubbles: true,
|
|
44
|
+
composed: true,
|
|
45
|
+
detail: {
|
|
46
|
+
name: column.name,
|
|
47
|
+
operator,
|
|
48
|
+
value: input.value
|
|
49
|
+
}
|
|
50
|
+
}));
|
|
51
|
+
}}
|
|
52
|
+
/>`
|
|
53
|
+
: operator == 'in'
|
|
54
|
+
? html ``
|
|
55
|
+
: operator === 'eq'
|
|
56
|
+
? html `
|
|
57
|
+
<input
|
|
58
|
+
style="min-width: 100px; min-height: 24px"
|
|
59
|
+
type="text"
|
|
60
|
+
name=${column.name}
|
|
61
|
+
.value=${value}
|
|
62
|
+
readonly
|
|
63
|
+
@click=${(e) => {
|
|
64
|
+
e.stopPropagation();
|
|
65
|
+
const confirmCallback = (selected) => {
|
|
66
|
+
var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {};
|
|
67
|
+
owner.dispatchEvent(new CustomEvent('filter-change', {
|
|
68
|
+
bubbles: true,
|
|
69
|
+
composed: true,
|
|
70
|
+
detail: selected ? selected[idField] : ''
|
|
71
|
+
}));
|
|
72
|
+
};
|
|
73
|
+
openResourceSelector(column, value, confirmCallback);
|
|
74
|
+
}}
|
|
75
|
+
/>
|
|
76
|
+
`
|
|
77
|
+
: html ``;
|
|
78
|
+
};
|
|
79
|
+
//# sourceMappingURL=filter-resource-select.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"filter-resource-select.js","sourceRoot":"","sources":["../../../src/filter-renderer/filter-resource-select.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAA;AACtC,OAAO,yCAAyC,CAAA;AAEhD,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAG/B,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAI3C,SAAS,oBAAoB,CAAC,MAAoB,EAAE,KAAU,EAAE,eAAiC;IAC/F,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,GAAG,IAAI,EAAE,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAA;IAEvF,IAAI,WAAW,CAAA;IACf,IAAI,OAAO,UAAU,KAAK,UAAU,EAAE;QACpC,WAAW,GAAG,UAAU,CAAC,KAAK,CAAC,CAAA;KAChC;SAAM;QACL,WAAW,GAAG,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAG,UAAU,CAAC,CAAA;KAClC;IAED,IAAI,QAAQ,GAAG,IAAI,CAAA;;eAEN,WAAW;yBACD,eAAe;mBACrB,SAAS;gBACZ,MAAM;cACR,IAAI;mBACC,SAAS;oBACR,UAAU;;GAE3B,CAAA;IAED,MAAM,KAAK,GAAG,SAAS,CAAC,QAAQ,EAAE;QAChC,QAAQ,EAAE,IAAI;QACd,IAAI,EAAE,OAAO;QACb,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC;KACtC,CAAC,CAAA;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAyB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IACjF,MAAM,MAAM,GAAG,MAAM,CAAC,MAA4B,CAAA;IAClD,MAAM,EAAE,QAAQ,GAAG,MAAM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A;gBACtD,CAAC;;OAEJ;gBACH,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import '@operato/input/ox-checkbox.js'\nimport '../grist-editor/ox-selector-resource-id'\n\nimport { html } from 'lit-html'\n\nimport { ColumnConfig, FilterConfigObject, FilterSelectRenderer } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\ntype SelectedCallback = (value: { id: string; name: string; description: string }) => void\n\nfunction openResourceSelector(column: ColumnConfig, value: any, confirmCallback: SelectedCallback) {\n const { queryName, select, list, basicArgs, valueField = 'id' } = column.record.options\n\n var actualValue\n if (typeof valueField === 'function') {\n actualValue = valueField(value)\n } else {\n actualValue = value?.[valueField]\n }\n\n var template = html`\n <ox-selector-resource-id\n .value=${actualValue}\n .confirmCallback=${confirmCallback}\n .queryName=${queryName}\n .select=${select}\n .list=${list}\n .basicArgs=${basicArgs}\n .valueField=${valueField}\n ></ox-selector-resource-id>\n `\n\n const popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: i18next.t('title.select_item')\n })\n}\n\nexport const FilterResourceSelect: FilterSelectRenderer = (column, value, owner) => {\n const filter = column.filter as FilterConfigObject\n const { operator = 'like' } = filter\n\n return operator === 'like'\n ? html` <input\n type=\"text\"\n name=${column.name}\n .value=${value}\n @change=${(e: CustomEvent) => {\n const input = e.target as HTMLInputElement\n input.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: {\n name: column.name,\n operator,\n value: input.value\n }\n })\n )\n }}\n />`\n : operator == 'in'\n ? html``\n : operator === 'eq'\n ? html`\n <input\n style=\"min-width: 100px; min-height: 24px\"\n type=\"text\"\n name=${column.name}\n .value=${value}\n readonly\n @click=${(e: Event) => {\n e.stopPropagation()\n\n const confirmCallback = (selected?: { [field: string]: any }) => {\n var { idField = 'id', nameField = 'name', descriptionField = 'description' } = column.record.options || {}\n\n owner.dispatchEvent(\n new CustomEvent('filter-change', {\n bubbles: true,\n composed: true,\n detail: selected ? selected[idField] : ''\n })\n )\n }\n\n openResourceSelector(column, value, confirmCallback)\n }}\n />\n `\n : html``\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { registerFilterRenderer } from '@operato/data-grist';
|
|
2
|
+
import { FilterResourceSelect } from './filter-resource-select.js';
|
|
3
|
+
registerFilterRenderer('resource-object', [FilterResourceSelect]);
|
|
4
|
+
registerFilterRenderer('resource-id', [FilterResourceSelect]);
|
|
5
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/filter-renderer/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAA;AAE5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAElE,sBAAsB,CAAC,iBAAiB,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA;AACjE,sBAAsB,CAAC,aAAa,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAA","sourcesContent":["import { registerFilterRenderer } from '@operato/data-grist'\n\nimport { FilterResourceSelect } from './filter-resource-select.js'\n\nregisterFilterRenderer('resource-object', [FilterResourceSelect])\nregisterFilterRenderer('resource-id', [FilterResourceSelect])\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist';
|
|
2
|
+
import { OxGristEditorCrontab } from './ox-grist-editor-crontab.js';
|
|
3
|
+
import { OxGristEditorJson } from './ox-grist-editor-json.js';
|
|
4
|
+
import { OxGristEditorParameters } from './ox-grist-editor-parameters.js';
|
|
5
|
+
import { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js';
|
|
6
|
+
import { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js';
|
|
7
|
+
import { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js';
|
|
8
|
+
import { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js';
|
|
9
|
+
import { OxGristEditorValueMap } from './ox-grist-editor-value-map.js';
|
|
10
|
+
import { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js';
|
|
11
|
+
import { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js';
|
|
12
|
+
import { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js';
|
|
13
|
+
/* register grist renderer/editor for id */
|
|
14
|
+
registerEditor('resource-id', OxGristEditorResourceId);
|
|
15
|
+
registerEditor('resource-object', OxGristEditorResourceObject);
|
|
16
|
+
registerEditor('resource-code', OxGristEditorResourceCode);
|
|
17
|
+
registerEditor('parameters', OxGristEditorParameters);
|
|
18
|
+
registerEditor('value-map', OxGristEditorValueMap);
|
|
19
|
+
registerEditor('partition-keys', OxGristEditorPartitionKeys);
|
|
20
|
+
registerEditor('crontab', OxGristEditorCrontab);
|
|
21
|
+
registerEditor('json', OxGristEditorJson);
|
|
22
|
+
registerRenderer('resource-id', OxGristRendererResourceId);
|
|
23
|
+
registerRenderer('resource-object', OxGristRendererResourceObject);
|
|
24
|
+
registerRenderer('parameters', OxGristRendererJson5);
|
|
25
|
+
registerRenderer('value-map', OxGristRendererJson5);
|
|
26
|
+
registerRenderer('partition-keys', OxGristRendererJson5);
|
|
27
|
+
registerRenderer('crontab', OxGristRendererCrontab);
|
|
28
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/grist-editor/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,cAAc,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AAE5F,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAA;AACnE,OAAO,EAAE,i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CAAC,SAAS,EAAE,sBAAsB,CAAC,CAAA","sourcesContent":["import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'\nimport { OxGristEditorJson } from './ox-grist-editor-json.js'\nimport { OxGristEditorParameters } from './ox-grist-editor-parameters.js'\nimport { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'\nimport { OxGristEditorResourceCode } from './ox-grist-editor-resource-code.js'\nimport { OxGristEditorResourceId } from './ox-grist-editor-resource-id.js'\nimport { OxGristEditorResourceObject } from './ox-grist-editor-resource-object.js'\nimport { OxGristEditorValueMap } from './ox-grist-editor-value-map.js'\nimport { OxGristRendererCrontab } from './ox-grist-renderer-crontab.js'\nimport { OxGristRendererResourceId } from './ox-grist-renderer-resource-id.js'\nimport { OxGristRendererResourceObject } from './ox-grist-renderer-resource-object.js'\n\n/* register grist renderer/editor for id */\nregisterEditor('resource-id', OxGristEditorResourceId)\nregisterEditor('resource-object', OxGristEditorResourceObject)\nregisterEditor('resource-code', OxGristEditorResourceCode)\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('json', OxGristEditorJson)\n\nregisterRenderer('resource-id', OxGristRendererResourceId)\nregisterRenderer('resource-object', OxGristRendererResourceObject)\nregisterRenderer('parameters', OxGristRendererJson5)\nregisterRenderer('value-map', OxGristRendererJson5)\nregisterRenderer('partition-keys', OxGristRendererJson5)\nregisterRenderer('crontab', OxGristRendererCrontab)\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './ox-popup-code-input.js';
|
|
2
|
+
import { OxGristEditor } from '@operato/data-grist';
|
|
3
|
+
export declare class OxGristEditorCode extends OxGristEditor {
|
|
4
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
firstUpdated(): Promise<void>;
|
|
6
|
+
showEditorPopup(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './ox-popup-code-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 OxGristEditorCode = class OxGristEditorCode 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
|
+
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('field-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
|
+
.confirmCallback=${change.bind(this)}
|
|
41
|
+
></ox-popup-code-input>
|
|
42
|
+
`, {
|
|
43
|
+
backdrop: true,
|
|
44
|
+
title: i18next.t('title.edit code'),
|
|
45
|
+
help: 'data-grist/grist-editor/code'
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
OxGristEditorCode = __decorate([
|
|
50
|
+
customElement('ox-grist-editor-code')
|
|
51
|
+
], OxGristEditorCode);
|
|
52
|
+
export { OxGristEditorCode };
|
|
53
|
+
//# 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,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAA;AAG3C,IAAa,iBAAiB,GAA9B,MAAa,iBAAkB,SAAQ,aAAa;IAClD,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,cAAc,EAAE;gBAC9B,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;6BACQ,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;;OAEvC,EACD;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC;YACnC,IAAI,EAAE,8BAA8B;SACrC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAnDY,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAmD7B;SAnDY,iBAAiB","sourcesContent":["import './ox-popup-code-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 } from '@operato/layout'\n\n@customElement('ox-grist-editor-code')\nexport class OxGristEditorCode extends OxGristEditor {\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('field-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 .confirmCallback=${change.bind(this)}\n ></ox-popup-code-input>\n `,\n {\n backdrop: true,\n title: i18next.t('title.edit code'),\n help: 'data-grist/grist-editor/code'\n }\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,EAAE,MAAM,mBAAmB,CAAA;AAEjD,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,oBAAoB,GAAjC,MAAa,oBAAqB,SAAQ,aAAa;IAGrD,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,IAAI,CAAC,KAAK,EAAE;YACd,OAAO,IAAI,CAAC,KAAK,CAAA;SAClB;QAED,MAAM,eAAe,GAAG,CAAC,MAAW,EAAE,EAAE;YACtC,IAAI,CAAC,aAAa,CAChB,IAAI,WAAW,CAAC,cAAc,EAAE;gBAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,MAAM;oBACb,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,CAAC,KAAK,GAAG,SAAS,CACpB,IAAI,CAAA;yCAC+B,IAAI,CAAC,KAAK,qBAAqB,eAAe;OAChF,EACD;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,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"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import './ox-popup-code-input.js';
|
|
2
|
+
import { OxGristEditor } from '@operato/data-grist';
|
|
3
|
+
export declare class OxGristEditorJson extends OxGristEditor {
|
|
4
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
firstUpdated(): Promise<void>;
|
|
6
|
+
showEditorPopup(): void;
|
|
7
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './ox-popup-code-input.js';
|
|
3
|
+
import { OxGristEditor } 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 OxGristEditorJson = class OxGristEditorJson 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
|
+
var change = (value) => {
|
|
22
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
23
|
+
bubbles: true,
|
|
24
|
+
composed: true,
|
|
25
|
+
detail: {
|
|
26
|
+
before: this.value,
|
|
27
|
+
after: value,
|
|
28
|
+
column: this.column,
|
|
29
|
+
record: this.record,
|
|
30
|
+
row: this.row
|
|
31
|
+
}
|
|
32
|
+
}));
|
|
33
|
+
};
|
|
34
|
+
var popup = openPopup(html `
|
|
35
|
+
<ox-popup-code-input
|
|
36
|
+
.value=${this.value}
|
|
37
|
+
mode="javascript"
|
|
38
|
+
@change=${(e) => {
|
|
39
|
+
change(e.detail.value);
|
|
40
|
+
popup.close();
|
|
41
|
+
}}
|
|
42
|
+
></ox-popup-code-input>
|
|
43
|
+
`, {
|
|
44
|
+
backdrop: true,
|
|
45
|
+
title: i18next.t('title.setting schedule'),
|
|
46
|
+
help: 'data-grist/grist-editor/code'
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
OxGristEditorJson = __decorate([
|
|
51
|
+
customElement('ox-grist-editor-json')
|
|
52
|
+
], OxGristEditorJson);
|
|
53
|
+
export { OxGristEditorJson };
|
|
54
|
+
//# sourceMappingURL=ox-grist-editor-json.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-json.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-grist-editor-json.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,IAAI,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,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC;YAC1C,IAAI,EAAE,8BAA8B;SACrC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AApDY,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CAoD7B;SApDY,iBAAiB","sourcesContent":["import './ox-popup-code-input.js'\n\nimport { OxGristEditor } 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-json')\nexport class OxGristEditorJson extends OxGristEditor {\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 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=\"javascript\"\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"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,CAAC,IAAI,CAAC,KAAK,CAAA;QACtF,OAAO,IAAI,CAAA,IAAI,KAAK,IAAI,EAAE,GAAG,CAAA;IAC/B,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,YAAY,EAAE,CAAA;QACrB,CAAC,CAAC,CAAA;QAEF,IAAI,CAAC,YAAY,EAAE,CAAA;IACrB,CAAC;IAED,KAAK,CAAC,YAAY;QAChB,IAAI,IAAI,CAAC,KAAK,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A;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"]}
|
|
@@ -0,0 +1,11 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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,IAA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BAC9B,OAAO,EAAE,IAAI;gBACb,QAAQ,EAAE,IAAI;gBACd,MAAM,EAAE;oBACN,MAAM,EAAE,IAAI,CAAC,KAAK;oBAClB,KAAK,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM;oBACrD,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;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"]}
|