@things-factory/organization 6.0.21 → 6.0.25
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-items-editor.ts +4 -2
- package/client/component/assignees-editor-popup.ts +75 -0
- package/client/component/assignees-editor.ts +211 -0
- package/client/component/assignees-view.ts +55 -0
- package/client/component/index.ts +5 -1
- package/client/model/approval-line.ts +3 -15
- package/client/model/org-member.ts +21 -0
- package/dist-client/component/approval-line-items-editor.js +4 -2
- package/dist-client/component/approval-line-items-editor.js.map +1 -1
- package/dist-client/component/assignees-editor-popup.d.ts +20 -0
- package/dist-client/component/assignees-editor-popup.js +81 -0
- package/dist-client/component/assignees-editor-popup.js.map +1 -0
- package/dist-client/component/assignees-editor.d.ts +27 -0
- package/dist-client/component/assignees-editor.js +208 -0
- package/dist-client/component/assignees-editor.js.map +1 -0
- package/dist-client/component/assignees-view.d.ts +10 -0
- package/dist-client/component/assignees-view.js +55 -0
- package/dist-client/component/assignees-view.js.map +1 -0
- package/dist-client/component/index.d.ts +3 -0
- package/dist-client/component/index.js +3 -0
- package/dist-client/component/index.js.map +1 -1
- package/dist-client/model/approval-line.d.ts +3 -13
- package/dist-client/model/approval-line.js +0 -8
- package/dist-client/model/approval-line.js.map +1 -1
- package/dist-client/model/org-member.d.ts +19 -0
- package/dist-client/model/org-member.js +14 -0
- package/dist-client/model/org-member.js.map +1 -0
- package/dist-client/tsconfig.tsbuildinfo +1 -1
- package/dist-server/service/approval-line/approval-line-item.js +22 -31
- package/dist-server/service/approval-line/approval-line-item.js.map +1 -1
- package/dist-server/service/approval-line/approval-line-query.js +7 -1
- package/dist-server/service/approval-line/approval-line-query.js.map +1 -1
- package/dist-server/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/server/service/approval-line/approval-line-item.ts +12 -26
- package/server/service/approval-line/approval-line-query.ts +7 -1
- package/translations/en.json +1 -0
- package/translations/ko.json +1 -0
- package/translations/ms.json +1 -0
- package/translations/zh.json +1 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import './assignees-view';
|
|
3
|
+
import { css, html, LitElement } from 'lit';
|
|
4
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
5
|
+
import { i18next, localize } from '@operato/i18n';
|
|
6
|
+
import { DataGrist, getEditor, getRenderer } from '@operato/data-grist';
|
|
7
|
+
import { isMobileDevice } from '@operato/utils';
|
|
8
|
+
import { ButtonContainerStyles } from '@operato/styles';
|
|
9
|
+
/**
|
|
10
|
+
* Assignee 리스트를 편집한다.
|
|
11
|
+
*/
|
|
12
|
+
let AssigneesEditor = class AssigneesEditor extends localize(i18next)(LitElement) {
|
|
13
|
+
render() {
|
|
14
|
+
return html `
|
|
15
|
+
<assignees-view .value=${this.value}></assignees-view>
|
|
16
|
+
|
|
17
|
+
<ox-grist
|
|
18
|
+
.mode=${isMobileDevice() ? 'CARD' : 'GRID'}
|
|
19
|
+
.config=${this.gristConfig}
|
|
20
|
+
.fetchHandler=${this.fetchHandler.bind(this)}
|
|
21
|
+
@record-change=${e => {
|
|
22
|
+
var _a;
|
|
23
|
+
this.value = (((_a = this.grist) === null || _a === void 0 ? void 0 : _a._data.records) || []).map(v => {
|
|
24
|
+
return { type: v.type, value: v.value, assignee: v.assignee };
|
|
25
|
+
});
|
|
26
|
+
this.dispatchEvent(new CustomEvent('change', {
|
|
27
|
+
bubbles: true,
|
|
28
|
+
composed: true,
|
|
29
|
+
detail: this.value
|
|
30
|
+
}));
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<div slot="headroom">
|
|
34
|
+
<div id="select">
|
|
35
|
+
<mwc-button raised danger @click=${() => this.deleteDataItems()}>${i18next.t('button.delete')}</mwc-button>
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</ox-grist>
|
|
39
|
+
`;
|
|
40
|
+
}
|
|
41
|
+
async firstUpdated() {
|
|
42
|
+
this.gristConfig = {
|
|
43
|
+
list: {
|
|
44
|
+
fields: ['type', 'assignee']
|
|
45
|
+
},
|
|
46
|
+
columns: [
|
|
47
|
+
{ type: 'gutter', gutterName: 'row-selector', multiple: true },
|
|
48
|
+
{ type: 'gutter', gutterName: 'sequence' },
|
|
49
|
+
{
|
|
50
|
+
type: 'gutter',
|
|
51
|
+
gutterName: 'button',
|
|
52
|
+
icon: 'arrow_upward',
|
|
53
|
+
handlers: {
|
|
54
|
+
click: 'move-up'
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
type: 'gutter',
|
|
59
|
+
gutterName: 'button',
|
|
60
|
+
icon: 'arrow_downward',
|
|
61
|
+
handlers: {
|
|
62
|
+
click: 'move-down'
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
type: 'select',
|
|
67
|
+
name: 'type',
|
|
68
|
+
header: i18next.t('field.type'),
|
|
69
|
+
record: {
|
|
70
|
+
editable: true,
|
|
71
|
+
options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']
|
|
72
|
+
},
|
|
73
|
+
width: 140
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
type: 'resource-object',
|
|
77
|
+
name: 'assignee',
|
|
78
|
+
header: i18next.t('field.assignee'),
|
|
79
|
+
record: {
|
|
80
|
+
editable: true,
|
|
81
|
+
editor: function (value, column, record, rowIndex, field) {
|
|
82
|
+
var options = {};
|
|
83
|
+
switch (record.type) {
|
|
84
|
+
case 'Employee':
|
|
85
|
+
options = {
|
|
86
|
+
title: i18next.t('title.employee list'),
|
|
87
|
+
queryName: 'employees',
|
|
88
|
+
columns: [
|
|
89
|
+
{ name: 'id', hidden: true },
|
|
90
|
+
{
|
|
91
|
+
name: 'controlNo',
|
|
92
|
+
header: { renderer: () => i18next.t('field.control-no') },
|
|
93
|
+
filter: 'search'
|
|
94
|
+
},
|
|
95
|
+
{ name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }
|
|
96
|
+
],
|
|
97
|
+
list: { fields: ['name', 'control-no'] },
|
|
98
|
+
valueField: 'id',
|
|
99
|
+
nameField: 'name',
|
|
100
|
+
descriptionField: 'controlNo'
|
|
101
|
+
};
|
|
102
|
+
break;
|
|
103
|
+
case 'Department':
|
|
104
|
+
options = {
|
|
105
|
+
title: i18next.t('title.department list'),
|
|
106
|
+
queryName: 'departments'
|
|
107
|
+
};
|
|
108
|
+
break;
|
|
109
|
+
case 'Role':
|
|
110
|
+
options = {
|
|
111
|
+
title: i18next.t('title.lookup role'),
|
|
112
|
+
queryName: 'roles'
|
|
113
|
+
};
|
|
114
|
+
break;
|
|
115
|
+
default:
|
|
116
|
+
options = {};
|
|
117
|
+
}
|
|
118
|
+
var dynamicRecord = Object.assign(Object.assign({}, column.record), { options });
|
|
119
|
+
return getEditor(column.type)(value, Object.assign(Object.assign({}, column), { record: dynamicRecord }), record, rowIndex, field);
|
|
120
|
+
},
|
|
121
|
+
renderer: function (value, column, record, rowIndex, field) {
|
|
122
|
+
var options = {};
|
|
123
|
+
switch (record.type) {
|
|
124
|
+
case 'Employee':
|
|
125
|
+
options = {
|
|
126
|
+
valueField: 'id',
|
|
127
|
+
nameField: 'name',
|
|
128
|
+
descriptionField: 'controlNo'
|
|
129
|
+
};
|
|
130
|
+
break;
|
|
131
|
+
case 'Department':
|
|
132
|
+
case 'Role':
|
|
133
|
+
default:
|
|
134
|
+
break;
|
|
135
|
+
}
|
|
136
|
+
var dynamicRecord = Object.assign(Object.assign({}, column.record), { options });
|
|
137
|
+
return getRenderer(column.type)(value, Object.assign(Object.assign({}, column), { record: dynamicRecord }), record, rowIndex, field);
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
width: 180
|
|
141
|
+
}
|
|
142
|
+
],
|
|
143
|
+
rows: {
|
|
144
|
+
selectable: {
|
|
145
|
+
multiple: true
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
pagination: {
|
|
149
|
+
infinite: true
|
|
150
|
+
},
|
|
151
|
+
sorters: []
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
async fetchHandler({ filters, page, limit, sortings = [] }) {
|
|
155
|
+
const value = [...(this.value || [])];
|
|
156
|
+
this.value = value;
|
|
157
|
+
return {
|
|
158
|
+
total: value.length,
|
|
159
|
+
records: value
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
async deleteDataItems() {
|
|
163
|
+
var _a;
|
|
164
|
+
(_a = this.grist) === null || _a === void 0 ? void 0 : _a.deleteSelectedRecords(false);
|
|
165
|
+
}
|
|
166
|
+
};
|
|
167
|
+
AssigneesEditor.styles = [
|
|
168
|
+
ButtonContainerStyles,
|
|
169
|
+
css `
|
|
170
|
+
:host {
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
|
|
174
|
+
background-color: #fff;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
assignees-view {
|
|
178
|
+
min-height: 100px;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
ox-grist {
|
|
182
|
+
flex: 1;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
#select {
|
|
186
|
+
display: flex;
|
|
187
|
+
justify-content: end;
|
|
188
|
+
padding: 10px;
|
|
189
|
+
}
|
|
190
|
+
`
|
|
191
|
+
];
|
|
192
|
+
__decorate([
|
|
193
|
+
property({ type: Object }),
|
|
194
|
+
__metadata("design:type", Array)
|
|
195
|
+
], AssigneesEditor.prototype, "value", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
state(),
|
|
198
|
+
__metadata("design:type", Object)
|
|
199
|
+
], AssigneesEditor.prototype, "gristConfig", void 0);
|
|
200
|
+
__decorate([
|
|
201
|
+
query('ox-grist'),
|
|
202
|
+
__metadata("design:type", DataGrist)
|
|
203
|
+
], AssigneesEditor.prototype, "grist", void 0);
|
|
204
|
+
AssigneesEditor = __decorate([
|
|
205
|
+
customElement('assignees-editor')
|
|
206
|
+
], AssigneesEditor);
|
|
207
|
+
export { AssigneesEditor };
|
|
208
|
+
//# sourceMappingURL=assignees-editor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignees-editor.js","sourceRoot":"","sources":["../../client/component/assignees-editor.ts"],"names":[],"mappings":";AAAA,OAAO,kBAAkB,CAAA;AAEzB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,KAAK,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAEzE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACjD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAA;AAIvD;;GAEG;AAEI,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,QAAQ,CAAC,OAAO,CAAC,CAAC,UAAU,CAAC;IAiChE,MAAM;QACJ,OAAO,IAAI,CAAA;+BACgB,IAAI,CAAC,KAAK;;;gBAGzB,cAAc,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM;kBAChC,IAAI,CAAC,WAAW;wBACV,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC;yBAC3B,CAAC,CAAC,EAAE;;YACnB,IAAI,CAAC,KAAK,GAAG,CAAC,CAAA,MAAC,IAAI,CAAC,KAAa,0CAAE,KAAK,CAAC,OAAO,KAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE;gBAC9D,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC,QAAQ,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AAG,EAAE,EAAE;QACxD,MAAM,KAAK,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,CAAA;QACrC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAElB,OAAO;YACL,KAAK,EAAE,KAAK,CAAC,MAAM;YACnB,OAAO,EAAE,KAAK;SACf,CAAA;IACH,CAAC;IAED,KAAK,CAAC,eAAe;;QACnB,MAAA,IAAI,CAAC,KAAK,0CAAE,qBAAqB,CAAC,KAAK,CAAC,CAAA;IAC1C,CAAC;;AAhMM,sBAAM,GAAG;IACd,qBAAqB;IACrB,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;KAqBF;CACF,CAAA;AAED;IAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;8CAAuB;AAElD;IAAC,KAAK,EAAE;;oDAAkB;AAE1B;IAAC,KAAK,CAAC,UAAU,CAAC;8BAAS,SAAS;8CAAA;AA/BzB,eAAe;IAD3B,aAAa,CAAC,kBAAkB,CAAC;GACrB,eAAe,CAkM3B;SAlMY,eAAe","sourcesContent":["import './assignees-view'\n\nimport { css, html, LitElement } from 'lit'\nimport { customElement, property, query, state } from 'lit/decorators.js'\n\nimport { i18next, localize } from '@operato/i18n'\nimport { DataGrist, getEditor, getRenderer } from '@operato/data-grist'\nimport { isMobileDevice } from '@operato/utils'\nimport { ButtonContainerStyles } from '@operato/styles'\n\nimport { AssigneeItem } from '../model/org-member'\n\n/**\n * Assignee 리스트를 편집한다.\n */\n@customElement('assignees-editor')\nexport class AssigneesEditor extends localize(i18next)(LitElement) {\n static styles = [\n ButtonContainerStyles,\n css`\n :host {\n display: flex;\n flex-direction: column;\n\n background-color: #fff;\n }\n\n assignees-view {\n min-height: 100px;\n }\n\n ox-grist {\n flex: 1;\n }\n\n #select {\n display: flex;\n justify-content: end;\n padding: 10px;\n }\n `\n ]\n\n @property({ type: Object }) value?: AssigneeItem[]\n\n @state() gristConfig?: any\n\n @query('ox-grist') grist?: DataGrist\n\n render() {\n return html`\n <assignees-view .value=${this.value}></assignees-view>\n\n <ox-grist\n .mode=${isMobileDevice() ? 'CARD' : 'GRID'}\n .config=${this.gristConfig}\n .fetchHandler=${this.fetchHandler.bind(this)}\n @record-change=${e => {\n this.value = ((this.grist as any)?._data.records || []).map(v => {\n return { type: v.type, value: v.value, assignee: v.assignee }\n })\n this.dispatchEvent(\n new CustomEvent('change', {\n bubbles: true,\n composed: true,\n detail: this.value\n })\n )\n }}\n >\n <div slot=\"headroom\">\n <div id=\"select\">\n <mwc-button raised danger @click=${() => this.deleteDataItems()}>${i18next.t('button.delete')}</mwc-button>\n </div>\n </div>\n </ox-grist>\n `\n }\n\n async firstUpdated() {\n this.gristConfig = {\n list: {\n fields: ['type', 'assignee']\n },\n columns: [\n { type: 'gutter', gutterName: 'row-selector', multiple: true },\n { type: 'gutter', gutterName: 'sequence' },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_upward',\n handlers: {\n click: 'move-up'\n }\n },\n {\n type: 'gutter',\n gutterName: 'button',\n icon: 'arrow_downward',\n handlers: {\n click: 'move-down'\n }\n },\n {\n type: 'select',\n name: 'type',\n header: i18next.t('field.type'),\n record: {\n editable: true,\n options: ['', 'Employee', 'Department', 'Role', 'MyDepartment', 'MySupervisor', 'Myself']\n },\n width: 140\n },\n {\n type: 'resource-object',\n name: 'assignee',\n header: i18next.t('field.assignee'),\n record: {\n editable: true,\n editor: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n title: i18next.t('title.employee list'),\n queryName: 'employees',\n columns: [\n { name: 'id', hidden: true },\n {\n name: 'controlNo',\n header: { renderer: () => i18next.t('field.control-no') },\n filter: 'search'\n },\n { name: 'name', header: { renderer: () => i18next.t('field.name') }, filter: 'search' }\n ],\n list: { fields: ['name', 'control-no'] },\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n options = {\n title: i18next.t('title.department list'),\n queryName: 'departments'\n }\n break\n case 'Role':\n options = {\n title: i18next.t('title.lookup role'),\n queryName: 'roles'\n }\n break\n default:\n options = {}\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getEditor(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n },\n renderer: function (value, column, record, rowIndex, field) {\n var options = {}\n switch (record.type) {\n case 'Employee':\n options = {\n valueField: 'id',\n nameField: 'name',\n descriptionField: 'controlNo'\n }\n break\n case 'Department':\n case 'Role':\n default:\n break\n }\n\n var dynamicRecord = { ...column.record, options }\n\n return getRenderer(column.type)(value, { ...column, record: dynamicRecord }, record, rowIndex, field)\n }\n },\n width: 180\n }\n ],\n rows: {\n selectable: {\n multiple: true\n }\n },\n pagination: {\n infinite: true\n },\n sorters: []\n }\n }\n\n async fetchHandler({ filters, page, limit, sortings = [] }) {\n const value = [...(this.value || [])]\n this.value = value\n\n return {\n total: value.length,\n records: value\n }\n }\n\n async deleteDataItems() {\n this.grist?.deleteSelectedRecords(false)\n }\n}\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { LitElement, TemplateResult } from 'lit';
|
|
2
|
+
import { AssigneeItem } from '../model/org-member';
|
|
3
|
+
declare const AssigneesView_base: (new (...args: any[]) => LitElement) & typeof LitElement;
|
|
4
|
+
export declare class AssigneesView extends AssigneesView_base {
|
|
5
|
+
static styles: import("lit").CSSResult[];
|
|
6
|
+
value?: AssigneeItem[];
|
|
7
|
+
render(): TemplateResult<1>;
|
|
8
|
+
renderItem(item: AssigneeItem, order: number): TemplateResult;
|
|
9
|
+
}
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { css, html, LitElement } from 'lit';
|
|
3
|
+
import { customElement, property } from 'lit/decorators.js';
|
|
4
|
+
import { i18next, localize } from '@operato/i18n';
|
|
5
|
+
let AssigneesView = class AssigneesView extends localize(i18next)(LitElement) {
|
|
6
|
+
render() {
|
|
7
|
+
const items = this.value || [];
|
|
8
|
+
return html ` ${items.map((item, order) => this.renderItem(item, order + 1))} `;
|
|
9
|
+
}
|
|
10
|
+
renderItem(item, order) {
|
|
11
|
+
const { type, assignee } = item;
|
|
12
|
+
const { name, description, controlNo } = assignee || {};
|
|
13
|
+
const subname = (description || controlNo) && `(${description || controlNo})`;
|
|
14
|
+
return html `
|
|
15
|
+
<div assignee>
|
|
16
|
+
<div>${type}</div>
|
|
17
|
+
<div><span name>${name}</span>${subname}</div>
|
|
18
|
+
</div>
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
AssigneesView.styles = [
|
|
23
|
+
css `
|
|
24
|
+
:host {
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: row;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
|
|
29
|
+
gap: 10px;
|
|
30
|
+
padding: 10px;
|
|
31
|
+
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
background-color: #fff;
|
|
35
|
+
|
|
36
|
+
--mdc-icon-size: 3em;
|
|
37
|
+
color: var(--secondary-color, black);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
div[assignee] {
|
|
41
|
+
padding: 5px;
|
|
42
|
+
border-radius: 5px;
|
|
43
|
+
border: 2px solid var(--primary-color, black);
|
|
44
|
+
}
|
|
45
|
+
`
|
|
46
|
+
];
|
|
47
|
+
__decorate([
|
|
48
|
+
property({ type: Object }),
|
|
49
|
+
__metadata("design:type", Array)
|
|
50
|
+
], AssigneesView.prototype, "value", void 0);
|
|
51
|
+
AssigneesView = __decorate([
|
|
52
|
+
customElement('assignees-view')
|
|
53
|
+
], AssigneesView);
|
|
54
|
+
export { AssigneesView };
|
|
55
|
+
//# sourceMappingURL=assignees-view.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assignees-view.js","sourceRoot":"","sources":["../../client/component/assignees-view.ts"],"names":[],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nimport { i18next, localize } from '@operato/i18n'\nimport { AssigneeItem } from '../model/org-member'\n\n@customElement('assignees-view')\nexport class AssigneesView 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[assignee] {\n padding: 5px;\n border-radius: 5px;\n border: 2px solid var(--primary-color, black);\n }\n `\n ]\n\n @property({ type: Object }) value?: AssigneeItem[]\n\n render() {\n const items = this.value || []\n\n return html` ${items.map((item, order) => this.renderItem(item, order + 1))} `\n }\n\n renderItem(item: AssigneeItem, order: number): TemplateResult {\n const { type, assignee } = item\n const { name, description, controlNo } = assignee || {}\n const subname = (description || controlNo) && `(${description || controlNo})`\n\n return html`\n <div assignee>\n <div>${type}</div>\n <div><span name>${name}</span>${subname}</div>\n </div>\n `\n }\n}\n"]}
|
|
@@ -4,3 +4,6 @@ export * from './department-view';
|
|
|
4
4
|
export * from './approval-line-view';
|
|
5
5
|
export * from './approval-line-items-editor';
|
|
6
6
|
export * from './approval-line-items-editor-popup';
|
|
7
|
+
export * from './assignees-view';
|
|
8
|
+
export * from './assignees-editor';
|
|
9
|
+
export * from './assignees-editor-popup';
|
|
@@ -4,4 +4,7 @@ export * from './department-view';
|
|
|
4
4
|
export * from './approval-line-view';
|
|
5
5
|
export * from './approval-line-items-editor';
|
|
6
6
|
export * from './approval-line-items-editor-popup';
|
|
7
|
+
export * from './assignees-view';
|
|
8
|
+
export * from './assignees-editor';
|
|
9
|
+
export * from './assignees-editor-popup';
|
|
7
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/component/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,0BAA0B,CAAA;AAExC,cAAc,mBAAmB,CAAA;AAEjC,cAAc,sBAAsB,CAAA;AACpC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,oCAAoC,CAAA;AAElD,cAAc,kBAAkB,CAAA;AAChC,cAAc,oBAAoB,CAAA;AAClC,cAAc,0BAA0B,CAAA","sourcesContent":["export * from './department-selector'\nexport * from './approval-line-selector'\n\nexport * from './department-view'\n\nexport * from './approval-line-view'\nexport * from './approval-line-items-editor'\nexport * from './approval-line-items-editor-popup'\n\nexport * from './assignees-view'\nexport * from './assignees-editor'\nexport * from './assignees-editor-popup'\n"]}
|
|
@@ -3,25 +3,15 @@ import { User } from './user';
|
|
|
3
3
|
import { Role } from './role';
|
|
4
4
|
import { Employee } from './employee';
|
|
5
5
|
import { Department } from './department';
|
|
6
|
-
|
|
7
|
-
Employee = "Employee",
|
|
8
|
-
Department = "Department",
|
|
9
|
-
Role = "Role"
|
|
10
|
-
}
|
|
6
|
+
import { OrgMemberTarget, OrgMemberTargetType } from './org-member';
|
|
11
7
|
export declare enum ApprovalLineOwnerType {
|
|
12
8
|
Employee = "Employee",
|
|
13
9
|
Common = "Common"
|
|
14
10
|
}
|
|
15
|
-
export declare class ApproverTarget {
|
|
16
|
-
id?: string;
|
|
17
|
-
name?: string;
|
|
18
|
-
description?: string;
|
|
19
|
-
controlNo?: string;
|
|
20
|
-
}
|
|
21
11
|
export declare class ApprovalLineItem {
|
|
22
|
-
type?:
|
|
12
|
+
type?: OrgMemberTargetType;
|
|
23
13
|
value?: string;
|
|
24
|
-
approver?:
|
|
14
|
+
approver?: OrgMemberTarget;
|
|
25
15
|
}
|
|
26
16
|
export declare class ApprovalLine {
|
|
27
17
|
readonly id?: string;
|
|
@@ -1,16 +1,8 @@
|
|
|
1
|
-
export var ApprovalLineItemType;
|
|
2
|
-
(function (ApprovalLineItemType) {
|
|
3
|
-
ApprovalLineItemType["Employee"] = "Employee";
|
|
4
|
-
ApprovalLineItemType["Department"] = "Department";
|
|
5
|
-
ApprovalLineItemType["Role"] = "Role";
|
|
6
|
-
})(ApprovalLineItemType || (ApprovalLineItemType = {}));
|
|
7
1
|
export var ApprovalLineOwnerType;
|
|
8
2
|
(function (ApprovalLineOwnerType) {
|
|
9
3
|
ApprovalLineOwnerType["Employee"] = "Employee";
|
|
10
4
|
ApprovalLineOwnerType["Common"] = "Common";
|
|
11
5
|
})(ApprovalLineOwnerType || (ApprovalLineOwnerType = {}));
|
|
12
|
-
export class ApproverTarget {
|
|
13
|
-
}
|
|
14
6
|
export class ApprovalLineItem {
|
|
15
7
|
}
|
|
16
8
|
export class ApprovalLine {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"approval-line.js","sourceRoot":"","sources":["../../client/model/approval-line.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"approval-line.js","sourceRoot":"","sources":["../../client/model/approval-line.ts"],"names":[],"mappings":"AAQA,MAAM,CAAN,IAAY,qBAGX;AAHD,WAAY,qBAAqB;IAC/B,8CAAqB,CAAA;IACrB,0CAAiB,CAAA;AACnB,CAAC,EAHW,qBAAqB,KAArB,qBAAqB,QAGhC;AAED,MAAM,OAAO,gBAAgB;CAI5B;AAED,MAAM,OAAO,YAAY;CAkCxB","sourcesContent":["import { Domain } from './domain'\nimport { User } from './user'\nimport { Role } from './role'\n\nimport { Employee } from './employee'\nimport { Department } from './department'\nimport { OrgMemberTarget, OrgMemberTargetType } from './org-member'\n\nexport enum ApprovalLineOwnerType {\n Employee = 'Employee',\n Common = 'Common'\n}\n\nexport class ApprovalLineItem {\n type?: OrgMemberTargetType\n value?: string\n approver?: OrgMemberTarget\n}\n\nexport class ApprovalLine {\n readonly id?: string\n\n domain?: Domain\n\n domainId?: string\n\n name?: string\n\n description?: string\n\n model?: ApprovalLineItem[]\n\n ownerType?: ApprovalLineOwnerType\n\n ownerValue?: string\n\n ownerEmployee?: Employee\n\n ownerDepartment?: Department\n\n ownerRole?: Role\n\n createdAt?: Date\n\n updatedAt?: Date\n\n creator?: User\n\n creatorId?: string\n\n updater?: User\n\n updaterId?: string\n}\n"]}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare enum OrgMemberTargetType {
|
|
2
|
+
Employee = "Employee",
|
|
3
|
+
Department = "Department",
|
|
4
|
+
Role = "Role",
|
|
5
|
+
Myself = "Myself",
|
|
6
|
+
MyDepartment = "MyDepartment",
|
|
7
|
+
MySupervisor = "MySupervisor"
|
|
8
|
+
}
|
|
9
|
+
export declare class OrgMemberTarget {
|
|
10
|
+
id?: string;
|
|
11
|
+
name?: string;
|
|
12
|
+
description?: string;
|
|
13
|
+
controlNo?: string;
|
|
14
|
+
}
|
|
15
|
+
export declare class AssigneeItem {
|
|
16
|
+
type?: OrgMemberTargetType;
|
|
17
|
+
value?: string;
|
|
18
|
+
assignee?: OrgMemberTarget;
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export var OrgMemberTargetType;
|
|
2
|
+
(function (OrgMemberTargetType) {
|
|
3
|
+
OrgMemberTargetType["Employee"] = "Employee";
|
|
4
|
+
OrgMemberTargetType["Department"] = "Department";
|
|
5
|
+
OrgMemberTargetType["Role"] = "Role";
|
|
6
|
+
OrgMemberTargetType["Myself"] = "Myself";
|
|
7
|
+
OrgMemberTargetType["MyDepartment"] = "MyDepartment";
|
|
8
|
+
OrgMemberTargetType["MySupervisor"] = "MySupervisor";
|
|
9
|
+
})(OrgMemberTargetType || (OrgMemberTargetType = {}));
|
|
10
|
+
export class OrgMemberTarget {
|
|
11
|
+
}
|
|
12
|
+
export class AssigneeItem {
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=org-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"org-member.js","sourceRoot":"","sources":["../../client/model/org-member.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,4CAAqB,CAAA;IACrB,gDAAyB,CAAA;IACzB,oCAAa,CAAA;IACb,wCAAiB,CAAA;IACjB,oDAA6B,CAAA;IAC7B,oDAA6B,CAAA;AAC/B,CAAC,EAPW,mBAAmB,KAAnB,mBAAmB,QAO9B;AAED,MAAM,OAAO,eAAe;CAK3B;AAED,MAAM,OAAO,YAAY;CAIxB","sourcesContent":["export enum OrgMemberTargetType {\n Employee = 'Employee',\n Department = 'Department',\n Role = 'Role',\n Myself = 'Myself',\n MyDepartment = 'MyDepartment',\n MySupervisor = 'MySupervisor'\n}\n\nexport class OrgMemberTarget {\n id?: string\n name?: string\n description?: string\n controlNo?: string\n}\n\nexport class AssigneeItem {\n type?: OrgMemberTargetType\n value?: string\n assignee?: OrgMemberTarget\n}\n"]}
|