@ds-mo/ui 14.26.0 → 14.27.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.package-ready.json +1 -1
- package/dist/agent-patterns.json +1 -1
- package/dist/agent.json +5 -5
- package/dist/components/ds-card-overview.js +1 -1
- package/dist/components/ds-field.js +1 -1
- package/dist/components/ds-score.js +1 -1
- package/dist/components/ds-table-group.js +1 -1
- package/dist/components/ds-table-group.js.map +1 -1
- package/dist/components/ds-table-saved-views.js +1 -1
- package/dist/components/ds-table.js +1 -1
- package/dist/components/p-Ctnm9NJP.js +2 -0
- package/dist/components/p-Ctnm9NJP.js.map +1 -0
- package/dist/components/{p-DRyrcR2k.js → p-VT-5XDkB.js} +2 -2
- package/dist/components/p-VT-5XDkB.js.map +1 -0
- package/dist/docs/components.json +3 -3
- package/dist/mcp-data/registry/field.json +1 -1
- package/dist/mcp-data/registry/registry.json +4 -4
- package/dist/mcp-data/registry/score.json +1 -1
- package/dist/mcp-data/registry/table-group.json +5 -5
- package/dist/mcp-data/registry/table.json +1 -1
- package/dist/types/components/Field/Field.d.ts +7 -0
- package/dist/types/components/Table/table-types.d.ts +2 -0
- package/dist/types/components/TableGroup/TableGroup.d.ts +13 -3
- package/package.json +1 -1
- package/dist/components/p-DRyrcR2k.js.map +0 -1
- package/dist/components/p-DVLghmNY.js +0 -2
- package/dist/components/p-DVLghmNY.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{d}from"./p-BMzn2Cmw.js";import{d as o}from"./p-Bjt_8sLe.js";import{d as l}from"./p-6_CNVbqa.js";import{d as r}from"./p-BXDLR072.js";import{d as h}from"./p-BVz-r3g0.js";import{d as c}from"./p-
|
|
1
|
+
import{p as e,H as s,c as t,h as i,a,t as n}from"./index.js";import{d}from"./p-BMzn2Cmw.js";import{d as o}from"./p-Bjt_8sLe.js";import{d as l}from"./p-6_CNVbqa.js";import{d as r}from"./p-BXDLR072.js";import{d as h}from"./p-BVz-r3g0.js";import{d as c}from"./p-Ctnm9NJP.js";import{d as m}from"./p-Cea7rROU.js";import{d as f}from"./p-to8BxxgT.js";import{d as u}from"./p-0XTyQNRG.js";import{d as b}from"./p-DlbhmXjH.js";import{d as p}from"./p-B3sRZBZk.js";import{d as v}from"./p-GEi3hDJQ.js";import{d as w}from"./p-Q7AOgrg5.js";import{d as g}from"./p-DGkn8FwV.js";import{d as k}from"./p-BIGpc__9.js";import{d as D}from"./p-DQQsS9Rx.js";import{d as E}from"./p-DW8ssbfI.js";const x=()=>`.sc-ds-table-saved-views-h{--ds-choice-popup-min-inline-size:var(--dimension-menu-width-xs);display:inline-block;min-inline-size:0;max-inline-size:var(--dimension-menu-width-xs)}ds-select.sc-ds-table-saved-views{display:block;min-inline-size:0;max-inline-size:100%}.table-saved-views__dialog-actions.sc-ds-table-saved-views{display:flex;align-items:center;justify-content:flex-start;gap:var(--dimension-space-100)}`;let y=0;const j=e(class e extends s{constructor(e){super();if(e!==false){this.__registerHost()}this.dsViewChange=t(this,"dsViewChange",7);this.dsViewCreate=t(this,"dsViewCreate",7);this.dsViewRename=t(this,"dsViewRename",7);this.dsViewRemove=t(this,"dsViewRemove",7);this.dsViewSave=t(this,"dsViewSave",7);this.dsViewDiscard=t(this,"dsViewDiscard",7);this.views=[];this.value="__default__";this.dirty=false;this.defaultViewId="__default__";this.defaultViewLabel="Default";this.label="Saved views";this.triggerLabel="Views";this.createLabel="New view";this.actionViewId=null;this.actionMenuOpen=false;this.actionMenuInitialFocusVisible=false;this.dialogOpen=false;this.dialogMode="create";this.dialogViewId=null;this.nameDraft="";this.nameError="";this.componentId=`ds-table-saved-views-${++y}`;this.selectId=`${this.componentId}-select`;this.actionMenuId=`${this.componentId}-actions`;this.fieldId=`${this.componentId}-name-field`;this.inputId=`${this.componentId}-name-input`;this.actionItems=[{label:"Rename",value:"rename"},{label:"Remove",value:"remove",isDestructive:true}]}get selectedCustomView(){return this.views.find((e=>e.id===this.value))}get dialogView(){return this.views.find((e=>e.id===this.dialogViewId))}get sections(){const e=this.views.map((e=>({label:e.label,value:e.id,subtextActions:this.dirty&&e.id===this.selectedCustomView?.id?[{label:"Save",value:"save"},{label:"Discard",value:"discard",tone:"negative"}]:undefined,action:{label:`Options for ${e.label}`,controls:this.actionMenuId,expanded:this.actionViewId===e.id&&this.actionMenuOpen}})));const s={header:"Templates",options:[{label:this.defaultViewLabel,value:this.defaultViewId}],divider:e.length>0};return e.length>0?[s,{header:"Custom",options:e}]:[s]}handleViewChange(e){if(typeof e==="string")this.dsViewChange.emit({viewId:e})}handleSubtextAction(e){const s=this.selectedCustomView;if(!s||!this.dirty||e.value!==s.id)return;if(e.actionValue==="save")this.dsViewSave.emit({viewId:s.id});if(e.actionValue==="discard")this.dsViewDiscard.emit({viewId:s.id})}handleOptionAction(e){if(!this.views.some((s=>s.id===e.value)))return;this.actionMenuInitialFocusVisible=e.originalEvent.detail===0;if(this.actionViewId===e.value&&this.actionMenuOpen){this.actionMenuOpen=false;return}this.actionViewId=e.value;this.actionAnchorId=e.anchorId;this.actionMenuOpen=true}handleActionSelect(e){const s=this.actionViewId;this.actionMenuOpen=false;if(!s)return;if(e.detail.value==="rename")this.openDialog("rename",s);if(e.detail.value==="remove")this.dsViewRemove.emit({viewId:s})}openDialog(e,s=null){const t=e==="rename"?this.views.find((e=>e.id===s)):undefined;if(e==="rename"&&!t)return;this.dialogMode=e;this.dialogViewId=t?.id??null;this.nameDraft=t?.label??"";this.nameError="";this.dialogOpen=true;requestAnimationFrame((()=>{requestAnimationFrame((()=>{const e=this.el.querySelector(`#${this.inputId}`);void e?.setFocus?.()}))}))}validateName(){const e=this.nameDraft.trim();if(!e)return"View name is required.";const s=this.views.some((s=>s.id!==this.dialogViewId&&s.label.trim().toLocaleLowerCase()===e.toLocaleLowerCase()));if(s||this.defaultViewLabel.trim().toLocaleLowerCase()===e.toLocaleLowerCase()){return"A view with this name already exists."}return""}submitDialog(){const e=this.validateName();if(e){this.nameError=e;return}const s=this.nameDraft.trim();if(this.dialogMode==="rename"&&this.dialogView){this.dsViewRename.emit({viewId:this.dialogView.id,name:s})}else{this.dsViewCreate.emit({name:s})}this.dialogOpen=false}finishDialogClose(){if(this.dialogOpen)return;this.dialogViewId=null;this.nameDraft="";this.nameError="";const e=this.el.querySelector(`#${this.selectId}`);void e?.setFocus?.()}render(){return i(a,{key:"01de9feec0a8ea96015a6e6815a7079e361d6536"},i("ds-select",{key:"5e28320496edd027febe3cb1ea1eba0ecdc1c151",id:this.selectId,size:"md",width:"fill",placeholder:this.label,"aria-label":this.label,sections:this.sections,value:this.value,triggerLabel:this.selectedCustomView?undefined:this.triggerLabel,triggerLabelPlaceholder:!this.selectedCustomView,dot:this.dirty&&Boolean(this.selectedCustomView),footerActionLabel:this.createLabel,activeFill:false,allowClear:false,onDsChange:e=>this.handleViewChange(e.detail),onDsFooterAction:()=>this.openDialog("create"),onDsOptionSubtextAction:e=>this.handleSubtextAction(e.detail),onDsOptionAction:e=>this.handleOptionAction(e.detail)}),i("ds-menu",{key:"dc03d3b6e3e0e036e9eebd0a0c1d8c467c099ded",id:this.actionMenuId,anchorId:this.actionAnchorId,menuLabel:"Saved view options",side:"bottom",align:"end",menuWidth:"max-content",minWidth:"0",items:this.actionItems,open:this.actionMenuOpen,initialFocusVisible:this.actionMenuInitialFocusVisible,onDsClose:()=>this.actionMenuOpen=false,onDsAfterClose:()=>{if(this.actionMenuOpen)return;this.actionViewId=null;this.actionAnchorId=undefined},onDsSelect:e=>this.handleActionSelect(e)}),i("ds-modal",{key:"21e01cf0bc7d8f23acecb3e7815541401684e8f3",open:this.dialogOpen,heading:this.dialogMode==="rename"?"Rename view":"Save as new view",modalWidth:"sm",onDsClose:()=>this.dialogOpen=false,onDsAfterClose:()=>this.finishDialogClose()},i("ds-field",{key:"346e2d5dd70d00a1787da39a2eb1624b4e861bb2",label:"Name",fieldId:this.fieldId,error:this.nameError.length>0,errorMessage:this.nameError},i("ds-input",{key:"7e685da71c95342db593c44155d90a0e3430d571",id:this.inputId,size:"md",placeholder:"Enter a unique name",value:this.nameDraft,autoFocus:true,onDsChange:e=>{this.nameDraft=e.detail;if(this.nameError)this.nameError=""},onKeyDown:e=>{if(e.key==="Enter")this.submitDialog()}})),i("div",{key:"9769885246722673269528e0fefa6b1570f1d7f1",slot:"footer",class:"table-saved-views__dialog-actions"},i("ds-button-filled",{key:"d7f721e3f6d0aab39a6a2db65d43d1555222ad36",label:this.dialogMode==="rename"?"Rename":"Save",size:"md",onDsClick:()=>this.submitDialog()}),i("ds-button-unfilled",{key:"75350d51986d1a6c0d1dc72a27b15a769343f07c",label:"Cancel",size:"md",onDsClick:()=>this.dialogOpen=false}))))}get el(){return this}static get style(){return x()}},[2,"ds-table-saved-views",{views:[16],value:[1],dirty:[4],defaultViewId:[1,"default-view-id"],defaultViewLabel:[1,"default-view-label"],label:[1],triggerLabel:[1,"trigger-label"],createLabel:[1,"create-label"],actionViewId:[32],actionAnchorId:[32],actionMenuOpen:[32],actionMenuInitialFocusVisible:[32],dialogOpen:[32],dialogMode:[32],dialogViewId:[32],nameDraft:[32],nameError:[32]}]);function C(){if(typeof customElements==="undefined"){return}const e=["ds-table-saved-views","ds-badge","ds-button-filled","ds-button-unfilled","ds-checkbox","ds-empty-state","ds-field","ds-icon","ds-input","ds-loader","ds-menu","ds-modal","ds-select","ds-swatch-picker","ds-switch","ds-tag","ds-text","ds-tooltip"];e.forEach((e=>{switch(e){case"ds-table-saved-views":if(!customElements.get(n(e))){customElements.define(n(e),j)}break;case"ds-badge":if(!customElements.get(n(e))){d()}break;case"ds-button-filled":if(!customElements.get(n(e))){o()}break;case"ds-button-unfilled":if(!customElements.get(n(e))){l()}break;case"ds-checkbox":if(!customElements.get(n(e))){r()}break;case"ds-empty-state":if(!customElements.get(n(e))){h()}break;case"ds-field":if(!customElements.get(n(e))){c()}break;case"ds-icon":if(!customElements.get(n(e))){m()}break;case"ds-input":if(!customElements.get(n(e))){f()}break;case"ds-loader":if(!customElements.get(n(e))){u()}break;case"ds-menu":if(!customElements.get(n(e))){b()}break;case"ds-modal":if(!customElements.get(n(e))){p()}break;case"ds-select":if(!customElements.get(n(e))){v()}break;case"ds-swatch-picker":if(!customElements.get(n(e))){w()}break;case"ds-switch":if(!customElements.get(n(e))){g()}break;case"ds-tag":if(!customElements.get(n(e))){k()}break;case"ds-text":if(!customElements.get(n(e))){D()}break;case"ds-tooltip":if(!customElements.get(n(e))){E()}break}}))}C();const V=j;const _=C;export{V as DsTableSavedViews,_ as defineCustomElement};
|
|
2
2
|
//# sourceMappingURL=ds-table-saved-views.js.map
|