@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,164 @@
1
- 'use strict';var _0x429148=_0x1cbd;(function(_0xd6edc2,_0x175b73){var _0x545f36=_0x1cbd,_0x5b7876=_0xd6edc2();while(!![]){try{var _0x5e1bb1=parseInt(_0x545f36(0x7a))/0x1*(-parseInt(_0x545f36(0x91))/0x2)+parseInt(_0x545f36(0x97))/0x3+parseInt(_0x545f36(0x80))/0x4+-parseInt(_0x545f36(0xa9))/0x5+parseInt(_0x545f36(0xa5))/0x6+-parseInt(_0x545f36(0xa6))/0x7*(-parseInt(_0x545f36(0x78))/0x8)+-parseInt(_0x545f36(0x83))/0x9;if(_0x5e1bb1===_0x175b73)break;else _0x5b7876['push'](_0x5b7876['shift']());}catch(_0x408daf){_0x5b7876['push'](_0x5b7876['shift']());}}}(_0x2599,0x5a0d2));Object[_0x429148(0xa7)](exports,_0x429148(0x77),{'value':!![]}),exports[_0x429148(0x92)]=createPermissionStore;function _typeof(_0x1ad545){'@babel/helpers - typeof';var _0x3b06e8=_0x429148;return _typeof=_0x3b06e8(0x81)==typeof Symbol&&_0x3b06e8(0xa4)==typeof Symbol[_0x3b06e8(0x89)]?function(_0x39be4d){return typeof _0x39be4d;}:function(_0x1db32f){var _0x57b704=_0x3b06e8;return _0x1db32f&&_0x57b704(0x81)==typeof Symbol&&_0x1db32f['constructor']===Symbol&&_0x1db32f!==Symbol[_0x57b704(0x9a)]?_0x57b704(0xa4):typeof _0x1db32f;},_typeof(_0x1ad545);}function ownKeys(_0x5b1636,_0x24dfee){var _0x23557f=_0x429148,_0x2fcd22=Object[_0x23557f(0x7c)](_0x5b1636);if(Object[_0x23557f(0x87)]){var _0x4e7e3c=Object[_0x23557f(0x87)](_0x5b1636);_0x24dfee&&(_0x4e7e3c=_0x4e7e3c[_0x23557f(0x9d)](function(_0x4dced7){var _0x4a3a8d=_0x23557f;return Object['getOwnPropertyDescriptor'](_0x5b1636,_0x4dced7)[_0x4a3a8d(0xa0)];})),_0x2fcd22[_0x23557f(0x8e)][_0x23557f(0xaa)](_0x2fcd22,_0x4e7e3c);}return _0x2fcd22;}function _objectSpread(_0x27f8de){var _0x19faa2=_0x429148;for(var _0x2f4088=0x1;_0x2f4088<arguments[_0x19faa2(0x90)];_0x2f4088++){var _0x1b8a41=null!=arguments[_0x2f4088]?arguments[_0x2f4088]:{};_0x2f4088%0x2?ownKeys(Object(_0x1b8a41),!0x0)[_0x19faa2(0x82)](function(_0xb403f0){_defineProperty(_0x27f8de,_0xb403f0,_0x1b8a41[_0xb403f0]);}):Object[_0x19faa2(0x94)]?Object[_0x19faa2(0x98)](_0x27f8de,Object[_0x19faa2(0x94)](_0x1b8a41)):ownKeys(Object(_0x1b8a41))[_0x19faa2(0x82)](function(_0x52a189){var _0x243978=_0x19faa2;Object['defineProperty'](_0x27f8de,_0x52a189,Object[_0x243978(0x8f)](_0x1b8a41,_0x52a189));});}return _0x27f8de;}function _classCallCheck(_0x24fded,_0x1a6874){var _0x87700d=_0x429148;if(!(_0x24fded instanceof _0x1a6874))throw new TypeError(_0x87700d(0xa2));}function _0x2599(){var _0xb379c9=['clear','1208645AIwMvR','apply','updatePermission','__esModule','48aGLcCD','loadPermission','11AHbIjr','value','keys','listeners','state','permission','1432292WcOEtv','function','forEach','1864386ujtgkI','subscribe','granted','getState','getOwnPropertySymbols','savePermission','iterator','delete','destroy','getSnapshot','cachedActions','push','getOwnPropertyDescriptor','length','93046npXeIy','createPermissionStore','updateUser','getOwnPropertyDescriptors','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','user','2071059hyQynC','defineProperties','denied','prototype','object','emitChange','filter','key','call','enumerable','adapter','Cannot\x20call\x20a\x20class\x20as\x20a\x20function','buildState','symbol','508224YKlEIm','229082ZVhusP','defineProperty'];_0x2599=function(){return _0xb379c9;};return _0x2599();}function _defineProperties(_0x4655f4,_0x4d4489){var _0x331220=_0x429148;for(var _0x1f2fbe=0x0;_0x1f2fbe<_0x4d4489[_0x331220(0x90)];_0x1f2fbe++){var _0x4ea8bc=_0x4d4489[_0x1f2fbe];_0x4ea8bc['enumerable']=_0x4ea8bc[_0x331220(0xa0)]||![],_0x4ea8bc['configurable']=!![];if(_0x331220(0x7b)in _0x4ea8bc)_0x4ea8bc['writable']=!![];Object['defineProperty'](_0x4655f4,_toPropertyKey(_0x4ea8bc[_0x331220(0x9e)]),_0x4ea8bc);}}function _0x1cbd(_0x2c2557,_0x39ba22){_0x2c2557=_0x2c2557-0x77;var _0x25991d=_0x2599();var _0x1cbd32=_0x25991d[_0x2c2557];return _0x1cbd32;}function _createClass(_0x4c303a,_0xcd9728,_0x40294f){var _0x383539=_0x429148;if(_0xcd9728)_defineProperties(_0x4c303a['prototype'],_0xcd9728);if(_0x40294f)_defineProperties(_0x4c303a,_0x40294f);return Object[_0x383539(0xa7)](_0x4c303a,'prototype',{'writable':![]}),_0x4c303a;}function _defineProperty(_0x3dd5e0,_0x4476df,_0x939b4c){var _0x23b5e7=_0x429148;return _0x4476df=_toPropertyKey(_0x4476df),_0x4476df in _0x3dd5e0?Object[_0x23b5e7(0xa7)](_0x3dd5e0,_0x4476df,{'value':_0x939b4c,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x3dd5e0[_0x4476df]=_0x939b4c,_0x3dd5e0;}function _toPropertyKey(_0x1bdc58){var _0x20e148=_0x429148,_0x22a33d=_toPrimitive(_0x1bdc58,'string');return _0x20e148(0xa4)==_typeof(_0x22a33d)?_0x22a33d:String(_0x22a33d);}function _toPrimitive(_0x4ad48a,_0x33a5f1){var _0x55c3dc=_0x429148;if(_0x55c3dc(0x9b)!=_typeof(_0x4ad48a)||!_0x4ad48a)return _0x4ad48a;var _0x2ec2d0=_0x4ad48a[Symbol['toPrimitive']];if(void 0x0!==_0x2ec2d0){var _0x48bd84=_0x2ec2d0[_0x55c3dc(0x9f)](_0x4ad48a,_0x33a5f1||'default');if(_0x55c3dc(0x9b)!=_typeof(_0x48bd84))return _0x48bd84;throw new TypeError(_0x55c3dc(0x95));}return('string'===_0x33a5f1?String:Number)(_0x4ad48a);}var PermissionStore=(function(){var _0x388494=_0x429148;function _0x32f313(_0x401a70){var _0x52c7be=_0x1cbd,_0x4c062e=this;_classCallCheck(this,_0x32f313),_defineProperty(this,_0x52c7be(0x7e),void 0x0),_defineProperty(this,_0x52c7be(0x7d),new Set()),_defineProperty(this,'cachedActions',void 0x0),_defineProperty(this,_0x52c7be(0x8c),function(){var _0x326c22=_0x52c7be;return _0x4c062e[_0x326c22(0x7e)];}),_defineProperty(this,_0x52c7be(0x86),function(){var _0x4ca58c=_0x52c7be;return _0x4c062e[_0x4ca58c(0x7e)];}),_defineProperty(this,_0x52c7be(0x84),function(_0x5231d7){var _0x2c4e72=_0x52c7be;return _0x4c062e[_0x2c4e72(0x7d)]['add'](_0x5231d7),function(){var _0x2e0cff=_0x2c4e72;return _0x4c062e[_0x2e0cff(0x7d)][_0x2e0cff(0x8a)](_0x5231d7);};}),_defineProperty(this,'emitChange',function(){var _0x41a652=_0x52c7be;_0x4c062e[_0x41a652(0x7d)][_0x41a652(0x82)](function(_0x571fc8){return _0x571fc8();});}),_defineProperty(this,_0x52c7be(0x85),function(_0x691afc,_0x307fc0){var _0x3f6d25=_0x52c7be;_0x4c062e[_0x3f6d25(0xa1)]['savePermission'](_0x691afc),_0x307fc0!==undefined&&_0x4c062e[_0x3f6d25(0xa1)]['saveUser'](_0x307fc0),_0x4c062e['state']=_0x4c062e[_0x3f6d25(0xa3)](_0x691afc,_0x307fc0),_0x4c062e[_0x3f6d25(0x9c)]();}),_defineProperty(this,'denied',function(){var _0x13d67f=_0x52c7be;_0x4c062e[_0x13d67f(0xa1)][_0x13d67f(0xa8)](),_0x4c062e[_0x13d67f(0x7e)]=_0x4c062e[_0x13d67f(0xa3)](),_0x4c062e['emitChange']();}),_defineProperty(this,_0x52c7be(0x93),function(_0x1cfc2e){var _0x131ed0=_0x52c7be,_0xc4f5a4=_objectSpread(_objectSpread({},_0x4c062e[_0x131ed0(0x7e)][_0x131ed0(0x96)]),_0x1cfc2e);_0x4c062e[_0x131ed0(0xa1)]['saveUser'](_0xc4f5a4),_0x4c062e[_0x131ed0(0x7e)]=_0x4c062e[_0x131ed0(0xa3)](_0x4c062e[_0x131ed0(0x7e)][_0x131ed0(0x7f)],_0xc4f5a4),_0x4c062e[_0x131ed0(0x9c)]();}),_defineProperty(this,_0x52c7be(0xab),function(_0x9ce491){var _0x2297fd=_0x52c7be,_0x525b35=_objectSpread(_objectSpread({},_0x4c062e[_0x2297fd(0x7e)]['permission']),_0x9ce491);_0x4c062e[_0x2297fd(0xa1)][_0x2297fd(0x88)](_0x525b35),_0x4c062e[_0x2297fd(0x7e)]=_0x4c062e[_0x2297fd(0xa3)](_0x525b35,_0x4c062e[_0x2297fd(0x7e)][_0x2297fd(0x96)]),_0x4c062e[_0x2297fd(0x9c)]();}),_defineProperty(this,_0x52c7be(0x8b),function(){var _0xa0f3db=_0x52c7be;_0x4c062e[_0xa0f3db(0x7d)]['clear']();}),this[_0x52c7be(0xa1)]=_0x401a70,this[_0x52c7be(0x8d)]={'granted':this[_0x52c7be(0x85)],'denied':this[_0x52c7be(0x99)],'updateUser':this[_0x52c7be(0x93)],'updatePermission':this['updatePermission']};var _0xf6379f=_0x401a70[_0x52c7be(0x79)](),_0x417855=_0x401a70['loadUser']();this['state']=this[_0x52c7be(0xa3)](_0xf6379f instanceof Promise?undefined:_0xf6379f,_0x417855 instanceof Promise?undefined:_0x417855);}return _createClass(_0x32f313,[{'key':_0x388494(0xa3),'value':function _0x130207(_0x231915,_0x15cbdf){var _0x1bc383=_0x388494;return _objectSpread(_objectSpread({},this[_0x1bc383(0x8d)]),{},{'permission':_0x231915,'user':_0x15cbdf,'isGranted':!!_0x231915});}}]),_0x32f313;}());function createPermissionStore(_0x452bb1){return new PermissionStore(_0x452bb1);}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.createPermissionStore = createPermissionStore;
7
+ 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); }
8
+ 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; }
9
+ 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; }
10
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
+ 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); } }
12
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
13
+ 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; }
14
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
15
+ 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); }
16
+ /**
17
+ * Store 完整接口,包含 React useSyncExternalStore 所需的 getSnapshot / subscribe
18
+ * 业务侧若不希望在 IDE 补全中看到 React 内部方法,可将变量显式声明为 PermissionStorePublic
19
+ *
20
+ * @template P - 权限对象类型
21
+ * @template U - 用户对象类型
22
+ */
23
+ /**
24
+ * 业务侧(axios 拦截器等非 React 环境)使用的 Store 公共接口
25
+ * 只暴露权限操作方法和销毁能力,屏蔽 React 内部机制
26
+ *
27
+ * @template P - 权限对象类型
28
+ * @template U - 用户对象类型
29
+ */
30
+ var PermissionStore = /*#__PURE__*/function () {
31
+ /**
32
+ * @param adapter - 权限数据持久化适配器
33
+ * 类字段初始化先于构造函数体,此处 this.granted 等已绑定完毕
34
+ */
35
+ function PermissionStore(adapter) {
36
+ var _this = this;
37
+ _classCallCheck(this, PermissionStore);
38
+ _defineProperty(this, "state", void 0);
39
+ _defineProperty(this, "listeners", new Set());
40
+ /**
41
+ * 缓存 actions 对象以保证引用稳定
42
+ * 注意:类字段箭头函数(granted/denied 等)在构造函数体执行前已完成初始化
43
+ * 因此在构造函数体中赋值 cachedActions 时,this.granted 等引用已可用
44
+ */
45
+ _defineProperty(this, "cachedActions", void 0);
46
+ /**
47
+ * 获取当前状态快照(供 React 及内部使用)
48
+ * @returns {PermissionContextValue<P, U>} 权限上下文值
49
+ */
50
+ _defineProperty(this, "getSnapshot", function () {
51
+ return _this.state;
52
+ });
53
+ /**
54
+ * 同步获取当前状态(供业务侧非 React 环境使用)
55
+ * @returns {PermissionContextValue<P, U>} 权限上下文值
56
+ */
57
+ _defineProperty(this, "getState", function () {
58
+ return _this.state;
59
+ });
60
+ /**
61
+ * 订阅状态变更,返回取消订阅函数(供 useSyncExternalStore 使用)
62
+ * @param {() => void} listener - 状态变更时的回调
63
+ * @returns {() => void} 取消订阅函数
64
+ */
65
+ _defineProperty(this, "subscribe", function (listener) {
66
+ _this.listeners.add(listener);
67
+ return function () {
68
+ return _this.listeners.delete(listener);
69
+ };
70
+ });
71
+ /**
72
+ * 通知所有订阅者状态已变更
73
+ */
74
+ _defineProperty(this, "emitChange", function () {
75
+ _this.listeners.forEach(function (l) {
76
+ return l();
77
+ });
78
+ });
79
+ /**
80
+ * 授权方法,登录成功后调用
81
+ * @param {P} permission - 权限数据
82
+ * @param {U} [user] - 用户信息(可选,后续可通过 updateUser 补充)
83
+ */
84
+ _defineProperty(this, "granted", function (permission, user) {
85
+ _this.adapter.savePermission(permission);
86
+ if (user !== undefined) {
87
+ _this.adapter.saveUser(user);
88
+ }
89
+ _this.state = _this.buildState(permission, user);
90
+ _this.emitChange();
91
+ });
92
+ /**
93
+ * 取消授权,清空所有持久化数据并通知订阅者
94
+ */
95
+ _defineProperty(this, "denied", function () {
96
+ _this.adapter.clear();
97
+ _this.state = _this.buildState();
98
+ _this.emitChange();
99
+ });
100
+ /**
101
+ * 更新用户信息(部分字段覆盖,不影响权限数据)
102
+ * @param {Partial<U>} userInfo - 需要更新的字段
103
+ */
104
+ _defineProperty(this, "updateUser", function (userInfo) {
105
+ var nextUser = _objectSpread(_objectSpread({}, _this.state.user), userInfo);
106
+ _this.adapter.saveUser(nextUser);
107
+ _this.state = _this.buildState(_this.state.permission, nextUser);
108
+ _this.emitChange();
109
+ });
110
+ /**
111
+ * 更新权限数据(部分字段覆盖,例如无感刷新 token 后调用)
112
+ * @param {Partial<P>} permissionInfo - 需要更新的权限字段
113
+ */
114
+ _defineProperty(this, "updatePermission", function (permissionInfo) {
115
+ var nextPermission = _objectSpread(_objectSpread({}, _this.state.permission), permissionInfo);
116
+ _this.adapter.savePermission(nextPermission);
117
+ _this.state = _this.buildState(nextPermission, _this.state.user);
118
+ _this.emitChange();
119
+ });
120
+ /** 销毁 Store,清除所有订阅者 */
121
+ _defineProperty(this, "destroy", function () {
122
+ _this.listeners.clear();
123
+ });
124
+ this.adapter = adapter;
125
+ this.cachedActions = {
126
+ granted: this.granted,
127
+ denied: this.denied,
128
+ updateUser: this.updateUser,
129
+ updatePermission: this.updatePermission
130
+ };
131
+ var _permission = adapter.loadPermission();
132
+ var _user = adapter.loadUser();
133
+ this.state = this.buildState(_permission instanceof Promise ? undefined : _permission, _user instanceof Promise ? undefined : _user);
134
+ }
135
+
136
+ /**
137
+ * 构建状态快照,复用 cachedActions 保证方法引用稳定性
138
+ * @param permission - 权限数据
139
+ * @param user - 用户信息
140
+ */
141
+ _createClass(PermissionStore, [{
142
+ key: "buildState",
143
+ value: function buildState(permission, user) {
144
+ return _objectSpread(_objectSpread({}, this.cachedActions), {}, {
145
+ permission: permission,
146
+ user: user,
147
+ isGranted: !!permission
148
+ });
149
+ }
150
+ }]);
151
+ return PermissionStore;
152
+ }();
153
+ /**
154
+ * 创建权限 Store 实例
155
+ * 返回 PermissionStoreInternal 类型(包含完整接口)
156
+ * 若业务侧不希望在 IDE 中看到 React 内部方法,可将变量显式声明为 PermissionStorePublic:
157
+ * const store: PermissionStorePublic<P, U> = createPermissionStore(adapter)
158
+ *
159
+ * @param {PermissionAdapter<P, U>} adapter - 权限数据持久化适配器
160
+ * @returns {PermissionStoreInternal<P, U>} 权限 Store 实例
161
+ */
162
+ function createPermissionStore(adapter) {
163
+ return new PermissionStore(adapter);
164
+ }
@@ -1 +1,145 @@
1
- 'use strict';var _0x36454d=_0x158a;(function(_0x491a09,_0x32d2c4){var _0xe1a8fe=_0x158a,_0x24299e=_0x491a09();while(!![]){try{var _0x20f192=parseInt(_0xe1a8fe(0x17d))/0x1*(-parseInt(_0xe1a8fe(0x159))/0x2)+parseInt(_0xe1a8fe(0x16b))/0x3*(parseInt(_0xe1a8fe(0x153))/0x4)+parseInt(_0xe1a8fe(0x158))/0x5+parseInt(_0xe1a8fe(0x15a))/0x6*(-parseInt(_0xe1a8fe(0x169))/0x7)+-parseInt(_0xe1a8fe(0x145))/0x8*(-parseInt(_0xe1a8fe(0x148))/0x9)+parseInt(_0xe1a8fe(0x155))/0xa*(parseInt(_0xe1a8fe(0x178))/0xb)+parseInt(_0xe1a8fe(0x16c))/0xc*(-parseInt(_0xe1a8fe(0x14c))/0xd);if(_0x20f192===_0x32d2c4)break;else _0x24299e['push'](_0x24299e['shift']());}catch(_0x1b1166){_0x24299e['push'](_0x24299e['shift']());}}}(_0x204e,0x40197));function _0x158a(_0x5b549d,_0x474384){_0x5b549d=_0x5b549d-0x13c;var _0x204e02=_0x204e();var _0x158aa9=_0x204e02[_0x5b549d];return _0x158aa9;}Object[_0x36454d(0x180)](exports,_0x36454d(0x13e),{'value':!![]}),exports[_0x36454d(0x140)]=void 0x0;var _react=_interopRequireWildcard(require('react')),_components=require(_0x36454d(0x17c)),_classnames=_interopRequireDefault(require(_0x36454d(0x17f)));require('../../styles/index.css');var _jsxRuntime=require('react/jsx-runtime'),_excluded=[_0x36454d(0x15b),_0x36454d(0x16d),_0x36454d(0x183),_0x36454d(0x179),_0x36454d(0x167),_0x36454d(0x15f),_0x36454d(0x14f),_0x36454d(0x160),'margin',_0x36454d(0x147),_0x36454d(0x146),_0x36454d(0x150),_0x36454d(0x16e),_0x36454d(0x176),_0x36454d(0x149),_0x36454d(0x14d),_0x36454d(0x15c),_0x36454d(0x13d),'mLeft',_0x36454d(0x16f),_0x36454d(0x173),_0x36454d(0x14a),'pLeft',_0x36454d(0x181),'className',_0x36454d(0x13f),_0x36454d(0x14e),_0x36454d(0x157),_0x36454d(0x154)];function _interopRequireDefault(_0x54ccac){var _0x1b4130=_0x36454d;return _0x54ccac&&_0x54ccac[_0x1b4130(0x13e)]?_0x54ccac:{'default':_0x54ccac};}function _getRequireWildcardCache(_0xd38d06){var _0x563c1c=_0x36454d;if(_0x563c1c(0x171)!=typeof WeakMap)return null;var _0x250361=new WeakMap(),_0x25744d=new WeakMap();return(_getRequireWildcardCache=function _0x3c1177(_0x1c43f1){return _0x1c43f1?_0x25744d:_0x250361;})(_0xd38d06);}function _interopRequireWildcard(_0x2466f2,_0x37c829){var _0x567e81=_0x36454d;if(!_0x37c829&&_0x2466f2&&_0x2466f2[_0x567e81(0x13e)])return _0x2466f2;if(null===_0x2466f2||'object'!=_typeof(_0x2466f2)&&_0x567e81(0x171)!=typeof _0x2466f2)return{'default':_0x2466f2};var _0x31adf1=_getRequireWildcardCache(_0x37c829);if(_0x31adf1&&_0x31adf1['has'](_0x2466f2))return _0x31adf1[_0x567e81(0x16a)](_0x2466f2);var _0x8d5d4a={'__proto__':null},_0x3cf938=Object[_0x567e81(0x180)]&&Object[_0x567e81(0x17b)];for(var _0x13a5e2 in _0x2466f2)if(_0x567e81(0x140)!==_0x13a5e2&&Object[_0x567e81(0x166)][_0x567e81(0x164)][_0x567e81(0x15e)](_0x2466f2,_0x13a5e2)){var _0x27c145=_0x3cf938?Object[_0x567e81(0x17b)](_0x2466f2,_0x13a5e2):null;_0x27c145&&(_0x27c145['get']||_0x27c145[_0x567e81(0x184)])?Object[_0x567e81(0x180)](_0x8d5d4a,_0x13a5e2,_0x27c145):_0x8d5d4a[_0x13a5e2]=_0x2466f2[_0x13a5e2];}return _0x8d5d4a[_0x567e81(0x140)]=_0x2466f2,_0x31adf1&&_0x31adf1[_0x567e81(0x184)](_0x2466f2,_0x8d5d4a),_0x8d5d4a;}function _typeof(_0x1ef4ee){'@babel/helpers - typeof';var _0x341b72=_0x36454d;return _typeof=_0x341b72(0x171)==typeof Symbol&&_0x341b72(0x143)==typeof Symbol['iterator']?function(_0x5769bd){return typeof _0x5769bd;}:function(_0x1491b7){var _0x4f70d7=_0x341b72;return _0x1491b7&&_0x4f70d7(0x171)==typeof Symbol&&_0x1491b7['constructor']===Symbol&&_0x1491b7!==Symbol[_0x4f70d7(0x166)]?_0x4f70d7(0x143):typeof _0x1491b7;},_typeof(_0x1ef4ee);}function ownKeys(_0x1271e1,_0x40e9cd){var _0x1e6f0b=_0x36454d,_0xc51593=Object[_0x1e6f0b(0x163)](_0x1271e1);if(Object['getOwnPropertySymbols']){var _0x16f560=Object['getOwnPropertySymbols'](_0x1271e1);_0x40e9cd&&(_0x16f560=_0x16f560[_0x1e6f0b(0x17a)](function(_0x41b179){var _0x348a55=_0x1e6f0b;return Object[_0x348a55(0x17b)](_0x1271e1,_0x41b179)[_0x348a55(0x161)];})),_0xc51593['push'][_0x1e6f0b(0x14b)](_0xc51593,_0x16f560);}return _0xc51593;}function _objectSpread(_0x48fd87){var _0x54bfb6=_0x36454d;for(var _0x5cf6a8=0x1;_0x5cf6a8<arguments['length'];_0x5cf6a8++){var _0x2dc7eb=null!=arguments[_0x5cf6a8]?arguments[_0x5cf6a8]:{};_0x5cf6a8%0x2?ownKeys(Object(_0x2dc7eb),!0x0)['forEach'](function(_0x33bfeb){_defineProperty(_0x48fd87,_0x33bfeb,_0x2dc7eb[_0x33bfeb]);}):Object[_0x54bfb6(0x162)]?Object['defineProperties'](_0x48fd87,Object[_0x54bfb6(0x162)](_0x2dc7eb)):ownKeys(Object(_0x2dc7eb))['forEach'](function(_0x4ec86e){var _0x1e1496=_0x54bfb6;Object[_0x1e1496(0x180)](_0x48fd87,_0x4ec86e,Object[_0x1e1496(0x17b)](_0x2dc7eb,_0x4ec86e));});}return _0x48fd87;}function _0x204e(){var _0x20243f=['1460990YGJqvH','margin','selectable','2016580dJBndJ','2lXCuer','6DFqNfp','children','mTop','indexOf','call','bold','color','enumerable','getOwnPropertyDescriptors','keys','hasOwnProperty','className','prototype','lineHeight','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','1736833EVIKIm','get','192372vACUVw','62724rRMXRB','clamp','mHorizontal','mRight','forwardRef','function','object','pTop','getOwnPropertySymbols','displayName','mVertical','string','22gMSmAt','height','filter','getOwnPropertyDescriptor','@tarojs/components','459922ArUzHm','length','classnames','defineProperty','pRight','concat','width','set','mLeft','number','mBottom','__esModule','textAlign','default','Text','propertyIsEnumerable','symbol','toPrimitive','8YXgbxr','style','padding','869526xKsmPR','pHorizontal','pBottom','apply','832kmzbzS','pVertical','decoration','fontSize','bgColor','pLeft','transparent','32gBCAtG','skeleton'];_0x204e=function(){return _0x20243f;};return _0x204e();}function _defineProperty(_0x8304b2,_0x220f7a,_0x3a7d09){var _0x5bb40e=_0x36454d;return _0x220f7a=_toPropertyKey(_0x220f7a),_0x220f7a in _0x8304b2?Object[_0x5bb40e(0x180)](_0x8304b2,_0x220f7a,{'value':_0x3a7d09,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x8304b2[_0x220f7a]=_0x3a7d09,_0x8304b2;}function _toPropertyKey(_0x2e088e){var _0x510c10=_0x36454d,_0x52300c=_toPrimitive(_0x2e088e,'string');return _0x510c10(0x143)==_typeof(_0x52300c)?_0x52300c:String(_0x52300c);}function _toPrimitive(_0x4299dd,_0x4240e2){var _0xa0ff4e=_0x36454d;if(_0xa0ff4e(0x172)!=_typeof(_0x4299dd)||!_0x4299dd)return _0x4299dd;var _0x261a35=_0x4299dd[Symbol[_0xa0ff4e(0x144)]];if(void 0x0!==_0x261a35){var _0x42d7a3=_0x261a35[_0xa0ff4e(0x15e)](_0x4299dd,_0x4240e2||'default');if(_0xa0ff4e(0x172)!=_typeof(_0x42d7a3))return _0x42d7a3;throw new TypeError(_0xa0ff4e(0x168));}return(_0xa0ff4e(0x177)===_0x4240e2?String:Number)(_0x4299dd);}function _objectWithoutProperties(_0x4da375,_0x5041ae){var _0x2693aa=_0x36454d;if(_0x4da375==null)return{};var _0x5bff0e=_objectWithoutPropertiesLoose(_0x4da375,_0x5041ae),_0x495cae,_0x4ad5b3;if(Object['getOwnPropertySymbols']){var _0x7fe5ae=Object[_0x2693aa(0x174)](_0x4da375);for(_0x4ad5b3=0x0;_0x4ad5b3<_0x7fe5ae[_0x2693aa(0x17e)];_0x4ad5b3++){_0x495cae=_0x7fe5ae[_0x4ad5b3];if(_0x5041ae[_0x2693aa(0x15d)](_0x495cae)>=0x0)continue;if(!Object[_0x2693aa(0x166)][_0x2693aa(0x142)][_0x2693aa(0x15e)](_0x4da375,_0x495cae))continue;_0x5bff0e[_0x495cae]=_0x4da375[_0x495cae];}}return _0x5bff0e;}function _objectWithoutPropertiesLoose(_0x25b6e2,_0xd2bc38){var _0x54aeee=_0x36454d;if(_0x25b6e2==null)return{};var _0x32db32={},_0x4cb10a=Object[_0x54aeee(0x163)](_0x25b6e2),_0x4782ba,_0x41d825;for(_0x41d825=0x0;_0x41d825<_0x4cb10a[_0x54aeee(0x17e)];_0x41d825++){_0x4782ba=_0x4cb10a[_0x41d825];if(_0xd2bc38[_0x54aeee(0x15d)](_0x4782ba)>=0x0)continue;_0x32db32[_0x4782ba]=_0x25b6e2[_0x4782ba];}return _0x32db32;}var px=function px(_0x4e6cd6){var _0xb7a7a5=_0x36454d;if(_0x4e6cd6===undefined||_0x4e6cd6===null||_0x4e6cd6==='')return undefined;return typeof _0x4e6cd6===_0xb7a7a5(0x13c)||!isNaN(Number(_0x4e6cd6))?''[_0xb7a7a5(0x182)](_0x4e6cd6,'px'):String(_0x4e6cd6);},Text=(0x0,_react[_0x36454d(0x170)])(function(_0x374c01,_0x4735c1){var _0x58f5ce=_0x36454d,_0x4a3cfc=_0x374c01[_0x58f5ce(0x15b)],_0x40a2c0=_0x374c01[_0x58f5ce(0x16d)],_0x5876e2=_0x374c01[_0x58f5ce(0x183)],_0x4a90f1=_0x374c01[_0x58f5ce(0x179)],_0x52b75e=_0x374c01['lineHeight'],_0xa49162=_0x374c01[_0x58f5ce(0x15f)],_0x42b239=_0x374c01['fontSize'],_0x18b006=_0x374c01[_0x58f5ce(0x160)],_0x4120d0=_0x374c01[_0x58f5ce(0x156)],_0x22e514=_0x374c01['padding'],_0x51b705=_0x374c01[_0x58f5ce(0x146)],_0x54253c=_0x51b705===void 0x0?{}:_0x51b705,_0x24e330=_0x374c01[_0x58f5ce(0x150)],_0x308b36=_0x374c01[_0x58f5ce(0x16e)],_0x56bafa=_0x374c01['mVertical'],_0x5b17fc=_0x374c01[_0x58f5ce(0x149)],_0x236c63=_0x374c01[_0x58f5ce(0x14d)],_0x13e25d=_0x374c01['mTop'],_0x1fb736=_0x374c01[_0x58f5ce(0x13d)],_0x169240=_0x374c01[_0x58f5ce(0x185)],_0x475af0=_0x374c01[_0x58f5ce(0x16f)],_0x57a713=_0x374c01[_0x58f5ce(0x173)],_0x327fe4=_0x374c01[_0x58f5ce(0x14a)],_0x4b384d=_0x374c01[_0x58f5ce(0x151)],_0x22b463=_0x374c01['pRight'],_0x4090b1=_0x374c01[_0x58f5ce(0x165)],_0xf98114=_0x374c01['textAlign'],_0x1f04f4=_0x374c01[_0x58f5ce(0x14e)],_0x4b0d93=_0x374c01[_0x58f5ce(0x157)],_0xd59050=_0x374c01[_0x58f5ce(0x154)],_0x476c78=_objectWithoutProperties(_0x374c01,_excluded),_0x41a473=(0x0,_classnames['default'])(_0x4090b1,{'zero-line-clamp-1':_0x40a2c0===0x1,'zero-line-clamp-2':_0x40a2c0===0x2,'zero-line-clamp-3':_0x40a2c0===0x3,'zero-line-clamp-4':_0x40a2c0===0x4,'zero-line-clamp-5':_0x40a2c0===0x5,'zero-line-clamp-6':_0x40a2c0===0x6,'zero-animate-pulse\x20zero-bg-gray-200\x20zero-text-transparent':_0xd59050}),_0x25112c=_objectSpread({'width':px(_0x5876e2),'height':px(_0x4a90f1),'margin':px(_0x4120d0),'marginTop':px(_0x13e25d!==null&&_0x13e25d!==void 0x0?_0x13e25d:_0x56bafa),'marginBottom':px(_0x1fb736!==null&&_0x1fb736!==void 0x0?_0x1fb736:_0x56bafa),'marginLeft':px(_0x169240!==null&&_0x169240!==void 0x0?_0x169240:_0x308b36),'marginRight':px(_0x475af0!==null&&_0x475af0!==void 0x0?_0x475af0:_0x308b36),'padding':px(_0x22e514),'paddingTop':px(_0x57a713!==null&&_0x57a713!==void 0x0?_0x57a713:_0x236c63),'paddingBottom':px(_0x327fe4!==null&&_0x327fe4!==void 0x0?_0x327fe4:_0x236c63),'paddingLeft':px(_0x4b384d!==null&&_0x4b384d!==void 0x0?_0x4b384d:_0x5b17fc),'paddingRight':px(_0x22b463!==null&&_0x22b463!==void 0x0?_0x22b463:_0x5b17fc),'fontSize':px(_0x42b239),'color':_0xd59050?_0x58f5ce(0x152):_0x18b006,'backgroundColor':_0x24e330,'lineHeight':px(_0x52b75e),'fontWeight':typeof _0xa49162==='boolean'?_0xa49162?_0x58f5ce(0x15f):'normal':_0xa49162,'textAlign':_0xf98114,'textDecoration':_0x1f04f4},_typeof(_0x54253c)==='object'?_0x54253c:{}),_0x57fe7a={};for(var _0x50113b in _0x25112c){_0x25112c[_0x50113b]!==undefined&&_0x25112c[_0x50113b]!==null&&(_0x57fe7a[_0x50113b]=_0x25112c[_0x50113b]);}return(0x0,_jsxRuntime['jsx'])(_components[_0x58f5ce(0x141)],_objectSpread(_objectSpread({'ref':_0x4735c1,'style':_0x57fe7a,'className':_0x41a473,'selectable':_0x4b0d93},_0x476c78),{},{'children':_0x4a3cfc}));});Text[_0x36454d(0x175)]=_0x36454d(0x141);var _default=exports['default']=Text;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _components = require("@tarojs/components");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ require("../../styles/index.css");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ 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"];
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
15
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
16
+ 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); }
17
+ 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; }
18
+ 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; }
19
+ 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; }
20
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
21
+ 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); }
22
+ 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; }
23
+ 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; }
24
+ /**
25
+ * 处理 px 转换
26
+ * @param val px|string|undefined
27
+ * @returns px|string|undefined
28
+ */
29
+ var px = function px(val) {
30
+ if (val === undefined || val === null || val === '') return undefined;
31
+ return typeof val === 'number' || !isNaN(Number(val)) ? "".concat(val, "px") : String(val);
32
+ };
33
+
34
+ /**
35
+ * taro weapp Text Component (Tailwind 版)
36
+ * - clamp: number|undefined 溢出显示行数
37
+ * - width: px|string|undefined 宽度
38
+ * - height: px|string|undefined 高度
39
+ * - fontSize: px|string|undefined 字体大小
40
+ * - lineHeight: px|string|undefined 行高
41
+ * - bold: boolean|number|string 字体粗细
42
+ * - color: string 字体颜色
43
+ * - bgColor: string 背景颜色
44
+ * - textAlign: 'left' | 'center' | 'right' | 'justify' 文本对齐方式
45
+ * - decoration: 'underline' | 'line-through' | 'none' 文本装饰
46
+ * - selectable: boolean 是否可选择
47
+ * - skeleton: boolean 是否为骨架屏
48
+ * - style: CSSProperties 自定义样式
49
+ * - children: ReactNode 子元素
50
+ * - margin: px|string|undefined 外边距
51
+ * - mTop: px|string|undefined 上外边距
52
+ * - mBottom: px|string|undefined 下外边距
53
+ * - mLeft: px|string|undefined 左外边距
54
+ * - mRight: px|string|undefined 右外边距
55
+ * - mHorizontal: px|string|undefined 水平外边距
56
+ * - mVertical: px|string|undefined 垂直外边距
57
+ * - padding: px|string|undefined 内边距
58
+ * - pTop: px|string|undefined 上内边距
59
+ * - pBottom: px|string|undefined 下内边距
60
+ * - pLeft: px|string|undefined 左内边距
61
+ * - pRight: px|string|undefined 右内边距
62
+ * - pHorizontal: px|string|undefined 水平内边距
63
+ * - pVertical: px|string|undefined 垂直内边距
64
+ * - rest: Text组件的其他属性
65
+ */
66
+ var Text = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
67
+ var children = props.children,
68
+ clamp = props.clamp,
69
+ width = props.width,
70
+ height = props.height,
71
+ lineHeight = props.lineHeight,
72
+ bold = props.bold,
73
+ fontSize = props.fontSize,
74
+ color = props.color,
75
+ margin = props.margin,
76
+ padding = props.padding,
77
+ _props$style = props.style,
78
+ style = _props$style === void 0 ? {} : _props$style,
79
+ bgColor = props.bgColor,
80
+ mHorizontal = props.mHorizontal,
81
+ mVertical = props.mVertical,
82
+ pHorizontal = props.pHorizontal,
83
+ pVertical = props.pVertical,
84
+ mTop = props.mTop,
85
+ mBottom = props.mBottom,
86
+ mLeft = props.mLeft,
87
+ mRight = props.mRight,
88
+ pTop = props.pTop,
89
+ pBottom = props.pBottom,
90
+ pLeft = props.pLeft,
91
+ pRight = props.pRight,
92
+ className = props.className,
93
+ textAlign = props.textAlign,
94
+ decoration = props.decoration,
95
+ selectable = props.selectable,
96
+ skeleton = props.skeleton,
97
+ rest = _objectWithoutProperties(props, _excluded);
98
+ var textClassNames = (0, _classnames.default)(className, {
99
+ 'zero-line-clamp-1': clamp === 1,
100
+ 'zero-line-clamp-2': clamp === 2,
101
+ 'zero-line-clamp-3': clamp === 3,
102
+ 'zero-line-clamp-4': clamp === 4,
103
+ 'zero-line-clamp-5': clamp === 5,
104
+ 'zero-line-clamp-6': clamp === 6,
105
+ 'zero-animate-pulse zero-bg-gray-200 zero-text-transparent': skeleton
106
+ });
107
+ var textStyle = _objectSpread({
108
+ width: px(width),
109
+ height: px(height),
110
+ margin: px(margin),
111
+ marginTop: px(mTop !== null && mTop !== void 0 ? mTop : mVertical),
112
+ marginBottom: px(mBottom !== null && mBottom !== void 0 ? mBottom : mVertical),
113
+ marginLeft: px(mLeft !== null && mLeft !== void 0 ? mLeft : mHorizontal),
114
+ marginRight: px(mRight !== null && mRight !== void 0 ? mRight : mHorizontal),
115
+ padding: px(padding),
116
+ paddingTop: px(pTop !== null && pTop !== void 0 ? pTop : pVertical),
117
+ paddingBottom: px(pBottom !== null && pBottom !== void 0 ? pBottom : pVertical),
118
+ paddingLeft: px(pLeft !== null && pLeft !== void 0 ? pLeft : pHorizontal),
119
+ paddingRight: px(pRight !== null && pRight !== void 0 ? pRight : pHorizontal),
120
+ fontSize: px(fontSize),
121
+ color: skeleton ? 'transparent' : color,
122
+ backgroundColor: bgColor,
123
+ lineHeight: px(lineHeight),
124
+ fontWeight: typeof bold === 'boolean' ? bold ? 'bold' : 'normal' : bold,
125
+ textAlign: textAlign,
126
+ textDecoration: decoration
127
+ }, _typeof(style) === 'object' ? style : {});
128
+ var cleanStyle = {};
129
+ for (var key in textStyle) {
130
+ if (textStyle[key] !== undefined && textStyle[key] !== null) {
131
+ // @ts-ignore
132
+ cleanStyle[key] = textStyle[key];
133
+ }
134
+ }
135
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Text, _objectSpread(_objectSpread({
136
+ ref: ref,
137
+ style: cleanStyle,
138
+ className: textClassNames,
139
+ selectable: selectable
140
+ }, rest), {}, {
141
+ children: children
142
+ }));
143
+ });
144
+ Text.displayName = 'Text';
145
+ var _default = exports.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 边框颜色
@@ -1 +1,227 @@
1
- 'use strict';var _0x3363fd=_0x1cb1;function _0x7da7(){var _0x35bf17=['className','alignItems','push','string','bgColor','View','concat','enumerable','pLeft','keys','flexBasis','children','calc(env(safe-area-inset-','around','jsx','default','apply','mRight','flexGrow','constructor','11182518GdUgtx','propertyIsEnumerable','pBottom','object','width','content-around','mTop','opacity','position','wrap','right','../../styles/index.css','flexShrink','env(safe-area-inset-','columnGap','indexOf','react','justifyItems','pRight','style','205426sPxiYo','classnames','left','justify-around','prototype','417QsOIih','full','100%','react/jsx-runtime','3580068BXGpqL','95286ZRMdmZ','both','padding','center','border','filter','row','245vurKTc','borderStyle','rowGap','call','17890sNwWrI','height','borderColor','between','zero:opacity-70','transparent','hover','2976800pWGUzD','mVertical','mHorizontal','defineProperty','symbol','length','flex-start','displayName','overflow','function','10353312FEFFHZ','none','alignSelf','margin','hidden','number','forEach','top','column','__esModule','bottom','defineProperties','getOwnPropertySymbols','flex-end','skeleton','pHorizontal','pVertical','radius','getOwnPropertyDescriptors','gap','safeArea','5amftvB','iterator','mLeft'];_0x7da7=function(){return _0x35bf17;};return _0x7da7();}function _0x1cb1(_0x50db21,_0x533050){_0x50db21=_0x50db21-0x184;var _0x7da713=_0x7da7();var _0x1cb1f3=_0x7da713[_0x50db21];return _0x1cb1f3;}(function(_0x2a3039,_0x28f200){var _0x1c7aee=_0x1cb1,_0x5e13b1=_0x2a3039();while(!![]){try{var _0x527849=parseInt(_0x1c7aee(0x196))/0x1+-parseInt(_0x1c7aee(0x1ab))/0x2*(-parseInt(_0x1c7aee(0x19b))/0x3)+parseInt(_0x1c7aee(0x19f))/0x4*(-parseInt(_0x1c7aee(0x1d1))/0x5)+-parseInt(_0x1c7aee(0x1a0))/0x6*(-parseInt(_0x1c7aee(0x1a7))/0x7)+-parseInt(_0x1c7aee(0x1bc))/0x8+parseInt(_0x1c7aee(0x1e8))/0x9+-parseInt(_0x1c7aee(0x1b2))/0xa;if(_0x527849===_0x28f200)break;else _0x5e13b1['push'](_0x5e13b1['shift']());}catch(_0x27c14c){_0x5e13b1['push'](_0x5e13b1['shift']());}}}(_0x7da7,0xb99c1));Object['defineProperty'](exports,_0x3363fd(0x1c5),{'value':!![]}),exports[_0x3363fd(0x1e3)]=void 0x0;var _react=require(_0x3363fd(0x192)),_components=require('@tarojs/components'),_classnames=_interopRequireDefault(require(_0x3363fd(0x197)));require(_0x3363fd(0x18d));var _jsxRuntime=require(_0x3363fd(0x19e)),_excluded=[_0x3363fd(0x19c),_0x3363fd(0x1a6),_0x3363fd(0x1c4),_0x3363fd(0x18b),'flex',_0x3363fd(0x1e1),_0x3363fd(0x1ae),_0x3363fd(0x1d4),_0x3363fd(0x193),'alignItems','alignSelf',_0x3363fd(0x1cf),_0x3363fd(0x1a9),_0x3363fd(0x190),_0x3363fd(0x18e),_0x3363fd(0x1e6),_0x3363fd(0x1de),_0x3363fd(0x189),_0x3363fd(0x1c0),_0x3363fd(0x186),_0x3363fd(0x1ac),'bgColor','style',_0x3363fd(0x1df),_0x3363fd(0x1bf),_0x3363fd(0x188),'mBottom','mLeft',_0x3363fd(0x1e5),_0x3363fd(0x1b4),_0x3363fd(0x1b3),_0x3363fd(0x1a2),'pTop',_0x3363fd(0x184),_0x3363fd(0x1dc),_0x3363fd(0x194),_0x3363fd(0x1cb),'pVertical',_0x3363fd(0x1d0),_0x3363fd(0x1b1),_0x3363fd(0x1ca),_0x3363fd(0x18a),'zIndex',_0x3363fd(0x198),'right',_0x3363fd(0x1c3),'bottom',_0x3363fd(0x1ba),_0x3363fd(0x1cd),_0x3363fd(0x1a4),_0x3363fd(0x1ad),'borderWidth',_0x3363fd(0x1a8)];function _interopRequireDefault(_0x25d716){var _0x69613f=_0x3363fd;return _0x25d716&&_0x25d716[_0x69613f(0x1c5)]?_0x25d716:{'default':_0x25d716};}function _typeof(_0x2d208c){'@babel/helpers - typeof';var _0x25b0fe=_0x3363fd;return _typeof=_0x25b0fe(0x1bb)==typeof Symbol&&_0x25b0fe(0x1b6)==typeof Symbol[_0x25b0fe(0x1d2)]?function(_0x1f2f34){return typeof _0x1f2f34;}:function(_0x372514){var _0x2f7109=_0x25b0fe;return _0x372514&&_0x2f7109(0x1bb)==typeof Symbol&&_0x372514[_0x2f7109(0x1e7)]===Symbol&&_0x372514!==Symbol[_0x2f7109(0x19a)]?'symbol':typeof _0x372514;},_typeof(_0x2d208c);}function ownKeys(_0x4d5512,_0x343862){var _0x17a4fa=_0x3363fd,_0x337866=Object[_0x17a4fa(0x1dd)](_0x4d5512);if(Object['getOwnPropertySymbols']){var _0x34376a=Object['getOwnPropertySymbols'](_0x4d5512);_0x343862&&(_0x34376a=_0x34376a[_0x17a4fa(0x1a5)](function(_0x5d6eb6){var _0x1ebe63=_0x17a4fa;return Object['getOwnPropertyDescriptor'](_0x4d5512,_0x5d6eb6)[_0x1ebe63(0x1db)];})),_0x337866[_0x17a4fa(0x1d6)][_0x17a4fa(0x1e4)](_0x337866,_0x34376a);}return _0x337866;}function _objectSpread(_0x3de952){var _0xb59e35=_0x3363fd;for(var _0x577bb7=0x1;_0x577bb7<arguments['length'];_0x577bb7++){var _0x334f75=null!=arguments[_0x577bb7]?arguments[_0x577bb7]:{};_0x577bb7%0x2?ownKeys(Object(_0x334f75),!0x0)[_0xb59e35(0x1c2)](function(_0x3cdf87){_defineProperty(_0x3de952,_0x3cdf87,_0x334f75[_0x3cdf87]);}):Object[_0xb59e35(0x1ce)]?Object[_0xb59e35(0x1c7)](_0x3de952,Object[_0xb59e35(0x1ce)](_0x334f75)):ownKeys(Object(_0x334f75))[_0xb59e35(0x1c2)](function(_0x415ca7){var _0x3f9ac6=_0xb59e35;Object[_0x3f9ac6(0x1b5)](_0x3de952,_0x415ca7,Object['getOwnPropertyDescriptor'](_0x334f75,_0x415ca7));});}return _0x3de952;}function _defineProperty(_0x239732,_0x1f65db,_0x20955d){return _0x1f65db=_toPropertyKey(_0x1f65db),_0x1f65db in _0x239732?Object['defineProperty'](_0x239732,_0x1f65db,{'value':_0x20955d,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x239732[_0x1f65db]=_0x20955d,_0x239732;}function _toPropertyKey(_0x2c09cb){var _0x3bec2f=_0x3363fd,_0x23c6d3=_toPrimitive(_0x2c09cb,_0x3bec2f(0x1d7));return _0x3bec2f(0x1b6)==_typeof(_0x23c6d3)?_0x23c6d3:String(_0x23c6d3);}function _toPrimitive(_0xb099c5,_0x4ce8a7){var _0x527f01=_0x3363fd;if('object'!=_typeof(_0xb099c5)||!_0xb099c5)return _0xb099c5;var _0x2268de=_0xb099c5[Symbol['toPrimitive']];if(void 0x0!==_0x2268de){var _0x6cf89f=_0x2268de[_0x527f01(0x1aa)](_0xb099c5,_0x4ce8a7||'default');if('object'!=_typeof(_0x6cf89f))return _0x6cf89f;throw new TypeError('@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.');}return(_0x527f01(0x1d7)===_0x4ce8a7?String:Number)(_0xb099c5);}function _objectWithoutProperties(_0x21e647,_0x8e3d33){var _0x200c89=_0x3363fd;if(_0x21e647==null)return{};var _0x5efc7c=_objectWithoutPropertiesLoose(_0x21e647,_0x8e3d33),_0x3f703e,_0x32a897;if(Object[_0x200c89(0x1c8)]){var _0x25959d=Object['getOwnPropertySymbols'](_0x21e647);for(_0x32a897=0x0;_0x32a897<_0x25959d[_0x200c89(0x1b7)];_0x32a897++){_0x3f703e=_0x25959d[_0x32a897];if(_0x8e3d33[_0x200c89(0x191)](_0x3f703e)>=0x0)continue;if(!Object[_0x200c89(0x19a)][_0x200c89(0x1e9)][_0x200c89(0x1aa)](_0x21e647,_0x3f703e))continue;_0x5efc7c[_0x3f703e]=_0x21e647[_0x3f703e];}}return _0x5efc7c;}function _objectWithoutPropertiesLoose(_0x49fcff,_0x1c99ac){var _0x1545c1=_0x3363fd;if(_0x49fcff==null)return{};var _0x1f080a={},_0x1b6de5=Object[_0x1545c1(0x1dd)](_0x49fcff),_0x59bbc2,_0x2a5e09;for(_0x2a5e09=0x0;_0x2a5e09<_0x1b6de5[_0x1545c1(0x1b7)];_0x2a5e09++){_0x59bbc2=_0x1b6de5[_0x2a5e09];if(_0x1c99ac[_0x1545c1(0x191)](_0x59bbc2)>=0x0)continue;_0x1f080a[_0x59bbc2]=_0x49fcff[_0x59bbc2];}return _0x1f080a;}var px=function px(_0x9fff4c){var _0x2c26b7=_0x3363fd;if(_0x9fff4c===undefined||_0x9fff4c===null||_0x9fff4c==='')return undefined;return typeof _0x9fff4c===_0x2c26b7(0x1c1)||!isNaN(Number(_0x9fff4c))?''[_0x2c26b7(0x1da)](_0x9fff4c,'px'):String(_0x9fff4c);},View=(0x0,_react['forwardRef'])(function(_0xcb30a6,_0x4fa226){var _0x49732e=_0x3363fd,_0x316d24=_0xcb30a6[_0x49732e(0x19c)],_0x40faa3=_0xcb30a6[_0x49732e(0x1a6)],_0x1095d2=_0xcb30a6[_0x49732e(0x1c4)],_0x314a93=_0xcb30a6[_0x49732e(0x18b)],_0x338f35=_0xcb30a6['flex'],_0x439302=_0xcb30a6[_0x49732e(0x1e1)],_0x140634=_0xcb30a6[_0x49732e(0x1ae)],_0x2ae946=_0xcb30a6[_0x49732e(0x1d4)],_0x2b7c73=_0xcb30a6[_0x49732e(0x193)],_0x283b1f=_0xcb30a6[_0x49732e(0x1d5)],_0x5e202a=_0xcb30a6[_0x49732e(0x1be)],_0x1507fb=_0xcb30a6[_0x49732e(0x1cf)],_0x40785f=_0xcb30a6[_0x49732e(0x1a9)],_0x3a23ff=_0xcb30a6['columnGap'],_0x1586b6=_0xcb30a6[_0x49732e(0x18e)],_0x25173b=_0xcb30a6[_0x49732e(0x1e6)],_0x961d42=_0xcb30a6['flexBasis'],_0x2b93e6=_0xcb30a6[_0x49732e(0x189)],_0x37fbea=_0xcb30a6['hidden'],_0x396232=_0xcb30a6[_0x49732e(0x186)],_0x43b256=_0xcb30a6[_0x49732e(0x1ac)],_0x410c3c=_0xcb30a6[_0x49732e(0x1d8)],_0x530f0a=_0xcb30a6[_0x49732e(0x195)],_0xea1f7c=_0x530f0a===void 0x0?{}:_0x530f0a,_0x451c42=_0xcb30a6[_0x49732e(0x1df)],_0x4284fa=_0xcb30a6[_0x49732e(0x1bf)],_0x5ee94d=_0xcb30a6['mTop'],_0x3ea901=_0xcb30a6['mBottom'],_0x33166b=_0xcb30a6[_0x49732e(0x1d3)],_0x422d47=_0xcb30a6['mRight'],_0x1c9129=_0xcb30a6[_0x49732e(0x1b4)],_0x25ebd0=_0xcb30a6[_0x49732e(0x1b3)],_0x4d4a98=_0xcb30a6[_0x49732e(0x1a2)],_0x2d2155=_0xcb30a6['pTop'],_0x39ffcf=_0xcb30a6[_0x49732e(0x184)],_0x30163a=_0xcb30a6[_0x49732e(0x1dc)],_0x10427c=_0xcb30a6['pRight'],_0x100fdd=_0xcb30a6[_0x49732e(0x1cb)],_0x13adc9=_0xcb30a6[_0x49732e(0x1cc)],_0x2e864f=_0xcb30a6[_0x49732e(0x1d0)],_0x420be6=_0xcb30a6[_0x49732e(0x1b1)],_0x1f161c=_0xcb30a6['skeleton'],_0x52d1b1=_0xcb30a6[_0x49732e(0x18a)],_0x365191=_0xcb30a6['zIndex'],_0x44e6b8=_0xcb30a6[_0x49732e(0x198)],_0x3e1731=_0xcb30a6[_0x49732e(0x18c)],_0x33c9b3=_0xcb30a6[_0x49732e(0x1c3)],_0x2b1c89=_0xcb30a6[_0x49732e(0x1c6)],_0x20cf51=_0xcb30a6[_0x49732e(0x1ba)],_0x189a4b=_0xcb30a6[_0x49732e(0x1cd)],_0x4207b8=_0xcb30a6[_0x49732e(0x1a4)],_0xb19c2e=_0xcb30a6[_0x49732e(0x1ad)],_0x32a152=_0xcb30a6['borderWidth'],_0x4980fd=_0xcb30a6[_0x49732e(0x1a8)],_0x31e72a=_objectWithoutProperties(_0xcb30a6,_excluded),_0x1ce421=(0x0,_classnames['default'])(_0x2ae946,{'zero-flex':!![],'zero-flex-1':_0x338f35,'zero-flex-col':_0x1095d2,'zero-flex-row':_0x40faa3,'zero-flex-wrap':_0x314a93,'zero-items-start':_0x283b1f==='flex-start','zero-items-end':_0x283b1f===_0x49732e(0x1c9),'zero-items-center':_0x283b1f===_0x49732e(0x1a3),'zero-justify-start':_0x2b7c73===_0x49732e(0x1b8),'zero-justify-end':_0x2b7c73===_0x49732e(0x1c9),'zero-justify-center':_0x2b7c73===_0x49732e(0x1a3),'zero-place-content-around':_0x439302===_0x49732e(0x187),'zero-justify-around':_0x439302===_0x49732e(0x199),'zero-justify-between':_0x140634,'zero-hidden':_0x37fbea,'zero-animate-pulse\x20zero-bg-gray-200':_0x1f161c}),_0x202903=function _0x986fdf(_0x2b5ccc,_0x3b983a,_0x36eb42){var _0x33c807=_0x49732e,_0x991594=_0x3b983a===_0x2b5ccc||_0x3b983a===_0x33c807(0x1a1);if(!_0x991594)return px(_0x36eb42);return _0x36eb42?_0x33c807(0x1e0)[_0x33c807(0x1da)](_0x2b5ccc,')\x20+\x20')[_0x33c807(0x1da)](px(_0x36eb42),')'):_0x33c807(0x18f)[_0x33c807(0x1da)](_0x2b5ccc,')');},_0x26a86e=_0x4207b8||_0xb19c2e!==undefined||_0x32a152!==undefined,_0x4cbd6b=_objectSpread({'width':px(_0x316d24?_0x49732e(0x19d):_0x396232),'height':px(_0x316d24?'100%':_0x43b256),'backgroundColor':_0x410c3c,'margin':px(_0x4284fa),'marginTop':px(_0x5ee94d!==null&&_0x5ee94d!==void 0x0?_0x5ee94d:_0x25ebd0),'marginBottom':px(_0x3ea901!==null&&_0x3ea901!==void 0x0?_0x3ea901:_0x25ebd0),'marginLeft':px(_0x33166b!==null&&_0x33166b!==void 0x0?_0x33166b:_0x1c9129),'marginRight':px(_0x422d47!==null&&_0x422d47!==void 0x0?_0x422d47:_0x1c9129),'padding':px(_0x4d4a98),'paddingTop':_0x202903(_0x49732e(0x1c3),_0x2e864f,_0x2d2155!==null&&_0x2d2155!==void 0x0?_0x2d2155:_0x13adc9),'paddingBottom':_0x202903(_0x49732e(0x1c6),_0x2e864f,_0x39ffcf!==null&&_0x39ffcf!==void 0x0?_0x39ffcf:_0x13adc9),'paddingLeft':px(_0x30163a!==null&&_0x30163a!==void 0x0?_0x30163a:_0x100fdd),'paddingRight':px(_0x10427c!==null&&_0x10427c!==void 0x0?_0x10427c:_0x100fdd),'position':_0x52d1b1,'zIndex':_0x365191,'left':px(_0x44e6b8),'right':px(_0x3e1731),'top':px(_0x33c9b3),'bottom':px(_0x2b1c89),'overflow':_0x20cf51,'borderRadius':px(_0x189a4b),'borderWidth':_0x26a86e?px(_0x32a152!==null&&_0x32a152!==void 0x0?_0x32a152:0x1):undefined,'borderStyle':_0x26a86e?_0x4980fd!==null&&_0x4980fd!==void 0x0?_0x4980fd:'solid':undefined,'borderColor':_0xb19c2e,'gap':px(_0x1507fb),'rowGap':px(_0x40785f),'columnGap':px(_0x3a23ff),'alignSelf':_0x5e202a,'flexShrink':_0x1586b6,'flexGrow':_0x25173b,'flexBasis':px(_0x961d42),'opacity':_0x2b93e6,'display':_0x37fbea?_0x49732e(0x1bd):undefined,'color':_0x1f161c?_0x49732e(0x1b0):undefined},_typeof(_0xea1f7c)===_0x49732e(0x185)?_0xea1f7c:{}),_0x93b1f2={};for(var _0x466d46 in _0x4cbd6b){_0x4cbd6b[_0x466d46]!==undefined&&_0x4cbd6b[_0x466d46]!==null&&(_0x93b1f2[_0x466d46]=_0x4cbd6b[_0x466d46]);}return(0x0,_jsxRuntime[_0x49732e(0x1e2)])(_components[_0x49732e(0x1d9)],_objectSpread(_objectSpread({'ref':_0x4fa226,'className':_0x1ce421,'style':_0x93b1f2,'hoverClass':_0x420be6?_0x49732e(0x1af):'none','hoverStayTime':0xc8},_0x31e72a),{},{'children':_0x451c42}));});View[_0x3363fd(0x1b9)]=_0x3363fd(0x1d9);var _default=exports['default']=View;
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = require("react");
8
+ var _components = require("@tarojs/components");
9
+ var _classnames = _interopRequireDefault(require("classnames"));
10
+ require("../../styles/index.css");
11
+ var _jsxRuntime = require("react/jsx-runtime");
12
+ var _excluded = ["full", "row", "column", "wrap", "flex", "around", "between", "className", "justifyItems", "alignItems", "alignSelf", "gap", "rowGap", "columnGap", "flexShrink", "flexGrow", "flexBasis", "opacity", "hidden", "width", "height", "bgColor", "background", "style", "children", "margin", "mTop", "mBottom", "mLeft", "mRight", "mHorizontal", "mVertical", "padding", "pTop", "pBottom", "pLeft", "pRight", "pHorizontal", "pVertical", "safeArea", "hover", "skeleton", "position", "zIndex", "left", "right", "top", "bottom", "overflow", "radius", "border", "borderColor", "borderWidth", "borderStyle"];
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+ 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); }
15
+ 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; }
16
+ 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; }
17
+ 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; }
18
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
19
+ 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); }
20
+ 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; }
21
+ 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; }
22
+ /**
23
+ * 处理 px 转换
24
+ * @param val px|string|undefined
25
+ * @returns px|string|undefined
26
+ */
27
+ var px = function px(val) {
28
+ if (val === undefined || val === null || val === '') return undefined;
29
+ return typeof val === 'number' || !isNaN(Number(val)) ? "".concat(val, "px") : String(val);
30
+ };
31
+
32
+ /**
33
+ * taro weapp View Component (Tailwind 版)
34
+ * - full: 100% 100% 宽度、高度100%
35
+ * - flex: flex: 1 自动适应
36
+ * - row: flex-direction: row 主轴水平
37
+ * - column: flex-direction: column 主轴垂直
38
+ * - wrap: flex-wrap: wrap 换行
39
+ * - around: flex-direction: row justify-content: space-around 主轴平均分布
40
+ * - between: flex-direction: row justify-content: space-between 主轴两端对齐
41
+ * - justifyItems: justify-content 主轴对齐方式
42
+ * - alignItems: align-items 交叉轴对齐方式
43
+ * - alignSelf: align-self 自身对齐方式
44
+ * - gap: gap 间距
45
+ * - rowGap: row-gap 行间距
46
+ * - columnGap: column-gap 列间距
47
+ * - flexShrink: flex-shrink 剩余空间不足时
48
+ * - flexGrow: flex-grow 剩余空间
49
+ * - flexBasis: flex-basis 初始大小
50
+ * - opacity: opacity 透明度
51
+ * - hidden: hidden 隐藏
52
+ * - width: width 宽度
53
+ * - height: height 高度
54
+ * - bgColor: background-color 背景颜色
55
+ * - background: background 背景图片等复杂背景
56
+ * - safeArea: safe-area-inset 安全区域
57
+ * - hover: hover 悬停状态
58
+ * - skeleton: skeleton 骨架屏
59
+ * - position: position 定位
60
+ * - zIndex: z-index 层级
61
+ * - left: left 定位左侧
62
+ * - right: right 定位右侧
63
+ * - top: top 定位上侧
64
+ * - bottom: bottom 定位下侧
65
+ * - overflow: overflow 显示
66
+ * - overflowX: overflow-x 显示
67
+ * - overflowY: overflow-y 显示
68
+ * - radius: border-radius 圆角
69
+ * - border: boolean 边框
70
+ * - borderColor: border-color 边框颜色
71
+ * - borderWidth: border-width 边框宽度
72
+ * - borderStyle: border-style 边框样式
73
+ * - style: style 自定义样式
74
+ * - children: children 子元素
75
+ * - margin: margin 外边距
76
+ * - mTop: margin-top 上外边距
77
+ * - mBottom: margin-bottom 下外边距
78
+ * - mLeft: margin-left 左外边距
79
+ * - mRight: margin-right 右外边距
80
+ * - mHorizontal: margin-horizontal 水平外边距
81
+ * - mVertical: margin-vertical 垂直外边距
82
+ * - padding: padding 内边距
83
+ * - pTop: padding-top 上内边距
84
+ * - pBottom: padding-bottom 下内边距
85
+ * - pLeft: padding-left 左内边距
86
+ * - pRight: padding-right 右内边距
87
+ * - pHorizontal: padding-horizontal 水平内边距
88
+ * - pVertical: padding-vertical 垂直内边距
89
+ * - rest: View组件其他属性
90
+ */
91
+ var View = /*#__PURE__*/(0, _react.forwardRef)(function (props, ref) {
92
+ var full = props.full,
93
+ row = props.row,
94
+ column = props.column,
95
+ wrap = props.wrap,
96
+ flex = props.flex,
97
+ around = props.around,
98
+ between = props.between,
99
+ className = props.className,
100
+ justifyItems = props.justifyItems,
101
+ alignItems = props.alignItems,
102
+ alignSelf = props.alignSelf,
103
+ gap = props.gap,
104
+ rowGap = props.rowGap,
105
+ columnGap = props.columnGap,
106
+ flexShrink = props.flexShrink,
107
+ flexGrow = props.flexGrow,
108
+ flexBasis = props.flexBasis,
109
+ opacity = props.opacity,
110
+ hidden = props.hidden,
111
+ width = props.width,
112
+ height = props.height,
113
+ bgColor = props.bgColor,
114
+ background = props.background,
115
+ _props$style = props.style,
116
+ style = _props$style === void 0 ? {} : _props$style,
117
+ children = props.children,
118
+ margin = props.margin,
119
+ mTop = props.mTop,
120
+ mBottom = props.mBottom,
121
+ mLeft = props.mLeft,
122
+ mRight = props.mRight,
123
+ mHorizontal = props.mHorizontal,
124
+ mVertical = props.mVertical,
125
+ padding = props.padding,
126
+ pTop = props.pTop,
127
+ pBottom = props.pBottom,
128
+ pLeft = props.pLeft,
129
+ pRight = props.pRight,
130
+ pHorizontal = props.pHorizontal,
131
+ pVertical = props.pVertical,
132
+ safeArea = props.safeArea,
133
+ hover = props.hover,
134
+ skeleton = props.skeleton,
135
+ position = props.position,
136
+ zIndex = props.zIndex,
137
+ left = props.left,
138
+ right = props.right,
139
+ top = props.top,
140
+ bottom = props.bottom,
141
+ overflow = props.overflow,
142
+ radius = props.radius,
143
+ border = props.border,
144
+ borderColor = props.borderColor,
145
+ borderWidth = props.borderWidth,
146
+ borderStyle = props.borderStyle,
147
+ rest = _objectWithoutProperties(props, _excluded);
148
+ var viewClass = (0, _classnames.default)(className, {
149
+ 'zero-flex': true,
150
+ 'zero-flex-1': flex,
151
+ 'zero-flex-col': column,
152
+ 'zero-flex-row': row,
153
+ 'zero-flex-wrap': wrap,
154
+ 'zero-items-start': alignItems === 'flex-start',
155
+ 'zero-items-end': alignItems === 'flex-end',
156
+ 'zero-items-center': alignItems === 'center',
157
+ 'zero-justify-start': justifyItems === 'flex-start',
158
+ 'zero-justify-end': justifyItems === 'flex-end',
159
+ 'zero-justify-center': justifyItems === 'center',
160
+ 'zero-place-content-around': around === 'content-around',
161
+ 'zero-justify-around': around === 'justify-around',
162
+ 'zero-justify-between': between,
163
+ 'zero-hidden': hidden,
164
+ 'zero-animate-pulse zero-bg-gray-200': skeleton
165
+ });
166
+ var getSafeAreaPadding = function getSafeAreaPadding(type, safeAreaVal, userPadding) {
167
+ var isSafe = safeAreaVal === type || safeAreaVal === 'both';
168
+ if (!isSafe) return px(userPadding);
169
+ return userPadding ? "calc(env(safe-area-inset-".concat(type, ") + ").concat(px(userPadding), ")") : "env(safe-area-inset-".concat(type, ")");
170
+ };
171
+ var hasBorder = border || borderColor !== undefined || borderWidth !== undefined;
172
+ var customStyle = _objectSpread({
173
+ width: px(full ? '100%' : width),
174
+ height: px(full ? '100%' : height),
175
+ backgroundColor: bgColor,
176
+ background: background,
177
+ margin: px(margin),
178
+ marginTop: px(mTop !== null && mTop !== void 0 ? mTop : mVertical),
179
+ marginBottom: px(mBottom !== null && mBottom !== void 0 ? mBottom : mVertical),
180
+ marginLeft: px(mLeft !== null && mLeft !== void 0 ? mLeft : mHorizontal),
181
+ marginRight: px(mRight !== null && mRight !== void 0 ? mRight : mHorizontal),
182
+ padding: px(padding),
183
+ paddingTop: getSafeAreaPadding('top', safeArea, pTop !== null && pTop !== void 0 ? pTop : pVertical),
184
+ paddingBottom: getSafeAreaPadding('bottom', safeArea, pBottom !== null && pBottom !== void 0 ? pBottom : pVertical),
185
+ paddingLeft: px(pLeft !== null && pLeft !== void 0 ? pLeft : pHorizontal),
186
+ paddingRight: px(pRight !== null && pRight !== void 0 ? pRight : pHorizontal),
187
+ position: position,
188
+ zIndex: zIndex,
189
+ left: px(left),
190
+ right: px(right),
191
+ top: px(top),
192
+ bottom: px(bottom),
193
+ overflow: overflow,
194
+ borderRadius: px(radius),
195
+ borderWidth: hasBorder ? px(borderWidth !== null && borderWidth !== void 0 ? borderWidth : 1) : undefined,
196
+ borderStyle: hasBorder ? borderStyle !== null && borderStyle !== void 0 ? borderStyle : 'solid' : undefined,
197
+ borderColor: borderColor,
198
+ gap: px(gap),
199
+ rowGap: px(rowGap),
200
+ columnGap: px(columnGap),
201
+ alignSelf: alignSelf,
202
+ flexShrink: flexShrink,
203
+ flexGrow: flexGrow,
204
+ flexBasis: px(flexBasis),
205
+ opacity: opacity,
206
+ display: hidden ? 'none' : undefined,
207
+ color: skeleton ? 'transparent' : undefined
208
+ }, _typeof(style) === 'object' ? style : {});
209
+ var cleanStyle = {};
210
+ for (var key in customStyle) {
211
+ if (customStyle[key] !== undefined && customStyle[key] !== null) {
212
+ // @ts-ignore
213
+ cleanStyle[key] = customStyle[key];
214
+ }
215
+ }
216
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.View, _objectSpread(_objectSpread({
217
+ ref: ref,
218
+ className: viewClass,
219
+ style: cleanStyle,
220
+ hoverClass: hover ? 'zero:opacity-70' : 'none',
221
+ hoverStayTime: 200
222
+ }, rest), {}, {
223
+ children: children
224
+ }));
225
+ });
226
+ View.displayName = 'View';
227
+ var _default = exports.default = View;