@zero-bits/taro-components 1.0.5 → 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 _0x300ed6=_0x46b6;(function(_0x2420a1,_0xf71f3f){var _0x3b6019=_0x46b6,_0x2f7f3c=_0x2420a1();while(!![]){try{var _0x1004b5=parseInt(_0x3b6019(0x77))/0x1+-parseInt(_0x3b6019(0x7d))/0x2+parseInt(_0x3b6019(0x6e))/0x3*(parseInt(_0x3b6019(0x76))/0x4)+parseInt(_0x3b6019(0x79))/0x5+parseInt(_0x3b6019(0x6c))/0x6+-parseInt(_0x3b6019(0x6f))/0x7*(-parseInt(_0x3b6019(0x78))/0x8)+-parseInt(_0x3b6019(0x73))/0x9;if(_0x1004b5===_0xf71f3f)break;else _0x2f7f3c['push'](_0x2f7f3c['shift']());}catch(_0x4d608b){_0x2f7f3c['push'](_0x2f7f3c['shift']());}}}(_0x2ce5,0xc18ab));import{useSyncExternalStore,useEffect,useRef}from'react';import{PermissionContext}from'../../context';import{jsx as _0x291a49}from'react/jsx-runtime';function PermissionProvider(_0x5bf25e){var _0x640438=_0x46b6,_0x34efad=_0x5bf25e[_0x640438(0x6d)],_0x34f367=_0x5bf25e['store'],_0x389c07=_0x5bf25e[_0x640438(0x7a)],_0x4ceda1=useSyncExternalStore(_0x34f367[_0x640438(0x71)],_0x34f367[_0x640438(0x7c)]),_0x12e0fc=useRef(_0x4ceda1[_0x640438(0x75)]);return useEffect(function(){var _0xdf8d66=_0x640438;if(_0x12e0fc[_0xdf8d66(0x7b)]&&!_0x4ceda1[_0xdf8d66(0x75)])_0x389c07===null||_0x389c07===void 0x0||_0x389c07();_0x12e0fc[_0xdf8d66(0x7b)]=_0x4ceda1['isGranted'];},[_0x4ceda1[_0x640438(0x75)],_0x389c07]),_0x291a49(PermissionContext[_0x640438(0x70)],{'value':_0x4ceda1,'children':_0x34efad});}function _0x46b6(_0x5d424c,_0x23b89c){_0x5d424c=_0x5d424c-0x6c;var _0x2ce590=_0x2ce5();var _0x46b6bf=_0x2ce590[_0x5d424c];return _0x46b6bf;}PermissionProvider[_0x300ed6(0x72)]=_0x300ed6(0x74);function _0x2ce5(){var _0x2e7118=['20157255EDErPG','PermissionProvider','isGranted','2045796bzDpqx','393088yhXwZV','4184eSIGEU','7440540cbrHvM','onDenied','current','getSnapshot','2310556OeIReh','3656874ygJsZX','children','6NRQlwT','9023cFHBab','Provider','subscribe','displayName'];_0x2ce5=function(){return _0x2e7118;};return _0x2ce5();}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 _0x27a1(_0x1afd1a,_0x124d30){_0x1afd1a=_0x1afd1a-0x104;var _0x542a6a=_0x542a();var _0x27a1bb=_0x542a6a[_0x1afd1a];return _0x27a1bb;}(function(_0x1a92a3,_0x407960){var _0x10cd42=_0x27a1,_0x613794=_0x1a92a3();while(!![]){try{var _0x4a4c1a=-parseInt(_0x10cd42(0x109))/0x1+-parseInt(_0x10cd42(0x104))/0x2+-parseInt(_0x10cd42(0x10a))/0x3*(-parseInt(_0x10cd42(0x106))/0x4)+-parseInt(_0x10cd42(0x10d))/0x5*(-parseInt(_0x10cd42(0x108))/0x6)+-parseInt(_0x10cd42(0x10b))/0x7+-parseInt(_0x10cd42(0x10c))/0x8*(-parseInt(_0x10cd42(0x105))/0x9)+parseInt(_0x10cd42(0x10e))/0xa*(parseInt(_0x10cd42(0x107))/0xb);if(_0x4a4c1a===_0x407960)break;else _0x613794['push'](_0x613794['shift']());}catch(_0x3f1cf1){_0x613794['push'](_0x613794['shift']());}}}(_0x542a,0x56666));function _0x542a(){var _0x1a59ca=['18aPjpmg','186514YAekAb','64683wofPir','1293775WgTCWE','944mSkKZp','3095ASRfCJ','10ztCjSO','1037972cgxxJu','22851MjrpwL','28cVNhRo','8710163UeoRCv'];_0x542a=function(){return _0x1a59ca;};return _0x542a();}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(_0x157041,_0xbffffc){var _0xb1cd56=_0x761f,_0x16a7a4=_0x157041();while(!![]){try{var _0x33197b=parseInt(_0xb1cd56(0x99))/0x1+parseInt(_0xb1cd56(0xa2))/0x2+parseInt(_0xb1cd56(0xb6))/0x3*(parseInt(_0xb1cd56(0xc1))/0x4)+-parseInt(_0xb1cd56(0x9d))/0x5+parseInt(_0xb1cd56(0xb4))/0x6*(-parseInt(_0xb1cd56(0x8f))/0x7)+parseInt(_0xb1cd56(0xad))/0x8+-parseInt(_0xb1cd56(0x9e))/0x9;if(_0x33197b===_0xbffffc)break;else _0x16a7a4['push'](_0x16a7a4['shift']());}catch(_0x3a6d0c){_0x16a7a4['push'](_0x16a7a4['shift']());}}}(_0x52ef,0xd82d7));function _typeof(_0x4fc4b3){'@babel/helpers - typeof';var _0x3648a4=_0x761f;return _typeof=_0x3648a4(0x91)==typeof Symbol&&_0x3648a4(0x8e)==typeof Symbol['iterator']?function(_0x50765a){return typeof _0x50765a;}:function(_0x296249){var _0x18ee0b=_0x3648a4;return _0x296249&&'function'==typeof Symbol&&_0x296249[_0x18ee0b(0xc2)]===Symbol&&_0x296249!==Symbol['prototype']?_0x18ee0b(0x8e):typeof _0x296249;},_typeof(_0x4fc4b3);}function ownKeys(_0x2da827,_0x2c8a60){var _0x437938=_0x761f,_0x57f25a=Object[_0x437938(0xb8)](_0x2da827);if(Object[_0x437938(0xb0)]){var _0x451430=Object[_0x437938(0xb0)](_0x2da827);_0x2c8a60&&(_0x451430=_0x451430[_0x437938(0xb9)](function(_0x27350f){var _0xef9f73=_0x437938;return Object[_0xef9f73(0xbe)](_0x2da827,_0x27350f)[_0xef9f73(0xa5)];})),_0x57f25a[_0x437938(0x9b)][_0x437938(0xbb)](_0x57f25a,_0x451430);}return _0x57f25a;}function _0x52ef(){var _0xfb22fb=['permission','Cannot\x20call\x20a\x20class\x20as\x20a\x20function','object','state','defineProperty','length','1693296YkPhdR','getSnapshot','push','savePermission','2401090fNKFAr','32560380jzYrMx','updatePermission','writable','getOwnPropertyDescriptors','3151788JMkzaS','configurable','toPrimitive','enumerable','defineProperties','call','string','adapter','listeners','denied','buildState','13870848wgYLPn','prototype','cachedActions','getOwnPropertySymbols','loadPermission','saveUser','forEach','6378QRQzwY','subscribe','2090751kbykDb','destroy','keys','filter','getState','apply','user','emitChange','getOwnPropertyDescriptor','updateUser','clear','4anfaUC','constructor','symbol','4718MFWeYB','key','function','value'];_0x52ef=function(){return _0xfb22fb;};return _0x52ef();}function _objectSpread(_0x276737){var _0x570512=_0x761f;for(var _0x330308=0x1;_0x330308<arguments['length'];_0x330308++){var _0x808192=null!=arguments[_0x330308]?arguments[_0x330308]:{};_0x330308%0x2?ownKeys(Object(_0x808192),!0x0)['forEach'](function(_0xcd1083){_defineProperty(_0x276737,_0xcd1083,_0x808192[_0xcd1083]);}):Object[_0x570512(0xa1)]?Object[_0x570512(0xa6)](_0x276737,Object['getOwnPropertyDescriptors'](_0x808192)):ownKeys(Object(_0x808192))['forEach'](function(_0x1402c3){var _0x2bcc61=_0x570512;Object[_0x2bcc61(0x97)](_0x276737,_0x1402c3,Object[_0x2bcc61(0xbe)](_0x808192,_0x1402c3));});}return _0x276737;}function _classCallCheck(_0x1fbb93,_0x490ded){var _0xf3b2e6=_0x761f;if(!(_0x1fbb93 instanceof _0x490ded))throw new TypeError(_0xf3b2e6(0x94));}function _defineProperties(_0x3c09c1,_0xafbce7){var _0x13d52e=_0x761f;for(var _0x342cfc=0x0;_0x342cfc<_0xafbce7[_0x13d52e(0x98)];_0x342cfc++){var _0x42ac8b=_0xafbce7[_0x342cfc];_0x42ac8b[_0x13d52e(0xa5)]=_0x42ac8b[_0x13d52e(0xa5)]||![],_0x42ac8b[_0x13d52e(0xa3)]=!![];if(_0x13d52e(0x92)in _0x42ac8b)_0x42ac8b[_0x13d52e(0xa0)]=!![];Object[_0x13d52e(0x97)](_0x3c09c1,_toPropertyKey(_0x42ac8b[_0x13d52e(0x90)]),_0x42ac8b);}}function _createClass(_0x4d3821,_0x18b1e1,_0x5756e9){var _0x55aef3=_0x761f;if(_0x18b1e1)_defineProperties(_0x4d3821[_0x55aef3(0xae)],_0x18b1e1);if(_0x5756e9)_defineProperties(_0x4d3821,_0x5756e9);return Object[_0x55aef3(0x97)](_0x4d3821,_0x55aef3(0xae),{'writable':![]}),_0x4d3821;}function _defineProperty(_0x1de35c,_0x27f960,_0x27e7d2){return _0x27f960=_toPropertyKey(_0x27f960),_0x27f960 in _0x1de35c?Object['defineProperty'](_0x1de35c,_0x27f960,{'value':_0x27e7d2,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x1de35c[_0x27f960]=_0x27e7d2,_0x1de35c;}function _0x761f(_0x79bbfc,_0x18f060){_0x79bbfc=_0x79bbfc-0x8e;var _0x52efd1=_0x52ef();var _0x761fc7=_0x52efd1[_0x79bbfc];return _0x761fc7;}function _toPropertyKey(_0x2603b4){var _0x4c61cd=_0x761f,_0x4d64d3=_toPrimitive(_0x2603b4,_0x4c61cd(0xa8));return'symbol'==_typeof(_0x4d64d3)?_0x4d64d3:String(_0x4d64d3);}function _toPrimitive(_0x485948,_0x4abd28){var _0x3f6c5f=_0x761f;if('object'!=_typeof(_0x485948)||!_0x485948)return _0x485948;var _0x213aa9=_0x485948[Symbol[_0x3f6c5f(0xa4)]];if(void 0x0!==_0x213aa9){var _0x122d54=_0x213aa9[_0x3f6c5f(0xa7)](_0x485948,_0x4abd28||'default');if(_0x3f6c5f(0x95)!=_typeof(_0x122d54))return _0x122d54;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x3f6c5f(0xa8)===_0x4abd28?String:Number)(_0x485948);}var PermissionStore=(function(){var _0x3e7faf=_0x761f;function _0xc90f6b(_0x105a0f){var _0x33882c=_0x761f,_0x35fe6d=this;_classCallCheck(this,_0xc90f6b),_defineProperty(this,_0x33882c(0x96),void 0x0),_defineProperty(this,_0x33882c(0xaa),new Set()),_defineProperty(this,'cachedActions',void 0x0),_defineProperty(this,_0x33882c(0x9a),function(){return _0x35fe6d['state'];}),_defineProperty(this,_0x33882c(0xba),function(){var _0x184cc5=_0x33882c;return _0x35fe6d[_0x184cc5(0x96)];}),_defineProperty(this,_0x33882c(0xb5),function(_0x41d1af){var _0x4536c8=_0x33882c;return _0x35fe6d[_0x4536c8(0xaa)]['add'](_0x41d1af),function(){var _0x216db=_0x4536c8;return _0x35fe6d[_0x216db(0xaa)]['delete'](_0x41d1af);};}),_defineProperty(this,_0x33882c(0xbd),function(){var _0x379fc0=_0x33882c;_0x35fe6d[_0x379fc0(0xaa)][_0x379fc0(0xb3)](function(_0x2fe880){return _0x2fe880();});}),_defineProperty(this,'granted',function(_0xe68176,_0x3c42bd){var _0x1145f8=_0x33882c;_0x35fe6d['adapter'][_0x1145f8(0x9c)](_0xe68176),_0x3c42bd!==undefined&&_0x35fe6d[_0x1145f8(0xa9)][_0x1145f8(0xb2)](_0x3c42bd),_0x35fe6d[_0x1145f8(0x96)]=_0x35fe6d[_0x1145f8(0xac)](_0xe68176,_0x3c42bd),_0x35fe6d[_0x1145f8(0xbd)]();}),_defineProperty(this,_0x33882c(0xab),function(){var _0x1742f2=_0x33882c;_0x35fe6d[_0x1742f2(0xa9)][_0x1742f2(0xc0)](),_0x35fe6d[_0x1742f2(0x96)]=_0x35fe6d[_0x1742f2(0xac)](),_0x35fe6d[_0x1742f2(0xbd)]();}),_defineProperty(this,'updateUser',function(_0xbd690f){var _0x1b7346=_0x33882c,_0x5ebf99=_objectSpread(_objectSpread({},_0x35fe6d[_0x1b7346(0x96)][_0x1b7346(0xbc)]),_0xbd690f);_0x35fe6d[_0x1b7346(0xa9)]['saveUser'](_0x5ebf99),_0x35fe6d[_0x1b7346(0x96)]=_0x35fe6d[_0x1b7346(0xac)](_0x35fe6d[_0x1b7346(0x96)][_0x1b7346(0x93)],_0x5ebf99),_0x35fe6d['emitChange']();}),_defineProperty(this,_0x33882c(0x9f),function(_0x10fdc3){var _0x15d350=_0x33882c,_0x177631=_objectSpread(_objectSpread({},_0x35fe6d['state']['permission']),_0x10fdc3);_0x35fe6d['adapter'][_0x15d350(0x9c)](_0x177631),_0x35fe6d['state']=_0x35fe6d[_0x15d350(0xac)](_0x177631,_0x35fe6d[_0x15d350(0x96)][_0x15d350(0xbc)]),_0x35fe6d['emitChange']();}),_defineProperty(this,_0x33882c(0xb7),function(){var _0x5a8883=_0x33882c;_0x35fe6d[_0x5a8883(0xaa)][_0x5a8883(0xc0)]();}),this['adapter']=_0x105a0f,this[_0x33882c(0xaf)]={'granted':this['granted'],'denied':this[_0x33882c(0xab)],'updateUser':this[_0x33882c(0xbf)],'updatePermission':this[_0x33882c(0x9f)]};var _0x5cefa5=_0x105a0f[_0x33882c(0xb1)](),_0x4281c1=_0x105a0f['loadUser']();this['state']=this[_0x33882c(0xac)](_0x5cefa5 instanceof Promise?undefined:_0x5cefa5,_0x4281c1 instanceof Promise?undefined:_0x4281c1);}return _createClass(_0xc90f6b,[{'key':_0x3e7faf(0xac),'value':function _0x5d52cd(_0x2ec38b,_0x482e97){var _0x45ba2a=_0x3e7faf;return _objectSpread(_objectSpread({},this[_0x45ba2a(0xaf)]),{},{'permission':_0x2ec38b,'user':_0x482e97,'isGranted':!!_0x2ec38b});}}]),_0xc90f6b;}());export function createPermissionStore(_0x7acf4b){return new PermissionStore(_0x7acf4b);}
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 _0x352f03=_0x1956;(function(_0x4cb3a0,_0xb1ecdb){var _0x35ca8f=_0x1956,_0x36f94b=_0x4cb3a0();while(!![]){try{var _0x4f2ab3=-parseInt(_0x35ca8f(0xfc))/0x1+parseInt(_0x35ca8f(0x10e))/0x2*(-parseInt(_0x35ca8f(0x11a))/0x3)+parseInt(_0x35ca8f(0xff))/0x4*(-parseInt(_0x35ca8f(0xe0))/0x5)+parseInt(_0x35ca8f(0x101))/0x6+-parseInt(_0x35ca8f(0xfa))/0x7*(parseInt(_0x35ca8f(0xf4))/0x8)+parseInt(_0x35ca8f(0x110))/0x9+parseInt(_0x35ca8f(0x11c))/0xa*(parseInt(_0x35ca8f(0x118))/0xb);if(_0x4f2ab3===_0xb1ecdb)break;else _0x36f94b['push'](_0x36f94b['shift']());}catch(_0x36f348){_0x36f94b['push'](_0x36f94b['shift']());}}}(_0x4de8,0x8ff79));var _excluded=[_0x352f03(0xf5),'clamp','width',_0x352f03(0xf7),_0x352f03(0xee),_0x352f03(0x11d),_0x352f03(0xed),_0x352f03(0x117),_0x352f03(0xe9),'padding',_0x352f03(0xe8),'bgColor',_0x352f03(0x11b),_0x352f03(0x111),_0x352f03(0x107),_0x352f03(0x114),_0x352f03(0x100),'mBottom',_0x352f03(0x103),_0x352f03(0x10f),_0x352f03(0xe4),_0x352f03(0xea),_0x352f03(0xf9),_0x352f03(0xfe),_0x352f03(0xe5),_0x352f03(0xdc),_0x352f03(0x10d),'selectable','skeleton'];function _typeof(_0x49cd50){'@babel/helpers - typeof';var _0x5016ca=_0x352f03;return _typeof=_0x5016ca(0x10b)==typeof Symbol&&'symbol'==typeof Symbol[_0x5016ca(0xe7)]?function(_0x484e8f){return typeof _0x484e8f;}:function(_0x5dc40e){var _0x37c5a0=_0x5016ca;return _0x5dc40e&&_0x37c5a0(0x10b)==typeof Symbol&&_0x5dc40e[_0x37c5a0(0xe3)]===Symbol&&_0x5dc40e!==Symbol[_0x37c5a0(0xf1)]?'symbol':typeof _0x5dc40e;},_typeof(_0x49cd50);}function ownKeys(_0x2a59e4,_0x3d55ec){var _0xb02352=_0x352f03,_0x199b43=Object[_0xb02352(0xfb)](_0x2a59e4);if(Object['getOwnPropertySymbols']){var _0x2aeddf=Object[_0xb02352(0x108)](_0x2a59e4);_0x3d55ec&&(_0x2aeddf=_0x2aeddf[_0xb02352(0x113)](function(_0x29bd2b){var _0x2d0b78=_0xb02352;return Object[_0x2d0b78(0xeb)](_0x2a59e4,_0x29bd2b)[_0x2d0b78(0x10c)];})),_0x199b43[_0xb02352(0xe6)][_0xb02352(0x10a)](_0x199b43,_0x2aeddf);}return _0x199b43;}function _objectSpread(_0x54f324){var _0x477ba0=_0x352f03;for(var _0x19d150=0x1;_0x19d150<arguments[_0x477ba0(0xef)];_0x19d150++){var _0x1a1051=null!=arguments[_0x19d150]?arguments[_0x19d150]:{};_0x19d150%0x2?ownKeys(Object(_0x1a1051),!0x0)[_0x477ba0(0x102)](function(_0x5ec937){_defineProperty(_0x54f324,_0x5ec937,_0x1a1051[_0x5ec937]);}):Object[_0x477ba0(0xec)]?Object['defineProperties'](_0x54f324,Object[_0x477ba0(0xec)](_0x1a1051)):ownKeys(Object(_0x1a1051))[_0x477ba0(0x102)](function(_0x108786){var _0x597a93=_0x477ba0;Object['defineProperty'](_0x54f324,_0x108786,Object[_0x597a93(0xeb)](_0x1a1051,_0x108786));});}return _0x54f324;}function _0x1956(_0x127029,_0x9d31a7){_0x127029=_0x127029-0xdb;var _0x4de897=_0x4de8();var _0x195698=_0x4de897[_0x127029];return _0x195698;}function _defineProperty(_0x46ce69,_0x105e31,_0x232dc9){var _0x43140d=_0x352f03;return _0x105e31=_toPropertyKey(_0x105e31),_0x105e31 in _0x46ce69?Object[_0x43140d(0x106)](_0x46ce69,_0x105e31,{'value':_0x232dc9,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x46ce69[_0x105e31]=_0x232dc9,_0x46ce69;}function _toPropertyKey(_0x1600d4){var _0xa268f1=_0x352f03,_0x245fa9=_toPrimitive(_0x1600d4,_0xa268f1(0x116));return _0xa268f1(0x104)==_typeof(_0x245fa9)?_0x245fa9:String(_0x245fa9);}function _toPrimitive(_0x5f5b33,_0xf00cdd){var _0x542911=_0x352f03;if(_0x542911(0xf8)!=_typeof(_0x5f5b33)||!_0x5f5b33)return _0x5f5b33;var _0x25384a=_0x5f5b33[Symbol['toPrimitive']];if(void 0x0!==_0x25384a){var _0x2f74c6=_0x25384a[_0x542911(0x112)](_0x5f5b33,_0xf00cdd||_0x542911(0xf6));if(_0x542911(0xf8)!=_typeof(_0x2f74c6))return _0x2f74c6;throw new TypeError(_0x542911(0xde));}return('string'===_0xf00cdd?String:Number)(_0x5f5b33);}function _objectWithoutProperties(_0x232ad0,_0x3ef0e9){var _0x49588c=_0x352f03;if(_0x232ad0==null)return{};var _0x5cec47=_objectWithoutPropertiesLoose(_0x232ad0,_0x3ef0e9),_0x1055a5,_0x469563;if(Object[_0x49588c(0x108)]){var _0x375b7d=Object[_0x49588c(0x108)](_0x232ad0);for(_0x469563=0x0;_0x469563<_0x375b7d['length'];_0x469563++){_0x1055a5=_0x375b7d[_0x469563];if(_0x3ef0e9[_0x49588c(0xe2)](_0x1055a5)>=0x0)continue;if(!Object['prototype'][_0x49588c(0xdb)]['call'](_0x232ad0,_0x1055a5))continue;_0x5cec47[_0x1055a5]=_0x232ad0[_0x1055a5];}}return _0x5cec47;}function _objectWithoutPropertiesLoose(_0xb7a7c9,_0x16c691){var _0x38342c=_0x352f03;if(_0xb7a7c9==null)return{};var _0x5d34bd={},_0x27b348=Object['keys'](_0xb7a7c9),_0xeac921,_0x4f33e0;for(_0x4f33e0=0x0;_0x4f33e0<_0x27b348[_0x38342c(0xef)];_0x4f33e0++){_0xeac921=_0x27b348[_0x4f33e0];if(_0x16c691[_0x38342c(0xe2)](_0xeac921)>=0x0)continue;_0x5d34bd[_0xeac921]=_0xb7a7c9[_0xeac921];}return _0x5d34bd;}import _0x100ad3,{forwardRef}from'react';import{Text as _0x50db9a}from'@tarojs/components';import _0x282cdc from'classnames';import'../../styles/index.css';import{jsx as _0x731ea9}from'react/jsx-runtime';var px=function px(_0x55ee17){var _0x4e832b=_0x352f03;if(_0x55ee17===undefined||_0x55ee17===null||_0x55ee17==='')return undefined;return typeof _0x55ee17===_0x4e832b(0x105)||!isNaN(Number(_0x55ee17))?''['concat'](_0x55ee17,'px'):String(_0x55ee17);},Text=forwardRef(function(_0x588ce0,_0x969ec2){var _0x5090d8=_0x352f03,_0x2e2158=_0x588ce0[_0x5090d8(0xf5)],_0x6113e6=_0x588ce0[_0x5090d8(0x115)],_0x4a1cb6=_0x588ce0[_0x5090d8(0x119)],_0x3b1e4a=_0x588ce0[_0x5090d8(0xf7)],_0x579c04=_0x588ce0[_0x5090d8(0xee)],_0x3c9508=_0x588ce0[_0x5090d8(0x11d)],_0x336db1=_0x588ce0[_0x5090d8(0xed)],_0x5a137a=_0x588ce0[_0x5090d8(0x117)],_0x54d9c4=_0x588ce0[_0x5090d8(0xe9)],_0x4e09e5=_0x588ce0[_0x5090d8(0xfd)],_0x1610af=_0x588ce0['style'],_0x298ce0=_0x1610af===void 0x0?{}:_0x1610af,_0x72791f=_0x588ce0[_0x5090d8(0xf3)],_0x52e39e=_0x588ce0['mHorizontal'],_0x3ef798=_0x588ce0['mVertical'],_0x12c6e9=_0x588ce0[_0x5090d8(0x107)],_0x369539=_0x588ce0['pVertical'],_0x86f5a4=_0x588ce0[_0x5090d8(0x100)],_0x2930ed=_0x588ce0[_0x5090d8(0xf2)],_0x51b882=_0x588ce0[_0x5090d8(0x103)],_0x46daf9=_0x588ce0[_0x5090d8(0x10f)],_0x30e73d=_0x588ce0[_0x5090d8(0xe4)],_0x5e6c8e=_0x588ce0[_0x5090d8(0xea)],_0x1df7c4=_0x588ce0['pLeft'],_0x499689=_0x588ce0['pRight'],_0x1b93b4=_0x588ce0[_0x5090d8(0xe5)],_0x56593e=_0x588ce0[_0x5090d8(0xdc)],_0x1e383f=_0x588ce0[_0x5090d8(0x10d)],_0x252404=_0x588ce0[_0x5090d8(0xf0)],_0x245229=_0x588ce0[_0x5090d8(0x109)],_0x27ef02=_objectWithoutProperties(_0x588ce0,_excluded),_0x3e4830=_0x282cdc(_0x1b93b4,{'zero-line-clamp-1':_0x6113e6===0x1,'zero-line-clamp-2':_0x6113e6===0x2,'zero-line-clamp-3':_0x6113e6===0x3,'zero-line-clamp-4':_0x6113e6===0x4,'zero-line-clamp-5':_0x6113e6===0x5,'zero-line-clamp-6':_0x6113e6===0x6,'zero-animate-pulse\x20zero-bg-gray-200\x20zero-text-transparent':_0x245229}),_0x137324=_objectSpread({'width':px(_0x4a1cb6),'height':px(_0x3b1e4a),'margin':px(_0x54d9c4),'marginTop':px(_0x86f5a4!==null&&_0x86f5a4!==void 0x0?_0x86f5a4:_0x3ef798),'marginBottom':px(_0x2930ed!==null&&_0x2930ed!==void 0x0?_0x2930ed:_0x3ef798),'marginLeft':px(_0x51b882!==null&&_0x51b882!==void 0x0?_0x51b882:_0x52e39e),'marginRight':px(_0x46daf9!==null&&_0x46daf9!==void 0x0?_0x46daf9:_0x52e39e),'padding':px(_0x4e09e5),'paddingTop':px(_0x30e73d!==null&&_0x30e73d!==void 0x0?_0x30e73d:_0x369539),'paddingBottom':px(_0x5e6c8e!==null&&_0x5e6c8e!==void 0x0?_0x5e6c8e:_0x369539),'paddingLeft':px(_0x1df7c4!==null&&_0x1df7c4!==void 0x0?_0x1df7c4:_0x12c6e9),'paddingRight':px(_0x499689!==null&&_0x499689!==void 0x0?_0x499689:_0x12c6e9),'fontSize':px(_0x336db1),'color':_0x245229?_0x5090d8(0xdd):_0x5a137a,'backgroundColor':_0x72791f,'lineHeight':px(_0x579c04),'fontWeight':typeof _0x3c9508==='boolean'?_0x3c9508?_0x5090d8(0x11d):_0x5090d8(0xe1):_0x3c9508,'textAlign':_0x56593e,'textDecoration':_0x1e383f},_typeof(_0x298ce0)==='object'?_0x298ce0:{}),_0x1435d6={};for(var _0x484f11 in _0x137324){_0x137324[_0x484f11]!==undefined&&_0x137324[_0x484f11]!==null&&(_0x1435d6[_0x484f11]=_0x137324[_0x484f11]);}return _0x731ea9(_0x50db9a,_objectSpread(_objectSpread({'ref':_0x969ec2,'style':_0x1435d6,'className':_0x3e4830,'selectable':_0x252404},_0x27ef02),{},{'children':_0x2e2158}));});Text[_0x352f03(0xdf)]='Text';function _0x4de8(){var _0x463429=['@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','displayName','275kyIlhf','normal','indexOf','constructor','pTop','className','push','iterator','style','margin','pBottom','getOwnPropertyDescriptor','getOwnPropertyDescriptors','fontSize','lineHeight','length','selectable','prototype','mBottom','bgColor','3649768SKBOuL','children','default','height','object','pLeft','7QcBSor','keys','316665IgHNJC','padding','pRight','63672CWZxda','mTop','1497582VUojmZ','forEach','mLeft','symbol','number','defineProperty','pHorizontal','getOwnPropertySymbols','skeleton','apply','function','enumerable','decoration','232954VYZdmx','mRight','3490020AqCcFt','mVertical','call','filter','pVertical','clamp','string','color','714296rnobWK','width','24rKnopb','mHorizontal','390pVgFLg','bold','propertyIsEnumerable','textAlign','transparent'];_0x4de8=function(){return _0x463429;};return _0x4de8();}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 边框颜色