@prolibu-suite/cobalt-core 0.11.1 → 0.11.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +113 -34
- package/dist/cjs/co-button.cjs.entry.js +1 -1
- package/dist/cjs/co-chip_2.cjs.entry.js +1 -1
- package/dist/cjs/co-document-editor.cjs.entry.js +1 -1
- package/dist/cjs/co-modal.cjs.entry.js +27 -1
- package/dist/cjs/co-overlay.cjs.entry.js +205 -34
- package/dist/cjs/co-rich-text-editor.cjs.entry.js +2 -2
- package/dist/cjs/co-rich-text-viewer.cjs.entry.js +1 -1
- package/dist/cjs/cobalt.cjs.js +1 -1
- package/dist/cjs/{index-oMHzCXm6.js → index-BbSD1Eyw.js} +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/{pagination-DV43TRj9.js → pagination-S2sSAgdl.js} +26 -2
- package/dist/cobalt/cobalt.esm.js +1 -1
- package/dist/cobalt/{p-d6e7c258.entry.js → p-02ff847e.entry.js} +1 -1
- package/dist/cobalt/{p-87e62e2b.entry.js → p-12914c0a.entry.js} +1 -1
- package/dist/cobalt/p-38eb2615.entry.js +1 -0
- package/dist/cobalt/{p-47eca182.entry.js → p-6c7e423c.entry.js} +1 -1
- package/dist/cobalt/p-93063876.entry.js +1 -0
- package/dist/cobalt/{p-RVQJEYxa.js → p-Ch-Tygdb.js} +1 -1
- package/dist/cobalt/p-DGLDAl09.js +1 -0
- package/dist/cobalt/{p-3b6efb79.entry.js → p-bb7bbe70.entry.js} +1 -1
- package/dist/cobalt/p-efd3e0de.entry.js +1 -0
- package/dist/collection/components/co-autocomplete/co-autocomplete.js +1 -1
- package/dist/collection/components/co-avatar-group/co-avatar-group.js +1 -1
- package/dist/collection/components/co-button/co-button.css +15 -0
- package/dist/collection/components/co-checkbox-group/co-checkbox-group.js +1 -1
- package/dist/collection/components/co-chip/co-chip.css +16 -11
- package/dist/collection/components/co-color-area/co-color-area.js +2 -2
- package/dist/collection/components/co-color-slider/co-color-slider.js +1 -1
- package/dist/collection/components/co-combobox/co-combobox.js +1 -1
- package/dist/collection/components/co-command-search/co-command-search.js +1 -1
- package/dist/collection/components/co-data-table/co-data-table.js +1 -1
- package/dist/collection/components/co-date-range-picker/co-date-range-picker.js +2 -2
- package/dist/collection/components/co-document-editor/co-document-editor.js +5 -5
- package/dist/collection/components/co-modal/co-modal.js +68 -1
- package/dist/collection/components/co-overlay/co-overlay.css +7 -0
- package/dist/collection/components/co-overlay/co-overlay.js +130 -26
- package/dist/collection/components/co-overlay/focusTrap.js +111 -3
- package/dist/collection/components/co-popover/co-popover.js +1 -1
- package/dist/collection/components/co-radio-group/co-radio-group.js +1 -1
- package/dist/collection/components/co-ref-field/co-ref-field.js +4 -4
- package/dist/collection/components/co-segmented-bar/co-segmented-bar.js +1 -1
- package/dist/collection/components/co-select/co-select.js +1 -1
- package/dist/collection/components/co-sidebar-nav/co-sidebar-nav.js +1 -1
- package/dist/collection/components/co-toast/co-toast.js +2 -2
- package/dist/collection/components/co-transfer-list/co-transfer-list.js +1 -1
- package/dist/collection/components/co-tree-item/co-tree-item.js +2 -2
- package/dist/components/co-autocomplete.js +1 -1
- package/dist/components/co-button.js +1 -1
- package/dist/components/co-chip.js +1 -1
- package/dist/components/co-column-picker.js +1 -1
- package/dist/components/co-combobox.js +1 -1
- package/dist/components/co-command-search.js +1 -1
- package/dist/components/co-data-table.js +1 -1
- package/dist/components/co-date-picker.js +1 -1
- package/dist/components/co-date-range-picker.js +1 -1
- package/dist/components/co-date-range.js +1 -1
- package/dist/components/co-date-time-picker.js +1 -1
- package/dist/components/co-document-editor.js +1 -1
- package/dist/components/co-drawer.js +1 -1
- package/dist/components/co-modal.js +1 -1
- package/dist/components/co-overlay.js +1 -1
- package/dist/components/co-rich-text-editor.js +1 -1
- package/dist/components/co-rich-text-viewer.js +1 -1
- package/dist/components/{p-BVdCvEza.js → p-BI_VaFsx.js} +1 -1
- package/dist/components/{p-Du8EpQb-.js → p-C_6szR7t.js} +1 -1
- package/dist/components/{p-RVQJEYxa.js → p-Ch-Tygdb.js} +1 -1
- package/dist/components/{p-zJ3pjFzW.js → p-DB8DGMc-.js} +1 -1
- package/dist/components/p-DGLDAl09.js +1 -0
- package/dist/components/{p-Hi57w2_2.js → p-DhPxNA2f.js} +1 -1
- package/dist/components/p-wUXcJGdy.js +1 -0
- package/dist/esm/co-button.entry.js +1 -1
- package/dist/esm/co-chip_2.entry.js +1 -1
- package/dist/esm/co-document-editor.entry.js +1 -1
- package/dist/esm/co-modal.entry.js +28 -2
- package/dist/esm/co-overlay.entry.js +205 -34
- package/dist/esm/co-rich-text-editor.entry.js +2 -2
- package/dist/esm/co-rich-text-viewer.entry.js +1 -1
- package/dist/esm/cobalt.js +1 -1
- package/dist/esm/{index-Cpo8HTwr.js → index-CgyOJePd.js} +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/{pagination-D9OfZUnY.js → pagination-BzrIQtrk.js} +26 -2
- package/dist/types/components/co-modal/co-modal.d.ts +23 -0
- package/dist/types/components/co-overlay/co-overlay.d.ts +29 -1
- package/dist/types/components/co-overlay/focusTrap.d.ts +24 -3
- package/dist/types/components.d.ts +21 -2
- package/package.json +4 -4
- package/dist/cobalt/p-1a5bec8c.entry.js +0 -1
- package/dist/cobalt/p-67a024dd.entry.js +0 -1
- package/dist/cobalt/p-B1JT7us1.js +0 -1
- package/dist/cobalt/p-c4c997f3.entry.js +0 -1
- package/dist/components/p-B1JT7us1.js +0 -1
- package/dist/components/p-nrwDl_gx.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as r,p as o,H as e,c as a,h as t}from"./index.js";import{d as s,a as c}from"./p-nrwDl_gx.js";import{s as i}from"./p-CBX_oabB.js";import{d as n}from"./p-KK2vAKs-.js";import{d}from"./p-BH184F0X.js";const l=o(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.coClose=a(this,"coClose",7),this.coOpen=a(this,"coOpen",7),this.coAfterOpen=a(this,"coAfterOpen",7),this.coAfterClose=a(this,"coAfterClose",7),this.open=!1,this.position="right",this.size="md",this.heading="",this.description="",this.icon="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.modeless=!1,this.loading=!1,this.hasFooter=!1,this.hasTabs=!1,this.hasHeaderSlot=!1,this.handleFooterSlotChange=r=>{this.hasFooter=i(r)},this.handleTabsSlotChange=r=>{this.hasTabs=i(r)},this.handleHeaderSlotChange=r=>{this.hasHeaderSlot=i(r)},this.handleOverlayClose=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=r=>{r.stopPropagation()},this.handleTransitionEnd=r=>{if(r.target!==this.asideEl)return;const o=c(r.propertyName,this.open,"transform");"after-open"===o?this.coAfterOpen.emit():"after-close"===o&&this.coAfterClose.emit()},this.promoteModeless=r=>{r&&(this.asideEl=r);const o=this.asideEl;if(this.modeless&&o&&"function"==typeof o.showPopover)try{o.matches(":popover-open")||o.showPopover()}catch(r){}}}get labelledBy(){return this.hasHeaderSlot?"co-drawer-header-content":this.heading?"co-drawer-heading":void 0}onOpenChange(r,o){r&&!o&&this.coOpen.emit()}handleKey(r){this.open&&this.closeOnEscape&&"Escape"===r.key&&(this.modeless&&document.querySelector("co-drawer[open]:not([modeless]), co-modal[open]")||this.coClose.emit())}componentDidLoad(){this.promoteModeless()}render(){const r=t("aside",{class:{"co-drawer":!0,"co-sq-elevation":!0,"co-sq-elevation-fallback":!0,"co-drawer--open":this.open,"co-drawer--modeless":this.modeless,[`co-drawer--${this.position}`]:!0,[`co-drawer--${this.size}`]:!0},popover:this.modeless?"manual":void 0,ref:this.promoteModeless,part:"drawer",role:"dialog","aria-modal":this.modeless?"false":"true","aria-labelledby":this.labelledBy,onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},t("div",{class:"co-drawer__card co-sq-clip",part:"card"},t("header",{class:"co-drawer__header",part:"header"},t("div",{class:"co-drawer__header-content",id:"co-drawer-header-content"},t("slot",{name:"header",onSlotchange:this.handleHeaderSlotChange},t("div",{class:"co-drawer__heading-row"},this.icon&&t("co-icon",{name:this.icon,size:20,class:"co-drawer__icon"}),t("h2",{class:"co-drawer__heading",id:"co-drawer-heading"},this.heading)),this.description&&t("p",{class:"co-drawer__description"},this.description))),this.closable&&t("button",{class:"co-drawer__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},t("co-icon",{name:"x",size:20}))),t("div",{class:{"co-drawer__tabs":!0,"co-drawer__tabs--empty":!this.hasTabs},part:"tabs"},t("slot",{name:"tabs",onSlotchange:this.handleTabsSlotChange})),t("div",{class:"co-drawer__body",part:"body"},t("slot",null),t("co-loader",{overlay:!0,visible:this.loading,part:"loader"})),t("footer",{class:{"co-drawer__footer":!0,"co-drawer__footer--empty":!this.hasFooter},part:"footer"},t("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange}))));return this.modeless?r:t("co-overlay",{open:this.open,onCoClose:this.handleOverlayClose},r)}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return'.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents}.co-drawer{position:fixed;display:flex;flex-direction:column;font-family:var(--co-font-family-primary);transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out);will-change:transform;z-index:1;contain:layout;--co-drawer-r:var(--co-shell-r, var(--co-border-radius-md));--co-sq-r:var(--co-drawer-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 10px 56px rgba(31, 28, 27, 0.12);--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 10px 28px rgba(31, 28, 27, 0.12))}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(100% + 12px))}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(-100% - 12px))}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px))}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:672px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__card{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--co-semantic-surface-page)}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading-row{display:flex;align-items:center;gap:var(--co-spacing-sm, 8px)}.co-drawer__icon{flex-shrink:0;color:var(--co-semantic-text-secondary)}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__description{margin:var(--co-spacing-xs) 0 0;font-size:var(--co-font-size-13, 13px);font-weight:400;color:var(--co-semantic-text-muted);line-height:1.4}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs--empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:var(--co-spacing-xl);position:relative}.co-drawer__body{scrollbar-width:thin;scrollbar-color:transparent transparent}.co-drawer__body:hover{scrollbar-color:var(--co-color-opacity-negro-16) transparent}.co-drawer__body::-webkit-scrollbar{width:6px}.co-drawer__body::-webkit-scrollbar-track{background:transparent}.co-drawer__body::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.co-drawer__body:hover::-webkit-scrollbar-thumb{background:var(--co-color-opacity-negro-16)}.co-drawer__body:hover::-webkit-scrollbar-thumb:hover{background:var(--co-color-opacity-negro-25)}.co-drawer__body:hover::-webkit-scrollbar-thumb:active{background:var(--co-color-opacity-negro-50)}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer--empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}.co-drawer--modeless{z-index:1000;border:0;padding:0;background:transparent}.co-drawer--modeless.co-drawer--right{left:auto;bottom:auto}.co-drawer--modeless.co-drawer--left{right:auto;bottom:auto}.co-drawer--modeless.co-drawer--bottom{top:auto}'}},[257,"co-drawer",{open:[1540],position:[513],size:[513],heading:[1],description:[1],icon:[1],closable:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],modeless:[516],loading:[4],hasFooter:[32],hasTabs:[32],hasHeaderSlot:[32]},[[4,"keydown","handleKey"]],{open:[{onOpenChange:0}]}]);function h(){"undefined"!=typeof customElements&&["co-drawer","co-icon","co-loader","co-overlay"].forEach((o=>{switch(o){case"co-drawer":customElements.get(r(o))||customElements.define(r(o),l);break;case"co-icon":customElements.get(r(o))||n();break;case"co-loader":customElements.get(r(o))||d();break;case"co-overlay":customElements.get(r(o))||s()}}))}h();export{l as C,h as d}
|
|
1
|
+
import{t as r,p as o,H as e,c as a,h as t}from"./index.js";import{d as s,a as c}from"./p-wUXcJGdy.js";import{s as i}from"./p-CBX_oabB.js";import{d as n}from"./p-KK2vAKs-.js";import{d}from"./p-BH184F0X.js";const l=o(class extends e{constructor(r){super(),!1!==r&&this.__registerHost(),this.__attachShadow(),this.coClose=a(this,"coClose",7),this.coOpen=a(this,"coOpen",7),this.coAfterOpen=a(this,"coAfterOpen",7),this.coAfterClose=a(this,"coAfterClose",7),this.open=!1,this.position="right",this.size="md",this.heading="",this.description="",this.icon="",this.closable=!0,this.closeOnOverlay=!0,this.closeOnEscape=!0,this.modeless=!1,this.loading=!1,this.hasFooter=!1,this.hasTabs=!1,this.hasHeaderSlot=!1,this.handleFooterSlotChange=r=>{this.hasFooter=i(r)},this.handleTabsSlotChange=r=>{this.hasTabs=i(r)},this.handleHeaderSlotChange=r=>{this.hasHeaderSlot=i(r)},this.handleOverlayClose=()=>{this.closeOnOverlay&&this.coClose.emit()},this.handleCloseClick=()=>{this.coClose.emit()},this.stopPropagation=r=>{r.stopPropagation()},this.handleTransitionEnd=r=>{if(r.target!==this.asideEl)return;const o=c(r.propertyName,this.open,"transform");"after-open"===o?this.coAfterOpen.emit():"after-close"===o&&this.coAfterClose.emit()},this.promoteModeless=r=>{r&&(this.asideEl=r);const o=this.asideEl;if(this.modeless&&o&&"function"==typeof o.showPopover)try{o.matches(":popover-open")||o.showPopover()}catch(r){}}}get labelledBy(){return this.hasHeaderSlot?"co-drawer-header-content":this.heading?"co-drawer-heading":void 0}onOpenChange(r,o){r&&!o&&this.coOpen.emit()}handleKey(r){this.open&&this.closeOnEscape&&"Escape"===r.key&&(this.modeless&&document.querySelector("co-drawer[open]:not([modeless]), co-modal[open]")||this.coClose.emit())}componentDidLoad(){this.promoteModeless()}render(){const r=t("aside",{class:{"co-drawer":!0,"co-sq-elevation":!0,"co-sq-elevation-fallback":!0,"co-drawer--open":this.open,"co-drawer--modeless":this.modeless,[`co-drawer--${this.position}`]:!0,[`co-drawer--${this.size}`]:!0},popover:this.modeless?"manual":void 0,ref:this.promoteModeless,part:"drawer",role:"dialog","aria-modal":this.modeless?"false":"true","aria-labelledby":this.labelledBy,onClick:this.stopPropagation,onTransitionEnd:this.handleTransitionEnd},t("div",{class:"co-drawer__card co-sq-clip",part:"card"},t("header",{class:"co-drawer__header",part:"header"},t("div",{class:"co-drawer__header-content",id:"co-drawer-header-content"},t("slot",{name:"header",onSlotchange:this.handleHeaderSlotChange},t("div",{class:"co-drawer__heading-row"},this.icon&&t("co-icon",{name:this.icon,size:20,class:"co-drawer__icon"}),t("h2",{class:"co-drawer__heading",id:"co-drawer-heading"},this.heading)),this.description&&t("p",{class:"co-drawer__description"},this.description))),this.closable&&t("button",{class:"co-drawer__close",type:"button","aria-label":"Close",onClick:this.handleCloseClick},t("co-icon",{name:"x",size:20}))),t("div",{class:{"co-drawer__tabs":!0,"co-drawer__tabs--empty":!this.hasTabs},part:"tabs"},t("slot",{name:"tabs",onSlotchange:this.handleTabsSlotChange})),t("div",{class:"co-drawer__body",part:"body"},t("slot",null),t("co-loader",{overlay:!0,visible:this.loading,part:"loader"})),t("footer",{class:{"co-drawer__footer":!0,"co-drawer__footer--empty":!this.hasFooter},part:"footer"},t("slot",{name:"footer",onSlotchange:this.handleFooterSlotChange}))));return this.modeless?r:t("co-overlay",{open:this.open,onCoClose:this.handleOverlayClose},r)}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return'.co-sq-elevation{border-radius:var(--co-sq-r);corner-shape:squircle;box-shadow:var(--co-sq-shadow)}.co-sq-clip{overflow:hidden;border-radius:var(--co-sq-r);corner-shape:squircle}@supports not (corner-shape: squircle){.co-sq-elevation{box-shadow:none}.co-sq-elevation-fallback{filter:var(--co-sq-drop-shadow)}.co-sq-clip{border-radius:0;--co-sq-tl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 0L95 0L92.5 0L90 0L87.5 0.01L85 0.01L82.5 0.02L80 0.04L77.5 0.06L75 0.1L72.5 0.14L70 0.2L67.5 0.28L65 0.38L62.5 0.5L60 0.65L57.5 0.83L55 1.04L52.5 1.3L50 1.6L47.5 1.96L45 2.37L42.5 2.85L40 3.41L37.5 4.05L35 4.8L32.5 5.65L30 6.63L27.5 7.77L25 9.07L22.5 10.58L20 12.34L17.5 14.41L15 16.85L12.5 19.79L10 23.42L7.5 28.06L5 34.37L2.5 44.29L0 100L100 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-tr:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 0L5 0L7.5 0L10 0L12.5 0.01L15 0.01L17.5 0.02L20 0.04L22.5 0.06L25 0.1L27.5 0.14L30 0.2L32.5 0.28L35 0.38L37.5 0.5L40 0.65L42.5 0.83L45 1.04L47.5 1.3L50 1.6L52.5 1.96L55 2.37L57.5 2.85L60 3.41L62.5 4.05L65 4.8L67.5 5.65L70 6.63L72.5 7.77L75 9.07L77.5 10.58L80 12.34L82.5 14.41L85 16.85L87.5 19.79L90 23.42L92.5 28.06L95 34.37L97.5 44.29L100 100L0 100Z%27 fill=%27%23fff%27/></svg>");--co-sq-bl:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M0 0L2.5 55.71L5 65.63L7.5 71.94L10 76.58L12.5 80.21L15 83.15L17.5 85.59L20 87.66L22.5 89.42L25 90.93L27.5 92.23L30 93.37L32.5 94.35L35 95.2L37.5 95.95L40 96.59L42.5 97.15L45 97.63L47.5 98.04L50 98.4L52.5 98.7L55 98.96L57.5 99.17L60 99.35L62.5 99.5L65 99.62L67.5 99.72L70 99.8L72.5 99.86L75 99.9L77.5 99.94L80 99.96L82.5 99.98L85 99.99L87.5 99.99L90 100L92.5 100L95 100L97.5 100L100 100L100 0Z%27 fill=%27%23fff%27/></svg>");--co-sq-br:url("data:image/svg+xml,<svg xmlns=%27http://www.w3.org/2000/svg%27 viewBox=%270 0 100 100%27 preserveAspectRatio=%27none%27><path d=%27M100 0L97.5 55.71L95 65.63L92.5 71.94L90 76.58L87.5 80.21L85 83.15L82.5 85.59L80 87.66L77.5 89.42L75 90.93L72.5 92.23L70 93.37L67.5 94.35L65 95.2L62.5 95.95L60 96.59L57.5 97.15L55 97.63L52.5 98.04L50 98.4L47.5 98.7L45 98.96L42.5 99.17L40 99.35L37.5 99.5L35 99.62L32.5 99.72L30 99.8L27.5 99.86L25 99.9L22.5 99.94L20 99.96L17.5 99.98L15 99.99L12.5 99.99L10 100L7.5 100L5 100L2.5 100L0 100L0 0Z%27 fill=%27%23fff%27/></svg>");-webkit-mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat;mask:var(--co-sq-tl) top left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-tr) top right / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-bl) bottom left / var(--co-sq-r) var(--co-sq-r) no-repeat, var(--co-sq-br) bottom right / var(--co-sq-r) var(--co-sq-r) no-repeat, linear-gradient(#fff 0 0) center / 100% calc(100% - 2 * var(--co-sq-r) + 2px) no-repeat, linear-gradient(#fff 0 0) center / calc(100% - 2 * var(--co-sq-r) + 2px) 100% no-repeat}}:host{display:contents}.co-drawer{position:fixed;display:flex;flex-direction:column;font-family:var(--co-font-family-primary);transition:transform var(--co-motion-duration-slow) var(--co-motion-ease-in-out);will-change:transform;z-index:1;contain:layout;--co-drawer-r:var(--co-shell-r, var(--co-border-radius-md));--co-sq-r:var(--co-drawer-r);--co-sq-shadow:0 1px 4px rgba(31, 28, 27, 0.06), 0 10px 56px rgba(31, 28, 27, 0.12);--co-sq-drop-shadow:drop-shadow(0 1px 2px rgba(31, 28, 27, 0.06)) drop-shadow(0 10px 28px rgba(31, 28, 27, 0.12))}.co-drawer--right{top:0;right:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(100% + 12px))}.co-drawer--right.co-drawer--open{transform:translateX(0)}.co-drawer--left{top:0;left:0;margin:6px;height:100vh;height:-webkit-fill-available;transform:translateX(calc(-100% - 12px))}.co-drawer--left.co-drawer--open{transform:translateX(0)}.co-drawer--bottom{bottom:0;left:0;right:0;margin:6px;width:auto;transform:translateY(calc(100% + 12px))}.co-drawer--bottom.co-drawer--open{transform:translateY(0)}.co-drawer--right.co-drawer--sm,.co-drawer--left.co-drawer--sm{width:400px;max-width:100vw}.co-drawer--right.co-drawer--md,.co-drawer--left.co-drawer--md{width:520px;max-width:100vw}.co-drawer--right.co-drawer--lg,.co-drawer--left.co-drawer--lg{width:672px;max-width:100vw}.co-drawer--right.co-drawer--xl,.co-drawer--left.co-drawer--xl{width:960px;max-width:100vw}.co-drawer--right.co-drawer--full,.co-drawer--left.co-drawer--full{width:100vw}.co-drawer--bottom.co-drawer--sm{height:40vh}.co-drawer--bottom.co-drawer--md{height:60vh}.co-drawer--bottom.co-drawer--lg{height:80vh}.co-drawer--bottom.co-drawer--xl{height:95vh}.co-drawer--bottom.co-drawer--full{height:100vh}.co-drawer__card{flex:1;min-height:0;display:flex;flex-direction:column;background:var(--co-semantic-surface-page)}.co-drawer__header{display:flex;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-bottom:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__header-content{flex:1;min-width:0}.co-drawer__heading-row{display:flex;align-items:center;gap:var(--co-spacing-sm, 8px)}.co-drawer__icon{flex-shrink:0;color:var(--co-semantic-text-secondary)}.co-drawer__heading{margin:0;font-size:var(--co-font-size-18);font-weight:600;color:var(--co-semantic-text-default);line-height:1.3;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.co-drawer__description{margin:var(--co-spacing-xs) 0 0;font-size:var(--co-font-size-13, 13px);font-weight:400;color:var(--co-semantic-text-muted);line-height:1.4}.co-drawer__close{display:flex;align-items:center;justify-content:center;padding:var(--co-spacing-xs);margin:0;border:none;background:transparent;cursor:pointer;color:var(--co-semantic-text-muted);border-radius:var(--co-border-radius-sm);transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out);flex-shrink:0}.co-drawer__close:hover{background:var(--co-semantic-surface-hover)}.co-drawer__close:focus-visible{outline:2px solid var(--co-color-primary-azul);outline-offset:2px}.co-drawer__tabs{flex-shrink:0;border-bottom:1px solid var(--co-semantic-border-default)}.co-drawer__tabs--empty{display:none}.co-drawer__body{flex:1;overflow-y:auto;overscroll-behavior:contain;padding:var(--co-spacing-xl);position:relative}.co-drawer__body{scrollbar-width:thin;scrollbar-color:transparent transparent}.co-drawer__body:hover{scrollbar-color:var(--co-color-opacity-negro-16) transparent}.co-drawer__body::-webkit-scrollbar{width:6px}.co-drawer__body::-webkit-scrollbar-track{background:transparent}.co-drawer__body::-webkit-scrollbar-thumb{background:transparent;border-radius:9999px}.co-drawer__body:hover::-webkit-scrollbar-thumb{background:var(--co-color-opacity-negro-16)}.co-drawer__body:hover::-webkit-scrollbar-thumb:hover{background:var(--co-color-opacity-negro-25)}.co-drawer__body:hover::-webkit-scrollbar-thumb:active{background:var(--co-color-opacity-negro-50)}.co-drawer__footer{display:flex;justify-content:flex-end;align-items:center;gap:var(--co-spacing-md);padding:var(--co-spacing-lg) var(--co-spacing-xl);border-top:1px solid var(--co-semantic-border-default);flex-shrink:0}.co-drawer__footer--empty{display:none}@media (max-width: 600px){.co-drawer--right,.co-drawer--left{width:100vw !important}}.co-drawer--modeless{z-index:1000;border:0;padding:0;background:transparent}.co-drawer--modeless.co-drawer--right{left:auto;bottom:auto}.co-drawer--modeless.co-drawer--left{right:auto;bottom:auto}.co-drawer--modeless.co-drawer--bottom{top:auto}'}},[257,"co-drawer",{open:[1540],position:[513],size:[513],heading:[1],description:[1],icon:[1],closable:[4],closeOnOverlay:[4,"close-on-overlay"],closeOnEscape:[4,"close-on-escape"],modeless:[516],loading:[4],hasFooter:[32],hasTabs:[32],hasHeaderSlot:[32]},[[4,"keydown","handleKey"]],{open:[{onOpenChange:0}]}]);function h(){"undefined"!=typeof customElements&&["co-drawer","co-icon","co-loader","co-overlay"].forEach((o=>{switch(o){case"co-drawer":customElements.get(r(o))||customElements.define(r(o),l);break;case"co-icon":customElements.get(r(o))||n();break;case"co-loader":customElements.get(r(o))||d();break;case"co-overlay":customElements.get(r(o))||s()}}))}h();export{l as C,h as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as t,w as e,g as a,s,r as n,a as o,b as r,C as i,c as l,d as u,F as E,e as g,f as T,h as d,I as m,j as S,L as _,k as I,l as c,M as P,m as p,P as x,n as A,o as f,p as L,q as F,S as h,t as N,u as C,T as y,V as b,v as k,x as O,y as H,z as M,A as z,B,D as G,E as R,G as j,H as v,J as U,K as Y,N as $,O as w,Q as D,R as K,U as V,W,X,Y as Z,Z as q,_ as J}from"./p-Ch-Tygdb.js";import{C as Q,T as tt,t as et}from"./p-CRxTFT_z.js";function at(t,e){return r(t,{includeUiExtensions:!1,features:e})}var st=Object.freeze({__proto__:null,COLOR_PALETTE:Q,CalloutNode:i,CobaltTaskItem:l,CobaltTaskList:u,FIELD_SYNC_META:E,FontFamilyExtension:g,FontSizeExtension:T,FontWeightExtension:d,IMAGE_LAYOUT_MODES:m,IndentExtension:S,LetterSpacingExtension:_,LineHeightExtension:I,ListStyleExtension:c,MentionNode:P,MergeField:p,PAGE_GAP_PX:x,PAGE_SIZES:A,PAGINATION_META:f,PRESETS:L,Pagination:F,SANITIZE_CONFIGS:h,SIGNATURE_TOKEN_STYLE:N,SignatureSlot:C,TABLE_CONTEXT_ITEMS:tt,TRAILING_BREAK_CLASS:y,VariableNode:b,applyImageLayoutMode:k,collectFields:O,computePageBreaks:H,createEditor:M,defaultToolbarForPreset:z,getExtensions:r,getImageLayoutMode:B,getPrintExtensions:G,headerImageWidth:R,htmlToJson:function(e,a="task",r){if(t(a))return n(e,a,r);const i=s(e??"",a,r);return o(i,at(a,r))},isPrintPreset:t,jsonToHtml:function(n,o="task",r){if(t(o))return n?e(n,o,r):"";if(function(t){if(!t)return!0;const e=t.content;return!Array.isArray(e)||0===e.length||e.every((t=>"paragraph"===t?.type&&(!t.content||0===t.content.length)))}(n))return"";const i=a(n,at(o,r));return s(i,o,r)},jsonToText:function(t){if(!t)return"";const e=new Set(["paragraph","heading","blockquote","listItem","bulletList","orderedList","codeBlock","horizontalRule"]),a=[],s=t=>{t&&("text"!==t.type||"string"!=typeof t.text?"variable"!==t.type?"mention"!==t.type?"mergeField"!==t.type?"signatureSlot"!==t.type?"hardBreak"!==t.type?(Array.isArray(t.content)&&t.content.forEach(s),e.has(t.type)&&a.push("\n")):a.push("\n"):a.push(`⟦sig:${t.attrs?.slot??1}⟧`):a.push(t.attrs?.value||`[[${t.attrs?.name??""}]]`):a.push(`@${t.attrs?.label??""}`):a.push(`{{${t.attrs?.name??""}}}`):a.push(t.text))};return s(t),a.join("").replace(/\n{3,}/g,"\n\n").trim()},layoutBox:j,maxLengthForPreset:v,nextFreeSlot:U,normalizePrintHtml:Y,pageContentHeight:$,parseFieldToken:w,readPrintHtml:n,resolvePageSize:D,sanitize:s,sanitizeFieldName:K,serializePrintHtml:V,setFieldValuesInHtml:W,signatureBoxStyle:X,signatureSlotHtml:Z,signatureToken:q,stripBandOffsets:J,toolbarItems:et,writePrintHtml:e});export{st as R}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as o,p as t,H as r,h as a}from"./index.js";import{d as c}from"./p-KK2vAKs-.js";const n={l:20,m:18,s:16,xs:14,sm:16},s=t(class extends r{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.variant="primary",this.shape="rounded",this.size="m",this.fullWidth=!1,this.elevated=!1,this.surface="light",this.disabled=!1,this.iconWeight="regular",this.type="button",this.handleClick=()=>{if(!this.disabled){if("submit"===this.type){const o=this.el.closest("form");if(o)return void o.requestSubmit()}if("reset"===this.type){const o=this.el.closest("form");o&&o.reset()}}}}render(){var o,t;const r=null!==(t=null!==(o=this.iconSize)&&void 0!==o?o:n[this.size])&&void 0!==t?t:18,c={};return this.color&&(c.background=this.color),this.textColor&&(c.color=this.textColor),a("button",{key:"e77a3b67e23b2690a818e6ad9aa38b21b4c8f972",class:{"co-button":!0,[`co-button--${this.variant}`]:!0,[`co-button--${this.shape}`]:!0,[`co-button--${this.size}`]:!0,[`co-button--surface-${this.surface}`]:!0,"co-button--elevated":this.elevated,"co-button--disabled":this.disabled},style:Object.keys(c).length?c:void 0,type:this.type,disabled:this.disabled,"aria-label":this.ariaLabelText||void 0,onClick:this.handleClick,part:"button"},this.iconLeft?a("co-icon",{name:this.iconLeft,weight:this.iconWeight,size:r}):null,a("slot",{key:"ee52eb057c04ee3e1f5a5b2e87dc778a338d9887"},this.label),this.iconRight?a("co-icon",{name:this.iconRight,weight:this.iconWeight,size:r}):null)}get el(){return this}static get style(){return':host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:var(--co-button-border-color, color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent))}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border-color, var(--co-button-border, var(--co-semantic-border-subtle)))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, var(--co-semantic-border-default))}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}.co-button>co-icon{margin-block:-1px}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}.co-button--soft{background:var(--co-semantic-surface-control);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--soft:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-control), var(--co-semantic-surface-hover))}.co-button--rounded.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-border-radius-xs)}:host([full-width]){display:block;width:100%}:host([full-width]) .co-button{width:100%}co-icon{color:var(--co-button-icon-color, inherit)}'}},[257,"co-button",{variant:[1],shape:[513],size:[1],fullWidth:[516,"full-width"],elevated:[4],surface:[1],disabled:[516],label:[1],ariaLabelText:[1,"aria-label-text"],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],iconWeight:[1,"icon-weight"],type:[1],color:[1],textColor:[1,"text-color"],iconSize:[2,"icon-size"]}]);function e(){"undefined"!=typeof customElements&&["co-button","co-icon"].forEach((t=>{switch(t){case"co-button":customElements.get(o(t))||customElements.define(o(t),s);break;case"co-icon":customElements.get(o(t))||c()}}))}e();export{s as C,e as d}
|
|
1
|
+
import{t as o,p as t,H as r,h as a}from"./index.js";import{d as c}from"./p-KK2vAKs-.js";const n={l:20,m:18,s:16,xs:14,sm:16},s=t(class extends r{constructor(o){super(),!1!==o&&this.__registerHost(),this.__attachShadow(),this.variant="primary",this.shape="rounded",this.size="m",this.fullWidth=!1,this.elevated=!1,this.surface="light",this.disabled=!1,this.iconWeight="regular",this.type="button",this.handleClick=()=>{if(!this.disabled){if("submit"===this.type){const o=this.el.closest("form");if(o)return void o.requestSubmit()}if("reset"===this.type){const o=this.el.closest("form");o&&o.reset()}}}}render(){var o,t;const r=null!==(t=null!==(o=this.iconSize)&&void 0!==o?o:n[this.size])&&void 0!==t?t:18,c={};return this.color&&(c.background=this.color),this.textColor&&(c.color=this.textColor),a("button",{key:"e77a3b67e23b2690a818e6ad9aa38b21b4c8f972",class:{"co-button":!0,[`co-button--${this.variant}`]:!0,[`co-button--${this.shape}`]:!0,[`co-button--${this.size}`]:!0,[`co-button--surface-${this.surface}`]:!0,"co-button--elevated":this.elevated,"co-button--disabled":this.disabled},style:Object.keys(c).length?c:void 0,type:this.type,disabled:this.disabled,"aria-label":this.ariaLabelText||void 0,onClick:this.handleClick,part:"button"},this.iconLeft?a("co-icon",{name:this.iconLeft,weight:this.iconWeight,size:r}):null,a("slot",{key:"ee52eb057c04ee3e1f5a5b2e87dc778a338d9887"},this.label),this.iconRight?a("co-icon",{name:this.iconRight,weight:this.iconWeight,size:r}):null)}get el(){return this}static get style(){return':host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:var(--co-button-border-color, color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent))}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border-color, var(--co-button-border, var(--co-semantic-border-subtle)))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, var(--co-semantic-border-default))}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button:focus-visible{box-shadow:0 0 0 2px var(--co-semantic-surface-page), 0 0 0 4px var(--co-semantic-border-focus);outline:2px solid transparent;outline-offset:2px}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}.co-button>co-icon{margin-block:-1px}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}.co-button--soft{background:var(--co-semantic-surface-control);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--soft:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-control), var(--co-semantic-surface-hover))}.co-button--rounded.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-border-radius-xs)}:host([full-width]){display:block;width:100%}:host([full-width]) .co-button{width:100%}co-icon{color:var(--co-button-icon-color, inherit)}'}},[257,"co-button",{variant:[1],shape:[513],size:[1],fullWidth:[516,"full-width"],elevated:[4],surface:[1],disabled:[516],label:[1],ariaLabelText:[1,"aria-label-text"],iconLeft:[1,"icon-left"],iconRight:[1,"icon-right"],iconWeight:[1,"icon-weight"],type:[1],color:[1],textColor:[1,"text-color"],iconSize:[2,"icon-size"]}]);function e(){"undefined"!=typeof customElements&&["co-button","co-icon"].forEach((t=>{switch(t){case"co-button":customElements.get(o(t))||customElements.define(o(t),s);break;case"co-icon":customElements.get(o(t))||c()}}))}e();export{s as C,e as d}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t,p as n,H as e,c as o,h as i}from"./index.js";function s(t,n,e){return t!==e?null:n?"after-open":"after-close"}const r=["a[href]","area[href]","button:not([disabled])",'input:not([disabled]):not([type="hidden"])',"select:not([disabled])","textarea:not([disabled])","iframe","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])','[tabindex]:not([tabindex="-1"])'].join(",");function a(t){if(t.shadowRoot)return Array.from(t.shadowRoot.children);if("SLOT"===t.tagName){const n=t.assignedElements({flatten:!0});return n.length?n:Array.from(t.children)}return Array.from(t.children)}function c(t){var n,e;if(!(null===(n=t.matches)||void 0===n?void 0:n.call(t,r))||t.hasAttribute("disabled"))return!1;const o=t.getAttribute("tabindex");return!(null!==o&&Number(o)<0||null===t.offsetParent&&0===t.getClientRects().length||!1===(null===(e=t.checkVisibility)||void 0===e?void 0:e.call(t,{visibilityProperty:!0})))}function h(t,n){const e=t=>{return"true"!==(o=t).getAttribute("aria-hidden")&&!o.hasAttribute("inert")&&(!!n(t)||a(t).some(e));var o};a(t).some(e)}function u(t,n){let e=null;return h(t,(t=>!!n(t)&&(e=t,!0))),e}function l(t){const n=[];return h(t,(t=>(c(t)&&n.push(t),!1))),n}function d(t,n){return t.length>0&&t[t.length-1]===n}let f=0,p="";const v=[];let y=0;const b="co-overlay--refront";function m(t){"function"==typeof requestAnimationFrame?requestAnimationFrame(t):t()}const g=n(class extends e{constructor(t){super(),!1!==t&&this.__registerHost(),this.__attachShadow(),this.coClose=o(this,"coClose",7),this.coAfterClose=o(this,"coAfterClose",3),this.coAfterOpen=o(this,"coAfterOpen",3),this.open=!1,this.trapFocus=!1,this.closeOnEscape=!1,this.hasLock=!1,this.trapId="co-overlay-trap-"+ ++y,this.trapping=!1,this.pressDownTarget=null,this.pressUpTarget=null,this.handlePointerDown=t=>{var n;this.pressDownTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,this.pressUpTarget=null},this.handlePointerUp=t=>{var n;this.pressUpTarget=null!==(n=t.composedPath()[0])&&void 0!==n?n:null},this.handleClick=t=>{var n;const e=null!==(n=t.composedPath()[0])&&void 0!==n?n:null,o=e===this.overlayEl&&function(t,n,e){return null!==t&&t===n&&n===e}(this.pressDownTarget,this.pressUpTarget,e);this.pressDownTarget=null,this.pressUpTarget=null,o&&this.coClose.emit()},this.handleTransitionEnd=t=>{if(t.target!==this.overlayEl)return;const n=s(t.propertyName,this.open,"opacity");"after-open"===n?this.coAfterOpen.emit():"after-close"===n&&this.coAfterClose.emit()}}onOpenChange(t){t?this.acquireLock():this.releaseLock(),this.syncPopover(),this.syncTrap()}onTrapFocusChange(){this.syncTrap()}componentDidLoad(){this.open&&this.acquireLock(),this.syncPopover(),this.syncTrap()}disconnectedCallback(){this.releaseLock(),this.releaseTrap()}async bringToFront(){const t=this.overlayEl;if(!this.open||!t||"function"!=typeof t.showPopover)return;if(!t.matches(":popover-open"))return;const n=this.deepActiveElement();t.classList.add(b);try{t.hidePopover(),t.showPopover()}catch(t){}n&&n.isConnected&&this.deepActiveElement()!==n&&n.focus({preventScroll:!0}),m((()=>t.classList.remove(b)))}acquireLock(){this.hasLock||(this.hasLock=!0,"undefined"!=typeof document&&(0===f&&(p=document.body.style.overflow,document.body.style.overflow="hidden"),f++))}releaseLock(){this.hasLock&&(this.hasLock=!1,"undefined"!=typeof document&&0!==f&&(f--,0===f&&(document.body.style.overflow=p)))}syncPopover(){const t=this.overlayEl;if(t&&"function"==typeof t.showPopover)try{const n=t.matches(":popover-open");this.open&&!n?t.showPopover():!this.open&&n&&t.hidePopover()}catch(t){}}syncTrap(){this.open&&this.trapFocus?this.engageTrap():this.releaseTrap()}engageTrap(){this.trapping||(this.trapping=!0,v.push(this.trapId),this.captureAndFocus())}releaseTrap(){if(!this.trapping)return;this.trapping=!1;const t=v.indexOf(this.trapId);t>=0&&v.splice(t,1),this.restoreFocus()}captureAndFocus(){this.returnFocusEl=this.deepActiveElement(),m((()=>{var t;if(!this.open||!this.trapping||!d(v,this.trapId))return;const n=function(t){const n=u(t,(t=>t.hasAttribute("autofocus")));if(n){if(c(n))return n;const t=n.shadowRoot?l(n)[0]:void 0;if(t)return t}return u(t,c)}(this.el);n?n.focus():null===(t=this.overlayEl)||void 0===t||t.focus()}))}restoreFocus(){const t=this.returnFocusEl;this.returnFocusEl=null,t&&t.isConnected&&"function"==typeof t.focus&&t.focus({preventScroll:!0})}deepActiveElement(){if("undefined"==typeof document)return null;let t=document.activeElement;for(;t&&t.shadowRoot&&t.shadowRoot.activeElement;)t=t.shadowRoot.activeElement;return t}handleKeydown(t){this.open&&(this.closeOnEscape&&"Escape"===t.key?this.coClose.emit():this.trapping&&"Tab"===t.key&&d(v,this.trapId)&&this.trapTab(t))}trapTab(t){var n;if(t.defaultPrevented)return;const e=l(this.el);if(0===e.length)return t.preventDefault(),void(null===(n=this.overlayEl)||void 0===n||n.focus());const o=e.indexOf(this.deepActiveElement()),i=function(t,n,e){return t<=0?-1:e?n<=0?t-1:n-1:-1===n||n>=t-1?0:n+1}(e.length,o,t.shiftKey);i<0||(t.preventDefault(),e[i].focus())}render(){return i("div",{key:"e18d7b0e3ebd4933a78a9f2d39af6058ce429105",class:{"co-overlay":!0,"co-overlay--open":this.open},part:"overlay",popover:"manual",tabindex:this.trapFocus?-1:void 0,ref:t=>this.overlayEl=t,onPointerDown:this.handlePointerDown,onPointerUp:this.handlePointerUp,onClick:this.handleClick,onTransitionEnd:this.handleTransitionEnd},i("slot",{key:"2f29233d44de8a0cc3100cfa08233cdc10ebf352"}))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}],trapFocus:[{onTrapFocusChange:0}]}}static get style(){return":host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-overlay--refront{transition:none !important}"}},[257,"co-overlay",{open:[1540],trapFocus:[516,"trap-focus"],closeOnEscape:[516,"close-on-escape"],bringToFront:[64]},[[4,"keydown","handleKeydown"]],{open:[{onOpenChange:0}],trapFocus:[{onTrapFocusChange:0}]}]);function x(){"undefined"!=typeof customElements&&["co-overlay"].forEach((n=>{"co-overlay"===n&&(customElements.get(t(n))||customElements.define(t(n),g))}))}x();export{g as C,s as a,x as d}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { r as registerInstance, h, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
|
|
3
|
-
const coButtonCss = () => `:host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:var(--co-button-border-color, color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent))}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border-color, var(--co-button-border, var(--co-semantic-border-subtle)))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, var(--co-semantic-border-default))}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}.co-button>co-icon{margin-block:-1px}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}.co-button--soft{background:var(--co-semantic-surface-control);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--soft:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-control), var(--co-semantic-surface-hover))}.co-button--rounded.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-border-radius-xs)}:host([full-width]){display:block;width:100%}:host([full-width]) .co-button{width:100%}co-icon{color:var(--co-button-icon-color, inherit)}`;
|
|
3
|
+
const coButtonCss = () => `:host{display:inline-flex}:host([disabled]){pointer-events:none}.co-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:1px solid transparent;outline:none;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;-webkit-font-smoothing:antialiased;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-fast) var(--co-motion-ease-out);box-sizing:border-box;-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary);border-color:var(--co-button-border-color, color-mix(in srgb, var(--co-semantic-on-primary) 28%, transparent))}.co-button--secondary{background:color-mix(in srgb, var(--co-button-bg, var(--co-semantic-surface-secondary)) 55%, transparent);color:var(--co-button-color, var(--co-semantic-on-secondary));border-color:var(--co-button-border-color, var(--co-button-border, var(--co-semantic-border-subtle)))}.co-button--stroke{background:color-mix(in srgb, var(--co-semantic-surface-secondary) 25%, transparent);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, var(--co-semantic-border-default))}.co-button--ghost{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger{background:var(--co-semantic-status-error);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--success{background:var(--co-semantic-status-success);color:var(--co-color-base-blanco);border-color:var(--co-button-border-color, transparent)}.co-button--rounded.co-button--l{padding:var(--co-spacing-xl) var(--co-spacing-2xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--m{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-16);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--s{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-14);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--rounded.co-button--xs{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-12);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--l{padding:var(--co-spacing-lg) var(--co-spacing-xl);gap:var(--co-spacing-md);font-size:var(--co-font-size-18);border-radius:var(--co-border-radius-lg)}.co-button--square.co-button--m{padding:var(--co-spacing-md) var(--co-spacing-lg);gap:var(--co-spacing-sm2);font-size:var(--co-font-size-16);border-radius:var(--co-border-radius-sm)}.co-button--square.co-button--s{padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-14);border-radius:var(--co-border-radius-xs)}.co-button--square.co-button--xs{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:var(--co-spacing-xs);font-size:var(--co-font-size-12);border-radius:var(--co-spacing-sm)}.co-button--disabled,.co-button:disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}.co-button--primary:hover:not(:disabled){opacity:0.88}.co-button--secondary:hover:not(:disabled),.co-button--stroke:hover:not(:disabled){background:var(--co-semantic-surface-hover)}.co-button--ghost:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-hover) 60%, transparent);-webkit-backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)));backdrop-filter:var(--co-glass-filter, blur(var(--co-glass-blur)) saturate(var(--co-glass-saturate)))}.co-button--danger:hover:not(:disabled),.co-button--success:hover:not(:disabled){opacity:0.88}.co-button:active:not(:disabled){transform:scale(0.97);transition-duration:var(--co-motion-duration-instant)}.co-button--primary{transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), background var(--co-motion-duration-fast) var(--co-motion-ease-out), transform var(--co-motion-duration-slow) var(--co-motion-ease-spring)}.co-button--secondary.co-button--elevated{box-shadow:var(--co-shadow-sm, 0 1px 2px 0 rgba(26, 26, 26, 0.04)), inset 0 0 0 1px var(--co-color-opacity-negro-8)}.co-button:focus-visible{box-shadow:0 0 0 2px var(--co-semantic-surface-page), 0 0 0 4px var(--co-semantic-border-focus);outline:2px solid transparent;outline-offset:2px}.co-button--ghost.co-button--surface-dark,.co-button--stroke.co-button--surface-dark{color:var(--co-color-base-blanco, #fff)}.co-button--ghost.co-button--surface-dark:hover:not(:disabled),.co-button--stroke.co-button--surface-dark:hover:not(:disabled){background:var(--co-color-opacity-blanco-16);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--danger.co-button--surface-dark:hover:not(:disabled){opacity:1;background:color-mix(in srgb, var(--co-semantic-status-error) 84%, var(--co-color-base-blanco, #fff))}.co-button--danger.co-button--surface-dark:focus-visible{box-shadow:0 0 0 2px color-mix(in srgb, var(--co-color-base-blanco, #fff) 45%, transparent)}::slotted([slot="icon-left"]),::slotted([slot="icon-right"]){display:inline-flex;flex-shrink:0}.co-button>co-icon{margin-block:-1px}@supports not (background: color-mix(in srgb, red, transparent)){.co-button--primary{background:var(--co-semantic-surface-primary)}.co-button--secondary{background:var(--co-semantic-surface-secondary)}.co-button--stroke{background:transparent}}.co-button--soft{background:var(--co-semantic-surface-control);color:var(--co-semantic-text-default);border-color:var(--co-button-border-color, transparent);-webkit-backdrop-filter:none;backdrop-filter:none}.co-button--soft:hover:not(:disabled){background:color-mix(in srgb, var(--co-semantic-surface-control), var(--co-semantic-surface-hover))}.co-button--rounded.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-button-radius, var(--co-border-radius-full))}.co-button--square.co-button--sm{height:32px;padding:var(--co-spacing-sm2) var(--co-spacing-md);gap:var(--co-spacing-sm);font-size:var(--co-font-size-12);font-weight:500;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);border-radius:var(--co-border-radius-xs)}:host([full-width]){display:block;width:100%}:host([full-width]) .co-button{width:100%}co-icon{color:var(--co-button-icon-color, inherit)}`;
|
|
4
4
|
|
|
5
5
|
const ICON_SIZE = { l: 20, m: 18, s: 16, xs: 14, sm: 16 };
|
|
6
6
|
const CoButton = class {
|
|
@@ -3,7 +3,7 @@ import { h as highlightSegments } from './normalizeText-Ba_v-MzM.js';
|
|
|
3
3
|
import { i as initOverlayScroll } from './overlayScroll-Bpv882_z.js';
|
|
4
4
|
import './overlayscrollbars-ox7HzCZn.js';
|
|
5
5
|
|
|
6
|
-
const coChipCss = () => `:host{display:inline-flex;max-width:var(--co-chip-max-width, none)}.co-chip{display:inline-flex;align-items:center;justify-content:center;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;box-sizing:border-box;-webkit-font-smoothing:antialiased;max-width:100%;overflow:hidden;border:1px solid transparent;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);cursor:default;margin:0;padding:0}button.co-chip{cursor:pointer;outline:none}button.co-chip:focus-visible{box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.co-chip__value{color:var(--co-chip-value-color, var(--co-color-gray-500, #888888))}.co-chip--filled{background:var(--co-chip-bg, var(--co-semantic-surface-muted));color:var(--co-chip-color, var(--co-semantic-text-default));border-color:var(--co-chip-border, transparent)}.co-chip--filled.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-color-opacity-negro-8, rgba(0, 0, 0, 0.08))}.co-chip--filled.co-chip--clickable:active:not(.co-chip--disabled){opacity:0.85}.co-chip--filled.co-chip--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary)}.co-chip--filled.co-chip--primary.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-semantic-surface-primary);opacity:0.85}.co-chip--filled.co-chip--success{background:var(--co-semantic-status-success);color:#fff}.co-chip--filled.co-chip--error{background:var(--co-semantic-status-error);color:#fff}.co-chip--filled.co-chip--warning{background:var(--co-color-status-review);color:#fff}.co-chip--filled.co-chip--info{background:var(--co-semantic-status-info);color:#fff}.co-chip--filled.co-chip--pending{background:var(--co-color-status-pending);color:#fff}.co-chip--filled.co-chip--progress{background:var(--co-color-status-progress);color:#fff}.co-chip--filled.co-chip--review{background:var(--co-color-status-review);color:#fff}.co-chip--filled.co-chip--submitted{background:var(--co-color-status-submitted);color:#fff}.co-chip--outlined{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-semantic-border-default)}.co-chip--outlined.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-semantic-surface-hover)}.co-chip--outlined.co-chip--clickable:active:not(.co-chip--disabled){background:var(--co-semantic-surface-muted)}.co-chip--outlined.co-chip--primary{color:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary)}.co-chip--outlined.co-chip--success{color:var(--co-semantic-status-success);border-color:var(--co-semantic-status-success)}.co-chip--outlined.co-chip--error{color:var(--co-semantic-status-error);border-color:var(--co-semantic-status-error)}.co-chip--outlined.co-chip--warning{color:var(--co-color-status-review);border-color:var(--co-color-status-review)}.co-chip--outlined.co-chip--info{color:var(--co-semantic-status-info);border-color:var(--co-semantic-status-info)}.co-chip--filled.co-chip--selected{box-shadow:inset 0 0 0 1px rgba(255, 255, 255, 0.3)}.co-chip--outlined.co-chip--selected{background:var(--co-semantic-surface-muted);border-width:2px}.co-chip--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}button.co-chip--disabled{pointer-events:auto;}.co-chip--large{font-size:var(--co-font-size-12)}.co-chip--large.co-chip--icon-none{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:0}.co-chip--large.co-chip--icon-left{padding:var(--co-spacing-xs) var(--co-spacing-sm2) var(--co-spacing-xs) var(--co-spacing-sm);gap:var(--co-spacing-sm)}.co-chip--large.co-chip--icon-right{padding:var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-sm2);gap:var(--co-spacing-sm)}.co-chip--large.co-chip--icon-both{padding:var(--co-spacing-xs);gap:var(--co-spacing-sm)}.co-chip--small{font-size:var(--co-font-size-10)}.co-chip--small.co-chip--icon-none{padding:var(--co-spacing-xs) var(--co-spacing-sm);gap:0}.co-chip--small.co-chip--icon-left{padding:var(--co-spacing-xs) var(--co-spacing-sm) var(--co-spacing-xs) var(--co-spacing-xs);gap:var(--co-spacing-xs)}.co-chip--small.co-chip--icon-right{padding:var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-sm);gap:var(--co-spacing-xs)}.co-chip--small.co-chip--icon-both{padding:var(--co-spacing-xs);gap:var(--co-spacing-xs)}.co-chip--rounded{border-radius:var(--co-border-radius-full)}.co-chip--square{border-radius:var(--co-spacing-sm)}.co-chip__icon-left,.co-chip__icon-right,.co-chip__dot,.co-chip__trailing{display:inline-flex;flex-shrink:0;align-items:center}.co-chip__trailing{color:var(--co-chip-trailing-color, currentColor)}.co-chip--large .co-chip__icon-left,.co-chip--large .co-chip__icon-right,.co-chip--large .co-chip__dot{width:16px;height:16px}.co-chip--small .co-chip__icon-left,.co-chip--small .co-chip__icon-right,.co-chip--small .co-chip__dot{width:10px;height:10px}.co-chip__remove{display:inline-flex;flex-shrink:0;align-items:center;cursor:pointer;opacity:1;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);border:none;background:transparent;padding:0;color:inherit}.co-chip__remove:hover{opacity:0.7}.co-chip--large .co-chip__remove{width:16px;height:16px}.co-chip--small .co-chip__remove{width:10px;height:10px}::slotted(*){display:inline-flex;width:100%;height:100%}.co-chip.co-chip--filter{height:34px;padding:0 12px;gap:7px;font-size:13.5px;border-radius:var(--co-border-radius-full);background:var(--co-
|
|
6
|
+
const coChipCss = () => `:host{display:inline-flex;max-width:var(--co-chip-max-width, none)}.co-chip{display:inline-flex;align-items:center;justify-content:center;font-family:var(--co-font-family-primary);font-weight:400;line-height:1;letter-spacing:var(--co-font-letter-spacing-body);white-space:nowrap;box-sizing:border-box;-webkit-font-smoothing:antialiased;max-width:100%;overflow:hidden;border:1px solid transparent;transition:background var(--co-motion-duration-fast) var(--co-motion-ease-out), border-color var(--co-motion-duration-fast) var(--co-motion-ease-out), opacity var(--co-motion-duration-fast) var(--co-motion-ease-out), box-shadow var(--co-motion-duration-fast) var(--co-motion-ease-out);cursor:default;margin:0;padding:0}button.co-chip{cursor:pointer;outline:none}button.co-chip:focus-visible{box-shadow:0 0 0 2px var(--co-semantic-border-focus-ring)}.co-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.co-chip__value{color:var(--co-chip-value-color, var(--co-color-gray-500, #888888))}.co-chip--filled{background:var(--co-chip-bg, var(--co-semantic-surface-muted));color:var(--co-chip-color, var(--co-semantic-text-default));border-color:var(--co-chip-border, transparent)}.co-chip--filled.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-color-opacity-negro-8, rgba(0, 0, 0, 0.08))}.co-chip--filled.co-chip--clickable:active:not(.co-chip--disabled){opacity:0.85}.co-chip--filled.co-chip--primary{background:var(--co-semantic-surface-primary);color:var(--co-semantic-on-primary)}.co-chip--filled.co-chip--primary.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-semantic-surface-primary);opacity:0.85}.co-chip--filled.co-chip--success{background:var(--co-semantic-status-success);color:#fff}.co-chip--filled.co-chip--error{background:var(--co-semantic-status-error);color:#fff}.co-chip--filled.co-chip--warning{background:var(--co-color-status-review);color:#fff}.co-chip--filled.co-chip--info{background:var(--co-semantic-status-info);color:#fff}.co-chip--filled.co-chip--pending{background:var(--co-color-status-pending);color:#fff}.co-chip--filled.co-chip--progress{background:var(--co-color-status-progress);color:#fff}.co-chip--filled.co-chip--review{background:var(--co-color-status-review);color:#fff}.co-chip--filled.co-chip--submitted{background:var(--co-color-status-submitted);color:#fff}.co-chip--outlined{background:transparent;color:var(--co-semantic-text-default);border-color:var(--co-semantic-border-default)}.co-chip--outlined.co-chip--clickable:hover:not(.co-chip--disabled){background:var(--co-semantic-surface-hover)}.co-chip--outlined.co-chip--clickable:active:not(.co-chip--disabled){background:var(--co-semantic-surface-muted)}.co-chip--outlined.co-chip--primary{color:var(--co-semantic-surface-primary);border-color:var(--co-semantic-surface-primary)}.co-chip--outlined.co-chip--success{color:var(--co-semantic-status-success);border-color:var(--co-semantic-status-success)}.co-chip--outlined.co-chip--error{color:var(--co-semantic-status-error);border-color:var(--co-semantic-status-error)}.co-chip--outlined.co-chip--warning{color:var(--co-color-status-review);border-color:var(--co-color-status-review)}.co-chip--outlined.co-chip--info{color:var(--co-semantic-status-info);border-color:var(--co-semantic-status-info)}.co-chip--filled.co-chip--selected{box-shadow:inset 0 0 0 1px rgba(255, 255, 255, 0.3)}.co-chip--outlined.co-chip--selected{background:var(--co-semantic-surface-muted);border-width:2px}.co-chip--disabled{opacity:0.4;cursor:not-allowed;pointer-events:none}button.co-chip--disabled{pointer-events:auto;}.co-chip--large{font-size:var(--co-font-size-12)}.co-chip--large.co-chip--icon-none{padding:var(--co-spacing-sm) var(--co-spacing-sm2);gap:0}.co-chip--large.co-chip--icon-left{padding:var(--co-spacing-xs) var(--co-spacing-sm2) var(--co-spacing-xs) var(--co-spacing-sm);gap:var(--co-spacing-sm)}.co-chip--large.co-chip--icon-right{padding:var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-sm2);gap:var(--co-spacing-sm)}.co-chip--large.co-chip--icon-both{padding:var(--co-spacing-xs);gap:var(--co-spacing-sm)}.co-chip--small{font-size:var(--co-font-size-10)}.co-chip--small.co-chip--icon-none{padding:var(--co-spacing-xs) var(--co-spacing-sm);gap:0}.co-chip--small.co-chip--icon-left{padding:var(--co-spacing-xs) var(--co-spacing-sm) var(--co-spacing-xs) var(--co-spacing-xs);gap:var(--co-spacing-xs)}.co-chip--small.co-chip--icon-right{padding:var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-xs) var(--co-spacing-sm);gap:var(--co-spacing-xs)}.co-chip--small.co-chip--icon-both{padding:var(--co-spacing-xs);gap:var(--co-spacing-xs)}.co-chip--rounded{border-radius:var(--co-border-radius-full)}.co-chip--square{border-radius:var(--co-spacing-sm)}.co-chip__icon-left,.co-chip__icon-right,.co-chip__dot,.co-chip__trailing{display:inline-flex;flex-shrink:0;align-items:center}.co-chip__trailing{color:var(--co-chip-trailing-color, currentColor)}.co-chip--large .co-chip__icon-left,.co-chip--large .co-chip__icon-right,.co-chip--large .co-chip__dot{width:16px;height:16px}.co-chip--small .co-chip__icon-left,.co-chip--small .co-chip__icon-right,.co-chip--small .co-chip__dot{width:10px;height:10px}.co-chip__remove{display:inline-flex;flex-shrink:0;align-items:center;cursor:pointer;opacity:1;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-out);border:none;background:transparent;padding:0;color:inherit}.co-chip__remove:hover{opacity:0.7}.co-chip--large .co-chip__remove{width:16px;height:16px}.co-chip--small .co-chip__remove{width:10px;height:10px}::slotted(*){display:inline-flex;width:100%;height:100%}.co-chip.co-chip--filter{height:34px;padding:0 12px;gap:7px;font-size:13.5px;border-radius:var(--co-border-radius-full);background:var(--co-semantic-surface-page, #fff);color:var(--co-semantic-text-default, #1f1c1b);border-color:transparent;box-shadow:inset 0 0 0 1px var(--co-semantic-border-default, rgba(0, 0, 0, 0.16))}.co-chip--filter .co-chip__icon-left{color:var(--co-semantic-text-muted, #888888)}.co-chip--filter .co-chip__trailing{color:var(--co-color-gray-400, #a0a0a0)}.co-chip--filter.co-chip--clickable:hover:not(.co-chip--disabled){box-shadow:inset 0 0 0 1px var(--co-semantic-border-field, rgba(0, 0, 0, 0.25))}.co-chip--filter.co-chip--clickable:active:not(.co-chip--disabled){background:var(--co-semantic-surface-disabled, #f6f6f6)}.co-chip--filter.co-chip--selected{background:var(--co-semantic-surface-disabled, #f6f6f6)}`;
|
|
7
7
|
|
|
8
8
|
const CoChip = class {
|
|
9
9
|
constructor(hostRef) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { r as registerInstance, c as createEvent, f as forceUpdate, h, H as Host, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
import { g as getRichTextStrings } from './richTextI18n-xnrKkNWQ.js';
|
|
3
3
|
import { b as parseFeatures, s as syncToolbarEditor } from './rich-text-host-BmdKHBZP.js';
|
|
4
|
-
import { B as getImageLayoutMode, F as FIELD_SYNC_META, E as headerImageWidth, w as writePrintHtml, r as readPrintHtml, Q as resolvePageSize, s as sanitize, q as Pagination, x as collectFields, z as createEditor, W as setFieldValuesInHtml, I as IMAGE_LAYOUT_MODES, P as PAGE_GAP_PX, G as layoutBox } from './pagination-
|
|
4
|
+
import { B as getImageLayoutMode, F as FIELD_SYNC_META, E as headerImageWidth, w as writePrintHtml, r as readPrintHtml, Q as resolvePageSize, s as sanitize, q as Pagination, x as collectFields, z as createEditor, W as setFieldValuesInHtml, I as IMAGE_LAYOUT_MODES, P as PAGE_GAP_PX, G as layoutBox } from './pagination-BzrIQtrk.js';
|
|
5
5
|
import './purify.es-B2QLgWrz.js';
|
|
6
6
|
|
|
7
7
|
/** Ventana de `coChange`: avisa como mucho cada 250 ms (nunca por tecla). */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, c as createEvent, h } from './index-DJkaRtbb.js';
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, a as getElement } from './index-DJkaRtbb.js';
|
|
2
2
|
import { a as afterEventFor } from './overlayAfterClose-Ch1jfwZ2.js';
|
|
3
3
|
import { s as slotHasContent } from './slotContent-CBX_oabB.js';
|
|
4
4
|
|
|
@@ -192,6 +192,19 @@ const CoModal = class {
|
|
|
192
192
|
* mismo nombre taparía `HTMLElement.draggable` con dos semánticas encimadas.
|
|
193
193
|
*/
|
|
194
194
|
this.movable = false;
|
|
195
|
+
/**
|
|
196
|
+
* Opt-in: trampa de foco accesible (QA 2026-09-24, «Generar contrato»). Con
|
|
197
|
+
* `true`, al abrir el foco ENTRA al modal (el primer `[autofocus]`; si no
|
|
198
|
+
* hay, el primer control), Tab / Shift+Tab ciclan adentro y al cerrar vuelve
|
|
199
|
+
* a donde estaba. El recorrido es compuesto: ve el contenido proyectado por
|
|
200
|
+
* los slots y el `<button>` interno de cada co-button. Default false → los
|
|
201
|
+
* consumidores actuales no cambian.
|
|
202
|
+
*
|
|
203
|
+
* La trampa es de `<co-overlay>`, así que sin overlay (`inline` o
|
|
204
|
+
* `backdrop="none"`) NO aplica: esos modos son paneles no bloqueantes y la
|
|
205
|
+
* página de atrás sigue operable.
|
|
206
|
+
*/
|
|
207
|
+
this.trapFocus = false;
|
|
195
208
|
/* `:empty` can't see across a <slot>, so slotted presence is tracked in JS */
|
|
196
209
|
this.hasFooter = false;
|
|
197
210
|
this.handleFooterSlotChange = (e) => {
|
|
@@ -307,6 +320,18 @@ const CoModal = class {
|
|
|
307
320
|
if (e.key === 'Escape')
|
|
308
321
|
this.coClose.emit();
|
|
309
322
|
}
|
|
323
|
+
/**
|
|
324
|
+
* Re-promueve el modal al TOPE del top layer (QA 2026-09-24, «Generar
|
|
325
|
+
* contrato»): un drawer que se abre DESPUÉS del modal (cambio de URL,
|
|
326
|
+
* historial) pinta encima, porque en el top layer gana el último promovido.
|
|
327
|
+
* Delega en su `<co-overlay>`: sin cerrar el modal, sin eventos (`coClose` /
|
|
328
|
+
* `coAfterClose` / `coAfterOpen`), sin soltar el scroll lock y sin re-animar
|
|
329
|
+
* la entrada. No-op sin overlay (`inline`, `backdrop="none"`) o cerrado.
|
|
330
|
+
*/
|
|
331
|
+
async bringToFront() {
|
|
332
|
+
var _a, _b, _c;
|
|
333
|
+
await ((_c = (_b = (_a = this.el.shadowRoot) === null || _a === void 0 ? void 0 : _a.querySelector('co-overlay')) === null || _b === void 0 ? void 0 : _b.bringToFront) === null || _c === void 0 ? void 0 : _c.call(_b));
|
|
334
|
+
}
|
|
310
335
|
/**
|
|
311
336
|
* La posición no se persiste: cada APERTURA arranca desde la posición por
|
|
312
337
|
* defecto. El reset va al abrir y no al cerrar a propósito — reseteando al
|
|
@@ -422,8 +447,9 @@ const CoModal = class {
|
|
|
422
447
|
}, part: "header", ref: (el) => (this.headerEl = el), onPointerDown: this.movable ? this.handleDragDown : undefined, onPointerMove: this.movable ? this.handleDragMove : undefined, onPointerUp: this.movable ? this.handleDragUp : undefined, onPointerCancel: this.movable ? this.handleDragCancel : undefined }, h("slot", { name: "header-leading" }), h("div", { class: "co-modal__header-text", part: "header-text" }, h("h2", { class: "co-modal__heading", part: "heading", id: "modal-heading" }, this.heading), this.description && (h("p", { class: "co-modal__description", part: "description" }, this.description))), h("slot", { name: "header-actions" }), this.closable && (h("button", { class: "co-modal__close", type: "button", "aria-label": "Close", onClick: this.handleCloseClick }, h("co-icon", { name: "x", size: closeIconSize })))), !this.noDividers && (h("div", { class: "co-modal__body", part: "body" }, h("slot", null))), h("div", { class: { 'co-modal__footer': true, 'co-modal__footer--empty': !this.hasFooter }, part: "footer" }, h("slot", { name: "footer", onSlotchange: this.handleFooterSlotChange })))));
|
|
423
448
|
if (!this.usesOverlay)
|
|
424
449
|
return frame;
|
|
425
|
-
return (h("co-overlay", { open: this.open, onCoClose: this.handleOverlayClick }, frame));
|
|
450
|
+
return (h("co-overlay", { open: this.open, trapFocus: this.trapFocus, onCoClose: this.handleOverlayClick }, frame));
|
|
426
451
|
}
|
|
452
|
+
get el() { return getElement(this); }
|
|
427
453
|
static get watchers() { return {
|
|
428
454
|
"open": [{
|
|
429
455
|
"resetPositionOnOpen": 0
|
|
@@ -55,20 +55,112 @@ function resolveTabIndex(count, activeIndex, shiftKey) {
|
|
|
55
55
|
// Forward: from the last element (or from outside) wrap to the first.
|
|
56
56
|
return activeIndex === -1 || activeIndex >= count - 1 ? 0 : activeIndex + 1;
|
|
57
57
|
}
|
|
58
|
+
// ── Recorrido compuesto (QA 2026-09-24, «Generar contrato» de contratos V2) ──
|
|
59
|
+
// El foco nunca entraba ni quedaba atrapado en un co-modal: `getFocusableElements`
|
|
60
|
+
// solo mira el light DOM de co-overlay (el frame del modal: el ✕). El contenido
|
|
61
|
+
// del consumidor llega por DOS <slot> (el de co-overlay y el del frame) y los
|
|
62
|
+
// controles reales viven en el shadow de cada co-* (el <button> de co-button, el
|
|
63
|
+
// <input> de co-input). El recorrido sigue el árbol PLANO: baja por shadowRoots
|
|
64
|
+
// y, en cada <slot>, por sus asignados — o por su contenido por defecto si no
|
|
65
|
+
// tiene. Todo esto corre solo en el navegador (abrir la trampa / cada Tab).
|
|
66
|
+
/** Hijos en el árbol plano: el shadow del host, los asignados de un slot o los hijos. */
|
|
67
|
+
function composedChildren(el) {
|
|
68
|
+
if (el.shadowRoot)
|
|
69
|
+
return Array.from(el.shadowRoot.children);
|
|
70
|
+
if (el.tagName === 'SLOT') {
|
|
71
|
+
const assigned = el.assignedElements({ flatten: true });
|
|
72
|
+
return assigned.length ? assigned : Array.from(el.children);
|
|
73
|
+
}
|
|
74
|
+
return Array.from(el.children);
|
|
75
|
+
}
|
|
76
|
+
/** Subárbol fuera de la trampa entero: oculto a AT o inerte. */
|
|
77
|
+
function isExcludedSubtree(el) {
|
|
78
|
+
return el.getAttribute('aria-hidden') === 'true' || el.hasAttribute('inert');
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Parada de Tab: matchea el selector, no está deshabilitado, no se sacó del
|
|
82
|
+
* orden con tabindex negativo (los botones internos de un trigger co-* —clear,
|
|
83
|
+
* chips— van con `tabIndex={-1}`, y `button:not([disabled])` los matchearía
|
|
84
|
+
* igual), tiene caja (offsetParent null = display:none; getClientRects cubre
|
|
85
|
+
* position:fixed) y no es `visibility:hidden`: un acordeón o fieldset colapsado
|
|
86
|
+
* conserva la caja pero el navegador no le da el foco, y la trampa lo elegiría
|
|
87
|
+
* igual → Tab clavado (WCAG 2.1.2). Sin la API (navegador viejo, jsdom) no filtra.
|
|
88
|
+
*/
|
|
89
|
+
function isTabStop(el) {
|
|
90
|
+
var _a, _b;
|
|
91
|
+
if (!((_a = el.matches) === null || _a === void 0 ? void 0 : _a.call(el, FOCUSABLE_SELECTOR)) || el.hasAttribute('disabled'))
|
|
92
|
+
return false;
|
|
93
|
+
const tabindex = el.getAttribute('tabindex');
|
|
94
|
+
if (tabindex !== null && Number(tabindex) < 0)
|
|
95
|
+
return false;
|
|
96
|
+
if (el.offsetParent === null && el.getClientRects().length === 0)
|
|
97
|
+
return false;
|
|
98
|
+
return ((_b = el.checkVisibility) === null || _b === void 0 ? void 0 : _b.call(el, { visibilityProperty: true })) !== false;
|
|
99
|
+
}
|
|
58
100
|
/**
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
* out of scope — the common dialog/modal content lives in the slotted subtree.)
|
|
101
|
+
* Recorre en orden del árbol plano los descendientes compuestos de `root` (sin
|
|
102
|
+
* incluirlo) hasta que `visit` devuelve true. Poda aria-hidden / inert.
|
|
62
103
|
*/
|
|
63
|
-
function
|
|
64
|
-
const
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
104
|
+
function walkComposed(root, visit) {
|
|
105
|
+
const step = (node) => {
|
|
106
|
+
if (isExcludedSubtree(node))
|
|
107
|
+
return false;
|
|
108
|
+
if (visit(node))
|
|
109
|
+
return true;
|
|
110
|
+
return composedChildren(node).some(step);
|
|
111
|
+
};
|
|
112
|
+
composedChildren(root).some(step);
|
|
113
|
+
}
|
|
114
|
+
/** Primer descendiente compuesto que cumple `match`, en orden del árbol plano. */
|
|
115
|
+
function findComposed(root, match) {
|
|
116
|
+
let found = null;
|
|
117
|
+
walkComposed(root, (el) => {
|
|
118
|
+
if (!match(el))
|
|
119
|
+
return false;
|
|
120
|
+
found = el;
|
|
121
|
+
return true;
|
|
122
|
+
});
|
|
123
|
+
return found;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* Paradas de Tab dentro de `root` en el árbol COMPUESTO (shadowRoots + slots
|
|
127
|
+
* asignados), con las mismas exclusiones que `getFocusableElements`.
|
|
128
|
+
*/
|
|
129
|
+
function getComposedFocusables(root) {
|
|
130
|
+
const out = [];
|
|
131
|
+
walkComposed(root, (el) => {
|
|
132
|
+
if (isTabStop(el))
|
|
133
|
+
out.push(el);
|
|
134
|
+
return false;
|
|
135
|
+
});
|
|
136
|
+
return out;
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Dónde cae el foco al abrir la trampa: el primer `[autofocus]` del recorrido
|
|
140
|
+
* compuesto —si es un host con shadow (`<co-input autofocus>`), su primer
|
|
141
|
+
* enfocable compuesto—; si no hay, la primera parada de Tab. `null` = nada
|
|
142
|
+
* enfocable (el llamador cae al contenedor).
|
|
143
|
+
*/
|
|
144
|
+
function resolveInitialFocus(root) {
|
|
145
|
+
const autofocus = findComposed(root, (el) => el.hasAttribute('autofocus'));
|
|
146
|
+
if (autofocus) {
|
|
147
|
+
if (isTabStop(autofocus))
|
|
148
|
+
return autofocus;
|
|
149
|
+
const inner = autofocus.shadowRoot ? getComposedFocusables(autofocus)[0] : undefined;
|
|
150
|
+
if (inner)
|
|
151
|
+
return inner;
|
|
152
|
+
}
|
|
153
|
+
return findComposed(root, isTabStop);
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Con dos trampas abiertas (un confirm sobre un modal, un modal anidado) las dos
|
|
157
|
+
* escuchan el keydown de document: solo la capa MÁS RECIENTE maneja Tab.
|
|
158
|
+
*/
|
|
159
|
+
function isTopTrap(stack, id) {
|
|
160
|
+
return stack.length > 0 && stack[stack.length - 1] === id;
|
|
69
161
|
}
|
|
70
162
|
|
|
71
|
-
const coOverlayCss = () => `:host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}`;
|
|
163
|
+
const coOverlayCss = () => `:host{display:contents}.co-overlay{position:fixed;inset:0;z-index:1000;margin:0;border:0;padding:0;width:auto;height:auto;max-width:none;max-height:none;overflow:visible;display:flex;align-items:center;justify-content:center;background:var(--co-overlay-bg, rgba(0, 0, 0, 0.4));-webkit-backdrop-filter:blur(var(--co-overlay-blur, 2px));backdrop-filter:blur(var(--co-overlay-blur, 2px));opacity:0;pointer-events:none;transition:opacity var(--co-motion-duration-fast) var(--co-motion-ease-in)}.co-overlay--open{opacity:1;pointer-events:auto;transition:opacity var(--co-motion-duration-base) var(--co-motion-ease-out)}.co-overlay--refront{transition:none !important}`;
|
|
72
164
|
|
|
73
165
|
/**
|
|
74
166
|
* Module-level body-scroll lock shared by every overlay instance.
|
|
@@ -96,6 +188,16 @@ function unlockBodyScroll() {
|
|
|
96
188
|
document.body.style.overflow = savedOverflow;
|
|
97
189
|
}
|
|
98
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* Pila de trampas de foco ABIERTAS, compartida por todas las instancias (como el
|
|
193
|
+
* scroll lock). Todas escuchan el keydown de document: con un confirm encima de
|
|
194
|
+
* un modal, las dos movían el foco en el mismo Tab. Solo la capa más reciente
|
|
195
|
+
* (`isTopTrap`) maneja Tab y el foco inicial.
|
|
196
|
+
*/
|
|
197
|
+
const trapStack = [];
|
|
198
|
+
let trapSeq = 0;
|
|
199
|
+
/** Clase del div mientras dura el re-apilado de `bringToFront()` (ver co-overlay.css). */
|
|
200
|
+
const REFRONT_CLASS = 'co-overlay--refront';
|
|
99
201
|
function nextFrame(cb) {
|
|
100
202
|
if (typeof requestAnimationFrame === 'function')
|
|
101
203
|
requestAnimationFrame(cb);
|
|
@@ -115,6 +217,11 @@ const CoOverlay = class {
|
|
|
115
217
|
* previously-focused element, moves focus into the overlay, cycles Tab /
|
|
116
218
|
* Shift+Tab within the slotted content, and restores focus on close.
|
|
117
219
|
* Default false → existing consumers are unchanged.
|
|
220
|
+
*
|
|
221
|
+
* The walk is COMPOSED (shadow roots + assigned slots): it reaches the
|
|
222
|
+
* consumer's content projected through a host's slots and the inner control
|
|
223
|
+
* of every co-* (a co-button's `<button>`). With several traps open, only the
|
|
224
|
+
* most recent one handles Tab.
|
|
118
225
|
*/
|
|
119
226
|
this.trapFocus = false;
|
|
120
227
|
/**
|
|
@@ -124,6 +231,10 @@ const CoOverlay = class {
|
|
|
124
231
|
this.closeOnEscape = false;
|
|
125
232
|
/** Whether THIS instance currently holds a scroll lock (prevents double-count). */
|
|
126
233
|
this.hasLock = false;
|
|
234
|
+
/** Identidad de esta instancia en `trapStack`. */
|
|
235
|
+
this.trapId = `co-overlay-trap-${++trapSeq}`;
|
|
236
|
+
/** Whether THIS instance is currently in `trapStack` (prevents double push). */
|
|
237
|
+
this.trapping = false;
|
|
127
238
|
// Origen de la pulsación en curso (ver isBackdropDismiss): un drag que
|
|
128
239
|
// empieza dentro del contenido y suelta en el fondo NO es un cierre —el
|
|
129
240
|
// navegador despacha ese `click` al ancestro común, el propio scrim—, ni
|
|
@@ -165,27 +276,55 @@ const CoOverlay = class {
|
|
|
165
276
|
else
|
|
166
277
|
this.releaseLock();
|
|
167
278
|
this.syncPopover();
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
this.restoreFocus();
|
|
173
|
-
}
|
|
279
|
+
this.syncTrap();
|
|
280
|
+
}
|
|
281
|
+
onTrapFocusChange() {
|
|
282
|
+
this.syncTrap();
|
|
174
283
|
}
|
|
175
284
|
componentDidLoad() {
|
|
176
285
|
// Handle the case where the overlay mounts already open.
|
|
177
286
|
if (this.open)
|
|
178
287
|
this.acquireLock();
|
|
179
288
|
this.syncPopover();
|
|
180
|
-
|
|
181
|
-
this.captureAndFocus();
|
|
289
|
+
this.syncTrap();
|
|
182
290
|
}
|
|
183
291
|
disconnectedCallback() {
|
|
184
292
|
// Safety: never leave the body locked if removed while open.
|
|
185
293
|
this.releaseLock();
|
|
186
|
-
// Safety: return focus if
|
|
187
|
-
|
|
188
|
-
|
|
294
|
+
// Safety: leave the trap stack and return focus if removed while trapping.
|
|
295
|
+
this.releaseTrap();
|
|
296
|
+
}
|
|
297
|
+
/**
|
|
298
|
+
* Re-promueve el scrim al TOPE del top layer (QA 2026-09-24, «Generar
|
|
299
|
+
* contrato»): un drawer abierto DESPUÉS de un modal pintaba encima, porque en
|
|
300
|
+
* el top layer gana el último promovido y no hay z-index que lo corrija.
|
|
301
|
+
* `hidePopover()` + `showPopover()` lo vuelven a meter último.
|
|
302
|
+
*
|
|
303
|
+
* No es un cierre: no emite `coClose` / `coAfterClose` / `coAfterOpen`, no
|
|
304
|
+
* toca `open` ni el scroll lock, y no re-anima la entrada (la clase
|
|
305
|
+
* `co-overlay--refront` anula la transición durante el re-show y se retira en
|
|
306
|
+
* el frame siguiente). Tampoco mueve el foco: si el re-show dispara los
|
|
307
|
+
* «popover focusing steps» (un `[autofocus]` adentro), se devuelve a donde
|
|
308
|
+
* estaba. No-op cerrado, sin Popover API o fuera del top layer.
|
|
309
|
+
*/
|
|
310
|
+
async bringToFront() {
|
|
311
|
+
const el = this.overlayEl;
|
|
312
|
+
if (!this.open || !el || typeof el.showPopover !== 'function')
|
|
313
|
+
return;
|
|
314
|
+
if (!el.matches(':popover-open'))
|
|
315
|
+
return;
|
|
316
|
+
const active = this.deepActiveElement();
|
|
317
|
+
el.classList.add(REFRONT_CLASS);
|
|
318
|
+
try {
|
|
319
|
+
el.hidePopover();
|
|
320
|
+
el.showPopover();
|
|
321
|
+
}
|
|
322
|
+
catch (_a) {
|
|
323
|
+
/* desconectado entre medio: no hay nada que re-apilar */
|
|
324
|
+
}
|
|
325
|
+
if (active && active.isConnected && this.deepActiveElement() !== active)
|
|
326
|
+
active.focus({ preventScroll: true });
|
|
327
|
+
nextFrame(() => el.classList.remove(REFRONT_CLASS));
|
|
189
328
|
}
|
|
190
329
|
acquireLock() {
|
|
191
330
|
if (this.hasLock)
|
|
@@ -223,19 +362,43 @@ const CoOverlay = class {
|
|
|
223
362
|
/* not connected yet, or already in the desired state */
|
|
224
363
|
}
|
|
225
364
|
}
|
|
226
|
-
/**
|
|
365
|
+
/** La trampa está activa exactamente mientras el overlay está abierto con `trapFocus`. */
|
|
366
|
+
syncTrap() {
|
|
367
|
+
if (this.open && this.trapFocus)
|
|
368
|
+
this.engageTrap();
|
|
369
|
+
else
|
|
370
|
+
this.releaseTrap();
|
|
371
|
+
}
|
|
372
|
+
engageTrap() {
|
|
373
|
+
if (this.trapping)
|
|
374
|
+
return;
|
|
375
|
+
this.trapping = true;
|
|
376
|
+
trapStack.push(this.trapId);
|
|
377
|
+
this.captureAndFocus();
|
|
378
|
+
}
|
|
379
|
+
releaseTrap() {
|
|
380
|
+
if (!this.trapping)
|
|
381
|
+
return;
|
|
382
|
+
this.trapping = false;
|
|
383
|
+
const i = trapStack.indexOf(this.trapId);
|
|
384
|
+
if (i >= 0)
|
|
385
|
+
trapStack.splice(i, 1);
|
|
386
|
+
this.restoreFocus();
|
|
387
|
+
}
|
|
388
|
+
/** Record the current focus and move it into the overlay (only while trapping). */
|
|
227
389
|
captureAndFocus() {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
390
|
+
// El activo PROFUNDO: `document.activeElement` se queda en el host de un
|
|
391
|
+
// co-* (co-button), cuyo focus() no llega al <button> interno.
|
|
392
|
+
this.returnFocusEl = this.deepActiveElement();
|
|
231
393
|
// Defer so slotted content / the open transition is ready to take focus.
|
|
232
394
|
nextFrame(() => {
|
|
233
395
|
var _a;
|
|
234
|
-
|
|
396
|
+
// Una trampa abierta en el mismo frame por ENCIMA (confirm) se queda el foco.
|
|
397
|
+
if (!this.open || !this.trapping || !isTopTrap(trapStack, this.trapId))
|
|
235
398
|
return;
|
|
236
|
-
const
|
|
237
|
-
if (
|
|
238
|
-
|
|
399
|
+
const target = resolveInitialFocus(this.el);
|
|
400
|
+
if (target)
|
|
401
|
+
target.focus();
|
|
239
402
|
else
|
|
240
403
|
(_a = this.overlayEl) === null || _a === void 0 ? void 0 : _a.focus();
|
|
241
404
|
});
|
|
@@ -244,8 +407,9 @@ const CoOverlay = class {
|
|
|
244
407
|
restoreFocus() {
|
|
245
408
|
const target = this.returnFocusEl;
|
|
246
409
|
this.returnFocusEl = null;
|
|
247
|
-
|
|
248
|
-
|
|
410
|
+
// Desmontado mientras el overlay estaba abierto (el paso de un wizard): no hay adónde volver.
|
|
411
|
+
if (target && target.isConnected && typeof target.focus === 'function')
|
|
412
|
+
target.focus({ preventScroll: true });
|
|
249
413
|
}
|
|
250
414
|
/** Deepest active element, descending through nested shadow roots. */
|
|
251
415
|
deepActiveElement() {
|
|
@@ -264,12 +428,16 @@ const CoOverlay = class {
|
|
|
264
428
|
this.coClose.emit();
|
|
265
429
|
return;
|
|
266
430
|
}
|
|
267
|
-
if (this.
|
|
431
|
+
if (this.trapping && e.key === 'Tab' && isTopTrap(trapStack, this.trapId))
|
|
268
432
|
this.trapTab(e);
|
|
269
433
|
}
|
|
270
434
|
trapTab(e) {
|
|
271
435
|
var _a;
|
|
272
|
-
|
|
436
|
+
// Tab ya manejado por un control de adentro (co-tags-field agrega el tag, las listas de co-rich-text y
|
|
437
|
+
// CodeMirror indentan): el listener de document corre DESPUÉS y no le roba el foco.
|
|
438
|
+
if (e.defaultPrevented)
|
|
439
|
+
return;
|
|
440
|
+
const focusables = getComposedFocusables(this.el);
|
|
273
441
|
if (focusables.length === 0) {
|
|
274
442
|
// Nothing to move to — keep focus pinned to the overlay container.
|
|
275
443
|
e.preventDefault();
|
|
@@ -284,12 +452,15 @@ const CoOverlay = class {
|
|
|
284
452
|
focusables[nextIndex].focus();
|
|
285
453
|
}
|
|
286
454
|
render() {
|
|
287
|
-
return (h("div", { key: '
|
|
455
|
+
return (h("div", { key: 'e18d7b0e3ebd4933a78a9f2d39af6058ce429105', class: { 'co-overlay': true, 'co-overlay--open': this.open }, part: "overlay", popover: "manual", tabindex: this.trapFocus ? -1 : undefined, ref: (el) => (this.overlayEl = el), onPointerDown: this.handlePointerDown, onPointerUp: this.handlePointerUp, onClick: this.handleClick, onTransitionEnd: this.handleTransitionEnd }, h("slot", { key: '2f29233d44de8a0cc3100cfa08233cdc10ebf352' })));
|
|
288
456
|
}
|
|
289
457
|
get el() { return getElement(this); }
|
|
290
458
|
static get watchers() { return {
|
|
291
459
|
"open": [{
|
|
292
460
|
"onOpenChange": 0
|
|
461
|
+
}],
|
|
462
|
+
"trapFocus": [{
|
|
463
|
+
"onTrapFocusChange": 0
|
|
293
464
|
}]
|
|
294
465
|
}; }
|
|
295
466
|
};
|