@operato/app 8.0.0-alpha.10 → 8.0.0-alpha.11
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 +8 -0
- package/dist/src/grist-editor/ox-grist-editor-role.d.ts +8 -0
- package/dist/src/grist-editor/ox-grist-editor-role.js +49 -0
- package/dist/src/grist-editor/ox-grist-editor-role.js.map +1 -0
- package/dist/src/grist-editor/ox-popup-role-input.d.ts +22 -0
- package/dist/src/grist-editor/ox-popup-role-input.js +92 -0
- package/dist/src/grist-editor/ox-popup-role-input.js.map +1 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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
|
+
## [8.0.0-alpha.11](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.10...v8.0.0-alpha.11) (2024-09-21)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @operato/app
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [8.0.0-alpha.10](https://github.com/hatiolab/operato/compare/v8.0.0-alpha.9...v8.0.0-alpha.10) (2024-09-18)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @operato/app
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import './ox-popup-role-input.js';
|
|
2
|
+
import { OxGristEditor } from '@operato/data-grist';
|
|
3
|
+
export declare class OxGristEditorRole extends OxGristEditor {
|
|
4
|
+
get editorTemplate(): import("lit-html").TemplateResult<1>;
|
|
5
|
+
_onclick(e: Event): void;
|
|
6
|
+
_onkeydown(e: KeyboardEvent): void;
|
|
7
|
+
showEditorPopup(): void;
|
|
8
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import './ox-popup-role-input.js';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import { customElement } from 'lit/decorators.js';
|
|
5
|
+
import { OxGristEditor } from '@operato/data-grist';
|
|
6
|
+
import { i18next } from '@operato/i18n';
|
|
7
|
+
import { openPopup } from '@operato/layout';
|
|
8
|
+
let OxGristEditorRole = class OxGristEditorRole extends OxGristEditor {
|
|
9
|
+
get editorTemplate() {
|
|
10
|
+
return html ` <div tabindex="0">...</div> `;
|
|
11
|
+
}
|
|
12
|
+
_onclick(e) {
|
|
13
|
+
e.stopPropagation();
|
|
14
|
+
this.showEditorPopup();
|
|
15
|
+
}
|
|
16
|
+
_onkeydown(e) {
|
|
17
|
+
const key = e.key;
|
|
18
|
+
if (key == 'Enter') {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
this.showEditorPopup();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
showEditorPopup() {
|
|
24
|
+
var change = (value) => {
|
|
25
|
+
this.dispatchEvent(new CustomEvent('field-change', {
|
|
26
|
+
bubbles: true,
|
|
27
|
+
composed: true,
|
|
28
|
+
detail: {
|
|
29
|
+
before: this.value,
|
|
30
|
+
after: value,
|
|
31
|
+
column: this.column,
|
|
32
|
+
record: this.record,
|
|
33
|
+
row: this.row
|
|
34
|
+
}
|
|
35
|
+
}));
|
|
36
|
+
};
|
|
37
|
+
var popup = openPopup(html ` <ox-popup-role-input .value=${this.value} .confirmCallback=${change.bind(this)}></ox-popup-role-input> `, {
|
|
38
|
+
backdrop: true,
|
|
39
|
+
title: i18next.t('title.edit role'),
|
|
40
|
+
size: 'medium',
|
|
41
|
+
help: 'data-grist/grist-editor/role'
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
OxGristEditorRole = __decorate([
|
|
46
|
+
customElement('ox-grist-editor-role')
|
|
47
|
+
], OxGristEditorRole);
|
|
48
|
+
export { OxGristEditorRole };
|
|
49
|
+
//# sourceMappingURL=ox-grist-editor-role.js.map
|
|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QACH,CAAC,CAAA;QAED,IAAI,KAAK,GAAG,SAAS,CACnB,IAAI,CAAA,gCAAgC,IAAI,CAAC,KAAK,qBAAqB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAC9G;YACE,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,iBAAiB,CAAC;YACnC,IAAI,EAAE,QAAQ;YACd,IAAI,EAAE,8BAA8B;SACrC,CACF,CAAA;IACH,CAAC;CACF,CAAA;AA7CY,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CA6C7B","sourcesContent":["import './ox-popup-role-input.js'\n\nimport { html } from 'lit'\nimport { customElement } from 'lit/decorators.js'\n\nimport { OxGristEditor } from '@operato/data-grist'\nimport { i18next } from '@operato/i18n'\nimport { openPopup } from '@operato/layout'\n\n@customElement('ox-grist-editor-role')\nexport class OxGristEditorRole extends OxGristEditor {\n get editorTemplate() {\n return html` <div tabindex=\"0\">...</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 var change = (value: string) => {\n this.dispatchEvent(\n new CustomEvent('field-change', {\n bubbles: true,\n composed: true,\n detail: {\n before: this.value,\n after: value,\n column: this.column,\n record: this.record,\n row: this.row\n }\n })\n )\n }\n\n var popup = openPopup(\n html` <ox-popup-role-input .value=${this.value} .confirmCallback=${change.bind(this)}></ox-popup-role-input> `,\n {\n backdrop: true,\n title: i18next.t('title.edit role'),\n size: 'medium',\n help: 'data-grist/grist-editor/role'\n }\n )\n }\n}\n"]}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import '@material/web/icon/icon.js';
|
|
2
|
+
import '@operato/input/ox-input-role.js';
|
|
3
|
+
import { LitElement, PropertyValueMap } from 'lit';
|
|
4
|
+
export declare class OxPopupRoleInput extends LitElement {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
value?: {
|
|
7
|
+
role: string;
|
|
8
|
+
owner: boolean;
|
|
9
|
+
super: boolean;
|
|
10
|
+
} | null;
|
|
11
|
+
confirmCallback: (newval: any) => void;
|
|
12
|
+
roles: {
|
|
13
|
+
role: string;
|
|
14
|
+
description: string;
|
|
15
|
+
}[];
|
|
16
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
17
|
+
firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): Promise<void>;
|
|
18
|
+
private onChange;
|
|
19
|
+
private onReset;
|
|
20
|
+
private onCancel;
|
|
21
|
+
private onConfirm;
|
|
22
|
+
}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { __decorate } from "tslib";
|
|
2
|
+
import '@material/web/icon/icon.js';
|
|
3
|
+
import '@operato/input/ox-input-role.js';
|
|
4
|
+
import gql from 'graphql-tag';
|
|
5
|
+
import { css, html, LitElement } from 'lit';
|
|
6
|
+
import { customElement, property, state } from 'lit/decorators.js';
|
|
7
|
+
import { i18next } from '@operato/i18n';
|
|
8
|
+
import { closePopup } from '@operato/popup';
|
|
9
|
+
import { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles';
|
|
10
|
+
import { client } from '@operato/graphql';
|
|
11
|
+
let OxPopupRoleInput = class OxPopupRoleInput extends LitElement {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.roles = [];
|
|
15
|
+
}
|
|
16
|
+
render() {
|
|
17
|
+
return html `
|
|
18
|
+
<ox-input-role .value=${this.value} .roles=${this.roles} @change=${this.onChange.bind(this)}> </ox-input-role>
|
|
19
|
+
|
|
20
|
+
<div class="footer">
|
|
21
|
+
<button @click=${this.onReset.bind(this)}><md-icon>restart_alt</md-icon>${i18next.t('button.reset')}</button>
|
|
22
|
+
<div filler></div>
|
|
23
|
+
<button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</button>
|
|
24
|
+
<button @click=${this.onConfirm.bind(this)} done><md-icon>done</md-icon>${i18next.t('button.confirm')}</button>
|
|
25
|
+
</div>
|
|
26
|
+
`;
|
|
27
|
+
}
|
|
28
|
+
async firstUpdated(_changedProperties) {
|
|
29
|
+
const response = await client.query({
|
|
30
|
+
query: gql `
|
|
31
|
+
query roles {
|
|
32
|
+
roles {
|
|
33
|
+
items {
|
|
34
|
+
name
|
|
35
|
+
description
|
|
36
|
+
}
|
|
37
|
+
total
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`
|
|
41
|
+
});
|
|
42
|
+
this.roles = response.data.roles.items;
|
|
43
|
+
}
|
|
44
|
+
onChange(e) {
|
|
45
|
+
e.stopPropagation();
|
|
46
|
+
this.value = e.detail;
|
|
47
|
+
}
|
|
48
|
+
onReset(e) {
|
|
49
|
+
this.value = null;
|
|
50
|
+
}
|
|
51
|
+
onCancel(e) {
|
|
52
|
+
closePopup(this);
|
|
53
|
+
}
|
|
54
|
+
onConfirm(e) {
|
|
55
|
+
this.confirmCallback && this.confirmCallback(this.value);
|
|
56
|
+
closePopup(this);
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
OxPopupRoleInput.styles = [
|
|
60
|
+
CommonHeaderStyles,
|
|
61
|
+
ScrollbarStyles,
|
|
62
|
+
css `
|
|
63
|
+
:host {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
|
|
67
|
+
background-color: var(--md-sys-color-surface);
|
|
68
|
+
|
|
69
|
+
width: var(--overlay-center-normal-width, 50%);
|
|
70
|
+
height: var(--overlay-center-normal-height, 50%);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
ox-input-role {
|
|
74
|
+
flex: 1;
|
|
75
|
+
overflow-y: auto;
|
|
76
|
+
}
|
|
77
|
+
`
|
|
78
|
+
];
|
|
79
|
+
__decorate([
|
|
80
|
+
property({ type: Object })
|
|
81
|
+
], OxPopupRoleInput.prototype, "value", void 0);
|
|
82
|
+
__decorate([
|
|
83
|
+
property({ type: Object })
|
|
84
|
+
], OxPopupRoleInput.prototype, "confirmCallback", void 0);
|
|
85
|
+
__decorate([
|
|
86
|
+
state()
|
|
87
|
+
], OxPopupRoleInput.prototype, "roles", void 0);
|
|
88
|
+
OxPopupRoleInput = __decorate([
|
|
89
|
+
customElement('ox-popup-role-input')
|
|
90
|
+
], OxPopupRoleInput);
|
|
91
|
+
export { OxPopupRoleInput };
|
|
92
|
+
//# sourceMappingURL=ox-popup-role-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ox-popup-role-input.js","sourceRoot":"","sources":["../../../src/grist-editor/ox-popup-role-input.ts"],"names":[],"mappings":";AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,iCAAiC,CAAA;AAExC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAoB,MAAM,KAAK,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,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;AACrE,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AAGlC,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,UAAU;IAAzC;;QA0BI,UAAK,GAA4C,EAAE,CAAA;IAmD9D,CAAC;IAjDC,MAAM;QACJ,OAAO,IAAI,CAAA;8BACe,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,YAAY,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC;;;yBAGxE,IAAI,CAAC,OAAO,CAAC,IAA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wC;AAE1D;IAAR,KAAK,EAAE;+CAAoD;AA1BjD,gBAAgB;IAD5B,aAAa,CAAC,qBAAqB,CAAC;GACxB,gBAAgB,CA6E5B","sourcesContent":["import '@material/web/icon/icon.js'\nimport '@operato/input/ox-input-role.js'\n\nimport gql from 'graphql-tag'\nimport { css, html, LitElement, PropertyValueMap } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { closePopup } from '@operato/popup'\nimport { CommonHeaderStyles, ScrollbarStyles } from '@operato/styles'\nimport { client } from '@operato/graphql'\n\n@customElement('ox-popup-role-input')\nexport class OxPopupRoleInput 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-role {\n flex: 1;\n overflow-y: auto;\n }\n `\n ]\n\n @property({ type: Object }) value?: { role: string; owner: boolean; super: boolean } | null\n\n @property({ type: Object }) confirmCallback!: (newval: any) => void\n\n @state() roles: { role: string; description: string }[] = []\n\n render() {\n return html`\n <ox-input-role .value=${this.value} .roles=${this.roles} @change=${this.onChange.bind(this)}> </ox-input-role>\n\n <div class=\"footer\">\n <button @click=${this.onReset.bind(this)}><md-icon>restart_alt</md-icon>${i18next.t('button.reset')}</button>\n <div filler></div>\n <button @click=${this.onCancel.bind(this)}><md-icon>cancel</md-icon>${i18next.t('button.cancel')}</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 async firstUpdated(_changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): Promise<void> {\n const response = await client.query({\n query: gql`\n query roles {\n roles {\n items {\n name\n description\n }\n total\n }\n }\n `\n })\n\n this.roles = response.data.roles.items\n }\n\n private onChange(e: CustomEvent) {\n e.stopPropagation()\n\n this.value = e.detail\n }\n\n private onReset(e: Event) {\n this.value = null\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"]}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@operato/app",
|
|
3
3
|
"description": "WebApplication production supporting components following open-wc recommendations",
|
|
4
4
|
"author": "heartyoh",
|
|
5
|
-
"version": "8.0.0-alpha.
|
|
5
|
+
"version": "8.0.0-alpha.11",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"@operato/attachment": "^8.0.0-alpha.10",
|
|
140
140
|
"@operato/data-grist": "^8.0.0-alpha.10",
|
|
141
141
|
"@operato/font": "^8.0.0-alpha.10",
|
|
142
|
-
"@operato/form": "^8.0.0-alpha.
|
|
142
|
+
"@operato/form": "^8.0.0-alpha.11",
|
|
143
143
|
"@operato/graphql": "^8.0.0-alpha.0",
|
|
144
144
|
"@operato/i18n": "^8.0.0-alpha.0",
|
|
145
145
|
"@operato/input": "^8.0.0-alpha.10",
|
|
@@ -188,5 +188,5 @@
|
|
|
188
188
|
"prettier --write"
|
|
189
189
|
]
|
|
190
190
|
},
|
|
191
|
-
"gitHead": "
|
|
191
|
+
"gitHead": "c0528f8d77f2be46f144a617ce6946c43fefad9a"
|
|
192
192
|
}
|