@things-factory/organization 6.0.12 → 6.0.17
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/client/component/approval-line-view.ts +8 -3
- package/dist-client/component/approval-line-view.d.ts +2 -1
- package/dist-client/component/approval-line-view.js +15 -3
- package/dist-client/component/approval-line-view.js.map +1 -1
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/approval-line/approval-line-item.js +13 -26
- package/dist-server/service/approval-line/approval-line-item.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/server/service/approval-line/approval-line-item.ts +12 -12
|
@@ -29,10 +29,15 @@ export class ApprovalLineView extends localize(i18next)(LitElement) {
|
|
|
29
29
|
border-radius: 5px;
|
|
30
30
|
border: 2px solid var(--primary-color, black);
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
div[approver][current] {
|
|
34
|
+
border-color: red;
|
|
35
|
+
}
|
|
32
36
|
`
|
|
33
37
|
]
|
|
34
38
|
|
|
35
39
|
@property({ type: Object }) model?: ApprovalLineItem[]
|
|
40
|
+
@property({ type: Number }) current?: number = -1
|
|
36
41
|
|
|
37
42
|
render() {
|
|
38
43
|
const items = this.model || []
|
|
@@ -46,11 +51,11 @@ export class ApprovalLineView extends localize(i18next)(LitElement) {
|
|
|
46
51
|
</div>
|
|
47
52
|
`
|
|
48
53
|
: html``}
|
|
49
|
-
${items.map(item => this.renderItem(item))}
|
|
54
|
+
${items.map((item, order) => this.renderItem(item, order + 1))}
|
|
50
55
|
`
|
|
51
56
|
}
|
|
52
57
|
|
|
53
|
-
renderItem(item: ApprovalLineItem): TemplateResult {
|
|
58
|
+
renderItem(item: ApprovalLineItem, order: number): TemplateResult {
|
|
54
59
|
const { type, approver } = item
|
|
55
60
|
const { name, description, controlNo } = approver || {}
|
|
56
61
|
const subname = (description || controlNo) && `(${description || controlNo})`
|
|
@@ -58,7 +63,7 @@ export class ApprovalLineView extends localize(i18next)(LitElement) {
|
|
|
58
63
|
return html`
|
|
59
64
|
<mwc-icon>arrow_forward_ios</mwc-icon>
|
|
60
65
|
|
|
61
|
-
<div approver>
|
|
66
|
+
<div approver ?current=${this.current == order}>
|
|
62
67
|
<div>${type}</div>
|
|
63
68
|
<div><span name>${name}</span>${subname}</div>
|
|
64
69
|
</div>
|
|
@@ -4,7 +4,8 @@ declare const ApprovalLineView_base: (new (...args: any[]) => LitElement) & type
|
|
|
4
4
|
export declare class ApprovalLineView extends ApprovalLineView_base {
|
|
5
5
|
static styles: import("lit").CSSResult[];
|
|
6
6
|
model?: ApprovalLineItem[];
|
|
7
|
+
current?: number;
|
|
7
8
|
render(): TemplateResult<1>;
|
|
8
|
-
renderItem(item: ApprovalLineItem): TemplateResult;
|
|
9
|
+
renderItem(item: ApprovalLineItem, order: number): TemplateResult;
|
|
9
10
|
}
|
|
10
11
|
export {};
|
|
@@ -3,6 +3,10 @@ import { css, html, LitElement } from 'lit';
|
|
|
3
3
|
import { customElement, property } from 'lit/decorators.js';
|
|
4
4
|
import { i18next, localize } from '@operato/i18n';
|
|
5
5
|
let ApprovalLineView = class ApprovalLineView extends localize(i18next)(LitElement) {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.current = -1;
|
|
9
|
+
}
|
|
6
10
|
render() {
|
|
7
11
|
const items = this.model || [];
|
|
8
12
|
return html `
|
|
@@ -14,17 +18,17 @@ let ApprovalLineView = class ApprovalLineView extends localize(i18next)(LitEleme
|
|
|
14
18
|
</div>
|
|
15
19
|
`
|
|
16
20
|
: html ``}
|
|
17
|
-
${items.map(item => this.renderItem(item))}
|
|
21
|
+
${items.map((item, order) => this.renderItem(item, order + 1))}
|
|
18
22
|
`;
|
|
19
23
|
}
|
|
20
|
-
renderItem(item) {
|
|
24
|
+
renderItem(item, order) {
|
|
21
25
|
const { type, approver } = item;
|
|
22
26
|
const { name, description, controlNo } = approver || {};
|
|
23
27
|
const subname = (description || controlNo) && `(${description || controlNo})`;
|
|
24
28
|
return html `
|
|
25
29
|
<mwc-icon>arrow_forward_ios</mwc-icon>
|
|
26
30
|
|
|
27
|
-
<div approver>
|
|
31
|
+
<div approver ?current=${this.current == order}>
|
|
28
32
|
<div>${type}</div>
|
|
29
33
|
<div><span name>${name}</span>${subname}</div>
|
|
30
34
|
</div>
|
|
@@ -54,12 +58,20 @@ ApprovalLineView.styles = [
|
|
|
54
58
|
border-radius: 5px;
|
|
55
59
|
border: 2px solid var(--primary-color, black);
|
|
56
60
|
}
|
|
61
|
+
|
|
62
|
+
div[approver][current] {
|
|
63
|
+
border-color: red;
|
|
64
|
+
}
|
|
57
65
|
`
|
|
58
66
|
];
|
|
59
67
|
__decorate([
|
|
60
68
|
property({ type: Object }),
|
|
61
69
|
__metadata("design:type", Array)
|
|
62
70
|
], ApprovalLineView.prototype, "model", void 0);
|
|
71
|
+
__decorate([
|
|
72
|
+
property({ type: Number }),
|
|
73
|
+
__metadata("design:type", Number)
|
|
74
|
+
], ApprovalLineView.prototype, "current", void 0);
|
|
63
75
|
ApprovalLineView = __decorate([
|
|
64
76
|
customElement('approval-line-view')
|
|
65
77
|
], ApprovalLineView);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-line-view.js","sourceRoot":"","sources":["../../client/component/approval-line-view.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAkB,MAAM,KAAK,CAAA;AAC3D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAS,MAAM,mBAAmB,CAAA;AAElE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAI1C,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"approval-line-view.js","sourceRoot":"","sources":["../../client/component/approval-line-view.ts"],"names":[],"mappings":";AAAA,OA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AI,EAAE,MAAM,EAAE,CAAC;;+CAA2B;AACtD;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;iDAAsB;AAhCtC,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAgE5B;SAhEY,gBAAgB","sourcesContent":["import { css, html, LitElement, TemplateResult } from 'lit'\nimport { customElement, property, query } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { ApprovalLineItem } from '../model/approval-line'\n\n@customElement('approval-line-view')\nexport class ApprovalLineView extends localize(i18next)(LitElement) {\n static styles = [\n css`\n :host {\n display: flex;\n flex-direction: row;\n flex-wrap: wrap;\n\n gap: 10px;\n padding: 10px;\n\n align-items: center;\n\n background-color: #fff;\n\n --mdc-icon-size: 3em;\n color: var(--secondary-color, black);\n }\n\n div[approver] {\n padding: 5px;\n border-radius: 5px;\n border: 2px solid var(--primary-color, black);\n }\n\n div[approver][current] {\n border-color: red;\n }\n `\n ]\n\n @property({ type: Object }) model?: ApprovalLineItem[]\n @property({ type: Number }) current?: number = -1\n\n render() {\n const items = this.model || []\n\n return html`\n ${this.model\n ? html`\n <div approver>\n <div>ME</div>\n <div>myself</div>\n </div>\n `\n : html``}\n ${items.map((item, order) => this.renderItem(item, order + 1))}\n `\n }\n\n renderItem(item: ApprovalLineItem, order: number): TemplateResult {\n const { type, approver } = item\n const { name, description, controlNo } = approver || {}\n const subname = (description || controlNo) && `(${description || controlNo})`\n\n return html`\n <mwc-icon>arrow_forward_ios</mwc-icon>\n\n <div approver ?current=${this.current == order}>\n <div>${type}</div>\n <div><span name>${name}</span>${subname}</div>\n </div>\n `\n }\n}\n"]}
|