@nocobase/plugin-users 2.1.0-alpha.45 → 2.1.0-alpha.46

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.
Files changed (42) hide show
  1. package/client-v2-api.md +193 -0
  2. package/dist/client/70.a415ef0ddba902d8.js +10 -0
  3. package/dist/client/index.js +1 -1
  4. package/dist/client/utils.d.ts +1 -1
  5. package/dist/client-v2/143.8fc4573e64ec8c3f.js +10 -0
  6. package/dist/client-v2/470.8f84a05a59c40a98.js +10 -0
  7. package/dist/client-v2/521.0916f57839371256.js +10 -0
  8. package/dist/client-v2/564.2f27ca5dcd50632f.js +10 -0
  9. package/dist/client-v2/569.07f16da700ba0ba6.js +10 -0
  10. package/dist/client-v2/587.a15f1f5b0dbbf4d5.js +10 -0
  11. package/dist/client-v2/784.25ee62a1613da5a6.js +10 -0
  12. package/dist/client-v2/786.ca0dea7bc67662c3.js +10 -0
  13. package/dist/client-v2/862.2aac0dea47472edf.js +10 -0
  14. package/dist/client-v2/914.d3af69c936276d49.js +10 -0
  15. package/dist/client-v2/components/resource/ResourceFormDrawer.d.ts +33 -0
  16. package/dist/client-v2/components/resource/ResourcePickerView.d.ts +46 -0
  17. package/dist/client-v2/components/resource/ResourceTablePage.d.ts +50 -0
  18. package/dist/client-v2/components/resource/SettingsActionCell.d.ts +39 -0
  19. package/dist/client-v2/components/resource/index.d.ts +12 -0
  20. package/dist/client-v2/index.js +1 -1
  21. package/dist/client-v2/locale.d.ts +6 -2
  22. package/dist/client-v2/models/UserPasswordFieldModel.d.ts +16 -0
  23. package/dist/client-v2/models/UserProfileFormModels.d.ts +19 -0
  24. package/dist/client-v2/models/UserRolesSelectFieldModel.d.ts +14 -0
  25. package/dist/client-v2/pages/ChangeUserPasswordDrawer.d.ts +15 -0
  26. package/dist/client-v2/pages/RoleUsersManager.d.ts +11 -0
  27. package/dist/client-v2/pages/UserFormDrawer.d.ts +15 -0
  28. package/dist/client-v2/pages/UsersManagementPage.d.ts +10 -0
  29. package/dist/client-v2/pages/UsersSettingsForm.d.ts +10 -0
  30. package/dist/client-v2/pages/types.d.ts +30 -0
  31. package/dist/client-v2/shared/adminProfileFormModels.d.ts +15 -0
  32. package/dist/client-v2/shared/generatePassword.d.ts +9 -0
  33. package/dist/client-v2/user-center/CurrentUserSummaryItemModel.d.ts +16 -0
  34. package/dist/client-v2/user-center/EditProfileItemModel.d.ts +18 -0
  35. package/dist/client-v2/user-center/SignOutItemModel.d.ts +17 -0
  36. package/dist/externalVersion.js +12 -10
  37. package/dist/locale/en-US.json +12 -1
  38. package/dist/locale/zh-CN.json +12 -1
  39. package/dist/server/user-data-sync-resource.d.ts +5 -1
  40. package/dist/server/user-data-sync-resource.js +3 -0
  41. package/package.json +2 -2
  42. package/dist/client/825.5b87f2d207f047ef.js +0 -10
