bromcom-ui 2.3.8 → 2.3.12
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-bcafa323.js → p-2171a0c0.js} +1 -1
- package/dist/bromcom-ui/{p-1dd8fc3d.entry.js → p-47cfa95d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-cb7cd8e5.entry.js → p-4ff1a95d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-df76345e.js → p-548a8473.js} +1 -1
- package/dist/bromcom-ui/{p-42801f3a.entry.js → p-54ae3352.entry.js} +1 -1
- package/dist/bromcom-ui/p-5c63cc5c.entry.js +1 -0
- package/dist/bromcom-ui/p-6760fc89.entry.js +1 -0
- package/dist/bromcom-ui/{p-e6150637.entry.js → p-6a83b7cf.entry.js} +1 -1
- package/dist/bromcom-ui/p-6d51c7eb.entry.js +1 -0
- package/dist/bromcom-ui/p-78ee84e3.entry.js +1 -0
- package/dist/bromcom-ui/{p-6d87b0e1.entry.js → p-7a567605.entry.js} +1 -1
- package/dist/bromcom-ui/p-7ce6b487.entry.js +1 -0
- package/dist/bromcom-ui/p-865ccb94.entry.js +1 -0
- package/dist/bromcom-ui/{p-57da3787.entry.js → p-891b1450.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4d83f2c6.entry.js → p-99e236db.entry.js} +1 -1
- package/dist/bromcom-ui/p-ba219861.entry.js +1 -0
- package/dist/bromcom-ui/{p-0132f3be.entry.js → p-bb5d1d6a.entry.js} +1 -1
- package/dist/bromcom-ui/p-d2ca7718.entry.js +1 -0
- package/dist/bromcom-ui/{p-7d1b1531.entry.js → p-dcc4bd56.entry.js} +1 -1
- package/dist/bromcom-ui/p-f11cabd5.entry.js +1 -0
- package/dist/bromcom-ui/{p-1583101a.entry.js → p-f9ad3ef6.entry.js} +1 -1
- package/dist/cjs/{bcm-form_5.cjs.entry.js → bcm-badge_10.cjs.entry.js} +904 -249
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +22 -15
- package/dist/cjs/bcm-checkbox.cjs.entry.js +4 -2
- package/dist/cjs/bcm-colorpicker.cjs.entry.js +4 -2
- package/dist/cjs/bcm-list-item.cjs.entry.js +70 -0
- package/dist/cjs/bcm-list.cjs.entry.js +276 -0
- package/dist/cjs/bcm-radio-group.cjs.entry.js +5 -2
- package/dist/cjs/bcm-select.cjs.entry.js +14 -6
- package/dist/cjs/bcm-textarea.cjs.entry.js +5 -2
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/molecules/checkbox/checkbox.js +27 -5
- package/dist/collection/components/molecules/input/input.js +29 -5
- package/dist/collection/components/molecules/radio/group.js +28 -5
- package/dist/collection/components/molecules/select/select.js +39 -10
- package/dist/collection/components/molecules/textarea/textarea.js +28 -5
- package/dist/collection/components/organism/colorpicker/colorpicker.js +27 -5
- package/dist/collection/components/organism/form/form.js +7 -9
- package/dist/collection/components/organism/listbox/listbox-item.js +2 -2
- package/dist/collection/components/organism/listbox/listbox.js +43 -16
- package/dist/esm/{bcm-form_5.entry.js → bcm-badge_10.entry.js} +900 -250
- package/dist/esm/bcm-checkbox-lite_9.entry.js +23 -16
- package/dist/esm/bcm-checkbox.entry.js +5 -3
- package/dist/esm/bcm-colorpicker.entry.js +6 -4
- package/dist/esm/bcm-datetime-picker_2.entry.js +2 -2
- package/dist/esm/bcm-dropdown.entry.js +1 -1
- package/dist/esm/bcm-list-item.entry.js +66 -0
- package/dist/esm/bcm-list.entry.js +272 -0
- package/dist/esm/bcm-popconfirm.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +1 -1
- package/dist/esm/bcm-pulldown-group_2.entry.js +1 -1
- package/dist/esm/bcm-pulldown.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +5 -2
- package/dist/esm/bcm-radio.entry.js +1 -1
- package/dist/esm/bcm-select-box_2.entry.js +1 -1
- package/dist/esm/bcm-select.entry.js +14 -6
- package/dist/esm/bcm-text.entry.js +1 -1
- package/dist/esm/bcm-textarea.entry.js +5 -2
- package/dist/esm/bcm-upload.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/{element-dragger-69122b76.js → element-dragger-9c68536d.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{utils-e794f7cb.js → utils-24f85563.js} +1 -1
- package/dist/types/components/molecules/checkbox/checkbox.d.ts +1 -0
- package/dist/types/components/molecules/input/input.d.ts +1 -0
- package/dist/types/components/molecules/radio/group.d.ts +1 -0
- package/dist/types/components/molecules/select/select.d.ts +1 -0
- package/dist/types/components/molecules/textarea/textarea.d.ts +1 -0
- package/dist/types/components/organism/colorpicker/colorpicker.d.ts +1 -0
- package/dist/types/components/organism/listbox/listbox.d.ts +1 -0
- package/dist/types/components.d.ts +14 -0
- package/package.json +1 -1
- package/dist/bromcom-ui/p-04fc7066.entry.js +0 -1
- package/dist/bromcom-ui/p-0916b55e.entry.js +0 -1
- package/dist/bromcom-ui/p-0c78726c.entry.js +0 -1
- package/dist/bromcom-ui/p-12493dbc.entry.js +0 -1
- package/dist/bromcom-ui/p-39cfc662.entry.js +0 -1
- package/dist/bromcom-ui/p-4263b46d.entry.js +0 -1
- package/dist/bromcom-ui/p-45e28586.entry.js +0 -1
- package/dist/bromcom-ui/p-56179a01.entry.js +0 -1
- package/dist/bromcom-ui/p-59c229e6.entry.js +0 -1
- package/dist/bromcom-ui/p-68ff64de.js +0 -1
- package/dist/bromcom-ui/p-6ba48b4b.entry.js +0 -1
- package/dist/bromcom-ui/p-7aef1f25.entry.js +0 -1
- package/dist/bromcom-ui/p-a8bebdaf.entry.js +0 -1
- package/dist/bromcom-ui/p-b9c0754e.entry.js +0 -1
- package/dist/bromcom-ui/p-d63c2db9.entry.js +0 -1
- package/dist/cjs/bcm-badge.cjs.entry.js +0 -50
- package/dist/cjs/bcm-button.cjs.entry.js +0 -246
- package/dist/cjs/bcm-modal.cjs.entry.js +0 -190
- package/dist/cjs/bcm-tab-pane.cjs.entry.js +0 -51
- package/dist/cjs/bcm-tab.cjs.entry.js +0 -72
- package/dist/cjs/bcm-tabs-content.cjs.entry.js +0 -43
- package/dist/cjs/bcm-tabs.cjs.entry.js +0 -361
- package/dist/cjs/types-f53bc841.js +0 -19
- package/dist/esm/bcm-badge.entry.js +0 -46
- package/dist/esm/bcm-button.entry.js +0 -242
- package/dist/esm/bcm-modal.entry.js +0 -186
- package/dist/esm/bcm-tab-pane.entry.js +0 -47
- package/dist/esm/bcm-tab.entry.js +0 -68
- package/dist/esm/bcm-tabs-content.entry.js +0 -39
- package/dist/esm/bcm-tabs.entry.js +0 -357
- package/dist/esm/types-4b11eac9.js +0 -28
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ce8878ec.js');
|
|
6
|
-
const index$1 = require('./index-2f62bdaf.js');
|
|
7
|
-
|
|
8
|
-
const tabPaneCss = "@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{width:100%;display:block}:host(.hidden){display:none}:host(:not(.active)){height:0 !important;overflow:hidden;padding:0 !important}:host(.active){display:block}";
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* @desc
|
|
12
|
-
* @param str
|
|
13
|
-
*/
|
|
14
|
-
const lowercase = (str) => str.toLowerCase();
|
|
15
|
-
const BcmTabPane = class {
|
|
16
|
-
constructor(hostRef) {
|
|
17
|
-
index.registerInstance(this, hostRef);
|
|
18
|
-
this.size = 'medium';
|
|
19
|
-
this.hidden = false;
|
|
20
|
-
this.fullWidth = false;
|
|
21
|
-
this.tab = (Math.random() * 4).toString(16).replace('.', '');
|
|
22
|
-
this.active = false;
|
|
23
|
-
}
|
|
24
|
-
connectedCallback() { }
|
|
25
|
-
disconnectedCallback() { }
|
|
26
|
-
componentWillLoad() { }
|
|
27
|
-
componentDidLoad() { }
|
|
28
|
-
componentWillRender() { }
|
|
29
|
-
componentDidRender() { }
|
|
30
|
-
componentWillUpdate() { }
|
|
31
|
-
componentDidUpdate() { }
|
|
32
|
-
handleActiveTabPane(e) {
|
|
33
|
-
if (lowercase(e.target.nodeName) === 'bcm-tab') {
|
|
34
|
-
if (e.target.tabId === this.tab) {
|
|
35
|
-
this.active = true;
|
|
36
|
-
}
|
|
37
|
-
else {
|
|
38
|
-
this.active = false;
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
render() {
|
|
43
|
-
const classes = index$1.classnames('tab-pane', this.size);
|
|
44
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.active ? 'active' : null);
|
|
45
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("slot", null))));
|
|
46
|
-
}
|
|
47
|
-
get el() { return index.getElement(this); }
|
|
48
|
-
};
|
|
49
|
-
BcmTabPane.style = tabPaneCss;
|
|
50
|
-
|
|
51
|
-
exports.bcm_tab_pane = BcmTabPane;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ce8878ec.js');
|
|
6
|
-
const index$1 = require('./index-2f62bdaf.js');
|
|
7
|
-
const types = require('./types-f53bc841.js');
|
|
8
|
-
|
|
9
|
-
const tabCss = "@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:block}:host(.hidden){display:none}slot[name=icon-suffix]::slotted(bcm-icon){margin-left:10px}slot[name=icon-prefix]::slotted(bcm-icon){margin-right:10px}.tab{position:relative;display:flex;justify-content:center;align-items:center;padding:var(--bcm-tab-vertical-space) 14px var(--bcm-tab-vertical-space) 14px;color:var(--bcm-color-grey-8);font-size:var(--bcm-tab-font-size);line-height:var(--bcm-tab-line-height);cursor:pointer;user-select:none}.tab.active{color:var(--bcm-color-prime-blue-6)}.tab:hover{color:var(--bcm-color-prime-blue-5)}.tab:active,.tab:focus{color:var(--bcm-color-prime-blue-7)}.tab[disabled],.tab.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}.tab.closable:not(.pane){padding-left:0;padding-right:0}.tab.closable .close{margin-left:34px}.tab.pane{border:1px solid transparent;border-bottom:none;border-color:var(--bcm-color-grey-5);background-color:var(--bcm-color-grey-3);border-radius:2px 2px 0 0}.tab.pane.active{background-color:#ffffff}.badge{padding-left:8px;position:relative}.badge.blink:after{content:\"\";position:absolute;top:8px;left:9px;background:black;border-radius:50%;height:7px;width:7px;box-shadow:0 0 0 0 rgba(0, 0, 0, 0);transform:scale(1)}.badge.success:after{animation:pulsesuccess 2s infinite;background-color:#52C41A}.badge.error:after{animation:pulseerror 2s infinite;background-color:#F5222D}.badge.default:after{animation:pulsedefault 2s infinite;background-color:#D9D9D9}.badge.processing:after{animation:pulseprocessing 2s infinite;background-color:#4293CF}.badge.warning:after{animation:pulsewarning 2s infinite;background-color:#FA8C16}@keyframes pulsesuccess{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(82, 196, 26, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulseerror{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(245, 34, 45, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulsedefault{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(217, 217, 217, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulseprocessing{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(66, 147, 207, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}@keyframes pulsewarning{0%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(250, 140, 22, 0.7)}70%{transform:scale(1);box-shadow:0 0 0 10px rgba(0, 0, 0, 0)}100%{transform:scale(0.95);box-shadow:0 0 0 0 rgba(0, 0, 0, 0)}}";
|
|
10
|
-
|
|
11
|
-
const BcmTab = class {
|
|
12
|
-
constructor(hostRef) {
|
|
13
|
-
index.registerInstance(this, hostRef);
|
|
14
|
-
this.click = index.createEvent(this, "bcm-click", 7);
|
|
15
|
-
this.close = index.createEvent(this, "bcm-close", 7);
|
|
16
|
-
/**
|
|
17
|
-
* Component Properties
|
|
18
|
-
*/
|
|
19
|
-
this.type = types.TypeProps.normal;
|
|
20
|
-
this.active = false;
|
|
21
|
-
this.disabled = false;
|
|
22
|
-
this.closable = false;
|
|
23
|
-
this.tabId = (Math.random() * 4).toString(16).replace('.', '');
|
|
24
|
-
this.formControl = null;
|
|
25
|
-
this.hidden = false;
|
|
26
|
-
this.status = 'default';
|
|
27
|
-
this.badge = false;
|
|
28
|
-
this.blink = false;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* @desc
|
|
32
|
-
*/
|
|
33
|
-
handleClose() {
|
|
34
|
-
if (this.disabled)
|
|
35
|
-
return;
|
|
36
|
-
this.close.emit();
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @desc
|
|
40
|
-
* @param event
|
|
41
|
-
*/
|
|
42
|
-
handleClick(event) {
|
|
43
|
-
if (this.disabled)
|
|
44
|
-
return;
|
|
45
|
-
const targetElement = event.target;
|
|
46
|
-
// Detect close icon clicked
|
|
47
|
-
// #
|
|
48
|
-
if (String(targetElement.tagName).toLowerCase() == 'bcm-icon' && targetElement.classList.contains('close')) {
|
|
49
|
-
this.close.emit(event);
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
this.click.emit(event);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
render() {
|
|
56
|
-
const { active, disabled, closable } = this;
|
|
57
|
-
const classes = index$1.classnames('tab', [this.type], {
|
|
58
|
-
'active': active,
|
|
59
|
-
'disabled': disabled,
|
|
60
|
-
'closable': closable
|
|
61
|
-
});
|
|
62
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
63
|
-
const badgeClasses = index$1.classnames('badge', this.status, {
|
|
64
|
-
'blink': this.blink
|
|
65
|
-
});
|
|
66
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes, onClick: (event) => this.handleClick(event) }, index.h("slot", { name: "icon-prefix" }), index.h("slot", null), index.h("slot", { name: "icon-suffix" }), this.closable && (index.h("bcm-icon", { class: "close", icon: "close", color: "grey-10" })), this.badge && (index.h("bcm-badge", { class: badgeClasses, size: "small", status: this.status })))));
|
|
67
|
-
}
|
|
68
|
-
get el() { return index.getElement(this); }
|
|
69
|
-
};
|
|
70
|
-
BcmTab.style = tabCss;
|
|
71
|
-
|
|
72
|
-
exports.bcm_tab = BcmTab;
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ce8878ec.js');
|
|
6
|
-
const index$1 = require('./index-2f62bdaf.js');
|
|
7
|
-
const utils = require('./utils-23ce0ff6.js');
|
|
8
|
-
const types = require('./types-f53bc841.js');
|
|
9
|
-
|
|
10
|
-
const tabsContentCss = "@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{width:100%;display:block;padding:8px}:host(.pane){border:1px solid transparent;border-top:none;border-color:var(--bcm-color-grey-5);border-radius:0 0 2px 2px}";
|
|
11
|
-
|
|
12
|
-
const BcmTabsContent = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.size = 'medium';
|
|
16
|
-
this.hidden = false;
|
|
17
|
-
this.fullWidth = false;
|
|
18
|
-
this.type = types.TypeProps.normal;
|
|
19
|
-
}
|
|
20
|
-
connectedCallback() { }
|
|
21
|
-
disconnectedCallback() { }
|
|
22
|
-
componentWillLoad() { }
|
|
23
|
-
componentDidLoad() { }
|
|
24
|
-
componentWillRender() { }
|
|
25
|
-
componentDidRender() { }
|
|
26
|
-
componentWillUpdate() { }
|
|
27
|
-
componentDidUpdate() { }
|
|
28
|
-
handleActivePane(e) {
|
|
29
|
-
utils.getChilds(this.el, 'bcm-tab-pane').forEach(items => {
|
|
30
|
-
items.tab == e.detail && (items.active = true);
|
|
31
|
-
items.tab != e.detail && (items.active = false);
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
render() {
|
|
35
|
-
const classes = index$1.classnames('tabs-content', this.size);
|
|
36
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null, this.type);
|
|
37
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes }, index.h("slot", null))));
|
|
38
|
-
}
|
|
39
|
-
get el() { return index.getElement(this); }
|
|
40
|
-
};
|
|
41
|
-
BcmTabsContent.style = tabsContentCss;
|
|
42
|
-
|
|
43
|
-
exports.bcm_tabs_content = BcmTabsContent;
|
|
@@ -1,361 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
-
|
|
5
|
-
const index = require('./index-ce8878ec.js');
|
|
6
|
-
const index$1 = require('./index-2f62bdaf.js');
|
|
7
|
-
const utils = require('./utils-23ce0ff6.js');
|
|
8
|
-
const types = require('./types-f53bc841.js');
|
|
9
|
-
|
|
10
|
-
const tabsCss = "@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:block}:host(.hidden){display:none}::slotted(bcm-tab:not(:last-child)){margin-right:32px}.tabs{position:relative;display:flex;flex-wrap:wrap}.tabs.large{--bcm-tab-vertical-space:16px;--bcm-tab-font-size:16px;--bcm-tab-line-height:24px}.tabs.medium{--bcm-tab-vertical-space:11px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.small{--bcm-tab-vertical-space:7px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.pane{--bcm-tab-vertical-space:9px;--bcm-tab-font-size:14px;--bcm-tab-line-height:22px}.tabs.full-width{width:100%;display:flex;align-items:center;justify-content:center}.tabs.full-width ::slotted(bcm-tab){flex:1}.tabs:before{content:\"\";position:absolute;z-index:1;top:var(--bcm-tabs-line-top);left:var(--bcm-tabs-line-left);right:var(--bcm-tabs-line-right);width:var(--bcm-tabs-line-width);height:var(--bcm-tabs-line-height);background-color:var(--bcm-color-prime-blue-6)}.tabs.underline:after{content:\"\";margin-top:0;z-index:0;left:0;width:100%;height:2px;background-color:var(--bcm-color-grey-4)}.tabs.animatable:before{transition:all 0.4s ease}.tabs.pane ::slotted(bcm-tab:not(:last-child)){margin-right:2px}.tabs.pane:before{display:none}.tabs.vertical{flex-direction:column;width:fit-content}.tabs.vertical:before{content:\"\";position:absolute;top:var(--bcm-tabs-line-top);left:var(--bcm-tabs-line-left);right:var(--bcm-tabs-line-right);width:var(--bcm-tabs-line-width);height:var(--bcm-tabs-line-height);background-color:var(--bcm-color-prime-blue-6)}.tabs.vertical ::slotted(bcm-tab){margin-right:0}";
|
|
11
|
-
|
|
12
|
-
const BcmTabs = class {
|
|
13
|
-
constructor(hostRef) {
|
|
14
|
-
index.registerInstance(this, hostRef);
|
|
15
|
-
this.click = index.createEvent(this, "bcm-click", 7);
|
|
16
|
-
this.change = index.createEvent(this, "bcm-change", 7);
|
|
17
|
-
this.bcmTabsActiveItem = index.createEvent(this, "bcm-tabs-active-item", 7);
|
|
18
|
-
/**
|
|
19
|
-
* Component Private variables
|
|
20
|
-
*/
|
|
21
|
-
this.tabs = [];
|
|
22
|
-
this.firstInit = true;
|
|
23
|
-
this.count = 0;
|
|
24
|
-
/**
|
|
25
|
-
* Component Properties
|
|
26
|
-
*/
|
|
27
|
-
this.size = types.SizeProps.large;
|
|
28
|
-
this.type = types.TypeProps.normal;
|
|
29
|
-
this.direction = types.DirectionProps.horizontal;
|
|
30
|
-
this.hidden = false;
|
|
31
|
-
this.fullWidth = false;
|
|
32
|
-
this.underline = true;
|
|
33
|
-
/**
|
|
34
|
-
* Component States
|
|
35
|
-
*/
|
|
36
|
-
this.activeChild = 1;
|
|
37
|
-
this.lineOpts = { top: '0px', left: '0px', right: '0px', width: '0px', height: '0px' };
|
|
38
|
-
this.prevButton = null;
|
|
39
|
-
this.nextButton = null;
|
|
40
|
-
this.completeButton = null;
|
|
41
|
-
this.prevButtonState = 'disabled';
|
|
42
|
-
this.nextButtonState = 'disabled';
|
|
43
|
-
this.completeButtonState = 'disabled';
|
|
44
|
-
}
|
|
45
|
-
async config(_config) {
|
|
46
|
-
if (_config['prevButton']) {
|
|
47
|
-
if (_config['prevButton']['id']) {
|
|
48
|
-
var prevButtonId = "#" + _config['prevButton']['id'];
|
|
49
|
-
this.prevButton = document.querySelector(prevButtonId);
|
|
50
|
-
}
|
|
51
|
-
if (_config['prevButton']['state']) {
|
|
52
|
-
this.prevButtonState = _config['prevButton']['state'];
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (_config['nextButton']) {
|
|
56
|
-
if (_config['nextButton']['id']) {
|
|
57
|
-
var nextButtonId = "#" + _config['nextButton']['id'];
|
|
58
|
-
this.nextButton = document.querySelector(nextButtonId);
|
|
59
|
-
}
|
|
60
|
-
if (_config['nextButton']['state']) {
|
|
61
|
-
this.nextButtonState = _config['nextButton']['state'];
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
if (_config['completeButton']) {
|
|
65
|
-
if (_config['completeButton']['id']) {
|
|
66
|
-
var completeButtonId = "#" + _config['completeButton']['id'];
|
|
67
|
-
this.completeButton = document.querySelector(completeButtonId);
|
|
68
|
-
}
|
|
69
|
-
if (_config['completeButton']['state']) {
|
|
70
|
-
this.completeButtonState = _config['completeButton']['state'];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
this.buttonControl();
|
|
74
|
-
return true;
|
|
75
|
-
}
|
|
76
|
-
async next() {
|
|
77
|
-
var getFormId = "#" + this.tabs[this.getActive() - 1]["formControl"];
|
|
78
|
-
var getForm = document.querySelector(getFormId);
|
|
79
|
-
var formData = null;
|
|
80
|
-
if (getForm) {
|
|
81
|
-
formData = await getForm.submit();
|
|
82
|
-
}
|
|
83
|
-
if ((getForm && formData.isValid) || !getForm) {
|
|
84
|
-
this.activeChild = this.getActive() + 1;
|
|
85
|
-
this.active(this.tabs[this.getActive() - 1]["tabId"]);
|
|
86
|
-
}
|
|
87
|
-
return formData;
|
|
88
|
-
}
|
|
89
|
-
async prev() {
|
|
90
|
-
this.activeChild = this.getActive() - 1;
|
|
91
|
-
this.active(this.tabs[this.getActive() - 1]["tabId"]);
|
|
92
|
-
return this.activeChild;
|
|
93
|
-
}
|
|
94
|
-
async complete() {
|
|
95
|
-
const tabStatuses = [];
|
|
96
|
-
var isValid = true;
|
|
97
|
-
this.tabs.forEach(element => {
|
|
98
|
-
if (element['formControl']) {
|
|
99
|
-
const getFormId = "#" + element["formControl"];
|
|
100
|
-
const getForm = document.querySelector(getFormId);
|
|
101
|
-
if (getForm) {
|
|
102
|
-
tabStatuses.push(getForm.submit());
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
const allStatuses = await Promise.all(tabStatuses);
|
|
107
|
-
allStatuses.forEach(item => {
|
|
108
|
-
if (item.isValid === false) {
|
|
109
|
-
isValid = false;
|
|
110
|
-
if (item.formName) {
|
|
111
|
-
const formId = this.tabs.filter((input) => input['formControl'] == item.formName)[0]['tabId'];
|
|
112
|
-
this.active(formId);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
});
|
|
116
|
-
return { isValid: isValid, Forms: allStatuses };
|
|
117
|
-
}
|
|
118
|
-
async active(id) {
|
|
119
|
-
var i = 0;
|
|
120
|
-
this.activeChild = -1,
|
|
121
|
-
await utils.delay(100);
|
|
122
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
123
|
-
i++,
|
|
124
|
-
items.tabId == id && (items.disabled = false,
|
|
125
|
-
items.active = true,
|
|
126
|
-
this.bcmTabsActiveItem.emit(items.tabId),
|
|
127
|
-
this.activeChild = i);
|
|
128
|
-
items.tabId != id && (items.active = false);
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
async getActiveTab() {
|
|
132
|
-
return this.tabs[this.getActive() - 1]["tabId"];
|
|
133
|
-
}
|
|
134
|
-
async getActiveIndex() {
|
|
135
|
-
return this.getActive();
|
|
136
|
-
}
|
|
137
|
-
async error(id, blink = false) {
|
|
138
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
139
|
-
items.tabId == id && (items.badge = true,
|
|
140
|
-
items.blink = blink,
|
|
141
|
-
items.status = "error");
|
|
142
|
-
});
|
|
143
|
-
}
|
|
144
|
-
async info(id, blink = false) {
|
|
145
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
146
|
-
items.tabId == id && (items.badge = true,
|
|
147
|
-
items.blink = blink,
|
|
148
|
-
items.status = "processing");
|
|
149
|
-
});
|
|
150
|
-
}
|
|
151
|
-
async warning(id, blink = false) {
|
|
152
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
153
|
-
items.tabId == id && (items.badge = true,
|
|
154
|
-
items.blink = blink,
|
|
155
|
-
items.status = "warning");
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
async success(id, blink = false) {
|
|
159
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
160
|
-
items.tabId == id && (items.badge = true,
|
|
161
|
-
items.blink = blink,
|
|
162
|
-
items.status = "success");
|
|
163
|
-
});
|
|
164
|
-
}
|
|
165
|
-
async statusReset(id) {
|
|
166
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
167
|
-
items.tabId == id && (items.badge = false,
|
|
168
|
-
items.blink = false,
|
|
169
|
-
items.status = "default");
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
buttonControl() {
|
|
173
|
-
if (this.prevButton) {
|
|
174
|
-
if (this.activeChild == 1) {
|
|
175
|
-
this.prevButton.setAttribute(this.prevButtonState, "true");
|
|
176
|
-
}
|
|
177
|
-
else {
|
|
178
|
-
this.prevButton.removeAttribute(this.prevButtonState);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
if (this.nextButton) {
|
|
182
|
-
if (this.getActive() == this.count) {
|
|
183
|
-
this.nextButton.setAttribute(this.nextButtonState, "true");
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
this.nextButton.removeAttribute(this.nextButtonState);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
if (this.completeButton) {
|
|
190
|
-
if (this.getActive() == this.count) {
|
|
191
|
-
this.completeButton.removeAttribute(this.completeButtonState);
|
|
192
|
-
}
|
|
193
|
-
else {
|
|
194
|
-
this.completeButton.setAttribute(this.completeButtonState, "true");
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
/**
|
|
199
|
-
* @ComponentMethod
|
|
200
|
-
*/
|
|
201
|
-
componentDidRender() {
|
|
202
|
-
if (!this.firstInit)
|
|
203
|
-
return;
|
|
204
|
-
let slotElements;
|
|
205
|
-
slotElements = this.el.shadowRoot.querySelector('slot').assignedElements();
|
|
206
|
-
this.tabs = [];
|
|
207
|
-
this.activeChild = this.getActive();
|
|
208
|
-
var isActive = false;
|
|
209
|
-
var firstId = null;
|
|
210
|
-
var i = 0;
|
|
211
|
-
// Get only bcm-tab elements from
|
|
212
|
-
// slot childs
|
|
213
|
-
slotElements.map((element) => {
|
|
214
|
-
i++;
|
|
215
|
-
this.type == "stepper" && (element.disabled = true);
|
|
216
|
-
if (!firstId) {
|
|
217
|
-
firstId = element.tabId;
|
|
218
|
-
}
|
|
219
|
-
if (String(element.tagName).toLowerCase() == 'bcm-tab') {
|
|
220
|
-
element.type = this.type;
|
|
221
|
-
// Activate default tab
|
|
222
|
-
// #
|
|
223
|
-
if (this.tabs.push(element) - 1 == this.activeChild) {
|
|
224
|
-
this.activateChild(this.activeChild);
|
|
225
|
-
isActive = true;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
this.count = i;
|
|
229
|
-
});
|
|
230
|
-
if (!isActive) {
|
|
231
|
-
this.active(firstId);
|
|
232
|
-
}
|
|
233
|
-
setTimeout(() => {
|
|
234
|
-
this.el.shadowRoot.querySelector('.tabs').classList.add('animatable');
|
|
235
|
-
}, 500);
|
|
236
|
-
}
|
|
237
|
-
componentDidLoad() {
|
|
238
|
-
utils.getChilds(this.el, 'bcm-tab').forEach(items => {
|
|
239
|
-
items.active && (this.bcmTabsActiveItem.emit(items.tabId), items.disabled = false);
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
getActive() {
|
|
243
|
-
const childs = utils.getChilds(this.el, 'bcm-tab');
|
|
244
|
-
const childIndex = childs.findIndex(child => child.active);
|
|
245
|
-
return childIndex >= 0 ? childIndex + 1 : 1;
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* @desc
|
|
249
|
-
*/
|
|
250
|
-
getChildIdx(child) {
|
|
251
|
-
let i = 1;
|
|
252
|
-
while (child.previousElementSibling) {
|
|
253
|
-
child = child.previousElementSibling;
|
|
254
|
-
i++;
|
|
255
|
-
}
|
|
256
|
-
return i;
|
|
257
|
-
}
|
|
258
|
-
/**
|
|
259
|
-
* @desc
|
|
260
|
-
* @param idx
|
|
261
|
-
*/
|
|
262
|
-
activateChild(idx) {
|
|
263
|
-
idx = idx - 1;
|
|
264
|
-
const child = this.tabs[idx];
|
|
265
|
-
if (child) {
|
|
266
|
-
this.tabs.forEach((tab) => tab.active = false);
|
|
267
|
-
child.active = true;
|
|
268
|
-
child.disabled = false;
|
|
269
|
-
this.transformLine(idx);
|
|
270
|
-
this.firstInit && index.forceUpdate(this.el);
|
|
271
|
-
this.firstInit = false;
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
/**
|
|
275
|
-
* @desc
|
|
276
|
-
* @param idx
|
|
277
|
-
*/
|
|
278
|
-
transformLine(idx) {
|
|
279
|
-
const tab = this.tabs[idx];
|
|
280
|
-
if (this.direction == 'horizontal') {
|
|
281
|
-
this.lineOpts.top = (tab.offsetTop + tab.offsetHeight) + 'px';
|
|
282
|
-
this.lineOpts.left = tab.offsetLeft + 'px';
|
|
283
|
-
this.lineOpts.width = tab.offsetWidth + 'px';
|
|
284
|
-
this.lineOpts.right = 'unset';
|
|
285
|
-
this.lineOpts.height = '2px';
|
|
286
|
-
}
|
|
287
|
-
else {
|
|
288
|
-
this.lineOpts.top = tab.offsetTop + 'px';
|
|
289
|
-
this.lineOpts.left = 'unset';
|
|
290
|
-
this.lineOpts.right = '0';
|
|
291
|
-
this.lineOpts.width = '2px';
|
|
292
|
-
this.lineOpts.height = tab.offsetHeight + 'px';
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
/**
|
|
296
|
-
* @desc
|
|
297
|
-
*/
|
|
298
|
-
getLineTransform() {
|
|
299
|
-
return {
|
|
300
|
-
'--bcm-tabs-line-top': this.lineOpts.top,
|
|
301
|
-
'--bcm-tabs-line-left': this.lineOpts.left,
|
|
302
|
-
'--bcm-tabs-line-width': this.lineOpts.width,
|
|
303
|
-
'--bcm-tabs-line-right': this.lineOpts.right,
|
|
304
|
-
'--bcm-tabs-line-height': this.lineOpts.height
|
|
305
|
-
};
|
|
306
|
-
}
|
|
307
|
-
/**
|
|
308
|
-
* @desc
|
|
309
|
-
* @param event
|
|
310
|
-
*/
|
|
311
|
-
handleTabClick(event) {
|
|
312
|
-
const targetElement = event.target;
|
|
313
|
-
const childIdx = this.getChildIdx(targetElement);
|
|
314
|
-
this.activeChild = null;
|
|
315
|
-
this.activeChild = childIdx;
|
|
316
|
-
}
|
|
317
|
-
/**
|
|
318
|
-
* @desc
|
|
319
|
-
* @param event
|
|
320
|
-
*/
|
|
321
|
-
handleTabClose(event) {
|
|
322
|
-
const targetElement = event.target;
|
|
323
|
-
const childIdx = this.getChildIdx(targetElement);
|
|
324
|
-
// Remove element
|
|
325
|
-
// #
|
|
326
|
-
targetElement.remove();
|
|
327
|
-
this.tabs.splice(childIdx - 1, 1);
|
|
328
|
-
if (childIdx === this.activeChild) {
|
|
329
|
-
this.activeChild = 1;
|
|
330
|
-
this.activateChild(1);
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
|
-
* @desc
|
|
335
|
-
* @param newValue
|
|
336
|
-
*/
|
|
337
|
-
activeChildChange(newValue) {
|
|
338
|
-
this.activateChild(newValue);
|
|
339
|
-
this.change.emit(newValue);
|
|
340
|
-
this.buttonControl();
|
|
341
|
-
}
|
|
342
|
-
/**
|
|
343
|
-
* @desc
|
|
344
|
-
*/
|
|
345
|
-
windowResize() {
|
|
346
|
-
this.transformLine(this.activeChild - 1);
|
|
347
|
-
index.forceUpdate(this.el);
|
|
348
|
-
}
|
|
349
|
-
render() {
|
|
350
|
-
const classes = index$1.classnames('tabs', [this.direction], [this.size], [this.type], this.fullWidth ? 'full-width' : null, this.underline ? 'underline' : null);
|
|
351
|
-
const hostClasses = index$1.classnames(this.hidden ? 'hidden' : null);
|
|
352
|
-
return (index.h(index.Host, { class: hostClasses }, index.h("div", { class: classes, style: this.getLineTransform(), "on-bcm-click": (event) => this.handleTabClick(event), "on-bcm-close": (event) => this.handleTabClose(event) }, index.h("slot", null))));
|
|
353
|
-
}
|
|
354
|
-
get el() { return index.getElement(this); }
|
|
355
|
-
static get watchers() { return {
|
|
356
|
-
"activeChild": ["activeChildChange"]
|
|
357
|
-
}; }
|
|
358
|
-
};
|
|
359
|
-
BcmTabs.style = tabsCss;
|
|
360
|
-
|
|
361
|
-
exports.bcm_tabs = BcmTabs;
|