@unicef-polymer/etools-form-builder 2.1.0 → 2.1.2
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/LICENSE +674 -674
- package/README.md +1 -1
- package/dist/assets/translations.d.ts +6 -0
- package/dist/assets/translations.js +67 -0
- package/dist/form-attachments-popup/form-attachments-popup.d.ts +86 -85
- package/dist/form-attachments-popup/form-attachments-popup.helper.d.ts +8 -8
- package/dist/form-attachments-popup/form-attachments-popup.helper.js +14 -14
- package/dist/form-attachments-popup/form-attachments-popup.js +255 -248
- package/dist/form-attachments-popup/form-attachments-popup.tpl.d.ts +3 -3
- package/dist/form-attachments-popup/form-attachments-popup.tpl.js +91 -89
- package/dist/form-attachments-popup/index.d.ts +2 -2
- package/dist/form-attachments-popup/index.js +2 -2
- package/dist/form-fields/abstract-field-base.class.d.ts +33 -28
- package/dist/form-fields/abstract-field-base.class.js +194 -176
- package/dist/form-fields/field-renderer-component.d.ts +20 -20
- package/dist/form-fields/field-renderer-component.js +249 -249
- package/dist/form-fields/index.d.ts +12 -12
- package/dist/form-fields/index.js +12 -12
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.d.ts +17 -17
- package/dist/form-fields/repeatable-fields/repeatable-attachment-field.js +209 -208
- package/dist/form-fields/repeatable-fields/repeatable-base-field.d.ts +20 -20
- package/dist/form-fields/repeatable-fields/repeatable-base-field.js +124 -123
- package/dist/form-fields/repeatable-fields/repeatable-number-field.d.ts +10 -10
- package/dist/form-fields/repeatable-fields/repeatable-number-field.js +67 -66
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.d.ts +15 -15
- package/dist/form-fields/repeatable-fields/repeatable-scale-field.js +108 -108
- package/dist/form-fields/repeatable-fields/repeatable-text-field.d.ts +8 -8
- package/dist/form-fields/repeatable-fields/repeatable-text-field.js +53 -53
- package/dist/form-fields/single-fields/attachment-field.d.ts +16 -16
- package/dist/form-fields/single-fields/attachment-field.js +98 -97
- package/dist/form-fields/single-fields/base-field.d.ts +11 -11
- package/dist/form-fields/single-fields/base-field.js +58 -57
- package/dist/form-fields/single-fields/boolean-field.d.ts +8 -8
- package/dist/form-fields/single-fields/boolean-field.js +49 -49
- package/dist/form-fields/single-fields/number-field.d.ts +10 -10
- package/dist/form-fields/single-fields/number-field.js +67 -66
- package/dist/form-fields/single-fields/scale-field.d.ts +18 -18
- package/dist/form-fields/single-fields/scale-field.js +108 -107
- package/dist/form-fields/single-fields/text-field.d.ts +8 -8
- package/dist/form-fields/single-fields/text-field.js +54 -54
- package/dist/form-groups/form-abstract-group.d.ts +65 -60
- package/dist/form-groups/form-abstract-group.js +375 -353
- package/dist/form-groups/form-card.d.ts +32 -32
- package/dist/form-groups/form-card.js +113 -108
- package/dist/form-groups/form-collapsed-card.d.ts +70 -70
- package/dist/form-groups/form-collapsed-card.js +254 -253
- package/dist/form-groups/index.d.ts +3 -3
- package/dist/form-groups/index.js +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/lib/additional-components/confirmation-dialog.d.ts +18 -16
- package/dist/lib/additional-components/confirmation-dialog.js +72 -65
- package/dist/lib/additional-components/etools-fb-card.d.ts +21 -16
- package/dist/lib/additional-components/etools-fb-card.js +238 -215
- package/dist/lib/styles/attachments.styles.d.ts +2 -2
- package/dist/lib/styles/attachments.styles.js +72 -72
- package/dist/lib/styles/card-styles.d.ts +2 -2
- package/dist/lib/styles/card-styles.js +154 -154
- package/dist/lib/styles/dialog.styles.d.ts +2 -2
- package/dist/lib/styles/dialog.styles.js +85 -85
- package/dist/lib/styles/elevation-styles.d.ts +9 -9
- package/dist/lib/styles/elevation-styles.js +43 -43
- package/dist/lib/styles/flex-layout-classes.d.ts +2 -2
- package/dist/lib/styles/flex-layout-classes.js +319 -319
- package/dist/lib/styles/form-builder-card.styles.d.ts +2 -2
- package/dist/lib/styles/form-builder-card.styles.js +49 -49
- package/dist/lib/styles/input-styles.d.ts +2 -2
- package/dist/lib/styles/input-styles.js +138 -138
- package/dist/lib/styles/page-layout-styles.d.ts +2 -2
- package/dist/lib/styles/page-layout-styles.js +201 -201
- package/dist/lib/styles/shared-styles.d.ts +2 -2
- package/dist/lib/styles/shared-styles.js +70 -70
- package/dist/lib/types/form-builder.interfaces.d.ts +83 -83
- package/dist/lib/types/form-builder.interfaces.js +0 -0
- package/dist/lib/types/form-builder.types.d.ts +59 -59
- package/dist/lib/types/form-builder.types.js +0 -0
- package/dist/lib/types/global.types.d.ts +4 -4
- package/dist/lib/types/global.types.js +0 -0
- package/dist/lib/utils/dialog.d.ts +10 -10
- package/dist/lib/utils/dialog.js +21 -21
- package/dist/lib/utils/fire-custom-event.d.ts +1 -1
- package/dist/lib/utils/fire-custom-event.js +7 -7
- package/dist/lib/utils/translate.d.ts +1 -0
- package/dist/lib/utils/translate.js +9 -0
- package/dist/lib/utils/validations.helper.d.ts +26 -26
- package/dist/lib/utils/validations.helper.js +42 -35
- package/package.json +56 -56
|
@@ -1,65 +1,72 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { LitElement, property, html, css, customElement } from 'lit-element';
|
|
8
|
-
import { fireEvent } from '../utils/fire-custom-event';
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
this.
|
|
14
|
-
this.
|
|
15
|
-
this.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { LitElement, property, html, css, customElement } from 'lit-element';
|
|
8
|
+
import { fireEvent } from '../utils/fire-custom-event';
|
|
9
|
+
import { getTranslation } from '../utils/translate';
|
|
10
|
+
let ConfirmationDialog = class ConfirmationDialog extends LitElement {
|
|
11
|
+
constructor() {
|
|
12
|
+
super();
|
|
13
|
+
this.dialogOpened = true;
|
|
14
|
+
this.text = '';
|
|
15
|
+
this.dialogTitle = '';
|
|
16
|
+
this.hideConfirmBtn = false;
|
|
17
|
+
if (!this.language) {
|
|
18
|
+
this.language = window.localStorage.defaultLanguage || 'en';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
set dialogData({ text, dialogTitle = 'Are you', hideConfirmBtn = false }) {
|
|
22
|
+
this.text = text;
|
|
23
|
+
this.dialogTitle = dialogTitle;
|
|
24
|
+
this.hideConfirmBtn = hideConfirmBtn;
|
|
25
|
+
this.requestUpdate();
|
|
26
|
+
}
|
|
27
|
+
render() {
|
|
28
|
+
return html `
|
|
29
|
+
<etools-dialog
|
|
30
|
+
id="confirmation-dialog"
|
|
31
|
+
size="md"
|
|
32
|
+
no-padding
|
|
33
|
+
keep-dialog-open
|
|
34
|
+
?hide-confirm-btn="${this.hideConfirmBtn}"
|
|
35
|
+
cancel-btn-text="${getTranslation(this.language, this.hideConfirmBtn ? 'OK' : 'CANCEL')}"
|
|
36
|
+
?opened="${this.dialogOpened}"
|
|
37
|
+
theme="confirmation"
|
|
38
|
+
dialog-title="${this.dialogTitle}"
|
|
39
|
+
@close="${this.onClose}"
|
|
40
|
+
@confirm-btn-clicked="${() => this.confirm()}"
|
|
41
|
+
>
|
|
42
|
+
<div class="confirmation-message">${this.text}</div>
|
|
43
|
+
</etools-dialog>
|
|
44
|
+
`;
|
|
45
|
+
}
|
|
46
|
+
onClose() {
|
|
47
|
+
fireEvent(this, 'response', { confirmed: false });
|
|
48
|
+
}
|
|
49
|
+
confirm() {
|
|
50
|
+
fireEvent(this, 'response', { confirmed: true });
|
|
51
|
+
}
|
|
52
|
+
static get styles() {
|
|
53
|
+
// language=CSS
|
|
54
|
+
return [
|
|
55
|
+
css `
|
|
56
|
+
.confirmation-message {
|
|
57
|
+
padding-left: 24px;
|
|
58
|
+
}
|
|
59
|
+
`
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
__decorate([
|
|
64
|
+
property()
|
|
65
|
+
], ConfirmationDialog.prototype, "dialogOpened", void 0);
|
|
66
|
+
__decorate([
|
|
67
|
+
property()
|
|
68
|
+
], ConfirmationDialog.prototype, "language", void 0);
|
|
69
|
+
ConfirmationDialog = __decorate([
|
|
70
|
+
customElement('confirmation-popup')
|
|
71
|
+
], ConfirmationDialog);
|
|
72
|
+
export { ConfirmationDialog };
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
-
import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
|
|
2
|
-
import '@polymer/iron-icons/iron-icons';
|
|
3
|
-
export declare class EtoolsFbCard extends LitElement {
|
|
4
|
-
cardTitle: string;
|
|
5
|
-
isEditable: boolean;
|
|
6
|
-
isCollapsible: boolean;
|
|
7
|
-
hideEditButton: boolean;
|
|
8
|
-
collapsed: boolean;
|
|
9
|
-
edit: boolean;
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { CSSResultArray, LitElement, TemplateResult } from 'lit-element';
|
|
2
|
+
import '@polymer/iron-icons/iron-icons';
|
|
3
|
+
export declare class EtoolsFbCard extends LitElement {
|
|
4
|
+
cardTitle: string;
|
|
5
|
+
isEditable: boolean;
|
|
6
|
+
isCollapsible: boolean;
|
|
7
|
+
hideEditButton: boolean;
|
|
8
|
+
collapsed: boolean;
|
|
9
|
+
edit: boolean;
|
|
10
|
+
language: string;
|
|
11
|
+
static get styles(): CSSResultArray;
|
|
12
|
+
constructor();
|
|
13
|
+
save(): void;
|
|
14
|
+
cancel(): void;
|
|
15
|
+
startEdit(): void;
|
|
16
|
+
toggleCollapse(): void;
|
|
17
|
+
connectedCallback(): void;
|
|
18
|
+
disconnectedCallback(): void;
|
|
19
|
+
handleLanguageChange(e: CustomEvent): void;
|
|
20
|
+
protected render(): TemplateResult;
|
|
21
|
+
}
|
|
@@ -1,215 +1,238 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
import { css, customElement, html, LitElement, property } from 'lit-element';
|
|
8
|
-
import '@polymer/iron-icons/iron-icons';
|
|
9
|
-
import { CardStyles } from '../styles/card-styles';
|
|
10
|
-
import { elevationStyles } from '../styles/elevation-styles';
|
|
11
|
-
import { FlexLayoutClasses } from '../styles/flex-layout-classes';
|
|
12
|
-
import { fireEvent } from '../utils/fire-custom-event';
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
this.
|
|
18
|
-
this.
|
|
19
|
-
this.
|
|
20
|
-
this.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.card-
|
|
43
|
-
padding:
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.
|
|
56
|
-
color: var(--
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
flex-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
padding-
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
.flex-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
<
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { css, customElement, html, LitElement, property } from 'lit-element';
|
|
8
|
+
import '@polymer/iron-icons/iron-icons';
|
|
9
|
+
import { CardStyles } from '../styles/card-styles';
|
|
10
|
+
import { elevationStyles } from '../styles/elevation-styles';
|
|
11
|
+
import { FlexLayoutClasses } from '../styles/flex-layout-classes';
|
|
12
|
+
import { fireEvent } from '../utils/fire-custom-event';
|
|
13
|
+
import { getTranslation } from '../utils/translate';
|
|
14
|
+
let EtoolsFbCard = class EtoolsFbCard extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super();
|
|
17
|
+
this.isEditable = false;
|
|
18
|
+
this.isCollapsible = false;
|
|
19
|
+
this.hideEditButton = false;
|
|
20
|
+
this.collapsed = false;
|
|
21
|
+
this.edit = false;
|
|
22
|
+
if (!this.language) {
|
|
23
|
+
this.language = window.localStorage.defaultLanguage || 'en';
|
|
24
|
+
}
|
|
25
|
+
this.handleLanguageChange = this.handleLanguageChange.bind(this);
|
|
26
|
+
}
|
|
27
|
+
static get styles() {
|
|
28
|
+
// language=CSS
|
|
29
|
+
return [
|
|
30
|
+
elevationStyles,
|
|
31
|
+
CardStyles,
|
|
32
|
+
FlexLayoutClasses,
|
|
33
|
+
css `
|
|
34
|
+
:host {
|
|
35
|
+
display: block;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.card-container {
|
|
39
|
+
background-color: var(--primary-background-color);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.card-title-box[is-collapsible] {
|
|
43
|
+
padding-left: 17px;
|
|
44
|
+
padding-right: 25px;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.card-content {
|
|
48
|
+
padding: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.card-buttons {
|
|
52
|
+
padding: 12px 24px;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.save-button {
|
|
56
|
+
color: var(--primary-background-color);
|
|
57
|
+
background-color: var(--primary-color);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.edit-button {
|
|
61
|
+
color: var(--gray-mid);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edit-button[edit] {
|
|
65
|
+
color: var(--primary-color);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.flex-header {
|
|
69
|
+
display: flex;
|
|
70
|
+
align-items: center;
|
|
71
|
+
padding-top: auto;
|
|
72
|
+
flex-wrap: nowrap;
|
|
73
|
+
}
|
|
74
|
+
.flex-header__collapse {
|
|
75
|
+
flex-basis: auto;
|
|
76
|
+
}
|
|
77
|
+
.flex-header__title {
|
|
78
|
+
font-size: 18px;
|
|
79
|
+
flex-basis: auto;
|
|
80
|
+
flex-grow: 1;
|
|
81
|
+
overflow: hidden;
|
|
82
|
+
white-space: nowrap;
|
|
83
|
+
text-overflow: ellipsis;
|
|
84
|
+
}
|
|
85
|
+
.flex-header__actions {
|
|
86
|
+
order: 1;
|
|
87
|
+
width: auto;
|
|
88
|
+
display: flex;
|
|
89
|
+
flex-basis: auto;
|
|
90
|
+
}
|
|
91
|
+
.flex-header__postfix {
|
|
92
|
+
order: 3;
|
|
93
|
+
}
|
|
94
|
+
.flex-header__edit {
|
|
95
|
+
order: 2;
|
|
96
|
+
}
|
|
97
|
+
@media (max-width: 380px) {
|
|
98
|
+
.card-title-box[is-collapsible] {
|
|
99
|
+
padding-left: 0;
|
|
100
|
+
padding-right: 0;
|
|
101
|
+
}
|
|
102
|
+
.flex-header {
|
|
103
|
+
align-items: baseline;
|
|
104
|
+
padding-top: 10px;
|
|
105
|
+
flex-wrap: wrap;
|
|
106
|
+
}
|
|
107
|
+
.flex-header__collapse {
|
|
108
|
+
flex-basis: 20%;
|
|
109
|
+
}
|
|
110
|
+
.flex-header__title {
|
|
111
|
+
flex-basis: 60%;
|
|
112
|
+
overflow: unset;
|
|
113
|
+
white-space: unset;
|
|
114
|
+
text-overflow: unset;
|
|
115
|
+
}
|
|
116
|
+
.flex-header__actions {
|
|
117
|
+
order: 2;
|
|
118
|
+
width: 100%;
|
|
119
|
+
border-top: 1px solid lightgrey;
|
|
120
|
+
justify-content: flex-end;
|
|
121
|
+
}
|
|
122
|
+
.flex-header__postfix {
|
|
123
|
+
order: 3;
|
|
124
|
+
}
|
|
125
|
+
.flex-header__edit {
|
|
126
|
+
order: 1;
|
|
127
|
+
flex-basis: 20%;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
`
|
|
131
|
+
];
|
|
132
|
+
}
|
|
133
|
+
save() {
|
|
134
|
+
fireEvent(this, 'save');
|
|
135
|
+
}
|
|
136
|
+
cancel() {
|
|
137
|
+
this.edit = false;
|
|
138
|
+
fireEvent(this, 'cancel');
|
|
139
|
+
}
|
|
140
|
+
startEdit() {
|
|
141
|
+
if (this.edit) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
this.edit = true;
|
|
145
|
+
fireEvent(this, 'start-edit');
|
|
146
|
+
}
|
|
147
|
+
toggleCollapse() {
|
|
148
|
+
this.collapsed = !this.collapsed;
|
|
149
|
+
}
|
|
150
|
+
connectedCallback() {
|
|
151
|
+
super.connectedCallback();
|
|
152
|
+
document.addEventListener('language-changed', this.handleLanguageChange.bind(this));
|
|
153
|
+
}
|
|
154
|
+
disconnectedCallback() {
|
|
155
|
+
super.disconnectedCallback();
|
|
156
|
+
document.removeEventListener('language-changed', this.handleLanguageChange.bind(this));
|
|
157
|
+
}
|
|
158
|
+
handleLanguageChange(e) {
|
|
159
|
+
this.language = e.detail.language;
|
|
160
|
+
}
|
|
161
|
+
// language=HTML
|
|
162
|
+
render() {
|
|
163
|
+
return html `
|
|
164
|
+
<div class="elevation card-container" elevation="1">
|
|
165
|
+
<header class="card-title-box with-bottom-line flex-header" ?is-collapsible="${this.isCollapsible}">
|
|
166
|
+
${this.isCollapsible
|
|
167
|
+
? html `
|
|
168
|
+
<paper-icon-button
|
|
169
|
+
class="flex-header__collapse"
|
|
170
|
+
@tap="${() => this.toggleCollapse()}"
|
|
171
|
+
icon="${this.collapsed ? 'expand-more' : 'expand-less'}"
|
|
172
|
+
></paper-icon-button>
|
|
173
|
+
`
|
|
174
|
+
: ''}
|
|
175
|
+
<div class="flex-header__title">${this.cardTitle}</div>
|
|
176
|
+
<div class="flex-header__actions"><slot name="actions"></slot></div>
|
|
177
|
+
<div class="layout horizontal center flex-header__edit">
|
|
178
|
+
${this.isEditable
|
|
179
|
+
? html `
|
|
180
|
+
<paper-icon-button
|
|
181
|
+
icon="create"
|
|
182
|
+
?edit=${this.edit}
|
|
183
|
+
?hidden="${this.hideEditButton}"
|
|
184
|
+
class="edit-button"
|
|
185
|
+
@tap="${() => this.startEdit()}"
|
|
186
|
+
></paper-icon-button>
|
|
187
|
+
`
|
|
188
|
+
: ''}
|
|
189
|
+
</div>
|
|
190
|
+
<div class="flex-header__postfix"><slot name="postfix"></slot></div>
|
|
191
|
+
</header>
|
|
192
|
+
<iron-collapse ?opened="${!this.collapsed}">
|
|
193
|
+
<section class="card-content-block">
|
|
194
|
+
<slot name="content"></slot>
|
|
195
|
+
|
|
196
|
+
${this.isEditable && this.edit
|
|
197
|
+
? html `
|
|
198
|
+
<div class="layout horizontal end-justified card-buttons">
|
|
199
|
+
<paper-button @tap="${() => this.cancel()}"
|
|
200
|
+
>${getTranslation(this.language, 'CANCEL')}</paper-button
|
|
201
|
+
>
|
|
202
|
+
<paper-button class="save-button" @tap="${() => this.save()}"
|
|
203
|
+
>${getTranslation(this.language, 'SAVE')}</paper-button
|
|
204
|
+
>
|
|
205
|
+
</div>
|
|
206
|
+
`
|
|
207
|
+
: ''}
|
|
208
|
+
</section>
|
|
209
|
+
</iron-collapse>
|
|
210
|
+
</div>
|
|
211
|
+
`;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
__decorate([
|
|
215
|
+
property({ attribute: 'card-title' })
|
|
216
|
+
], EtoolsFbCard.prototype, "cardTitle", void 0);
|
|
217
|
+
__decorate([
|
|
218
|
+
property({ type: Boolean, attribute: 'is-editable' })
|
|
219
|
+
], EtoolsFbCard.prototype, "isEditable", void 0);
|
|
220
|
+
__decorate([
|
|
221
|
+
property({ type: Boolean, attribute: 'is-collapsible' })
|
|
222
|
+
], EtoolsFbCard.prototype, "isCollapsible", void 0);
|
|
223
|
+
__decorate([
|
|
224
|
+
property({ type: Boolean, attribute: 'hide-edit-button' })
|
|
225
|
+
], EtoolsFbCard.prototype, "hideEditButton", void 0);
|
|
226
|
+
__decorate([
|
|
227
|
+
property({ type: Boolean })
|
|
228
|
+
], EtoolsFbCard.prototype, "collapsed", void 0);
|
|
229
|
+
__decorate([
|
|
230
|
+
property({ type: Boolean })
|
|
231
|
+
], EtoolsFbCard.prototype, "edit", void 0);
|
|
232
|
+
__decorate([
|
|
233
|
+
property()
|
|
234
|
+
], EtoolsFbCard.prototype, "language", void 0);
|
|
235
|
+
EtoolsFbCard = __decorate([
|
|
236
|
+
customElement('etools-fb-card')
|
|
237
|
+
], EtoolsFbCard);
|
|
238
|
+
export { EtoolsFbCard };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { CSSResult } from 'lit-element';
|
|
2
|
-
export declare const AttachmentsStyles: CSSResult;
|
|
1
|
+
import { CSSResult } from 'lit-element';
|
|
2
|
+
export declare const AttachmentsStyles: CSSResult;
|