@@ -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
+ "use strict";(self.webpackChunk_nocobase_plugin_users_client_v2=self.webpackChunk_nocobase_plugin_users_client_v2||[]).push([["786"],{241:function(e,t,n){n.r(t),n.d(t,{SignOutItemModel:function(){return l}});var r=n(485);function o(e,t,n,r,o,i,u){try{var c=e[i](u),a=c.value}catch(e){n(e);return}c.done?t(a):Promise.resolve(a).then(r,o)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function a(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(a=function(){return!!e})()}var l=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=u(t),i(e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,a()?Reflect.construct(t,r||[],u(this).constructor):t.apply(this,r)),"section","danger"),i(e,"sort",1e3),i(e,"label","Sign out"),e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&c(n,e),t=[{key:"onClick",value:function(){var e;return(e=function(){var e,t,n,o;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),c=Object.defineProperty;return c(u,"next",{value:a(0)}),c(u,"throw",{value:a(1)}),c(u,"return",{value:a(2)}),"function"==typeof Symbol&&c(u,Symbol.iterator,{value:function(){return this}}),u;function a(c){return function(a){var l=[c,a];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=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++,r=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],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(i){switch(i.label){case 0:return[4,this.context.api.auth.signOut()];case 1:if(n=i.sent(),o=(0,r.resolveV2SigninRedirect)(null==n||null==(t=n.data)||null==(e=t.data)?void 0:e.redirect,this.context.app))return window.location.replace(o),[2];return(0,r.redirectToV2Signin)(this.context.app,(0,r.getCurrentV2RedirectPath)(this.context.app,window.location),{replace:!0}),[2]}})},function(){var t=this,n=arguments;return new Promise(function(r,i){var u=e.apply(t,n);function c(e){o(u,r,i,c,a,"next",e)}function a(e){o(u,r,i,c,a,"throw",e)}c(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(r.UserCenterActionItemModel);i(l,"itemId","sign-out"),t.default=l}}]);
@@ -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
+ "use strict";(self.webpackChunk_nocobase_plugin_users_client_v2=self.webpackChunk_nocobase_plugin_users_client_v2||[]).push([["862"],{381:function(e,t,r){r.r(t),r.d(t,{ChangePasswordItemModel:function(){return P}});var n=r(485),o=r(694),a=r(625),l=r(59),u=r(155),s=r.n(u),i=r(488),c=r(667);function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t,r,n,o,a,l){try{var u=e[a](l),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function l(e){p(a,n,o,l,u,"next",e)}function u(e){p(a,n,o,l,u,"throw",e)}l(void 0)})}}function m(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h(e){return(h=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(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],l=!0,u=!1;try{for(o=o.call(e);!(l=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);l=!0);}catch(e){u=!0,n=e}finally{try{l||null==o.return||o.return()}finally{if(u)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function v(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(l,"next",{value:s(0)}),u(l,"throw",{value:s(1)}),u(l,"return",{value:s(2)}),"function"==typeof Symbol&&u(l,Symbol.iterator,{value:function(){return this}}),l;function s(u){return function(s){var i=[u,s];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,i[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===i[0]||2===i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}}}function g(){var e=(0,i.nK)().t,t=(0,o.useFlowContext)(),r=l.theme.useToken().token,f=y(l.Form.useForm(),1)[0],p=y((0,u.useState)(!1),2),m=p[0],h=p[1],b=y((0,u.useState)(""),2),w=b[0],g=b[1],P=(0,a.useMemoizedFn)(function(e,r){return d(function(){var e,n,o,a,l,u,s,i,f,p,d,m,h;return v(this,function(b){switch(b.label){case 0:if("string"!=typeof r||!r)return[2];u=(null==(l=null==(o=t.app)||null==(n=o.pm)||null==(e=n.get)?void 0:e.call(n,c.X))||null==(a=l.getPasswordValidators)?void 0:a.call(l))||[],s=!0,i=!1,f=void 0,b.label=1;case 1:b.trys.push([1,6,7,8]),p=u[Symbol.iterator](),b.label=2;case 2:if(s=(d=p.next()).done)return[3,5];return[4,(0,d.value)(r,{username:void 0})];case 3:if(m=b.sent())throw Error(m);b.label=4;case 4:return s=!0,[3,2];case 5:return[3,8];case 6:return h=b.sent(),i=!0,f=h,[3,8];case 7:try{s||null==p.return||p.return()}finally{if(i)throw f}return[7];case 8:return[2]}})})()}),S=(0,a.useMemoizedFn)(function(){return d(function(){var e,r,o,a,l,u,s;return v(this,function(i){switch(i.label){case 0:return[4,f.validateFields()];case 1:e=i.sent(),g(""),h(!0),i.label=2;case 2:return i.trys.push([2,4,5,6]),[4,t.api.resource("auth").changePassword({values:e})];case 3:return i.sent(),f.resetFields(),(0,n.redirectToV2Signin)(t.app,(0,n.getCurrentV2RedirectPath)(t.app,window.location),{replace:!0}),[3,6];case 4:throw g((null==(s=r=i.sent())||null==(u=s.response)||null==(l=u.data)||null==(a=l.errors)||null==(o=a[0])?void 0:o.message)||(null==s?void 0:s.message)||String(r)),r;case 5:return h(!1),[7];case 6:return[2]}})})()});return s().createElement(n.DrawerFormLayout,{title:e("Change password"),onSubmit:S,submitting:m,submitText:e("Submit"),cancelText:e("Cancel")},s().createElement(l.Form,{form:f,layout:"vertical"},w?s().createElement(l.Alert,{type:"error",showIcon:!0,message:w,style:{marginBottom:r.marginMD}}):null,s().createElement(l.Form.Item,{name:"oldPassword",label:e("Old password"),rules:[{required:!0,message:e("Please enter the old password")}]},s().createElement(n.PasswordInput,{autoComplete:"current-password"})),s().createElement(l.Form.Item,{name:"newPassword",label:e("New password"),rules:[{required:!0,message:e("Please enter the new password")},{validator:P}]},s().createElement(n.PasswordInput,{autoComplete:"new-password",checkStrength:!0})),s().createElement(l.Form.Item,{name:"confirmPassword",label:e("Confirm password"),dependencies:["newPassword"],rules:[{required:!0,message:e("Please confirm the new password")},function(t){var r=t.getFieldValue;return{validator:function(t,n){return n&&r("newPassword")!==n?Promise.reject(Error(e("Password mismatch"))):Promise.resolve()}}}]},s().createElement(n.PasswordInput,{autoComplete:"new-password",checkStrength:!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,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=h(t),m(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,w()?Reflect.construct(t,n||[],h(this).constructor):t.apply(this,n)),"section","profile"),m(e,"sort",100),m(e,"label","Change password"),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&b(r,e),t=[{key:"prepare",value:function(){return d(function(){var e,t,r;return v(this,function(n){switch(n.label){case 0:return[4,this.context.systemSettings.load()];case 1:return r=null==(t=n.sent())||null==(e=t.data)?void 0:e.enableChangePassword,this.ready=!1!==r,[2]}})}).call(this)}},{key:"onClick",value:function(){return d(function(){return v(this,function(e){return this.context.viewer.open({type:"drawer",width:"50%",closable:!0,content:function(){return s().createElement(g,null)}}),[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}(n.UserCenterActionItemModel);m(P,"itemId","change-password"),t.default=P}}]);
@@ -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
+ "use strict";(self.webpackChunk_nocobase_plugin_users_client_v2=self.webpackChunk_nocobase_plugin_users_client_v2||[]).push([["914"],{649:function(e,t,r){r.r(t),r.d(t,{UserCreateFormModel:function(){return P},UserEditFormModel:function(){return O}});var n=r(477),o=r(485),a=r(694),l=r(59),i=r(155),c=r.n(i);function u(e,t,r,n,o,a,l){try{var i=e[a](l),c=i.value}catch(e){r(e);return}i.done?t(c):Promise.resolve(c).then(n,o)}function s(e,t,r){return t=d(t),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}(e,v()?Reflect.construct(t,r||[],d(e).constructor):t.apply(e,r))}function f(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function h(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)}}function p(e,t,r){return t&&h(e.prototype,t),r&&h(e,r),e}function b(e,t,r){return(b="u">typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=function(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=d(e)););return e}(e,t);if(n){var o=Object.getOwnPropertyDescriptor(n,t);return o.get?o.get.call(r||e):o.value}})(e,t,r||e)}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function y(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function v(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(v=function(){return!!e})()}function m(){var e,t,r=(e=["\n &.ant-card {\n box-shadow: none !important;\n background: transparent !important;\n }\n\n > .ant-card-body {\n background: transparent !important;\n }\n"],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return m=function(){return r},r}var w=(0,n.css)(m()),P=function(e){function t(){return f(this,t),s(this,t,arguments)}return y(t,e),p(t,[{key:"onInit",value:function(e){b(d(t.prototype),"onInit",this).call(this,e),this.setDecoratorProps({bordered:!1,className:w})}},{key:"renderComponent",value:function(){var e=this.props,t=e.colon,r=e.labelAlign,n=e.labelWidth,l=e.labelWrap,i=e.layout,u=this.decoratorProps,s=u.heightMode,f=u.height;return c().createElement(o.FormBlockContent,{model:this,gridModel:this.subModels.grid,layoutProps:{colon:t,labelAlign:r,labelWidth:n,labelWrap:l,layout:i},heightMode:s,height:f,grid:c().createElement(a.FlowModelRenderer,{model:this.subModels.grid,showFlowSettings:!1})})}}]),t}(o.CreateFormModel),O=function(e){function t(){var e,r,n;return f(this,t),e=s(this,t,arguments),r="handlePageChange",n=function(t){var r;return(r=function(){var r;return function(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},l=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),i=Object.defineProperty;return i(l,"next",{value:c(0)}),i(l,"throw",{value:c(1)}),i(l,"return",{value:c(2)}),"function"==typeof Symbol&&i(l,Symbol.iterator,{value:function(){return this}}),l;function c(i){return function(c){var u=[i,c];if(r)throw TypeError("Generator is already executing.");for(;l&&(l=0,u[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&u[0]?n.return:u[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,u[1])).done)return o;switch(n=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return a.label++,{value:u[1],done:!1};case 5:a.label++,n=u[1],u=[0];continue;case 7:u=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){a=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){a.label=u[1];break}if(6===u[0]&&a.label<o[1]){a.label=o[1],o=u;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(u);break}o[2]&&a.ops.pop(),a.trys.pop();continue}u=t.call(e,a)}catch(e){u=[6,e],n=0}finally{r=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}}}(this,function(n){switch(n.label){case 0:var l,i;if(l=e.resource,null!=(i=a.MultiRecordResource)&&"u">typeof Symbol&&i[Symbol.hasInstance]?!i[Symbol.hasInstance](l):!(l instanceof i))return[3,3];return(r=e.resource).setPage(t),r.loading=!0,[4,r.refresh()];case 1:return n.sent(),[4,(0,o.dispatchEventDeep)(e,"paginationChange")];case 2:n.sent(),n.label=3;case 3:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var a=r.apply(e,t);function l(e){u(a,n,o,l,i,"next",e)}function i(e){u(a,n,o,l,i,"throw",e)}l(void 0)})})()},r in e?Object.defineProperty(e,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[r]=n,e}return y(t,e),p(t,[{key:"onInit",value:function(e){b(d(t.prototype),"onInit",this).call(this,e),this.setDecoratorProps({bordered:!1,className:w})}},{key:"renderComponent",value:function(){var e,t,r=this.props,n=r.colon,i=r.labelAlign,u=r.labelWidth,s=r.labelWrap,f=r.layout,h=this.decoratorProps,p=h.heightMode,b=h.height,d=this.hasAvailableData(),y=this.resource.loading||d?this.isMultiRecordResource()&&this.resource.getMeta("count")>1?c().createElement("div",{style:{textAlign:"center",marginTop:16}},c().createElement(l.Pagination,{simple:!0,pageSize:1,showSizeChanger:!1,defaultCurrent:this.resource.getPage(),total:this.resource.getTotalPage(),onChange:this.handlePageChange,style:{display:"inline-block"}})):null:c().createElement("div",{style:{textAlign:"center",marginTop:16,color:null==(t=this.context)||null==(e=t.themeToken)?void 0:e.colorTextDescription}},this.translate("No available data currently"));return c().createElement(o.FormBlockContent,{model:this,gridModel:this.subModels.grid,layoutProps:{colon:n,labelAlign:i,labelWidth:u,labelWrap:s,layout:f},heightMode:p,height:b,grid:c().createElement(a.FlowModelRenderer,{model:this.subModels.grid,showFlowSettings:!1}),footer:y})}}]),t}(o.EditFormModel)}}]);
@@ -0,0 +1,33 @@
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 FormInstance, type FormProps } from 'antd';
10
+ import React from 'react';
11
+ export interface ResourceFormDrawerRenderArgs<Values extends object> {
12
+ form: FormInstance<Values>;
13
+ submitting: boolean;
14
+ }
15
+ export interface ResourceFormDrawerProps<Values extends object = Record<string, unknown>> {
16
+ title: React.ReactNode;
17
+ initialValues?: Partial<Values>;
18
+ form?: FormInstance<Values>;
19
+ formProps?: Omit<FormProps<Values>, 'form' | 'initialValues' | 'children'>;
20
+ children: React.ReactNode | ((args: ResourceFormDrawerRenderArgs<Values>) => React.ReactNode);
21
+ onSubmit: (values: Values, form: FormInstance<Values>) => Promise<void> | void;
22
+ onSubmitted?: (values: Values) => Promise<void> | void;
23
+ submitText?: React.ReactNode;
24
+ cancelText?: React.ReactNode;
25
+ footer?: React.ReactNode;
26
+ }
27
+ /**
28
+ * Drawer-hosted antd form for settings CRUD pages. The caller owns the API
29
+ * branch (create/update/etc.); this component only handles form lifecycle,
30
+ * validation, loading state, and the shared drawer chrome.
31
+ */
32
+ export declare function ResourceFormDrawer<Values extends object = Record<string, unknown>>(props: ResourceFormDrawerProps<Values>): React.JSX.Element;
33
+ export default ResourceFormDrawer;
@@ -0,0 +1,46 @@
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 { Collection } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { type CompiledFilter, type TableProps } from '@nocobase/client-v2';
12
+ export interface ResourcePickerRequestParams {
13
+ filter?: CompiledFilter;
14
+ page: number;
15
+ pageSize: number;
16
+ }
17
+ export interface ResourcePickerLoadResult<RecordType extends object> {
18
+ data: RecordType[];
19
+ total?: number;
20
+ page?: number;
21
+ pageSize?: number;
22
+ }
23
+ export interface ResourcePickerViewProps<RecordType extends object = Record<string, unknown>> {
24
+ title: React.ReactNode;
25
+ collection?: Collection;
26
+ columns: TableProps<RecordType>['columns'];
27
+ rowKey: TableProps<RecordType>['rowKey'];
28
+ request: (params: ResourcePickerRequestParams) => Promise<ResourcePickerLoadResult<RecordType>>;
29
+ onSubmit: (selectedRows: RecordType[], selectedRowKeys: React.Key[]) => Promise<void> | void;
30
+ t?: (key: string, options?: Record<string, unknown>) => string;
31
+ selectionType?: 'checkbox' | 'radio';
32
+ submitText?: React.ReactNode;
33
+ cancelText?: React.ReactNode;
34
+ filterableFieldNames?: string[];
35
+ noIgnore?: boolean;
36
+ requireSelection?: boolean;
37
+ defaultPageSize?: number;
38
+ tableProps?: Omit<TableProps<RecordType>, 'columns' | 'dataSource' | 'loading' | 'onChange' | 'pagination' | 'rowKey' | 'rowSelection'>;
39
+ }
40
+ /**
41
+ * Viewer-hosted record picker for settings pages and secondary selection
42
+ * flows. Open it with `ctx.viewer.open(...)` and pass resource loading logic
43
+ * through `request`; the component owns filter, pagination, and selection UI.
44
+ */
45
+ export declare function ResourcePickerView<RecordType extends object = Record<string, unknown>>(props: ResourcePickerViewProps<RecordType>): React.JSX.Element;
46
+ export default ResourcePickerView;
@@ -0,0 +1,50 @@
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 { Collection } from '@nocobase/flow-engine';
10
+ import React from 'react';
11
+ import { type CompiledFilter, type TableProps } from '@nocobase/client-v2';
12
+ export interface ResourceTableRequestParams {
13
+ filter?: CompiledFilter;
14
+ page: number;
15
+ pageSize: number;
16
+ }
17
+ export interface ResourceTableLoadResult<RecordType extends object> {
18
+ data: RecordType[];
19
+ total?: number;
20
+ page?: number;
21
+ pageSize?: number;
22
+ }
23
+ export interface ResourceTablePageToolbarArgs {
24
+ loading: boolean;
25
+ refresh: () => void;
26
+ refreshAsync: () => Promise<unknown>;
27
+ }
28
+ export interface ResourceTablePageProps<RecordType extends object = Record<string, unknown>> {
29
+ collection?: Collection;
30
+ columns: TableProps<RecordType>['columns'];
31
+ rowKey: TableProps<RecordType>['rowKey'];
32
+ request: (params: ResourceTableRequestParams) => Promise<ResourceTableLoadResult<RecordType>>;
33
+ t?: (key: string, options?: Record<string, unknown>) => string;
34
+ filterableFieldNames?: string[];
35
+ noIgnore?: boolean;
36
+ toolbar?: React.ReactNode | ((args: ResourceTablePageToolbarArgs) => React.ReactNode);
37
+ toolbarLayout?: 'inline' | 'split';
38
+ showRefresh?: boolean;
39
+ padding?: boolean;
40
+ defaultPageSize?: number;
41
+ fillHeight?: boolean;
42
+ tableProps?: Omit<TableProps<RecordType>, 'columns' | 'dataSource' | 'loading' | 'onChange' | 'pagination' | 'rowKey'>;
43
+ }
44
+ /**
45
+ * Settings-page table shell for resource-backed lists. It owns the common
46
+ * filter + pagination + refresh lifecycle while callers provide business
47
+ * actions, columns, and request mapping.
48
+ */
49
+ export declare function ResourceTablePage<RecordType extends object = Record<string, unknown>>(props: ResourceTablePageProps<RecordType>): React.JSX.Element;
50
+ export default ResourceTablePage;
@@ -0,0 +1,39 @@
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 ButtonProps } from 'antd';
10
+ import React from 'react';
11
+ export interface SettingsActionConfirm {
12
+ title: React.ReactNode;
13
+ description?: React.ReactNode;
14
+ okText?: React.ReactNode;
15
+ cancelText?: React.ReactNode;
16
+ }
17
+ export interface SettingsActionItem<RecordType extends object = Record<string, unknown>> {
18
+ key: React.Key;
19
+ label: React.ReactNode;
20
+ icon?: React.ReactNode;
21
+ danger?: boolean;
22
+ disabled?: boolean;
23
+ hidden?: boolean;
24
+ confirm?: SettingsActionConfirm;
25
+ buttonProps?: Omit<ButtonProps, 'children' | 'danger' | 'disabled' | 'icon' | 'onClick' | 'type'>;
26
+ onClick?: (record: RecordType) => Promise<void> | void;
27
+ }
28
+ export interface SettingsActionCellProps<RecordType extends object = Record<string, unknown>> {
29
+ record: RecordType;
30
+ actions: SettingsActionItem<RecordType>[];
31
+ showIcons?: boolean;
32
+ split?: React.ReactNode | null;
33
+ }
34
+ /**
35
+ * Compact row-action renderer for settings tables. It keeps edit/delete style
36
+ * actions visually consistent while leaving business behavior to the caller.
37
+ */
38
+ export declare function SettingsActionCell<RecordType extends object = Record<string, unknown>>(props: SettingsActionCellProps<RecordType>): React.JSX.Element;
39
+ export default SettingsActionCell;
@@ -0,0 +1,12 @@
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 * from './ResourceFormDrawer';
10
+ export * from './ResourcePickerView';
11
+ export * from './ResourceTablePage';
12
+ export * from './SettingsActionCell';
@@ -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("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-users/client-v2",["ahooks","react-i18next","@nocobase/client-v2","react-router-dom","react","antd","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-users/client-v2"]=t(require("ahooks"),require("react-i18next"),require("@nocobase/client-v2"),require("react-router-dom"),require("react"),require("antd"),require("@nocobase/flow-engine")):e["@nocobase/plugin-users/client-v2"]=t(e.ahooks,e["react-i18next"],e["@nocobase/client-v2"],e["react-router-dom"],e.react,e.antd,e["@nocobase/flow-engine"])}(self,function(e,t,r,n,o,a,i){return function(){"use strict";var u={485:function(e){e.exports=r},694:function(e){e.exports=i},625:function(t){t.exports=e},59:function(e){e.exports=a},155:function(e){e.exports=o},953:function(e){e.exports=t},442:function(e){e.exports=n}},c={};function l(e){var t=c[e];if(void 0!==t)return t.exports;var r=c[e]={exports:{}};return u[e](r,r.exports,l),r.exports}l.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return l.d(t,{a:t}),t},l.d=function(e,t){for(var r in t)l.o(t,r)&&!l.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},l.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),l.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},l.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},l.g.importScripts&&(s=l.g.location+"");var s,f=l.g.document;if(!s&&f&&(f.currentScript&&"SCRIPT"===f.currentScript.tagName.toUpperCase()&&(s=f.currentScript.src),!s)){var p=f.getElementsByTagName("script");if(p.length)for(var d=p.length-1;d>-1&&(!s||!/^http(s?):/.test(s));)s=p[d--].src}if(!s)throw Error("Automatic publicPath is not supported in this browser");l.p=s.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/");var b={};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-users/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-users/dist/client-v2/"}l.p=e}(),!function(){l.r(b),l.d(b,{PluginUsersClientV2:function(){return $},NAMESPACE:function(){return c},default:function(){return B},useUsersTranslation:function(){return s}});var e=l(485),t=l(694),r=l(625),n=l(59),o=l(155),a=l.n(o),i=l(442),u=l(953),c="users";function s(){return(0,u.useTranslation)([c,"client"],{nsMode:"fallback"})}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function p(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function d(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){p(a,n,o,i,u,"next",e)}function u(e){p(a,n,o,i,u,"throw",e)}i(void 0)})}}function h(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y(e){return(y=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function m(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r,n,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var a=[],i=!0,u=!1;try{for(o=o.call(e);!(i=(r=o.next()).done)&&(a.push(r.value),!t||a.length!==t);i=!0);}catch(e){u=!0,n=e}finally{try{i||null==o.return||o.return()}finally{if(u)throw n}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function w(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(w=function(){return!!e})()}function g(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}function P(){var u=s().t,c=(0,t.useFlowContext)(),l=(0,i.useNavigate)(),f=m(n.Form.useForm(),1)[0],p=m((0,o.useState)(!1),2),b=p[0],h=p[1],y=m((0,o.useState)(""),2),v=y[0],w=y[1],P=(0,r.useMemoizedFn)(function(e,t){return d(function(){var e,r,n,o,a,i,u,l,s,f,p,d,b;return g(this,function(h){switch(h.label){case 0:if("string"!=typeof t||!t)return[2];i=(null==(a=null==(n=c.app)||null==(r=n.pm)||null==(e=r.get)?void 0:e.call(r,$))||null==(o=a.getPasswordValidators)?void 0:o.call(a))||[],u=!0,l=!1,s=void 0,h.label=1;case 1:h.trys.push([1,6,7,8]),f=i[Symbol.iterator](),h.label=2;case 2:if(u=(p=f.next()).done)return[3,5];return[4,(0,p.value)(t,{username:void 0})];case 3:if(d=h.sent())throw Error(d);h.label=4;case 4:return u=!0,[3,2];case 5:return[3,8];case 6:return b=h.sent(),l=!0,s=b,[3,8];case 7:try{u||null==f.return||f.return()}finally{if(l)throw s}return[7];case 8:return[2]}})})()}),x=(0,r.useMemoizedFn)(function(){return d(function(){var e,t,r,n,o,a;return g(this,function(i){switch(i.label){case 0:return[4,f.validateFields()];case 1:e=i.sent(),w(""),h(!0),i.label=2;case 2:return i.trys.push([2,4,5,6]),[4,c.api.resource("auth").changePassword({values:e})];case 3:return i.sent(),f.resetFields(),l("/signin"),[3,6];case 4:throw w((null==(t=i.sent())||null==(a=t.response)||null==(o=a.data)||null==(n=o.errors)||null==(r=n[0])?void 0:r.message)||(null==t?void 0:t.message)||String(t)),t;case 5:return h(!1),[7];case 6:return[2]}})})()});return a().createElement(e.DrawerFormLayout,{title:u("Change password"),onSubmit:x,submitting:b,submitText:u("Submit"),cancelText:u("Cancel")},a().createElement(n.Form,{form:f,layout:"vertical"},v?a().createElement(n.Alert,{type:"error",showIcon:!0,message:v,style:{marginBottom:16}}):null,a().createElement(n.Form.Item,{name:"oldPassword",label:u("Old password"),rules:[{required:!0,message:u("Please enter the old password")}]},a().createElement(e.PasswordInput,{autoComplete:"current-password"})),a().createElement(n.Form.Item,{name:"newPassword",label:u("New password"),rules:[{required:!0,message:u("Please enter the new password")},{validator:P}]},a().createElement(e.PasswordInput,{autoComplete:"new-password",checkStrength:!0})),a().createElement(n.Form.Item,{name:"confirmPassword",label:u("Confirm password"),dependencies:["newPassword"],rules:[{required:!0,message:u("Please confirm the new password")},function(e){var t=e.getFieldValue;return{validator:function(e,r){return r&&t("newPassword")!==r?Promise.reject(Error(u("Password mismatch"))):Promise.resolve()}}}]},a().createElement(e.PasswordInput,{autoComplete:"new-password",checkStrength:!0}))))}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,n;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=y(t),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,w()?Reflect.construct(t,n||[],y(this).constructor):t.apply(this,n)),"section","profile"),h(e,"sort",100),h(e,"label","Change password"),e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&v(r,e),t=[{key:"prepare",value:function(){return d(function(){var e,t,r;return g(this,function(n){switch(n.label){case 0:return[4,this.context.systemSettings.load()];case 1:return r=null==(t=n.sent())||null==(e=t.data)?void 0:e.enableChangePassword,this.ready=!1!==r,[2]}})}).call(this)}},{key:"onClick",value:function(){return d(function(){return g(this,function(e){return this.context.viewer.drawer({width:"50%",closable:!0,content:function(){return a().createElement(P,null)}}),[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}(e.UserCenterActionItemModel);function O(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){r(e);return}u.done?t(c):Promise.resolve(c).then(n,o)}function S(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var a=e.apply(t,r);function i(e){O(a,n,o,i,u,"next",e)}function u(e){O(a,n,o,i,u,"throw",e)}i(void 0)})}}function j(e,t,r){return t=T(t),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}(e,A()?Reflect.construct(t,r||[],T(e).constructor):t.apply(e,r))}function _(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function k(e,t,r){return(k=A()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&q(o,r.prototype),o}).apply(null,arguments)}function E(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)}}function C(e,t,r){return t&&E(e.prototype,t),r&&E(e,r),e}function I(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function T(e){return(T=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function M(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&q(e,t)}function q(e,t){return(q=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function F(e){var t="function"==typeof Map?new Map:void 0;return(F=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 k(e,arguments,T(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),q(r,e)})(e)}function A(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(A=function(){return!!e})()}function V(e,t){var r,n,o,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},i=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(i,"next",{value:c(0)}),u(i,"throw",{value:c(1)}),u(i,"return",{value:c(2)}),"function"==typeof Symbol&&u(i,Symbol.iterator,{value:function(){return this}}),i;function c(u){return function(c){var l=[u,c];if(r)throw TypeError("Generator is already executing.");for(;i&&(i=0,l[0]&&(a=0)),a;)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 a.label++,{value:l[1],done:!1};case 5:a.label++,n=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(o=(o=a.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){a.label=l[1];break}if(6===l[0]&&a.label<o[1]){a.label=o[1],o=l;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(l);break}o[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}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}}}}h(x,"itemId","change-password");var R=function(e){function t(){var e;return _(this,t),e=j(this,t,arguments),I(e,"section","profile"),I(e,"sort",0),e}return M(t,e),C(t,[{key:"prepare",value:function(){return S(function(){var e;return V(this,function(t){return e=this.context.user||{},this.label=e.nickname||e.username||e.email||"",this.value=void 0,this.description=void 0,this.ready=!!this.label,[2]})}).call(this)}}]),t}(e.UserCenterTextItemModel);I(R,"itemId","current-user-summary");var U=function(t){function r(){var e;return _(this,r),e=j(this,r,arguments),I(e,"section","danger"),I(e,"sort",1e3),I(e,"label","Sign out"),e}return M(r,t),C(r,[{key:"onClick",value:function(){return S(function(){var t,r,n,o;return V(this,function(a){switch(a.label){case 0:return[4,this.context.api.auth.signOut()];case 1:if(n=a.sent(),o=(0,e.resolveV2SigninRedirect)(null==n||null==(r=n.data)||null==(t=r.data)?void 0:t.redirect,this.context.app))return window.location.replace(o),[2];return(0,e.redirectToV2Signin)(this.context.app,(0,e.getCurrentV2RedirectPath)(this.context.app,window.location),{replace:!0}),[2]}})}).call(this)}}]),r}(e.UserCenterActionItemModel);I(U,"itemId","sign-out");var $=function(e){function t(){var e;return _(this,t),e=j(this,t,arguments),I(e,"passwordValidators",new Map),e}return M(t,e),C(t,[{key:"registerPasswordValidator",value:function(e,t){this.passwordValidators.set(e,t)}},{key:"unregisterPasswordValidator",value:function(e){this.passwordValidators.delete(e)}},{key:"getPasswordValidators",value:function(){return Array.from(this.passwordValidators.values())}},{key:"load",value:function(){return S(function(){return V(this,function(e){return this.app.flowEngine.registerModels({ChangePasswordItemModel:x,CurrentUserSummaryItemModel:R,SignOutItemModel:U}),[2]})}).call(this)}}]),t}(F(e.Plugin)),B=$}(),b}()});
10
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("ahooks"),require("@emotion/css"),require("@nocobase/plugin-acl/client-v2"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):"function"==typeof define&&define.amd?define("@nocobase/plugin-users/client-v2",["ahooks","@emotion/css","@nocobase/plugin-acl/client-v2","@nocobase/client-v2","react","antd","@ant-design/icons","@nocobase/flow-engine"],t):"object"==typeof exports?exports["@nocobase/plugin-users/client-v2"]=t(require("ahooks"),require("@emotion/css"),require("@nocobase/plugin-acl/client-v2"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@ant-design/icons"),require("@nocobase/flow-engine")):e["@nocobase/plugin-users/client-v2"]=t(e.ahooks,e["@emotion/css"],e["@nocobase/plugin-acl/client-v2"],e["@nocobase/client-v2"],e.react,e.antd,e["@ant-design/icons"],e["@nocobase/flow-engine"])}(self,function(e,t,n,r,o,i,u,a){return function(){"use strict";var c,s,l,f,p,d={667:function(e,t,n){n.d(t,{X:function(){return p}});var r=n(485),o=n(762),i=n.n(o);function u(e,t,n,r,o,i,u){try{var a=e[i](u),c=a.value}catch(e){n(e);return}a.done?t(c):Promise.resolve(c).then(r,o)}function a(e,t,n){return(a=f()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&s(o,n.prototype),o}).apply(null,arguments)}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function l(e){var t="function"==typeof Map?new Map:void 0;return(l=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,n)}function n(){return a(e,arguments,c(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),s(n,e)})(e)}function f(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(f=function(){return!!e})()}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,n,o,i,u;if(!(this instanceof r))throw TypeError("Cannot call a class as a function");return t=r,n=arguments,t=c(t),o=e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"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(t,n||[],c(this).constructor):t.apply(this,n)),i="passwordValidators",u=new Map,i in o?Object.defineProperty(o,i,{value:u,enumerable:!0,configurable:!0,writable:!0}):o[i]=u,e}return r.prototype=Object.create(e&&e.prototype,{constructor:{value:r,writable:!0,configurable:!0}}),e&&s(r,e),t=[{key:"registerPasswordValidator",value:function(e,t){this.passwordValidators.set(e,t)}},{key:"unregisterPasswordValidator",value:function(e){this.passwordValidators.delete(e)}},{key:"getPasswordValidators",value:function(){return Array.from(this.passwordValidators.values())}},{key:"load",value:function(){var e;return(e=function(){var e;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),a=Object.defineProperty;return a(u,"next",{value:c(0)}),a(u,"throw",{value:c(1)}),a(u,"return",{value:c(2)}),"function"==typeof Symbol&&a(u,Symbol.iterator,{value:function(){return this}}),u;function c(a){return function(c){var s=[a,c];if(n)throw TypeError("Generator is already executing.");for(;u&&(u=0,s[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&s[0]?r.return:s[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,s[1])).done)return o;switch(r=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return i.label++,{value:s[1],done:!1};case 5:i.label++,r=s[1],s=[0];continue;case 7:s=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===s[0]||2===s[0])){i=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){i.label=s[1];break}if(6===s[0]&&i.label<o[1]){i.label=o[1],o=s;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(s);break}o[2]&&i.ops.pop(),i.trys.pop();continue}s=t.call(e,i)}catch(e){s=[6,e],r=0}finally{n=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}}(this,function(t){return this.pluginSettingsManager.has("users-permissions")||this.pluginSettingsManager.addMenuItem({key:"users-permissions",title:this.t("Users & Permissions"),isPinned:!0,sort:200,icon:"TeamOutlined",showTabs:!0}),this.pluginSettingsManager.addPageTabItem({menuKey:"users-permissions",key:"users",title:this.t("Users"),icon:"UserOutlined",aclSnippet:"pm.users",sort:2,componentLoader:function(){return Promise.all([n.e("564"),n.e("470")]).then(n.bind(n,757))}}),null==(e=this.app.pm.get(i()))||e.rolesManager.add("users",{title:String(this.t("Users")),sort:10,componentLoader:function(){return Promise.all([n.e("564"),n.e("521")]).then(n.bind(n,240))}}),this.app.flowEngine.registerModelLoaders({EditProfileItemModel:{extends:"UserCenterItemModel",loader:function(){return n.e("784").then(n.bind(n,467))}},UserPasswordFieldModel:{extends:"PasswordFieldModel",loader:function(){return n.e("569").then(n.bind(n,552))}},UserRolesSelectFieldModel:{extends:"RecordSelectFieldModel",loader:function(){return n.e("143").then(n.bind(n,466))}},UserCreateFormModel:{extends:"CreateFormModel",loader:function(){return n.e("914").then(n.bind(n,649))}},UserEditFormModel:{extends:"EditFormModel",loader:function(){return n.e("914").then(n.bind(n,649))}},ChangePasswordItemModel:{extends:"UserCenterItemModel",loader:function(){return n.e("862").then(n.bind(n,381))}},CurrentUserSummaryItemModel:{extends:"UserCenterItemModel",loader:function(){return n.e("587").then(n.bind(n,638))}},SignOutItemModel:{extends:"UserCenterItemModel",loader:function(){return n.e("786").then(n.bind(n,241))}}}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){u(i,r,o,a,c,"next",e)}function c(e){u(i,r,o,a,c,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(r.prototype,t),r}(l(r.Plugin));t.A=p},488:function(e,t,n){n.d(t,{CU:function(){return i},MZ:function(){return c},kj:function(){return a},nK:function(){return u}});var r=n(694);function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}var i="@nocobase/plugin-users";function u(){return{t:a()}}function a(){var e=(0,r.useFlowEngine)();return function(t,n){return e.context.t(t,o({ns:[i,"users","client"]},n))}}function c(e,t){return(0,r.tExpr)(e,o({ns:[i,"users","client"]},t))}},375:function(e){e.exports=u},477:function(e){e.exports=t},485:function(e){e.exports=r},694:function(e){e.exports=a},762:function(e){e.exports=n},625:function(t){t.exports=e},59:function(e){e.exports=i},155:function(e){e.exports=o}},b={};function h(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}};return d[e](n,n.exports,h),n.exports}h.m=d,h.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return h.d(t,{a:t}),t},h.d=function(e,t){for(var n in t)h.o(t,n)&&!h.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},h.f={},h.e=function(e){return Promise.all(Object.keys(h.f).reduce(function(t,n){return h.f[n](e,t),t},[]))},h.u=function(e){return""+e+"."+({143:"8fc4573e64ec8c3f",470:"8f84a05a59c40a98",521:"0916f57839371256",564:"2f27ca5dcd50632f",569:"07f16da700ba0ba6",587:"a15f1f5b0dbbf4d5",784:"25ee62a1613da5a6",786:"ca0dea7bc67662c3",862:"2aac0dea47472edf",914:"d3af69c936276d49"})[e]+".js"},h.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),h.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},h.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,i,u=document.getElementsByTagName("script"),a=0;a<u.length;a++){var c=u[a];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-users/client-v2:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,h.nc&&o.setAttribute("nonce",h.nc),o.setAttribute("data-rspack","@nocobase/plugin-users/client-v2:"+n),o.src=e),v[e]=[t];var s=function(t,n){o.onerror=o.onload=null,clearTimeout(l);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=s.bind(null,o.onerror),o.onload=s.bind(null,o.onload),i&&document.head.appendChild(o)},h.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},h.g.importScripts&&(g=h.g.location+"");var v,g,y=h.g.document;if(!g&&y&&(y.currentScript&&"SCRIPT"===y.currentScript.tagName.toUpperCase()&&(g=y.currentScript.src),!g)){var m=y.getElementsByTagName("script");if(m.length)for(var w=m.length-1;w>-1&&(!g||!/^http(s?):/.test(g));)g=m[w--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");h.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),c={889:0},h.f.j=function(e,t){var n=h.o(c,e)?c[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=c[e]=[t,r]});t.push(n[2]=r);var o=h.p+h.u(e),i=Error();h.l(o,function(t){if(h.o(c,e)&&(0!==(n=c[e])&&(c[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},s=function(e,t){var n,r,o=t[0],i=t[1],u=t[2],a=0;if(o.some(function(e){return 0!==c[e]})){for(n in i)h.o(i,n)&&(h.m[n]=i[n]);u&&u(h)}for(e&&e(t);a<o.length;a++)r=o[a],h.o(c,r)&&c[r]&&c[r][0](),c[r]=0},(l=self.webpackChunk_nocobase_plugin_users_client_v2=self.webpackChunk_nocobase_plugin_users_client_v2||[]).forEach(s.bind(null,0)),l.push=s.bind(null,l.push.bind(l));var _={};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 n=window.__webpack_public_path__||"";n&&("/"!==n.charAt(n.length-1)&&(n+="/"),e=n+"static/plugins/@nocobase/plugin-users/dist/client-v2/")}if(!e){var r=window.__nocobase_modern_client_prefix__||"v",o="/"+(r=String(r).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var i=window.location.pathname||"/",u=i.indexOf(o);e=u>=0?i.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+r+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-users/dist/client-v2/"}h.p=e}(),h.r(_),h.d(_,{NAMESPACE:function(){return p.CU},PluginUsersClientV2:function(){return f.X},default:function(){return f.A},tExpr:function(){return p.MZ},useT:function(){return p.kj},useUsersTranslation:function(){return p.nK}}),f=h(667),p=h(488),_}()});
@@ -6,5 +6,9 @@
6
6
  * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
- export declare const NAMESPACE = "users";
10
- export declare function useUsersTranslation(): import("react-i18next").UseTranslationResponse<("users" | "client")[], undefined>;
9
+ export declare const NAMESPACE = "@nocobase/plugin-users";
10
+ export declare function useUsersTranslation(): {
11
+ t: (key: string, options?: Record<string, unknown>) => string;
12
+ };
13
+ export declare function useT(): (key: string, options?: Record<string, unknown>) => string;
14
+ export declare function tExpr(key: string, options?: Record<string, unknown>): string;
@@ -0,0 +1,16 @@
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 { PasswordFieldModel } from '@nocobase/client-v2';
10
+ import React from 'react';
11
+ export declare class UserPasswordFieldModel extends PasswordFieldModel {
12
+ private readonly validatePassword;
13
+ private getUsernameForValidation;
14
+ private ensurePasswordValidationRule;
15
+ render(): React.JSX.Element;
16
+ }
@@ -0,0 +1,19 @@
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 { CreateFormModel, EditFormModel } from '@nocobase/client-v2';
10
+ import React from 'react';
11
+ export declare class UserCreateFormModel extends CreateFormModel {
12
+ onInit(options: any): void;
13
+ renderComponent(): React.JSX.Element;
14
+ }
15
+ export declare class UserEditFormModel extends EditFormModel {
16
+ onInit(options: any): void;
17
+ handlePageChange: (page: number) => Promise<void>;
18
+ renderComponent(): React.JSX.Element;
19
+ }
@@ -0,0 +1,14 @@
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
+ /// <reference types="react" />
10
+ import { RecordSelectFieldModel } from '@nocobase/client-v2';
11
+ export declare class UserRolesSelectFieldModel extends RecordSelectFieldModel {
12
+ private ensureResourceRequestDefaults;
13
+ render(): import("react").JSX.Element;
14
+ }
@@ -0,0 +1,15 @@
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 React from 'react';
10
+ import type { User } from './types';
11
+ export interface ChangeUserPasswordDrawerProps {
12
+ user: User;
13
+ onSubmitted: () => Promise<void> | void;
14
+ }
15
+ export default function ChangeUserPasswordDrawer(props: ChangeUserPasswordDrawerProps): React.JSX.Element;
@@ -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 { RoleTabProps } from '@nocobase/plugin-acl/client-v2';
10
+ import React from 'react';
11
+ export default function RoleUsersManager(props: RoleTabProps): React.JSX.Element;
@@ -0,0 +1,15 @@
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 React from 'react';
10
+ import type { User } from './types';
11
+ export interface UserFormDrawerProps {
12
+ user?: User;
13
+ onSubmitted: () => Promise<void> | void;
14
+ }
15
+ export default function UserFormDrawer(props: UserFormDrawerProps): React.JSX.Element;
@@ -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
+ import React from 'react';
10
+ export default function UsersManagementPage(): React.JSX.Element;
@@ -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
+ import React from 'react';
10
+ export default function UsersSettingsForm(): React.JSX.Element;
@@ -0,0 +1,30 @@
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 interface Role {
10
+ name: string;
11
+ title: string;
12
+ }
13
+ export interface User {
14
+ id: number;
15
+ nickname?: string;
16
+ username?: string;
17
+ email?: string;
18
+ phone?: string;
19
+ roles?: Role[];
20
+ }
21
+ export interface ListPayload<RecordType extends object> {
22
+ data?: RecordType[];
23
+ meta?: {
24
+ page?: number;
25
+ pageSize?: number;
26
+ total?: number;
27
+ count?: number;
28
+ };
29
+ }
30
+ export declare function toListPayload<RecordType extends object>(responseData: unknown): ListPayload<RecordType>;
@@ -0,0 +1,15 @@
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 { CreateModelOptions } from '@nocobase/flow-engine';
10
+ export declare const ADMIN_PROFILE_CREATE_FORM_MODEL_UID = "nocobase-admin-profile-create-form-2";
11
+ export declare const ADMIN_PROFILE_EDIT_FORM_MODEL_UID = "nocobase-admin-profile-edit-form-2";
12
+ type FlowModelTree = CreateModelOptions & Record<string, unknown>;
13
+ export declare function buildAdminProfileCreateFormModel(): FlowModelTree;
14
+ export declare function buildAdminProfileEditFormModel(): FlowModelTree;
15
+ export {};
@@ -0,0 +1,9 @@
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 generatePassword: (length?: number) => string;
@@ -0,0 +1,16 @@
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 { UserCenterTextItemModel } from '@nocobase/client-v2';
10
+ export declare class CurrentUserSummaryItemModel extends UserCenterTextItemModel {
11
+ static itemId: string;
12
+ section: "profile";
13
+ sort: number;
14
+ prepare(): Promise<void>;
15
+ }
16
+ export default CurrentUserSummaryItemModel;
@@ -0,0 +1,18 @@
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 { UserCenterActionItemModel } from '@nocobase/client-v2';
10
+ export declare class EditProfileItemModel extends UserCenterActionItemModel {
11
+ static itemId: string;
12
+ section: "profile";
13
+ sort: number;
14
+ label: string;
15
+ prepare(): Promise<void>;
16
+ onClick(): Promise<void>;
17
+ }
18
+ export default EditProfileItemModel;
@@ -0,0 +1,17 @@
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 { UserCenterActionItemModel } from '@nocobase/client-v2';
10
+ export declare class SignOutItemModel extends UserCenterActionItemModel {
11
+ static itemId: string;
12
+ section: "danger";
13
+ sort: number;
14
+ label: string;
15
+ onClick(): Promise<void>;
16
+ }
17
+ export default SignOutItemModel;
@@ -13,20 +13,22 @@ module.exports = {
13
13
  "react-i18next": "11.18.6",
14
14
  "react-router-dom": "6.30.1",
15
15
  "react": "18.2.0",
16
- "@nocobase/client": "2.1.0-alpha.45",
16
+ "@nocobase/client": "2.1.0-alpha.46",
17
17
  "antd": "5.24.2",
18
18
  "@formily/core": "2.3.7",
19
- "@nocobase/plugin-acl": "2.1.0-alpha.45",
19
+ "@nocobase/plugin-acl": "2.1.0-alpha.46",
20
20
  "@emotion/css": "11.13.0",
21
- "@nocobase/utils": "2.1.0-alpha.45",
22
- "@nocobase/client-v2": "2.1.0-alpha.45",
23
- "@nocobase/database": "2.1.0-alpha.45",
24
- "@nocobase/server": "2.1.0-alpha.45",
25
- "@nocobase/plugin-user-data-sync": "2.1.0-alpha.45",
26
- "@nocobase/plugin-ui-schema-storage": "2.1.0-alpha.45",
21
+ "@nocobase/utils": "2.1.0-alpha.46",
22
+ "@nocobase/flow-engine": "2.1.0-alpha.46",
23
+ "@nocobase/client-v2": "2.1.0-alpha.46",
24
+ "@nocobase/database": "2.1.0-alpha.46",
25
+ "@nocobase/server": "2.1.0-alpha.46",
26
+ "@nocobase/plugin-user-data-sync": "2.1.0-alpha.46",
27
+ "@nocobase/plugin-ui-schema-storage": "2.1.0-alpha.46",
28
+ "@nocobase/logger": "2.1.0-alpha.46",
27
29
  "lodash": "4.18.1",
28
- "@nocobase/flow-engine": "2.1.0-alpha.45",
29
30
  "ahooks": "3.7.8",
30
- "@nocobase/actions": "2.1.0-alpha.45",
31
+ "@ant-design/icons": "5.6.1",
32
+ "@nocobase/actions": "2.1.0-alpha.46",
31
33
  "sequelize": "6.35.2"
32
34
  };