@unicef-polymer/etools-form-builder 2.1.0-rc.6 → 2.1.1

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