@brandsync/wc 0.0.9 → 0.0.10
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/custom-elements.json +24 -0
- package/dist/brandsync-wc/brandsync-wc.esm.js +1 -1
- package/dist/brandsync-wc/p-b1e1b2d6.entry.js +1 -0
- package/dist/cjs/brandsync-wc.cjs.js +1 -1
- package/dist/cjs/bs-menu_2.cjs.entry.js +7 -2
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.cmp.test.js +18 -0
- package/dist/collection/components/bs-menu-item/bs-menu-item.css +19 -1
- package/dist/collection/components/bs-menu-item/bs-menu-item.js +34 -2
- package/dist/collection/components/bs-menu-item/bs-menu-item.stories.js +3 -0
- package/dist/components/bs-input.js +1 -1
- package/dist/components/bs-menu-item.js +1 -1
- package/dist/components/p-DHbUF0g6.js +1 -0
- package/dist/esm/brandsync-wc.js +1 -1
- package/dist/esm/bs-menu_2.entry.js +7 -2
- package/dist/esm/loader.js +1 -1
- package/dist/types/components/bs-menu-item/bs-menu-item.d.ts +7 -1
- package/dist/types/components/bs-menu-item/bs-menu-item.stories.d.ts +1 -0
- package/dist/types/components.d.ts +30 -5
- package/package.json +1 -1
- package/dist/brandsync-wc/p-5333bb5a.entry.js +0 -1
- package/dist/components/p-_vXDfB3V.js +0 -1
package/custom-elements.json
CHANGED
|
@@ -2792,6 +2792,30 @@
|
|
|
2792
2792
|
"tagName": "bs-menu-item",
|
|
2793
2793
|
"name": "BsMenuItem",
|
|
2794
2794
|
"description": "A single selectable row inside a `bs-menu`: an optional icon plus a text label, rendered as a\nreal `<button>` for correct keyboard/click semantics.\n\n## When to use\n- As a child of `bs-menu`, one per selectable action/option.\n\n## When not to use\n- Outside of `bs-menu` -- this component's sizing/hover treatment is designed to sit inside the\n menu's rounded, padded list box.",
|
|
2795
|
+
"attributes": [
|
|
2796
|
+
{
|
|
2797
|
+
"name": "disabled",
|
|
2798
|
+
"description": "Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by\nkeyboard tabbing, and clicking it does not emit `bsSelect`.",
|
|
2799
|
+
"type": {
|
|
2800
|
+
"text": "boolean"
|
|
2801
|
+
},
|
|
2802
|
+
"default": "false",
|
|
2803
|
+
"fieldName": "disabled"
|
|
2804
|
+
}
|
|
2805
|
+
],
|
|
2806
|
+
"members": [
|
|
2807
|
+
{
|
|
2808
|
+
"kind": "field",
|
|
2809
|
+
"name": "disabled",
|
|
2810
|
+
"description": "Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by\nkeyboard tabbing, and clicking it does not emit `bsSelect`.",
|
|
2811
|
+
"type": {
|
|
2812
|
+
"text": "boolean"
|
|
2813
|
+
},
|
|
2814
|
+
"default": "false",
|
|
2815
|
+
"readonly": true,
|
|
2816
|
+
"attribute": "disabled"
|
|
2817
|
+
}
|
|
2818
|
+
],
|
|
2795
2819
|
"events": [
|
|
2796
2820
|
{
|
|
2797
2821
|
"name": "bsSelect",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,g as a,b as t}from"./p-nLORuTUY.js";export{s as setNonce}from"./p-nLORuTUY.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((async e=>(await a(),t([["p-94ed898a",[[785,"bs-input",{value:[1025],type:[1],label:[1],placeholder:[1],description:[1],error:[1],disabled:[4],required:[4],step:[2],min:[2],max:[2],options:[16],rows:[2],chips:[16],titleOptions:[16],initialsTitle:[1,"initials-title"],countryOptions:[16],country:[1],length:[2],open:[1540],hasIcon:[32],hasEndIcon:[32],passwordVisible:[32],chipDraft:[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["p-7776b57b",[[769,"bs-chatbot-header",{heading:[1],expanded:[1540]}]]],["p-30a0e168",[[257,"bs-ai-disclaimer"]]],["p-18af02df",[[513,"bs-ai-greeting",{assistantName:[1,"assistant-name"],productName:[1,"product-name"]}]]],["p-805644e4",[[513,"bs-ai-thinking",{label:[1]}]]],["p-16a54578",[[513,"bs-attachment",{type:[1],fileName:[1,"file-name"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],loading:[4],removable:[4]}]]],["p-3dacae70",[[769,"bs-attachment-list",{ariaLabel:[1,"aria-label"],canScrollRight:[32]}]]],["p-a34f460d",[[769,"bs-badge",{variant:[1]}]]],["p-eb4d87f0",[[785,"bs-button",{variant:[1],size:[1],disabled:[4],type:[1],ariaLabel:[1,"aria-label"],hasIcon:[32],hasEndIcon:[32],hasLabel:[32]}]]],["p-ce0914a7",[[513,"bs-button-skeleton",{size:[1]}]]],["p-dd747a12",[[769,"bs-card",{surface:[1]}]]],["p-8d12ed96",[[513,"bs-chatbot-feedback",{rating:[1538],submitted:[1540],comment:[1025],heading:[1],subtitle:[1]}]]],["p-8a78d6ea",[[769,"bs-chatbot-response-action",{sourcesCount:[2,"sources-count"],menuOpen:[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["p-0d64ea40",[[769,"bs-chatbot-sources-drawer",{heading:[1],count:[2],slottedCount:[32]}]]],["p-d682675e",[[769,"bs-chatbot-suggestion-button",{disabled:[4]}]]],["p-bc72439a",[[785,"bs-composer",{variant:[1],placeholder:[1],value:[1],state:[1],ariaLabel:[1,"aria-label"],hasAttachments:[32]}]]],["p-dad4a92c",[[769,"bs-composer-status-banner",{type:[1],message:[1],showIcon:[4,"show-icon"],showButton:[4,"show-button"],actionLabel:[1,"action-label"],allowClose:[4,"allow-close"]}]]],["p-96f374be",[[513,"bs-data-table",{columns:[16],rows:[16],sortColumn:[1,"sort-column"],sortDirection:[1,"sort-direction"],selectable:[4],cellRenderer:[16],selectedIds:[32]}]]],["p-880ea3f8",[[769,"bs-modal",{open:[1540],heading:[1],size:[1],hasFooter:[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["p-575ce905",[[769,"bs-source-link",{fileName:[1,"file-name"],sourceName:[1,"source-name"],version:[1],href:[1],target:[1]}]]],["p-1515498e",[[769,"bs-tooltip",{placement:[1]}]]],["p-
|
|
1
|
+
import{p as e,g as a,b as t}from"./p-nLORuTUY.js";export{s as setNonce}from"./p-nLORuTUY.js";(()=>{const a=import.meta.url,s={};return""!==a&&(s.resourcesUrl=new URL(".",a).href),e(s)})().then((async e=>(await a(),t([["p-94ed898a",[[785,"bs-input",{value:[1025],type:[1],label:[1],placeholder:[1],description:[1],error:[1],disabled:[4],required:[4],step:[2],min:[2],max:[2],options:[16],rows:[2],chips:[16],titleOptions:[16],initialsTitle:[1,"initials-title"],countryOptions:[16],country:[1],length:[2],open:[1540],hasIcon:[32],hasEndIcon:[32],passwordVisible:[32],chipDraft:[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["p-7776b57b",[[769,"bs-chatbot-header",{heading:[1],expanded:[1540]}]]],["p-30a0e168",[[257,"bs-ai-disclaimer"]]],["p-18af02df",[[513,"bs-ai-greeting",{assistantName:[1,"assistant-name"],productName:[1,"product-name"]}]]],["p-805644e4",[[513,"bs-ai-thinking",{label:[1]}]]],["p-16a54578",[[513,"bs-attachment",{type:[1],fileName:[1,"file-name"],imageSrc:[1,"image-src"],imageAlt:[1,"image-alt"],loading:[4],removable:[4]}]]],["p-3dacae70",[[769,"bs-attachment-list",{ariaLabel:[1,"aria-label"],canScrollRight:[32]}]]],["p-a34f460d",[[769,"bs-badge",{variant:[1]}]]],["p-eb4d87f0",[[785,"bs-button",{variant:[1],size:[1],disabled:[4],type:[1],ariaLabel:[1,"aria-label"],hasIcon:[32],hasEndIcon:[32],hasLabel:[32]}]]],["p-ce0914a7",[[513,"bs-button-skeleton",{size:[1]}]]],["p-dd747a12",[[769,"bs-card",{surface:[1]}]]],["p-8d12ed96",[[513,"bs-chatbot-feedback",{rating:[1538],submitted:[1540],comment:[1025],heading:[1],subtitle:[1]}]]],["p-8a78d6ea",[[769,"bs-chatbot-response-action",{sourcesCount:[2,"sources-count"],menuOpen:[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["p-0d64ea40",[[769,"bs-chatbot-sources-drawer",{heading:[1],count:[2],slottedCount:[32]}]]],["p-d682675e",[[769,"bs-chatbot-suggestion-button",{disabled:[4]}]]],["p-bc72439a",[[785,"bs-composer",{variant:[1],placeholder:[1],value:[1],state:[1],ariaLabel:[1,"aria-label"],hasAttachments:[32]}]]],["p-dad4a92c",[[769,"bs-composer-status-banner",{type:[1],message:[1],showIcon:[4,"show-icon"],showButton:[4,"show-button"],actionLabel:[1,"action-label"],allowClose:[4,"allow-close"]}]]],["p-96f374be",[[513,"bs-data-table",{columns:[16],rows:[16],sortColumn:[1,"sort-column"],sortDirection:[1,"sort-direction"],selectable:[4],cellRenderer:[16],selectedIds:[32]}]]],["p-880ea3f8",[[769,"bs-modal",{open:[1540],heading:[1],size:[1],hasFooter:[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["p-575ce905",[[769,"bs-source-link",{fileName:[1,"file-name"],sourceName:[1,"source-name"],version:[1],href:[1],target:[1]}]]],["p-1515498e",[[769,"bs-tooltip",{placement:[1]}]]],["p-b1e1b2d6",[[257,"bs-menu"],[769,"bs-menu-item",{disabled:[4],hasIcon:[32]}]]]],e))));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,h as s,c as i}from"./p-nLORuTUY.js";const a=class{constructor(s){e(this,s)}render(){return s("div",{key:"e49c52a18ea8c10399d818a00e0c6b748f0c9b8f",part:"list",class:"bs-menu",role:"menu"},s("slot",{key:"7e8cef2af1a068d0ab31fc3aee0abf8b59645a08"}))}};a.style=":host{display:block;--bs-menu-bg:var(--bs-surface-raised);--bs-menu-radius:var(--bs-border-radius-100);--bs-menu-padding-y:var(--bs-spacing-50);--bs-menu-gap:var(--bs-spacing-50);--bs-menu-shadow:var(--bs-shadow-sm)}.bs-menu{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--bs-menu-gap);background:var(--bs-menu-bg);border-radius:var(--bs-menu-radius);padding:var(--bs-menu-padding-y) 0;box-shadow:var(--bs-menu-shadow);font-family:inherit}";const n=class{constructor(s){e(this,s),this.bsSelect=i(this,"bsSelect")}disabled=!1;hasIcon=!1;bsSelect;onIconSlotchange=e=>{this.hasIcon=e.target.assignedNodes().length>0};onClick=()=>{this.disabled||this.bsSelect.emit()};render(){return s("button",{key:"ddd19d6211c8fe3be1567f67ac74076ccd664235",type:"button",part:"item",role:"menuitem",class:"bs-menu-item "+(this.disabled?"bs-menu-item--disabled":""),disabled:this.disabled,"aria-disabled":this.disabled?"true":void 0,onClick:this.onClick},s("span",{key:"bee75c968706c83503a3461f263640c3fbfa12a9",part:"icon",class:"bs-menu-item__icon "+(this.hasIcon?"bs-menu-item__icon--has-content":"")},s("slot",{key:"521e1f06cd42794e78e17de93f1318f2998f67bd",name:"icon",onSlotchange:this.onIconSlotchange})),s("span",{key:"0f65b70e59b7dbaa3e455a3f2ff73b50dcdb1b61",part:"label",class:"bs-menu-item__label"},s("slot",{key:"31f5e8c8ce0996bfe26051918b378de82dffa63c"})))}};n.style=":host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container-hover);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-disabled-bg:var(--bs-surface-action-disabled);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-icon-color-disabled:var(--bs-icon-disabled);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-color-disabled:var(--bs-text-on-disabled);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item--disabled{background:var(--bs-menu-item-disabled-bg);color:var(--bs-menu-item-color-disabled);cursor:not-allowed}.bs-menu-item--disabled:hover,.bs-menu-item--disabled:active{background:var(--bs-menu-item-disabled-bg)}.bs-menu-item--disabled .bs-menu-item__icon{color:var(--bs-menu-item-icon-color-disabled)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}";export{a as bs_menu,n as bs_menu_item}
|
|
@@ -18,7 +18,7 @@ var patchBrowser = () => {
|
|
|
18
18
|
|
|
19
19
|
patchBrowser().then(async (options) => {
|
|
20
20
|
await index.globalScripts();
|
|
21
|
-
return index.bootstrapLazy([["bs-input.cjs",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header.cjs",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer.cjs",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting.cjs",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking.cjs",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment.cjs",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list.cjs",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge.cjs",[[769,"bs-badge",{"variant":[1]}]]],["bs-button.cjs",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton.cjs",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card.cjs",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback.cjs",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action.cjs",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer.cjs",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button.cjs",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer.cjs",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner.cjs",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table.cjs",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal.cjs",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link.cjs",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip.cjs",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2.cjs",[[257,"bs-menu"],[769,"bs-menu-item",{"hasIcon":[32]}]]]], options);
|
|
21
|
+
return index.bootstrapLazy([["bs-input.cjs",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header.cjs",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer.cjs",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting.cjs",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking.cjs",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment.cjs",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list.cjs",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge.cjs",[[769,"bs-badge",{"variant":[1]}]]],["bs-button.cjs",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton.cjs",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card.cjs",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback.cjs",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action.cjs",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer.cjs",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button.cjs",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer.cjs",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner.cjs",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table.cjs",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal.cjs",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link.cjs",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip.cjs",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2.cjs",[[257,"bs-menu"],[769,"bs-menu-item",{"disabled":[4],"hasIcon":[32]}]]]], options);
|
|
22
22
|
});
|
|
23
23
|
|
|
24
24
|
exports.setNonce = index.setNonce;
|
|
@@ -14,13 +14,16 @@ const BsMenu = class {
|
|
|
14
14
|
};
|
|
15
15
|
BsMenu.style = bsMenuCss();
|
|
16
16
|
|
|
17
|
-
const bsMenuItemCss = () => `:host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}`;
|
|
17
|
+
const bsMenuItemCss = () => `:host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container-hover);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-disabled-bg:var(--bs-surface-action-disabled);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-icon-color-disabled:var(--bs-icon-disabled);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-color-disabled:var(--bs-text-on-disabled);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item--disabled{background:var(--bs-menu-item-disabled-bg);color:var(--bs-menu-item-color-disabled);cursor:not-allowed}.bs-menu-item--disabled:hover,.bs-menu-item--disabled:active{background:var(--bs-menu-item-disabled-bg)}.bs-menu-item--disabled .bs-menu-item__icon{color:var(--bs-menu-item-icon-color-disabled)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}`;
|
|
18
18
|
|
|
19
19
|
const BsMenuItem = class {
|
|
20
20
|
constructor(hostRef) {
|
|
21
21
|
index.registerInstance(this, hostRef);
|
|
22
22
|
this.bsSelect = index.createEvent(this, "bsSelect");
|
|
23
23
|
}
|
|
24
|
+
/** Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by
|
|
25
|
+
* keyboard tabbing, and clicking it does not emit `bsSelect`. */
|
|
26
|
+
disabled = false;
|
|
24
27
|
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
25
28
|
* renders when there's actually an icon to show. */
|
|
26
29
|
hasIcon = false;
|
|
@@ -30,10 +33,12 @@ const BsMenuItem = class {
|
|
|
30
33
|
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
31
34
|
};
|
|
32
35
|
onClick = () => {
|
|
36
|
+
if (this.disabled)
|
|
37
|
+
return;
|
|
33
38
|
this.bsSelect.emit();
|
|
34
39
|
};
|
|
35
40
|
render() {
|
|
36
|
-
return (index.h("button", { key: '
|
|
41
|
+
return (index.h("button", { key: 'ddd19d6211c8fe3be1567f67ac74076ccd664235', type: "button", part: "item", role: "menuitem", class: `bs-menu-item ${this.disabled ? 'bs-menu-item--disabled' : ''}`, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.onClick }, index.h("span", { key: 'bee75c968706c83503a3461f263640c3fbfa12a9', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, index.h("slot", { key: '521e1f06cd42794e78e17de93f1318f2998f67bd', name: "icon", onSlotchange: this.onIconSlotchange })), index.h("span", { key: '0f65b70e59b7dbaa3e455a3f2ff73b50dcdb1b61', part: "label", class: "bs-menu-item__label" }, index.h("slot", { key: '31f5e8c8ce0996bfe26051918b378de82dffa63c' }))));
|
|
37
42
|
}
|
|
38
43
|
};
|
|
39
44
|
BsMenuItem.style = bsMenuItemCss();
|
package/dist/cjs/loader.cjs.js
CHANGED
|
@@ -5,7 +5,7 @@ var index = require('./index-CVh-sqA_.js');
|
|
|
5
5
|
const defineCustomElements = async (win, options) => {
|
|
6
6
|
if (typeof window === 'undefined') return undefined;
|
|
7
7
|
await index.globalScripts();
|
|
8
|
-
return index.bootstrapLazy([["bs-input.cjs",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header.cjs",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer.cjs",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting.cjs",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking.cjs",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment.cjs",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list.cjs",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge.cjs",[[769,"bs-badge",{"variant":[1]}]]],["bs-button.cjs",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton.cjs",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card.cjs",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback.cjs",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action.cjs",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer.cjs",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button.cjs",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer.cjs",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner.cjs",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table.cjs",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal.cjs",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link.cjs",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip.cjs",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2.cjs",[[257,"bs-menu"],[769,"bs-menu-item",{"hasIcon":[32]}]]]], options);
|
|
8
|
+
return index.bootstrapLazy([["bs-input.cjs",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header.cjs",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer.cjs",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting.cjs",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking.cjs",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment.cjs",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list.cjs",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge.cjs",[[769,"bs-badge",{"variant":[1]}]]],["bs-button.cjs",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton.cjs",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card.cjs",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback.cjs",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action.cjs",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer.cjs",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button.cjs",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer.cjs",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner.cjs",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table.cjs",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal.cjs",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link.cjs",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip.cjs",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2.cjs",[[257,"bs-menu"],[769,"bs-menu-item",{"disabled":[4],"hasIcon":[32]}]]]], options);
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
exports.setNonce = index.setNonce;
|
|
@@ -30,4 +30,22 @@ describe('bs-menu-item', () => {
|
|
|
30
30
|
root.shadowRoot.querySelector('[part="item"]').click();
|
|
31
31
|
expect(selectSpy).toHaveReceivedEventTimes(1);
|
|
32
32
|
});
|
|
33
|
+
it('has no background by default (enabled state has no fill of its own)', async () => {
|
|
34
|
+
const { root } = await render(h("bs-menu-item", null, "Read aloud"));
|
|
35
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
36
|
+
expect(getComputedStyle(button).backgroundColor).toBe('rgba(0, 0, 0, 0)');
|
|
37
|
+
});
|
|
38
|
+
it('applies disabled styling, sets the native disabled attribute and aria-disabled, when disabled is set', async () => {
|
|
39
|
+
const { root } = await render(h("bs-menu-item", { disabled: true }, "Read aloud"));
|
|
40
|
+
const button = root.shadowRoot.querySelector('[part="item"]');
|
|
41
|
+
expect(button).toHaveClass('bs-menu-item--disabled');
|
|
42
|
+
expect(button).toHaveAttribute('disabled');
|
|
43
|
+
expect(button).toEqualAttribute('aria-disabled', 'true');
|
|
44
|
+
});
|
|
45
|
+
it('does not emit bsSelect when clicked while disabled', async () => {
|
|
46
|
+
const { root, spyOnEvent } = await render(h("bs-menu-item", { disabled: true }, "Read aloud"));
|
|
47
|
+
const selectSpy = spyOnEvent('bsSelect');
|
|
48
|
+
root.shadowRoot.querySelector('[part="item"]').click();
|
|
49
|
+
expect(selectSpy).toHaveReceivedEventTimes(0);
|
|
50
|
+
});
|
|
33
51
|
});
|
|
@@ -4,10 +4,13 @@
|
|
|
4
4
|
--bs-menu-item-padding-y: var(--bs-spacing-100);
|
|
5
5
|
--bs-menu-item-padding-x: var(--bs-spacing-150);
|
|
6
6
|
--bs-menu-item-gap: var(--bs-spacing-100);
|
|
7
|
-
--bs-menu-item-hover: var(--bs-color-neutral-container);
|
|
7
|
+
--bs-menu-item-hover: var(--bs-color-neutral-container-hover);
|
|
8
8
|
--bs-menu-item-pressed: var(--bs-color-neutral-container-pressed);
|
|
9
|
+
--bs-menu-item-disabled-bg: var(--bs-surface-action-disabled);
|
|
9
10
|
--bs-menu-item-icon-color: var(--bs-icon-default);
|
|
11
|
+
--bs-menu-item-icon-color-disabled: var(--bs-icon-disabled);
|
|
10
12
|
--bs-menu-item-color: var(--bs-text-muted);
|
|
13
|
+
--bs-menu-item-color-disabled: var(--bs-text-on-disabled);
|
|
11
14
|
--bs-menu-item-font-size: var(--bs-font-size-md);
|
|
12
15
|
--bs-menu-item-line-height: var(--bs-line-height-body-md);
|
|
13
16
|
}
|
|
@@ -42,6 +45,21 @@
|
|
|
42
45
|
background: var(--bs-menu-item-pressed);
|
|
43
46
|
}
|
|
44
47
|
|
|
48
|
+
.bs-menu-item--disabled {
|
|
49
|
+
background: var(--bs-menu-item-disabled-bg);
|
|
50
|
+
color: var(--bs-menu-item-color-disabled);
|
|
51
|
+
cursor: not-allowed;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.bs-menu-item--disabled:hover,
|
|
55
|
+
.bs-menu-item--disabled:active {
|
|
56
|
+
background: var(--bs-menu-item-disabled-bg);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.bs-menu-item--disabled .bs-menu-item__icon {
|
|
60
|
+
color: var(--bs-menu-item-icon-color-disabled);
|
|
61
|
+
}
|
|
62
|
+
|
|
45
63
|
.bs-menu-item__icon {
|
|
46
64
|
display: none;
|
|
47
65
|
width: 24px;
|
|
@@ -19,14 +19,20 @@ import { h } from "@stencil/core";
|
|
|
19
19
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
20
20
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
21
21
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
22
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
22
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
23
23
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
24
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
24
25
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
26
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
25
27
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
28
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
26
29
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
27
30
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
28
31
|
*/
|
|
29
32
|
export class BsMenuItem {
|
|
33
|
+
/** Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by
|
|
34
|
+
* keyboard tabbing, and clicking it does not emit `bsSelect`. */
|
|
35
|
+
disabled = false;
|
|
30
36
|
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
31
37
|
* renders when there's actually an icon to show. */
|
|
32
38
|
hasIcon = false;
|
|
@@ -36,10 +42,12 @@ export class BsMenuItem {
|
|
|
36
42
|
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
37
43
|
};
|
|
38
44
|
onClick = () => {
|
|
45
|
+
if (this.disabled)
|
|
46
|
+
return;
|
|
39
47
|
this.bsSelect.emit();
|
|
40
48
|
};
|
|
41
49
|
render() {
|
|
42
|
-
return (h("button", { key: '
|
|
50
|
+
return (h("button", { key: 'ddd19d6211c8fe3be1567f67ac74076ccd664235', type: "button", part: "item", role: "menuitem", class: `bs-menu-item ${this.disabled ? 'bs-menu-item--disabled' : ''}`, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.onClick }, h("span", { key: 'bee75c968706c83503a3461f263640c3fbfa12a9', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '521e1f06cd42794e78e17de93f1318f2998f67bd', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '0f65b70e59b7dbaa3e455a3f2ff73b50dcdb1b61', part: "label", class: "bs-menu-item__label" }, h("slot", { key: '31f5e8c8ce0996bfe26051918b378de82dffa63c' }))));
|
|
43
51
|
}
|
|
44
52
|
static get is() { return "bs-menu-item"; }
|
|
45
53
|
static get encapsulation() { return "shadow"; }
|
|
@@ -53,6 +61,30 @@ export class BsMenuItem {
|
|
|
53
61
|
"$": ["bs-menu-item.css"]
|
|
54
62
|
};
|
|
55
63
|
}
|
|
64
|
+
static get properties() {
|
|
65
|
+
return {
|
|
66
|
+
"disabled": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"mutable": false,
|
|
69
|
+
"complexType": {
|
|
70
|
+
"original": "boolean",
|
|
71
|
+
"resolved": "boolean",
|
|
72
|
+
"references": {}
|
|
73
|
+
},
|
|
74
|
+
"required": false,
|
|
75
|
+
"optional": false,
|
|
76
|
+
"docs": {
|
|
77
|
+
"tags": [],
|
|
78
|
+
"text": "Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by\nkeyboard tabbing, and clicking it does not emit `bsSelect`."
|
|
79
|
+
},
|
|
80
|
+
"getter": false,
|
|
81
|
+
"setter": false,
|
|
82
|
+
"reflect": false,
|
|
83
|
+
"attribute": "disabled",
|
|
84
|
+
"defaultValue": "false"
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
}
|
|
56
88
|
static get states() {
|
|
57
89
|
return {
|
|
58
90
|
"hasIcon": {}
|
|
@@ -25,6 +25,9 @@ export const WithIcon = {
|
|
|
25
25
|
</bs-menu-item>
|
|
26
26
|
`,
|
|
27
27
|
};
|
|
28
|
+
export const Disabled = {
|
|
29
|
+
render: () => html ` <bs-menu-item style="width: 210px;" disabled>Read aloud</bs-menu-item> `,
|
|
30
|
+
};
|
|
28
31
|
export const InAMenu = {
|
|
29
32
|
name: 'In a bs-menu',
|
|
30
33
|
render: () => html `
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as i,p as t,H as s,c as e,h as r}from"./p-BpvhHQSw.js";import{d as n}from"./p-DndQiCMP.js";import{d as o}from"./p-_vXDfB3V.js";const a=t(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.bsInput=e(this,"bsInput"),this.bsChange=e(this,"bsChange"),this.bsOpen=e(this,"bsOpen"),this.bsChipAdd=e(this,"bsChipAdd"),this.bsChipRemove=e(this,"bsChipRemove"),this.bsTitleChange=e(this,"bsTitleChange"),this.bsCountryChange=e(this,"bsCountryChange")}get el(){return this}value="";type="text";label;placeholder;description;error;disabled=!1;required=!1;step=1;min;max;options=[];rows=3;chips=[];titleOptions=[];initialsTitle="";countryOptions=[];country="";length=4;open=!1;bsInput;bsChange;bsOpen;bsChipAdd;bsChipRemove;bsTitleChange;bsCountryChange;hasIcon=!1;hasEndIcon=!1;passwordVisible=!1;chipDraft="";pinInputs=[];componentWillLoad(){this.hasIcon=this.hasSlottedContent("icon"),this.hasEndIcon=this.hasSlottedContent("end-icon")}hasSlottedContent(i){return Array.from(this.el.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("slot")===i))}onIconSlotchange=i=>{this.hasIcon=i.target.assignedNodes().length>0};onEndIconSlotchange=i=>{this.hasEndIcon=i.target.assignedNodes().length>0};onInput=i=>{this.bsInput.emit(i.target.value)};onChange=i=>{this.bsChange.emit(i.target.value)};clampNumber(i){return void 0!==this.min&&i<this.min&&(i=this.min),void 0!==this.max&&i>this.max&&(i=this.max),i}onStepperIncrement=()=>{if(this.disabled)return;const i=this.clampNumber((parseFloat(this.value)||0)+this.step);this.value=i+"",this.bsChange.emit(this.value)};onStepperDecrement=()=>{if(this.disabled)return;const i=this.clampNumber((parseFloat(this.value)||0)-this.step);this.value=i+"",this.bsChange.emit(this.value)};onTogglePasswordVisibility=()=>{this.passwordVisible=!this.passwordVisible};onDropdownToggle=()=>{this.disabled||(this.open=!this.open,this.bsOpen.emit(this.open))};onDropdownKeydown=i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.onDropdownToggle())};onDropdownOptionSelect=i=>()=>{this.value=i.label,this.open=!1,this.bsChange.emit(this.value)};onHostKeydown(i){"dropdown"===this.type&&this.open&&"Escape"===i.key&&(this.open=!1)}onHostFocusOut(i){if("dropdown"!==this.type||!this.open)return;const t=i.relatedTarget;t&&this.el.contains(t)||(this.open=!1)}onChipDraftInput=i=>{this.chipDraft=i.target.value};onChipDraftKeydown=i=>{if("Enter"===i.key){i.preventDefault();const t=this.chipDraft.trim();t&&(this.bsChipAdd.emit(t),this.chipDraft="")}};onChipRemove=i=>()=>{this.bsChipRemove.emit(i)};onTitleChange=i=>{this.bsTitleChange.emit(i.target.value)};onCountryChange=i=>{this.bsCountryChange.emit(i.target.value)};onPinInput=i=>t=>{const s=t.target;let e=s.value;e.length>1&&(e=e.slice(-1),s.value=e),e&&i<this.length-1&&this.pinInputs[i+1]?.focus(),this.bsChange.emit(this.pinInputs.map((i=>i?.value??"")).join(""))};onPinKeydown=i=>t=>{"Backspace"===t.key&&!t.target.value&&i>0&&this.pinInputs[i-1]?.focus()};get showsEndIconArea(){return"number"===this.type||"password"===this.type||"dropdown"===this.type||"date"===this.type||this.hasEndIcon}get showsIconArea(){return"search"===this.type&&!this.hasIcon||this.hasIcon}renderIconContent(){return"search"!==this.type||this.hasIcon?r("slot",{name:"icon",onSlotchange:this.onIconSlotchange}):r("svg",{class:"bs-input__search-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor","stroke-width":"1.3"}),r("path",{d:"M11 11L14.5 14.5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"}))}renderEndIconContent(){return"number"===this.type?r("span",{class:"bs-input__stepper"},r("button",{type:"button",part:"control",class:"bs-input__stepper-btn","aria-label":"Increment",tabIndex:-1,disabled:this.disabled,onClick:this.onStepperIncrement},r("svg",{viewBox:"0 0 10 6",width:"10",height:"6","aria-hidden":"true"},r("path",{d:"M1 5L5 1L9 5",stroke:"currentColor","stroke-width":"1.3",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}))),r("button",{type:"button",part:"control",class:"bs-input__stepper-btn","aria-label":"Decrement",tabIndex:-1,disabled:this.disabled,onClick:this.onStepperDecrement},r("svg",{viewBox:"0 0 10 6",width:"10",height:"6","aria-hidden":"true"},r("path",{d:"M1 1L5 5L9 1",stroke:"currentColor","stroke-width":"1.3",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})))):"password"===this.type?r("button",{type:"button",part:"control",class:"bs-input__password-toggle","aria-label":this.passwordVisible?"Hide password":"Show password",disabled:this.disabled,onClick:this.onTogglePasswordVisibility},this.passwordVisible?r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z",stroke:"currentColor","stroke-width":"1.2","stroke-linejoin":"round"}),r("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M2 2L14 14",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})):r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z",stroke:"currentColor","stroke-width":"1.2","stroke-linejoin":"round"}),r("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor","stroke-width":"1.2"}))):"dropdown"===this.type?r("svg",{class:"bs-input__chevron",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})):"date"!==this.type||this.hasEndIcon?r("slot",{name:"end-icon",onSlotchange:this.onEndIconSlotchange}):r("svg",{class:"bs-input__calendar",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M2 6.5H14",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M5 1.5V4M11 1.5V4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"}))}renderStandardControl(){return r("input",{id:"control",part:"control",class:"bs-input__control",type:"password"===this.type?this.passwordVisible?"text":"password":"dropdown"===this.type?"text":this.type,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:"dropdown"===this.type,min:"number"===this.type?this.min:void 0,max:"number"===this.type?this.max:void 0,step:"number"===this.type?this.step:void 0,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})}renderSelectControl(){return r("select",{id:"control",part:"control",class:"bs-input__control",disabled:this.disabled,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange},this.options.map((i=>r("option",{value:i.value,selected:i.value===this.value},i.label))))}renderTextareaControl(){return r("textarea",{id:"control",part:"control",class:"bs-input__control bs-input__control--textarea",rows:this.rows,value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})}renderChipControl(){return r("div",{class:"bs-input__chips"},this.chips.map((i=>r("span",{part:"chip",class:"bs-input__chip"},i,r("button",{type:"button",class:"bs-input__chip-remove","aria-label":"Remove "+i,onClick:this.onChipRemove(i)},"×")))),r("input",{id:"control",part:"control",class:"bs-input__control bs-input__chip-input",type:"text",value:this.chipDraft,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onChipDraftInput,onKeyDown:this.onChipDraftKeydown}))}renderInitialsControl(){return[r("select",{part:"control",class:"bs-input__control bs-input__title-select",disabled:this.disabled,onChange:this.onTitleChange},this.titleOptions.map((i=>r("option",{value:i,selected:i===this.initialsTitle},i)))),r("input",{id:"control",part:"control",class:"bs-input__control",type:"text",value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})]}renderCountryControl(){return[r("select",{part:"control",class:"bs-input__control bs-input__country-select",disabled:this.disabled,onChange:this.onCountryChange},this.countryOptions.map((i=>r("option",{value:i.code,selected:i.code===this.country},i.flagIcon?i.flagIcon+" ":"",i.code," ",i.label)))),r("input",{id:"control",part:"control",class:"bs-input__control",type:"text",value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})]}renderControl(){switch(this.type){case"select":return this.renderSelectControl();case"textarea":return this.renderTextareaControl();case"chip":return this.renderChipControl();case"initials":return this.renderInitialsControl();case"country":return this.renderCountryControl();default:return this.renderStandardControl()}}renderField(){const i=["bs-input__field",this.error?"bs-input__field--error":"",this.disabled?"bs-input__field--disabled":"","textarea"===this.type?"bs-input__field--textarea":"","chip"===this.type?"bs-input__field--chip":""].filter(Boolean).join(" "),t="dropdown"===this.type;return r("div",{class:"bs-input__field-wrapper"},r("div",{part:"field",class:i,onClick:t?this.onDropdownToggle:void 0,onKeyDown:t?this.onDropdownKeydown:void 0,"aria-haspopup":t?"listbox":void 0,"aria-expanded":t?this.open+"":void 0},r("span",{part:"icon",class:"bs-input__icon "+(this.showsIconArea?"bs-input__icon--visible":"")},this.renderIconContent()),this.renderControl(),r("span",{part:"end-icon",class:"bs-input__end-icon "+(this.showsEndIconArea?"bs-input__end-icon--visible":"")},this.renderEndIconContent())),t&&this.open&&this.options.length>0&&r("bs-menu",{part:"menu",class:"bs-input__dropdown-menu",role:"listbox"},this.options.map((i=>r("bs-menu-item",{key:i.value,onBsSelect:this.onDropdownOptionSelect(i)},i.label)))))}renderPinField(){return this.pinInputs=[],r("div",{part:"field",class:"bs-input__field bs-input__field--pin "+(this.disabled?"bs-input__field--disabled":"")},Array.from({length:this.length}).map(((i,t)=>r("input",{id:0===t?"control":void 0,ref:i=>this.pinInputs[t]=i,part:"control",class:"bs-input__pin-cell",type:"text",inputMode:"numeric",maxLength:1,value:this.value[t]??"",disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onPinInput(t),onKeyDown:this.onPinKeydown(t)}))))}render(){return r("div",{key:"a929eee8f7b100f372763a259f5d5fed298c8dff",class:"bs-input "+(this.error?"bs-input--error":"")},this.label&&r("label",{key:"fba27eccc9a351caa58fd849aad54e9388de361c",part:"label",class:"bs-input__label",htmlFor:"control"},this.label,this.required&&r("span",{key:"d4852798433e75b6c4cac34a9fbc5f9c23c8925d",part:"required",class:"bs-input__required","aria-hidden":"true"},"*")),"pin"===this.type?this.renderPinField():this.renderField(),this.error?r("span",{id:"description-or-error",part:"error",class:"bs-input__error"},r("svg",{part:"error-icon",class:"bs-input__error-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M8 5V8.5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"}),r("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})),this.error):this.description?r("span",{id:"description-or-error",part:"description",class:"bs-input__description"},this.description):null)}static get delegatesFocus(){return!0}static get style(){return":host{display:block;--bs-input-radius:var(--bs-border-radius-100);--bs-input-height:var(--bs-spacing-600);--bs-input-padding-x:var(--bs-spacing-150);--bs-input-padding-y:var(--bs-spacing-100);--bs-input-gap:var(--bs-spacing-200);--bs-input-icon-size:var(--bs-spacing-300);--bs-input-stack-gap:var(--bs-spacing-50);--bs-input-error-icon-size:var(--bs-spacing-250);--bs-input-field-bg:var(--bs-input-bg-default);--bs-input-field-bg-disabled:var(--bs-input-bg-disabled);--bs-input-field-border:var(--bs-input-border-default);--bs-input-field-border-hover:var(--bs-input-border-hover);--bs-input-field-border-focus:var(--bs-input-border-focus);--bs-input-field-border-error:var(--bs-input-border-error);--bs-input-field-text:var(--bs-input-text);--bs-input-field-placeholder:var(--bs-input-placeholder);--bs-input-label-color:var(--bs-input-label);--bs-input-description-color:var(--bs-input-description);--bs-input-error-color:var(--bs-input-error);--bs-input-icon-color:var(--bs-icon-muted);--bs-input-icon-color-error:var(--bs-input-icon-error);--bs-input-icon-color-disabled:var(--bs-input-icon-disabled);--bs-input-chip-bg:var(--bs-input-bg-disabled);--bs-input-chip-text:var(--bs-input-text)}.bs-input{display:flex;flex-direction:column;gap:var(--bs-input-stack-gap);font-family:inherit}.bs-input__label{font-size:var(--bs-font-size-sm);font-weight:var(--bs-font-weight-medium);color:var(--bs-input-label-color)}.bs-input__required{color:var(--bs-input-error-color);margin-left:2px}.bs-input__field{box-sizing:border-box;display:flex;align-items:center;gap:var(--bs-input-gap);height:var(--bs-input-height);padding:var(--bs-input-padding-y) var(--bs-input-padding-x);border:1px solid var(--bs-input-field-border);border-radius:var(--bs-input-radius);background:var(--bs-input-field-bg)}.bs-input__field:hover:not(.bs-input__field--disabled){border-color:var(--bs-input-field-border-hover)}.bs-input__field:focus-within{border-color:var(--bs-input-field-border-focus)}.bs-input__field--error{border-color:var(--bs-input-field-border-error)}.bs-input__field--disabled{background:var(--bs-input-field-bg-disabled);cursor:not-allowed}.bs-input__control{flex:1;min-width:0;border:none;outline:none;padding:0;background:transparent;color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit}.bs-input__control::placeholder{color:var(--bs-input-field-placeholder)}.bs-input__control:disabled{color:var(--bs-input-text-disabled);cursor:not-allowed}.bs-input__control::-webkit-strong-password-auto-fill-button,.bs-input__control::-webkit-credentials-auto-fill-button{display:none !important;visibility:hidden;pointer-events:none;position:absolute;right:0}.bs-input__control::-webkit-textfield-decoration-container{visibility:hidden}.bs-input__control::-ms-reveal,.bs-input__control::-ms-clear{display:none}.bs-input--error .bs-input__label{color:var(--bs-input-label-color)}.bs-input__icon,.bs-input__end-icon{display:none;align-items:center;flex-shrink:0;color:var(--bs-input-icon-color)}.bs-input__icon--visible,.bs-input__end-icon--visible{display:flex}.bs-input__icon ::slotted(*),.bs-input__end-icon ::slotted(*){display:block;width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field--error .bs-input__icon,.bs-input__field--error .bs-input__end-icon{color:var(--bs-input-icon-color-error)}.bs-input__field--disabled .bs-input__icon,.bs-input__field--disabled .bs-input__end-icon{color:var(--bs-input-icon-color-disabled)}.bs-input__description{font-size:var(--bs-font-size-xs);color:var(--bs-input-description-color)}.bs-input__error{display:flex;align-items:center;gap:var(--bs-input-stack-gap);font-size:var(--bs-font-size-xs);color:var(--bs-input-error-color)}.bs-input__error-icon{flex-shrink:0;width:var(--bs-input-error-icon-size);height:var(--bs-input-error-icon-size)}.bs-input__field--textarea{height:auto;align-items:flex-start}.bs-input__control--textarea{resize:vertical}.bs-input__stepper{display:flex;flex-direction:column}.bs-input__stepper-btn{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:inherit;padding:0;cursor:pointer}.bs-input__stepper-btn:disabled{cursor:not-allowed}.bs-input__password-toggle{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:inherit;padding:0;cursor:pointer;width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__password-toggle:disabled{cursor:not-allowed}.bs-input__password-toggle svg{width:100%;height:100%}.bs-input__chevron{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field-wrapper{position:relative;width:100%}.bs-input__dropdown-menu{position:absolute;top:calc(100% + var(--bs-input-stack-gap));left:0;right:0;z-index:1}.bs-input__calendar{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__search-icon{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field--chip{flex-wrap:wrap;height:auto;min-height:var(--bs-input-height)}.bs-input__chips{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bs-spacing-100);flex:1;min-width:0}.bs-input__chip{display:inline-flex;align-items:center;gap:4px;background:var(--bs-input-chip-bg);color:var(--bs-input-chip-text);border-radius:var(--bs-input-radius);padding:2px 6px;font-size:var(--bs-font-size-sm)}.bs-input__chip-remove{border:none;background:transparent;color:inherit;cursor:pointer;padding:0;line-height:1}.bs-input__chip-input{flex:1;min-width:60px}.bs-input__title-select,.bs-input__country-select{flex-shrink:0;width:auto;border:none;outline:none;background:transparent;color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit}.bs-input__field--pin{border:none;padding:0;background:transparent;gap:var(--bs-input-gap)}.bs-input__pin-cell{box-sizing:border-box;width:var(--bs-input-height);height:var(--bs-input-height);text-align:center;border:1px solid var(--bs-input-field-border);border-radius:var(--bs-input-radius);background:var(--bs-input-field-bg);color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit;outline:none}.bs-input__pin-cell:focus{border-color:var(--bs-input-field-border-focus)}.bs-input__field--pin.bs-input__field--disabled .bs-input__pin-cell{background:var(--bs-input-field-bg-disabled);cursor:not-allowed}"}},[785,"bs-input",{value:[1025],type:[1],label:[1],placeholder:[1],description:[1],error:[1],disabled:[4],required:[4],step:[2],min:[2],max:[2],options:[16],rows:[2],chips:[16],titleOptions:[16],initialsTitle:[1,"initials-title"],countryOptions:[16],country:[1],length:[2],open:[1540],hasIcon:[32],hasEndIcon:[32],passwordVisible:[32],chipDraft:[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]);function p(){"undefined"!=typeof customElements&&["bs-input","bs-menu","bs-menu-item"].forEach((t=>{switch(t){case"bs-input":customElements.get(i(t))||customElements.define(i(t),a);break;case"bs-menu":customElements.get(i(t))||n();break;case"bs-menu-item":customElements.get(i(t))||o()}}))}p();const l=a,d=p;export{l as BsInput,d as defineCustomElement}
|
|
1
|
+
import{t as i,p as t,H as s,c as e,h as r}from"./p-BpvhHQSw.js";import{d as n}from"./p-DndQiCMP.js";import{d as o}from"./p-DHbUF0g6.js";const a=t(class extends s{constructor(i){super(),!1!==i&&this.__registerHost(),this.__attachShadow(),this.bsInput=e(this,"bsInput"),this.bsChange=e(this,"bsChange"),this.bsOpen=e(this,"bsOpen"),this.bsChipAdd=e(this,"bsChipAdd"),this.bsChipRemove=e(this,"bsChipRemove"),this.bsTitleChange=e(this,"bsTitleChange"),this.bsCountryChange=e(this,"bsCountryChange")}get el(){return this}value="";type="text";label;placeholder;description;error;disabled=!1;required=!1;step=1;min;max;options=[];rows=3;chips=[];titleOptions=[];initialsTitle="";countryOptions=[];country="";length=4;open=!1;bsInput;bsChange;bsOpen;bsChipAdd;bsChipRemove;bsTitleChange;bsCountryChange;hasIcon=!1;hasEndIcon=!1;passwordVisible=!1;chipDraft="";pinInputs=[];componentWillLoad(){this.hasIcon=this.hasSlottedContent("icon"),this.hasEndIcon=this.hasSlottedContent("end-icon")}hasSlottedContent(i){return Array.from(this.el.childNodes).some((t=>t.nodeType===Node.ELEMENT_NODE&&t.getAttribute("slot")===i))}onIconSlotchange=i=>{this.hasIcon=i.target.assignedNodes().length>0};onEndIconSlotchange=i=>{this.hasEndIcon=i.target.assignedNodes().length>0};onInput=i=>{this.bsInput.emit(i.target.value)};onChange=i=>{this.bsChange.emit(i.target.value)};clampNumber(i){return void 0!==this.min&&i<this.min&&(i=this.min),void 0!==this.max&&i>this.max&&(i=this.max),i}onStepperIncrement=()=>{if(this.disabled)return;const i=this.clampNumber((parseFloat(this.value)||0)+this.step);this.value=i+"",this.bsChange.emit(this.value)};onStepperDecrement=()=>{if(this.disabled)return;const i=this.clampNumber((parseFloat(this.value)||0)-this.step);this.value=i+"",this.bsChange.emit(this.value)};onTogglePasswordVisibility=()=>{this.passwordVisible=!this.passwordVisible};onDropdownToggle=()=>{this.disabled||(this.open=!this.open,this.bsOpen.emit(this.open))};onDropdownKeydown=i=>{"Enter"!==i.key&&" "!==i.key||(i.preventDefault(),this.onDropdownToggle())};onDropdownOptionSelect=i=>()=>{this.value=i.label,this.open=!1,this.bsChange.emit(this.value)};onHostKeydown(i){"dropdown"===this.type&&this.open&&"Escape"===i.key&&(this.open=!1)}onHostFocusOut(i){if("dropdown"!==this.type||!this.open)return;const t=i.relatedTarget;t&&this.el.contains(t)||(this.open=!1)}onChipDraftInput=i=>{this.chipDraft=i.target.value};onChipDraftKeydown=i=>{if("Enter"===i.key){i.preventDefault();const t=this.chipDraft.trim();t&&(this.bsChipAdd.emit(t),this.chipDraft="")}};onChipRemove=i=>()=>{this.bsChipRemove.emit(i)};onTitleChange=i=>{this.bsTitleChange.emit(i.target.value)};onCountryChange=i=>{this.bsCountryChange.emit(i.target.value)};onPinInput=i=>t=>{const s=t.target;let e=s.value;e.length>1&&(e=e.slice(-1),s.value=e),e&&i<this.length-1&&this.pinInputs[i+1]?.focus(),this.bsChange.emit(this.pinInputs.map((i=>i?.value??"")).join(""))};onPinKeydown=i=>t=>{"Backspace"===t.key&&!t.target.value&&i>0&&this.pinInputs[i-1]?.focus()};get showsEndIconArea(){return"number"===this.type||"password"===this.type||"dropdown"===this.type||"date"===this.type||this.hasEndIcon}get showsIconArea(){return"search"===this.type&&!this.hasIcon||this.hasIcon}renderIconContent(){return"search"!==this.type||this.hasIcon?r("slot",{name:"icon",onSlotchange:this.onIconSlotchange}):r("svg",{class:"bs-input__search-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("circle",{cx:"7",cy:"7",r:"5",stroke:"currentColor","stroke-width":"1.3"}),r("path",{d:"M11 11L14.5 14.5",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round"}))}renderEndIconContent(){return"number"===this.type?r("span",{class:"bs-input__stepper"},r("button",{type:"button",part:"control",class:"bs-input__stepper-btn","aria-label":"Increment",tabIndex:-1,disabled:this.disabled,onClick:this.onStepperIncrement},r("svg",{viewBox:"0 0 10 6",width:"10",height:"6","aria-hidden":"true"},r("path",{d:"M1 5L5 1L9 5",stroke:"currentColor","stroke-width":"1.3",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"}))),r("button",{type:"button",part:"control",class:"bs-input__stepper-btn","aria-label":"Decrement",tabIndex:-1,disabled:this.disabled,onClick:this.onStepperDecrement},r("svg",{viewBox:"0 0 10 6",width:"10",height:"6","aria-hidden":"true"},r("path",{d:"M1 1L5 5L9 1",stroke:"currentColor","stroke-width":"1.3",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"})))):"password"===this.type?r("button",{type:"button",part:"control",class:"bs-input__password-toggle","aria-label":this.passwordVisible?"Hide password":"Show password",disabled:this.disabled,onClick:this.onTogglePasswordVisibility},this.passwordVisible?r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z",stroke:"currentColor","stroke-width":"1.2","stroke-linejoin":"round"}),r("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M2 2L14 14",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"})):r("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M1 8C2.2 5.5 4.9 3 8 3C11.1 3 13.8 5.5 15 8C13.8 10.5 11.1 13 8 13C4.9 13 2.2 10.5 1 8Z",stroke:"currentColor","stroke-width":"1.2","stroke-linejoin":"round"}),r("circle",{cx:"8",cy:"8",r:"2",stroke:"currentColor","stroke-width":"1.2"}))):"dropdown"===this.type?r("svg",{class:"bs-input__chevron",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("path",{d:"M4 6L8 10L12 6",stroke:"currentColor","stroke-width":"1.3","stroke-linecap":"round","stroke-linejoin":"round"})):"date"!==this.type||this.hasEndIcon?r("slot",{name:"end-icon",onSlotchange:this.onEndIconSlotchange}):r("svg",{class:"bs-input__calendar",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("rect",{x:"2",y:"3",width:"12",height:"11",rx:"1",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M2 6.5H14",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M5 1.5V4M11 1.5V4",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"}))}renderStandardControl(){return r("input",{id:"control",part:"control",class:"bs-input__control",type:"password"===this.type?this.passwordVisible?"text":"password":"dropdown"===this.type?"text":this.type,value:this.value,placeholder:this.placeholder,disabled:this.disabled,readOnly:"dropdown"===this.type,min:"number"===this.type?this.min:void 0,max:"number"===this.type?this.max:void 0,step:"number"===this.type?this.step:void 0,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})}renderSelectControl(){return r("select",{id:"control",part:"control",class:"bs-input__control",disabled:this.disabled,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange},this.options.map((i=>r("option",{value:i.value,selected:i.value===this.value},i.label))))}renderTextareaControl(){return r("textarea",{id:"control",part:"control",class:"bs-input__control bs-input__control--textarea",rows:this.rows,value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-describedby":this.error||this.description?"description-or-error":void 0,"aria-invalid":this.error?"true":void 0,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})}renderChipControl(){return r("div",{class:"bs-input__chips"},this.chips.map((i=>r("span",{part:"chip",class:"bs-input__chip"},i,r("button",{type:"button",class:"bs-input__chip-remove","aria-label":"Remove "+i,onClick:this.onChipRemove(i)},"×")))),r("input",{id:"control",part:"control",class:"bs-input__control bs-input__chip-input",type:"text",value:this.chipDraft,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onChipDraftInput,onKeyDown:this.onChipDraftKeydown}))}renderInitialsControl(){return[r("select",{part:"control",class:"bs-input__control bs-input__title-select",disabled:this.disabled,onChange:this.onTitleChange},this.titleOptions.map((i=>r("option",{value:i,selected:i===this.initialsTitle},i)))),r("input",{id:"control",part:"control",class:"bs-input__control",type:"text",value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})]}renderCountryControl(){return[r("select",{part:"control",class:"bs-input__control bs-input__country-select",disabled:this.disabled,onChange:this.onCountryChange},this.countryOptions.map((i=>r("option",{value:i.code,selected:i.code===this.country},i.flagIcon?i.flagIcon+" ":"",i.code," ",i.label)))),r("input",{id:"control",part:"control",class:"bs-input__control",type:"text",value:this.value,placeholder:this.placeholder,disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onInput,onChange:this.onChange})]}renderControl(){switch(this.type){case"select":return this.renderSelectControl();case"textarea":return this.renderTextareaControl();case"chip":return this.renderChipControl();case"initials":return this.renderInitialsControl();case"country":return this.renderCountryControl();default:return this.renderStandardControl()}}renderField(){const i=["bs-input__field",this.error?"bs-input__field--error":"",this.disabled?"bs-input__field--disabled":"","textarea"===this.type?"bs-input__field--textarea":"","chip"===this.type?"bs-input__field--chip":""].filter(Boolean).join(" "),t="dropdown"===this.type;return r("div",{class:"bs-input__field-wrapper"},r("div",{part:"field",class:i,onClick:t?this.onDropdownToggle:void 0,onKeyDown:t?this.onDropdownKeydown:void 0,"aria-haspopup":t?"listbox":void 0,"aria-expanded":t?this.open+"":void 0},r("span",{part:"icon",class:"bs-input__icon "+(this.showsIconArea?"bs-input__icon--visible":"")},this.renderIconContent()),this.renderControl(),r("span",{part:"end-icon",class:"bs-input__end-icon "+(this.showsEndIconArea?"bs-input__end-icon--visible":"")},this.renderEndIconContent())),t&&this.open&&this.options.length>0&&r("bs-menu",{part:"menu",class:"bs-input__dropdown-menu",role:"listbox"},this.options.map((i=>r("bs-menu-item",{key:i.value,onBsSelect:this.onDropdownOptionSelect(i)},i.label)))))}renderPinField(){return this.pinInputs=[],r("div",{part:"field",class:"bs-input__field bs-input__field--pin "+(this.disabled?"bs-input__field--disabled":"")},Array.from({length:this.length}).map(((i,t)=>r("input",{id:0===t?"control":void 0,ref:i=>this.pinInputs[t]=i,part:"control",class:"bs-input__pin-cell",type:"text",inputMode:"numeric",maxLength:1,value:this.value[t]??"",disabled:this.disabled,"aria-required":this.required?"true":void 0,onInput:this.onPinInput(t),onKeyDown:this.onPinKeydown(t)}))))}render(){return r("div",{key:"a929eee8f7b100f372763a259f5d5fed298c8dff",class:"bs-input "+(this.error?"bs-input--error":"")},this.label&&r("label",{key:"fba27eccc9a351caa58fd849aad54e9388de361c",part:"label",class:"bs-input__label",htmlFor:"control"},this.label,this.required&&r("span",{key:"d4852798433e75b6c4cac34a9fbc5f9c23c8925d",part:"required",class:"bs-input__required","aria-hidden":"true"},"*")),"pin"===this.type?this.renderPinField():this.renderField(),this.error?r("span",{id:"description-or-error",part:"error",class:"bs-input__error"},r("svg",{part:"error-icon",class:"bs-input__error-icon",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true"},r("circle",{cx:"8",cy:"8",r:"6.5",stroke:"currentColor","stroke-width":"1.2"}),r("path",{d:"M8 5V8.5",stroke:"currentColor","stroke-width":"1.2","stroke-linecap":"round"}),r("circle",{cx:"8",cy:"11",r:"0.75",fill:"currentColor"})),this.error):this.description?r("span",{id:"description-or-error",part:"description",class:"bs-input__description"},this.description):null)}static get delegatesFocus(){return!0}static get style(){return":host{display:block;--bs-input-radius:var(--bs-border-radius-100);--bs-input-height:var(--bs-spacing-600);--bs-input-padding-x:var(--bs-spacing-150);--bs-input-padding-y:var(--bs-spacing-100);--bs-input-gap:var(--bs-spacing-200);--bs-input-icon-size:var(--bs-spacing-300);--bs-input-stack-gap:var(--bs-spacing-50);--bs-input-error-icon-size:var(--bs-spacing-250);--bs-input-field-bg:var(--bs-input-bg-default);--bs-input-field-bg-disabled:var(--bs-input-bg-disabled);--bs-input-field-border:var(--bs-input-border-default);--bs-input-field-border-hover:var(--bs-input-border-hover);--bs-input-field-border-focus:var(--bs-input-border-focus);--bs-input-field-border-error:var(--bs-input-border-error);--bs-input-field-text:var(--bs-input-text);--bs-input-field-placeholder:var(--bs-input-placeholder);--bs-input-label-color:var(--bs-input-label);--bs-input-description-color:var(--bs-input-description);--bs-input-error-color:var(--bs-input-error);--bs-input-icon-color:var(--bs-icon-muted);--bs-input-icon-color-error:var(--bs-input-icon-error);--bs-input-icon-color-disabled:var(--bs-input-icon-disabled);--bs-input-chip-bg:var(--bs-input-bg-disabled);--bs-input-chip-text:var(--bs-input-text)}.bs-input{display:flex;flex-direction:column;gap:var(--bs-input-stack-gap);font-family:inherit}.bs-input__label{font-size:var(--bs-font-size-sm);font-weight:var(--bs-font-weight-medium);color:var(--bs-input-label-color)}.bs-input__required{color:var(--bs-input-error-color);margin-left:2px}.bs-input__field{box-sizing:border-box;display:flex;align-items:center;gap:var(--bs-input-gap);height:var(--bs-input-height);padding:var(--bs-input-padding-y) var(--bs-input-padding-x);border:1px solid var(--bs-input-field-border);border-radius:var(--bs-input-radius);background:var(--bs-input-field-bg)}.bs-input__field:hover:not(.bs-input__field--disabled){border-color:var(--bs-input-field-border-hover)}.bs-input__field:focus-within{border-color:var(--bs-input-field-border-focus)}.bs-input__field--error{border-color:var(--bs-input-field-border-error)}.bs-input__field--disabled{background:var(--bs-input-field-bg-disabled);cursor:not-allowed}.bs-input__control{flex:1;min-width:0;border:none;outline:none;padding:0;background:transparent;color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit}.bs-input__control::placeholder{color:var(--bs-input-field-placeholder)}.bs-input__control:disabled{color:var(--bs-input-text-disabled);cursor:not-allowed}.bs-input__control::-webkit-strong-password-auto-fill-button,.bs-input__control::-webkit-credentials-auto-fill-button{display:none !important;visibility:hidden;pointer-events:none;position:absolute;right:0}.bs-input__control::-webkit-textfield-decoration-container{visibility:hidden}.bs-input__control::-ms-reveal,.bs-input__control::-ms-clear{display:none}.bs-input--error .bs-input__label{color:var(--bs-input-label-color)}.bs-input__icon,.bs-input__end-icon{display:none;align-items:center;flex-shrink:0;color:var(--bs-input-icon-color)}.bs-input__icon--visible,.bs-input__end-icon--visible{display:flex}.bs-input__icon ::slotted(*),.bs-input__end-icon ::slotted(*){display:block;width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field--error .bs-input__icon,.bs-input__field--error .bs-input__end-icon{color:var(--bs-input-icon-color-error)}.bs-input__field--disabled .bs-input__icon,.bs-input__field--disabled .bs-input__end-icon{color:var(--bs-input-icon-color-disabled)}.bs-input__description{font-size:var(--bs-font-size-xs);color:var(--bs-input-description-color)}.bs-input__error{display:flex;align-items:center;gap:var(--bs-input-stack-gap);font-size:var(--bs-font-size-xs);color:var(--bs-input-error-color)}.bs-input__error-icon{flex-shrink:0;width:var(--bs-input-error-icon-size);height:var(--bs-input-error-icon-size)}.bs-input__field--textarea{height:auto;align-items:flex-start}.bs-input__control--textarea{resize:vertical}.bs-input__stepper{display:flex;flex-direction:column}.bs-input__stepper-btn{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:inherit;padding:0;cursor:pointer}.bs-input__stepper-btn:disabled{cursor:not-allowed}.bs-input__password-toggle{display:flex;align-items:center;justify-content:center;border:none;background:transparent;color:inherit;padding:0;cursor:pointer;width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__password-toggle:disabled{cursor:not-allowed}.bs-input__password-toggle svg{width:100%;height:100%}.bs-input__chevron{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field-wrapper{position:relative;width:100%}.bs-input__dropdown-menu{position:absolute;top:calc(100% + var(--bs-input-stack-gap));left:0;right:0;z-index:1}.bs-input__calendar{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__search-icon{width:var(--bs-input-icon-size);height:var(--bs-input-icon-size)}.bs-input__field--chip{flex-wrap:wrap;height:auto;min-height:var(--bs-input-height)}.bs-input__chips{display:flex;flex-wrap:wrap;align-items:center;gap:var(--bs-spacing-100);flex:1;min-width:0}.bs-input__chip{display:inline-flex;align-items:center;gap:4px;background:var(--bs-input-chip-bg);color:var(--bs-input-chip-text);border-radius:var(--bs-input-radius);padding:2px 6px;font-size:var(--bs-font-size-sm)}.bs-input__chip-remove{border:none;background:transparent;color:inherit;cursor:pointer;padding:0;line-height:1}.bs-input__chip-input{flex:1;min-width:60px}.bs-input__title-select,.bs-input__country-select{flex-shrink:0;width:auto;border:none;outline:none;background:transparent;color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit}.bs-input__field--pin{border:none;padding:0;background:transparent;gap:var(--bs-input-gap)}.bs-input__pin-cell{box-sizing:border-box;width:var(--bs-input-height);height:var(--bs-input-height);text-align:center;border:1px solid var(--bs-input-field-border);border-radius:var(--bs-input-radius);background:var(--bs-input-field-bg);color:var(--bs-input-field-text);font-size:var(--bs-font-size-md);font-family:inherit;outline:none}.bs-input__pin-cell:focus{border-color:var(--bs-input-field-border-focus)}.bs-input__field--pin.bs-input__field--disabled .bs-input__pin-cell{background:var(--bs-input-field-bg-disabled);cursor:not-allowed}"}},[785,"bs-input",{value:[1025],type:[1],label:[1],placeholder:[1],description:[1],error:[1],disabled:[4],required:[4],step:[2],min:[2],max:[2],options:[16],rows:[2],chips:[16],titleOptions:[16],initialsTitle:[1,"initials-title"],countryOptions:[16],country:[1],length:[2],open:[1540],hasIcon:[32],hasEndIcon:[32],passwordVisible:[32],chipDraft:[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]);function p(){"undefined"!=typeof customElements&&["bs-input","bs-menu","bs-menu-item"].forEach((t=>{switch(t){case"bs-input":customElements.get(i(t))||customElements.define(i(t),a);break;case"bs-menu":customElements.get(i(t))||n();break;case"bs-menu-item":customElements.get(i(t))||o()}}))}p();const l=a,d=p;export{l as BsInput,d as defineCustomElement}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as o,d as s}from"./p-
|
|
1
|
+
import{B as o,d as s}from"./p-DHbUF0g6.js";const p=o,r=s;export{p as BsMenuItem,r as defineCustomElement}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e,p as s,H as i,c as t,h as n}from"./p-BpvhHQSw.js";const a=s(class extends i{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.bsSelect=t(this,"bsSelect")}disabled=!1;hasIcon=!1;bsSelect;onIconSlotchange=e=>{this.hasIcon=e.target.assignedNodes().length>0};onClick=()=>{this.disabled||this.bsSelect.emit()};render(){return n("button",{key:"ddd19d6211c8fe3be1567f67ac74076ccd664235",type:"button",part:"item",role:"menuitem",class:"bs-menu-item "+(this.disabled?"bs-menu-item--disabled":""),disabled:this.disabled,"aria-disabled":this.disabled?"true":void 0,onClick:this.onClick},n("span",{key:"bee75c968706c83503a3461f263640c3fbfa12a9",part:"icon",class:"bs-menu-item__icon "+(this.hasIcon?"bs-menu-item__icon--has-content":"")},n("slot",{key:"521e1f06cd42794e78e17de93f1318f2998f67bd",name:"icon",onSlotchange:this.onIconSlotchange})),n("span",{key:"0f65b70e59b7dbaa3e455a3f2ff73b50dcdb1b61",part:"label",class:"bs-menu-item__label"},n("slot",{key:"31f5e8c8ce0996bfe26051918b378de82dffa63c"})))}static get style(){return":host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container-hover);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-disabled-bg:var(--bs-surface-action-disabled);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-icon-color-disabled:var(--bs-icon-disabled);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-color-disabled:var(--bs-text-on-disabled);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item--disabled{background:var(--bs-menu-item-disabled-bg);color:var(--bs-menu-item-color-disabled);cursor:not-allowed}.bs-menu-item--disabled:hover,.bs-menu-item--disabled:active{background:var(--bs-menu-item-disabled-bg)}.bs-menu-item--disabled .bs-menu-item__icon{color:var(--bs-menu-item-icon-color-disabled)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}"}},[769,"bs-menu-item",{disabled:[4],hasIcon:[32]}]);function b(){"undefined"!=typeof customElements&&["bs-menu-item"].forEach((s=>{"bs-menu-item"===s&&(customElements.get(e(s))||customElements.define(e(s),a))}))}b();export{a as B,b as d}
|
package/dist/esm/brandsync-wc.js
CHANGED
|
@@ -16,5 +16,5 @@ var patchBrowser = () => {
|
|
|
16
16
|
|
|
17
17
|
patchBrowser().then(async (options) => {
|
|
18
18
|
await globalScripts();
|
|
19
|
-
return bootstrapLazy([["bs-input",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2",[[257,"bs-menu"],[769,"bs-menu-item",{"hasIcon":[32]}]]]], options);
|
|
19
|
+
return bootstrapLazy([["bs-input",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2",[[257,"bs-menu"],[769,"bs-menu-item",{"disabled":[4],"hasIcon":[32]}]]]], options);
|
|
20
20
|
});
|
|
@@ -12,13 +12,16 @@ const BsMenu = class {
|
|
|
12
12
|
};
|
|
13
13
|
BsMenu.style = bsMenuCss();
|
|
14
14
|
|
|
15
|
-
const bsMenuItemCss = () => `:host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}`;
|
|
15
|
+
const bsMenuItemCss = () => `:host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container-hover);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-disabled-bg:var(--bs-surface-action-disabled);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-icon-color-disabled:var(--bs-icon-disabled);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-color-disabled:var(--bs-text-on-disabled);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item--disabled{background:var(--bs-menu-item-disabled-bg);color:var(--bs-menu-item-color-disabled);cursor:not-allowed}.bs-menu-item--disabled:hover,.bs-menu-item--disabled:active{background:var(--bs-menu-item-disabled-bg)}.bs-menu-item--disabled .bs-menu-item__icon{color:var(--bs-menu-item-icon-color-disabled)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}`;
|
|
16
16
|
|
|
17
17
|
const BsMenuItem = class {
|
|
18
18
|
constructor(hostRef) {
|
|
19
19
|
registerInstance(this, hostRef);
|
|
20
20
|
this.bsSelect = createEvent(this, "bsSelect");
|
|
21
21
|
}
|
|
22
|
+
/** Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by
|
|
23
|
+
* keyboard tabbing, and clicking it does not emit `bsSelect`. */
|
|
24
|
+
disabled = false;
|
|
22
25
|
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
23
26
|
* renders when there's actually an icon to show. */
|
|
24
27
|
hasIcon = false;
|
|
@@ -28,10 +31,12 @@ const BsMenuItem = class {
|
|
|
28
31
|
this.hasIcon = ev.target.assignedNodes().length > 0;
|
|
29
32
|
};
|
|
30
33
|
onClick = () => {
|
|
34
|
+
if (this.disabled)
|
|
35
|
+
return;
|
|
31
36
|
this.bsSelect.emit();
|
|
32
37
|
};
|
|
33
38
|
render() {
|
|
34
|
-
return (h("button", { key: '
|
|
39
|
+
return (h("button", { key: 'ddd19d6211c8fe3be1567f67ac74076ccd664235', type: "button", part: "item", role: "menuitem", class: `bs-menu-item ${this.disabled ? 'bs-menu-item--disabled' : ''}`, disabled: this.disabled, "aria-disabled": this.disabled ? 'true' : undefined, onClick: this.onClick }, h("span", { key: 'bee75c968706c83503a3461f263640c3fbfa12a9', part: "icon", class: `bs-menu-item__icon ${this.hasIcon ? 'bs-menu-item__icon--has-content' : ''}` }, h("slot", { key: '521e1f06cd42794e78e17de93f1318f2998f67bd', name: "icon", onSlotchange: this.onIconSlotchange })), h("span", { key: '0f65b70e59b7dbaa3e455a3f2ff73b50dcdb1b61', part: "label", class: "bs-menu-item__label" }, h("slot", { key: '31f5e8c8ce0996bfe26051918b378de82dffa63c' }))));
|
|
35
40
|
}
|
|
36
41
|
};
|
|
37
42
|
BsMenuItem.style = bsMenuItemCss();
|
package/dist/esm/loader.js
CHANGED
|
@@ -4,7 +4,7 @@ export { s as setNonce } from './index-nLORuTUY.js';
|
|
|
4
4
|
const defineCustomElements = async (win, options) => {
|
|
5
5
|
if (typeof window === 'undefined') return undefined;
|
|
6
6
|
await globalScripts();
|
|
7
|
-
return bootstrapLazy([["bs-input",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2",[[257,"bs-menu"],[769,"bs-menu-item",{"hasIcon":[32]}]]]], options);
|
|
7
|
+
return bootstrapLazy([["bs-input",[[785,"bs-input",{"value":[1025],"type":[1],"label":[1],"placeholder":[1],"description":[1],"error":[1],"disabled":[4],"required":[4],"step":[2],"min":[2],"max":[2],"options":[16],"rows":[2],"chips":[16],"titleOptions":[16],"initialsTitle":[1,"initials-title"],"countryOptions":[16],"country":[1],"length":[2],"open":[1540],"hasIcon":[32],"hasEndIcon":[32],"passwordVisible":[32],"chipDraft":[32]},[[0,"keydown","onHostKeydown"],[0,"focusout","onHostFocusOut"]]]]],["bs-chatbot-header",[[769,"bs-chatbot-header",{"heading":[1],"expanded":[1540]}]]],["bs-ai-disclaimer",[[257,"bs-ai-disclaimer"]]],["bs-ai-greeting",[[513,"bs-ai-greeting",{"assistantName":[1,"assistant-name"],"productName":[1,"product-name"]}]]],["bs-ai-thinking",[[513,"bs-ai-thinking",{"label":[1]}]]],["bs-attachment",[[513,"bs-attachment",{"type":[1],"fileName":[1,"file-name"],"imageSrc":[1,"image-src"],"imageAlt":[1,"image-alt"],"loading":[4],"removable":[4]}]]],["bs-attachment-list",[[769,"bs-attachment-list",{"ariaLabel":[1,"aria-label"],"canScrollRight":[32]}]]],["bs-badge",[[769,"bs-badge",{"variant":[1]}]]],["bs-button",[[785,"bs-button",{"variant":[1],"size":[1],"disabled":[4],"type":[1],"ariaLabel":[1,"aria-label"],"hasIcon":[32],"hasEndIcon":[32],"hasLabel":[32]}]]],["bs-button-skeleton",[[513,"bs-button-skeleton",{"size":[1]}]]],["bs-card",[[769,"bs-card",{"surface":[1]}]]],["bs-chatbot-feedback",[[513,"bs-chatbot-feedback",{"rating":[1538],"submitted":[1540],"comment":[1025],"heading":[1],"subtitle":[1]}]]],["bs-chatbot-response-action",[[769,"bs-chatbot-response-action",{"sourcesCount":[2,"sources-count"],"menuOpen":[1540,"menu-open"]},[[4,"click","onDocumentClick"],[4,"keydown","onKeydown"]]]]],["bs-chatbot-sources-drawer",[[769,"bs-chatbot-sources-drawer",{"heading":[1],"count":[2],"slottedCount":[32]}]]],["bs-chatbot-suggestion-button",[[769,"bs-chatbot-suggestion-button",{"disabled":[4]}]]],["bs-composer",[[785,"bs-composer",{"variant":[1],"placeholder":[1],"value":[1],"state":[1],"ariaLabel":[1,"aria-label"],"hasAttachments":[32]}]]],["bs-composer-status-banner",[[769,"bs-composer-status-banner",{"type":[1],"message":[1],"showIcon":[4,"show-icon"],"showButton":[4,"show-button"],"actionLabel":[1,"action-label"],"allowClose":[4,"allow-close"]}]]],["bs-data-table",[[513,"bs-data-table",{"columns":[16],"rows":[16],"sortColumn":[1,"sort-column"],"sortDirection":[1,"sort-direction"],"selectable":[4],"cellRenderer":[16],"selectedIds":[32]}]]],["bs-modal",[[769,"bs-modal",{"open":[1540],"heading":[1],"size":[1],"hasFooter":[32]},[[4,"keydown","onKeydown"],[4,"focusin","onFocusIn"]]]]],["bs-source-link",[[769,"bs-source-link",{"fileName":[1,"file-name"],"sourceName":[1,"source-name"],"version":[1],"href":[1],"target":[1]}]]],["bs-tooltip",[[769,"bs-tooltip",{"placement":[1]}]]],["bs-menu_2",[[257,"bs-menu"],[769,"bs-menu-item",{"disabled":[4],"hasIcon":[32]}]]]], options);
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
export { defineCustomElements };
|
|
@@ -19,14 +19,20 @@ import { EventEmitter } from '../../stencil-public-runtime';
|
|
|
19
19
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
20
20
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
21
21
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
22
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
22
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
23
23
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
24
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
24
25
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
26
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
25
27
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
28
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
26
29
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
27
30
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
28
31
|
*/
|
|
29
32
|
export declare class BsMenuItem {
|
|
33
|
+
/** Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by
|
|
34
|
+
* keyboard tabbing, and clicking it does not emit `bsSelect`. */
|
|
35
|
+
disabled: boolean;
|
|
30
36
|
/** Tracks whether the `icon` slot has assigned content, so the icon wrapper (and its gap) only
|
|
31
37
|
* renders when there's actually an icon to show. */
|
|
32
38
|
hasIcon: boolean;
|
|
@@ -838,14 +838,22 @@ export namespace Components {
|
|
|
838
838
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
839
839
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
840
840
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
841
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
841
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
842
842
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
843
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
843
844
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
845
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
844
846
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
847
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
845
848
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
846
849
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
847
850
|
*/
|
|
848
851
|
interface BsMenuItem {
|
|
852
|
+
/**
|
|
853
|
+
* Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by keyboard tabbing, and clicking it does not emit `bsSelect`.
|
|
854
|
+
* @default false
|
|
855
|
+
*/
|
|
856
|
+
"disabled": boolean;
|
|
849
857
|
}
|
|
850
858
|
/**
|
|
851
859
|
* An overlay dialog that interrupts the current flow for a focused task or confirmation.
|
|
@@ -1722,10 +1730,13 @@ declare global {
|
|
|
1722
1730
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
1723
1731
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
1724
1732
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
1725
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
1733
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
1726
1734
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
1735
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
1727
1736
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
1737
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
1728
1738
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
1739
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
1729
1740
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
1730
1741
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
1731
1742
|
*/
|
|
@@ -2815,14 +2826,22 @@ declare namespace LocalJSX {
|
|
|
2815
2826
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
2816
2827
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
2817
2828
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
2818
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
2829
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
2819
2830
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
2831
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
2820
2832
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
2833
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
2821
2834
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
2835
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
2822
2836
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
2823
2837
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
2824
2838
|
*/
|
|
2825
2839
|
interface BsMenuItem {
|
|
2840
|
+
/**
|
|
2841
|
+
* Disables the item: no hover/pressed/focus styling, no pointer cursor, not reachable by keyboard tabbing, and clicking it does not emit `bsSelect`.
|
|
2842
|
+
* @default false
|
|
2843
|
+
*/
|
|
2844
|
+
"disabled"?: boolean;
|
|
2826
2845
|
/**
|
|
2827
2846
|
* Fires when the item is clicked.
|
|
2828
2847
|
*/
|
|
@@ -3046,6 +3065,9 @@ declare namespace LocalJSX {
|
|
|
3046
3065
|
"length": number;
|
|
3047
3066
|
"open": boolean;
|
|
3048
3067
|
}
|
|
3068
|
+
interface BsMenuItemAttributes {
|
|
3069
|
+
"disabled": boolean;
|
|
3070
|
+
}
|
|
3049
3071
|
interface BsModalAttributes {
|
|
3050
3072
|
"open": boolean;
|
|
3051
3073
|
"heading": string;
|
|
@@ -3082,7 +3104,7 @@ declare namespace LocalJSX {
|
|
|
3082
3104
|
"bs-data-table": Omit<BsDataTable, keyof BsDataTableAttributes> & { [K in keyof BsDataTable & keyof BsDataTableAttributes]?: BsDataTable[K] } & { [K in keyof BsDataTable & keyof BsDataTableAttributes as `attr:${K}`]?: BsDataTableAttributes[K] } & { [K in keyof BsDataTable & keyof BsDataTableAttributes as `prop:${K}`]?: BsDataTable[K] };
|
|
3083
3105
|
"bs-input": Omit<BsInput, keyof BsInputAttributes> & { [K in keyof BsInput & keyof BsInputAttributes]?: BsInput[K] } & { [K in keyof BsInput & keyof BsInputAttributes as `attr:${K}`]?: BsInputAttributes[K] } & { [K in keyof BsInput & keyof BsInputAttributes as `prop:${K}`]?: BsInput[K] };
|
|
3084
3106
|
"bs-menu": BsMenu;
|
|
3085
|
-
"bs-menu-item": BsMenuItem;
|
|
3107
|
+
"bs-menu-item": Omit<BsMenuItem, keyof BsMenuItemAttributes> & { [K in keyof BsMenuItem & keyof BsMenuItemAttributes]?: BsMenuItem[K] } & { [K in keyof BsMenuItem & keyof BsMenuItemAttributes as `attr:${K}`]?: BsMenuItemAttributes[K] } & { [K in keyof BsMenuItem & keyof BsMenuItemAttributes as `prop:${K}`]?: BsMenuItem[K] };
|
|
3086
3108
|
"bs-modal": Omit<BsModal, keyof BsModalAttributes> & { [K in keyof BsModal & keyof BsModalAttributes]?: BsModal[K] } & { [K in keyof BsModal & keyof BsModalAttributes as `attr:${K}`]?: BsModalAttributes[K] } & { [K in keyof BsModal & keyof BsModalAttributes as `prop:${K}`]?: BsModal[K] };
|
|
3087
3109
|
"bs-source-link": Omit<BsSourceLink, keyof BsSourceLinkAttributes> & { [K in keyof BsSourceLink & keyof BsSourceLinkAttributes]?: BsSourceLink[K] } & { [K in keyof BsSourceLink & keyof BsSourceLinkAttributes as `attr:${K}`]?: BsSourceLinkAttributes[K] } & { [K in keyof BsSourceLink & keyof BsSourceLinkAttributes as `prop:${K}`]?: BsSourceLink[K] };
|
|
3088
3110
|
"bs-tooltip": Omit<BsTooltip, keyof BsTooltipAttributes> & { [K in keyof BsTooltip & keyof BsTooltipAttributes]?: BsTooltip[K] } & { [K in keyof BsTooltip & keyof BsTooltipAttributes as `attr:${K}`]?: BsTooltipAttributes[K] } & { [K in keyof BsTooltip & keyof BsTooltipAttributes as `prop:${K}`]?: BsTooltip[K] };
|
|
@@ -3574,10 +3596,13 @@ declare module "@stencil/core" {
|
|
|
3574
3596
|
* @prop --bs-menu-item-padding-y - Top/bottom padding. Aliased to `--bs-spacing-100`.
|
|
3575
3597
|
* @prop --bs-menu-item-padding-x - Left/right padding. Aliased to `--bs-spacing-150`.
|
|
3576
3598
|
* @prop --bs-menu-item-gap - Gap between icon and label. Aliased to `--bs-spacing-100`.
|
|
3577
|
-
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container`.
|
|
3599
|
+
* @prop --bs-menu-item-hover - Background on hover. Aliased to `--bs-color-neutral-container-hover`.
|
|
3578
3600
|
* @prop --bs-menu-item-pressed - Background when pressed. Aliased to `--bs-color-neutral-container-pressed`.
|
|
3601
|
+
* @prop --bs-menu-item-disabled-bg - Background when `disabled` is set. Aliased to `--bs-surface-action-disabled`.
|
|
3579
3602
|
* @prop --bs-menu-item-icon-color - Icon color. Aliased to `--bs-icon-default`.
|
|
3603
|
+
* @prop --bs-menu-item-icon-color-disabled - Icon color when `disabled` is set. Aliased to `--bs-icon-disabled`.
|
|
3580
3604
|
* @prop --bs-menu-item-color - Label text color. Aliased to `--bs-text-muted`.
|
|
3605
|
+
* @prop --bs-menu-item-color-disabled - Label text color when `disabled` is set. Aliased to `--bs-text-on-disabled`.
|
|
3581
3606
|
* @prop --bs-menu-item-font-size - Aliased to `--bs-font-size-md`.
|
|
3582
3607
|
* @prop --bs-menu-item-line-height - Aliased to `--bs-line-height-body-md`.
|
|
3583
3608
|
*/
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e,h as s,c as n}from"./p-nLORuTUY.js";const a=class{constructor(s){e(this,s)}render(){return s("div",{key:"e49c52a18ea8c10399d818a00e0c6b748f0c9b8f",part:"list",class:"bs-menu",role:"menu"},s("slot",{key:"7e8cef2af1a068d0ab31fc3aee0abf8b59645a08"}))}};a.style=":host{display:block;--bs-menu-bg:var(--bs-surface-raised);--bs-menu-radius:var(--bs-border-radius-100);--bs-menu-padding-y:var(--bs-spacing-50);--bs-menu-gap:var(--bs-spacing-50);--bs-menu-shadow:var(--bs-shadow-sm)}.bs-menu{box-sizing:border-box;display:flex;flex-direction:column;gap:var(--bs-menu-gap);background:var(--bs-menu-bg);border-radius:var(--bs-menu-radius);padding:var(--bs-menu-padding-y) 0;box-shadow:var(--bs-menu-shadow);font-family:inherit}";const i=class{constructor(s){e(this,s),this.bsSelect=n(this,"bsSelect")}hasIcon=!1;bsSelect;onIconSlotchange=e=>{this.hasIcon=e.target.assignedNodes().length>0};onClick=()=>{this.bsSelect.emit()};render(){return s("button",{key:"dee92b0e122d1a1d100e950ac5b3a368a94d075b",type:"button",part:"item",role:"menuitem",class:"bs-menu-item",onClick:this.onClick},s("span",{key:"e4ce02b4df1ec40bf0f3f72bd1611816e8851909",part:"icon",class:"bs-menu-item__icon "+(this.hasIcon?"bs-menu-item__icon--has-content":"")},s("slot",{key:"9e19fea7d90078577047b5aea0170c09d27fb340",name:"icon",onSlotchange:this.onIconSlotchange})),s("span",{key:"179ce497185c4f9f5bbd238bd0c781a189743ad1",part:"label",class:"bs-menu-item__label"},s("slot",{key:"dfe5de71a770cc9ff9847d8f687bba01ae9e1b1e"})))}};i.style=":host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}";export{a as bs_menu,i as bs_menu_item}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e,p as s,H as t,c as n,h as i}from"./p-BpvhHQSw.js";const a=s(class extends t{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.bsSelect=n(this,"bsSelect")}hasIcon=!1;bsSelect;onIconSlotchange=e=>{this.hasIcon=e.target.assignedNodes().length>0};onClick=()=>{this.bsSelect.emit()};render(){return i("button",{key:"dee92b0e122d1a1d100e950ac5b3a368a94d075b",type:"button",part:"item",role:"menuitem",class:"bs-menu-item",onClick:this.onClick},i("span",{key:"e4ce02b4df1ec40bf0f3f72bd1611816e8851909",part:"icon",class:"bs-menu-item__icon "+(this.hasIcon?"bs-menu-item__icon--has-content":"")},i("slot",{key:"9e19fea7d90078577047b5aea0170c09d27fb340",name:"icon",onSlotchange:this.onIconSlotchange})),i("span",{key:"179ce497185c4f9f5bbd238bd0c781a189743ad1",part:"label",class:"bs-menu-item__label"},i("slot",{key:"dfe5de71a770cc9ff9847d8f687bba01ae9e1b1e"})))}static get style(){return":host{display:block;--bs-menu-item-radius:var(--bs-border-radius-100);--bs-menu-item-padding-y:var(--bs-spacing-100);--bs-menu-item-padding-x:var(--bs-spacing-150);--bs-menu-item-gap:var(--bs-spacing-100);--bs-menu-item-hover:var(--bs-color-neutral-container);--bs-menu-item-pressed:var(--bs-color-neutral-container-pressed);--bs-menu-item-icon-color:var(--bs-icon-default);--bs-menu-item-color:var(--bs-text-muted);--bs-menu-item-font-size:var(--bs-font-size-md);--bs-menu-item-line-height:var(--bs-line-height-body-md)}.bs-menu-item{box-sizing:border-box;display:flex;align-items:center;width:100%;height:48px;border:none;cursor:pointer;background:transparent;color:var(--bs-menu-item-color);font-family:inherit;border-radius:var(--bs-menu-item-radius);padding:var(--bs-menu-item-padding-y) var(--bs-menu-item-padding-x);gap:var(--bs-menu-item-gap);transition:background-color var(--bs-duration-fast) var(--bs-easing-standard)}.bs-menu-item:focus-visible{outline:2px solid var(--bs-border-neutral-focus);outline-offset:2px}.bs-menu-item:hover{background:var(--bs-menu-item-hover)}.bs-menu-item:active{background:var(--bs-menu-item-pressed)}.bs-menu-item__icon{display:none;width:24px;height:24px;flex-shrink:0;color:var(--bs-menu-item-icon-color)}.bs-menu-item__icon--has-content{display:inline-flex;align-items:center;justify-content:center}.bs-menu-item__icon ::slotted(svg){width:24px;height:24px}.bs-menu-item__label{font-size:var(--bs-menu-item-font-size);line-height:calc(var(--bs-menu-item-line-height) * 1px);white-space:nowrap}"}},[769,"bs-menu-item",{hasIcon:[32]}]);function o(){"undefined"!=typeof customElements&&["bs-menu-item"].forEach((s=>{"bs-menu-item"===s&&(customElements.get(e(s))||customElements.define(e(s),a))}))}o();export{a as B,o as d}
|