@zero-bits/taro-components 1.1.0 → 1.3.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.
- package/es/components/Permission/PermissionProvider.js +1 -35
- package/es/components/Permission/index.js +1 -2
- package/es/components/Permission/store.js +1 -158
- package/es/components/Text/index.d.ts +2 -0
- package/es/components/Text/index.js +1 -136
- package/es/components/View/index.d.ts +3 -1
- package/es/components/View/index.js +1 -220
- package/es/components/index.js +1 -3
- package/es/context/index.js +1 -6
- package/es/hooks/index.js +1 -2
- package/es/hooks/usePermission.js +1 -18
- package/es/hooks/useWeappUpdate.js +1 -33
- package/es/index.js +1 -3
- package/es/styles/index.css +120 -1
- package/es/types/index.js +1 -1
- package/lib/components/Permission/PermissionProvider.js +1 -41
- package/lib/components/Permission/index.js +1 -20
- package/lib/components/Permission/store.js +1 -164
- package/lib/components/Text/index.d.ts +2 -0
- package/lib/components/Text/index.js +1 -145
- package/lib/components/View/index.d.ts +3 -1
- package/lib/components/View/index.js +1 -227
- package/lib/components/index.js +1 -36
- package/lib/context/index.js +1 -12
- package/lib/hooks/index.js +1 -19
- package/lib/hooks/usePermission.js +1 -24
- package/lib/hooks/useWeappUpdate.js +1 -38
- package/lib/index.js +1 -63
- package/lib/styles/index.css +120 -1
- package/lib/types/index.js +1 -5
- package/package.json +1 -24
|
@@ -1,35 +1 @@
|
|
|
1
|
-
|
|
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
|
+
var _0x904fe1=_0xad02;function _0x2c38(){var _0x1e1dca=['nZvVCKXoCNy','otmZmtKXzNf5qLLN','mZa3ndi0z0T2vfHO','mJGZnJbArK9PshC','mtCZntHzs0vlCMC','B25ezw5Pzwq','mJuYnJmXoejjCuL5tG','C3rVCMu','ugvYBwLZC2LVBLbYB3zPzgvY','zgLZCgXHEu5HBwu','mtC3ntaYmMLnsfrMEq','uhjVDMLKzxi','mtG2ody4v2DfrfzN','mJG0nda2vLv6zgPs','AxnhCMfUDgvK','C3vIC2nYAwjL','mtborxPVEhe','y3vYCMvUDa','nZjMsu9Hshi','z2v0u25HChnOB3q'];_0x2c38=function(){return _0x1e1dca;};return _0x2c38();}(function(_0x401c5b,_0x633ea0){var _0x1e2045=_0xad02,_0x565f88=_0x401c5b();while(!![]){try{var _0x319668=-parseInt(_0x1e2045(0xf2))/0x1+-parseInt(_0x1e2045(0xe7))/0x2+-parseInt(_0x1e2045(0xe5))/0x3*(parseInt(_0x1e2045(0xf1))/0x4)+parseInt(_0x1e2045(0xe1))/0x5*(-parseInt(_0x1e2045(0xef))/0x6)+parseInt(_0x1e2045(0xe6))/0x7*(-parseInt(_0x1e2045(0xe3))/0x8)+-parseInt(_0x1e2045(0xeb))/0x9+parseInt(_0x1e2045(0xe8))/0xa*(parseInt(_0x1e2045(0xe9))/0xb);if(_0x319668===_0x633ea0)break;else _0x565f88['push'](_0x565f88['shift']());}catch(_0x2617bc){_0x565f88['push'](_0x565f88['shift']());}}}(_0x2c38,0xc292c));import{useSyncExternalStore,useEffect,useRef}from'react';import{PermissionContext}from'../../context';import{jsx as _0x1801f4}from'react/jsx-runtime';function _0xad02(_0x22e8c0,_0x246039){_0x22e8c0=_0x22e8c0-0xdf;var _0x2c38ed=_0x2c38();var _0xad0290=_0x2c38ed[_0x22e8c0];if(_0xad02['nTofvx']===undefined){var _0x51ba64=function(_0x6cc0fe){var _0xe48c80='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x1801f4='',_0x3484ac='';for(var _0x3a6f00=0x0,_0xaec854,_0x13d819,_0x558f30=0x0;_0x13d819=_0x6cc0fe['charAt'](_0x558f30++);~_0x13d819&&(_0xaec854=_0x3a6f00%0x4?_0xaec854*0x40+_0x13d819:_0x13d819,_0x3a6f00++%0x4)?_0x1801f4+=String['fromCharCode'](0xff&_0xaec854>>(-0x2*_0x3a6f00&0x6)):0x0){_0x13d819=_0xe48c80['indexOf'](_0x13d819);}for(var _0x2f9c08=0x0,_0x49db1e=_0x1801f4['length'];_0x2f9c08<_0x49db1e;_0x2f9c08++){_0x3484ac+='%'+('00'+_0x1801f4['charCodeAt'](_0x2f9c08)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3484ac);};_0xad02['TPFWUk']=_0x51ba64,_0xad02['kvGvdJ']={},_0xad02['nTofvx']=!![];}var _0x528869=_0x2c38ed[0x0],_0x1d18a9=_0x22e8c0+_0x528869,_0x119826=_0xad02['kvGvdJ'][_0x1d18a9];return!_0x119826?(_0xad0290=_0xad02['TPFWUk'](_0xad0290),_0xad02['kvGvdJ'][_0x1d18a9]=_0xad0290):_0xad0290=_0x119826,_0xad0290;}function PermissionProvider(_0x3484ac){var _0x193cb0=_0xad02,_0x3a6f00=_0x3484ac['children'],_0xaec854=_0x3484ac[_0x193cb0(0xec)],_0x13d819=_0x3484ac[_0x193cb0(0xea)],_0x558f30=useSyncExternalStore(_0xaec854[_0x193cb0(0xe0)],_0xaec854[_0x193cb0(0xe4)]),_0x2f9c08=useRef(_0x558f30[_0x193cb0(0xdf)]);return useEffect(function(){var _0x3fb0c6=_0x193cb0;if(_0x2f9c08[_0x3fb0c6(0xe2)]&&!_0x558f30[_0x3fb0c6(0xdf)])_0x13d819===null||_0x13d819===void 0x0||_0x13d819();_0x2f9c08[_0x3fb0c6(0xe2)]=_0x558f30[_0x3fb0c6(0xdf)];},[_0x558f30[_0x193cb0(0xdf)],_0x13d819]),_0x1801f4(PermissionContext[_0x193cb0(0xf0)],{'value':_0x558f30,'children':_0x3a6f00});}PermissionProvider[_0x904fe1(0xee)]=_0x904fe1(0xed);export default PermissionProvider;
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export { createPermissionStore } from "./store";
|
|
1
|
+
(function(_0x4b84dd,_0x298fe7){var _0x1bb60c=_0xe726,_0x45d033=_0x4b84dd();while(!![]){try{var _0x26180b=parseInt(_0x1bb60c(0x106))/0x1*(-parseInt(_0x1bb60c(0x103))/0x2)+parseInt(_0x1bb60c(0x105))/0x3*(-parseInt(_0x1bb60c(0x108))/0x4)+-parseInt(_0x1bb60c(0x109))/0x5+parseInt(_0x1bb60c(0x107))/0x6*(parseInt(_0x1bb60c(0x104))/0x7)+-parseInt(_0x1bb60c(0x102))/0x8*(parseInt(_0x1bb60c(0x10a))/0x9)+parseInt(_0x1bb60c(0x10b))/0xa+parseInt(_0x1bb60c(0x101))/0xb;if(_0x26180b===_0x298fe7)break;else _0x45d033['push'](_0x45d033['shift']());}catch(_0x4a2d25){_0x45d033['push'](_0x45d033['shift']());}}}(_0x5232,0x7266c));function _0xe726(_0x1b12ed,_0x4f38c2){_0x1b12ed=_0x1b12ed-0x101;var _0x52323f=_0x5232();var _0xe7267f=_0x52323f[_0x1b12ed];if(_0xe726['hfqXUv']===undefined){var _0x265a48=function(_0x3bf96f){var _0x218173='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x271008='',_0x2f4279='';for(var _0x11d7d0=0x0,_0x2c88aa,_0x3283a6,_0x2b0809=0x0;_0x3283a6=_0x3bf96f['charAt'](_0x2b0809++);~_0x3283a6&&(_0x2c88aa=_0x11d7d0%0x4?_0x2c88aa*0x40+_0x3283a6:_0x3283a6,_0x11d7d0++%0x4)?_0x271008+=String['fromCharCode'](0xff&_0x2c88aa>>(-0x2*_0x11d7d0&0x6)):0x0){_0x3283a6=_0x218173['indexOf'](_0x3283a6);}for(var _0x4db52b=0x0,_0x37c5dd=_0x271008['length'];_0x4db52b<_0x37c5dd;_0x4db52b++){_0x2f4279+='%'+('00'+_0x271008['charCodeAt'](_0x4db52b)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x2f4279);};_0xe726['mgEnqF']=_0x265a48,_0xe726['CFkKAh']={},_0xe726['hfqXUv']=!![];}var _0x513b71=_0x52323f[0x0],_0x203bbb=_0x1b12ed+_0x513b71,_0x273dc9=_0xe726['CFkKAh'][_0x203bbb];return!_0x273dc9?(_0xe7267f=_0xe726['mgEnqF'](_0xe7267f),_0xe726['CFkKAh'][_0x203bbb]=_0xe7267f):_0xe7267f=_0x273dc9,_0xe7267f;}function _0x5232(){var _0x482489=['n0fHzNr0Bq','m3n2zffzua','odqYowHUCxLivG','mZmZmJu4ELnVCvDO','mJm0nJu2ohney3LKqq','mZeWmdm1CfnxD0P2','mJa3EfrItLjf','ntKWmdu3mgTYDhLwBW','nJi4nZy2nKfOzhv6uq','mZe4ndbpqMDgCLO','mMDiCLbsDq'];_0x5232=function(){return _0x482489;};return _0x5232();}export{default as PermissionProvider}from'./PermissionProvider';export{createPermissionStore}from'./store';
|
|
@@ -1,158 +1 @@
|
|
|
1
|
-
function
|
|
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
|
+
(function(_0x10a153,_0x41252b){var _0x3c6cb5=_0x2e77,_0x5a71c9=_0x10a153();while(!![]){try{var _0x1ad120=parseInt(_0x3c6cb5(0x1f9))/0x1*(parseInt(_0x3c6cb5(0x205))/0x2)+parseInt(_0x3c6cb5(0x1f6))/0x3+-parseInt(_0x3c6cb5(0x1e9))/0x4+-parseInt(_0x3c6cb5(0x1fe))/0x5*(-parseInt(_0x3c6cb5(0x1df))/0x6)+-parseInt(_0x3c6cb5(0x1e4))/0x7+-parseInt(_0x3c6cb5(0x200))/0x8+parseInt(_0x3c6cb5(0x20e))/0x9;if(_0x1ad120===_0x41252b)break;else _0x5a71c9['push'](_0x5a71c9['shift']());}catch(_0x43b4ad){_0x5a71c9['push'](_0x5a71c9['shift']());}}}(_0x222c,0x9392f));function _typeof(_0x278be9){'@babel/helpers - typeof';var _0x4cdf0f=_0x2e77;return _typeof='function'==typeof Symbol&&_0x4cdf0f(0x210)==typeof Symbol['iterator']?function(_0x3e1c1c){return typeof _0x3e1c1c;}:function(_0x44f09b){var _0x2d4c1b=_0x4cdf0f;return _0x44f09b&&_0x2d4c1b(0x1e2)==typeof Symbol&&_0x44f09b[_0x2d4c1b(0x1fa)]===Symbol&&_0x44f09b!==Symbol[_0x2d4c1b(0x209)]?_0x2d4c1b(0x210):typeof _0x44f09b;},_typeof(_0x278be9);}function ownKeys(_0x16e454,_0x219339){var _0x29a340=_0x2e77,_0x22db6d=Object[_0x29a340(0x1f5)](_0x16e454);if(Object[_0x29a340(0x1fd)]){var _0x5cbd44=Object[_0x29a340(0x1fd)](_0x16e454);_0x219339&&(_0x5cbd44=_0x5cbd44[_0x29a340(0x1e7)](function(_0x1b6de9){var _0x35fe68=_0x29a340;return Object[_0x35fe68(0x1dd)](_0x16e454,_0x1b6de9)[_0x35fe68(0x1f8)];})),_0x22db6d[_0x29a340(0x20f)][_0x29a340(0x20a)](_0x22db6d,_0x5cbd44);}return _0x22db6d;}function _0x222c(){var _0x2e521e=['zNvUy3rPB24','zgvZDhjVEq','nZm2nde0meDWBNzTEG','z3jHBNrLza','C3vIC2nYAwjL','zMLSDgvY','ywrHChrLCG','mZmZotK5mM1UAxPZsa','D3jPDgfIBgu','C3rHDgu','y2fJAgvKqwn0Aw9UCW','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9YCW','q2fUBM90ignHBgWGysbJBgfZCYbHCYbHigz1BMn0Aw9U','zgvMAw5LuhjVCgvYDhK','C2f2zvvZzxi','BgvUz3rO','BgLZDgvUzxjZ','ywrK','A2v5CW','mtm2mduZm1vywxDzwa','zw1PDenOyw5Nzq','zw51BwvYywjSzq','nZe0nJDvrNfUzLK','y29UC3rYDwn0B3i','B2jQzwn0','C3rYAw5N','z2v0t3DUuhjVCgvYDhLtEw1IB2XZ','mZK0nvDiBuPQwG','y2XLyxi','mtuXnJGWofjpuvfnCW','DMfSDwu','zgvUAwvK','DxbKyxrLvxnLCG','CgvYBwLZC2LVBG','mtHewMjIrfa','yNvPBgrtDgf0zq','Bg9HzfvZzxi','DxbKyxrLugvYBwLZC2LVBG','ChjVDg90ExbL','yxbWBhK','A2v5','DxnLCG','zM9YrwfJAa','nJy2odm0m2TPuu9cCW','ChvZAa','C3LTyM9S','C2f2zvbLCM1PC3nPB24','z2v0u3rHDgu','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','zgvSzxrL','nJqXngnTrfnezW','zgvMAw5LuhjVCgvYDgLLCW','Bg9HzfbLCM1PC3nPB24'];_0x222c=function(){return _0x2e521e;};return _0x222c();}function _objectSpread(_0x49a034){var _0xa73022=_0x2e77;for(var _0x405e20=0x1;_0x405e20<arguments[_0xa73022(0x1f2)];_0x405e20++){var _0x2b9604=null!=arguments[_0x405e20]?arguments[_0x405e20]:{};_0x405e20%0x2?ownKeys(Object(_0x2b9604),!0x0)[_0xa73022(0x20d)](function(_0x46d068){_defineProperty(_0x49a034,_0x46d068,_0x2b9604[_0x46d068]);}):Object[_0xa73022(0x1ee)]?Object[_0xa73022(0x1e0)](_0x49a034,Object[_0xa73022(0x1ee)](_0x2b9604)):ownKeys(Object(_0x2b9604))[_0xa73022(0x20d)](function(_0x428da0){var _0xf2dc76=_0xa73022;Object[_0xf2dc76(0x1f0)](_0x49a034,_0x428da0,Object[_0xf2dc76(0x1dd)](_0x2b9604,_0x428da0));});}return _0x49a034;}function _classCallCheck(_0x4002f9,Constructor){var _0x4042f1=_0x2e77;if(!(_0x4002f9 instanceof Constructor))throw new TypeError(_0x4042f1(0x1ef));}function _defineProperties(_0x52697f,_0x30a1b8){var _0x41b655=_0x2e77;for(var _0x27a917=0x0;_0x27a917<_0x30a1b8['length'];_0x27a917++){var _0x532205=_0x30a1b8[_0x27a917];_0x532205['enumerable']=_0x532205[_0x41b655(0x1f8)]||![],_0x532205['configurable']=!![];if(_0x41b655(0x201)in _0x532205)_0x532205[_0x41b655(0x1ea)]=!![];Object[_0x41b655(0x1f0)](_0x52697f,_toPropertyKey(_0x532205[_0x41b655(0x20b)]),_0x532205);}}function _0x2e77(_0x5b7213,_0x2cb374){_0x5b7213=_0x5b7213-0x1dd;var _0x222c7e=_0x222c();var _0x2e7789=_0x222c7e[_0x5b7213];if(_0x2e77['iWJItl']===undefined){var _0x461b7b=function(_0x39d39b){var _0x54ddb9='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x278be9='',_0x3e1c1c='';for(var _0x44f09b=0x0,_0x16e454,_0x219339,_0x22db6d=0x0;_0x219339=_0x39d39b['charAt'](_0x22db6d++);~_0x219339&&(_0x16e454=_0x44f09b%0x4?_0x16e454*0x40+_0x219339:_0x219339,_0x44f09b++%0x4)?_0x278be9+=String['fromCharCode'](0xff&_0x16e454>>(-0x2*_0x44f09b&0x6)):0x0){_0x219339=_0x54ddb9['indexOf'](_0x219339);}for(var _0x5cbd44=0x0,_0x1b6de9=_0x278be9['length'];_0x5cbd44<_0x1b6de9;_0x5cbd44++){_0x3e1c1c+='%'+('00'+_0x278be9['charCodeAt'](_0x5cbd44)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x3e1c1c);};_0x2e77['HQuVGl']=_0x461b7b,_0x2e77['NTmGcc']={},_0x2e77['iWJItl']=!![];}var _0x172771=_0x222c7e[0x0],_0x51c4c7=_0x5b7213+_0x172771,_0x3249c9=_0x2e77['NTmGcc'][_0x51c4c7];return!_0x3249c9?(_0x2e7789=_0x2e77['HQuVGl'](_0x2e7789),_0x2e77['NTmGcc'][_0x51c4c7]=_0x2e7789):_0x2e7789=_0x3249c9,_0x2e7789;}function _createClass(Constructor,_0x190b5e,_0x4cf20d){var _0x40c830=_0x2e77;if(_0x190b5e)_defineProperties(Constructor[_0x40c830(0x209)],_0x190b5e);if(_0x4cf20d)_defineProperties(Constructor,_0x4cf20d);return Object[_0x40c830(0x1f0)](Constructor,_0x40c830(0x209),{'writable':![]}),Constructor;}function _defineProperty(_0x4d8063,_0x57c334,_0x204455){var _0x410087=_0x2e77;return _0x57c334=_toPropertyKey(_0x57c334),_0x57c334 in _0x4d8063?Object[_0x410087(0x1f0)](_0x4d8063,_0x57c334,{'value':_0x204455,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x4d8063[_0x57c334]=_0x204455,_0x4d8063;}function _toPropertyKey(_0x9edfec){var _0x7224da=_0x2e77,_0x1fa338=_toPrimitive(_0x9edfec,_0x7224da(0x1fc));return'symbol'==_typeof(_0x1fa338)?_0x1fa338:String(_0x1fa338);}function _toPrimitive(_0x1aad36,_0x5d2619){var _0x558881=_0x2e77;if(_0x558881(0x1fb)!=_typeof(_0x1aad36)||!_0x1aad36)return _0x1aad36;var _0x24b09f=_0x1aad36[Symbol['toPrimitive']];if(void 0x0!==_0x24b09f){var _0x138e38=_0x24b09f['call'](_0x1aad36,_0x5d2619||'default');if(_0x558881(0x1fb)!=_typeof(_0x138e38))return _0x138e38;throw new TypeError(_0x558881(0x1ed));}return('string'===_0x5d2619?String:Number)(_0x1aad36);}var PermissionStore=(function(){var _0x25c0c6=_0x2e77;function PermissionStore(_0x3aa9c4){var _0xc28174=_0x2e77,_0x44c980=this;_classCallCheck(this,PermissionStore),_defineProperty(this,_0xc28174(0x1eb),void 0x0),_defineProperty(this,_0xc28174(0x1f3),new Set()),_defineProperty(this,_0xc28174(0x1ec),void 0x0),_defineProperty(this,'getSnapshot',function(){var _0x3eef7f=_0xc28174;return _0x44c980[_0x3eef7f(0x1eb)];}),_defineProperty(this,_0xc28174(0x212),function(){var _0x4cc276=_0xc28174;return _0x44c980[_0x4cc276(0x1eb)];}),_defineProperty(this,_0xc28174(0x1e6),function(_0x1c544f){var _0x117e6c=_0xc28174;return _0x44c980[_0x117e6c(0x1f3)][_0x117e6c(0x1f4)](_0x1c544f),function(){var _0x407c0e=_0x117e6c;return _0x44c980[_0x407c0e(0x1f3)][_0x407c0e(0x1de)](_0x1c544f);};}),_defineProperty(this,_0xc28174(0x1f7),function(){var _0xe4a32c=_0xc28174;_0x44c980[_0xe4a32c(0x1f3)][_0xe4a32c(0x20d)](function(_0x4e0867){return _0x4e0867();});}),_defineProperty(this,_0xc28174(0x1e5),function(_0x216008,_0x5846a9){var _0x5216b1=_0xc28174;_0x44c980[_0x5216b1(0x1e8)][_0x5216b1(0x211)](_0x216008),_0x5846a9!==undefined&&_0x44c980[_0x5216b1(0x1e8)][_0x5216b1(0x1f1)](_0x5846a9),_0x44c980[_0x5216b1(0x1eb)]=_0x44c980[_0x5216b1(0x206)](_0x216008,_0x5846a9),_0x44c980[_0x5216b1(0x1f7)]();}),_defineProperty(this,_0xc28174(0x202),function(){var _0x5f1d86=_0xc28174;_0x44c980[_0x5f1d86(0x1e8)]['clear'](),_0x44c980['state']=_0x44c980['buildState'](),_0x44c980[_0x5f1d86(0x1f7)]();}),_defineProperty(this,_0xc28174(0x203),function(_0x3e81f7){var _0x322a98=_0xc28174,_0x452b38=_objectSpread(_objectSpread({},_0x44c980[_0x322a98(0x1eb)][_0x322a98(0x20c)]),_0x3e81f7);_0x44c980[_0x322a98(0x1e8)][_0x322a98(0x1f1)](_0x452b38),_0x44c980[_0x322a98(0x1eb)]=_0x44c980[_0x322a98(0x206)](_0x44c980[_0x322a98(0x1eb)][_0x322a98(0x204)],_0x452b38),_0x44c980[_0x322a98(0x1f7)]();}),_defineProperty(this,'updatePermission',function(_0x5c4094){var _0x1f2461=_0xc28174,_0x4c0d01=_objectSpread(_objectSpread({},_0x44c980[_0x1f2461(0x1eb)][_0x1f2461(0x204)]),_0x5c4094);_0x44c980[_0x1f2461(0x1e8)][_0x1f2461(0x211)](_0x4c0d01),_0x44c980[_0x1f2461(0x1eb)]=_0x44c980[_0x1f2461(0x206)](_0x4c0d01,_0x44c980[_0x1f2461(0x1eb)]['user']),_0x44c980['emitChange']();}),_defineProperty(this,_0xc28174(0x1e3),function(){var _0x190d38=_0xc28174;_0x44c980['listeners'][_0x190d38(0x1ff)]();}),this[_0xc28174(0x1e8)]=_0x3aa9c4,this[_0xc28174(0x1ec)]={'granted':this[_0xc28174(0x1e5)],'denied':this[_0xc28174(0x202)],'updateUser':this['updateUser'],'updatePermission':this[_0xc28174(0x208)]};var _0x4ea4ff=_0x3aa9c4[_0xc28174(0x1e1)](),_0x2e7da5=_0x3aa9c4[_0xc28174(0x207)]();this['state']=this[_0xc28174(0x206)](_0x4ea4ff instanceof Promise?undefined:_0x4ea4ff,_0x2e7da5 instanceof Promise?undefined:_0x2e7da5);}return _createClass(PermissionStore,[{'key':_0x25c0c6(0x206),'value':function _0x16acbd(_0xe0007a,_0x426797){var _0x2559a7=_0x25c0c6;return _objectSpread(_objectSpread({},this[_0x2559a7(0x1ec)]),{},{'permission':_0xe0007a,'user':_0x426797,'isGranted':!!_0xe0007a});}}]),PermissionStore;}());export function createPermissionStore(_0x2568a0){return new PermissionStore(_0x2568a0);}
|
|
@@ -17,6 +17,7 @@ export type UITextProps = {
|
|
|
17
17
|
decoration?: 'underline' | 'line-through' | 'none';
|
|
18
18
|
selectable?: boolean;
|
|
19
19
|
skeleton?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
20
21
|
style?: CSSProperties;
|
|
21
22
|
} & TextProps & Partial<PaddingType> & Partial<MarginType>;
|
|
22
23
|
/**
|
|
@@ -33,6 +34,7 @@ export type UITextProps = {
|
|
|
33
34
|
* - decoration: 'underline' | 'line-through' | 'none' 文本装饰
|
|
34
35
|
* - selectable: boolean 是否可选择
|
|
35
36
|
* - skeleton: boolean 是否为骨架屏
|
|
37
|
+
* - disabled: boolean 是否禁用
|
|
36
38
|
* - style: CSSProperties 自定义样式
|
|
37
39
|
* - children: ReactNode 子元素
|
|
38
40
|
* - margin: px|string|undefined 外边距
|
|
@@ -1,136 +1 @@
|
|
|
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;
|
|
1
|
+
var _0x3d36b7=_0x1edc;(function(_0x11051c,_0x3c4d76){var _0x4c8463=_0x1edc,_0x20ff80=_0x11051c();while(!![]){try{var _0x3b9bfc=-parseInt(_0x4c8463(0x99))/0x1+-parseInt(_0x4c8463(0x98))/0x2+parseInt(_0x4c8463(0x9d))/0x3+parseInt(_0x4c8463(0x96))/0x4*(-parseInt(_0x4c8463(0x6c))/0x5)+parseInt(_0x4c8463(0x6b))/0x6*(-parseInt(_0x4c8463(0x6d))/0x7)+parseInt(_0x4c8463(0x91))/0x8*(-parseInt(_0x4c8463(0x6e))/0x9)+parseInt(_0x4c8463(0x9f))/0xa;if(_0x3b9bfc===_0x3c4d76)break;else _0x20ff80['push'](_0x20ff80['shift']());}catch(_0x45e313){_0x20ff80['push'](_0x20ff80['shift']());}}}(_0x3cf8,0xed0df));var _excluded=[_0x3d36b7(0x71),_0x3d36b7(0x7e),_0x3d36b7(0x6f),_0x3d36b7(0x9b),_0x3d36b7(0x9a),_0x3d36b7(0x93),_0x3d36b7(0x8e),_0x3d36b7(0xa8),'margin',_0x3d36b7(0xa1),_0x3d36b7(0x83),_0x3d36b7(0x94),_0x3d36b7(0x9e),_0x3d36b7(0xa3),_0x3d36b7(0x86),'pVertical',_0x3d36b7(0x70),'mBottom',_0x3d36b7(0x81),_0x3d36b7(0x79),_0x3d36b7(0xaa),_0x3d36b7(0x82),_0x3d36b7(0x95),_0x3d36b7(0xa0),'className',_0x3d36b7(0x7a),_0x3d36b7(0x8c),_0x3d36b7(0x85),_0x3d36b7(0x89),_0x3d36b7(0xa6),'onClick'];function _0x3cf8(){var _0x4d62de=['BM9YBwfS','ChvZAa','ChjVDg90ExbL','zgvMAw5LuhjVCgvYDgLLCW','z2v0t3DUuhjVCgvYDhLtEw1IB2XZ','BvjPz2H0','Dgv4DefSAwDU','Dg9qCMLTAxrPDMu','qeb0B1bYAw1PDgL2zsbTDxn0ihjLDhvYBIbHihbYAw1PDgL2zsb2ywX1zs4','C3LTyM9S','y2XHBxa','ChjVCgvYDhLjC0vUDw1LCMfIBgu','CfzLCNrPy2fS','BuXLzNq','CejVDhrVBq','C3r5Bgu','Aw5KzxHpzG','C2vSzwn0ywjSzq','CeHVCML6B250ywW','B2jQzwn0','C3rYAw5N','C2TLBgv0B24','BgvUz3rO','zMLSDgvY','zgvJB3jHDgLVBG','AxrLCMf0B3i','zM9UDfnPEMu','y2fSBa','y29UC3rYDwn0B3i','mZe2mgfAsxvVBG','zM9YrwfJAa','yM9Sza','yMDdB2XVCG','CeXLzNq','nZaWntmZmLj5z2j3ta','zNvUy3rPB24','mtGXotG0vLjvvLvo','otCWndyZwgX5s29J','BgLUzuHLAwDODa','AgvPz2H0','yM9VBgvHBG','mZK1mZC5ouvRywj6Bq','BuHVCML6B250ywW','mZKZodm3nZbMBe9tt2e','CfjPz2H0','CgfKzgLUzW','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9YCW','BvzLCNrPy2fS','DhjHBNnWyxjLBNq','z2v0t3DUuhjVCgvYDhLezxnJCMLWDg9Y','zgLZywjSzwq','zgvMyxvSDa','y29SB3i','y2XHC3noyw1L','CfrVCa','BwfYz2LU','BujVDhrVBq','mJK2odm4nNnjwM1xCa','nxLkuej0zG','mtrUs1bJq20','mteWmdDYzejSBfK','D2LKDgG','BvrVCa','y2HPBgrYzw4','A2v5CW','zgvMAw5LuhjVCgvYDhK'];_0x3cf8=function(){return _0x4d62de;};return _0x3cf8();}function _typeof(_0x789571){'@babel/helpers - typeof';var _0x3b7214=_0x3d36b7;return _typeof='function'==typeof Symbol&&'symbol'==typeof Symbol[_0x3b7214(0x8d)]?function(_0x1f137f){return typeof _0x1f137f;}:function(_0x216b7f){var _0x5c4379=_0x3b7214;return _0x216b7f&&_0x5c4379(0x97)==typeof Symbol&&_0x216b7f[_0x5c4379(0x90)]===Symbol&&_0x216b7f!==Symbol[_0x5c4379(0x76)]?_0x5c4379(0x7d):typeof _0x216b7f;},_typeof(_0x789571);}function ownKeys(_0x2e647d,_0x5336c8){var _0x3716bd=_0x3d36b7,_0x43d7c5=Object[_0x3716bd(0x72)](_0x2e647d);if(Object['getOwnPropertySymbols']){var _0x444107=Object['getOwnPropertySymbols'](_0x2e647d);_0x5336c8&&(_0x444107=_0x444107[_0x3716bd(0x8b)](function(_0x51e6d5){var _0xa6a467=_0x3716bd;return Object[_0xa6a467(0xa5)](_0x2e647d,_0x51e6d5)['enumerable'];})),_0x43d7c5[_0x3716bd(0x75)]['apply'](_0x43d7c5,_0x444107);}return _0x43d7c5;}function _objectSpread(_0x46c30b){var _0x4b3243=_0x3d36b7;for(var _0xbbf675=0x1;_0xbbf675<arguments['length'];_0xbbf675++){var _0x43ba3e=null!=arguments[_0xbbf675]?arguments[_0xbbf675]:{};_0xbbf675%0x2?ownKeys(Object(_0x43ba3e),!0x0)[_0x4b3243(0x92)](function(_0x352a89){_defineProperty(_0x46c30b,_0x352a89,_0x43ba3e[_0x352a89]);}):Object['getOwnPropertyDescriptors']?Object[_0x4b3243(0x77)](_0x46c30b,Object[_0x4b3243(0xa2)](_0x43ba3e)):ownKeys(Object(_0x43ba3e))[_0x4b3243(0x92)](function(_0x3985a0){var _0x451232=_0x4b3243;Object['defineProperty'](_0x46c30b,_0x3985a0,Object[_0x451232(0xa5)](_0x43ba3e,_0x3985a0));});}return _0x46c30b;}function _defineProperty(_0x9133d9,_0x5dd8c6,_0x145266){var _0x2f9128=_0x3d36b7;return _0x5dd8c6=_toPropertyKey(_0x5dd8c6),_0x5dd8c6 in _0x9133d9?Object[_0x2f9128(0x73)](_0x9133d9,_0x5dd8c6,{'value':_0x145266,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x9133d9[_0x5dd8c6]=_0x145266,_0x9133d9;}function _toPropertyKey(_0x26ee9f){var _0x47946e=_0x3d36b7,_0x2eaf68=_toPrimitive(_0x26ee9f,_0x47946e(0x88));return _0x47946e(0x7d)==_typeof(_0x2eaf68)?_0x2eaf68:String(_0x2eaf68);}function _toPrimitive(_0x34f20a,_0x5b427e){var _0x1c89bf=_0x3d36b7;if(_0x1c89bf(0x87)!=_typeof(_0x34f20a)||!_0x34f20a)return _0x34f20a;var _0x561db6=_0x34f20a[Symbol[_0x1c89bf(0x7b)]];if(void 0x0!==_0x561db6){var _0xe6b4a5=_0x561db6[_0x1c89bf(0x8f)](_0x34f20a,_0x5b427e||_0x1c89bf(0xa7));if(_0x1c89bf(0x87)!=_typeof(_0xe6b4a5))return _0xe6b4a5;throw new TypeError(_0x1c89bf(0x7c));}return(_0x1c89bf(0x88)===_0x5b427e?String:Number)(_0x34f20a);}function _0x1edc(_0xd1dd81,_0x32fa02){_0xd1dd81=_0xd1dd81-0x69;var _0x3cf8d0=_0x3cf8();var _0x1edc55=_0x3cf8d0[_0xd1dd81];if(_0x1edc['tZGMTK']===undefined){var _0x19943b=function(_0x3bb001){var _0x598265='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789+/=';var _0x3f8fec='',_0x4d3215='';for(var _0x789571=0x0,_0x1f137f,_0x216b7f,_0x2e647d=0x0;_0x216b7f=_0x3bb001['charAt'](_0x2e647d++);~_0x216b7f&&(_0x1f137f=_0x789571%0x4?_0x1f137f*0x40+_0x216b7f:_0x216b7f,_0x789571++%0x4)?_0x3f8fec+=String['fromCharCode'](0xff&_0x1f137f>>(-0x2*_0x789571&0x6)):0x0){_0x216b7f=_0x598265['indexOf'](_0x216b7f);}for(var _0x5336c8=0x0,_0x43d7c5=_0x3f8fec['length'];_0x5336c8<_0x43d7c5;_0x5336c8++){_0x4d3215+='%'+('00'+_0x3f8fec['charCodeAt'](_0x5336c8)['toString'](0x10))['slice'](-0x2);}return decodeURIComponent(_0x4d3215);};_0x1edc['IxYnZx']=_0x19943b,_0x1edc['gnJsaE']={},_0x1edc['tZGMTK']=!![];}var _0x5c4acb=_0x3cf8d0[0x0],_0x400da2=_0xd1dd81+_0x5c4acb,_0x2d9196=_0x1edc['gnJsaE'][_0x400da2];return!_0x2d9196?(_0x1edc55=_0x1edc['IxYnZx'](_0x1edc55),_0x1edc['gnJsaE'][_0x400da2]=_0x1edc55):_0x1edc55=_0x2d9196,_0x1edc55;}function _objectWithoutProperties(_0x6bda06,_0x35f414){var _0x4aed4d=_0x3d36b7;if(_0x6bda06==null)return{};var _0x2f93ee=_objectWithoutPropertiesLoose(_0x6bda06,_0x35f414),_0x5d502a,_0x29803a;if(Object[_0x4aed4d(0x78)]){var _0x5c718b=Object[_0x4aed4d(0x78)](_0x6bda06);for(_0x29803a=0x0;_0x29803a<_0x5c718b[_0x4aed4d(0x8a)];_0x29803a++){_0x5d502a=_0x5c718b[_0x29803a];if(_0x35f414[_0x4aed4d(0x84)](_0x5d502a)>=0x0)continue;if(!Object[_0x4aed4d(0x76)][_0x4aed4d(0x7f)][_0x4aed4d(0x8f)](_0x6bda06,_0x5d502a))continue;_0x2f93ee[_0x5d502a]=_0x6bda06[_0x5d502a];}}return _0x2f93ee;}function _objectWithoutPropertiesLoose(_0x507488,_0x106ecd){var _0x4b796c=_0x3d36b7;if(_0x507488==null)return{};var _0x4de9a7={},_0x53a690=Object[_0x4b796c(0x72)](_0x507488),_0x24ef39,_0x4afe6f;for(_0x4afe6f=0x0;_0x4afe6f<_0x53a690[_0x4b796c(0x8a)];_0x4afe6f++){_0x24ef39=_0x53a690[_0x4afe6f];if(_0x106ecd[_0x4b796c(0x84)](_0x24ef39)>=0x0)continue;_0x4de9a7[_0x24ef39]=_0x507488[_0x24ef39];}return _0x4de9a7;}import React,{forwardRef}from'react';import{Text as OrigText}from'@tarojs/components';import _0x3f8fec from'classnames';import'../../styles/index.css';import{jsx as _0x4d3215}from'react/jsx-runtime';var px=function px(_0x30e216){if(_0x30e216===undefined||_0x30e216===null||_0x30e216==='')return undefined;return typeof _0x30e216==='number'||!isNaN(Number(_0x30e216))?''['concat'](_0x30e216,'px'):String(_0x30e216);},Text=forwardRef(function(_0x592198,_0x122880){var _0x3b2060=_0x3d36b7,_0x107c2e=_0x592198['children'],_0x391897=_0x592198[_0x3b2060(0x7e)],_0x3bb85e=_0x592198['width'],_0x1161c5=_0x592198['height'],_0x591494=_0x592198['lineHeight'],_0x4a9370=_0x592198[_0x3b2060(0x93)],_0x5a53a4=_0x592198[_0x3b2060(0x8e)],_0xd03f7b=_0x592198[_0x3b2060(0xa8)],_0x3eab4a=_0x592198[_0x3b2060(0x69)],_0x4b08dc=_0x592198[_0x3b2060(0xa1)],_0x500f4f=_0x592198[_0x3b2060(0x83)],_0x3161d3=_0x500f4f===void 0x0?{}:_0x500f4f,_0x2088ed=_0x592198[_0x3b2060(0x94)],_0x4e93c9=_0x592198[_0x3b2060(0x9e)],_0x537416=_0x592198[_0x3b2060(0xa3)],_0x29d615=_0x592198[_0x3b2060(0x86)],_0x5c50ee=_0x592198[_0x3b2060(0x80)],_0x20a2f6=_0x592198[_0x3b2060(0x70)],_0x4e3349=_0x592198[_0x3b2060(0x6a)],_0x516069=_0x592198[_0x3b2060(0x81)],_0x52644e=_0x592198[_0x3b2060(0x79)],_0x35e403=_0x592198['pTop'],_0x92765b=_0x592198[_0x3b2060(0x82)],_0x5087c3=_0x592198[_0x3b2060(0x95)],_0x96156=_0x592198[_0x3b2060(0xa0)],_0x38c0ab=_0x592198[_0x3b2060(0xa9)],_0x6b7136=_0x592198[_0x3b2060(0x7a)],_0x544f62=_0x592198[_0x3b2060(0x8c)],_0x137633=_0x592198[_0x3b2060(0x85)],_0x2b632f=_0x592198[_0x3b2060(0x89)],_0x197b49=_0x592198[_0x3b2060(0xa6)],_0x401bb9=_0x592198['onClick'],_0x5c24f2=_objectWithoutProperties(_0x592198,_excluded),_0x45bf5d=_0x3f8fec(_0x38c0ab,{'zero-line-clamp-1':_0x391897===0x1,'zero-line-clamp-2':_0x391897===0x2,'zero-line-clamp-3':_0x391897===0x3,'zero-line-clamp-4':_0x391897===0x4,'zero-line-clamp-5':_0x391897===0x5,'zero-line-clamp-6':_0x391897===0x6,'zero-animate-pulse\x20zero-bg-gray-200\x20zero-text-transparent':_0x2b632f}),_0x6adc00=_objectSpread({'width':px(_0x3bb85e),'height':px(_0x1161c5),'margin':px(_0x3eab4a),'marginTop':px(_0x20a2f6!==null&&_0x20a2f6!==void 0x0?_0x20a2f6:_0x537416),'marginBottom':px(_0x4e3349!==null&&_0x4e3349!==void 0x0?_0x4e3349:_0x537416),'marginLeft':px(_0x516069!==null&&_0x516069!==void 0x0?_0x516069:_0x4e93c9),'marginRight':px(_0x52644e!==null&&_0x52644e!==void 0x0?_0x52644e:_0x4e93c9),'padding':px(_0x4b08dc),'paddingTop':px(_0x35e403!==null&&_0x35e403!==void 0x0?_0x35e403:_0x5c50ee),'paddingBottom':px(_0x92765b!==null&&_0x92765b!==void 0x0?_0x92765b:_0x5c50ee),'paddingLeft':px(_0x5087c3!==null&&_0x5087c3!==void 0x0?_0x5087c3:_0x29d615),'paddingRight':px(_0x96156!==null&&_0x96156!==void 0x0?_0x96156:_0x29d615),'fontSize':px(_0x5a53a4),'color':_0x2b632f?_0x3b2060(0xa4):_0xd03f7b,'backgroundColor':_0x2088ed,'lineHeight':px(_0x591494),'fontWeight':typeof _0x4a9370===_0x3b2060(0x9c)?_0x4a9370?_0x3b2060(0x93):_0x3b2060(0x74):_0x4a9370,'textAlign':_0x6b7136,'textDecoration':_0x544f62},_typeof(_0x3161d3)==='object'?_0x3161d3:{}),_0x58f1e1={};for(var _0x47b808 in _0x6adc00){_0x6adc00[_0x47b808]!==undefined&&_0x6adc00[_0x47b808]!==null&&(_0x58f1e1[_0x47b808]=_0x6adc00[_0x47b808]);}return _0x4d3215(OrigText,_objectSpread(_objectSpread({'ref':_0x122880,'style':_0x58f1e1,'className':_0x45bf5d,'selectable':_0x137633,'onClick':_0x197b49?undefined:_0x401bb9},_0x5c24f2),{},{'children':_0x107c2e}));});Text['displayName']='Text';export default Text;
|
|
@@ -8,7 +8,7 @@ export type MarginType = Record<MarginKeys, string | number>;
|
|
|
8
8
|
export type PaddingKeys = 'pTop' | 'pBottom' | 'pLeft' | 'pRight' | 'padding' | 'pHorizontal' | 'pVertical';
|
|
9
9
|
export type PaddingType = Record<PaddingKeys, string | number>;
|
|
10
10
|
export type PositionValue = 'static' | 'relative' | 'absolute' | 'fixed' | 'sticky';
|
|
11
|
-
export type OverflowValue = 'hidden' | 'visible' | 'scroll';
|
|
11
|
+
export type OverflowValue = 'hidden' | 'visible' | 'scroll' | 'auto';
|
|
12
12
|
export interface UIViewProps {
|
|
13
13
|
full?: boolean;
|
|
14
14
|
row?: boolean;
|
|
@@ -29,6 +29,7 @@ export interface UIViewProps {
|
|
|
29
29
|
flexBasis?: string | number;
|
|
30
30
|
opacity?: number | string;
|
|
31
31
|
hidden?: boolean;
|
|
32
|
+
disabled?: boolean;
|
|
32
33
|
width?: string | number;
|
|
33
34
|
height?: string | number;
|
|
34
35
|
minWidth?: string | number;
|
|
@@ -78,6 +79,7 @@ type Props = UIViewProps & Partial<PaddingType> & Partial<MarginType> & ViewProp
|
|
|
78
79
|
* - flexBasis: flex-basis 初始大小
|
|
79
80
|
* - opacity: opacity 透明度
|
|
80
81
|
* - hidden: hidden 隐藏
|
|
82
|
+
* - disabled: disabled 是否禁用
|
|
81
83
|
* - width: width 宽度
|
|
82
84
|
* - height: height 高度
|
|
83
85
|
* - bgColor: background-color 背景颜色
|