@nocobase/plugin-field-sort 2.1.0-beta.36 → 2.1.0-beta.37

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/client-v2.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export * from './dist/client-v2';
2
+ export { default } from './dist/client-v2';
package/client-v2.js ADDED
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/client-v2/index.js');
@@ -8,8 +8,6 @@
8
8
  */
9
9
  import { Plugin } from '@nocobase/client';
10
10
  export declare class PluginFieldSortClient extends Plugin {
11
- afterAdd(): Promise<void>;
12
- beforeLoad(): Promise<void>;
13
11
  load(): Promise<void>;
14
12
  }
15
13
  export default PluginFieldSortClient;
@@ -7,4 +7,4 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("antd"),require("react"),require("@nocobase/client"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-sort",["antd","react","@nocobase/client","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-field-sort"]=t(require("antd"),require("react"),require("@nocobase/client"),require("@nocobase/flow-engine")):e["@nocobase/plugin-field-sort"]=t(e.antd,e.react,e["@nocobase/client"],e["@nocobase/flow-engine"])}(self,function(e,t,r,n){return function(){"use strict";var o={342:function(e){e.exports=r},694:function(e){e.exports=n},59:function(t){t.exports=e},155:function(e){e.exports=t}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var u,a=c.g.document;if(!u&&a&&(a.currentScript&&"SCRIPT"===a.currentScript.tagName.toUpperCase()&&(u=a.currentScript.src),!u)){var l=a.getElementsByTagName("script");if(l.length)for(var p=l.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=l[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var f={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-field-sort/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-field-sort/dist/client/"}c.p=e}(),!function(){c.r(f),c.d(f,{default:function(){return _},PluginFieldSortClient:function(){return P}});var e=c(342);function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}var i=function(i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function");function c(){var n,i,u,a,l;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return i=c,u=arguments,i=r(i),t(n=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,o()?Reflect.construct(i,u||[],r(this).constructor):i.apply(this,u)),"name","sort"),t(n,"type","object"),t(n,"group","advanced"),t(n,"order",1),t(n,"title",'{{t("Sort")}}'),t(n,"sortable",!0),t(n,"titleUsable",!0),t(n,"description",'{{t("Used for drag and drop sorting scenarios, supporting grouping sorting")}}'),t(n,"default",{type:"sort",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}}),t(n,"availableTypes",["sort"]),t(n,"hasDefaultValue",!1),t(n,"properties",(a=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}({},e.defaultProps),l=l={scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',"x-disabled":"{{ !editMainOnly}}","x-decorator":"FormItem","x-component":"Select",enum:"{{scopeKeyOptions}}",description:"{{t('When a field is selected for grouping, it will be grouped first before sorting.')}}"}},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(l)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(l)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(l,e))}),a)),t(n,"filterable",{operators:e.operators.number}),t(n,"validateSchema",function(t){return{maximum:{type:"number",title:'{{ t("Maximum") }}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":"{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(e.i18n.t("Maximum must greater than minimum"),"' : ''\n }}}")},minimum:{type:"number",title:'{{ t("Minimum") }}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":{dependencies:[".maximum"],fulfill:{state:{selfErrors:"{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(e.i18n.t("Minimum must less than maximum"),"' : ''}}")}}}},format:{type:"string",title:'{{ t("Format") }}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{allowClear:!0},enum:[{label:'{{ t("Odd") }}',value:"odd"},{label:'{{ t("Even") }}',value:"even"}]},pattern:{type:"string",title:'{{ t("Regular expression") }}',"x-decorator":"FormItem","x-component":"Input","x-component-props":{prefix:"/",suffix:"/"}}}}),n}return c.prototype=Object.create(i&&i.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),i&&n(c,i),c}(e.CollectionFieldInterface),u=c(59),a=c(155),l=c.n(a),p=c(694);function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){return(b=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function y(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(y=function(){return!!e})()}var d=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=s(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,y()?Reflect.construct(e,t||[],s(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&b(r,e),t=[{key:"render",value:function(){var e,t;return l().createElement(u.InputNumber,(e=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},this.props),t=t={style:{width:"100%"}},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(t)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}),e))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(e.FieldModel);function m(e,t,r,n,o,i,c){try{var u=e[i](c),a=u.value}catch(e){r(e);return}u.done?t(a):Promise.resolve(a).then(n,o)}function h(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){m(i,n,o,c,u,"next",e)}function u(e){m(i,n,o,c,u,"throw",e)}c(void 0)})}}function v(e,t,r){return(v=j()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&O(o,r.prototype),o}).apply(null,arguments)}p.EditableItemModel.bindModelToInterface("SortFieldModel",["sort"],{isDefault:!0}),p.DisplayItemModel.bindModelToInterface("DisplayNumberFieldModel",["sort"],{isDefault:!0});function g(e){return(g=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function O(e,t){return(O=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return v(e,arguments,g(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),O(r,e)})(e)}function j(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(j=function(){return!!e})()}function x(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}var P=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=g(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,j()?Reflect.construct(e,t||[],g(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&O(r,e),t=[{key:"afterAdd",value:function(){return h(function(){return x(this,function(e){return[2]})})()}},{key:"beforeLoad",value:function(){return h(function(){return x(this,function(e){return[2]})})()}},{key:"load",value:function(){return h(function(){return x(this,function(e){return this.app.addFieldInterfaces([i]),this.flowEngine.registerModels({SortFieldModel:d}),[2]})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(w(e.Plugin)),_=P}(),f}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/client-v2"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-sort",["react","antd","@nocobase/client","@nocobase/client-v2","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-field-sort"]=t(require("react"),require("antd"),require("@nocobase/client"),require("@nocobase/client-v2"),require("@nocobase/flow-engine")):e["@nocobase/plugin-field-sort"]=t(e.react,e.antd,e["@nocobase/client"],e["@nocobase/client-v2"],e["@nocobase/flow-engine"])}(self,function(e,t,r,n,o){return function(){"use strict";var i={342:function(e){e.exports=r},485:function(e){e.exports=n},694:function(e){e.exports=o},59:function(e){e.exports=t},155:function(t){t.exports=e}},c={};function u(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return i[e](r,r.exports,u),r.exports}u.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(t,{a:t}),t},u.d=function(e,t){for(var r in t)u.o(t,r)&&!u.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},u.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),u.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},u.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u.g.importScripts&&(a=u.g.location+"");var a,l=u.g.document;if(!a&&l&&(l.currentScript&&"SCRIPT"===l.currentScript.tagName.toUpperCase()&&(a=l.currentScript.src),!a)){var p=l.getElementsByTagName("script");if(p.length)for(var s=p.length-1;s>-1&&(!a||!/^http(s?):/.test(a));)a=p[s--].src}if(!a)throw Error("Automatic publicPath is not supported in this browser");u.p=a.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var f={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-field-sort/dist/client/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-field-sort/dist/client/"}u.p=e}(),!function(){u.r(f),u.d(f,{default:function(){return S},PluginFieldSortClient:function(){return x}});var e=u(342);function t(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function r(e){return(r=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function n(e,t){return(n=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function o(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(o=function(){return!!e})()}var i=function(i){if("function"!=typeof i&&null!==i)throw TypeError("Super expression must either be null or a function");function c(){var n,i,u,a,l;if(!(this instanceof c))throw TypeError("Cannot call a class as a function");return i=c,u=arguments,i=r(i),t(n=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,o()?Reflect.construct(i,u||[],r(this).constructor):i.apply(this,u)),"name","sort"),t(n,"type","object"),t(n,"group","advanced"),t(n,"order",1),t(n,"title",'{{t("Sort")}}'),t(n,"sortable",!0),t(n,"titleUsable",!0),t(n,"description",'{{t("Used for drag and drop sorting scenarios, supporting grouping sorting")}}'),t(n,"default",{type:"sort",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}}),t(n,"availableTypes",["sort"]),t(n,"hasDefaultValue",!1),t(n,"properties",(a=function(e){for(var r=1;r<arguments.length;r++){var n=null!=arguments[r]?arguments[r]:{},o=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),o.forEach(function(r){t(e,r,n[r])})}return e}({},e.defaultProps),l=l={scopeKey:{type:"string",title:'{{t("Grouped sorting")}}',"x-disabled":"{{ !editMainOnly}}","x-decorator":"FormItem","x-component":"Select",enum:"{{scopeKeyOptions}}",description:"{{t('When a field is selected for grouping, it will be grouped first before sorting.')}}"}},Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(l)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(l)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(l,e))}),a)),t(n,"filterable",{operators:e.operators.number}),t(n,"validateSchema",function(t){return{maximum:{type:"number",title:'{{ t("Maximum") }}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":"{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? '".concat(e.i18n.t("Maximum must greater than minimum"),"' : ''\n }}}")},minimum:{type:"number",title:'{{ t("Minimum") }}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":{dependencies:[".maximum"],fulfill:{state:{selfErrors:"{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? '".concat(e.i18n.t("Minimum must less than maximum"),"' : ''}}")}}}},format:{type:"string",title:'{{ t("Format") }}',"x-decorator":"FormItem","x-component":"Select","x-component-props":{allowClear:!0},enum:[{label:'{{ t("Odd") }}',value:"odd"},{label:'{{ t("Even") }}',value:"even"}]},pattern:{type:"string",title:'{{ t("Regular expression") }}',"x-decorator":"FormItem","x-component":"Input","x-component-props":{prefix:"/",suffix:"/"}}}}),n}return c.prototype=Object.create(i&&i.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),i&&n(c,i),c}(e.CollectionFieldInterface),c=u(155),a=u.n(c),l=u(59),p=u(694),s=u(485);function b(e){return(b=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}var O=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=b(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,m()?Reflect.construct(e,t||[],b(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&d(r,e),t=[{key:"render",value:function(){var e,t,r;return a().createElement(l.InputNumber,(t=y({},this.props),r=r={style:y({width:"100%"},null==(e=this.props)?void 0:e.style)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(s.FieldModel);function v(e,t,r,n,o,i,c){try{var u=e[i](c),a=u.value}catch(e){r(e);return}u.done?t(a):Promise.resolve(a).then(n,o)}function g(e,t,r){return(g=P()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&w(o,r.prototype),o}).apply(null,arguments)}O.define({label:function(e){var t,r,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,p.tExpr)(e,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},n),r=r={ns:"@nocobase/plugin-field-sort"},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}("Sort")}),p.EditableItemModel.bindModelToInterface("SortFieldModel",["sort"],{isDefault:!0}),p.DisplayItemModel.bindModelToInterface("DisplayNumberFieldModel",["sort"],{isDefault:!0}),p.FilterableItemModel.bindModelToInterface("NumberFieldModel",["sort"],{isDefault:!0});function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function w(e,t){return(w=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function j(e){var t="function"==typeof Map?new Map:void 0;return(j=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return g(e,arguments,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),w(r,e)})(e)}function P(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(P=function(){return!!e})()}var x=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=h(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,P()?Reflect.construct(e,t||[],h(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&w(r,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:a(0)}),u(c,"throw",{value:a(1)}),u(c,"return",{value:a(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function a(u){return function(a){var l=[u,a];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,l[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&l[0]?n.return:l[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,l[1])).done)return o;switch(n=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,n=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],n=0}finally{r=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(e){return this.app.addFieldInterfaces([i]),this.flowEngine.registerModels({SortFieldModel:O}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){v(i,n,o,c,u,"next",e)}function u(e){v(i,n,o,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(j(e.Plugin)),S=x}(),f}()});
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export { SortFieldModel } from './models/SortFieldModel';
10
+ export { SortFieldInterface } from './sort-interface';
11
+ export { default } from './plugin';
@@ -0,0 +1,10 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("antd"),require("@nocobase/client-v2"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-field-sort/client-v2",["react","antd","@nocobase/client-v2","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-field-sort/client-v2"]=t(require("react"),require("antd"),require("@nocobase/client-v2"),require("@nocobase/flow-engine")):e["@nocobase/plugin-field-sort/client-v2"]=t(e.react,e.antd,e["@nocobase/client-v2"],e["@nocobase/flow-engine"])}(self,function(e,t,r,n){return function(){"use strict";var o={798:function(e,t,r){r.r(t),r.d(t,{SortFieldModel:function(){return b}});var n=r(155),o=r.n(n),i=r(59),c=r(694),u=r(485),l=r(488);function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}var b=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=a(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,f()?Reflect.construct(e,t||[],a(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&s(r,e),t=[{key:"render",value:function(){var e,t,r;return o().createElement(i.InputNumber,(t=p({},this.props),r=r={style:p({width:"100%"},null==(e=this.props)?void 0:e.style)},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(u.FieldModel);b.define({label:(0,l.MZ)("Sort")}),c.EditableItemModel.bindModelToInterface("SortFieldModel",["sort"],{isDefault:!0}),c.DisplayItemModel.bindModelToInterface("DisplayNumberFieldModel",["sort"],{isDefault:!0}),c.FilterableItemModel.bindModelToInterface("NumberFieldModel",["sort"],{isDefault:!0})},488:function(e,t,r){r.d(t,{MZ:function(){return o}});var n=r(694);function o(e){var t,r,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.tExpr)(e,(t=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})}return e}({},o),r=r={ns:"@nocobase/plugin-field-sort"},Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}),t))}},485:function(e){e.exports=r},694:function(e){e.exports=n},59:function(e){e.exports=t},155:function(t){t.exports=e}},i={};function c(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,c),r.exports}c.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return c.d(t,{a:t}),t},c.d=function(e,t){for(var r in t)c.o(t,r)&&!c.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},c.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),c.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},c.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},c.g.importScripts&&(u=c.g.location+"");var u,l=c.g.document;if(!u&&l&&(l.currentScript&&"SCRIPT"===l.currentScript.tagName.toUpperCase()&&(u=l.currentScript.src),!u)){var a=l.getElementsByTagName("script");if(a.length)for(var p=a.length-1;p>-1&&(!u||!/^http(s?):/.test(u));)u=a[p--].src}if(!u)throw Error("Automatic publicPath is not supported in this browser");c.p=u.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var s={};return!function(){var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src&&(e=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/")),!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-field-sort/dist/client-v2/")}if(!e){if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var n=window.location.pathname||"/",o=n.indexOf("/v2/");e=o>=0?n.slice(0,o+1):"/"}e&&(e=e.replace(/\/v2\/?$/,"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-field-sort/dist/client-v2/"}c.p=e}(),!function(){c.r(s),c.d(s,{SortFieldModel:function(){return e.SortFieldModel},default:function(){return O},SortFieldInterface:function(){return p}});var e=c(798),t=c(485),r=c(488);function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){return(o=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(u=function(){return!!e})()}var l={"uiSchema.title":{type:"string",title:'{{t("Field display name")}}',required:!0,"x-decorator":"FormItem","x-component":"Input"},name:{type:"string",title:'{{t("Field name")}}',required:!0,"x-disabled":"{{ !createOnly }}","x-decorator":"FormItem","x-component":"Input","x-validator":"uid",description:"{{t('Randomly generated and can be modified. Support letters, numbers and underscores, must start with an letter.')}}"}},a=[{label:'{{t("=")}}',value:"$eq",selected:!0},{label:'{{t("≠")}}',value:"$ne"},{label:'{{t(">")}}',value:"$gt"},{label:'{{t("≥")}}',value:"$gte"},{label:'{{t("<")}}',value:"$lt"},{label:'{{t("≤")}}',value:"$lte"},{label:'{{t("is empty")}}',value:"$empty",noValue:!0},{label:'{{t("is not empty")}}',value:"$notEmpty",noValue:!0}],p=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,i,c,p,s;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return i=t,c=arguments,i=o(i),n(e=function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,u()?Reflect.construct(i,c||[],o(this).constructor):i.apply(this,c)),"name","sort"),n(e,"type","object"),n(e,"group","advanced"),n(e,"order",1),n(e,"title",(0,r.MZ)("Sort")),n(e,"sortable",!0),n(e,"titleUsable",!0),n(e,"description",(0,r.MZ)("Used for drag and drop sorting scenarios, supporting grouping sorting")),n(e,"default",{type:"sort",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}}),n(e,"availableTypes",["sort"]),n(e,"hasDefaultValue",!1),n(e,"properties",(p=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},o=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(o=o.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),o.forEach(function(t){n(e,t,r[t])})}return e}({},l),s=s={scopeKey:{type:"string",title:(0,r.MZ)("Grouped sorting"),"x-disabled":"{{ !editMainOnly}}","x-decorator":"FormItem","x-component":"Select",enum:"{{scopeKeyOptions}}",description:(0,r.MZ)("When a field is selected for grouping, it will be grouped first before sorting.")}},Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(s)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t.push.apply(t,r)}return t})(Object(s)).forEach(function(e){Object.defineProperty(p,e,Object.getOwnPropertyDescriptor(s,e))}),p)),n(e,"filterable",{operators:a}),n(e,"validateSchema",function(){return{maximum:{type:"number",title:(0,r.MZ)("Maximum"),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":"{{(field) => {\n const targetValue = field.query('.minimum').value();\n field.selfErrors =\n !!targetValue && !!field.value && targetValue > field.value ? t(\"Maximum must greater than minimum\") : ''\n }}}"},minimum:{type:"number",title:(0,r.MZ)("Minimum"),"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{precision:0},"x-reactions":{dependencies:[".maximum"],fulfill:{state:{selfErrors:'{{!!$deps[0] && !!$self.value && $deps[0] < $self.value ? t("Minimum must less than maximum") : ""}}'}}}},format:{type:"string",title:(0,r.MZ)("Format"),"x-decorator":"FormItem","x-component":"Select","x-component-props":{allowClear:!0},enum:[{label:(0,r.MZ)("Odd"),value:"odd"},{label:(0,r.MZ)("Even"),value:"even"}]},pattern:{type:"string",title:(0,r.MZ)("Regular expression"),"x-decorator":"FormItem","x-component":"Input","x-component-props":{prefix:"/",suffix:"/"}}}}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e),t}(t.CollectionFieldInterface);function f(e,t,r,n,o,i,c){try{var u=e[i](c),l=u.value}catch(e){r(e);return}u.done?t(l):Promise.resolve(l).then(n,o)}function b(e,t,r){return(b=v()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&d(o,r.prototype),o}).apply(null,arguments)}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function d(e,t){return(d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e){var t="function"==typeof Map?new Map:void 0;return(m=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return b(e,arguments,y(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),d(r,e)})(e)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}var O=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function r(){var e,t;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return e=r,t=arguments,e=y(e),function(e,t){var r;if(t&&("object"==((r=t)&&"u">typeof Symbol&&r.constructor===Symbol?"symbol":typeof r)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,v()?Reflect.construct(e,t||[],y(this).constructor):e.apply(this,t))}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&d(r,e),t=[{key:"load",value:function(){var e;return(e=function(){return function(e,t){var r,n,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},c=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(c,"next",{value:l(0)}),u(c,"throw",{value:l(1)}),u(c,"return",{value:l(2)}),"function"==typeof Symbol&&u(c,Symbol.iterator,{value:function(){return this}}),c;function l(u){return function(l){var a=[u,l];if(r)throw TypeError("Generator is already executing.");for(;c&&(c=0,a[0]&&(i=0)),i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}}}(this,function(e){return this.app.addFieldInterfaces([p]),this.flowEngine.registerModelLoaders({SortFieldModel:{loader:function(){return Promise.resolve().then(c.bind(c,798))}}}),[2]})},function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function c(e){f(i,n,o,c,u,"next",e)}function u(e){f(i,n,o,c,u,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(r.prototype,t),r}(m(t.Plugin))}(),s}()});
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ export declare const NAMESPACE = "@nocobase/plugin-field-sort";
10
+ export declare function useT(): (str: string, options?: {}) => string;
11
+ export declare function tExpr(key: string, options?: {}): string;
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import React from 'react';
10
- import { FieldModel } from '@nocobase/client';
10
+ import { FieldModel } from '@nocobase/client-v2';
11
11
  export declare class SortFieldModel extends FieldModel {
12
12
  render(): React.JSX.Element;
13
13
  }
@@ -0,0 +1,13 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { Application, Plugin } from '@nocobase/client-v2';
10
+ export declare class PluginFieldSortClient extends Plugin<any, Application> {
11
+ load(): Promise<void>;
12
+ }
13
+ export default PluginFieldSortClient;
@@ -0,0 +1,131 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+ import { CollectionFieldInterface } from '@nocobase/client-v2';
10
+ export declare class SortFieldInterface extends CollectionFieldInterface {
11
+ name: string;
12
+ type: string;
13
+ group: string;
14
+ order: number;
15
+ title: string;
16
+ sortable: boolean;
17
+ titleUsable: boolean;
18
+ description: string;
19
+ default: {
20
+ type: string;
21
+ uiSchema: {
22
+ type: string;
23
+ 'x-component': string;
24
+ 'x-component-props': {
25
+ stringMode: boolean;
26
+ step: string;
27
+ };
28
+ 'x-validator': string;
29
+ };
30
+ };
31
+ availableTypes: string[];
32
+ hasDefaultValue: boolean;
33
+ properties: {
34
+ scopeKey: {
35
+ type: string;
36
+ title: string;
37
+ 'x-disabled': string;
38
+ 'x-decorator': string;
39
+ 'x-component': string;
40
+ enum: string;
41
+ description: string;
42
+ };
43
+ 'uiSchema.title': {
44
+ type: string;
45
+ title: string;
46
+ required: boolean;
47
+ 'x-decorator': string;
48
+ 'x-component': string;
49
+ };
50
+ name: {
51
+ type: string;
52
+ title: string;
53
+ required: boolean;
54
+ 'x-disabled': string;
55
+ 'x-decorator': string;
56
+ 'x-component': string;
57
+ 'x-validator': string;
58
+ description: string;
59
+ };
60
+ };
61
+ filterable: {
62
+ operators: ({
63
+ label: string;
64
+ value: string;
65
+ selected: boolean;
66
+ noValue?: undefined;
67
+ } | {
68
+ label: string;
69
+ value: string;
70
+ selected?: undefined;
71
+ noValue?: undefined;
72
+ } | {
73
+ label: string;
74
+ value: string;
75
+ noValue: boolean;
76
+ selected?: undefined;
77
+ })[];
78
+ };
79
+ validateSchema: () => {
80
+ maximum: {
81
+ type: string;
82
+ title: string;
83
+ 'x-decorator': string;
84
+ 'x-component': string;
85
+ 'x-component-props': {
86
+ precision: number;
87
+ };
88
+ 'x-reactions': string;
89
+ };
90
+ minimum: {
91
+ type: string;
92
+ title: string;
93
+ 'x-decorator': string;
94
+ 'x-component': string;
95
+ 'x-component-props': {
96
+ precision: number;
97
+ };
98
+ 'x-reactions': {
99
+ dependencies: string[];
100
+ fulfill: {
101
+ state: {
102
+ selfErrors: string;
103
+ };
104
+ };
105
+ };
106
+ };
107
+ format: {
108
+ type: string;
109
+ title: string;
110
+ 'x-decorator': string;
111
+ 'x-component': string;
112
+ 'x-component-props': {
113
+ allowClear: boolean;
114
+ };
115
+ enum: {
116
+ label: string;
117
+ value: string;
118
+ }[];
119
+ };
120
+ pattern: {
121
+ type: string;
122
+ title: string;
123
+ 'x-decorator': string;
124
+ 'x-component': string;
125
+ 'x-component-props': {
126
+ prefix: string;
127
+ suffix: string;
128
+ };
129
+ };
130
+ };
131
+ }
@@ -8,15 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "antd": "5.24.2",
12
- "react": "18.2.0",
13
- "@nocobase/flow-engine": "2.1.0-beta.36",
14
- "@nocobase/client": "2.1.0-beta.36",
11
+ "@nocobase/client": "2.1.0-beta.37",
12
+ "@nocobase/flow-engine": "2.1.0-beta.37",
13
+ "@nocobase/client-v2": "2.1.0-beta.37",
15
14
  "lodash": "4.18.1",
16
- "@nocobase/database": "2.1.0-beta.36",
17
- "@nocobase/actions": "2.1.0-beta.36",
18
- "@nocobase/server": "2.1.0-beta.36",
19
- "@nocobase/data-source-manager": "2.1.0-beta.36",
15
+ "@nocobase/database": "2.1.0-beta.37",
16
+ "@nocobase/actions": "2.1.0-beta.37",
17
+ "@nocobase/server": "2.1.0-beta.37",
18
+ "@nocobase/data-source-manager": "2.1.0-beta.37",
20
19
  "sequelize": "6.35.2",
21
- "@nocobase/lock-manager": "2.1.0-beta.36"
20
+ "@nocobase/lock-manager": "2.1.0-beta.37",
21
+ "react": "18.2.0",
22
+ "antd": "5.24.2"
22
23
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-field-sort",
3
- "version": "2.1.0-beta.36",
3
+ "version": "2.1.0-beta.37",
4
4
  "license": "Apache-2.0",
5
5
  "displayName": "Collection field: Sort",
6
6
  "displayName.ru-RU": "Поле коллекции: Сортировка",
@@ -12,6 +12,7 @@
12
12
  "peerDependencies": {
13
13
  "@nocobase/actions": "2.x",
14
14
  "@nocobase/client": "2.x",
15
+ "@nocobase/client-v2": "2.x",
15
16
  "@nocobase/database": "2.x",
16
17
  "@nocobase/lock-manager": "2.x",
17
18
  "@nocobase/server": "2.x",
@@ -22,5 +23,5 @@
22
23
  "keywords": [
23
24
  "Collection fields"
24
25
  ],
25
- "gitHead": "397d45c744f6eb48b3a0cd785c87cbf1257c3513"
26
+ "gitHead": "7132e5b83ecc0e42b54715eaf1429c72bcef34ae"
26
27
  }