@mlightcad/ribbon 0.0.3 → 0.0.4
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/README.md +1 -1
- package/dist/ml-ribbon.css +1 -1
- package/dist/ml-ribbon.es.js +128 -128
- package/dist/ml-ribbon.umd.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ A Vue 3 + TypeScript Ribbon UI component library aligned with Syncfusion Ribbon
|
|
|
21
21
|
- Internationalization-ready UI text model via `MlRibbon` `texts` prop (no built-in hard-coded visible strings in Ribbon components)
|
|
22
22
|
- Icon-only command rendering via `RibbonItemModel.hideLabel`
|
|
23
23
|
- Group footer command popover via `RibbonGroupModel.footerMenuItems`
|
|
24
|
-
- Dropdown command memory: selected option updates trigger icon
|
|
24
|
+
- Dropdown command memory: selected option updates trigger icon, icon click executes current option command, label/arrow opens menu; set `props.syncLabelWithSelection = true` to also update label
|
|
25
25
|
- Customizable tab-right extension area via `MlRibbon` `#tabs-extra` slot
|
|
26
26
|
|
|
27
27
|
## Naming Conventions
|
package/dist/ml-ribbon.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
:root{--ml-rb-border:var(--el-border-color);--ml-rb-border-strong:var(--el-border-color-dark);--ml-rb-bg:var(--el-fill-color-light);--ml-rb-panel-bg:var(--el-fill-color-lighter);--ml-rb-tab-text:var(--el-text-color-primary);--ml-rb-muted:var(--el-text-color-secondary);--ml-rb-active:var(--el-color-primary);--ml-rb-header-start:var(--el-bg-color);--ml-rb-header-end:var(--el-fill-color-light);--ml-rb-hover-bg:var(--el-fill-color);--ml-rb-hover-border:var(--el-border-color);--ml-rb-active-bg:var(--el-fill-color-dark);--ml-rb-active-border:var(--el-border-color-darker);--ml-rb-surface:var(--el-bg-color);--ml-rb-surface-soft:var(--el-fill-color-blank);--ml-rb-keytip-border:#e7a957;--ml-rb-keytip-bg:#fff7eb;--ml-rb-keytip-inline-bg:#1b212a;--ml-rb-keytip-inline-fg:#ffdc85;--ml-rb-keytip-inline-shadow:oklab(0% none none/.2);--ml-rb-split-icon-hover-bg:color-mix(in oklab, var(--el-color-primary) 14%, transparent);--ml-rb-split-icon-hover-fg:var(--el-color-primary);--ml-rb-split-label-hover-bg:oklab(57.259% -.0282497 -.196933/.16);--ml-rb-split-label-hover-fg:#1f4fbf}html.dark{--ml-rb-keytip-border:#cf9448;--ml-rb-keytip-bg:#2b2420;--ml-rb-keytip-inline-bg:#f4f6fb;--ml-rb-keytip-inline-fg:#1d2530;--ml-rb-keytip-inline-shadow:oklab(0% none none/.35);--ml-rb-split-icon-hover-bg:color-mix(in oklab, var(--el-color-primary) 24%, transparent);--ml-rb-split-icon-hover-fg:#8db9ff;--ml-rb-split-label-hover-bg:oklab(71.6785% -.0267566 -.145349/.2);--ml-rb-split-label-hover-fg:#a8ccff}.ml-ribbon{--ml-rb-scale:1;--ml-rb-overflow-slot-width:40px;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));border:1px solid var(--ml-rb-border-strong);background:var(--ml-rb-bg);color:var(--ml-rb-tab-text);border-radius:0;overflow:hidden}.ml-ribbon.ml-ribbon--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon.ml-ribbon--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon__header{z-index:10;min-height:calc(var(--ml-rb-control-height) + 2px);border-bottom:1px solid var(--ml-rb-border);background:linear-gradient(180deg, var(--ml-rb-header-start) 0%, var(--ml-rb-header-end) 100%);justify-content:space-between;align-items:center;gap:8px;padding:0 8px;display:flex;position:relative}.ml-ribbon__head-left,.ml-ribbon__head-right{align-items:center;display:flex}.ml-ribbon__head-left{gap:8px}.ml-ribbon__head-right{gap:4px}.ml-ribbon__tabs-extra{align-items:center;gap:8px;display:inline-flex}.ml-ribbon__control--minimize.el-button{height:24px;min-height:24px;padding:0 8px}.ml-ribbon__head-right .el-button+.el-button{margin-left:0}.ml-ribbon-popper{--ml-rb-popper-scale:1}.ml-ribbon-popper.ml-ribbon-popper--size-small{--ml-rb-popper-scale:.92}.ml-ribbon-popper.ml-ribbon-popper--size-large{--ml-rb-popper-scale:1.08}.ml-ribbon-popper.ml-ribbon-popper--size-small .el-dropdown-menu__item{min-height:22px}.ml-ribbon-file-menu-dropdown .el-dropdown-menu__item{font-size:calc(var(--el-font-size-small) * var(--ml-rb-popper-scale,1));color:var(--ml-rb-tab-text);min-height:20px;font-family:inherit;font-weight:400;line-height:20px}.ml-ribbon-dropdown-menu .el-dropdown-menu__item,.ml-ribbon-select-dropdown .el-select-dropdown__item{font-size:calc(var(--el-font-size-small) * var(--ml-rb-popper-scale,1))}.ml-ribbon-dropdown-item__content{align-items:center;gap:6px;display:inline-flex}.ml-ribbon-dropdown-item__icon{font-size:var(--ml-rb-font-sm)}.ml-ribbon-dropdown-item__icon--class{justify-content:center;align-items:center;width:1em;height:1em;display:inline-flex}.ml-ribbon-dropdown-item__label{line-height:1.2}.ml-ribbon-tabs{align-items:center;gap:2px;display:inline-flex}.ml-ribbon-tab{height:calc(var(--ml-rb-compact-height) - 2px);color:var(--ml-rb-tab-text);font-size:var(--ml-rb-font-sm);cursor:pointer;line-height:calc(var(--ml-rb-compact-height) - 2px);background:0 0;border:none;border-bottom:2px solid #0000;margin:0;padding:0 8px}.ml-ribbon-tab:hover{background:var(--ml-rb-hover-bg)}.ml-ribbon-tab.is-active{color:var(--ml-rb-active);border-bottom-color:var(--ml-rb-active)}.ml-ribbon-contextual-tabs{align-items:center;gap:6px;display:flex}.ml-ribbon-contextual-tabs__ctx{gap:6px;display:flex}.ml-ribbon-contextual-tabs__block{border:1px solid color-mix(in oklab, var(--ctx-color) 55%, #fff);border-radius:4px;align-items:center;gap:4px;padding:0 3px;display:inline-flex}.ml-ribbon-contextual-tabs__block small{font-size:calc(var(--ml-rb-font-xs) * .9);color:color-mix(in oklab, var(--ctx-color) 72%, #111);font-weight:600}.ml-ribbon__head-right .el-button.is-circle{width:24px;height:24px}.ml-ribbon__head-right .el-switch{--el-switch-on-color:#d0d4dc;--el-switch-height:18px;--el-switch-width:34px}.ml-ribbon__panel{z-index:1;background:var(--ml-rb-panel-bg);min-height:calc(var(--ml-rb-control-height) * 2.75);align-items:stretch;gap:0;padding:4px 0 3px;display:flex;position:relative;overflow-x:hidden}.ml-ribbon__panel--simplified{align-items:center;gap:6px;min-height:36px}.ml-ribbon-group{border-right:1px solid var(--ml-rb-border);flex-direction:column;flex:0 0 190px;justify-content:space-between;min-width:190px;max-width:190px;padding:0 6px;display:flex;overflow:hidden}.ml-ribbon-group.ml-ribbon-group--auto-width{flex:none;width:max-content;min-width:0;max-width:none}.ml-ribbon-group.ml-ribbon-group--overflow{flex:0 0 var(--ml-rb-overflow-slot-width);min-width:var(--ml-rb-overflow-slot-width);max-width:var(--ml-rb-overflow-slot-width);padding:0 4px}.ml-ribbon-group__body{overflow:hidden}.ml-ribbon-group__body--overflow{justify-content:center;align-items:center;display:flex}.ml-ribbon-group__content{min-height:calc(var(--ml-rb-control-height) * 1.8);align-items:flex-start;gap:6px;padding:2px 1px;display:flex;overflow:hidden}.ml-ribbon-group__content--row,.ml-ribbon-group__content--column{flex-direction:row}.ml-ribbon-collection{gap:4px;max-width:100%;display:flex}.ml-ribbon-collection--row{flex-flow:wrap;align-content:flex-start;align-items:flex-start}.ml-ribbon-collection--column{grid-auto-flow:column;grid-template-rows:repeat(var(--ml-ribbon-collection-rows,3), minmax(var(--ml-rb-compact-height), auto));grid-auto-columns:minmax(98px,max-content);align-items:stretch;gap:2px;min-width:98px;display:grid}.ml-ribbon-item-host{min-height:var(--ml-rb-compact-height);align-items:center;max-width:100%;display:inline-flex;position:relative}.ml-ribbon-item-host__keytip{left:50%;top:calc(-8px * var(--ml-rb-scale));z-index:30;min-width:calc(18px * var(--ml-rb-scale));height:calc(20px * var(--ml-rb-scale));padding:0 calc(4px * var(--ml-rb-scale));border:1px solid var(--ml-rb-keytip-border);border-radius:calc(2px * var(--ml-rb-scale));background:var(--ml-rb-keytip-inline-bg);color:var(--ml-rb-keytip-inline-fg);font-size:var(--ml-rb-font-sm);white-space:nowrap;pointer-events:none;box-shadow:0 1px 3px var(--ml-rb-keytip-inline-shadow);justify-content:center;align-items:center;line-height:1;display:inline-flex;position:absolute;transform:translate(-50%)}.ml-ribbon-item-host.is-large .el-button{text-align:center;justify-content:center;align-items:center;width:max-content;min-width:0;height:78px;min-height:78px;padding:8px 6px;display:inline-flex}.ml-ribbon-item-host.is-large .el-button>span{flex-direction:column;justify-content:center;align-items:center;gap:4px;line-height:1.1;display:inline-flex}.ml-ribbon-item-host.is-small .el-button{min-height:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);padding:0 6px}.ml-ribbon-item-host :is(.el-button,.el-select,.el-input__wrapper,.el-checkbox){font-size:var(--ml-rb-font-sm)}.ml-ribbon-item-host .el-button{box-shadow:none;height:calc(var(--ml-rb-compact-height) + 2px);background:0 0;border-color:#0000;border-radius:4px;justify-content:flex-start;padding:0 7px}.ml-ribbon-item-host__icon{font-size:var(--ml-rb-font-base);margin-right:4px}.ml-ribbon-item-host__icon--class{justify-content:center;align-items:center;width:1em;height:1em;display:inline-flex}.ml-ribbon-item-host__icon--dropdown-primary{cursor:pointer;border-radius:4px;padding:1px 3px;transition:background-color .15s,color .15s}.ml-ribbon-item-host__icon--dropdown-primary:hover{background:var(--ml-rb-split-icon-hover-bg);color:var(--ml-rb-split-icon-hover-fg)}.ml-ribbon-item-host.is-label-hidden .ml-ribbon-item-host__icon{margin-right:0}.ml-ribbon-item-host.is-label-hidden .el-button{min-width:var(--ml-rb-compact-height);justify-content:center;padding-left:4px;padding-right:4px}.ml-ribbon-item-host__label{line-height:1.1}.ml-ribbon-item-host__content{align-items:center;gap:4px;display:inline-flex}.ml-ribbon-item-host__text-row{align-items:center;gap:2px;display:inline-flex}.ml-ribbon-item-host.type-dropdown .ml-ribbon-item-host__text-row{border-radius:4px;padding:1px 4px;transition:background-color .15s,color .15s}.ml-ribbon-item-host.type-dropdown .ml-ribbon-item-host__text-row:hover{background:var(--ml-rb-split-label-hover-bg);color:var(--ml-rb-split-label-hover-fg)}.ml-ribbon-item-host__dropdown-arrow{font-size:var(--ml-rb-font-xs)}.ml-ribbon-item-host.is-large .ml-ribbon-item-host__icon{font-size:calc(var(--ml-rb-font-base) * 1.7);margin-bottom:2px;margin-right:0}.ml-ribbon-item-host.is-large .ml-ribbon-item-host__label{font-size:var(--ml-rb-font-sm)}.ml-ribbon-item-host.is-large.type-dropdown .ml-ribbon-item-host__content{flex-direction:column;justify-content:center}.ml-ribbon-item-host.is-label-hidden.is-small.type-dropdown .ml-ribbon-item-host__content{gap:2px}.ml-ribbon-item-host.is-label-hidden.is-small.type-dropdown .ml-ribbon-item-host__text-row{margin-left:0}.ml-ribbon__panel .el-button:hover,.ml-ribbon__panel .el-button:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon__panel .el-button:active{background:var(--ml-rb-active-bg);border-color:var(--ml-rb-active-border)}.ml-ribbon__panel .el-button.is-disabled{background:0 0;border-color:#0000}.ml-ribbon--keytips-open .ml-ribbon__panel,.ml-ribbon--keytips-open .ml-ribbon-group,.ml-ribbon--keytips-open .ml-ribbon-group__body,.ml-ribbon--keytips-open .ml-ribbon-group__content{overflow:visible}.ml-ribbon--keytips-open .ml-ribbon__panel{z-index:20}.ml-ribbon-item-host .el-select{max-width:100%}.ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:100%}.ml-ribbon-group--auto-width .ml-ribbon-group__content{width:max-content}.ml-ribbon-group--auto-width .ml-ribbon-collection--column{grid-auto-columns:max-content;width:max-content;min-width:0}.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:auto}.ml-ribbon-item-host .el-input__wrapper{box-shadow:none;background:0 0;border:1px solid #0000}.ml-ribbon-item-host .el-select .el-select__wrapper,.ml-ribbon-item-host .el-select .el-input__wrapper{min-height:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);padding:0 var(--ml-rb-select-padding-x);border-radius:4px}.ml-ribbon-item-host .el-select .el-select__selected-item,.ml-ribbon-item-host .el-select .el-select__placeholder,.ml-ribbon-item-host .el-select .el-select__input{font-size:var(--ml-rb-select-font-size)}.ml-ribbon-item-host .el-select:hover .el-input__wrapper,.ml-ribbon-item-host .el-select.is-focus .el-input__wrapper{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-item-host .el-color-picker{--el-color-picker-size:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height)}.ml-ribbon-item-host .el-color-picker .el-color-picker__trigger{width:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);background:0 0;border-color:#0000;border-radius:4px;padding:0}.ml-ribbon-item-host .el-color-picker:hover .el-color-picker__trigger,.ml-ribbon-item-host .el-color-picker .el-color-picker__trigger:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-group-button{flex-direction:column;gap:2px;max-width:100%;display:flex}.ml-ribbon-group-button .el-button-group{flex-wrap:wrap;max-width:100%;display:flex}.ml-ribbon-group-button__label{font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted)}.ml-ribbon-gallery{min-width:160px}.ml-ribbon-gallery__title{font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted);margin-bottom:4px}.ml-ribbon-gallery__category-title{font-size:var(--ml-rb-font-xs);margin:0 0 4px}.ml-ribbon-gallery__grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;display:grid}.ml-ribbon-gallery__item{border:1px solid var(--ml-rb-border);background:var(--ml-rb-surface);cursor:pointer;text-align:center;border-radius:4px;padding:5px}.ml-ribbon-gallery__item.is-selected{border-color:var(--ml-rb-active);box-shadow:0 0 0 1px color-mix(in oklab, var(--ml-rb-active) 35%, #fff)}.ml-ribbon-gallery__preview{color:var(--ml-rb-muted)}.ml-ribbon-gallery__label{font-size:var(--ml-rb-font-sm);margin-top:2px}.ml-ribbon-group__footer{width:100%;height:11px;min-height:11px;line-height:11px;font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted);justify-content:center;align-items:center;gap:2px;padding:0;display:inline-flex;position:relative;overflow:hidden}.ml-ribbon-group__title{white-space:nowrap;text-overflow:ellipsis;max-width:calc(100% - 26px);line-height:11px;display:inline-block;overflow:hidden}.ml-ribbon-group__footer-trigger{width:12px;height:10px;color:var(--ml-rb-muted);cursor:pointer;vertical-align:middle;background:0 0;border:none;justify-content:center;align-items:center;margin:0 0 0 1px;padding:0;display:inline-flex}.ml-ribbon-group__footer-trigger:hover{color:var(--ml-rb-tab-text)}.ml-ribbon-group__icon{font-size:var(--ml-rb-font-xs);vertical-align:middle;margin-right:2px}.ml-ribbon-group__launcher{--el-button-icon-size:10px;height:10px;min-height:10px;margin:0;padding:0;line-height:10px;position:absolute;bottom:0;right:0}.ml-ribbon-group__overflow-trigger{width:12px;height:10px;color:var(--ml-rb-muted);cursor:pointer;vertical-align:middle;background:0 0;border:none;justify-content:center;align-items:center;margin-left:2px;padding:0;display:inline-flex}.ml-ribbon-group__overflow-trigger:hover{color:var(--ml-rb-tab-text)}.ml-ribbon-group__overflow-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-group__overflow-popover.ml-ribbon-group__overflow-popover--size-small{--ml-rb-scale:.92}.ml-ribbon-group__overflow-popover.ml-ribbon-group__overflow-popover--size-large{--ml-rb-scale:1.08}.ml-ribbon-group__overflow-content{max-width:min(420px,80vw)}.ml-ribbon-group__overflow-content .ml-ribbon-group__content{overflow:visible}.ml-ribbon-group__overflow-content .ml-ribbon-collection--column{grid-template-rows:none;grid-template-columns:minmax(110px,max-content);grid-auto-columns:auto;grid-auto-flow:row}.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:auto}.ml-ribbon-simplified-group{height:28px;color:var(--ml-rb-tab-text);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:4px;align-items:center;gap:6px;padding:0 8px;display:inline-flex}.ml-ribbon-simplified-group:hover{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-simplified-group__icon{font-size:calc(var(--ml-rb-font-base) * 1.1)}.ml-ribbon-group-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-group-popover.ml-ribbon-group-popover--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon-group-popover.ml-ribbon-group-popover--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon-simplified-group__panel{min-width:300px;max-width:min(560px,80vw)}.ml-ribbon-simplified-group__panel .ml-ribbon-group__content{gap:8px;padding:6px 4px;overflow:visible}.ml-ribbon-simplified-group__panel .ml-ribbon-collection{flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:10px 6px;display:flex}.ml-ribbon-overflow-trigger{width:28px;height:20px;color:var(--ml-rb-tab-text);font-family:inherit;font-size:var(--ml-rb-font-base);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:4px;justify-content:center;align-self:center;align-items:center;margin-top:0;margin-left:0;font-weight:400;display:inline-flex}.ml-ribbon-overflow-trigger:hover{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-overflow-trigger__dots{line-height:1;font-size:calc(var(--ml-rb-font-base) * 1.1);letter-spacing:1px;justify-content:center;align-items:center;display:inline-flex;transform:none}.ml-ribbon-group__footer.ml-ribbon-group__footer--overflow{visibility:hidden}.ml-ribbon-overflow-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-overflow-popover.ml-ribbon-overflow-popover--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon-overflow-popover.ml-ribbon-overflow-popover--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon-overflow-popover .ml-ribbon-group__content{overflow:visible}.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:hover,.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:focus-visible,.ml-ribbon-overflow-popover .el-button:hover,.ml-ribbon-overflow-popover .el-button:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:active,.ml-ribbon-overflow-popover .el-button:active{background:var(--ml-rb-active-bg);border-color:var(--ml-rb-active-border)}.ml-ribbon-overflow-list{flex-direction:column;gap:8px;max-height:320px;display:flex;overflow:auto}.ml-ribbon-overflow-group{border:1px solid var(--ml-rb-border);background:var(--ml-rb-surface-soft);border-radius:6px;padding:6px}.ml-ribbon-overflow-group__header{font-size:var(--ml-rb-font-sm);color:var(--ml-rb-tab-text);margin-bottom:6px;font-weight:600}.ml-ribbon-backstage{--ml-rb-backstage-scale:1;--ml-rb-backstage-nav-width:calc(260px * var(--ml-rb-backstage-scale));--ml-rb-backstage-nav-padding:calc(16px * var(--ml-rb-backstage-scale));--ml-rb-backstage-content-padding:calc(24px * var(--ml-rb-backstage-scale));--ml-rb-backstage-title-size:calc(var(--el-font-size-extra-large) * var(--ml-rb-backstage-scale));--ml-rb-backstage-text-size:calc(var(--el-font-size-base) * var(--ml-rb-backstage-scale));grid-template-columns:var(--ml-rb-backstage-nav-width) 1fr;height:100%;display:grid}.ml-ribbon-backstage.ml-ribbon-backstage--size-small{--ml-rb-backstage-scale:.92}.ml-ribbon-backstage.ml-ribbon-backstage--size-large{--ml-rb-backstage-scale:1.08}.ml-ribbon-backstage__nav{border-right:1px solid var(--ml-rb-border);padding:var(--ml-rb-backstage-nav-padding)}.ml-ribbon-backstage__content{padding:var(--ml-rb-backstage-content-padding)}.ml-ribbon-backstage__content h2{font-size:var(--ml-rb-backstage-title-size);margin:0;line-height:1.2}.ml-ribbon-backstage__content p{margin-top:calc(10px * var(--ml-rb-backstage-scale));font-size:var(--ml-rb-backstage-text-size);line-height:1.6}.ml-ribbon-backstage__menu .el-menu-item{min-height:calc(36px * var(--ml-rb-backstage-scale));line-height:calc(36px * var(--ml-rb-backstage-scale));font-size:var(--ml-rb-backstage-text-size)}.ml-ribbon-keytips{z-index:5000;border:1px solid var(--ml-rb-keytip-border);background:var(--ml-rb-keytip-bg);border-radius:8px;align-items:center;gap:6px;padding:8px;display:flex;position:fixed;bottom:12px;right:12px}.ml-ribbon-keytip{border:1px solid var(--ml-rb-keytip-border);background:var(--ml-rb-surface);font-size:var(--ml-rb-font-sm);border-radius:4px;padding:2px 6px}@media (width<=960px){.ml-ribbon-backstage{grid-template-columns:1fr}}
|
|
1
|
+
:root{--ml-rb-border:var(--el-border-color);--ml-rb-border-strong:var(--el-border-color-dark);--ml-rb-bg:var(--el-fill-color-light);--ml-rb-panel-bg:var(--el-fill-color-lighter);--ml-rb-tab-text:var(--el-text-color-primary);--ml-rb-muted:var(--el-text-color-secondary);--ml-rb-active:var(--el-color-primary);--ml-rb-header-start:var(--el-bg-color);--ml-rb-header-end:var(--el-fill-color-light);--ml-rb-hover-bg:var(--el-fill-color);--ml-rb-hover-border:var(--el-border-color);--ml-rb-active-bg:var(--el-fill-color-dark);--ml-rb-active-border:var(--el-border-color-darker);--ml-rb-surface:var(--el-bg-color);--ml-rb-surface-soft:var(--el-fill-color-blank);--ml-rb-keytip-border:#e7a957;--ml-rb-keytip-bg:#fff7eb;--ml-rb-keytip-inline-bg:#1b212a;--ml-rb-keytip-inline-fg:#ffdc85;--ml-rb-keytip-inline-shadow:oklab(0% none none/.2);--ml-rb-split-icon-hover-bg:color-mix(in oklab, var(--el-color-primary) 14%, transparent);--ml-rb-split-icon-hover-fg:var(--el-color-primary);--ml-rb-split-label-hover-bg:oklab(57.259% -.0282497 -.196933/.16);--ml-rb-split-label-hover-fg:#1f4fbf}html.dark{--ml-rb-keytip-border:#cf9448;--ml-rb-keytip-bg:#2b2420;--ml-rb-keytip-inline-bg:#f4f6fb;--ml-rb-keytip-inline-fg:#1d2530;--ml-rb-keytip-inline-shadow:oklab(0% none none/.35);--ml-rb-split-icon-hover-bg:color-mix(in oklab, var(--el-color-primary) 24%, transparent);--ml-rb-split-icon-hover-fg:#8db9ff;--ml-rb-split-label-hover-bg:oklab(71.6785% -.0267566 -.145349/.2);--ml-rb-split-label-hover-fg:#a8ccff}.ml-ribbon{--ml-rb-scale:1;--ml-rb-overflow-slot-width:40px;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-content-rows:3;--ml-rb-content-row-gap:2px;--ml-rb-footer-line-height:calc(11px * var(--ml-rb-scale));--ml-rb-footer-pad-top:calc(4px * var(--ml-rb-scale));--ml-rb-footer-pad-bottom:calc(2px * var(--ml-rb-scale));--ml-rb-footer-height:calc(var(--ml-rb-footer-line-height) + var(--ml-rb-footer-pad-top) + var(--ml-rb-footer-pad-bottom));--ml-rb-panel-content-height:calc((var(--ml-rb-compact-height) * var(--ml-rb-content-rows)) + (var(--ml-rb-content-row-gap) * (var(--ml-rb-content-rows) - 1)));--ml-rb-panel-height:calc(var(--ml-rb-panel-content-height) + var(--ml-rb-footer-height));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));border:1px solid var(--ml-rb-border-strong);background:var(--ml-rb-bg);color:var(--ml-rb-tab-text);border-radius:0;overflow:hidden}.ml-ribbon.ml-ribbon--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon.ml-ribbon--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon__header{z-index:10;min-height:calc(var(--ml-rb-control-height) + 2px);border-bottom:1px solid var(--ml-rb-border);background:linear-gradient(180deg, var(--ml-rb-header-start) 0%, var(--ml-rb-header-end) 100%);justify-content:space-between;align-items:center;gap:8px;padding:0 8px;display:flex;position:relative}.ml-ribbon__head-left,.ml-ribbon__head-right{align-items:center;display:flex}.ml-ribbon__head-left{gap:8px}.ml-ribbon__head-right{gap:4px}.ml-ribbon__tabs-extra{align-items:center;gap:8px;display:inline-flex}.ml-ribbon__control--minimize.el-button{height:24px;min-height:24px;padding:0 8px}.ml-ribbon__head-right .el-button+.el-button{margin-left:0}.ml-ribbon-popper{--ml-rb-popper-scale:1}.ml-ribbon-popper.ml-ribbon-popper--size-small{--ml-rb-popper-scale:.92}.ml-ribbon-popper.ml-ribbon-popper--size-large{--ml-rb-popper-scale:1.08}.ml-ribbon-popper.ml-ribbon-popper--size-small .el-dropdown-menu__item{min-height:22px}.ml-ribbon-file-menu-dropdown .el-dropdown-menu__item{font-size:calc(var(--el-font-size-small) * var(--ml-rb-popper-scale,1));color:var(--ml-rb-tab-text);min-height:20px;font-family:inherit;font-weight:400;line-height:20px}.ml-ribbon-dropdown-menu .el-dropdown-menu__item,.ml-ribbon-select-dropdown .el-select-dropdown__item{font-size:calc(var(--el-font-size-small) * var(--ml-rb-popper-scale,1))}.ml-ribbon-dropdown-item__content{align-items:center;gap:6px;display:inline-flex}.ml-ribbon-dropdown-item__icon{font-size:var(--ml-rb-font-sm)}.ml-ribbon-dropdown-item__icon--class{justify-content:center;align-items:center;width:1em;height:1em;display:inline-flex}.ml-ribbon-dropdown-item__label{line-height:1.2}.ml-ribbon-tabs{align-items:center;gap:2px;display:inline-flex}.ml-ribbon-tab{height:calc(var(--ml-rb-compact-height) - 2px);color:var(--ml-rb-tab-text);font-size:var(--ml-rb-font-sm);cursor:pointer;line-height:calc(var(--ml-rb-compact-height) - 2px);background:0 0;border:none;border-bottom:2px solid #0000;margin:0;padding:0 8px}.ml-ribbon-tab:hover{background:var(--ml-rb-hover-bg)}.ml-ribbon-tab.is-active{color:var(--ml-rb-active);border-bottom-color:var(--ml-rb-active)}.ml-ribbon-contextual-tabs{align-items:center;gap:6px;display:flex}.ml-ribbon-contextual-tabs__ctx{gap:6px;display:flex}.ml-ribbon-contextual-tabs__block{border:1px solid color-mix(in oklab, var(--ctx-color) 55%, #fff);border-radius:4px;align-items:center;gap:4px;padding:0 3px;display:inline-flex}.ml-ribbon-contextual-tabs__block small{font-size:calc(var(--ml-rb-font-xs) * .9);color:color-mix(in oklab, var(--ctx-color) 72%, #111);font-weight:600}.ml-ribbon__head-right .el-button.is-circle{width:24px;height:24px}.ml-ribbon__head-right .el-switch{--el-switch-on-color:#d0d4dc;--el-switch-height:18px;--el-switch-width:34px}.ml-ribbon__panel{z-index:1;background:var(--ml-rb-panel-bg);min-height:var(--ml-rb-panel-height);height:var(--ml-rb-panel-height);align-items:stretch;gap:0;padding:0;display:flex;position:relative;overflow-x:hidden}.ml-ribbon__panel--simplified{align-items:center;gap:6px;height:36px;min-height:36px}.ml-ribbon-group{border-right:1px solid var(--ml-rb-border);flex-direction:column;flex:0 0 190px;justify-content:space-between;min-width:190px;max-width:190px;padding:0 6px;display:flex;overflow:hidden}.ml-ribbon-group.ml-ribbon-group--auto-width{flex:none;width:max-content;min-width:0;max-width:none}.ml-ribbon-group.ml-ribbon-group--overflow{flex:0 0 var(--ml-rb-overflow-slot-width);min-width:var(--ml-rb-overflow-slot-width);max-width:var(--ml-rb-overflow-slot-width);padding:0 4px}.ml-ribbon-group__body{flex:auto;min-height:0;display:flex;overflow:hidden}.ml-ribbon-group__body--overflow{justify-content:center;align-items:center;display:flex}.ml-ribbon-group__content{min-height:var(--ml-rb-panel-content-height);height:var(--ml-rb-panel-content-height);align-items:stretch;gap:6px;padding:0 1px;display:flex;overflow:hidden}.ml-ribbon-group__content--row,.ml-ribbon-group__content--column{flex-direction:row}.ml-ribbon-collection{gap:4px;max-width:100%;display:flex}.ml-ribbon-collection--row{flex-flow:wrap;align-content:flex-start;align-items:flex-start}.ml-ribbon-collection--column{grid-auto-flow:column;grid-template-rows:repeat(var(--ml-ribbon-collection-rows,3), var(--ml-rb-compact-height));align-items:stretch;gap:var(--ml-rb-content-row-gap);grid-auto-columns:minmax(98px,max-content);min-width:98px;display:grid}.ml-ribbon-item-host{min-height:var(--ml-rb-compact-height);align-items:center;max-width:100%;display:inline-flex;position:relative}.ml-ribbon-item-host__keytip{left:50%;top:calc(-8px * var(--ml-rb-scale));z-index:30;min-width:calc(18px * var(--ml-rb-scale));height:calc(20px * var(--ml-rb-scale));padding:0 calc(4px * var(--ml-rb-scale));border:1px solid var(--ml-rb-keytip-border);border-radius:calc(2px * var(--ml-rb-scale));background:var(--ml-rb-keytip-inline-bg);color:var(--ml-rb-keytip-inline-fg);font-size:var(--ml-rb-font-sm);white-space:nowrap;pointer-events:none;box-shadow:0 1px 3px var(--ml-rb-keytip-inline-shadow);justify-content:center;align-items:center;line-height:1;display:inline-flex;position:absolute;transform:translate(-50%)}.ml-ribbon-item-host.is-large{align-self:stretch;height:100%}.ml-ribbon-item-host.is-large .el-button{text-align:center;justify-content:center;align-items:center;width:max-content;min-width:0;height:100%;min-height:0;padding:8px 6px;display:inline-flex}.ml-ribbon-item-host.is-large .el-button>span{flex-direction:column;justify-content:center;align-items:center;gap:4px;line-height:1.1;display:inline-flex}.ml-ribbon-item-host.is-small .el-button{min-height:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);padding:0 6px}.ml-ribbon-item-host :is(.el-button,.el-select,.el-input__wrapper,.el-checkbox){font-size:var(--ml-rb-font-sm)}.ml-ribbon-item-host .el-button{box-shadow:none;height:calc(var(--ml-rb-compact-height) + 2px);background:0 0;border-color:#0000;border-radius:4px;justify-content:flex-start;padding:0 7px}.ml-ribbon-item-host__icon{font-size:var(--ml-rb-font-base);margin-right:4px}.ml-ribbon-item-host__icon--class{justify-content:center;align-items:center;width:1em;height:1em;display:inline-flex}.ml-ribbon-item-host__icon--dropdown-primary{cursor:pointer;border-radius:4px;justify-content:center;align-items:center;padding:0;line-height:1;transition:background-color .15s,color .15s;display:inline-flex}.ml-ribbon-item-host__icon--dropdown-primary:hover{background:var(--ml-rb-split-icon-hover-bg);color:var(--ml-rb-split-icon-hover-fg)}.ml-ribbon-item-host.is-label-hidden .ml-ribbon-item-host__icon{margin-right:0}.ml-ribbon-item-host.is-label-hidden .el-button{min-width:var(--ml-rb-compact-height);justify-content:center;padding-left:4px;padding-right:4px}.ml-ribbon-item-host__label{line-height:1.1}.ml-ribbon-item-host__content{align-items:center;gap:4px;display:inline-flex}.ml-ribbon-item-host__text-row{align-items:center;gap:2px;display:inline-flex}.ml-ribbon-item-host.type-dropdown .ml-ribbon-item-host__text-row{border-radius:4px;padding:1px 4px;transition:background-color .15s,color .15s}.ml-ribbon-item-host.type-dropdown .ml-ribbon-item-host__text-row:hover{background:var(--ml-rb-split-label-hover-bg);color:var(--ml-rb-split-label-hover-fg)}.ml-ribbon-item-host__dropdown-arrow{font-size:var(--ml-rb-font-xs)}.ml-ribbon-item-host.is-large .ml-ribbon-item-host__icon{font-size:calc(var(--ml-rb-font-base) * 1.7);margin-bottom:2px;margin-right:0}.ml-ribbon-item-host.is-large .ml-ribbon-item-host__label{font-size:var(--ml-rb-font-sm)}.ml-ribbon-item-host.is-large.type-dropdown .ml-ribbon-item-host__content{flex-direction:column;justify-content:center}.ml-ribbon-item-host.is-label-hidden.is-small.type-dropdown .ml-ribbon-item-host__content{gap:2px}.ml-ribbon-item-host.is-label-hidden.is-small.type-dropdown .ml-ribbon-item-host__text-row{margin-left:0}.ml-ribbon__panel .el-button:hover,.ml-ribbon__panel .el-button:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon__panel .el-button:active{background:var(--ml-rb-active-bg);border-color:var(--ml-rb-active-border)}.ml-ribbon__panel .el-button.is-disabled{background:0 0;border-color:#0000}.ml-ribbon--keytips-open .ml-ribbon__panel,.ml-ribbon--keytips-open .ml-ribbon-group,.ml-ribbon--keytips-open .ml-ribbon-group__body,.ml-ribbon--keytips-open .ml-ribbon-group__content{overflow:visible}.ml-ribbon--keytips-open .ml-ribbon__panel{z-index:20}.ml-ribbon-item-host .el-select{max-width:100%}.ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:100%}.ml-ribbon-group--auto-width .ml-ribbon-group__content{width:max-content}.ml-ribbon-group--auto-width .ml-ribbon-collection--column{grid-auto-columns:max-content;width:max-content;min-width:0}.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-group--auto-width .ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:auto}.ml-ribbon-item-host .el-input__wrapper{box-shadow:none;background:0 0;border:1px solid #0000}.ml-ribbon-item-host .el-select .el-select__wrapper,.ml-ribbon-item-host .el-select .el-input__wrapper{min-height:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);padding:0 var(--ml-rb-select-padding-x);border-radius:4px}.ml-ribbon-item-host .el-select .el-select__selected-item,.ml-ribbon-item-host .el-select .el-select__placeholder,.ml-ribbon-item-host .el-select .el-select__input{font-size:var(--ml-rb-select-font-size)}.ml-ribbon-item-host .el-select:hover .el-input__wrapper,.ml-ribbon-item-host .el-select.is-focus .el-input__wrapper{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-item-host .el-color-picker{--el-color-picker-size:var(--ml-rb-compact-height);width:var(--ml-rb-compact-height);min-width:var(--ml-rb-compact-height);height:var(--ml-rb-compact-height);align-items:center;line-height:1;display:inline-flex}.ml-ribbon-item-host .el-color-picker .el-color-picker__trigger{background:0 0;border-color:#0000;border-radius:4px;width:100%;height:100%;padding:0}.ml-ribbon-item-host .el-color-picker .el-color-picker__empty,.ml-ribbon-item-host .el-color-picker .el-color-picker__icon{font-size:calc(12px * var(--ml-rb-scale));line-height:1;transform:none}.ml-ribbon-item-host .el-color-picker:hover .el-color-picker__trigger,.ml-ribbon-item-host .el-color-picker .el-color-picker__trigger:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-group-button{flex-direction:column;gap:2px;max-width:100%;display:flex}.ml-ribbon-group-button .el-button-group{flex-wrap:wrap;max-width:100%;display:flex}.ml-ribbon-group-button__label{font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted)}.ml-ribbon-gallery{min-width:160px}.ml-ribbon-gallery__title{font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted);margin-bottom:4px}.ml-ribbon-gallery__category-title{font-size:var(--ml-rb-font-xs);margin:0 0 4px}.ml-ribbon-gallery__grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;display:grid}.ml-ribbon-gallery__item{border:1px solid var(--ml-rb-border);background:var(--ml-rb-surface);cursor:pointer;text-align:center;border-radius:4px;padding:5px}.ml-ribbon-gallery__item.is-selected{border-color:var(--ml-rb-active);box-shadow:0 0 0 1px color-mix(in oklab, var(--ml-rb-active) 35%, #fff)}.ml-ribbon-gallery__preview{color:var(--ml-rb-muted)}.ml-ribbon-gallery__label{font-size:var(--ml-rb-font-sm);margin-top:2px}.ml-ribbon-group__footer{box-sizing:border-box;width:calc(100% + 12px);min-height:var(--ml-rb-footer-height);height:var(--ml-rb-footer-height);padding:var(--ml-rb-footer-pad-top) 0 var(--ml-rb-footer-pad-bottom);line-height:var(--ml-rb-footer-line-height);font-size:var(--ml-rb-font-xs);color:var(--ml-rb-muted);border:1px solid #0000;border-radius:4px;justify-content:center;align-items:center;gap:2px;margin:0 -6px;transition:background-color .15s,border-color .15s,color .15s;display:inline-flex;position:relative;overflow:hidden}.ml-ribbon-group__footer:hover{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border);color:var(--ml-rb-tab-text)}.ml-ribbon-group__title{line-height:var(--ml-rb-footer-line-height);white-space:nowrap;text-overflow:ellipsis;max-width:calc(100% - 26px);display:inline-block;overflow:hidden}.ml-ribbon-group__footer-trigger{width:12px;height:10px;color:var(--ml-rb-muted);cursor:pointer;vertical-align:middle;background:0 0;border:none;justify-content:center;align-items:center;margin:0 0 0 1px;padding:0;display:inline-flex}.ml-ribbon-group__footer-trigger:hover{color:var(--ml-rb-tab-text)}.ml-ribbon-group__icon{font-size:var(--ml-rb-font-xs);vertical-align:middle;margin-right:2px}.ml-ribbon-group__launcher{--el-button-icon-size:10px;height:10px;min-height:10px;margin:0;padding:0;line-height:10px;position:absolute;bottom:0;right:0}.ml-ribbon-group__overflow-trigger{width:12px;height:10px;color:var(--ml-rb-muted);cursor:pointer;vertical-align:middle;background:0 0;border:none;justify-content:center;align-items:center;margin-left:2px;padding:0;display:inline-flex}.ml-ribbon-group__overflow-trigger:hover{color:var(--ml-rb-tab-text)}.ml-ribbon-group__overflow-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-group__overflow-popover.ml-ribbon-group__overflow-popover--size-small{--ml-rb-scale:.92}.ml-ribbon-group__overflow-popover.ml-ribbon-group__overflow-popover--size-large{--ml-rb-scale:1.08}.ml-ribbon-group__overflow-content{max-width:min(420px,80vw)}.ml-ribbon-group__overflow-content .ml-ribbon-group__content{overflow:visible}.ml-ribbon-group__overflow-content .ml-ribbon-collection--column{grid-template-rows:none;grid-template-columns:minmax(110px,max-content);grid-auto-columns:auto;grid-auto-flow:row}.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host,.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host .el-button,.ml-ribbon-group__overflow-content .ml-ribbon-collection--column .ml-ribbon-item-host .el-select{width:auto}.ml-ribbon-simplified-group{height:28px;color:var(--ml-rb-tab-text);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:4px;align-items:center;gap:6px;padding:0 8px;display:inline-flex}.ml-ribbon-simplified-group:hover{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-simplified-group__icon{font-size:calc(var(--ml-rb-font-base) * 1.1)}.ml-ribbon-group-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-group-popover.ml-ribbon-group-popover--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon-group-popover.ml-ribbon-group-popover--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon-simplified-group__panel{min-width:300px;max-width:min(560px,80vw)}.ml-ribbon-simplified-group__panel .ml-ribbon-group__content{gap:8px;padding:6px 4px;overflow:visible}.ml-ribbon-simplified-group__panel .ml-ribbon-collection{flex-wrap:wrap;align-content:flex-start;align-items:flex-start;gap:10px 6px;display:flex}.ml-ribbon-overflow-trigger{width:28px;height:20px;color:var(--ml-rb-tab-text);font-family:inherit;font-size:var(--ml-rb-font-base);cursor:pointer;background:0 0;border:1px solid #0000;border-radius:4px;justify-content:center;align-self:center;align-items:center;margin-top:0;margin-left:0;font-weight:400;display:inline-flex}.ml-ribbon-overflow-trigger:hover{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-overflow-trigger__dots{line-height:1;font-size:calc(var(--ml-rb-font-base) * 1.1);letter-spacing:1px;justify-content:center;align-items:center;display:inline-flex;transform:none}.ml-ribbon-group__footer.ml-ribbon-group__footer--overflow{visibility:hidden}.ml-ribbon-overflow-popover{--ml-rb-scale:1;--ml-rb-font-xs:calc(var(--el-font-size-extra-small) * var(--ml-rb-scale));--ml-rb-font-sm:calc(var(--el-font-size-small) * var(--ml-rb-scale));--ml-rb-font-base:calc(var(--el-font-size-base) * var(--ml-rb-scale));--ml-rb-control-height:calc(var(--el-component-size-default) * var(--ml-rb-scale));--ml-rb-compact-height:calc(var(--el-component-size-small) * var(--ml-rb-scale));--ml-rb-select-padding-x:6px;--ml-rb-select-font-size:calc(13px * var(--ml-rb-scale));padding:8px!important}.ml-ribbon-overflow-popover.ml-ribbon-overflow-popover--size-small{--ml-rb-scale:.92;--ml-rb-select-padding-x:4px}.ml-ribbon-overflow-popover.ml-ribbon-overflow-popover--size-large{--ml-rb-scale:1.08;--ml-rb-select-padding-x:7px}.ml-ribbon-overflow-popover .ml-ribbon-group__content{overflow:visible}.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:hover,.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:focus-visible,.ml-ribbon-overflow-popover .el-button:hover,.ml-ribbon-overflow-popover .el-button:focus-visible{background:var(--ml-rb-hover-bg);border-color:var(--ml-rb-hover-border)}.ml-ribbon-overflow-popover .ml-ribbon__panel .el-button:active,.ml-ribbon-overflow-popover .el-button:active{background:var(--ml-rb-active-bg);border-color:var(--ml-rb-active-border)}.ml-ribbon-overflow-list{flex-direction:column;gap:8px;max-height:320px;display:flex;overflow:auto}.ml-ribbon-overflow-group{border:1px solid var(--ml-rb-border);background:var(--ml-rb-surface-soft);border-radius:6px;padding:6px}.ml-ribbon-overflow-group__header{font-size:var(--ml-rb-font-sm);color:var(--ml-rb-tab-text);margin-bottom:6px;font-weight:600}.ml-ribbon-backstage{--ml-rb-backstage-scale:1;--ml-rb-backstage-nav-width:calc(260px * var(--ml-rb-backstage-scale));--ml-rb-backstage-nav-padding:calc(16px * var(--ml-rb-backstage-scale));--ml-rb-backstage-content-padding:calc(24px * var(--ml-rb-backstage-scale));--ml-rb-backstage-title-size:calc(var(--el-font-size-extra-large) * var(--ml-rb-backstage-scale));--ml-rb-backstage-text-size:calc(var(--el-font-size-base) * var(--ml-rb-backstage-scale));grid-template-columns:var(--ml-rb-backstage-nav-width) 1fr;height:100%;display:grid}.ml-ribbon-backstage.ml-ribbon-backstage--size-small{--ml-rb-backstage-scale:.92}.ml-ribbon-backstage.ml-ribbon-backstage--size-large{--ml-rb-backstage-scale:1.08}.ml-ribbon-backstage__nav{border-right:1px solid var(--ml-rb-border);padding:var(--ml-rb-backstage-nav-padding)}.ml-ribbon-backstage__content{padding:var(--ml-rb-backstage-content-padding)}.ml-ribbon-backstage__content h2{font-size:var(--ml-rb-backstage-title-size);margin:0;line-height:1.2}.ml-ribbon-backstage__content p{margin-top:calc(10px * var(--ml-rb-backstage-scale));font-size:var(--ml-rb-backstage-text-size);line-height:1.6}.ml-ribbon-backstage__menu .el-menu-item{min-height:calc(36px * var(--ml-rb-backstage-scale));line-height:calc(36px * var(--ml-rb-backstage-scale));font-size:var(--ml-rb-backstage-text-size)}.ml-ribbon-keytips{z-index:5000;border:1px solid var(--ml-rb-keytip-border);background:var(--ml-rb-keytip-bg);border-radius:8px;align-items:center;gap:6px;padding:8px;display:flex;position:fixed;bottom:12px;right:12px}.ml-ribbon-keytip{border:1px solid var(--ml-rb-keytip-border);background:var(--ml-rb-surface);font-size:var(--ml-rb-font-sm);border-radius:4px;padding:2px 6px}@media (width<=960px){.ml-ribbon-backstage{grid-template-columns:1fr}}
|
|
2
2
|
/*$vite$:1*/
|
package/dist/ml-ribbon.es.js
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
1
|
import { Fragment as e, computed as t, createBlock as n, createCommentVNode as r, createElementBlock as i, createElementVNode as a, createSlots as o, createTextVNode as s, createVNode as c, defineComponent as l, inject as u, markRaw as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onMounted as h, onUnmounted as g, openBlock as _, provide as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, toRaw as w, unref as T, watch as E, withCtx as D, withModifiers as O } from "vue";
|
|
2
|
-
import { ElButton as k, ElButtonGroup as A, ElCheckbox as ee, ElColorPicker as te, ElConfigProvider as ne, ElDrawer as j, ElDropdown as M, ElDropdownItem as N, ElDropdownMenu as P, ElIcon as F, ElOption as I, ElPopover as
|
|
3
|
-
import { ArrowDown as
|
|
2
|
+
import { ElButton as k, ElButtonGroup as A, ElCheckbox as ee, ElColorPicker as te, ElConfigProvider as ne, ElDrawer as j, ElDropdown as M, ElDropdownItem as N, ElDropdownMenu as P, ElIcon as F, ElOption as I, ElPopover as L, ElSelect as R, ElSwitch as z, ElTooltip as re, useGlobalConfig as ie } from "element-plus";
|
|
3
|
+
import { ArrowDown as B, ArrowDownBold as V, ArrowUp as H, ArrowUpBold as ae, Grid as U, Menu as oe, Promotion as W } from "@element-plus/icons-vue";
|
|
4
4
|
//#region src/ribbon/context.ts
|
|
5
|
-
var
|
|
5
|
+
var se = Symbol("RibbonContext");
|
|
6
6
|
//#endregion
|
|
7
7
|
//#region src/ribbon/composables/useRibbonState.ts
|
|
8
|
-
function
|
|
8
|
+
function G(e) {
|
|
9
9
|
return e == null || typeof e == "string" ? e : typeof e == "object" || typeof e == "function" ? d(w(e)) : e;
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function ce(e) {
|
|
12
12
|
if (!e) return;
|
|
13
13
|
let t = { ...e };
|
|
14
|
-
return "icon" in t && (t.icon =
|
|
14
|
+
return "icon" in t && (t.icon = G(t.icon)), Array.isArray(t.options) && (t.options = t.options.map((e) => {
|
|
15
15
|
if (!e || typeof e != "object") return e;
|
|
16
16
|
let t = e;
|
|
17
17
|
return "icon" in t ? {
|
|
18
18
|
...t,
|
|
19
|
-
icon:
|
|
19
|
+
icon: G(t.icon)
|
|
20
20
|
} : t;
|
|
21
21
|
})), t;
|
|
22
22
|
}
|
|
23
23
|
function K(e) {
|
|
24
24
|
return {
|
|
25
25
|
...e,
|
|
26
|
-
icon:
|
|
27
|
-
props:
|
|
26
|
+
icon: G(e.icon),
|
|
27
|
+
props: ce(e.props)
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
function q(e) {
|
|
31
31
|
return {
|
|
32
32
|
...e,
|
|
33
|
-
icon:
|
|
33
|
+
icon: G(e.icon),
|
|
34
34
|
footerMenuItems: e.footerMenuItems?.map(K),
|
|
35
35
|
collections: e.collections?.map((e) => ({
|
|
36
36
|
...e,
|
|
@@ -246,7 +246,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
246
246
|
},
|
|
247
247
|
emits: ["select", "open-backstage"],
|
|
248
248
|
setup(o, { emit: l }) {
|
|
249
|
-
let u = l, d = y(!1), f =
|
|
249
|
+
let u = l, d = y(!1), f = ie("size", ""), m = t(() => f.value || "default"), h = t(() => `ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${m.value}`);
|
|
250
250
|
function g(e) {
|
|
251
251
|
d.value = e;
|
|
252
252
|
}
|
|
@@ -422,74 +422,74 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
422
422
|
},
|
|
423
423
|
emits: ["item-click"],
|
|
424
424
|
setup(o, { emit: l }) {
|
|
425
|
-
let d = o, f = l, m = u(
|
|
425
|
+
let d = o, f = l, m = u(se, null), h = t(() => Array.isArray(d.item.props?.options) ? d.item.props.options : []), g = ie("size", ""), v = t(() => g.value || "default"), w = t(() => `ml-ribbon-dropdown-menu ml-ribbon-popper ml-ribbon-popper--size-${v.value}`), E = t(() => `ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${v.value}`), A = t(() => d.item.props?.icon || (typeof d.item.icon == "string" || !d.item.icon ? null : d.item.icon)), ne = t(() => {
|
|
426
426
|
let e = d.item.props?.icon;
|
|
427
427
|
return typeof e == "string" && e.trim().length > 0 ? e : typeof d.item.icon == "string" && d.item.icon.trim().length > 0 ? d.item.icon : null;
|
|
428
|
-
}), j = t(() => d.item.hideLabel !== !0),
|
|
429
|
-
let e =
|
|
430
|
-
if (e) {
|
|
431
|
-
let t =
|
|
428
|
+
}), j = t(() => d.item.hideLabel !== !0), L = t(() => d.item.label || d.item.id), z = t(() => d.item.keyTip?.trim().toUpperCase() ?? ""), re = t(() => d.item.props?.syncLabelWithSelection === !0), V = y(!1), ae = y(void 0), U = t(() => h.value.find((e) => de(e) === ae.value) ?? null), oe = t(() => {
|
|
429
|
+
let e = U.value;
|
|
430
|
+
if (e && re.value) {
|
|
431
|
+
let t = fe(e);
|
|
432
432
|
if (t) return t;
|
|
433
433
|
}
|
|
434
434
|
return d.item.label ?? d.item.id;
|
|
435
|
-
}),
|
|
436
|
-
if (
|
|
437
|
-
let e =
|
|
435
|
+
}), W = t(() => {
|
|
436
|
+
if (U.value) {
|
|
437
|
+
let e = ue(U.value);
|
|
438
438
|
if (e) return e;
|
|
439
439
|
}
|
|
440
440
|
return A.value;
|
|
441
|
-
}),
|
|
442
|
-
if (
|
|
443
|
-
let e =
|
|
441
|
+
}), G = t(() => {
|
|
442
|
+
if (U.value) {
|
|
443
|
+
let e = Z(U.value);
|
|
444
444
|
if (e) return e;
|
|
445
445
|
}
|
|
446
|
-
return
|
|
447
|
-
}),
|
|
448
|
-
if (!m?.keyTipsOpen.value || !
|
|
446
|
+
return W.value ? null : ne.value;
|
|
447
|
+
}), ce = t(() => {
|
|
448
|
+
if (!m?.keyTipsOpen.value || !z.value) return !1;
|
|
449
449
|
let e = m.keyTipsSequence.value.toLowerCase();
|
|
450
|
-
return e ?
|
|
450
|
+
return e ? z.value.toLowerCase().startsWith(e) : !0;
|
|
451
451
|
});
|
|
452
|
-
function
|
|
452
|
+
function K() {
|
|
453
453
|
f("item-click", d.id);
|
|
454
454
|
}
|
|
455
|
-
function K(e) {
|
|
456
|
-
R.value = e;
|
|
457
|
-
}
|
|
458
455
|
function q(e) {
|
|
459
|
-
|
|
456
|
+
V.value = e;
|
|
460
457
|
}
|
|
461
|
-
function J() {
|
|
462
|
-
|
|
458
|
+
function J(e) {
|
|
459
|
+
ae.value = e, X(e), V.value = !1;
|
|
463
460
|
}
|
|
464
461
|
function Y() {
|
|
465
|
-
|
|
462
|
+
V.value = !V.value;
|
|
463
|
+
}
|
|
464
|
+
function le() {
|
|
465
|
+
let e = U.value;
|
|
466
466
|
if (!e) {
|
|
467
|
-
|
|
467
|
+
K();
|
|
468
468
|
return;
|
|
469
469
|
}
|
|
470
|
-
|
|
470
|
+
X(de(e));
|
|
471
471
|
}
|
|
472
|
-
function
|
|
472
|
+
function X(e) {
|
|
473
473
|
if (typeof e == "string" || typeof e == "number") {
|
|
474
474
|
f("item-click", String(e));
|
|
475
475
|
return;
|
|
476
476
|
}
|
|
477
|
-
|
|
477
|
+
K();
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function ue(e) {
|
|
480
480
|
if (!e || typeof e != "object") return null;
|
|
481
481
|
let t = e.icon;
|
|
482
482
|
return !t || typeof t == "string" ? null : t;
|
|
483
483
|
}
|
|
484
|
-
function
|
|
484
|
+
function Z(e) {
|
|
485
485
|
if (!e || typeof e != "object") return null;
|
|
486
486
|
let t = e.icon;
|
|
487
487
|
return typeof t != "string" || t.trim().length === 0 ? null : t;
|
|
488
488
|
}
|
|
489
|
-
function
|
|
489
|
+
function de(e) {
|
|
490
490
|
if (!(!e || typeof e != "object")) return e.value;
|
|
491
491
|
}
|
|
492
|
-
function
|
|
492
|
+
function fe(e) {
|
|
493
493
|
if (!e || typeof e != "object") return;
|
|
494
494
|
let t = e.label;
|
|
495
495
|
return typeof t == "string" ? t : void 0;
|
|
@@ -502,14 +502,14 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
502
502
|
]]),
|
|
503
503
|
"data-item-id": o.id,
|
|
504
504
|
role: "group"
|
|
505
|
-
}, [
|
|
505
|
+
}, [ce.value ? (_(), i("span", Ie, C(z.value), 1)) : r("", !0), o.item.type === "groupButton" ? (_(), n($, {
|
|
506
506
|
key: 1,
|
|
507
507
|
id: o.item.id,
|
|
508
508
|
label: o.item.label ?? "",
|
|
509
509
|
options: o.item.props?.options ?? [],
|
|
510
510
|
multiple: !!o.item.props?.multiple,
|
|
511
511
|
disabled: o.item.disabled,
|
|
512
|
-
onChange:
|
|
512
|
+
onChange: K
|
|
513
513
|
}, null, 8, [
|
|
514
514
|
"id",
|
|
515
515
|
"label",
|
|
@@ -523,7 +523,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
523
523
|
categories: o.item.props?.categories ?? [],
|
|
524
524
|
"preview-fallback": d.galleryPreviewFallback,
|
|
525
525
|
disabled: o.item.disabled,
|
|
526
|
-
onSelect:
|
|
526
|
+
onSelect: K
|
|
527
527
|
}, null, 8, [
|
|
528
528
|
"id",
|
|
529
529
|
"label",
|
|
@@ -542,23 +542,23 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
542
542
|
trigger: "click",
|
|
543
543
|
disabled: o.item.disabled,
|
|
544
544
|
"popper-class": w.value,
|
|
545
|
-
onVisibleChange:
|
|
546
|
-
onCommand:
|
|
545
|
+
onVisibleChange: q,
|
|
546
|
+
onCommand: J
|
|
547
547
|
}, {
|
|
548
548
|
dropdown: D(() => [c(T(P), null, {
|
|
549
549
|
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(N), {
|
|
550
550
|
key: String(e.value),
|
|
551
551
|
command: e.value
|
|
552
552
|
}, {
|
|
553
|
-
default: D(() => [a("span", Be, [
|
|
553
|
+
default: D(() => [a("span", Be, [ue(e) ? (_(), n(T(F), {
|
|
554
554
|
key: 0,
|
|
555
555
|
class: "ml-ribbon-dropdown-item__icon"
|
|
556
556
|
}, {
|
|
557
|
-
default: D(() => [(_(), n(S(
|
|
557
|
+
default: D(() => [(_(), n(S(ue(e))))]),
|
|
558
558
|
_: 2
|
|
559
|
-
}, 1024)) :
|
|
559
|
+
}, 1024)) : Z(e) ? (_(), i("i", {
|
|
560
560
|
key: 1,
|
|
561
|
-
class: p(["ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class",
|
|
561
|
+
class: p(["ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class", Z(e)]),
|
|
562
562
|
"aria-hidden": "true"
|
|
563
563
|
}, null, 2)) : r("", !0), a("span", Ve, C(e.label), 1)])]),
|
|
564
564
|
_: 2
|
|
@@ -567,25 +567,25 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
567
567
|
})]),
|
|
568
568
|
default: D(() => [c(T(k), {
|
|
569
569
|
type: "default",
|
|
570
|
-
"aria-label":
|
|
571
|
-
onClick:
|
|
570
|
+
"aria-label": L.value,
|
|
571
|
+
onClick: Y
|
|
572
572
|
}, {
|
|
573
|
-
default: D(() => [a("span", Le, [
|
|
573
|
+
default: D(() => [a("span", Le, [W.value ? (_(), i("span", {
|
|
574
574
|
key: 0,
|
|
575
575
|
class: "ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary",
|
|
576
|
-
onClick: O(
|
|
576
|
+
onClick: O(le, ["stop"])
|
|
577
577
|
}, [c(T(F), null, {
|
|
578
|
-
default: D(() => [(_(), n(S(
|
|
578
|
+
default: D(() => [(_(), n(S(W.value)))]),
|
|
579
579
|
_: 1
|
|
580
|
-
})])) :
|
|
580
|
+
})])) : G.value ? (_(), i("span", {
|
|
581
581
|
key: 1,
|
|
582
582
|
class: "ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-item-host__icon--dropdown-primary",
|
|
583
|
-
onClick: O(
|
|
583
|
+
onClick: O(le, ["stop"])
|
|
584
584
|
}, [a("i", {
|
|
585
|
-
class: p(
|
|
585
|
+
class: p(G.value),
|
|
586
586
|
"aria-hidden": "true"
|
|
587
|
-
}, null, 2)])) : r("", !0), a("span", Re, [j.value ? (_(), i("span", ze, C(
|
|
588
|
-
default: D(() => [(_(), n(S(
|
|
587
|
+
}, null, 2)])) : r("", !0), a("span", Re, [j.value ? (_(), i("span", ze, C(oe.value), 1)) : r("", !0), c(T(F), { class: p(["ml-ribbon-item-host__dropdown-arrow", { "is-open": V.value }]) }, {
|
|
588
|
+
default: D(() => [(_(), n(S(V.value ? T(H) : T(B))))]),
|
|
589
589
|
_: 1
|
|
590
590
|
}, 8, ["class"])])])]),
|
|
591
591
|
_: 1
|
|
@@ -594,20 +594,20 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
594
594
|
}, 8, ["disabled", "popper-class"])) : o.item.type === "checkbox" ? (_(), n(T(ee), {
|
|
595
595
|
key: 5,
|
|
596
596
|
disabled: o.item.disabled,
|
|
597
|
-
onChange:
|
|
597
|
+
onChange: K
|
|
598
598
|
}, {
|
|
599
599
|
default: D(() => [s(C(o.item.label), 1)]),
|
|
600
600
|
_: 1
|
|
601
601
|
}, 8, ["disabled"])) : o.item.type === "colorPicker" ? (_(), n(T(te), {
|
|
602
602
|
key: 6,
|
|
603
603
|
disabled: o.item.disabled,
|
|
604
|
-
onChange:
|
|
605
|
-
}, null, 8, ["disabled"])) : o.item.type === "comboBox" ? (_(), n(T(
|
|
604
|
+
onChange: K
|
|
605
|
+
}, null, 8, ["disabled"])) : o.item.type === "comboBox" ? (_(), n(T(R), {
|
|
606
606
|
key: 7,
|
|
607
607
|
disabled: o.item.disabled,
|
|
608
608
|
"popper-class": E.value,
|
|
609
609
|
style: { width: "92px" },
|
|
610
|
-
onChange:
|
|
610
|
+
onChange: K
|
|
611
611
|
}, {
|
|
612
612
|
default: D(() => [(_(!0), i(e, null, b(h.value, (e) => (_(), n(T(I), {
|
|
613
613
|
key: String(e.value),
|
|
@@ -618,8 +618,8 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
618
618
|
}, 8, ["disabled", "popper-class"])) : (_(), n(T(k), {
|
|
619
619
|
key: 8,
|
|
620
620
|
disabled: o.item.disabled,
|
|
621
|
-
"aria-label":
|
|
622
|
-
onClick:
|
|
621
|
+
"aria-label": L.value,
|
|
622
|
+
onClick: K
|
|
623
623
|
}, {
|
|
624
624
|
default: D(() => [A.value ? (_(), n(T(F), {
|
|
625
625
|
key: 0,
|
|
@@ -692,13 +692,13 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
692
692
|
},
|
|
693
693
|
emits: ["item-click"],
|
|
694
694
|
setup(e, { emit: o }) {
|
|
695
|
-
let s = e, l = o, u = t(() => s.autoWidth !== !1), d = y(null), m = y([]), v = y(null), b = y(null), w = y(0), O = y(0), A =
|
|
695
|
+
let s = e, l = o, u = t(() => s.autoWidth !== !1), d = y(null), m = y([]), v = y(null), b = y(null), w = y(0), O = y(0), A = ie("size", ""), ee = t(() => A.value || "default"), te = t(() => `ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${ee.value}`), ne = t(() => ({ modifiers: [{
|
|
696
696
|
name: "offset",
|
|
697
697
|
options: { offset: [w.value, 8] }
|
|
698
698
|
}] })), j = t(() => ({ modifiers: [{
|
|
699
699
|
name: "offset",
|
|
700
700
|
options: { offset: [O.value, 8] }
|
|
701
|
-
}] })), M = t(() => !s.icon || typeof s.icon == "string" ? null : s.icon), N = t(() => m.value.length > 0), P = t(() => (s.groupModel?.footerMenuItems?.length ?? 0) > 0), I = y(!1),
|
|
701
|
+
}] })), M = t(() => !s.icon || typeof s.icon == "string" ? null : s.icon), N = t(() => m.value.length > 0), P = t(() => (s.groupModel?.footerMenuItems?.length ?? 0) > 0), I = y(!1), R = y(!1), z = t(() => {
|
|
702
702
|
if (!s.groupModel || !m.value.length) return null;
|
|
703
703
|
let e = new Set(m.value), t = s.groupModel.collections?.map((t) => ({
|
|
704
704
|
...t,
|
|
@@ -708,7 +708,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
708
708
|
...s.groupModel,
|
|
709
709
|
collections: t
|
|
710
710
|
} : null;
|
|
711
|
-
}),
|
|
711
|
+
}), re = t(() => s.groupModel?.footerMenuItems?.length ? {
|
|
712
712
|
id: `${s.groupModel.id}-footer-menu`,
|
|
713
713
|
title: "",
|
|
714
714
|
orientation: "row",
|
|
@@ -718,7 +718,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
718
718
|
items: s.groupModel.footerMenuItems
|
|
719
719
|
}]
|
|
720
720
|
} : null);
|
|
721
|
-
function
|
|
721
|
+
function V() {
|
|
722
722
|
let e = d.value?.querySelector(".ml-ribbon-group__content");
|
|
723
723
|
if (!e) {
|
|
724
724
|
m.value.length > 0 && (m.value = []);
|
|
@@ -737,12 +737,12 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
737
737
|
(i.right - t.right > .5 || i.bottom - t.bottom > .5 || t.left - i.left > .5 || t.top - i.top > .5) && n.push(r);
|
|
738
738
|
}), m.value.length === n.length && m.value.every((e, t) => e === n[t]) || (m.value = n);
|
|
739
739
|
}
|
|
740
|
-
function
|
|
740
|
+
function ae() {
|
|
741
741
|
f(() => {
|
|
742
|
-
Y(),
|
|
742
|
+
Y(), U(), oe(), V();
|
|
743
743
|
});
|
|
744
744
|
}
|
|
745
|
-
function
|
|
745
|
+
function U() {
|
|
746
746
|
let e = d.value?.getBoundingClientRect(), t = v.value?.getBoundingClientRect();
|
|
747
747
|
if (!e || !t) {
|
|
748
748
|
w.value !== 0 && (w.value = 0);
|
|
@@ -751,7 +751,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
751
751
|
let n = Math.round(e.left - t.left);
|
|
752
752
|
w.value !== n && (w.value = n);
|
|
753
753
|
}
|
|
754
|
-
function
|
|
754
|
+
function oe() {
|
|
755
755
|
let e = d.value?.getBoundingClientRect(), t = b.value?.getBoundingClientRect();
|
|
756
756
|
if (!e || !t) {
|
|
757
757
|
O.value !== 0 && (O.value = 0);
|
|
@@ -760,17 +760,17 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
760
760
|
let n = Math.round(e.left - t.left);
|
|
761
761
|
O.value !== n && (O.value = n);
|
|
762
762
|
}
|
|
763
|
-
function
|
|
763
|
+
function se(e) {
|
|
764
764
|
I.value = e;
|
|
765
765
|
}
|
|
766
|
-
function
|
|
767
|
-
|
|
766
|
+
function G(e) {
|
|
767
|
+
R.value = e;
|
|
768
768
|
}
|
|
769
|
-
function
|
|
769
|
+
function ce() {
|
|
770
770
|
I.value = !I.value;
|
|
771
771
|
}
|
|
772
772
|
function K() {
|
|
773
|
-
|
|
773
|
+
R.value = !R.value;
|
|
774
774
|
}
|
|
775
775
|
let q = null, J = null;
|
|
776
776
|
function Y() {
|
|
@@ -779,11 +779,11 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
779
779
|
J !== e && (J && q.unobserve(J), e && q.observe(e), J = e);
|
|
780
780
|
}
|
|
781
781
|
return E(() => s.groupModel, () => {
|
|
782
|
-
|
|
782
|
+
ae();
|
|
783
783
|
}, { deep: !0 }), h(() => {
|
|
784
784
|
typeof ResizeObserver < "u" && (q = new ResizeObserver(() => {
|
|
785
|
-
|
|
786
|
-
}), d.value && q.observe(d.value), Y()),
|
|
785
|
+
U(), oe(), V();
|
|
786
|
+
}), d.value && q.observe(d.value), Y()), ae();
|
|
787
787
|
}), g(() => {
|
|
788
788
|
q?.disconnect();
|
|
789
789
|
}), (t, o) => (_(), i("section", {
|
|
@@ -800,14 +800,14 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
800
800
|
_: 1
|
|
801
801
|
})) : r("", !0),
|
|
802
802
|
a("span", Je, C(e.title), 1),
|
|
803
|
-
P.value &&
|
|
803
|
+
P.value && re.value ? (_(), n(T(L), {
|
|
804
804
|
key: 1,
|
|
805
805
|
trigger: "click",
|
|
806
806
|
placement: "bottom-start",
|
|
807
807
|
"popper-class": te.value,
|
|
808
808
|
"popper-options": j.value,
|
|
809
|
-
onShow: o[1] ||= (e) =>
|
|
810
|
-
onHide: o[2] ||= (e) =>
|
|
809
|
+
onShow: o[1] ||= (e) => se(!0),
|
|
810
|
+
onHide: o[2] ||= (e) => se(!1)
|
|
811
811
|
}, {
|
|
812
812
|
reference: D(() => [a("button", {
|
|
813
813
|
ref_key: "footerTriggerRef",
|
|
@@ -816,41 +816,41 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
816
816
|
class: p(["ml-ribbon-group__footer-trigger", { "is-open": I.value }]),
|
|
817
817
|
"aria-label": e.overflowTriggerAriaLabel,
|
|
818
818
|
"aria-expanded": I.value,
|
|
819
|
-
onClick:
|
|
819
|
+
onClick: ce
|
|
820
820
|
}, [c(T(F), null, {
|
|
821
|
-
default: D(() => [(_(), n(S(I.value ? T(
|
|
821
|
+
default: D(() => [(_(), n(S(I.value ? T(H) : T(B))))]),
|
|
822
822
|
_: 1
|
|
823
823
|
})], 10, Ye)]),
|
|
824
824
|
default: D(() => [a("div", Xe, [c(We, {
|
|
825
|
-
group:
|
|
825
|
+
group: re.value,
|
|
826
826
|
"gallery-preview-fallback": e.galleryPreviewFallback,
|
|
827
827
|
onItemClick: o[0] ||= (e) => l("item-click", e)
|
|
828
828
|
}, null, 8, ["group", "gallery-preview-fallback"])])]),
|
|
829
829
|
_: 1
|
|
830
830
|
}, 8, ["popper-class", "popper-options"])) : r("", !0),
|
|
831
|
-
N.value &&
|
|
831
|
+
N.value && z.value ? (_(), n(T(L), {
|
|
832
832
|
key: 2,
|
|
833
833
|
trigger: "click",
|
|
834
834
|
placement: "bottom-start",
|
|
835
835
|
"popper-class": te.value,
|
|
836
836
|
"popper-options": ne.value,
|
|
837
|
-
onShow: o[4] ||= (e) =>
|
|
838
|
-
onHide: o[5] ||= (e) =>
|
|
837
|
+
onShow: o[4] ||= (e) => G(!0),
|
|
838
|
+
onHide: o[5] ||= (e) => G(!1)
|
|
839
839
|
}, {
|
|
840
840
|
reference: D(() => [a("button", {
|
|
841
841
|
ref_key: "overflowTriggerRef",
|
|
842
842
|
ref: v,
|
|
843
843
|
type: "button",
|
|
844
|
-
class: p(["ml-ribbon-group__overflow-trigger", { "is-open":
|
|
844
|
+
class: p(["ml-ribbon-group__overflow-trigger", { "is-open": R.value }]),
|
|
845
845
|
"aria-label": e.overflowTriggerAriaLabel,
|
|
846
|
-
"aria-expanded":
|
|
846
|
+
"aria-expanded": R.value,
|
|
847
847
|
onClick: K
|
|
848
848
|
}, [c(T(F), null, {
|
|
849
|
-
default: D(() => [(_(), n(S(
|
|
849
|
+
default: D(() => [(_(), n(S(R.value ? T(H) : T(B))))]),
|
|
850
850
|
_: 1
|
|
851
851
|
})], 10, Ze)]),
|
|
852
852
|
default: D(() => [a("div", Qe, [c(We, {
|
|
853
|
-
group:
|
|
853
|
+
group: z.value,
|
|
854
854
|
"gallery-preview-fallback": e.galleryPreviewFallback,
|
|
855
855
|
onItemClick: o[3] ||= (e) => l("item-click", e)
|
|
856
856
|
}, null, 8, ["group", "gallery-preview-fallback"])])]),
|
|
@@ -862,7 +862,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
862
862
|
class: "ml-ribbon-group__launcher"
|
|
863
863
|
}, {
|
|
864
864
|
default: D(() => [c(T(F), null, {
|
|
865
|
-
default: D(() => [c(T(
|
|
865
|
+
default: D(() => [c(T(W))]),
|
|
866
866
|
_: 1
|
|
867
867
|
})]),
|
|
868
868
|
_: 1
|
|
@@ -983,7 +983,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
983
983
|
contextualTabDefaultTitle: "Contextual",
|
|
984
984
|
galleryPreviewFallback: "Preview unavailable"
|
|
985
985
|
}, M = s, N = u, { context: P, visibleTabs: I } = ue(M.id, M.tabs, M.activeLayout ? String(M.activeLayout).toLowerCase() === "simplified" ? "simplified" : "classic" : M.layout, M.minimized, M.activeTab || M.tabs[0]?.id || "");
|
|
986
|
-
v(
|
|
986
|
+
v(se, P), E(() => M.tabs, (e) => {
|
|
987
987
|
P.tabs.value = te(e), P.tabs.value.some((e) => e.id === P.activeTab.value) || (P.activeTab.value = P.tabs.value[0]?.id || "");
|
|
988
988
|
}, { deep: !0 }), E(() => M.layout, (e) => {
|
|
989
989
|
e !== P.layout.value && (P.layout.value = e);
|
|
@@ -1006,7 +1006,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1006
1006
|
}), E(P.backdropOpen, (e) => {
|
|
1007
1007
|
N(e ? "backstageOpen" : "backstageClose");
|
|
1008
1008
|
});
|
|
1009
|
-
let
|
|
1009
|
+
let R = t(() => I.value.find((e) => e.id === P.activeTab.value)), B = t(() => R.value?.groups?.filter((e) => e.visible !== !1) ?? []), H = y(null), W = y(/* @__PURE__ */ new Set()), G = y({}), ce = ie("size", ""), K = t(() => M.size || ce.value || "default"), q = t(() => `ml-ribbon-group-popover ml-ribbon-group-popover--size-${K.value}`), J = t(() => `ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${K.value}`), Y = t(() => ({
|
|
1010
1010
|
layoutSwitcherTooltip: M.texts.layoutSwitcherTooltip || j.layoutSwitcherTooltip,
|
|
1011
1011
|
minimizeTooltip: M.texts.minimizeTooltip || j.minimizeTooltip,
|
|
1012
1012
|
keyTipsToggleText: M.texts.keyTipsToggleText || j.keyTipsToggleText,
|
|
@@ -1021,10 +1021,10 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1021
1021
|
keyTipsEmptySequence: M.texts.keyTipsEmptySequence || j.keyTipsEmptySequence,
|
|
1022
1022
|
contextualTabDefaultTitle: M.texts.contextualTabDefaultTitle || j.contextualTabDefaultTitle,
|
|
1023
1023
|
galleryPreviewFallback: M.texts.galleryPreviewFallback || j.galleryPreviewFallback
|
|
1024
|
-
})), le = t(() => P.minimized.value ?
|
|
1024
|
+
})), le = t(() => P.minimized.value ? ae : V), X = t(() => B.value.filter((e) => !W.value.has(e.id))), Z = t(() => B.value.filter((e) => W.value.has(e.id))), de = t(() => {
|
|
1025
1025
|
if (!Z.value.length) return 220;
|
|
1026
1026
|
let e = Z.value.reduce((e, t) => {
|
|
1027
|
-
let n =
|
|
1027
|
+
let n = G.value[t.id] ?? he(t);
|
|
1028
1028
|
return Math.max(e, n);
|
|
1029
1029
|
}, 0), t = Math.ceil(e + 40);
|
|
1030
1030
|
return Math.max(220, Math.min(720, t));
|
|
@@ -1065,19 +1065,19 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1065
1065
|
}
|
|
1066
1066
|
function ve() {
|
|
1067
1067
|
if (P.layout.value !== "classic") {
|
|
1068
|
-
|
|
1068
|
+
W.value = /* @__PURE__ */ new Set();
|
|
1069
1069
|
return;
|
|
1070
1070
|
}
|
|
1071
|
-
let e =
|
|
1071
|
+
let e = H.value;
|
|
1072
1072
|
if (!e) return;
|
|
1073
|
-
let t =
|
|
1073
|
+
let t = B.value;
|
|
1074
1074
|
if (!t.length) {
|
|
1075
|
-
|
|
1075
|
+
W.value = /* @__PURE__ */ new Set();
|
|
1076
1076
|
return;
|
|
1077
1077
|
}
|
|
1078
1078
|
let n = Math.round(e.getBoundingClientRect().width), r = _e(e), i = ge(e);
|
|
1079
|
-
|
|
1080
|
-
...
|
|
1079
|
+
G.value = {
|
|
1080
|
+
...G.value,
|
|
1081
1081
|
...i
|
|
1082
1082
|
};
|
|
1083
1083
|
let a = t.filter((e) => e.enableGroupOverflow === !1), o = t.filter((e) => e.enableGroupOverflow !== !1).map((e, t) => ({
|
|
@@ -1091,7 +1091,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1091
1091
|
let e = c[p].group;
|
|
1092
1092
|
s.add(e.id), p += 1;
|
|
1093
1093
|
}
|
|
1094
|
-
|
|
1094
|
+
W.value = s;
|
|
1095
1095
|
}
|
|
1096
1096
|
function ye() {
|
|
1097
1097
|
f(() => {
|
|
@@ -1099,11 +1099,11 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1099
1099
|
ve();
|
|
1100
1100
|
return;
|
|
1101
1101
|
}
|
|
1102
|
-
if (
|
|
1102
|
+
if (W.value.size === 0) {
|
|
1103
1103
|
ve();
|
|
1104
1104
|
return;
|
|
1105
1105
|
}
|
|
1106
|
-
|
|
1106
|
+
W.value = /* @__PURE__ */ new Set(), f(() => {
|
|
1107
1107
|
ve();
|
|
1108
1108
|
});
|
|
1109
1109
|
});
|
|
@@ -1137,7 +1137,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1137
1137
|
return t === "INPUT" || t === "TEXTAREA" || t === "SELECT";
|
|
1138
1138
|
}
|
|
1139
1139
|
function ke() {
|
|
1140
|
-
let e =
|
|
1140
|
+
let e = R.value;
|
|
1141
1141
|
if (!e?.groups?.length) {
|
|
1142
1142
|
P.keyTips.value = [];
|
|
1143
1143
|
return;
|
|
@@ -1155,7 +1155,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1155
1155
|
P.keyTips.value = t;
|
|
1156
1156
|
}
|
|
1157
1157
|
function Ae(e) {
|
|
1158
|
-
let t =
|
|
1158
|
+
let t = R.value;
|
|
1159
1159
|
if (t?.groups?.length) {
|
|
1160
1160
|
for (let n of t.groups) if (n.visible !== !1) for (let t of n.collections ?? []) {
|
|
1161
1161
|
let r = t.items.find((t) => t.id === e.targetId && t.disabled !== !0);
|
|
@@ -1199,29 +1199,29 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1199
1199
|
}
|
|
1200
1200
|
}
|
|
1201
1201
|
function Me(e) {
|
|
1202
|
-
return e.icon && typeof e.icon != "string" ? e.icon : e.groupIconCss ?
|
|
1202
|
+
return e.icon && typeof e.icon != "string" ? e.icon : e.groupIconCss ? U : null;
|
|
1203
1203
|
}
|
|
1204
1204
|
E([
|
|
1205
|
-
|
|
1205
|
+
B,
|
|
1206
1206
|
() => P.layout.value,
|
|
1207
1207
|
() => P.minimized.value
|
|
1208
1208
|
], () => {
|
|
1209
1209
|
ye();
|
|
1210
|
-
}), E([
|
|
1210
|
+
}), E([R, () => P.tabs.value], () => {
|
|
1211
1211
|
ke(), Q();
|
|
1212
1212
|
}, {
|
|
1213
1213
|
deep: !0,
|
|
1214
1214
|
immediate: !0
|
|
1215
1215
|
}), E(() => P.keyTipsOpen.value, (e) => {
|
|
1216
1216
|
e || Q();
|
|
1217
|
-
}), E(
|
|
1217
|
+
}), E(H, (e, t) => {
|
|
1218
1218
|
t && $ && $.unobserve(t), e && $ && $.observe(e);
|
|
1219
1219
|
}, { flush: "post" });
|
|
1220
1220
|
let $ = null;
|
|
1221
1221
|
return h(() => {
|
|
1222
1222
|
window.addEventListener("keydown", je), typeof ResizeObserver < "u" && ($ = new ResizeObserver(() => {
|
|
1223
1223
|
ye();
|
|
1224
|
-
}),
|
|
1224
|
+
}), H.value && $.observe(H.value)), ye();
|
|
1225
1225
|
}), g(() => {
|
|
1226
1226
|
window.removeEventListener("keydown", je), $?.disconnect();
|
|
1227
1227
|
}), l(P.api), (t, l) => (_(), n(T(ne), { size: M.size }, {
|
|
@@ -1258,7 +1258,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1258
1258
|
"active-tab",
|
|
1259
1259
|
"default-contextual-title"
|
|
1260
1260
|
]),
|
|
1261
|
-
M.hideMinimizeButton ? r("", !0) : (_(), n(T(
|
|
1261
|
+
M.hideMinimizeButton ? r("", !0) : (_(), n(T(re), {
|
|
1262
1262
|
key: 1,
|
|
1263
1263
|
content: Y.value.minimizeTooltip
|
|
1264
1264
|
}, {
|
|
@@ -1274,19 +1274,19 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1274
1274
|
_: 1
|
|
1275
1275
|
}, 8, ["content"]))
|
|
1276
1276
|
]), a("div", nt, [
|
|
1277
|
-
M.hideLayoutSwitcher ? r("", !0) : (_(), n(T(
|
|
1277
|
+
M.hideLayoutSwitcher ? r("", !0) : (_(), n(T(re), {
|
|
1278
1278
|
key: 0,
|
|
1279
1279
|
content: Y.value.layoutSwitcherTooltip
|
|
1280
1280
|
}, {
|
|
1281
1281
|
default: D(() => [c(T(k), {
|
|
1282
1282
|
circle: "",
|
|
1283
1283
|
class: "ml-ribbon__control ml-ribbon__control--layout",
|
|
1284
|
-
icon: T(
|
|
1284
|
+
icon: T(oe),
|
|
1285
1285
|
onClick: Ce
|
|
1286
1286
|
}, null, 8, ["icon"])]),
|
|
1287
1287
|
_: 1
|
|
1288
1288
|
}, 8, ["content"])),
|
|
1289
|
-
M.hideKeyTipsToggle ? r("", !0) : (_(), n(T(
|
|
1289
|
+
M.hideKeyTipsToggle ? r("", !0) : (_(), n(T(z), {
|
|
1290
1290
|
key: 1,
|
|
1291
1291
|
"inline-prompt": "",
|
|
1292
1292
|
class: "ml-ribbon__control ml-ribbon__control--keytips",
|
|
@@ -1305,12 +1305,12 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1305
1305
|
minimized: T(P).minimized.value
|
|
1306
1306
|
})])) : r("", !0)
|
|
1307
1307
|
])]),
|
|
1308
|
-
!T(P).minimized.value &&
|
|
1308
|
+
!T(P).minimized.value && R.value && T(P).layout.value === "classic" ? (_(), i("main", {
|
|
1309
1309
|
key: 0,
|
|
1310
1310
|
class: "ml-ribbon__panel",
|
|
1311
|
-
"data-active-tab":
|
|
1311
|
+
"data-active-tab": R.value.id,
|
|
1312
1312
|
ref_key: "classicPanelRef",
|
|
1313
|
-
ref:
|
|
1313
|
+
ref: H
|
|
1314
1314
|
}, [(_(!0), i(e, null, b(X.value, (e) => (_(), n($e, {
|
|
1315
1315
|
id: e.id,
|
|
1316
1316
|
key: e.id,
|
|
@@ -1348,7 +1348,7 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1348
1348
|
"group-model",
|
|
1349
1349
|
"overflow-trigger-aria-label",
|
|
1350
1350
|
"gallery-preview-fallback"
|
|
1351
|
-
]))), 128)), Z.value.length ? (_(), i("section", at, [a("div", ot, [c(T(
|
|
1351
|
+
]))), 128)), Z.value.length ? (_(), i("section", at, [a("div", ot, [c(T(L), {
|
|
1352
1352
|
trigger: "click",
|
|
1353
1353
|
placement: "bottom-end",
|
|
1354
1354
|
width: de.value,
|
|
@@ -1371,11 +1371,11 @@ var Z = { class: "ml-ribbon-backstage__nav" }, de = { class: "ml-ribbon-backstag
|
|
|
1371
1371
|
}, null, 8, ["group", "gallery-preview-fallback"])]))), 128))])]),
|
|
1372
1372
|
_: 1
|
|
1373
1373
|
}, 8, ["width", "popper-class"])]), l[9] ||= a("footer", { class: "ml-ribbon-group__footer ml-ribbon-group__footer--overflow" }, null, -1)])) : r("", !0)], 8, it)) : r("", !0),
|
|
1374
|
-
!T(P).minimized.value &&
|
|
1374
|
+
!T(P).minimized.value && R.value && T(P).layout.value === "simplified" ? (_(), i("main", {
|
|
1375
1375
|
key: 1,
|
|
1376
1376
|
class: "ml-ribbon__panel ml-ribbon__panel--simplified",
|
|
1377
|
-
"data-active-tab":
|
|
1378
|
-
}, [(_(!0), i(e, null, b(
|
|
1377
|
+
"data-active-tab": R.value.id
|
|
1378
|
+
}, [(_(!0), i(e, null, b(B.value, (e) => (_(), n(T(L), {
|
|
1379
1379
|
key: e.id,
|
|
1380
1380
|
trigger: "click",
|
|
1381
1381
|
placement: "bottom-start",
|
package/dist/ml-ribbon.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`element-plus`),require(`@element-plus/icons-vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`element-plus`,`@element-plus/icons-vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MlRibbon={},e.Vue,e.ElementPlus,e.ElementPlusIconsVue))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Symbol(`RibbonContext`);function a(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function o(e){if(!e)return;let t={...e};return`icon`in t&&(t.icon=a(t.icon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:a(t.icon)}:t})),t}function s(e){return{...e,icon:a(e.icon),props:o(e.props)}}function c(e){return{...e,icon:a(e.icon),footerMenuItems:e.footerMenuItems?.map(s),collections:e.collections?.map(e=>({...e,items:e.items.map(s)}))}}function l(e){return{...e,groups:e.groups?.map(c)}}function u(e){return e.map(l)}function d(e){(!e.collections||e.collections.length===0)&&(e.collections=[{id:`${e.id}-collection-1`,items:[]}])}function f(e,t,n,r,i){let a=e.find(e=>e.id===t);if(!a?.groups)return;let o=a.groups.find(e=>e.id===n);if(!o?.collections)return;let s=o.collections.find(e=>e.id===r);s&&i(s.items)}function p(e,n,r,i,a){let o=(0,t.ref)(r),p=(0,t.ref)(i),m=(0,t.ref)(a),h=(0,t.ref)(u(n)),g=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)([]),b=(0,t.ref)(``),x=(0,t.computed)(()=>h.value.filter(e=>e.visible!==!1)),S={addTab(e){h.value.push(l(e)),m.value||=e.id},removeTab(e){h.value=h.value.filter(t=>t.id!==e),m.value===e&&(m.value=x.value[0]?.id??``)},showTab(e){let t=h.value.find(t=>t.id===e);t&&(t.visible=!0)},hideTab(e){let t=h.value.find(t=>t.id===e);t&&(t.visible=!1)},selectTab(e){m.value=e},addGroup(e,t){let n=h.value.find(t=>t.id===e);n&&(n.groups??=[],d(t),n.groups.push(c(t)))},removeGroup(e,t){let n=h.value.find(t=>t.id===e);n?.groups&&(n.groups=n.groups.filter(e=>e.id!==t))},showGroup(e,t){let n=h.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!0)},hideGroup(e,t){let n=h.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!1)},addItem(e,t,n,r){f(h.value,e,t,n,e=>e.push(s(r)))},removeItem(e,t,n,r){f(h.value,e,t,n,e=>{let t=e.findIndex(e=>e.id===r);t>=0&&e.splice(t,1)})},updateItem(e,t,n,r,i){f(h.value,e,t,n,e=>{let t=e.find(e=>e.id===r);t&&Object.assign(t,i)})},enableItem(e,t,n,r){S.updateItem(e,t,n,r,{disabled:!1})},disableItem(e,t,n,r){S.updateItem(e,t,n,r,{disabled:!0})},refreshLayout(){g.value=!1},minimize(e){p.value=e},toggleSimplified(){o.value=o.value===`classic`?`simplified`:`classic`}};return{context:{id:e,layout:o,minimized:p,activeTab:m,tabs:h,overflowOpen:g,backdropOpen:_,keyTipsOpen:v,keyTips:y,keyTipsSequence:b,registerKeyTip:e=>{y.value.some(t=>t.id===e.id)||y.value.push(e)},unregisterKeyTip:e=>{y.value=y.value.filter(t=>t.id!==e)},api:S},visibleTabs:x}}var m={class:`ml-ribbon-backstage__nav`},h={class:`ml-ribbon-backstage__content`},g={key:0},_={key:1},v=(0,t.defineComponent)({__name:`RibbonBackstage`,props:{open:{type:Boolean},backLabel:{},title:{},description:{},size:{default:`default`}},emits:[`close`],setup(e,{emit:r}){let i=e,a=r;function o(){a(`close`)}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDrawer),{"model-value":i.open,size:`100%`,"with-header":!1,direction:`ltr`,onClose:o},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-backstage`,`ml-ribbon-backstage--size-${i.size||`default`}`])},[e.$slots.default?(0,t.renderSlot)(e.$slots,`default`,{key:0,close:o,backLabel:i.backLabel,title:i.title,description:i.description,size:i.size}):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`aside`,m,[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`primary`,onClick:o},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.backLabel),1)]),_:1})]),(0,t.createElementVNode)(`section`,h,[i.title?((0,t.openBlock)(),(0,t.createElementBlock)(`h2`,g,(0,t.toDisplayString)(i.title),1)):(0,t.createCommentVNode)(``,!0),i.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,_,(0,t.toDisplayString)(i.description),1)):(0,t.createCommentVNode)(``,!0)])],64))],2)]),_:3},8,[`model-value`]))}}),y={class:`ml-ribbon-tabs`,role:`tablist`},b=[`aria-selected`,`onClick`],x=(0,t.defineComponent)({__name:`RibbonTabs`,props:{tabs:{},activeTab:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>r.tabs.filter(e=>e.visible!==!1));return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab`,{"is-active":e.activeTab===n.id}]),role:`tab`,"aria-selected":e.activeTab===n.id,onClick:e=>i(`select`,n.id)},(0,t.toDisplayString)(n.title),11,b))),128))]))}}),S={class:`ml-ribbon-contextual-tabs`},C={class:`ml-ribbon-contextual-tabs__normal`},w={class:`ml-ribbon-contextual-tabs__ctx`},T=(0,t.defineComponent)({__name:`RibbonContextualTabs`,props:{tabs:{},activeTab:{},defaultContextualTitle:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n;return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S,[(0,t.createElementVNode)(`div`,C,[(0,t.createVNode)(x,{tabs:r.tabs.filter(e=>!e.contextual),"active-tab":e.activeTab,onSelect:a[0]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`])]),(0,t.createElementVNode)(`div`,w,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs.filter(e=>e.contextual),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-contextual-tabs__block`,style:(0,t.normalizeStyle)({"--ctx-color":n.contextualColor||`#67c23a`})},[(0,t.createElementVNode)(`small`,null,(0,t.toDisplayString)(n.contextualTitle||r.defaultContextualTitle),1),(0,t.createVNode)(x,{tabs:[n],"active-tab":e.activeTab,onSelect:a[1]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`])],4))),128))])]))}}),E=(0,t.defineComponent)({__name:`RibbonFileMenu`,props:{items:{},label:{},openBackstageLabel:{},showOpenBackstage:{type:Boolean}},emits:[`select`,`open-backstage`],setup(e,{emit:r}){let i=r,a=(0,t.ref)(!1),o=(0,n.useGlobalConfig)(`size`,``),s=(0,t.computed)(()=>o.value||`default`),c=(0,t.computed)(()=>`ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${s.value}`);function l(e){a.value=e}function u(e){if(e===`__backstage`){i(`open-backstage`);return}i(`select`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{trigger:`click`,"popper-class":c.value,onCommand:u,onVisibleChange:l},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[e.showOpenBackstage===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,command:`__backstage`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.openBackstageLabel),1)]),_:1})),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:r.id,divided:e.showOpenBackstage!==!1&&i===0,command:r.id,disabled:r.disabled},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.label),1)]),_:2},1032,[`divided`,`command`,`disabled`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab ml-ribbon-tab--file`,{"is-active":a.value}])},(0,t.toDisplayString)(e.label),3)]),_:1},8,[`popper-class`]))}}),D=(0,t.defineComponent)({__name:`RibbonCollection`,props:{id:{},layout:{default:`row`},rows:{default:3}},setup(e){let n=e,r=(0,t.computed)(()=>({"--ml-ribbon-collection-rows":String(n.rows)}));return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-collection`,[`ml-ribbon-collection--${n.layout}`]]),style:(0,t.normalizeStyle)(r.value)},[(0,t.renderSlot)(e.$slots,`default`)],6))}}),O={key:0,class:`ml-ribbon-gallery__title`},k={class:`ml-ribbon-gallery__categories`},A={class:`ml-ribbon-gallery__category-title`},j={class:`ml-ribbon-gallery__grid`},M=[`disabled`,`onClick`],N={class:`ml-ribbon-gallery__preview`},P={class:`ml-ribbon-gallery__label`},F=(0,t.defineComponent)({__name:`RibbonGallery`,props:{id:{},label:{},categories:{},disabled:{type:Boolean,default:!1},previewFallback:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``);function o(e){r.disabled||(a.value=e,i(`select`,e))}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery`,{"is-disabled":e.disabled}])},[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,O,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,k,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-gallery__category`},[(0,t.createElementVNode)(`h4`,A,(0,t.toDisplayString)(n.title),1),(0,t.createElementVNode)(`div`,j,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item`,{"is-selected":a.value===n.id}]),disabled:e.disabled,onClick:e=>o(n.id)},[(0,t.createElementVNode)(`div`,N,(0,t.toDisplayString)(n.preview??r.previewFallback),1),(0,t.createElementVNode)(`div`,P,(0,t.toDisplayString)(n.label),1)],10,M))),128))])]))),128))])],2))}}),I=[`data-id`],L={class:`ml-ribbon-group-button__label`},R=(0,t.defineComponent)({__name:`RibbonGroupButton`,props:{id:{},label:{},options:{},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.ref)([]);function s(e){if(!i.disabled){if(i.multiple){o.value.includes(e)?o.value=o.value.filter(t=>t!==e):o.value=[...o.value,e],a(`change`,o.value);return}o.value=[e],a(`change`,e)}}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-group-button`,"data-id":e.id},[(0,t.createElementVNode)(`div`,L,(0,t.toDisplayString)(e.label),1),(0,t.createVNode)((0,t.unref)(n.ElButtonGroup),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:r.value,disabled:e.disabled,type:o.value.includes(r.value)?`primary`:`default`,onClick:e=>s(r.value)},{default:(0,t.withCtx)(()=>[r.icon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-item-host__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(r.icon)))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(r.label),1)]),_:2},1032,[`disabled`,`type`,`onClick`]))),128))]),_:1})],8,I))}}),z=[`data-template-id`],B=(0,t.defineComponent)({__name:`RibbonTemplateItem`,props:{id:{},item:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-template-item`,"data-template-id":e.id},[(0,t.renderSlot)(n.$slots,`default`,{item:e.item},()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.item.label??e.item.id),1)])],8,z))}}),V=[`data-item-id`],H={key:0,class:`ml-ribbon-item-host__keytip`},U={class:`ml-ribbon-item-host__content`},W={class:`ml-ribbon-item-host__text-row`},G={key:0,class:`ml-ribbon-item-host__label`},K={class:`ml-ribbon-dropdown-item__content`},q={class:`ml-ribbon-dropdown-item__label`},ee={key:2,class:`ml-ribbon-item-host__label`},J=(0,t.defineComponent)({__name:`RibbonItemHost`,props:{id:{},item:{},groupId:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:a}){let o=e,s=a,c=(0,t.inject)(i,null),l=(0,t.computed)(()=>Array.isArray(o.item.props?.options)?o.item.props.options:[]),u=(0,n.useGlobalConfig)(`size`,``),d=(0,t.computed)(()=>u.value||`default`),f=(0,t.computed)(()=>`ml-ribbon-dropdown-menu ml-ribbon-popper ml-ribbon-popper--size-${d.value}`),p=(0,t.computed)(()=>`ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${d.value}`),m=(0,t.computed)(()=>o.item.props?.icon||(typeof o.item.icon==`string`||!o.item.icon?null:o.item.icon)),h=(0,t.computed)(()=>{let e=o.item.props?.icon;return typeof e==`string`&&e.trim().length>0?e:typeof o.item.icon==`string`&&o.item.icon.trim().length>0?o.item.icon:null}),g=(0,t.computed)(()=>o.item.hideLabel!==!0),_=(0,t.computed)(()=>o.item.label||o.item.id),v=(0,t.computed)(()=>o.item.keyTip?.trim().toUpperCase()??``),y=(0,t.ref)(!1),b=(0,t.ref)(void 0),x=(0,t.computed)(()=>l.value.find(e=>P(e)===b.value)??null),S=(0,t.computed)(()=>{let e=x.value;if(e){let t=I(e);if(t)return t}return o.item.label??o.item.id}),C=(0,t.computed)(()=>{if(x.value){let e=M(x.value);if(e)return e}return m.value}),w=(0,t.computed)(()=>{if(x.value){let e=N(x.value);if(e)return e}return C.value?null:h.value}),T=(0,t.computed)(()=>{if(!c?.keyTipsOpen.value||!v.value)return!1;let e=c.keyTipsSequence.value.toLowerCase();return e?v.value.toLowerCase().startsWith(e):!0});function E(){s(`item-click`,o.id)}function D(e){y.value=e}function O(e){b.value=e,j(e),y.value=!1}function k(){y.value=!y.value}function A(){let e=x.value;if(!e){E();return}j(P(e))}function j(e){if(typeof e==`string`||typeof e==`number`){s(`item-click`,String(e));return}E()}function M(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return!t||typeof t==`string`?null:t}function N(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return typeof t!=`string`||t.trim().length===0?null:t}function P(e){if(!(!e||typeof e!=`object`))return e.value}function I(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-item-host`,[`is-${e.item.size??`medium`}`,`type-${e.item.type}`,{"is-label-hidden":e.item.hideLabel===!0}]]),"data-item-id":e.id,role:`group`},[T.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,H,(0,t.toDisplayString)(v.value),1)):(0,t.createCommentVNode)(``,!0),e.item.type===`groupButton`?((0,t.openBlock)(),(0,t.createBlock)(R,{key:1,id:e.item.id,label:e.item.label??``,options:e.item.props?.options??[],multiple:!!e.item.props?.multiple,disabled:e.item.disabled,onChange:E},null,8,[`id`,`label`,`options`,`multiple`,`disabled`])):e.item.type===`gallery`?((0,t.openBlock)(),(0,t.createBlock)(F,{key:2,id:e.item.id,label:e.item.label??``,categories:e.item.props?.categories??[],"preview-fallback":o.galleryPreviewFallback,disabled:e.item.disabled,onSelect:E},null,8,[`id`,`label`,`categories`,`preview-fallback`,`disabled`])):e.item.type===`template`?((0,t.openBlock)(),(0,t.createBlock)(B,{key:3,id:e.item.id,item:e.item},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`template`,{item:e.item})]),_:3},8,[`id`,`item`])):e.item.type===`dropdown`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{key:4,trigger:`click`,disabled:e.item.disabled,"popper-class":f.value,onVisibleChange:D,onCommand:O},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:String(e.value),command:e.value},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,K,[M(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(M(e))))]),_:2},1024)):N(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class`,N(e)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,q,(0,t.toDisplayString)(e.label),1)])]),_:2},1032,[`command`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`default`,"aria-label":_.value,onClick:k},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,U,[C.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary`,onClick:(0,t.withModifiers)(A,[`stop`])},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(C.value)))]),_:1})])):w.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-item-host__icon--dropdown-primary`,onClick:(0,t.withModifiers)(A,[`stop`])},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(w.value),"aria-hidden":`true`},null,2)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,W,[g.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,G,(0,t.toDisplayString)(S.value),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:(0,t.normalizeClass)([`ml-ribbon-item-host__dropdown-arrow`,{"is-open":y.value}])},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(y.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1},8,[`class`])])])]),_:1},8,[`aria-label`])]),_:1},8,[`disabled`,`popper-class`])):e.item.type===`checkbox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElCheckbox),{key:5,disabled:e.item.disabled,onChange:E},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.item.label),1)]),_:1},8,[`disabled`])):e.item.type===`colorPicker`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElColorPicker),{key:6,disabled:e.item.disabled,onChange:E},null,8,[`disabled`])):e.item.type===`comboBox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSelect),{key:7,disabled:e.item.disabled,"popper-class":p.value,style:{width:`92px`},onChange:E},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElOption),{key:String(e.value),label:String(e.label),value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`disabled`,`popper-class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:8,disabled:e.item.disabled,"aria-label":_.value,onClick:E},{default:(0,t.withCtx)(()=>[m.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-item-host__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(m.value)))]),_:1})):h.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class`,h.value]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),g.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ee,(0,t.toDisplayString)(e.item.label??e.item.id),1)):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`disabled`,`aria-label`]))],10,V))}}),Y=(0,t.defineComponent)({__name:`RibbonGroupContent`,props:{group:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:n}){let r=e,i=n;return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-group__content`,[`ml-ribbon-group__content--${r.group.orientation??`column`}`]])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.group.collections??[],e=>((0,t.openBlock)(),(0,t.createBlock)(D,{id:e.id,key:e.id,layout:e.layout??(r.group.orientation===`row`?`row`:`column`),rows:e.rows},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createBlock)(J,{id:e.id,key:e.id,item:e,"group-id":r.group.id,"gallery-preview-fallback":r.galleryPreviewFallback,onItemClick:t=>i(`item-click`,{groupId:r.group.id,itemId:e.id})},null,8,[`id`,`item`,`group-id`,`gallery-preview-fallback`,`onItemClick`]))),128))]),_:2},1032,[`id`,`layout`,`rows`]))),128))],2))}}),te=[`data-priority`],X={class:`ml-ribbon-group__body`},Z={class:`ml-ribbon-group__footer`},Q={class:`ml-ribbon-group__title`},$=[`aria-label`,`aria-expanded`],ne={class:`ml-ribbon-group__overflow-content`},re=[`aria-label`,`aria-expanded`],ie={class:`ml-ribbon-group__overflow-content`},ae=(0,t.defineComponent)({__name:`RibbonGroup`,props:{id:{},title:{},icon:{},groupIconCss:{},orientation:{},autoWidth:{type:Boolean},priority:{},launcher:{type:Boolean},showLauncherIcon:{type:Boolean},groupModel:{},overflowTriggerAriaLabel:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.computed)(()=>a.autoWidth!==!1),c=(0,t.ref)(null),l=(0,t.ref)([]),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(0),p=(0,t.ref)(0),m=(0,n.useGlobalConfig)(`size`,``),h=(0,t.computed)(()=>m.value||`default`),g=(0,t.computed)(()=>`ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${h.value}`),_=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[f.value,8]}}]})),v=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[p.value,8]}}]})),y=(0,t.computed)(()=>!a.icon||typeof a.icon==`string`?null:a.icon),b=(0,t.computed)(()=>l.value.length>0),x=(0,t.computed)(()=>(a.groupModel?.footerMenuItems?.length??0)>0),S=(0,t.ref)(!1),C=(0,t.ref)(!1),w=(0,t.computed)(()=>{if(!a.groupModel||!l.value.length)return null;let e=new Set(l.value),t=a.groupModel.collections?.map(t=>({...t,items:t.items.filter(t=>e.has(t.id))})).filter(e=>e.items.length>0)??[];return t.length?{...a.groupModel,collections:t}:null}),T=(0,t.computed)(()=>a.groupModel?.footerMenuItems?.length?{id:`${a.groupModel.id}-footer-menu`,title:``,orientation:`row`,collections:[{id:`${a.groupModel.id}-footer-menu-collection`,layout:`row`,items:a.groupModel.footerMenuItems}]}:null);function E(){let e=c.value?.querySelector(`.ml-ribbon-group__content`);if(!e){l.value.length>0&&(l.value=[]);return}let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0){l.value.length>0&&(l.value=[]);return}let n=[];e.querySelectorAll(`.ml-ribbon-item-host[data-item-id]`).forEach(e=>{let r=e.dataset.itemId;if(!r)return;let i=e.getBoundingClientRect();(i.right-t.right>.5||i.bottom-t.bottom>.5||t.left-i.left>.5||t.top-i.top>.5)&&n.push(r)}),l.value.length===n.length&&l.value.every((e,t)=>e===n[t])||(l.value=n)}function D(){(0,t.nextTick)(()=>{I(),O(),k(),E()})}function O(){let e=c.value?.getBoundingClientRect(),t=u.value?.getBoundingClientRect();if(!e||!t){f.value!==0&&(f.value=0);return}let n=Math.round(e.left-t.left);f.value!==n&&(f.value=n)}function k(){let e=c.value?.getBoundingClientRect(),t=d.value?.getBoundingClientRect();if(!e||!t){p.value!==0&&(p.value=0);return}let n=Math.round(e.left-t.left);p.value!==n&&(p.value=n)}function A(e){S.value=e}function j(e){C.value=e}function M(){S.value=!S.value}function N(){C.value=!C.value}let P=null,F=null;function I(){if(!P)return;let e=c.value?.querySelector(`.ml-ribbon-group__content`)??null;F!==e&&(F&&P.unobserve(F),e&&P.observe(e),F=e)}return(0,t.watch)(()=>a.groupModel,()=>{D()},{deep:!0}),(0,t.onMounted)(()=>{typeof ResizeObserver<`u`&&(P=new ResizeObserver(()=>{O(),k(),E()}),c.value&&P.observe(c.value),I()),D()}),(0,t.onUnmounted)(()=>{P?.disconnect()}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`groupSectionRef`,ref:c,class:(0,t.normalizeClass)([`ml-ribbon-group`,{"ml-ribbon-group--auto-width":s.value}]),"data-priority":e.priority??100},[(0,t.createElementVNode)(`div`,X,[(0,t.renderSlot)(i.$slots,`default`)]),(0,t.createElementVNode)(`footer`,Z,[y.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(y.value)))]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Q,(0,t.toDisplayString)(e.title),1),x.value&&T.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:1,trigger:`click`,placement:`bottom-start`,"popper-class":g.value,"popper-options":v.value,onShow:a[1]||=e=>A(!0),onHide:a[2]||=e=>A(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`footerTriggerRef`,ref:d,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__footer-trigger`,{"is-open":S.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":S.value,onClick:M},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(S.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,$)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ne,[(0,t.createVNode)(Y,{group:T.value,"gallery-preview-fallback":e.galleryPreviewFallback,onItemClick:a[0]||=e=>o(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`])])]),_:1},8,[`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),b.value&&w.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:2,trigger:`click`,placement:`bottom-start`,"popper-class":g.value,"popper-options":_.value,onShow:a[4]||=e=>j(!0),onHide:a[5]||=e=>j(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`overflowTriggerRef`,ref:u,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__overflow-trigger`,{"is-open":C.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":C.value,onClick:N},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(C.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,re)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ie,[(0,t.createVNode)(Y,{group:w.value,"gallery-preview-fallback":e.galleryPreviewFallback,onItemClick:a[3]||=e=>o(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`])])]),_:1},8,[`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),e.showLauncherIcon??e.launcher?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:3,link:``,class:`ml-ribbon-group__launcher`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Promotion))]),_:1})]),_:1})):(0,t.createCommentVNode)(``,!0)])],10,te))}}),oe={class:`ml-ribbon__header`},se={class:`ml-ribbon__head-left`},ce={class:`ml-ribbon__head-right`},le={key:2,class:`ml-ribbon__tabs-extra`},ue=[`data-active-tab`],de={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},fe={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},pe=[`aria-label`],me={class:`ml-ribbon-overflow-list`},he={class:`ml-ribbon-overflow-group__header`},ge=[`data-active-tab`],_e={class:`ml-ribbon-simplified-group`,type:`button`},ve={class:`ml-ribbon-simplified-group__panel`},ye=40,be=(0,t.defineComponent)({__name:`Ribbon`,props:{id:{default:`ml-ribbon-root`},tabs:{},activeTab:{default:``},activeLayout:{default:void 0},layout:{default:`classic`},size:{default:void 0},minimized:{type:Boolean,default:!1},hideLayoutSwitcher:{type:Boolean,default:!1},hideMinimizeButton:{type:Boolean,default:!1},hideKeyTipsToggle:{type:Boolean,default:!1},showFileMenu:{type:Boolean,default:!0},showOpenBackstage:{type:Boolean,default:!0},fileMenuItems:{default:()=>[]},texts:{default:()=>({})}},emits:[`update:activeTab`,`update:layout`,`update:minimized`,`tabChange`,`layoutChange`,`itemClick`,`overflowOpen`,`overflowClose`,`backstageOpen`,`backstageClose`,`fileMenuSelect`],setup(e,{expose:a,emit:o}){function s(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function c(e){if(!e)return;let t={...e};return`icon`in t&&(t.icon=s(t.icon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:s(t.icon)}:t})),t}function l(e){return{...e,icon:s(e.icon),props:c(e.props)}}function u(e){return{...e,icon:s(e.icon),footerMenuItems:e.footerMenuItems?.map(l),collections:e.collections?.map(e=>({...e,items:e.items?.map(l)}))}}function d(e){return e.map(e=>({...e,groups:e.groups?.map(u)}))}let f={layoutSwitcherTooltip:`Switch ribbon layout`,minimizeTooltip:`Minimize ribbon`,keyTipsToggleText:`Key Tips`,overflowTriggerAriaLabel:`Open overflow groups`,groupOverflowTriggerAriaLabel:`Open group menu`,fileMenuLabel:`File`,fileMenuOpenBackstageLabel:`Open backstage`,backstageBackLabel:`Back`,backstageTitle:`Backstage`,backstageDescription:`Manage your document and settings here.`,keyTipsSequencePrefix:`Sequence:`,keyTipsEmptySequence:`No key sequence`,contextualTabDefaultTitle:`Contextual`,galleryPreviewFallback:`Preview unavailable`},m=e,h=o,{context:g,visibleTabs:_}=p(m.id,m.tabs,m.activeLayout?String(m.activeLayout).toLowerCase()===`simplified`?`simplified`:`classic`:m.layout,m.minimized,m.activeTab||m.tabs[0]?.id||``);(0,t.provide)(i,g),(0,t.watch)(()=>m.tabs,e=>{g.tabs.value=d(e),g.tabs.value.some(e=>e.id===g.activeTab.value)||(g.activeTab.value=g.tabs.value[0]?.id||``)},{deep:!0}),(0,t.watch)(()=>m.layout,e=>{e!==g.layout.value&&(g.layout.value=e)}),(0,t.watch)(()=>m.activeLayout,e=>{if(!e)return;let t=String(e).toLowerCase()===`simplified`?`simplified`:`classic`;t!==g.layout.value&&(g.layout.value=t)}),(0,t.watch)(()=>m.minimized,e=>{e!==g.minimized.value&&(g.minimized.value=e)}),(0,t.watch)(()=>m.activeTab,e=>{e&&e!==g.activeTab.value&&(g.activeTab.value=e)}),(0,t.watch)(g.activeTab,e=>{h(`update:activeTab`,e),h(`tabChange`,e)}),(0,t.watch)(g.layout,e=>{h(`update:layout`,e),h(`layoutChange`,e)}),(0,t.watch)(g.minimized,e=>{h(`update:minimized`,e)}),(0,t.watch)(g.overflowOpen,e=>{h(e?`overflowOpen`:`overflowClose`)}),(0,t.watch)(g.backdropOpen,e=>{h(e?`backstageOpen`:`backstageClose`)});let y=(0,t.computed)(()=>_.value.find(e=>e.id===g.activeTab.value)),b=(0,t.computed)(()=>y.value?.groups?.filter(e=>e.visible!==!1)??[]),x=(0,t.ref)(null),S=(0,t.ref)(new Set),C=(0,t.ref)({}),w=(0,n.useGlobalConfig)(`size`,``),D=(0,t.computed)(()=>m.size||w.value||`default`),O=(0,t.computed)(()=>`ml-ribbon-group-popover ml-ribbon-group-popover--size-${D.value}`),k=(0,t.computed)(()=>`ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${D.value}`),A=(0,t.computed)(()=>({layoutSwitcherTooltip:m.texts.layoutSwitcherTooltip||f.layoutSwitcherTooltip,minimizeTooltip:m.texts.minimizeTooltip||f.minimizeTooltip,keyTipsToggleText:m.texts.keyTipsToggleText||f.keyTipsToggleText,overflowTriggerAriaLabel:m.texts.overflowTriggerAriaLabel||f.overflowTriggerAriaLabel,groupOverflowTriggerAriaLabel:m.texts.groupOverflowTriggerAriaLabel||f.groupOverflowTriggerAriaLabel,fileMenuLabel:m.texts.fileMenuLabel||f.fileMenuLabel,fileMenuOpenBackstageLabel:m.texts.fileMenuOpenBackstageLabel||f.fileMenuOpenBackstageLabel,backstageBackLabel:m.texts.backstageBackLabel||f.backstageBackLabel,backstageTitle:m.texts.backstageTitle||f.backstageTitle,backstageDescription:m.texts.backstageDescription||f.backstageDescription,keyTipsSequencePrefix:m.texts.keyTipsSequencePrefix||f.keyTipsSequencePrefix,keyTipsEmptySequence:m.texts.keyTipsEmptySequence||f.keyTipsEmptySequence,contextualTabDefaultTitle:m.texts.contextualTabDefaultTitle||f.contextualTabDefaultTitle,galleryPreviewFallback:m.texts.galleryPreviewFallback||f.galleryPreviewFallback})),j=(0,t.computed)(()=>g.minimized.value?r.ArrowUpBold:r.ArrowDownBold),M=(0,t.computed)(()=>b.value.filter(e=>!S.value.has(e.id))),N=(0,t.computed)(()=>b.value.filter(e=>S.value.has(e.id))),P=(0,t.computed)(()=>{if(!N.value.length)return 220;let e=N.value.reduce((e,t)=>{let n=C.value[t.id]??L(t);return Math.max(e,n)},0),t=Math.ceil(e+40);return Math.max(220,Math.min(720,t))});function F(e){let t=(e.collections??[]).flatMap(e=>(e.items??[]).map(e=>({...l(e),size:`medium`})));return{...e,orientation:`row`,collections:[{id:`${e.id}-simplified`,layout:`row`,items:t}]}}function I(e){return e.priority??100}function L(e){return e.autoWidth===!1?190:140}function R(e){let t={};return e.querySelectorAll(`.ml-ribbon-group`).forEach(e=>{let n=e.dataset.groupId;if(!n)return;let r=e.getBoundingClientRect().width;r>0&&(t[n]=r)}),t}function z(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--ml-rb-overflow-slot-width`));return Number.isFinite(t)&&t>0?t:ye}function B(){if(g.layout.value!==`classic`){S.value=new Set;return}let e=x.value;if(!e)return;let t=b.value;if(!t.length){S.value=new Set;return}let n=Math.round(e.getBoundingClientRect().width),r=z(e),i=R(e);C.value={...C.value,...i};let a=t.filter(e=>e.enableGroupOverflow===!1),o=t.filter(e=>e.enableGroupOverflow!==!1).map((e,t)=>({group:e,index:t})),s=new Set,c=[...o].sort((e,t)=>{let n=I(t.group)-I(e.group);return n===0?t.index-e.index:n}),l=e=>i[e.id]??L(e),u=a.reduce((e,t)=>e+l(t),0),d=e=>o.filter(({group:t})=>!e.has(t.id)).reduce((e,{group:t})=>e+l(t),0),f=e=>u+d(e)+(e.size>0?r:0),p=0;for(;f(s)>n&&p<c.length;){let e=c[p].group;s.add(e.id),p+=1}S.value=s}function V(){(0,t.nextTick)(()=>{if(g.layout.value!==`classic`||g.minimized.value){B();return}if(S.value.size===0){B();return}S.value=new Set,(0,t.nextTick)(()=>{B()})})}function H(e){g.activeTab.value=e}function U(){g.api.toggleSimplified()}function W(){g.minimized.value=!g.minimized.value}function G(e){h(`fileMenuSelect`,e)}function K(){g.backdropOpen.value=!1}function q(e,t){h(`itemClick`,{tabId:g.activeTab.value,groupId:e,itemId:t})}function ee(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function J(){let e=y.value;if(!e?.groups?.length){g.keyTips.value=[];return}let t=e.groups.filter(e=>e.visible!==!1).flatMap(t=>(t.collections??[]).flatMap(n=>n.items.filter(e=>e.keyTip&&e.disabled!==!0).map(n=>{let r=n.keyTip?.trim().toUpperCase();return r?{id:`${e.id}:${t.id}:${n.id}`,key:r,targetId:n.id,sequence:r.split(``),scope:`item`}:null}).filter(e=>!!e)));g.keyTips.value=t}function te(e){let t=y.value;if(t?.groups?.length){for(let n of t.groups)if(n.visible!==!1)for(let t of n.collections??[]){let r=t.items.find(t=>t.id===e.targetId&&t.disabled!==!0);if(r){q(n.id,r.id),g.keyTipsOpen.value=!1,g.keyTipsSequence.value=``;return}}}}function X(){g.keyTipsSequence.value=``}function Z(e){if(!ee(e.target)){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`Alt`){e.preventDefault(),g.keyTipsOpen.value=!g.keyTipsOpen.value,g.keyTipsOpen.value||X();return}if(g.keyTipsOpen.value&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),g.keyTipsOpen.value=!1,X();return}if(e.key===`Backspace`){e.preventDefault(),g.keyTipsSequence.value=g.keyTipsSequence.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){e.preventDefault();let t=`${g.keyTipsSequence.value}${e.key.toUpperCase()}`;g.keyTipsSequence.value=t;let n=t.toLowerCase(),r=g.keyTips.value.find(e=>e.key.toLowerCase()===n);if(r){te(r);return}g.keyTips.value.some(e=>e.key.toLowerCase().startsWith(n))||X()}}}}function Q(e){return e.icon&&typeof e.icon!=`string`?e.icon:e.groupIconCss?r.Grid:null}(0,t.watch)([b,()=>g.layout.value,()=>g.minimized.value],()=>{V()}),(0,t.watch)([y,()=>g.tabs.value],()=>{J(),X()},{deep:!0,immediate:!0}),(0,t.watch)(()=>g.keyTipsOpen.value,e=>{e||X()}),(0,t.watch)(x,(e,t)=>{t&&$&&$.unobserve(t),e&&$&&$.observe(e)},{flush:`post`});let $=null;return(0,t.onMounted)(()=>{window.addEventListener(`keydown`,Z),typeof ResizeObserver<`u`&&($=new ResizeObserver(()=>{V()}),x.value&&$.observe(x.value)),V()}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,Z),$?.disconnect()}),a(g.api),(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElConfigProvider),{size:m.size},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`section`,{class:(0,t.normalizeClass)([`ml-ribbon`,[`ml-ribbon--${(0,t.unref)(g).layout.value}`,`ml-ribbon--size-${D.value}`,{"ml-ribbon--minimized":(0,t.unref)(g).minimized.value,"ml-ribbon--keytips-open":(0,t.unref)(g).keyTipsOpen.value}]])},[(0,t.createElementVNode)(`header`,oe,[(0,t.createElementVNode)(`div`,se,[e.showFileMenu?((0,t.openBlock)(),(0,t.createBlock)(E,{key:0,items:e.fileMenuItems,label:A.value.fileMenuLabel,"open-backstage-label":A.value.fileMenuOpenBackstageLabel,"show-open-backstage":e.showOpenBackstage,onSelect:G,onOpenBackstage:a[0]||=e=>(0,t.unref)(g).backdropOpen.value=!0},null,8,[`items`,`label`,`open-backstage-label`,`show-open-backstage`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(T,{tabs:(0,t.unref)(_),"active-tab":(0,t.unref)(g).activeTab.value,"default-contextual-title":A.value.contextualTabDefaultTitle,onSelect:H},null,8,[`tabs`,`active-tab`,`default-contextual-title`]),m.hideMinimizeButton?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:1,content:A.value.minimizeTooltip},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{class:(0,t.normalizeClass)([`ml-ribbon__control`,`ml-ribbon__control--minimize`,(0,t.unref)(g).minimized.value?`ml-ribbon__control--minimize-up`:`ml-ribbon__control--minimize-down`]),icon:j.value,onClick:W},null,8,[`class`,`icon`])]),_:1},8,[`content`]))]),(0,t.createElementVNode)(`div`,ce,[m.hideLayoutSwitcher?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:0,content:A.value.layoutSwitcherTooltip},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{circle:``,class:`ml-ribbon__control ml-ribbon__control--layout`,icon:(0,t.unref)(r.Menu),onClick:U},null,8,[`icon`])]),_:1},8,[`content`])),m.hideKeyTipsToggle?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSwitch),{key:1,"inline-prompt":``,class:`ml-ribbon__control ml-ribbon__control--keytips`,"active-text":A.value.keyTipsToggleText,"inactive-text":A.value.keyTipsToggleText,"model-value":(0,t.unref)(g).keyTipsOpen.value,onChange:a[1]||=e=>(0,t.unref)(g).keyTipsOpen.value=!(0,t.unref)(g).keyTipsOpen.value},null,8,[`active-text`,`inactive-text`,`model-value`])),i.$slots[`tabs-extra`]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,le,[(0,t.renderSlot)(i.$slots,`tabs-extra`,{activeTab:(0,t.unref)(g).activeTab.value,layout:(0,t.unref)(g).layout.value,minimized:(0,t.unref)(g).minimized.value})])):(0,t.createCommentVNode)(``,!0)])]),!(0,t.unref)(g).minimized.value&&y.value&&(0,t.unref)(g).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,class:`ml-ribbon__panel`,"data-active-tab":y.value.id,ref_key:`classicPanelRef`,ref:x},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(M.value,e=>((0,t.openBlock)(),(0,t.createBlock)(ae,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,"auto-width":e.autoWidth,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":A.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[3]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(Y,{group:e,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[2]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`auto-width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`]))),128)),N.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,de,[(0,t.createElementVNode)(`div`,fe,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:P.value,"popper-class":k.value,onShow:a[5]||=e=>(0,t.unref)(g).overflowOpen.value=!0,onHide:a[6]||=e=>(0,t.unref)(g).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":A.value.overflowTriggerAriaLabel},[...a[8]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,pe)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,me,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(N.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,he,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)(Y,{group:e,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[4]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])]))),128))])]),_:1},8,[`width`,`popper-class`])]),a[9]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ue)):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(g).minimized.value&&y.value&&(0,t.unref)(g).layout.value===`simplified`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified`,"data-active-tab":y.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(b.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,"popper-class":O.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,_e,[Q(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(Q(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ve,[(0,t.createVNode)(Y,{group:F(e),"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[7]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])])]),_:2},1032,[`popper-class`]))),128))],8,ge)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(v,{open:(0,t.unref)(g).backdropOpen.value,size:D.value,"back-label":A.value.backstageBackLabel,title:A.value.backstageTitle,description:A.value.backstageDescription,onClose:K},(0,t.createSlots)({_:2},[i.$slots.backstage?{name:`default`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`backstage`,{close:K,open:(0,t.unref)(g).backdropOpen.value,size:D.value,backLabel:A.value.backstageBackLabel,title:A.value.backstageTitle,description:A.value.backstageDescription})]),key:`0`}:void 0]),1032,[`open`,`size`,`back-label`,`title`,`description`])],2)]),_:3},8,[`size`]))}}),xe={class:`ml-ribbon-tab-definition`,hidden:``},Se=(0,t.defineComponent)({__name:`RibbonTab`,props:{id:{},title:{},visible:{type:Boolean},contextual:{type:Boolean},contextualColor:{},contextualTitle:{}},setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xe,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ce={key:0,class:`ml-ribbon-keytips`,"aria-live":`polite`},we={class:`ml-ribbon-keytips__hint`},Te=(0,t.defineComponent)({__name:`RibbonKeyTips`,props:{open:{type:Boolean},tips:{default:()=>[]},sequencePrefix:{},emptySequenceText:{}},emits:[`activate`,`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.computed)(()=>a.value?r.tips.filter(e=>e.key.toLowerCase().startsWith(a.value.toLowerCase())):r.tips),s=(0,t.computed)(()=>a.value||r.emptySequenceText||``),c=(0,t.computed)(()=>r.sequencePrefix?`${r.sequencePrefix}${s.value}`:s.value),l=(0,t.computed)(()=>a.value.toLowerCase()),u=(0,t.computed)(()=>r.tips.filter(e=>e.key.toLowerCase()===l.value)),d=(0,t.computed)(()=>r.tips.some(e=>e.key.toLowerCase().startsWith(l.value)));function f(){a.value=``}function p(e){if(r.open&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),f(),i(`close`);return}if(e.key===`Backspace`){e.preventDefault(),a.value=a.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){if(e.preventDefault(),a.value+=e.key.toUpperCase(),u.value.length>0){i(`activate`,u.value[0]),f();return}d.value||f()}}}return(0,t.onMounted)(()=>window.addEventListener(`keydown`,p)),(0,t.onUnmounted)(()=>window.removeEventListener(`keydown`,p)),(0,t.watch)(()=>r.open,e=>{e||f()}),(n,r)=>e.open?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ce,[(0,t.createElementVNode)(`div`,we,(0,t.toDisplayString)(c.value),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`ml-ribbon-keytip`},(0,t.toDisplayString)(e.key),1))),128))])):(0,t.createCommentVNode)(``,!0)}});e.MlRibbon=be,e.MlRibbonBackstage=v,e.MlRibbonCollection=D,e.MlRibbonContextualTabs=T,e.MlRibbonFileMenu=E,e.MlRibbonGallery=F,e.MlRibbonGroup=ae,e.MlRibbonGroupButton=R,e.MlRibbonItemHost=J,e.MlRibbonKeyTips=Te,e.MlRibbonTab=Se,e.MlRibbonTabs=x,e.MlRibbonTemplateItem=B});
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`vue`),require(`element-plus`),require(`@element-plus/icons-vue`)):typeof define==`function`&&define.amd?define([`exports`,`vue`,`element-plus`,`@element-plus/icons-vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.MlRibbon={},e.Vue,e.ElementPlus,e.ElementPlusIconsVue))})(this,function(e,t,n,r){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var i=Symbol(`RibbonContext`);function a(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function o(e){if(!e)return;let t={...e};return`icon`in t&&(t.icon=a(t.icon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:a(t.icon)}:t})),t}function s(e){return{...e,icon:a(e.icon),props:o(e.props)}}function c(e){return{...e,icon:a(e.icon),footerMenuItems:e.footerMenuItems?.map(s),collections:e.collections?.map(e=>({...e,items:e.items.map(s)}))}}function l(e){return{...e,groups:e.groups?.map(c)}}function u(e){return e.map(l)}function d(e){(!e.collections||e.collections.length===0)&&(e.collections=[{id:`${e.id}-collection-1`,items:[]}])}function f(e,t,n,r,i){let a=e.find(e=>e.id===t);if(!a?.groups)return;let o=a.groups.find(e=>e.id===n);if(!o?.collections)return;let s=o.collections.find(e=>e.id===r);s&&i(s.items)}function p(e,n,r,i,a){let o=(0,t.ref)(r),p=(0,t.ref)(i),m=(0,t.ref)(a),h=(0,t.ref)(u(n)),g=(0,t.ref)(!1),_=(0,t.ref)(!1),v=(0,t.ref)(!1),y=(0,t.ref)([]),b=(0,t.ref)(``),x=(0,t.computed)(()=>h.value.filter(e=>e.visible!==!1)),S={addTab(e){h.value.push(l(e)),m.value||=e.id},removeTab(e){h.value=h.value.filter(t=>t.id!==e),m.value===e&&(m.value=x.value[0]?.id??``)},showTab(e){let t=h.value.find(t=>t.id===e);t&&(t.visible=!0)},hideTab(e){let t=h.value.find(t=>t.id===e);t&&(t.visible=!1)},selectTab(e){m.value=e},addGroup(e,t){let n=h.value.find(t=>t.id===e);n&&(n.groups??=[],d(t),n.groups.push(c(t)))},removeGroup(e,t){let n=h.value.find(t=>t.id===e);n?.groups&&(n.groups=n.groups.filter(e=>e.id!==t))},showGroup(e,t){let n=h.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!0)},hideGroup(e,t){let n=h.value.find(t=>t.id===e)?.groups?.find(e=>e.id===t);n&&(n.visible=!1)},addItem(e,t,n,r){f(h.value,e,t,n,e=>e.push(s(r)))},removeItem(e,t,n,r){f(h.value,e,t,n,e=>{let t=e.findIndex(e=>e.id===r);t>=0&&e.splice(t,1)})},updateItem(e,t,n,r,i){f(h.value,e,t,n,e=>{let t=e.find(e=>e.id===r);t&&Object.assign(t,i)})},enableItem(e,t,n,r){S.updateItem(e,t,n,r,{disabled:!1})},disableItem(e,t,n,r){S.updateItem(e,t,n,r,{disabled:!0})},refreshLayout(){g.value=!1},minimize(e){p.value=e},toggleSimplified(){o.value=o.value===`classic`?`simplified`:`classic`}};return{context:{id:e,layout:o,minimized:p,activeTab:m,tabs:h,overflowOpen:g,backdropOpen:_,keyTipsOpen:v,keyTips:y,keyTipsSequence:b,registerKeyTip:e=>{y.value.some(t=>t.id===e.id)||y.value.push(e)},unregisterKeyTip:e=>{y.value=y.value.filter(t=>t.id!==e)},api:S},visibleTabs:x}}var m={class:`ml-ribbon-backstage__nav`},h={class:`ml-ribbon-backstage__content`},g={key:0},_={key:1},v=(0,t.defineComponent)({__name:`RibbonBackstage`,props:{open:{type:Boolean},backLabel:{},title:{},description:{},size:{default:`default`}},emits:[`close`],setup(e,{emit:r}){let i=e,a=r;function o(){a(`close`)}return(e,r)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDrawer),{"model-value":i.open,size:`100%`,"with-header":!1,direction:`ltr`,onClose:o},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-backstage`,`ml-ribbon-backstage--size-${i.size||`default`}`])},[e.$slots.default?(0,t.renderSlot)(e.$slots,`default`,{key:0,close:o,backLabel:i.backLabel,title:i.title,description:i.description,size:i.size}):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:1},[(0,t.createElementVNode)(`aside`,m,[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`primary`,onClick:o},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(i.backLabel),1)]),_:1})]),(0,t.createElementVNode)(`section`,h,[i.title?((0,t.openBlock)(),(0,t.createElementBlock)(`h2`,g,(0,t.toDisplayString)(i.title),1)):(0,t.createCommentVNode)(``,!0),i.description?((0,t.openBlock)(),(0,t.createElementBlock)(`p`,_,(0,t.toDisplayString)(i.description),1)):(0,t.createCommentVNode)(``,!0)])],64))],2)]),_:3},8,[`model-value`]))}}),y={class:`ml-ribbon-tabs`,role:`tablist`},b=[`aria-selected`,`onClick`],x=(0,t.defineComponent)({__name:`RibbonTabs`,props:{tabs:{},activeTab:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.computed)(()=>r.tabs.filter(e=>e.visible!==!1));return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,y,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(a.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab`,{"is-active":e.activeTab===n.id}]),role:`tab`,"aria-selected":e.activeTab===n.id,onClick:e=>i(`select`,n.id)},(0,t.toDisplayString)(n.title),11,b))),128))]))}}),S={class:`ml-ribbon-contextual-tabs`},C={class:`ml-ribbon-contextual-tabs__normal`},w={class:`ml-ribbon-contextual-tabs__ctx`},T=(0,t.defineComponent)({__name:`RibbonContextualTabs`,props:{tabs:{},activeTab:{},defaultContextualTitle:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n;return(n,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,S,[(0,t.createElementVNode)(`div`,C,[(0,t.createVNode)(x,{tabs:r.tabs.filter(e=>!e.contextual),"active-tab":e.activeTab,onSelect:a[0]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`])]),(0,t.createElementVNode)(`div`,w,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.tabs.filter(e=>e.contextual),n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-contextual-tabs__block`,style:(0,t.normalizeStyle)({"--ctx-color":n.contextualColor||`#67c23a`})},[(0,t.createElementVNode)(`small`,null,(0,t.toDisplayString)(n.contextualTitle||r.defaultContextualTitle),1),(0,t.createVNode)(x,{tabs:[n],"active-tab":e.activeTab,onSelect:a[1]||=e=>i(`select`,e)},null,8,[`tabs`,`active-tab`])],4))),128))])]))}}),E=(0,t.defineComponent)({__name:`RibbonFileMenu`,props:{items:{},label:{},openBackstageLabel:{},showOpenBackstage:{type:Boolean}},emits:[`select`,`open-backstage`],setup(e,{emit:r}){let i=r,a=(0,t.ref)(!1),o=(0,n.useGlobalConfig)(`size`,``),s=(0,t.computed)(()=>o.value||`default`),c=(0,t.computed)(()=>`ml-ribbon-file-menu-dropdown ml-ribbon-popper ml-ribbon-popper--size-${s.value}`);function l(e){a.value=e}function u(e){if(e===`__backstage`){i(`open-backstage`);return}i(`select`,e)}return(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{trigger:`click`,"popper-class":c.value,onCommand:u,onVisibleChange:l},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[e.showOpenBackstage===!1?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:0,command:`__backstage`},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.openBackstageLabel),1)]),_:1})),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,(r,i)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:r.id,divided:e.showOpenBackstage!==!1&&i===0,command:r.id,disabled:r.disabled},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(r.label),1)]),_:2},1032,[`divided`,`command`,`disabled`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-tab ml-ribbon-tab--file`,{"is-active":a.value}])},(0,t.toDisplayString)(e.label),3)]),_:1},8,[`popper-class`]))}}),D=(0,t.defineComponent)({__name:`RibbonCollection`,props:{id:{},layout:{default:`row`},rows:{default:3}},setup(e){let n=e,r=(0,t.computed)(()=>({"--ml-ribbon-collection-rows":String(n.rows)}));return(e,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-collection`,[`ml-ribbon-collection--${n.layout}`]]),style:(0,t.normalizeStyle)(r.value)},[(0,t.renderSlot)(e.$slots,`default`)],6))}}),O={key:0,class:`ml-ribbon-gallery__title`},k={class:`ml-ribbon-gallery__categories`},A={class:`ml-ribbon-gallery__category-title`},j={class:`ml-ribbon-gallery__grid`},M=[`disabled`,`onClick`],N={class:`ml-ribbon-gallery__preview`},P={class:`ml-ribbon-gallery__label`},F=(0,t.defineComponent)({__name:`RibbonGallery`,props:{id:{},label:{},categories:{},disabled:{type:Boolean,default:!1},previewFallback:{}},emits:[`select`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``);function o(e){r.disabled||(a.value=e,i(`select`,e))}return(n,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-gallery`,{"is-disabled":e.disabled}])},[e.label?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,O,(0,t.toDisplayString)(e.label),1)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`div`,k,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.categories,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:n.id,class:`ml-ribbon-gallery__category`},[(0,t.createElementVNode)(`h4`,A,(0,t.toDisplayString)(n.title),1),(0,t.createElementVNode)(`div`,j,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(n.items,n=>((0,t.openBlock)(),(0,t.createElementBlock)(`button`,{key:n.id,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-gallery__item`,{"is-selected":a.value===n.id}]),disabled:e.disabled,onClick:e=>o(n.id)},[(0,t.createElementVNode)(`div`,N,(0,t.toDisplayString)(n.preview??r.previewFallback),1),(0,t.createElementVNode)(`div`,P,(0,t.toDisplayString)(n.label),1)],10,M))),128))])]))),128))])],2))}}),I=[`data-id`],L={class:`ml-ribbon-group-button__label`},R=(0,t.defineComponent)({__name:`RibbonGroupButton`,props:{id:{},label:{},options:{},multiple:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1}},emits:[`change`],setup(e,{emit:r}){let i=e,a=r,o=(0,t.ref)([]);function s(e){if(!i.disabled){if(i.multiple){o.value.includes(e)?o.value=o.value.filter(t=>t!==e):o.value=[...o.value,e],a(`change`,o.value);return}o.value=[e],a(`change`,e)}}return(r,i)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-group-button`,"data-id":e.id},[(0,t.createElementVNode)(`div`,L,(0,t.toDisplayString)(e.label),1),(0,t.createVNode)((0,t.unref)(n.ElButtonGroup),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.options,r=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:r.value,disabled:e.disabled,type:o.value.includes(r.value)?`primary`:`default`,onClick:e=>s(r.value)},{default:(0,t.withCtx)(()=>[r.icon?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-item-host__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(r.icon)))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createTextVNode)(` `+(0,t.toDisplayString)(r.label),1)]),_:2},1032,[`disabled`,`type`,`onClick`]))),128))]),_:1})],8,I))}}),z=[`data-template-id`],B=(0,t.defineComponent)({__name:`RibbonTemplateItem`,props:{id:{},item:{}},setup(e){return(n,r)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:`ml-ribbon-template-item`,"data-template-id":e.id},[(0,t.renderSlot)(n.$slots,`default`,{item:e.item},()=>[(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.item.label??e.item.id),1)])],8,z))}}),V=[`data-item-id`],H={key:0,class:`ml-ribbon-item-host__keytip`},U={class:`ml-ribbon-item-host__content`},W={class:`ml-ribbon-item-host__text-row`},G={key:0,class:`ml-ribbon-item-host__label`},K={class:`ml-ribbon-dropdown-item__content`},q={class:`ml-ribbon-dropdown-item__label`},ee={key:2,class:`ml-ribbon-item-host__label`},J=(0,t.defineComponent)({__name:`RibbonItemHost`,props:{id:{},item:{},groupId:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:a}){let o=e,s=a,c=(0,t.inject)(i,null),l=(0,t.computed)(()=>Array.isArray(o.item.props?.options)?o.item.props.options:[]),u=(0,n.useGlobalConfig)(`size`,``),d=(0,t.computed)(()=>u.value||`default`),f=(0,t.computed)(()=>`ml-ribbon-dropdown-menu ml-ribbon-popper ml-ribbon-popper--size-${d.value}`),p=(0,t.computed)(()=>`ml-ribbon-select-dropdown ml-ribbon-popper ml-ribbon-popper--size-${d.value}`),m=(0,t.computed)(()=>o.item.props?.icon||(typeof o.item.icon==`string`||!o.item.icon?null:o.item.icon)),h=(0,t.computed)(()=>{let e=o.item.props?.icon;return typeof e==`string`&&e.trim().length>0?e:typeof o.item.icon==`string`&&o.item.icon.trim().length>0?o.item.icon:null}),g=(0,t.computed)(()=>o.item.hideLabel!==!0),_=(0,t.computed)(()=>o.item.label||o.item.id),v=(0,t.computed)(()=>o.item.keyTip?.trim().toUpperCase()??``),y=(0,t.computed)(()=>o.item.props?.syncLabelWithSelection===!0),b=(0,t.ref)(!1),x=(0,t.ref)(void 0),S=(0,t.computed)(()=>l.value.find(e=>I(e)===x.value)??null),C=(0,t.computed)(()=>{let e=S.value;if(e&&y.value){let t=L(e);if(t)return t}return o.item.label??o.item.id}),w=(0,t.computed)(()=>{if(S.value){let e=N(S.value);if(e)return e}return m.value}),T=(0,t.computed)(()=>{if(S.value){let e=P(S.value);if(e)return e}return w.value?null:h.value}),E=(0,t.computed)(()=>{if(!c?.keyTipsOpen.value||!v.value)return!1;let e=c.keyTipsSequence.value.toLowerCase();return e?v.value.toLowerCase().startsWith(e):!0});function D(){s(`item-click`,o.id)}function O(e){b.value=e}function k(e){x.value=e,M(e),b.value=!1}function A(){b.value=!b.value}function j(){let e=S.value;if(!e){D();return}M(I(e))}function M(e){if(typeof e==`string`||typeof e==`number`){s(`item-click`,String(e));return}D()}function N(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return!t||typeof t==`string`?null:t}function P(e){if(!e||typeof e!=`object`)return null;let t=e.icon;return typeof t!=`string`||t.trim().length===0?null:t}function I(e){if(!(!e||typeof e!=`object`))return e.value}function L(e){if(!e||typeof e!=`object`)return;let t=e.label;return typeof t==`string`?t:void 0}return(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-item-host`,[`is-${e.item.size??`medium`}`,`type-${e.item.type}`,{"is-label-hidden":e.item.hideLabel===!0}]]),"data-item-id":e.id,role:`group`},[E.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,H,(0,t.toDisplayString)(v.value),1)):(0,t.createCommentVNode)(``,!0),e.item.type===`groupButton`?((0,t.openBlock)(),(0,t.createBlock)(R,{key:1,id:e.item.id,label:e.item.label??``,options:e.item.props?.options??[],multiple:!!e.item.props?.multiple,disabled:e.item.disabled,onChange:D},null,8,[`id`,`label`,`options`,`multiple`,`disabled`])):e.item.type===`gallery`?((0,t.openBlock)(),(0,t.createBlock)(F,{key:2,id:e.item.id,label:e.item.label??``,categories:e.item.props?.categories??[],"preview-fallback":o.galleryPreviewFallback,disabled:e.item.disabled,onSelect:D},null,8,[`id`,`label`,`categories`,`preview-fallback`,`disabled`])):e.item.type===`template`?((0,t.openBlock)(),(0,t.createBlock)(B,{key:3,id:e.item.id,item:e.item},{default:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`template`,{item:e.item})]),_:3},8,[`id`,`item`])):e.item.type===`dropdown`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdown),{key:4,trigger:`click`,disabled:e.item.disabled,"popper-class":f.value,onVisibleChange:O,onCommand:k},{dropdown:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElDropdownMenu),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElDropdownItem),{key:String(e.value),command:e.value},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,K,[N(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-dropdown-item__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(N(e))))]),_:2},1024)):P(e)?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-dropdown-item__icon ml-ribbon-dropdown-item__icon--class`,P(e)]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,q,(0,t.toDisplayString)(e.label),1)])]),_:2},1032,[`command`]))),128))]),_:1})]),default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{type:`default`,"aria-label":_.value,onClick:A},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`span`,U,[w.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:0,class:`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--dropdown-primary`,onClick:(0,t.withModifiers)(j,[`stop`])},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(w.value)))]),_:1})])):T.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:1,class:`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class ml-ribbon-item-host__icon--dropdown-primary`,onClick:(0,t.withModifiers)(j,[`stop`])},[(0,t.createElementVNode)(`i`,{class:(0,t.normalizeClass)(T.value),"aria-hidden":`true`},null,2)])):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,W,[g.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,G,(0,t.toDisplayString)(C.value),1)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)((0,t.unref)(n.ElIcon),{class:(0,t.normalizeClass)([`ml-ribbon-item-host__dropdown-arrow`,{"is-open":b.value}])},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(b.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1},8,[`class`])])])]),_:1},8,[`aria-label`])]),_:1},8,[`disabled`,`popper-class`])):e.item.type===`checkbox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElCheckbox),{key:5,disabled:e.item.disabled,onChange:D},{default:(0,t.withCtx)(()=>[(0,t.createTextVNode)((0,t.toDisplayString)(e.item.label),1)]),_:1},8,[`disabled`])):e.item.type===`colorPicker`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElColorPicker),{key:6,disabled:e.item.disabled,onChange:D},null,8,[`disabled`])):e.item.type===`comboBox`?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSelect),{key:7,disabled:e.item.disabled,"popper-class":p.value,style:{width:`92px`},onChange:D},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(l.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElOption),{key:String(e.value),label:String(e.label),value:e.value},null,8,[`label`,`value`]))),128))]),_:1},8,[`disabled`,`popper-class`])):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:8,disabled:e.item.disabled,"aria-label":_.value,onClick:D},{default:(0,t.withCtx)(()=>[m.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-item-host__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(m.value)))]),_:1})):h.value?((0,t.openBlock)(),(0,t.createElementBlock)(`i`,{key:1,class:(0,t.normalizeClass)([`ml-ribbon-item-host__icon ml-ribbon-item-host__icon--class`,h.value]),"aria-hidden":`true`},null,2)):(0,t.createCommentVNode)(``,!0),g.value?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,ee,(0,t.toDisplayString)(e.item.label??e.item.id),1)):(0,t.createCommentVNode)(``,!0)]),_:1},8,[`disabled`,`aria-label`]))],10,V))}}),Y=(0,t.defineComponent)({__name:`RibbonGroupContent`,props:{group:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:n}){let r=e,i=n;return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{class:(0,t.normalizeClass)([`ml-ribbon-group__content`,[`ml-ribbon-group__content--${r.group.orientation??`column`}`]])},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(r.group.collections??[],e=>((0,t.openBlock)(),(0,t.createBlock)(D,{id:e.id,key:e.id,layout:e.layout??(r.group.orientation===`row`?`row`:`column`),rows:e.rows},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(e.items,e=>((0,t.openBlock)(),(0,t.createBlock)(J,{id:e.id,key:e.id,item:e,"group-id":r.group.id,"gallery-preview-fallback":r.galleryPreviewFallback,onItemClick:t=>i(`item-click`,{groupId:r.group.id,itemId:e.id})},null,8,[`id`,`item`,`group-id`,`gallery-preview-fallback`,`onItemClick`]))),128))]),_:2},1032,[`id`,`layout`,`rows`]))),128))],2))}}),te=[`data-priority`],X={class:`ml-ribbon-group__body`},Z={class:`ml-ribbon-group__footer`},Q={class:`ml-ribbon-group__title`},$=[`aria-label`,`aria-expanded`],ne={class:`ml-ribbon-group__overflow-content`},re=[`aria-label`,`aria-expanded`],ie={class:`ml-ribbon-group__overflow-content`},ae=(0,t.defineComponent)({__name:`RibbonGroup`,props:{id:{},title:{},icon:{},groupIconCss:{},orientation:{},autoWidth:{type:Boolean},priority:{},launcher:{type:Boolean},showLauncherIcon:{type:Boolean},groupModel:{},overflowTriggerAriaLabel:{},galleryPreviewFallback:{}},emits:[`item-click`],setup(e,{emit:i}){let a=e,o=i,s=(0,t.computed)(()=>a.autoWidth!==!1),c=(0,t.ref)(null),l=(0,t.ref)([]),u=(0,t.ref)(null),d=(0,t.ref)(null),f=(0,t.ref)(0),p=(0,t.ref)(0),m=(0,n.useGlobalConfig)(`size`,``),h=(0,t.computed)(()=>m.value||`default`),g=(0,t.computed)(()=>`ml-ribbon-group__overflow-popover ml-ribbon-group__overflow-popover--size-${h.value}`),_=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[f.value,8]}}]})),v=(0,t.computed)(()=>({modifiers:[{name:`offset`,options:{offset:[p.value,8]}}]})),y=(0,t.computed)(()=>!a.icon||typeof a.icon==`string`?null:a.icon),b=(0,t.computed)(()=>l.value.length>0),x=(0,t.computed)(()=>(a.groupModel?.footerMenuItems?.length??0)>0),S=(0,t.ref)(!1),C=(0,t.ref)(!1),w=(0,t.computed)(()=>{if(!a.groupModel||!l.value.length)return null;let e=new Set(l.value),t=a.groupModel.collections?.map(t=>({...t,items:t.items.filter(t=>e.has(t.id))})).filter(e=>e.items.length>0)??[];return t.length?{...a.groupModel,collections:t}:null}),T=(0,t.computed)(()=>a.groupModel?.footerMenuItems?.length?{id:`${a.groupModel.id}-footer-menu`,title:``,orientation:`row`,collections:[{id:`${a.groupModel.id}-footer-menu-collection`,layout:`row`,items:a.groupModel.footerMenuItems}]}:null);function E(){let e=c.value?.querySelector(`.ml-ribbon-group__content`);if(!e){l.value.length>0&&(l.value=[]);return}let t=e.getBoundingClientRect();if(t.width<=0||t.height<=0){l.value.length>0&&(l.value=[]);return}let n=[];e.querySelectorAll(`.ml-ribbon-item-host[data-item-id]`).forEach(e=>{let r=e.dataset.itemId;if(!r)return;let i=e.getBoundingClientRect();(i.right-t.right>.5||i.bottom-t.bottom>.5||t.left-i.left>.5||t.top-i.top>.5)&&n.push(r)}),l.value.length===n.length&&l.value.every((e,t)=>e===n[t])||(l.value=n)}function D(){(0,t.nextTick)(()=>{I(),O(),k(),E()})}function O(){let e=c.value?.getBoundingClientRect(),t=u.value?.getBoundingClientRect();if(!e||!t){f.value!==0&&(f.value=0);return}let n=Math.round(e.left-t.left);f.value!==n&&(f.value=n)}function k(){let e=c.value?.getBoundingClientRect(),t=d.value?.getBoundingClientRect();if(!e||!t){p.value!==0&&(p.value=0);return}let n=Math.round(e.left-t.left);p.value!==n&&(p.value=n)}function A(e){S.value=e}function j(e){C.value=e}function M(){S.value=!S.value}function N(){C.value=!C.value}let P=null,F=null;function I(){if(!P)return;let e=c.value?.querySelector(`.ml-ribbon-group__content`)??null;F!==e&&(F&&P.unobserve(F),e&&P.observe(e),F=e)}return(0,t.watch)(()=>a.groupModel,()=>{D()},{deep:!0}),(0,t.onMounted)(()=>{typeof ResizeObserver<`u`&&(P=new ResizeObserver(()=>{O(),k(),E()}),c.value&&P.observe(c.value),I()),D()}),(0,t.onUnmounted)(()=>{P?.disconnect()}),(i,a)=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{ref_key:`groupSectionRef`,ref:c,class:(0,t.normalizeClass)([`ml-ribbon-group`,{"ml-ribbon-group--auto-width":s.value}]),"data-priority":e.priority??100},[(0,t.createElementVNode)(`div`,X,[(0,t.renderSlot)(i.$slots,`default`)]),(0,t.createElementVNode)(`footer`,Z,[y.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(y.value)))]),_:1})):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,Q,(0,t.toDisplayString)(e.title),1),x.value&&T.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:1,trigger:`click`,placement:`bottom-start`,"popper-class":g.value,"popper-options":v.value,onShow:a[1]||=e=>A(!0),onHide:a[2]||=e=>A(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`footerTriggerRef`,ref:d,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__footer-trigger`,{"is-open":S.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":S.value,onClick:M},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(S.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,$)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ne,[(0,t.createVNode)(Y,{group:T.value,"gallery-preview-fallback":e.galleryPreviewFallback,onItemClick:a[0]||=e=>o(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`])])]),_:1},8,[`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),b.value&&w.value?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:2,trigger:`click`,placement:`bottom-start`,"popper-class":g.value,"popper-options":_.value,onShow:a[4]||=e=>j(!0),onHide:a[5]||=e=>j(!1)},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{ref_key:`overflowTriggerRef`,ref:u,type:`button`,class:(0,t.normalizeClass)([`ml-ribbon-group__overflow-trigger`,{"is-open":C.value}]),"aria-label":e.overflowTriggerAriaLabel,"aria-expanded":C.value,onClick:N},[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(C.value?(0,t.unref)(r.ArrowUp):(0,t.unref)(r.ArrowDown))))]),_:1})],10,re)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ie,[(0,t.createVNode)(Y,{group:w.value,"gallery-preview-fallback":e.galleryPreviewFallback,onItemClick:a[3]||=e=>o(`item-click`,e)},null,8,[`group`,`gallery-preview-fallback`])])]),_:1},8,[`popper-class`,`popper-options`])):(0,t.createCommentVNode)(``,!0),e.showLauncherIcon??e.launcher?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElButton),{key:3,link:``,class:`ml-ribbon-group__launcher`},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElIcon),null,{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(r.Promotion))]),_:1})]),_:1})):(0,t.createCommentVNode)(``,!0)])],10,te))}}),oe={class:`ml-ribbon__header`},se={class:`ml-ribbon__head-left`},ce={class:`ml-ribbon__head-right`},le={key:2,class:`ml-ribbon__tabs-extra`},ue=[`data-active-tab`],de={key:0,class:`ml-ribbon-group ml-ribbon-group--overflow`},fe={class:`ml-ribbon-group__body ml-ribbon-group__body--overflow`},pe=[`aria-label`],me={class:`ml-ribbon-overflow-list`},he={class:`ml-ribbon-overflow-group__header`},ge=[`data-active-tab`],_e={class:`ml-ribbon-simplified-group`,type:`button`},ve={class:`ml-ribbon-simplified-group__panel`},ye=40,be=(0,t.defineComponent)({__name:`Ribbon`,props:{id:{default:`ml-ribbon-root`},tabs:{},activeTab:{default:``},activeLayout:{default:void 0},layout:{default:`classic`},size:{default:void 0},minimized:{type:Boolean,default:!1},hideLayoutSwitcher:{type:Boolean,default:!1},hideMinimizeButton:{type:Boolean,default:!1},hideKeyTipsToggle:{type:Boolean,default:!1},showFileMenu:{type:Boolean,default:!0},showOpenBackstage:{type:Boolean,default:!0},fileMenuItems:{default:()=>[]},texts:{default:()=>({})}},emits:[`update:activeTab`,`update:layout`,`update:minimized`,`tabChange`,`layoutChange`,`itemClick`,`overflowOpen`,`overflowClose`,`backstageOpen`,`backstageClose`,`fileMenuSelect`],setup(e,{expose:a,emit:o}){function s(e){return e==null||typeof e==`string`?e:typeof e==`object`||typeof e==`function`?(0,t.markRaw)((0,t.toRaw)(e)):e}function c(e){if(!e)return;let t={...e};return`icon`in t&&(t.icon=s(t.icon)),Array.isArray(t.options)&&(t.options=t.options.map(e=>{if(!e||typeof e!=`object`)return e;let t=e;return`icon`in t?{...t,icon:s(t.icon)}:t})),t}function l(e){return{...e,icon:s(e.icon),props:c(e.props)}}function u(e){return{...e,icon:s(e.icon),footerMenuItems:e.footerMenuItems?.map(l),collections:e.collections?.map(e=>({...e,items:e.items?.map(l)}))}}function d(e){return e.map(e=>({...e,groups:e.groups?.map(u)}))}let f={layoutSwitcherTooltip:`Switch ribbon layout`,minimizeTooltip:`Minimize ribbon`,keyTipsToggleText:`Key Tips`,overflowTriggerAriaLabel:`Open overflow groups`,groupOverflowTriggerAriaLabel:`Open group menu`,fileMenuLabel:`File`,fileMenuOpenBackstageLabel:`Open backstage`,backstageBackLabel:`Back`,backstageTitle:`Backstage`,backstageDescription:`Manage your document and settings here.`,keyTipsSequencePrefix:`Sequence:`,keyTipsEmptySequence:`No key sequence`,contextualTabDefaultTitle:`Contextual`,galleryPreviewFallback:`Preview unavailable`},m=e,h=o,{context:g,visibleTabs:_}=p(m.id,m.tabs,m.activeLayout?String(m.activeLayout).toLowerCase()===`simplified`?`simplified`:`classic`:m.layout,m.minimized,m.activeTab||m.tabs[0]?.id||``);(0,t.provide)(i,g),(0,t.watch)(()=>m.tabs,e=>{g.tabs.value=d(e),g.tabs.value.some(e=>e.id===g.activeTab.value)||(g.activeTab.value=g.tabs.value[0]?.id||``)},{deep:!0}),(0,t.watch)(()=>m.layout,e=>{e!==g.layout.value&&(g.layout.value=e)}),(0,t.watch)(()=>m.activeLayout,e=>{if(!e)return;let t=String(e).toLowerCase()===`simplified`?`simplified`:`classic`;t!==g.layout.value&&(g.layout.value=t)}),(0,t.watch)(()=>m.minimized,e=>{e!==g.minimized.value&&(g.minimized.value=e)}),(0,t.watch)(()=>m.activeTab,e=>{e&&e!==g.activeTab.value&&(g.activeTab.value=e)}),(0,t.watch)(g.activeTab,e=>{h(`update:activeTab`,e),h(`tabChange`,e)}),(0,t.watch)(g.layout,e=>{h(`update:layout`,e),h(`layoutChange`,e)}),(0,t.watch)(g.minimized,e=>{h(`update:minimized`,e)}),(0,t.watch)(g.overflowOpen,e=>{h(e?`overflowOpen`:`overflowClose`)}),(0,t.watch)(g.backdropOpen,e=>{h(e?`backstageOpen`:`backstageClose`)});let y=(0,t.computed)(()=>_.value.find(e=>e.id===g.activeTab.value)),b=(0,t.computed)(()=>y.value?.groups?.filter(e=>e.visible!==!1)??[]),x=(0,t.ref)(null),S=(0,t.ref)(new Set),C=(0,t.ref)({}),w=(0,n.useGlobalConfig)(`size`,``),D=(0,t.computed)(()=>m.size||w.value||`default`),O=(0,t.computed)(()=>`ml-ribbon-group-popover ml-ribbon-group-popover--size-${D.value}`),k=(0,t.computed)(()=>`ml-ribbon-overflow-popover ml-ribbon-overflow-popover--size-${D.value}`),A=(0,t.computed)(()=>({layoutSwitcherTooltip:m.texts.layoutSwitcherTooltip||f.layoutSwitcherTooltip,minimizeTooltip:m.texts.minimizeTooltip||f.minimizeTooltip,keyTipsToggleText:m.texts.keyTipsToggleText||f.keyTipsToggleText,overflowTriggerAriaLabel:m.texts.overflowTriggerAriaLabel||f.overflowTriggerAriaLabel,groupOverflowTriggerAriaLabel:m.texts.groupOverflowTriggerAriaLabel||f.groupOverflowTriggerAriaLabel,fileMenuLabel:m.texts.fileMenuLabel||f.fileMenuLabel,fileMenuOpenBackstageLabel:m.texts.fileMenuOpenBackstageLabel||f.fileMenuOpenBackstageLabel,backstageBackLabel:m.texts.backstageBackLabel||f.backstageBackLabel,backstageTitle:m.texts.backstageTitle||f.backstageTitle,backstageDescription:m.texts.backstageDescription||f.backstageDescription,keyTipsSequencePrefix:m.texts.keyTipsSequencePrefix||f.keyTipsSequencePrefix,keyTipsEmptySequence:m.texts.keyTipsEmptySequence||f.keyTipsEmptySequence,contextualTabDefaultTitle:m.texts.contextualTabDefaultTitle||f.contextualTabDefaultTitle,galleryPreviewFallback:m.texts.galleryPreviewFallback||f.galleryPreviewFallback})),j=(0,t.computed)(()=>g.minimized.value?r.ArrowUpBold:r.ArrowDownBold),M=(0,t.computed)(()=>b.value.filter(e=>!S.value.has(e.id))),N=(0,t.computed)(()=>b.value.filter(e=>S.value.has(e.id))),P=(0,t.computed)(()=>{if(!N.value.length)return 220;let e=N.value.reduce((e,t)=>{let n=C.value[t.id]??L(t);return Math.max(e,n)},0),t=Math.ceil(e+40);return Math.max(220,Math.min(720,t))});function F(e){let t=(e.collections??[]).flatMap(e=>(e.items??[]).map(e=>({...l(e),size:`medium`})));return{...e,orientation:`row`,collections:[{id:`${e.id}-simplified`,layout:`row`,items:t}]}}function I(e){return e.priority??100}function L(e){return e.autoWidth===!1?190:140}function R(e){let t={};return e.querySelectorAll(`.ml-ribbon-group`).forEach(e=>{let n=e.dataset.groupId;if(!n)return;let r=e.getBoundingClientRect().width;r>0&&(t[n]=r)}),t}function z(e){let t=Number.parseFloat(getComputedStyle(e).getPropertyValue(`--ml-rb-overflow-slot-width`));return Number.isFinite(t)&&t>0?t:ye}function B(){if(g.layout.value!==`classic`){S.value=new Set;return}let e=x.value;if(!e)return;let t=b.value;if(!t.length){S.value=new Set;return}let n=Math.round(e.getBoundingClientRect().width),r=z(e),i=R(e);C.value={...C.value,...i};let a=t.filter(e=>e.enableGroupOverflow===!1),o=t.filter(e=>e.enableGroupOverflow!==!1).map((e,t)=>({group:e,index:t})),s=new Set,c=[...o].sort((e,t)=>{let n=I(t.group)-I(e.group);return n===0?t.index-e.index:n}),l=e=>i[e.id]??L(e),u=a.reduce((e,t)=>e+l(t),0),d=e=>o.filter(({group:t})=>!e.has(t.id)).reduce((e,{group:t})=>e+l(t),0),f=e=>u+d(e)+(e.size>0?r:0),p=0;for(;f(s)>n&&p<c.length;){let e=c[p].group;s.add(e.id),p+=1}S.value=s}function V(){(0,t.nextTick)(()=>{if(g.layout.value!==`classic`||g.minimized.value){B();return}if(S.value.size===0){B();return}S.value=new Set,(0,t.nextTick)(()=>{B()})})}function H(e){g.activeTab.value=e}function U(){g.api.toggleSimplified()}function W(){g.minimized.value=!g.minimized.value}function G(e){h(`fileMenuSelect`,e)}function K(){g.backdropOpen.value=!1}function q(e,t){h(`itemClick`,{tabId:g.activeTab.value,groupId:e,itemId:t})}function ee(e){if(!(e instanceof HTMLElement))return!1;if(e.isContentEditable)return!0;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`}function J(){let e=y.value;if(!e?.groups?.length){g.keyTips.value=[];return}let t=e.groups.filter(e=>e.visible!==!1).flatMap(t=>(t.collections??[]).flatMap(n=>n.items.filter(e=>e.keyTip&&e.disabled!==!0).map(n=>{let r=n.keyTip?.trim().toUpperCase();return r?{id:`${e.id}:${t.id}:${n.id}`,key:r,targetId:n.id,sequence:r.split(``),scope:`item`}:null}).filter(e=>!!e)));g.keyTips.value=t}function te(e){let t=y.value;if(t?.groups?.length){for(let n of t.groups)if(n.visible!==!1)for(let t of n.collections??[]){let r=t.items.find(t=>t.id===e.targetId&&t.disabled!==!0);if(r){q(n.id,r.id),g.keyTipsOpen.value=!1,g.keyTipsSequence.value=``;return}}}}function X(){g.keyTipsSequence.value=``}function Z(e){if(!ee(e.target)){if(e.altKey&&!e.ctrlKey&&!e.metaKey&&e.key===`Alt`){e.preventDefault(),g.keyTipsOpen.value=!g.keyTipsOpen.value,g.keyTipsOpen.value||X();return}if(g.keyTipsOpen.value&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),g.keyTipsOpen.value=!1,X();return}if(e.key===`Backspace`){e.preventDefault(),g.keyTipsSequence.value=g.keyTipsSequence.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){e.preventDefault();let t=`${g.keyTipsSequence.value}${e.key.toUpperCase()}`;g.keyTipsSequence.value=t;let n=t.toLowerCase(),r=g.keyTips.value.find(e=>e.key.toLowerCase()===n);if(r){te(r);return}g.keyTips.value.some(e=>e.key.toLowerCase().startsWith(n))||X()}}}}function Q(e){return e.icon&&typeof e.icon!=`string`?e.icon:e.groupIconCss?r.Grid:null}(0,t.watch)([b,()=>g.layout.value,()=>g.minimized.value],()=>{V()}),(0,t.watch)([y,()=>g.tabs.value],()=>{J(),X()},{deep:!0,immediate:!0}),(0,t.watch)(()=>g.keyTipsOpen.value,e=>{e||X()}),(0,t.watch)(x,(e,t)=>{t&&$&&$.unobserve(t),e&&$&&$.observe(e)},{flush:`post`});let $=null;return(0,t.onMounted)(()=>{window.addEventListener(`keydown`,Z),typeof ResizeObserver<`u`&&($=new ResizeObserver(()=>{V()}),x.value&&$.observe(x.value)),V()}),(0,t.onUnmounted)(()=>{window.removeEventListener(`keydown`,Z),$?.disconnect()}),a(g.api),(i,a)=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElConfigProvider),{size:m.size},{default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`section`,{class:(0,t.normalizeClass)([`ml-ribbon`,[`ml-ribbon--${(0,t.unref)(g).layout.value}`,`ml-ribbon--size-${D.value}`,{"ml-ribbon--minimized":(0,t.unref)(g).minimized.value,"ml-ribbon--keytips-open":(0,t.unref)(g).keyTipsOpen.value}]])},[(0,t.createElementVNode)(`header`,oe,[(0,t.createElementVNode)(`div`,se,[e.showFileMenu?((0,t.openBlock)(),(0,t.createBlock)(E,{key:0,items:e.fileMenuItems,label:A.value.fileMenuLabel,"open-backstage-label":A.value.fileMenuOpenBackstageLabel,"show-open-backstage":e.showOpenBackstage,onSelect:G,onOpenBackstage:a[0]||=e=>(0,t.unref)(g).backdropOpen.value=!0},null,8,[`items`,`label`,`open-backstage-label`,`show-open-backstage`])):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(T,{tabs:(0,t.unref)(_),"active-tab":(0,t.unref)(g).activeTab.value,"default-contextual-title":A.value.contextualTabDefaultTitle,onSelect:H},null,8,[`tabs`,`active-tab`,`default-contextual-title`]),m.hideMinimizeButton?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:1,content:A.value.minimizeTooltip},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{class:(0,t.normalizeClass)([`ml-ribbon__control`,`ml-ribbon__control--minimize`,(0,t.unref)(g).minimized.value?`ml-ribbon__control--minimize-up`:`ml-ribbon__control--minimize-down`]),icon:j.value,onClick:W},null,8,[`class`,`icon`])]),_:1},8,[`content`]))]),(0,t.createElementVNode)(`div`,ce,[m.hideLayoutSwitcher?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElTooltip),{key:0,content:A.value.layoutSwitcherTooltip},{default:(0,t.withCtx)(()=>[(0,t.createVNode)((0,t.unref)(n.ElButton),{circle:``,class:`ml-ribbon__control ml-ribbon__control--layout`,icon:(0,t.unref)(r.Menu),onClick:U},null,8,[`icon`])]),_:1},8,[`content`])),m.hideKeyTipsToggle?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElSwitch),{key:1,"inline-prompt":``,class:`ml-ribbon__control ml-ribbon__control--keytips`,"active-text":A.value.keyTipsToggleText,"inactive-text":A.value.keyTipsToggleText,"model-value":(0,t.unref)(g).keyTipsOpen.value,onChange:a[1]||=e=>(0,t.unref)(g).keyTipsOpen.value=!(0,t.unref)(g).keyTipsOpen.value},null,8,[`active-text`,`inactive-text`,`model-value`])),i.$slots[`tabs-extra`]?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,le,[(0,t.renderSlot)(i.$slots,`tabs-extra`,{activeTab:(0,t.unref)(g).activeTab.value,layout:(0,t.unref)(g).layout.value,minimized:(0,t.unref)(g).minimized.value})])):(0,t.createCommentVNode)(``,!0)])]),!(0,t.unref)(g).minimized.value&&y.value&&(0,t.unref)(g).layout.value===`classic`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:0,class:`ml-ribbon__panel`,"data-active-tab":y.value.id,ref_key:`classicPanelRef`,ref:x},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(M.value,e=>((0,t.openBlock)(),(0,t.createBlock)(ae,{id:e.id,key:e.id,"data-group-id":e.id,title:e.title,icon:e.icon,"group-icon-css":e.groupIconCss,orientation:e.orientation,"auto-width":e.autoWidth,priority:e.priority??100,launcher:e.launcher,"show-launcher-icon":e.showLauncherIcon,"group-model":e,"overflow-trigger-aria-label":A.value.groupOverflowTriggerAriaLabel,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[3]||=e=>q(e.groupId,e.itemId)},{default:(0,t.withCtx)(()=>[(0,t.createVNode)(Y,{group:e,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[2]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])]),_:2},1032,[`id`,`data-group-id`,`title`,`icon`,`group-icon-css`,`orientation`,`auto-width`,`priority`,`launcher`,`show-launcher-icon`,`group-model`,`overflow-trigger-aria-label`,`gallery-preview-fallback`]))),128)),N.value.length?((0,t.openBlock)(),(0,t.createElementBlock)(`section`,de,[(0,t.createElementVNode)(`div`,fe,[(0,t.createVNode)((0,t.unref)(n.ElPopover),{trigger:`click`,placement:`bottom-end`,width:P.value,"popper-class":k.value,onShow:a[5]||=e=>(0,t.unref)(g).overflowOpen.value=!0,onHide:a[6]||=e=>(0,t.unref)(g).overflowOpen.value=!1},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,{type:`button`,class:`ml-ribbon-overflow-trigger`,"aria-label":A.value.overflowTriggerAriaLabel},[...a[8]||=[(0,t.createElementVNode)(`span`,{class:`ml-ribbon-overflow-trigger__dots`},`...`,-1)]],8,pe)]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,me,[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(N.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`section`,{key:e.id,class:`ml-ribbon-overflow-group`},[(0,t.createElementVNode)(`header`,he,(0,t.toDisplayString)(e.title),1),(0,t.createVNode)(Y,{group:e,"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[4]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])]))),128))])]),_:1},8,[`width`,`popper-class`])]),a[9]||=(0,t.createElementVNode)(`footer`,{class:`ml-ribbon-group__footer ml-ribbon-group__footer--overflow`},null,-1)])):(0,t.createCommentVNode)(``,!0)],8,ue)):(0,t.createCommentVNode)(``,!0),!(0,t.unref)(g).minimized.value&&y.value&&(0,t.unref)(g).layout.value===`simplified`?((0,t.openBlock)(),(0,t.createElementBlock)(`main`,{key:1,class:`ml-ribbon__panel ml-ribbon__panel--simplified`,"data-active-tab":y.value.id},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(b.value,e=>((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElPopover),{key:e.id,trigger:`click`,placement:`bottom-start`,width:340,"popper-class":O.value},{reference:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`button`,_e,[Q(e)?((0,t.openBlock)(),(0,t.createBlock)((0,t.unref)(n.ElIcon),{key:0,class:`ml-ribbon-simplified-group__icon`},{default:(0,t.withCtx)(()=>[((0,t.openBlock)(),(0,t.createBlock)((0,t.resolveDynamicComponent)(Q(e))))]),_:2},1024)):(0,t.createCommentVNode)(``,!0),(0,t.createElementVNode)(`span`,null,(0,t.toDisplayString)(e.title),1)])]),default:(0,t.withCtx)(()=>[(0,t.createElementVNode)(`div`,ve,[(0,t.createVNode)(Y,{group:F(e),"gallery-preview-fallback":A.value.galleryPreviewFallback,onItemClick:a[7]||=e=>q(e.groupId,e.itemId)},null,8,[`group`,`gallery-preview-fallback`])])]),_:2},1032,[`popper-class`]))),128))],8,ge)):(0,t.createCommentVNode)(``,!0),(0,t.createVNode)(v,{open:(0,t.unref)(g).backdropOpen.value,size:D.value,"back-label":A.value.backstageBackLabel,title:A.value.backstageTitle,description:A.value.backstageDescription,onClose:K},(0,t.createSlots)({_:2},[i.$slots.backstage?{name:`default`,fn:(0,t.withCtx)(()=>[(0,t.renderSlot)(i.$slots,`backstage`,{close:K,open:(0,t.unref)(g).backdropOpen.value,size:D.value,backLabel:A.value.backstageBackLabel,title:A.value.backstageTitle,description:A.value.backstageDescription})]),key:`0`}:void 0]),1032,[`open`,`size`,`back-label`,`title`,`description`])],2)]),_:3},8,[`size`]))}}),xe={class:`ml-ribbon-tab-definition`,hidden:``},Se=(0,t.defineComponent)({__name:`RibbonTab`,props:{id:{},title:{},visible:{type:Boolean},contextual:{type:Boolean},contextualColor:{},contextualTitle:{}},setup(e){return(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,xe,[(0,t.renderSlot)(e.$slots,`default`)]))}}),Ce={key:0,class:`ml-ribbon-keytips`,"aria-live":`polite`},we={class:`ml-ribbon-keytips__hint`},Te=(0,t.defineComponent)({__name:`RibbonKeyTips`,props:{open:{type:Boolean},tips:{default:()=>[]},sequencePrefix:{},emptySequenceText:{}},emits:[`activate`,`close`],setup(e,{emit:n}){let r=e,i=n,a=(0,t.ref)(``),o=(0,t.computed)(()=>a.value?r.tips.filter(e=>e.key.toLowerCase().startsWith(a.value.toLowerCase())):r.tips),s=(0,t.computed)(()=>a.value||r.emptySequenceText||``),c=(0,t.computed)(()=>r.sequencePrefix?`${r.sequencePrefix}${s.value}`:s.value),l=(0,t.computed)(()=>a.value.toLowerCase()),u=(0,t.computed)(()=>r.tips.filter(e=>e.key.toLowerCase()===l.value)),d=(0,t.computed)(()=>r.tips.some(e=>e.key.toLowerCase().startsWith(l.value)));function f(){a.value=``}function p(e){if(r.open&&!(e.altKey||e.ctrlKey||e.metaKey)){if(e.key===`Escape`){e.preventDefault(),f(),i(`close`);return}if(e.key===`Backspace`){e.preventDefault(),a.value=a.value.slice(0,-1);return}if(/^[a-z0-9]$/i.test(e.key)){if(e.preventDefault(),a.value+=e.key.toUpperCase(),u.value.length>0){i(`activate`,u.value[0]),f();return}d.value||f()}}}return(0,t.onMounted)(()=>window.addEventListener(`keydown`,p)),(0,t.onUnmounted)(()=>window.removeEventListener(`keydown`,p)),(0,t.watch)(()=>r.open,e=>{e||f()}),(n,r)=>e.open?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,Ce,[(0,t.createElementVNode)(`div`,we,(0,t.toDisplayString)(c.value),1),((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(o.value,e=>((0,t.openBlock)(),(0,t.createElementBlock)(`span`,{key:e.id,class:`ml-ribbon-keytip`},(0,t.toDisplayString)(e.key),1))),128))])):(0,t.createCommentVNode)(``,!0)}});e.MlRibbon=be,e.MlRibbonBackstage=v,e.MlRibbonCollection=D,e.MlRibbonContextualTabs=T,e.MlRibbonFileMenu=E,e.MlRibbonGallery=F,e.MlRibbonGroup=ae,e.MlRibbonGroupButton=R,e.MlRibbonItemHost=J,e.MlRibbonKeyTips=Te,e.MlRibbonTab=Se,e.MlRibbonTabs=x,e.MlRibbonTemplateItem=B});
|