bromcom-ui 2.8.1 → 2.9.0-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.css +1 -1
- package/dist/bromcom-ui/bromcom-ui.esm.js +1 -1
- package/dist/bromcom-ui/{p-0d4a552d.entry.js → p-043beeb5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-80a43b79.js → p-08fb3095.js} +1 -1
- package/dist/bromcom-ui/{p-d011a407.entry.js → p-0a28fd61.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a49ded35.entry.js → p-0c07940d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-02afc93f.entry.js → p-0d9741fc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a8a4460a.entry.js → p-11629904.entry.js} +1 -1
- package/dist/bromcom-ui/{p-274465b7.entry.js → p-11e7f04b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-87df3ffb.js → p-12543c4f.js} +1 -1
- package/dist/bromcom-ui/{p-90894817.entry.js → p-139b0cfc.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d693b8b.entry.js → p-195c4c41.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9c9babdd.entry.js → p-1b8982a8.entry.js} +1 -1
- package/dist/bromcom-ui/p-24aefda6.js +1 -1
- package/dist/bromcom-ui/{p-24a733ff.entry.js → p-25cfdc1c.entry.js} +1 -1
- package/dist/bromcom-ui/p-27a8f8cc.entry.js +5 -0
- package/dist/bromcom-ui/{p-160ef457.entry.js → p-3731f4fb.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2ea24a6e.js → p-431b023c.js} +1 -1
- package/dist/bromcom-ui/{p-236def30.entry.js → p-43bb2a7c.entry.js} +1 -1
- package/dist/bromcom-ui/p-440afdfa.entry.js +5 -0
- package/dist/bromcom-ui/{p-e7028542.entry.js → p-465c6839.entry.js} +1 -1
- package/dist/bromcom-ui/{p-56896e3a.entry.js → p-49105365.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e0618f5d.entry.js → p-4be5dbb6.entry.js} +1 -1
- package/dist/bromcom-ui/p-4fcc0d21.entry.js +5 -0
- package/dist/bromcom-ui/{p-b94fa326.js → p-54bcf02f.js} +1 -1
- package/dist/bromcom-ui/{p-0ee1ff83.entry.js → p-61f2613f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-8864e6af.entry.js → p-62adb1ff.entry.js} +1 -1
- package/dist/bromcom-ui/{p-94293d46.entry.js → p-68e2ddc3.entry.js} +1 -1
- package/dist/bromcom-ui/{p-251bfa4c.entry.js → p-78bfd81b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f902b559.js → p-799af572.js} +1 -1
- package/dist/bromcom-ui/{p-cf7af1fc.entry.js → p-7b09e9b1.entry.js} +1 -1
- package/dist/bromcom-ui/{p-d1598dd5.entry.js → p-7ce49866.entry.js} +1 -1
- package/dist/bromcom-ui/p-8d0ca8c2.js +1 -1
- package/dist/bromcom-ui/{p-89f7a5c7.entry.js → p-908e7c36.entry.js} +1 -1
- package/dist/bromcom-ui/p-92bf3f86.js +5 -0
- package/dist/bromcom-ui/{p-7658ec26.entry.js → p-9bdcbb1a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-f4f4e410.entry.js → p-9be7f6be.entry.js} +1 -1
- package/dist/bromcom-ui/{p-c15e0e77.entry.js → p-a104f436.entry.js} +1 -1
- package/dist/bromcom-ui/{p-be6d0712.entry.js → p-a1b02a4a.entry.js} +1 -1
- package/dist/bromcom-ui/p-a429e85b.js +1 -1
- package/dist/bromcom-ui/{p-dcb2ae7f.entry.js → p-abd0ebef.entry.js} +1 -1
- package/dist/bromcom-ui/p-b0353da0.entry.js +19 -0
- package/dist/bromcom-ui/p-b60bcecf.js +1 -1
- package/dist/bromcom-ui/{p-72b7fda0.entry.js → p-b640b81a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e6ce5ec8.entry.js → p-b7d6857f.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e82340a2.entry.js → p-bad06cf8.entry.js} +1 -1
- package/dist/bromcom-ui/{p-625af6e2.entry.js → p-c41e87a2.entry.js} +1 -1
- package/dist/bromcom-ui/p-c6c6529b.entry.js +5 -0
- package/dist/bromcom-ui/p-cb0afdd3.entry.js +5 -0
- package/dist/bromcom-ui/{p-e0f440b4.js → p-cb6d3c4e.js} +1 -1
- package/dist/bromcom-ui/{p-a3aa9b2a.entry.js → p-cc470d2a.entry.js} +1 -1
- package/dist/bromcom-ui/{p-47b69111.entry.js → p-d0b8b715.entry.js} +1 -1
- package/dist/bromcom-ui/p-d18196f9.entry.js +5 -0
- package/dist/bromcom-ui/{p-4899fba4.entry.js → p-d5b645ba.entry.js} +1 -1
- package/dist/bromcom-ui/{p-dce2079e.entry.js → p-d78958e3.entry.js} +1 -1
- package/dist/bromcom-ui/p-ded0661d.entry.js +5 -0
- package/dist/bromcom-ui/{p-9eb2a75d.entry.js → p-e150d373.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4dac52f8.entry.js → p-f053aa86.entry.js} +1 -1
- package/dist/bromcom-ui/{p-140b10d1.entry.js → p-f589ac2d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-2fc1ab9a.entry.js → p-f606f90c.entry.js} +1 -1
- package/dist/bromcom-ui/{p-334e3147.entry.js → p-ff488369.entry.js} +1 -1
- package/dist/cjs/{bcm-634604e3.js → bcm-ab921827.js} +4 -4
- 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-colorful_2.cjs.entry.js → bcm-avatar_15.cjs.entry.js} +6180 -76
- 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-card.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +416 -0
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +5 -5
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +193 -0
- package/dist/cjs/bcm-collapse.cjs.entry.js +1 -1
- package/dist/cjs/bcm-color-input.cjs.entry.js +5 -5
- 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 +6 -6
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +3 -3
- package/dist/cjs/bcm-form-2.cjs.entry.js +5 -4
- package/dist/cjs/bcm-input-custom.cjs.entry.js +1 -1
- package/dist/cjs/bcm-item.cjs.entry.js +3 -3
- package/dist/cjs/bcm-items.cjs.entry.js +3 -3
- package/dist/cjs/bcm-link.cjs.entry.js +3 -3
- package/dist/cjs/bcm-menu.cjs.entry.js +7 -7
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +5 -5
- package/dist/cjs/bcm-modal-2.cjs.entry.js +6 -6
- package/dist/cjs/bcm-modal.cjs.entry.js +6 -6
- 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 +9 -9
- package/dist/cjs/bcm-radio.cjs.entry.js +12 -12
- package/dist/cjs/bcm-range.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 +8 -8
- 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-tab-item-header.cjs.entry.js +9 -9
- package/dist/cjs/bcm-tab-item.cjs.entry.js +5 -5
- package/dist/cjs/bcm-tag.cjs.entry.js +14 -14
- package/dist/cjs/bcm-text.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +6 -6
- package/dist/cjs/bcm-time-picker.cjs.entry.js +3 -3
- package/dist/cjs/bcm-toast.cjs.entry.js +10 -10
- package/dist/cjs/bromcom-ui.cjs.js +1 -1
- package/dist/cjs/{floating-ui-74eb26d6.js → floating-ui-c9fc2202.js} +2 -2
- package/dist/cjs/{generate-21143214.js → generate-de243a66.js} +1 -1
- package/dist/cjs/{input-template-4617f909.js → input-template-4c532c3a.js} +6 -6
- package/dist/cjs/{json-parse-decarator-8dbf0b0e.js → json-parse-decarator-f61061cf.js} +1 -1
- package/dist/cjs/{label-template-cc69bc21.js → label-template-4d5f99a5.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{number-helper-08a7ff70.js → number-helper-dedd64eb.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-3c8f3a72.js → popover-placement-ccb40073.js} +1 -1
- package/dist/cjs/{slot-template-3e59d7d8.js → slot-template-d70ea082.js} +1 -1
- package/dist/cjs/{stepper-states-9b6818aa.js → stepper-states-faff7944.js} +1 -1
- package/dist/cjs/{string-helper-45cffee0.js → string-helper-d681e5c7.js} +2 -2
- package/dist/cjs/{tooltip-helper-2e8b879b.js → tooltip-helper-edce6fd0.js} +9 -9
- package/dist/cjs/{validators-6a0077a8.js → validators-e5a6ef69.js} +1 -1
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/chip/chip-group.css +127 -0
- package/dist/collection/components/atoms/chip/chip-group.js +336 -0
- package/dist/collection/components/atoms/chip/chip.css +9 -0
- package/dist/collection/components/atoms/chip/chip.js +109 -26
- package/dist/collection/components/organism/form/form.js +1 -0
- package/dist/collection/components/organism/form-2/bcm-form-components.js +1 -0
- package/dist/collection/components/organism/list/list.css +3 -0
- package/dist/components/bcm-chip-group.d.ts +11 -0
- package/dist/components/bcm-chip-group.js +194 -0
- package/dist/components/bcm-chip.js +1 -100
- package/dist/components/bcm-form-2.js +1 -0
- package/dist/components/bcm-form.js +1 -0
- package/dist/components/bcm-list.js +1 -1702
- package/dist/components/chip.js +149 -0
- package/dist/components/generate.js +1 -1
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +1 -0
- package/dist/{esm/bcm-list.entry.js → components/list.js} +136 -31
- package/dist/esm/bcm-9f50af9c.js +1 -1
- 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-colorful_2.entry.js → bcm-avatar_15.entry.js} +6164 -73
- package/dist/esm/bcm-breadcrumb.entry.js +1 -1
- package/dist/esm/bcm-button-group.entry.js +2 -2
- package/dist/esm/bcm-card.entry.js +1 -1
- package/dist/esm/bcm-checkbox-group.entry.js +412 -0
- package/dist/esm/bcm-checkbox-lite_9.entry.js +2 -2
- package/dist/esm/bcm-checkbox_2.entry.js +188 -0
- package/dist/esm/bcm-collapse.entry.js +1 -1
- package/dist/esm/bcm-color-input.entry.js +3 -3
- package/dist/esm/bcm-date-picker.entry.js +2 -2
- package/dist/esm/bcm-datetime-picker.entry.js +2 -2
- package/dist/esm/bcm-default.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +4 -4
- package/dist/esm/bcm-dropdown.entry.js +3 -3
- package/dist/esm/bcm-expansion-panel.entry.js +1 -1
- package/dist/esm/bcm-form-2.entry.js +3 -2
- package/dist/esm/bcm-input-custom.entry.js +1 -1
- package/dist/esm/bcm-item.entry.js +2 -2
- package/dist/esm/bcm-items.entry.js +1 -1
- package/dist/esm/bcm-link.entry.js +1 -1
- package/dist/esm/bcm-menu.entry.js +4 -4
- package/dist/esm/bcm-modal-2-footer.entry.js +3 -3
- package/dist/esm/bcm-modal-2-header.entry.js +3 -3
- package/dist/esm/bcm-modal-2.entry.js +4 -4
- package/dist/esm/bcm-modal.entry.js +2 -2
- package/dist/esm/bcm-popconfirm-box.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +2 -2
- package/dist/esm/bcm-popover.entry.js +4 -4
- package/dist/esm/bcm-progress.entry.js +2 -2
- package/dist/esm/bcm-radio-group.entry.js +4 -4
- package/dist/esm/bcm-radio.entry.js +4 -4
- package/dist/esm/bcm-range.entry.js +2 -2
- 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 +5 -5
- package/dist/esm/bcm-switch.entry.js +2 -2
- package/dist/esm/bcm-tab-group.entry.js +4 -4
- package/dist/esm/bcm-tab-item-header.entry.js +4 -4
- package/dist/esm/bcm-tab-item.entry.js +3 -3
- package/dist/esm/bcm-tag.entry.js +3 -3
- package/dist/esm/bcm-textarea.entry.js +3 -3
- package/dist/esm/bcm-time-picker.entry.js +2 -2
- package/dist/esm/bcm-toast.entry.js +2 -2
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/floating-ui-e7341329.js +1 -1
- package/dist/esm/{generate-a39b1045.js → generate-61676bf1.js} +1 -1
- package/dist/esm/{input-template-e1df6efd.js → input-template-606f7441.js} +2 -2
- package/dist/esm/{json-parse-decarator-b1ceb8c8.js → json-parse-decarator-2303670f.js} +1 -1
- package/dist/esm/label-template-d74fe788.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{number-helper-fa8e8000.js → number-helper-4ef4df19.js} +1 -1
- package/dist/esm/old-bcm-popover-box.entry.js +2 -2
- package/dist/esm/old-bcm-popover.entry.js +2 -2
- package/dist/esm/{stepper-states-44849ee8.js → stepper-states-9bb5528f.js} +1 -1
- package/dist/esm/string-helper-6bd24967.js +1 -1
- package/dist/esm/{tooltip-helper-10b64c23.js → tooltip-helper-79e225e7.js} +4 -4
- package/dist/esm/{validators-dd70be40.js → validators-c4a5912c.js} +1 -1
- package/dist/types/components/atoms/chip/chip-group.d.ts +26 -0
- package/dist/types/components/atoms/chip/chip.d.ts +18 -13
- package/dist/types/components.d.ts +49 -4
- package/package.json +1 -1
- package/dist/bromcom-ui/p-111c4b6a.entry.js +0 -5
- package/dist/bromcom-ui/p-121eca04.entry.js +0 -5
- package/dist/bromcom-ui/p-1eabd5dc.js +0 -10
- package/dist/bromcom-ui/p-55837df1.entry.js +0 -5
- package/dist/bromcom-ui/p-86b8672d.entry.js +0 -5
- package/dist/bromcom-ui/p-8c62e1ca.entry.js +0 -5
- package/dist/bromcom-ui/p-9d23288e.entry.js +0 -5
- package/dist/bromcom-ui/p-b4f40047.entry.js +0 -5
- package/dist/bromcom-ui/p-b5ba17a4.entry.js +0 -13
- package/dist/bromcom-ui/p-b85bdadc.entry.js +0 -5
- package/dist/bromcom-ui/p-cbb3c1f0.entry.js +0 -5
- package/dist/bromcom-ui/p-d155cf69.entry.js +0 -5
- package/dist/bromcom-ui/p-d3cb8d25.js +0 -5
- package/dist/bromcom-ui/p-f3d550ed.entry.js +0 -5
- package/dist/bromcom-ui/p-fdc8effc.entry.js +0 -5
- package/dist/cjs/bcm-avatar_2.cjs.entry.js +0 -139
- package/dist/cjs/bcm-button_7.cjs.entry.js +0 -1521
- package/dist/cjs/bcm-chip.cjs.entry.js +0 -74
- package/dist/cjs/bcm-input.cjs.entry.js +0 -370
- package/dist/cjs/bcm-list.cjs.entry.js +0 -1607
- package/dist/cjs/bcm-rc-overflow_2.cjs.entry.js +0 -2443
- package/dist/cjs/bcm-typography.cjs.entry.js +0 -21
- package/dist/cjs/index-906fb4e5.js +0 -540
- package/dist/esm/bcm-avatar_2.entry.js +0 -134
- package/dist/esm/bcm-button_7.entry.js +0 -1511
- package/dist/esm/bcm-chip.entry.js +0 -70
- package/dist/esm/bcm-input.entry.js +0 -366
- package/dist/esm/bcm-rc-overflow_2.entry.js +0 -2438
- package/dist/esm/bcm-typography.entry.js +0 -17
- package/dist/esm/index-6310a048.js +0 -537
|
@@ -0,0 +1,336 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Built with Stencil
|
|
3
|
+
* Copyright (c) Bromcom.
|
|
4
|
+
*/
|
|
5
|
+
import { Generate } from "@bcm/helpers";
|
|
6
|
+
import { Bcm } from "@bcm/model";
|
|
7
|
+
import { CaptionTemplate, LabelTemplate } from "@bcm/template";
|
|
8
|
+
import { Host, h } from "@stencil/core";
|
|
9
|
+
import cs from "classnames";
|
|
10
|
+
export class BcmChipGroup {
|
|
11
|
+
constructor() {
|
|
12
|
+
this._id = Generate.UID();
|
|
13
|
+
this.name = undefined;
|
|
14
|
+
this.value = undefined;
|
|
15
|
+
this.required = false;
|
|
16
|
+
this.size = "medium";
|
|
17
|
+
this.label = undefined;
|
|
18
|
+
this.caption = undefined;
|
|
19
|
+
this.noCaption = false;
|
|
20
|
+
this.captionType = Bcm.Status.default;
|
|
21
|
+
this.captionError = undefined;
|
|
22
|
+
}
|
|
23
|
+
handleSelectItem(e) {
|
|
24
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
25
|
+
if (target instanceof HTMLElement) {
|
|
26
|
+
const data = e.detail;
|
|
27
|
+
const chipItem = document.createElement("bcm-chip");
|
|
28
|
+
// chipItem.setAttribute("type", "dismissable");
|
|
29
|
+
chipItem.setAttribute("value", data.id);
|
|
30
|
+
chipItem.innerHTML = data.text;
|
|
31
|
+
target.parentNode.insertBefore(chipItem, target);
|
|
32
|
+
this.setSelect(data.id);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
handleDismiss(e) {
|
|
36
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
37
|
+
if (target instanceof HTMLElement) {
|
|
38
|
+
target.remove();
|
|
39
|
+
this.setSelect();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
handleSelect(e) {
|
|
43
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
44
|
+
if (target instanceof HTMLElement) {
|
|
45
|
+
if (target.type === "addable") {
|
|
46
|
+
this.showListComponent(target.id);
|
|
47
|
+
}
|
|
48
|
+
else {
|
|
49
|
+
this.setSelect(target.value);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
showListComponent(id) {
|
|
54
|
+
const listComponent = document.getElementById(id + "-list");
|
|
55
|
+
if (listComponent) {
|
|
56
|
+
listComponent.show();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
getSlots() {
|
|
60
|
+
return this.el.querySelectorAll("bcm-chip");
|
|
61
|
+
}
|
|
62
|
+
setSelect(val = this.value, noEvent = false) {
|
|
63
|
+
const slots = this.getSlots();
|
|
64
|
+
if ((slots === null || slots === void 0 ? void 0 : slots.length) === 0)
|
|
65
|
+
return;
|
|
66
|
+
const slotArray = Array.from(slots);
|
|
67
|
+
const selectedSlot = slotArray.find(slot => slot.value === val);
|
|
68
|
+
if (!selectedSlot) {
|
|
69
|
+
this.value = slotArray[0].value;
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
this.value = val;
|
|
73
|
+
}
|
|
74
|
+
slotArray.forEach(slot => {
|
|
75
|
+
slot.selected = slot.value === this.value;
|
|
76
|
+
});
|
|
77
|
+
if (!noEvent) {
|
|
78
|
+
this.change.emit(this.value);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
setAttr() {
|
|
82
|
+
const slots = this.getSlots();
|
|
83
|
+
if ((slots === null || slots === void 0 ? void 0 : slots.length) === 0)
|
|
84
|
+
return;
|
|
85
|
+
const slotArray = Array.from(slots);
|
|
86
|
+
slotArray.forEach(slot => {
|
|
87
|
+
slot.setAttribute("size", this.size);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
componentWillLoad() {
|
|
91
|
+
this.setSelect();
|
|
92
|
+
}
|
|
93
|
+
componentDidRender() {
|
|
94
|
+
this.setAttr();
|
|
95
|
+
}
|
|
96
|
+
render() {
|
|
97
|
+
const { label, required, noCaption, captionType, captionError, caption } = this;
|
|
98
|
+
const hostClasses = cs("bcm-chip-group");
|
|
99
|
+
return (h(Host, { class: hostClasses }, label && (h("div", null, h(LabelTemplate, { type: captionType, value: label, required: required }))), h("div", { class: "tw-flex tw-flex-wrap tw-gap-1" }, h("slot", null)), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
100
|
+
}
|
|
101
|
+
static get is() { return "bcm-chip-group"; }
|
|
102
|
+
static get originalStyleUrls() {
|
|
103
|
+
return {
|
|
104
|
+
"$": ["chip-group.scss"]
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
static get styleUrls() {
|
|
108
|
+
return {
|
|
109
|
+
"$": ["chip-group.css"]
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
static get properties() {
|
|
113
|
+
return {
|
|
114
|
+
"_id": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"mutable": true,
|
|
117
|
+
"complexType": {
|
|
118
|
+
"original": "string",
|
|
119
|
+
"resolved": "string",
|
|
120
|
+
"references": {}
|
|
121
|
+
},
|
|
122
|
+
"required": false,
|
|
123
|
+
"optional": false,
|
|
124
|
+
"docs": {
|
|
125
|
+
"tags": [],
|
|
126
|
+
"text": ""
|
|
127
|
+
},
|
|
128
|
+
"attribute": "id",
|
|
129
|
+
"reflect": true,
|
|
130
|
+
"defaultValue": "Generate.UID()"
|
|
131
|
+
},
|
|
132
|
+
"name": {
|
|
133
|
+
"type": "string",
|
|
134
|
+
"mutable": false,
|
|
135
|
+
"complexType": {
|
|
136
|
+
"original": "string",
|
|
137
|
+
"resolved": "string",
|
|
138
|
+
"references": {}
|
|
139
|
+
},
|
|
140
|
+
"required": false,
|
|
141
|
+
"optional": false,
|
|
142
|
+
"docs": {
|
|
143
|
+
"tags": [],
|
|
144
|
+
"text": ""
|
|
145
|
+
},
|
|
146
|
+
"attribute": "name",
|
|
147
|
+
"reflect": false
|
|
148
|
+
},
|
|
149
|
+
"value": {
|
|
150
|
+
"type": "any",
|
|
151
|
+
"mutable": true,
|
|
152
|
+
"complexType": {
|
|
153
|
+
"original": "any",
|
|
154
|
+
"resolved": "any",
|
|
155
|
+
"references": {}
|
|
156
|
+
},
|
|
157
|
+
"required": false,
|
|
158
|
+
"optional": false,
|
|
159
|
+
"docs": {
|
|
160
|
+
"tags": [],
|
|
161
|
+
"text": ""
|
|
162
|
+
},
|
|
163
|
+
"attribute": "value",
|
|
164
|
+
"reflect": false
|
|
165
|
+
},
|
|
166
|
+
"required": {
|
|
167
|
+
"type": "boolean",
|
|
168
|
+
"mutable": false,
|
|
169
|
+
"complexType": {
|
|
170
|
+
"original": "boolean",
|
|
171
|
+
"resolved": "boolean",
|
|
172
|
+
"references": {}
|
|
173
|
+
},
|
|
174
|
+
"required": false,
|
|
175
|
+
"optional": false,
|
|
176
|
+
"docs": {
|
|
177
|
+
"tags": [],
|
|
178
|
+
"text": ""
|
|
179
|
+
},
|
|
180
|
+
"attribute": "required",
|
|
181
|
+
"reflect": false,
|
|
182
|
+
"defaultValue": "false"
|
|
183
|
+
},
|
|
184
|
+
"size": {
|
|
185
|
+
"type": "string",
|
|
186
|
+
"mutable": false,
|
|
187
|
+
"complexType": {
|
|
188
|
+
"original": "\"small\" | \"medium\" | \"large\"",
|
|
189
|
+
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
190
|
+
"references": {}
|
|
191
|
+
},
|
|
192
|
+
"required": false,
|
|
193
|
+
"optional": false,
|
|
194
|
+
"docs": {
|
|
195
|
+
"tags": [],
|
|
196
|
+
"text": ""
|
|
197
|
+
},
|
|
198
|
+
"attribute": "size",
|
|
199
|
+
"reflect": false,
|
|
200
|
+
"defaultValue": "\"medium\""
|
|
201
|
+
},
|
|
202
|
+
"label": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"mutable": false,
|
|
205
|
+
"complexType": {
|
|
206
|
+
"original": "string",
|
|
207
|
+
"resolved": "string",
|
|
208
|
+
"references": {}
|
|
209
|
+
},
|
|
210
|
+
"required": false,
|
|
211
|
+
"optional": false,
|
|
212
|
+
"docs": {
|
|
213
|
+
"tags": [],
|
|
214
|
+
"text": ""
|
|
215
|
+
},
|
|
216
|
+
"attribute": "label",
|
|
217
|
+
"reflect": false
|
|
218
|
+
},
|
|
219
|
+
"caption": {
|
|
220
|
+
"type": "string",
|
|
221
|
+
"mutable": false,
|
|
222
|
+
"complexType": {
|
|
223
|
+
"original": "string",
|
|
224
|
+
"resolved": "string",
|
|
225
|
+
"references": {}
|
|
226
|
+
},
|
|
227
|
+
"required": false,
|
|
228
|
+
"optional": false,
|
|
229
|
+
"docs": {
|
|
230
|
+
"tags": [],
|
|
231
|
+
"text": ""
|
|
232
|
+
},
|
|
233
|
+
"attribute": "caption",
|
|
234
|
+
"reflect": false
|
|
235
|
+
},
|
|
236
|
+
"noCaption": {
|
|
237
|
+
"type": "boolean",
|
|
238
|
+
"mutable": false,
|
|
239
|
+
"complexType": {
|
|
240
|
+
"original": "boolean",
|
|
241
|
+
"resolved": "boolean",
|
|
242
|
+
"references": {}
|
|
243
|
+
},
|
|
244
|
+
"required": false,
|
|
245
|
+
"optional": false,
|
|
246
|
+
"docs": {
|
|
247
|
+
"tags": [],
|
|
248
|
+
"text": ""
|
|
249
|
+
},
|
|
250
|
+
"attribute": "no-caption",
|
|
251
|
+
"reflect": false,
|
|
252
|
+
"defaultValue": "false"
|
|
253
|
+
},
|
|
254
|
+
"captionType": {
|
|
255
|
+
"type": "string",
|
|
256
|
+
"mutable": false,
|
|
257
|
+
"complexType": {
|
|
258
|
+
"original": "StatusTypes",
|
|
259
|
+
"resolved": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
|
|
260
|
+
"references": {
|
|
261
|
+
"StatusTypes": {
|
|
262
|
+
"location": "import",
|
|
263
|
+
"path": "@bcm/model"
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
},
|
|
267
|
+
"required": false,
|
|
268
|
+
"optional": false,
|
|
269
|
+
"docs": {
|
|
270
|
+
"tags": [],
|
|
271
|
+
"text": ""
|
|
272
|
+
},
|
|
273
|
+
"attribute": "caption-type",
|
|
274
|
+
"reflect": false,
|
|
275
|
+
"defaultValue": "Bcm.Status.default"
|
|
276
|
+
},
|
|
277
|
+
"captionError": {
|
|
278
|
+
"type": "string",
|
|
279
|
+
"mutable": false,
|
|
280
|
+
"complexType": {
|
|
281
|
+
"original": "string",
|
|
282
|
+
"resolved": "string",
|
|
283
|
+
"references": {}
|
|
284
|
+
},
|
|
285
|
+
"required": false,
|
|
286
|
+
"optional": false,
|
|
287
|
+
"docs": {
|
|
288
|
+
"tags": [],
|
|
289
|
+
"text": ""
|
|
290
|
+
},
|
|
291
|
+
"attribute": "caption-error",
|
|
292
|
+
"reflect": false
|
|
293
|
+
}
|
|
294
|
+
};
|
|
295
|
+
}
|
|
296
|
+
static get events() {
|
|
297
|
+
return [{
|
|
298
|
+
"method": "change",
|
|
299
|
+
"name": "bcm-change",
|
|
300
|
+
"bubbles": true,
|
|
301
|
+
"cancelable": true,
|
|
302
|
+
"composed": true,
|
|
303
|
+
"docs": {
|
|
304
|
+
"tags": [],
|
|
305
|
+
"text": ""
|
|
306
|
+
},
|
|
307
|
+
"complexType": {
|
|
308
|
+
"original": "any",
|
|
309
|
+
"resolved": "any",
|
|
310
|
+
"references": {}
|
|
311
|
+
}
|
|
312
|
+
}];
|
|
313
|
+
}
|
|
314
|
+
static get elementRef() { return "el"; }
|
|
315
|
+
static get listeners() {
|
|
316
|
+
return [{
|
|
317
|
+
"name": "bcm-chip-select-item",
|
|
318
|
+
"method": "handleSelectItem",
|
|
319
|
+
"target": undefined,
|
|
320
|
+
"capture": false,
|
|
321
|
+
"passive": false
|
|
322
|
+
}, {
|
|
323
|
+
"name": "bcm-chip-dismiss",
|
|
324
|
+
"method": "handleDismiss",
|
|
325
|
+
"target": undefined,
|
|
326
|
+
"capture": false,
|
|
327
|
+
"passive": false
|
|
328
|
+
}, {
|
|
329
|
+
"name": "bcm-chip-select",
|
|
330
|
+
"method": "handleSelect",
|
|
331
|
+
"target": undefined,
|
|
332
|
+
"capture": false,
|
|
333
|
+
"passive": false
|
|
334
|
+
}];
|
|
335
|
+
}
|
|
336
|
+
}
|
|
@@ -185,6 +185,9 @@
|
|
|
185
185
|
width: 14px;
|
|
186
186
|
height: 14px;
|
|
187
187
|
}
|
|
188
|
+
.bcm-chip__size-small .bcm-chip--selected-icon {
|
|
189
|
+
width: 8px;
|
|
190
|
+
}
|
|
188
191
|
.bcm-chip__size-medium {
|
|
189
192
|
font-size: 12px;
|
|
190
193
|
line-height: calc(12px + 8px);
|
|
@@ -193,6 +196,9 @@
|
|
|
193
196
|
width: 16px;
|
|
194
197
|
height: 16px;
|
|
195
198
|
}
|
|
199
|
+
.bcm-chip__size-medium .bcm-chip--selected-icon {
|
|
200
|
+
width: 10px;
|
|
201
|
+
}
|
|
196
202
|
.bcm-chip__size-large {
|
|
197
203
|
font-size: 14px;
|
|
198
204
|
line-height: calc(14px + 8px);
|
|
@@ -200,4 +206,7 @@
|
|
|
200
206
|
.bcm-chip__size-large .bcm-avatar {
|
|
201
207
|
width: 18px;
|
|
202
208
|
height: 18px;
|
|
209
|
+
}
|
|
210
|
+
.bcm-chip__size-large .bcm-chip--selected-icon {
|
|
211
|
+
width: 12px;
|
|
203
212
|
}
|
|
@@ -2,36 +2,39 @@
|
|
|
2
2
|
* Built with Stencil
|
|
3
3
|
* Copyright (c) Bromcom.
|
|
4
4
|
*/
|
|
5
|
-
import { h, Host } from
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import {
|
|
5
|
+
import { h, Host } from "@stencil/core";
|
|
6
|
+
import cs from "classnames";
|
|
7
|
+
import { ColorHelper } from "../../../helper/color-helper";
|
|
8
|
+
import { Generate } from "../../../helper/generate";
|
|
9
9
|
export class BcmChip {
|
|
10
10
|
constructor() {
|
|
11
11
|
this._id = Generate.UID();
|
|
12
|
-
this.type =
|
|
13
|
-
this.size =
|
|
12
|
+
this.type = "default";
|
|
13
|
+
this.size = "medium";
|
|
14
14
|
this.avatar = undefined;
|
|
15
15
|
this.icon = undefined;
|
|
16
16
|
this.disabled = undefined;
|
|
17
17
|
this.color = undefined;
|
|
18
|
+
this.selected = false;
|
|
19
|
+
this.value = undefined;
|
|
20
|
+
this.data = [];
|
|
18
21
|
}
|
|
19
22
|
// @ts-ignore
|
|
20
23
|
setColor() {
|
|
21
|
-
if (!this.color)
|
|
24
|
+
if (!this.color && !this.selected)
|
|
22
25
|
return;
|
|
23
|
-
const color = this.color;
|
|
26
|
+
const color = this.selected ? "indigo" : this.color; // Important: Find a solution for this in V3! ( selected ? this.color : "indigo" )
|
|
24
27
|
return {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
"--bcm-chip-color": ColorHelper.dsColor(color + "-500"),
|
|
29
|
+
"--bcm-chip-color-hover": ColorHelper.dsColor(color + "-500"),
|
|
30
|
+
"--bcm-chip-color-focus": ColorHelper.dsColor(color + "-600"),
|
|
31
|
+
"--bcm-chip-color-active": ColorHelper.dsColor(color + "-700"),
|
|
32
|
+
"--bcm-chip-color-disabled": ColorHelper.dsColor("slate" + "-300"),
|
|
33
|
+
"--bcm-chip-background-color": ColorHelper.dsColor(color + "-100"),
|
|
34
|
+
"--bcm-chip-background-color-hover": ColorHelper.dsColor(color + "-200"),
|
|
35
|
+
"--bcm-chip-background-color-focus": ColorHelper.dsColor(color + "-300"),
|
|
36
|
+
"--bcm-chip-background-color-active": ColorHelper.dsColor(color + "-200"),
|
|
37
|
+
"--bcm-chip-background-color-disabled": ColorHelper.dsColor("slate" + "-100"),
|
|
35
38
|
};
|
|
36
39
|
}
|
|
37
40
|
handleDismiss(e) {
|
|
@@ -44,13 +47,25 @@ export class BcmChip {
|
|
|
44
47
|
e.preventDefault();
|
|
45
48
|
this.bcmChipAddable.emit(this.el);
|
|
46
49
|
}
|
|
50
|
+
listSelectedItems(e) {
|
|
51
|
+
// To be added to v3
|
|
52
|
+
e.stopPropagation();
|
|
53
|
+
e.preventDefault();
|
|
54
|
+
if (e.detail) {
|
|
55
|
+
this.bcmChipSelectItem.emit(e.detail);
|
|
56
|
+
e.target.setClear();
|
|
57
|
+
this.data = this.data.filter(item => item.id !== e.detail.id);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
47
60
|
render() {
|
|
48
61
|
const { type, size, avatar, disabled, color } = this;
|
|
49
|
-
const hostClasses = cs(
|
|
50
|
-
|
|
51
|
-
|
|
62
|
+
const hostClasses = cs("bcm-chip", `bcm-chip__type-${type}`, `bcm-chip__size-${size}`, {
|
|
63
|
+
"bcm-chip--disabled": disabled,
|
|
64
|
+
"bcm-chip--avatar": avatar,
|
|
52
65
|
});
|
|
53
|
-
return (h(Host, { class: hostClasses, tabindex: "0", disabled: disabled, style: this.setColor(), onClick: e => this.bcmChipSelect.emit(e) }, avatar && h("bcm-avatar", Object.assign({ size: size }, (color && { color }), (avatar && { image: avatar }))), type ===
|
|
66
|
+
return (h(Host, { class: hostClasses, tabindex: "0", disabled: disabled, style: this.setColor(), onClick: e => this.bcmChipSelect.emit(e) }, h("div", { class: cs(this.selected ? "bcm-chip--selected-icon" : "tw-hidden tw-w-0") }, h("bcm-icon", { icon: "fal fa-check" })), avatar && h("bcm-avatar", Object.assign({ size: size }, (color && { color }), (avatar && { image: avatar }))), type === "addable" && (h("span", { class: "bcm-chip__left" }, h("bcm-icon", { onClick: e => this.handleAddable(e), icon: "far fa-plus" }))), h("slot", null), type === "dismissable" && (h("span", { class: "bcm-chip__type-dismissable-icon" }, h("bcm-icon", { onClick: e => this.handleDismiss(e), icon: "fal fa-times" }))), this.data &&
|
|
67
|
+
this.data.length > 0 && ( // To be added to v3
|
|
68
|
+
h("bcm-list", { "onBcm-change": e => this.listSelectedItems(e), id: this._id + "-list", data: this.data, linkedComponent: this._id, searchable: true, highlight: true }))));
|
|
54
69
|
}
|
|
55
70
|
static get is() { return "bcm-chip"; }
|
|
56
71
|
static get originalStyleUrls() {
|
|
@@ -87,7 +102,7 @@ export class BcmChip {
|
|
|
87
102
|
"type": "string",
|
|
88
103
|
"mutable": true,
|
|
89
104
|
"complexType": {
|
|
90
|
-
"original": "
|
|
105
|
+
"original": "\"default\" | \"dismissable\" | \"addable\" | \"checkable\"",
|
|
91
106
|
"resolved": "\"addable\" | \"checkable\" | \"default\" | \"dismissable\"",
|
|
92
107
|
"references": {}
|
|
93
108
|
},
|
|
@@ -99,13 +114,13 @@ export class BcmChip {
|
|
|
99
114
|
},
|
|
100
115
|
"attribute": "type",
|
|
101
116
|
"reflect": false,
|
|
102
|
-
"defaultValue": "
|
|
117
|
+
"defaultValue": "\"default\""
|
|
103
118
|
},
|
|
104
119
|
"size": {
|
|
105
120
|
"type": "string",
|
|
106
121
|
"mutable": true,
|
|
107
122
|
"complexType": {
|
|
108
|
-
"original": "
|
|
123
|
+
"original": "\"small\" | \"medium\" | \"large\"",
|
|
109
124
|
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
110
125
|
"references": {}
|
|
111
126
|
},
|
|
@@ -117,7 +132,7 @@ export class BcmChip {
|
|
|
117
132
|
},
|
|
118
133
|
"attribute": "size",
|
|
119
134
|
"reflect": false,
|
|
120
|
-
"defaultValue": "
|
|
135
|
+
"defaultValue": "\"medium\""
|
|
121
136
|
},
|
|
122
137
|
"avatar": {
|
|
123
138
|
"type": "any",
|
|
@@ -186,6 +201,59 @@ export class BcmChip {
|
|
|
186
201
|
},
|
|
187
202
|
"attribute": "color",
|
|
188
203
|
"reflect": false
|
|
204
|
+
},
|
|
205
|
+
"selected": {
|
|
206
|
+
"type": "boolean",
|
|
207
|
+
"mutable": true,
|
|
208
|
+
"complexType": {
|
|
209
|
+
"original": "boolean",
|
|
210
|
+
"resolved": "boolean",
|
|
211
|
+
"references": {}
|
|
212
|
+
},
|
|
213
|
+
"required": false,
|
|
214
|
+
"optional": false,
|
|
215
|
+
"docs": {
|
|
216
|
+
"tags": [],
|
|
217
|
+
"text": ""
|
|
218
|
+
},
|
|
219
|
+
"attribute": "selected",
|
|
220
|
+
"reflect": false,
|
|
221
|
+
"defaultValue": "false"
|
|
222
|
+
},
|
|
223
|
+
"value": {
|
|
224
|
+
"type": "string",
|
|
225
|
+
"mutable": true,
|
|
226
|
+
"complexType": {
|
|
227
|
+
"original": "string",
|
|
228
|
+
"resolved": "string",
|
|
229
|
+
"references": {}
|
|
230
|
+
},
|
|
231
|
+
"required": false,
|
|
232
|
+
"optional": false,
|
|
233
|
+
"docs": {
|
|
234
|
+
"tags": [],
|
|
235
|
+
"text": ""
|
|
236
|
+
},
|
|
237
|
+
"attribute": "value",
|
|
238
|
+
"reflect": false
|
|
239
|
+
},
|
|
240
|
+
"data": {
|
|
241
|
+
"type": "any",
|
|
242
|
+
"mutable": true,
|
|
243
|
+
"complexType": {
|
|
244
|
+
"original": "any",
|
|
245
|
+
"resolved": "any",
|
|
246
|
+
"references": {}
|
|
247
|
+
},
|
|
248
|
+
"required": false,
|
|
249
|
+
"optional": false,
|
|
250
|
+
"docs": {
|
|
251
|
+
"tags": [],
|
|
252
|
+
"text": ""
|
|
253
|
+
},
|
|
254
|
+
"attribute": "data",
|
|
255
|
+
"reflect": false,
|
|
256
|
+
"defaultValue": "[]"
|
|
189
257
|
}
|
|
190
258
|
};
|
|
191
259
|
}
|
|
@@ -235,6 +303,21 @@ export class BcmChip {
|
|
|
235
303
|
"resolved": "any",
|
|
236
304
|
"references": {}
|
|
237
305
|
}
|
|
306
|
+
}, {
|
|
307
|
+
"method": "bcmChipSelectItem",
|
|
308
|
+
"name": "bcm-chip-select-item",
|
|
309
|
+
"bubbles": true,
|
|
310
|
+
"cancelable": true,
|
|
311
|
+
"composed": true,
|
|
312
|
+
"docs": {
|
|
313
|
+
"tags": [],
|
|
314
|
+
"text": ""
|
|
315
|
+
},
|
|
316
|
+
"complexType": {
|
|
317
|
+
"original": "any",
|
|
318
|
+
"resolved": "any",
|
|
319
|
+
"references": {}
|
|
320
|
+
}
|
|
238
321
|
}];
|
|
239
322
|
}
|
|
240
323
|
static get elementRef() { return "el"; }
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Components, JSX } from "../types/components";
|
|
2
|
+
|
|
3
|
+
interface BcmChipGroup extends Components.BcmChipGroup, HTMLElement {}
|
|
4
|
+
export const BcmChipGroup: {
|
|
5
|
+
prototype: BcmChipGroup;
|
|
6
|
+
new (): BcmChipGroup;
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Used to define this component and all nested components recursively.
|
|
10
|
+
*/
|
|
11
|
+
export const defineCustomElement: () => void;
|