@operato/app 8.0.0-alpha.27 → 8.0.0-alpha.29
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/tsconfig.tsbuildinfo +1 -1
- package/package.json +12 -12
- package/dist/src/filters-form/filter-code-select.d.ts +0 -3
- package/dist/src/filters-form/filter-code-select.js +0 -6
- package/dist/src/filters-form/filter-code-select.js.map +0 -1
- package/dist/src/filters-form/ox-input-code-filter.d.ts +0 -17
- package/dist/src/filters-form/ox-input-code-filter.js +0 -137
- package/dist/src/filters-form/ox-input-code-filter.js.map +0 -1
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.29",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
7
7
|
"module": "dist/src/index.js",
|
|
8
8
|
"exports": {
|
|
@@ -147,18 +147,18 @@
|
|
|
147
147
|
"@graphql-tools/delegate": "^10.0.1",
|
|
148
148
|
"@graphql-tools/wrap": "^8.5.0",
|
|
149
149
|
"@material/web": "^2.0.0",
|
|
150
|
-
"@operato/attachment": "^8.0.0-alpha.
|
|
151
|
-
"@operato/data-grist": "^8.0.0-alpha.
|
|
152
|
-
"@operato/font": "^8.0.0-alpha.
|
|
153
|
-
"@operato/form": "^8.0.0-alpha.
|
|
154
|
-
"@operato/graphql": "^8.0.0-alpha.
|
|
150
|
+
"@operato/attachment": "^8.0.0-alpha.29",
|
|
151
|
+
"@operato/data-grist": "^8.0.0-alpha.29",
|
|
152
|
+
"@operato/font": "^8.0.0-alpha.29",
|
|
153
|
+
"@operato/form": "^8.0.0-alpha.29",
|
|
154
|
+
"@operato/graphql": "^8.0.0-alpha.29",
|
|
155
155
|
"@operato/i18n": "^8.0.0-alpha.0",
|
|
156
|
-
"@operato/input": "^8.0.0-alpha.
|
|
157
|
-
"@operato/layout": "^8.0.0-alpha.
|
|
158
|
-
"@operato/property-editor": "^8.0.0-alpha.
|
|
159
|
-
"@operato/shell": "^8.0.0-alpha.
|
|
156
|
+
"@operato/input": "^8.0.0-alpha.29",
|
|
157
|
+
"@operato/layout": "^8.0.0-alpha.29",
|
|
158
|
+
"@operato/property-editor": "^8.0.0-alpha.29",
|
|
159
|
+
"@operato/shell": "^8.0.0-alpha.29",
|
|
160
160
|
"@operato/styles": "^8.0.0-alpha.27",
|
|
161
|
-
"@operato/utils": "^8.0.0-alpha.
|
|
161
|
+
"@operato/utils": "^8.0.0-alpha.29",
|
|
162
162
|
"cm6-graphql": "^0.0.14",
|
|
163
163
|
"codemirror": "^6.0.1",
|
|
164
164
|
"cronstrue": "^2.2.0",
|
|
@@ -199,5 +199,5 @@
|
|
|
199
199
|
"prettier --write"
|
|
200
200
|
]
|
|
201
201
|
},
|
|
202
|
-
"gitHead": "
|
|
202
|
+
"gitHead": "f2f91b0c9ba7b29d7eeaca566f8e5875fa554331"
|
|
203
203
|
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import './ox-filter-resource-code.js';
|
|
2
|
-
import { html } from 'lit-html';
|
|
3
|
-
export const FilterCodeSelect = (column, value, owner) => {
|
|
4
|
-
return html ` <ox-filter-resource-code name=${column === null || column === void 0 ? void 0 : column.name} .column=${column} .value=${value}></ox-filter-resource-code> `;
|
|
5
|
-
};
|
|
6
|
-
//# sourceMappingURL=filter-code-select.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"filter-code-select.js","sourceRoot":"","sources":["../../../src/filters-form/filter-code-select.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,CAAA;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAI/B,MAAM,CAAC,MAAM,gBAAgB,GAAyB,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;IAC7E,OAAO,IAAI,CAAA,+BAA+B,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,YAAY,MAAM,WAAW,KAAK,2BAA2B,CAAA;AACrH,CAAC,CAAA","sourcesContent":["import './ox-filter-resource-code.js'\n\nimport { html } from 'lit-html'\n\nimport { FilterSelectRenderer } from '@operato/data-grist'\n\nexport const FilterCodeSelect: FilterSelectRenderer = (column, value, owner) => {\n return html` <ox-filter-resource-code name=${column?.name} .column=${column} .value=${value}></ox-filter-resource-code> `\n}\n"]}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import '@operato/input/ox-select.js';
|
|
2
|
-
import { OxFormField } from '@operato/input';
|
|
3
|
-
type CommonCodeDetail = {
|
|
4
|
-
name: string;
|
|
5
|
-
description: string;
|
|
6
|
-
rank: number;
|
|
7
|
-
};
|
|
8
|
-
export declare class OxInputCodeFilter extends OxFormField {
|
|
9
|
-
static styles: import("lit").CSSResult;
|
|
10
|
-
column: any;
|
|
11
|
-
value?: string;
|
|
12
|
-
codes: CommonCodeDetail[];
|
|
13
|
-
render(): import("lit-html").TemplateResult<1>;
|
|
14
|
-
fetchCodes(): Promise<void>;
|
|
15
|
-
connectedCallback(): void;
|
|
16
|
-
}
|
|
17
|
-
export {};
|
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
import { __decorate } from "tslib";
|
|
2
|
-
import '@operato/input/ox-select.js';
|
|
3
|
-
import gql from 'graphql-tag';
|
|
4
|
-
import { css, html } from 'lit';
|
|
5
|
-
import { customElement, property, state } from 'lit/decorators.js';
|
|
6
|
-
import { i18next } from '@operato/i18n';
|
|
7
|
-
import { client, gqlContext } from '@operato/graphql';
|
|
8
|
-
import { OxFormField } from '@operato/input';
|
|
9
|
-
const FETCH_COMMON_CODE_GQL = (codeName) => gql `
|
|
10
|
-
{
|
|
11
|
-
commonCode(name: "${codeName}") {
|
|
12
|
-
details {
|
|
13
|
-
name
|
|
14
|
-
description
|
|
15
|
-
rank
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
`;
|
|
20
|
-
let OxInputCodeFilter = class OxInputCodeFilter extends OxFormField {
|
|
21
|
-
constructor() {
|
|
22
|
-
super(...arguments);
|
|
23
|
-
this.codes = [];
|
|
24
|
-
}
|
|
25
|
-
render() {
|
|
26
|
-
var _a, _b;
|
|
27
|
-
const { name, filter } = this.column;
|
|
28
|
-
const operator = filter.operator;
|
|
29
|
-
const { selectDispOpt = 'code-name' } = this.column.record || {};
|
|
30
|
-
if (!this.codes || this.codes.length === 0) {
|
|
31
|
-
return html `<p>Loading...</p>`;
|
|
32
|
-
}
|
|
33
|
-
return operator === 'in'
|
|
34
|
-
? html `
|
|
35
|
-
<ox-select
|
|
36
|
-
.value=${this.value}
|
|
37
|
-
@change=${(e) => {
|
|
38
|
-
let val = e.detail;
|
|
39
|
-
this.value = (val === null || val === void 0 ? void 0 : val.length) > 0 ? val : undefined;
|
|
40
|
-
this === null || this === void 0 ? void 0 : this.dispatchEvent(new CustomEvent('change', {
|
|
41
|
-
detail: {
|
|
42
|
-
name,
|
|
43
|
-
operator,
|
|
44
|
-
value: this.value
|
|
45
|
-
}
|
|
46
|
-
}));
|
|
47
|
-
}}
|
|
48
|
-
>
|
|
49
|
-
<ox-popup-list multiple attr-selected="checked" with-search align-left>
|
|
50
|
-
<ox-checkbox
|
|
51
|
-
checkAll
|
|
52
|
-
@click=${(e) => {
|
|
53
|
-
var _a;
|
|
54
|
-
const checked = e.target.checked;
|
|
55
|
-
const val = checked ? this.codes.map((code) => code.name) : [];
|
|
56
|
-
(_a = e.target) === null || _a === void 0 ? void 0 : _a.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: val }));
|
|
57
|
-
}}
|
|
58
|
-
>${i18next.t('label.all')}</ox-checkbox
|
|
59
|
-
>
|
|
60
|
-
${(_a = this.codes) === null || _a === void 0 ? void 0 : _a.filter((code) => !!code.name).map((code) => html `
|
|
61
|
-
<ox-checkbox
|
|
62
|
-
option
|
|
63
|
-
value=${code.name}
|
|
64
|
-
@change=${(e) => {
|
|
65
|
-
const parent = e.target.parentElement;
|
|
66
|
-
const checkCnt = e.target.checked ? 1 : -1;
|
|
67
|
-
const checkedLen = parent.querySelectorAll('ox-checkbox[option][checked]').length + checkCnt;
|
|
68
|
-
parent.querySelector('ox-checkbox[checkAll]').checked =
|
|
69
|
-
this.codes.filter((code) => !!code.name).length === checkedLen;
|
|
70
|
-
}}
|
|
71
|
-
>${selectDispOpt.replace('name', code.description).replace('code', code.name)}</ox-checkbox
|
|
72
|
-
>
|
|
73
|
-
`)}
|
|
74
|
-
</ox-popup-list>
|
|
75
|
-
</ox-select>
|
|
76
|
-
`
|
|
77
|
-
: html `
|
|
78
|
-
<ox-select
|
|
79
|
-
.value=${this.value}
|
|
80
|
-
@change=${(e) => {
|
|
81
|
-
this.value = e.detail;
|
|
82
|
-
this.dispatchEvent(new CustomEvent('change', {
|
|
83
|
-
detail: {
|
|
84
|
-
name,
|
|
85
|
-
operator,
|
|
86
|
-
value: this.value
|
|
87
|
-
}
|
|
88
|
-
}));
|
|
89
|
-
}}
|
|
90
|
-
>
|
|
91
|
-
<ox-popup-list with-search>
|
|
92
|
-
<div option value=""> </div>
|
|
93
|
-
${(_b = this.codes) === null || _b === void 0 ? void 0 : _b.map((code) => html `
|
|
94
|
-
<div option value=${code.name}>
|
|
95
|
-
${selectDispOpt.replace('name', code.description).replace('code', code.name)}
|
|
96
|
-
</div>
|
|
97
|
-
`)}
|
|
98
|
-
</ox-popup-list>
|
|
99
|
-
</ox-select>
|
|
100
|
-
`;
|
|
101
|
-
}
|
|
102
|
-
async fetchCodes() {
|
|
103
|
-
var _a;
|
|
104
|
-
const { codeName } = this.column.record || {};
|
|
105
|
-
if (codeName) {
|
|
106
|
-
const response = await client.query({
|
|
107
|
-
query: FETCH_COMMON_CODE_GQL(codeName),
|
|
108
|
-
context: gqlContext()
|
|
109
|
-
});
|
|
110
|
-
this.codes = ((_a = response === null || response === void 0 ? void 0 : response.data) === null || _a === void 0 ? void 0 : _a.commonCode.details) || [];
|
|
111
|
-
this.requestUpdate();
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
connectedCallback() {
|
|
115
|
-
super.connectedCallback();
|
|
116
|
-
this.fetchCodes();
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
OxInputCodeFilter.styles = css `
|
|
120
|
-
:host {
|
|
121
|
-
min-width: 100px;
|
|
122
|
-
}
|
|
123
|
-
`;
|
|
124
|
-
__decorate([
|
|
125
|
-
property({ type: Object })
|
|
126
|
-
], OxInputCodeFilter.prototype, "column", void 0);
|
|
127
|
-
__decorate([
|
|
128
|
-
property({ type: String })
|
|
129
|
-
], OxInputCodeFilter.prototype, "value", void 0);
|
|
130
|
-
__decorate([
|
|
131
|
-
state()
|
|
132
|
-
], OxInputCodeFilter.prototype, "codes", void 0);
|
|
133
|
-
OxInputCodeFilter = __decorate([
|
|
134
|
-
customElement('ox-filter-resource-code')
|
|
135
|
-
], OxInputCodeFilter);
|
|
136
|
-
export { OxInputCodeFilter };
|
|
137
|
-
//# sourceMappingURL=ox-filter-resource-code.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ox-filter-resource-code.js","sourceRoot":"","sources":["../../../src/filters-form/ox-filter-resource-code.ts"],"names":[],"mappings":";AAAA,OAAO,6BAA6B,CAAA;AAEpC,OAAO,GAAG,MAAM,aAAa,CAAA;AAC7B,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AAQ5C,MAAM,qBAAqB,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IZ;AAE2B;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;iDAAY;AACX;IAA3B,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;gDAAe;AAEjC;IAAR,KAAK,EAAE;gDAA+B;AAV5B,iBAAiB;IAD7B,aAAa,CAAC,sBAAsB,CAAC;GACzB,iBAAiB,CA2H7B","sourcesContent":["import '@operato/input/ox-select.js'\n\nimport gql from 'graphql-tag'\nimport { css, html } from 'lit'\nimport { customElement, property, state } from 'lit/decorators.js'\n\nimport { i18next } from '@operato/i18n'\nimport { FilterConfigObject } from '@operato/data-grist'\nimport { client, gqlContext } from '@operato/graphql'\nimport { OxFormField } from '@operato/input'\n\ntype CommonCodeDetail = {\n name: string\n description: string\n rank: number\n}\n\nconst FETCH_COMMON_CODE_GQL = (codeName: string) => gql`\n{\n commonCode(name: \"${codeName}\") {\n details {\n name\n description\n rank\n }\n }\n}\n`\n\n@customElement('ox-filter-resource-code')\nexport class OxInputCodeFilter extends OxFormField {\n static styles = css`\n :host {\n min-width: 100px;\n }\n `\n\n @property({ type: Object }) column: any\n @property({ type: String }) value?: string\n\n @state() codes: CommonCodeDetail[] = []\n\n render() {\n const { name, filter } = this.column\n const operator = (filter as FilterConfigObject).operator\n const { selectDispOpt = 'code-name' } = this.column.record || {}\n\n if (!this.codes || this.codes.length === 0) {\n return html`<p>Loading...</p>`\n }\n\n return operator === 'in'\n ? html`\n <ox-select\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n let val = e.detail\n this.value = val?.length > 0 ? val : undefined\n\n this?.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n name,\n operator,\n value: this.value\n }\n })\n )\n }}\n >\n <ox-popup-list multiple attr-selected=\"checked\" with-search align-left>\n <ox-checkbox\n checkAll\n @click=${(e: any) => {\n const checked = e.target.checked\n const val = checked ? this.codes!.map((code: CommonCodeDetail) => code.name) : []\n\n e.target?.dispatchEvent(new CustomEvent('select', { bubbles: true, detail: val }))\n }}\n >${i18next.t('label.all')}</ox-checkbox\n >\n ${this.codes\n ?.filter((code: CommonCodeDetail) => !!code.name)\n .map(\n (code: CommonCodeDetail) => html`\n <ox-checkbox\n option\n value=${code.name}\n @change=${(e: any) => {\n const parent = e.target.parentElement\n const checkCnt = e.target.checked ? 1 : -1\n const checkedLen = parent.querySelectorAll('ox-checkbox[option][checked]').length + checkCnt\n\n parent.querySelector('ox-checkbox[checkAll]').checked =\n this.codes.filter((code: CommonCodeDetail) => !!code.name).length === checkedLen\n }}\n >${selectDispOpt.replace('name', code.description).replace('code', code.name)}</ox-checkbox\n >\n `\n )}\n </ox-popup-list>\n </ox-select>\n `\n : html`\n <ox-select\n .value=${this.value}\n @change=${(e: CustomEvent) => {\n this.value = e.detail\n this.dispatchEvent(\n new CustomEvent('change', {\n detail: {\n name,\n operator,\n value: this.value\n }\n })\n )\n }}\n >\n <ox-popup-list with-search>\n <div option value=\"\"> </div>\n ${this.codes?.map(\n (code: CommonCodeDetail) => html`\n <div option value=${code.name}>\n ${selectDispOpt.replace('name', code.description).replace('code', code.name)}\n </div>\n `\n )}\n </ox-popup-list>\n </ox-select>\n `\n }\n\n async fetchCodes() {\n const { codeName } = this.column.record || {}\n\n if (codeName) {\n const response = await client.query({\n query: FETCH_COMMON_CODE_GQL(codeName),\n context: gqlContext()\n })\n\n this.codes = response?.data?.commonCode.details || []\n\n this.requestUpdate()\n }\n }\n\n connectedCallback() {\n super.connectedCallback()\n\n this.fetchCodes()\n }\n}\n"]}
|