@operato/grist-editor 9.0.0-beta.0 → 9.0.0-beta.10
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 +44 -0
- package/dist/src/index.js +2 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-grist-editor-crontab.js +9 -0
- package/dist/src/ox-grist-editor-crontab.js.map +1 -1
- package/dist/src/ox-grist-editor-duration.js +9 -0
- package/dist/src/ox-grist-editor-duration.js.map +1 -1
- package/dist/src/ox-grist-editor-hashtags.js +9 -0
- package/dist/src/ox-grist-editor-hashtags.js.map +1 -1
- package/dist/src/ox-grist-editor-i18n-label.js +9 -0
- package/dist/src/ox-grist-editor-i18n-label.js.map +1 -1
- package/dist/src/ox-grist-editor-parameters.js +9 -0
- package/dist/src/ox-grist-editor-parameters.js.map +1 -1
- package/dist/src/ox-grist-editor-partition-keys.js +9 -0
- package/dist/src/ox-grist-editor-partition-keys.js.map +1 -1
- package/dist/src/ox-grist-editor-value-map.js +9 -0
- package/dist/src/ox-grist-editor-value-map.js.map +1 -1
- package/dist/src/ox-grist-editor-value-ranges.js +9 -0
- package/dist/src/ox-grist-editor-value-ranges.js.map +1 -1
- package/dist/src/ox-grist-renderer-crontab.js +1 -1
- package/dist/src/ox-grist-renderer-crontab.js.map +1 -1
- package/dist/src/ox-parameters-builder.js +27 -0
- package/dist/src/ox-parameters-builder.js.map +1 -1
- package/dist/src/ox-popup-crontab-input.js +25 -5
- package/dist/src/ox-popup-crontab-input.js.map +1 -1
- package/dist/src/ox-popup-duration-input.js +25 -5
- package/dist/src/ox-popup-duration-input.js.map +1 -1
- package/dist/src/ox-popup-hashtags-input.js +22 -6
- package/dist/src/ox-popup-hashtags-input.js.map +1 -1
- package/dist/src/ox-popup-i18n-label-input.js +28 -6
- package/dist/src/ox-popup-i18n-label-input.js.map +1 -1
- package/dist/src/ox-popup-parameters-builder.js +43 -5
- package/dist/src/ox-popup-parameters-builder.js.map +1 -1
- package/dist/src/ox-popup-partition-keys-input.js +28 -6
- package/dist/src/ox-popup-partition-keys-input.js.map +1 -1
- package/dist/src/ox-popup-value-map-input.js +34 -6
- package/dist/src/ox-popup-value-map-input.js.map +1 -1
- package/dist/src/ox-popup-value-ranges-input.js +34 -6
- package/dist/src/ox-popup-value-ranges-input.js.map +1 -1
- package/dist/stories/ox-grist-editor-crontab.stories.js +200 -185
- package/dist/stories/ox-grist-editor-crontab.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -9
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,50 @@
|
|
|
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
|
+
## [9.0.0-beta.10](https://github.com/hatiolab/operato/compare/v9.0.0-beta.9...v9.0.0-beta.10) (2025-01-25)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### :bug: Bug Fix
|
|
10
|
+
|
|
11
|
+
* tweak tsconfig.json ([3c424b1](https://github.com/hatiolab/operato/commit/3c424b18d046f95d5619076d113d49a4b4dc9bbb))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [9.0.0-beta.7](https://github.com/hatiolab/operato/compare/v9.0.0-beta.6...v9.0.0-beta.7) (2025-01-20)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @operato/grist-editor
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
## [9.0.0-beta.6](https://github.com/hatiolab/operato/compare/v9.0.0-beta.5...v9.0.0-beta.6) (2025-01-20)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### :bug: Bug Fix
|
|
27
|
+
|
|
28
|
+
* esm module ([9642b97](https://github.com/hatiolab/operato/commit/9642b97650623d9ce71f6db0fd1995a2379205b5))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
## [9.0.0-beta.5](https://github.com/hatiolab/operato/compare/v9.0.0-beta.4...v9.0.0-beta.5) (2025-01-20)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
### :bug: Bug Fix
|
|
36
|
+
|
|
37
|
+
* esm module ([1319b00](https://github.com/hatiolab/operato/commit/1319b00d6955a514f63b3469fb514a28f84168a2))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
## [9.0.0-beta.4](https://github.com/hatiolab/operato/compare/v9.0.0-beta.3...v9.0.0-beta.4) (2025-01-20)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### :bug: Bug Fix
|
|
45
|
+
|
|
46
|
+
* esm module ([0402232](https://github.com/hatiolab/operato/commit/04022327fa47eac64eaf3c56eeec55b9ace13e0e))
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
|
|
6
50
|
## [9.0.0-beta.0](https://github.com/hatiolab/operato/compare/v8.0.0-beta.11...v9.0.0-beta.0) (2025-01-13)
|
|
7
51
|
|
|
8
52
|
**Note:** Version bump only for package @operato/grist-editor
|
package/dist/src/index.js
CHANGED
|
@@ -7,8 +7,8 @@ import { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'
|
|
|
7
7
|
import { OxGristEditorQuantifier } from './ox-grist-editor-quantifier.js';
|
|
8
8
|
import { OxGristEditorValueMap } from './ox-grist-editor-value-map.js';
|
|
9
9
|
import { OxGristRendererDuration } from './ox-grist-renderer-duration.js';
|
|
10
|
-
import { OxGristRendererQuantifier } from './ox-grist-renderer-quantifier';
|
|
11
|
-
import { OxGristRendererHashtags } from './ox-grist-renderer-hashtags';
|
|
10
|
+
import { OxGristRendererQuantifier } from './ox-grist-renderer-quantifier.js';
|
|
11
|
+
import { OxGristRendererHashtags } from './ox-grist-renderer-hashtags.js';
|
|
12
12
|
import { OxGristRendererPartitionKeys } from './ox-grist-renderer-partition-keys.js';
|
|
13
13
|
import { OxGristEditorValueRanges } from './ox-grist-editor-value-ranges.js';
|
|
14
14
|
import { OxGristEditorI18nLabel } from './ox-grist-editor-i18n-label.js';
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/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,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AACtE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,yBAAyB,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/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,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAA;AACrE,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,qCAAqC,CAAA;AAChF,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAA;AACzE,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAg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AAChE,gBAAgB,CAAC,UAAU,EAAE,uBAAuB,CAAC,CAAA;AACrD,gBAAgB,CAAC,YAAY,EAAE,yBAAyB,CAAC,CAAA;AACzD,gBAAgB,CAAC,UAAU,EAAE,uBAAuB,CAAC,CAAA;AACrD,gBAAgB,CAAC,YAAY,EAAE,wBAAwB,CAAC,CAAA;AACxD,gBAAgB,CAAC,WAAW,EAAE,wBAAwB,CAAC,CAAA","sourcesContent":["import { OxGristRendererJson5, registerEditor, registerRenderer } from '@operato/data-grist'\n\nimport { OxGristEditorCrontab } from './ox-grist-editor-crontab.js'\nimport { OxGristEditorDuration } from './ox-grist-editor-duration.js'\nimport { OxGristEditorHashtags } from './ox-grist-editor-hashtags.js'\nimport { OxGristEditorParameters } from './ox-grist-editor-parameters.js'\nimport { OxGristEditorPartitionKeys } from './ox-grist-editor-partition-keys.js'\nimport { OxGristEditorQuantifier } from './ox-grist-editor-quantifier.js'\nimport { OxGristEditorValueMap } from './ox-grist-editor-value-map.js'\nimport { OxGristRendererDuration } from './ox-grist-renderer-duration.js'\nimport { OxGristRendererQuantifier } from './ox-grist-renderer-quantifier.js'\nimport { OxGristRendererHashtags } from './ox-grist-renderer-hashtags.js'\nimport { OxGristRendererPartitionKeys } from './ox-grist-renderer-partition-keys.js'\nimport { OxGristEditorValueRanges } from './ox-grist-editor-value-ranges.js'\nimport { OxGristEditorI18nLabel } from './ox-grist-editor-i18n-label.js'\nimport { OxGristRendererI18nLabel } from './ox-grist-renderer-i18n-label.js'\nimport { OxGristRendererSignature } from './ox-grist-renderer-signature.js'\nimport { OxGristEditorSignature } from './ox-grist-editor-signature.js'\n\n/* register grist renderer/editor for id */\nregisterEditor('parameters', OxGristEditorParameters)\nregisterEditor('value-map', OxGristEditorValueMap)\nregisterEditor('value-ranges', OxGristEditorValueRanges)\nregisterEditor('partition-keys', OxGristEditorPartitionKeys)\nregisterEditor('crontab', OxGristEditorCrontab)\nregisterEditor('duration', OxGristEditorDuration)\nregisterEditor('quantifier', OxGristEditorQuantifier)\nregisterEditor('hashtags', OxGristEditorHashtags)\nregisterEditor('i18n-label', OxGristEditorI18nLabel)\nregisterEditor('signature', OxGristEditorSignature)\n\nregisterRenderer('parameters', OxGristRendererJson5)\nregisterRenderer('value-map', OxGristRendererJson5)\nregisterRenderer('value-ranges', OxGristRendererJson5)\nregisterRenderer('partition-keys', OxGristRendererPartitionKeys)\nregisterRenderer('duration', OxGristRendererDuration)\nregisterRenderer('quantifier', OxGristRendererQuantifier)\nregisterRenderer('hashtags', OxGristRendererHashtags)\nregisterRenderer('i18n-label', OxGristRendererI18nLabel)\nregisterRenderer('signature', OxGristRendererSignature)\n"]}
|
|
@@ -6,6 +6,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
6
6
|
import { i18next } from '@operato/i18n';
|
|
7
7
|
import { openPopup } from '@operato/popup';
|
|
8
8
|
let OxGristEditorCrontab = class OxGristEditorCrontab extends OxGristEditor {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
Object.defineProperty(this, "popup", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
9
18
|
get editorTemplate() {
|
|
10
19
|
return html ` <div tabindex="0">${this.value || ''}</div> `;
|
|
11
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-crontab.js","sourceRoot":"","sources":["../../src/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,gBAA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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;AApDY,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAoDhC","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/popup'\n\n@customElement('ox-grist-editor-crontab')\nexport class OxGristEditorCrontab extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return html` <div tabindex=\"0\">${this.value || ''}</div> `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.showEditorPopup()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.showEditorPopup()\n }\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"]}
|
|
@@ -6,6 +6,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
6
6
|
import { i18next } from '@operato/i18n';
|
|
7
7
|
import { openPopup } from '@operato/popup';
|
|
8
8
|
let OxGristEditorDuration = class OxGristEditorDuration extends OxGristEditor {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
Object.defineProperty(this, "popup", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
9
18
|
get editorTemplate() {
|
|
10
19
|
return html ` <div tabindex="0">${this.value || ''}</div> `;
|
|
11
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-duration.js","sourceRoot":"","sources":["../../src/ox-grist-editor-duration.ts"],"names":[],"mappings":";AAAA,OAAO,8BAA8B,CAAA;AAErC,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,gBAAgB,CAAA;AAGhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-duration.js","sourceRoot":"","sources":["../../src/ox-grist-editor-duration.ts"],"names":[],"mappings":";AAAA,OAAO,8BAA8B,CAAA;AAErC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,aAAa,EAAE,M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D;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC;YACvC,IAAI,EAAE,kCAAkC;SACzC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AApDY,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAoDjC","sourcesContent":["import './ox-popup-duration-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/popup'\n\n@customElement('ox-grist-editor-duration')\nexport class OxGristEditorDuration extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return html` <div tabindex=\"0\">${this.value || ''}</div> `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.showEditorPopup()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.showEditorPopup()\n }\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-duration-input .value=${this.value} .confirmCallback=${confirmCallback}></ox-popup-duration-input>\n `,\n {\n backdrop: true,\n title: i18next.t('title.edit duration'),\n help: 'data-grist/grist-editor/duration'\n }\n )\n }\n}\n"]}
|
|
@@ -6,6 +6,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
6
6
|
import { i18next } from '@operato/i18n';
|
|
7
7
|
import { openPopup } from '@operato/popup';
|
|
8
8
|
let OxGristEditorHashtags = class OxGristEditorHashtags extends OxGristEditor {
|
|
9
|
+
constructor() {
|
|
10
|
+
super(...arguments);
|
|
11
|
+
Object.defineProperty(this, "popup", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
}
|
|
9
18
|
get editorTemplate() {
|
|
10
19
|
const value = this.value;
|
|
11
20
|
return html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-hashtags.js","sourceRoot":"","sources":["../../src/ox-grist-editor-hashtags.ts"],"names":[],"mappings":";AAAA,OAAO,8BAA8B,CAAA;AAErC,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,gBAAgB,CAAA;AAGhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-hashtags.js","sourceRoot":"","sources":["../../src/ox-grist-editor-hashtags.ts"],"names":[],"mappings":";AAAA,OAAO,8BAA8B,CAAA;AAErC,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,gBAAgB,CAAA;AAGhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,aAAa;IAAjD;;QACG;;;;;WAAmB;IAwD7B,CAAC;IAtDC,IAAI,cAAc;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QAExB,OAAO,IAAI,CAAA;;UAEL,KAAK,IAAI,KAAK,CAAC,MAAM,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AAqB,eAAe,8BAA8B,EAC/G;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC;SACxC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AAzDY,qBAAqB;IADjC,aAAa,CAAC,0BAA0B,CAAC;GAC7B,qBAAqB,CAyDjC","sourcesContent":["import './ox-popup-hashtags-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/popup'\n\n@customElement('ox-grist-editor-hashtags')\nexport class OxGristEditorHashtags extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n const value = this.value\n\n return html`\n <div tabindex=\"0\">\n ${value && value.length > 0 ? (value as string[]).map(x => `#${x}`).join(' ') : '\\u00A0' /* */}\n </div>\n `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.showEditorPopup()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.showEditorPopup()\n }\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 const value = Array.isArray(this.value) ? [...this.value] : []\n\n this.popup = openPopup(\n html` <ox-popup-hashtags-input .value=${value} .confirmCallback=${confirmCallback}></ox-popup-hashtags-input> `,\n {\n backdrop: true,\n title: i18next.t('title.edit hashtags')\n }\n )\n }\n}\n"]}
|
|
@@ -10,6 +10,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
10
10
|
import { i18next } from '@operato/i18n';
|
|
11
11
|
import { openPopup } from '@operato/popup';
|
|
12
12
|
let OxGristEditorI18nLabel = class OxGristEditorI18nLabel extends OxGristEditor {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
Object.defineProperty(this, "popup", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
get options() {
|
|
14
23
|
var _a;
|
|
15
24
|
return ((_a = this.column.record) === null || _a === void 0 ? void 0 : _a.options) || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-i18n-label.js","sourceRoot":"","sources":["../../src/ox-grist-editor-i18n-label.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAGhD,IAAM,sBAAsB,GAA5B,MAAM,sBAAuB,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-i18n-label.js","sourceRoot":"","sources":["../../src/ox-grist-editor-i18n-label.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,gCAAgC,CAAA;AAEvC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAA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BAAsB;IADlC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,sBAAsB,CAmFlC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-popup-i18n-label-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\nimport json5 from 'json5'\n\nimport { cloneDeep } from 'lodash-es'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/popup'\n\n@customElement('ox-grist-editor-i18n-label')\nexport class OxGristEditorI18nLabel extends OxGristEditor {\n private popup?: PopupHandle\n\n get options() {\n return this.column.record?.options || {}\n }\n\n get editorTemplate() {\n const { displayColumn } = this.column.record.options || {}\n\n const value =\n this.value && typeof this.value === 'object'\n ? this.value[i18next.language || 'en-US']\n : displayColumn\n ? this.record[displayColumn]\n : ''\n\n return html`<div tabindex=\"0\">${value || ''}</div>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help, languages, objectified = false } = this.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-i18n-label-input .value=${value} .languages=${languages} .confirmCallback=${confirmCallback}>\n </ox-popup-i18n-label-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('title.i18n-label')} `,\n help\n })\n }\n}\n"]}
|
|
@@ -11,6 +11,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
11
11
|
import { i18next } from '@operato/i18n';
|
|
12
12
|
import { openPopup } from '@operato/popup';
|
|
13
13
|
let OxGristEditorParameters = class OxGristEditorParameters extends OxGristEditor {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
Object.defineProperty(this, "popup", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
configurable: true,
|
|
19
|
+
writable: true,
|
|
20
|
+
value: void 0
|
|
21
|
+
});
|
|
22
|
+
}
|
|
14
23
|
get editorTemplate() {
|
|
15
24
|
const value = this.value && typeof this.value === 'object' ? JSON.stringify(this.value) : this.value;
|
|
16
25
|
return html ` <div tabindex="0">${value || ''}</div> `;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-parameters.js","sourceRoot":"","sources":["../../src/ox-grist-editor-parameters.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,4BAA4B,CAAA;AACnC,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,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IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAA;QACzG,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,KAAK,GAAQ,EAAE,CAAA;QACrB,CAAC;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;AAnFY,uBAAuB;IADnC,aAAa,CAAC,4BAA4B,CAAC;GAC/B,uBAAuB,CAmFnC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-parameters-builder.js'\nimport './ox-popup-parameters-builder.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/popup'\n\n@customElement('ox-grist-editor-parameters')\nexport class OxGristEditorParameters extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n const value = this.value && typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html` <div tabindex=\"0\">${value || ''}</div> `\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\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"]}
|
|
@@ -10,6 +10,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
10
10
|
import { i18next } from '@operato/i18n';
|
|
11
11
|
import { openPopup } from '@operato/popup';
|
|
12
12
|
let OxGristEditorPartitionKeys = class OxGristEditorPartitionKeys extends OxGristEditor {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
Object.defineProperty(this, "popup", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
get editorTemplate() {
|
|
14
23
|
return this.value && this.value instanceof Array && this.value.length > 0
|
|
15
24
|
? html `<md-icon style="--md-icon-size:1.3em">key</md-icon>`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-partition-keys.js","sourceRoot":"","sources":["../../src/ox-grist-editor-partition-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAGhD,IAAM,0BAA0B,GAAhC,MAAM,0BAA2B,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-partition-keys.js","sourceRoot":"","sources":["../../src/ox-grist-editor-partition-keys.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MA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C,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,CAAC;YACH,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;QACzG,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,KAAK,GAAQ,EAAE,CAAA;QACrB,CAAC;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;AAxEY,0BAA0B;IADtC,aAAa,CAAC,gCAAgC,CAAC;GACnC,0BAA0B,CAwEtC","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/popup'\n\n@customElement('ox-grist-editor-partition-keys')\nexport class OxGristEditorPartitionKeys extends OxGristEditor {\n private popup?: PopupHandle\n\n get editorTemplate() {\n return this.value && this.value instanceof Array && this.value.length > 0\n ? html`<md-icon style=\"--md-icon-size:1.3em\">key</md-icon>`\n : html``\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\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"]}
|
|
@@ -10,6 +10,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
10
10
|
import { i18next } from '@operato/i18n';
|
|
11
11
|
import { openPopup } from '@operato/popup';
|
|
12
12
|
let OxGristEditorValueMap = class OxGristEditorValueMap extends OxGristEditor {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
Object.defineProperty(this, "popup", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
get options() {
|
|
14
23
|
var _a;
|
|
15
24
|
return ((_a = this.column.record) === null || _a === void 0 ? void 0 : _a.options) || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-value-map.js","sourceRoot":"","sources":["../../src/ox-grist-editor-value-map.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAGhD,IAAM,qBAAqB,GAA3B,MAAM,qBAAsB,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-value-map.js","sourceRoot":"","sources":["../../src/ox-grist-editor-value-map.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,+BAA+B,CAAA;AAEtC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,O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port './ox-popup-value-map-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { cloneDeep } from 'lodash-es'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup, PopupHandle } from '@operato/popup'\n\n@customElement('ox-grist-editor-value-map')\nexport class OxGristEditorValueMap extends OxGristEditor {\n private popup?: PopupHandle\n\n get options() {\n return this.column.record?.options || {}\n }\n\n get editorTemplate() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html`<div tabindex=\"0\">${value || ''}</div>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help, valuetype = 'string', defaultValue, objectified = false } = this.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-value-map-input\n .value=${value}\n .valuetype=${valuetype}\n .defaultValue=${defaultValue}\n .confirmCallback=${confirmCallback}\n >\n </ox-popup-value-map-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('title.value-map')} `,\n help\n })\n }\n}\n"]}
|
|
@@ -10,6 +10,15 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
10
10
|
import { i18next } from '@operato/i18n';
|
|
11
11
|
import { openPopup } from '@operato/popup';
|
|
12
12
|
let OxGristEditorValueRanges = class OxGristEditorValueRanges extends OxGristEditor {
|
|
13
|
+
constructor() {
|
|
14
|
+
super(...arguments);
|
|
15
|
+
Object.defineProperty(this, "popup", {
|
|
16
|
+
enumerable: true,
|
|
17
|
+
configurable: true,
|
|
18
|
+
writable: true,
|
|
19
|
+
value: void 0
|
|
20
|
+
});
|
|
21
|
+
}
|
|
13
22
|
get options() {
|
|
14
23
|
var _a;
|
|
15
24
|
return ((_a = this.column.record) === null || _a === void 0 ? void 0 : _a.options) || {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-editor-value-ranges.js","sourceRoot":"","sources":["../../src/ox-grist-editor-value-ranges.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,kCAAkC,CAAA;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC1B,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAErC,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAA;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,SAAS,EAAe,MAAM,gBAAgB,CAAA;AAGhD,IAAM,wBAAwB,GAA9B,MAAM,wBAAyB,SAAQ,aAAa;
|
|
1
|
+
{"version":3,"file":"ox-grist-editor-value-ranges.js","sour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AAO;YACb,KAAK,EAAE,GAAG,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,WAAW,EAAE,KAAI,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,GAAG;YACnE,IAAI;SACL,CAAC,CAAA;IACJ,CAAC;CACF,CAAA;AAhFY,wBAAwB;IADpC,aAAa,CAAC,8BAA8B,CAAC;GACjC,wBAAwB,CAgFpC","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport './ox-popup-value-ranges-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/popup'\n\n@customElement('ox-grist-editor-value-ranges')\nexport class OxGristEditorValueRanges extends OxGristEditor {\n private popup?: PopupHandle\n\n get options() {\n return this.column.record?.options || {}\n }\n\n get editorTemplate() {\n const value = typeof this.value === 'object' ? JSON.stringify(this.value) : this.value\n return html`<div tabindex=\"0\">${value || ''}</div>`\n }\n\n _onclick(e: Event): void {\n e.stopPropagation()\n this.openSelector()\n }\n\n _onkeydown(e: KeyboardEvent): void {\n const key = e.key\n if (key == 'Enter') {\n e.stopPropagation()\n this.openSelector()\n }\n }\n\n async openSelector() {\n if (this.popup) {\n delete this.popup\n }\n\n const { name, help, valuetype = 'string', defaultValue, objectified = false } = this.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-value-ranges-input\n .value=${value}\n .valuetype=${valuetype}\n .defaultValue=${defaultValue}\n .confirmCallback=${confirmCallback}\n >\n </ox-popup-value-ranges-input>\n `\n\n this.popup = openPopup(template, {\n backdrop: true,\n size: 'large',\n title: `${name?.toUpperCase() || i18next.t('title.value-ranges')} `,\n help\n })\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-renderer-crontab.js","sourceRoot":"","sources":["../../src/ox-grist-renderer-crontab.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,
|
|
1
|
+
{"version":3,"file":"ox-grist-renderer-crontab.js","sourceRoot":"","sources":["../../src/ox-grist-renderer-crontab.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,mBAAmB,CAAA;AACzC,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAI1B,MAAM,CAAC,MAAM,sBAAsB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAC9F,IAAI,IAAI,GAAG,EAAE,CAAA;IAEb,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;QAC3D,IAAI,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,QAAQ,IAAI,IAAI,EAAE,CAAC,CAAA;IAC9E,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;IAClB,CAAC;IAED,OAAO,IAAI,CAAA,+BAA+B,IAAI,SAAS,CAAA;AACzD,CAAC,CAAA","sourcesContent":["import cronstrue from 'cronstrue/i18n.js'\nimport i18next from 'i18next'\nimport { html } from 'lit'\n\nimport { FieldRenderer } from '@operato/data-grist'\n\nexport const OxGristRendererCrontab: FieldRenderer = (value, column, record, rowIndex, field) => {\n let text = ''\n\n try {\n const language = (i18next.language || 'en').substring(0, 2)\n text = !value ? '' : cronstrue.toString(value, { locale: language || 'en' })\n } catch (e) {\n console.error(e)\n }\n\n return html`<span data-reactive-tooltip>${text}</span>`\n}\n"]}
|
|
@@ -38,6 +38,33 @@ const DEFAULT_VALUE = {
|
|
|
38
38
|
date: null
|
|
39
39
|
};
|
|
40
40
|
let OxParametersBuilder = class OxParametersBuilder extends LitElement {
|
|
41
|
+
constructor() {
|
|
42
|
+
super(...arguments);
|
|
43
|
+
Object.defineProperty(this, "value", {
|
|
44
|
+
enumerable: true,
|
|
45
|
+
configurable: true,
|
|
46
|
+
writable: true,
|
|
47
|
+
value: void 0
|
|
48
|
+
});
|
|
49
|
+
Object.defineProperty(this, "props", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: void 0
|
|
54
|
+
});
|
|
55
|
+
Object.defineProperty(this, "host", {
|
|
56
|
+
enumerable: true,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true,
|
|
59
|
+
value: void 0
|
|
60
|
+
});
|
|
61
|
+
Object.defineProperty(this, "context", {
|
|
62
|
+
enumerable: true,
|
|
63
|
+
configurable: true,
|
|
64
|
+
writable: true,
|
|
65
|
+
value: void 0
|
|
66
|
+
});
|
|
67
|
+
}
|
|
41
68
|
render() {
|
|
42
69
|
return html `<slot></slot>`;
|
|
43
70
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-parameters-builder.js","sourceRoot":"","sources":["../../src/ox-parameters-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAA2B,MAAM,0BAA0B,CAAA;AAEpF;;;;;;;;;;;EAWE;AAEF,MAAM,aAAa,GAAG;IACpB,MAAM,EAAE,EAAE;IACV,MAAM,EAAE,CAAC;IACT,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,EAAE;IACV,IAAI,EAAE,EAAE;IACR,QAAQ,EAAE,EAAE;IACZ,QAAQ,EAAE,KAAK;IACf,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,SAAS;IAChB,kBAAkB,EAAE,IAAI;IACxB,qBAAqB,EAAE,IAAI;IAC3B,eAAe,EAAE,EAAE;IACnB,gBAAgB,EAAE,EAAE;IACpB,aAAa,EAAE,IAAI;IACnB,WAAW,EAAE,IAAI;IACjB,aAAa,EAAE,EAAE;IACjB,OAAO,EAAE,IAAI;IACb,IAAI,EAAE,IAAI;CACJ,CAAA;AAGD,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"ox-parameters-builder.js","sourceRoot":"","sources":["../../src/ox-parameters-builder.ts"],"names":[],"mappings":"AAAA;;GAEG;;AAEH,OAAO,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AACtD,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,gBAAgB,EAA2B,MAAM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,IAAI,WAAW,CAAC,iBAAiB,EAAE;YACjC,OAAO,EAAE,IAAI;YACb,QAAQ,EAAE,IAAI;YACd,MAAM,EAAE,IAAI,CAAC,UAAU,EAAE;SAC1B,CAAC,CACH,CAAA;IACH,CAAC;CACF,CAAA;AAxF6B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAW;AACX;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;kDAAuB;AACrB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAU;AACT;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;oDAAa;AAJ7B,mBAAmB;IAD/B,aAAa,CAAC,uBAAuB,CAAC;GAC1B,mBAAmB,CAyF/B","sourcesContent":["/**\n * @license Copyright © HatioLab Inc. All rights reserved.\n */\n\nimport { html, LitElement, PropertyValues } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { OxPropertyEditor, PropertySpec, CSSStyles } from '@operato/property-editor'\n\n/**\n모든 에디터들은 change 이벤트를 지원해야 한다. 또한, 모든 에디터들은 value속성에 값을 가져야 한다.\n\nExample:\n\n <ox-parameters-builder value=\"{{value}}\">\n <label>Center X</label>\n <input type=\"number\" .value=\"${value.cx}\">\n <label>Width</label>\n <input type=\"number\" .value=\"${value.width}\">\n </ox-parameters-builder>\n*/\n\nconst DEFAULT_VALUE = {\n legend: '',\n number: 0,\n angle: 0,\n string: '',\n text: '',\n textarea: '',\n checkbox: false,\n select: '',\n color: '#000000',\n 'solidcolor-stops': null,\n 'gradientcolor-stops': null,\n 'gltf-selector': '',\n 'image-selector': '',\n multiplecolor: null,\n editortable: null,\n imageselector: '',\n options: null,\n date: null\n} as any\n\n@customElement('ox-parameters-builder')\nexport class OxParametersBuilder extends LitElement {\n @property({ type: Object }) value: any\n @property({ type: Array }) props?: PropertySpec[]\n @property({ type: Object }) host: any\n @property({ type: Object }) context: any\n\n render() {\n return html`<slot></slot>`\n }\n\n firstUpdated() {\n this.addEventListener('change', this._onValueChanged.bind(this))\n }\n\n updated(changes: PropertyValues<this>) {\n changes.has('props') && this._onPropsChanged(this.props)\n changes.has('value') && this._setValues()\n }\n\n _onPropsChanged(props: PropertySpec[] | undefined) {\n this.textContent = ''\n ;(props || []).forEach(prop => {\n let elementType = OxPropertyEditor.getEditor(prop.type)\n if (!elementType) {\n console.warn('Property Editor not defined', prop.type)\n return\n }\n let element = document.createElement(elementType) as OxPropertyEditor\n\n element.label = prop.label\n element.type = prop.type\n element.placeholder = prop.placeholder\n element.host = this.host\n element.context = this.context\n element.setAttribute('name', prop.name)\n\n if (prop.observe) {\n element.observe = prop.observe\n }\n element.property = prop.property\n element.editor = prop.editor\n element.setAttribute('property-editor', '')\n\n if (prop.styles) {\n Object.keys(prop.styles).forEach((key: string) => {\n element.style[key as keyof CSSStyles] = prop.styles![key as keyof CSSStyles]\n })\n }\n\n this.appendChild(element)\n })\n }\n\n _setValues() {\n var value = this.value || {}\n Array.from(this.querySelectorAll('[name]')).forEach(propertyEditor => {\n const editor = propertyEditor as OxPropertyEditor\n let name = editor.getAttribute('name')\n editor.value = value[name!] === undefined ? DEFAULT_VALUE[editor.type] : value[name!]\n })\n }\n\n _getValues() {\n var value = {} as any\n Array.from(this.querySelectorAll('[name]')).forEach(propertyEditor => {\n const editor = propertyEditor as OxPropertyEditor\n let name = editor.getAttribute('name')\n value[name!] = editor.value === undefined ? DEFAULT_VALUE[editor.type] : editor.value\n })\n\n return value\n }\n\n _onValueChanged(e: Event) {\n e.stopPropagation()\n var prop = e.target as HTMLElement\n\n if (!prop || !prop.hasAttribute('property-editor')) {\n return\n }\n\n this.dispatchEvent(\n new CustomEvent('property-change', {\n bubbles: true,\n composed: true,\n detail: this._getValues()\n })\n )\n }\n}\n"]}
|
|
@@ -7,6 +7,21 @@ import { i18next } from '@operato/i18n';
|
|
|
7
7
|
import { closePopup } from '@operato/popup';
|
|
8
8
|
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
9
9
|
let OxPopupCrontabInput = class OxPopupCrontabInput extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
Object.defineProperty(this, "value", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(this, "confirmCallback", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
}
|
|
10
25
|
render() {
|
|
11
26
|
return html `
|
|
12
27
|
<ox-input-crontab .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-crontab>
|
|
@@ -32,10 +47,14 @@ let OxPopupCrontabInput = class OxPopupCrontabInput extends LitElement {
|
|
|
32
47
|
closePopup(this);
|
|
33
48
|
}
|
|
34
49
|
};
|
|
35
|
-
OxPopupCrontabInput
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
Object.defineProperty(OxPopupCrontabInput, "styles", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
configurable: true,
|
|
53
|
+
writable: true,
|
|
54
|
+
value: [
|
|
55
|
+
CommonHeaderStyles,
|
|
56
|
+
ScrollbarStyles,
|
|
57
|
+
css `
|
|
39
58
|
:host {
|
|
40
59
|
display: flex;
|
|
41
60
|
flex-direction: column;
|
|
@@ -61,7 +80,8 @@ OxPopupCrontabInput.styles = [
|
|
|
61
80
|
color: var(--md-sys-color-on-primary-container);
|
|
62
81
|
}
|
|
63
82
|
`
|
|
64
|
-
]
|
|
83
|
+
]
|
|
84
|
+
});
|
|
65
85
|
__decorate([
|
|
66
86
|
property({ type: Object })
|
|
67
87
|
], OxPopupCrontabInput.prototype, "value", void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-crontab-input.js","sourceRoot":"","sources":["../../src/ox-popup-crontab-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG9D,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;
|
|
1
|
+
{"version":3,"file":"ox-popup-crontab-input.js","sourceRoot":"","sources":["../../src/ox-popup-crontab-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,oCAAoC,CAAA;AAE3C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE3D,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAG9D,IAAM,mBAAmB,GAAzB,MAAM,mBAAoB,SAAQ,UAAU;IAA5C;;QAgCuB;;;;;WAAU;QACV;;;;;WAAuC;IA8BrE,CAAC;IA5BC,MAAM;QACJ,OAAO,IAAI,CAAA;iCACkB,IAAI,CAAC,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;;yBAItD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;qCACZ,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;;yBAEtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,gCAAgC,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAExG,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,CAAc;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAC,MAAM,CAAA;IACvB,CAAC;IAEO,QAAQ,CAAC,CAAQ;QACvB,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;IAEO,SAAS,CAAC,CAAQ;QACxB,IAAI,CAAC,eAAe,IAAI,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AA7DM;;;;WAAS;QACd,kBAAkB;QAClB,eAAe;QACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;KACF;EA7BY,CA6BZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;kDAAW;AACV;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;4DAAwC;AAjCxD,mBAAmB;IAD/B,aAAa,CAAC,wBAAwB,CAAC;GAC3B,mBAAmB,CA+D/B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-crontab.js'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-crontab-input')\nexport class OxPopupCrontabInput extends LitElement {\n static styles = [\n CommonHeaderStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: var(--md-sys-color-surface);\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-crontab {\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(--md-sys-color-on-primary-container);\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-crontab .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-crontab>\n\n <div class=\"footer\">\n <div filler></div>\n <button @click=${this.onCancel.bind(this)} danger>\n <md-icon>cancel</md-icon>${i18next.t('button.cancel')}\n </button>\n <button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</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 closePopup(this)\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n closePopup(this)\n }\n}\n"]}
|