blip-ds 1.153.0 → 1.154.2
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/blip-ds/bds-accordion-body.entry.js +36 -0
- package/dist/blip-ds/bds-accordion-body.system.entry.js +1 -0
- package/dist/blip-ds/bds-accordion-group.entry.js +38 -0
- package/dist/blip-ds/bds-accordion-group.system.entry.js +1 -0
- package/dist/blip-ds/bds-accordion-header.entry.js +55 -0
- package/dist/blip-ds/bds-accordion-header.system.entry.js +1 -0
- package/dist/blip-ds/bds-chip-clickable.entry.js +15 -9
- package/dist/blip-ds/bds-chip-clickable.system.entry.js +1 -1
- package/dist/blip-ds/bds-chip-selected.entry.js +12 -7
- package/dist/blip-ds/bds-chip-selected.system.entry.js +1 -1
- package/dist/blip-ds/blip-ds.esm.js +1 -1
- package/dist/blip-ds/blip-ds.system.js +1 -1
- package/dist/blip-ds/p-12c80fd5.entry.js +1 -0
- package/dist/blip-ds/p-1db518de.system.entry.js +1 -0
- package/dist/blip-ds/p-28436a00.entry.js +1 -0
- package/dist/blip-ds/p-2e8ba5a6.entry.js +1 -0
- package/dist/blip-ds/{p-28a290f0.system.entry.js → p-49279986.system.entry.js} +1 -1
- package/dist/blip-ds/p-6be564b6.system.entry.js +1 -0
- package/dist/blip-ds/p-9a98b63f.system.js +1 -1
- package/dist/blip-ds/p-9ef77f22.system.entry.js +1 -0
- package/dist/blip-ds/{p-7557f3f5.system.entry.js → p-a35b1dde.system.entry.js} +1 -1
- package/dist/blip-ds/p-c6fdb2bf.entry.js +1 -0
- package/dist/blip-ds/p-d9d948ba.entry.js +1 -0
- package/dist/blip-ds/p-e620f23e.system.entry.js +1 -0
- package/dist/blip-ds/{p-ae72e820.entry.js → p-fa174276.entry.js} +1 -1
- package/dist/cjs/bds-accordion-body.cjs.entry.js +40 -0
- package/dist/cjs/bds-accordion-group.cjs.entry.js +42 -0
- package/dist/cjs/bds-accordion-header.cjs.entry.js +59 -0
- package/dist/cjs/bds-chip-clickable.cjs.entry.js +15 -9
- package/dist/cjs/bds-chip-selected.cjs.entry.js +12 -7
- package/dist/cjs/bds-icon_2.cjs.entry.js +769 -0
- package/dist/cjs/blip-ds.cjs.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/accordion/accordion-body.js +98 -0
- package/dist/collection/components/accordion/accordion-group.js +85 -0
- package/dist/collection/components/accordion/accordion-header.js +175 -0
- package/dist/collection/components/accordion/accordion.css +77 -0
- package/dist/collection/components/chip-clickable/chip-clickable.js +16 -10
- package/dist/collection/components/chip-selected/chip-selected.css +8 -8
- package/dist/collection/components/chip-selected/chip-selected.js +14 -14
- package/dist/esm/bds-accordion-body.entry.js +36 -0
- package/dist/esm/bds-accordion-group.entry.js +38 -0
- package/dist/esm/bds-accordion-header.entry.js +55 -0
- package/dist/esm/bds-chip-clickable.entry.js +15 -9
- package/dist/esm/bds-chip-selected.entry.js +12 -7
- package/dist/esm/bds-icon_2.entry.js +764 -0
- package/dist/esm/blip-ds.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm-es5/bds-accordion-body.entry.js +1 -0
- package/dist/esm-es5/bds-accordion-group.entry.js +1 -0
- package/dist/esm-es5/bds-accordion-header.entry.js +1 -0
- package/dist/esm-es5/bds-chip-clickable.entry.js +1 -1
- package/dist/esm-es5/bds-chip-selected.entry.js +1 -1
- package/dist/esm-es5/{bds-icon.entry.js → bds-icon_2.entry.js} +1 -1
- package/dist/esm-es5/blip-ds.js +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/types/components/accordion/accordion-body.d.ts +12 -0
- package/dist/types/components/accordion/accordion-group.d.ts +13 -0
- package/dist/types/components/accordion/accordion-header.d.ts +28 -0
- package/dist/types/components/chip-clickable/chip-clickable.d.ts +2 -0
- package/dist/types/components/chip-selected/chip-selected.d.ts +2 -1
- package/dist/types/components.d.ts +86 -0
- package/package.json +1 -1
- package/dist/blip-ds/p-049c0be1.entry.js +0 -1
- package/dist/blip-ds/p-5a1d3dd3.system.entry.js +0 -1
- package/dist/blip-ds/p-9fd518dc.system.entry.js +0 -1
- package/dist/blip-ds/p-c9f19ec5.entry.js +0 -1
- package/dist/blip-ds/p-cf2e73cd.entry.js +0 -1
- package/dist/esm-es5/bds-typo.entry.js +0 -1
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8825be35.js');
|
|
6
|
+
|
|
7
|
+
const accordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); .accordion_header{display:grid;grid-auto-flow:column;gap:24px;-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center;padding:24px;padding-right:56px;position:relative;color:#202c44;cursor:pointer}.accordion_header .accButton{position:absolute;right:24px;top:calc(50% - 16px);border-radius:8px;contain:inherit;-webkit-transition:height 0.5s, all 0.3s;-moz-transition:height 0.5s, all 0.3s;transition:height 0.5s, all 0.3s}.accordion_header .accButton__isopen{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.accordion_header .accButton::before{content:\"\";position:absolute;inset:-4px;border:2px solid transparent;border-radius:4px}.accordion_header .accButton:focus{outline:none}.accordion_header .accButton:focus::before{border-color:#c226fb}.accordion_header .accButton:hover{background-color:#f2f2f2}.accordion_header .accButton:active{background-color:#e6e6e6}.accordion_body{height:0;overflow:hidden;border-bottom:1px solid #b9cbd3;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s}.accordion_body .container{padding:0 24px 48px;position:relative;color:#202c44}";
|
|
8
|
+
|
|
9
|
+
const AccordionBody = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.container = null;
|
|
13
|
+
this.isOpen = false;
|
|
14
|
+
this.numberElement = null;
|
|
15
|
+
this.refContainer = (el) => {
|
|
16
|
+
this.container = el;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async toggle() {
|
|
20
|
+
this.isOpen = !this.isOpen;
|
|
21
|
+
}
|
|
22
|
+
async close() {
|
|
23
|
+
this.isOpen = false;
|
|
24
|
+
}
|
|
25
|
+
async reciveNumber(number) {
|
|
26
|
+
this.numberElement = number;
|
|
27
|
+
}
|
|
28
|
+
isOpenChanged() {
|
|
29
|
+
this.heightContainer = this.isOpen ? this.container.offsetHeight : 0;
|
|
30
|
+
}
|
|
31
|
+
render() {
|
|
32
|
+
return (index.h("div", { class: "accordion_body", style: { height: `${this.heightContainer}px` } }, index.h("div", { class: "container", ref: (el) => this.refContainer(el) }, index.h("slot", null))));
|
|
33
|
+
}
|
|
34
|
+
static get watchers() { return {
|
|
35
|
+
"isOpen": ["isOpenChanged"]
|
|
36
|
+
}; }
|
|
37
|
+
};
|
|
38
|
+
AccordionBody.style = accordionCss;
|
|
39
|
+
|
|
40
|
+
exports.bds_accordion_body = AccordionBody;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8825be35.js');
|
|
6
|
+
|
|
7
|
+
const accordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); .accordion_header{display:grid;grid-auto-flow:column;gap:24px;-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center;padding:24px;padding-right:56px;position:relative;color:#202c44;cursor:pointer}.accordion_header .accButton{position:absolute;right:24px;top:calc(50% - 16px);border-radius:8px;contain:inherit;-webkit-transition:height 0.5s, all 0.3s;-moz-transition:height 0.5s, all 0.3s;transition:height 0.5s, all 0.3s}.accordion_header .accButton__isopen{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.accordion_header .accButton::before{content:\"\";position:absolute;inset:-4px;border:2px solid transparent;border-radius:4px}.accordion_header .accButton:focus{outline:none}.accordion_header .accButton:focus::before{border-color:#c226fb}.accordion_header .accButton:hover{background-color:#f2f2f2}.accordion_header .accButton:active{background-color:#e6e6e6}.accordion_body{height:0;overflow:hidden;border-bottom:1px solid #b9cbd3;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s}.accordion_body .container{padding:0 24px 48px;position:relative;color:#202c44}";
|
|
8
|
+
|
|
9
|
+
const AccordionGroup = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.accheaders = null;
|
|
13
|
+
this.accBodies = null;
|
|
14
|
+
/**
|
|
15
|
+
* Focus Selected. Used to add title in header accordion.
|
|
16
|
+
*/
|
|
17
|
+
this.collapse = 'default';
|
|
18
|
+
}
|
|
19
|
+
async closeAll(actNumber) {
|
|
20
|
+
if (this.collapse == 'default') {
|
|
21
|
+
for (let i = 0; i < this.accBodies.length; i++) {
|
|
22
|
+
if (actNumber != i)
|
|
23
|
+
this.accBodies[i].close() && this.accheaders[i].close();
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
componentWillRender() {
|
|
28
|
+
this.accheaders = this.element.getElementsByTagName('bds-accordion-header');
|
|
29
|
+
this.accBodies = this.element.getElementsByTagName('bds-accordion-body');
|
|
30
|
+
for (let i = 0; i < this.accheaders.length; i++) {
|
|
31
|
+
this.accheaders[i].reciveNumber(i);
|
|
32
|
+
this.accBodies[i].reciveNumber(i);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
render() {
|
|
36
|
+
return (index.h("div", { class: "accordion_group" }, index.h("slot", null)));
|
|
37
|
+
}
|
|
38
|
+
get element() { return index.getElement(this); }
|
|
39
|
+
};
|
|
40
|
+
AccordionGroup.style = accordionCss;
|
|
41
|
+
|
|
42
|
+
exports.bds_accordion_group = AccordionGroup;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
const index = require('./index-8825be35.js');
|
|
6
|
+
|
|
7
|
+
const accordionCss = "@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); .accordion_header{display:grid;grid-auto-flow:column;gap:24px;-ms-flex-pack:start;justify-content:start;-ms-flex-align:center;align-items:center;padding:24px;padding-right:56px;position:relative;color:#202c44;cursor:pointer}.accordion_header .accButton{position:absolute;right:24px;top:calc(50% - 16px);border-radius:8px;contain:inherit;-webkit-transition:height 0.5s, all 0.3s;-moz-transition:height 0.5s, all 0.3s;transition:height 0.5s, all 0.3s}.accordion_header .accButton__isopen{-webkit-transform:rotate(180deg);transform:rotate(180deg)}.accordion_header .accButton::before{content:\"\";position:absolute;inset:-4px;border:2px solid transparent;border-radius:4px}.accordion_header .accButton:focus{outline:none}.accordion_header .accButton:focus::before{border-color:#c226fb}.accordion_header .accButton:hover{background-color:#f2f2f2}.accordion_header .accButton:active{background-color:#e6e6e6}.accordion_body{height:0;overflow:hidden;border-bottom:1px solid #b9cbd3;-webkit-transition:all 0.5s;-moz-transition:all 0.5s;transition:all 0.5s}.accordion_body .container{padding:0 24px 48px;position:relative;color:#202c44}";
|
|
8
|
+
|
|
9
|
+
const AccordionHeader = class {
|
|
10
|
+
constructor(hostRef) {
|
|
11
|
+
index.registerInstance(this, hostRef);
|
|
12
|
+
this.accGroup = null;
|
|
13
|
+
this.accNextBody = null;
|
|
14
|
+
this.isOpen = false;
|
|
15
|
+
this.numberElement = null;
|
|
16
|
+
/**
|
|
17
|
+
* Accordion Title. Used to add title in header accordion.
|
|
18
|
+
*/
|
|
19
|
+
this.accordionTitle = null;
|
|
20
|
+
/**
|
|
21
|
+
* Icon. Used to add icon in header accordion.
|
|
22
|
+
*/
|
|
23
|
+
this.icon = null;
|
|
24
|
+
/**
|
|
25
|
+
* Avatar Name. Used to add avatar in header accordion.
|
|
26
|
+
*/
|
|
27
|
+
this.avatarName = null;
|
|
28
|
+
/**
|
|
29
|
+
* Avatar Thumb. Used to add avatar in header accordion.
|
|
30
|
+
*/
|
|
31
|
+
this.avatarThumb = null;
|
|
32
|
+
this.toggle = () => {
|
|
33
|
+
var _a, _b;
|
|
34
|
+
this.isOpen = !this.isOpen;
|
|
35
|
+
(_a = this.accNextBody) === null || _a === void 0 ? void 0 : _a.toggle();
|
|
36
|
+
(_b = this.accGroup) === null || _b === void 0 ? void 0 : _b.closeAll(this.numberElement);
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async close() {
|
|
40
|
+
this.isOpen = false;
|
|
41
|
+
}
|
|
42
|
+
async reciveNumber(number) {
|
|
43
|
+
this.numberElement = number;
|
|
44
|
+
}
|
|
45
|
+
componentWillRender() {
|
|
46
|
+
this.accGroup = this.element.parentElement;
|
|
47
|
+
this.accNextBody = this.element.nextElementSibling;
|
|
48
|
+
}
|
|
49
|
+
render() {
|
|
50
|
+
return (index.h("div", { onClick: this.toggle, class: { accordion_header: true } }, this.avatarName || this.avatarThumb ? (index.h("bds-avatar", { name: this.avatarName, thumbnail: this.avatarThumb, size: "extra-small" })) : (this.icon && index.h("bds-icon", { size: "x-large", name: "tag", color: "inherit" })), this.accordionTitle && (index.h("bds-typo", { bold: "bold", variant: "fs-16" }, this.accordionTitle)), index.h("slot", null), this.accNextBody && (index.h("bds-icon", { class: {
|
|
51
|
+
accButton: true,
|
|
52
|
+
accButton__isopen: this.isOpen,
|
|
53
|
+
}, size: "x-large", name: "arrow-down", color: "inherit", tabindex: "0", onKeyPress: this.toggle }))));
|
|
54
|
+
}
|
|
55
|
+
get element() { return index.getElement(this); }
|
|
56
|
+
};
|
|
57
|
+
AccordionHeader.style = accordionCss;
|
|
58
|
+
|
|
59
|
+
exports.bds_accordion_header = AccordionHeader;
|
|
@@ -33,23 +33,29 @@ const ChipClickable = class {
|
|
|
33
33
|
*/
|
|
34
34
|
this.disabled = false;
|
|
35
35
|
}
|
|
36
|
-
|
|
37
|
-
if (event.key === 'Enter' && !this.disabled) {
|
|
36
|
+
handleClickKey(event) {
|
|
37
|
+
if ((event.key === 'Enter' || event.key === ' ') && !this.disabled) {
|
|
38
38
|
event.preventDefault();
|
|
39
39
|
this.chipClickableClick.emit();
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
if (event.key === key && !this.disabled) {
|
|
42
|
+
handleClick(event) {
|
|
43
|
+
if (!this.disabled) {
|
|
45
44
|
event.preventDefault();
|
|
46
|
-
this.
|
|
45
|
+
this.chipClickableClick.emit();
|
|
47
46
|
}
|
|
48
|
-
|
|
47
|
+
}
|
|
48
|
+
handleCloseChip(event) {
|
|
49
|
+
event.preventDefault();
|
|
50
|
+
this.chipClickableClose.emit({ id: this.element.id });
|
|
51
|
+
this.visible = false;
|
|
52
|
+
}
|
|
53
|
+
handleCloseKey(event) {
|
|
54
|
+
if ((event.key === 'Enter' || event.key === ' ') && !this.disabled) {
|
|
49
55
|
event.preventDefault();
|
|
50
56
|
this.chipClickableClose.emit({ id: this.element.id });
|
|
57
|
+
this.visible = false;
|
|
51
58
|
}
|
|
52
|
-
this.visible = false;
|
|
53
59
|
}
|
|
54
60
|
getSizeAvatarChip() {
|
|
55
61
|
if (this.size === 'tall') {
|
|
@@ -73,7 +79,7 @@ const ChipClickable = class {
|
|
|
73
79
|
'chip_clickable--hide': !this.visible,
|
|
74
80
|
'chip_clickable--click': this.clickable,
|
|
75
81
|
'chip_clickable--disabled': this.disabled,
|
|
76
|
-
}, onClick: this.handleClick.bind(this) }, this.clickable && !this.disabled && (index.h("div", { class: "chip_focus", onKeyDown: this.
|
|
82
|
+
}, onClick: this.handleClick.bind(this) }, this.clickable && !this.disabled && (index.h("div", { class: "chip_focus", onKeyDown: this.handleClickKey.bind(this), tabindex: "0" })), this.clickable && !this.disabled && index.h("div", { class: "chip_darker" }), this.icon && !this.avatar && (index.h("div", { class: "chip_clickable--icon" }, index.h("bds-icon", { size: this.getSizeIconChip(), name: this.icon }))), this.avatar && (index.h("div", { class: "chip_clickable--avatar" }, index.h("bds-avatar", { size: this.getSizeAvatarChip(), thumbnail: this.avatar }))), index.h("bds-typo", { class: "chip_clickable--text", variant: "fs-12", bold: "bold" }, index.h("slot", null)), this.close && (index.h("div", { class: "chip_clickable--close", onClick: this.handleCloseChip.bind(this) }, !this.disabled && (index.h("div", { class: "close_focus", onKeyDown: this.handleCloseKey.bind(this), tabindex: "0" })), index.h("bds-icon", { size: "x-small", theme: "solid", name: "error" }))))));
|
|
77
83
|
}
|
|
78
84
|
get element() { return index.getElement(this); }
|
|
79
85
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
const index = require('./index-8825be35.js');
|
|
6
6
|
|
|
7
|
-
const chipSelectedCss = "@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); :host
|
|
7
|
+
const chipSelectedCss = "@import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); @import url(\"https://fonts.googleapis.com/css2?family=Nunito+Sans:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap\"); :host{display:-ms-flexbox;display:flex;height:-webkit-fit-content;height:-moz-fit-content;height:fit-content;width:-webkit-max-content;width:-moz-max-content;width:max-content;border-radius:4px;-webkit-box-sizing:border-box;box-sizing:border-box}:host .chip{display:-ms-flexbox;display:flex;min-width:32px;width:-webkit-max-content;width:-moz-max-content;width:max-content;height:32px;border-radius:16px;padding:2px 4px;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;position:relative;z-index:0}:host .chip .chip_focus:focus{position:absolute;width:100%;height:100%;padding:2px;border-radius:4px;outline:#c226fb solid 2px}:host .chip .chip_darker{position:absolute;width:100%;height:100%;border-radius:inherit;z-index:1;-webkit-backdrop-filter:brightness(1);backdrop-filter:brightness(1);-webkit-box-sizing:border-box;box-sizing:border-box}:host .chip--icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:4px;height:20px;color:#202c44;z-index:2}:host .chip--text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:20px;z-index:2;margin:0 8px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#202c44;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif}:host .chip--tall{height:40px;border-radius:24px}:host .chip--default{background-color:#b3d4ff}:host .chip--info{background-color:#80e3eb}:host .chip--success{background-color:#90e6bc}:host .chip--warning{background-color:#fff6a8}:host .chip--danger{background-color:#ffa5a5}:host .chip--outline{background-color:#ffffff;border:1px solid #b9cbd3;padding:2px 3px}:host .chip--outline .chip_darker{height:calc(100% + 2px)}:host .chip:hover{cursor:pointer}:host .chip:hover .chip_darker{-webkit-backdrop-filter:brightness(0.9);backdrop-filter:brightness(0.9)}:host .chip:active{cursor:pointer}:host .chip:active .chip_darker{-webkit-backdrop-filter:brightness(0.8);backdrop-filter:brightness(0.8)}:host .chip:focus-visible{outline:none}:host .chip_selected{display:-ms-flexbox;display:flex;min-width:32px;width:-webkit-max-content;width:-moz-max-content;width:max-content;height:32px;border-radius:16px;padding:2px;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;background-color:#ffffff;border:2px solid #3f7de8}:host .chip_selected--icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:20px;padding-left:4px;color:#125ad5}:host .chip_selected--text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:20px;margin:0 8px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#125ad5;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif}:host .chip_selected--tall{height:40px;border-radius:24px}:host .chip_selected:hover{background-color:#e8f2ff;cursor:pointer}:host .chip_selected:active{background-color:#d1e3fa}:host .chip_disabled{display:-ms-flexbox;display:flex;min-width:32px;width:-webkit-max-content;width:-moz-max-content;width:max-content;height:32px;border-radius:16px;padding:2px 4px;-ms-flex-align:center;align-items:center;-webkit-box-sizing:border-box;box-sizing:border-box;-ms-flex-pack:center;justify-content:center;position:relative;z-index:0;background-color:#f3f6fa}:host .chip_disabled--icon{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;padding-left:4px;width:16px;height:20px;color:#505f79;z-index:2}:host .chip_disabled--text{display:-ms-flexbox;display:flex;-ms-flex-align:center;align-items:center;height:20px;z-index:2;margin:0 8px;-ms-flex-wrap:nowrap;flex-wrap:nowrap;color:#505f79;font-family:\"Nunito Sans\", \"Tahoma\", \"Helvetica\", \"Arial\", sans-serif}:host .chip_disabled--tall{height:40px;border-radius:24px}:host .chip_disabled:hover{cursor:default}";
|
|
8
8
|
|
|
9
9
|
const ChipSelected = class {
|
|
10
10
|
constructor(hostRef) {
|
|
@@ -28,11 +28,9 @@ const ChipSelected = class {
|
|
|
28
28
|
*/
|
|
29
29
|
this.disabled = false;
|
|
30
30
|
}
|
|
31
|
-
handleKeyDown(
|
|
32
|
-
if (
|
|
33
|
-
|
|
34
|
-
return;
|
|
35
|
-
ev.preventDefault();
|
|
31
|
+
handleKeyDown(event) {
|
|
32
|
+
if (event.key === ' ' && !this.disabled) {
|
|
33
|
+
event.preventDefault();
|
|
36
34
|
if (this.isSelected) {
|
|
37
35
|
return (this.isSelected = false);
|
|
38
36
|
}
|
|
@@ -70,8 +68,15 @@ const ChipSelected = class {
|
|
|
70
68
|
return chipSelected;
|
|
71
69
|
}
|
|
72
70
|
}
|
|
71
|
+
getSizeIconChip() {
|
|
72
|
+
if (this.size === 'tall') {
|
|
73
|
+
return 'medium';
|
|
74
|
+
}
|
|
75
|
+
else
|
|
76
|
+
return 'x-small';
|
|
77
|
+
}
|
|
73
78
|
render() {
|
|
74
|
-
return (index.h(index.Host, null, index.h("div", { class: Object.assign(Object.assign({ chip: true }, this.getStyleChip()), this.getDisabledChip()), onClick: this.handleClick, onKeyDown: this.handleKeyDown, tabindex: "0" }, !this.isSelected && !this.disabled && index.h("div", { class: "chip_darker" }), this.icon && !this.isSelected && (index.h("div", { class: "chip--icon" }, index.h("bds-icon", { size:
|
|
79
|
+
return (index.h(index.Host, null, index.h("div", { class: Object.assign(Object.assign({ chip: true }, this.getStyleChip()), this.getDisabledChip()), onClick: this.handleClick }, !this.disabled && index.h("div", { class: "chip_focus", onKeyDown: this.handleKeyDown.bind(this), tabindex: "0" }), !this.isSelected && !this.disabled && index.h("div", { class: "chip_darker" }), this.icon && !this.isSelected && (index.h("div", { class: "chip--icon" }, index.h("bds-icon", { size: this.getSizeIconChip(), name: this.icon }))), this.isSelected && (index.h("div", { class: "chip_selected--icon" }, index.h("bds-icon", { size: this.getSizeIconChip(), name: "checkball" }))), index.h("bds-typo", { class: Object.assign({ 'chip--text': true }, this.getStyleText()), variant: "fs-12", "no-wrap": true, bold: "bold" }, index.h("slot", null)))));
|
|
75
80
|
}
|
|
76
81
|
get el() { return index.getElement(this); }
|
|
77
82
|
};
|