@univerjs/preset-sheets-sort 0.6.10 → 0.7.0-beta.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/lib/index.css CHANGED
@@ -1 +1 @@
1
- .univer-extend-confirm-content{font-size:14px}.univer-extend-confirm-radio-group{margin-top:16px}.univer-custom-sort-panel-container .univer-custom-sort-panel-ext{display:flex;justify-content:space-between;align-items:center}.univer-custom-sort-panel-container .univer-custom-sort-panel-ext .univer-add-condition{color:#274fee;color:var(---Hyacinth-Blue-500, #274fee);font-size:16px;display:flex;align-items:center;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-custom-sort-panel-container .univer-custom-sort-panel-ext .univer-add-condition-text{margin-left:6px;font-size:12px}.univer-custom-sort-panel-container .univer-custom-sort-panel-ext .univer-add-condition-disable{color:#1e222b;color:var(---Black, #1e222b);opacity:.3;cursor:not-allowed}.univer-custom-sort-panel-container .univer-custom-sort-panel-footer{margin-top:20px;display:flex;justify-content:end}.univer-custom-sort-panel-container .univer-custom-sort-panel-footer-btn{margin-left:12px}.univer-custom-sort-panel-container .univer-custom-sort-panel-item{display:flex;align-items:center;border-bottom:1px solid var(--gray-200)}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-head{display:flex;align-items:center}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-handler{font-size:16px;display:flex;align-items:center;justify-content:center;color:#1e222b;cursor:pointer}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-remove{font-size:14px;color:#4b4b4b;cursor:pointer;width:14px;height:14px;position:absolute;right:0}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-column-input{display:flex;width:236px;padding:6px 10px;justify-content:space-between;align-items:center;margin-left:8px;border-radius:6px;border:1px solid #e5e5e5;border:1px solid var(---Grey-200, #e5e5e5);background:#fff;background:var(---White, #fff);color:#1e222b;color:var(---Black, #1e222b);font-family:PingFang SC;font-size:13px;font-style:normal;font-weight:400;line-height:20px;overflow:hidden}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-column-input-dropdown{width:16px;height:16px;color:#4b4b4b}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-column-input-text{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-order-radio{display:flex;padding:0 10px}.univer-custom-sort-panel-container .univer-custom-sort-panel-item-order-radio-cn{display:flex;padding:0 20px}.univer-custom-sort-panel-container .univer-condition-list{max-height:310px;overflow-y:auto;overflow-x:hidden}.univer-embed-sort-btn-container{display:flex;margin-bottom:12px}.univer-embed-sort-btn-container .univer-embed-sort-btn{font-size:13px;font-style:normal;font-weight:400;display:flex;width:140px;padding:6px 0;justify-content:center;align-items:center;gap:4px;border:1px solid #e5e5e5;border:1px solid var(---Grey-200, #e5e5e5);cursor:default}.univer-embed-sort-btn-container .univer-embed-sort-btn:active{background:#1e222b17}.univer-embed-sort-btn-container .univer-embed-sort-btn:hover{background:#1e222b0f;background:var(--black-6, rgba(30, 34, 43, .06))}.univer-embed-sort-btn-container .univer-embed-sort-btn-asc{border-radius:6px 0 0 6px}.univer-embed-sort-btn-container .univer-embed-sort-btn-desc{border-radius:0 6px 6px 0;margin-left:-1px}.univer-embed-sort-btn-container .univer-embed-sort-btn-icon{font-size:16px;color:#1e222b;margin-right:4px}.univer-custom-sort-col-menu{display:grid;grid-gap:var(--margin-xxs);gap:var(--margin-xxs);align-items:center;box-sizing:border-box;margin-top:0;margin-bottom:0;padding:var(--padding-sm);font-size:var(--font-size-base);background:#fff;background:var(---White, #fff);border:1px solid rgba(30,34,43,.06);border:1px solid var(--black-6, rgba(30, 34, 43, .06));border-radius:8px;border-radius:var(--Radius-4, 8px);box-shadow:0 4px 12px 2px #1e222b1a;max-height:310px;overflow-y:auto;overflow-x:hidden}.univer-custom-sort-col-menu li{list-style:none}.univer-custom-sort-col-menu-item{cursor:pointer;position:relative;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;height:28px;padding:0 8px;font-size:13px;font-weight:400;font-style:normal;line-height:20px;color:#1e222b;color:var(---Black, #1e222b);text-align:left;border-radius:4px;border-radius:var(--border-radius-base);transition:background .2s}.univer-custom-sort-col-menu-item:hover{background:#f5f5f5}.univer-custom-sort-col-menu-item-desc{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
1
+ .univer-absolute{position:absolute}.univer-relative{position:relative}.univer-right-0{right:0}.univer-my-0{margin-top:0;margin-bottom:0}.univer-mb-3{margin-bottom:12px}.univer-ml-1\.5{margin-left:6px}.univer-ml-2{margin-left:8px}.univer-ml-3{margin-left:12px}.univer-mr-1{margin-right:4px}.univer-mt-4{margin-top:16px}.univer-mt-5{margin-top:20px}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-grid{display:grid}.univer-h-7{height:28px}.univer-max-h-\[310px\]{max-height:310px}.univer-w-1\/2{width:50%}.univer-w-\[236px\]{width:236px}.univer-w-\[640px\]{width:640px}.univer-w-full{width:100%}.univer-max-w-\[220px\]{max-width:220px}.univer-cursor-pointer{cursor:pointer}.univer-select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.univer-list-none{list-style-type:none}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-1{gap:4px}.univer-overflow-hidden{overflow:hidden}.univer-overflow-y-auto{overflow-y:auto}.univer-overflow-x-hidden{overflow-x:hidden}.univer-truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.univer-text-ellipsis{text-overflow:ellipsis}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded{border-radius:4px}.univer-rounded-lg{border-radius:8px}.univer-rounded-md{border-radius:6px}.univer-border{border-width:1px}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-bg-white{background-color:var(--univer-white)}.univer-p-1{padding:4px}.univer-px-2{padding-left:8px;padding-right:8px}.univer-px-2\.5{padding-left:10px;padding-right:10px}.univer-px-5{padding-left:20px;padding-right:20px}.univer-py-1\.5{padding-top:6px;padding-bottom:6px}.univer-text-base{font-size:16px;line-height:24px}.univer-text-sm{font-size:14px;line-height:20px}.univer-text-xs{font-size:12px;line-height:16px}.univer-text-gray-700{color:var(--univer-gray-700)}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-shadow-lg{--tw-shadow: 0px 4px 6px 0px rgba(30, 40, 77, .05), 0px 10px 15px -3px rgba(30, 40, 77, .1);--tw-shadow-colored: 0px 4px 6px 0px var(--tw-shadow-color), 0px 10px 15px -3px var(--tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--tw-ring-offset-shadow, 0 0 rgba(0,0,0,0)),var(--tw-ring-shadow, 0 0 rgba(0,0,0,0)),var(--tw-shadow)}.univer-transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.hover\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.disabled\:univer-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:univer-divide-opacity-30:disabled>:not([hidden])~:not([hidden]){--tw-divide-opacity: .3 }.disabled\:univer-text-gray-800:disabled{color:var(--univer-gray-800)}
package/lib/umd/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // @univerjs/sheets-sort/index
2
- (function(l,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("@univerjs/core"),require("@univerjs/sheets"),require("@univerjs/engine-formula")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets","@univerjs/engine-formula"],i):(l=typeof globalThis<"u"?globalThis:l||self,i(l.UniverSheetsSort={},l.UniverCore,l.UniverSheets,l.UniverEngineFormula))})(this,function(l,i,S,N){"use strict";var Z=Object.defineProperty;var ee=(l,i,S)=>i in l?Z(l,i,{enumerable:!0,configurable:!0,writable:!0,value:S}):l[i]=S;var _=(l,i,S)=>ee(l,typeof i!="symbol"?i+"":i,S);var C;const E="sheets-sort.config",y={};var g=(e=>(e.DESC="desc",e.ASC="asc",e))(g||{});const A=e=>e.replace(/-/gi,"").replace(/'/gi,""),j=(e,s)=>{const t=e===null||e==="",n=s===null||s==="";return t&&n?0:t?1:n?-1:null},O=(e,s,t)=>{const n=typeof e=="number",r=typeof s=="number";return n&&r?e<s?t===g.ASC?-1:1:e>s?t===g.ASC?1:-1:0:n?t===g.ASC?1:-1:r?t===g.ASC?-1:1:null},P=(e,s,t)=>{const n=typeof e=="string",r=typeof s=="string";if(n&&(e=A(e.toLocaleLowerCase())),r&&(s=A(s.toLocaleLowerCase())),!n&&!r)return null;if(n&&r){const o=e,u=s;return o<u?t===g.ASC?-1:1:o>u?t===g.ASC?1:-1:0}return n?t===g.ASC?1:-1:r?t===g.ASC?-1:1:null},b=e=>!e||Object.keys(e).length===0||(e==null?void 0:e.v)==null&&(e==null?void 0:e.p)==null;var M=Object.getOwnPropertyDescriptor,V=(e,s,t,n)=>{for(var r=n>1?void 0:n?M(s,t):s,o=e.length-1,u;o>=0;o--)(u=e[o])&&(r=u(r)||r);return r},R=(e,s)=>(t,n)=>s(t,n,e);l.SheetsSortService=class extends i.Disposable{constructor(t,n,r){super();_(this,"_compareFns",[]);this._univerInstanceService=t,this._commandService=n,this._formulaDataModel=r}mergeCheck(t){var a;const{unitId:n,subUnitId:r,range:o}=t,u=(a=this._univerInstanceService.getUnit(n))==null?void 0:a.getSheetBySheetId(r);if(!u)return!1;const c=u.getMergeData().filter(m=>i.Rectangle.contains(o,m));return c.length===0?!0:$(o,c)}emptyCheck(t){var c;const{unitId:n,subUnitId:r,range:o}=t,u=(c=this._univerInstanceService.getUnit(n))==null?void 0:c.getSheetBySheetId(r);if(!u)return!1;for(let a=o.startRow;a<=o.endRow;a++)for(let m=o.startColumn;m<=o.endColumn;m++)if(!b(u.getCellRaw(a,m)))return!0;return!1}singleCheck(t){return t.range.startRow!==t.range.endRow}formulaCheck(t){var c,a;const{unitId:n,subUnitId:r,range:o}=t,u=(a=(c=this._formulaDataModel.getArrayFormulaRange())==null?void 0:c[n])==null?void 0:a[r];for(const m in u){const d=u[Number(m)];for(const I in d){const v=d[Number(I)];if(v&&i.Rectangle.intersects(o,v))return!1}}return!0}registerCompareFn(t){this._compareFns.unshift(t)}getAllCompareFns(){return this._compareFns}applySort(t,n,r){var c;const{unitId:o,subUnitId:u}=S.getSheetCommandTarget(this._univerInstanceService)||{};this._commandService.executeCommand(p.id,{orderRules:t.orderRules,range:t.range,hasTitle:(c=t.hasTitle)!=null?c:!1,unitId:n||o,subUnitId:r||u})}},l.SheetsSortService=V([R(0,i.IUniverInstanceService),R(1,i.ICommandService),R(2,i.Inject(N.FormulaDataModel))],l.SheetsSortService);function $(e,s){const t=e.endRow-e.startRow+1,n=e.endColumn-e.startColumn+1;let r=null,o=null;const u=t*n;let c=0;for(const a of s)if(a.startRow>=e.startRow&&a.endRow<=e.endRow&&a.startColumn>=e.startColumn&&a.endColumn<=e.endColumn){const m=a.endRow-a.startRow+1,d=a.endColumn-a.startColumn+1;if(r===null&&o===null)r=m,o=d;else if(m!==r||d!==o)return!1;c+=m*d}return c===u}const p={id:"sheet.command.sort-range",type:i.CommandType.COMMAND,handler:(e,s)=>{const{range:t,orderRules:n,hasTitle:r,unitId:o,subUnitId:u}=s,c=e.get(l.SheetsSortService),a=e.get(i.IUniverInstanceService),{worksheet:m}=S.getSheetCommandTarget(a,s)||{};if(!m)return!1;const d=m.getMergeData().filter(f=>i.Rectangle.contains(t,f)),I=d.map(f=>f.startRow),{startRow:v,endRow:W}=t,Y=r?v+1:v,w=[],T=[];for(let f=Y;f<=W;f++)m.getRowFiltered(f)||m.getRowRawVisible(f)!==!1&&(d.length&&!I.includes(f)||(w.push({index:f,value:L(m,f,n)}),T.push(f)));const z=c.getAllCompareFns();w.sort(q(n,G(z)));const D={};w.forEach(({index:f,value:ne},X)=>{D[T[X]]=f});const J={id:S.ReorderRangeCommand.id,params:{unitId:o,subUnitId:u,range:t,order:D}},Q=e.get(i.ICommandService);return i.sequenceExecute([J],Q).result}};function L(e,s,t){const n=[];return t.forEach(({colIndex:r})=>{n.push(e.getCellRaw(s,r))}),n}function G(e){return(s,t,n)=>{for(let r=0;r<e.length;r++){const o=e[r](s,t,n);if(o!=null)return o}return 0}}function q(e,s){return function(t,n){let r=null;for(let o=0;o<e.length;o++){const u=t.value[o],c=n.value[o];if(r=s(e[o].type,u,c),r!==0&&r!==null&&r!==void 0)return r}return 0}}var B=Object.getOwnPropertyDescriptor,k=(e,s,t,n)=>{for(var r=n>1?void 0:n?B(s,t):s,o=e.length-1,u;o>=0;o--)(u=e[o])&&(r=u(r)||r);return r},U=(e,s)=>(t,n)=>s(t,n,e);let h=class extends i.Disposable{constructor(e,s){super(),this._commandService=e,this._sortService=s,this._initCommands(),this._registerCompareFns()}_initCommands(){[p].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerCompareFns(){const e=(s,t,n)=>{const r=this._getCommonValue(t),o=this._getCommonValue(n),u=[j,P,O];for(let c=0;c<u.length;c++){const a=u[c](r,o,s);if(a!==null)return a}return null};this._sortService.registerCompareFn(e)}_getCommonValue(e){var t,n;if(b(e))return null;const s=(n=(t=e==null?void 0:e.p)==null?void 0:t.body)==null?void 0:n.dataStream;return s||((e==null?void 0:e.t)===i.CellValueType.NUMBER?Number.parseFloat(`${e.v}`):(e==null?void 0:e.t)===i.CellValueType.STRING?typeof e.v=="number"?e.v:`${e.v}`:(e==null?void 0:e.t)===i.CellValueType.BOOLEAN?`${e.v}`:(e==null?void 0:e.t)===i.CellValueType.FORCE_STRING?Number.parseFloat(`${e.v}`):`${e==null?void 0:e.v}`)}};h=k([U(0,i.ICommandService),U(1,i.Inject(l.SheetsSortService))],h);var H=Object.getOwnPropertyDescriptor,x=(e,s,t,n)=>{for(var r=n>1?void 0:n?H(s,t):s,o=e.length-1,u;o>=0;o--)(u=e[o])&&(r=u(r)||r);return r},F=(e,s)=>(t,n)=>s(t,n,e);const K="SHEET_SORT_PLUGIN";l.UniverSheetsSortPlugin=(C=class extends i.Plugin{constructor(s=y,t,n){super(),this._config=s,this._injector=t,this._configService=n;const{...r}=i.merge({},y,this._config);this._configService.setConfig(E,r)}onStarting(){[[h],[l.SheetsSortService]].forEach(s=>this._injector.add(s))}onReady(){this._injector.get(h)}},_(C,"type",i.UniverInstanceType.UNIVER_SHEET),_(C,"pluginName",K),C),l.UniverSheetsSortPlugin=x([F(1,i.Inject(i.Injector)),F(2,i.IConfigService)],l.UniverSheetsSortPlugin),l.SortRangeCommand=p,l.SortType=g,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
2
+ (function(l,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@univerjs/core"),require("@univerjs/engine-formula"),require("@univerjs/sheets")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/engine-formula","@univerjs/sheets"],o):(l=typeof globalThis<"u"?globalThis:l||self,o(l.UniverSheetsSort={},l.UniverCore,l.UniverEngineFormula,l.UniverSheets))})(this,function(l,o,S,h){"use strict";var te=Object.defineProperty;var ne=(l,o,S)=>o in l?te(l,o,{enumerable:!0,configurable:!0,writable:!0,value:S}):l[o]=S;var N=(l,o,S)=>ne(l,typeof o!="symbol"?o+"":o,S);const T="sheets-sort.config",w={};var g=(e=>(e.DESC="desc",e.ASC="asc",e))(g||{});const b=e=>e.replace(/-/gi,"").replace(/'/gi,""),E=(e,n)=>{const t=e===null||e==="",r=n===null||n==="";return t&&r?0:t?1:r?-1:null},O=(e,n,t)=>{const r=typeof e=="number",s=typeof n=="number";return r&&s?e<n?t===g.ASC?-1:1:e>n?t===g.ASC?1:-1:0:r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},j=(e,n,t)=>{const r=typeof e=="string",s=typeof n=="string";if(r&&(e=b(e.toLocaleLowerCase())),s&&(n=b(n.toLocaleLowerCase())),!r&&!s)return null;if(r&&s){const i=e,u=n;return i<u?t===g.ASC?-1:1:i>u?t===g.ASC?1:-1:0}return r?t===g.ASC?1:-1:s?t===g.ASC?-1:1:null},U=e=>!e||Object.keys(e).length===0||(e==null?void 0:e.v)==null&&(e==null?void 0:e.p)==null;var M=Object.getOwnPropertyDescriptor,V=(e,n,t,r)=>{for(var s=r>1?void 0:r?M(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},_=(e,n)=>(t,r)=>n(t,r,e);l.SheetsSortService=class extends o.Disposable{constructor(t,r,s){super();N(this,"_compareFns",[]);this._univerInstanceService=t,this._commandService=r,this._formulaDataModel=s}mergeCheck(t){var a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=this._univerInstanceService.getUnit(r))==null?void 0:a.getSheetBySheetId(s);if(!u)return!1;const c=u.getMergeData().filter(f=>o.Rectangle.contains(i,f));return c.length===0?!0:$(i,c)}emptyCheck(t){var c;const{unitId:r,subUnitId:s,range:i}=t,u=(c=this._univerInstanceService.getUnit(r))==null?void 0:c.getSheetBySheetId(s);if(!u)return!1;for(let a=i.startRow;a<=i.endRow;a++)for(let f=i.startColumn;f<=i.endColumn;f++)if(!U(u.getCellRaw(a,f)))return!0;return!1}singleCheck(t){return t.range.startRow!==t.range.endRow}formulaCheck(t){var c,a;const{unitId:r,subUnitId:s,range:i}=t,u=(a=(c=this._formulaDataModel.getArrayFormulaRange())==null?void 0:c[r])==null?void 0:a[s];for(const f in u){const d=u[Number(f)];for(const R in d){const v=d[Number(R)];if(v&&o.Rectangle.intersects(i,v))return!1}}return!0}registerCompareFn(t){this._compareFns.unshift(t)}getAllCompareFns(){return this._compareFns}applySort(t,r,s){var c;const{unitId:i,subUnitId:u}=h.getSheetCommandTarget(this._univerInstanceService)||{};this._commandService.executeCommand(p.id,{orderRules:t.orderRules,range:t.range,hasTitle:(c=t.hasTitle)!=null?c:!1,unitId:r||i,subUnitId:s||u})}},l.SheetsSortService=V([_(0,o.IUniverInstanceService),_(1,o.ICommandService),_(2,o.Inject(S.FormulaDataModel))],l.SheetsSortService);function $(e,n){const t=e.endRow-e.startRow+1,r=e.endColumn-e.startColumn+1;let s=null,i=null;const u=t*r;let c=0;for(const a of n)if(a.startRow>=e.startRow&&a.endRow<=e.endRow&&a.startColumn>=e.startColumn&&a.endColumn<=e.endColumn){const f=a.endRow-a.startRow+1,d=a.endColumn-a.startColumn+1;if(s===null&&i===null)s=f,i=d;else if(f!==s||d!==i)return!1;c+=f*d}return c===u}const p={id:"sheet.command.sort-range",type:o.CommandType.COMMAND,handler:(e,n)=>{const{range:t,orderRules:r,hasTitle:s,unitId:i,subUnitId:u}=n,c=e.get(l.SheetsSortService),a=e.get(o.IUniverInstanceService),{worksheet:f}=h.getSheetCommandTarget(a,n)||{};if(!f)return!1;const d=f.getMergeData().filter(m=>o.Rectangle.contains(t,m)),R=d.map(m=>m.startRow),{startRow:v,endRow:J}=t,Q=s?v+1:v,I=[],F=[];for(let m=Q;m<=J;m++)f.getRowFiltered(m)||f.getRowRawVisible(m)!==!1&&(d.length&&!R.includes(m)||(I.push({index:m,value:L(f,m,r)}),F.push(m)));const X=c.getAllCompareFns();I.sort(q(r,G(X)));const D={};I.forEach(({index:m,value:se},ee)=>{D[F[ee]]=m});const Z={id:h.ReorderRangeCommand.id,params:{unitId:i,subUnitId:u,range:t,order:D}},k=e.get(o.ICommandService);return o.sequenceExecute([Z],k).result}};function L(e,n,t){const r=[];return t.forEach(({colIndex:s})=>{r.push(e.getCellRaw(n,s))}),r}function G(e){return(n,t,r)=>{for(let s=0;s<e.length;s++){const i=e[s](n,t,r);if(i!=null)return i}return 0}}function q(e,n){return function(t,r){let s=null;for(let i=0;i<e.length;i++){const u=t.value[i],c=r.value[i];if(s=n(e[i].type,u,c),s!==0&&s!==null&&s!==void 0)return s}return 0}}var B=Object.getOwnPropertyDescriptor,H=(e,n,t,r)=>{for(var s=r>1?void 0:r?B(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},y=(e,n)=>(t,r)=>n(t,r,e);let C=class extends o.Disposable{constructor(e,n){super(),this._commandService=e,this._sortService=n,this._initCommands(),this._registerCompareFns()}_initCommands(){[p].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_registerCompareFns(){const e=(n,t,r)=>{const s=this._getCommonValue(t),i=this._getCommonValue(r),u=[E,j,O];for(let c=0;c<u.length;c++){const a=u[c](s,i,n);if(a!==null)return a}return null};this._sortService.registerCompareFn(e)}_getCommonValue(e){var t,r;if(U(e))return null;const n=(r=(t=e==null?void 0:e.p)==null?void 0:t.body)==null?void 0:r.dataStream;return n||((e==null?void 0:e.t)===o.CellValueType.NUMBER?Number.parseFloat(`${e.v}`):(e==null?void 0:e.t)===o.CellValueType.STRING?typeof e.v=="number"?e.v:`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.BOOLEAN?`${e.v}`:(e==null?void 0:e.t)===o.CellValueType.FORCE_STRING?Number.parseFloat(`${e.v}`):`${e==null?void 0:e.v}`)}};C=H([y(0,o.ICommandService),y(1,o.Inject(l.SheetsSortService))],C);var K=Object.defineProperty,W=Object.getOwnPropertyDescriptor,Y=(e,n,t)=>n in e?K(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,x=(e,n,t,r)=>{for(var s=r>1?void 0:r?W(n,t):n,i=e.length-1,u;i>=0;i--)(u=e[i])&&(s=u(s)||s);return s},A=(e,n)=>(t,r)=>n(t,r,e),P=(e,n,t)=>Y(e,typeof n!="symbol"?n+"":n,t);const z="SHEET_SORT_PLUGIN";l.UniverSheetsSortPlugin=class extends o.Plugin{constructor(n=w,t,r){super(),this._config=n,this._injector=t,this._configService=r;const{...s}=o.merge({},w,this._config);this._configService.setConfig(T,s)}onStarting(){[[C],[l.SheetsSortService]].forEach(n=>this._injector.add(n))}onReady(){this._injector.get(C)}},P(l.UniverSheetsSortPlugin,"type",o.UniverInstanceType.UNIVER_SHEET),P(l.UniverSheetsSortPlugin,"pluginName",z),l.UniverSheetsSortPlugin=x([o.DependentOn(h.UniverSheetsPlugin,S.UniverFormulaEnginePlugin),A(1,o.Inject(o.Injector)),A(2,o.IConfigService)],l.UniverSheetsSortPlugin),l.SortRangeCommand=p,l.SortType=g,Object.defineProperty(l,Symbol.toStringTag,{value:"Module"})});
3
3
 
4
4
 
5
5
  // @univerjs/sheets-sort/facade
@@ -7,16 +7,34 @@
7
7
 
8
8
 
9
9
  // @univerjs/sheets-sort-ui/index
10
- (function(u,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets-sort"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/sheets"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-sort","@univerjs/engine-formula","@univerjs/sheets-ui","@univerjs/ui","rxjs","react/jsx-runtime","@univerjs/sheets","@univerjs/design","react"],s):(u=typeof globalThis<"u"?globalThis:u||self,s(u.UniverSheetsSortUi={},u.UniverCore,u.UniverSheetsSort,u.UniverEngineFormula,u.UniverSheetsUi,u.UniverUi,u.rxjs,u.React,u.UniverSheets,u.UniverDesign,u.React))})(this,function(u,s,I,Ie,E,S,oe,a,m,M,l){"use strict";var Ct=Object.defineProperty;var gt=(u,s,I)=>s in u?Ct(u,s,{enumerable:!0,configurable:!0,writable:!0,value:I}):u[s]=I;var re=(u,s,I)=>gt(u,typeof s!="symbol"?s+"":s,I);const ye="sheets-sort-ui.config",se={};var P=function(){return P=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},P.apply(this,arguments)},_e=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},x=l.forwardRef(function(e,t){var r=e.icon,n=e.id,o=e.className,i=e.extend,c=_e(e,["icon","id","className","extend"]),C="univerjs-icon univerjs-icon-".concat(n," ").concat(o||"").trim(),h=l.useRef("_".concat(xe()));return ie(r,"".concat(n),{defIds:r.defIds,idSuffix:h.current},P({ref:t,className:C},c),i)});function ie(e,t,r,n,o){return l.createElement(e.tag,P(P({key:t},Me(e,r,o)),n),(Pe(e,r).children||[]).map(function(i,c){return ie(i,"".concat(t,"-").concat(e.tag,"-").concat(c),r,void 0,o)}))}function Me(e,t,r){var n=P({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],C=i[1];c==="mask"&&typeof C=="string"&&(n[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var o=t.defIds;return!o||o.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(i){var c=i[0],C=i[1];typeof C=="string"&&(n[c]=C.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Pe(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?P(P({},e),{children:e.children.map(function(o){return typeof o.attrs.id=="string"&&n&&n.indexOf(o.attrs.id)>-1?P(P({},o),{attrs:P(P({},o.attrs),{id:o.attrs.id+t.idSuffix})}):o})}):e}function xe(){return Math.random().toString(36).substring(2,8)}x.displayName="UniverIcon";var Te={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z",fillRule:"evenodd",clipRule:"evenodd"}}]},q=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"ascending- single",ref:t,icon:Te}))});q.displayName="AscendingSingle";var Ee={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ae=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"check-mark-single",ref:t,icon:Ee}))});ae.displayName="CheckMarkSingle";var be={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.77445 9.24306L9.77457 11.9573C9.77458 12.2887 9.50597 12.5574 9.17459 12.5574 8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507 9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661 11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306zM6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512 7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574 6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588 4.88808 9.55156 5.26798 9.55156 5.50229 9.78588L6.22584 10.5094z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM2.34014 5.86724V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V5.86724H2.34014ZM13.6601 4.66724H2.34014V3.73989C2.34014 2.9667 2.96694 2.33989 3.74014 2.33989H12.2601C13.0333 2.33989 13.6601 2.96669 13.6601 3.73989V4.66724Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ce=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"custom-sort-single",ref:t,icon:be}))});ce.displayName="CustomSortSingle";var Re={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V13.1332C3.15332 14.2377 4.04875 15.1332 5.15332 15.1332H10.8465C11.9511 15.1332 12.8465 14.2377 12.8465 13.1331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V13.1331C11.6465 13.575 11.2884 13.9331 10.8465 13.9331H5.15332C4.71149 13.9331 4.35332 13.575 4.35332 13.1332V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},le=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"delete-empty-single",ref:t,icon:Re}))});le.displayName="DeleteEmptySingle";var ke={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z",fillRule:"evenodd",clipRule:"evenodd"}}]},Y=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"descending-single",ref:t,icon:ke}))});Y.displayName="DescendingSingle";var we={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z"}}]},de=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-ascending-single",ref:t,icon:we}))});de.displayName="ExpandAscendingSingle";var Oe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z"}}]},ue=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"expand-descending-single",ref:t,icon:Oe}))});ue.displayName="ExpandDescendingSingle";var De={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},X=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"increase-single",ref:t,icon:De}))});X.displayName="IncreaseSingle";var Ne={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},me=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ne}))});me.displayName="MoreDownSingle";var Le={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},Se=l.forwardRef(function(e,t){return l.createElement(x,Object.assign({},e,{id:"sequence-single",ref:t,icon:Le}))});Se.displayName="SequenceSingle";const d={extendConfirmContent:"univer-extend-confirm-content",extendConfirmRadioGroup:"univer-extend-confirm-radio-group",customSortPanelContainer:"univer-custom-sort-panel-container",customSortPanelExt:"univer-custom-sort-panel-ext",addCondition:"univer-add-condition",addConditionText:"univer-add-condition-text",addConditionDisable:"univer-add-condition-disable",customSortPanelFooter:"univer-custom-sort-panel-footer",customSortPanelFooterBtn:"univer-custom-sort-panel-footer-btn",customSortPanelItem:"univer-custom-sort-panel-item",customSortPanelItemHead:"univer-custom-sort-panel-item-head",customSortPanelItemHandler:"univer-custom-sort-panel-item-handler",customSortPanelItemRemove:"univer-custom-sort-panel-item-remove",customSortPanelItemColumnInput:"univer-custom-sort-panel-item-column-input",customSortPanelItemColumnInputDropdown:"univer-custom-sort-panel-item-column-input-dropdown",customSortPanelItemColumnInputText:"univer-custom-sort-panel-item-column-input-text",customSortPanelItemOrderRadio:"univer-custom-sort-panel-item-order-radio",customSortPanelItemOrderRadioCn:"univer-custom-sort-panel-item-order-radio-cn",conditionList:"univer-condition-list",embedSortBtnContainer:"univer-embed-sort-btn-container",embedSortBtn:"univer-embed-sort-btn",embedSortBtnAsc:"univer-embed-sort-btn-asc",embedSortBtnDesc:"univer-embed-sort-btn-desc",embedSortBtnIcon:"univer-embed-sort-btn-icon",customSortColMenu:"univer-custom-sort-col-menu",customSortColMenuItem:"univer-custom-sort-col-menu-item",customSortColMenuItemDesc:"univer-custom-sort-col-menu-item-desc"},He=e=>{const[t,r]=l.useState("0"),n=S.useDependency(s.LocaleService);return a.jsxs("div",{className:d.extendConfirmContent,children:[a.jsx("div",{className:"extend-confirm-desc",children:n.t("sheets-sort.dialog.sort-reminder-desc")}),a.jsxs(M.RadioGroup,{className:d.extendConfirmRadioGroup,value:t,direction:"vertical",onChange:o=>{r(o),e.onChange(o)},children:[a.jsx(M.Radio,{value:"0",children:n.t("sheets-sort.dialog.sort-reminder-no")}),a.jsx(M.Radio,{value:"1",children:n.t("sheets-sort.dialog.sort-reminder-ext")})]})]})};var Ue=Object.getOwnPropertyDescriptor,je=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ue(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},w=(e,t)=>(r,n)=>t(r,n,e);const L={MERGE_ERROR:"sheets-sort.error.merge-size",EMPTY_ERROR:"sheets-sort.error.empty",SINGLE_ERROR:"sheets-sort.error.single",FORMULA_ARRAY:"sheets-sort.error.formula-array"};let p=class extends s.Disposable{constructor(t,r,n,o,i,c,C){super();re(this,"_customSortState$",new oe.BehaviorSubject(null));re(this,"customSortState$",this._customSortState$.asObservable());this._univerInstanceService=t,this._confirmService=r,this._logService=n,this._selectionManagerService=o,this._sheetsSortService=i,this._localeService=c,this._commandService=C}async triggerSortDirectly(t,r,n){const o=n||await this._detectSortLocation(r);if(!o||!this._check(o))return!1;const c={orderRules:[{type:t?I.SortType.ASC:I.SortType.DESC,colIndex:o.colIndex}],range:o.range};return this._sheetsSortService.applySort(c,o.unitId,o.subUnitId),!0}async triggerSortCustomize(){const t=await this._detectSortLocation();return!t||!this._check(t)?!1:(this.showCustomSortPanel(t),!0)}customSortState(){return this._customSortState$.getValue()}getTitles(t){var h,f;const r=(h=this.customSortState())==null?void 0:h.location;if(!r)return[];const{unitId:n,subUnitId:o,range:i}=r,c=(f=this._univerInstanceService.getUnit(n))==null?void 0:f.getSheetBySheetId(o);if(!c)return[];const C=Ae(this._localeService);return Array.from({length:i.endColumn-i.startColumn+1},(R,_)=>{var y;const k=(y=c.getCell(i.startRow,_+i.startColumn))==null?void 0:y.v;return{index:_+i.startColumn,label:t?`${k!=null?k:C(_+i.startColumn)}`:C(_+i.startColumn)}})}setSelection(t,r,n){var c;const o=(c=this._univerInstanceService.getUnit(t))==null?void 0:c.getSheetBySheetId(r);if(!o)return;const i={unitId:t,subUnitId:r,selections:[{range:n,primary:m.getPrimaryForRange(n,o),style:null}]};this._commandService.executeCommand(m.SetSelectionsOperation.id,i)}async showCheckError(t){return await this._confirmService.confirm({id:"sort-range-check-error",title:{title:this._localeService.t("info.tooltip")},children:{title:a.jsx("div",{children:this._localeService.t(t)})}})}async showExtendConfirm(){let t=!1;return await this._confirmService.confirm({id:"extend-sort-range-dialog",title:{title:this._localeService.t("sheets-sort.dialog.sort-reminder")},children:{title:a.jsx(He,{onChange:n=>{t=n==="1"}})},width:400})?t?"extend":"keep":"cancel"}showCustomSortPanel(t){this._customSortState$.next({location:t,show:!0})}closeCustomSortPanel(){this._customSortState$.next({show:!1})}_check(t){return this._sheetsSortService.singleCheck(t)?this._sheetsSortService.mergeCheck(t)?this._sheetsSortService.formulaCheck(t)?this._sheetsSortService.emptyCheck(t)?!0:(this.showCheckError(L.EMPTY_ERROR),!1):(this.showCheckError(L.FORMULA_ARRAY),!1):(this.showCheckError(L.MERGE_ERROR),!1):(this.showCheckError(L.SINGLE_ERROR),!1)}async _detectSortLocation(t){const r=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET),n=r.getActiveSheet(),o=r.getUnitId(),i=n.getSheetId(),c=this._selectionManagerService.getCurrentLastSelection();if(!c)return null;let C;if(t===!0)C=m.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},n),this.setSelection(o,i,C);else if(t===!1)C=c.range;else{const h=await this.showExtendConfirm();if(h==="cancel")return null;h==="keep"?C=c.range:(C=m.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},n),this.setSelection(o,i,C))}return{range:C,unitId:o,subUnitId:i,colIndex:c.primary.actualColumn}}};p=je([w(0,s.IUniverInstanceService),w(1,S.IConfirmService),w(2,s.ILogService),w(3,s.Inject(m.SheetsSelectionsService)),w(4,s.Inject(I.SheetsSortService)),w(5,s.Inject(s.LocaleService)),w(6,s.ICommandService)],p);function Ae(e){return t=>{const r=s.Tools.chatAtABC(t);switch(e.getCurrentLocale()){case s.LocaleType.ZH_CN:return`"${r}"列`;case s.LocaleType.EN_US:return`Column "${r}"`;default:return`Column "${r}"`}}}const H={id:"sheet.command.sort-range-asc",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},U={id:"sheet.command.sort-range-asc-ext",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},j={id:"sheet.command.sort-range-desc",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},A={id:"sheet.command.sort-range-desc-ext",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},$={id:"sheet.command.sort-range-custom",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()},B={id:"sheet.command.sort-range-asc-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!1)},F={id:"sheet.command.sort-range-asc-ext-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!0,!0)},W={id:"sheet.command.sort-range-desc-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!1)},V={id:"sheet.command.sort-range-desc-ext-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortDirectly(!1,!0)},z={id:"sheet.command.sort-range-custom-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(p).triggerSortCustomize()};function $e(){const e=S.useDependency(p),t=S.useDependency(I.SheetsSortService),r=S.useDependency(s.LocaleService),[n,o]=l.useState(!1),[i,c]=l.useState(0),C=l.useRef(null),h=e.customSortState();if(!h||!h.location)return null;const{range:f,unitId:R,subUnitId:_}=h.location,k=e.getTitles(n),[y,D]=l.useState([{type:I.SortType.ASC,colIndex:f.startColumn}]),te=l.useCallback((g,T)=>{const N=[...y];T===null?N.splice(g,1):N[g]=T,D(N)},[y]),G=l.useCallback(s.throttle(()=>{const g=[...y],T=Fe(f,y);T!==null&&(g.push({type:I.SortType.ASC,colIndex:T}),D(g))},200),[y,f]),v=l.useCallback((g,T)=>{t.applySort({range:f,orderRules:g,hasTitle:T}),e.closeCustomSortPanel()},[t,e,f]),ne=l.useCallback(()=>{e.closeCustomSortPanel()},[e]),mt=l.useCallback(g=>{o(g),g?e.setSelection(R,_,{...f,startRow:f.startRow+1}):e.setSelection(R,_,f)},[e,f,_,R]);l.useEffect(()=>{C.current&&y.length>5&&(C.current.scrollTop=C.current.scrollHeight)},[y]);const St=y.length<k.length,pe=y.map(g=>({...g,id:`${g.colIndex}`}));return a.jsxs("div",{className:d.customSortPanelContainer,children:[a.jsxs("div",{className:d.customSortPanelContent,onMouseDown:g=>{g.stopPropagation()},children:[a.jsxs("div",{className:d.customSortPanelExt,children:[a.jsx("div",{className:d.firstRowCheck,children:a.jsx(M.Checkbox,{checked:n,onChange:g=>mt(!!g),children:r.t("sheets-sort.dialog.first-row-check")})}),St?a.jsxs("div",{className:d.addCondition,onClick:G,children:[a.jsx(X,{}),a.jsx("span",{className:d.addConditionText,children:r.t("sheets-sort.dialog.add-condition")})]}):a.jsxs("div",{className:`
11
- ${d.addCondition}
12
- ${d.addConditionDisable}
13
- `,children:[a.jsx(X,{}),a.jsx("span",{className:d.addConditionText,children:r.t("sheets-sort.dialog.add-condition")})]})]}),a.jsx("div",{className:d.conditionList,onScroll:g=>{const T=g.currentTarget.scrollTop;c(T)},ref:C,children:a.jsx(M.DraggableList,{list:pe,onListChange:D,idKey:"id",draggableHandle:`.${d.customSortPanelItemHandler}`,itemRender:g=>a.jsx(Be,{titles:k,list:pe,item:g,onChange:(T,N)=>te(N,T),scrollPosition:i}),rowHeight:32,margin:[0,12]})})]}),a.jsxs("div",{className:d.customSortPanelFooter,children:[a.jsx(M.Button,{className:d.customSortPanelFooterBtn,onClick:()=>ne(),children:r.t("sheets-sort.dialog.cancel")}),a.jsx(M.Button,{className:d.customSortPanelFooterBtn,variant:"primary",onClick:()=>v(y,n),children:r.t("sheets-sort.dialog.confirm")})]})]})}function Be(e){var G;const{list:t,item:r,titles:n,onChange:o,scrollPosition:i}=e,c=S.useDependency(s.LocaleService),C=n.filter(v=>!t.some(ne=>ne.colIndex===v.index)||v.index===r.colIndex),h=t.findIndex(v=>v.colIndex===r.colIndex),f=l.useCallback(v=>{o({...r,colIndex:v.index},h),_(!1)},[h,r,o]),[R,_]=l.useState(!1),k=v=>{_(v)};l.useEffect(()=>{_(!1)},[i]);const y=t.length>1,D=(G=n.find(v=>v.index===r.colIndex))==null?void 0:G.label,te=c.getCurrentLocale()===s.LocaleType.ZH_CN?d.customSortPanelItemOrderRadioCn:d.customSortPanelItemOrderRadio;return a.jsxs("div",{className:d.customSortPanelItem,children:[a.jsxs("div",{className:d.customSortPanelItemHead,children:[a.jsx("div",{className:d.customSortPanelItemHandler,children:a.jsx(Se,{})}),a.jsx("div",{className:d.customSortPanelItemColumn,children:a.jsx(M.Dropdown,{align:"start",overlay:a.jsx("ul",{className:M.clsx(d.customSortColMenu,"univer-theme"),children:C.map(v=>a.jsxs("li",{onClick:()=>f(v),className:d.customSortColMenuItem,children:[a.jsx("span",{className:d.customSortColMenuItemDesc,children:v.label}),a.jsx("span",{className:d.customSortColMenuItemCheck,children:v.index===r.colIndex&&a.jsx(ae,{})})]},v.index))}),open:R,onOpenChange:k,children:a.jsxs("div",{className:d.customSortPanelItemColumnInput,children:[a.jsx("span",{className:d.customSortPanelItemColumnInputText,children:D}),a.jsx(me,{className:d.customSortPanelItemColumnInputDropdown})]})})})]}),a.jsx("div",{className:d.customSortPanelItemOrder,children:a.jsxs(M.RadioGroup,{className:te,value:r.type,onChange:v=>{o({...r,type:v},h)},children:[a.jsx(M.Radio,{value:I.SortType.ASC,children:c.t("sheets-sort.general.sort-asc")}),a.jsx(M.Radio,{value:I.SortType.DESC,children:c.t("sheets-sort.general.sort-desc")})]})}),a.jsx("div",{className:d.customSortPanelItemRemove,children:y&&a.jsx(le,{onClick:()=>o(null,h)})})]})}function Fe(e,t){const{startColumn:r,endColumn:n}=e,o=new Set(t.map(i=>i==null?void 0:i.colIndex));for(let i=r;i<=n;i++)if(!o.has(i))return i;return null}function We(e){const{range:t,colIndex:r,onClose:n}=e,o=S.useDependency(p),i=S.useDependency(s.IUniverInstanceService),c=S.useDependency(s.LocaleService),C=l.useCallback(h=>{const{unitId:f,subUnitId:R}=m.getSheetCommandTarget(i)||{};if(t&&f&&R){const _={...t,startRow:t.startRow+1};o.triggerSortDirectly(h,!1,{unitId:f,subUnitId:R,range:_,colIndex:r})}else console.warn(`Cannot find the target to sort. unitId: ${f}, subUnitId: ${R}, range: ${t}, colIndex: ${r}`);n()},[t,r,o,i,n]);return a.jsxs("div",{className:d.embedSortBtnContainer,children:[a.jsxs("div",{className:`
14
- ${d.embedSortBtn}
15
- ${d.embedSortBtnAsc}
16
- `,onClick:()=>C(!0),children:[a.jsx(q,{className:d.embedSortBtnIcon}),c.t("sheets-sort.general.sort-asc")]}),a.jsxs("div",{className:`
17
- ${d.embedSortBtn}
18
- ${d.embedSortBtnDesc}
19
- `,onClick:()=>C(!1),children:[a.jsx(Y,{className:d.embedSortBtnIcon}),c.t("sheets-sort.general.sort-desc")]})]})}const Ce="sheet.menu.sheets-sort",ge="sheet.menu.sheets-sort-ctx",O="AscendingSingle",K="ExpandAscendingSingle",J="DescendingSingle",Q="ExpandDescendingSingle",ee="CustomSortSingle";function Ve(e){return{id:Ce,type:S.MenuItemType.SUBITEMS,icon:O,tooltip:"sheets-sort.general.sort",hidden$:S.getMenuHiddenObservable(e,s.UniverInstanceType.UNIVER_SHEET),disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function ze(e){return{id:H.id,icon:O,title:"sheets-sort.general.sort-asc-cur",type:S.MenuItemType.BUTTON,hidden$:E.getCurrentExclusiveRangeInterest$(e)}}function Ze(e){return{id:U.id,title:"sheets-sort.general.sort-asc-ext",icon:K,type:S.MenuItemType.BUTTON}}function Ge(e){return{id:j.id,title:"sheets-sort.general.sort-desc-cur",icon:J,type:S.MenuItemType.BUTTON}}function qe(e){return{id:A.id,title:"sheets-sort.general.sort-desc-ext",icon:Q,type:S.MenuItemType.BUTTON}}function Ye(e){return{id:$.id,title:"sheets-sort.general.sort-custom",type:S.MenuItemType.BUTTON,icon:ee}}function Xe(e){return{id:ge,title:"sheets-sort.general.sort",type:S.MenuItemType.SUBITEMS,icon:O,hidden$:S.getMenuHiddenObservable(e,s.UniverInstanceType.UNIVER_SHEET),disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function Ke(e){return{id:B.id,title:"sheets-sort.general.sort-asc-cur",type:S.MenuItemType.BUTTON,icon:O,disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function Je(e){return{id:F.id,title:"sheets-sort.general.sort-asc-ext",type:S.MenuItemType.BUTTON,icon:K,disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function Qe(e){return{id:W.id,title:"sheets-sort.general.sort-desc-cur",type:S.MenuItemType.BUTTON,icon:J,disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function et(e){return{id:V.id,title:"sheets-sort.general.sort-desc-ext",type:S.MenuItemType.BUTTON,icon:Q,disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}function tt(e){return{id:z.id,title:"sheets-sort.general.sort-custom",type:S.MenuItemType.BUTTON,icon:ee,disabled$:E.getCurrentRangeDisable$(e,{workbookTypes:[m.WorkbookEditablePermission],worksheetTypes:[m.WorksheetSortPermission,m.WorksheetEditPermission],rangeTypes:[m.RangeProtectionPermissionEditPoint]})}}const nt={[S.RibbonStartGroup.FORMULAS_INSERT]:{[Ce]:{order:2,menuItemFactory:Ve,[H.id]:{order:0,menuItemFactory:ze},[U.id]:{order:1,menuItemFactory:Ze},[j.id]:{order:2,menuItemFactory:Ge},[A.id]:{order:3,menuItemFactory:qe},[$.id]:{order:4,menuItemFactory:Ye}}},[S.ContextMenuPosition.MAIN_AREA]:{[S.ContextMenuGroup.DATA]:{[ge]:{order:0,menuItemFactory:Xe,[B.id]:{order:0,menuItemFactory:Ke},[F.id]:{order:1,menuItemFactory:Je},[W.id]:{order:2,menuItemFactory:Qe},[V.id]:{order:3,menuItemFactory:et},[z.id]:{order:4,menuItemFactory:tt}}}}};var rt=Object.getOwnPropertyDescriptor,ot=(e,t,r,n)=>{for(var o=n>1?void 0:n?rt(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},b=(e,t)=>(r,n)=>t(r,n,e);const he="custom-sort-dialog",st=560;let Z=class extends s.RxDisposable{constructor(e,t,r,n,o,i,c,C,h,f){super(),this._commandService=e,this._menuManagerService=t,this._dialogService=r,this._layoutService=n,this._uiPartsService=o,this._sheetRenderService=i,this._localeService=c,this._sheetsSortUIService=C,this._injector=h,this._componentManager=f,this._initCommands(),this._initMenu(),this._initUI()}_initMenu(){this._menuManagerService.mergeMenu(nt)}_initCommands(){[H,U,j,A,$,B,F,W,V,z].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(I.SortRangeCommand.id))}_initUI(){this.disposeWithMe(this._componentManager.register("CustomSortPanel",$e)),this.disposeWithMe(this._uiPartsService.registerComponent(E.SheetsUIPart.FILTER_PANEL_EMBED_POINT,()=>S.connectInjector(We,this._injector))),this.disposeWithMe(this._componentManager.register(O,q)),this.disposeWithMe(this._componentManager.register(K,de)),this.disposeWithMe(this._componentManager.register(J,Y)),this.disposeWithMe(this._componentManager.register(Q,ue)),this.disposeWithMe(this._componentManager.register(ee,ce)),this._sheetsSortUIService.customSortState$.pipe(oe.takeUntil(this.dispose$)).subscribe(e=>{e&&e.show&&e.location?this._openCustomSortPanel(e.location):e&&!(e!=null&&e.show)&&this._closePanel()})}_openCustomSortPanel(e){this._dialogService.open({id:he,draggable:!0,width:st,title:{title:`${this._localeService.t("sheets-sort.general.sort-custom")}: ${Ie.serializeRange(e.range)}`},children:{label:"CustomSortPanel"},destroyOnClose:!0,defaultPosition:it(),preservePositionOnDestroy:!1,onClose:()=>this._closePanel(),mask:!0})}_closePanel(){this._dialogService.close(he),queueMicrotask(()=>this._layoutService.focus())}};Z=ot([b(0,s.ICommandService),b(1,S.IMenuManagerService),b(2,S.IDialogService),b(3,S.ILayoutService),b(4,S.IUIPartsService),b(5,s.Inject(E.SheetsRenderService)),b(6,s.Inject(s.LocaleService)),b(7,s.Inject(p)),b(8,s.Inject(s.Injector)),b(9,s.Inject(S.ComponentManager))],Z);function it(){return{x:0,y:0}}var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t,r,n)=>{for(var o=n>1?void 0:n?ct(t,r):t,i=e.length-1,c;i>=0;i--)(c=e[i])&&(o=c(o)||o);return o},fe=(e,t)=>(r,n)=>t(r,n,e),ve=(e,t,r)=>lt(e,typeof t!="symbol"?t+"":t,r);const ut="SHEET_SORT_UI_PLUGIN";u.UniverSheetsSortUIPlugin=class extends s.Plugin{constructor(t=se,r,n){super(),this._config=t,this._injector=r,this._configService=n;const{...o}=s.merge({},se,this._config);this._configService.setConfig(ye,o)}onStarting(){[[p],[Z]].forEach(t=>this._injector.add(t))}onRendered(){this._injector.get(Z)}},ve(u.UniverSheetsSortUIPlugin,"type",s.UniverInstanceType.UNIVER_SHEET),ve(u.UniverSheetsSortUIPlugin,"pluginName",ut),u.UniverSheetsSortUIPlugin=dt([s.DependentOn(I.UniverSheetsSortPlugin),fe(1,s.Inject(s.Injector)),fe(2,s.IConfigService)],u.UniverSheetsSortUIPlugin),u.SortRangeAscCommand=H,u.SortRangeAscExtCommand=U,u.SortRangeAscExtInCtxMenuCommand=F,u.SortRangeAscInCtxMenuCommand=B,u.SortRangeCustomCommand=$,u.SortRangeCustomInCtxMenuCommand=z,u.SortRangeDescCommand=j,u.SortRangeDescExtCommand=A,u.SortRangeDescExtInCtxMenuCommand=V,u.SortRangeDescInCtxMenuCommand=W,Object.defineProperty(u,Symbol.toStringTag,{value:"Module"})});
10
+ (function(d,s){typeof exports=="object"&&typeof module<"u"?s(exports,require("@univerjs/core"),require("@univerjs/sheets-sort"),require("@univerjs/engine-formula"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("rxjs"),require("react/jsx-runtime"),require("@univerjs/sheets"),require("@univerjs/design"),require("react")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-sort","@univerjs/engine-formula","@univerjs/sheets-ui","@univerjs/ui","rxjs","react/jsx-runtime","@univerjs/sheets","@univerjs/design","react"],s):(d=typeof globalThis<"u"?globalThis:d||self,s(d.UniverSheetsSortUi={},d.UniverCore,d.UniverSheetsSort,d.UniverEngineFormula,d.UniverSheetsUi,d.UniverUi,d.rxjs,d.React,d.UniverSheets,d.UniverDesign,d.React))})(this,function(d,s,p,pe,T,u,re,a,g,_,l){"use strict";var mt=Object.defineProperty;var vt=(d,s,p)=>s in d?mt(d,s,{enumerable:!0,configurable:!0,writable:!0,value:p}):d[s]=p;var ne=(d,s,p)=>vt(d,typeof s!="symbol"?s+"":s,p);const ye="sheets-sort-ui.config",ie={};var I=function(){return I=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++){t=arguments[r];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},I.apply(this,arguments)},_e=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},M=l.forwardRef(function(e,t){var r=e.icon,n=e.id,i=e.className,o=e.extend,c=_e(e,["icon","id","className","extend"]),h="univerjs-icon univerjs-icon-".concat(n," ").concat(i||"").trim(),m=l.useRef("_".concat(Me()));return se(r,"".concat(n),{defIds:r.defIds,idSuffix:m.current},I({ref:t,className:h},c),o)});function se(e,t,r,n,i){return l.createElement(e.tag,I(I({key:t},xe(e,r,i)),n),(Ie(e,r).children||[]).map(function(o,c){return se(o,"".concat(t,"-").concat(e.tag,"-").concat(c),r,void 0,i)}))}function xe(e,t,r){var n=I({},e.attrs);r!=null&&r.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=r.colorChannel1),e.tag==="mask"&&n.id&&(n.id=n.id+t.idSuffix),Object.entries(n).forEach(function(o){var c=o[0],h=o[1];c==="mask"&&typeof h=="string"&&(n[c]=h.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))});var i=t.defIds;return!i||i.length===0||(e.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+t.idSuffix),Object.entries(n).forEach(function(o){var c=o[0],h=o[1];typeof h=="string"&&(n[c]=h.replace(/url\(#(.*)\)/,"url(#$1".concat(t.idSuffix,")")))})),n}function Ie(e,t){var r,n=t.defIds;return!n||n.length===0?e:e.tag==="defs"&&(!((r=e.children)===null||r===void 0)&&r.length)?I(I({},e),{children:e.children.map(function(i){return typeof i.attrs.id=="string"&&n&&n.indexOf(i.attrs.id)>-1?I(I({},i),{attrs:I(I({},i.attrs),{id:i.attrs.id+t.idSuffix})}):i})}):e}function Me(){return Math.random().toString(36).substring(2,8)}M.displayName="UniverIcon";var Ee={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 14.4667C12.4208 14.798 12.1522 15.0667 11.8208 15.0667C11.4895 15.0667 11.2208 14.798 11.2208 14.4667V2.98193L9.97861 4.22417C9.7443 4.45848 9.3644 4.45848 9.13008 4.22417C8.89577 3.98985 8.89577 3.60995 9.13008 3.37564L11.3967 1.10897C11.6311 0.874657 12.011 0.874657 12.2453 1.10897L14.5119 3.37564C14.7463 3.60995 14.7463 3.98985 14.5119 4.22417C14.2776 4.45848 13.8977 4.45848 13.6634 4.22417L12.4208 2.9816V14.4667Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z",fillRule:"evenodd",clipRule:"evenodd"}}]},q=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"ascending- single",ref:t,icon:Ee}))});q.displayName="AscendingSingle";var Te={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M14.1544 3.75557C14.3887 3.98988 14.3887 4.36978 14.1544 4.6041L6.51409 12.2444C6.40157 12.3569 6.24896 12.4201 6.08983 12.4201C5.9307 12.4201 5.77808 12.3569 5.66556 12.2444L1.84541 8.42425C1.6111 8.18993 1.6111 7.81003 1.84541 7.57572C2.07973 7.34141 2.45963 7.34141 2.69394 7.57572L6.08983 10.9716L13.3059 3.75557C13.5402 3.52126 13.9201 3.52126 14.1544 3.75557Z",fillRule:"evenodd",clipRule:"evenodd"}}]},oe=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"check-mark-single",ref:t,icon:Te}))});oe.displayName="CheckMarkSingle";var we={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M9.77445 9.24306L9.77457 11.9573C9.77458 12.2887 9.50597 12.5574 9.17459 12.5574 8.84322 12.5574 8.57458 12.2888 8.57457 11.9574L8.57439 7.79509C8.57438 7.46372 8.84299 7.19508 9.17436 7.19507 9.3281 7.19493 9.48196 7.25351 9.59925 7.3708L11.3465 9.11808C11.5808 9.3524 11.5808 9.7323 11.3465 9.96661 11.1122 10.2009 10.7323 10.2009 10.498 9.96661L9.77445 9.24306zM6.22584 10.5094L6.22572 7.79514C6.22571 7.46377 6.49433 7.19513 6.8257 7.19512 7.15707 7.1951 7.42571 7.46372 7.42572 7.79509L7.4259 11.9574C7.42592 12.2888 7.1573 12.5574 6.82593 12.5574 6.67228 12.5575 6.51828 12.4989 6.40104 12.3817L4.65376 10.6344C4.41945 10.4001 4.41945 10.0202 4.65376 9.78588 4.88808 9.55156 5.26798 9.55156 5.50229 9.78588L6.22584 10.5094z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.14014 3.73989C1.14014 2.30396 2.3042 1.13989 3.74014 1.13989H12.2601C13.6961 1.13989 14.8601 2.30395 14.8601 3.73989V12.2599C14.8601 13.6958 13.6961 14.8599 12.2601 14.8599H3.74014C2.3042 14.8599 1.14014 13.6958 1.14014 12.2599V3.73989ZM2.34014 5.86724V12.2599C2.34014 13.0331 2.96694 13.6599 3.74014 13.6599H12.2601C13.0333 13.6599 13.6601 13.0331 13.6601 12.2599V5.86724H2.34014ZM13.6601 4.66724H2.34014V3.73989C2.34014 2.9667 2.96694 2.33989 3.74014 2.33989H12.2601C13.0333 2.33989 13.6601 2.96669 13.6601 3.73989V4.66724Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ae=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"custom-sort-single",ref:t,icon:we}))});ae.displayName="CustomSortSingle";var be={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M5.3313 1.4667C5.3313 1.13533 5.59993.866699 5.9313.866699H10.069C10.4004.866699 10.669 1.13533 10.669 1.4667 10.669 1.79807 10.4004 2.0667 10.069 2.0667H5.9313C5.59993 2.0667 5.3313 1.79807 5.3313 1.4667zM1.09985 3.64443C1.09985 3.31306 1.36848 3.04443 1.69985 3.04443H14.2999C14.6312 3.04443 14.8999 3.31306 14.8999 3.64443 14.8999 3.9758 14.6312 4.24443 14.2999 4.24443H1.69985C1.36848 4.24443 1.09985 3.9758 1.09985 3.64443z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.75332 5.22217C3.86966 5.22217 3.15332 5.93851 3.15332 6.82217V13.1332C3.15332 14.2377 4.04875 15.1332 5.15332 15.1332H10.8465C11.9511 15.1332 12.8465 14.2377 12.8465 13.1331V6.82217C12.8465 5.93851 12.1302 5.22217 11.2465 5.22217H4.75332ZM4.35332 6.82217C4.35332 6.60125 4.53241 6.42217 4.75332 6.42217H11.2465C11.4674 6.42217 11.6465 6.60125 11.6465 6.82217V13.1331C11.6465 13.575 11.2884 13.9331 10.8465 13.9331H5.15332C4.71149 13.9331 4.35332 13.575 4.35332 13.1332V6.82217Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ce=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"delete-empty-single",ref:t,icon:be}))});ce.displayName="DeleteEmptySingle";var ke={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M12.4208 1.53335C12.4208 1.20198 12.1522 0.93335 11.8208 0.93335C11.4895 0.93335 11.2208 1.20198 11.2208 1.53335V13.0181L9.97861 11.7758C9.7443 11.5415 9.3644 11.5415 9.13008 11.7758C8.89577 12.0101 8.89577 12.39 9.13008 12.6244L11.3967 14.891C11.6311 15.1253 12.011 15.1253 12.2453 14.891L14.5119 12.6244C14.7463 12.39 14.7463 12.0101 14.5119 11.7758C14.2776 11.5415 13.8977 11.5415 13.6634 11.7758L12.4208 13.0184V1.53335Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M1.98967 10.2798C1.6583 10.2798 1.38967 10.0112 1.38967 9.67983 1.38967 9.34846 1.6583 9.07983 1.98967 9.07983H6.50138C6.74406 9.07983 6.96284 9.22602 7.05571 9.45022 7.14858 9.67443 7.09725 9.9325 6.92565 10.1041L3.43819 13.5916H6.50138C6.83276 13.5916 7.10138 13.8602 7.10138 14.1916 7.10138 14.5229 6.83276 14.7916 6.50138 14.7916H1.98967C1.74699 14.7916 1.52821 14.6454 1.43534 14.4212 1.34247 14.197 1.3938 13.9389 1.5654 13.7673L5.05286 10.2798H1.98967zM5.1846 1.86439C4.8641.989866 3.62725.989866 3.30674 1.86439L1.34882 7.20672C1.23479 7.51786 1.39458 7.86252 1.70571 7.97655 2.01684 8.09058 2.3615 7.93079 2.47553 7.61966L3.06159 6.02055 3.06338 6.02056H5.42975L6.01581 7.61966C6.12984 7.93079 6.4745 8.09058 6.78563 7.97655 7.09677 7.86252 7.25655 7.51786 7.14252 7.20672L5.1846 1.86439zM4.98996 4.82056L4.24567 2.78971 3.50138 4.82056H4.98996z",fillRule:"evenodd",clipRule:"evenodd"}}]},G=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"descending-single",ref:t,icon:ke}))});G.displayName="DescendingSingle";var Re={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 3.20024C1.57503 3.20024 1.3064 2.93161 1.3064 2.60024C1.3064 2.26887 1.57503 2.00024 1.9064 2.00024H4.57306C4.90443 2.00024 5.17306 2.26887 5.17306 2.60024C5.17306 2.93161 4.90443 3.20024 4.57306 3.20024H1.9064ZM1.3064 6.19985C1.3064 6.53122 1.57503 6.79985 1.9064 6.79985H5.9064C6.23777 6.79985 6.5064 6.53122 6.5064 6.19985C6.5064 5.86848 6.23777 5.59985 5.9064 5.59985H1.9064C1.57503 5.59985 1.3064 5.86848 1.3064 6.19985ZM1.9064 10.3997C1.57503 10.3997 1.3064 10.1311 1.3064 9.79971C1.3064 9.46834 1.57503 9.19971 1.9064 9.19971H7.23973C7.5711 9.19971 7.83973 9.46834 7.83973 9.79971C7.83973 10.1311 7.5711 10.3997 7.23973 10.3997H1.9064ZM1.9064 13.9996C1.57503 13.9996 1.3064 13.7309 1.3064 13.3996C1.3064 13.0682 1.57503 12.7996 1.9064 12.7996H8.57306C8.90443 12.7996 9.17306 13.0682 9.17306 13.3996C9.17306 13.7309 8.90443 13.9996 8.57306 13.9996H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 14.2667C12.4267 14.5981 12.1581 14.8667 11.8267 14.8667C11.4953 14.8667 11.2267 14.5981 11.2267 14.2667V3.18198L9.98447 4.42422C9.75015 4.65853 9.37026 4.65853 9.13594 4.42422C8.90163 4.1899 8.90163 3.81 9.13594 3.57569L11.4026 1.30902C11.6369 1.07471 12.0168 1.07471 12.2511 1.30902L14.5178 3.57569C14.7521 3.81 14.7521 4.1899 14.5178 4.42422C14.2835 4.65853 13.9036 4.65853 13.6693 4.42422L12.4267 3.18165V14.2667Z"}}]},le=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"expand-ascending-single",ref:t,icon:Re}))});le.displayName="ExpandAscendingSingle";var Oe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M1.9064 12.7998C1.57503 12.7998 1.3064 13.0684 1.3064 13.3998C1.3064 13.7311 1.57503 13.9998 1.9064 13.9998H4.57306C4.90443 13.9998 5.17306 13.7311 5.17306 13.3998C5.17306 13.0684 4.90443 12.7998 4.57306 12.7998H1.9064ZM1.3064 9.80015C1.3064 9.46878 1.57503 9.20015 1.9064 9.20015H5.9064C6.23777 9.20015 6.5064 9.46878 6.5064 9.80015C6.5064 10.1315 6.23777 10.4001 5.9064 10.4001H1.9064C1.57503 10.4001 1.3064 10.1315 1.3064 9.80015ZM1.9064 5.60029C1.57503 5.60029 1.3064 5.86892 1.3064 6.20029C1.3064 6.53166 1.57503 6.80029 1.9064 6.80029H7.23973C7.5711 6.80029 7.83973 6.53166 7.83973 6.20029C7.83973 5.86892 7.5711 5.60029 7.23973 5.60029H1.9064ZM1.9064 2.00044C1.57503 2.00044 1.3064 2.26907 1.3064 2.60044C1.3064 2.93181 1.57503 3.20044 1.9064 3.20044H8.57306C8.90443 3.20044 9.17306 2.93181 9.17306 2.60044C9.17306 2.26907 8.90443 2.00044 8.57306 2.00044H1.9064Z",fillRule:"evenodd",clipRule:"evenodd"}},{tag:"path",attrs:{fill:"currentColor",d:"M12.4267 1.7333C12.4267 1.40193 12.1581 1.1333 11.8267 1.1333C11.4953 1.1333 11.2267 1.40193 11.2267 1.7333V12.818L9.98447 11.5758C9.75015 11.3415 9.37026 11.3415 9.13594 11.5758C8.90163 11.8101 8.90163 12.19 9.13594 12.4243L11.4026 14.691C11.6369 14.9253 12.0168 14.9253 12.2511 14.691L14.5178 12.4243C14.7521 12.19 14.7521 11.8101 14.5178 11.5758C14.2835 11.3415 13.9036 11.3415 13.6693 11.5758L12.4267 12.8183V1.7333Z"}}]},de=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"expand-descending-single",ref:t,icon:Oe}))});de.displayName="ExpandDescendingSingle";var Pe={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.6 1.99991C8.60001 1.66854 8.33138 1.39991 8.00001 1.3999C7.66864 1.3999 7.40001 1.66853 7.4 1.9999L7.39996 7.3999H1.9999C1.66853 7.3999 1.3999 7.66853 1.3999 7.9999C1.3999 8.33127 1.66853 8.5999 1.9999 8.5999H7.39995L7.3999 13.9999C7.3999 14.3313 7.66853 14.5999 7.9999 14.5999C8.33127 14.5999 8.5999 14.3313 8.5999 13.9999L8.59995 8.5999H13.9999C14.3313 8.5999 14.5999 8.33127 14.5999 7.9999C14.5999 7.66853 14.3313 7.3999 13.9999 7.3999H8.59996L8.6 1.99991Z"}}]},Y=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"increase-single",ref:t,icon:Pe}))});Y.displayName="IncreaseSingle";var Ne={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M11.3536 6.14645C11.5488 6.34171 11.5488 6.65829 11.3536 6.85355L8.35355 9.85355C8.15829 10.0488 7.84171 10.0488 7.64645 9.85355L4.64645 6.85355C4.45118 6.65829 4.45118 6.34171 4.64645 6.14645C4.84171 5.95118 5.15829 5.95118 5.35355 6.14645L8 8.79289L10.6464 6.14645C10.8417 5.95118 11.1583 5.95118 11.3536 6.14645Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ue=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"more-down-single",ref:t,icon:Ne}))});ue.displayName="MoreDownSingle";var De={tag:"svg",attrs:{fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"mask",attrs:{id:"mask0_622_8",style:{maskType:"alpha"},width:16,height:16,x:0,y:0,maskUnits:"userSpaceOnUse"},children:[{tag:"path",attrs:{fill:"#D9D9D9",d:"M0 0H16V16H0z"}}]},{tag:"g",attrs:{fill:"currentColor",mask:"url(#mask0_622_8)"},children:[{tag:"path",attrs:{d:"M6 5C6.55228 5 7 4.55228 7 4 7 3.44772 6.55228 3 6 3 5.44772 3 5 3.44772 5 4 5 4.55228 5.44772 5 6 5zM6 9C6.55228 9 7 8.55229 7 8 7 7.44772 6.55228 7 6 7 5.44772 7 5 7.44772 5 8 5 8.55229 5.44772 9 6 9zM7 12C7 12.5523 6.55228 13 6 13 5.44772 13 5 12.5523 5 12 5 11.4477 5.44772 11 6 11 6.55228 11 7 11.4477 7 12zM10 5C10.5523 5 11 4.55228 11 4 11 3.44772 10.5523 3 10 3 9.44771 3 9 3.44772 9 4 9 4.55228 9.44771 5 10 5zM11 8C11 8.55229 10.5523 9 10 9 9.44771 9 9 8.55229 9 8 9 7.44772 9.44771 7 10 7 10.5523 7 11 7.44772 11 8zM10 13C10.5523 13 11 12.5523 11 12 11 11.4477 10.5523 11 10 11 9.44771 11 9 11.4477 9 12 9 12.5523 9.44771 13 10 13z"}}]}]},ge=l.forwardRef(function(e,t){return l.createElement(M,Object.assign({},e,{id:"sequence-single",ref:t,icon:De}))});ge.displayName="SequenceSingle";const Le=e=>{const[t,r]=l.useState("0"),n=u.useDependency(s.LocaleService);return a.jsxs("div",{className:"univer-text-sm",children:[a.jsx("div",{className:"extend-confirm-desc",children:n.t("sheets-sort.dialog.sort-reminder-desc")}),a.jsxs(_.RadioGroup,{className:"univer-mt-4",value:t,direction:"vertical",onChange:i=>{r(i),e.onChange(i)},children:[a.jsx(_.Radio,{value:"0",children:n.t("sheets-sort.dialog.sort-reminder-no")}),a.jsx(_.Radio,{value:"1",children:n.t("sheets-sort.dialog.sort-reminder-ext")})]})]})};var Ue=Object.getOwnPropertyDescriptor,He=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ue(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},R=(e,t)=>(r,n)=>t(r,n,e);const D={MERGE_ERROR:"sheets-sort.error.merge-size",EMPTY_ERROR:"sheets-sort.error.empty",SINGLE_ERROR:"sheets-sort.error.single",FORMULA_ARRAY:"sheets-sort.error.formula-array"};let f=class extends s.Disposable{constructor(t,r,n,i,o,c,h){super();ne(this,"_customSortState$",new re.BehaviorSubject(null));ne(this,"customSortState$",this._customSortState$.asObservable());this._univerInstanceService=t,this._confirmService=r,this._logService=n,this._selectionManagerService=i,this._sheetsSortService=o,this._localeService=c,this._commandService=h}async triggerSortDirectly(t,r,n){const i=n||await this._detectSortLocation(r);if(!i||!this._check(i))return!1;const c={orderRules:[{type:t?p.SortType.ASC:p.SortType.DESC,colIndex:i.colIndex}],range:i.range};return this._sheetsSortService.applySort(c,i.unitId,i.subUnitId),!0}async triggerSortCustomize(){const t=await this._detectSortLocation();return!t||!this._check(t)?!1:(this.showCustomSortPanel(t),!0)}customSortState(){return this._customSortState$.getValue()}getTitles(t){var m,C;const r=(m=this.customSortState())==null?void 0:m.location;if(!r)return[];const{unitId:n,subUnitId:i,range:o}=r,c=(C=this._univerInstanceService.getUnit(n))==null?void 0:C.getSheetBySheetId(i);if(!c)return[];const h=je(this._localeService);return Array.from({length:o.endColumn-o.startColumn+1},(b,x)=>{var y;const k=(y=c.getCell(o.startRow,x+o.startColumn))==null?void 0:y.v;return{index:x+o.startColumn,label:t?`${k!=null?k:h(x+o.startColumn)}`:h(x+o.startColumn)}})}setSelection(t,r,n){var c;const i=(c=this._univerInstanceService.getUnit(t))==null?void 0:c.getSheetBySheetId(r);if(!i)return;const o={unitId:t,subUnitId:r,selections:[{range:n,primary:g.getPrimaryForRange(n,i),style:null}]};this._commandService.executeCommand(g.SetSelectionsOperation.id,o)}async showCheckError(t){return await this._confirmService.confirm({id:"sort-range-check-error",title:{title:this._localeService.t("info.tooltip")},children:{title:a.jsx("div",{children:this._localeService.t(t)})}})}async showExtendConfirm(){let t=!1;return await this._confirmService.confirm({id:"extend-sort-range-dialog",title:{title:this._localeService.t("sheets-sort.dialog.sort-reminder")},children:{title:a.jsx(Le,{onChange:n=>{t=n==="1"}})},width:400})?t?"extend":"keep":"cancel"}showCustomSortPanel(t){this._customSortState$.next({location:t,show:!0})}closeCustomSortPanel(){this._customSortState$.next({show:!1})}_check(t){return this._sheetsSortService.singleCheck(t)?this._sheetsSortService.mergeCheck(t)?this._sheetsSortService.formulaCheck(t)?this._sheetsSortService.emptyCheck(t)?!0:(this.showCheckError(D.EMPTY_ERROR),!1):(this.showCheckError(D.FORMULA_ARRAY),!1):(this.showCheckError(D.MERGE_ERROR),!1):(this.showCheckError(D.SINGLE_ERROR),!1)}async _detectSortLocation(t){const r=this._univerInstanceService.getCurrentUnitForType(s.UniverInstanceType.UNIVER_SHEET),n=r.getActiveSheet(),i=r.getUnitId(),o=n.getSheetId(),c=this._selectionManagerService.getCurrentLastSelection();if(!c)return null;let h;if(t===!0)h=g.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},n),this.setSelection(i,o,h);else if(t===!1)h=c.range;else{const m=await this.showExtendConfirm();if(m==="cancel")return null;m==="keep"?h=c.range:(h=g.expandToContinuousRange(c.range,{up:!0,down:!0,left:!0,right:!0},n),this.setSelection(i,o,h))}return{range:h,unitId:i,subUnitId:o,colIndex:c.primary.actualColumn}}};f=He([R(0,s.IUniverInstanceService),R(1,u.IConfirmService),R(2,s.ILogService),R(3,s.Inject(g.SheetsSelectionsService)),R(4,s.Inject(p.SheetsSortService)),R(5,s.Inject(s.LocaleService)),R(6,s.ICommandService)],f);function je(e){return t=>{const r=s.Tools.chatAtABC(t);switch(e.getCurrentLocale()){case s.LocaleType.ZH_CN:return`"${r}"列`;case s.LocaleType.EN_US:return`Column "${r}"`;default:return`Column "${r}"`}}}const L={id:"sheet.command.sort-range-asc",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!0,!1)},U={id:"sheet.command.sort-range-asc-ext",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!0,!0)},H={id:"sheet.command.sort-range-desc",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!1,!1)},j={id:"sheet.command.sort-range-desc-ext",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!1,!0)},A={id:"sheet.command.sort-range-custom",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortCustomize()},$={id:"sheet.command.sort-range-asc-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!0,!1)},B={id:"sheet.command.sort-range-asc-ext-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!0,!0)},F={id:"sheet.command.sort-range-desc-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!1,!1)},W={id:"sheet.command.sort-range-desc-ext-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortDirectly(!1,!0)},V={id:"sheet.command.sort-range-custom-ctx",type:s.CommandType.COMMAND,handler:async e=>await e.get(f).triggerSortCustomize()};function Ae(){const e=u.useDependency(f),t=u.useObservable(e.customSortState$);return!t||!t.location?null:a.jsx($e,{state:t})}function $e({state:e}){const t=u.useDependency(p.SheetsSortService),r=u.useDependency(s.LocaleService),n=u.useDependency(f),[i,o]=l.useState(!1),[c,h]=l.useState(0),m=l.useRef(null),{range:C,unitId:b,subUnitId:x}=e.location,k=n.getTitles(i),[y,P]=l.useState([{type:p.SortType.ASC,colIndex:C.startColumn}]),ee=l.useCallback((v,E)=>{const N=[...y];E===null?N.splice(v,1):N[v]=E,P(N)},[y]),Z=l.useCallback(s.throttle(()=>{const v=[...y],E=Fe(C,y);E!==null&&(v.push({type:p.SortType.ASC,colIndex:E}),P(v))},200),[y,C]),S=l.useCallback((v,E)=>{t.applySort({range:C,orderRules:v,hasTitle:E}),n.closeCustomSortPanel()},[t,n,C]),te=l.useCallback(()=>{n.closeCustomSortPanel()},[n]),gt=l.useCallback(v=>{o(v),v?n.setSelection(b,x,{...C,startRow:C.startRow+1}):n.setSelection(b,x,C)},[n,C,x,b]);l.useEffect(()=>{m.current&&y.length>5&&(m.current.scrollTop=m.current.scrollHeight)},[y]);const ht=y.length<k.length,fe=y.map(v=>({...v,id:`${v.colIndex}`}));return a.jsxs("div",{children:[a.jsxs("div",{onMouseDown:v=>{v.stopPropagation()},children:[a.jsxs("div",{className:"univer-flex univer-items-center univer-justify-between",children:[a.jsx(_.Checkbox,{checked:i,onChange:v=>gt(!!v),children:r.t("sheets-sort.dialog.first-row-check")}),ht?a.jsxs("div",{className:`
11
+ univer-flex univer-cursor-pointer univer-select-none univer-items-center
12
+ univer-text-base
13
+ `,onClick:Z,children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5",children:r.t("sheets-sort.dialog.add-condition")})]}):a.jsxs("div",{className:`
14
+ univer-flex univer-cursor-pointer univer-select-none univer-items-center
15
+ univer-text-base univer-text-primary-500
16
+ disabled:univer-cursor-not-allowed disabled:univer-divide-opacity-30
17
+ disabled:univer-text-gray-800
18
+ `,children:[a.jsx(Y,{}),a.jsx("span",{className:"univer-ml-1.5 univer-text-xs",children:r.t("sheets-sort.dialog.add-condition")})]})]}),a.jsx("div",{className:"univer-max-h-[310px] univer-overflow-y-auto univer-overflow-x-hidden",onScroll:v=>{const E=v.currentTarget.scrollTop;h(E)},ref:m,children:a.jsx(_.DraggableList,{list:fe,onListChange:P,idKey:"id",draggableHandle:"[data-u-comp=sort-panel-item-handler]",itemRender:v=>a.jsx(Be,{titles:k,list:fe,item:v,onChange:(E,N)=>ee(N,E),scrollPosition:c}),rowHeight:32,margin:[0,12]})})]}),a.jsxs("div",{className:"univer-mt-5 univer-flex univer-justify-end",children:[a.jsx(_.Button,{className:"univer-ml-3",onClick:()=>te(),children:r.t("sheets-sort.dialog.cancel")}),a.jsx(_.Button,{className:"univer-ml-3",variant:"primary",onClick:()=>S(y,i),children:r.t("sheets-sort.dialog.confirm")})]})]})}function Be(e){var Z;const{list:t,item:r,titles:n,onChange:i,scrollPosition:o}=e,c=u.useDependency(s.LocaleService),h=n.filter(S=>!t.some(te=>te.colIndex===S.index)||S.index===r.colIndex),m=t.findIndex(S=>S.colIndex===r.colIndex),C=l.useCallback(S=>{i({...r,colIndex:S.index},m),x(!1)},[m,r,i]),[b,x]=l.useState(!1),k=S=>{x(S)};l.useEffect(()=>{x(!1)},[o]);const y=t.length>1,P=(Z=n.find(S=>S.index===r.colIndex))==null?void 0:Z.label,ee=c.getCurrentLocale()===s.LocaleType.ZH_CN?"univer-flex univer-px-5":"univer-flex univer-px-2.5";return a.jsxs("div",{className:"univer-flex univer-items-center",children:[a.jsxs("div",{className:"univer-flex univer-items-center",children:[a.jsx("div",{"data-u-comp":"sort-panel-item-handler",className:`
19
+ univer-flex univer-cursor-pointer univer-items-center univer-justify-center univer-text-base
20
+ univer-text-gray-700
21
+ `,children:a.jsx(ge,{})}),a.jsx("div",{children:a.jsx(_.Dropdown,{align:"start",overlay:a.jsx("ul",{className:`
22
+ univer-my-0 univer-box-border univer-grid univer-max-h-[310px] univer-items-center
23
+ univer-gap-1 univer-overflow-y-auto univer-overflow-x-hidden univer-rounded-lg
24
+ univer-border univer-bg-white univer-p-1 univer-text-base univer-shadow-lg
25
+ `,children:h.map(S=>a.jsxs("li",{onClick:()=>C(S),className:`
26
+ univer-relative univer-box-border univer-flex univer-h-7 univer-cursor-pointer
27
+ univer-list-none univer-items-center univer-justify-between univer-rounded
28
+ univer-px-2 univer-text-sm univer-transition-all
29
+ hover:univer-bg-gray-100
30
+ `,children:[a.jsx("span",{className:"univer-max-w-[220px] univer-truncate",children:S.label}),a.jsx("span",{children:S.index===r.colIndex&&a.jsx(oe,{})})]},S.index))}),open:b,onOpenChange:k,children:a.jsxs("div",{className:`
31
+ univer-ml-2 univer-flex univer-w-[236px] univer-items-center univer-justify-between
32
+ univer-overflow-hidden univer-rounded-md univer-border univer-border-gray-200
33
+ univer-px-2.5 univer-py-1.5 univer-text-sm univer-text-gray-900
34
+ `,children:[a.jsx("span",{className:`
35
+ univer-max-w-[220px] univer-overflow-hidden univer-text-ellipsis
36
+ univer-whitespace-nowrap
37
+ `,children:P}),a.jsx(ue,{})]})})})]}),a.jsx("div",{children:a.jsxs(_.RadioGroup,{className:ee,value:r.type,onChange:S=>{i({...r,type:S},m)},children:[a.jsx(_.Radio,{value:p.SortType.ASC,children:c.t("sheets-sort.general.sort-asc")}),a.jsx(_.Radio,{value:p.SortType.DESC,children:c.t("sheets-sort.general.sort-desc")})]})}),a.jsx("div",{className:"univer-absolute univer-right-0 univer-cursor-pointer univer-text-sm univer-s-[14px]",children:y&&a.jsx(ce,{onClick:()=>i(null,m)})})]})}function Fe(e,t){const{startColumn:r,endColumn:n}=e,i=new Set(t.map(o=>o==null?void 0:o.colIndex));for(let o=r;o<=n;o++)if(!i.has(o))return o;return null}function We(e){const{range:t,colIndex:r,onClose:n}=e,i=u.useDependency(f),o=u.useDependency(s.IUniverInstanceService),c=u.useDependency(s.LocaleService),h=l.useCallback(m=>{const{unitId:C,subUnitId:b}=g.getSheetCommandTarget(o)||{};if(t&&C&&b){const x={...t,startRow:t.startRow+1};i.triggerSortDirectly(m,!1,{unitId:C,subUnitId:b,range:x,colIndex:r})}else throw new Error(`Cannot find the target to sort. unitId: ${C}, subUnitId: ${b}, range: ${t}, colIndex: ${r}`);n()},[t,r,i,o,n]);return a.jsxs(_.ButtonGroup,{className:"univer-mb-3 univer-w-full",children:[a.jsxs(_.Button,{className:"univer-w-1/2",onClick:()=>h(!0),children:[a.jsx(q,{className:"univer-mr-1"}),c.t("sheets-sort.general.sort-asc")]}),a.jsxs(_.Button,{className:"univer-w-1/2",onClick:()=>h(!1),children:[a.jsx(G,{className:"univer-mr-1"}),c.t("sheets-sort.general.sort-desc")]})]})}const he="sheet.menu.sheets-sort",me="sheet.menu.sheets-sort-ctx",O="AscendingSingle",X="ExpandAscendingSingle",K="DescendingSingle",J="ExpandDescendingSingle",Q="CustomSortSingle";function Ve(e){return{id:he,type:u.MenuItemType.SUBITEMS,icon:O,tooltip:"sheets-sort.general.sort",hidden$:u.getMenuHiddenObservable(e,s.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function ze(e){return{id:L.id,icon:O,title:"sheets-sort.general.sort-asc-cur",type:u.MenuItemType.BUTTON,hidden$:T.getCurrentExclusiveRangeInterest$(e)}}function Ze(e){return{id:U.id,title:"sheets-sort.general.sort-asc-ext",icon:X,type:u.MenuItemType.BUTTON}}function qe(e){return{id:H.id,title:"sheets-sort.general.sort-desc-cur",icon:K,type:u.MenuItemType.BUTTON}}function Ge(e){return{id:j.id,title:"sheets-sort.general.sort-desc-ext",icon:J,type:u.MenuItemType.BUTTON}}function Ye(e){return{id:A.id,title:"sheets-sort.general.sort-custom",type:u.MenuItemType.BUTTON,icon:Q}}function Xe(e){return{id:me,title:"sheets-sort.general.sort",type:u.MenuItemType.SUBITEMS,icon:O,hidden$:u.getMenuHiddenObservable(e,s.UniverInstanceType.UNIVER_SHEET),disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function Ke(e){return{id:$.id,title:"sheets-sort.general.sort-asc-cur",type:u.MenuItemType.BUTTON,icon:O,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function Je(e){return{id:B.id,title:"sheets-sort.general.sort-asc-ext",type:u.MenuItemType.BUTTON,icon:X,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function Qe(e){return{id:F.id,title:"sheets-sort.general.sort-desc-cur",type:u.MenuItemType.BUTTON,icon:K,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function et(e){return{id:W.id,title:"sheets-sort.general.sort-desc-ext",type:u.MenuItemType.BUTTON,icon:J,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}function tt(e){return{id:V.id,title:"sheets-sort.general.sort-custom",type:u.MenuItemType.BUTTON,icon:Q,disabled$:T.getCurrentRangeDisable$(e,{workbookTypes:[g.WorkbookEditablePermission],worksheetTypes:[g.WorksheetSortPermission,g.WorksheetEditPermission],rangeTypes:[g.RangeProtectionPermissionEditPoint]})}}const nt={[u.RibbonStartGroup.FORMULAS_INSERT]:{[he]:{order:2,menuItemFactory:Ve,[L.id]:{order:0,menuItemFactory:ze},[U.id]:{order:1,menuItemFactory:Ze},[H.id]:{order:2,menuItemFactory:qe},[j.id]:{order:3,menuItemFactory:Ge},[A.id]:{order:4,menuItemFactory:Ye}}},[u.ContextMenuPosition.MAIN_AREA]:{[u.ContextMenuGroup.DATA]:{[me]:{order:0,menuItemFactory:Xe,[$.id]:{order:0,menuItemFactory:Ke},[B.id]:{order:1,menuItemFactory:Je},[F.id]:{order:2,menuItemFactory:Qe},[W.id]:{order:3,menuItemFactory:et},[V.id]:{order:4,menuItemFactory:tt}}}}};var rt=Object.getOwnPropertyDescriptor,it=(e,t,r,n)=>{for(var i=n>1?void 0:n?rt(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},w=(e,t)=>(r,n)=>t(r,n,e);const ve="custom-sort-dialog",st=560;let z=class extends s.RxDisposable{constructor(e,t,r,n,i,o,c,h,m,C){super(),this._commandService=e,this._menuManagerService=t,this._dialogService=r,this._layoutService=n,this._uiPartsService=i,this._sheetRenderService=o,this._localeService=c,this._sheetsSortUIService=h,this._injector=m,this._componentManager=C,this._initCommands(),this._initMenu(),this._initUI()}_initMenu(){this._menuManagerService.mergeMenu(nt)}_initCommands(){[L,U,H,j,A,$,B,F,W,V].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this.disposeWithMe(this._sheetRenderService.registerSkeletonChangingMutations(p.SortRangeCommand.id))}_initUI(){this.disposeWithMe(this._componentManager.register("CustomSortPanel",Ae)),this.disposeWithMe(this._uiPartsService.registerComponent(T.SheetsUIPart.FILTER_PANEL_EMBED_POINT,()=>u.connectInjector(We,this._injector))),this.disposeWithMe(this._componentManager.register(O,q)),this.disposeWithMe(this._componentManager.register(X,le)),this.disposeWithMe(this._componentManager.register(K,G)),this.disposeWithMe(this._componentManager.register(J,de)),this.disposeWithMe(this._componentManager.register(Q,ae)),this._sheetsSortUIService.customSortState$.pipe(re.takeUntil(this.dispose$)).subscribe(e=>{e&&e.show&&e.location?this._openCustomSortPanel(e.location):e&&!(e!=null&&e.show)&&this._closePanel()})}_openCustomSortPanel(e){this._dialogService.open({id:ve,draggable:!0,width:st,title:{title:`${this._localeService.t("sheets-sort.general.sort-custom")}: ${pe.serializeRange(e.range)}`},children:{label:"CustomSortPanel"},destroyOnClose:!0,defaultPosition:ot(),preservePositionOnDestroy:!1,onClose:()=>this._closePanel(),mask:!0})}_closePanel(){this._dialogService.close(ve),queueMicrotask(()=>this._layoutService.focus())}};z=it([w(0,s.ICommandService),w(1,u.IMenuManagerService),w(2,u.IDialogService),w(3,u.ILayoutService),w(4,u.IUIPartsService),w(5,s.Inject(T.SheetsRenderService)),w(6,s.Inject(s.LocaleService)),w(7,s.Inject(f)),w(8,s.Inject(s.Injector)),w(9,s.Inject(u.ComponentManager))],z);function ot(){return{x:0,y:0}}var at=Object.defineProperty,ct=Object.getOwnPropertyDescriptor,lt=(e,t,r)=>t in e?at(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,dt=(e,t,r,n)=>{for(var i=n>1?void 0:n?ct(t,r):t,o=e.length-1,c;o>=0;o--)(c=e[o])&&(i=c(i)||i);return i},Ce=(e,t)=>(r,n)=>t(r,n,e),Se=(e,t,r)=>lt(e,typeof t!="symbol"?t+"":t,r);const ut="SHEET_SORT_UI_PLUGIN";d.UniverSheetsSortUIPlugin=class extends s.Plugin{constructor(t=ie,r,n){super(),this._config=t,this._injector=r,this._configService=n;const{...i}=s.merge({},ie,this._config);this._configService.setConfig(ye,i)}onStarting(){[[f],[z]].forEach(t=>this._injector.add(t))}onRendered(){this._injector.get(z)}},Se(d.UniverSheetsSortUIPlugin,"type",s.UniverInstanceType.UNIVER_SHEET),Se(d.UniverSheetsSortUIPlugin,"pluginName",ut),d.UniverSheetsSortUIPlugin=dt([s.DependentOn(p.UniverSheetsSortPlugin),Ce(1,s.Inject(s.Injector)),Ce(2,s.IConfigService)],d.UniverSheetsSortUIPlugin),d.SortRangeAscCommand=L,d.SortRangeAscExtCommand=U,d.SortRangeAscExtInCtxMenuCommand=B,d.SortRangeAscInCtxMenuCommand=$,d.SortRangeCustomCommand=A,d.SortRangeCustomInCtxMenuCommand=V,d.SortRangeDescCommand=H,d.SortRangeDescExtCommand=j,d.SortRangeDescExtInCtxMenuCommand=W,d.SortRangeDescInCtxMenuCommand=F,Object.defineProperty(d,Symbol.toStringTag,{value:"Module"})});
20
38
 
21
39
 
22
40
  // index
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@univerjs/preset-sheets-sort",
3
- "version": "0.6.10",
3
+ "version": "0.7.0-beta.1",
4
4
  "private": false,
5
5
  "description": "",
6
6
  "author": "DreamNum <developer@univer.ai>",
@@ -57,15 +57,16 @@
57
57
  "rxjs": ">=7.0.0"
58
58
  },
59
59
  "dependencies": {
60
- "@univerjs/sheets-sort": "0.6.10",
61
- "@univerjs/sheets-sort-ui": "0.6.10"
60
+ "@univerjs/sheets-sort": "0.7.0-beta.1",
61
+ "@univerjs/sheets-sort-ui": "0.7.0-beta.1",
62
+ "rxjs": ">=7.0.0"
62
63
  },
63
64
  "devDependencies": {
64
- "@univerjs/core": "0.6.10",
65
+ "@univerjs/core": "0.7.0-beta.1",
65
66
  "react": "18.3.1",
66
67
  "react-dom": "18.3.1",
67
- "typescript": "^5.8.2",
68
- "@univerjs-infra/shared": "0.6.10"
68
+ "typescript": "^5.8.3",
69
+ "@univerjs-infra/shared": "0.7.0-beta.1"
69
70
  },
70
71
  "scripts": {
71
72
  "prebuild:preset": "tsx prepare.ts",