globuswebcomponents 2.13.1 → 2.13.3
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/dist/cjs/gb-action-panel_61.cjs.entry.js +742 -127
- package/dist/cjs/gb-approval-modal.cjs.entry.js +16 -13
- package/dist/cjs/gb-approval-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/gb-modal-action.gb-modal-header.entry.cjs.js.map +1 -1
- package/dist/cjs/gb-modal-action_2.cjs.entry.js +12 -12
- package/dist/cjs/gb-prompt-modal.cjs.entry.js +2 -1
- package/dist/cjs/gb-prompt-modal.entry.cjs.js.map +1 -1
- package/dist/cjs/globuscomponents.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/reusableModels-_LRAKnsh.js.map +1 -1
- package/dist/collection/components/gb-approval-modal/gb-approval-modal.js +63 -126
- package/dist/collection/components/gb-approval-modal/gb-approval-modal.js.map +1 -1
- package/dist/collection/components/gb-button-group/gb-button-group.js +4 -2
- package/dist/collection/components/gb-button-group/gb-button-group.js.map +1 -1
- package/dist/collection/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.js +9 -4
- package/dist/collection/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.js.map +1 -1
- package/dist/collection/components/gb-input-field/gb-input-field.css +8 -1
- package/dist/collection/components/gb-input-field/gb-input-field.js +268 -28
- package/dist/collection/components/gb-input-field/gb-input-field.js.map +1 -1
- package/dist/collection/components/gb-modal-action/gb-modal-action.js +89 -89
- package/dist/collection/components/gb-modal-action/gb-modal-action.js.map +1 -1
- package/dist/collection/components/gb-prompt-modal/gb-prompt-modal.js +28 -1
- package/dist/collection/components/gb-prompt-modal/gb-prompt-modal.js.map +1 -1
- package/dist/collection/components/gb-sidebar/gb-sidebar.js +9 -9
- package/dist/collection/components/gb-sidebar/gb-sidebar.js.map +1 -1
- package/dist/collection/components/gb-table/gb-table.css +6 -0
- package/dist/collection/components/gb-table/gb-table.js +454 -90
- package/dist/collection/components/gb-table/gb-table.js.map +1 -1
- package/dist/collection/components/gb-token-field-compact/gb-token-field-compact.js +13 -5
- package/dist/collection/components/gb-token-field-compact/gb-token-field-compact.js.map +1 -1
- package/dist/collection/components/gb-token-field-compressed/gb-token-field-compressed.js +20 -10
- package/dist/collection/components/gb-token-field-compressed/gb-token-field-compressed.js.map +1 -1
- package/dist/collection/models/reusableModels.js.map +1 -1
- package/dist/components/gb-approval-modal.js +23 -26
- package/dist/components/gb-approval-modal.js.map +1 -1
- package/dist/components/gb-button-group.js +1 -1
- package/dist/components/gb-header.js +2 -2
- package/dist/components/gb-input-dropdown-menu-item.js +1 -1
- package/dist/components/gb-input-dropdown.js +1 -1
- package/dist/components/gb-input-field.js +1 -1
- package/dist/components/gb-modal-action.js +1 -1
- package/dist/components/gb-pagination.js +1 -1
- package/dist/components/gb-prompt-modal.js +3 -1
- package/dist/components/gb-prompt-modal.js.map +1 -1
- package/dist/components/gb-rich-text.js +4 -4
- package/dist/components/gb-sidebar.js +5 -5
- package/dist/components/gb-sidebar.js.map +1 -1
- package/dist/components/gb-table-header.js +1 -1
- package/dist/components/gb-table.js +457 -94
- package/dist/components/gb-table.js.map +1 -1
- package/dist/components/gb-textarea-input-field.js +1 -1
- package/dist/components/gb-token-field-compact.js +5 -1
- package/dist/components/gb-token-field-compact.js.map +1 -1
- package/dist/components/gb-token-field-compressed.js +9 -4
- package/dist/components/gb-token-field-compressed.js.map +1 -1
- package/dist/components/gb-wysiwyg-toolbar.js +1 -1
- package/dist/components/{p-CY9tYu7L.js → p-B9OaQ8IO.js} +5 -5
- package/dist/components/{p-CY9tYu7L.js.map → p-B9OaQ8IO.js.map} +1 -1
- package/dist/components/{p-Bo26ZXLD.js → p-BQWEHDtb.js} +4 -3
- package/dist/components/p-BQWEHDtb.js.map +1 -0
- package/dist/components/{p-0Dn-Rnju.js → p-Br16o-rx.js} +5 -5
- package/dist/components/{p-0Dn-Rnju.js.map → p-Br16o-rx.js.map} +1 -1
- package/dist/components/{p-COqi1UbV.js → p-C9OKT7Zi.js} +4 -4
- package/dist/components/{p-COqi1UbV.js.map → p-C9OKT7Zi.js.map} +1 -1
- package/dist/components/{p-BpCukPcq.js → p-CQg5uJVz.js} +20 -20
- package/dist/components/p-CQg5uJVz.js.map +1 -0
- package/dist/components/{p-D7ISVr5X.js → p-DT0m5qpo.js} +7 -4
- package/dist/components/p-DT0m5qpo.js.map +1 -0
- package/dist/components/{p-DXiN3a4D.js → p-DY_80Vnz.js} +3 -3
- package/dist/components/{p-DXiN3a4D.js.map → p-DY_80Vnz.js.map} +1 -1
- package/dist/components/{p-CoLGqDxS.js → p-QHFMnid1.js} +270 -30
- package/dist/components/p-QHFMnid1.js.map +1 -0
- package/dist/components/p-cHn6O-Kf.js.map +1 -1
- package/dist/components/{p-Krq9Xzvd.js → p-iQxeojAw.js} +5 -5
- package/dist/components/{p-Krq9Xzvd.js.map → p-iQxeojAw.js.map} +1 -1
- package/dist/components/test-input-tag.js +1 -1
- package/dist/docs.json +332 -285
- package/dist/esm/gb-action-panel_61.entry.js +742 -127
- package/dist/esm/gb-approval-modal.entry.js +17 -14
- package/dist/esm/gb-approval-modal.entry.js.map +1 -1
- package/dist/esm/gb-modal-action.gb-modal-header.entry.js.map +1 -1
- package/dist/esm/gb-modal-action_2.entry.js +12 -12
- package/dist/esm/gb-prompt-modal.entry.js +2 -1
- package/dist/esm/gb-prompt-modal.entry.js.map +1 -1
- package/dist/esm/globuscomponents.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/reusableModels-cHn6O-Kf.js.map +1 -1
- package/dist/globuscomponents/gb-approval-modal.entry.esm.js.map +1 -1
- package/dist/globuscomponents/gb-modal-action.gb-modal-header.entry.esm.js.map +1 -1
- package/dist/globuscomponents/gb-prompt-modal.entry.esm.js.map +1 -1
- package/dist/globuscomponents/globuscomponents.esm.js +1 -1
- package/dist/globuscomponents/p-0ea6a4f5.entry.js +2 -0
- package/dist/globuscomponents/p-0ea6a4f5.entry.js.map +1 -0
- package/dist/globuscomponents/{p-0875c4c8.entry.js → p-85bf9ca2.entry.js} +2 -2
- package/dist/globuscomponents/p-85bf9ca2.entry.js.map +1 -0
- package/dist/globuscomponents/p-cHn6O-Kf.js.map +1 -1
- package/dist/globuscomponents/p-cf0eb0b1.entry.js +2 -0
- package/dist/globuscomponents/p-cf0eb0b1.entry.js.map +1 -0
- package/dist/globuscomponents/{p-a68e199d.entry.js → p-e2a71662.entry.js} +2 -2
- package/dist/globuscomponents/p-e2a71662.entry.js.map +1 -0
- package/dist/types/components/gb-approval-modal/gb-approval-modal.d.ts +10 -11
- package/dist/types/components/gb-input-field/gb-input-field.d.ts +2 -0
- package/dist/types/components/gb-modal-action/gb-modal-action.d.ts +6 -6
- package/dist/types/components/gb-prompt-modal/gb-prompt-modal.d.ts +1 -0
- package/dist/types/components/gb-sidebar/gb-sidebar.d.ts +8 -5
- package/dist/types/components/gb-token-field-compressed/gb-token-field-compressed.d.ts +1 -1
- package/dist/types/components.d.ts +174 -98
- package/dist/types/models/reusableModels.d.ts +10 -4
- package/package.json +2 -1
- package/dist/components/p-Bo26ZXLD.js.map +0 -1
- package/dist/components/p-BpCukPcq.js.map +0 -1
- package/dist/components/p-CoLGqDxS.js.map +0 -1
- package/dist/components/p-D7ISVr5X.js.map +0 -1
- package/dist/globuscomponents/p-0875c4c8.entry.js.map +0 -1
- package/dist/globuscomponents/p-107a1db6.entry.js +0 -2
- package/dist/globuscomponents/p-107a1db6.entry.js.map +0 -1
- package/dist/globuscomponents/p-65070e05.entry.js +0 -2
- package/dist/globuscomponents/p-65070e05.entry.js.map +0 -1
- package/dist/globuscomponents/p-a68e199d.entry.js.map +0 -1
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { h } from "@stencil/core";
|
|
2
|
-
export class
|
|
2
|
+
export class GbApprovalModal {
|
|
3
3
|
constructor() {
|
|
4
4
|
this.showDecision = true;
|
|
5
|
+
this.badgeType = 'badge_color';
|
|
6
|
+
this.badgeIcon = 'dot';
|
|
7
|
+
this.badgeLabel = '';
|
|
5
8
|
this.firstButtonText = '';
|
|
6
9
|
this.secondButtonText = '';
|
|
7
|
-
this.
|
|
8
|
-
this.
|
|
9
|
-
this.
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
this.
|
|
13
|
-
this.firstButtonIconTrailingSwap = '';
|
|
14
|
-
this.secondButtonIconTrailingSwap = '';
|
|
15
|
-
this.thirdButtonIconTrailingSwap = '';
|
|
10
|
+
this.firstButtonState = 'default';
|
|
11
|
+
this.headerText = '';
|
|
12
|
+
this.textareaLabel = '';
|
|
13
|
+
}
|
|
14
|
+
emitTextareaValue(textareaValue) {
|
|
15
|
+
this.textareaValueChanged.emit(textareaValue.detail);
|
|
16
16
|
}
|
|
17
17
|
render() {
|
|
18
|
-
return (h("div", { key: '
|
|
18
|
+
return (h("div", { key: '5f494111fe6a24abacd5f3944ecb83052f08f8a7', class: "approval-modal shadow-sm" }, h("gb-modal-header", { key: '89b9aff2552c397b3e09a43280f445e8e559848d', "close-button-position": "right", text: this.headerText }), h("div", { key: '7987ce95d2e2dad2323090f0e107ac366d84fbfe', class: "modal-content" }, this.showDecision && (h("div", { key: 'cfa41c5e6112a96433d41c883de1d0204ac49388', class: "modal-row" }, h("p", { key: 'fdf1dc3dc2c73ff47c257202050645cafd48db78', class: "text-sm-regular heading" }, "Reviewer's decision"), h("gb-badge", { key: '241b70919bcd70341f4a123a3e9799b047c73400', size: "sm", type: this.badgeType, icon: this.badgeIcon, color: this.badgeColor }, h("p", { key: '6ac9efe7c0c8a1ce23e444a583dd95b3253084a8' }, this.badgeLabel)))), h("div", { key: 'e89df4e499f8fe587220d8562db16b06a7952bba', class: "modal-textarea" }, h("gb-textarea-input-field", { key: '4c8108bc3bbf1de21ff8b5fa50c7e9cb7746b13c', idOfInput: "default", state: "default", type: "default", "show-label": true, label: this.textareaLabel || 'Reason', "show-hint-text": false, destructive: false, "placeholder-text": "Enter comments here", onTextareaValueChanged: this.emitTextareaValue.bind(this) }))), h("gb-modal-action", { key: 'ba83b57c4f911bf3ae57a0911a1528d0bd1b3894', "action-type": "double", "first-button-state": this.firstButtonState, "first-button-text": this.firstButtonText, "second-button-text": this.secondButtonText, onFirstButtonClicked: () => this.primaryButtonClicked.emit(), onSecondButtonClicked: () => this.secondaryButtonClicked.emit() })));
|
|
19
19
|
}
|
|
20
20
|
static get is() { return "gb-approval-modal"; }
|
|
21
21
|
static get encapsulation() { return "shadow"; }
|
|
@@ -99,7 +99,8 @@ export class gbapprovalmodal {
|
|
|
99
99
|
"getter": false,
|
|
100
100
|
"setter": false,
|
|
101
101
|
"reflect": false,
|
|
102
|
-
"attribute": "badge-type"
|
|
102
|
+
"attribute": "badge-type",
|
|
103
|
+
"defaultValue": "'badge_color'"
|
|
103
104
|
},
|
|
104
105
|
"badgeIcon": {
|
|
105
106
|
"type": "string",
|
|
@@ -124,7 +125,8 @@ export class gbapprovalmodal {
|
|
|
124
125
|
"getter": false,
|
|
125
126
|
"setter": false,
|
|
126
127
|
"reflect": false,
|
|
127
|
-
"attribute": "badge-icon"
|
|
128
|
+
"attribute": "badge-icon",
|
|
129
|
+
"defaultValue": "'dot'"
|
|
128
130
|
},
|
|
129
131
|
"badgeLabel": {
|
|
130
132
|
"type": "string",
|
|
@@ -143,7 +145,8 @@ export class gbapprovalmodal {
|
|
|
143
145
|
"getter": false,
|
|
144
146
|
"setter": false,
|
|
145
147
|
"reflect": false,
|
|
146
|
-
"attribute": "badge-label"
|
|
148
|
+
"attribute": "badge-label",
|
|
149
|
+
"defaultValue": "''"
|
|
147
150
|
},
|
|
148
151
|
"firstButtonText": {
|
|
149
152
|
"type": "string",
|
|
@@ -185,53 +188,19 @@ export class gbapprovalmodal {
|
|
|
185
188
|
"attribute": "second-button-text",
|
|
186
189
|
"defaultValue": "''"
|
|
187
190
|
},
|
|
188
|
-
"
|
|
189
|
-
"type": "string",
|
|
190
|
-
"mutable": false,
|
|
191
|
-
"complexType": {
|
|
192
|
-
"original": "string",
|
|
193
|
-
"resolved": "string",
|
|
194
|
-
"references": {}
|
|
195
|
-
},
|
|
196
|
-
"required": false,
|
|
197
|
-
"optional": false,
|
|
198
|
-
"docs": {
|
|
199
|
-
"tags": [],
|
|
200
|
-
"text": ""
|
|
201
|
-
},
|
|
202
|
-
"getter": false,
|
|
203
|
-
"setter": false,
|
|
204
|
-
"reflect": false,
|
|
205
|
-
"attribute": "third-button-text",
|
|
206
|
-
"defaultValue": "''"
|
|
207
|
-
},
|
|
208
|
-
"firstIconButtonSwap": {
|
|
209
|
-
"type": "string",
|
|
210
|
-
"mutable": false,
|
|
211
|
-
"complexType": {
|
|
212
|
-
"original": "string",
|
|
213
|
-
"resolved": "string",
|
|
214
|
-
"references": {}
|
|
215
|
-
},
|
|
216
|
-
"required": false,
|
|
217
|
-
"optional": false,
|
|
218
|
-
"docs": {
|
|
219
|
-
"tags": [],
|
|
220
|
-
"text": ""
|
|
221
|
-
},
|
|
222
|
-
"getter": false,
|
|
223
|
-
"setter": false,
|
|
224
|
-
"reflect": false,
|
|
225
|
-
"attribute": "first-icon-button-swap",
|
|
226
|
-
"defaultValue": "''"
|
|
227
|
-
},
|
|
228
|
-
"secondIconButtonSwap": {
|
|
191
|
+
"firstButtonState": {
|
|
229
192
|
"type": "string",
|
|
230
193
|
"mutable": false,
|
|
231
194
|
"complexType": {
|
|
232
|
-
"original": "
|
|
233
|
-
"resolved": "
|
|
234
|
-
"references": {
|
|
195
|
+
"original": "StateType",
|
|
196
|
+
"resolved": "\"applied\" | \"default\" | \"disabled\" | \"loading\"",
|
|
197
|
+
"references": {
|
|
198
|
+
"StateType": {
|
|
199
|
+
"location": "import",
|
|
200
|
+
"path": "../../models/reusableModels",
|
|
201
|
+
"id": "src/models/reusableModels.ts::StateType"
|
|
202
|
+
}
|
|
203
|
+
}
|
|
235
204
|
},
|
|
236
205
|
"required": false,
|
|
237
206
|
"optional": false,
|
|
@@ -242,10 +211,10 @@ export class gbapprovalmodal {
|
|
|
242
211
|
"getter": false,
|
|
243
212
|
"setter": false,
|
|
244
213
|
"reflect": false,
|
|
245
|
-
"attribute": "
|
|
246
|
-
"defaultValue": "''"
|
|
214
|
+
"attribute": "first-button-state",
|
|
215
|
+
"defaultValue": "'default'"
|
|
247
216
|
},
|
|
248
|
-
"
|
|
217
|
+
"headerText": {
|
|
249
218
|
"type": "string",
|
|
250
219
|
"mutable": false,
|
|
251
220
|
"complexType": {
|
|
@@ -262,10 +231,10 @@ export class gbapprovalmodal {
|
|
|
262
231
|
"getter": false,
|
|
263
232
|
"setter": false,
|
|
264
233
|
"reflect": false,
|
|
265
|
-
"attribute": "
|
|
234
|
+
"attribute": "header-text",
|
|
266
235
|
"defaultValue": "''"
|
|
267
236
|
},
|
|
268
|
-
"
|
|
237
|
+
"textareaLabel": {
|
|
269
238
|
"type": "string",
|
|
270
239
|
"mutable": false,
|
|
271
240
|
"complexType": {
|
|
@@ -282,90 +251,58 @@ export class gbapprovalmodal {
|
|
|
282
251
|
"getter": false,
|
|
283
252
|
"setter": false,
|
|
284
253
|
"reflect": false,
|
|
285
|
-
"attribute": "
|
|
254
|
+
"attribute": "textarea-label",
|
|
286
255
|
"defaultValue": "''"
|
|
287
|
-
}
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
"
|
|
297
|
-
"optional": false,
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
}
|
|
259
|
+
static get events() {
|
|
260
|
+
return [{
|
|
261
|
+
"method": "primaryButtonClicked",
|
|
262
|
+
"name": "primaryButtonClicked",
|
|
263
|
+
"bubbles": true,
|
|
264
|
+
"cancelable": true,
|
|
265
|
+
"composed": true,
|
|
298
266
|
"docs": {
|
|
299
267
|
"tags": [],
|
|
300
268
|
"text": ""
|
|
301
269
|
},
|
|
302
|
-
"getter": false,
|
|
303
|
-
"setter": false,
|
|
304
|
-
"reflect": false,
|
|
305
|
-
"attribute": "third-button-icon-leading-swap",
|
|
306
|
-
"defaultValue": "''"
|
|
307
|
-
},
|
|
308
|
-
"firstButtonIconTrailingSwap": {
|
|
309
|
-
"type": "string",
|
|
310
|
-
"mutable": false,
|
|
311
270
|
"complexType": {
|
|
312
|
-
"original": "
|
|
313
|
-
"resolved": "
|
|
271
|
+
"original": "void",
|
|
272
|
+
"resolved": "void",
|
|
314
273
|
"references": {}
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
"
|
|
274
|
+
}
|
|
275
|
+
}, {
|
|
276
|
+
"method": "secondaryButtonClicked",
|
|
277
|
+
"name": "secondaryButtonClicked",
|
|
278
|
+
"bubbles": true,
|
|
279
|
+
"cancelable": true,
|
|
280
|
+
"composed": true,
|
|
318
281
|
"docs": {
|
|
319
282
|
"tags": [],
|
|
320
283
|
"text": ""
|
|
321
284
|
},
|
|
322
|
-
"getter": false,
|
|
323
|
-
"setter": false,
|
|
324
|
-
"reflect": false,
|
|
325
|
-
"attribute": "first-button-icon-trailing-swap",
|
|
326
|
-
"defaultValue": "''"
|
|
327
|
-
},
|
|
328
|
-
"secondButtonIconTrailingSwap": {
|
|
329
|
-
"type": "string",
|
|
330
|
-
"mutable": false,
|
|
331
285
|
"complexType": {
|
|
332
|
-
"original": "
|
|
333
|
-
"resolved": "
|
|
286
|
+
"original": "void",
|
|
287
|
+
"resolved": "void",
|
|
334
288
|
"references": {}
|
|
335
|
-
}
|
|
336
|
-
|
|
337
|
-
"
|
|
289
|
+
}
|
|
290
|
+
}, {
|
|
291
|
+
"method": "textareaValueChanged",
|
|
292
|
+
"name": "textareaValueChanged",
|
|
293
|
+
"bubbles": true,
|
|
294
|
+
"cancelable": true,
|
|
295
|
+
"composed": true,
|
|
338
296
|
"docs": {
|
|
339
297
|
"tags": [],
|
|
340
298
|
"text": ""
|
|
341
299
|
},
|
|
342
|
-
"getter": false,
|
|
343
|
-
"setter": false,
|
|
344
|
-
"reflect": false,
|
|
345
|
-
"attribute": "second-button-icon-trailing-swap",
|
|
346
|
-
"defaultValue": "''"
|
|
347
|
-
},
|
|
348
|
-
"thirdButtonIconTrailingSwap": {
|
|
349
|
-
"type": "string",
|
|
350
|
-
"mutable": false,
|
|
351
300
|
"complexType": {
|
|
352
301
|
"original": "string",
|
|
353
302
|
"resolved": "string",
|
|
354
303
|
"references": {}
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
"optional": false,
|
|
358
|
-
"docs": {
|
|
359
|
-
"tags": [],
|
|
360
|
-
"text": ""
|
|
361
|
-
},
|
|
362
|
-
"getter": false,
|
|
363
|
-
"setter": false,
|
|
364
|
-
"reflect": false,
|
|
365
|
-
"attribute": "third-button-icon-trailing-swap",
|
|
366
|
-
"defaultValue": "''"
|
|
367
|
-
}
|
|
368
|
-
};
|
|
304
|
+
}
|
|
305
|
+
}];
|
|
369
306
|
}
|
|
370
307
|
}
|
|
371
308
|
//# sourceMappingURL=gb-approval-modal.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gb-approval-modal.js","sourceRoot":"","sources":["../../../src/components/gb-approval-modal/gb-approval-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"gb-approval-modal.js","sourceRoot":"","sources":["../../../src/components/gb-approval-modal/gb-approval-modal.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAgB,CAAC,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAQxE,MAAM,OAAO,eAAe;IAL5B;QAMU,iBAAY,GAAY,IAAI,CAAC;QAE7B,cAAS,GAAe,aAAa,CAAC;QACtC,cAAS,GAAmB,KAAK,CAAC;QAClC,eAAU,GAAW,EAAE,CAAC;QACxB,oBAAe,GAAW,EAAE,CAAC;QAC7B,qBAAgB,GAAW,EAAE,CAAC;QAC9B,qBAAgB,GAAc,SAAS,C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ACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Event, EventEmitter, h, Prop } from '@stencil/core';\r\nimport { GeneralColors, BadgeTypes, BadgeIconTypes, StateType } from '../../models/reusableModels';\r\n\r\n@Component({\r\n tag: 'gb-approval-modal',\r\n styleUrl: 'gb-approval-modal.css',\r\n shadow: true,\r\n})\r\nexport class GbApprovalModal {\r\n @Prop() showDecision: boolean = true;\r\n @Prop() badgeColor: GeneralColors;\r\n @Prop() badgeType: BadgeTypes = 'badge_color';\r\n @Prop() badgeIcon: BadgeIconTypes = 'dot';\r\n @Prop() badgeLabel: string = '';\r\n @Prop() firstButtonText: string = '';\r\n @Prop() secondButtonText: string = '';\r\n @Prop() firstButtonState: StateType = 'default';\r\n @Prop() headerText: string = '';\r\n @Prop() textareaLabel: string = '';\r\n @Event() primaryButtonClicked: EventEmitter<void>;\r\n @Event() secondaryButtonClicked: EventEmitter<void>;\r\n @Event() textareaValueChanged: EventEmitter<string>;\r\n\r\n emitTextareaValue(textareaValue: any) {\r\n this.textareaValueChanged.emit(textareaValue.detail);\r\n }\r\n\r\n render() {\r\n return (\r\n <div class=\"approval-modal shadow-sm\">\r\n <gb-modal-header close-button-position=\"right\" text={this.headerText}></gb-modal-header>\r\n {/* <div class=\"modal-top\">\r\n <p class=\"display-xs-semi-bold\">Title</p>\r\n <gb-button-close size=\"sm\" color=\"gray\"></gb-button-close>\r\n </div> */}\r\n\r\n <div class=\"modal-content\">\r\n {this.showDecision && (\r\n <div class=\"modal-row\">\r\n <p class=\"text-sm-regular heading\">Reviewer's decision</p>\r\n <gb-badge size=\"sm\" type={this.badgeType} icon={this.badgeIcon} color={this.badgeColor}>\r\n <p>{this.badgeLabel}</p>\r\n </gb-badge>\r\n </div>\r\n )}\r\n\r\n <div class=\"modal-textarea\">\r\n <gb-textarea-input-field\r\n idOfInput=\"default\"\r\n state=\"default\"\r\n type=\"default\"\r\n show-label={true}\r\n label={this.textareaLabel || 'Reason'}\r\n show-hint-text={false}\r\n destructive={false}\r\n placeholder-text=\"Enter comments here\"\r\n onTextareaValueChanged={this.emitTextareaValue.bind(this)}\r\n ></gb-textarea-input-field>\r\n </div>\r\n </div>\r\n <gb-modal-action\r\n action-type=\"double\"\r\n first-button-state={this.firstButtonState}\r\n first-button-text={this.firstButtonText}\r\n second-button-text={this.secondButtonText}\r\n onFirstButtonClicked={() => this.primaryButtonClicked.emit()}\r\n onSecondButtonClicked={() => this.secondaryButtonClicked.emit()}\r\n ></gb-modal-action>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -8,6 +8,7 @@ export class GbButtonGroup {
|
|
|
8
8
|
// { label: 'Gideon', current: false, icon: 'assets/calendar-02.svg' },
|
|
9
9
|
// { label: 'Emmanuel', current: false, icon: 'assets/calendar-02.svg' },
|
|
10
10
|
];
|
|
11
|
+
this.icon = 'checkbox';
|
|
11
12
|
this.showLabel = false;
|
|
12
13
|
this.label = '';
|
|
13
14
|
this.internalItems = [];
|
|
@@ -29,7 +30,7 @@ export class GbButtonGroup {
|
|
|
29
30
|
// this.valueChange.emit({ value: this.selectedValue, current: this.internalItems[index].current });
|
|
30
31
|
}
|
|
31
32
|
render() {
|
|
32
|
-
return (h("div", { key: '
|
|
33
|
+
return (h("div", { key: '4787b4849abe0146ce478ad4c5760454b77f0d52', class: "button_group_container" }, this.showLabel && h("p", { key: '7b07d2799bb7cfb42ae56c75cc3d7646716d4d79', class: "dropdown_label text-sm-regular" }, this.label), h("div", { key: 'c8c48e1e0cca9329b9805247205b424d16035cd1', class: "button_group_wrapper" }, this.internalItems.map((item, index) => (h("gb-button-group-base", { key: index, state: "default", icon: this.icon, label: item.label, current: item.current, onClick: () => this.handleSelect(index), "icon-src": item.icon }))))));
|
|
33
34
|
}
|
|
34
35
|
static get is() { return "gb-button-group"; }
|
|
35
36
|
static get encapsulation() { return "shadow"; }
|
|
@@ -87,7 +88,8 @@ export class GbButtonGroup {
|
|
|
87
88
|
"getter": false,
|
|
88
89
|
"setter": false,
|
|
89
90
|
"reflect": false,
|
|
90
|
-
"attribute": "icon"
|
|
91
|
+
"attribute": "icon",
|
|
92
|
+
"defaultValue": "'checkbox'"
|
|
91
93
|
},
|
|
92
94
|
"showLabel": {
|
|
93
95
|
"type": "boolean",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gb-button-group.js","sourceRoot":"","sources":["../../../src/components/gb-button-group/gb-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AASvG,MAAM,OAAO,aAAa;IAN1B;QAQU,UAAK,GAA0D;QACrE,oEAAoE;QACpE,uEAAuE;QACvE,mEAAmE;QACnE,uEAAuE;QACvE,yEAAyE;SAC1E,CAAC;
|
|
1
|
+
{"version":3,"file":"gb-button-group.js","sourceRoot":"","sources":["../../../src/components/gb-button-group/gb-button-group.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,KAAK,EAAgB,IAAI,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AASvG,MAAM,OAAO,aAAa;IAN1B;QAQU,UAAK,GAA0D;QACrE,oEAAoE;QACpE,uEAAuE;QACvE,mEAAmE;QACnE,uEAAuE;QACvE,yEAAyE;SAC1E,CAAC;QACM,SAAI,GAAqB,UA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,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,cAC7B,IAAI,CAAC,IAAI,GACG,CACzB,CAAC,CACE,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { AttachInternals, Component, Event, EventEmitter, Prop, State, Watch, h } from '@stencil/core';\r\nimport { ButtonGroupTypes } from '../../models/reusableModels';\r\n\r\n@Component({\r\n tag: 'gb-button-group',\r\n styleUrl: 'gb-button-group.css',\r\n shadow: true,\r\n formAssociated: true,\r\n})\r\nexport class GbButtonGroup {\r\n @AttachInternals() internals: ElementInternals;\r\n @Prop() items: { label: string; current?: boolean; icon?: string }[] = [\r\n // { label: 'Male', current: true, icon: 'assets/calendar-02.svg' },\r\n // { label: 'Female', current: false, icon: 'assets/calendar-02.svg' },\r\n // { label: 'Hi', current: false, icon: 'assets/calendar-02.svg' },\r\n // { label: 'Gideon', current: false, icon: 'assets/calendar-02.svg' },\r\n // { label: 'Emmanuel', current: false, icon: 'assets/calendar-02.svg' },\r\n ];\r\n @Prop() icon: ButtonGroupTypes = 'checkbox';\r\n @Prop() showLabel: boolean = false;\r\n @Prop() label: string = '';\r\n @State() internalItems: { label: string; current?: boolean; icon?: string }[] = [];\r\n @State() selectedValue: string = '';\r\n // @Event() valueChange: EventEmitter<{ value: string; current: boolean }>;\r\n @Event() optionChange: EventEmitter<string>;\r\n\r\n @Watch('items')\r\n onItemsUpdated(newValue: { label: string; current?: boolean; icon?: string }[]) {\r\n this.internalItems = newValue;\r\n }\r\n\r\n componentWillLoad() {\r\n this.internalItems = [...this.items];\r\n }\r\n\r\n handleSelect(index: number) {\r\n const selectedValue = this.internalItems[index].label;\r\n\r\n this.internalItems = this.internalItems.map((item, i) => ({\r\n ...item,\r\n current: i === index,\r\n }));\r\n\r\n this.selectedValue = selectedValue;\r\n\r\n this.optionChange.emit(this.selectedValue);\r\n // console.log(this.selectedValue)\r\n\r\n // console.log({ value: this.selectedValue, current: this.internalItems[index].current });\r\n // this.valueChange.emit({ value: this.selectedValue, current: this.internalItems[index].current });\r\n }\r\n\r\n render() {\r\n return (\r\n <div class=\"button_group_container\">\r\n {this.showLabel && <p class=\"dropdown_label text-sm-regular\">{this.label}</p>}\r\n <div class=\"button_group_wrapper\">\r\n {this.internalItems.map((item, index) => (\r\n <gb-button-group-base\r\n key={index}\r\n state=\"default\"\r\n icon={this.icon}\r\n label={item.label}\r\n current={item.current}\r\n onClick={() => this.handleSelect(index)}\r\n icon-src={item.icon}\r\n ></gb-button-group-base>\r\n ))}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
package/dist/collection/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.js
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { h, Fragment, getAssetPath } from "@stencil/core";
|
|
2
|
+
import { StateEnum } from "../../models/reusableModels";
|
|
2
3
|
export class GbInputDropdownMenuItem {
|
|
3
4
|
constructor() {
|
|
5
|
+
this.type = 'default';
|
|
4
6
|
this.supportingText = false;
|
|
5
7
|
this.selected = false;
|
|
8
|
+
this.state = StateEnum.Default;
|
|
6
9
|
this.iconLeading = false;
|
|
7
10
|
this.iconLeadingSwap = '';
|
|
8
11
|
this.ellipsed = true;
|
|
@@ -51,13 +54,13 @@ export class GbInputDropdownMenuItem {
|
|
|
51
54
|
render() {
|
|
52
55
|
return (
|
|
53
56
|
// <div class="dropdown-container" onClick={() => (this.selected = !this.selected)}>
|
|
54
|
-
h("div", { key: '
|
|
57
|
+
h("div", { key: 'b9889f67621d8f78fd707694f2d30ad3a5a64f62', class: "dropdown-container", onClick: () => this.handleClick() }, h("div", { key: '8cd44c0225af757c7eb378503ab28c51b53609b9', class: {
|
|
55
58
|
'dropdown-item': true,
|
|
56
59
|
'selected': this.selected,
|
|
57
60
|
'disabled': this.state === 'disabled',
|
|
58
61
|
'checkbox': this.type === 'checkbox',
|
|
59
62
|
[this.type]: true,
|
|
60
|
-
}, role: "option", "aria-selected": this.selected ? 'true' : 'false', "aria-disabled": this.state === 'disabled' ? 'true' : 'false' }, h("div", { key: '
|
|
63
|
+
}, role: "option", "aria-selected": this.selected ? 'true' : 'false', "aria-disabled": this.state === 'disabled' ? 'true' : 'false' }, h("div", { key: '200f44bbe4cc7a8fb1b2193575d6eafd843be16f', class: "content" }, this.type === 'icon_leading' && this.iconLeading && h("div", { key: '226ae5d180ddd362e08daad08790165a87d222b9', class: `icon_leading ${this.state}`, innerHTML: this.leadingIconSvg }), this.type === 'avatar_leading' && (h("gb-avatar", { key: '04c68cff7ad84c070d72999ff6e564db04994c93', class: "avatar-icon", size: "xs", color: this.color, text: true }, h("slot", { key: '1814b58f8a781007ecb1c22d09fee477ea497d53', name: "initials", slot: "initials" }))), this.type === 'dot_leading' && (h(Fragment, null, this.state === 'default' ? (h("svg", { id: "icon", xmlns: "http://www.w3.org/2000/svg", width: "10px", height: "10px", viewBox: "0 0 10 10", fill: "none" }, h("circle", { cx: "5", cy: "5", r: "4", fill: "#17B26A" }))) : (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "10", height: "10", viewBox: "0 0 10 10", fill: "none" }, h("circle", { cx: "5", cy: "5", r: "4", fill: "#EEF2F6" }))))), this.type === 'checkbox' && h("gb-checkbox", { key: 'b9bc6bbbd0b1d9cc397d9366e5574f34f8b12a08', class: "checkbox", size: "md", type: "checkbox", state: this.state, checked: this.selected }), h("slot", { key: '9e464846673c46ad2f3228d54a7f013d2422dbfe', name: "name" }), this.supportingText && (h("span", { key: '0586327e4d77898e4f31eb56e3d634bff9a54416' }, h("slot", { key: '178d75d8776dfe2683f276b9000fd2a04204dfa6', name: "supporting_text" })))), this.selected && this.type !== 'checkbox' && (h("div", { key: '1b4044482cc8d8cd2cace7825848a094bac3fda9', class: `tick` }, this.state !== 'disabled' ? (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none", class: `${this.state}` }, h("path", { d: "M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337", stroke: "#075DB2", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))) : (h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 20 20", fill: "none" }, h("path", { d: "M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337", stroke: "#CDD5DF", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" }))))))));
|
|
61
64
|
}
|
|
62
65
|
static get is() { return "gb-input-dropdown-menu-item"; }
|
|
63
66
|
static get encapsulation() { return "shadow"; }
|
|
@@ -96,7 +99,8 @@ export class GbInputDropdownMenuItem {
|
|
|
96
99
|
"getter": false,
|
|
97
100
|
"setter": false,
|
|
98
101
|
"reflect": false,
|
|
99
|
-
"attribute": "type"
|
|
102
|
+
"attribute": "type",
|
|
103
|
+
"defaultValue": "'default'"
|
|
100
104
|
},
|
|
101
105
|
"supportingText": {
|
|
102
106
|
"type": "boolean",
|
|
@@ -161,7 +165,8 @@ export class GbInputDropdownMenuItem {
|
|
|
161
165
|
"getter": false,
|
|
162
166
|
"setter": false,
|
|
163
167
|
"reflect": false,
|
|
164
|
-
"attribute": "state"
|
|
168
|
+
"attribute": "state",
|
|
169
|
+
"defaultValue": "StateEnum.Default"
|
|
165
170
|
},
|
|
166
171
|
"color": {
|
|
167
172
|
"type": "string",
|
package/dist/collection/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gb-input-dropdown-menu-item.js","sourceRoot":"","sources":["../../../src/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.tsx"],"names":[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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, h, Fragment, Event, EventEmitter, State, getAssetPath } from '@stencil/core';\r\nimport { ColorTypes, DropdownTypes, StateEnum } from '../../models/reusableModels';\r\n\r\n@Component({\r\n tag: 'gb-input-dropdown-menu-item',\r\n styleUrl: 'gb-input-dropdown-menu-item.css',\r\n shadow: true,\r\n})\r\nexport class GbInputDropdownMenuItem {\r\n @Prop() type: DropdownTypes;\r\n @Prop() supportingText: boolean = false;\r\n @Prop({ mutable: true }) selected: boolean = false;\r\n @Prop() state: StateEnum;\r\n @Prop() color: ColorTypes;\r\n @Prop() iconLeading: boolean = false;\r\n @Prop() iconLeadingSwap: string = '';\r\n @Prop() ellipsed: boolean = true;\r\n @State() leadingIconSvg: string = '';\r\n @Event() dropdownItemClicked: EventEmitter<void>;\r\n\r\n @Element() el: HTMLElement;\r\n\r\n async loadIcon(iconName: string) {\r\n const iconPath = getAssetPath(`${iconName}`);\r\n const response = await fetch(iconPath);\r\n const svg = await response.text();\r\n\r\n const parser = new DOMParser();\r\n const svgDoc = parser.parseFromString(svg, 'image/svg+xml');\r\n const svgElement = svgDoc.documentElement;\r\n\r\n // Add `has-opacity` class to all elements that have an opacity attribute\r\n const elementsWithOpacity = svgElement.querySelectorAll('[opacity]');\r\n elementsWithOpacity.forEach(el => {\r\n el.classList.add('has_opacity');\r\n });\r\n\r\n // Serialize and store\r\n const modifiedSvg = svgElement.outerHTML;\r\n // console.log(modifiedSvg)\r\n this.leadingIconSvg = modifiedSvg;\r\n }\r\n\r\n componentWillLoad() {\r\n this.loadIcon(this.iconLeadingSwap);\r\n }\r\n\r\n componentDidLoad() {\r\n const nameSlot = this.el.querySelector('[slot=\"name\"]');\r\n const supportingTextSlot = this.el.querySelector('[slot=\"supporting_text\"]');\r\n const initialsSlot = this.el.querySelector('[slot=\"initials\"]');\r\n\r\n if (nameSlot) {\r\n nameSlot.classList.add('text-md-medium');\r\n\r\n if(this.ellipsed) {\r\n nameSlot.classList.add('ellipsed');\r\n }\r\n }\r\n\r\n if (initialsSlot) {\r\n initialsSlot.classList.add('text-xs-semi-bold');\r\n }\r\n\r\n if (supportingTextSlot) {\r\n supportingTextSlot.classList.add('text-sm-regular');\r\n }\r\n }\r\n\r\n async handleClick() {\r\n this.dropdownItemClicked.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n // <div class=\"dropdown-container\" onClick={() => (this.selected = !this.selected)}>\r\n <div class=\"dropdown-container\" onClick={() => this.handleClick()}>\r\n <div\r\n class={{\r\n 'dropdown-item': true,\r\n 'selected': this.selected,\r\n 'disabled': this.state === 'disabled',\r\n 'checkbox': this.type === 'checkbox',\r\n [this.type]: true,\r\n }}\r\n role=\"option\"\r\n aria-selected={this.selected ? 'true' : 'false'}\r\n aria-disabled={this.state === 'disabled' ? 'true' : 'false'}\r\n >\r\n <div class=\"content\">\r\n {this.type === 'icon_leading' && this.iconLeading && <div class={`icon_leading ${this.state}`} innerHTML={this.leadingIconSvg}></div>}\r\n {this.type === 'avatar_leading' && (\r\n <gb-avatar class=\"avatar-icon\" size=\"xs\" color={this.color} text={true}>\r\n <slot name=\"initials\" slot=\"initials\"></slot>\r\n </gb-avatar>\r\n )}\r\n {this.type === 'dot_leading' && (\r\n <>\r\n {this.state === 'default' ? (\r\n <svg id=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 10 10\" fill=\"none\">\r\n <circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#17B26A\" />\r\n </svg>\r\n ) : (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\">\r\n <circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#EEF2F6\" />\r\n </svg>\r\n )}\r\n </>\r\n )}\r\n {this.type === 'checkbox' && <gb-checkbox class=\"checkbox\" size=\"md\" type=\"checkbox\" state={this.state} checked={this.selected}></gb-checkbox>}\r\n <slot name=\"name\"></slot>\r\n {this.supportingText && (\r\n <span>\r\n <slot name=\"supporting_text\"></slot>\r\n </span>\r\n )}\r\n </div>\r\n {this.selected && this.type !== 'checkbox' && (\r\n <div class={`tick`}>\r\n {this.state !== 'disabled' ? (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" class={`${this.state}`}>\r\n <path\r\n d=\"M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337\"\r\n stroke=\"#075DB2\"\r\n stroke-width=\"1.66667\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n ) : (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337\"\r\n stroke=\"#CDD5DF\"\r\n stroke-width=\"1.66667\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
1
|
+
{"version":3,"file":"gb-input-dropdown-menu-item.js","sourceRoot":"","sources":["../../../src/components/gb-input-dropdown-menu-item/gb-input-dropdown-menu-item.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,EAAE,KAAK,EAAgB,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AAChH,OAAO,EAA6B,SAAS,EAAE,MAAM,6BAA6B,CAAC;AAOnF,MAAM,OAAO,uBAAuB;IALpC;QAMU,SAAI,GAAkB,SAAS,CAAC;QAChC,mBAAc,GAAY,KAAK,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;oBAC9I,6DAAM,IAAI,EAAC,MAAM,GAAQ;oBACxB,IAAI,CAAC,cAAc,IAAI,CACtB;wBACE,6DAAM,IAAI,EAAC,iBAAiB,GAAQ,CAC/B,CACR,CACG;gBACL,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,IAAI,KAAK,UAAU,IAAI,CAC5C,4DAAK,KAAK,EAAE,MAAM,IACf,IAAI,CAAC,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,CAC3B,WAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,EAAC,KAAK,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE;oBACnH,YACE,CAAC,EAAC,wGAAwG,EAC1G,MAAM,EAAC,SAAS,kBACH,SAAS,oBACP,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CAAC,CAAC,CAAC,CACF,WAAK,KAAK,EAAC,4BAA4B,EAAC,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM;oBAC5F,YACE,CAAC,EAAC,wGAAwG,EAC1G,MAAM,EAAC,SAAS,kBACH,SAAS,oBACP,OAAO,qBACN,OAAO,GACvB,CACE,CACP,CACG,CACP,CACG,CACF,CACP,CAAC;IACJ,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CACF","sourcesContent":["import { Component, Element, Prop, h, Fragment, Event, EventEmitter, State, getAssetPath } from '@stencil/core';\r\nimport { ColorTypes, DropdownTypes, StateEnum } from '../../models/reusableModels';\r\n\r\n@Component({\r\n tag: 'gb-input-dropdown-menu-item',\r\n styleUrl: 'gb-input-dropdown-menu-item.css',\r\n shadow: true,\r\n})\r\nexport class GbInputDropdownMenuItem {\r\n @Prop() type: DropdownTypes = 'default';\r\n @Prop() supportingText: boolean = false;\r\n @Prop({ mutable: true }) selected: boolean = false;\r\n @Prop() state: StateEnum = StateEnum.Default;\r\n @Prop() color: ColorTypes;\r\n @Prop() iconLeading: boolean = false;\r\n @Prop() iconLeadingSwap: string = '';\r\n @Prop() ellipsed: boolean = true;\r\n @State() leadingIconSvg: string = '';\r\n @Event() dropdownItemClicked: EventEmitter<void>;\r\n\r\n @Element() el: HTMLElement;\r\n\r\n async loadIcon(iconName: string) {\r\n const iconPath = getAssetPath(`${iconName}`);\r\n const response = await fetch(iconPath);\r\n const svg = await response.text();\r\n\r\n const parser = new DOMParser();\r\n const svgDoc = parser.parseFromString(svg, 'image/svg+xml');\r\n const svgElement = svgDoc.documentElement;\r\n\r\n // Add `has-opacity` class to all elements that have an opacity attribute\r\n const elementsWithOpacity = svgElement.querySelectorAll('[opacity]');\r\n elementsWithOpacity.forEach(el => {\r\n el.classList.add('has_opacity');\r\n });\r\n\r\n // Serialize and store\r\n const modifiedSvg = svgElement.outerHTML;\r\n // console.log(modifiedSvg)\r\n this.leadingIconSvg = modifiedSvg;\r\n }\r\n\r\n componentWillLoad() {\r\n this.loadIcon(this.iconLeadingSwap);\r\n }\r\n\r\n componentDidLoad() {\r\n const nameSlot = this.el.querySelector('[slot=\"name\"]');\r\n const supportingTextSlot = this.el.querySelector('[slot=\"supporting_text\"]');\r\n const initialsSlot = this.el.querySelector('[slot=\"initials\"]');\r\n\r\n if (nameSlot) {\r\n nameSlot.classList.add('text-md-medium');\r\n\r\n if(this.ellipsed) {\r\n nameSlot.classList.add('ellipsed');\r\n }\r\n }\r\n\r\n if (initialsSlot) {\r\n initialsSlot.classList.add('text-xs-semi-bold');\r\n }\r\n\r\n if (supportingTextSlot) {\r\n supportingTextSlot.classList.add('text-sm-regular');\r\n }\r\n }\r\n\r\n async handleClick() {\r\n this.dropdownItemClicked.emit();\r\n }\r\n\r\n render() {\r\n return (\r\n // <div class=\"dropdown-container\" onClick={() => (this.selected = !this.selected)}>\r\n <div class=\"dropdown-container\" onClick={() => this.handleClick()}>\r\n <div\r\n class={{\r\n 'dropdown-item': true,\r\n 'selected': this.selected,\r\n 'disabled': this.state === 'disabled',\r\n 'checkbox': this.type === 'checkbox',\r\n [this.type]: true,\r\n }}\r\n role=\"option\"\r\n aria-selected={this.selected ? 'true' : 'false'}\r\n aria-disabled={this.state === 'disabled' ? 'true' : 'false'}\r\n >\r\n <div class=\"content\">\r\n {this.type === 'icon_leading' && this.iconLeading && <div class={`icon_leading ${this.state}`} innerHTML={this.leadingIconSvg}></div>}\r\n {this.type === 'avatar_leading' && (\r\n <gb-avatar class=\"avatar-icon\" size=\"xs\" color={this.color} text={true}>\r\n <slot name=\"initials\" slot=\"initials\"></slot>\r\n </gb-avatar>\r\n )}\r\n {this.type === 'dot_leading' && (\r\n <>\r\n {this.state === 'default' ? (\r\n <svg id=\"icon\" xmlns=\"http://www.w3.org/2000/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 10 10\" fill=\"none\">\r\n <circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#17B26A\" />\r\n </svg>\r\n ) : (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" fill=\"none\">\r\n <circle cx=\"5\" cy=\"5\" r=\"4\" fill=\"#EEF2F6\" />\r\n </svg>\r\n )}\r\n </>\r\n )}\r\n {this.type === 'checkbox' && <gb-checkbox class=\"checkbox\" size=\"md\" type=\"checkbox\" state={this.state} checked={this.selected}></gb-checkbox>}\r\n <slot name=\"name\"></slot>\r\n {this.supportingText && (\r\n <span>\r\n <slot name=\"supporting_text\"></slot>\r\n </span>\r\n )}\r\n </div>\r\n {this.selected && this.type !== 'checkbox' && (\r\n <div class={`tick`}>\r\n {this.state !== 'disabled' ? (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\" class={`${this.state}`}>\r\n <path\r\n d=\"M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337\"\r\n stroke=\"#075DB2\"\r\n stroke-width=\"1.66667\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n ) : (\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"20\" height=\"20\" viewBox=\"0 0 20 20\" fill=\"none\">\r\n <path\r\n d=\"M4.16669 12.0834C4.16669 12.0834 5.41669 12.0834 7.08335 15C7.08335 15 11.7157 7.36115 15.8334 5.83337\"\r\n stroke=\"#CDD5DF\"\r\n stroke-width=\"1.66667\"\r\n stroke-linecap=\"round\"\r\n stroke-linejoin=\"round\"\r\n />\r\n </svg>\r\n )}\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n );\r\n }\r\n}\r\n"]}
|
|
@@ -2808,6 +2808,7 @@
|
|
|
2808
2808
|
color: var(--color-text-danger, #b51726) !important;
|
|
2809
2809
|
} */
|
|
2810
2810
|
|
|
2811
|
+
|
|
2811
2812
|
:host {
|
|
2812
2813
|
position: relative;
|
|
2813
2814
|
}
|
|
@@ -2818,7 +2819,7 @@ input {
|
|
|
2818
2819
|
outline: none;
|
|
2819
2820
|
}
|
|
2820
2821
|
|
|
2821
|
-
input:focus{
|
|
2822
|
+
input:focus {
|
|
2822
2823
|
caret-color: var(--color-text, #4b5565);
|
|
2823
2824
|
}
|
|
2824
2825
|
|
|
@@ -3173,6 +3174,12 @@ input:autofill {
|
|
|
3173
3174
|
.country_icon {
|
|
3174
3175
|
display: flex;
|
|
3175
3176
|
align-items: center;
|
|
3177
|
+
border-radius: var(--rounded-full);
|
|
3178
|
+
overflow: hidden;
|
|
3179
|
+
}
|
|
3180
|
+
|
|
3181
|
+
.country_icon img {
|
|
3182
|
+
/* object-fit: cover; */
|
|
3176
3183
|
}
|
|
3177
3184
|
|
|
3178
3185
|
.dropdown_menu {
|