bromcom-ui 2.8.1 → 2.9.0-rc.0
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-4899fba4.entry.js → p-0906c9b4.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e7028542.entry.js → p-0ee4e283.entry.js} +1 -1
- package/dist/bromcom-ui/{p-4dac52f8.entry.js → p-0fdbbbe8.entry.js} +1 -1
- package/dist/bromcom-ui/p-14378828.entry.js +5 -0
- package/dist/bromcom-ui/{p-251bfa4c.entry.js → p-15fa3329.entry.js} +1 -1
- package/dist/bromcom-ui/{p-9c9babdd.entry.js → p-1c5a2111.entry.js} +1 -1
- package/dist/bromcom-ui/{p-e0618f5d.entry.js → p-20ac20d4.entry.js} +1 -1
- package/dist/bromcom-ui/p-24aefda6.js +1 -1
- package/dist/bromcom-ui/p-2cb4a196.entry.js +5 -0
- package/dist/bromcom-ui/p-2ea24a6e.js +1 -1
- package/dist/bromcom-ui/{p-0ee1ff83.entry.js → p-344a4674.entry.js} +1 -1
- package/dist/bromcom-ui/p-3ad545f0.entry.js +5 -0
- package/dist/bromcom-ui/{p-90894817.entry.js → p-40a5e4fc.entry.js} +1 -1
- package/dist/bromcom-ui/p-440afdfa.entry.js +5 -0
- package/dist/bromcom-ui/{p-94293d46.entry.js → p-4b34b3f9.entry.js} +1 -1
- package/dist/bromcom-ui/{p-a3aa9b2a.entry.js → p-55001c80.entry.js} +1 -1
- package/dist/bromcom-ui/{p-625af6e2.entry.js → p-5f288af5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-274465b7.entry.js → p-70b428e8.entry.js} +1 -1
- package/dist/bromcom-ui/p-89b21290.entry.js +5 -0
- package/dist/bromcom-ui/p-8d0ca8c2.js +1 -1
- package/dist/bromcom-ui/{p-e82340a2.entry.js → p-9b10d955.entry.js} +1 -1
- package/dist/bromcom-ui/{p-47b69111.entry.js → p-9c7e9b5d.entry.js} +1 -1
- package/dist/bromcom-ui/p-a0a3fd94.entry.js +5 -0
- package/dist/bromcom-ui/{p-f4f4e410.entry.js → p-a2046742.entry.js} +1 -1
- package/dist/bromcom-ui/p-a429e85b.js +1 -1
- package/dist/bromcom-ui/p-a97ee69d.entry.js +19 -0
- package/dist/bromcom-ui/{p-2fc1ab9a.entry.js → p-ab55def1.entry.js} +1 -1
- package/dist/bromcom-ui/p-b60bcecf.js +1 -1
- package/dist/bromcom-ui/{p-a8a4460a.entry.js → p-c9b10de5.entry.js} +1 -1
- package/dist/bromcom-ui/{p-160ef457.entry.js → p-cad8f786.entry.js} +1 -1
- package/dist/bromcom-ui/{p-140b10d1.entry.js → p-e008411a.entry.js} +1 -1
- package/dist/bromcom-ui/p-e0f440b4.js +1 -1
- package/dist/bromcom-ui/{p-c15e0e77.entry.js → p-e3cafc0d.entry.js} +1 -1
- package/dist/bromcom-ui/{p-0d693b8b.entry.js → p-e606c42b.entry.js} +1 -1
- package/dist/bromcom-ui/{p-86b8672d.entry.js → p-e66821e5.entry.js} +1 -1
- package/dist/cjs/{bcm-634604e3.js → bcm-ab921827.js} +4 -4
- package/dist/cjs/bcm-alert.cjs.entry.js +2 -2
- package/dist/cjs/{bcm-colorful_2.cjs.entry.js → bcm-avatar_15.cjs.entry.js} +6232 -149
- package/dist/cjs/bcm-button-group.cjs.entry.js +5 -5
- package/dist/cjs/bcm-card.cjs.entry.js +3 -3
- package/dist/cjs/bcm-checkbox-group.cjs.entry.js +416 -0
- package/dist/cjs/bcm-checkbox-lite_9.cjs.entry.js +4 -4
- package/dist/cjs/bcm-checkbox_2.cjs.entry.js +193 -0
- package/dist/cjs/bcm-color-input.cjs.entry.js +2 -2
- package/dist/cjs/bcm-date-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-datetime-picker.cjs.entry.js +7 -7
- package/dist/cjs/bcm-drawer.cjs.entry.js +4 -4
- package/dist/cjs/bcm-dropdown.cjs.entry.js +4 -4
- package/dist/cjs/bcm-expansion-panel.cjs.entry.js +2 -2
- package/dist/cjs/bcm-form-2.cjs.entry.js +4 -3
- package/dist/cjs/bcm-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-items.cjs.entry.js +2 -2
- package/dist/cjs/bcm-link.cjs.entry.js +3 -3
- package/dist/cjs/bcm-menu.cjs.entry.js +4 -4
- package/dist/cjs/bcm-modal-2-footer.cjs.entry.js +2 -2
- package/dist/cjs/bcm-modal-2-header.cjs.entry.js +2 -2
- package/dist/cjs/bcm-modal-2.cjs.entry.js +3 -3
- package/dist/cjs/bcm-modal.cjs.entry.js +5 -5
- package/dist/cjs/bcm-popconfirm-box.cjs.entry.js +3 -3
- package/dist/cjs/bcm-popconfirm.cjs.entry.js +3 -3
- package/dist/cjs/bcm-popover.cjs.entry.js +5 -5
- package/dist/cjs/bcm-progress.cjs.entry.js +2 -2
- package/dist/cjs/bcm-radio-group.cjs.entry.js +6 -6
- package/dist/cjs/bcm-radio.cjs.entry.js +9 -9
- package/dist/cjs/bcm-range.cjs.entry.js +4 -4
- package/dist/cjs/bcm-select.cjs.entry.js +2 -2
- package/dist/cjs/bcm-stepper.cjs.entry.js +4 -4
- package/dist/cjs/bcm-switch.cjs.entry.js +7 -7
- package/dist/cjs/bcm-tab-group.cjs.entry.js +3 -3
- package/dist/cjs/bcm-tab-item-header.cjs.entry.js +6 -6
- package/dist/cjs/bcm-tab-item.cjs.entry.js +2 -2
- package/dist/cjs/bcm-tag.cjs.entry.js +12 -12
- package/dist/cjs/bcm-text.cjs.entry.js +3 -3
- package/dist/cjs/bcm-textarea.cjs.entry.js +5 -5
- package/dist/cjs/bcm-time-picker.cjs.entry.js +2 -2
- package/dist/cjs/bcm-toast.cjs.entry.js +9 -9
- 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/{input-template-4617f909.js → input-template-1441e468.js} +5 -5
- package/dist/cjs/{label-template-cc69bc21.js → label-template-4d5f99a5.js} +3 -3
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/old-bcm-popover-box.cjs.entry.js +4 -4
- package/dist/cjs/old-bcm-popover.cjs.entry.js +3 -3
- 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/{string-helper-45cffee0.js → string-helper-d681e5c7.js} +2 -2
- package/dist/cjs/{tooltip-helper-2e8b879b.js → tooltip-helper-235b26ea.js} +6 -6
- package/dist/collection/collection-manifest.json +1 -0
- package/dist/collection/components/atoms/chip/chip-group.js +292 -0
- package/dist/collection/components/atoms/chip/chip.js +107 -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 +174 -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/{esm/bcm-chip.entry.js → components/chip.js} +110 -33
- 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-colorful_2.entry.js → bcm-avatar_15.entry.js} +6219 -149
- package/dist/esm/bcm-button-group.entry.js +1 -1
- package/dist/esm/bcm-checkbox-group.entry.js +412 -0
- package/dist/esm/bcm-checkbox-lite_9.entry.js +1 -1
- package/dist/esm/bcm-checkbox_2.entry.js +188 -0
- package/dist/esm/bcm-date-picker.entry.js +1 -1
- package/dist/esm/bcm-datetime-picker.entry.js +1 -1
- package/dist/esm/bcm-drawer.entry.js +1 -1
- package/dist/esm/bcm-dropdown.entry.js +1 -1
- package/dist/esm/bcm-form-2.entry.js +2 -1
- package/dist/esm/bcm-item.entry.js +1 -1
- package/dist/esm/bcm-link.entry.js +1 -1
- package/dist/esm/bcm-modal-2.entry.js +1 -1
- package/dist/esm/bcm-modal.entry.js +1 -1
- package/dist/esm/bcm-popconfirm.entry.js +1 -1
- package/dist/esm/bcm-popover.entry.js +1 -1
- package/dist/esm/bcm-progress.entry.js +1 -1
- package/dist/esm/bcm-radio-group.entry.js +1 -1
- package/dist/esm/bcm-radio.entry.js +1 -1
- package/dist/esm/bcm-range.entry.js +1 -1
- package/dist/esm/bcm-stepper.entry.js +1 -1
- package/dist/esm/bcm-switch.entry.js +1 -1
- package/dist/esm/bcm-tab-group.entry.js +1 -1
- package/dist/esm/bcm-tab-item-header.entry.js +1 -1
- package/dist/esm/bcm-tag.entry.js +1 -1
- package/dist/esm/bcm-textarea.entry.js +1 -1
- package/dist/esm/bcm-time-picker.entry.js +1 -1
- package/dist/esm/bcm-toast.entry.js +1 -1
- package/dist/esm/bromcom-ui.js +1 -1
- package/dist/esm/floating-ui-e7341329.js +1 -1
- package/dist/esm/input-template-e1df6efd.js +1 -1
- package/dist/esm/label-template-d74fe788.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/old-bcm-popover.entry.js +1 -1
- package/dist/esm/string-helper-6bd24967.js +1 -1
- package/dist/esm/tooltip-helper-10b64c23.js +1 -1
- package/dist/types/components/atoms/chip/chip-group.d.ts +22 -0
- package/dist/types/components/atoms/chip/chip.d.ts +18 -13
- package/dist/types/components.d.ts +47 -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-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-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-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,292 @@
|
|
|
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.label = undefined;
|
|
17
|
+
this.caption = undefined;
|
|
18
|
+
this.noCaption = false;
|
|
19
|
+
this.captionType = Bcm.Status.default;
|
|
20
|
+
this.captionError = undefined;
|
|
21
|
+
}
|
|
22
|
+
handleSelectItem(e) {
|
|
23
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
24
|
+
if (target instanceof HTMLElement) {
|
|
25
|
+
const data = e.detail;
|
|
26
|
+
const chipItem = document.createElement("bcm-chip");
|
|
27
|
+
chipItem.setAttribute("type", "dismissable");
|
|
28
|
+
chipItem.setAttribute("value", data.id);
|
|
29
|
+
chipItem.innerHTML = data.text;
|
|
30
|
+
target.parentNode.insertBefore(chipItem, target);
|
|
31
|
+
this.setSelect(data.id);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
handleDismiss(e) {
|
|
35
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
36
|
+
if (target instanceof HTMLElement) {
|
|
37
|
+
target.remove();
|
|
38
|
+
this.setSelect();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
handleSelect(e) {
|
|
42
|
+
const target = e === null || e === void 0 ? void 0 : e.target;
|
|
43
|
+
if (target instanceof HTMLElement) {
|
|
44
|
+
if (target.type === "addable") {
|
|
45
|
+
const listComponent = document.getElementById(target.id + "-list");
|
|
46
|
+
if (listComponent) {
|
|
47
|
+
listComponent.show();
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
this.setSelect(target.value);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
getSlots() {
|
|
56
|
+
return this.el.querySelectorAll("bcm-chip");
|
|
57
|
+
}
|
|
58
|
+
setSelect(val = this.value, noEvent = false) {
|
|
59
|
+
const slots = this.getSlots();
|
|
60
|
+
if ((slots === null || slots === void 0 ? void 0 : slots.length) === 0)
|
|
61
|
+
return;
|
|
62
|
+
const slotArray = Array.from(slots);
|
|
63
|
+
const selectedSlot = slotArray.find(slot => slot.value === val);
|
|
64
|
+
if (!selectedSlot) {
|
|
65
|
+
this.value = slotArray[0].value;
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
this.value = val;
|
|
69
|
+
}
|
|
70
|
+
slotArray.forEach(slot => {
|
|
71
|
+
slot.selected = slot.value === this.value;
|
|
72
|
+
});
|
|
73
|
+
if (!noEvent) {
|
|
74
|
+
this.change.emit(this.value);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
componentWillLoad() {
|
|
78
|
+
this.setSelect();
|
|
79
|
+
}
|
|
80
|
+
render() {
|
|
81
|
+
const { label, required, noCaption, captionType, captionError, caption } = this;
|
|
82
|
+
const hostClasses = cs("bcm-chip-group");
|
|
83
|
+
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-2" }, h("slot", null)), h(CaptionTemplate, { noCaption: noCaption, captionType: captionType, captionError: captionError, caption: caption })));
|
|
84
|
+
}
|
|
85
|
+
static get is() { return "bcm-chip-group"; }
|
|
86
|
+
static get properties() {
|
|
87
|
+
return {
|
|
88
|
+
"_id": {
|
|
89
|
+
"type": "string",
|
|
90
|
+
"mutable": true,
|
|
91
|
+
"complexType": {
|
|
92
|
+
"original": "string",
|
|
93
|
+
"resolved": "string",
|
|
94
|
+
"references": {}
|
|
95
|
+
},
|
|
96
|
+
"required": false,
|
|
97
|
+
"optional": false,
|
|
98
|
+
"docs": {
|
|
99
|
+
"tags": [],
|
|
100
|
+
"text": ""
|
|
101
|
+
},
|
|
102
|
+
"attribute": "id",
|
|
103
|
+
"reflect": true,
|
|
104
|
+
"defaultValue": "Generate.UID()"
|
|
105
|
+
},
|
|
106
|
+
"name": {
|
|
107
|
+
"type": "string",
|
|
108
|
+
"mutable": false,
|
|
109
|
+
"complexType": {
|
|
110
|
+
"original": "string",
|
|
111
|
+
"resolved": "string",
|
|
112
|
+
"references": {}
|
|
113
|
+
},
|
|
114
|
+
"required": false,
|
|
115
|
+
"optional": false,
|
|
116
|
+
"docs": {
|
|
117
|
+
"tags": [],
|
|
118
|
+
"text": ""
|
|
119
|
+
},
|
|
120
|
+
"attribute": "name",
|
|
121
|
+
"reflect": false
|
|
122
|
+
},
|
|
123
|
+
"value": {
|
|
124
|
+
"type": "any",
|
|
125
|
+
"mutable": true,
|
|
126
|
+
"complexType": {
|
|
127
|
+
"original": "any",
|
|
128
|
+
"resolved": "any",
|
|
129
|
+
"references": {}
|
|
130
|
+
},
|
|
131
|
+
"required": false,
|
|
132
|
+
"optional": false,
|
|
133
|
+
"docs": {
|
|
134
|
+
"tags": [],
|
|
135
|
+
"text": ""
|
|
136
|
+
},
|
|
137
|
+
"attribute": "value",
|
|
138
|
+
"reflect": false
|
|
139
|
+
},
|
|
140
|
+
"required": {
|
|
141
|
+
"type": "boolean",
|
|
142
|
+
"mutable": false,
|
|
143
|
+
"complexType": {
|
|
144
|
+
"original": "boolean",
|
|
145
|
+
"resolved": "boolean",
|
|
146
|
+
"references": {}
|
|
147
|
+
},
|
|
148
|
+
"required": false,
|
|
149
|
+
"optional": false,
|
|
150
|
+
"docs": {
|
|
151
|
+
"tags": [],
|
|
152
|
+
"text": ""
|
|
153
|
+
},
|
|
154
|
+
"attribute": "required",
|
|
155
|
+
"reflect": false,
|
|
156
|
+
"defaultValue": "false"
|
|
157
|
+
},
|
|
158
|
+
"label": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"mutable": false,
|
|
161
|
+
"complexType": {
|
|
162
|
+
"original": "string",
|
|
163
|
+
"resolved": "string",
|
|
164
|
+
"references": {}
|
|
165
|
+
},
|
|
166
|
+
"required": false,
|
|
167
|
+
"optional": false,
|
|
168
|
+
"docs": {
|
|
169
|
+
"tags": [],
|
|
170
|
+
"text": ""
|
|
171
|
+
},
|
|
172
|
+
"attribute": "label",
|
|
173
|
+
"reflect": false
|
|
174
|
+
},
|
|
175
|
+
"caption": {
|
|
176
|
+
"type": "string",
|
|
177
|
+
"mutable": false,
|
|
178
|
+
"complexType": {
|
|
179
|
+
"original": "string",
|
|
180
|
+
"resolved": "string",
|
|
181
|
+
"references": {}
|
|
182
|
+
},
|
|
183
|
+
"required": false,
|
|
184
|
+
"optional": false,
|
|
185
|
+
"docs": {
|
|
186
|
+
"tags": [],
|
|
187
|
+
"text": ""
|
|
188
|
+
},
|
|
189
|
+
"attribute": "caption",
|
|
190
|
+
"reflect": false
|
|
191
|
+
},
|
|
192
|
+
"noCaption": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"mutable": false,
|
|
195
|
+
"complexType": {
|
|
196
|
+
"original": "boolean",
|
|
197
|
+
"resolved": "boolean",
|
|
198
|
+
"references": {}
|
|
199
|
+
},
|
|
200
|
+
"required": false,
|
|
201
|
+
"optional": false,
|
|
202
|
+
"docs": {
|
|
203
|
+
"tags": [],
|
|
204
|
+
"text": ""
|
|
205
|
+
},
|
|
206
|
+
"attribute": "no-caption",
|
|
207
|
+
"reflect": false,
|
|
208
|
+
"defaultValue": "false"
|
|
209
|
+
},
|
|
210
|
+
"captionType": {
|
|
211
|
+
"type": "string",
|
|
212
|
+
"mutable": false,
|
|
213
|
+
"complexType": {
|
|
214
|
+
"original": "StatusTypes",
|
|
215
|
+
"resolved": "\"default\" | \"error\" | \"info\" | \"success\" | \"warning\"",
|
|
216
|
+
"references": {
|
|
217
|
+
"StatusTypes": {
|
|
218
|
+
"location": "import",
|
|
219
|
+
"path": "@bcm/model"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"required": false,
|
|
224
|
+
"optional": false,
|
|
225
|
+
"docs": {
|
|
226
|
+
"tags": [],
|
|
227
|
+
"text": ""
|
|
228
|
+
},
|
|
229
|
+
"attribute": "caption-type",
|
|
230
|
+
"reflect": false,
|
|
231
|
+
"defaultValue": "Bcm.Status.default"
|
|
232
|
+
},
|
|
233
|
+
"captionError": {
|
|
234
|
+
"type": "string",
|
|
235
|
+
"mutable": false,
|
|
236
|
+
"complexType": {
|
|
237
|
+
"original": "string",
|
|
238
|
+
"resolved": "string",
|
|
239
|
+
"references": {}
|
|
240
|
+
},
|
|
241
|
+
"required": false,
|
|
242
|
+
"optional": false,
|
|
243
|
+
"docs": {
|
|
244
|
+
"tags": [],
|
|
245
|
+
"text": ""
|
|
246
|
+
},
|
|
247
|
+
"attribute": "caption-error",
|
|
248
|
+
"reflect": false
|
|
249
|
+
}
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
static get events() {
|
|
253
|
+
return [{
|
|
254
|
+
"method": "change",
|
|
255
|
+
"name": "bcm-change",
|
|
256
|
+
"bubbles": true,
|
|
257
|
+
"cancelable": true,
|
|
258
|
+
"composed": true,
|
|
259
|
+
"docs": {
|
|
260
|
+
"tags": [],
|
|
261
|
+
"text": ""
|
|
262
|
+
},
|
|
263
|
+
"complexType": {
|
|
264
|
+
"original": "any",
|
|
265
|
+
"resolved": "any",
|
|
266
|
+
"references": {}
|
|
267
|
+
}
|
|
268
|
+
}];
|
|
269
|
+
}
|
|
270
|
+
static get elementRef() { return "el"; }
|
|
271
|
+
static get listeners() {
|
|
272
|
+
return [{
|
|
273
|
+
"name": "bcm-chip-select-item",
|
|
274
|
+
"method": "handleSelectItem",
|
|
275
|
+
"target": undefined,
|
|
276
|
+
"capture": false,
|
|
277
|
+
"passive": false
|
|
278
|
+
}, {
|
|
279
|
+
"name": "bcm-chip-dismiss",
|
|
280
|
+
"method": "handleDismiss",
|
|
281
|
+
"target": undefined,
|
|
282
|
+
"capture": false,
|
|
283
|
+
"passive": false
|
|
284
|
+
}, {
|
|
285
|
+
"name": "bcm-chip-select",
|
|
286
|
+
"method": "handleSelect",
|
|
287
|
+
"target": undefined,
|
|
288
|
+
"capture": false,
|
|
289
|
+
"passive": false
|
|
290
|
+
}];
|
|
291
|
+
}
|
|
292
|
+
}
|
|
@@ -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,23 @@ export class BcmChip {
|
|
|
44
47
|
e.preventDefault();
|
|
45
48
|
this.bcmChipAddable.emit(this.el);
|
|
46
49
|
}
|
|
50
|
+
listSelectedItems(e) {
|
|
51
|
+
e.stopPropagation();
|
|
52
|
+
e.preventDefault();
|
|
53
|
+
if (e.detail) {
|
|
54
|
+
this.bcmChipSelectItem.emit(e.detail);
|
|
55
|
+
e.target.setClear();
|
|
56
|
+
this.data = this.data.filter(item => item.id !== e.detail.id);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
47
59
|
render() {
|
|
48
60
|
const { type, size, avatar, disabled, color } = this;
|
|
49
|
-
const hostClasses = cs(
|
|
50
|
-
|
|
51
|
-
|
|
61
|
+
const hostClasses = cs("bcm-chip", `bcm-chip__type-${type}`, `bcm-chip__size-${size}`, {
|
|
62
|
+
"bcm-chip--disabled": disabled,
|
|
63
|
+
"bcm-chip--avatar": avatar,
|
|
52
64
|
});
|
|
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 ===
|
|
65
|
+
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 === "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 && this.data.length > 0 && ( // To be added to v3
|
|
66
|
+
h("bcm-list", { "onBcm-change": e => this.listSelectedItems(e), id: this._id + "-list", data: this.data, linkedComponent: this._id, searchable: true, highlight: true }))));
|
|
54
67
|
}
|
|
55
68
|
static get is() { return "bcm-chip"; }
|
|
56
69
|
static get originalStyleUrls() {
|
|
@@ -87,7 +100,7 @@ export class BcmChip {
|
|
|
87
100
|
"type": "string",
|
|
88
101
|
"mutable": true,
|
|
89
102
|
"complexType": {
|
|
90
|
-
"original": "
|
|
103
|
+
"original": "\"default\" | \"dismissable\" | \"addable\" | \"checkable\"",
|
|
91
104
|
"resolved": "\"addable\" | \"checkable\" | \"default\" | \"dismissable\"",
|
|
92
105
|
"references": {}
|
|
93
106
|
},
|
|
@@ -99,13 +112,13 @@ export class BcmChip {
|
|
|
99
112
|
},
|
|
100
113
|
"attribute": "type",
|
|
101
114
|
"reflect": false,
|
|
102
|
-
"defaultValue": "
|
|
115
|
+
"defaultValue": "\"default\""
|
|
103
116
|
},
|
|
104
117
|
"size": {
|
|
105
118
|
"type": "string",
|
|
106
119
|
"mutable": true,
|
|
107
120
|
"complexType": {
|
|
108
|
-
"original": "
|
|
121
|
+
"original": "\"small\" | \"medium\" | \"large\"",
|
|
109
122
|
"resolved": "\"large\" | \"medium\" | \"small\"",
|
|
110
123
|
"references": {}
|
|
111
124
|
},
|
|
@@ -117,7 +130,7 @@ export class BcmChip {
|
|
|
117
130
|
},
|
|
118
131
|
"attribute": "size",
|
|
119
132
|
"reflect": false,
|
|
120
|
-
"defaultValue": "
|
|
133
|
+
"defaultValue": "\"medium\""
|
|
121
134
|
},
|
|
122
135
|
"avatar": {
|
|
123
136
|
"type": "any",
|
|
@@ -186,6 +199,59 @@ export class BcmChip {
|
|
|
186
199
|
},
|
|
187
200
|
"attribute": "color",
|
|
188
201
|
"reflect": false
|
|
202
|
+
},
|
|
203
|
+
"selected": {
|
|
204
|
+
"type": "boolean",
|
|
205
|
+
"mutable": true,
|
|
206
|
+
"complexType": {
|
|
207
|
+
"original": "boolean",
|
|
208
|
+
"resolved": "boolean",
|
|
209
|
+
"references": {}
|
|
210
|
+
},
|
|
211
|
+
"required": false,
|
|
212
|
+
"optional": false,
|
|
213
|
+
"docs": {
|
|
214
|
+
"tags": [],
|
|
215
|
+
"text": ""
|
|
216
|
+
},
|
|
217
|
+
"attribute": "selected",
|
|
218
|
+
"reflect": false,
|
|
219
|
+
"defaultValue": "false"
|
|
220
|
+
},
|
|
221
|
+
"value": {
|
|
222
|
+
"type": "string",
|
|
223
|
+
"mutable": true,
|
|
224
|
+
"complexType": {
|
|
225
|
+
"original": "string",
|
|
226
|
+
"resolved": "string",
|
|
227
|
+
"references": {}
|
|
228
|
+
},
|
|
229
|
+
"required": false,
|
|
230
|
+
"optional": false,
|
|
231
|
+
"docs": {
|
|
232
|
+
"tags": [],
|
|
233
|
+
"text": ""
|
|
234
|
+
},
|
|
235
|
+
"attribute": "value",
|
|
236
|
+
"reflect": false
|
|
237
|
+
},
|
|
238
|
+
"data": {
|
|
239
|
+
"type": "any",
|
|
240
|
+
"mutable": true,
|
|
241
|
+
"complexType": {
|
|
242
|
+
"original": "any",
|
|
243
|
+
"resolved": "any",
|
|
244
|
+
"references": {}
|
|
245
|
+
},
|
|
246
|
+
"required": false,
|
|
247
|
+
"optional": false,
|
|
248
|
+
"docs": {
|
|
249
|
+
"tags": [],
|
|
250
|
+
"text": ""
|
|
251
|
+
},
|
|
252
|
+
"attribute": "data",
|
|
253
|
+
"reflect": false,
|
|
254
|
+
"defaultValue": "[]"
|
|
189
255
|
}
|
|
190
256
|
};
|
|
191
257
|
}
|
|
@@ -235,6 +301,21 @@ export class BcmChip {
|
|
|
235
301
|
"resolved": "any",
|
|
236
302
|
"references": {}
|
|
237
303
|
}
|
|
304
|
+
}, {
|
|
305
|
+
"method": "bcmChipSelectItem",
|
|
306
|
+
"name": "bcm-chip-select-item",
|
|
307
|
+
"bubbles": true,
|
|
308
|
+
"cancelable": true,
|
|
309
|
+
"composed": true,
|
|
310
|
+
"docs": {
|
|
311
|
+
"tags": [],
|
|
312
|
+
"text": ""
|
|
313
|
+
},
|
|
314
|
+
"complexType": {
|
|
315
|
+
"original": "any",
|
|
316
|
+
"resolved": "any",
|
|
317
|
+
"references": {}
|
|
318
|
+
}
|
|
238
319
|
}];
|
|
239
320
|
}
|
|
240
321
|
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;
|