@operato/grist-editor 2.0.0-alpha.9 → 2.0.0-alpha.90
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 +420 -0
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/ox-grist-editor-crontab.d.ts +1 -1
- package/dist/src/ox-grist-editor-duration.d.ts +1 -1
- package/dist/src/ox-grist-editor-hashtags.d.ts +1 -1
- package/dist/src/ox-grist-editor-i18n-label.d.ts +13 -0
- package/dist/src/ox-grist-editor-i18n-label.js +85 -0
- package/dist/src/ox-grist-editor-i18n-label.js.map +1 -0
- package/dist/src/ox-grist-editor-parameters.d.ts +1 -1
- package/dist/src/ox-grist-editor-partition-keys.d.ts +1 -1
- package/dist/src/ox-grist-editor-partition-keys.js +1 -1
- package/dist/src/ox-grist-editor-partition-keys.js.map +1 -1
- package/dist/src/ox-grist-editor-quantifier.d.ts +1 -1
- package/dist/src/ox-grist-editor-value-map.d.ts +1 -1
- package/dist/src/ox-grist-editor-value-ranges.d.ts +1 -1
- package/dist/src/ox-grist-renderer-i18n-label.d.ts +2 -0
- package/dist/src/ox-grist-renderer-i18n-label.js +9 -0
- package/dist/src/ox-grist-renderer-i18n-label.js.map +1 -0
- package/dist/src/ox-grist-renderer-partition-keys.d.ts +1 -1
- package/dist/src/ox-grist-renderer-partition-keys.js +4 -4
- package/dist/src/ox-grist-renderer-partition-keys.js.map +1 -1
- package/dist/src/ox-popup-crontab-input.d.ts +2 -1
- package/dist/src/ox-popup-crontab-input.js +7 -8
- package/dist/src/ox-popup-crontab-input.js.map +1 -1
- package/dist/src/ox-popup-duration-input.d.ts +2 -1
- package/dist/src/ox-popup-duration-input.js +7 -8
- package/dist/src/ox-popup-duration-input.js.map +1 -1
- package/dist/src/ox-popup-hashtags-input.d.ts +2 -1
- package/dist/src/ox-popup-hashtags-input.js +8 -9
- package/dist/src/ox-popup-hashtags-input.js.map +1 -1
- package/dist/src/ox-popup-i18n-label-input.d.ts +16 -0
- package/dist/src/ox-popup-i18n-label-input.js +100 -0
- package/dist/src/ox-popup-i18n-label-input.js.map +1 -0
- package/dist/src/ox-popup-parameters-builder.d.ts +2 -1
- package/dist/src/ox-popup-parameters-builder.js +7 -8
- package/dist/src/ox-popup-parameters-builder.js.map +1 -1
- package/dist/src/ox-popup-partition-keys-input.d.ts +2 -1
- package/dist/src/ox-popup-partition-keys-input.js +7 -8
- package/dist/src/ox-popup-partition-keys-input.js.map +1 -1
- package/dist/src/ox-popup-value-map-input.d.ts +2 -1
- package/dist/src/ox-popup-value-map-input.js +7 -8
- package/dist/src/ox-popup-value-map-input.js.map +1 -1
- package/dist/src/ox-popup-value-ranges-input.d.ts +2 -1
- package/dist/src/ox-popup-value-ranges-input.js +7 -8
- package/dist/src/ox-popup-value-ranges-input.js.map +1 -1
- package/dist/stories/ox-grist-editor-crontab.stories.d.ts +1 -1
- package/dist/stories/ox-grist-editor-crontab.stories.js +66 -54
- package/dist/stories/ox-grist-editor-crontab.stories.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -36
- package/src/index.ts +4 -0
- package/src/ox-grist-editor-i18n-label.ts +101 -0
- package/src/ox-grist-editor-partition-keys.ts +1 -1
- package/src/ox-grist-renderer-i18n-label.ts +12 -0
- package/src/ox-grist-renderer-partition-keys.ts +4 -4
- package/src/ox-popup-crontab-input.ts +7 -8
- package/src/ox-popup-duration-input.ts +7 -8
- package/src/ox-popup-hashtags-input.ts +8 -9
- package/src/ox-popup-i18n-label-input.ts +97 -0
- package/src/ox-popup-parameters-builder.ts +7 -8
- package/src/ox-popup-partition-keys-input.ts +7 -8
- package/src/ox-popup-value-map-input.ts +8 -8
- package/src/ox-popup-value-ranges-input.ts +7 -8
- package/stories/ox-grist-editor-crontab.stories.ts +71 -60
- package/themes/grist-theme.css +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import '@operato/input/ox-input-quantifier.js';
|
|
2
2
|
import { OxGristEditor } from '@operato/data-grist';
|
|
3
3
|
export declare class OxGristEditorQuantifier extends OxGristEditor {
|
|
4
|
-
get editorTemplate(): import("lit").TemplateResult<1>;
|
|
4
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
5
5
|
}
|
|
@@ -6,7 +6,7 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
6
6
|
export declare class OxGristEditorValueMap extends OxGristEditor {
|
|
7
7
|
private popup?;
|
|
8
8
|
get options(): any;
|
|
9
|
-
get editorTemplate(): import("lit").TemplateResult<1>;
|
|
9
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
10
10
|
_onclick(e: Event): void;
|
|
11
11
|
_onkeydown(e: KeyboardEvent): void;
|
|
12
12
|
openSelector(): Promise<void>;
|
|
@@ -6,7 +6,7 @@ import { OxGristEditor } from '@operato/data-grist';
|
|
|
6
6
|
export declare class OxGristEditorValueRanges extends OxGristEditor {
|
|
7
7
|
private popup?;
|
|
8
8
|
get options(): any;
|
|
9
|
-
get editorTemplate(): import("lit").TemplateResult<1>;
|
|
9
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
10
10
|
_onclick(e: Event): void;
|
|
11
11
|
_onkeydown(e: KeyboardEvent): void;
|
|
12
12
|
openSelector(): Promise<void>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { html } from 'lit';
|
|
2
|
+
import i18next from 'i18next';
|
|
3
|
+
export const OxGristRendererI18nLabel = (value, column, record, rowIndex, field) => {
|
|
4
|
+
const language = i18next.language || 'en-US';
|
|
5
|
+
const labels = value || {};
|
|
6
|
+
const label = labels[language] || labels[language.substring(0, 2)] || labels['en'] || '';
|
|
7
|
+
return html `<span>${label}</span>`;
|
|
8
|
+
};
|
|
9
|
+
//# sourceMappingURL=ox-grist-renderer-i18n-label.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-grist-renderer-i18n-label.js","sourceRoot":"","sources":["../../src/ox-grist-renderer-i18n-label.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,OAAO,OAAO,MAAM,SAAS,CAAA;AAE7B,MAAM,CAAC,MAAM,wBAAwB,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IAChG,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,OAAO,CAAA;IAC5C,MAAM,MAAM,GAAG,KAAK,IAAI,EAAE,CAAA;IAC1B,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,CAAA;IAExF,OAAO,IAAI,CAAA,SAAS,KAAK,SAAS,CAAA;AACpC,CAAC,CAAA","sourcesContent":["import { html } from 'lit'\n\nimport { FieldRenderer } from '@operato/data-grist'\nimport i18next from 'i18next'\n\nexport const OxGristRendererI18nLabel: FieldRenderer = (value, column, record, rowIndex, field) => {\n const language = i18next.language || 'en-US'\n const labels = value || {}\n const label = labels[language] || labels[language.substring(0, 2)] || labels['en'] || ''\n\n return html`<span>${label}</span>`\n}\n"]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import '@material/
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
2
|
import { html } from 'lit';
|
|
3
3
|
function onmouseover(e, value) {
|
|
4
4
|
const element = e.target;
|
|
@@ -11,11 +11,11 @@ function onmouseout(e) {
|
|
|
11
11
|
}
|
|
12
12
|
export const OxGristRendererPartitionKeys = (value, column, record, rowIndex, field) => {
|
|
13
13
|
return value && value instanceof Array && value.length > 0
|
|
14
|
-
? html `<
|
|
15
|
-
style="--
|
|
14
|
+
? html `<md-icon
|
|
15
|
+
style="--md-icon-size:1.3em"
|
|
16
16
|
@mouseover=${(e) => onmouseover(e, value)}
|
|
17
17
|
@mouseout=${onmouseout}
|
|
18
|
-
>key</
|
|
18
|
+
>key</md-icon
|
|
19
19
|
>`
|
|
20
20
|
: html ``;
|
|
21
21
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-grist-renderer-partition-keys.js","sourceRoot":"","sources":["../../src/ox-grist-renderer-partition-keys.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ox-grist-renderer-partition-keys.js","sourceRoot":"","sources":["../../src/ox-grist-renderer-partition-keys.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAG1B,SAAS,WAAW,CAAC,CAAa,EAAE,KAAY;IAC9C,MAAM,OAAO,GAAG,CAAC,CAAC,MAAwB,CAAA;IAC1C,MAAM,OAAO,GAAG,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;IACpD,OAAO,CAAC,YAAY,CAAC,cAAc,EAAE,OAAO,CAAC,CAAA;AAC/C,CAAC;AAED,SAAS,UAAU,CAAC,CAAa;IAC/B,MAAM,OAAO,GAAG,CAAC,CAAC,MAAwB,CAAA;IAC1C,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAA;AACzC,CAAC;AAED,MAAM,CAAC,MAAM,4BAA4B,GAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,EAAE;IACpG,OAAO,KAAK,IAAI,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QACxD,CAAC,CAAC,IAAI,CAAA;;qBAEW,CAAC,CAAa,EAAE,EAAE,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK,CAAC;oBACzC,UAAU;;QAEtB;QACJ,CAAC,CAAC,IAAI,CAAA,EAAE,CAAA;AACZ,CAAC,CAAA","sourcesContent":["import '@material/web/icon/icon.js'\nimport { html } from 'lit'\nimport { FieldRenderer } from '@operato/data-grist'\n\nfunction onmouseover(e: MouseEvent, value: any[]) {\n const element = e.target as HTMLPreElement\n const tooltip = value.map(key => key.name).join(',')\n element.setAttribute('data-tooltip', tooltip)\n}\n\nfunction onmouseout(e: MouseEvent) {\n const element = e.target as HTMLPreElement\n element.removeAttribute('data-tooltip')\n}\n\nexport const OxGristRendererPartitionKeys: FieldRenderer = (value, column, record, rowIndex, field) => {\n return value && value instanceof Array && value.length > 0\n ? html`<md-icon\n style=\"--md-icon-size:1.3em\"\n @mouseover=${(e: MouseEvent) => onmouseover(e, value)}\n @mouseout=${onmouseout}\n >key</md-icon\n >`\n : html``\n}\n"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
1
2
|
import '@operato/input/ox-input-crontab.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class OxPopupCrontabInput extends LitElement {
|
|
4
5
|
static styles: import("lit").CSSResult[];
|
|
5
6
|
value: any;
|
|
6
7
|
confirmCallback: (newval: any) => void;
|
|
7
|
-
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
9
|
private onChange;
|
|
9
10
|
private onCancel;
|
|
10
11
|
private onConfirm;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
2
3
|
import '@operato/input/ox-input-crontab.js';
|
|
3
4
|
import { css, html, LitElement } from 'lit';
|
|
4
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
6
|
import { i18next } from '@operato/i18n';
|
|
6
7
|
import { closePopup } from '@operato/popup';
|
|
7
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let OxPopupCrontabInput = class OxPopupCrontabInput extends LitElement {
|
|
9
10
|
render() {
|
|
10
11
|
return html `
|
|
11
12
|
<ox-input-crontab .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-crontab>
|
|
12
13
|
|
|
13
14
|
<div class="button-container">
|
|
14
|
-
<
|
|
15
|
-
|
|
15
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
16
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
17
|
+
</button>
|
|
18
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
16
19
|
</div>
|
|
17
20
|
`;
|
|
18
21
|
}
|
|
@@ -29,6 +32,7 @@ let OxPopupCrontabInput = class OxPopupCrontabInput extends LitElement {
|
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
34
|
OxPopupCrontabInput.styles = [
|
|
35
|
+
ButtonContainerStyles,
|
|
32
36
|
ScrollbarStyles,
|
|
33
37
|
css `
|
|
34
38
|
:host {
|
|
@@ -55,11 +59,6 @@ OxPopupCrontabInput.styles = [
|
|
|
55
59
|
|
|
56
60
|
color: var(--primary-color);
|
|
57
61
|
}
|
|
58
|
-
|
|
59
|
-
.button-container {
|
|
60
|
-
display: flex;
|
|
61
|
-
margin-left: auto;
|
|
62
|
-
}
|
|
63
62
|
`
|
|
64
63
|
];
|
|
65
64
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-crontab-input.js","sourceRoot":"","sources":["../../src/ox-popup-crontab-input.ts"],"names":[],"mappings":";AAAA,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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AAC,KAAK,CAAC,CAAA;QACxD,UAAU,CAAC,IAAI,CAAC,CAAA;IAClB,CAAC;;AA5DM,0BAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;KAyBF;CACF,AA7BY,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,CA8D/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 { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-crontab-input')\nexport class OxPopupCrontabInput extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-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(--primary-color);\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=\"button-container\">\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)}><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"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
1
2
|
import '@operato/input/ox-input-duration.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class OxPopupDurationInput extends LitElement {
|
|
4
5
|
static styles: import("lit").CSSResult[];
|
|
5
6
|
value: any;
|
|
6
7
|
confirmCallback: (newval: any) => void;
|
|
7
|
-
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
9
|
private onChange;
|
|
9
10
|
private onCancel;
|
|
10
11
|
private onConfirm;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
2
3
|
import '@operato/input/ox-input-duration.js';
|
|
3
4
|
import { css, html, LitElement } from 'lit';
|
|
4
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
6
|
import { i18next } from '@operato/i18n';
|
|
6
7
|
import { closePopup } from '@operato/popup';
|
|
7
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let OxPopupDurationInput = class OxPopupDurationInput extends LitElement {
|
|
9
10
|
render() {
|
|
10
11
|
return html `
|
|
11
12
|
<ox-input-duration .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-duration>
|
|
12
13
|
|
|
13
14
|
<div class="button-container">
|
|
14
|
-
<
|
|
15
|
-
|
|
15
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
16
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
17
|
+
</button>
|
|
18
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
16
19
|
</div>
|
|
17
20
|
`;
|
|
18
21
|
}
|
|
@@ -29,6 +32,7 @@ let OxPopupDurationInput = class OxPopupDurationInput extends LitElement {
|
|
|
29
32
|
}
|
|
30
33
|
};
|
|
31
34
|
OxPopupDurationInput.styles = [
|
|
35
|
+
ButtonContainerStyles,
|
|
32
36
|
ScrollbarStyles,
|
|
33
37
|
css `
|
|
34
38
|
:host {
|
|
@@ -45,11 +49,6 @@ OxPopupDurationInput.styles = [
|
|
|
45
49
|
flex: 1;
|
|
46
50
|
overflow-y: auto;
|
|
47
51
|
}
|
|
48
|
-
|
|
49
|
-
.button-container {
|
|
50
|
-
display: flex;
|
|
51
|
-
margin-left: auto;
|
|
52
|
-
}
|
|
53
52
|
`
|
|
54
53
|
];
|
|
55
54
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-duration-input.js","sourceRoot":"","sources":["../../src/ox-popup-duration-input.ts"],"names":[],"mappings":";AAAA,OAAO,qCAAqC,CAAA;AAE5C,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,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-popup-duration-input.js","sourceRoot":"","sources":["../../src/ox-popup-duration-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAE5C,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAE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AC5B,oBAAoB,CAoDhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-duration.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 { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-duration-input')\nexport class OxPopupDurationInput extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-duration {\n flex: 1;\n overflow-y: auto;\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-duration .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-duration>\n\n <div class=\"button-container\">\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)}><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"]}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
1
2
|
import '@operato/input/ox-input-hashtags.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class OxPopupHashtagsInput extends LitElement {
|
|
4
5
|
static styles: import("lit").CSSResult[];
|
|
5
6
|
value: string[];
|
|
6
7
|
confirmCallback: (newval: any) => void;
|
|
7
|
-
render(): import("lit").TemplateResult<1>;
|
|
8
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
8
9
|
private onChange;
|
|
9
10
|
private onCancel;
|
|
10
11
|
private onConfirm;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
2
3
|
import '@operato/input/ox-input-hashtags.js';
|
|
3
4
|
import { css, html, LitElement } from 'lit';
|
|
4
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
6
|
import { i18next } from '@operato/i18n';
|
|
6
7
|
import { closePopup } from '@operato/popup';
|
|
7
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let OxPopupHashtagsInput = class OxPopupHashtagsInput extends LitElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
@@ -15,8 +16,10 @@ let OxPopupHashtagsInput = class OxPopupHashtagsInput extends LitElement {
|
|
|
15
16
|
<ox-input-hashtags .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-hashtags>
|
|
16
17
|
|
|
17
18
|
<div class="button-container">
|
|
18
|
-
<
|
|
19
|
-
|
|
19
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
20
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
21
|
+
</button>
|
|
22
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
20
23
|
</div>
|
|
21
24
|
`;
|
|
22
25
|
}
|
|
@@ -33,6 +36,7 @@ let OxPopupHashtagsInput = class OxPopupHashtagsInput extends LitElement {
|
|
|
33
36
|
}
|
|
34
37
|
};
|
|
35
38
|
OxPopupHashtagsInput.styles = [
|
|
39
|
+
ButtonContainerStyles,
|
|
36
40
|
ScrollbarStyles,
|
|
37
41
|
css `
|
|
38
42
|
:host {
|
|
@@ -49,15 +53,10 @@ OxPopupHashtagsInput.styles = [
|
|
|
49
53
|
flex: 1;
|
|
50
54
|
overflow-y: auto;
|
|
51
55
|
}
|
|
52
|
-
|
|
53
|
-
.button-container {
|
|
54
|
-
display: flex;
|
|
55
|
-
margin-left: auto;
|
|
56
|
-
}
|
|
57
56
|
`
|
|
58
57
|
];
|
|
59
58
|
__decorate([
|
|
60
|
-
property({ type:
|
|
59
|
+
property({ type: Array })
|
|
61
60
|
], OxPopupHashtagsInput.prototype, "value", void 0);
|
|
62
61
|
__decorate([
|
|
63
62
|
property({ type: Object })
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-hashtags-input.js","sourceRoot":"","sources":["../../src/ox-popup-hashtags-input.ts"],"names":[],"mappings":";AAAA,OAAO,qCAAqC,CAAA;AAE5C,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,eAAe,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"ox-popup-hashtags-input.js","sourceRoot":"","sources":["../../src/ox-popup-hashtags-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,qCAAqC,CAAA;AAE5C,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,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QAsBsB,UAAK,GAAa,EAAE,CAAA;IA8BjD,CAAC;IA3BC,MAAM;QACJ,OAAO,IAAI,CAAA;kCACmB,IAAI,CAAC,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;yBAGvD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;qCACZ,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;;yBAEtC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,2BAA2B,OAAO,CAAC,CAAC,CAAC,gBAAgB,CAAC;;KAEnG,CAAA;IACH,CAAC;IAEO,QAAQ,CAAC,CAAc;QAC7B,CAAC,CAAC,eAAe,EAAE,CAAA;QAEnB,IAAI,CAAC,KAAK,GAAI,CAAC,CAAC,MAAc,CAAC,KAAK,CAAA;IACtC,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;;AAlDM,2BAAM,GAAG;IACd,qBAAqB;IACrB,eAAe;IACf,GAAG,CAAA;;;;;;;;;;;;;;;KAeF;CACF,AAnBY,CAmBZ;AAE0B;IAA1B,QAAQ,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC;mDAAqB;AACnB;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;6DAAwC;AAvBxD,oBAAoB;IADhC,aAAa,CAAC,yBAAyB,CAAC;GAC5B,oBAAoB,CAoDhC","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-hashtags.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 { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-hashtags-input')\nexport class OxPopupHashtagsInput extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-hashtags {\n flex: 1;\n overflow-y: auto;\n }\n `\n ]\n\n @property({ type: Array }) value: string[] = []\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-hashtags .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-hashtags>\n\n <div class=\"button-container\">\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)}><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.target as any).value\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"]}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@operato/input/ox-input-i18n-label.js';
|
|
3
|
+
import { LitElement } from 'lit';
|
|
4
|
+
export declare class OxPopupValueMapInput extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
value: any;
|
|
7
|
+
languages: {
|
|
8
|
+
code: string;
|
|
9
|
+
display: string;
|
|
10
|
+
}[];
|
|
11
|
+
confirmCallback: (newval: any) => void;
|
|
12
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
13
|
+
private onChange;
|
|
14
|
+
private onCancel;
|
|
15
|
+
private onConfirm;
|
|
16
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import '@operato/input/ox-input-i18n-label.js';
|
|
4
|
+
import { css, html, LitElement } from 'lit';
|
|
5
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
6
|
+
import { i18next } from '@operato/i18n';
|
|
7
|
+
import { closePopup } from '@operato/popup';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
9
|
+
let OxPopupValueMapInput = class OxPopupValueMapInput extends LitElement {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.languages = [];
|
|
13
|
+
}
|
|
14
|
+
render() {
|
|
15
|
+
return html `
|
|
16
|
+
<ox-input-i18n-label .value=${this.value} .languages=${this.languages} @change=${this.onChange.bind(this)}>
|
|
17
|
+
</ox-input-i18n-label>
|
|
18
|
+
|
|
19
|
+
<div class="button-container">
|
|
20
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
21
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
22
|
+
</button>
|
|
23
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
24
|
+
</div>
|
|
25
|
+
`;
|
|
26
|
+
}
|
|
27
|
+
onChange(e) {
|
|
28
|
+
e.stopPropagation();
|
|
29
|
+
/*
|
|
30
|
+
주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로,
|
|
31
|
+
layout의 구성에 변화가 발생하면, 다시 render된다.
|
|
32
|
+
이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)
|
|
33
|
+
이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,
|
|
34
|
+
만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.
|
|
35
|
+
따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.
|
|
36
|
+
(이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)
|
|
37
|
+
=>
|
|
38
|
+
이런 이유로, Object.assign(...)을 사용하였다.
|
|
39
|
+
*/
|
|
40
|
+
if (!this.value || typeof this.value !== 'object') {
|
|
41
|
+
this.value = {};
|
|
42
|
+
}
|
|
43
|
+
for (let key in this.value) {
|
|
44
|
+
delete this.value[key];
|
|
45
|
+
}
|
|
46
|
+
Object.assign(this.value, e.detail);
|
|
47
|
+
}
|
|
48
|
+
onCancel(e) {
|
|
49
|
+
closePopup(this);
|
|
50
|
+
}
|
|
51
|
+
onConfirm(e) {
|
|
52
|
+
this.confirmCallback && this.confirmCallback(this.value);
|
|
53
|
+
closePopup(this);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
OxPopupValueMapInput.styles = [
|
|
57
|
+
ButtonContainerStyles,
|
|
58
|
+
ScrollbarStyles,
|
|
59
|
+
css `
|
|
60
|
+
:host {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
|
|
64
|
+
background-color: #fff;
|
|
65
|
+
|
|
66
|
+
width: var(--overlay-center-normal-width, 50%);
|
|
67
|
+
height: var(--overlay-center-normal-height, 50%);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
ox-input-i18n-label {
|
|
71
|
+
flex: 1;
|
|
72
|
+
overflow-y: auto;
|
|
73
|
+
padding: var(--padding-default);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
span {
|
|
77
|
+
flex: 1;
|
|
78
|
+
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
justify-content: center;
|
|
82
|
+
|
|
83
|
+
color: var(--primary-color);
|
|
84
|
+
}
|
|
85
|
+
`
|
|
86
|
+
];
|
|
87
|
+
__decorate([
|
|
88
|
+
property({ type: Object })
|
|
89
|
+
], OxPopupValueMapInput.prototype, "value", void 0);
|
|
90
|
+
__decorate([
|
|
91
|
+
property({ type: Array })
|
|
92
|
+
], OxPopupValueMapInput.prototype, "languages", void 0);
|
|
93
|
+
__decorate([
|
|
94
|
+
property({ type: Object })
|
|
95
|
+
], OxPopupValueMapInput.prototype, "confirmCallback", void 0);
|
|
96
|
+
OxPopupValueMapInput = __decorate([
|
|
97
|
+
customElement('ox-popup-i18n-label-input')
|
|
98
|
+
], OxPopupValueMapInput);
|
|
99
|
+
export { OxPopupValueMapInput };
|
|
100
|
+
//# sourceMappingURL=ox-popup-i18n-label-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-popup-i18n-label-input.js","sourceRoot":"","sources":["../../src/ox-popup-i18n-label-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,uCAAuC,CAAA;AAE9C,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,qBAAqB,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAGjE,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,UAAU;IAA7C;;QAkCsB,cAAS,GAAwC,EAAE,CAAA;IAmDhF,CAAC;IAhDC,MAAM;QACJ,OAAO,IAAI,CAAA;oCACqB,IAAI,CAAC,KAAK,eAAe,IAAI,CAAC,SAAS,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;;yBAItF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;qCACZ,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;;yBAEtC,IA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icon.js'\nimport '@operato/input/ox-input-i18n-label.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 { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-i18n-label-input')\nexport class OxPopupValueMapInput extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-input-i18n-label {\n flex: 1;\n overflow-y: auto;\n padding: var(--padding-default);\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Array }) languages: { code: string; display: string }[] = []\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n return html`\n <ox-input-i18n-label .value=${this.value} .languages=${this.languages} @change=${this.onChange.bind(this)}>\n </ox-input-i18n-label>\n\n <div class=\"button-container\">\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)}><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 /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n\n if (!this.value || typeof this.value !== 'object') {\n this.value = {}\n }\n\n for (let key in this.value) {\n delete this.value[key]\n }\n\n Object.assign(this.value, e.detail)\n }\n\n private onCancel(e: Event) {\n closePopup(this)\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n closePopup(this)\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
1
2
|
import '@operato/i18n/ox-i18n.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class OxPopupParametersBuilder extends LitElement {
|
|
@@ -7,7 +8,7 @@ export declare class OxPopupParametersBuilder extends LitElement {
|
|
|
7
8
|
host: any;
|
|
8
9
|
context: any;
|
|
9
10
|
confirmCallback: (newval: any) => void;
|
|
10
|
-
render(): import("lit").TemplateResult<1>;
|
|
11
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
11
12
|
private onChange;
|
|
12
13
|
private onCancel;
|
|
13
14
|
private onConfirm;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
2
3
|
import '@operato/i18n/ox-i18n.js';
|
|
3
4
|
import { css, html, LitElement } from 'lit';
|
|
4
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
6
|
import { i18next } from '@operato/i18n';
|
|
6
7
|
import { closePopup } from '@operato/popup';
|
|
7
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let OxPopupParametersBuilder = class OxPopupParametersBuilder extends LitElement {
|
|
9
10
|
render() {
|
|
10
11
|
var props = this.props instanceof Array ? this.props : [];
|
|
@@ -23,8 +24,10 @@ let OxPopupParametersBuilder = class OxPopupParametersBuilder extends LitElement
|
|
|
23
24
|
: html ` <span><ox-i18n msgid="text.no properties to set"></ox-i18n></span> `}
|
|
24
25
|
|
|
25
26
|
<div class="button-container">
|
|
26
|
-
<
|
|
27
|
-
|
|
27
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
28
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
29
|
+
</button>
|
|
30
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
28
31
|
</div>
|
|
29
32
|
`;
|
|
30
33
|
}
|
|
@@ -58,6 +61,7 @@ let OxPopupParametersBuilder = class OxPopupParametersBuilder extends LitElement
|
|
|
58
61
|
}
|
|
59
62
|
};
|
|
60
63
|
OxPopupParametersBuilder.styles = [
|
|
64
|
+
ButtonContainerStyles,
|
|
61
65
|
ScrollbarStyles,
|
|
62
66
|
css `
|
|
63
67
|
:host {
|
|
@@ -84,11 +88,6 @@ OxPopupParametersBuilder.styles = [
|
|
|
84
88
|
|
|
85
89
|
color: var(--primary-color);
|
|
86
90
|
}
|
|
87
|
-
|
|
88
|
-
.button-container {
|
|
89
|
-
display: flex;
|
|
90
|
-
margin-left: auto;
|
|
91
|
-
}
|
|
92
91
|
`
|
|
93
92
|
];
|
|
94
93
|
__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ox-popup-parameters-builder.js","sourceRoot":"","sources":["../../src/ox-popup-parameters-builder.ts"],"names":[],"mappings":";AAAA,OAAO,0BAA0B,CAAA;AAEjC,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,OA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import { customElement, property } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles'\n\n@customElement('ox-popup-parameters-builder')\nexport class OxPopupParametersBuilder extends LitElement {\n static styles = [\n ButtonContainerStyles,\n ScrollbarStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n\n width: var(--overlay-center-normal-width, 50%);\n height: var(--overlay-center-normal-height, 50%);\n }\n\n ox-parameters-builder {\n flex: 1;\n overflow-y: auto;\n }\n\n span {\n flex: 1;\n\n display: flex;\n align-items: center;\n justify-content: center;\n\n color: var(--primary-color);\n }\n `\n ]\n\n @property({ type: Object }) value: any\n @property({ type: Object }) props: any\n @property({ type: Object }) host: any\n @property({ type: Object }) context: any\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n render() {\n var props = this.props instanceof Array ? this.props : []\n\n return html`\n ${props.length > 0\n ? html`\n <ox-parameters-builder\n .value=${this.value}\n .props=${props}\n .host=${this.host}\n .context=${this.context}\n @property-change=${this.onChange.bind(this)}\n >\n </ox-parameters-builder>\n `\n : html` <span><ox-i18n msgid=\"text.no properties to set\"></ox-i18n></span> `}\n\n <div class=\"button-container\">\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)}><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 /* \n 주의 : 이 팝업 템플릿은 layout 모듈에 의해서 render 되므로, \n layout의 구성에 변화가 발생하면, 다시 render된다.\n 이 팝업이 떠 있는 상태에서, 또 다른 팝업이 뜨는 경우도 layout 구성의 변화를 야기한다. (overlay의 갯수의 증가)\n 이 경우 value, options, confirmCallback 등 클로져를 사용한 것들이 초기 바인딩된 값으로 다시 바인딩되게 되는데,\n 만약, 템플릿 내부에서 이들 속성의 레퍼런스가 변화했다면, 원래 상태로 되돌아가는 현상이 발생하게 된다.\n 따라서, 가급적 이들 속성의 레퍼런스를 변화시키지 않는 것이 좋다.\n (이 팝업 클래스를 템플릿으로 사용한 곳의 코드를 참조하세요.)\n => \n 이런 이유로, Object.assign(...)을 사용하였다.\n */\n if (!this.value) {\n this.value = {}\n }\n\n for (let key in this.value) {\n delete this.value[key]\n }\n Object.assign(this.value, e.detail)\n }\n\n private onCancel(e: Event) {\n closePopup(this)\n }\n\n private onConfirm(e: Event) {\n this.confirmCallback && this.confirmCallback(this.value)\n closePopup(this)\n }\n}\n"]}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
1
2
|
import '@operato/input/ox-input-partition-keys.js';
|
|
2
3
|
import { LitElement } from 'lit';
|
|
3
4
|
export declare class OxPopupPartitionKeysInput extends LitElement {
|
|
@@ -5,7 +6,7 @@ export declare class OxPopupPartitionKeysInput extends LitElement {
|
|
|
5
6
|
value: any;
|
|
6
7
|
valuetype: string;
|
|
7
8
|
confirmCallback: (newval: any) => void;
|
|
8
|
-
render(): import("lit").TemplateResult<1>;
|
|
9
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
9
10
|
private onChange;
|
|
10
11
|
private onCancel;
|
|
11
12
|
private onConfirm;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
2
3
|
import '@operato/input/ox-input-partition-keys.js';
|
|
3
4
|
import { css, html, LitElement } from 'lit';
|
|
4
5
|
import { customElement, property } from 'lit/decorators.js';
|
|
5
6
|
import { i18next } from '@operato/i18n';
|
|
6
7
|
import { closePopup } from '@operato/popup';
|
|
7
|
-
import { ScrollbarStyles } from '@operato/styles';
|
|
8
|
+
import { ButtonContainerStyles, ScrollbarStyles } from '@operato/styles';
|
|
8
9
|
let OxPopupPartitionKeysInput = class OxPopupPartitionKeysInput extends LitElement {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
@@ -15,8 +16,10 @@ let OxPopupPartitionKeysInput = class OxPopupPartitionKeysInput extends LitEleme
|
|
|
15
16
|
<ox-input-partition-keys .value=${this.value} @change=${this.onChange.bind(this)}> </ox-input-partition-keys>
|
|
16
17
|
|
|
17
18
|
<div class="button-container">
|
|
18
|
-
<
|
|
19
|
-
|
|
19
|
+
<button @click=${this.onCancel.bind(this)} danger>
|
|
20
|
+
<md-icon>cancel</md-icon>${i18next.t('button.cancel')}
|
|
21
|
+
</button>
|
|
22
|
+
<button @click=${this.onConfirm.bind(this)}><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
20
23
|
</div>
|
|
21
24
|
`;
|
|
22
25
|
}
|
|
@@ -50,6 +53,7 @@ let OxPopupPartitionKeysInput = class OxPopupPartitionKeysInput extends LitEleme
|
|
|
50
53
|
}
|
|
51
54
|
};
|
|
52
55
|
OxPopupPartitionKeysInput.styles = [
|
|
56
|
+
ButtonContainerStyles,
|
|
53
57
|
ScrollbarStyles,
|
|
54
58
|
css `
|
|
55
59
|
:host {
|
|
@@ -77,11 +81,6 @@ OxPopupPartitionKeysInput.styles = [
|
|
|
77
81
|
|
|
78
82
|
color: var(--primary-color);
|
|
79
83
|
}
|
|
80
|
-
|
|
81
|
-
.button-container {
|
|
82
|
-
display: flex;
|
|
83
|
-
margin-left: auto;
|
|
84
|
-
}
|
|
85
84
|
`
|
|
86
85
|
];
|
|
87
86
|
__decorate([
|