@tachybase/plugin-full-text-search 0.23.35 → 0.23.40

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.
@@ -1 +1 @@
1
- (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("antd"),require("lodash")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","antd","lodash"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@tachybase/plugin-full-text-search"]={},t["@tachybase/client"],t.jsxRuntime,t.antd,t.lodash))})(this,function(t,e,a,d,f){"use strict";var w=Object.defineProperty,T=Object.defineProperties;var V=Object.getOwnPropertyDescriptors;var C=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,P=Object.prototype.propertyIsEnumerable;var j=(t,e,a)=>e in t?w(t,e,{enumerable:!0,configurable:!0,writable:!0,value:a}):t[e]=a,y=(t,e)=>{for(var a in e||(e={}))M.call(e,a)&&j(t,a,e[a]);if(C)for(var a of C(e))P.call(e,a)&&j(t,a,e[a]);return t},x=(t,e)=>T(t,V(e));var q=(t,e,a)=>new Promise((d,f)=>{var z=r=>{try{u(a.next(r))}catch(p){f(p)}},S=r=>{try{u(a.throw(r))}catch(p){f(p)}},u=r=>r.done?d(r.value):Promise.resolve(r.value).then(z,S);u((a=a.apply(t,e)).next())});const z={type:"void",name:"fuzzy-search-action","x-action":"fuzzy-search-action","x-component":"FuzzySearchInput"},S=n=>a.jsx(e.ActionInitializer,x(y({},n),{schema:z})),u="@tachybase/plugin-full-text-search",r=()=>({t:(s,c={})=>e.i18n.t(s,y({ns:u},c))}),g={name:"enableActions.fuzzySearch",type:"item",title:(n=>e.tval(n,{ns:u}))("Full fuzzy search"),Component:S,schema:{"x-align":"left"}},A=()=>{const{handleSearch:n,handleValueChange:s}=I(),{t:c}=r();return a.jsx(d.Space.Compact,{style:{width:300},children:a.jsx(d.Input.Search,{placeholder:c("Full fuzzy search"),allowClear:!0,onSearch:n,onChange:s})})};function I(){const n=e.useDataBlockRequest(),s=e.useDataBlockProps(),c=i=>{var l;F({queryValue:i.trim(),defaultFilter:(l=s==null?void 0:s.params)==null?void 0:l.filter,service:n})},m=f.debounce(i=>{var o,h;((o=i.target)==null?void 0:o.value)||F({queryValue:"",defaultFilter:(h=s==null?void 0:s.params)==null?void 0:h.filter,service:n})});return{handleSearch:c,handleValueChange:m}}function F({queryValue:n,defaultFilter:s,service:c}){var o,h,v;const m=((h=(o=c.params)==null?void 0:o[1])==null?void 0:h.filters)||{},i=e.mergeFilter([...Object.values(m),s]),l=x(y({},(v=c.params)==null?void 0:v[0]),{filter:i,search:{keywords:[n]}});c.run(l,{filters:m})}class b extends e.Plugin{load(){return q(this,null,function*(){this.app.addComponents({FuzzySearchInput:A}),this.app.schemaInitializerManager.addItem("table:configureActions",g.name,g)})}}t.default=b,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
1
+ (function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("@tachybase/client"),require("react/jsx-runtime"),require("antd")):typeof define=="function"&&define.amd?define(["exports","@tachybase/client","react/jsx-runtime","antd"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t["@tachybase/plugin-full-text-search"]={},t["@tachybase/client"],t.jsxRuntime,t.antd))})(this,function(t,e,n,o){"use strict";var C=Object.defineProperty,P=Object.defineProperties;var T=Object.getOwnPropertyDescriptors;var F=Object.getOwnPropertySymbols;var w=Object.prototype.hasOwnProperty,M=Object.prototype.propertyIsEnumerable;var g=(t,e,n)=>e in t?C(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,p=(t,e)=>{for(var n in e||(e={}))w.call(e,n)&&g(t,n,e[n]);if(F)for(var n of F(e))M.call(e,n)&&g(t,n,e[n]);return t},y=(t,e)=>P(t,T(e));var b=(t,e,n)=>new Promise((o,l)=>{var m=r=>{try{u(n.next(r))}catch(c){l(c)}},h=r=>{try{u(n.throw(r))}catch(c){l(c)}},u=r=>r.done?o(r.value):Promise.resolve(r.value).then(m,h);u((n=n.apply(t,e)).next())});const l={type:"void",name:"fuzzy-search-action","x-action":"fuzzy-search-action","x-component":"FuzzySearchInput"},m=a=>n.jsx(e.ActionInitializer,y(p({},a),{schema:l})),h="@tachybase/plugin-full-text-search",u=()=>({t:(s,i={})=>e.i18n.t(s,p({ns:h},i))}),c={name:"enableActions.fuzzySearch",type:"item",title:(a=>e.tval(a,{ns:h}))("Full fuzzy search"),Component:m,schema:{"x-align":"left"}},j=()=>{const{handleSearch:a}=A(),{t:s}=u();return n.jsx(o.Space.Compact,{style:{width:300},children:n.jsx(o.Input.Search,{placeholder:s("Full fuzzy search"),onSearch:a})})};function A(){const a=e.useDataBlockRequest(),s=e.useDataBlockProps();return{handleSearch:d=>{var f;I({queryValue:d.trim(),defaultFilter:(f=s==null?void 0:s.params)==null?void 0:f.filter,service:a})}}}function I({queryValue:a,defaultFilter:s,service:i}){var z,S,x;const d=((S=(z=i.params)==null?void 0:z[1])==null?void 0:S.filters)||{},f=e.mergeFilter([...Object.values(d),s]),q=y(p({},(x=i.params)==null?void 0:x[0]),{filter:f,search:{keywords:[a]}});i.run(q,{filters:d})}class v extends e.Plugin{load(){return b(this,null,function*(){this.app.addComponents({FuzzySearchInput:j}),this.app.schemaInitializerManager.addItem("table:configureActions",c.name,c)})}}t.default=v,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
@@ -1,8 +1,8 @@
1
1
  module.exports = {
2
- "@tachybase/client": "0.23.35",
2
+ "@tachybase/client": "0.23.40",
3
3
  "antd": "5.22.5",
4
4
  "lodash": "4.17.21",
5
- "@tachybase/actions": "0.23.35",
6
- "@tachybase/database": "0.23.35",
7
- "@tachybase/server": "0.23.35"
5
+ "@tachybase/actions": "0.23.40",
6
+ "@tachybase/database": "0.23.40",
7
+ "@tachybase/server": "0.23.40"
8
8
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tachybase/plugin-full-text-search",
3
- "version": "0.23.35",
3
+ "version": "0.23.40",
4
4
  "description": "Provides full text search capability",
5
5
  "main": "dist/server/index.js",
6
6
  "devDependencies": {
@@ -8,11 +8,11 @@
8
8
  "lodash": "4.17.21"
9
9
  },
10
10
  "peerDependencies": {
11
- "@tachybase/actions": "0.23.35",
12
- "@tachybase/client": "0.23.35",
13
- "@tachybase/server": "0.23.35",
14
- "@tachybase/database": "0.23.35",
15
- "@tachybase/test": "0.23.35"
11
+ "@tachybase/actions": "0.23.40",
12
+ "@tachybase/server": "0.23.40",
13
+ "@tachybase/test": "0.23.40",
14
+ "@tachybase/client": "0.23.40",
15
+ "@tachybase/database": "0.23.40"
16
16
  },
17
17
  "description.zh-CN": "提供全字段搜索能力",
18
18
  "displayName.zh-CN": "全文搜索"