bromcom-ui 2.3.20 → 2.3.24
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/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-013b6f5d.entry.js +1 -0
- package/dist/bromcom-ui/p-2ac10f7e.entry.js +1 -0
- package/dist/bromcom-ui/p-50580ac4.entry.js +1 -0
- package/dist/bromcom-ui/p-7c8feaee.entry.js +1 -0
- package/dist/bromcom-ui/p-8742c05d.entry.js +1 -0
- package/dist/bromcom-ui/p-907fa2b4.entry.js +1 -0
- package/dist/bromcom-ui/p-a0cf36ff.entry.js +1 -0
- package/dist/bromcom-ui/p-def1e061.entry.js +1 -0
- package/dist/cjs/bcm-badge_10.cjs.entry.js +25 -3
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +19 -3
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +19 -9
- package/dist/cjs/bcm-checkbox.cjs.entry.js +14 -1
- package/dist/cjs/bcm-collapse-group.cjs.entry.js +22 -4
- package/dist/cjs/bcm-collapse.cjs.entry.js +4 -2
- package/dist/cjs/bcm-select.cjs.entry.js +61 -30
- package/dist/cjs/bcm-switch.cjs.entry.js +28 -4
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/molecules/checkbox/checkbox-lite.js +24 -2
- package/dist/collection/components/molecules/checkbox/checkbox.css +34 -3
- package/dist/collection/components/molecules/checkbox/checkbox.js +50 -1
- package/dist/collection/components/molecules/checkbox/group.js +51 -3
- package/dist/collection/components/molecules/collapse/collapse.css +3 -0
- package/dist/collection/components/molecules/collapse/collapse.js +21 -1
- package/dist/collection/components/molecules/collapse/group.js +58 -4
- package/dist/collection/components/molecules/input/input.css +4 -0
- package/dist/collection/components/molecules/input/input.js +20 -1
- package/dist/collection/components/molecules/search/search.js +1 -1
- package/dist/collection/components/molecules/select/select.js +61 -30
- package/dist/collection/components/molecules/switch/switch.css +45 -1
- package/dist/collection/components/molecules/switch/switch.js +185 -4
- package/dist/collection/components/organism/form/form.js +22 -0
- package/dist/collection/components/organism/listbox/listbox.js +11 -5
- package/dist/collection/utils/validation.js +1 -1
- package/dist/esm/bcm-badge_10.entry.js +26 -4
- package/dist/esm/bcm-checkbox-group.entry.js +19 -3
- package/dist/esm/bcm-checkbox-lite_9.entry.js +19 -9
- package/dist/esm/bcm-checkbox.entry.js +14 -1
- package/dist/esm/bcm-collapse-group.entry.js +22 -4
- package/dist/esm/bcm-collapse.entry.js +4 -2
- package/dist/esm/bcm-select.entry.js +61 -30
- package/dist/esm/bcm-switch.entry.js +28 -4
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/molecules/checkbox/checkbox-lite.d.ts +1 -0
- package/dist/types/components/molecules/checkbox/checkbox.d.ts +4 -0
- package/dist/types/components/molecules/checkbox/group.d.ts +2 -0
- package/dist/types/components/molecules/collapse/collapse.d.ts +1 -0
- package/dist/types/components/molecules/collapse/group.d.ts +4 -1
- package/dist/types/components/molecules/input/input.d.ts +1 -0
- package/dist/types/components/molecules/select/select.d.ts +1 -1
- package/dist/types/components/molecules/switch/switch.d.ts +11 -0
- package/dist/types/components/organism/form/form.d.ts +1 -0
- package/dist/types/components.d.ts +28 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-088e3939.entry.js +0 -1
- package/dist/bromcom-ui/p-2dce84ef.entry.js +0 -1
- package/dist/bromcom-ui/p-860cb26e.entry.js +0 -1
- package/dist/bromcom-ui/p-9eec3968.entry.js +0 -1
- package/dist/bromcom-ui/p-bbf3492f.entry.js +0 -1
- package/dist/bromcom-ui/p-c3b61cd2.entry.js +0 -1
- package/dist/bromcom-ui/p-f11cabd5.entry.js +0 -1
- package/dist/bromcom-ui/p-f2f70343.entry.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Component, h, Prop, Event, Host } from '@stencil/core';
|
|
1
|
+
import { Component, h, Prop, Event, Host, State, Method } from '@stencil/core';
|
|
2
2
|
import cs from 'classnames';
|
|
3
3
|
export class BcmSwitch {
|
|
4
4
|
constructor() {
|
|
@@ -8,6 +8,14 @@ export class BcmSwitch {
|
|
|
8
8
|
this.disabled = false;
|
|
9
9
|
this.hidden = false;
|
|
10
10
|
this.value = '';
|
|
11
|
+
this.label = null;
|
|
12
|
+
this.required = false;
|
|
13
|
+
this.noCaption = false;
|
|
14
|
+
this.captionType = 'default';
|
|
15
|
+
}
|
|
16
|
+
connectedCallback() {
|
|
17
|
+
this.captionCache = this.caption;
|
|
18
|
+
this.captionTypeCache = this.captionType;
|
|
11
19
|
}
|
|
12
20
|
handleClick() {
|
|
13
21
|
this.checked = this.input.checked;
|
|
@@ -28,8 +36,21 @@ export class BcmSwitch {
|
|
|
28
36
|
this.disabled = true;
|
|
29
37
|
}
|
|
30
38
|
}
|
|
39
|
+
async setClear() {
|
|
40
|
+
if (this.input.checked == true) {
|
|
41
|
+
this.input.checked = false;
|
|
42
|
+
this.checked = this.input.checked;
|
|
43
|
+
this.value = this.checked;
|
|
44
|
+
this.change.emit(this.checked);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
async resetCaption() {
|
|
48
|
+
this.caption = this.captionCache;
|
|
49
|
+
this.captionType = this.captionTypeCache;
|
|
50
|
+
this.captionError = null;
|
|
51
|
+
}
|
|
31
52
|
render() {
|
|
32
|
-
const { checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled } = this;
|
|
53
|
+
const { checked, size, activeIcon, inactiveIcon, activeText, inactiveText, pending, disabled, label, required, noCaption, captionType, captionError, caption } = this;
|
|
33
54
|
const classes = cs('container', size, {
|
|
34
55
|
'switch-checked': checked,
|
|
35
56
|
'disabled': disabled
|
|
@@ -38,12 +59,19 @@ export class BcmSwitch {
|
|
|
38
59
|
'checked': checked,
|
|
39
60
|
'disabled': disabled
|
|
40
61
|
});
|
|
62
|
+
const captionClasses = cs('size-1', 'input-caption', 'caption-' + captionType);
|
|
41
63
|
const isPermitted = (condition) => {
|
|
42
64
|
return (condition && size === 'medium');
|
|
43
65
|
};
|
|
44
66
|
const isMedium = size === 'medium';
|
|
45
|
-
const hostClasses = cs(this.hidden ? 'hidden' : null);
|
|
67
|
+
const hostClasses = cs('switch', this.hidden ? 'hidden' : null);
|
|
46
68
|
return (h(Host, { class: hostClasses },
|
|
69
|
+
label && h("label", { class: "label size-1" },
|
|
70
|
+
" ",
|
|
71
|
+
label,
|
|
72
|
+
" ",
|
|
73
|
+
required && ('*'),
|
|
74
|
+
" "),
|
|
47
75
|
h("label", { class: wrapperClass },
|
|
48
76
|
isPermitted(inactiveText) && h("span", { class: "inactive-text size-1" }, inactiveText),
|
|
49
77
|
h("div", { class: classes },
|
|
@@ -51,7 +79,16 @@ export class BcmSwitch {
|
|
|
51
79
|
h("span", { class: "handle" }, pending && h("span", { class: "spinner" })),
|
|
52
80
|
isMedium && h("bcm-icon", { icon: inactiveIcon, size: 14, class: "icon-inactive" })),
|
|
53
81
|
h("input", { onClick: () => this.handleClick(), onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur(), ref: el => (this.input = el), checked: checked, type: "checkbox", class: "switch", disabled: disabled }),
|
|
54
|
-
isPermitted(activeText) && h("span", { class: "active-text size-1" }, activeText))
|
|
82
|
+
isPermitted(activeText) && h("span", { class: "active-text size-1" }, activeText)),
|
|
83
|
+
!noCaption && (h("div", { class: "caption-area" }, captionType == "error"
|
|
84
|
+
? h("span", { class: captionClasses },
|
|
85
|
+
" ",
|
|
86
|
+
captionError,
|
|
87
|
+
" ")
|
|
88
|
+
: caption && h("span", { class: captionClasses },
|
|
89
|
+
" ",
|
|
90
|
+
caption,
|
|
91
|
+
" ")))));
|
|
55
92
|
}
|
|
56
93
|
static get is() { return "bcm-switch"; }
|
|
57
94
|
static get encapsulation() { return "shadow"; }
|
|
@@ -254,8 +291,118 @@ export class BcmSwitch {
|
|
|
254
291
|
},
|
|
255
292
|
"attribute": "name",
|
|
256
293
|
"reflect": true
|
|
294
|
+
},
|
|
295
|
+
"label": {
|
|
296
|
+
"type": "string",
|
|
297
|
+
"mutable": false,
|
|
298
|
+
"complexType": {
|
|
299
|
+
"original": "string",
|
|
300
|
+
"resolved": "string",
|
|
301
|
+
"references": {}
|
|
302
|
+
},
|
|
303
|
+
"required": false,
|
|
304
|
+
"optional": false,
|
|
305
|
+
"docs": {
|
|
306
|
+
"tags": [],
|
|
307
|
+
"text": ""
|
|
308
|
+
},
|
|
309
|
+
"attribute": "label",
|
|
310
|
+
"reflect": false,
|
|
311
|
+
"defaultValue": "null"
|
|
312
|
+
},
|
|
313
|
+
"required": {
|
|
314
|
+
"type": "boolean",
|
|
315
|
+
"mutable": false,
|
|
316
|
+
"complexType": {
|
|
317
|
+
"original": "boolean",
|
|
318
|
+
"resolved": "boolean",
|
|
319
|
+
"references": {}
|
|
320
|
+
},
|
|
321
|
+
"required": false,
|
|
322
|
+
"optional": false,
|
|
323
|
+
"docs": {
|
|
324
|
+
"tags": [],
|
|
325
|
+
"text": ""
|
|
326
|
+
},
|
|
327
|
+
"attribute": "required",
|
|
328
|
+
"reflect": true,
|
|
329
|
+
"defaultValue": "false"
|
|
330
|
+
},
|
|
331
|
+
"noCaption": {
|
|
332
|
+
"type": "boolean",
|
|
333
|
+
"mutable": false,
|
|
334
|
+
"complexType": {
|
|
335
|
+
"original": "boolean",
|
|
336
|
+
"resolved": "boolean",
|
|
337
|
+
"references": {}
|
|
338
|
+
},
|
|
339
|
+
"required": false,
|
|
340
|
+
"optional": false,
|
|
341
|
+
"docs": {
|
|
342
|
+
"tags": [],
|
|
343
|
+
"text": ""
|
|
344
|
+
},
|
|
345
|
+
"attribute": "no-caption",
|
|
346
|
+
"reflect": false,
|
|
347
|
+
"defaultValue": "false"
|
|
348
|
+
},
|
|
349
|
+
"caption": {
|
|
350
|
+
"type": "string",
|
|
351
|
+
"mutable": false,
|
|
352
|
+
"complexType": {
|
|
353
|
+
"original": "string",
|
|
354
|
+
"resolved": "string",
|
|
355
|
+
"references": {}
|
|
356
|
+
},
|
|
357
|
+
"required": false,
|
|
358
|
+
"optional": false,
|
|
359
|
+
"docs": {
|
|
360
|
+
"tags": [],
|
|
361
|
+
"text": ""
|
|
362
|
+
},
|
|
363
|
+
"attribute": "caption",
|
|
364
|
+
"reflect": false
|
|
365
|
+
},
|
|
366
|
+
"captionError": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"mutable": false,
|
|
369
|
+
"complexType": {
|
|
370
|
+
"original": "string",
|
|
371
|
+
"resolved": "string",
|
|
372
|
+
"references": {}
|
|
373
|
+
},
|
|
374
|
+
"required": false,
|
|
375
|
+
"optional": false,
|
|
376
|
+
"docs": {
|
|
377
|
+
"tags": [],
|
|
378
|
+
"text": ""
|
|
379
|
+
},
|
|
380
|
+
"attribute": "caption-error",
|
|
381
|
+
"reflect": false
|
|
382
|
+
},
|
|
383
|
+
"captionType": {
|
|
384
|
+
"type": "string",
|
|
385
|
+
"mutable": false,
|
|
386
|
+
"complexType": {
|
|
387
|
+
"original": "'primary' | 'success' | 'warning' | 'error' | 'default'",
|
|
388
|
+
"resolved": "\"default\" | \"error\" | \"primary\" | \"success\" | \"warning\"",
|
|
389
|
+
"references": {}
|
|
390
|
+
},
|
|
391
|
+
"required": false,
|
|
392
|
+
"optional": false,
|
|
393
|
+
"docs": {
|
|
394
|
+
"tags": [],
|
|
395
|
+
"text": ""
|
|
396
|
+
},
|
|
397
|
+
"attribute": "caption-type",
|
|
398
|
+
"reflect": false,
|
|
399
|
+
"defaultValue": "'default'"
|
|
257
400
|
}
|
|
258
401
|
}; }
|
|
402
|
+
static get states() { return {
|
|
403
|
+
"captionCache": {},
|
|
404
|
+
"captionTypeCache": {}
|
|
405
|
+
}; }
|
|
259
406
|
static get events() { return [{
|
|
260
407
|
"method": "change",
|
|
261
408
|
"name": "bcm-change",
|
|
@@ -302,4 +449,38 @@ export class BcmSwitch {
|
|
|
302
449
|
"references": {}
|
|
303
450
|
}
|
|
304
451
|
}]; }
|
|
452
|
+
static get methods() { return {
|
|
453
|
+
"setClear": {
|
|
454
|
+
"complexType": {
|
|
455
|
+
"signature": "() => Promise<void>",
|
|
456
|
+
"parameters": [],
|
|
457
|
+
"references": {
|
|
458
|
+
"Promise": {
|
|
459
|
+
"location": "global"
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
"return": "Promise<void>"
|
|
463
|
+
},
|
|
464
|
+
"docs": {
|
|
465
|
+
"text": "",
|
|
466
|
+
"tags": []
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
"resetCaption": {
|
|
470
|
+
"complexType": {
|
|
471
|
+
"signature": "() => Promise<void>",
|
|
472
|
+
"parameters": [],
|
|
473
|
+
"references": {
|
|
474
|
+
"Promise": {
|
|
475
|
+
"location": "global"
|
|
476
|
+
}
|
|
477
|
+
},
|
|
478
|
+
"return": "Promise<void>"
|
|
479
|
+
},
|
|
480
|
+
"docs": {
|
|
481
|
+
"text": "",
|
|
482
|
+
"tags": []
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
}; }
|
|
305
486
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Component, h, Host, Listen, Element, Prop, Event, Method } from '@stencil/core';
|
|
2
2
|
import cs from 'classnames';
|
|
3
|
+
import { getChilds } from '../../../utils/utils';
|
|
3
4
|
import { validate } from '../../../utils/validation';
|
|
4
5
|
/**
|
|
5
6
|
* @desc
|
|
@@ -163,11 +164,15 @@ export class BcmForm {
|
|
|
163
164
|
isWrapperComponent(item) {
|
|
164
165
|
return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
|
|
165
166
|
}
|
|
167
|
+
isGroupComponent(item) {
|
|
168
|
+
return ['bcm-checkbox-group', 'bcm-radio-group'].includes(item.toLowerCase());
|
|
169
|
+
}
|
|
166
170
|
async userFormData() {
|
|
167
171
|
this.formData = {};
|
|
168
172
|
this.isValid = true;
|
|
169
173
|
this.returnCaption = [];
|
|
170
174
|
for (const item of this.inputs) {
|
|
175
|
+
const isGroupComponent = this.isGroupComponent(item.tagName);
|
|
171
176
|
const isWrapperComponent = this.isWrapperComponent(item.tagName);
|
|
172
177
|
const wrapperComponent = isWrapperComponent && item;
|
|
173
178
|
const input = isWrapperComponent
|
|
@@ -191,6 +196,23 @@ export class BcmForm {
|
|
|
191
196
|
}
|
|
192
197
|
}
|
|
193
198
|
}
|
|
199
|
+
else if (isGroupComponent) {
|
|
200
|
+
getChilds(input, "bcm-checkbox").forEach(element => {
|
|
201
|
+
if (element.required == true) {
|
|
202
|
+
valid = validate.required(element.value);
|
|
203
|
+
if (!valid['valid']) {
|
|
204
|
+
element.noCaption = false;
|
|
205
|
+
element.captionError = valid['message'];
|
|
206
|
+
element.captionType = valid['type'];
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
element.noCaption = input.noCaption;
|
|
210
|
+
element.captionError = null;
|
|
211
|
+
element.captionType = "default";
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
}
|
|
194
216
|
else {
|
|
195
217
|
valid = validate.required(input.value);
|
|
196
218
|
}
|
|
@@ -151,6 +151,9 @@ export class BcmListbox {
|
|
|
151
151
|
}
|
|
152
152
|
async addChecked(items) {
|
|
153
153
|
this.setClear();
|
|
154
|
+
if (sessionStorage.getItem(this._internal_id + "-config")) {
|
|
155
|
+
this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
|
|
156
|
+
}
|
|
154
157
|
this.checkedList = items;
|
|
155
158
|
this.checkedList.forEach((item) => {
|
|
156
159
|
this.handleListboxChecked({ detail: String(item) }, this._internal_id);
|
|
@@ -180,7 +183,7 @@ export class BcmListbox {
|
|
|
180
183
|
}, 100);
|
|
181
184
|
}
|
|
182
185
|
async config(_config) {
|
|
183
|
-
if (_config['treeview']
|
|
186
|
+
if (_config['treeview']) {
|
|
184
187
|
typeof _config['treeview'] == 'boolean'
|
|
185
188
|
? this.treeview = _config['treeview']
|
|
186
189
|
: this.treeview = false;
|
|
@@ -307,6 +310,7 @@ export class BcmListbox {
|
|
|
307
310
|
this.searchSub = "x";
|
|
308
311
|
}
|
|
309
312
|
}
|
|
313
|
+
sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
|
|
310
314
|
// forceUpdate(this.el)
|
|
311
315
|
return Promise.resolve(true);
|
|
312
316
|
}
|
|
@@ -321,10 +325,12 @@ export class BcmListbox {
|
|
|
321
325
|
if (this.treeview) {
|
|
322
326
|
await customElements.whenDefined("bcm-treeview");
|
|
323
327
|
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
this.
|
|
327
|
-
|
|
328
|
+
if (bcmTreeview) {
|
|
329
|
+
await bcmTreeview.setData(_data);
|
|
330
|
+
if (this.searchData.length > 0) {
|
|
331
|
+
this.isEmpty(false);
|
|
332
|
+
this.isLoading(false);
|
|
333
|
+
}
|
|
328
334
|
}
|
|
329
335
|
}
|
|
330
336
|
}, 100);
|
|
@@ -16,7 +16,7 @@ export class rules {
|
|
|
16
16
|
}
|
|
17
17
|
required(value, componentValidation) {
|
|
18
18
|
let validation = this.response(true);
|
|
19
|
-
if (value == '' || value == "" || value == undefined || value == null) {
|
|
19
|
+
if (value == '' || value == "" || value == undefined || value == null || value === false) {
|
|
20
20
|
validation = this.response(false, 'This field is required.');
|
|
21
21
|
}
|
|
22
22
|
if (componentValidation) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, c as createEvent, f as forceUpdate } from './index-8fe7aea4.js';
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
3
|
import { C as ColorPalette } from './colors-7c7b35e9.js';
|
|
4
|
-
import { e as extractColor,
|
|
4
|
+
import { e as extractColor, g as getChilds, d as delay } from './utils-24f85563.js';
|
|
5
5
|
|
|
6
6
|
const badgeCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}.success{background-color:#52C41A}.error{background-color:#F5222D}.default{background-color:#D9D9D9}.processing{background-color:#4293CF}.warning{background-color:#FA8C16}.badge-basic{padding:0 8px;border:1px solid #FFFFFF;color:var(--bcm-color-grey-1);border-radius:16px;font-size:14px;height:22px;display:inline-flex;align-items:center;justify-content:center}.badge-info{display:inline-flex;align-items:center}.badge-text{color:var(--bcm-color-grey-7);font-size:14px}.badge-dot{display:inline-block;width:8px;height:8px;border:1px solid #FFFFFF;margin-right:8px;border-radius:100%;box-sizing:border-box;margin-bottom:1px}.badge-dot.basic.medium{width:12px;height:12px;margin-bottom:-1px;line-height:1}.badge-dot.basic.large{width:16px;height:16px;margin-bottom:-1px;line-height:1}";
|
|
7
7
|
|
|
@@ -299,7 +299,7 @@ class rules {
|
|
|
299
299
|
}
|
|
300
300
|
required(value, componentValidation) {
|
|
301
301
|
let validation = this.response(true);
|
|
302
|
-
if (value == '' || value == "" || value == undefined || value == null) {
|
|
302
|
+
if (value == '' || value == "" || value == undefined || value == null || value === false) {
|
|
303
303
|
validation = this.response(false, 'This field is required.');
|
|
304
304
|
}
|
|
305
305
|
if (componentValidation) {
|
|
@@ -484,11 +484,15 @@ const BcmForm = class {
|
|
|
484
484
|
isWrapperComponent(item) {
|
|
485
485
|
return ['bcm-datetime-picker', 'bcm-date-picker', 'bcm-time-picker'].includes(item.toLowerCase());
|
|
486
486
|
}
|
|
487
|
+
isGroupComponent(item) {
|
|
488
|
+
return ['bcm-checkbox-group', 'bcm-radio-group'].includes(item.toLowerCase());
|
|
489
|
+
}
|
|
487
490
|
async userFormData() {
|
|
488
491
|
this.formData = {};
|
|
489
492
|
this.isValid = true;
|
|
490
493
|
this.returnCaption = [];
|
|
491
494
|
for (const item of this.inputs) {
|
|
495
|
+
const isGroupComponent = this.isGroupComponent(item.tagName);
|
|
492
496
|
const isWrapperComponent = this.isWrapperComponent(item.tagName);
|
|
493
497
|
const wrapperComponent = isWrapperComponent && item;
|
|
494
498
|
const input = isWrapperComponent
|
|
@@ -512,6 +516,23 @@ const BcmForm = class {
|
|
|
512
516
|
}
|
|
513
517
|
}
|
|
514
518
|
}
|
|
519
|
+
else if (isGroupComponent) {
|
|
520
|
+
getChilds(input, "bcm-checkbox").forEach(element => {
|
|
521
|
+
if (element.required == true) {
|
|
522
|
+
valid = validate.required(element.value);
|
|
523
|
+
if (!valid['valid']) {
|
|
524
|
+
element.noCaption = false;
|
|
525
|
+
element.captionError = valid['message'];
|
|
526
|
+
element.captionType = valid['type'];
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
element.noCaption = input.noCaption;
|
|
530
|
+
element.captionError = null;
|
|
531
|
+
element.captionType = "default";
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
}
|
|
515
536
|
else {
|
|
516
537
|
valid = validate.required(input.value);
|
|
517
538
|
}
|
|
@@ -5984,7 +6005,7 @@ const BcmIcon = class {
|
|
|
5984
6005
|
};
|
|
5985
6006
|
BcmIcon.style = iconCss;
|
|
5986
6007
|
|
|
5987
|
-
const inputCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block;width:100%;margin:0 0 8px 0}:host(.hidden){display:none}.input-container{display:flex;flex-direction:column;width:100%;max-width:256px}.input-container.full-width{max-width:100%}.input-base{flex:1 1 auto;display:inline-flex;align-items:stretch;justify-content:start;position:relative;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);border-radius:2px;vertical-align:middle;overflow:hidden;padding:0 4px;cursor:text}.input-base.focused:not(.disabled){border-color:var(--bcm-color-prime-blue-5);box-shadow:0px 0px 4px var(--bcm-color-prime-blue-6)}.input-base.focused:not(.disabled) .caret-container{opacity:1}.input-base.focused:not(.disabled) .input-clear-button{opacity:1}.input-base:hover:not(.disabled){border-color:var(--bcm-color-prime-blue-6)}.input-base:hover:not(.disabled) .caret-container{opacity:1}.input-base:hover:not(.disabled) .input-clear-button{opacity:1}.input-base.disabled{background-color:var(--bcm-color-grey-3);cursor:not-allowed}.input-base.empty .input-clear-button{display:none}.input-base.invalid{border-color:var(--bcm-color-red-6)}.error .label{color:var(--bcm-color-red-6) !important}.error .input-base{border:1px solid var(--bcm-color-red-6) !important}.input-base input{color:var(--bcm-color-grey-8);flex:1 1 auto;width:0%;border:none;border-radius:2px;background:none;box-shadow:none;padding:0;margin:0 4px;font-family:\"Roboto\", sans-serif;cursor:inherit;-webkit-appearance:none;appearance:none}.input-base input::-webkit-search-decoration,.input-base input::-webkit-search-cancel-button,.input-base input::-webkit-search-results-button,.input-base input::-webkit-search-results-decoration{-webkit-appearance:none}.input-base input::placeholder{color:var(--bcm-color-grey-6);user-select:none}.input-base input:focus{outline:none}input::-webkit-calendar-picker-indicator{-webkit-appearance:none;display:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}input[type=number]{-moz-appearance:textfield}.input-prefix,.input-suffix{display:inline-flex;align-items:center;justify-content:center;cursor:default;color:var(--bcm-color-grey-7)}.input-prefix ::slotted(*),.input-prefix>span{margin-left:4px}.input-suffix ::slotted(*),.input-suffix>span{margin-right:4px}.input-clear-button,.input-password-toggle{display:inline-flex;align-items:center;border:none;background:none;padding:0;cursor:pointer;margin-right:4px;transition:0.2s opacity}.input-clear-button:last-child,.input-clear-button:last-of-type,.input-password-toggle:last-child,.input-password-toggle:last-of-type{margin-right:8px}.input-clear-button:focus,.input-password-toggle:focus{outline:none}.input-clear-button{opacity:0}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.input-caption{display:block}.unit.input-suffix{width:24px}.unit-prefix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default;color:var(--bcm-color-grey-8)}.caret-container{opacity:0;width:30px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-left:1px solid #D9D9D9;border-right:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box;margin-right:4px}.caret-container:last-of-type{margin-right:-4px;border-right:none}.caret-container .caret{display:inline-flex;height:50%;width:100%;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer}.caret-container .caret:hover{color:var(--bcm-color-prime-blue-6)}.caret-container .caret:active{background-color:var(--bcm-color-grey-3)}.caret-container .caret:last-child{border-top:1px solid #D9D9D9}.caret-container.disabled{background-color:var(--bcm-color-grey-3)}.caret-container.disabled .caret{cursor:not-allowed}.default-icon{margin-right:8px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.input-large{height:38px}.input-medium{height:30px}.input-small{height:20px}";
|
|
6008
|
+
const inputCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block;width:100%;margin:0 0 8px 0}:host(.hidden){display:none}:host(.no-margin){margin:0}.input-container{display:flex;flex-direction:column;width:100%;max-width:256px}.input-container.full-width{max-width:100%}.input-base{flex:1 1 auto;display:inline-flex;align-items:stretch;justify-content:start;position:relative;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);border-radius:2px;vertical-align:middle;overflow:hidden;padding:0 4px;cursor:text}.input-base.focused:not(.disabled){border-color:var(--bcm-color-prime-blue-5);box-shadow:0px 0px 4px var(--bcm-color-prime-blue-6)}.input-base.focused:not(.disabled) .caret-container{opacity:1}.input-base.focused:not(.disabled) .input-clear-button{opacity:1}.input-base:hover:not(.disabled){border-color:var(--bcm-color-prime-blue-6)}.input-base:hover:not(.disabled) .caret-container{opacity:1}.input-base:hover:not(.disabled) .input-clear-button{opacity:1}.input-base.disabled{background-color:var(--bcm-color-grey-3);cursor:not-allowed}.input-base.empty .input-clear-button{display:none}.input-base.invalid{border-color:var(--bcm-color-red-6)}.error .label{color:var(--bcm-color-red-6) !important}.error .input-base{border:1px solid var(--bcm-color-red-6) !important}.input-base input{color:var(--bcm-color-grey-8);flex:1 1 auto;width:0%;border:none;border-radius:2px;background:none;box-shadow:none;padding:0;margin:0 4px;font-family:\"Roboto\", sans-serif;cursor:inherit;-webkit-appearance:none;appearance:none}.input-base input::-webkit-search-decoration,.input-base input::-webkit-search-cancel-button,.input-base input::-webkit-search-results-button,.input-base input::-webkit-search-results-decoration{-webkit-appearance:none}.input-base input::placeholder{color:var(--bcm-color-grey-6);user-select:none}.input-base input:focus{outline:none}input::-webkit-calendar-picker-indicator{-webkit-appearance:none;display:none}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none}input[type=number]{-moz-appearance:textfield}.input-prefix,.input-suffix{display:inline-flex;align-items:center;justify-content:center;cursor:default;color:var(--bcm-color-grey-7)}.input-prefix ::slotted(*),.input-prefix>span{margin-left:4px}.input-suffix ::slotted(*),.input-suffix>span{margin-right:4px}.input-clear-button,.input-password-toggle{display:inline-flex;align-items:center;border:none;background:none;padding:0;cursor:pointer;margin-right:4px;transition:0.2s opacity}.input-clear-button:last-child,.input-clear-button:last-of-type,.input-password-toggle:last-child,.input-password-toggle:last-of-type{margin-right:8px}.input-clear-button:focus,.input-password-toggle:focus{outline:none}.input-clear-button{opacity:0}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.input-caption{display:block}.unit.input-suffix{width:24px}.unit-prefix{display:inline-flex;flex:0 0 auto;align-items:center;cursor:default;color:var(--bcm-color-grey-8)}.caret-container{opacity:0;width:30px;display:flex;flex-direction:column;justify-content:center;align-items:center;border-left:1px solid #D9D9D9;border-right:1px solid #D9D9D9;transition:0.2s opacity;user-select:none;box-sizing:border-box;margin-right:4px}.caret-container:last-of-type{margin-right:-4px;border-right:none}.caret-container .caret{display:inline-flex;height:50%;width:100%;align-items:center;justify-content:center;color:var(--bcm-color-grey-7);cursor:pointer}.caret-container .caret:hover{color:var(--bcm-color-prime-blue-6)}.caret-container .caret:active{background-color:var(--bcm-color-grey-3)}.caret-container .caret:last-child{border-top:1px solid #D9D9D9}.caret-container.disabled{background-color:var(--bcm-color-grey-3)}.caret-container.disabled .caret{cursor:not-allowed}.default-icon{margin-right:8px}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.input-large{height:38px}.input-medium{height:30px}.input-small{height:20px}";
|
|
5988
6009
|
|
|
5989
6010
|
let id = 0;
|
|
5990
6011
|
const defaultIcons = {
|
|
@@ -6011,6 +6032,7 @@ const BcmInput = class {
|
|
|
6011
6032
|
this.value = '';
|
|
6012
6033
|
this.size = "medium";
|
|
6013
6034
|
this.noCaption = false;
|
|
6035
|
+
this.noMargin = false;
|
|
6014
6036
|
this.captionType = 'default';
|
|
6015
6037
|
this.fullWidth = false;
|
|
6016
6038
|
this.disabled = false;
|
|
@@ -6338,7 +6360,7 @@ const BcmInput = class {
|
|
|
6338
6360
|
});
|
|
6339
6361
|
const inputClass = size === 'large' ? 'size-3' : 'size-2';
|
|
6340
6362
|
const captionClasses = classnames('size-1', 'input-caption', 'caption-' + captionType);
|
|
6341
|
-
const hostClasses = classnames(this.hidden ? 'hidden' : null);
|
|
6363
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, this.noMargin ? 'no-margin' : null);
|
|
6342
6364
|
return (h(Host, { class: hostClasses }, h("div", { class: containerClasses }, label && h("label", { htmlFor: this.inputId, class: "label size-1" }, " ", label, " ", required && ('*'), " "), h("div", { class: baseClasses }, h("span", { class: "input-prefix" }, h("slot", { name: "prefix" }), unitPrefix && h("span", { class: classnames(inputClass, 'unit-prefix') }, unitPrefix)), h("input", { "bcm-internal-id": this._id, id: this.inputId, class: inputClass, ref: el => (this.inputElement = el), onFocus: this.handleFocus, onBlur: this.handleBlur, onChange: this.handleChange, onInput: this.handleInput, maxLength: this.maxLength, type: type === 'password' && isPasswordVisible ? 'text' :
|
|
6343
6365
|
type === 'number' ? 'text' : type, placeholder: placeholder, value: type === 'number' && !this.hasFocus
|
|
6344
6366
|
? value + (value && (unit === null || unit === void 0 ? void 0 : unit.length) > 0 ? ' ' + unit : '')
|
|
@@ -61,11 +61,27 @@ const BcmCheckboxGroup = class {
|
|
|
61
61
|
this.optionType && (checkbox.optionType = this.optionType);
|
|
62
62
|
this.buttonStyle && (checkbox.buttonStyle = this.buttonStyle);
|
|
63
63
|
this.size && (checkbox.size = this.size);
|
|
64
|
-
this.required &&
|
|
65
|
-
|
|
64
|
+
// this.required == true && checkbox.required == true && (
|
|
65
|
+
// checkbox.required = true
|
|
66
|
+
// )
|
|
67
|
+
this.disabled == true && (checkbox.disabled = true);
|
|
66
68
|
});
|
|
67
69
|
this.groupChecked().then(values => this.value = values);
|
|
68
70
|
}
|
|
71
|
+
async setClear() {
|
|
72
|
+
const checkboxesInit = this.getAllInputs();
|
|
73
|
+
checkboxesInit.map(checkbox => {
|
|
74
|
+
checkbox.setClear();
|
|
75
|
+
checkbox.noCaption = this.noCaption;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
async resetCaption() {
|
|
79
|
+
const checkboxesInit = this.getAllInputs();
|
|
80
|
+
checkboxesInit.map(checkbox => {
|
|
81
|
+
checkbox.resetCaption();
|
|
82
|
+
checkbox.noCaption = this.noCaption;
|
|
83
|
+
});
|
|
84
|
+
}
|
|
69
85
|
/**
|
|
70
86
|
* @ComponentMethod
|
|
71
87
|
*/
|
|
@@ -240,7 +256,7 @@ const BcmCheckboxGroup = class {
|
|
|
240
256
|
});
|
|
241
257
|
var customStyle = {};
|
|
242
258
|
this.gap && (customStyle = { 'gap': this.gap });
|
|
243
|
-
return (h(Host, { class: hostClasses, "on-bcm-change": () => this.inputChange() }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), indeterminate && (h("div", { class: indeterminateClasses }, h("input", { id: "bcm-indeterminate-element", type: "checkbox", disabled: disabled }), h("label", { htmlFor: "bcm-indeterminate-element", "on-click": () => this.indeterminateClick() }, h("span", null, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), "Check All"))), h("div", { class: groupContainerClasses, style: customStyle }, checkboxesProp && this.checkboxesProp.map((checkbox) => h("bcm-checkbox", { name: checkbox.name, checked: checkbox.checked, disabled: checkbox.disabled, noCaption: this.noCaption, optionType: this.optionType, buttonStyle: this.buttonStyle, size: this.size, "full-width": this.fullWidth }, checkbox.label)), h("slot", null))));
|
|
259
|
+
return (h(Host, { class: hostClasses, "on-bcm-change": () => this.inputChange() }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), indeterminate && (h("div", { class: indeterminateClasses }, h("input", { id: "bcm-indeterminate-element", type: "checkbox", disabled: disabled }), h("label", { htmlFor: "bcm-indeterminate-element", "on-click": () => this.indeterminateClick() }, h("span", null, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), "Check All"))), h("div", { class: groupContainerClasses, style: customStyle }, checkboxesProp && this.checkboxesProp.map((checkbox) => h("bcm-checkbox", { name: checkbox.name, checked: checkbox.checked, disabled: checkbox.disabled, required: this.required === true && checkbox.required === true && (true), noCaption: this.noCaption, optionType: this.optionType, buttonStyle: this.buttonStyle, size: this.size, "full-width": this.fullWidth }, checkbox.label)), h("slot", null))));
|
|
244
260
|
}
|
|
245
261
|
get el() { return getElement(this); }
|
|
246
262
|
static get watchers() { return {
|
|
@@ -2,7 +2,7 @@ import { r as registerInstance, h, H as Host, g as getElement, a as getAssetPath
|
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
3
|
import { g as getChilds } from './utils-24f85563.js';
|
|
4
4
|
|
|
5
|
-
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label
|
|
5
|
+
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px;display:none}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px}:host(.indeterminate) label span.icon{position:relative}:host(.indeterminate) label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}:host(.indeterminate) label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}:host(.indeterminate) label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}input:checked+label .icon-checked{display:block}bcm-icon{filter:brightness(0) invert(1)}input[disabled]+label{cursor:not-allowed}input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}:host(.error) input:not([disabled])+label span.icon{border-color:var(--bcm-color-red-6)}.caption-area{margin-bottom:8px;min-height:20px;display:block}.input-caption{display:block}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.radio-button>span.icon{display:none}.radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.large{height:40px}.radio-button.medium{height:32px}.radio-button.small{height:24px}";
|
|
6
6
|
|
|
7
7
|
const BcmCheckboxLite = class {
|
|
8
8
|
constructor(hostRef) {
|
|
@@ -13,6 +13,7 @@ const BcmCheckboxLite = class {
|
|
|
13
13
|
this.value = '';
|
|
14
14
|
this.name = 'checkbox';
|
|
15
15
|
this.checked = false;
|
|
16
|
+
this.indeterminate = false;
|
|
16
17
|
this.disabled = false;
|
|
17
18
|
this.readOnly = false;
|
|
18
19
|
this.hidden = false;
|
|
@@ -30,8 +31,11 @@ const BcmCheckboxLite = class {
|
|
|
30
31
|
componentDidUpdate() { }
|
|
31
32
|
render() {
|
|
32
33
|
const { disabled, checked, readOnly, name, required } = this;
|
|
33
|
-
const hostClasses = classnames(this.hidden ? 'hidden' : null
|
|
34
|
-
|
|
34
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
35
|
+
'indeterminate': this.indeterminate
|
|
36
|
+
});
|
|
37
|
+
const iconClasses = classnames('icon');
|
|
38
|
+
return (h(Host, { class: hostClasses }, h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly }), h("label", { htmlFor: name }, h("span", { class: iconClasses }, h("svg", { class: "svg-icon icon-checked", width: "11", height: "9", viewBox: "0 0 11 9", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h("path", { d: "M1.91308 4.03516H1.91326C1.99256 4.03525 2.07081 4.05331 2.14213 4.08798C2.21341 4.12262 2.27591 4.17295 2.32497 4.2352L1.91308 4.03516ZM1.91308 4.03516H1.09394C0.890308 4.03516 0.776602 4.26975 0.902321 4.4292L0.902371 4.42927L4.11214 8.49567L4.11218 8.49573C4.32247 8.76188 4.72568 8.76114 4.93667 8.49617L4.93708 8.49566L10.6597 1.24398C10.6598 1.24378 10.66 1.24358 10.6602 1.24338C10.7884 1.08295 10.6699 0.85 10.4689 0.85H9.6498C9.48941 0.85 9.33668 0.9235 9.2376 1.05044C9.23751 1.05055 9.23742 1.05066 9.23734 1.05077L4.52403 7.02157M1.91308 4.03516L4.52403 7.02157M4.52403 7.02157L2.32506 4.23531L4.52403 7.02157Z", fill: "#BFBFBF", stroke: "#BFBFBF", "stroke-width": "0.3" }))))));
|
|
35
39
|
}
|
|
36
40
|
get el() { return getElement(this); }
|
|
37
41
|
};
|
|
@@ -281,6 +285,9 @@ const BcmListbox = class {
|
|
|
281
285
|
}
|
|
282
286
|
async addChecked(items) {
|
|
283
287
|
this.setClear();
|
|
288
|
+
if (sessionStorage.getItem(this._internal_id + "-config")) {
|
|
289
|
+
this.config(JSON.parse(sessionStorage.getItem(this._internal_id + "-config")));
|
|
290
|
+
}
|
|
284
291
|
this.checkedList = items;
|
|
285
292
|
this.checkedList.forEach((item) => {
|
|
286
293
|
this.handleListboxChecked({ detail: String(item) }, this._internal_id);
|
|
@@ -310,7 +317,7 @@ const BcmListbox = class {
|
|
|
310
317
|
}, 100);
|
|
311
318
|
}
|
|
312
319
|
async config(_config) {
|
|
313
|
-
if (_config['treeview']
|
|
320
|
+
if (_config['treeview']) {
|
|
314
321
|
typeof _config['treeview'] == 'boolean'
|
|
315
322
|
? this.treeview = _config['treeview']
|
|
316
323
|
: this.treeview = false;
|
|
@@ -437,6 +444,7 @@ const BcmListbox = class {
|
|
|
437
444
|
this.searchSub = "x";
|
|
438
445
|
}
|
|
439
446
|
}
|
|
447
|
+
sessionStorage.setItem(this._internal_id + "-config", JSON.stringify(_config));
|
|
440
448
|
// forceUpdate(this.el)
|
|
441
449
|
return Promise.resolve(true);
|
|
442
450
|
}
|
|
@@ -451,10 +459,12 @@ const BcmListbox = class {
|
|
|
451
459
|
if (this.treeview) {
|
|
452
460
|
await customElements.whenDefined("bcm-treeview");
|
|
453
461
|
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
this.
|
|
457
|
-
|
|
462
|
+
if (bcmTreeview) {
|
|
463
|
+
await bcmTreeview.setData(_data);
|
|
464
|
+
if (this.searchData.length > 0) {
|
|
465
|
+
this.isEmpty(false);
|
|
466
|
+
this.isLoading(false);
|
|
467
|
+
}
|
|
458
468
|
}
|
|
459
469
|
}
|
|
460
470
|
}, 100);
|
|
@@ -1306,7 +1316,7 @@ const BcmSearch = class {
|
|
|
1306
1316
|
}
|
|
1307
1317
|
render() {
|
|
1308
1318
|
const hostClasses = classnames(this.hidden ? 'hidden' : null);
|
|
1309
|
-
return (h(Host, { class: hostClasses }, h("bcm-input", { placeholder: this.searchPlaceholder, "no-caption": true, "full-width": true, disabled: this.disabled, type: "search", "on-bcm-change": e => this.inputChange(e.detail), value: this.searchValue })));
|
|
1319
|
+
return (h(Host, { class: hostClasses }, h("bcm-input", { placeholder: this.searchPlaceholder, "no-caption": true, "no-margin": true, "full-width": true, disabled: this.disabled, type: "search", "on-bcm-change": e => this.inputChange(e.detail), value: this.searchValue })));
|
|
1310
1320
|
}
|
|
1311
1321
|
get el() { return getElement(this); }
|
|
1312
1322
|
static get watchers() { return {
|
|
@@ -30,7 +30,7 @@ var ColorProps;
|
|
|
30
30
|
ColorProps["bc-orange"] = "bc-orange";
|
|
31
31
|
})(ColorProps || (ColorProps = {}));
|
|
32
32
|
|
|
33
|
-
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label
|
|
33
|
+
const checkboxCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}.size-1{font-size:12px;line-height:20px}.size-2{font-size:14px;line-height:22px}.size-3{font-size:16px;line-height:24px}.size-4{font-size:20px;line-height:28px}.size-5{font-size:24px;line-height:32px}.size-6{font-size:30px;line-height:38px}.size-7{font-size:38px;line-height:46px}.size-8{font-size:46px;line-height:54px}.size-9{font-size:56px;line-height:64px}.weight-regular{font-weight:400}.weight-semibold{font-weight:500}:host{display:inline-block}:host(.hidden){display:none}input{display:none}.svg-icon{filter:brightness(0) invert(1);width:12px;height:12px;display:none}label{display:flex;align-items:flex-start;font-size:14px;color:var(--bcm-color-grey-8);cursor:pointer}label span.icon{display:flex;align-items:center;justify-content:center;min-width:16px;min-height:16px;border:1px solid #D9D9D9;margin-right:8px;border-radius:2px;margin-top:2px}:host(.indeterminate) label span.icon{position:relative}:host(.indeterminate) label span.icon::after{content:\"\";position:absolute;top:50%;left:8px;width:10px;height:10px;background-color:var(--bcm-color-prime-blue-6);transform:translate(-50%, -50%);opacity:1;z-index:1}:host(.indeterminate) label span.icon::before{content:\"\";position:absolute;top:-1px;left:-1px;width:16px;height:100%;border-radius:2px;background-color:var(--bcm-color-grey-1);border:1px solid var(--bcm-color-grey-5);opacity:1;z-index:1}:host(.indeterminate) label span.icon:hover:not(.disabled):before{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}input:checked+label span.icon{background-color:var(--bcm-color-prime-blue-6);border-color:transparent}input:checked+label .icon-checked{display:block}bcm-icon{filter:brightness(0) invert(1)}input[disabled]+label{cursor:not-allowed}input[disabled]+label span.icon{background-color:var(--bcm-color-grey-3);border-color:var(--bcm-color-grey-5)}input[disabled]+label bcm-icon{filter:brightness(0);opacity:0.3}input:not([disabled])+label:hover span.icon{border-color:var(--bcm-color-prime-blue-6);box-shadow:0px 2px 4px rgba(54, 121, 171, 0.5)}:host(.error) input:not([disabled])+label span.icon{border-color:var(--bcm-color-red-6)}.caption-area{margin-bottom:8px;min-height:20px;display:block}.input-caption{display:block}.caption-default{color:#8C8C8C}.caption-primary{color:#4293CF}.caption-success{color:#52C41A}.caption-warning{color:#FA8C16}.caption-error{color:#F5222D}.radio-button{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-grey-8);border:1px solid var(--bcm-color-grey-5);padding:0 16px;box-sizing:border-box;display:flex;align-items:center;justify-content:center}.radio-button>span.icon{display:none}.radio-button>span.slot{display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;user-select:none}.radio-button:hover:not(.disabled){color:var(--bcm-color-prime-blue-5)}.radio-button:active:not(.disabled){color:var(--bcm-color-prime-blue-7)}.radio-button.disabled{background-color:var(--bcm-color-grey-3);color:var(--bcm-color-grey-6);cursor:not-allowed}.radio-button.checked.disabled{background-color:var(--bcm-color-grey-4);color:var(--bcm-color-grey-1);border-color:var(--bcm-color-grey-5)}.radio-button.checked.solid{color:var(--bcm-color-grey-1);background-color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.solid:hover{background-color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.solid:active{background-color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.checked.outline{background-color:var(--bcm-color-grey-1);color:var(--bcm-color-prime-blue-6);border-color:var(--bcm-color-prime-blue-6)}.radio-button.checked.outline:hover{color:var(--bcm-color-prime-blue-5);border-color:var(--bcm-color-prime-blue-5)}.radio-button.checked.outline:active{color:var(--bcm-color-prime-blue-7);border-color:var(--bcm-color-prime-blue-7)}.radio-button.large{height:40px}.radio-button.medium{height:32px}.radio-button.small{height:24px}";
|
|
34
34
|
|
|
35
35
|
const BcmCheckbox = class {
|
|
36
36
|
constructor(hostRef) {
|
|
@@ -59,6 +59,19 @@ const BcmCheckbox = class {
|
|
|
59
59
|
*/
|
|
60
60
|
connectedCallback() {
|
|
61
61
|
this.handleChange = this.handleChange.bind(this);
|
|
62
|
+
this.captionCache = this.caption;
|
|
63
|
+
this.captionTypeCache = this.captionType;
|
|
64
|
+
}
|
|
65
|
+
async setClear() {
|
|
66
|
+
if (this.inputElement.checked == true) {
|
|
67
|
+
this.inputElement.checked = false;
|
|
68
|
+
this.handleChange();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
async resetCaption() {
|
|
72
|
+
this.caption = this.captionCache;
|
|
73
|
+
this.captionType = this.captionTypeCache;
|
|
74
|
+
this.captionError = null;
|
|
62
75
|
}
|
|
63
76
|
componentDidLoad() {
|
|
64
77
|
this.value = this.inputElement.checked;
|