@univerjs/sheets-filter-ui 0.17.0 → 0.18.0
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/cjs/index.js +70 -2
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/index.js +70 -2433
- package/lib/es/locale/ca-ES.js +1 -85
- package/lib/es/locale/en-US.js +1 -85
- package/lib/es/locale/es-ES.js +1 -85
- package/lib/es/locale/fa-IR.js +1 -85
- package/lib/es/locale/fr-FR.js +1 -85
- package/lib/es/locale/ja-JP.js +1 -85
- package/lib/es/locale/ko-KR.js +1 -85
- package/lib/es/locale/ru-RU.js +1 -85
- package/lib/es/locale/sk-SK.js +1 -85
- package/lib/es/locale/vi-VN.js +1 -85
- package/lib/es/locale/zh-CN.js +1 -85
- package/lib/es/locale/zh-TW.js +1 -85
- package/lib/index.css +393 -1
- package/lib/index.js +70 -2433
- package/lib/locale/ca-ES.js +1 -85
- package/lib/locale/en-US.js +1 -85
- package/lib/locale/es-ES.js +1 -85
- package/lib/locale/fa-IR.js +1 -85
- package/lib/locale/fr-FR.js +1 -85
- package/lib/locale/ja-JP.js +1 -85
- package/lib/locale/ko-KR.js +1 -85
- package/lib/locale/ru-RU.js +1 -85
- package/lib/locale/sk-SK.js +1 -85
- package/lib/locale/vi-VN.js +1 -85
- package/lib/locale/zh-CN.js +1 -85
- package/lib/locale/zh-TW.js +1 -85
- package/lib/types/__testing__/data.d.ts +16 -1
- package/lib/types/commands/operations/sheets-filter.operation.d.ts +17 -2
- package/lib/types/config/config.d.ts +16 -1
- package/lib/types/controllers/sheets-filter-permission.controller.d.ts +16 -1
- package/lib/types/controllers/sheets-filter-ui-desktop.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-filter-ui-mobile.controller.d.ts +15 -0
- package/lib/types/controllers/sheets-filter.shortcut.d.ts +16 -1
- package/lib/types/locale/ca-ES.d.ts +16 -1
- package/lib/types/locale/es-ES.d.ts +16 -1
- package/lib/types/locale/fa-IR.d.ts +16 -1
- package/lib/types/locale/fr-FR.d.ts +16 -1
- package/lib/types/locale/ja-JP.d.ts +16 -1
- package/lib/types/locale/ko-KR.d.ts +16 -1
- package/lib/types/locale/ru-RU.d.ts +16 -1
- package/lib/types/locale/sk-SK.d.ts +16 -1
- package/lib/types/locale/vi-VN.d.ts +16 -1
- package/lib/types/locale/zh-CN.d.ts +16 -1
- package/lib/types/locale/zh-TW.d.ts +16 -1
- package/lib/types/menu/schema.d.ts +16 -1
- package/lib/types/menu/sheets-filter.menu.d.ts +17 -2
- package/lib/types/mobile-plugin.d.ts +16 -1
- package/lib/types/models/conditions.d.ts +18 -2
- package/lib/types/models/utils.d.ts +16 -1
- package/lib/types/plugin.d.ts +16 -1
- package/lib/types/services/sheets-filter-panel.service.d.ts +22 -5
- package/lib/types/services/util.d.ts +16 -1
- package/lib/types/views/components/SheetsFilterByColorsPanel.d.ts +16 -1
- package/lib/types/views/components/SheetsFilterByConditionsPanel.d.ts +16 -1
- package/lib/types/views/components/SheetsFilterByValuesPanel.d.ts +16 -1
- package/lib/types/views/components/SheetsFilterPanel.stories.d.ts +16 -1
- package/lib/types/views/render-modules/sheets-filter.render-controller.d.ts +18 -2
- package/lib/types/views/widgets/drawings.d.ts +16 -1
- package/lib/types/views/widgets/filter-button.shape.d.ts +17 -1
- package/lib/types/worker/generate-filter-values.service.d.ts +20 -4
- package/lib/types/worker/plugin.d.ts +15 -0
- package/lib/umd/index.js +70 -2
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +15 -14
package/lib/umd/index.js
CHANGED
|
@@ -1,7 +1,75 @@
|
|
|
1
|
-
(function(g,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("@univerjs/core"),require("@univerjs/sheets-filter"),require("@univerjs/sheets-ui"),require("@univerjs/ui"),require("@univerjs/engine-render"),require("@univerjs/sheets"),require("rxjs"),require("@univerjs/rpc"),require("@univerjs/design"),require("react"),require("react/jsx-runtime")):typeof define=="function"&&define.amd?define(["exports","@univerjs/core","@univerjs/sheets-filter","@univerjs/sheets-ui","@univerjs/ui","@univerjs/engine-render","@univerjs/sheets","rxjs","@univerjs/rpc","@univerjs/design","react","react/jsx-runtime"],c):(g=typeof globalThis<"u"?globalThis:g||self,c(g.UniverSheetsFilterUi={},g.UniverCore,g.UniverSheetsFilter,g.UniverSheetsUi,g.UniverUi,g.UniverEngineRender,g.UniverSheets,g.rxjs,g.UniverRpc,g.UniverDesign,g.React,g.React))})(this,(function(g,c,u,$,C,K,y,S,fe,N,F,d){"use strict";var rr=Object.defineProperty;var ir=(g,c,u)=>c in g?rr(g,c,{enumerable:!0,configurable:!0,writable:!0,value:u}):g[c]=u;var _=(g,c,u)=>ir(g,typeof c!="symbol"?c+"":c,u);var se;var R=(r=>(r[r.FIRST=0]="FIRST",r[r.SECOND=1]="SECOND",r))(R||{}),E=(r=>(r.NONE="none",r.STARTS_WITH="startsWith",r.DOES_NOT_START_WITH="doesNotStartWith",r.ENDS_WITH="endsWith",r.DOES_NOT_END_WITH="doesNotEndWith",r.CONTAINS="contains",r.DOES_NOT_CONTAIN="doesNotContain",r.EQUALS="equals",r.NOT_EQUALS="notEquals",r.EMPTY="empty",r.NOT_EMPTY="notEmpty",r.BETWEEN="between",r.NOT_BETWEEN="notBetween",r.CUSTOM="custom",r))(E||{}),f;(r=>{r.NONE={label:"sheets-filter.conditions.none",operator:E.NONE,order:R.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw new Error("[FilterConditionItems.NONE]: should not have initial form params!")},testMappingParams:i=>i.operator1===E.NONE,mapToFilterColumn:()=>null,testMappingFilterColumn:i=>!i.customFilters&&!i.filters?{}:!1},r.EMPTY={label:"sheets-filter.conditions.empty",operator:E.EMPTY,order:R.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw new Error("[FilterConditionItems.EMPTY]: should not have initial form params!")},testMappingParams:({operator1:i})=>i===E.EMPTY,mapToFilterColumn:()=>({customFilters:{customFilters:[{val:""}]}}),testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.val===""&&s.operator===void 0?{operator1:E.EMPTY}:!1}},r.NOT_EMPTY={label:"sheets-filter.conditions.not-empty",operator:E.NOT_EMPTY,order:R.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw new Error("[FilterConditionItems.NOT_EMPTY]: should not have initial form params!")},testMappingParams:({operator1:i})=>i===E.NOT_EMPTY,mapToFilterColumn:()=>({customFilters:{customFilters:[{val:"",operator:u.CustomFilterOperator.NOT_EQUALS}]}}),testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.val===" "&&s.operator===u.CustomFilterOperator.NOT_EQUALS?{operator1:E.NOT_EMPTY}:!1}},r.TEXT_CONTAINS={label:"sheets-filter.conditions.text-contains",operator:E.CONTAINS,order:R.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:E.CONTAINS,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===E.CONTAINS},mapToFilterColumn:i=>{const{val1:s}=i;return s===""?null:{customFilters:{customFilters:[{val:`*${s}*`}]}}},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0],a=s.val.toString();return!s.operator&&a.startsWith("*")&&a.endsWith("*")?{operator1:E.CONTAINS,val1:a.slice(1,-1)}:!1}},r.DOES_NOT_CONTAIN={label:"sheets-filter.conditions.does-not-contain",operator:E.DOES_NOT_CONTAIN,order:R.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:E.DOES_NOT_CONTAIN,val1:""}),mapToFilterColumn:i=>({customFilters:{customFilters:[{val:`*${i.val1}*`,operator:u.CustomFilterOperator.NOT_EQUALS}]}}),testMappingParams:i=>{const[s]=D(i);return s===E.DOES_NOT_CONTAIN},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0],a=s.val.toString();return s.operator===u.CustomFilterOperator.NOT_EQUALS&&a.startsWith("*")&&a.endsWith("*")?{operator1:E.DOES_NOT_CONTAIN,val1:a.slice(1,-1)}:!1}},r.STARTS_WITH={label:"sheets-filter.conditions.starts-with",operator:E.STARTS_WITH,order:R.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:E.STARTS_WITH,val1:""}),mapToFilterColumn:i=>({customFilters:{customFilters:[{val:`${i.val1}*`}]}}),testMappingParams:i=>{const[s]=D(i);return s===E.STARTS_WITH},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0],a=s.val.toString();return!s.operator&&a.endsWith("*")&&!a.startsWith("*")?{operator1:E.STARTS_WITH,val1:a.slice(0,-1)}:!1}},r.ENDS_WITH={label:"sheets-filter.conditions.ends-with",operator:E.ENDS_WITH,order:R.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:E.ENDS_WITH,val1:""}),mapToFilterColumn:i=>({customFilters:{customFilters:[{val:`*${i.val1}`}]}}),testMappingParams:i=>{const[s]=D(i);return s===E.ENDS_WITH},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0],a=s.val.toString();return!s.operator&&a.startsWith("*")&&!a.endsWith("*")?{operator1:E.ENDS_WITH,val1:a.slice(1)}:!1}},r.EQUALS={label:"sheets-filter.conditions.equals",operator:E.EQUALS,order:R.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:E.EQUALS,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===E.EQUALS},mapToFilterColumn:i=>{const{val1:s}=i;return s===""?null:{customFilters:{customFilters:[{val:s}]}}},testMappingFilterColumn:i=>{var s,a,h;return((a=(s=i.filters)==null?void 0:s.filters)==null?void 0:a.length)===1?{operator1:E.EQUALS,val1:""}:((h=i.customFilters)==null?void 0:h.customFilters.length)===1&&!i.customFilters.customFilters[0].operator?{operator1:E.EQUALS,val1:i.customFilters.customFilters[0].val.toString()}:!1}},r.GREATER_THAN={label:"sheets-filter.conditions.greater-than",operator:u.CustomFilterOperator.GREATER_THAN,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.GREATER_THAN,val1:""}),mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.GREATER_THAN}]}}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.GREATER_THAN},testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.GREATER_THAN?!1:{operator1:u.CustomFilterOperator.GREATER_THAN,val1:s.val.toString()}}},r.GREATER_THAN_OR_EQUAL={label:"sheets-filter.conditions.greater-than-or-equal",operator:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.GREATER_THAN_OR_EQUAL},mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL}]}}),testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.GREATER_THAN_OR_EQUAL?!1:{operator1:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:s.val.toString()}}},r.LESS_THAN={label:"sheets-filter.conditions.less-than",operator:u.CustomFilterOperator.LESS_THAN,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.LESS_THAN,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.LESS_THAN},mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.LESS_THAN}]}}),testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.LESS_THAN?!1:{operator1:u.CustomFilterOperator.LESS_THAN,val1:s.val.toString()}}},r.LESS_THAN_OR_EQUAL={label:"sheets-filter.conditions.less-than-or-equal",operator:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.LESS_THAN_OR_EQUAL},mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.LESS_THAN_OR_EQUAL}]}}),testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.LESS_THAN_OR_EQUAL?!1:{operator1:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,val1:s.val.toString()}}},r.EQUAL={label:"sheets-filter.conditions.equal",operator:u.CustomFilterOperator.EQUAL,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.EQUAL,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.EQUAL},mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.EQUAL}]}}),testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.EQUAL?!1:{operator1:u.CustomFilterOperator.EQUAL,val1:s.val.toString()}}},r.NOT_EQUAL={label:"sheets-filter.conditions.not-equal",operator:u.CustomFilterOperator.NOT_EQUALS,numOfParameters:1,order:R.FIRST,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.NOT_EQUALS,val1:""}),testMappingParams:i=>{const[s]=D(i);return s===u.CustomFilterOperator.NOT_EQUALS},mapToFilterColumn:i=>({customFilters:{customFilters:[{val:i.val1,operator:u.CustomFilterOperator.NOT_EQUALS}]}}),testMappingFilterColumn:i=>{var a;if(((a=i.customFilters)==null?void 0:a.customFilters.length)!==1)return!1;const s=i.customFilters.customFilters[0];return s.operator!==u.CustomFilterOperator.NOT_EQUALS?!1:{operator1:u.CustomFilterOperator.NOT_EQUALS,val1:s.val.toString()}}},r.BETWEEN={label:"sheets-filter.conditions.between",operator:E.BETWEEN,order:R.SECOND,numOfParameters:2,getDefaultFormParams:()=>({and:!0,operator1:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:"",operator2:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:""}),testMappingParams:i=>{const{and:s,operator1:a,operator2:h}=i;if(!s)return!1;const m=[a,h];return m.includes(u.CustomFilterOperator.GREATER_THAN_OR_EQUAL)&&m.includes(u.CustomFilterOperator.LESS_THAN_OR_EQUAL)},mapToFilterColumn:i=>{const{val1:s,val2:a,operator1:h}=i,m=h===u.CustomFilterOperator.GREATER_THAN_OR_EQUAL;return{customFilters:{and:c.BooleanNumber.TRUE,customFilters:[{val:m?s:a,operator:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL},{val:m?a:s,operator:u.CustomFilterOperator.LESS_THAN_OR_EQUAL}]}}},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==2)return!1;const[s,a]=i.customFilters.customFilters;return s.operator===u.CustomFilterOperator.GREATER_THAN_OR_EQUAL&&a.operator===u.CustomFilterOperator.LESS_THAN_OR_EQUAL&&i.customFilters.and?{and:!0,operator1:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:s.val.toString(),operator2:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:a.val.toString()}:a.operator===u.CustomFilterOperator.GREATER_THAN_OR_EQUAL&&s.operator===u.CustomFilterOperator.LESS_THAN_OR_EQUAL&&i.customFilters.and?{and:!0,operator1:u.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:a.val.toString(),operator2:u.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:s.val.toLocaleString()}:!1}},r.NOT_BETWEEN={label:"sheets-filter.conditions.not-between",operator:E.NOT_BETWEEN,order:R.SECOND,numOfParameters:2,getDefaultFormParams:()=>({operator1:u.CustomFilterOperator.LESS_THAN,val1:"",operator2:u.CustomFilterOperator.GREATER_THAN,val2:""}),testMappingParams:i=>{const{and:s,operator1:a,operator2:h}=i;if(s)return!1;const m=[a,h];return m.includes(u.CustomFilterOperator.GREATER_THAN)&&m.includes(u.CustomFilterOperator.LESS_THAN)},mapToFilterColumn:i=>{const{val1:s,val2:a,operator1:h}=i,m=h===u.CustomFilterOperator.GREATER_THAN;return{customFilters:{customFilters:[{val:m?s:a,operator:u.CustomFilterOperator.GREATER_THAN},{val:m?a:s,operator:u.CustomFilterOperator.LESS_THAN}]}}},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==2)return!1;const[s,a]=i.customFilters.customFilters;return s.operator===u.CustomFilterOperator.LESS_THAN&&a.operator===u.CustomFilterOperator.GREATER_THAN&&!i.customFilters.and?{operator1:u.CustomFilterOperator.LESS_THAN,val1:s.val.toString(),operator2:u.CustomFilterOperator.GREATER_THAN,val2:a.val.toString()}:a.operator===u.CustomFilterOperator.LESS_THAN&&s.operator===u.CustomFilterOperator.GREATER_THAN&&!i.customFilters.and?{operator1:u.CustomFilterOperator.GREATER_THAN,val1:a.val.toString(),operator2:u.CustomFilterOperator.LESS_THAN,val2:s.val.toLocaleString()}:!1}},r.CUSTOM={label:"sheets-filter.conditions.custom",operator:E.CUSTOM,order:R.SECOND,numOfParameters:2,getDefaultFormParams:()=>({operator1:E.NONE,val1:"",operator2:E.NONE,val2:""}),testMappingParams:()=>!0,mapToFilterColumn:i=>{const{and:s,val1:a,val2:h,operator1:m,operator2:p}=i;function I(M,L){for(const U of r.ALL_CONDITIONS)if(U.operator===M)return U.mapToFilterColumn({val1:L,operator1:M})}const v=!m||m===r.NONE.operator,T=!p||p===r.NONE.operator;if(v&&T)return r.NONE.mapToFilterColumn({});if(v)return I(p,h);if(T)return I(m,a);const O=I(m,a),P=I(p,h),A={customFilters:[O.customFilters.customFilters[0],P.customFilters.customFilters[0]]};return s&&(A.and=c.BooleanNumber.TRUE),{customFilters:A}},testMappingFilterColumn:i=>{var h;if(((h=i.customFilters)==null?void 0:h.customFilters.length)!==2)return!1;const s=i.customFilters.customFilters.map(m=>l({customFilters:{customFilters:[m]}})),a={operator1:s[0][0].operator,val1:s[0][1].val1,operator2:s[1][0].operator,val2:s[1][1].val1};return i.customFilters.and&&(a.and=!0),a}},r.ALL_CONDITIONS=[r.NONE,r.EMPTY,r.NOT_EMPTY,r.TEXT_CONTAINS,r.DOES_NOT_CONTAIN,r.STARTS_WITH,r.ENDS_WITH,r.EQUALS,r.GREATER_THAN,r.GREATER_THAN_OR_EQUAL,r.LESS_THAN,r.LESS_THAN_OR_EQUAL,r.EQUAL,r.NOT_EQUAL,r.BETWEEN,r.NOT_BETWEEN,r.CUSTOM];function e(i){const s=r.ALL_CONDITIONS.find(a=>a.operator===i);if(!s)throw new Error(`[SheetsFilter]: no condition item found for operator: ${i}`);return s}r.getItemByOperator=e;function t(i,s){for(const a of r.ALL_CONDITIONS.filter(h=>h.numOfParameters===s))if(a.numOfParameters!==0&&a.testMappingParams(i))return a;for(const a of r.ALL_CONDITIONS)if(a.testMappingParams(i))return a;throw new Error("[SheetsFilter]: no condition item can be mapped from the filter map params!")}r.testMappingParams=t;function n(i){const s=r.ALL_CONDITIONS.find(a=>a.operator===i);return(s==null?void 0:s.numOfParameters)===0?{operator1:s.operator}:s.getDefaultFormParams()}r.getInitialFormParams=n;function o(i,s){return i.mapToFilterColumn(s)}r.mapToFilterColumn=o;function l(i){if(!i)return[r.NONE,{}];for(const s of r.ALL_CONDITIONS){const a=s.testMappingFilterColumn(i);if(a)return[s,a]}return[r.NONE,{}]}r.testMappingFilterColumn=l})(f||(f={}));function D(r){const{operator1:e,operator2:t,val1:n,val2:o}=r;if(e&&t)throw new Error("Both operator1 and operator2 are set!");if(!e&&!t)throw new Error("Neither operator1 and operator2 and both not set!");return e?[e,n]:[t,o]}function be(r){const e=[],t=[];let n=0,o=0;function l(i){i.leaf&&(i.checked?(e.push(i),n+=i.count):(t.push(i),o+=i.count)),i.children&&i.children.forEach(l)}return r.forEach(l),{checkedItems:e,uncheckedItems:t,checked:n,unchecked:o}}var ot=Object.getOwnPropertyDescriptor,st=(r,e,t,n)=>{for(var o=n>1?void 0:n?ot(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},ye=(r,e)=>(t,n)=>e(t,n,r);const Pe="sheets-filter.generate-filter-values.service",ve=c.createIdentifier(Pe);let Ae=class extends c.Disposable{constructor(r,e,t){super(),this._localeService=r,this._univerInstanceService=e,this._logService=t}async getFilterValues(r){var p;const{unitId:e,subUnitId:t,filteredOutRowsByOtherColumns:n,filterColumn:o,filters:l,blankChecked:i,iterateRange:s,alreadyChecked:a}=r,h=this._univerInstanceService.getUnit(e),m=(p=this._univerInstanceService.getUnit(e))==null?void 0:p.getSheetBySheetId(t);return!h||!m?[]:(this._logService.debug("[SheetsGenerateFilterValuesService]","getFilterValues for",{unitId:e,subUnitId:t}),He(l,this._localeService,s,m,new Set(n),o,new Set(a.map(String)),i,h.getStyles()))}};Ae=st([ye(0,c.Inject(c.LocaleService)),ye(1,c.IUniverInstanceService),ye(2,c.ILogService)],Ae);function He(r,e,t,n,o,l,i,s,a){var P,A,M,L,U,B,Y,q,ae,H;const h=new Map,m=new Map,p="yyyy-mm-dd",I="empty",v=!r&&((l==null?void 0:l.filterBy)===u.FilterBy.COLORS||(l==null?void 0:l.filterBy)===u.FilterBy.CONDITIONS)&&((P=l.filteredOutRows)==null?void 0:P.size);let T=0;for(const b of n.iterateByColumn(t,!1,!1)){const{row:ke,rowSpan:Fe=1}=b;let le=0;for(;le<Fe;){const tr=ke+le;if(o.has(tr)){le++;continue}const X=b!=null&&b.value?c.extractPureTextFromCell(b.value):"";if(!X){T+=1,le+=Fe;continue}const Ne=(A=b.value)!=null&&A.v&&!b.value.p?(U=(L=a.get((M=b.value)==null?void 0:M.s))==null?void 0:L.n)==null?void 0:U.pattern:"",it=Ne&&c.numfmt.getFormatInfo(Ne).isDate;let nt=!1;if(it){const{year:W,month:Z,day:w}=c.numfmt.getFormatDateInfo(Ne);nt=W||Z||w}if(Ne&&it&&nt){const W=(B=n.getCellRaw(b.row,b.col))==null?void 0:B.v;if(!W){le++;continue}const Z=c.numfmt.format(p,Number(W)),[w,V,pe]=Z.split("-").map(Number);let J=h.get(`${w}`);J||(J={title:`${w}`,key:`${w}`,children:[],count:0,leaf:!1,checked:!1},h.set(`${w}`,J),m.set(`${w}`,[`${w}`]));let j=(Y=J.children)==null?void 0:Y.find(De=>De.key===`${w}-${V}`);j||(j={title:e.t(`sheets-filter.date.${V}`),key:`${w}-${V}`,children:[],count:0,leaf:!1,checked:!1},(q=J.children)==null||q.push(j),m.set(`${w}-${V}`,[`${w}`,`${w}-${V}`]));const Be=(ae=j==null?void 0:j.children)==null?void 0:ae.find(De=>De.key===`${w}-${V}-${pe}`);Be?(Be.originValues.add(X),Be.count++,j.count++,J.count++):((H=j.children)==null||H.push({title:`${pe}`,key:`${w}-${V}-${pe}`,count:1,originValues:new Set([X]),leaf:!0,checked:v?!1:i.size?i.has(X):!s}),j.count++,J.count++,m.set(`${w}-${V}-${pe}`,[`${w}`,`${w}-${V}`,`${w}-${V}-${pe}`]))}else{const W=X;let Z=h.get(W);Z?Z.count++:(Z={title:X,leaf:!0,checked:v?!1:i.size?i.has(X):!s,key:W,count:1},h.set(W,Z),m.set(W,[W]))}le++}}const O=v?!1:r?s:!0;if(T>0){const b={title:e.t("sheets-filter.panel.empty"),count:T,leaf:!0,checked:O,key:I};h.set("empty",b),m.set("empty",[I])}return{filterTreeItems:at(Array.from(h.values())),filterTreeMapCache:m}}function at(r){return Array.from(r).sort((e,t)=>e.children&&!t.children?-1:!e.children&&t.children?1:lt(e.title,t.title)).map(e=>(e.children&&e.children.sort((t,n)=>{const o=Number.parseInt(t.key.split("-")[1],10),l=Number.parseInt(n.key.split("-")[1],10);return o-l}).forEach(t=>{t.children&&t.children.sort((n,o)=>{const l=Number.parseInt(n.key.split("-")[2],10),i=Number.parseInt(o.key.split("-")[2],10);return l-i})}),e))}const xe=r=>!Number.isNaN(Number(r))&&!Number.isNaN(Number.parseFloat(r));function lt(r,e){const t=xe(r),n=xe(e);return t&&n?Number.parseFloat(r)-Number.parseFloat(e):t&&!n?-1:!t&&n?1:r.localeCompare(e)}function we(r,e){for(const t of r){if(t.key===e)return t;if(t.children){const n=we(t.children,e);if(n)return n}}return null}function We(r){return r.leaf?r.checked:r.children?r.children.every(e=>We(e)):!0}function ce(r,e){r.leaf&&(e!==void 0?r.checked=e:r.checked=!r.checked),r.children&&r.children.forEach(t=>ce(t,e))}function Ve(r,e){const t=[];return r.forEach(n=>{const o=n.originValues?e.some(s=>Array.from(n.originValues).some(a=>a.toLowerCase().includes(s.toLowerCase()))):!1,l=!o&&e.some(s=>n.title.toLowerCase().includes(s.toLowerCase()));if(o||l)t.push({...n});else if(n.children){const s=Ve(n.children,e);if(s.length>0){const a=s.reduce((h,m)=>h+m.count,0);t.push({...n,count:a,children:s})}}}),t}var ct=Object.getOwnPropertyDescriptor,_e=(r,e,t,n)=>{for(var o=n>1?void 0:n?ct(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},ue=(r,e)=>(t,n)=>e(t,n,r);c.createIdentifier("sheets-filter-ui.sheets-filter-panel.service");let Q=class extends c.Disposable{constructor(e,t){super();_(this,"_filterBy$",new S.BehaviorSubject(u.FilterBy.VALUES));_(this,"filterBy$",this._filterBy$.asObservable());_(this,"_filterByModel$",new S.ReplaySubject(1));_(this,"filterByModel$",this._filterByModel$.asObservable());_(this,"_filterByModel",null);_(this,"_hasCriteria$",new S.BehaviorSubject(!1));_(this,"hasCriteria$",this._hasCriteria$.asObservable());_(this,"_filterModel",null);_(this,"_col$",new S.BehaviorSubject(-1));_(this,"col$",this._col$.asObservable());_(this,"_filterHeaderListener",null);this._injector=e,this._refRangeService=t}get filterBy(){return this._filterBy$.getValue()}get filterByModel(){return this._filterByModel}set filterByModel(e){this._filterByModel=e,this._filterByModel$.next(e)}get filterModel(){return this._filterModel}get col(){return this._col$.getValue()}dispose(){this._filterBy$.complete(),this._filterByModel$.complete(),this._hasCriteria$.complete()}setupCol(e,t){this.terminate(),this._filterModel=e,this._col$.next(t);const n=e.getFilterColumn(t);if(n){const o=n.getColumnData();if(o.customFilters){this._hasCriteria$.next(!0),this._setupByConditions(e,t);return}if(o.colorFilters){this._hasCriteria$.next(!0),this._setupByColors(e,t);return}if(o.filters){this._hasCriteria$.next(!0),this._setupByValues(e,t);return}this._hasCriteria$.next(!1),this._setupByValues(e,t);return}this._hasCriteria$.next(!1),this._setupByValues(e,t)}changeFilterBy(e){if(!this._filterModel||this.col===-1)return!1;switch(e){case u.FilterBy.VALUES:this._setupByValues(this._filterModel,this.col);break;case u.FilterBy.COLORS:this._setupByColors(this._filterModel,this.col);break;case u.FilterBy.CONDITIONS:this._setupByConditions(this._filterModel,this.col);break}return!0}terminate(){return this._filterModel=null,this._col$.next(-1),this._disposeFilterHeaderChangeListener(),!0}_disposeFilterHeaderChangeListener(){var e;(e=this._filterHeaderListener)==null||e.dispose(),this._filterHeaderListener=null}_listenToFilterHeaderChange(e,t){this._disposeFilterHeaderChangeListener();const n=e.unitId,o=e.subUnitId,l=e.getRange(),i={startColumn:t,startRow:l.startRow,endRow:l.startRow,endColumn:t};this._filterHeaderListener=this._refRangeService.watchRange(n,o,i,(s,a)=>{if(!a)this.terminate();else{const h=a.startColumn-s.startColumn;h!==0&&this._filterByModel.deltaCol(h)}})}async _setupByValues(e,t){this._disposePreviousModel();const n=e.getRange();if(n.startRow===n.endRow)return!1;const o=await Ce.fromFilterColumn(this._injector,e,t);return this.filterByModel=o,this._filterBy$.next(u.FilterBy.VALUES),this._listenToFilterHeaderChange(e,t),!0}async _setupByColors(e,t){this._disposePreviousModel();const n=e.getRange();if(n.startRow===n.endRow)return!1;const o=await Se.fromFilterColumn(this._injector,e,t);return this.filterByModel=o,this._filterBy$.next(u.FilterBy.COLORS),this._listenToFilterHeaderChange(e,t),!0}_setupByConditions(e,t){this._disposePreviousModel();const n=e.getRange();if(n.startRow===n.endRow)return!1;const o=ge.fromFilterColumn(this._injector,e,t,e.getFilterColumn(t));return this.filterByModel=o,this._filterBy$.next(u.FilterBy.CONDITIONS),this._listenToFilterHeaderChange(e,t),!0}_disposePreviousModel(){var e;(e=this._filterByModel)==null||e.dispose(),this.filterByModel=null}};Q=_e([ue(0,c.Inject(c.Injector)),ue(1,c.Inject(y.RefRangeService))],Q);let ge=class extends c.Disposable{constructor(e,t,n,o,l){super();_(this,"canApply$",S.of(!0));_(this,"_conditionItem$");_(this,"conditionItem$");_(this,"_filterConditionFormParams$");_(this,"filterConditionFormParams$");this._filterModel=e,this.col=t,this._commandService=l,this._conditionItem$=new S.BehaviorSubject(n),this.conditionItem$=this._conditionItem$.asObservable(),this._filterConditionFormParams$=new S.BehaviorSubject(o),this.filterConditionFormParams$=this._filterConditionFormParams$.asObservable()}static fromFilterColumn(e,t,n,o){const[l,i]=f.testMappingFilterColumn(o==null?void 0:o.getColumnData());return e.createInstance(ge,t,n,l,i)}get conditionItem(){return this._conditionItem$.getValue()}get filterConditionFormParams(){return this._filterConditionFormParams$.getValue()}dispose(){super.dispose(),this._conditionItem$.complete(),this._filterConditionFormParams$.complete()}deltaCol(e){this.col+=e}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}async apply(){if(this._disposed)return!1;const e=f.mapToFilterColumn(this.conditionItem,this.filterConditionFormParams);return this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:e})}onPrimaryConditionChange(e){const t=f.ALL_CONDITIONS.find(n=>n.operator===e);if(!t)throw new Error(`[ByConditionsModel]: condition item not found for operator: ${e}!`);this._conditionItem$.next(t),this._filterConditionFormParams$.next(f.getInitialFormParams(e))}onConditionFormChange(e){const t={...this.filterConditionFormParams,...e};if(t.and!==!0&&delete t.and,typeof e.and<"u"||typeof e.operator1<"u"||typeof e.operator2<"u"){const n=f.testMappingParams(t,this.conditionItem.numOfParameters);this._conditionItem$.next(n)}this._filterConditionFormParams$.next(t)}};ge=_e([ue(4,c.ICommandService)],ge);let Ce=class extends c.Disposable{constructor(e,t,n,o,l){super();_(this,"_rawFilterItems$");_(this,"rawFilterItems$");_(this,"filterItems$");_(this,"_filterItems",[]);_(this,"_treeMapCache");_(this,"canApply$");_(this,"_manuallyUpdateFilterItems$");_(this,"_searchString$");_(this,"searchString$");this._filterModel=e,this.col=t,this._commandService=l,this._treeMapCache=o,this._searchString$=new S.BehaviorSubject(""),this.searchString$=this._searchString$.asObservable(),this._rawFilterItems$=new S.BehaviorSubject(n),this.rawFilterItems$=this._rawFilterItems$.asObservable(),this._manuallyUpdateFilterItems$=new S.Subject,this.filterItems$=S.merge(S.combineLatest([this._searchString$.pipe(S.throttleTime(500,void 0,{leading:!0,trailing:!0}),S.startWith(void 0)),this._rawFilterItems$]).pipe(S.map(([i,s])=>{if(!i)return s;const h=i.toLowerCase().split(/\s+/).filter(m=>!!m);return Ve(s,h)})),this._manuallyUpdateFilterItems$).pipe(S.shareReplay(1)),this.canApply$=this.filterItems$.pipe(S.map(i=>be(i).checked>0)),this.disposeWithMe(this.filterItems$.subscribe(i=>this._filterItems=i))}static async fromFilterColumn(e,t,n){const o=e.get(c.IUniverInstanceService),l=e.get(c.LocaleService),i=e.get(ve,c.Quantity.OPTIONAL),{unitId:s,subUnitId:a}=t,h=o.getUniverSheetInstance(s);if(!h)throw new Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${s}!`);const m=h==null?void 0:h.getSheetBySheetId(a);if(!m)throw new Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${s} and subUnitId: ${a}!`);const p=t.getRange(),I=n,v=t.getFilterColumn(n),T=v==null?void 0:v.getColumnData().filters,O=new Set(T==null?void 0:T.filters),P=!!(T&&T.blank),A=t.getFilteredOutRowsExceptCol(n),M={...p,startRow:p.startRow+1,startColumn:I,endColumn:I};let L,U;if(i){const B=await i.getFilterValues({unitId:s,subUnitId:a,filteredOutRowsByOtherColumns:Array.from(A),filterColumn:v,filters:!!T,blankChecked:P,iterateRange:M,alreadyChecked:Array.from(O)});L=B.filterTreeItems,U=B.filterTreeMapCache}else{const B=He(!!T,l,M,m,A,v,O,P,h.getStyles());L=B.filterTreeItems,U=B.filterTreeMapCache}return e.createInstance(Ce,t,n,L,U)}get rawFilterItems(){return this._rawFilterItems$.getValue()}get filterItems(){return this._filterItems}get treeMapCache(){return this._treeMapCache}dispose(){this._rawFilterItems$.complete(),this._searchString$.complete()}deltaCol(e){this.col+=e}setSearchString(e){this._searchString$.next(e)}onCheckAllToggled(e){const t=c.Tools.deepClone(this._filterItems);t.forEach(n=>ce(n,e)),this._manuallyUpdateFilterItems(t)}onFilterCheckToggled(e){const t=c.Tools.deepClone(this._filterItems),n=we(t,e.key);if(!n)return;const o=We(n);ce(n,!o),this._manuallyUpdateFilterItems(t)}onFilterOnly(e){const t=c.Tools.deepClone(this._filterItems);t.forEach(n=>ce(n,!1)),e.forEach(n=>{const o=we(t,n);o&&ce(o,!0)}),this._manuallyUpdateFilterItems(t)}_manuallyUpdateFilterItems(e){this._manuallyUpdateFilterItems$.next(e)}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}async apply(){if(this._disposed)return!1;const e=be(this._filterItems),{checked:t,checkedItems:n}=e,o=this.rawFilterItems;let l=0;for(const h of o)l+=h.count;const i=t===0,s=e.checked===l,a={colId:this.col};if(i)throw new Error("[ByValuesModel]: no checked items!");if(s)return this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null});{a.filters={};const h=n.filter(p=>p.key!=="empty");h.length>0&&(a.filters={filters:h.flatMap(p=>p.originValues?Array.from(p.originValues):[p.title])}),h.length!==n.length&&(a.filters.blank=!0)}return this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:a})}};Ce=_e([ue(4,c.ICommandService)],Ce);let Se=class extends c.Disposable{constructor(e,t,n,o,l){super();_(this,"canApply$",S.of(!0));_(this,"_cellFillColors$");_(this,"cellFillColors$");_(this,"_cellTextColors$");_(this,"cellTextColors$");this._filterModel=e,this.col=t,this._commandService=l,this._cellFillColors$=new S.BehaviorSubject(Array.from(n.values())),this.cellFillColors$=this._cellFillColors$.asObservable(),this._cellTextColors$=new S.BehaviorSubject(Array.from(o.values())),this.cellTextColors$=this._cellTextColors$.asObservable()}static async fromFilterColumn(e,t,n){var M,L,U;const o=e.get(c.IUniverInstanceService),{unitId:l,subUnitId:i}=t,s=o.getUniverSheetInstance(l);if(!s)throw new Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${l}!`);const a=s==null?void 0:s.getSheetBySheetId(i);if(!a)throw new Error(`[ByColorsModel]: Worksheet not found for filter model with unitId: ${l} and subUnitId: ${i}!`);const h=t.getRange(),m=n,p=(M=t.getFilterColumn(n))==null?void 0:M.getColumnData().colorFilters,I=t.getFilteredOutRowsExceptCol(n),v={...h,startRow:h.startRow+1,startColumn:m,endColumn:m},T=new Map,O=new Set((L=p==null?void 0:p.cellFillColors)!=null?L:[]),P=new Map,A=new Set((U=p==null?void 0:p.cellTextColors)!=null?U:[]);for(const B of a.iterateByColumn(v,!1,!0)){const{row:Y,col:q,value:ae}=B;if(I.has(Y))continue;const H=a.getComposedCellStyleByCellData(Y,q,ae);if(H.bg&&H.bg.rgb){const b=new c.ColorKit(H.bg.rgb).toRgbString();T.has(b)||T.set(b,{color:b,checked:O.has(b)})}else T.set("default-fill-color",{color:null,checked:O.has(null)});if(H.cl&&H.cl.rgb){const b=new c.ColorKit(H.cl.rgb).toRgbString();P.has(b)||P.set(b,{color:b,checked:A.has(b)})}else P.set("default-font-color",{color:K.COLOR_BLACK_RGB,checked:A.has(K.COLOR_BLACK_RGB)})}return e.createInstance(Se,t,n,T,P)}get cellFillColors(){return this._cellFillColors$.getValue()}get cellTextColors(){return this._cellTextColors$.getValue()}dispose(){super.dispose(),this._cellFillColors$.complete()}deltaCol(e){this.col+=e}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}onFilterCheckToggled(e,t=!0){const n=t?this.cellFillColors:this.cellTextColors,o=[];let l=!1;for(let i=0;i<n.length;i++){const s=n[i];if(s.color===e.color){l=!0,o.push({color:s.color,checked:!s.checked});continue}o.push({color:s.color,checked:s.checked})}l&&(this._resetColorsCheckedStatus(!t),t?this._cellFillColors$.next([...o]):this._cellTextColors$.next([...o]))}_resetColorsCheckedStatus(e=!0){const t=e?this.cellFillColors:this.cellTextColors,n=[];for(let o=0;o<t.length;o++)n.push({color:t[o].color,checked:!1});e?this._cellFillColors$.next([...n]):this._cellTextColors$.next([...n])}async apply(){if(this._disposed)return!1;const e=this.cellFillColors.filter(o=>o.checked).map(o=>o.color),t=this.cellTextColors.filter(o=>o.checked).map(o=>o.color);if(e.length===0&&t.length===0)return this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null});const n={colId:this.col};return e.length>0?n.colorFilters={cellFillColors:e}:t.length>0&&(n.colorFilters={cellTextColors:t}),this._commandService.executeCommand(u.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:n})}};Se=_e([ue(4,c.ICommandService)],Se);const ee="FILTER_PANEL_OPENED",he={id:"sheet.operation.open-filter-panel",type:c.CommandType.OPERATION,handler:(r,e)=>{const t=r.get(c.IContextService),n=r.get(u.SheetsFilterService),o=r.get(Q),l=r.get(c.ICommandService),i=r.has($.IEditorBridgeService)?r.get($.IEditorBridgeService):null;i!=null&&i.isVisible().visible&&l.syncExecuteCommand($.SetCellEditVisibleOperation.id,{visible:!1});const{unitId:s,subUnitId:a,col:h}=e,m=n.getFilterModel(s,a);return m?(o.setupCol(m,h),t.getContextValue(ee)||t.setContextValue(ee,!0),!0):!1}},te={id:"sheet.operation.close-filter-panel",type:c.CommandType.OPERATION,handler:r=>{const e=r.get(c.IContextService),t=r.get(Q),n=r.get(C.ILayoutService,c.Quantity.OPTIONAL);return e.getContextValue(ee)?(e.setContextValue(ee,!1),n==null||n.focus(),t.terminate()):!1}},Re={id:"sheet.operation.apply-filter",type:c.CommandType.OPERATION,handler:(r,e)=>{const{filterBy:t}=e;return r.get(Q).changeFilterBy(t)}},re={name:"@univerjs/sheets-filter-ui",version:"0.17.0"},je="sheets-filter-ui.config",Te={};var ut=Object.getOwnPropertyDescriptor,ht=(r,e,t,n)=>{for(var o=n>1?void 0:n?ut(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},ie=(r,e)=>(t,n)=>e(t,n,r);let ne=class extends c.Disposable{constructor(r,e,t,n,o,l){super(),this._sheetsFilterService=r,this._localeService=e,this._commandService=t,this._sheetPermissionCheckPermission=n,this._injector=o,this._sheetsSelectionService=l,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(r=>{var e,t,n;if(r.id===u.SmartToggleSheetsFilterCommand.id){const o=this._injector.get(c.IUniverInstanceService),l=y.getSheetCommandTarget(o);if(!l)return;const{unitId:i,subUnitId:s,worksheet:a}=l,h=(e=this._sheetsFilterService.getFilterModel(i,s))==null?void 0:e.getRange();let m;if(h)m=this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[y.RangeProtectionPermissionViewPoint],worksheetTypes:[y.WorksheetFilterPermission,y.WorksheetViewPermission]},[h],i,s);else{const p=(t=this._sheetsSelectionService.getCurrentLastSelection())==null?void 0:t.range;if(p){let I={...p};I=p.startColumn===p.endColumn&&p.startRow===p.endRow?y.expandToContinuousRange(I,{left:!0,right:!0,up:!0,down:!0},a):I,m=this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[y.RangeProtectionPermissionViewPoint],worksheetTypes:[y.WorksheetViewPermission,y.WorksheetFilterPermission]},[I],i,s)}else m=this._sheetPermissionCheckPermission.permissionCheckWithoutRange({rangeTypes:[y.RangeProtectionPermissionViewPoint],worksheetTypes:[y.WorksheetViewPermission,y.WorksheetFilterPermission]})}m||this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr"))}if(r.id===he.id){const o=r.params,{unitId:l,subUnitId:i}=o,s=(n=this._sheetsFilterService.getFilterModel(l,i))==null?void 0:n.getRange(),a=c.Tools.deepClone(s);a&&(a.startColumn=o.col,a.endColumn=o.col,this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[y.RangeProtectionPermissionViewPoint],worksheetTypes:[y.WorksheetFilterPermission,y.WorksheetViewPermission]},[a],l,i)||this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t("permission.dialog.filterErr")))}}))}};ne=ht([ie(0,c.Inject(u.SheetsFilterService)),ie(1,c.Inject(c.LocaleService)),ie(2,c.ICommandService),ie(3,c.Inject(y.SheetPermissionCheckController)),ie(4,c.Inject(c.Injector)),ie(5,c.Inject(y.SheetsSelectionsService))],ne);const G=16,dt=new Path2D("M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z");class Qe{static drawNoCriteria(e,t,n,o){e.save(),K.Rect.drawWith(e,{radius:2,width:G,height:G,fill:o}),e.lineCap="square",e.strokeStyle=n,e.scale(t/G,t/G),e.beginPath(),e.lineWidth=1,e.lineCap="round",e.moveTo(3,4),e.lineTo(13,4),e.moveTo(4.5,8),e.lineTo(11.5,8),e.moveTo(6,12),e.lineTo(10,12),e.stroke(),e.restore()}static drawHasCriteria(e,t,n,o){e.save(),K.Rect.drawWith(e,{radius:2,width:G,height:G,fill:o}),e.scale(t/G,t/G),e.fillStyle=n,e.fill(dt),e.restore()}}var mt=Object.getOwnPropertyDescriptor,pt=(r,e,t,n)=>{for(var o=n>1?void 0:n?mt(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},Le=(r,e)=>(t,n)=>e(t,n,r);const x=16,de=1;let $e=class extends K.Shape{constructor(e,t,n,o,l){super(e,t);_(this,"_cellWidth",0);_(this,"_cellHeight",0);_(this,"_filterParams");_(this,"_hovered",!1);this._contextService=n,this._commandService=o,this._themeService=l,this.setShapeProps(t),this.onPointerDown$.subscribeEvent(i=>this.onPointerDown(i)),this.onPointerEnter$.subscribeEvent(()=>this.onPointerEnter()),this.onPointerLeave$.subscribeEvent(()=>this.onPointerLeave())}setShapeProps(e){typeof e.cellHeight<"u"&&(this._cellHeight=e.cellHeight),typeof e.cellWidth<"u"&&(this._cellWidth=e.cellWidth),typeof e.filterParams<"u"&&(this._filterParams=e.filterParams),this.transformByState({width:e.width,height:e.height})}_draw(e){const t=this._cellHeight,n=this._cellWidth,o=x-n,l=x-t;e.save();const i=new Path2D;i.rect(o,l,n,t),e.clip(i);const{hasCriteria:s}=this._filterParams,a=this._themeService.getColorFromTheme("primary.600"),h=this._hovered?this._themeService.getColorFromTheme("gray.50"):"rgba(255, 255, 255, 1.0)";s?Qe.drawHasCriteria(e,x,a,h):Qe.drawNoCriteria(e,x,a,h),e.restore()}onPointerDown(e){if(e.button===2)return;const{col:t,unitId:n,subUnitId:o}=this._filterParams;this._contextService.getContextValue(ee)||!this._commandService.hasCommand(he.id)||setTimeout(()=>{this._commandService.executeCommand(he.id,{unitId:n,subUnitId:o,col:t})},200)}onPointerEnter(){this._hovered=!0,this.makeDirty(!0)}onPointerLeave(){this._hovered=!1,this.makeDirty(!0)}};$e=pt([Le(2,c.IContextService),Le(3,c.ICommandService),Le(4,c.Inject(c.ThemeService))],$e);var ft=Object.getOwnPropertyDescriptor,vt=(r,e,t,n)=>{for(var o=n>1?void 0:n?ft(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},z=(r,e)=>(t,n)=>e(t,n,r);const _t=1e3,gt=5e3;function Ct(r,e,t,n){switch(n){case c.VerticalAlign.TOP:return r+de;case c.VerticalAlign.MIDDLE:return r+Math.max(0,(t-x)/2);case c.VerticalAlign.BOTTOM:default:return e-x-de}}let Me=class extends c.RxDisposable{constructor(e,t,n,o,l,i,s,a){super();_(this,"_filterRangeShape",null);_(this,"_buttonRenderDisposable",null);_(this,"_filterButtonShapes",[]);this._context=e,this._injector=t,this._sheetSkeletonManagerService=n,this._sheetsFilterService=o,this._themeService=l,this._sheetInterceptorService=i,this._commandService=s,this._selectionRenderService=a,this._initRenderer()}dispose(){super.dispose(),this._disposeRendering()}_initRenderer(){this._sheetSkeletonManagerService.currentSkeleton$.pipe(S.switchMap(e=>{var s,a;if(!e)return S.of(null);const{unit:t,unitId:n}=this._context,o=((s=t.getActiveSheet())==null?void 0:s.getSheetId())||"",l=(a=this._sheetsFilterService.getFilterModel(n,o))!=null?a:void 0,i=()=>({unitId:n,worksheetId:o,filterModel:l,range:l==null?void 0:l.getRange(),skeleton:e.skeleton});return c.fromCallback(this._commandService.onCommandExecuted.bind(this._commandService)).pipe(S.filter(([h])=>{var m;return h.type===c.CommandType.MUTATION&&((m=h.params)==null?void 0:m.unitId)===t.getUnitId()&&(u.FILTER_MUTATIONS.has(h.id)||h.id===y.SetRangeValuesMutation.id)}),S.throttleTime(20,void 0,{leading:!1,trailing:!0}),S.map(i),S.startWith(i()))}),S.takeUntil(this.dispose$)).subscribe(e=>{this._disposeRendering(),!(!e||!e.range)&&(this._renderRange(e.range,e.skeleton),this._renderButtons(e))})}_renderRange(e,t){const{scene:n}=this._context,{rowHeaderWidth:o,columnHeaderHeight:l}=t,i=this._filterRangeShape=new $.SelectionControl(n,_t,this._themeService,{rowHeaderWidth:o,columnHeaderHeight:l,enableAutoFill:!1,highlightHeader:!1}),s={range:e,primary:null,style:{fill:"rgba(0, 0, 0, 0.0)"}},a=$.attachSelectionWithCoord(s,t);i.updateRangeBySelectionWithCoord(a),i.setEvent(!1),n.makeDirty(!0)}_renderButtons(e){const{range:t,filterModel:n,unitId:o,skeleton:l,worksheetId:i}=e,{unit:s,scene:a}=this._context,h=s.getSheetBySheetId(i);if(!h)return;this._interceptCellContent(o,i,e.range);const{startColumn:m,endColumn:p,startRow:I}=t;for(let v=m;v<=p;v++){const T=`sheets-filter-button-${v}`,O=$.getCoordByCell(I,v,a,l),P=h.getComposedCellStyle(I,v),A=(P==null?void 0:P.vt)||c.VerticalAlign.BOTTOM,{startX:M,startY:L,endX:U,endY:B}=O,Y=U-M,q=B-L;if(q<=de||Y<=de)continue;const ae=!!n.getFilterColumn(v),H=U-x-de,b=Ct(L,B,q,A),ke={left:H,top:b,height:x,width:x,zIndex:gt,cellHeight:q,cellWidth:Y,filterParams:{unitId:o,subUnitId:i,col:v,hasCriteria:ae}},Fe=this._injector.createInstance($e,T,ke);this._filterButtonShapes.push(Fe)}a.addObjects(this._filterButtonShapes),a.makeDirty()}_interceptCellContent(e,t,n){const{startRow:o,startColumn:l,endColumn:i}=n;this._buttonRenderDisposable=this._sheetInterceptorService.intercept(y.INTERCEPTOR_POINT.CELL_CONTENT,{effect:c.InterceptorEffectEnum.Style,handler:(s,a,h)=>{const{row:m,col:p,unitId:I,subUnitId:v}=a;return I!==e||v!==t||m!==o||p<l||p>i||((!s||s===a.rawData)&&(s={...a.rawData}),s.fontRenderExtension={...s==null?void 0:s.fontRenderExtension,rightOffset:x}),h(s)},priority:10})}_disposeRendering(){var e,t;(e=this._filterRangeShape)==null||e.dispose(),this._filterButtonShapes.forEach(n=>n.dispose()),(t=this._buttonRenderDisposable)==null||t.dispose(),this._filterRangeShape=null,this._buttonRenderDisposable=null,this._filterButtonShapes=[]}};Me=vt([z(1,c.Inject(c.Injector)),z(2,c.Inject($.SheetSkeletonManagerService)),z(3,c.Inject(u.SheetsFilterService)),z(4,c.Inject(c.ThemeService)),z(5,c.Inject(y.SheetInterceptorService)),z(6,c.ICommandService),z(7,$.ISheetSelectionRenderService)],Me);var St=Object.getOwnPropertyDescriptor,Tt=(r,e,t,n)=>{for(var o=n>1?void 0:n?St(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},Ge=(r,e)=>(t,n)=>e(t,n,r);let me=class extends c.RxDisposable{constructor(r,e){super(),this._renderManagerService=r,this._sheetsRenderService=e,[u.SetSheetsFilterRangeMutation,u.SetSheetsFilterCriteriaMutation,u.RemoveSheetsFilterMutation,u.ReCalcSheetsFilterMutation].forEach(t=>this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(t.id))),this.disposeWithMe(this._renderManagerService.registerRenderModule(c.UniverInstanceType.UNIVER_SHEET,[Me]))}};me=Tt([Ge(0,K.IRenderManagerService),Ge(1,c.Inject($.SheetsRenderService))],me);var Et=Object.defineProperty,It=Object.getOwnPropertyDescriptor,Ot=(r,e,t)=>e in r?Et(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t,Ft=(r,e,t,n)=>{for(var o=n>1?void 0:n?It(e,t):e,l=r.length-1,i;l>=0;l--)(i=r[l])&&(o=i(o)||o);return o},Ye=(r,e)=>(t,n)=>e(t,n,r),Ee=(r,e,t)=>Ot(r,typeof e!="symbol"?e+"":e,t);g.UniverSheetsFilterMobileUIPlugin=class extends c.Plugin{constructor(e=Te,t,n){super(),this._config=e,this._injector=t,this._configService=n;const{menu:o,...l}=c.merge({},Te,this._config);o&&this._configService.setConfig("menu",o,{merge:!0}),this._configService.setConfig(je,l)}onStarting(){[[ne],[me]].forEach(e=>this._injector.add(e))}onReady(){this._injector.get(ne)}onRendered(){this._injector.get(me)}},Ee(g.UniverSheetsFilterMobileUIPlugin,"type",c.UniverInstanceType.UNIVER_SHEET),Ee(g.UniverSheetsFilterMobileUIPlugin,"pluginName","SHEET_FILTER_UI_PLUGIN"),Ee(g.UniverSheetsFilterMobileUIPlugin,"packageName",re.name),Ee(g.UniverSheetsFilterMobileUIPlugin,"version",re.version),g.UniverSheetsFilterMobileUIPlugin=Ft([c.DependentOn(u.UniverSheetsFilterPlugin),Ye(1,c.Inject(c.Injector)),Ye(2,c.IConfigService)],g.UniverSheetsFilterMobileUIPlugin);function oe({ref:r,...e}){const{icon:t,id:n,className:o,extend:l,...i}=e,s=`univerjs-icon univerjs-icon-${n} ${o||""}`.trim(),a=F.useRef(`_${yt()}`);return qe(t,`${n}`,{defIds:t.defIds,idSuffix:a.current},{ref:r,className:s,...i},l)}function qe(r,e,t,n,o){return F.createElement(r.tag,{key:e,...Nt(r,t,o),...n},(bt(r,t).children||[]).map((l,i)=>qe(l,`${e}-${r.tag}-${i}`,t,void 0,o)))}function Nt(r,e,t){const n={...r.attrs};t!=null&&t.colorChannel1&&n.fill==="colorChannel1"&&(n.fill=t.colorChannel1),r.tag==="mask"&&n.id&&(n.id=n.id+e.idSuffix),Object.entries(n).forEach(([l,i])=>{l==="mask"&&typeof i=="string"&&(n[l]=i.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))});const{defIds:o}=e;return!o||o.length===0||(r.tag==="use"&&n["xlink:href"]&&(n["xlink:href"]=n["xlink:href"]+e.idSuffix),Object.entries(n).forEach(([l,i])=>{typeof i=="string"&&(n[l]=i.replace(/url\(#(.*)\)/,`url(#$1${e.idSuffix})`))})),n}function bt(r,e){var n;const{defIds:t}=e;return!t||t.length===0?r:r.tag==="defs"&&((n=r.children)!=null&&n.length)?{...r,children:r.children.map(o=>typeof o.attrs.id=="string"&&t&&t.includes(o.attrs.id)?{...o,attrs:{...o.attrs,id:o.attrs.id+e.idSuffix}}:o)}:r}function yt(){return Math.random().toString(36).substring(2,8)}oe.displayName="UniverIcon";const Pt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M10 1.05957C10.356 1.05957 10.6816 1.26162 10.8408 1.58008L18.8408 17.5801L18.8799 17.668C19.0486 18.1134 18.8551 18.6232 18.4199 18.8408C17.9557 19.0727 17.3913 18.8841 17.1592 18.4199L10 4.10156L2.84082 18.4199C2.60871 18.8841 2.04434 19.0727 1.58008 18.8408C1.11587 18.6087 0.92731 18.0443 1.15918 17.5801L9.15918 1.58008C9.31841 1.26162 9.64395 1.05957 10 1.05957Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M15.3337 11.7261L15.4294 11.731C15.9035 11.779 16.2732 12.1798 16.2732 12.6665C16.2732 13.1532 15.9035 13.554 15.4294 13.602L15.3337 13.6069H4.66675C4.1476 13.6069 3.72632 13.1856 3.72632 12.6665C3.72632 12.1474 4.1476 11.7261 4.66675 11.7261H15.3337Z"}}]},Ze=F.forwardRef(function(e,t){return F.createElement(oe,Object.assign({},e,{id:"a-icon",ref:t,icon:Pt}))});Ze.displayName="AIcon";const At={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 20",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M17.0596 10C17.0596 6.10087 13.8992 2.94043 10 2.94043C6.10087 2.94043 2.94043 6.10087 2.94043 10C2.94043 13.8992 6.10087 17.0596 10 17.0596C13.8992 17.0596 17.0596 13.8992 17.0596 10ZM18.9404 10C18.9404 14.9374 14.9374 18.9404 10 18.9404C5.06257 18.9404 1.05957 14.9374 1.05957 10C1.05957 5.06257 5.06257 1.05957 10 1.05957C14.9374 1.05957 18.9404 5.06257 18.9404 10Z"}},{tag:"path",attrs:{fill:"currentColor",d:"M4.29492 4.13476C4.63911 3.79057 5.1845 3.76906 5.55371 4.07031L5.625 4.13476L16.0244 14.5352L16.0889 14.6064C16.3902 14.9757 16.3686 15.52 16.0244 15.8643C15.6573 16.2313 15.0624 16.2313 14.6953 15.8643L4.29492 5.46484L4.23047 5.39355C3.92922 5.02434 3.95073 4.47895 4.29492 4.13476Z"}}]},Ke=F.forwardRef(function(e,t){return F.createElement(oe,Object.assign({},e,{id:"ban-icon",ref:t,icon:At}))});Ke.displayName="BanIcon";const wt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 17 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z",fillRule:"evenodd",clipRule:"evenodd"}}]},ze=F.forwardRef(function(e,t){return F.createElement(oe,Object.assign({},e,{id:"filter-icon",ref:t,icon:wt}))});ze.displayName="FilterIcon";const Rt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z"}}]},Xe=F.forwardRef(function(e,t){return F.createElement(oe,Object.assign({},e,{id:"info-icon",ref:t,icon:Rt}))});Xe.displayName="InfoIcon";const Lt={tag:"svg",attrs:{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 16 16",width:"1em",height:"1em"},children:[{tag:"path",attrs:{fill:"currentColor",d:"M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z",fillRule:"evenodd",clipRule:"evenodd"}}]},Je=F.forwardRef(function(e,t){return F.createElement(oe,Object.assign({},e,{id:"success-icon",ref:t,icon:Lt}))});Je.displayName="SuccessIcon";function $t(r){const e=r.get(u.SheetsFilterService);return{id:u.SmartToggleSheetsFilterCommand.id,type:C.MenuItemType.BUTTON_SELECTOR,icon:"FilterIcon",tooltip:"sheets-filter.toolbar.smart-toggle-filter-tooltip",hidden$:C.getMenuHiddenObservable(r,c.UniverInstanceType.UNIVER_SHEET),activated$:e.activeFilterModel$.pipe(S.map(t=>!!t)),disabled$:$.getObservableWithExclusiveRange$(r,$.getCurrentRangeDisable$(r,{worksheetTypes:[y.WorksheetFilterPermission,y.WorksheetViewPermission],rangeTypes:[y.RangeProtectionPermissionViewPoint]}))}}function Mt(r){const e=r.get(u.SheetsFilterService);return{id:u.ClearSheetsFilterCriteriaCommand.id,type:C.MenuItemType.BUTTON,title:"sheets-filter.toolbar.clear-filter-criteria",hidden$:C.getMenuHiddenObservable(r,c.UniverInstanceType.UNIVER_SHEET),disabled$:e.activeFilterModel$.pipe(S.switchMap(t=>{var n;return(n=t==null?void 0:t.hasCriteria$.pipe(S.map(o=>!o)))!=null?n:S.of(!0)}))}}function Ut(r){const e=r.get(u.SheetsFilterService);return{id:u.ReCalcSheetsFilterCommand.id,type:C.MenuItemType.BUTTON,title:"sheets-filter.toolbar.re-calc-filter-conditions",hidden$:C.getMenuHiddenObservable(r,c.UniverInstanceType.UNIVER_SHEET),disabled$:e.activeFilterModel$.pipe(S.switchMap(t=>{var n;return(n=t==null?void 0:t.hasCriteria$.pipe(S.map(o=>!o)))!=null?n:S.of(!0)}))}}const kt={[C.RibbonDataGroup.ORGANIZATION]:{[u.SmartToggleSheetsFilterCommand.id]:{order:2,menuItemFactory:$t,[u.ClearSheetsFilterCriteriaCommand.id]:{order:0,menuItemFactory:Mt},[u.ReCalcSheetsFilterCommand.id]:{order:1,menuItemFactory:Ut}}}};function Bt(r){const{model:e}=r,t=C.useDependency(c.LocaleService),n=C.useObservable(e.cellFillColors$,[],!0),o=C.useObservable(e.cellTextColors$,[],!0),l=F.useCallback(s=>{e.onFilterCheckToggled(s)},[e]),i=F.useCallback(s=>{e.onFilterCheckToggled(s,!1)},[e]);return d.jsx("div",{"data-u-comp":"sheets-filter-panel-colors-container",className:"univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",children:d.jsxs("div",{"data-u-comp":"sheets-filter-panel",className:N.clsx("univer-mt-2 univer-box-border univer-flex univer-h-[300px] univer-flex-grow univer-flex-col univer-gap-4 univer-overflow-auto univer-rounded-md univer-px-2 univer-py-2.5",N.borderClassName),children:[n.length>1&&d.jsxs("div",{children:[d.jsx("div",{className:"univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:t.t("sheets-filter.panel.filter-by-cell-fill-color")}),d.jsx("div",{className:"univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",children:n.map((s,a)=>d.jsxs("div",{className:"univer-relative univer-size-6",onClick:()=>l(s),children:[s.color?d.jsx("button",{type:"button",className:N.clsx("univer-box-border univer-size-6 univer-cursor-pointer univer-rounded-full univer-border univer-border-solid univer-border-transparent univer-bg-gray-300 univer-transition-shadow hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white"),style:{backgroundColor:s.color}}):d.jsx(Ke,{className:"univer-size-6 univer-cursor-pointer univer-rounded-full hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white"}),s.checked&&d.jsx(et,{})]},`sheets-filter-cell-fill-color-${a}`))})]}),o.length>1&&d.jsxs("div",{children:[d.jsx("div",{className:"univer-mb-2 univer-text-sm univer-text-gray-900 dark:!univer-text-white",children:t.t("sheets-filter.panel.filter-by-cell-text-color")}),d.jsx("div",{className:"univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2",children:o.map((s,a)=>d.jsxs("div",{className:"univer-relative univer-size-6",onClick:()=>i(s),children:[d.jsx("div",{className:"univer-box-border univer-flex univer-size-full univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-border univer-border-solid univer-border-[rgba(13,13,13,0.06)] univer-p-0.5 hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white dark:!univer-border-[rgba(255,255,255,0.06)]",children:d.jsx(Ze,{style:{color:s.color}})}),s.checked&&d.jsx(et,{})]},`sheets-filter-cell-text-color-${a}`))})]}),n.length<=1&&o.length<=1&&d.jsx("div",{className:"univer-flex univer-size-full univer-items-center univer-justify-center univer-text-sm univer-text-gray-900 dark:!univer-text-gray-200",children:t.t("sheets-filter.panel.filter-by-color-none")})]})})}function et(){return d.jsx("div",{className:"univer-absolute -univer-bottom-0.5 -univer-right-0.5 univer-flex univer-size-3 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded-full univer-bg-white",children:d.jsx(Je,{className:"univer-size-full univer-font-bold univer-text-[#418F1F]"})})}function Dt(r){var v,T;const{model:e}=r,t=C.useDependency(c.LocaleService),n=C.useObservable(e.conditionItem$,void 0),o=C.useObservable(e.filterConditionFormParams$,void 0),l=o!=null&&o.and?"AND":"OR",i=F.useCallback(O=>{e.onConditionFormChange({and:O==="AND"})},[e]),s=Ht(t),a=F.useCallback(O=>{e.onPrimaryConditionChange(O)},[e]),h=xt(t),m=F.useCallback(O=>{e.onConditionFormChange(O)},[e]),p=t.t("sheets-filter.panel.input-values-placeholder");function I(O,P,A){const M=f.getItemByOperator(O).numOfParameters===1;return d.jsxs(d.Fragment,{children:[A==="operator2"&&d.jsxs(N.RadioGroup,{value:l,onChange:i,children:[d.jsx(N.Radio,{value:"AND",children:t.t("sheets-filter.panel.and")}),d.jsx(N.Radio,{value:"OR",children:t.t("sheets-filter.panel.or")})]}),d.jsx(N.Select,{value:O,options:h,onChange:L=>m({[A]:L})}),M&&d.jsx("div",{children:d.jsx(N.Input,{className:"univer-mt-2",value:P,placeholder:p,onChange:L=>m({[A==="operator1"?"val1":"val2"]:L})})})]})}return d.jsx("div",{"data-u-comp":"sheets-filter-panel-conditions-container",className:"univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",children:n&&o&&d.jsxs(d.Fragment,{children:[d.jsx(N.Select,{value:n.operator,options:s,onChange:a}),f.getItemByOperator(n.operator).numOfParameters!==0?d.jsxs("div",{"data-u-comp":"sheets-filter-panel-conditions-container-inner",className:N.clsx("univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2",N.borderClassName),children:[n.numOfParameters>=1&&I(o.operator1,(v=o.val1)!=null?v:"","operator1"),n.numOfParameters>=2&&I(o.operator2,(T=o.val2)!=null?T:"","operator2"),d.jsxs("div",{"data-u-comp":"sheets-filter-panel-conditions-desc",className:"univer-mt-2 univer-text-xs univer-text-gray-500",children:[t.t("sheets-filter.panel.?"),d.jsx("br",{}),t.t("sheets-filter.panel.*")]})]}):null]})})}function Ht(r){const e=r.getCurrentLocale();return F.useMemo(()=>[{options:[{label:r.t(f.NONE.label),value:f.NONE.operator}]},{options:[{label:r.t(f.EMPTY.label),value:f.EMPTY.operator},{label:r.t(f.NOT_EMPTY.label),value:f.NOT_EMPTY.operator}]},{options:[{label:r.t(f.TEXT_CONTAINS.label),value:f.TEXT_CONTAINS.operator},{label:r.t(f.DOES_NOT_CONTAIN.label),value:f.DOES_NOT_CONTAIN.operator},{label:r.t(f.STARTS_WITH.label),value:f.STARTS_WITH.operator},{label:r.t(f.ENDS_WITH.label),value:f.ENDS_WITH.operator},{label:r.t(f.EQUALS.label),value:f.EQUALS.operator}]},{options:[{label:r.t(f.GREATER_THAN.label),value:f.GREATER_THAN.operator},{label:r.t(f.GREATER_THAN_OR_EQUAL.label),value:f.GREATER_THAN_OR_EQUAL.operator},{label:r.t(f.LESS_THAN.label),value:f.LESS_THAN.operator},{label:r.t(f.LESS_THAN_OR_EQUAL.label),value:f.LESS_THAN_OR_EQUAL.operator},{label:r.t(f.EQUAL.label),value:f.EQUAL.operator},{label:r.t(f.NOT_EQUAL.label),value:f.NOT_EQUAL.operator},{label:r.t(f.BETWEEN.label),value:f.BETWEEN.operator},{label:r.t(f.NOT_BETWEEN.label),value:f.NOT_BETWEEN.operator}]},{options:[{label:r.t(f.CUSTOM.label),value:f.CUSTOM.operator}]}],[e,r])}function xt(r){const e=r.getCurrentLocale();return F.useMemo(()=>f.ALL_CONDITIONS.filter(t=>t.numOfParameters!==2).map(t=>({label:r.t(t.label),value:t.operator})),[e,r])}function Wt(r){const{model:e}=r,t=C.useDependency(c.LocaleService),n=C.useObservable(e.searchString$,"",!0),o=C.useObservable(e.filterItems$,void 0,!0),l=t.t("sheets-filter.panel.filter-only"),i=be(o),s=i.checked>0&&i.unchecked===0,a=i.checked>0&&i.unchecked>0,h=e.treeMapCache,m=F.useCallback(()=>{e.onCheckAllToggled(!s)},[e,s]),p=F.useCallback(v=>{e.setSearchString(v)},[e]);function I(v){let T=[];return v.forEach(O=>{O.checked&&T.push(O.key),O.children&&(T=T.concat(I(O.children)))}),T}return d.jsxs("div",{"data-u-comp":"sheets-filter-panel-values-container",className:"univer-flex univer-h-full univer-min-h-[300px] univer-flex-col",children:[d.jsx(N.Input,{autoFocus:!0,value:n,placeholder:t.t("sheets-filter.panel.search-placeholder"),onChange:p}),d.jsxs("div",{"data-u-comp":"sheets-filter-panel",className:N.clsx("univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden univer-rounded-md univer-px-2 univer-py-2.5",N.borderClassName),children:[d.jsx("div",{"data-u-comp":"sheets-filter-panel-values-item",className:"univer-box-border univer-h-8 univer-w-full univer-py-0.5",children:d.jsxs("div",{"data-u-comp":"sheets-filter-panel-values-item-inner",className:"univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-py-0 univer-pl-5 univer-pr-0.5 univer-text-sm",children:[d.jsx(N.Checkbox,{indeterminate:a,disabled:o.length===0,checked:s,onChange:m}),d.jsx("span",{"data-u-comp":"sheets-filter-panel-values-item-text",className:"univer-mx-1 univer-inline-block univer-flex-shrink univer-truncate univer-text-gray-900 dark:!univer-text-white",children:`${t.t("sheets-filter.panel.select-all")}`}),d.jsx("span",{"data-u-comp":"sheets-filter-panel-values-item-count",className:"univer-text-gray-400 dark:!univer-text-gray-500",children:`(${i.checked}/${i.checked+i.unchecked})`})]})}),d.jsx("div",{"data-u-comp":"sheets-filter-panel-values-virtual",className:"univer-flex-grow",children:d.jsx(N.Tree,{data:o,defaultExpandAll:!1,valueGroup:I(o),onChange:v=>{e.onFilterCheckToggled(v)},defaultCache:h,itemHeight:28,treeNodeClassName:`
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require(`@univerjs/core`),require(`@univerjs/sheets-filter`),require(`@univerjs/sheets-ui`),require(`@univerjs/ui`),require(`@univerjs/engine-render`),require(`@univerjs/sheets`),require(`rxjs`),require(`@univerjs/rpc`),require(`@univerjs/design`),require(`react`),require(`react/jsx-runtime`)):typeof define==`function`&&define.amd?define([`exports`,`@univerjs/core`,`@univerjs/sheets-filter`,`@univerjs/sheets-ui`,`@univerjs/ui`,`@univerjs/engine-render`,`@univerjs/sheets`,`rxjs`,`@univerjs/rpc`,`@univerjs/design`,`react`,`react/jsx-runtime`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.UniverSheetsFilterUi={},e.UniverCore,e.UniverSheetsFilter,e.UniverSheetsUi,e.UniverUi,e.UniverEngineRender,e.UniverSheets,e.rxjs,e.UniverRpc,e.UniverDesign,e.React,e.React))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});let f=function(e){return e[e.FIRST=0]=`FIRST`,e[e.SECOND=1]=`SECOND`,e}({}),p=function(e){return e.NONE=`none`,e.STARTS_WITH=`startsWith`,e.DOES_NOT_START_WITH=`doesNotStartWith`,e.ENDS_WITH=`endsWith`,e.DOES_NOT_END_WITH=`doesNotEndWith`,e.CONTAINS=`contains`,e.DOES_NOT_CONTAIN=`doesNotContain`,e.EQUALS=`equals`,e.NOT_EQUALS=`notEquals`,e.EMPTY=`empty`,e.NOT_EMPTY=`notEmpty`,e.BETWEEN=`between`,e.NOT_BETWEEN=`notBetween`,e.CUSTOM=`custom`,e}({}),m;(function(e){let r=e.NONE={label:`sheets-filter.conditions.none`,operator:p.NONE,order:f.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw Error(`[FilterConditionItems.NONE]: should not have initial form params!`)},testMappingParams:e=>e.operator1===p.NONE,mapToFilterColumn:()=>null,testMappingFilterColumn:e=>!e.customFilters&&!e.filters?{}:!1},i=e.ALL_CONDITIONS=[r,e.EMPTY={label:`sheets-filter.conditions.empty`,operator:p.EMPTY,order:f.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw Error(`[FilterConditionItems.EMPTY]: should not have initial form params!`)},testMappingParams:({operator1:e})=>e===p.EMPTY,mapToFilterColumn:()=>({customFilters:{customFilters:[{val:``}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let n=e.customFilters.customFilters[0];return n.val===``&&n.operator===void 0?{operator1:p.EMPTY}:!1}},e.NOT_EMPTY={label:`sheets-filter.conditions.not-empty`,operator:p.NOT_EMPTY,order:f.SECOND,numOfParameters:0,getDefaultFormParams:()=>{throw Error(`[FilterConditionItems.NOT_EMPTY]: should not have initial form params!`)},testMappingParams:({operator1:e})=>e===p.NOT_EMPTY,mapToFilterColumn:()=>({customFilters:{customFilters:[{val:``,operator:n.CustomFilterOperator.NOT_EQUALS}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.val===` `&&r.operator===n.CustomFilterOperator.NOT_EQUALS?{operator1:p.NOT_EMPTY}:!1}},e.TEXT_CONTAINS={label:`sheets-filter.conditions.text-contains`,operator:p.CONTAINS,order:f.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:p.CONTAINS,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===p.CONTAINS},mapToFilterColumn:e=>{let{val1:t}=e;return t===``?null:{customFilters:{customFilters:[{val:`*${t}*`}]}}},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let n=e.customFilters.customFilters[0],r=n.val.toString();return!n.operator&&r.startsWith(`*`)&&r.endsWith(`*`)?{operator1:p.CONTAINS,val1:r.slice(1,-1)}:!1}},e.DOES_NOT_CONTAIN={label:`sheets-filter.conditions.does-not-contain`,operator:p.DOES_NOT_CONTAIN,order:f.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:p.DOES_NOT_CONTAIN,val1:``}),mapToFilterColumn:e=>({customFilters:{customFilters:[{val:`*${e.val1}*`,operator:n.CustomFilterOperator.NOT_EQUALS}]}}),testMappingParams:e=>{let[t]=h(e);return t===p.DOES_NOT_CONTAIN},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0],i=r.val.toString();return r.operator===n.CustomFilterOperator.NOT_EQUALS&&i.startsWith(`*`)&&i.endsWith(`*`)?{operator1:p.DOES_NOT_CONTAIN,val1:i.slice(1,-1)}:!1}},e.STARTS_WITH={label:`sheets-filter.conditions.starts-with`,operator:p.STARTS_WITH,order:f.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:p.STARTS_WITH,val1:``}),mapToFilterColumn:e=>({customFilters:{customFilters:[{val:`${e.val1}*`}]}}),testMappingParams:e=>{let[t]=h(e);return t===p.STARTS_WITH},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let n=e.customFilters.customFilters[0],r=n.val.toString();return!n.operator&&r.endsWith(`*`)&&!r.startsWith(`*`)?{operator1:p.STARTS_WITH,val1:r.slice(0,-1)}:!1}},e.ENDS_WITH={label:`sheets-filter.conditions.ends-with`,operator:p.ENDS_WITH,order:f.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:p.ENDS_WITH,val1:``}),mapToFilterColumn:e=>({customFilters:{customFilters:[{val:`*${e.val1}`}]}}),testMappingParams:e=>{let[t]=h(e);return t===p.ENDS_WITH},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let n=e.customFilters.customFilters[0],r=n.val.toString();return!n.operator&&r.startsWith(`*`)&&!r.endsWith(`*`)?{operator1:p.ENDS_WITH,val1:r.slice(1)}:!1}},e.EQUALS={label:`sheets-filter.conditions.equals`,operator:p.EQUALS,order:f.FIRST,numOfParameters:1,getDefaultFormParams:()=>({operator1:p.EQUALS,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===p.EQUALS},mapToFilterColumn:e=>{let{val1:t}=e;return t===``?null:{customFilters:{customFilters:[{val:t}]}}},testMappingFilterColumn:e=>{var t,n;return((t=e.filters)==null||(t=t.filters)==null?void 0:t.length)===1?{operator1:p.EQUALS,val1:``}:((n=e.customFilters)==null?void 0:n.customFilters.length)===1&&!e.customFilters.customFilters[0].operator?{operator1:p.EQUALS,val1:e.customFilters.customFilters[0].val.toString()}:!1}},e.GREATER_THAN={label:`sheets-filter.conditions.greater-than`,operator:n.CustomFilterOperator.GREATER_THAN,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.GREATER_THAN,val1:``}),mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.GREATER_THAN}]}}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.GREATER_THAN},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.GREATER_THAN?{operator1:n.CustomFilterOperator.GREATER_THAN,val1:r.val.toString()}:!1}},e.GREATER_THAN_OR_EQUAL={label:`sheets-filter.conditions.greater-than-or-equal`,operator:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.GREATER_THAN_OR_EQUAL},mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.GREATER_THAN_OR_EQUAL?{operator1:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:r.val.toString()}:!1}},e.LESS_THAN={label:`sheets-filter.conditions.less-than`,operator:n.CustomFilterOperator.LESS_THAN,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.LESS_THAN,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.LESS_THAN},mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.LESS_THAN}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.LESS_THAN?{operator1:n.CustomFilterOperator.LESS_THAN,val1:r.val.toString()}:!1}},e.LESS_THAN_OR_EQUAL={label:`sheets-filter.conditions.less-than-or-equal`,operator:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.LESS_THAN_OR_EQUAL},mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.LESS_THAN_OR_EQUAL}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.LESS_THAN_OR_EQUAL?{operator1:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,val1:r.val.toString()}:!1}},e.EQUAL={label:`sheets-filter.conditions.equal`,operator:n.CustomFilterOperator.EQUAL,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.EQUAL,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.EQUAL},mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.EQUAL}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.EQUAL?{operator1:n.CustomFilterOperator.EQUAL,val1:r.val.toString()}:!1}},e.NOT_EQUAL={label:`sheets-filter.conditions.not-equal`,operator:n.CustomFilterOperator.NOT_EQUALS,numOfParameters:1,order:f.FIRST,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.NOT_EQUALS,val1:``}),testMappingParams:e=>{let[t]=h(e);return t===n.CustomFilterOperator.NOT_EQUALS},mapToFilterColumn:e=>({customFilters:{customFilters:[{val:e.val1,operator:n.CustomFilterOperator.NOT_EQUALS}]}}),testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==1)return!1;let r=e.customFilters.customFilters[0];return r.operator===n.CustomFilterOperator.NOT_EQUALS?{operator1:n.CustomFilterOperator.NOT_EQUALS,val1:r.val.toString()}:!1}},e.BETWEEN={label:`sheets-filter.conditions.between`,operator:p.BETWEEN,order:f.SECOND,numOfParameters:2,getDefaultFormParams:()=>({and:!0,operator1:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:``,operator2:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:``}),testMappingParams:e=>{let{and:t,operator1:r,operator2:i}=e;if(!t)return!1;let a=[r,i];return a.includes(n.CustomFilterOperator.GREATER_THAN_OR_EQUAL)&&a.includes(n.CustomFilterOperator.LESS_THAN_OR_EQUAL)},mapToFilterColumn:e=>{let{val1:r,val2:i,operator1:a}=e,o=a===n.CustomFilterOperator.GREATER_THAN_OR_EQUAL;return{customFilters:{and:t.BooleanNumber.TRUE,customFilters:[{val:o?r:i,operator:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL},{val:o?i:r,operator:n.CustomFilterOperator.LESS_THAN_OR_EQUAL}]}}},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==2)return!1;let[r,i]=e.customFilters.customFilters;return r.operator===n.CustomFilterOperator.GREATER_THAN_OR_EQUAL&&i.operator===n.CustomFilterOperator.LESS_THAN_OR_EQUAL&&e.customFilters.and?{and:!0,operator1:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:r.val.toString(),operator2:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:i.val.toString()}:i.operator===n.CustomFilterOperator.GREATER_THAN_OR_EQUAL&&r.operator===n.CustomFilterOperator.LESS_THAN_OR_EQUAL&&e.customFilters.and?{and:!0,operator1:n.CustomFilterOperator.GREATER_THAN_OR_EQUAL,val1:i.val.toString(),operator2:n.CustomFilterOperator.LESS_THAN_OR_EQUAL,val2:r.val.toLocaleString()}:!1}},e.NOT_BETWEEN={label:`sheets-filter.conditions.not-between`,operator:p.NOT_BETWEEN,order:f.SECOND,numOfParameters:2,getDefaultFormParams:()=>({operator1:n.CustomFilterOperator.LESS_THAN,val1:``,operator2:n.CustomFilterOperator.GREATER_THAN,val2:``}),testMappingParams:e=>{let{and:t,operator1:r,operator2:i}=e;if(t)return!1;let a=[r,i];return a.includes(n.CustomFilterOperator.GREATER_THAN)&&a.includes(n.CustomFilterOperator.LESS_THAN)},mapToFilterColumn:e=>{let{val1:t,val2:r,operator1:i}=e,a=i===n.CustomFilterOperator.GREATER_THAN;return{customFilters:{customFilters:[{val:a?t:r,operator:n.CustomFilterOperator.GREATER_THAN},{val:a?r:t,operator:n.CustomFilterOperator.LESS_THAN}]}}},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==2)return!1;let[r,i]=e.customFilters.customFilters;return r.operator===n.CustomFilterOperator.LESS_THAN&&i.operator===n.CustomFilterOperator.GREATER_THAN&&!e.customFilters.and?{operator1:n.CustomFilterOperator.LESS_THAN,val1:r.val.toString(),operator2:n.CustomFilterOperator.GREATER_THAN,val2:i.val.toString()}:i.operator===n.CustomFilterOperator.LESS_THAN&&r.operator===n.CustomFilterOperator.GREATER_THAN&&!e.customFilters.and?{operator1:n.CustomFilterOperator.GREATER_THAN,val1:i.val.toString(),operator2:n.CustomFilterOperator.LESS_THAN,val2:r.val.toLocaleString()}:!1}},e.CUSTOM={label:`sheets-filter.conditions.custom`,operator:p.CUSTOM,order:f.SECOND,numOfParameters:2,getDefaultFormParams:()=>({operator1:p.NONE,val1:``,operator2:p.NONE,val2:``}),testMappingParams:()=>!0,mapToFilterColumn:e=>{let{and:n,val1:a,val2:o,operator1:s,operator2:c}=e;function l(e,t){for(let n of i)if(n.operator===e)return n.mapToFilterColumn({val1:t,operator1:e})}let u=!s||s===m.NONE.operator,d=!c||c===m.NONE.operator;if(u&&d)return r.mapToFilterColumn({});if(u)return l(c,o);if(d)return l(s,a);let f=l(s,a),p=l(c,o),h={customFilters:[f.customFilters.customFilters[0],p.customFilters.customFilters[0]]};return n&&(h.and=t.BooleanNumber.TRUE),{customFilters:h}},testMappingFilterColumn:e=>{var t;if(((t=e.customFilters)==null?void 0:t.customFilters.length)!==2)return!1;let n=e.customFilters.customFilters.map(e=>l({customFilters:{customFilters:[e]}})),r={operator1:n[0][0].operator,val1:n[0][1].val1,operator2:n[1][0].operator,val2:n[1][1].val1};return e.customFilters.and&&(r.and=!0),r}}];function a(e){let t=i.find(t=>t.operator===e);if(!t)throw Error(`[SheetsFilter]: no condition item found for operator: ${e}`);return t}e.getItemByOperator=a;function o(e,t){for(let n of i.filter(e=>e.numOfParameters===t))if(n.numOfParameters!==0&&n.testMappingParams(e))return n;for(let t of i)if(t.testMappingParams(e))return t;throw Error(`[SheetsFilter]: no condition item can be mapped from the filter map params!`)}e.testMappingParams=o;function s(e){let t=i.find(t=>t.operator===e);return(t==null?void 0:t.numOfParameters)===0?{operator1:t.operator}:t.getDefaultFormParams()}e.getInitialFormParams=s;function c(e,t){return e.mapToFilterColumn(t)}e.mapToFilterColumn=c;function l(e){if(!e)return[r,{}];for(let t of i){let n=t.testMappingFilterColumn(e);if(n)return[t,n]}return[r,{}]}e.testMappingFilterColumn=l})(m||(m={}));function h(e){let{operator1:t,operator2:n,val1:r,val2:i}=e;if(t&&n)throw Error(`Both operator1 and operator2 are set!`);if(!t&&!n)throw Error(`Neither operator1 and operator2 and both not set!`);return t?[t,r]:[n,i]}function g(e){let t=[],n=[],r=0,i=0;function a(e){e.leaf&&(e.checked?(t.push(e),r+=e.count):(n.push(e),i+=e.count)),e.children&&e.children.forEach(a)}return e.forEach(a),{checkedItems:t,uncheckedItems:n,checked:r,unchecked:i}}function _(e,t){return function(n,r){t(n,r,e)}}function v(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}let y=`sheets-filter.generate-filter-values.service`,b=(0,t.createIdentifier)(y),x=class extends t.Disposable{constructor(e,t,n){super(),this._localeService=e,this._univerInstanceService=t,this._logService=n}async getFilterValues(e){var t;let{unitId:n,subUnitId:r,filteredOutRowsByOtherColumns:i,filterColumn:a,filters:o,blankChecked:s,iterateRange:c,alreadyChecked:l}=e,u=this._univerInstanceService.getUnit(n),d=(t=this._univerInstanceService.getUnit(n))==null?void 0:t.getSheetBySheetId(r);return!u||!d?[]:(this._logService.debug(`[SheetsGenerateFilterValuesService]`,`getFilterValues for`,{unitId:n,subUnitId:r}),S(o,this._localeService,c,d,new Set(i),a,new Set(l.map(String)),s,u.getStyles()))}};x=v([_(0,(0,t.Inject)(t.LocaleService)),_(1,t.IUniverInstanceService),_(2,t.ILogService)],x);function S(e,r,i,a,o,s,c,l,u){var d;let f=new Map,p=new Map,m=`empty`,h=!e&&((s==null?void 0:s.filterBy)===n.FilterBy.COLORS||(s==null?void 0:s.filterBy)===n.FilterBy.CONDITIONS)&&((d=s.filteredOutRows)==null?void 0:d.size),g=0;for(let e of a.iterateByColumn(i,!1,!1)){let{row:n,rowSpan:i=1}=e,s=0;for(;s<i;){var _,v,y;let d=n+s;if(o.has(d)){s++;continue}let m=e!=null&&e.value?(0,t.extractPureTextFromCell)(e.value):``;if(!m){g+=1,s+=i;continue}let C=(_=e.value)!=null&&_.v&&!e.value.p?(v=u.get((y=e.value)==null?void 0:y.s))==null||(v=v.n)==null?void 0:v.pattern:``,E=C&&t.numfmt.getFormatInfo(C).isDate,D=!1;if(E){let{year:e,month:n,day:r}=t.numfmt.getFormatDateInfo(C);D=e||n||r}if(C&&E&&D){var b,x,S;let n=(b=a.getCellRaw(e.row,e.col))==null?void 0:b.v;if(!n){s++;continue}let[i,o,u]=t.numfmt.format(`yyyy-mm-dd`,Number(n)).split(`-`).map(Number),d=f.get(`${i}`);d||(d={title:`${i}`,key:`${i}`,children:[],count:0,leaf:!1,checked:!1},f.set(`${i}`,d),p.set(`${i}`,[`${i}`]));let g=(x=d.children)==null?void 0:x.find(e=>e.key===`${i}-${o}`);if(!g){var w;g={title:r.t(`sheets-filter.date.${o}`),key:`${i}-${o}`,children:[],count:0,leaf:!1,checked:!1},(w=d.children)==null||w.push(g),p.set(`${i}-${o}`,[`${i}`,`${i}-${o}`])}let _=g==null||(S=g.children)==null?void 0:S.find(e=>e.key===`${i}-${o}-${u}`);if(_)_.originValues.add(m),_.count++,g.count++,d.count++;else{var T;(T=g.children)==null||T.push({title:`${u}`,key:`${i}-${o}-${u}`,count:1,originValues:new Set([m]),leaf:!0,checked:h?!1:c.size?c.has(m):!l}),g.count++,d.count++,p.set(`${i}-${o}-${u}`,[`${i}`,`${i}-${o}`,`${i}-${o}-${u}`])}}else{let e=m,t=f.get(e);t?t.count++:(t={title:m,leaf:!0,checked:h?!1:c.size?c.has(m):!l,key:e,count:1},f.set(e,t),p.set(e,[e]))}s++}}let E=h?!1:e?l:!0;if(g>0){let e={title:r.t(`sheets-filter.panel.empty`),count:g,leaf:!0,checked:E,key:m};f.set(`empty`,e),p.set(`empty`,[m])}return{filterTreeItems:C(Array.from(f.values())),filterTreeMapCache:p}}function C(e){return Array.from(e).sort((e,t)=>e.children&&!t.children?-1:!e.children&&t.children?1:T(e.title,t.title)).map(e=>(e.children&&e.children.sort((e,t)=>Number.parseInt(e.key.split(`-`)[1],10)-Number.parseInt(t.key.split(`-`)[1],10)).forEach(e=>{e.children&&e.children.sort((e,t)=>Number.parseInt(e.key.split(`-`)[2],10)-Number.parseInt(t.key.split(`-`)[2],10))}),e))}let w=e=>!Number.isNaN(Number(e))&&!Number.isNaN(Number.parseFloat(e));function T(e,t){let n=w(e),r=w(t);return n&&r?Number.parseFloat(e)-Number.parseFloat(t):n&&!r?-1:!n&&r?1:e.localeCompare(t)}function E(e,t){for(let n of e){if(n.key===t)return n;if(n.children){let e=E(n.children,t);if(e)return e}}return null}function D(e){return e.leaf?e.checked:e.children?e.children.every(e=>D(e)):!0}function O(e,t){e.leaf&&(t===void 0?e.checked=!e.checked:e.checked=t),e.children&&e.children.forEach(e=>O(e,t))}function ee(e,t){let n=[];return e.forEach(e=>{let r=e.originValues?t.some(t=>Array.from(e.originValues).some(e=>e.toLowerCase().includes(t.toLowerCase()))):!1,i=!r&&t.some(t=>e.title.toLowerCase().includes(t.toLowerCase()));if(r||i)n.push({...e});else if(e.children){let r=ee(e.children,t);if(r.length>0){let t=r.reduce((e,t)=>e+t.count,0);n.push({...e,count:t,children:r})}}}),n}function k(e){"@babel/helpers - typeof";return k=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},k(e)}function te(e,t){if(k(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(k(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function ne(e){var t=te(e,`string`);return k(t)==`symbol`?t:t+``}function A(e,t,n){return(t=ne(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var j,M,N;(0,t.createIdentifier)(`sheets-filter-ui.sheets-filter-panel.service`);let P=class extends t.Disposable{get filterBy(){return this._filterBy$.getValue()}get filterByModel(){return this._filterByModel}set filterByModel(e){this._filterByModel=e,this._filterByModel$.next(e)}get filterModel(){return this._filterModel}get col(){return this._col$.getValue()}constructor(e,t){super(),this._injector=e,this._refRangeService=t,A(this,`_filterBy$`,new s.BehaviorSubject(n.FilterBy.VALUES)),A(this,`filterBy$`,this._filterBy$.asObservable()),A(this,`_filterByModel$`,new s.ReplaySubject(1)),A(this,`filterByModel$`,this._filterByModel$.asObservable()),A(this,`_filterByModel`,null),A(this,`_hasCriteria$`,new s.BehaviorSubject(!1)),A(this,`hasCriteria$`,this._hasCriteria$.asObservable()),A(this,`_filterModel`,null),A(this,`_col$`,new s.BehaviorSubject(-1)),A(this,`col$`,this._col$.asObservable()),A(this,`_filterHeaderListener`,null)}dispose(){this._filterBy$.complete(),this._filterByModel$.complete(),this._hasCriteria$.complete()}setupCol(e,t){this.terminate(),this._filterModel=e,this._col$.next(t);let n=e.getFilterColumn(t);if(n){let r=n.getColumnData();if(r.customFilters){this._hasCriteria$.next(!0),this._setupByConditions(e,t);return}if(r.colorFilters){this._hasCriteria$.next(!0),this._setupByColors(e,t);return}if(r.filters){this._hasCriteria$.next(!0),this._setupByValues(e,t);return}this._hasCriteria$.next(!1),this._setupByValues(e,t);return}this._hasCriteria$.next(!1),this._setupByValues(e,t)}changeFilterBy(e){if(!this._filterModel||this.col===-1)return!1;switch(e){case n.FilterBy.VALUES:this._setupByValues(this._filterModel,this.col);break;case n.FilterBy.COLORS:this._setupByColors(this._filterModel,this.col);break;case n.FilterBy.CONDITIONS:this._setupByConditions(this._filterModel,this.col);break}return!0}terminate(){return this._filterModel=null,this._col$.next(-1),this._disposeFilterHeaderChangeListener(),!0}_disposeFilterHeaderChangeListener(){var e;(e=this._filterHeaderListener)==null||e.dispose(),this._filterHeaderListener=null}_listenToFilterHeaderChange(e,t){this._disposeFilterHeaderChangeListener();let n=e.unitId,r=e.subUnitId,i=e.getRange(),a={startColumn:t,startRow:i.startRow,endRow:i.startRow,endColumn:t};this._filterHeaderListener=this._refRangeService.watchRange(n,r,a,(e,t)=>{if(!t)this.terminate();else{let n=t.startColumn-e.startColumn;n!==0&&this._filterByModel.deltaCol(n)}})}async _setupByValues(e,t){this._disposePreviousModel();let r=e.getRange();return r.startRow===r.endRow?!1:(this.filterByModel=await I.fromFilterColumn(this._injector,e,t),this._filterBy$.next(n.FilterBy.VALUES),this._listenToFilterHeaderChange(e,t),!0)}async _setupByColors(e,t){this._disposePreviousModel();let r=e.getRange();return r.startRow===r.endRow?!1:(this.filterByModel=await re.fromFilterColumn(this._injector,e,t),this._filterBy$.next(n.FilterBy.COLORS),this._listenToFilterHeaderChange(e,t),!0)}_setupByConditions(e,t){this._disposePreviousModel();let r=e.getRange();return r.startRow===r.endRow?!1:(this.filterByModel=F.fromFilterColumn(this._injector,e,t,e.getFilterColumn(t)),this._filterBy$.next(n.FilterBy.CONDITIONS),this._listenToFilterHeaderChange(e,t),!0)}_disposePreviousModel(){var e;(e=this._filterByModel)==null||e.dispose(),this.filterByModel=null}};P=v([_(0,(0,t.Inject)(t.Injector)),_(1,(0,t.Inject)(o.RefRangeService))],P);let F=j=class extends t.Disposable{static fromFilterColumn(e,t,n,r){let[i,a]=m.testMappingFilterColumn(r==null?void 0:r.getColumnData());return e.createInstance(j,t,n,i,a)}get conditionItem(){return this._conditionItem$.getValue()}get filterConditionFormParams(){return this._filterConditionFormParams$.getValue()}constructor(e,t,n,r,i){super(),this._filterModel=e,this.col=t,this._commandService=i,A(this,`canApply$`,(0,s.of)(!0)),A(this,`_conditionItem$`,void 0),A(this,`conditionItem$`,void 0),A(this,`_filterConditionFormParams$`,void 0),A(this,`filterConditionFormParams$`,void 0),this._conditionItem$=new s.BehaviorSubject(n),this.conditionItem$=this._conditionItem$.asObservable(),this._filterConditionFormParams$=new s.BehaviorSubject(r),this.filterConditionFormParams$=this._filterConditionFormParams$.asObservable()}dispose(){super.dispose(),this._conditionItem$.complete(),this._filterConditionFormParams$.complete()}deltaCol(e){this.col+=e}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}async apply(){if(this._disposed)return!1;let e=m.mapToFilterColumn(this.conditionItem,this.filterConditionFormParams);return this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:e})}onPrimaryConditionChange(e){let t=m.ALL_CONDITIONS.find(t=>t.operator===e);if(!t)throw Error(`[ByConditionsModel]: condition item not found for operator: ${e}!`);this._conditionItem$.next(t),this._filterConditionFormParams$.next(m.getInitialFormParams(e))}onConditionFormChange(e){let t={...this.filterConditionFormParams,...e};if(t.and!==!0&&delete t.and,e.and!==void 0||e.operator1!==void 0||e.operator2!==void 0){let e=m.testMappingParams(t,this.conditionItem.numOfParameters);this._conditionItem$.next(e)}this._filterConditionFormParams$.next(t)}};F=j=v([_(4,t.ICommandService)],F);let I=M=class extends t.Disposable{static async fromFilterColumn(e,n,r){let i=e.get(t.IUniverInstanceService),a=e.get(t.LocaleService),o=e.get(b,t.Quantity.OPTIONAL),{unitId:s,subUnitId:c}=n,l=i.getUniverSheetInstance(s);if(!l)throw Error(`[ByValuesModel]: Workbook not found for filter model with unitId: ${s}!`);let u=l==null?void 0:l.getSheetBySheetId(c);if(!u)throw Error(`[ByValuesModel]: Worksheet not found for filter model with unitId: ${s} and subUnitId: ${c}!`);let d=n.getRange(),f=r,p=n.getFilterColumn(r),m=p==null?void 0:p.getColumnData().filters,h=new Set(m==null?void 0:m.filters),g=!!(m&&m.blank),_=n.getFilteredOutRowsExceptCol(r),v={...d,startRow:d.startRow+1,startColumn:f,endColumn:f},y,x;if(o){let e=await o.getFilterValues({unitId:s,subUnitId:c,filteredOutRowsByOtherColumns:Array.from(_),filterColumn:p,filters:!!m,blankChecked:g,iterateRange:v,alreadyChecked:Array.from(h)});y=e.filterTreeItems,x=e.filterTreeMapCache}else{let e=S(!!m,a,v,u,_,p,h,g,l.getStyles());y=e.filterTreeItems,x=e.filterTreeMapCache}return e.createInstance(M,n,r,y,x)}get rawFilterItems(){return this._rawFilterItems$.getValue()}get filterItems(){return this._filterItems}get treeMapCache(){return this._treeMapCache}constructor(e,t,n,r,i){super(),this._filterModel=e,this.col=t,this._commandService=i,A(this,`_rawFilterItems$`,void 0),A(this,`rawFilterItems$`,void 0),A(this,`filterItems$`,void 0),A(this,`_filterItems`,[]),A(this,`_treeMapCache`,void 0),A(this,`canApply$`,void 0),A(this,`_manuallyUpdateFilterItems$`,void 0),A(this,`_searchString$`,void 0),A(this,`searchString$`,void 0),this._treeMapCache=r,this._searchString$=new s.BehaviorSubject(``),this.searchString$=this._searchString$.asObservable(),this._rawFilterItems$=new s.BehaviorSubject(n),this.rawFilterItems$=this._rawFilterItems$.asObservable(),this._manuallyUpdateFilterItems$=new s.Subject,this.filterItems$=(0,s.merge)((0,s.combineLatest)([this._searchString$.pipe((0,s.throttleTime)(500,void 0,{leading:!0,trailing:!0}),(0,s.startWith)(void 0)),this._rawFilterItems$]).pipe((0,s.map)(([e,t])=>e?ee(t,e.toLowerCase().split(/\s+/).filter(e=>!!e)):t)),this._manuallyUpdateFilterItems$).pipe((0,s.shareReplay)(1)),this.canApply$=this.filterItems$.pipe((0,s.map)(e=>g(e).checked>0)),this.disposeWithMe(this.filterItems$.subscribe(e=>this._filterItems=e))}dispose(){this._rawFilterItems$.complete(),this._searchString$.complete()}deltaCol(e){this.col+=e}setSearchString(e){this._searchString$.next(e)}onCheckAllToggled(e){let n=t.Tools.deepClone(this._filterItems);n.forEach(t=>O(t,e)),this._manuallyUpdateFilterItems(n)}onFilterCheckToggled(e){let n=t.Tools.deepClone(this._filterItems),r=E(n,e.key);r&&(O(r,!D(r)),this._manuallyUpdateFilterItems(n))}onFilterOnly(e){let n=t.Tools.deepClone(this._filterItems);n.forEach(e=>O(e,!1)),e.forEach(e=>{let t=E(n,e);t&&O(t,!0)}),this._manuallyUpdateFilterItems(n)}_manuallyUpdateFilterItems(e){this._manuallyUpdateFilterItems$.next(e)}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}async apply(){if(this._disposed)return!1;let e=g(this._filterItems),{checked:t,checkedItems:r}=e,i=this.rawFilterItems,a=0;for(let e of i)a+=e.count;let o=t===0,s=e.checked===a,c={colId:this.col};if(o)throw Error(`[ByValuesModel]: no checked items!`);if(s)return this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null});{c.filters={};let e=r.filter(e=>e.key!==`empty`);e.length>0&&(c.filters={filters:e.flatMap(e=>e.originValues?Array.from(e.originValues):[e.title])}),e.length!==r.length&&(c.filters.blank=!0)}return this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:c})}};I=M=v([_(4,t.ICommandService)],I);let re=N=class extends t.Disposable{static async fromFilterColumn(e,n,r){var i,o,s;let c=e.get(t.IUniverInstanceService),{unitId:l,subUnitId:u}=n,d=c.getUniverSheetInstance(l);if(!d)throw Error(`[ByColorsModel]: Workbook not found for filter model with unitId: ${l}!`);let f=d==null?void 0:d.getSheetBySheetId(u);if(!f)throw Error(`[ByColorsModel]: Worksheet not found for filter model with unitId: ${l} and subUnitId: ${u}!`);let p=n.getRange(),m=r,h=(i=n.getFilterColumn(r))==null?void 0:i.getColumnData().colorFilters,g=n.getFilteredOutRowsExceptCol(r),_={...p,startRow:p.startRow+1,startColumn:m,endColumn:m},v=new Map,y=new Set((o=h==null?void 0:h.cellFillColors)==null?[]:o),b=new Map,x=new Set((s=h==null?void 0:h.cellTextColors)==null?[]:s);for(let e of f.iterateByColumn(_,!1,!0)){let{row:n,col:r,value:i}=e;if(g.has(n))continue;let o=f.getComposedCellStyleByCellData(n,r,i);if(o.bg&&o.bg.rgb){let e=new t.ColorKit(o.bg.rgb).toRgbString();v.has(e)||v.set(e,{color:e,checked:y.has(e)})}else v.set(`default-fill-color`,{color:null,checked:y.has(null)});if(o.cl&&o.cl.rgb){let e=new t.ColorKit(o.cl.rgb).toRgbString();b.has(e)||b.set(e,{color:e,checked:x.has(e)})}else b.set(`default-font-color`,{color:a.COLOR_BLACK_RGB,checked:x.has(a.COLOR_BLACK_RGB)})}return e.createInstance(N,n,r,v,b)}get cellFillColors(){return this._cellFillColors$.getValue()}get cellTextColors(){return this._cellTextColors$.getValue()}constructor(e,t,n,r,i){super(),this._filterModel=e,this.col=t,this._commandService=i,A(this,`canApply$`,(0,s.of)(!0)),A(this,`_cellFillColors$`,void 0),A(this,`cellFillColors$`,void 0),A(this,`_cellTextColors$`,void 0),A(this,`cellTextColors$`,void 0),this._cellFillColors$=new s.BehaviorSubject(Array.from(n.values())),this.cellFillColors$=this._cellFillColors$.asObservable(),this._cellTextColors$=new s.BehaviorSubject(Array.from(r.values())),this.cellTextColors$=this._cellTextColors$.asObservable()}dispose(){super.dispose(),this._cellFillColors$.complete()}deltaCol(e){this.col+=e}clear(){return this._disposed?Promise.resolve(!1):this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null})}onFilterCheckToggled(e,t=!0){let n=t?this.cellFillColors:this.cellTextColors,r=[],i=!1;for(let t=0;t<n.length;t++){let a=n[t];if(a.color===e.color){i=!0,r.push({color:a.color,checked:!a.checked});continue}r.push({color:a.color,checked:a.checked})}i&&(this._resetColorsCheckedStatus(!t),t?this._cellFillColors$.next([...r]):this._cellTextColors$.next([...r]))}_resetColorsCheckedStatus(e=!0){let t=e?this.cellFillColors:this.cellTextColors,n=[];for(let e=0;e<t.length;e++)n.push({color:t[e].color,checked:!1});e?this._cellFillColors$.next([...n]):this._cellTextColors$.next([...n])}async apply(){if(this._disposed)return!1;let e=this.cellFillColors.filter(e=>e.checked).map(e=>e.color),t=this.cellTextColors.filter(e=>e.checked).map(e=>e.color);if(e.length===0&&t.length===0)return this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:null});let r={colId:this.col};return e.length>0?r.colorFilters={cellFillColors:e}:t.length>0&&(r.colorFilters={cellTextColors:t}),this._commandService.executeCommand(n.SetSheetsFilterCriteriaCommand.id,{unitId:this._filterModel.unitId,subUnitId:this._filterModel.subUnitId,col:this.col,criteria:r})}};re=N=v([_(4,t.ICommandService)],re);let L=`FILTER_PANEL_OPENED`,R={id:`sheet.operation.open-filter-panel`,type:t.CommandType.OPERATION,handler:(e,i)=>{let a=e.get(t.IContextService),o=e.get(n.SheetsFilterService),s=e.get(P),c=e.get(t.ICommandService),l=e.has(r.IEditorBridgeService)?e.get(r.IEditorBridgeService):null;l!=null&&l.isVisible().visible&&c.syncExecuteCommand(r.SetCellEditVisibleOperation.id,{visible:!1});let{unitId:u,subUnitId:d,col:f}=i,p=o.getFilterModel(u,d);return p?(s.setupCol(p,f),a.getContextValue(`FILTER_PANEL_OPENED`)||a.setContextValue(L,!0),!0):!1}},z={id:`sheet.operation.close-filter-panel`,type:t.CommandType.OPERATION,handler:e=>{let n=e.get(t.IContextService),r=e.get(P),a=e.get(i.ILayoutService,t.Quantity.OPTIONAL);return n.getContextValue(`FILTER_PANEL_OPENED`)?(n.setContextValue(L,!1),a==null||a.focus(),r.terminate()):!1}},B={id:`sheet.operation.apply-filter`,type:t.CommandType.OPERATION,handler:(e,t)=>{let{filterBy:n}=t;return e.get(P).changeFilterBy(n)}};var V=`@univerjs/sheets-filter-ui`,H=`0.18.0`;let U=`sheets-filter-ui.config`;Symbol(U);let W={},G=class extends t.Disposable{constructor(e,t,n,r,i,a){super(),this._sheetsFilterService=e,this._localeService=t,this._commandService=n,this._sheetPermissionCheckPermission=r,this._injector=i,this._sheetsSelectionService=a,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(e.id===n.SmartToggleSheetsFilterCommand.id){var r;let e=(0,o.getSheetCommandTarget)(this._injector.get(t.IUniverInstanceService));if(!e)return;let{unitId:n,subUnitId:a,worksheet:s}=e,c=(r=this._sheetsFilterService.getFilterModel(n,a))==null?void 0:r.getRange(),l;if(c)l=this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[o.RangeProtectionPermissionViewPoint],worksheetTypes:[o.WorksheetFilterPermission,o.WorksheetViewPermission]},[c],n,a);else{var i;let e=(i=this._sheetsSelectionService.getCurrentLastSelection())==null?void 0:i.range;if(e){let t={...e};t=e.startColumn===e.endColumn&&e.startRow===e.endRow?(0,o.expandToContinuousRange)(t,{left:!0,right:!0,up:!0,down:!0},s):t,l=this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[o.RangeProtectionPermissionViewPoint],worksheetTypes:[o.WorksheetViewPermission,o.WorksheetFilterPermission]},[t],n,a)}else l=this._sheetPermissionCheckPermission.permissionCheckWithoutRange({rangeTypes:[o.RangeProtectionPermissionViewPoint],worksheetTypes:[o.WorksheetViewPermission,o.WorksheetFilterPermission]})}l||this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.filterErr`))}if(e.id===R.id){var a;let n=e.params,{unitId:r,subUnitId:i}=n,s=(a=this._sheetsFilterService.getFilterModel(r,i))==null?void 0:a.getRange(),c=t.Tools.deepClone(s);c&&(c.startColumn=n.col,c.endColumn=n.col,this._sheetPermissionCheckPermission.permissionCheckWithRanges({rangeTypes:[o.RangeProtectionPermissionViewPoint],worksheetTypes:[o.WorksheetFilterPermission,o.WorksheetViewPermission]},[c],r,i)||this._sheetPermissionCheckPermission.blockExecuteWithoutPermission(this._localeService.t(`permission.dialog.filterErr`)))}}))}};G=v([_(0,(0,t.Inject)(n.SheetsFilterService)),_(1,(0,t.Inject)(t.LocaleService)),_(2,t.ICommandService),_(3,(0,t.Inject)(o.SheetPermissionCheckController)),_(4,(0,t.Inject)(t.Injector)),_(5,(0,t.Inject)(o.SheetsSelectionsService))],G);let ie=new Path2D(`M3.30363 3C2.79117 3 2.51457 3.60097 2.84788 3.99024L6.8 8.60593V12.5662C6.8 12.7184 6.8864 12.8575 7.02289 12.9249L8.76717 13.7863C8.96655 13.8847 9.2 13.7396 9.2 13.5173V8.60593L13.1521 3.99024C13.4854 3.60097 13.2088 3 12.6964 3H3.30363Z`);var ae=class{static drawNoCriteria(e,t,n,r){e.save(),a.Rect.drawWith(e,{radius:2,width:16,height:16,fill:r}),e.lineCap=`square`,e.strokeStyle=n,e.scale(t/16,t/16),e.beginPath(),e.lineWidth=1,e.lineCap=`round`,e.moveTo(3,4),e.lineTo(13,4),e.moveTo(4.5,8),e.lineTo(11.5,8),e.moveTo(6,12),e.lineTo(10,12),e.stroke(),e.restore()}static drawHasCriteria(e,t,n,r){e.save(),a.Rect.drawWith(e,{radius:2,width:16,height:16,fill:r}),e.scale(t/16,t/16),e.fillStyle=n,e.fill(ie),e.restore()}};let K=class extends a.Shape{constructor(e,t,n,r,i){super(e,t),this._contextService=n,this._commandService=r,this._themeService=i,A(this,`_cellWidth`,0),A(this,`_cellHeight`,0),A(this,`_filterParams`,void 0),A(this,`_hovered`,!1),this.setShapeProps(t),this.onPointerDown$.subscribeEvent(e=>this.onPointerDown(e)),this.onPointerEnter$.subscribeEvent(()=>this.onPointerEnter()),this.onPointerLeave$.subscribeEvent(()=>this.onPointerLeave())}setShapeProps(e){e.cellHeight!==void 0&&(this._cellHeight=e.cellHeight),e.cellWidth!==void 0&&(this._cellWidth=e.cellWidth),e.filterParams!==void 0&&(this._filterParams=e.filterParams),this.transformByState({width:e.width,height:e.height})}_draw(e){let t=this._cellHeight,n=this._cellWidth,r=16-n,i=16-t;e.save();let a=new Path2D;a.rect(r,i,n,t),e.clip(a);let{hasCriteria:o}=this._filterParams,s=this._themeService.getColorFromTheme(`primary.600`),c=this._hovered?this._themeService.getColorFromTheme(`gray.50`):`rgba(255, 255, 255, 1.0)`;o?ae.drawHasCriteria(e,16,s,c):ae.drawNoCriteria(e,16,s,c),e.restore()}onPointerDown(e){if(e.button===2)return;let{col:t,unitId:n,subUnitId:r}=this._filterParams;this._contextService.getContextValue(`FILTER_PANEL_OPENED`)||!this._commandService.hasCommand(R.id)||setTimeout(()=>{this._commandService.executeCommand(R.id,{unitId:n,subUnitId:r,col:t})},200)}onPointerEnter(){this._hovered=!0,this.makeDirty(!0)}onPointerLeave(){this._hovered=!1,this.makeDirty(!0)}};K=v([_(2,t.IContextService),_(3,t.ICommandService),_(4,(0,t.Inject)(t.ThemeService))],K);function oe(e,n,r,i){switch(i){case t.VerticalAlign.TOP:return e+1;case t.VerticalAlign.MIDDLE:return e+Math.max(0,(r-16)/2);case t.VerticalAlign.BOTTOM:default:return n-16-1}}let q=class extends t.RxDisposable{constructor(e,t,n,r,i,a,o,s){super(),this._context=e,this._injector=t,this._sheetSkeletonManagerService=n,this._sheetsFilterService=r,this._themeService=i,this._sheetInterceptorService=a,this._commandService=o,this._selectionRenderService=s,A(this,`_filterRangeShape`,null),A(this,`_buttonRenderDisposable`,null),A(this,`_filterButtonShapes`,[]),this._initRenderer()}dispose(){super.dispose(),this._disposeRendering()}_initRenderer(){this._sheetSkeletonManagerService.currentSkeleton$.pipe((0,s.switchMap)(e=>{var r,i;if(!e)return(0,s.of)(null);let{unit:a,unitId:c}=this._context,l=((r=a.getActiveSheet())==null?void 0:r.getSheetId())||``,u=(i=this._sheetsFilterService.getFilterModel(c,l))==null?void 0:i,d=()=>({unitId:c,worksheetId:l,filterModel:u,range:u==null?void 0:u.getRange(),skeleton:e.skeleton});return(0,t.fromCallback)(this._commandService.onCommandExecuted.bind(this._commandService)).pipe((0,s.filter)(([e])=>{var r;return e.type===t.CommandType.MUTATION&&((r=e.params)==null?void 0:r.unitId)===a.getUnitId()&&(n.FILTER_MUTATIONS.has(e.id)||e.id===o.SetRangeValuesMutation.id)}),(0,s.throttleTime)(20,void 0,{leading:!1,trailing:!0}),(0,s.map)(d),(0,s.startWith)(d()))}),(0,s.takeUntil)(this.dispose$)).subscribe(e=>{this._disposeRendering(),!(!e||!e.range)&&(this._renderRange(e.range,e.skeleton),this._renderButtons(e))})}_renderRange(e,t){let{scene:n}=this._context,{rowHeaderWidth:i,columnHeaderHeight:a}=t,o=this._filterRangeShape=new r.SelectionControl(n,1e3,this._themeService,{rowHeaderWidth:i,columnHeaderHeight:a,enableAutoFill:!1,highlightHeader:!1}),s=(0,r.attachSelectionWithCoord)({range:e,primary:null,style:{fill:`rgba(0, 0, 0, 0.0)`}},t);o.updateRangeBySelectionWithCoord(s),o.setEvent(!1),n.makeDirty(!0)}_renderButtons(e){let{range:n,filterModel:i,unitId:a,skeleton:o,worksheetId:s}=e,{unit:c,scene:l}=this._context,u=c.getSheetBySheetId(s);if(!u)return;this._interceptCellContent(a,s,e.range);let{startColumn:d,endColumn:f,startRow:p}=n;for(let e=d;e<=f;e++){let n=`sheets-filter-button-${e}`,c=(0,r.getCoordByCell)(p,e,l,o),d=u.getComposedCellStyle(p,e),f=(d==null?void 0:d.vt)||t.VerticalAlign.BOTTOM,{startX:m,startY:h,endX:g,endY:_}=c,v=g-m,y=_-h;if(y<=1||v<=1)continue;let b=!!i.getFilterColumn(e),x={left:g-16-1,top:oe(h,_,y,f),height:16,width:16,zIndex:5e3,cellHeight:y,cellWidth:v,filterParams:{unitId:a,subUnitId:s,col:e,hasCriteria:b}},S=this._injector.createInstance(K,n,x);this._filterButtonShapes.push(S)}l.addObjects(this._filterButtonShapes),l.makeDirty()}_interceptCellContent(e,n,r){let{startRow:i,startColumn:a,endColumn:s}=r;this._buttonRenderDisposable=this._sheetInterceptorService.intercept(o.INTERCEPTOR_POINT.CELL_CONTENT,{effect:t.InterceptorEffectEnum.Style,handler:(t,r,o)=>{let{row:c,col:l,unitId:u,subUnitId:d}=r;return u!==e||d!==n||c!==i||l<a||l>s?o(t):((!t||t===r.rawData)&&(t={...r.rawData}),t.fontRenderExtension={...t==null?void 0:t.fontRenderExtension,rightOffset:16},o(t))},priority:10})}_disposeRendering(){var e,t;(e=this._filterRangeShape)==null||e.dispose(),this._filterButtonShapes.forEach(e=>e.dispose()),(t=this._buttonRenderDisposable)==null||t.dispose(),this._filterRangeShape=null,this._buttonRenderDisposable=null,this._filterButtonShapes=[]}};q=v([_(1,(0,t.Inject)(t.Injector)),_(2,(0,t.Inject)(r.SheetSkeletonManagerService)),_(3,(0,t.Inject)(n.SheetsFilterService)),_(4,(0,t.Inject)(t.ThemeService)),_(5,(0,t.Inject)(o.SheetInterceptorService)),_(6,t.ICommandService),_(7,r.ISheetSelectionRenderService)],q);let J=class extends t.RxDisposable{constructor(e,r){super(),this._renderManagerService=e,this._sheetsRenderService=r,[n.SetSheetsFilterRangeMutation,n.SetSheetsFilterCriteriaMutation,n.RemoveSheetsFilterMutation,n.ReCalcSheetsFilterMutation].forEach(e=>this.disposeWithMe(this._sheetsRenderService.registerSkeletonChangingMutations(e.id))),this.disposeWithMe(this._renderManagerService.registerRenderModule(t.UniverInstanceType.UNIVER_SHEET,[q]))}};J=v([_(0,a.IRenderManagerService),_(1,(0,t.Inject)(r.SheetsRenderService))],J);let Y=class extends t.Plugin{constructor(e=W,n,r){super(),this._config=e,this._injector=n,this._configService=r;let{menu:i,...a}=(0,t.merge)({},W,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(U,a)}onStarting(){[[G],[J]].forEach(e=>this._injector.add(e))}onReady(){this._injector.get(G)}onRendered(){this._injector.get(J)}};A(Y,`type`,t.UniverInstanceType.UNIVER_SHEET),A(Y,`pluginName`,`SHEET_FILTER_UI_PLUGIN`),A(Y,`packageName`,V),A(Y,`version`,H),Y=v([(0,t.DependentOn)(n.UniverSheetsFilterPlugin),_(1,(0,t.Inject)(t.Injector)),_(2,t.IConfigService)],Y);function X({ref:e,...t}){let{icon:n,id:r,className:i,extend:a,...o}=t,s=`univerjs-icon univerjs-icon-${r} ${i||``}`.trim(),c=(0,u.useRef)(`_${ue()}`);return se(n,`${r}`,{defIds:n.defIds,idSuffix:c.current},{ref:e,className:s,...o},a)}function se(e,t,n,r,i){return(0,u.createElement)(e.tag,{key:t,...ce(e,n,i),...r},(le(e,n).children||[]).map((r,a)=>se(r,`${t}-${e.tag}-${a}`,n,void 0,i)))}function ce(e,t,n){let r={...e.attrs};n!=null&&n.colorChannel1&&r.fill===`colorChannel1`&&(r.fill=n.colorChannel1),e.tag===`mask`&&r.id&&(r.id+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{e===`mask`&&typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))});let{defIds:i}=t;return!i||i.length===0?r:(e.tag===`use`&&r[`xlink:href`]&&(r[`xlink:href`]+=t.idSuffix),Object.entries(r).forEach(([e,n])=>{typeof n==`string`&&(r[e]=n.replace(/url\(#(.*)\)/,`url(#$1${t.idSuffix})`))}),r)}function le(e,t){var n;let{defIds:r}=t;return!r||r.length===0?e:e.tag===`defs`&&(n=e.children)!=null&&n.length?{...e,children:e.children.map(e=>typeof e.attrs.id==`string`&&r&&r.includes(e.attrs.id)?{...e,attrs:{...e.attrs,id:e.attrs.id+t.idSuffix}}:e)}:e}function ue(){return Math.random().toString(36).substring(2,8)}X.displayName=`UniverIcon`;let de={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 20`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M10 1.05957C10.356 1.05957 10.6816 1.26162 10.8408 1.58008L18.8408 17.5801L18.8799 17.668C19.0486 18.1134 18.8551 18.6232 18.4199 18.8408C17.9557 19.0727 17.3913 18.8841 17.1592 18.4199L10 4.10156L2.84082 18.4199C2.60871 18.8841 2.04434 19.0727 1.58008 18.8408C1.11587 18.6087 0.92731 18.0443 1.15918 17.5801L9.15918 1.58008C9.31841 1.26162 9.64395 1.05957 10 1.05957Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M15.3337 11.7261L15.4294 11.731C15.9035 11.779 16.2732 12.1798 16.2732 12.6665C16.2732 13.1532 15.9035 13.554 15.4294 13.602L15.3337 13.6069H4.66675C4.1476 13.6069 3.72632 13.1856 3.72632 12.6665C3.72632 12.1474 4.1476 11.7261 4.66675 11.7261H15.3337Z`}}]},fe=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(X,Object.assign({},e,{id:`a-icon`,ref:t,icon:de}))});fe.displayName=`AIcon`;let pe={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 20 20`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M17.0596 10C17.0596 6.10087 13.8992 2.94043 10 2.94043C6.10087 2.94043 2.94043 6.10087 2.94043 10C2.94043 13.8992 6.10087 17.0596 10 17.0596C13.8992 17.0596 17.0596 13.8992 17.0596 10ZM18.9404 10C18.9404 14.9374 14.9374 18.9404 10 18.9404C5.06257 18.9404 1.05957 14.9374 1.05957 10C1.05957 5.06257 5.06257 1.05957 10 1.05957C14.9374 1.05957 18.9404 5.06257 18.9404 10Z`}},{tag:`path`,attrs:{fill:`currentColor`,d:`M4.29492 4.13476C4.63911 3.79057 5.1845 3.76906 5.55371 4.07031L5.625 4.13476L16.0244 14.5352L16.0889 14.6064C16.3902 14.9757 16.3686 15.52 16.0244 15.8643C15.6573 16.2313 15.0624 16.2313 14.6953 15.8643L4.29492 5.46484L4.23047 5.39355C3.92922 5.02434 3.95073 4.47895 4.29492 4.13476Z`}}]},me=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(X,Object.assign({},e,{id:`ban-icon`,ref:t,icon:pe}))});me.displayName=`BanIcon`;let he={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 17 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M3.32182 2.60967C2.98161 2.60967 2.79671 3.0074 3.01601 3.2675L6.85819 7.8246C6.94943 7.93282 6.99947 8.06981 6.99947 8.21136V12.7338C6.99947 12.898 7.0998 13.0455 7.2525 13.1058L8.73833 13.6928C9.00085 13.7965 9.28531 13.6031 9.28531 13.3208V8.21136C9.28531 8.06981 9.33535 7.93282 9.42659 7.8246L13.2688 3.2675C13.4881 3.0074 13.3032 2.60967 12.963 2.60967H3.32182ZM2.09858 4.04101C1.22139 3.0006 1.96097 1.40967 3.32182 1.40967H12.963C14.3238 1.40967 15.0634 3.0006 14.1862 4.04101L10.4853 8.43054V13.3208C10.4853 14.4498 9.34747 15.2237 8.29742 14.8089L6.81158 14.2219C6.20078 13.9806 5.79947 13.3905 5.79947 12.7338V8.43054L2.09858 4.04101Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},ge=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(X,Object.assign({},e,{id:`filter-icon`,ref:t,icon:he}))});ge.displayName=`FilterIcon`;let _e={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8.00016 1.33203C6.68162 1.33203 5.39269 1.72302 4.29636 2.45557C3.20004 3.18811 2.34555 4.2293 1.84097 5.44747C1.33638 6.66565 1.20436 8.00609 1.4616 9.2993C1.71883 10.5925 2.35377 11.7804 3.28612 12.7127C4.21847 13.6451 5.40636 14.28 6.69956 14.5373C7.99277 14.7945 9.33321 14.6625 10.5514 14.1579C11.7696 13.6533 12.8108 12.7988 13.5433 11.7025C14.2758 10.6062 14.6668 9.31724 14.6668 7.9987C14.6649 6.23118 13.9619 4.53662 12.7121 3.2868C11.4622 2.03697 9.76768 1.33397 8.00016 1.33203ZM7.66683 3.9987C7.86461 3.9987 8.05795 4.05735 8.2224 4.16723C8.38685 4.27711 8.51502 4.43329 8.59071 4.61601C8.6664 4.79874 8.6862 4.99981 8.64762 5.19379C8.60903 5.38777 8.51379 5.56595 8.37394 5.7058C8.23409 5.84566 8.0559 5.9409 7.86192 5.97948C7.66794 6.01807 7.46687 5.99826 7.28415 5.92258C7.10142 5.84689 6.94524 5.71872 6.83536 5.55427C6.72548 5.38982 6.66683 5.19648 6.66683 4.9987C6.66683 4.73348 6.77219 4.47913 6.95972 4.29159C7.14726 4.10405 7.40162 3.9987 7.66683 3.9987ZM9.3335 11.332H6.66683C6.49002 11.332 6.32045 11.2618 6.19543 11.1368C6.0704 11.0117 6.00016 10.8422 6.00016 10.6654C6.00016 10.4886 6.0704 10.319 6.19543 10.194C6.32045 10.0689 6.49002 9.9987 6.66683 9.9987H7.3335V7.9987H6.66683C6.49002 7.9987 6.32045 7.92846 6.19543 7.80343C6.0704 7.67841 6.00016 7.50884 6.00016 7.33203C6.00016 7.15522 6.0704 6.98565 6.19543 6.86063C6.32045 6.7356 6.49002 6.66536 6.66683 6.66536H8.00016C8.17698 6.66536 8.34655 6.7356 8.47157 6.86063C8.59659 6.98565 8.66683 7.15522 8.66683 7.33203V9.9987H9.3335C9.51031 9.9987 9.67988 10.0689 9.8049 10.194C9.92993 10.319 10.0002 10.4886 10.0002 10.6654C10.0002 10.8422 9.92993 11.0117 9.8049 11.1368C9.67988 11.2618 9.51031 11.332 9.3335 11.332Z`}}]},ve=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(X,Object.assign({},e,{id:`info-icon`,ref:t,icon:_e}))});ve.displayName=`InfoIcon`;let ye={tag:`svg`,attrs:{xmlns:`http://www.w3.org/2000/svg`,fill:`none`,viewBox:`0 0 16 16`,width:`1em`,height:`1em`},children:[{tag:`path`,attrs:{fill:`currentColor`,d:`M8 15C11.866 15 15 11.866 15 8C15 4.13401 11.866 1 8 1C4.13401 1 1 4.13401 1 8C1 11.866 4.13401 15 8 15ZM11.7245 6.42417C11.9588 6.18985 11.9588 5.80995 11.7245 5.57564C11.4901 5.34132 11.1102 5.34132 10.8759 5.57564L7.3002 9.15137L5.72446 7.57564C5.49014 7.34132 5.11025 7.34132 4.87593 7.57564C4.64162 7.80995 4.64162 8.18985 4.87593 8.42417L6.87593 10.4242C7.11025 10.6585 7.49014 10.6585 7.72446 10.4242L11.7245 6.42417Z`,fillRule:`evenodd`,clipRule:`evenodd`}}]},be=(0,u.forwardRef)(function(e,t){return(0,u.createElement)(X,Object.assign({},e,{id:`success-icon`,ref:t,icon:ye}))});be.displayName=`SuccessIcon`;function xe(e){let a=e.get(n.SheetsFilterService);return{id:n.SmartToggleSheetsFilterCommand.id,type:i.MenuItemType.BUTTON_SELECTOR,icon:`FilterIcon`,tooltip:`sheets-filter.toolbar.smart-toggle-filter-tooltip`,hidden$:(0,i.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),activated$:a.activeFilterModel$.pipe((0,s.map)(e=>!!e)),disabled$:(0,r.getObservableWithExclusiveRange$)(e,(0,r.getCurrentRangeDisable$)(e,{worksheetTypes:[o.WorksheetFilterPermission,o.WorksheetViewPermission],rangeTypes:[o.RangeProtectionPermissionViewPoint]}))}}function Se(e){let r=e.get(n.SheetsFilterService);return{id:n.ClearSheetsFilterCriteriaCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-filter.toolbar.clear-filter-criteria`,hidden$:(0,i.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:r.activeFilterModel$.pipe((0,s.switchMap)(e=>{var t;return(t=e==null?void 0:e.hasCriteria$.pipe((0,s.map)(e=>!e)))==null?(0,s.of)(!0):t}))}}function Ce(e){let r=e.get(n.SheetsFilterService);return{id:n.ReCalcSheetsFilterCommand.id,type:i.MenuItemType.BUTTON,title:`sheets-filter.toolbar.re-calc-filter-conditions`,hidden$:(0,i.getMenuHiddenObservable)(e,t.UniverInstanceType.UNIVER_SHEET),disabled$:r.activeFilterModel$.pipe((0,s.switchMap)(e=>{var t;return(t=e==null?void 0:e.hasCriteria$.pipe((0,s.map)(e=>!e)))==null?(0,s.of)(!0):t}))}}let we={[i.RibbonDataGroup.ORGANIZATION]:{[n.SmartToggleSheetsFilterCommand.id]:{order:2,menuItemFactory:xe,[n.ClearSheetsFilterCriteriaCommand.id]:{order:0,menuItemFactory:Se},[n.ReCalcSheetsFilterCommand.id]:{order:1,menuItemFactory:Ce}}}};function Te(e){let{model:n}=e,r=(0,i.useDependency)(t.LocaleService),a=(0,i.useObservable)(n.cellFillColors$,[],!0),o=(0,i.useObservable)(n.cellTextColors$,[],!0),s=(0,u.useCallback)(e=>{n.onFilterCheckToggled(e)},[n]),c=(0,u.useCallback)(e=>{n.onFilterCheckToggled(e,!1)},[n]);return(0,d.jsx)(`div`,{"data-u-comp":`sheets-filter-panel-colors-container`,className:`univer-flex univer-h-full univer-min-h-[300px] univer-flex-col`,children:(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel`,className:(0,l.clsx)(`
|
|
2
|
+
univer-mt-2 univer-box-border univer-flex univer-h-[300px] univer-flex-grow univer-flex-col
|
|
3
|
+
univer-gap-4 univer-overflow-auto univer-rounded-md univer-px-2 univer-py-2.5
|
|
4
|
+
`,l.borderClassName),children:[a.length>1&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`
|
|
5
|
+
univer-mb-2 univer-text-sm univer-text-gray-900
|
|
6
|
+
dark:!univer-text-white
|
|
7
|
+
`,children:r.t(`sheets-filter.panel.filter-by-cell-fill-color`)}),(0,d.jsx)(`div`,{className:`
|
|
8
|
+
univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2
|
|
9
|
+
`,children:a.map((e,t)=>(0,d.jsxs)(`div`,{className:`univer-relative univer-size-6`,onClick:()=>s(e),children:[e.color?(0,d.jsx)(`button`,{type:`button`,className:(0,l.clsx)(`
|
|
10
|
+
univer-box-border univer-size-6 univer-cursor-pointer
|
|
11
|
+
univer-rounded-full univer-border univer-border-solid
|
|
12
|
+
univer-border-transparent univer-bg-gray-300 univer-transition-shadow
|
|
13
|
+
hover:univer-ring-2 hover:univer-ring-offset-2
|
|
14
|
+
hover:univer-ring-offset-white
|
|
15
|
+
`),style:{backgroundColor:e.color}}):(0,d.jsx)(me,{className:`
|
|
16
|
+
univer-size-6 univer-cursor-pointer univer-rounded-full
|
|
17
|
+
hover:univer-ring-2 hover:univer-ring-offset-2
|
|
18
|
+
hover:univer-ring-offset-white
|
|
19
|
+
`}),e.checked&&(0,d.jsx)(Ee,{})]},`sheets-filter-cell-fill-color-${t}`))})]}),o.length>1&&(0,d.jsxs)(`div`,{children:[(0,d.jsx)(`div`,{className:`
|
|
20
|
+
univer-mb-2 univer-text-sm univer-text-gray-900
|
|
21
|
+
dark:!univer-text-white
|
|
22
|
+
`,children:r.t(`sheets-filter.panel.filter-by-cell-text-color`)}),(0,d.jsx)(`div`,{className:`
|
|
23
|
+
univer-grid univer-grid-cols-8 univer-items-center univer-justify-start univer-gap-2
|
|
24
|
+
`,children:o.map((e,t)=>(0,d.jsxs)(`div`,{className:`univer-relative univer-size-6`,onClick:()=>c(e),children:[(0,d.jsx)(`div`,{className:`
|
|
25
|
+
univer-box-border univer-flex univer-size-full univer-cursor-pointer
|
|
26
|
+
univer-items-center univer-justify-center univer-rounded-full univer-border
|
|
27
|
+
univer-border-solid univer-border-[rgba(13,13,13,0.06)] univer-p-0.5
|
|
28
|
+
hover:univer-ring-2 hover:univer-ring-offset-2 hover:univer-ring-offset-white
|
|
29
|
+
dark:!univer-border-[rgba(255,255,255,0.06)]
|
|
30
|
+
`,children:(0,d.jsx)(fe,{style:{color:e.color}})}),e.checked&&(0,d.jsx)(Ee,{})]},`sheets-filter-cell-text-color-${t}`))})]}),a.length<=1&&o.length<=1&&(0,d.jsx)(`div`,{className:`
|
|
31
|
+
univer-flex univer-size-full univer-items-center univer-justify-center univer-text-sm
|
|
32
|
+
univer-text-gray-900
|
|
33
|
+
dark:!univer-text-gray-200
|
|
34
|
+
`,children:r.t(`sheets-filter.panel.filter-by-color-none`)})]})})}function Ee(){return(0,d.jsx)(`div`,{className:`
|
|
35
|
+
univer-absolute -univer-bottom-0.5 -univer-right-0.5 univer-flex univer-size-3 univer-cursor-pointer
|
|
36
|
+
univer-items-center univer-justify-center univer-rounded-full univer-bg-white
|
|
37
|
+
`,children:(0,d.jsx)(be,{className:`univer-size-full univer-font-bold univer-text-[#418F1F]`})})}function De(e){var n,r;let{model:a}=e,o=(0,i.useDependency)(t.LocaleService),s=(0,i.useObservable)(a.conditionItem$,void 0),c=(0,i.useObservable)(a.filterConditionFormParams$,void 0),f=c!=null&&c.and?`AND`:`OR`,p=(0,u.useCallback)(e=>{a.onConditionFormChange({and:e===`AND`})},[a]),h=Oe(o),g=(0,u.useCallback)(e=>{a.onPrimaryConditionChange(e)},[a]),_=ke(o),v=(0,u.useCallback)(e=>{a.onConditionFormChange(e)},[a]),y=o.t(`sheets-filter.panel.input-values-placeholder`);function b(e,t,n){let r=m.getItemByOperator(e).numOfParameters===1;return(0,d.jsxs)(d.Fragment,{children:[n===`operator2`&&(0,d.jsxs)(l.RadioGroup,{value:f,onChange:p,children:[(0,d.jsx)(l.Radio,{value:`AND`,children:o.t(`sheets-filter.panel.and`)}),(0,d.jsx)(l.Radio,{value:`OR`,children:o.t(`sheets-filter.panel.or`)})]}),(0,d.jsx)(l.Select,{value:e,options:_,onChange:e=>v({[n]:e})}),r&&(0,d.jsx)(`div`,{children:(0,d.jsx)(l.Input,{className:`univer-mt-2`,value:t,placeholder:y,onChange:e=>v({[n===`operator1`?`val1`:`val2`]:e})})})]})}return(0,d.jsx)(`div`,{"data-u-comp":`sheets-filter-panel-conditions-container`,className:`univer-flex univer-h-full univer-min-h-[300px] univer-flex-col`,children:s&&c&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(l.Select,{value:s.operator,options:h,onChange:g}),m.getItemByOperator(s.operator).numOfParameters===0?null:(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel-conditions-container-inner`,className:(0,l.clsx)(`
|
|
38
|
+
univer-mt-2 univer-flex-grow univer-overflow-hidden univer-rounded-md univer-p-2
|
|
39
|
+
`,l.borderClassName),children:[s.numOfParameters>=1&&b(c.operator1,(n=c.val1)==null?``:n,`operator1`),s.numOfParameters>=2&&b(c.operator2,(r=c.val2)==null?``:r,`operator2`),(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel-conditions-desc`,className:`univer-mt-2 univer-text-xs univer-text-gray-500`,children:[o.t(`sheets-filter.panel.?`),(0,d.jsx)(`br`,{}),o.t(`sheets-filter.panel.*`)]})]})]})})}function Oe(e){return(0,u.useMemo)(()=>[{options:[{label:e.t(m.NONE.label),value:m.NONE.operator}]},{options:[{label:e.t(m.EMPTY.label),value:m.EMPTY.operator},{label:e.t(m.NOT_EMPTY.label),value:m.NOT_EMPTY.operator}]},{options:[{label:e.t(m.TEXT_CONTAINS.label),value:m.TEXT_CONTAINS.operator},{label:e.t(m.DOES_NOT_CONTAIN.label),value:m.DOES_NOT_CONTAIN.operator},{label:e.t(m.STARTS_WITH.label),value:m.STARTS_WITH.operator},{label:e.t(m.ENDS_WITH.label),value:m.ENDS_WITH.operator},{label:e.t(m.EQUALS.label),value:m.EQUALS.operator}]},{options:[{label:e.t(m.GREATER_THAN.label),value:m.GREATER_THAN.operator},{label:e.t(m.GREATER_THAN_OR_EQUAL.label),value:m.GREATER_THAN_OR_EQUAL.operator},{label:e.t(m.LESS_THAN.label),value:m.LESS_THAN.operator},{label:e.t(m.LESS_THAN_OR_EQUAL.label),value:m.LESS_THAN_OR_EQUAL.operator},{label:e.t(m.EQUAL.label),value:m.EQUAL.operator},{label:e.t(m.NOT_EQUAL.label),value:m.NOT_EQUAL.operator},{label:e.t(m.BETWEEN.label),value:m.BETWEEN.operator},{label:e.t(m.NOT_BETWEEN.label),value:m.NOT_BETWEEN.operator}]},{options:[{label:e.t(m.CUSTOM.label),value:m.CUSTOM.operator}]}],[e.getCurrentLocale(),e])}function ke(e){return(0,u.useMemo)(()=>m.ALL_CONDITIONS.filter(e=>e.numOfParameters!==2).map(t=>({label:e.t(t.label),value:t.operator})),[e.getCurrentLocale(),e])}function Ae(e){let{model:n}=e,r=(0,i.useDependency)(t.LocaleService),a=(0,i.useObservable)(n.searchString$,``,!0),o=(0,i.useObservable)(n.filterItems$,void 0,!0),s=r.t(`sheets-filter.panel.filter-only`),c=g(o),f=c.checked>0&&c.unchecked===0,p=c.checked>0&&c.unchecked>0,m=n.treeMapCache,h=(0,u.useCallback)(()=>{n.onCheckAllToggled(!f)},[n,f]),_=(0,u.useCallback)(e=>{n.setSearchString(e)},[n]);function v(e){let t=[];return e.forEach(e=>{e.checked&&t.push(e.key),e.children&&(t=t.concat(v(e.children)))}),t}return(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel-values-container`,className:`univer-flex univer-h-full univer-min-h-[300px] univer-flex-col`,children:[(0,d.jsx)(l.Input,{autoFocus:!0,value:a,placeholder:r.t(`sheets-filter.panel.search-placeholder`),onChange:_}),(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel`,className:(0,l.clsx)(`
|
|
40
|
+
univer-mt-2 univer-box-border univer-flex univer-flex-grow univer-flex-col univer-overflow-hidden
|
|
41
|
+
univer-rounded-md univer-px-2 univer-py-2.5
|
|
42
|
+
`,l.borderClassName),children:[(0,d.jsx)(`div`,{"data-u-comp":`sheets-filter-panel-values-item`,className:`univer-box-border univer-h-8 univer-w-full univer-py-0.5`,children:(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel-values-item-inner`,className:`
|
|
43
|
+
univer-box-border univer-flex univer-h-7 univer-items-center univer-rounded-md univer-py-0
|
|
44
|
+
univer-pl-5 univer-pr-0.5 univer-text-sm
|
|
45
|
+
`,children:[(0,d.jsx)(l.Checkbox,{indeterminate:p,disabled:o.length===0,checked:f,onChange:h}),(0,d.jsx)(`span`,{"data-u-comp":`sheets-filter-panel-values-item-text`,className:`
|
|
46
|
+
univer-mx-1 univer-inline-block univer-flex-shrink univer-truncate univer-text-gray-900
|
|
47
|
+
dark:!univer-text-white
|
|
48
|
+
`,children:`${r.t(`sheets-filter.panel.select-all`)}`}),(0,d.jsx)(`span`,{"data-u-comp":`sheets-filter-panel-values-item-count`,className:`
|
|
49
|
+
univer-text-gray-400
|
|
50
|
+
dark:!univer-text-gray-500
|
|
51
|
+
`,children:`(${c.checked}/${c.checked+c.unchecked})`})]})}),(0,d.jsx)(`div`,{"data-u-comp":`sheets-filter-panel-values-virtual`,className:`univer-flex-grow`,children:(0,d.jsx)(l.Tree,{data:o,defaultExpandAll:!1,valueGroup:v(o),onChange:e=>{n.onFilterCheckToggled(e)},defaultCache:m,itemHeight:28,treeNodeClassName:`
|
|
2
52
|
univer-pr-2 univer-border-box univer-rounded-md
|
|
3
53
|
[&:hover_a]:univer-inline-block
|
|
4
54
|
hover:univer-bg-gray-50 univer-h-full
|
|
5
55
|
univer-text-gray-900 dark:hover:!univer-bg-gray-900
|
|
6
56
|
dark:!univer-text-white
|
|
7
|
-
`,attachRender:
|
|
57
|
+
`,attachRender:e=>(0,d.jsxs)(`div`,{className:`
|
|
58
|
+
univer-ml-1 univer-flex univer-h-5 univer-flex-1 univer-cursor-pointer
|
|
59
|
+
univer-items-center univer-justify-between univer-text-sm univer-text-primary-500
|
|
60
|
+
`,children:[(0,d.jsx)(`span`,{"data-u-comp":`sheets-filter-panel-values-item-count`,className:`
|
|
61
|
+
univer-text-gray-400
|
|
62
|
+
dark:!univer-text-gray-500
|
|
63
|
+
`,children:`(${e.count})`}),(0,d.jsx)(`a`,{className:`
|
|
64
|
+
univer-box-border univer-hidden univer-h-4 univer-whitespace-nowrap univer-px-1.5
|
|
65
|
+
`,onClick:()=>{let t=[];e.children?e.children.forEach(e=>{e.children?e.children.forEach(e=>{t.push(e.key)}):t.push(e.key)}):t.push(e.key),n.onFilterOnly(t)},children:s})]})})})]})]})}function je(){let e=(0,i.useDependency)(n.SheetsFilterSyncController);if(!(0,i.useObservable)(e.visible$,void 0,!0))return null;let r=(0,i.useDependency)(t.LocaleService),a=(0,i.useDependency)(i.IMessageService),o=(0,i.useObservable)(e.enabled$,void 0,!0);return(0,d.jsxs)(`div`,{className:`
|
|
66
|
+
univer-mt-2 univer-flex univer-items-center univer-justify-between univer-text-sm univer-text-gray-900
|
|
67
|
+
dark:!univer-text-gray-200
|
|
68
|
+
`,children:[(0,d.jsxs)(`div`,{className:`univer-flex univer-items-center univer-gap-1`,children:[(0,d.jsx)(`span`,{children:r.t(`sheets-filter.sync.title`)}),(0,d.jsx)(l.Tooltip,{title:o?r.t(`sheets-filter.sync.statusTips.off`):r.t(`sheets-filter.sync.statusTips.on`),asChild:!0,children:(0,d.jsx)(ve,{className:`univer-block`})})]}),(0,d.jsx)(l.Switch,{defaultChecked:o,onChange:t=>{let n=t?r.t(`sheets-filter.sync.switchTips.on`):r.t(`sheets-filter.sync.switchTips.off`);e.setEnabled(t),a.show({content:n,type:l.MessageType.Success,duration:2e3})}})]})}function Me(){var e;let a=(0,i.useDependency)(P),o=(0,i.useDependency)(t.LocaleService),c=(0,i.useDependency)(t.ICommandService),f=(0,i.useObservable)(a.filterBy$,void 0,!0),p=(0,i.useObservable)(a.filterByModel$,void 0,!1),m=(0,i.useObservable)(()=>(p==null?void 0:p.canApply$)||(0,s.of)(!1),void 0,!1,[p]),h=Ne(o),g=!(0,i.useObservable)(a.hasCriteria$),_=(0,u.useCallback)(e=>{c.executeCommand(B.id,{filterBy:e})},[c]),v=(0,u.useCallback)(async()=>{await(p==null?void 0:p.clear()),c.executeCommand(z.id)},[p,c]),y=(0,u.useCallback)(()=>{c.executeCommand(z.id)},[c]),b=(0,u.useCallback)(async()=>{await(p==null?void 0:p.apply()),c.executeCommand(z.id)},[p,c]),x=(e=(0,i.useDependency)(n.SheetsFilterService).activeFilterModel)==null?void 0:e.getRange(),S=a.col,C=(0,i.useComponentsOfPart)(r.SheetsUIPart.FILTER_PANEL_EMBED_POINT);return(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel`,className:`
|
|
69
|
+
univer-box-border univer-flex univer-max-h-[500px] univer-w-[400px] univer-flex-col univer-rounded-lg
|
|
70
|
+
univer-bg-white univer-p-4 univer-shadow-lg
|
|
71
|
+
dark:!univer-border-gray-600 dark:!univer-bg-gray-700
|
|
72
|
+
`,children:[(0,d.jsx)(i.ComponentContainer,{components:C,sharedProps:{range:x,colIndex:S,onClose:y}}),(0,d.jsx)(`div`,{className:`univer-mb-1 univer-flex-shrink-0 univer-flex-grow-0`,children:(0,d.jsx)(l.Segmented,{value:f,items:h,onChange:e=>_(e)})}),p?(0,d.jsx)(`div`,{"data-u-comp":`sheets-filter-panel-content`,className:`univer-flex-shrink univer-flex-grow univer-pt-2`,children:f===n.FilterBy.VALUES?(0,d.jsx)(Ae,{model:p}):f===n.FilterBy.COLORS?(0,d.jsx)(Te,{model:p}):(0,d.jsx)(De,{model:p})}):(0,d.jsx)(`div`,{className:`univer-flex-1`}),(0,d.jsx)(je,{}),(0,d.jsxs)(`div`,{"data-u-comp":`sheets-filter-panel-footer`,className:`
|
|
73
|
+
univer-mt-4 univer-inline-flex univer-flex-shrink-0 univer-flex-grow-0 univer-flex-nowrap
|
|
74
|
+
univer-justify-between univer-overflow-hidden
|
|
75
|
+
`,children:[(0,d.jsx)(l.Button,{variant:`link`,onClick:v,disabled:g,children:o.t(`sheets-filter.panel.clear-filter`)}),(0,d.jsxs)(`span`,{className:`univer-flex univer-gap-2`,children:[(0,d.jsx)(l.Button,{variant:`default`,onClick:y,children:o.t(`sheets-filter.panel.cancel`)}),(0,d.jsx)(l.Button,{disabled:!m,variant:`primary`,onClick:b,children:o.t(`sheets-filter.panel.confirm`)})]})]})]})}function Ne(e){return(0,u.useMemo)(()=>[{label:e.t(`sheets-filter.panel.by-values`),value:n.FilterBy.VALUES},{label:e.t(`sheets-filter.panel.by-colors`),value:n.FilterBy.COLORS},{label:e.t(`sheets-filter.panel.by-conditions`),value:n.FilterBy.CONDITIONS}],[e.getCurrentLocale(),e])}let Pe={id:n.SmartToggleSheetsFilterCommand.id,binding:i.KeyCode.L|i.MetaKeys.CTRL_COMMAND|i.MetaKeys.SHIFT,description:`sheets-filter.shortcut.smart-toggle-filter`,preconditions:r.whenSheetEditorFocused,group:`4_sheet-edit`},Fe=`FILTER_PANEL_POPUP`,Z=class extends J{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(f,d),this._injector=e,this._componentManager=t,this._sheetsFilterPanelService=n,this._sheetCanvasPopupService=r,this._sheetsFilterService=i,this._localeService=a,this._shortcutService=o,this._commandService=s,this._menuManagerService=c,this._contextService=l,this._messageService=u,A(this,`_popupDisposable`,void 0),this._initCommands(),this._initShortcuts(),this._initMenuItems(),this._initUI()}dispose(){super.dispose(),this._closeFilterPopup()}_initShortcuts(){[Pe].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}_initCommands(){[n.SmartToggleSheetsFilterCommand,n.RemoveSheetFilterCommand,n.SetSheetFilterRangeCommand,n.SetSheetsFilterCriteriaCommand,n.ClearSheetsFilterCriteriaCommand,n.ReCalcSheetsFilterCommand,B,R,z].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))})}_initMenuItems(){this._menuManagerService.mergeMenu(we)}_initUI(){[[Fe,Me],[`FilterIcon`,ge]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))}),this.disposeWithMe(this._contextService.subscribeContextValue$(L).pipe((0,s.distinctUntilChanged)()).subscribe(e=>{e?this._openFilterPopup():this._closeFilterPopup()})),this.disposeWithMe(this._sheetsFilterService.errorMsg$.subscribe(e=>{e&&this._messageService.show({type:l.MessageType.Error,content:this._localeService.t(e)})}))}_openFilterPopup(){let e=this._sheetsFilterPanelService.filterModel;if(!e)throw Error(`[SheetsFilterUIController]: no filter model when opening filter popup!`);let t=e.getRange(),n=this._sheetsFilterPanelService.col,{startRow:r}=t;this._popupDisposable=this._sheetCanvasPopupService.attachPopupToCell(r,n,{componentKey:Fe,direction:`horizontal`,onClickOutside:()=>this._commandService.syncExecuteCommand(z.id),offset:[5,0]})}_closeFilterPopup(){var e;(e=this._popupDisposable)==null||e.dispose(),this._popupDisposable=null}};Z=v([_(0,(0,t.Inject)(t.Injector)),_(1,(0,t.Inject)(i.ComponentManager)),_(2,(0,t.Inject)(P)),_(3,(0,t.Inject)(r.SheetCanvasPopManagerService)),_(4,(0,t.Inject)(n.SheetsFilterService)),_(5,(0,t.Inject)(t.LocaleService)),_(6,i.IShortcutService),_(7,t.ICommandService),_(8,i.IMenuManagerService),_(9,t.IContextService),_(10,i.IMessageService),_(11,(0,t.Inject)(r.SheetsRenderService)),_(12,a.IRenderManagerService)],Z);let Q=class extends t.Plugin{constructor(e=W,n,r,i){super(),this._config=e,this._injector=n,this._configService=r,this._rpcChannelService=i;let{menu:a,...o}=(0,t.merge)({},W,this._config);a&&this._configService.setConfig(`menu`,a,{merge:!0}),this._configService.setConfig(U,o)}onStarting(){(0,t.registerDependencies)(this._injector,[[P],[G],[Z]]),this._config.useRemoteFilterValuesGenerator&&this._rpcChannelService&&this._injector.add([b,{useFactory:()=>(0,c.toModule)(this._rpcChannelService.requestChannel(y))}])}onReady(){(0,t.touchDependencies)(this._injector,[[G]])}onRendered(){(0,t.touchDependencies)(this._injector,[[Z]])}};A(Q,`type`,t.UniverInstanceType.UNIVER_SHEET),A(Q,`pluginName`,`SHEET_FILTER_UI_PLUGIN`),A(Q,`packageName`,V),A(Q,`version`,H),Q=v([(0,t.DependentOn)(n.UniverSheetsFilterPlugin),_(1,(0,t.Inject)(t.Injector)),_(2,t.IConfigService),_(3,(0,t.Optional)(c.IRPCChannelService))],Q);let $=class extends t.Plugin{constructor(e,t,n){super(),this._config=e,this._injector=t,this._rpcChannelService=n}onStarting(){[[b,{useClass:x}]].forEach(e=>this._injector.add(e))}onReady(){this._rpcChannelService.registerChannel(y,(0,c.fromModule)(this._injector.get(b)))}};A($,`type`,t.UniverInstanceType.UNIVER_SHEET),A($,`pluginName`,`SHEET_FILTER_UI_WORKER_PLUGIN`),A($,`packageName`,V),A($,`version`,H),$=v([_(1,(0,t.Inject)(t.Injector)),_(2,c.IRPCChannelService)],$),e.ChangeFilterByOperation=B,e.CloseFilterPanelOperation=z,e.OpenFilterPanelOperation=R,Object.defineProperty(e,`UniverSheetsFilterMobileUIPlugin`,{enumerable:!0,get:function(){return Y}}),Object.defineProperty(e,`UniverSheetsFilterUIPlugin`,{enumerable:!0,get:function(){return Q}}),Object.defineProperty(e,`UniverSheetsFilterUIWorkerPlugin`,{enumerable:!0,get:function(){return $}})});
|
package/lib/umd/locale/ca-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiCaES=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`Alterna el filtre`,"clear-filter-criteria":`Neteja les condicions del filtre`,"re-calc-filter-conditions":`Recalcula les condicions del filtre`},command:{"not-valid-filter-range":`L’interval seleccionat només té una fila i no és vàlid per filtrar.`},shortcut:{"smart-toggle-filter":`Alterna el filtre`},panel:{"clear-filter":`Neteja el filtre`,cancel:`Cancel·la`,confirm:`Confirma`,"by-values":`Per valors`,"by-colors":`Per colors`,"filter-by-cell-fill-color":`Filtra per color de fons de la cel·la`,"filter-by-cell-text-color":`Filtra per color de text de la cel·la`,"filter-by-color-none":`La columna només conté un color`,"by-conditions":`Per condicions`,"filter-only":`Només filtra`,"search-placeholder":`Utilitza espai per separar paraules clau`,"select-all":`Selecciona-ho tot`,"input-values-placeholder":`Introdueix valors`,and:`I`,or:`O`,empty:`(buit)`,"?":`Utilitza “?” per representar un sol caràcter.`,"*":`Utilitza “*” per representar diversos caràcters.`},conditions:{none:`Cap`,empty:`Està buit`,"not-empty":`No està buit`,"text-contains":`El text conté`,"does-not-contain":`El text no conté`,"starts-with":`El text comença amb`,"ends-with":`El text acaba amb`,equals:`El text és igual a`,"greater-than":`Més gran que`,"greater-than-or-equal":`Més gran o igual que`,"less-than":`Menys que`,"less-than-or-equal":`Menys o igual que`,equal:`Igual`,"not-equal":`No igual`,between:`Entre`,"not-between":`No entre`,custom:`Personalitzat`},msg:{"filter-header-forbidden":`No pots moure la fila de capçalera d’un filtre.`},date:{1:`Gener`,2:`Febrer`,3:`Març`,4:`Abril`,5:`Maig`,6:`Juny`,7:`Juliol`,8:`Agost`,9:`Setembre`,10:`Octubre`,11:`Novembre`,12:`Desembre`},sync:{title:`El filtre és visible per a tothom`,statusTips:{on:`Un cop activat, tots els col·laboradors veuran els resultats del filtre`,off:`Un cop desactivat, només tu veuràs els resultats del filtre`},switchTips:{on:`S’ha activat "El filtre és visible per a tothom", tots els col·laboradors veuran els resultats del filtre`,off:`S’ha desactivat "El filtre és visible per a tothom", només tu veuràs els resultats del filtre`}}}}});
|
package/lib/umd/locale/en-US.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiEnUS=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`Toggle Filter`,"clear-filter-criteria":`Clear Filter Conditions`,"re-calc-filter-conditions":`Re-calc Filter Conditions`},command:{"not-valid-filter-range":`The selected range only has one row and not valid for filter.`},shortcut:{"smart-toggle-filter":`Toggle Filter`},panel:{"clear-filter":`Clear Filter`,cancel:`Cancel`,confirm:`Confirm`,"by-values":`By Values`,"by-colors":`By Colors`,"filter-by-cell-fill-color":`Filter by cell fill color`,"filter-by-cell-text-color":`Filter by cell text color`,"filter-by-color-none":`The column contains only one color`,"by-conditions":`By Conditions`,"filter-only":`Filter Only`,"search-placeholder":`Use space to separate keywords`,"select-all":`Select All`,"input-values-placeholder":`Input Values`,and:`AND`,or:`OR`,empty:`(empty)`,"?":`Use “?” to represent a single character.`,"*":`Use “*” to represent multiple characters.`},conditions:{none:`None`,empty:`Is Empty`,"not-empty":`Is Not Empty`,"text-contains":`Text Contains`,"does-not-contain":`Text Does Not Contain`,"starts-with":`Text Starts With`,"ends-with":`Text Ends With`,equals:`Text Equals`,"greater-than":`Greater Than`,"greater-than-or-equal":`Greater Than Or Equal To`,"less-than":`Less Than`,"less-than-or-equal":`Less Than Or Equal To`,equal:`Equal`,"not-equal":`Not Equal`,between:`Between`,"not-between":`Not Between`,custom:`Custom`},msg:{"filter-header-forbidden":`You can't move the header row of a filter.`},date:{1:`January`,2:`February`,3:`March`,4:`April`,5:`May`,6:`June`,7:`July`,8:`August`,9:`September`,10:`October`,11:`November`,12:`December`},sync:{title:`Filter is visible to everyone`,statusTips:{on:`Once on, all collaborators will see the filter results`,off:`Once off, only you will see the filter results`},switchTips:{on:`"Filter is visible to everyone" is turned on, all collaborators will see the filter results`,off:`"Filter is visible to everyone" is turned off, only you will see the filter results`}}}}});
|
package/lib/umd/locale/es-ES.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiEsES=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`Alternar filtro`,"clear-filter-criteria":`Borrar condiciones de filtro`,"re-calc-filter-conditions":`Recalcular condiciones de filtro`},command:{"not-valid-filter-range":`El rango seleccionado solo tiene una fila y no es válido para filtrar.`},shortcut:{"smart-toggle-filter":`Alternar filtro`},panel:{"clear-filter":`Borrar filtro`,cancel:`Cancelar`,confirm:`Confirmar`,"by-values":`Por valores`,"by-colors":`Por colores`,"filter-by-cell-fill-color":`Filtrar por color de relleno de celda`,"filter-by-cell-text-color":`Filtrar por color de texto de celda`,"filter-by-color-none":`La columna contiene solo un color`,"by-conditions":`Por condiciones`,"filter-only":`Solo filtrar`,"search-placeholder":`Usa espacio para separar palabras clave`,"select-all":`Seleccionar todo`,"input-values-placeholder":`Introducir valores`,and:`Y`,or:`O`,empty:`(vacío)`,"?":`Usa “?” para representar un solo carácter.`,"*":`Usa “*” para representar varios caracteres.`},conditions:{none:`Ninguno`,empty:`Está vacío`,"not-empty":`No está vacío`,"text-contains":`El texto contiene`,"does-not-contain":`El texto no contiene`,"starts-with":`El texto comienza con`,"ends-with":`El texto termina con`,equals:`El texto es igual a`,"greater-than":`Mayor que`,"greater-than-or-equal":`Mayor o igual que`,"less-than":`Menor que`,"less-than-or-equal":`Menor o igual que`,equal:`Igual`,"not-equal":`No igual`,between:`Entre`,"not-between":`No entre`,custom:`Personalizado`},msg:{"filter-header-forbidden":`No puedes mover la fila de encabezado de un filtro.`},date:{1:`Enero`,2:`Febrero`,3:`Marzo`,4:`Abril`,5:`Mayo`,6:`Junio`,7:`Julio`,8:`Agosto`,9:`Septiembre`,10:`Octubre`,11:`Noviembre`,12:`Diciembre`},sync:{title:`El filtro es visible para todos`,statusTips:{on:`Una vez activado, todos los colaboradores verán los resultados del filtro`,off:`Una vez desactivado, solo tú verás los resultados del filtro`},switchTips:{on:`"El filtro es visible para todos" está activado, todos los colaboradores verán los resultados del filtro`,off:`"El filtro es visible para todos" está desactivado, solo tú verás los resultados del filtro`}}}}});
|
package/lib/umd/locale/fa-IR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiFaIR=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`تغییر حالت فیلتر`,"clear-filter-criteria":`پاک کردن شرایط فیلتر`,"re-calc-filter-conditions":`بازمحاسبه شرایط فیلتر`},command:{"not-valid-filter-range":`محدوده انتخاب شده فقط یک ردیف دارد و برای فیلتر معتبر نیست.`},shortcut:{"smart-toggle-filter":`تغییر حالت فیلتر`},panel:{"clear-filter":`پاک کردن فیلتر`,cancel:`انصراف`,confirm:`تایید`,"by-values":`بر اساس مقادیر`,"by-colors":`بر اساس رنگها`,"filter-by-cell-fill-color":`فیلتر بر اساس رنگ پر کردن سلول`,"filter-by-cell-text-color":`فیلتر بر اساس رنگ متن سلول`,"filter-by-color-none":`این ستون فقط شامل یک رنگ است`,"by-conditions":`بر اساس شرایط`,"filter-only":`فقط فیلتر`,"search-placeholder":`برای جداسازی کلیدواژهها از فاصله استفاده کنید`,"select-all":`انتخاب همه`,"input-values-placeholder":`ورود مقادیر`,and:`و`,or:`یا`,empty:`(خالی)`,"?":`برای نمایش یک کاراکتر از “?” استفاده کنید.`,"*":`برای نمایش چندین کاراکتر از “*” استفاده کنید.`},conditions:{none:`هیچ کدام`,empty:`خالی است`,"not-empty":`خالی نیست`,"text-contains":`شامل متن است`,"does-not-contain":`شامل متن نیست`,"starts-with":`با متن شروع میشود`,"ends-with":`با متن پایان مییابد`,equals:`برابر است با`,"greater-than":`بزرگتر از`,"greater-than-or-equal":`بزرگتر از یا برابر با`,"less-than":`کوچکتر از`,"less-than-or-equal":`کوچکتر از یا برابر با`,equal:`برابر است با`,"not-equal":`برابر نیست با`,between:`بین`,"not-between":`بین نیست`,custom:`سفارشی`},msg:{"filter-header-forbidden":`شما نمیتوانید ردیف هدر یک فیلتر را جابهجا کنید.`},date:{1:`ژانویه`,2:`فوریه`,3:`مارس`,4:`آوریل`,5:`مه`,6:`ژوئن`,7:`جولای`,8:`آگوست`,9:`سپتامبر`,10:`اکتبر`,11:`نوامبر`,12:`دسامبر`},sync:{title:`فیلتر برای همه قابل مشاهده است`,statusTips:{on:`پس از روشن شدن، همه همکاران نتایج فیلتر را مشاهده خواهند کرد`,off:`پس از خاموش شدن، فقط شما نتایج فیلتر را مشاهده خواهید کرد`},switchTips:{on:`گزینه "فیلتر برای همه قابل مشاهده است" روشن است، همه همکاران نتایج فیلتر را مشاهده خواهند کرد`,off:`گزینه "فیلتر برای همه قابل مشاهده است" خاموش است، فقط شما نتایج فیلتر را مشاهده خواهید کرد`}}}}});
|
package/lib/umd/locale/fr-FR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiFrFR=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`Inverser le filtre`,"clear-filter-criteria":`Effacer les conditions de filtre`,"re-calc-filter-conditions":`Recalculer les conditions de filtre`},command:{"not-valid-filter-range":`La plage sélectionnée n'a qu'une seule ligne et n'est pas valide pour le filtre.`},shortcut:{"smart-toggle-filter":`Inverser le filtre`},panel:{"clear-filter":`Effacer le filtre`,cancel:`Annuler`,confirm:`Confirmer`,"by-values":`Par valeurs`,"by-colors":`Par couleurs`,"filter-by-cell-fill-color":`Filtrer par couleur de remplissage de cellule`,"filter-by-cell-text-color":`Filtrer par couleur de texte de cellule`,"filter-by-color-none":`Cette colonne ne contient qu'une seule couleur`,"by-conditions":`Par conditions`,"filter-only":`Filtrer uniquement`,"search-placeholder":`Utilisez un espace pour séparer les mots-clés`,"select-all":`Tout sélectionner`,"input-values-placeholder":`Saisir des valeurs`,and:`ET`,or:`OU`,empty:`(vide)`,"?":`Utilisez “?” pour représenter un seul caractère.`,"*":`Utilisez “*” pour représenter plusieurs caractères.`},conditions:{none:`Aucun`,empty:`Est vide`,"not-empty":`N'est pas vide`,"text-contains":`Le texte contient`,"does-not-contain":`Le texte ne contient pas`,"starts-with":`Le texte commence par`,"ends-with":`Le texte se termine par`,equals:`Le texte est égal à`,"greater-than":`Supérieur à`,"greater-than-or-equal":`Supérieur ou égal à`,"less-than":`Inférieur à`,"less-than-or-equal":`Inférieur ou égal à`,equal:`Égal à`,"not-equal":`Différent de`,between:`Entre`,"not-between":`Pas entre`,custom:`Personnalisé`},msg:{"filter-header-forbidden":`Vous ne pouvez pas déplacer la ligne d'en-tête d'un filtre.`},date:{1:`Jan`,2:`Fév`,3:`Mar`,4:`Avr`,5:`Mai`,6:`Juin`,7:`Juil`,8:`Août`,9:`Sept`,10:`Oct`,11:`Nov`,12:`Déc`},sync:{title:`Le filtre est visible par tous`,statusTips:{on:`Une fois activé, tous les collaborateurs verront les résultats du filtre`,off:`Une fois désactivé, seul vous verrez les résultats du filtre`},switchTips:{on:`“Le filtre est visible par tous” est activé, tous les collaborateurs verront les résultats du filtre`,off:`“Le filtre est visible par tous” est désactivé, seul vous verrez les résultats du filtre`}}}}});
|
package/lib/umd/locale/ja-JP.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiJaJP=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`フィルタの切替`,"clear-filter-criteria":`フィルタ条件をクリア`,"re-calc-filter-conditions":`フィルタ条件を再計算`},command:{"not-valid-filter-range":`選択範囲に1行しか含まれていないため、フィルタを適用できません。`},shortcut:{"smart-toggle-filter":`フィルタの切替`},panel:{"clear-filter":`フィルタをクリア`,cancel:`キャンセル`,confirm:`確認`,"by-values":`値でフィルタ`,"by-colors":`色でフィルタ`,"filter-by-cell-fill-color":`セルの塗りつぶし色でフィルタ`,"filter-by-cell-text-color":`セルの文字色でフィルタ`,"filter-by-color-none":`この列は単一の色のみを含んでいます`,"by-conditions":`条件でフィルタ`,"filter-only":`フィルタのみ表示`,"search-placeholder":`検索語はスペースで区切る`,"select-all":`すべて選択`,"input-values-placeholder":`値を入力`,and:`AND`,or:`OR`,empty:`(空白)`,"?":`「?」は任意の1文字`,"*":`「*」は任意の複数文字`},conditions:{none:`なし`,empty:`空白セル`,"not-empty":`空白ではない`,"text-contains":`文字列を含む`,"does-not-contain":`文字列を含まない`,"starts-with":`前方一致`,"ends-with":`後方一致`,equals:`一致`,"greater-than":`より大きい`,"greater-than-or-equal":`以上`,"less-than":`より小さい`,"less-than-or-equal":`以下`,equal:`等しい`,"not-equal":`等しくない`,between:`範囲内`,"not-between":`範囲外`,custom:`カスタム`},msg:{"filter-header-forbidden":`フィルタヘッダー行は移動できません。`},date:{1:`1月`,2:`2月`,3:`3月`,4:`4月`,5:`5月`,6:`6月`,7:`7月`,8:`8月`,9:`9月`,10:`10月`,11:`11月`,12:`12月`},sync:{title:`フィルタを全員が表示可能`,statusTips:{on:`有効にすると、すべての共同作業者がフィルタ結果を表示できます。`,off:`無効にすると、自分のみフィルタ結果を表示できます。`},switchTips:{on:`「フィルタを全員が表示可能」が有効な場合、すべての共同作業者がフィルタ結果を表示できます。`,off:`「フィルタを全員が表示可能」が無効な場合、自分のみフィルタ結果を表示できます。`}}}}});
|
package/lib/umd/locale/ko-KR.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(e,t){typeof exports
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?module.exports=t():typeof define==`function`&&define.amd?define([],t):(e=typeof globalThis<`u`?globalThis:e||self,e.UniverSheetsFilterUiKoKR=t())})(this,function(){return{"sheets-filter":{toolbar:{"smart-toggle-filter-tooltip":`필터 토글`,"clear-filter-criteria":`필터 조건 지우기`,"re-calc-filter-conditions":`필터 조건 재계산`},command:{"not-valid-filter-range":`선택한 범위에 한 행만 있어 필터를 적용할 수 없습니다.`},shortcut:{"smart-toggle-filter":`필터 토글`},panel:{"clear-filter":`필터 지우기`,cancel:`취소`,confirm:`확인`,"by-values":`값으로 필터`,"by-colors":`색상으로 필터`,"filter-by-cell-fill-color":`셀 채우기 색상으로 필터`,"filter-by-cell-text-color":`셀 텍스트 색상으로 필터`,"filter-by-color-none":`이 열은 단일 색상만 포함합니다`,"by-conditions":`조건으로 필터`,"filter-only":`필터만 보기`,"search-placeholder":`검색어는 공백으로 구분`,"select-all":`전체 선택`,"input-values-placeholder":`값 입력`,and:`AND`,or:`OR`,empty:`(빈 값)`,"?":`“?”는 임의의 한 문자`,"*":`“*”는 임의의 여러 문자`},conditions:{none:`없음`,empty:`빈 셀`,"not-empty":`빈 셀 아님`,"text-contains":`텍스트 포함`,"does-not-contain":`텍스트 미포함`,"starts-with":`텍스트 시작`,"ends-with":`텍스트 끝`,equals:`텍스트 일치`,"greater-than":`크다`,"greater-than-or-equal":`크거나 같다`,"less-than":`작다`,"less-than-or-equal":`작거나 같다`,equal:`같음`,"not-equal":`같지 않음`,between:`범위 내`,"not-between":`범위 밖`,custom:`사용자 지정`},msg:{"filter-header-forbidden":`필터 헤더 행은 이동할 수 없습니다.`},date:{1:`1월`,2:`2월`,3:`3월`,4:`4월`,5:`5월`,6:`6월`,7:`7월`,8:`8월`,9:`9월`,10:`10월`,11:`11월`,12:`12월`},sync:{title:`필터를 모든 사용자가 볼 수 있음`,statusTips:{on:`활성화하면 모든 협업자가 필터 결과를 볼 수 있습니다.`,off:`비활성화하면 나만 필터 결과를 볼 수 있습니다.`},switchTips:{on:`"필터를 모든 사용자가 볼 수 있음"이 활성화되어 모든 협업자가 필터 결과를 볼 수 있습니다.`,off:`"필터를 모든 사용자가 볼 수 있음"이 비활성화되어 나만 필터 결과를 볼 수 있습니다.`}}}}});
|