bromcom-ui 2.7.37 → 2.7.38-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/p-00dc3d2e.entry.js +5 -0
- package/dist/bromcom-ui/p-04b6abc3.js +5 -0
- package/dist/bromcom-ui/p-04c8b756.js +1 -1
- package/dist/bromcom-ui/{p-1e2d1714.entry.js → p-0612fbb0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8430b547.entry.js → p-08662565.entry.js} +1 -1
- package/dist/bromcom-ui/{p-02f2445a.entry.js → p-0c343f1d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-edec76e6.entry.js → p-14afb435.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9d2fe304.entry.js → p-161d83e1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-53a00d98.js → p-16c10cc7.js} +1 -1
- package/dist/bromcom-ui/{p-e48c96b5.entry.js → p-1a1ee7ac.entry.js} +1 -1
- package/dist/bromcom-ui/{p-38b69e07.entry.js → p-1bb7803c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-55b88051.entry.js → p-1fa6181a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-da458f63.entry.js → p-26d5b24d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-894b0a04.entry.js → p-27085077.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a29b08eb.entry.js → p-29f3c080.entry.js} +1 -1
- package/dist/bromcom-ui/p-2c9f6e6a.entry.js +5 -0
- package/dist/bromcom-ui/{p-168b8ca7.entry.js → p-35502aac.entry.js} +1 -1
- package/dist/bromcom-ui/{p-6720d135.entry.js → p-375429c3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8c018ae0.js → p-3c7a0345.js} +1 -1
- package/dist/bromcom-ui/p-3d2cdbcc.entry.js +5 -0
- package/dist/bromcom-ui/{p-52b34297.entry.js → p-3fcb3478.entry.js} +1 -1
- package/dist/bromcom-ui/{p-58761f87.js → p-4058bd89.js} +1 -1
- package/dist/bromcom-ui/{p-15e43f94.entry.js → p-432ebc3f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-095d05df.entry.js → p-43c148a4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2c31ab48.entry.js → p-44dd9f7a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-fe3e3210.js → p-45704915.js} +1 -1
- package/dist/bromcom-ui/{p-9729086c.entry.js → p-4f79155d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ba65d1dc.entry.js → p-52707827.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5926788b.entry.js → p-529cece6.entry.js} +1 -1
- package/dist/bromcom-ui/p-56a57960.entry.js +5 -0
- package/dist/bromcom-ui/{p-7e44e6b5.js → p-5ae0a59b.js} +1 -1
- package/dist/bromcom-ui/{p-4220635e.entry.js → p-5de35604.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c573addc.entry.js → p-649f6d13.entry.js} +1 -1
- package/dist/bromcom-ui/{p-5b114d5a.entry.js → p-6a0c96dc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f5ae5381.entry.js → p-6bc8c9a5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c1c18de5.entry.js → p-783cb2bb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c5c9e76f.entry.js → p-79719bd4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-08d242bf.entry.js → p-7f137af3.entry.js} +1 -1
- package/dist/bromcom-ui/p-8065cf74.js +5 -0
- package/dist/bromcom-ui/p-85688ecf.entry.js +5 -0
- package/dist/bromcom-ui/{p-037531dd.entry.js → p-878e45a0.entry.js} +1 -1
- package/dist/bromcom-ui/{p-3e557630.entry.js → p-888b5c8c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-78cf8966.entry.js → p-9086c5e5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a185570c.entry.js → p-9710630f.entry.js} +1 -1
- package/dist/bromcom-ui/p-9c6de630.js +1 -1
- package/dist/bromcom-ui/{p-da7603b0.entry.js → p-9e6e812b.entry.js} +1 -1
- package/dist/bromcom-ui/p-a0b83826.js +5 -0
- package/dist/bromcom-ui/p-a23d2359.entry.js +5 -0
- package/dist/bromcom-ui/p-a2d79502.entry.js +5 -0
- package/dist/bromcom-ui/p-a8abc160.entry.js +5 -0
- package/dist/bromcom-ui/{p-a3ffcb0d.js → p-a8d1397d.js} +1 -1
- package/dist/bromcom-ui/{p-fc1ef08f.entry.js → p-b1b449e5.entry.js} +1 -1
- package/dist/bromcom-ui/p-b95461ec.entry.js +5 -0
- package/dist/bromcom-ui/{p-ff742ab4.entry.js → p-c09b0566.entry.js} +1 -1
- package/dist/bromcom-ui/{p-ad4cf3f3.entry.js → p-c546cfdf.entry.js} +1 -1
- package/dist/bromcom-ui/{p-78963452.entry.js → p-c7e3e6b0.entry.js} +1 -1
- package/dist/bromcom-ui/p-c9bd85e9.js +1 -1
- package/dist/bromcom-ui/{p-7b5e88c5.entry.js → p-cb975855.entry.js} +1 -1
- package/dist/bromcom-ui/{p-95c5d04b.entry.js → p-cbfa56e8.entry.js} +1 -1
- package/dist/bromcom-ui/p-d33c83e8.entry.js +5 -0
- package/dist/bromcom-ui/p-d4200c87.entry.js +5 -0
- package/dist/bromcom-ui/{p-33e2496d.entry.js → p-d5503ae8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-331ee3a4.js → p-d98d05a3.js} +1 -1
- package/dist/bromcom-ui/{p-99bed73b.entry.js → p-d9acb076.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0f69842c.entry.js → p-df615728.entry.js} +1 -1
- package/dist/bromcom-ui/{p-425e15b7.entry.js → p-e07222d9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a2b5a278.entry.js → p-e974df65.entry.js} +1 -1
- package/dist/bromcom-ui/{p-93e7539f.entry.js → p-e987ebfa.entry.js} +1 -1
- package/dist/bromcom-ui/{p-1978e4ae.entry.js → p-eaa34b84.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e7b229fb.js → p-f20c8e07.js} +1 -1
- package/dist/bromcom-ui/{p-ac9f1774.entry.js → p-ff737d82.entry.js} +1 -1
- package/dist/cjs/bcm-accordion.cjs.entry.js +1 -1
- package/dist/cjs/bcm-alert.cjs.entry.js +3 -3
- package/dist/cjs/bcm-attendance.cjs.entry.js +1 -1
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +10 -10
- package/dist/cjs/bcm-breadcrumb.cjs.entry.js +1 -1
- package/dist/cjs/bcm-button-group.cjs.entry.js +6 -6
- package/dist/cjs/{bcm-button_3.cjs.entry.js → bcm-button.cjs.entry.js} +34 -189
- package/dist/cjs/bcm-card.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +8 -8
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +5 -5
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +9 -9
- package/dist/cjs/bcm-chip.cjs.entry.js +1 -1
- package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
- package/dist/cjs/bcm-date-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +8 -8
- package/dist/cjs/bcm-default.cjs.entry.js +1 -1
- package/dist/cjs/bcm-drawer.cjs.entry.js +7 -7
- package/dist/cjs/bcm-dropdown.cjs.entry.js +19 -153
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +3 -3
- package/dist/cjs/{bcm-2c51bf0c.js → bcm-f00ec62c.js} +4 -4
- package/dist/cjs/bcm-form-2.cjs.entry.js +4 -4
- package/dist/cjs/bcm-form.cjs.entry.js +2 -2
- package/dist/cjs/bcm-icon.cjs.entry.js +41 -0
- package/dist/cjs/bcm-input.cjs.entry.js +10 -10
- package/dist/cjs/bcm-item.cjs.entry.js +3 -3
- package/dist/cjs/bcm-items.cjs.entry.js +3 -3
- package/dist/cjs/bcm-label_2.cjs.entry.js +12 -12
- package/dist/cjs/bcm-link.cjs.entry.js +3 -3
- package/dist/cjs/{bcm-text.cjs.entry.js → bcm-linked_2.cjs.entry.js} +183 -6
- package/dist/cjs/bcm-list.cjs.entry.js +26 -26
- package/dist/cjs/bcm-menu.cjs.entry.js +13 -122
- package/dist/cjs/bcm-modal.cjs.entry.js +142 -0
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +4 -4
- package/dist/cjs/bcm-popover.cjs.entry.js +8 -8
- package/dist/cjs/bcm-progress.cjs.entry.js +3 -3
- package/dist/cjs/bcm-radio-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-radio.cjs.entry.js +5 -5
- package/dist/cjs/bcm-range.cjs.entry.js +5 -5
- package/dist/cjs/bcm-search.cjs.entry.js +5 -5
- package/dist/cjs/bcm-select.cjs.entry.js +2 -2
- package/dist/cjs/bcm-skeleton.cjs.entry.js +1 -1
- package/dist/cjs/bcm-step.cjs.entry.js +2 -2
- package/dist/cjs/bcm-stepper.cjs.entry.js +5 -5
- package/dist/cjs/bcm-switch.cjs.entry.js +8 -8
- package/dist/cjs/bcm-tab-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-tag.cjs.entry.js +14 -14
- package/dist/cjs/bcm-textarea.cjs.entry.js +6 -6
- package/dist/cjs/bcm-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{floating-ui-dae608ba.js → floating-ui-2a4a79ff.js} +4 -3
- package/dist/cjs/{generate-e91273b0.js → generate-e98dfd99.js} +1 -1
- package/dist/cjs/{input-template-8d591f62.js → input-template-00b50605.js} +6 -6
- package/dist/cjs/{json-parse-decarator-f014cca6.js → json-parse-decarator-98c9ac9a.js} +1 -1
- package/dist/cjs/{label-template-38d5c382.js → label-template-e56264b3.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{number-helper-54c0c852.js → number-helper-b80392ed.js} +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +6 -6
- package/dist/cjs/old-bcm-popover.cjs.entry.js +4 -4
- package/dist/cjs/{popover-placement-87901bb3.js → popover-placement-ac98d407.js} +1 -1
- package/dist/cjs/{slot-template-84d37599.js → slot-template-a4505c70.js} +1 -1
- package/dist/cjs/{stepper-states-b5763eec.js → stepper-states-bd774fce.js} +1 -1
- package/dist/cjs/{string-helper-df40a475.js → string-helper-145cd64f.js} +2 -2
- package/dist/cjs/{tooltip-helper-932f081b.js → tooltip-helper-1418bb15.js} +5 -5
- package/dist/cjs/{validators-40884433.js → validators-5514189b.js} +1 -1
- package/dist/collection/components/molecules/dropdown/dropdown.js +27 -214
- package/dist/collection/components/molecules/linked/linked.js +39 -6
- package/dist/collection/components/molecules/menu/menu.js +7 -183
- package/dist/collection/utils/floating-ui.js +2 -1
- package/dist/components/bcm-dropdown.js +29 -164
- package/dist/components/bcm-linked.js +1 -194
- package/dist/components/floating-ui.js +2 -1
- package/dist/components/generate.js +1 -1
- package/dist/{esm/bcm-linked.entry.js → components/linked.js} +58 -22
- package/dist/components/menu.js +9 -122
- package/dist/esm/bcm-accordion.entry.js +1 -1
- package/dist/esm/bcm-alert.entry.js +1 -1
- package/dist/esm/bcm-attendance.entry.js +1 -1
- package/dist/esm/bcm-avatar_2.entry.js +7 -7
- package/dist/esm/bcm-b8d8a236.js +1 -1
- package/dist/esm/bcm-breadcrumb.entry.js +1 -1
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/{bcm-button_3.entry.js → bcm-button.entry.js} +24 -177
- package/dist/esm/bcm-card.entry.js +3 -3
- package/dist/esm/bcm-checkbox-group.entry.js +3 -3
- package/dist/esm/bcm-checkbox-lite_9.entry.js +3 -3
- package/dist/esm/bcm-checkbox_2.entry.js +4 -4
- package/dist/esm/bcm-chip.entry.js +3 -3
- package/dist/esm/bcm-collapse-group.entry.js +1 -1
- package/dist/esm/bcm-collapse.entry.js +1 -1
- package/dist/esm/bcm-colorpicker.entry.js +2 -2
- package/dist/esm/bcm-date-picker.entry.js +3 -3
- package/dist/esm/bcm-datetime-picker.entry.js +4 -4
- package/dist/esm/bcm-default.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +7 -7
- package/dist/esm/bcm-dropdown.entry.js +16 -150
- package/dist/esm/bcm-expansion-panel.entry.js +3 -3
- package/dist/esm/bcm-form-2.entry.js +2 -2
- package/dist/esm/bcm-form.entry.js +1 -1
- package/dist/esm/bcm-icon.entry.js +37 -0
- package/dist/esm/bcm-input.entry.js +6 -6
- package/dist/esm/bcm-item.entry.js +4 -4
- package/dist/esm/bcm-items.entry.js +1 -1
- package/dist/esm/bcm-label_2.entry.js +9 -9
- package/dist/esm/bcm-link.entry.js +1 -1
- package/dist/esm/{bcm-text.entry.js → bcm-linked_2.entry.js} +183 -7
- package/dist/esm/bcm-list.entry.js +10 -10
- package/dist/esm/bcm-menu.entry.js +14 -123
- package/dist/esm/bcm-modal.entry.js +138 -0
- package/dist/esm/bcm-old-input.entry.js +1 -1
- package/dist/esm/bcm-old-tag_2.entry.js +1 -1
- package/dist/esm/bcm-popconfirm-box.entry.js +3 -3
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +8 -8
- package/dist/esm/bcm-progress.entry.js +4 -4
- package/dist/esm/bcm-radio-group.entry.js +3 -3
- package/dist/esm/bcm-radio.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +3 -3
- package/dist/esm/bcm-search.entry.js +4 -4
- package/dist/esm/bcm-select.entry.js +1 -1
- package/dist/esm/bcm-skeleton.entry.js +1 -1
- package/dist/esm/bcm-step.entry.js +2 -2
- package/dist/esm/bcm-stepper.entry.js +4 -4
- package/dist/esm/bcm-switch.entry.js +3 -3
- package/dist/esm/bcm-tab-group.entry.js +2 -2
- package/dist/esm/bcm-table.entry.js +1 -1
- package/dist/esm/bcm-tabs-content.entry.js +1 -1
- package/dist/esm/bcm-tabs.entry.js +1 -1
- package/dist/esm/bcm-tag.entry.js +4 -4
- package/dist/esm/bcm-textarea.entry.js +4 -4
- package/dist/esm/bcm-time-picker.entry.js +3 -3
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/{color-helper-7e202fd8.js → color-helper-b5e9aa56.js} +1 -1
- package/dist/esm/{element-dragger-89bb52fd.js → element-dragger-7ea06c76.js} +1 -1
- package/dist/esm/{floating-ui-f03a96ce.js → floating-ui-700d0b98.js} +3 -2
- package/dist/esm/{generate-ba9e1f0b.js → generate-38707d04.js} +1 -1
- package/dist/esm/{input-template-569671e3.js → input-template-bd2265e4.js} +2 -2
- package/dist/esm/{json-parse-decarator-ae9a53d6.js → json-parse-decarator-0e105c28.js} +1 -1
- package/dist/esm/label-template-f352ef5b.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{number-helper-4313dc1c.js → number-helper-5268042c.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +5 -5
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{stepper-states-13781383.js → stepper-states-925a81ea.js} +1 -1
- package/dist/esm/string-helper-74a1648f.js +1 -1
- package/dist/esm/{tooltip-helper-8c88ed15.js → tooltip-helper-2c89e1cc.js} +6 -6
- package/dist/esm/{utils-57652744.js → utils-b3338faf.js} +1 -1
- package/dist/esm/{validators-66dd02d3.js → validators-734a2c8e.js} +1 -1
- package/dist/types/components/molecules/dropdown/dropdown.d.ts +2 -15
- package/dist/types/components/molecules/linked/linked.d.ts +3 -1
- package/dist/types/components/molecules/menu/menu.d.ts +1 -13
- package/dist/types/components.d.ts +12 -13
- package/package.json +1 -1
- package/dist/bromcom-ui/assets +0 -0
- package/dist/bromcom-ui/p-1ae166db.entry.js +0 -5
- package/dist/bromcom-ui/p-3cebdafb.js +0 -5
- package/dist/bromcom-ui/p-44991f28.js +0 -5
- package/dist/bromcom-ui/p-5d8eb303.entry.js +0 -5
- package/dist/bromcom-ui/p-62ba8263.entry.js +0 -5
- package/dist/bromcom-ui/p-8fa9378f.entry.js +0 -5
- package/dist/bromcom-ui/p-9512271e.entry.js +0 -5
- package/dist/bromcom-ui/p-9c2800b0.entry.js +0 -5
- package/dist/bromcom-ui/p-b4c617f6.entry.js +0 -5
- package/dist/bromcom-ui/p-b639def6.js +0 -5
- package/dist/bromcom-ui/p-b924d9b8.entry.js +0 -5
- package/dist/bromcom-ui/p-d6a11d39.entry.js +0 -5
- package/dist/bromcom-ui/p-e83e3eae.entry.js +0 -5
- package/dist/cjs/bcm-linked.cjs.entry.js +0 -181
- package/dist/collection/assets +0 -0
|
@@ -13,15 +13,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
13
13
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
14
14
|
};
|
|
15
15
|
import { forceUpdate, h, Host } from '@stencil/core';
|
|
16
|
-
import { IsLoad } from '../../../decorators/is-load-decorator';
|
|
17
|
-
import { Generate } from '../../../helper/generate';
|
|
18
16
|
import cs from 'classnames';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
// import Bcm from '../../../models/bcm';
|
|
22
|
-
import { NumberHelper } from '../../../helper/number-helper';
|
|
23
|
-
import { Tooltip } from '@bcm/helpers';
|
|
24
|
-
import { FloatingUI } from '@bcm/utils';
|
|
17
|
+
import { Generate, Tooltip } from '@bcm/helpers';
|
|
18
|
+
import { IsLoad } from '@bcm/decorator';
|
|
25
19
|
export class BcmMenu {
|
|
26
20
|
constructor() {
|
|
27
21
|
this._id = Generate.UID();
|
|
@@ -36,100 +30,12 @@ export class BcmMenu {
|
|
|
36
30
|
this.maxHeight = '500px';
|
|
37
31
|
this.minHeight = '150px';
|
|
38
32
|
this.selectable = true;
|
|
39
|
-
this.open = false;
|
|
40
33
|
this.placement = 'bottom-start';
|
|
41
34
|
this.activeItemId = undefined;
|
|
42
35
|
this.data = [];
|
|
43
36
|
}
|
|
44
|
-
componentWillRender() {
|
|
45
|
-
this.calculateLocation();
|
|
46
|
-
}
|
|
47
|
-
componentDidRender() {
|
|
48
|
-
this.calculateLocation();
|
|
49
|
-
}
|
|
50
|
-
componentWillLoad() {
|
|
51
|
-
// this.data = this.data.map(item => ({ ...item, id: item.id ?? Generate.UID() }));
|
|
52
|
-
this.open = !this.linkedComponent;
|
|
53
|
-
}
|
|
54
|
-
async componentDidLoad() {
|
|
55
|
-
if (this.linkedComponent) {
|
|
56
|
-
document.body.appendChild(this.el);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
async calculateLocation() {
|
|
60
|
-
if (this.linkedComponent) {
|
|
61
|
-
const menu = this.el;
|
|
62
|
-
if (menu) {
|
|
63
|
-
if (this.open) {
|
|
64
|
-
let placement = this.placement;
|
|
65
|
-
const targetElementId = this.linkedComponent ? this.linkedComponent : this._id;
|
|
66
|
-
const targetElement = document.getElementById(targetElementId);
|
|
67
|
-
const menuId = targetElement === null || targetElement === void 0 ? void 0 : targetElement.getAttribute('menu-id');
|
|
68
|
-
if (menu && targetElement && (menuId ? menuId == this._id : true)) {
|
|
69
|
-
FloatingUI({
|
|
70
|
-
ref: targetElement,
|
|
71
|
-
floating: menu,
|
|
72
|
-
placement: this.placement,
|
|
73
|
-
offset: 2,
|
|
74
|
-
arrow: false,
|
|
75
|
-
arrowColor: ``,
|
|
76
|
-
});
|
|
77
|
-
getPlacement(menu, targetElement, placement, (place) => (placement = place));
|
|
78
|
-
await delay(10);
|
|
79
|
-
let pos = setPosition(placement, targetElement);
|
|
80
|
-
if (this.height.indexOf('%') > -1) {
|
|
81
|
-
menu.style.height = NumberHelper.toNumber(this.height) * 0.01 * window.innerHeight - pos[0] - 50 + 'px';
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
menu.style.height = this.height;
|
|
85
|
-
}
|
|
86
|
-
menu.style.minHeight = this.minHeight;
|
|
87
|
-
// const calculatedMaxHeight = window.innerHeight - pos[0] - 50;
|
|
88
|
-
const calculatedMaxHeight = placement.split('-')[0] == 'top' ? window.innerHeight - (window.innerHeight - pos[0]) - 50 : window.innerHeight - pos[0] - 50;
|
|
89
|
-
if (this.maxHeight.indexOf('%') > -1) {
|
|
90
|
-
menu.style.maxHeight = NumberHelper.toNumber(this.maxHeight) * 0.01 * calculatedMaxHeight + 'px';
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
menu.style.maxHeight = NumberHelper.toNumber(this.maxHeight) < calculatedMaxHeight ? this.maxHeight : calculatedMaxHeight + 'px';
|
|
94
|
-
}
|
|
95
|
-
menu.style.overflowY = 'auto';
|
|
96
|
-
getPlacement(menu, targetElement, placement, (place) => (placement = place));
|
|
97
|
-
await delay(10);
|
|
98
|
-
pos = setPosition(placement, targetElement);
|
|
99
|
-
// menu.style.top = (placement.split('-')[0] == 'top' ? pos[0] - menu.offsetHeight : pos[0]) + 'px';
|
|
100
|
-
// // menu.style.left = pos[1] + 'px';
|
|
101
|
-
// menu.style.left = (placement.split('-')[1] == 'end' ? pos[1] - menu.offsetWidth : pos[1]) + 'px';
|
|
102
|
-
menu.classList.toggle('bcm-menu--top', placement.split('-')[0] == 'top');
|
|
103
|
-
menu.style.minWidth = targetElement.offsetWidth + 'px';
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
menu.style.top = '-9999px';
|
|
108
|
-
menu.style.left = '-9999px';
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
handleWheel(event) {
|
|
114
|
-
if (this.open && this.linkedComponent) {
|
|
115
|
-
if (Generate.findEventPath(event, this.el)) {
|
|
116
|
-
this.calculateLocation();
|
|
117
|
-
}
|
|
118
|
-
else {
|
|
119
|
-
this.hide();
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
watchOpen() {
|
|
124
|
-
this.bcmOpen.emit(this.open);
|
|
125
|
-
}
|
|
126
|
-
async show() {
|
|
127
|
-
this.open = true;
|
|
128
|
-
}
|
|
129
|
-
async hide() {
|
|
130
|
-
this.open = false;
|
|
131
|
-
}
|
|
132
37
|
async setActive(param) {
|
|
38
|
+
this.activeItemId = null;
|
|
133
39
|
const recursive = (data) => {
|
|
134
40
|
data.forEach(item => {
|
|
135
41
|
if (item.id == param) {
|
|
@@ -150,18 +56,6 @@ export class BcmMenu {
|
|
|
150
56
|
handleSlotItems({ detail }) {
|
|
151
57
|
this.data = detail;
|
|
152
58
|
}
|
|
153
|
-
handleOnClick(event) {
|
|
154
|
-
if (this.disabled || !this.linkedComponent)
|
|
155
|
-
return;
|
|
156
|
-
const linkedId = document.getElementById(this.linkedComponent);
|
|
157
|
-
const isClickTarget = linkedId && Generate.findEventPath(event, linkedId);
|
|
158
|
-
if (isClickTarget) {
|
|
159
|
-
this.open = !this.open;
|
|
160
|
-
}
|
|
161
|
-
else {
|
|
162
|
-
!Generate.findEventPath(event, this.el) && this.hide();
|
|
163
|
-
}
|
|
164
|
-
}
|
|
165
59
|
handleClickItem(item) {
|
|
166
60
|
if (item.items && item.items.length > 0) {
|
|
167
61
|
item.isOpen = !item.isOpen;
|
|
@@ -169,9 +63,7 @@ export class BcmMenu {
|
|
|
169
63
|
}
|
|
170
64
|
else {
|
|
171
65
|
this.activeItemId = item.id;
|
|
172
|
-
|
|
173
|
-
this.hide();
|
|
174
|
-
}
|
|
66
|
+
document.dispatchEvent(new CustomEvent('linked-data-dismiss', { detail: { id: this._id } }));
|
|
175
67
|
}
|
|
176
68
|
// this.data = this.data.map(menuItem => ({ ...menuItem, active: menuItem.id === item.id }));
|
|
177
69
|
this.bcmClick.emit(item);
|
|
@@ -180,11 +72,9 @@ export class BcmMenu {
|
|
|
180
72
|
return new Tooltip({ message: text, targetId: 'bcm-menu__item-' + this._id + '-' + id, placement: 'right' });
|
|
181
73
|
}
|
|
182
74
|
render() {
|
|
183
|
-
const { data, collapsible, collapse
|
|
75
|
+
const { data, collapsible, collapse } = this;
|
|
184
76
|
const hostClasses = cs('bcm-menu', `bcm-menu__size-${this.size}`, {
|
|
185
|
-
'bcm-menu__collapse': collapse
|
|
186
|
-
'bcm-menu__open': open,
|
|
187
|
-
'bcm-menu--linked': !!this.linkedComponent,
|
|
77
|
+
'bcm-menu__collapse': collapse
|
|
188
78
|
});
|
|
189
79
|
const MenuLinkTemplate = (item, index) => {
|
|
190
80
|
if (!item.text)
|
|
@@ -452,7 +342,7 @@ export class BcmMenu {
|
|
|
452
342
|
"references": {
|
|
453
343
|
"PlacementTypes": {
|
|
454
344
|
"location": "import",
|
|
455
|
-
"path": "
|
|
345
|
+
"path": "@bcm/model"
|
|
456
346
|
}
|
|
457
347
|
}
|
|
458
348
|
},
|
|
@@ -488,7 +378,6 @@ export class BcmMenu {
|
|
|
488
378
|
}
|
|
489
379
|
static get states() {
|
|
490
380
|
return {
|
|
491
|
-
"open": {},
|
|
492
381
|
"activeItemId": {}
|
|
493
382
|
};
|
|
494
383
|
}
|
|
@@ -508,21 +397,6 @@ export class BcmMenu {
|
|
|
508
397
|
"resolved": "any",
|
|
509
398
|
"references": {}
|
|
510
399
|
}
|
|
511
|
-
}, {
|
|
512
|
-
"method": "bcmOpen",
|
|
513
|
-
"name": "bcm-open",
|
|
514
|
-
"bubbles": true,
|
|
515
|
-
"cancelable": true,
|
|
516
|
-
"composed": true,
|
|
517
|
-
"docs": {
|
|
518
|
-
"tags": [],
|
|
519
|
-
"text": ""
|
|
520
|
-
},
|
|
521
|
-
"complexType": {
|
|
522
|
-
"original": "any",
|
|
523
|
-
"resolved": "any",
|
|
524
|
-
"references": {}
|
|
525
|
-
}
|
|
526
400
|
}, {
|
|
527
401
|
"method": "bcmExpanded",
|
|
528
402
|
"name": "bcm-expanded",
|
|
@@ -542,38 +416,6 @@ export class BcmMenu {
|
|
|
542
416
|
}
|
|
543
417
|
static get methods() {
|
|
544
418
|
return {
|
|
545
|
-
"show": {
|
|
546
|
-
"complexType": {
|
|
547
|
-
"signature": "() => Promise<void>",
|
|
548
|
-
"parameters": [],
|
|
549
|
-
"references": {
|
|
550
|
-
"Promise": {
|
|
551
|
-
"location": "global"
|
|
552
|
-
}
|
|
553
|
-
},
|
|
554
|
-
"return": "Promise<void>"
|
|
555
|
-
},
|
|
556
|
-
"docs": {
|
|
557
|
-
"text": "",
|
|
558
|
-
"tags": []
|
|
559
|
-
}
|
|
560
|
-
},
|
|
561
|
-
"hide": {
|
|
562
|
-
"complexType": {
|
|
563
|
-
"signature": "() => Promise<void>",
|
|
564
|
-
"parameters": [],
|
|
565
|
-
"references": {
|
|
566
|
-
"Promise": {
|
|
567
|
-
"location": "global"
|
|
568
|
-
}
|
|
569
|
-
},
|
|
570
|
-
"return": "Promise<void>"
|
|
571
|
-
},
|
|
572
|
-
"docs": {
|
|
573
|
-
"text": "",
|
|
574
|
-
"tags": []
|
|
575
|
-
}
|
|
576
|
-
},
|
|
577
419
|
"setActive": {
|
|
578
420
|
"complexType": {
|
|
579
421
|
"signature": "(param: any) => Promise<void>",
|
|
@@ -596,31 +438,13 @@ export class BcmMenu {
|
|
|
596
438
|
};
|
|
597
439
|
}
|
|
598
440
|
static get elementRef() { return "el"; }
|
|
599
|
-
static get watchers() {
|
|
600
|
-
return [{
|
|
601
|
-
"propName": "open",
|
|
602
|
-
"methodName": "watchOpen"
|
|
603
|
-
}];
|
|
604
|
-
}
|
|
605
441
|
static get listeners() {
|
|
606
442
|
return [{
|
|
607
|
-
"name": "wheel",
|
|
608
|
-
"method": "handleWheel",
|
|
609
|
-
"target": "document",
|
|
610
|
-
"capture": false,
|
|
611
|
-
"passive": false
|
|
612
|
-
}, {
|
|
613
443
|
"name": "bcm-items",
|
|
614
444
|
"method": "handleSlotItems",
|
|
615
445
|
"target": undefined,
|
|
616
446
|
"capture": false,
|
|
617
447
|
"passive": false
|
|
618
|
-
}, {
|
|
619
|
-
"name": "click",
|
|
620
|
-
"method": "handleOnClick",
|
|
621
|
-
"target": "window",
|
|
622
|
-
"capture": false,
|
|
623
|
-
"passive": false
|
|
624
448
|
}];
|
|
625
449
|
}
|
|
626
450
|
}
|
|
@@ -26,7 +26,8 @@ args) => {
|
|
|
26
26
|
}
|
|
27
27
|
style &&
|
|
28
28
|
Object.assign(floating.style, Object.assign(Object.assign({}, (style.height && { height: style.height })), (style.minHeight && { minHeight: style.minHeight })));
|
|
29
|
-
|
|
29
|
+
const heightCheck = ['auto', '100%', '100vh', '100vw', 'inherit', 'initial', 'unset', undefined].some(item => item == (style === null || style === void 0 ? void 0 : style.height));
|
|
30
|
+
if (autoSize && heightCheck) {
|
|
30
31
|
_middleware.push(size({
|
|
31
32
|
apply({ availableHeight }) {
|
|
32
33
|
const maxHeight = `${availableHeight > window.innerHeight ? window.innerHeight - 10 : availableHeight}px`;
|
|
@@ -10,8 +10,8 @@ import { G as Generate } from './generate.js';
|
|
|
10
10
|
import { B as Bcm } from './bcm.js';
|
|
11
11
|
import { d as defineCustomElement$5 } from './button.js';
|
|
12
12
|
import { d as defineCustomElement$4 } from './icon.js';
|
|
13
|
-
import { d as defineCustomElement$3 } from './
|
|
14
|
-
import { d as defineCustomElement$2 } from './
|
|
13
|
+
import { d as defineCustomElement$3 } from './linked.js';
|
|
14
|
+
import { d as defineCustomElement$2 } from './menu.js';
|
|
15
15
|
|
|
16
16
|
const dropdownCss = "@import url(\"https://fonts.googleapis.com/css?family=Roboto:400,500\");@import url(\"https://fonts.googleapis.com/css2?family=Inter:wght@200;400;500;600&display=swap\"); .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}.input-size-large{height:40px}.input-size-medium{height:32px}.input-size-small{height:24px}.resize-none textarea{resize:none}.resize-vertical textarea{resize:vertical}.resize-auto textarea{height:auto;resize:none}.textarea-size-large{padding:4px 0 0 4px;min-height:40px}.textarea-size-large .bcm-input-element{min-height:calc((40px - 8px) + 2px)}.textarea-size-large .input-clear-button{height:calc( 40px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-medium{padding:4px 0 0 4px;min-height:32px}.textarea-size-medium .bcm-input-element{min-height:calc((32px - 8px) + 2px)}.textarea-size-medium .input-clear-button{height:calc( 32px - 16px );top:8px;padding:0;margin-right:8px}.textarea-size-small{padding:0px 0 0 4px;min-height:24px}.textarea-size-small .bcm-input-element{min-height:calc((24px - 8px) + 2px)}.textarea-size-small .input-clear-button{height:calc( 24px - 16px );top:8px;padding:0;margin-right:8px}:root{--bcm-new-ds-color-inherit:inherit;--bcm-new-ds-color-current:currentColor;--bcm-new-ds-color-transparent:transparent;--bcm-new-ds-color-black:#000;--bcm-new-ds-color-white:#fff;--bcm-new-ds-color-slate:#64748b;--bcm-new-ds-color-slate-50:#f8fafc;--bcm-new-ds-color-slate-100:#f1f5f9;--bcm-new-ds-color-slate-200:#e2e8f0;--bcm-new-ds-color-slate-300:#cbd5e1;--bcm-new-ds-color-slate-400:#94a3b8;--bcm-new-ds-color-slate-500:#64748b;--bcm-new-ds-color-slate-600:#475569;--bcm-new-ds-color-slate-700:#334155;--bcm-new-ds-color-slate-800:#1e293b;--bcm-new-ds-color-slate-900:#0f172a;--bcm-new-ds-color-gray:#6b7280;--bcm-new-ds-color-gray-50:#f9fafb;--bcm-new-ds-color-gray-100:#f3f4f6;--bcm-new-ds-color-gray-200:#e5e7eb;--bcm-new-ds-color-gray-300:#d1d5db;--bcm-new-ds-color-gray-400:#9ca3af;--bcm-new-ds-color-gray-500:#6b7280;--bcm-new-ds-color-gray-600:#4b5563;--bcm-new-ds-color-gray-700:#374151;--bcm-new-ds-color-gray-800:#1f2937;--bcm-new-ds-color-gray-900:#111827;--bcm-new-ds-color-zinc:#71717a;--bcm-new-ds-color-zinc-50:#fafafa;--bcm-new-ds-color-zinc-100:#f4f4f5;--bcm-new-ds-color-zinc-200:#e4e4e7;--bcm-new-ds-color-zinc-300:#d4d4d8;--bcm-new-ds-color-zinc-400:#a1a1aa;--bcm-new-ds-color-zinc-500:#71717a;--bcm-new-ds-color-zinc-600:#52525b;--bcm-new-ds-color-zinc-700:#3f3f46;--bcm-new-ds-color-zinc-800:#27272a;--bcm-new-ds-color-zinc-900:#18181b;--bcm-new-ds-color-neutral:#737373;--bcm-new-ds-color-neutral-50:#fafafa;--bcm-new-ds-color-neutral-100:#f5f5f5;--bcm-new-ds-color-neutral-200:#e5e5e5;--bcm-new-ds-color-neutral-300:#d4d4d4;--bcm-new-ds-color-neutral-400:#a3a3a3;--bcm-new-ds-color-neutral-500:#737373;--bcm-new-ds-color-neutral-600:#525252;--bcm-new-ds-color-neutral-700:#404040;--bcm-new-ds-color-neutral-800:#262626;--bcm-new-ds-color-neutral-900:#171717;--bcm-new-ds-color-stone:#78716c;--bcm-new-ds-color-stone-50:#fafaf9;--bcm-new-ds-color-stone-100:#f5f5f4;--bcm-new-ds-color-stone-200:#e7e5e4;--bcm-new-ds-color-stone-300:#d6d3d1;--bcm-new-ds-color-stone-400:#a8a29e;--bcm-new-ds-color-stone-500:#78716c;--bcm-new-ds-color-stone-600:#57534e;--bcm-new-ds-color-stone-700:#44403c;--bcm-new-ds-color-stone-800:#292524;--bcm-new-ds-color-stone-900:#1c1917;--bcm-new-ds-color-red:#ef4444;--bcm-new-ds-color-red-50:#fef2f2;--bcm-new-ds-color-red-100:#fee2e2;--bcm-new-ds-color-red-200:#fecaca;--bcm-new-ds-color-red-300:#fca5a5;--bcm-new-ds-color-red-400:#f87171;--bcm-new-ds-color-red-500:#ef4444;--bcm-new-ds-color-red-600:#dc2626;--bcm-new-ds-color-red-700:#b91c1c;--bcm-new-ds-color-red-800:#991b1b;--bcm-new-ds-color-red-900:#7f1d1d;--bcm-new-ds-color-orange:#f97316;--bcm-new-ds-color-orange-50:#fff7ed;--bcm-new-ds-color-orange-100:#ffedd5;--bcm-new-ds-color-orange-200:#fed7aa;--bcm-new-ds-color-orange-300:#fdba74;--bcm-new-ds-color-orange-400:#fb923c;--bcm-new-ds-color-orange-500:#f97316;--bcm-new-ds-color-orange-600:#ea580c;--bcm-new-ds-color-orange-700:#c2410c;--bcm-new-ds-color-orange-800:#9a3412;--bcm-new-ds-color-orange-900:#7c2d12;--bcm-new-ds-color-amber:#f59e0b;--bcm-new-ds-color-amber-50:#fffbeb;--bcm-new-ds-color-amber-100:#fef3c7;--bcm-new-ds-color-amber-200:#fde68a;--bcm-new-ds-color-amber-300:#fcd34d;--bcm-new-ds-color-amber-400:#fbbf24;--bcm-new-ds-color-amber-500:#f59e0b;--bcm-new-ds-color-amber-600:#d97706;--bcm-new-ds-color-amber-700:#b45309;--bcm-new-ds-color-amber-800:#92400e;--bcm-new-ds-color-amber-900:#78350f;--bcm-new-ds-color-yellow:#eab308;--bcm-new-ds-color-yellow-50:#fefce8;--bcm-new-ds-color-yellow-100:#fef9c3;--bcm-new-ds-color-yellow-200:#fef08a;--bcm-new-ds-color-yellow-300:#fde047;--bcm-new-ds-color-yellow-400:#facc15;--bcm-new-ds-color-yellow-500:#eab308;--bcm-new-ds-color-yellow-600:#ca8a04;--bcm-new-ds-color-yellow-700:#a16207;--bcm-new-ds-color-yellow-800:#854d0e;--bcm-new-ds-color-yellow-900:#713f12;--bcm-new-ds-color-lime:#84cc16;--bcm-new-ds-color-lime-50:#f7fee7;--bcm-new-ds-color-lime-100:#ecfccb;--bcm-new-ds-color-lime-200:#d9f99d;--bcm-new-ds-color-lime-300:#bef264;--bcm-new-ds-color-lime-400:#a3e635;--bcm-new-ds-color-lime-500:#84cc16;--bcm-new-ds-color-lime-600:#65a30d;--bcm-new-ds-color-lime-700:#4d7c0f;--bcm-new-ds-color-lime-800:#3f6212;--bcm-new-ds-color-lime-900:#365314;--bcm-new-ds-color-green:#22c55e;--bcm-new-ds-color-green-50:#f0fdf4;--bcm-new-ds-color-green-100:#dcfce7;--bcm-new-ds-color-green-200:#bbf7d0;--bcm-new-ds-color-green-300:#86efac;--bcm-new-ds-color-green-400:#4ade80;--bcm-new-ds-color-green-500:#22c55e;--bcm-new-ds-color-green-600:#16a34a;--bcm-new-ds-color-green-700:#15803d;--bcm-new-ds-color-green-800:#166534;--bcm-new-ds-color-green-900:#14532d;--bcm-new-ds-color-emerald:#10b981;--bcm-new-ds-color-emerald-50:#ecfdf5;--bcm-new-ds-color-emerald-100:#d1fae5;--bcm-new-ds-color-emerald-200:#a7f3d0;--bcm-new-ds-color-emerald-300:#6ee7b7;--bcm-new-ds-color-emerald-400:#34d399;--bcm-new-ds-color-emerald-500:#10b981;--bcm-new-ds-color-emerald-600:#059669;--bcm-new-ds-color-emerald-700:#047857;--bcm-new-ds-color-emerald-800:#065f46;--bcm-new-ds-color-emerald-900:#064e3b;--bcm-new-ds-color-teal:#14b8a6;--bcm-new-ds-color-teal-50:#f0fdfa;--bcm-new-ds-color-teal-100:#ccfbf1;--bcm-new-ds-color-teal-200:#99f6e4;--bcm-new-ds-color-teal-300:#5eead4;--bcm-new-ds-color-teal-400:#2dd4bf;--bcm-new-ds-color-teal-500:#14b8a6;--bcm-new-ds-color-teal-600:#0d9488;--bcm-new-ds-color-teal-700:#0f766e;--bcm-new-ds-color-teal-800:#115e59;--bcm-new-ds-color-teal-900:#134e4a;--bcm-new-ds-color-cyan:#06b6d4;--bcm-new-ds-color-cyan-50:#ecfeff;--bcm-new-ds-color-cyan-100:#cffafe;--bcm-new-ds-color-cyan-200:#a5f3fc;--bcm-new-ds-color-cyan-300:#67e8f9;--bcm-new-ds-color-cyan-400:#22d3ee;--bcm-new-ds-color-cyan-500:#06b6d4;--bcm-new-ds-color-cyan-600:#0891b2;--bcm-new-ds-color-cyan-700:#0e7490;--bcm-new-ds-color-cyan-800:#155e75;--bcm-new-ds-color-cyan-900:#164e63;--bcm-new-ds-color-sky:#0ea5e9;--bcm-new-ds-color-sky-50:#f0f9ff;--bcm-new-ds-color-sky-100:#e0f2fe;--bcm-new-ds-color-sky-200:#bae6fd;--bcm-new-ds-color-sky-300:#7dd3fc;--bcm-new-ds-color-sky-400:#38bdf8;--bcm-new-ds-color-sky-500:#0ea5e9;--bcm-new-ds-color-sky-600:#0284c7;--bcm-new-ds-color-sky-700:#0369a1;--bcm-new-ds-color-sky-800:#075985;--bcm-new-ds-color-sky-900:#0c4a6e;--bcm-new-ds-color-blue:#3b82f6;--bcm-new-ds-color-blue-50:#eff6ff;--bcm-new-ds-color-blue-100:#dbeafe;--bcm-new-ds-color-blue-200:#bfdbfe;--bcm-new-ds-color-blue-300:#93c5fd;--bcm-new-ds-color-blue-400:#60a5fa;--bcm-new-ds-color-blue-500:#3b82f6;--bcm-new-ds-color-blue-600:#2563eb;--bcm-new-ds-color-blue-700:#1d4ed8;--bcm-new-ds-color-blue-800:#1e40af;--bcm-new-ds-color-blue-900:#1e3a8a;--bcm-new-ds-color-indigo:#6366f1;--bcm-new-ds-color-indigo-50:#eef2ff;--bcm-new-ds-color-indigo-100:#e0e7ff;--bcm-new-ds-color-indigo-200:#c7d2fe;--bcm-new-ds-color-indigo-300:#a5b4fc;--bcm-new-ds-color-indigo-400:#818cf8;--bcm-new-ds-color-indigo-500:#6366f1;--bcm-new-ds-color-indigo-600:#4f46e5;--bcm-new-ds-color-indigo-700:#4338ca;--bcm-new-ds-color-indigo-800:#3730a3;--bcm-new-ds-color-indigo-900:#312e81;--bcm-new-ds-color-violet:#8b5cf6;--bcm-new-ds-color-violet-50:#f5f3ff;--bcm-new-ds-color-violet-100:#ede9fe;--bcm-new-ds-color-violet-200:#ddd6fe;--bcm-new-ds-color-violet-300:#c4b5fd;--bcm-new-ds-color-violet-400:#a78bfa;--bcm-new-ds-color-violet-500:#8b5cf6;--bcm-new-ds-color-violet-600:#7c3aed;--bcm-new-ds-color-violet-700:#6d28d9;--bcm-new-ds-color-violet-800:#5b21b6;--bcm-new-ds-color-violet-900:#4c1d95;--bcm-new-ds-color-purple:#a855f7;--bcm-new-ds-color-purple-50:#faf5ff;--bcm-new-ds-color-purple-100:#f3e8ff;--bcm-new-ds-color-purple-200:#e9d5ff;--bcm-new-ds-color-purple-300:#d8b4fe;--bcm-new-ds-color-purple-400:#c084fc;--bcm-new-ds-color-purple-500:#a855f7;--bcm-new-ds-color-purple-600:#9333ea;--bcm-new-ds-color-purple-700:#7e22ce;--bcm-new-ds-color-purple-800:#6b21a8;--bcm-new-ds-color-purple-900:#581c87;--bcm-new-ds-color-fuchsia:#d946ef;--bcm-new-ds-color-fuchsia-50:#fdf4ff;--bcm-new-ds-color-fuchsia-100:#fae8ff;--bcm-new-ds-color-fuchsia-200:#f5d0fe;--bcm-new-ds-color-fuchsia-300:#f0abfc;--bcm-new-ds-color-fuchsia-400:#e879f9;--bcm-new-ds-color-fuchsia-500:#d946ef;--bcm-new-ds-color-fuchsia-600:#c026d3;--bcm-new-ds-color-fuchsia-700:#a21caf;--bcm-new-ds-color-fuchsia-800:#86198f;--bcm-new-ds-color-fuchsia-900:#701a75;--bcm-new-ds-color-pink:#ec4899;--bcm-new-ds-color-pink-50:#fdf2f8;--bcm-new-ds-color-pink-100:#fce7f3;--bcm-new-ds-color-pink-200:#fbcfe8;--bcm-new-ds-color-pink-300:#f9a8d4;--bcm-new-ds-color-pink-400:#f472b6;--bcm-new-ds-color-pink-500:#ec4899;--bcm-new-ds-color-pink-600:#db2777;--bcm-new-ds-color-pink-700:#be185d;--bcm-new-ds-color-pink-800:#9d174d;--bcm-new-ds-color-pink-900:#831843;--bcm-new-ds-color-rose:#f43f5e;--bcm-new-ds-color-rose-50:#fff1f2;--bcm-new-ds-color-rose-100:#ffe4e6;--bcm-new-ds-color-rose-200:#fecdd3;--bcm-new-ds-color-rose-300:#fda4af;--bcm-new-ds-color-rose-400:#fb7185;--bcm-new-ds-color-rose-500:#f43f5e;--bcm-new-ds-color-rose-600:#e11d48;--bcm-new-ds-color-rose-700:#be123c;--bcm-new-ds-color-rose-800:#9f1239;--bcm-new-ds-color-rose-900:#881337}*{box-sizing:border-box}.bcm-dropdown{width:fit-content;display:inline-flex;flex-direction:row}.bcm-dropdown.hidden{display:none}.bcm-dropdown.no-style{cursor:pointer}.bcm-dropdown.full-width{width:100%}.bcm-dropdown.full-width .bcm-button__container-text{flex:1;justify-content:space-between}.bcm-dropdown__type-split .main-button .bcm-button__container{border-top-right-radius:0;border-bottom-right-radius:0}.bcm-dropdown__type-split .split-button .bcm-button__container{border-top-left-radius:0;border-bottom-left-radius:0;margin-left:1px;min-width:auto}.bcm-dropdown__icon{display:flex;flex-direction:row;align-items:center;justify-content:center;flex-wrap:nowrap;transform:rotate(0deg);transition:transform 0.2s ease}.bcm-dropdown__icon--open{transform:rotate(180deg)}";
|
|
17
17
|
|
|
@@ -30,7 +30,6 @@ const BcmDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
30
30
|
super();
|
|
31
31
|
this.__registerHost();
|
|
32
32
|
this.bcmClick = createEvent(this, "bcm-click", 7);
|
|
33
|
-
this.dropdownLinkedComponent = createEvent(this, "dropdown-linked-component", 7);
|
|
34
33
|
this.isOpen = undefined;
|
|
35
34
|
this._id = Generate.UID();
|
|
36
35
|
this.menuId = Generate.UID();
|
|
@@ -46,14 +45,13 @@ const BcmDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
46
45
|
this.noStyle = false;
|
|
47
46
|
this.dropdownIcon = 'fas fa-angle-down';
|
|
48
47
|
this.linkedComponent = undefined;
|
|
49
|
-
this.multiLevel = false;
|
|
50
48
|
this.loading = false;
|
|
51
49
|
this.variant = undefined;
|
|
52
50
|
this.dataDismiss = false;
|
|
53
51
|
this.fullWidth = false;
|
|
54
52
|
this.iconPosition = Bcm.IconPosition.prefix;
|
|
55
53
|
this.placement = undefined;
|
|
56
|
-
this.height =
|
|
54
|
+
this.height = undefined;
|
|
57
55
|
this.maxHeight = '500px';
|
|
58
56
|
this.minHeight = '50px';
|
|
59
57
|
this.stopDeepClean = false;
|
|
@@ -66,156 +64,25 @@ const BcmDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
66
64
|
this.data = newValue;
|
|
67
65
|
}
|
|
68
66
|
}
|
|
69
|
-
async
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
// if (this.isOpen) {
|
|
76
|
-
// document.body.classList.add(disableScrollClass);
|
|
77
|
-
// } else {
|
|
78
|
-
// document.body.classList.remove(disableScrollClass);
|
|
79
|
-
// }
|
|
80
|
-
}
|
|
81
|
-
handleIsClickDismiss({ detail }) {
|
|
82
|
-
if (this.multiLevel) {
|
|
83
|
-
this.isOpen = detail;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
handleOnClick(event) {
|
|
87
|
-
if (this.linkedComponent)
|
|
88
|
-
return this.linkedComponentClick(event);
|
|
89
|
-
if (this.isOpen) {
|
|
90
|
-
const targetElement = this.linkedComponent ? document.getElementById(this.linkedComponent) : this.el;
|
|
91
|
-
const box = this.getPopoverBox();
|
|
92
|
-
if (box) {
|
|
93
|
-
const isClickBox = Generate.findEventPath(event, box);
|
|
94
|
-
const isClickThis = Generate.findEventPath(event, targetElement);
|
|
95
|
-
if (!isClickBox && !isClickThis) {
|
|
96
|
-
this.isOpen = false;
|
|
97
|
-
return;
|
|
98
|
-
}
|
|
99
|
-
const isClickDismiss = Generate.findEventPathHasAttribute(event, 'data-dismiss');
|
|
100
|
-
if (isClickDismiss) {
|
|
101
|
-
this.isOpen = false;
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
handleWheel(event) {
|
|
108
|
-
if (this.isOpen) {
|
|
109
|
-
const box = this.getPopoverBox();
|
|
110
|
-
if (box) {
|
|
111
|
-
const isClickBox = Generate.findEventPath(event, box);
|
|
112
|
-
const isClickThis = Generate.findEventPath(event, this.el);
|
|
113
|
-
if (!isClickBox && !isClickThis) {
|
|
114
|
-
this.isOpen = false;
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
async setActive(id) {
|
|
121
|
-
if (id) {
|
|
122
|
-
const menu = document.getElementById(`${this.menuId}`);
|
|
123
|
-
if (menu) {
|
|
124
|
-
menu.setActive(id);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
67
|
+
async setActive(id = null) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
(_b = (_a = document
|
|
70
|
+
.getElementById(`${this.menuId}`)) === null || _a === void 0 ? void 0 : _a.querySelectorAll('bcm-menu')) === null || _b === void 0 ? void 0 : _b.forEach(item => {
|
|
71
|
+
item.setActive(id);
|
|
72
|
+
});
|
|
127
73
|
}
|
|
128
74
|
handleSlotItems({ detail }) {
|
|
129
75
|
this.data = detail;
|
|
130
76
|
}
|
|
131
|
-
// connectedCallback() {
|
|
132
|
-
// const disableScrollClass = `bcm-dropdown--disable-scroll-${this._id}`;
|
|
133
|
-
// const styleId = `bcm-dropdown-style-${this._id}`;
|
|
134
|
-
// let style = document.getElementById(styleId);
|
|
135
|
-
// if (!style) {
|
|
136
|
-
// style = document.createElement('style');
|
|
137
|
-
// style.id = styleId;
|
|
138
|
-
// style.innerHTML = `.${disableScrollClass} { overflow: hidden; }`;
|
|
139
|
-
// document.head.appendChild(style);
|
|
140
|
-
// }
|
|
141
|
-
// }
|
|
142
77
|
componentDidLoad() {
|
|
143
|
-
|
|
144
|
-
if (box) {
|
|
145
|
-
box.remove();
|
|
146
|
-
}
|
|
78
|
+
var _a;
|
|
147
79
|
const bcmContent = this.el.querySelector('bcm-content');
|
|
148
80
|
if (bcmContent) {
|
|
149
|
-
|
|
150
|
-
this.createBox();
|
|
151
|
-
this.isOpen = this.isOpen;
|
|
81
|
+
(_a = document.getElementById(this.menuId)) === null || _a === void 0 ? void 0 : _a.appendChild(bcmContent);
|
|
152
82
|
}
|
|
153
83
|
}
|
|
154
|
-
disconnectedCallback() {
|
|
155
|
-
this.isOpen = false;
|
|
156
|
-
if (this.stopDeepClean)
|
|
157
|
-
return;
|
|
158
|
-
const box = this.getPopoverBox();
|
|
159
|
-
if (box) {
|
|
160
|
-
box.remove();
|
|
161
|
-
}
|
|
162
|
-
// const disableScrollClass = `bcm-dropdown--disable-scroll-${this._id}`;
|
|
163
|
-
// document.body.classList.remove(disableScrollClass);
|
|
164
|
-
}
|
|
165
|
-
createBox() {
|
|
166
|
-
const content = this.el.querySelector('bcm-content');
|
|
167
|
-
if (content) {
|
|
168
|
-
const targetElementId = this.linkedComponent ? this.linkedComponent : this._id;
|
|
169
|
-
let box = document.getElementById(`dropdown-box-${this._id}`);
|
|
170
|
-
if (!box) {
|
|
171
|
-
box = document.createElement('old-bcm-popover-box');
|
|
172
|
-
box.setAttribute('id', 'dropdown-box-' + this._id);
|
|
173
|
-
box.setAttribute('target-id', targetElementId);
|
|
174
|
-
box.setAttribute('placement', this.placement || 'bottom-start');
|
|
175
|
-
box.setAttribute('linked-component', targetElementId);
|
|
176
|
-
box.setAttribute('min-height', this.minHeight);
|
|
177
|
-
box.setAttribute('max-height', this.maxHeight);
|
|
178
|
-
box.setAttribute('height', this.height);
|
|
179
|
-
content.style.display = 'block';
|
|
180
|
-
content.removeAttribute('hidden');
|
|
181
|
-
box.appendChild(content);
|
|
182
|
-
document.body.appendChild(box);
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
}
|
|
186
|
-
linkedComponentClick(event) {
|
|
187
|
-
const targetElement = document.getElementById(this.linkedComponent);
|
|
188
|
-
const box = document.querySelector(`bcm-popover-box[id="dropdown-box-${this._id}"]`);
|
|
189
|
-
const isClickBox = Generate.findEventPath(event, box);
|
|
190
|
-
const isClickThis = Generate.findEventPath(event, targetElement);
|
|
191
|
-
if (!isClickBox && !isClickThis) {
|
|
192
|
-
this.isOpen = false;
|
|
193
|
-
return;
|
|
194
|
-
}
|
|
195
|
-
if (isClickBox || isClickThis) {
|
|
196
|
-
this.createBox();
|
|
197
|
-
this.isOpen = true;
|
|
198
|
-
this.dropdownLinkedComponent.emit(true);
|
|
199
|
-
}
|
|
200
|
-
const isClickDismiss = Generate.findEventPathHasAttribute(event, 'data-dismiss');
|
|
201
|
-
if (isClickDismiss) {
|
|
202
|
-
this.isOpen = false;
|
|
203
|
-
this.dropdownLinkedComponent.emit(false);
|
|
204
|
-
return;
|
|
205
|
-
}
|
|
206
|
-
}
|
|
207
|
-
checkClick() {
|
|
208
|
-
if (this.getPopoverBox()) {
|
|
209
|
-
this.isOpen = !this.isOpen;
|
|
210
|
-
this.isOpen ? this.getPopoverBox().show() : this.getPopoverBox().hide();
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
getPopoverBox() {
|
|
214
|
-
this.createBox();
|
|
215
|
-
return document.querySelector(`old-bcm-popover-box[id="dropdown-box-${this._id}"]`);
|
|
216
|
-
}
|
|
217
84
|
render() {
|
|
218
|
-
const { size, kind, disabled, icon, color, href, target, loading, type, variant, fullWidth } = this;
|
|
85
|
+
const { size, kind, disabled, icon, color, href, target, loading, type, variant, fullWidth, isOpen } = this;
|
|
219
86
|
const hostClasses = classnames('bcm-dropdown', 'bcm-dropdown__type-' + type, {
|
|
220
87
|
'full-width': fullWidth,
|
|
221
88
|
'no-style': this.noStyle,
|
|
@@ -223,15 +90,14 @@ const BcmDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
223
90
|
});
|
|
224
91
|
const attributes = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, (disabled && { disabled })), (loading && { loading })), (kind && { kind })), (size && { size })), (variant && { variant })), (color && { color })), (this.menuId && { 'menu-id': this.menuId }));
|
|
225
92
|
const iconClasses = classnames('bcm-dropdown__icon', {
|
|
226
|
-
'bcm-dropdown__icon--open':
|
|
93
|
+
'bcm-dropdown__icon--open': isOpen,
|
|
227
94
|
});
|
|
228
95
|
const dropdownIcon = (h("span", { class: iconClasses }, h("bcm-icon", { icon: this.dropdownIcon })));
|
|
229
|
-
return (h(Host, { class: hostClasses
|
|
96
|
+
return (h(Host, { class: hostClasses }, h("span", { hidden: true }, h("slot", null)), this.noStyle && h("slot", null), !this.noStyle && (h("bcm-button", Object.assign({ class: "main-button", id: `${this._id}-button` }, attributes, (icon && { icon }), (href && type === 'split' && { href }), (target && type === 'split' && { target }), (fullWidth && { fullWidth })), h("slot", null), type === 'dropdown' && dropdownIcon)), !this.noStyle && type === 'split' && (h("bcm-button", Object.assign({ id: `${this._id}-button-split`, class: "split-button" }, attributes), dropdownIcon)), h("bcm-linked", { id: `${this.menuId}`, "target-id": `${this._id}-button${type === 'split' ? '-split' : ''}`, placement: this.placement || (type === 'dropdown' ? 'bottom-start' : 'bottom-end'), "max-height": this.maxHeight, "min-height": this.minHeight, height: this.height, "on-bcm-open": e => { var _a; return ((_a = e === null || e === void 0 ? void 0 : e.target) === null || _a === void 0 ? void 0 : _a.id) == this.menuId && (this.isOpen = e.detail); } }, this.data && this.data.length > 0 && h("bcm-menu", { data: this.data, selectable: this.selectable, "on-bcm-click": e => this.bcmClick.emit(e.detail) }))));
|
|
230
97
|
}
|
|
231
98
|
get el() { return this; }
|
|
232
99
|
static get watchers() { return {
|
|
233
|
-
"data": ["dataChanged"]
|
|
234
|
-
"isOpen": ["isOpenChanged"]
|
|
100
|
+
"data": ["dataChanged"]
|
|
235
101
|
}; }
|
|
236
102
|
static get style() { return dropdownCss; }
|
|
237
103
|
}, [4, "bcm-dropdown", {
|
|
@@ -250,22 +116,21 @@ const BcmDropdown$1 = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement
|
|
|
250
116
|
"noStyle": [1028, "no-style"],
|
|
251
117
|
"dropdownIcon": [1025, "dropdown-icon"],
|
|
252
118
|
"linkedComponent": [1025, "linked-component"],
|
|
253
|
-
"
|
|
254
|
-
"
|
|
255
|
-
"
|
|
256
|
-
"
|
|
257
|
-
"
|
|
258
|
-
"
|
|
259
|
-
"
|
|
260
|
-
"
|
|
261
|
-
"
|
|
262
|
-
"minHeight": [1025, "min-height"],
|
|
119
|
+
"loading": [4],
|
|
120
|
+
"variant": [1],
|
|
121
|
+
"dataDismiss": [4, "data-dismiss"],
|
|
122
|
+
"fullWidth": [4, "full-width"],
|
|
123
|
+
"iconPosition": [1, "icon-position"],
|
|
124
|
+
"placement": [1],
|
|
125
|
+
"height": [8],
|
|
126
|
+
"maxHeight": [1, "max-height"],
|
|
127
|
+
"minHeight": [1, "min-height"],
|
|
263
128
|
"stopDeepClean": [4, "stop-deep-clean"],
|
|
264
129
|
"selectable": [4],
|
|
265
|
-
"color": [
|
|
130
|
+
"color": [8],
|
|
266
131
|
"data": [1032],
|
|
267
132
|
"setActive": [64]
|
|
268
|
-
}, [[
|
|
133
|
+
}, [[0, "bcm-items", "handleSlotItems"]]]);
|
|
269
134
|
__decorate([
|
|
270
135
|
IsLoad()
|
|
271
136
|
], BcmDropdown$1.prototype, "el", void 0);
|
|
@@ -276,7 +141,7 @@ function defineCustomElement$1() {
|
|
|
276
141
|
if (typeof customElements === "undefined") {
|
|
277
142
|
return;
|
|
278
143
|
}
|
|
279
|
-
const components = ["bcm-dropdown", "bcm-button", "bcm-icon", "bcm-
|
|
144
|
+
const components = ["bcm-dropdown", "bcm-button", "bcm-icon", "bcm-linked", "bcm-menu"];
|
|
280
145
|
components.forEach(tagName => { switch (tagName) {
|
|
281
146
|
case "bcm-dropdown":
|
|
282
147
|
if (!customElements.get(tagName)) {
|
|
@@ -293,12 +158,12 @@ function defineCustomElement$1() {
|
|
|
293
158
|
defineCustomElement$4();
|
|
294
159
|
}
|
|
295
160
|
break;
|
|
296
|
-
case "bcm-
|
|
161
|
+
case "bcm-linked":
|
|
297
162
|
if (!customElements.get(tagName)) {
|
|
298
163
|
defineCustomElement$3();
|
|
299
164
|
}
|
|
300
165
|
break;
|
|
301
|
-
case "
|
|
166
|
+
case "bcm-menu":
|
|
302
167
|
if (!customElements.get(tagName)) {
|
|
303
168
|
defineCustomElement$2();
|
|
304
169
|
}
|