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,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, H as Host, g as getElement, a as getAssetPath, c as createEvent } from './index-8fe7aea4.js';
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
-
import { g as getChilds } from './utils-
|
|
3
|
+
import { g as getChilds } from './utils-24f85563.js';
|
|
4
4
|
|
|
5
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 .icon-checked{display:none}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}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
|
|
|
@@ -221,6 +221,7 @@ const BcmListbox = class {
|
|
|
221
221
|
async resetCaption() {
|
|
222
222
|
this.caption = this.captionCache;
|
|
223
223
|
this.captionType = this.captionTypeCache;
|
|
224
|
+
this.captionError = null;
|
|
224
225
|
}
|
|
225
226
|
connectedCallback() {
|
|
226
227
|
this.captionCache = this.caption;
|
|
@@ -257,7 +258,9 @@ const BcmListbox = class {
|
|
|
257
258
|
if (this.treeview) {
|
|
258
259
|
await customElements.whenDefined("bcm-treeview");
|
|
259
260
|
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
260
|
-
|
|
261
|
+
if (bcmTreeview) {
|
|
262
|
+
await bcmTreeview.selected(id);
|
|
263
|
+
}
|
|
261
264
|
}
|
|
262
265
|
}, 100);
|
|
263
266
|
}
|
|
@@ -311,13 +314,15 @@ const BcmListbox = class {
|
|
|
311
314
|
: this.treeview = false;
|
|
312
315
|
}
|
|
313
316
|
setTimeout(async () => {
|
|
314
|
-
if (this.treeview) {
|
|
317
|
+
if (this.treeview === true) {
|
|
315
318
|
await customElements.whenDefined("bcm-treeview");
|
|
316
319
|
const bcmTreeview = this.el.shadowRoot.querySelector("bcm-treeview");
|
|
317
|
-
|
|
318
|
-
|
|
320
|
+
if (bcmTreeview) {
|
|
321
|
+
await bcmTreeview.config(_config);
|
|
322
|
+
await bcmTreeview.selected(this.selectedId);
|
|
323
|
+
}
|
|
319
324
|
}
|
|
320
|
-
},
|
|
325
|
+
}, 300);
|
|
321
326
|
if (_config['searchFields']) {
|
|
322
327
|
if (Array.isArray(_config['searchFields'])) {
|
|
323
328
|
this.searchFields = _config['searchFields'];
|
|
@@ -634,7 +639,10 @@ const BcmListbox = class {
|
|
|
634
639
|
* @param item
|
|
635
640
|
*/
|
|
636
641
|
itemRenderer(item) {
|
|
637
|
-
if (item.
|
|
642
|
+
if (item[this.objectMapping['id']] && String(this.selectedId) == String(item[this.objectMapping['id']])) {
|
|
643
|
+
this.listboxItemSelected.emit(item);
|
|
644
|
+
}
|
|
645
|
+
if (item[this.objectMapping['selected']] && item[this.objectMapping['selected']] === true) {
|
|
638
646
|
this.listboxItemSelected.emit(item);
|
|
639
647
|
}
|
|
640
648
|
// var checkedListCache = this.checkedList;
|
|
@@ -654,11 +662,8 @@ const BcmListbox = class {
|
|
|
654
662
|
// this.listboxChecked.emit(item[this.objectMapping['id']])
|
|
655
663
|
// }
|
|
656
664
|
// }
|
|
657
|
-
|
|
658
|
-
this.
|
|
659
|
-
}
|
|
660
|
-
return (h("bcm-listbox-item", Object.assign({ _internal_id: this._internal_id, id: item[this.objectMapping['id']], text: item[this.objectMapping['text']] }, (item[this.objectMapping['icon']] && { icon: item[this.objectMapping['icon']] }), (item[this.objectMapping['avatar']] && { avatar: item[this.objectMapping['avatar']] }), (item[this.objectMapping['avatarName']] && { avatarName: item[this.objectMapping['avatarName']] }), (item[this.objectMapping['avatarImage']] && { avatarImage: item[this.objectMapping['avatarImage']] }), (item[this.objectMapping['secondaryText']] && { secondaryText: item[this.objectMapping['secondaryText']] }), (item[this.objectMapping['tooltipText']] && { tooltipText: item[this.objectMapping['tooltipText']] }), (item[this.objectMapping['checked']] && { checked: item[this.objectMapping['checked']] }), (item[this.objectMapping['disabled']] && { disabled: true }), (item[this.objectMapping['selected']] && this.checkboxes == false && { selected: item[this.objectMapping['selected']] }), (this.template && { template: this.template }), (this.checkboxes && { checkboxes: true }), (this.size && { size: this.size }), { itemObject: item, objectMapping: this.objectMapping }, (this.checkedList && this.checkedList.find(e => e == item[this.objectMapping['id']])) && { checked: true }, (this.updateCheckedList.length > 0 &&
|
|
661
|
-
((this.updateCheckedList.find(e => e == item[this.objectMapping['id']])) ? { checked: true } : { checked: false })))));
|
|
665
|
+
return (h("bcm-listbox-item", Object.assign({ _internal_id: this._internal_id, id: item[this.objectMapping['id']], text: item[this.objectMapping['text']] }, (item[this.objectMapping['icon']] && { icon: item[this.objectMapping['icon']] }), (item[this.objectMapping['avatar']] && { avatar: item[this.objectMapping['avatar']] }), (item[this.objectMapping['avatarName']] && { avatarName: item[this.objectMapping['avatarName']] }), (item[this.objectMapping['avatarImage']] && { avatarImage: item[this.objectMapping['avatarImage']] }), (item[this.objectMapping['secondaryText']] && { secondaryText: item[this.objectMapping['secondaryText']] }), (item[this.objectMapping['tooltipText']] && { tooltipText: item[this.objectMapping['tooltipText']] }), (item[this.objectMapping['checked']] === true && { checked: item[this.objectMapping['checked']] }), (item[this.objectMapping['disabled']] === true && { disabled: true }), (item[this.objectMapping['selected']] === true && this.checkboxes == false && { selected: item[this.objectMapping['selected']] }), (this.template && { template: this.template }), (this.checkboxes && { checkboxes: true }), (this.size && { size: this.size }), { itemObject: item, objectMapping: this.objectMapping }, (this.checkedList && this.checkedList.find(e => e === item[this.objectMapping['id']])) && { checked: true }, (this.updateCheckedList.length > 0 &&
|
|
666
|
+
((this.updateCheckedList.find(e => e === item[this.objectMapping['id']])) ? { checked: true } : { checked: false })))));
|
|
662
667
|
}
|
|
663
668
|
/**
|
|
664
669
|
* @desc
|
|
@@ -907,7 +912,7 @@ const BcmListbox = class {
|
|
|
907
912
|
this.onFocus = focusEvent;
|
|
908
913
|
}
|
|
909
914
|
render() {
|
|
910
|
-
const { innerComponent, label, required, treeview, searchText, checkboxes, search, size, fullWidth, total, indeterminateState, checked, checklist, searchData, searchFields, _flex, returnField, searchSub, infoFooter, showSearch, noCaption, caption, captionType } = this;
|
|
915
|
+
const { innerComponent, label, required, treeview, searchText, checkboxes, search, size, fullWidth, total, indeterminateState, checked, checklist, searchData, searchFields, _flex, returnField, searchSub, infoFooter, showSearch, noCaption, caption, captionError, captionType } = this;
|
|
911
916
|
const bcmListbox = classnames('bcm-listbox', {
|
|
912
917
|
'error': captionType == 'error' ? true : false,
|
|
913
918
|
'full-width': fullWidth,
|
|
@@ -960,7 +965,9 @@ const BcmListbox = class {
|
|
|
960
965
|
// ( this.empty || total == 0 ) && (
|
|
961
966
|
h("div", { id: "empty", class: "empty" }, h("bcm-empty", { size: "small", text: "No Data" }))
|
|
962
967
|
// )
|
|
963
|
-
), infoFooter == true && (h("div", { class: "bcm-listbox-footer" }, h("bcm-text", { scale: "size-1", color: "grey-8" }, checklist.length > 0 && (' ( ' + checklist.length + ' selected ) '), "Total ", h("span", { id: "in-search" }), " ", h("span", { id: "in-total" }, total), " items found."))))), !noCaption && (h("div", { class: "caption-area" },
|
|
968
|
+
), infoFooter == true && (h("div", { class: "bcm-listbox-footer" }, h("bcm-text", { scale: "size-1", color: "grey-8" }, checklist.length > 0 && (' ( ' + checklist.length + ' selected ) '), "Total ", h("span", { id: "in-search" }), " ", h("span", { id: "in-total" }, total), " items found."))))), !noCaption && (h("div", { class: "caption-area" }, captionType == "error"
|
|
969
|
+
? h("span", { class: captionClasses }, " ", captionError, " ")
|
|
970
|
+
: caption && h("span", { class: captionClasses }, " ", caption, " ")))));
|
|
964
971
|
}
|
|
965
972
|
get el() { return getElement(this); }
|
|
966
973
|
static get watchers() { return {
|
|
@@ -1039,10 +1046,10 @@ const BcmListboxItem = class {
|
|
|
1039
1046
|
}
|
|
1040
1047
|
componentDidLoad() {
|
|
1041
1048
|
if (!this.disabled) {
|
|
1042
|
-
if (this.selected
|
|
1049
|
+
if (this.selected === true) {
|
|
1043
1050
|
this.listboxItemSelected.emit(this.itemObject);
|
|
1044
1051
|
}
|
|
1045
|
-
this.checkboxes && (this.checked
|
|
1052
|
+
this.checkboxes && (this.checked === true && (this.listboxChecked.emit(this._id)));
|
|
1046
1053
|
}
|
|
1047
1054
|
}
|
|
1048
1055
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } 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 } from './utils-
|
|
4
|
+
import { e as extractColor } from './utils-24f85563.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* 'color' prop predefined values
|
|
@@ -101,7 +101,7 @@ const BcmCheckbox = class {
|
|
|
101
101
|
};
|
|
102
102
|
}
|
|
103
103
|
render() {
|
|
104
|
-
const { disabled, checked, readOnly, name, handleChange, required, caption, captionType, noCaption, buttonStyle, size, optionType } = this;
|
|
104
|
+
const { disabled, checked, readOnly, name, handleChange, required, caption, captionError, captionType, noCaption, buttonStyle, size, optionType } = this;
|
|
105
105
|
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
106
106
|
'error': captionType == 'error' ? true : false
|
|
107
107
|
});
|
|
@@ -115,7 +115,9 @@ const BcmCheckbox = class {
|
|
|
115
115
|
});
|
|
116
116
|
var fontColor = extractColor(ColorPalette, ColorProps[this.color] + '-6');
|
|
117
117
|
var style = "<style>.radio-button:not(.checked):hover{color: " + fontColor + "} </style>";
|
|
118
|
-
return (h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly, onChange: handleChange, ref: el => (this.inputElement = el) }), optionType == 'button' && (h("span", { innerHTML: style })), h("label", { title: optionType == 'button' ? this.el.innerHTML : null, htmlFor: name, class: optionType == 'default' ? defaultClasses : buttonClasses, style: this.getColor(this.color) }, h("span", { class: "icon" }, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), h("span", { class: "slot" }, h("slot", null))), !noCaption && (h("div", { class: "caption-area" },
|
|
118
|
+
return (h(Host, { class: hostClasses, onFocus: () => this.handleFocus(), onBlur: () => this.handleBlur() }, h("input", { id: name, type: "checkbox", checked: checked, disabled: disabled, required: required, readOnly: readOnly, onChange: handleChange, ref: el => (this.inputElement = el) }), optionType == 'button' && (h("span", { innerHTML: style })), h("label", { title: optionType == 'button' ? this.el.innerHTML : null, htmlFor: name, class: optionType == 'default' ? defaultClasses : buttonClasses, style: this.getColor(this.color) }, h("span", { class: "icon" }, h("bcm-icon", { class: "icon-checked", icon: "component-check", size: "small", type: "default" })), h("span", { class: "slot" }, h("slot", null))), !noCaption && (h("div", { class: "caption-area" }, captionType == "error"
|
|
119
|
+
? h("span", { class: captionClasses }, " ", captionError, " ")
|
|
120
|
+
: caption && h("span", { class: captionClasses }, " ", caption, " ")))));
|
|
119
121
|
}
|
|
120
122
|
get el() { return getElement(this); }
|
|
121
123
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, a as getAssetPath, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
-
import './utils-
|
|
4
|
-
import { E as ElementDragger, D as DragDirections } from './element-dragger-
|
|
3
|
+
import './utils-24f85563.js';
|
|
4
|
+
import { E as ElementDragger, D as DragDirections } from './element-dragger-9c68536d.js';
|
|
5
5
|
|
|
6
6
|
const colorpickerCss = "@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{position:relative;margin:0 0 8px 0}.color-picker{position:relative;width:200px}.color-picker.open .picker{opacity:1;visibility:visible;transform:scale(1) translateY(56px)}.picker{width:300px;position:absolute;top:0;z-index:1;background-color:#ffffff;border:1px solid #F6F6F6;box-shadow:0px 3px 3.6px 0.4px rgba(0, 0, 0, 0.15);opacity:0;visibility:hidden;transition:transform 0.2s ease, opacity 0.3s ease;transform:scale(0.8) translateY(-100px)}.label{display:flex;flex-direction:column;color:var(--bcm-color-grey-9);margin-bottom:4px}.caption-area{min-height:20px}.input-caption{display:block}.input{display:flex;cursor:pointer;border:1px solid var(--bcm-color-grey-5);border-radius:2px}.color{position:relative;width:100%;height:166px;user-select:none}.color img{width:100%;height:100%;user-select:none;pointer-events:none}.color-indicator{position:absolute;top:0;left:0;width:17px;height:17px;border:1px solid rgba(255, 255, 255, 0.82);box-shadow:0px 1px 2px rgba(0, 0, 0, 0.25);transform:translate(0, 0);border-radius:100%;user-select:none;box-sizing:border-box;pointer-events:none}.colors{position:relative;width:100%;height:16px;margin-top:8px}.colors img{width:100%;user-select:none;pointer-events:none}.colors-holder{position:absolute;top:50%;left:0;width:100%;height:8px;overflow:hidden;transform:translateY(-50%);border-radius:8px;user-select:none}.colors-indicator{position:absolute;top:50%;left:0;width:17px;height:17px;border:2px solid rgba(255, 255, 255, 0.82);box-shadow:0px 1px 4px rgba(0, 0, 0, 0.25);transform:translateY(-50%);border-radius:100%;user-select:none;box-sizing:border-box;pointer-events:none}.transparency{position:relative;width:100%;height:16px;margin-top:8px}.transparency-holder{position:absolute;top:50%;left:0;width:100%;height:8px;overflow:hidden;transform:translateY(-50%);border-radius:8px;background:transparent none repeat center center/20px}.transparency-indicator{position:absolute;top:50%;left:0;width:17px;height:17px;border:2px solid rgba(255, 255, 255, 0.82);box-shadow:0px 1px 4px rgba(0, 0, 0, 0.25);transform:translateY(-50%);border-radius:100%;user-select:none;box-sizing:border-box}.colors-transparency{padding:16px}.active-color{display:flex;align-items:center;width:100%;height:30px}.active-color .color-thumb{width:100%;height:100%;background-color:transparent;border-radius:1px 0 0 1px}.active-color .color-text{font-size:14px;color:#656565;margin-left:8px}.icon{display:flex;align-items:center;justify-content:center;cursor:pointer;width:30px;color:var(--bcm-color-grey-6)}.color-input{border:none;width:100%;padding:10px;outline:none;-webkit-tap-highlight-color:transparent}";
|
|
7
7
|
|
|
@@ -389,12 +389,14 @@ const BcmColorPicker = class {
|
|
|
389
389
|
this._setColor(color);
|
|
390
390
|
}
|
|
391
391
|
render() {
|
|
392
|
-
const { label, required, noCaption, caption, captionType } = this;
|
|
392
|
+
const { label, required, noCaption, caption, captionError, captionType } = this;
|
|
393
393
|
const classes = classnames('color-picker', {
|
|
394
394
|
open: this.open
|
|
395
395
|
});
|
|
396
396
|
const captionClasses = classnames('size-1', 'input-caption', 'caption-' + captionType);
|
|
397
|
-
return (h(Host, null, h("div", { class: classes, onClick: () => this.handleClick() }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), h("div", { class: "input" }, h("div", { class: "active-color" }, h("div", { class: "color-thumb", style: { backgroundColor: this.value } })), h("span", { class: "icon", slot: "suffix" }, h("bcm-icon", { icon: "bg-colors" }))), !noCaption && (h("div", { class: "caption-area" },
|
|
397
|
+
return (h(Host, null, h("div", { class: classes, onClick: () => this.handleClick() }, label && h("label", { class: "label size-1" }, " ", label, " ", required && ('*'), " "), h("div", { class: "input" }, h("div", { class: "active-color" }, h("div", { class: "color-thumb", style: { backgroundColor: this.value } })), h("span", { class: "icon", slot: "suffix" }, h("bcm-icon", { icon: "bg-colors" }))), !noCaption && (h("div", { class: "caption-area" }, captionType == "error"
|
|
398
|
+
? h("span", { class: captionClasses }, " ", captionError, " ")
|
|
399
|
+
: caption && h("span", { class: captionClasses }, " ", caption, " "))), h("div", { class: "picker" }, h("div", { class: "input" }, h("input", { type: "text", class: "color-input", maxlength: "7", ref: el => (this.inputElement = el), onKeyUp: (e) => this.handleColorInputKeyUp(e) })), h("div", { class: "color", onMouseDown: () => this.mouseState = 'down', style: { backgroundColor: this.hsvtorgb({ h: this.h, s: this.s, v: this.v }).hex }, ref: el => (this.colorElement = el) }, h("img", { src: getAssetPath('./static/color.svg') }), h("div", { class: "color-indicator", ref: el => (this.colorIndicatorElement = el) })), h("div", { class: "colors-transparency" }, h("div", { class: "colors", onMouseDown: () => this.mouseState = 'down', ref: el => (this.colorsElement = el) }, h("div", { class: "colors-holder" }, h("img", { src: getAssetPath('./static/colors.svg') })), h("div", { class: "colors-indicator", ref: el => (this.colorsIndicatorElement = el) })))))));
|
|
398
400
|
}
|
|
399
401
|
static get assetsDirs() { return ["static"]; }
|
|
400
402
|
get el() { return getElement(this); }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
-
import {
|
|
4
|
-
import { D as DragDirections, E as ElementDragger } from './element-dragger-
|
|
3
|
+
import { d as delay } from './utils-24f85563.js';
|
|
4
|
+
import { D as DragDirections, E as ElementDragger } from './element-dragger-9c68536d.js';
|
|
5
5
|
import { p as popoverPlacement, a as popoverBoxPlacement } from './popover-placement-a4ab1587.js';
|
|
6
6
|
|
|
7
7
|
var Months;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
2
|
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
-
import { g as getChilds } from './utils-
|
|
3
|
+
import { g as getChilds } from './utils-24f85563.js';
|
|
4
4
|
|
|
5
5
|
const dropdownCss = "@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;width:fit-content}:host(.hidden){display:none}*{box-sizing:border-box}::-webkit-details-marker{display:none}summary{display:inline-block}.items-container{--group-shadow:0px 4px 4px rgba(0, 0, 0, 0.25)}details{position:relative}.items-container{min-width:150px;transition:height 0.3s ease;position:absolute;left:0;transition:height 0.3s ease;background-color:#ffffff;border-radius:2px;box-shadow:var(--group-shadow);z-index:10000}";
|
|
6
6
|
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
|
+
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
+
|
|
4
|
+
const listItemCss = "@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}.list-item{padding:8px;color:var(--bcm-color-grey-8);background-color:var(--bcm-color-grey-1);cursor:pointer}.list-item.disabled{color:var(--bcm-color-grey-6);cursor:not-allowed}.list-item.selected{color:var(--bcm-color-prime-blue-6)}.list-item.selected:hover:not(.disabled){color:var(--bcm-color-prime-blue-6)}.list-item:hover:not(.disabled),.list-item:active:not(.disabled){color:var(--bcm-color-prime-blue-6)}";
|
|
5
|
+
|
|
6
|
+
const BcmListItem = class {
|
|
7
|
+
constructor(hostRef) {
|
|
8
|
+
registerInstance(this, hostRef);
|
|
9
|
+
this.listSelected = createEvent(this, "bcm-list-selected", 7);
|
|
10
|
+
this.size = 'medium';
|
|
11
|
+
this.hidden = false;
|
|
12
|
+
this.disabled = false;
|
|
13
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
14
|
+
this.template = null;
|
|
15
|
+
this._uniq_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
16
|
+
this._id = (Math.random() * 4).toString(16).replace('.', '');
|
|
17
|
+
this.itemObject = null;
|
|
18
|
+
this.selected = false;
|
|
19
|
+
}
|
|
20
|
+
connectedCallback() { }
|
|
21
|
+
disconnectedCallback() { }
|
|
22
|
+
componentWillLoad() { }
|
|
23
|
+
componentDidLoad() { }
|
|
24
|
+
componentWillRender() { }
|
|
25
|
+
componentDidRender() { }
|
|
26
|
+
componentWillUpdate() { }
|
|
27
|
+
componentDidUpdate() { }
|
|
28
|
+
async select() {
|
|
29
|
+
if (!this.disabled) {
|
|
30
|
+
if (this.itemObject) {
|
|
31
|
+
this.listSelected.emit(this.itemObject);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
this.listSelected.emit(this._id);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @desc
|
|
40
|
+
*/
|
|
41
|
+
handleClick() {
|
|
42
|
+
if (!this.disabled) {
|
|
43
|
+
if (this.itemObject) {
|
|
44
|
+
this.listSelected.emit(this.itemObject);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
this.listSelected.emit(this._id);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
render() {
|
|
52
|
+
const { size, disabled, selected, hidden } = this;
|
|
53
|
+
const classes = classnames('list-item', size, {
|
|
54
|
+
'disabled': disabled,
|
|
55
|
+
'selected': selected,
|
|
56
|
+
'size-2': size === 'small' || size === 'medium',
|
|
57
|
+
'size-3': size === 'large',
|
|
58
|
+
});
|
|
59
|
+
const hostClasses = classnames(hidden ? 'hidden' : null);
|
|
60
|
+
return (h(Host, { class: hostClasses, onClick: () => this.handleClick() }, h("div", { class: classes }, this.text ? this.text : h("slot", null))));
|
|
61
|
+
}
|
|
62
|
+
get el() { return getElement(this); }
|
|
63
|
+
};
|
|
64
|
+
BcmListItem.style = listItemCss;
|
|
65
|
+
|
|
66
|
+
export { BcmListItem as bcm_list_item };
|
|
@@ -0,0 +1,272 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-8fe7aea4.js';
|
|
2
|
+
import { c as classnames } from './index-e58a2d48.js';
|
|
3
|
+
import { g as getChilds, b as dropInComponent } from './utils-24f85563.js';
|
|
4
|
+
|
|
5
|
+
const listCss = "@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;opacity:0;width:256px;height:256px;background-color:#ffffff;overflow-y:auto;padding:4px;border:1px solid #D9D9D9;box-shadow:0px 2px 8px rgba(0, 0, 0, 0.15);box-sizing:border-box;transition:height 1s ease 1s;z-index:-999;position:absolute;top:-10000;left:-10000}:host(.full-width){width:100%}:host(.flex){width:100%;height:100%}:host(.show){opacity:1;z-index:100000}.spinner{position:absolute;top:0;left:0;width:100%;height:100%;display:none;align-items:center;justify-content:center;background-color:#ffffff}.spinner.show{display:flex}";
|
|
6
|
+
|
|
7
|
+
const BcmList = class {
|
|
8
|
+
constructor(hostRef) {
|
|
9
|
+
registerInstance(this, hostRef);
|
|
10
|
+
this.listSelected = createEvent(this, "bcm-list-selected", 7);
|
|
11
|
+
this.isRendered = false;
|
|
12
|
+
this.linkedElementWidth = "100%";
|
|
13
|
+
this.bodyStyleOverflow = '';
|
|
14
|
+
this.objectMapping = {
|
|
15
|
+
'id': "id",
|
|
16
|
+
'text': "text",
|
|
17
|
+
'selected': "selected",
|
|
18
|
+
};
|
|
19
|
+
this.size = 'medium';
|
|
20
|
+
this.hidden = false;
|
|
21
|
+
this.fullWidth = false;
|
|
22
|
+
this.flex = false;
|
|
23
|
+
this.items = [];
|
|
24
|
+
this.isShow = true;
|
|
25
|
+
this.linkedComponent = null;
|
|
26
|
+
this._internal_id = (Math.random() * 4).toString(16).replace('.', '');
|
|
27
|
+
this.value = null;
|
|
28
|
+
this.width = "100%";
|
|
29
|
+
this.height = "256px";
|
|
30
|
+
this.minWidth = null;
|
|
31
|
+
this.maxWidth = null;
|
|
32
|
+
this.configured = false;
|
|
33
|
+
}
|
|
34
|
+
connectedCallback() {
|
|
35
|
+
this.bodyStyleOverflow = document.querySelector("body").style.overflow;
|
|
36
|
+
if (this.linkedComponent) {
|
|
37
|
+
this.isShow = false;
|
|
38
|
+
this.handleLinkedComponent();
|
|
39
|
+
}
|
|
40
|
+
const slot = this.el.shadowRoot.querySelectorAll('bcm-list-item');
|
|
41
|
+
if (slot) {
|
|
42
|
+
slot.forEach(el => {
|
|
43
|
+
if (String(el.tagName).toLowerCase() === 'bcm-list-item') {
|
|
44
|
+
el.setAttribute("_internal_id", this._internal_id);
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
disconnectedCallback() { }
|
|
50
|
+
componentWillLoad() { }
|
|
51
|
+
componentDidLoad() { }
|
|
52
|
+
componentWillRender() { }
|
|
53
|
+
componentDidRender() { }
|
|
54
|
+
componentWillUpdate() { }
|
|
55
|
+
componentDidUpdate() { }
|
|
56
|
+
/**
|
|
57
|
+
* @desc
|
|
58
|
+
*/
|
|
59
|
+
async hide() {
|
|
60
|
+
this.isShow = false;
|
|
61
|
+
document.querySelector("body").style.overflow = this.bodyStyleOverflow;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* @desc
|
|
65
|
+
*/
|
|
66
|
+
async show() {
|
|
67
|
+
this.isShow = true;
|
|
68
|
+
if (this.items && !this.isRendered) {
|
|
69
|
+
this.isRendered = true;
|
|
70
|
+
this.processData(this.items);
|
|
71
|
+
}
|
|
72
|
+
this.handleLinkedComponent();
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* @desc
|
|
76
|
+
*/
|
|
77
|
+
async toggle() {
|
|
78
|
+
this.isShow = !this.isShow;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @desc
|
|
82
|
+
*/
|
|
83
|
+
async config(_config) {
|
|
84
|
+
if (_config['linkedComponent']) {
|
|
85
|
+
typeof _config['linkedComponent'] == 'string'
|
|
86
|
+
? this.linkedComponent = _config['linkedComponent']
|
|
87
|
+
: this.linkedComponent = null;
|
|
88
|
+
}
|
|
89
|
+
if (_config['mapping']) {
|
|
90
|
+
if (_config['mapping']['id']) {
|
|
91
|
+
this.objectMapping['id'] = _config['mapping']['id'];
|
|
92
|
+
}
|
|
93
|
+
if (_config['mapping']['text']) {
|
|
94
|
+
this.objectMapping['text'] = _config['mapping']['text'];
|
|
95
|
+
}
|
|
96
|
+
if (_config['mapping']['selected']) {
|
|
97
|
+
this.objectMapping['selected'] = _config['mapping']['selected'];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
this.configured = true;
|
|
101
|
+
return _config;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* @desc
|
|
105
|
+
*/
|
|
106
|
+
async setData(_data = []) {
|
|
107
|
+
if (_data) {
|
|
108
|
+
typeof _data == 'string'
|
|
109
|
+
? this.items = JSON.parse(_data)
|
|
110
|
+
: this.items = _data;
|
|
111
|
+
this.isRendered = false;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
processData(_data) {
|
|
115
|
+
this.handleLoading(true);
|
|
116
|
+
const list = this.el.shadowRoot.querySelector('.list');
|
|
117
|
+
list.innerHTML = "";
|
|
118
|
+
this.selectedId = null;
|
|
119
|
+
this.value = null;
|
|
120
|
+
if (_data.length > 0) {
|
|
121
|
+
_data.forEach((item, index) => {
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
const element = document.createElement("bcm-list-item");
|
|
124
|
+
element.setAttribute("_internal_id", this._internal_id);
|
|
125
|
+
element.setAttribute("text", item[this.objectMapping['text']]);
|
|
126
|
+
element.setAttribute("id", item[this.objectMapping['id']]);
|
|
127
|
+
if (item[this.objectMapping['selected']]) {
|
|
128
|
+
element.select();
|
|
129
|
+
}
|
|
130
|
+
element.itemObject = item;
|
|
131
|
+
list.appendChild(element);
|
|
132
|
+
if (_data.length == index + 1) {
|
|
133
|
+
this.handleLoading(false);
|
|
134
|
+
}
|
|
135
|
+
}, 100);
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
else {
|
|
139
|
+
this.handleLoading(false);
|
|
140
|
+
// console.log("no data")
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
handleLoading(show = false) {
|
|
144
|
+
const spinner = this.el.shadowRoot.querySelector('.spinner');
|
|
145
|
+
if (show == true) {
|
|
146
|
+
spinner.classList.add("show");
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
spinner.classList.remove("show");
|
|
150
|
+
}
|
|
151
|
+
this.handleLinkedComponent();
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* @desc
|
|
155
|
+
*/
|
|
156
|
+
handleClick(event) {
|
|
157
|
+
if (!this.el.contains(event.target)
|
|
158
|
+
|| (event["path"]
|
|
159
|
+
&& event["path"].filter((input) => input['_internal_id'] == this._internal_id)[0]
|
|
160
|
+
&& event["path"].filter((input) => input['nodeName'] == "BCM-LIST-ITEM")[0])) {
|
|
161
|
+
if (this.isShow) {
|
|
162
|
+
this.hide();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
scrollEvent(event) {
|
|
167
|
+
if (!this.el.contains(event.target)) {
|
|
168
|
+
if (this.isShow) {
|
|
169
|
+
this.hide();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
onmousemove(e) {
|
|
174
|
+
if (this.el.contains(e.target)) {
|
|
175
|
+
if (document.querySelector("body").style.overflow != "hidden") {
|
|
176
|
+
document.querySelector("body").style.overflow = "hidden";
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
if (document.querySelector("body").style.overflow != this.bodyStyleOverflow) {
|
|
181
|
+
document.querySelector("body").style.overflow = this.bodyStyleOverflow;
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* @descc
|
|
187
|
+
* @param event
|
|
188
|
+
*/
|
|
189
|
+
handleListboxClearSelecteds(event) {
|
|
190
|
+
if (this.isInternal(event) || (!this.isInternal(event) && this.isInternalSlot(event))) {
|
|
191
|
+
var selectedItem = null;
|
|
192
|
+
if (selectedItem = getChilds(this.el, "bcm-list-item").find(x => x.id === this.selectedId)) {
|
|
193
|
+
selectedItem.selected = false;
|
|
194
|
+
}
|
|
195
|
+
if (selectedItem = this.el.shadowRoot.getElementById(this.getItemId(event))) {
|
|
196
|
+
this.selectedId = this.getItemId(event);
|
|
197
|
+
selectedItem.selected = true;
|
|
198
|
+
}
|
|
199
|
+
if (this.isInternalSlot(event)) {
|
|
200
|
+
if (selectedItem = event.path[0]) {
|
|
201
|
+
this.selectedId = event.path[0].id;
|
|
202
|
+
selectedItem.selected = true;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @desc
|
|
209
|
+
*/
|
|
210
|
+
getItemId(event) {
|
|
211
|
+
const detect = event.path
|
|
212
|
+
&& event.path[0]
|
|
213
|
+
&& event.path[0].attributes
|
|
214
|
+
&& event.path[0].attributes['id']
|
|
215
|
+
&& event.path[0].attributes['id'].value;
|
|
216
|
+
return detect;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* @desc
|
|
220
|
+
*/
|
|
221
|
+
isInternalSlot(event) {
|
|
222
|
+
const detect = event.path
|
|
223
|
+
&& event.path[0]
|
|
224
|
+
&& String(event.path[0].tagName).toLowerCase() === 'bcm-list-item'
|
|
225
|
+
&& this.el.contains(event.path[0]);
|
|
226
|
+
return detect;
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* @desc
|
|
230
|
+
*/
|
|
231
|
+
isInternal(event) {
|
|
232
|
+
const detect = event.path
|
|
233
|
+
&& event.path[0]
|
|
234
|
+
&& event.path[0].attributes
|
|
235
|
+
&& event.path[0].attributes['_internal_id']
|
|
236
|
+
&& event.path[0].attributes['_internal_id'].value;
|
|
237
|
+
return detect == this._internal_id;
|
|
238
|
+
}
|
|
239
|
+
/**
|
|
240
|
+
* @desc
|
|
241
|
+
*/
|
|
242
|
+
handleLinkedComponent() {
|
|
243
|
+
dropInComponent(this.el, "#" + this.linkedComponent);
|
|
244
|
+
var element = null;
|
|
245
|
+
if (this.width == "100%" && (element = document.querySelector("#" + this.linkedComponent))) {
|
|
246
|
+
this.linkedElementWidth = element.clientWidth + "px";
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
render() {
|
|
250
|
+
const classes = classnames('list-container', this.size);
|
|
251
|
+
const hostClasses = classnames(this.hidden ? 'hidden' : null, {
|
|
252
|
+
'show': this.isShow,
|
|
253
|
+
'full-width': this.fullWidth
|
|
254
|
+
});
|
|
255
|
+
// const customStyle = {
|
|
256
|
+
// 'width': this.width
|
|
257
|
+
// }
|
|
258
|
+
var customStyle = {
|
|
259
|
+
'height': "auto",
|
|
260
|
+
'max-height': this.height,
|
|
261
|
+
'width': this.minWidth != null || this.maxWidth != null ? 'max-content' :
|
|
262
|
+
this.width != "100%" ? this.width : this.linkedElementWidth,
|
|
263
|
+
'min-width': this.minWidth != null ? this.minWidth == "100%" || this.minWidth == "auto" ? this.linkedElementWidth : this.minWidth : null,
|
|
264
|
+
'max-width': this.maxWidth != null ? this.maxWidth == "100%" || this.maxWidth == "auto" ? this.linkedElementWidth : this.maxWidth : null,
|
|
265
|
+
};
|
|
266
|
+
return (h(Host, { class: hostClasses, style: customStyle }, h("div", { class: classes }, h("slot", null), h("div", { class: "list" }), h("div", { class: "spinner" }, h("bcm-icon", { type: "animated", color: "prime-blue", class: "prefix", icon: "loading" })))));
|
|
267
|
+
}
|
|
268
|
+
get el() { return getElement(this); }
|
|
269
|
+
};
|
|
270
|
+
BcmList.style = listCss;
|
|
271
|
+
|
|
272
|
+
export { BcmList as bcm_list };
|