@zero-bits/taro-components 1.0.6 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,35 @@
1
- var _0x41d788=_0xaa64;(function(_0x50c766,_0x1e026e){var _0x21a0ea=_0xaa64,_0x4d7363=_0x50c766();while(!![]){try{var _0x24ac3a=parseInt(_0x21a0ea(0xef))/0x1*(-parseInt(_0x21a0ea(0xf0))/0x2)+parseInt(_0x21a0ea(0xfc))/0x3*(parseInt(_0x21a0ea(0xf5))/0x4)+-parseInt(_0x21a0ea(0xfb))/0x5*(parseInt(_0x21a0ea(0xf3))/0x6)+-parseInt(_0x21a0ea(0xf8))/0x7*(parseInt(_0x21a0ea(0xf2))/0x8)+-parseInt(_0x21a0ea(0xf7))/0x9+-parseInt(_0x21a0ea(0xf9))/0xa+-parseInt(_0x21a0ea(0xee))/0xb*(-parseInt(_0x21a0ea(0xf6))/0xc);if(_0x24ac3a===_0x1e026e)break;else _0x4d7363['push'](_0x4d7363['shift']());}catch(_0xb018c2){_0x4d7363['push'](_0x4d7363['shift']());}}}(_0x13fd,0xc6e98));import{useSyncExternalStore,useEffect,useRef}from'react';import{PermissionContext}from'../../context';import{jsx as _0x4b3b82}from'react/jsx-runtime';function PermissionProvider(_0x293068){var _0x10a750=_0xaa64,_0x4fcab7=_0x293068['children'],_0x7b0a9a=_0x293068['store'],_0x429ab4=_0x293068[_0x10a750(0xfd)],_0x3d1618=useSyncExternalStore(_0x7b0a9a['subscribe'],_0x7b0a9a[_0x10a750(0x100)]),_0x12a64b=useRef(_0x3d1618[_0x10a750(0xf4)]);return useEffect(function(){var _0x128c2e=_0x10a750;if(_0x12a64b[_0x128c2e(0xf1)]&&!_0x3d1618['isGranted'])_0x429ab4===null||_0x429ab4===void 0x0||_0x429ab4();_0x12a64b[_0x128c2e(0xf1)]=_0x3d1618[_0x128c2e(0xf4)];},[_0x3d1618[_0x10a750(0xf4)],_0x429ab4]),_0x4b3b82(PermissionContext[_0x10a750(0xfe)],{'value':_0x3d1618,'children':_0x4fcab7});}function _0x13fd(){var _0x4b40fe=['onDenied','Provider','displayName','getSnapshot','19921cCJrXZ','2981LRvtqY','638uETqHG','current','86744KjBEtU','168XYoFxG','isGranted','4fSGJjP','21036JPgkax','2232378cNReFD','469wBZWoZ','4608320rhEoAw','PermissionProvider','31020PdWela','600201IbwHWs'];_0x13fd=function(){return _0x4b40fe;};return _0x13fd();}function _0xaa64(_0x1a37ef,_0x577501){_0x1a37ef=_0x1a37ef-0xee;var _0x13fd32=_0x13fd();var _0xaa6416=_0x13fd32[_0x1a37ef];return _0xaa6416;}PermissionProvider[_0x41d788(0xff)]=_0x41d788(0xfa);export default PermissionProvider;
1
+ import { useSyncExternalStore, useEffect, useRef } from 'react';
2
+ import { PermissionContext } from "../../context";
3
+
4
+ /**
5
+ * 权限组件 Provider 的属性
6
+ *
7
+ * @template P - 权限对象类型
8
+ * @template U - 用户对象类型
9
+ */
10
+ import { jsx as _jsx } from "react/jsx-runtime";
11
+ /**
12
+ * 权限组件的入口 Provider,通常包裹在 App 根节点
13
+ *
14
+ * @template P - 权限对象类型
15
+ * @template U - 用户对象类型
16
+ * @param {PermissionProviderProps<P, U>} props - 组件属性
17
+ * @returns {JSX.Element}
18
+ */
19
+ function PermissionProvider(_ref) {
20
+ var children = _ref.children,
21
+ store = _ref.store,
22
+ onDenied = _ref.onDenied;
23
+ var state = useSyncExternalStore(store.subscribe, store.getSnapshot);
24
+ var prevGrantedRef = useRef(state.isGranted);
25
+ useEffect(function () {
26
+ if (prevGrantedRef.current && !state.isGranted) onDenied === null || onDenied === void 0 || onDenied();
27
+ prevGrantedRef.current = state.isGranted;
28
+ }, [state.isGranted, onDenied]);
29
+ return /*#__PURE__*/_jsx(PermissionContext.Provider, {
30
+ value: state,
31
+ children: children
32
+ });
33
+ }
34
+ PermissionProvider.displayName = 'PermissionProvider';
35
+ export default PermissionProvider;
@@ -1 +1,2 @@
1
- (function(_0x149874,_0x511f7a){var _0x50c7de=_0x519f,_0x547936=_0x149874();while(!![]){try{var _0x26afc7=parseInt(_0x50c7de(0x1a8))/0x1+-parseInt(_0x50c7de(0x1a9))/0x2*(-parseInt(_0x50c7de(0x1a5))/0x3)+parseInt(_0x50c7de(0x1a4))/0x4*(parseInt(_0x50c7de(0x1ad))/0x5)+parseInt(_0x50c7de(0x1a1))/0x6*(parseInt(_0x50c7de(0x1a2))/0x7)+-parseInt(_0x50c7de(0x1a6))/0x8*(-parseInt(_0x50c7de(0x1a3))/0x9)+-parseInt(_0x50c7de(0x1ab))/0xa*(parseInt(_0x50c7de(0x1ac))/0xb)+parseInt(_0x50c7de(0x1aa))/0xc*(-parseInt(_0x50c7de(0x1a7))/0xd);if(_0x26afc7===_0x511f7a)break;else _0x547936['push'](_0x547936['shift']());}catch(_0x34d603){_0x547936['push'](_0x547936['shift']());}}}(_0x3d93,0xee6ae));function _0x519f(_0xdf8b12,_0x2363e1){_0xdf8b12=_0xdf8b12-0x1a1;var _0x3d938e=_0x3d93();var _0x519ffa=_0x3d938e[_0xdf8b12];return _0x519ffa;}function _0x3d93(){var _0x4ce632=['207XZIhHr','7180WFFcgI','3wUzodO','381632BWxFzk','126724gqbumo','1371751KMaPdy','733142kPajvN','3804OxFOFb','10541030DZxhaI','11zPwNhp','3545dsIQce','189864EyFvCy','224GFiyeQ'];_0x3d93=function(){return _0x4ce632;};return _0x3d93();}export{default as PermissionProvider}from'./PermissionProvider';export{createPermissionStore}from'./store';
1
+ export { default as PermissionProvider } from "./PermissionProvider";
2
+ export { createPermissionStore } from "./store";
@@ -1 +1,158 @@
1
- (function(_0x439385,_0x2a89a0){var _0xfe178d=_0x1829,_0x21336f=_0x439385();while(!![]){try{var _0x58bef3=-parseInt(_0xfe178d(0x14f))/0x1+parseInt(_0xfe178d(0x14d))/0x2+-parseInt(_0xfe178d(0x17b))/0x3+-parseInt(_0xfe178d(0x165))/0x4*(-parseInt(_0xfe178d(0x164))/0x5)+-parseInt(_0xfe178d(0x151))/0x6+parseInt(_0xfe178d(0x16d))/0x7*(parseInt(_0xfe178d(0x16e))/0x8)+parseInt(_0xfe178d(0x167))/0x9;if(_0x58bef3===_0x2a89a0)break;else _0x21336f['push'](_0x21336f['shift']());}catch(_0x2d615a){_0x21336f['push'](_0x21336f['shift']());}}}(_0x1b49,0x2fe2d));function _typeof(_0x531e01){'@babel/helpers - typeof';var _0x2ddf81=_0x1829;return _typeof=_0x2ddf81(0x16c)==typeof Symbol&&_0x2ddf81(0x16f)==typeof Symbol[_0x2ddf81(0x158)]?function(_0x39afa6){return typeof _0x39afa6;}:function(_0x2f97e0){var _0x2c4c4a=_0x2ddf81;return _0x2f97e0&&_0x2c4c4a(0x16c)==typeof Symbol&&_0x2f97e0[_0x2c4c4a(0x160)]===Symbol&&_0x2f97e0!==Symbol[_0x2c4c4a(0x14e)]?'symbol':typeof _0x2f97e0;},_typeof(_0x531e01);}function ownKeys(_0x4c026f,_0xf2a691){var _0x2f7aa2=_0x1829,_0x16a99=Object[_0x2f7aa2(0x170)](_0x4c026f);if(Object[_0x2f7aa2(0x15f)]){var _0x54fc0c=Object['getOwnPropertySymbols'](_0x4c026f);_0xf2a691&&(_0x54fc0c=_0x54fc0c['filter'](function(_0x578747){var _0x2b8851=_0x2f7aa2;return Object[_0x2b8851(0x150)](_0x4c026f,_0x578747)['enumerable'];})),_0x16a99['push']['apply'](_0x16a99,_0x54fc0c);}return _0x16a99;}function _objectSpread(_0x377d41){var _0x14bc78=_0x1829;for(var _0x5276cf=0x1;_0x5276cf<arguments[_0x14bc78(0x154)];_0x5276cf++){var _0x281ea8=null!=arguments[_0x5276cf]?arguments[_0x5276cf]:{};_0x5276cf%0x2?ownKeys(Object(_0x281ea8),!0x0)[_0x14bc78(0x173)](function(_0x285425){_defineProperty(_0x377d41,_0x285425,_0x281ea8[_0x285425]);}):Object[_0x14bc78(0x162)]?Object[_0x14bc78(0x15e)](_0x377d41,Object[_0x14bc78(0x162)](_0x281ea8)):ownKeys(Object(_0x281ea8))[_0x14bc78(0x173)](function(_0x398e9f){var _0x2bfffe=_0x14bc78;Object[_0x2bfffe(0x16a)](_0x377d41,_0x398e9f,Object[_0x2bfffe(0x150)](_0x281ea8,_0x398e9f));});}return _0x377d41;}function _classCallCheck(_0x56084d,_0x32ad94){var _0x261147=_0x1829;if(!(_0x56084d instanceof _0x32ad94))throw new TypeError(_0x261147(0x17d));}function _defineProperties(_0x5052f3,_0x419599){var _0x3c9b58=_0x1829;for(var _0x29ba99=0x0;_0x29ba99<_0x419599[_0x3c9b58(0x154)];_0x29ba99++){var _0x410c6a=_0x419599[_0x29ba99];_0x410c6a[_0x3c9b58(0x178)]=_0x410c6a[_0x3c9b58(0x178)]||![],_0x410c6a[_0x3c9b58(0x17c)]=!![];if('value'in _0x410c6a)_0x410c6a['writable']=!![];Object[_0x3c9b58(0x16a)](_0x5052f3,_toPropertyKey(_0x410c6a[_0x3c9b58(0x15a)]),_0x410c6a);}}function _createClass(_0x506cbf,_0x48ba98,_0x369b34){var _0xc295a4=_0x1829;if(_0x48ba98)_defineProperties(_0x506cbf[_0xc295a4(0x14e)],_0x48ba98);if(_0x369b34)_defineProperties(_0x506cbf,_0x369b34);return Object[_0xc295a4(0x16a)](_0x506cbf,_0xc295a4(0x14e),{'writable':![]}),_0x506cbf;}function _defineProperty(_0x588de5,_0x22c503,_0x5e03c4){var _0x2d080f=_0x1829;return _0x22c503=_toPropertyKey(_0x22c503),_0x22c503 in _0x588de5?Object[_0x2d080f(0x16a)](_0x588de5,_0x22c503,{'value':_0x5e03c4,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x588de5[_0x22c503]=_0x5e03c4,_0x588de5;}function _toPropertyKey(_0x526963){var _0x496533=_0x1829,_0x21157f=_toPrimitive(_0x526963,_0x496533(0x15c));return _0x496533(0x16f)==_typeof(_0x21157f)?_0x21157f:String(_0x21157f);}function _toPrimitive(_0x29387b,_0x2b7185){var _0x1e0428=_0x1829;if(_0x1e0428(0x176)!=_typeof(_0x29387b)||!_0x29387b)return _0x29387b;var _0x47bd57=_0x29387b[Symbol[_0x1e0428(0x166)]];if(void 0x0!==_0x47bd57){var _0x24dc12=_0x47bd57[_0x1e0428(0x163)](_0x29387b,_0x2b7185||_0x1e0428(0x161));if(_0x1e0428(0x176)!=_typeof(_0x24dc12))return _0x24dc12;throw new TypeError(_0x1e0428(0x15d));}return(_0x1e0428(0x15c)===_0x2b7185?String:Number)(_0x29387b);}var PermissionStore=(function(){function _0x39ce7f(_0x318a15){var _0x10ea13=_0x1829,_0x4fb6bc=this;_classCallCheck(this,_0x39ce7f),_defineProperty(this,_0x10ea13(0x174),void 0x0),_defineProperty(this,_0x10ea13(0x168),new Set()),_defineProperty(this,_0x10ea13(0x152),void 0x0),_defineProperty(this,_0x10ea13(0x172),function(){var _0x17b54d=_0x10ea13;return _0x4fb6bc[_0x17b54d(0x174)];}),_defineProperty(this,_0x10ea13(0x156),function(){var _0x131af7=_0x10ea13;return _0x4fb6bc[_0x131af7(0x174)];}),_defineProperty(this,_0x10ea13(0x155),function(_0x260598){var _0x2da389=_0x10ea13;return _0x4fb6bc[_0x2da389(0x168)]['add'](_0x260598),function(){var _0x4d2c99=_0x2da389;return _0x4fb6bc[_0x4d2c99(0x168)][_0x4d2c99(0x171)](_0x260598);};}),_defineProperty(this,_0x10ea13(0x17e),function(){var _0x1d0fc6=_0x10ea13;_0x4fb6bc['listeners'][_0x1d0fc6(0x173)](function(_0x576851){return _0x576851();});}),_defineProperty(this,_0x10ea13(0x16b),function(_0x11f8bd,_0x3c50ab){var _0x30a9aa=_0x10ea13;_0x4fb6bc[_0x30a9aa(0x175)][_0x30a9aa(0x180)](_0x11f8bd),_0x3c50ab!==undefined&&_0x4fb6bc[_0x30a9aa(0x175)]['saveUser'](_0x3c50ab),_0x4fb6bc[_0x30a9aa(0x174)]=_0x4fb6bc['buildState'](_0x11f8bd,_0x3c50ab),_0x4fb6bc[_0x30a9aa(0x17e)]();}),_defineProperty(this,_0x10ea13(0x169),function(){var _0x109d74=_0x10ea13;_0x4fb6bc[_0x109d74(0x175)][_0x109d74(0x15b)](),_0x4fb6bc[_0x109d74(0x174)]=_0x4fb6bc[_0x109d74(0x179)](),_0x4fb6bc[_0x109d74(0x17e)]();}),_defineProperty(this,_0x10ea13(0x17f),function(_0x50ee9d){var _0x166f84=_0x10ea13,_0x191ced=_objectSpread(_objectSpread({},_0x4fb6bc[_0x166f84(0x174)][_0x166f84(0x157)]),_0x50ee9d);_0x4fb6bc[_0x166f84(0x175)]['saveUser'](_0x191ced),_0x4fb6bc[_0x166f84(0x174)]=_0x4fb6bc[_0x166f84(0x179)](_0x4fb6bc[_0x166f84(0x174)]['permission'],_0x191ced),_0x4fb6bc['emitChange']();}),_defineProperty(this,'updatePermission',function(_0x578776){var _0x691df9=_0x10ea13,_0x470f51=_objectSpread(_objectSpread({},_0x4fb6bc['state'][_0x691df9(0x17a)]),_0x578776);_0x4fb6bc['adapter']['savePermission'](_0x470f51),_0x4fb6bc[_0x691df9(0x174)]=_0x4fb6bc[_0x691df9(0x179)](_0x470f51,_0x4fb6bc[_0x691df9(0x174)][_0x691df9(0x157)]),_0x4fb6bc['emitChange']();}),_defineProperty(this,_0x10ea13(0x153),function(){var _0x322698=_0x10ea13;_0x4fb6bc[_0x322698(0x168)][_0x322698(0x15b)]();}),this[_0x10ea13(0x175)]=_0x318a15,this[_0x10ea13(0x152)]={'granted':this[_0x10ea13(0x16b)],'denied':this[_0x10ea13(0x169)],'updateUser':this[_0x10ea13(0x17f)],'updatePermission':this[_0x10ea13(0x159)]};var _0x58090c=_0x318a15['loadPermission'](),_0x46f6c4=_0x318a15[_0x10ea13(0x177)]();this[_0x10ea13(0x174)]=this['buildState'](_0x58090c instanceof Promise?undefined:_0x58090c,_0x46f6c4 instanceof Promise?undefined:_0x46f6c4);}return _createClass(_0x39ce7f,[{'key':'buildState','value':function _0x59e57c(_0x5bc61e,_0x201790){var _0x11626d=_0x1829;return _objectSpread(_objectSpread({},this[_0x11626d(0x152)]),{},{'permission':_0x5bc61e,'user':_0x201790,'isGranted':!!_0x5bc61e});}}]),_0x39ce7f;}());function _0x1829(_0x4f9271,_0x101ab5){_0x4f9271=_0x4f9271-0x14d;var _0x1b49b2=_0x1b49();var _0x1829cb=_0x1b49b2[_0x4f9271];return _0x1829cb;}export function createPermissionStore(_0x199c28){return new PermissionStore(_0x199c28);}function _0x1b49(){var _0x3c6987=['loadUser','enumerable','buildState','permission','1038429UoPBEu','configurable','Cannot\x20call\x20a\x20class\x20as\x20a\x20function','emitChange','updateUser','savePermission','258208TkMfOe','prototype','210553SaOlvc','getOwnPropertyDescriptor','1841184KxqTEg','cachedActions','destroy','length','subscribe','getState','user','iterator','updatePermission','key','clear','string','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','defineProperties','getOwnPropertySymbols','constructor','default','getOwnPropertyDescriptors','call','22745yIUsWn','292qpgMPI','toPrimitive','3942477uWfJdV','listeners','denied','defineProperty','granted','function','4207XEAXbh','2136MlWhoi','symbol','keys','delete','getSnapshot','forEach','state','adapter','object'];_0x1b49=function(){return _0x3c6987;};return _0x1b49();}
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
5
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
6
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
7
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
8
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
9
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
10
+ /**
11
+ * Store 完整接口,包含 React useSyncExternalStore 所需的 getSnapshot / subscribe
12
+ * 业务侧若不希望在 IDE 补全中看到 React 内部方法,可将变量显式声明为 PermissionStorePublic
13
+ *
14
+ * @template P - 权限对象类型
15
+ * @template U - 用户对象类型
16
+ */
17
+ /**
18
+ * 业务侧(axios 拦截器等非 React 环境)使用的 Store 公共接口
19
+ * 只暴露权限操作方法和销毁能力,屏蔽 React 内部机制
20
+ *
21
+ * @template P - 权限对象类型
22
+ * @template U - 用户对象类型
23
+ */
24
+ var PermissionStore = /*#__PURE__*/function () {
25
+ /**
26
+ * @param adapter - 权限数据持久化适配器
27
+ * 类字段初始化先于构造函数体,此处 this.granted 等已绑定完毕
28
+ */
29
+ function PermissionStore(adapter) {
30
+ var _this = this;
31
+ _classCallCheck(this, PermissionStore);
32
+ _defineProperty(this, "state", void 0);
33
+ _defineProperty(this, "listeners", new Set());
34
+ /**
35
+ * 缓存 actions 对象以保证引用稳定
36
+ * 注意:类字段箭头函数(granted/denied 等)在构造函数体执行前已完成初始化
37
+ * 因此在构造函数体中赋值 cachedActions 时,this.granted 等引用已可用
38
+ */
39
+ _defineProperty(this, "cachedActions", void 0);
40
+ /**
41
+ * 获取当前状态快照(供 React 及内部使用)
42
+ * @returns {PermissionContextValue<P, U>} 权限上下文值
43
+ */
44
+ _defineProperty(this, "getSnapshot", function () {
45
+ return _this.state;
46
+ });
47
+ /**
48
+ * 同步获取当前状态(供业务侧非 React 环境使用)
49
+ * @returns {PermissionContextValue<P, U>} 权限上下文值
50
+ */
51
+ _defineProperty(this, "getState", function () {
52
+ return _this.state;
53
+ });
54
+ /**
55
+ * 订阅状态变更,返回取消订阅函数(供 useSyncExternalStore 使用)
56
+ * @param {() => void} listener - 状态变更时的回调
57
+ * @returns {() => void} 取消订阅函数
58
+ */
59
+ _defineProperty(this, "subscribe", function (listener) {
60
+ _this.listeners.add(listener);
61
+ return function () {
62
+ return _this.listeners.delete(listener);
63
+ };
64
+ });
65
+ /**
66
+ * 通知所有订阅者状态已变更
67
+ */
68
+ _defineProperty(this, "emitChange", function () {
69
+ _this.listeners.forEach(function (l) {
70
+ return l();
71
+ });
72
+ });
73
+ /**
74
+ * 授权方法,登录成功后调用
75
+ * @param {P} permission - 权限数据
76
+ * @param {U} [user] - 用户信息(可选,后续可通过 updateUser 补充)
77
+ */
78
+ _defineProperty(this, "granted", function (permission, user) {
79
+ _this.adapter.savePermission(permission);
80
+ if (user !== undefined) {
81
+ _this.adapter.saveUser(user);
82
+ }
83
+ _this.state = _this.buildState(permission, user);
84
+ _this.emitChange();
85
+ });
86
+ /**
87
+ * 取消授权,清空所有持久化数据并通知订阅者
88
+ */
89
+ _defineProperty(this, "denied", function () {
90
+ _this.adapter.clear();
91
+ _this.state = _this.buildState();
92
+ _this.emitChange();
93
+ });
94
+ /**
95
+ * 更新用户信息(部分字段覆盖,不影响权限数据)
96
+ * @param {Partial<U>} userInfo - 需要更新的字段
97
+ */
98
+ _defineProperty(this, "updateUser", function (userInfo) {
99
+ var nextUser = _objectSpread(_objectSpread({}, _this.state.user), userInfo);
100
+ _this.adapter.saveUser(nextUser);
101
+ _this.state = _this.buildState(_this.state.permission, nextUser);
102
+ _this.emitChange();
103
+ });
104
+ /**
105
+ * 更新权限数据(部分字段覆盖,例如无感刷新 token 后调用)
106
+ * @param {Partial<P>} permissionInfo - 需要更新的权限字段
107
+ */
108
+ _defineProperty(this, "updatePermission", function (permissionInfo) {
109
+ var nextPermission = _objectSpread(_objectSpread({}, _this.state.permission), permissionInfo);
110
+ _this.adapter.savePermission(nextPermission);
111
+ _this.state = _this.buildState(nextPermission, _this.state.user);
112
+ _this.emitChange();
113
+ });
114
+ /** 销毁 Store,清除所有订阅者 */
115
+ _defineProperty(this, "destroy", function () {
116
+ _this.listeners.clear();
117
+ });
118
+ this.adapter = adapter;
119
+ this.cachedActions = {
120
+ granted: this.granted,
121
+ denied: this.denied,
122
+ updateUser: this.updateUser,
123
+ updatePermission: this.updatePermission
124
+ };
125
+ var _permission = adapter.loadPermission();
126
+ var _user = adapter.loadUser();
127
+ this.state = this.buildState(_permission instanceof Promise ? undefined : _permission, _user instanceof Promise ? undefined : _user);
128
+ }
129
+
130
+ /**
131
+ * 构建状态快照,复用 cachedActions 保证方法引用稳定性
132
+ * @param permission - 权限数据
133
+ * @param user - 用户信息
134
+ */
135
+ _createClass(PermissionStore, [{
136
+ key: "buildState",
137
+ value: function buildState(permission, user) {
138
+ return _objectSpread(_objectSpread({}, this.cachedActions), {}, {
139
+ permission: permission,
140
+ user: user,
141
+ isGranted: !!permission
142
+ });
143
+ }
144
+ }]);
145
+ return PermissionStore;
146
+ }();
147
+ /**
148
+ * 创建权限 Store 实例
149
+ * 返回 PermissionStoreInternal 类型(包含完整接口)
150
+ * 若业务侧不希望在 IDE 中看到 React 内部方法,可将变量显式声明为 PermissionStorePublic:
151
+ * const store: PermissionStorePublic<P, U> = createPermissionStore(adapter)
152
+ *
153
+ * @param {PermissionAdapter<P, U>} adapter - 权限数据持久化适配器
154
+ * @returns {PermissionStoreInternal<P, U>} 权限 Store 实例
155
+ */
156
+ export function createPermissionStore(adapter) {
157
+ return new PermissionStore(adapter);
158
+ }
@@ -1 +1,136 @@
1
- var _0x7ff51d=_0x5e65;(function(_0x3e1eec,_0x232a1e){var _0x254ba9=_0x5e65,_0x3cf097=_0x3e1eec();while(!![]){try{var _0x449cf4=parseInt(_0x254ba9(0xa1))/0x1*(parseInt(_0x254ba9(0x98))/0x2)+-parseInt(_0x254ba9(0xa7))/0x3*(parseInt(_0x254ba9(0x8f))/0x4)+parseInt(_0x254ba9(0x8c))/0x5*(parseInt(_0x254ba9(0x90))/0x6)+parseInt(_0x254ba9(0xa4))/0x7+-parseInt(_0x254ba9(0xab))/0x8*(-parseInt(_0x254ba9(0x9b))/0x9)+-parseInt(_0x254ba9(0x85))/0xa+parseInt(_0x254ba9(0x92))/0xb;if(_0x449cf4===_0x232a1e)break;else _0x3cf097['push'](_0x3cf097['shift']());}catch(_0x912242){_0x3cf097['push'](_0x3cf097['shift']());}}}(_0x4100,0x9c70d));var _excluded=[_0x7ff51d(0xa2),_0x7ff51d(0x9d),'width',_0x7ff51d(0xb1),'lineHeight',_0x7ff51d(0x94),_0x7ff51d(0x87),_0x7ff51d(0x7c),_0x7ff51d(0x80),_0x7ff51d(0x77),'style',_0x7ff51d(0x8a),_0x7ff51d(0x93),_0x7ff51d(0x9e),_0x7ff51d(0x91),_0x7ff51d(0xa8),'mTop','mBottom',_0x7ff51d(0x8d),'mRight','pTop',_0x7ff51d(0x97),_0x7ff51d(0xa5),_0x7ff51d(0xad),_0x7ff51d(0x79),'textAlign',_0x7ff51d(0x95),_0x7ff51d(0x86),_0x7ff51d(0x8e)];function _typeof(_0x14aad4){'@babel/helpers - typeof';var _0x5d9146=_0x7ff51d;return _typeof='function'==typeof Symbol&&_0x5d9146(0x9f)==typeof Symbol[_0x5d9146(0xb0)]?function(_0x58b3f4){return typeof _0x58b3f4;}:function(_0x163e50){var _0xbe5395=_0x5d9146;return _0x163e50&&'function'==typeof Symbol&&_0x163e50[_0xbe5395(0x78)]===Symbol&&_0x163e50!==Symbol['prototype']?'symbol':typeof _0x163e50;},_typeof(_0x14aad4);}function ownKeys(_0x5bd5d5,_0x4e575a){var _0x175a16=_0x7ff51d,_0x1ebbe9=Object[_0x175a16(0x7f)](_0x5bd5d5);if(Object[_0x175a16(0xb4)]){var _0x16a154=Object[_0x175a16(0xb4)](_0x5bd5d5);_0x4e575a&&(_0x16a154=_0x16a154['filter'](function(_0x7ae00c){var _0x5488af=_0x175a16;return Object[_0x5488af(0xaf)](_0x5bd5d5,_0x7ae00c)[_0x5488af(0x81)];})),_0x1ebbe9['push'][_0x175a16(0x7d)](_0x1ebbe9,_0x16a154);}return _0x1ebbe9;}function _objectSpread(_0x2c3052){var _0x1075b3=_0x7ff51d;for(var _0x2e0b54=0x1;_0x2e0b54<arguments['length'];_0x2e0b54++){var _0x5d653c=null!=arguments[_0x2e0b54]?arguments[_0x2e0b54]:{};_0x2e0b54%0x2?ownKeys(Object(_0x5d653c),!0x0)[_0x1075b3(0xb5)](function(_0x3bb00a){_defineProperty(_0x2c3052,_0x3bb00a,_0x5d653c[_0x3bb00a]);}):Object[_0x1075b3(0xb6)]?Object[_0x1075b3(0xaa)](_0x2c3052,Object[_0x1075b3(0xb6)](_0x5d653c)):ownKeys(Object(_0x5d653c))['forEach'](function(_0x4ca012){Object['defineProperty'](_0x2c3052,_0x4ca012,Object['getOwnPropertyDescriptor'](_0x5d653c,_0x4ca012));});}return _0x2c3052;}function _defineProperty(_0x59fa21,_0x1b8806,_0xdb52d0){return _0x1b8806=_toPropertyKey(_0x1b8806),_0x1b8806 in _0x59fa21?Object['defineProperty'](_0x59fa21,_0x1b8806,{'value':_0xdb52d0,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x59fa21[_0x1b8806]=_0xdb52d0,_0x59fa21;}function _toPropertyKey(_0x3249d0){var _0x18b4c6=_0x7ff51d,_0x14f905=_toPrimitive(_0x3249d0,_0x18b4c6(0x7b));return _0x18b4c6(0x9f)==_typeof(_0x14f905)?_0x14f905:String(_0x14f905);}function _toPrimitive(_0x5addd4,_0x3ae535){var _0x38dccf=_0x7ff51d;if('object'!=_typeof(_0x5addd4)||!_0x5addd4)return _0x5addd4;var _0x50ce13=_0x5addd4[Symbol[_0x38dccf(0xae)]];if(void 0x0!==_0x50ce13){var _0x5c63eb=_0x50ce13[_0x38dccf(0xa9)](_0x5addd4,_0x3ae535||_0x38dccf(0x9a));if(_0x38dccf(0xb2)!=_typeof(_0x5c63eb))return _0x5c63eb;throw new TypeError(_0x38dccf(0xa0));}return('string'===_0x3ae535?String:Number)(_0x5addd4);}function _objectWithoutProperties(_0x442432,_0x112d5d){var _0x25d1ea=_0x7ff51d;if(_0x442432==null)return{};var _0x15fd36=_objectWithoutPropertiesLoose(_0x442432,_0x112d5d),_0x11ac94,_0xf5b996;if(Object[_0x25d1ea(0xb4)]){var _0x1b31b5=Object[_0x25d1ea(0xb4)](_0x442432);for(_0xf5b996=0x0;_0xf5b996<_0x1b31b5[_0x25d1ea(0x7e)];_0xf5b996++){_0x11ac94=_0x1b31b5[_0xf5b996];if(_0x112d5d['indexOf'](_0x11ac94)>=0x0)continue;if(!Object[_0x25d1ea(0x89)]['propertyIsEnumerable'][_0x25d1ea(0xa9)](_0x442432,_0x11ac94))continue;_0x15fd36[_0x11ac94]=_0x442432[_0x11ac94];}}return _0x15fd36;}function _objectWithoutPropertiesLoose(_0x2f0c31,_0x3df9aa){var _0x5ec0c2=_0x7ff51d;if(_0x2f0c31==null)return{};var _0x10a3db={},_0x3ac29b=Object[_0x5ec0c2(0x7f)](_0x2f0c31),_0x3fff7d,_0x30c583;for(_0x30c583=0x0;_0x30c583<_0x3ac29b[_0x5ec0c2(0x7e)];_0x30c583++){_0x3fff7d=_0x3ac29b[_0x30c583];if(_0x3df9aa['indexOf'](_0x3fff7d)>=0x0)continue;_0x10a3db[_0x3fff7d]=_0x2f0c31[_0x3fff7d];}return _0x10a3db;}function _0x5e65(_0x331650,_0x39e3c1){_0x331650=_0x331650-0x77;var _0x410007=_0x4100();var _0x5e65fc=_0x410007[_0x331650];return _0x5e65fc;}function _0x4100(){var _0x3731e2=['width','pRight','toPrimitive','getOwnPropertyDescriptor','iterator','height','object','concat','getOwnPropertySymbols','forEach','getOwnPropertyDescriptors','padding','constructor','className','number','string','color','apply','length','keys','margin','enumerable','mRight','mBottom','boolean','5811410ttzXwW','selectable','fontSize','Text','prototype','bgColor','textAlign','1929355ZSHEia','mLeft','skeleton','3626764NTSICp','6uhQLcc','pHorizontal','5879060GkTDsx','mHorizontal','bold','decoration','lineHeight','pBottom','686384iypmft','normal','default','459gUWwgg','style','clamp','mVertical','symbol','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','1goDAov','children','transparent','3786538KpNMgZ','pLeft','pTop','3FmwJxy','pVertical','call','defineProperties','50848etRmSK'];_0x4100=function(){return _0x3731e2;};return _0x4100();}import _0xff7c3a,{forwardRef}from'react';import{Text as _0x4f0961}from'@tarojs/components';import _0x4fbe3a from'classnames';import'../../styles/index.css';import{jsx as _0xeb04df}from'react/jsx-runtime';var px=function px(_0x44753b){var _0x54b70b=_0x7ff51d;if(_0x44753b===undefined||_0x44753b===null||_0x44753b==='')return undefined;return typeof _0x44753b===_0x54b70b(0x7a)||!isNaN(Number(_0x44753b))?''[_0x54b70b(0xb3)](_0x44753b,'px'):String(_0x44753b);},Text=forwardRef(function(_0x5a17b8,_0x5376fe){var _0x508b54=_0x7ff51d,_0x25eeef=_0x5a17b8[_0x508b54(0xa2)],_0x200b09=_0x5a17b8['clamp'],_0x23dfb1=_0x5a17b8[_0x508b54(0xac)],_0x238cda=_0x5a17b8[_0x508b54(0xb1)],_0x2edbf2=_0x5a17b8[_0x508b54(0x96)],_0x15cb58=_0x5a17b8[_0x508b54(0x94)],_0x34194a=_0x5a17b8[_0x508b54(0x87)],_0x450d45=_0x5a17b8[_0x508b54(0x7c)],_0x52e650=_0x5a17b8[_0x508b54(0x80)],_0x3e110c=_0x5a17b8[_0x508b54(0x77)],_0x190f12=_0x5a17b8[_0x508b54(0x9c)],_0x1e703e=_0x190f12===void 0x0?{}:_0x190f12,_0x1a8421=_0x5a17b8['bgColor'],_0x5b9fcd=_0x5a17b8[_0x508b54(0x93)],_0x5d7999=_0x5a17b8[_0x508b54(0x9e)],_0x49e7f2=_0x5a17b8[_0x508b54(0x91)],_0x32b0af=_0x5a17b8[_0x508b54(0xa8)],_0x4beb24=_0x5a17b8['mTop'],_0x33520d=_0x5a17b8[_0x508b54(0x83)],_0x137703=_0x5a17b8[_0x508b54(0x8d)],_0x575991=_0x5a17b8[_0x508b54(0x82)],_0x446243=_0x5a17b8[_0x508b54(0xa6)],_0x1f84bc=_0x5a17b8['pBottom'],_0x54cf30=_0x5a17b8[_0x508b54(0xa5)],_0x3dfa79=_0x5a17b8['pRight'],_0x25258f=_0x5a17b8[_0x508b54(0x79)],_0x4351c3=_0x5a17b8[_0x508b54(0x8b)],_0x4c4fb7=_0x5a17b8['decoration'],_0x3e49aa=_0x5a17b8[_0x508b54(0x86)],_0xb788ff=_0x5a17b8[_0x508b54(0x8e)],_0x332832=_objectWithoutProperties(_0x5a17b8,_excluded),_0x267e98=_0x4fbe3a(_0x25258f,{'zero-line-clamp-1':_0x200b09===0x1,'zero-line-clamp-2':_0x200b09===0x2,'zero-line-clamp-3':_0x200b09===0x3,'zero-line-clamp-4':_0x200b09===0x4,'zero-line-clamp-5':_0x200b09===0x5,'zero-line-clamp-6':_0x200b09===0x6,'zero-animate-pulse\x20zero-bg-gray-200\x20zero-text-transparent':_0xb788ff}),_0x52935c=_objectSpread({'width':px(_0x23dfb1),'height':px(_0x238cda),'margin':px(_0x52e650),'marginTop':px(_0x4beb24!==null&&_0x4beb24!==void 0x0?_0x4beb24:_0x5d7999),'marginBottom':px(_0x33520d!==null&&_0x33520d!==void 0x0?_0x33520d:_0x5d7999),'marginLeft':px(_0x137703!==null&&_0x137703!==void 0x0?_0x137703:_0x5b9fcd),'marginRight':px(_0x575991!==null&&_0x575991!==void 0x0?_0x575991:_0x5b9fcd),'padding':px(_0x3e110c),'paddingTop':px(_0x446243!==null&&_0x446243!==void 0x0?_0x446243:_0x32b0af),'paddingBottom':px(_0x1f84bc!==null&&_0x1f84bc!==void 0x0?_0x1f84bc:_0x32b0af),'paddingLeft':px(_0x54cf30!==null&&_0x54cf30!==void 0x0?_0x54cf30:_0x49e7f2),'paddingRight':px(_0x3dfa79!==null&&_0x3dfa79!==void 0x0?_0x3dfa79:_0x49e7f2),'fontSize':px(_0x34194a),'color':_0xb788ff?_0x508b54(0xa3):_0x450d45,'backgroundColor':_0x1a8421,'lineHeight':px(_0x2edbf2),'fontWeight':typeof _0x15cb58===_0x508b54(0x84)?_0x15cb58?_0x508b54(0x94):_0x508b54(0x99):_0x15cb58,'textAlign':_0x4351c3,'textDecoration':_0x4c4fb7},_typeof(_0x1e703e)===_0x508b54(0xb2)?_0x1e703e:{}),_0x324ef1={};for(var _0x144b4c in _0x52935c){_0x52935c[_0x144b4c]!==undefined&&_0x52935c[_0x144b4c]!==null&&(_0x324ef1[_0x144b4c]=_0x52935c[_0x144b4c]);}return _0xeb04df(_0x4f0961,_objectSpread(_objectSpread({'ref':_0x5376fe,'style':_0x324ef1,'className':_0x267e98,'selectable':_0x3e49aa},_0x332832),{},{'children':_0x25eeef}));});Text['displayName']=_0x7ff51d(0x88);export default Text;
1
+ var _excluded = ["children", "clamp", "width", "height", "lineHeight", "bold", "fontSize", "color", "margin", "padding", "style", "bgColor", "mHorizontal", "mVertical", "pHorizontal", "pVertical", "mTop", "mBottom", "mLeft", "mRight", "pTop", "pBottom", "pLeft", "pRight", "className", "textAlign", "decoration", "selectable", "skeleton"];
2
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import React, { forwardRef } from 'react';
11
+ import { Text as OrigText } from '@tarojs/components';
12
+ import classNames from 'classnames';
13
+ import "../../styles/index.css";
14
+ import { jsx as _jsx } from "react/jsx-runtime";
15
+ /**
16
+ * 处理 px 转换
17
+ * @param val px|string|undefined
18
+ * @returns px|string|undefined
19
+ */
20
+ var px = function px(val) {
21
+ if (val === undefined || val === null || val === '') return undefined;
22
+ return typeof val === 'number' || !isNaN(Number(val)) ? "".concat(val, "px") : String(val);
23
+ };
24
+
25
+ /**
26
+ * taro weapp Text Component (Tailwind 版)
27
+ * - clamp: number|undefined 溢出显示行数
28
+ * - width: px|string|undefined 宽度
29
+ * - height: px|string|undefined 高度
30
+ * - fontSize: px|string|undefined 字体大小
31
+ * - lineHeight: px|string|undefined 行高
32
+ * - bold: boolean|number|string 字体粗细
33
+ * - color: string 字体颜色
34
+ * - bgColor: string 背景颜色
35
+ * - textAlign: 'left' | 'center' | 'right' | 'justify' 文本对齐方式
36
+ * - decoration: 'underline' | 'line-through' | 'none' 文本装饰
37
+ * - selectable: boolean 是否可选择
38
+ * - skeleton: boolean 是否为骨架屏
39
+ * - style: CSSProperties 自定义样式
40
+ * - children: ReactNode 子元素
41
+ * - margin: px|string|undefined 外边距
42
+ * - mTop: px|string|undefined 上外边距
43
+ * - mBottom: px|string|undefined 下外边距
44
+ * - mLeft: px|string|undefined 左外边距
45
+ * - mRight: px|string|undefined 右外边距
46
+ * - mHorizontal: px|string|undefined 水平外边距
47
+ * - mVertical: px|string|undefined 垂直外边距
48
+ * - padding: px|string|undefined 内边距
49
+ * - pTop: px|string|undefined 上内边距
50
+ * - pBottom: px|string|undefined 下内边距
51
+ * - pLeft: px|string|undefined 左内边距
52
+ * - pRight: px|string|undefined 右内边距
53
+ * - pHorizontal: px|string|undefined 水平内边距
54
+ * - pVertical: px|string|undefined 垂直内边距
55
+ * - rest: Text组件的其他属性
56
+ */
57
+ var Text = /*#__PURE__*/forwardRef(function (props, ref) {
58
+ var children = props.children,
59
+ clamp = props.clamp,
60
+ width = props.width,
61
+ height = props.height,
62
+ lineHeight = props.lineHeight,
63
+ bold = props.bold,
64
+ fontSize = props.fontSize,
65
+ color = props.color,
66
+ margin = props.margin,
67
+ padding = props.padding,
68
+ _props$style = props.style,
69
+ style = _props$style === void 0 ? {} : _props$style,
70
+ bgColor = props.bgColor,
71
+ mHorizontal = props.mHorizontal,
72
+ mVertical = props.mVertical,
73
+ pHorizontal = props.pHorizontal,
74
+ pVertical = props.pVertical,
75
+ mTop = props.mTop,
76
+ mBottom = props.mBottom,
77
+ mLeft = props.mLeft,
78
+ mRight = props.mRight,
79
+ pTop = props.pTop,
80
+ pBottom = props.pBottom,
81
+ pLeft = props.pLeft,
82
+ pRight = props.pRight,
83
+ className = props.className,
84
+ textAlign = props.textAlign,
85
+ decoration = props.decoration,
86
+ selectable = props.selectable,
87
+ skeleton = props.skeleton,
88
+ rest = _objectWithoutProperties(props, _excluded);
89
+ var textClassNames = classNames(className, {
90
+ 'zero-line-clamp-1': clamp === 1,
91
+ 'zero-line-clamp-2': clamp === 2,
92
+ 'zero-line-clamp-3': clamp === 3,
93
+ 'zero-line-clamp-4': clamp === 4,
94
+ 'zero-line-clamp-5': clamp === 5,
95
+ 'zero-line-clamp-6': clamp === 6,
96
+ 'zero-animate-pulse zero-bg-gray-200 zero-text-transparent': skeleton
97
+ });
98
+ var textStyle = _objectSpread({
99
+ width: px(width),
100
+ height: px(height),
101
+ margin: px(margin),
102
+ marginTop: px(mTop !== null && mTop !== void 0 ? mTop : mVertical),
103
+ marginBottom: px(mBottom !== null && mBottom !== void 0 ? mBottom : mVertical),
104
+ marginLeft: px(mLeft !== null && mLeft !== void 0 ? mLeft : mHorizontal),
105
+ marginRight: px(mRight !== null && mRight !== void 0 ? mRight : mHorizontal),
106
+ padding: px(padding),
107
+ paddingTop: px(pTop !== null && pTop !== void 0 ? pTop : pVertical),
108
+ paddingBottom: px(pBottom !== null && pBottom !== void 0 ? pBottom : pVertical),
109
+ paddingLeft: px(pLeft !== null && pLeft !== void 0 ? pLeft : pHorizontal),
110
+ paddingRight: px(pRight !== null && pRight !== void 0 ? pRight : pHorizontal),
111
+ fontSize: px(fontSize),
112
+ color: skeleton ? 'transparent' : color,
113
+ backgroundColor: bgColor,
114
+ lineHeight: px(lineHeight),
115
+ fontWeight: typeof bold === 'boolean' ? bold ? 'bold' : 'normal' : bold,
116
+ textAlign: textAlign,
117
+ textDecoration: decoration
118
+ }, _typeof(style) === 'object' ? style : {});
119
+ var cleanStyle = {};
120
+ for (var key in textStyle) {
121
+ if (textStyle[key] !== undefined && textStyle[key] !== null) {
122
+ // @ts-ignore
123
+ cleanStyle[key] = textStyle[key];
124
+ }
125
+ }
126
+ return /*#__PURE__*/_jsx(OrigText, _objectSpread(_objectSpread({
127
+ ref: ref,
128
+ style: cleanStyle,
129
+ className: textClassNames,
130
+ selectable: selectable
131
+ }, rest), {}, {
132
+ children: children
133
+ }));
134
+ });
135
+ Text.displayName = 'Text';
136
+ export default Text;
@@ -31,7 +31,12 @@ export interface UIViewProps {
31
31
  hidden?: boolean;
32
32
  width?: string | number;
33
33
  height?: string | number;
34
+ minWidth?: string | number;
35
+ minHeight?: string | number;
36
+ maxWidth?: string | number;
37
+ maxHeight?: string | number;
34
38
  bgColor?: string;
39
+ background?: string;
35
40
  safeArea?: 'top' | 'bottom' | 'both';
36
41
  hover?: boolean;
37
42
  skeleton?: boolean;
@@ -42,6 +47,8 @@ export interface UIViewProps {
42
47
  top?: number | string;
43
48
  bottom?: number | string;
44
49
  overflow?: OverflowValue;
50
+ overflowX?: OverflowValue;
51
+ overflowY?: OverflowValue;
45
52
  radius?: string | number;
46
53
  border?: boolean;
47
54
  borderColor?: string;
@@ -74,6 +81,7 @@ type Props = UIViewProps & Partial<PaddingType> & Partial<MarginType> & ViewProp
74
81
  * - width: width 宽度
75
82
  * - height: height 高度
76
83
  * - bgColor: background-color 背景颜色
84
+ * - background: background 背景图片等复杂背景
77
85
  * - safeArea: safe-area-inset 安全区域
78
86
  * - hover: hover 悬停状态
79
87
  * - skeleton: skeleton 骨架屏
@@ -84,6 +92,8 @@ type Props = UIViewProps & Partial<PaddingType> & Partial<MarginType> & ViewProp
84
92
  * - top: top 定位上侧
85
93
  * - bottom: bottom 定位下侧
86
94
  * - overflow: overflow 显示
95
+ * - overflowX: overflow-x 显示
96
+ * - overflowY: overflow-y 显示
87
97
  * - radius: border-radius 圆角
88
98
  * - border: boolean 边框
89
99
  * - borderColor: border-color 边框颜色