@nocobase/plugin-field-sort 2.1.0-beta.38 → 2.1.0-beta.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.
@@ -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
+ import type { FieldConfigurePropertyComponentProps } from '@nocobase/client-v2';
10
+ import React from 'react';
11
+ export declare function SortFieldConfigureForm(props: FieldConfigurePropertyComponentProps): React.JSX.Element;
@@ -7,5 +7,6 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  export { SortFieldModel } from './models/SortFieldModel';
10
+ export { SortFieldConfigureForm } from './SortFieldConfigureForm';
10
11
  export { SortFieldInterface } from './sort-interface';
11
12
  export { default } from './plugin';
@@ -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("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}()});
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 f(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 p(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(p=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,p()?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=f({},this.props),r=r={style:f({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 l},kj:function(){return u}});var n=r(694);function o(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 i(e,t){return t=null!=t?t:{},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}var c="@nocobase/plugin-field-sort";function u(){var e=(0,n.useFlowEngine)();return function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return e.context.t(t,i(o({},r),{ns:[c,"client"]}))}}function l(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,n.tExpr)(e,i(o({},t),{ns:c}))}},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 f=a.length-1;f>-1&&(!u||!/^http(s?):/.test(u));)u=a[f--].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 w},SortFieldInterface:function(){return y},SortFieldConfigureForm:function(){return u}});var e=c(798),t=c(59),r=c(155),n=c.n(r),o=c(488),i=/^\s*\{\{\s*t\s*\(\s*(['"])(.*?)\1(?:\s*,[\s\S]*?)?\)\s*\}\}\s*$/;function u(e){var c,u,l=(0,o.kj)(),a=(0,r.useMemo)(function(){var t,r;return((null==(t=e.field)?void 0:t.fields)||(null==(r=e.collection)?void 0:r.fields)||[]).filter(function(e){return["string","bigInt","integer"].includes(e.type)}).map(function(e){var t;return{value:e.name,label:function(e,t){if("string"!=typeof e)return e;var r=e.match(i);return(null==r?void 0:r[2])?t(r[2]):e}((null==(t=e.uiSchema)?void 0:t.title)||e.name,l)}})},[null==(c=e.collection)?void 0:c.fields,null==(u=e.field)?void 0:u.fields,l]);return n().createElement(t.Form.Item,{name:"scopeKey",label:l("Grouped sorting"),tooltip:l("When a field is selected for grouping, it will be grouped first before sorting.")},n().createElement(t.Select,{allowClear:!0,disabled:e.disabled,options:a}))}var l=c(485);function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e,t){return(p=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function b(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(b=function(){return!!e})()}var y=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function t(){var e,r,n;if(!(this instanceof t))throw TypeError("Cannot call a class as a function");return r=t,n=arguments,r=f(r),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,b()?Reflect.construct(r,n||[],f(this).constructor):r.apply(this,n)),"name","sort"),a(e,"type","object"),a(e,"group","advanced"),a(e,"order",1),a(e,"title",(0,o.MZ)("Sort")),a(e,"sortable",!0),a(e,"titleUsable",!0),a(e,"description",(0,o.MZ)("Used for drag and drop sorting scenarios, supporting grouping sorting")),a(e,"default",{type:"sort",uiSchema:{type:"number","x-component":"InputNumber","x-component-props":{stringMode:!0,step:"1"},"x-validator":"integer"}}),a(e,"availableTypes",["sort"]),a(e,"hasDefaultValue",!1),a(e,"configure",{items:[{name:"scopeKey",Component:u}]}),a(e,"filterable",{operators:"number"}),e}return t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&p(t,e),t}(l.CollectionFieldInterface);function d(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 v(e,t,r){return(v=m()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&g(o,r.prototype),o}).apply(null,arguments)}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function O(e){var t="function"==typeof Map?new Map:void 0;return(O=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,h(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),g(r,e)})(e)}function m(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(m=function(){return!!e})()}var w=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,m()?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&&g(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([y]),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){d(i,n,o,c,u,"next",e)}function u(e){d(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}(O(l.Plugin))}(),s}()});
@@ -7,6 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
  import { CollectionFieldInterface } from '@nocobase/client-v2';
10
+ import { SortFieldConfigureForm } from './SortFieldConfigureForm';
10
11
  export declare class SortFieldInterface extends CollectionFieldInterface {
11
12
  name: string;
12
13
  type: string;
@@ -30,102 +31,13 @@ export declare class SortFieldInterface extends CollectionFieldInterface {
30
31
  };
31
32
  availableTypes: string[];
32
33
  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
- };
34
+ configure: {
35
+ items: {
36
+ name: string;
37
+ Component: typeof SortFieldConfigureForm;
38
+ }[];
60
39
  };
61
40
  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
- };
41
+ operators: string;
130
42
  };
131
43
  }
@@ -8,16 +8,16 @@
8
8
  */
9
9
 
10
10
  module.exports = {
11
- "@nocobase/client": "2.1.0-beta.38",
12
- "@nocobase/flow-engine": "2.1.0-beta.38",
13
- "@nocobase/client-v2": "2.1.0-beta.38",
11
+ "@nocobase/client": "2.1.0-beta.40",
12
+ "@nocobase/client-v2": "2.1.0-beta.40",
13
+ "antd": "5.24.2",
14
+ "react": "18.2.0",
15
+ "@nocobase/flow-engine": "2.1.0-beta.40",
14
16
  "lodash": "4.18.1",
15
- "@nocobase/database": "2.1.0-beta.38",
16
- "@nocobase/actions": "2.1.0-beta.38",
17
- "@nocobase/server": "2.1.0-beta.38",
18
- "@nocobase/data-source-manager": "2.1.0-beta.38",
17
+ "@nocobase/database": "2.1.0-beta.40",
18
+ "@nocobase/actions": "2.1.0-beta.40",
19
+ "@nocobase/server": "2.1.0-beta.40",
20
+ "@nocobase/data-source-manager": "2.1.0-beta.40",
19
21
  "sequelize": "6.35.2",
20
- "@nocobase/lock-manager": "2.1.0-beta.38",
21
- "react": "18.2.0",
22
- "antd": "5.24.2"
22
+ "@nocobase/lock-manager": "2.1.0-beta.40"
23
23
  };
@@ -1 +1,6 @@
1
- {}
1
+ {
2
+ "Grouped sorting": "Grouped sorting",
3
+ "Sort": "Sort",
4
+ "Used for drag and drop sorting scenarios, supporting grouping sorting": "Used for drag and drop sorting scenarios, supporting grouping sorting",
5
+ "When a field is selected for grouping, it will be grouped first before sorting.": "When a field is selected for grouping, it will be grouped first before sorting."
6
+ }
@@ -1 +1,6 @@
1
- {}
1
+ {
2
+ "Grouped sorting": "分组排序",
3
+ "Sort": "排序",
4
+ "Used for drag and drop sorting scenarios, supporting grouping sorting": "用于拖拽排序场景,支持分组排序",
5
+ "When a field is selected for grouping, it will be grouped first before sorting.": "选择分组字段后,会先按该字段分组,再在组内排序。"
6
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/plugin-field-sort",
3
- "version": "2.1.0-beta.38",
3
+ "version": "2.1.0-beta.40",
4
4
  "license": "Apache-2.0",
5
5
  "displayName": "Collection field: Sort",
6
6
  "displayName.ru-RU": "Поле коллекции: Сортировка",
@@ -15,6 +15,7 @@
15
15
  "@nocobase/client-v2": "2.x",
16
16
  "@nocobase/database": "2.x",
17
17
  "@nocobase/lock-manager": "2.x",
18
+ "@nocobase/plugin-data-source-manager": "2.x",
18
19
  "@nocobase/server": "2.x",
19
20
  "@nocobase/test": "2.x",
20
21
  "lodash": "4.x",
@@ -23,5 +24,5 @@
23
24
  "keywords": [
24
25
  "Collection fields"
25
26
  ],
26
- "gitHead": "d1c585108ff6e51c17b0b52bacb1a2d621d9c119"
27
+ "gitHead": "36e906138f6305723abbef676a61006058feb5ea"
27
28
  }