@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,220 @@
1
- var _0x442417=_0x1f9c;(function(_0x21f6cc,_0x4a0cf7){var _0xffa42b=_0x1f9c,_0x55c994=_0x21f6cc();while(!![]){try{var _0x5c04b8=-parseInt(_0xffa42b(0x12d))/0x1+-parseInt(_0xffa42b(0x124))/0x2*(parseInt(_0xffa42b(0x128))/0x3)+-parseInt(_0xffa42b(0x14c))/0x4*(parseInt(_0xffa42b(0x113))/0x5)+parseInt(_0xffa42b(0x10f))/0x6+-parseInt(_0xffa42b(0x12a))/0x7*(-parseInt(_0xffa42b(0x155))/0x8)+-parseInt(_0xffa42b(0x134))/0x9+parseInt(_0xffa42b(0x135))/0xa;if(_0x5c04b8===_0x4a0cf7)break;else _0x55c994['push'](_0x55c994['shift']());}catch(_0x5a53f5){_0x55c994['push'](_0x55c994['shift']());}}}(_0x55a0,0xbfbbe));function _0x1f9c(_0x195897,_0x58d3cf){_0x195897=_0x195897-0x10b;var _0x55a008=_0x55a0();var _0x1f9c9c=_0x55a008[_0x195897];return _0x1f9c9c;}var _excluded=[_0x442417(0x157),'row','column',_0x442417(0x154),_0x442417(0x131),_0x442417(0x168),'between',_0x442417(0x116),_0x442417(0x138),_0x442417(0x11d),_0x442417(0x136),'gap',_0x442417(0x133),_0x442417(0x129),'flexShrink','flexGrow',_0x442417(0x160),'opacity',_0x442417(0x150),_0x442417(0x120),_0x442417(0x127),_0x442417(0x16c),_0x442417(0x122),_0x442417(0x13d),_0x442417(0x11b),'mTop',_0x442417(0x16a),_0x442417(0x166),_0x442417(0x16b),_0x442417(0x15a),_0x442417(0x14a),_0x442417(0x163),_0x442417(0x167),_0x442417(0x152),_0x442417(0x137),_0x442417(0x110),_0x442417(0x117),_0x442417(0x123),'safeArea','hover',_0x442417(0x115),_0x442417(0x159),_0x442417(0x15b),_0x442417(0x11f),'right',_0x442417(0x162),_0x442417(0x145),_0x442417(0x114),_0x442417(0x13a),_0x442417(0x143),_0x442417(0x164),_0x442417(0x15c),_0x442417(0x15f)];function _typeof(_0x5c3bfa){'@babel/helpers - typeof';var _0x3c155c=_0x442417;return _typeof=_0x3c155c(0x15d)==typeof Symbol&&_0x3c155c(0x112)==typeof Symbol[_0x3c155c(0x161)]?function(_0x35ff7){return typeof _0x35ff7;}:function(_0x5e471b){var _0x378d27=_0x3c155c;return _0x5e471b&&_0x378d27(0x15d)==typeof Symbol&&_0x5e471b[_0x378d27(0x11c)]===Symbol&&_0x5e471b!==Symbol[_0x378d27(0x14f)]?_0x378d27(0x112):typeof _0x5e471b;},_typeof(_0x5c3bfa);}function ownKeys(_0x4099b4,_0x4e35db){var _0x412543=_0x442417,_0x42ae90=Object[_0x412543(0x121)](_0x4099b4);if(Object[_0x412543(0x13c)]){var _0x2f4206=Object[_0x412543(0x13c)](_0x4099b4);_0x4e35db&&(_0x2f4206=_0x2f4206[_0x412543(0x10e)](function(_0x12ced1){var _0x1be7cb=_0x412543;return Object[_0x1be7cb(0x146)](_0x4099b4,_0x12ced1)[_0x1be7cb(0x147)];})),_0x42ae90[_0x412543(0x125)][_0x412543(0x16e)](_0x42ae90,_0x2f4206);}return _0x42ae90;}function _objectSpread(_0x227ffb){var _0xf3e54e=_0x442417;for(var _0x3d5617=0x1;_0x3d5617<arguments[_0xf3e54e(0x148)];_0x3d5617++){var _0x907cbe=null!=arguments[_0x3d5617]?arguments[_0x3d5617]:{};_0x3d5617%0x2?ownKeys(Object(_0x907cbe),!0x0)[_0xf3e54e(0x169)](function(_0x2003d7){_defineProperty(_0x227ffb,_0x2003d7,_0x907cbe[_0x2003d7]);}):Object[_0xf3e54e(0x10d)]?Object[_0xf3e54e(0x13f)](_0x227ffb,Object[_0xf3e54e(0x10d)](_0x907cbe)):ownKeys(Object(_0x907cbe))[_0xf3e54e(0x169)](function(_0x4d70ea){var _0x3bd047=_0xf3e54e;Object[_0x3bd047(0x111)](_0x227ffb,_0x4d70ea,Object[_0x3bd047(0x146)](_0x907cbe,_0x4d70ea));});}return _0x227ffb;}function _defineProperty(_0x51d3f4,_0x4f3bb8,_0x1342f5){var _0x96202=_0x442417;return _0x4f3bb8=_toPropertyKey(_0x4f3bb8),_0x4f3bb8 in _0x51d3f4?Object[_0x96202(0x111)](_0x51d3f4,_0x4f3bb8,{'value':_0x1342f5,'enumerable':!![],'configurable':!![],'writable':!![]}):_0x51d3f4[_0x4f3bb8]=_0x1342f5,_0x51d3f4;}function _toPropertyKey(_0xdc9f40){var _0x2633ef=_0x442417,_0x101470=_toPrimitive(_0xdc9f40,_0x2633ef(0x144));return _0x2633ef(0x112)==_typeof(_0x101470)?_0x101470:String(_0x101470);}function _toPrimitive(_0x4639ee,_0x516e6d){var _0x9e1423=_0x442417;if(_0x9e1423(0x142)!=_typeof(_0x4639ee)||!_0x4639ee)return _0x4639ee;var _0x11105b=_0x4639ee[Symbol[_0x9e1423(0x12c)]];if(void 0x0!==_0x11105b){var _0x4b8fdc=_0x11105b[_0x9e1423(0x141)](_0x4639ee,_0x516e6d||_0x9e1423(0x11e));if(_0x9e1423(0x142)!=_typeof(_0x4b8fdc))return _0x4b8fdc;throw new TypeError(_0x9e1423(0x119));}return(_0x9e1423(0x144)===_0x516e6d?String:Number)(_0x4639ee);}function _objectWithoutProperties(_0x2e8210,_0x221623){var _0x329e0d=_0x442417;if(_0x2e8210==null)return{};var _0x572a15=_objectWithoutPropertiesLoose(_0x2e8210,_0x221623),_0x2e71c3,_0x33991f;if(Object[_0x329e0d(0x13c)]){var _0x509bde=Object[_0x329e0d(0x13c)](_0x2e8210);for(_0x33991f=0x0;_0x33991f<_0x509bde[_0x329e0d(0x148)];_0x33991f++){_0x2e71c3=_0x509bde[_0x33991f];if(_0x221623[_0x329e0d(0x153)](_0x2e71c3)>=0x0)continue;if(!Object['prototype'][_0x329e0d(0x139)][_0x329e0d(0x141)](_0x2e8210,_0x2e71c3))continue;_0x572a15[_0x2e71c3]=_0x2e8210[_0x2e71c3];}}return _0x572a15;}function _objectWithoutPropertiesLoose(_0x10f444,_0x28cabc){var _0x1a99a0=_0x442417;if(_0x10f444==null)return{};var _0x81ea73={},_0x2fd4a3=Object[_0x1a99a0(0x121)](_0x10f444),_0x56c6cf,_0x3bc133;for(_0x3bc133=0x0;_0x3bc133<_0x2fd4a3[_0x1a99a0(0x148)];_0x3bc133++){_0x56c6cf=_0x2fd4a3[_0x3bc133];if(_0x28cabc[_0x1a99a0(0x153)](_0x56c6cf)>=0x0)continue;_0x81ea73[_0x56c6cf]=_0x10f444[_0x56c6cf];}return _0x81ea73;}import{forwardRef}from'react';import{View as _0x5c5deb}from'@tarojs/components';import _0x311d98 from'classnames';import'../../styles/index.css';import{jsx as _0x1d0484}from'react/jsx-runtime';var px=function px(_0x455d09){var _0x23bbb3=_0x442417;if(_0x455d09===undefined||_0x455d09===null||_0x455d09==='')return undefined;return typeof _0x455d09===_0x23bbb3(0x15e)||!isNaN(Number(_0x455d09))?''[_0x23bbb3(0x11a)](_0x455d09,'px'):String(_0x455d09);},View=forwardRef(function(_0x5d87c6,_0x223894){var _0x5cd84d=_0x442417,_0x1cacb9=_0x5d87c6[_0x5cd84d(0x157)],_0x5c8fea=_0x5d87c6[_0x5cd84d(0x165)],_0x5f4d5a=_0x5d87c6[_0x5cd84d(0x10b)],_0x11ecf5=_0x5d87c6[_0x5cd84d(0x154)],_0x1a3e5b=_0x5d87c6[_0x5cd84d(0x131)],_0x1d59c9=_0x5d87c6[_0x5cd84d(0x168)],_0x319b40=_0x5d87c6[_0x5cd84d(0x126)],_0x4a0340=_0x5d87c6[_0x5cd84d(0x116)],_0x191122=_0x5d87c6['justifyItems'],_0x265a38=_0x5d87c6['alignItems'],_0x522d67=_0x5d87c6[_0x5cd84d(0x136)],_0x2a085b=_0x5d87c6[_0x5cd84d(0x14d)],_0xfe58dd=_0x5d87c6['rowGap'],_0xb72004=_0x5d87c6['columnGap'],_0x10d4e0=_0x5d87c6[_0x5cd84d(0x151)],_0x49658f=_0x5d87c6['flexGrow'],_0x5bdbf3=_0x5d87c6[_0x5cd84d(0x160)],_0x4220db=_0x5d87c6[_0x5cd84d(0x130)],_0xe7966e=_0x5d87c6['hidden'],_0x56b2af=_0x5d87c6[_0x5cd84d(0x120)],_0x16c633=_0x5d87c6[_0x5cd84d(0x127)],_0x53273b=_0x5d87c6['bgColor'],_0xf62c55=_0x5d87c6['style'],_0x5159a1=_0xf62c55===void 0x0?{}:_0xf62c55,_0x45baf6=_0x5d87c6[_0x5cd84d(0x13d)],_0x38b50c=_0x5d87c6[_0x5cd84d(0x11b)],_0x21ea08=_0x5d87c6[_0x5cd84d(0x156)],_0x5a46a9=_0x5d87c6[_0x5cd84d(0x16a)],_0x2bb856=_0x5d87c6[_0x5cd84d(0x166)],_0x2ba813=_0x5d87c6['mRight'],_0x14a0c7=_0x5d87c6[_0x5cd84d(0x15a)],_0x210b7f=_0x5d87c6[_0x5cd84d(0x14a)],_0x3f935d=_0x5d87c6[_0x5cd84d(0x163)],_0x26d581=_0x5d87c6[_0x5cd84d(0x167)],_0x59cc9d=_0x5d87c6[_0x5cd84d(0x152)],_0x2218a6=_0x5d87c6[_0x5cd84d(0x137)],_0x3d3604=_0x5d87c6[_0x5cd84d(0x110)],_0x404975=_0x5d87c6['pHorizontal'],_0x436c43=_0x5d87c6[_0x5cd84d(0x123)],_0x51f350=_0x5d87c6[_0x5cd84d(0x12b)],_0x2c11d1=_0x5d87c6[_0x5cd84d(0x14b)],_0x36b66f=_0x5d87c6[_0x5cd84d(0x115)],_0x1085dc=_0x5d87c6['position'],_0xd120fd=_0x5d87c6[_0x5cd84d(0x15b)],_0x4c99e2=_0x5d87c6[_0x5cd84d(0x11f)],_0x2a7d2c=_0x5d87c6['right'],_0x136da9=_0x5d87c6[_0x5cd84d(0x162)],_0x3fc489=_0x5d87c6['bottom'],_0x32314f=_0x5d87c6['overflow'],_0x4daf92=_0x5d87c6['radius'],_0x5eb8b8=_0x5d87c6[_0x5cd84d(0x143)],_0x11d847=_0x5d87c6[_0x5cd84d(0x164)],_0x15355f=_0x5d87c6[_0x5cd84d(0x15c)],_0x1de704=_0x5d87c6['borderStyle'],_0x1a3daf=_objectWithoutProperties(_0x5d87c6,_excluded),_0x327a35=_0x311d98(_0x4a0340,{'zero-flex':!![],'zero-flex-1':_0x1a3e5b,'zero-flex-col':_0x5f4d5a,'zero-flex-row':_0x5c8fea,'zero-flex-wrap':_0x11ecf5,'zero-items-start':_0x265a38===_0x5cd84d(0x12f),'zero-items-end':_0x265a38==='flex-end','zero-items-center':_0x265a38===_0x5cd84d(0x13e),'zero-justify-start':_0x191122===_0x5cd84d(0x12f),'zero-justify-end':_0x191122==='flex-end','zero-justify-center':_0x191122===_0x5cd84d(0x13e),'zero-place-content-around':_0x1d59c9===_0x5cd84d(0x14e),'zero-justify-around':_0x1d59c9==='justify-around','zero-justify-between':_0x319b40,'zero-hidden':_0xe7966e,'zero-animate-pulse\x20zero-bg-gray-200':_0x36b66f}),_0x5a2f0d=function _0x17daf3(_0x1c5080,_0x1badc1,_0x715fa5){var _0x3e23dd=_0x5cd84d,_0x273d54=_0x1badc1===_0x1c5080||_0x1badc1==='both';if(!_0x273d54)return px(_0x715fa5);return _0x715fa5?_0x3e23dd(0x140)[_0x3e23dd(0x11a)](_0x1c5080,_0x3e23dd(0x158))[_0x3e23dd(0x11a)](px(_0x715fa5),')'):'env(safe-area-inset-'[_0x3e23dd(0x11a)](_0x1c5080,')');},_0x37b11f=_0x5eb8b8||_0x11d847!==undefined||_0x15355f!==undefined,_0x3d044b=_objectSpread({'width':px(_0x1cacb9?_0x5cd84d(0x16d):_0x56b2af),'height':px(_0x1cacb9?_0x5cd84d(0x16d):_0x16c633),'backgroundColor':_0x53273b,'margin':px(_0x38b50c),'marginTop':px(_0x21ea08!==null&&_0x21ea08!==void 0x0?_0x21ea08:_0x210b7f),'marginBottom':px(_0x5a46a9!==null&&_0x5a46a9!==void 0x0?_0x5a46a9:_0x210b7f),'marginLeft':px(_0x2bb856!==null&&_0x2bb856!==void 0x0?_0x2bb856:_0x14a0c7),'marginRight':px(_0x2ba813!==null&&_0x2ba813!==void 0x0?_0x2ba813:_0x14a0c7),'padding':px(_0x3f935d),'paddingTop':_0x5a2f0d(_0x5cd84d(0x162),_0x51f350,_0x26d581!==null&&_0x26d581!==void 0x0?_0x26d581:_0x436c43),'paddingBottom':_0x5a2f0d(_0x5cd84d(0x145),_0x51f350,_0x59cc9d!==null&&_0x59cc9d!==void 0x0?_0x59cc9d:_0x436c43),'paddingLeft':px(_0x2218a6!==null&&_0x2218a6!==void 0x0?_0x2218a6:_0x404975),'paddingRight':px(_0x3d3604!==null&&_0x3d3604!==void 0x0?_0x3d3604:_0x404975),'position':_0x1085dc,'zIndex':_0xd120fd,'left':px(_0x4c99e2),'right':px(_0x2a7d2c),'top':px(_0x136da9),'bottom':px(_0x3fc489),'overflow':_0x32314f,'borderRadius':px(_0x4daf92),'borderWidth':_0x37b11f?px(_0x15355f!==null&&_0x15355f!==void 0x0?_0x15355f:0x1):undefined,'borderStyle':_0x37b11f?_0x1de704!==null&&_0x1de704!==void 0x0?_0x1de704:_0x5cd84d(0x12e):undefined,'borderColor':_0x11d847,'gap':px(_0x2a085b),'rowGap':px(_0xfe58dd),'columnGap':px(_0xb72004),'alignSelf':_0x522d67,'flexShrink':_0x10d4e0,'flexGrow':_0x49658f,'flexBasis':px(_0x5bdbf3),'opacity':_0x4220db,'display':_0xe7966e?_0x5cd84d(0x13b):undefined,'color':_0x36b66f?_0x5cd84d(0x149):undefined},_typeof(_0x5159a1)===_0x5cd84d(0x142)?_0x5159a1:{}),_0x4b2a3d={};for(var _0x5f2ee1 in _0x3d044b){_0x3d044b[_0x5f2ee1]!==undefined&&_0x3d044b[_0x5f2ee1]!==null&&(_0x4b2a3d[_0x5f2ee1]=_0x3d044b[_0x5f2ee1]);}return _0x1d0484(_0x5c5deb,_objectSpread(_objectSpread({'ref':_0x223894,'className':_0x327a35,'style':_0x4b2a3d,'hoverClass':_0x2c11d1?_0x5cd84d(0x10c):_0x5cd84d(0x13b),'hoverStayTime':0xc8},_0x1a3daf),{},{'children':_0x45baf6}));});View[_0x442417(0x118)]=_0x442417(0x132);function _0x55a0(){var _0x72e730=['margin','constructor','alignItems','default','left','width','keys','style','pVertical','12468HSvYRN','push','between','height','615XkkXNr','columnGap','959wfcAQM','safeArea','toPrimitive','1110554ZYJwUg','solid','flex-start','opacity','flex','View','rowGap','8531586gJrBUJ','33651440IqRoso','alignSelf','pLeft','justifyItems','propertyIsEnumerable','radius','none','getOwnPropertySymbols','children','center','defineProperties','calc(env(safe-area-inset-','call','object','border','string','bottom','getOwnPropertyDescriptor','enumerable','length','transparent','mVertical','hover','450520RFUCtM','gap','content-around','prototype','hidden','flexShrink','pBottom','indexOf','wrap','42520VazAOj','mTop','full',')\x20+\x20','position','mHorizontal','zIndex','borderWidth','function','number','borderStyle','flexBasis','iterator','top','padding','borderColor','row','mLeft','pTop','around','forEach','mBottom','mRight','bgColor','100%','apply','column','zero:opacity-70','getOwnPropertyDescriptors','filter','4901586frYcIy','pRight','defineProperty','symbol','35Kvyznh','overflow','skeleton','className','pHorizontal','displayName','@@toPrimitive\x20must\x20return\x20a\x20primitive\x20value.','concat'];_0x55a0=function(){return _0x72e730;};return _0x55a0();}export default View;
1
+ 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"];
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 { forwardRef } from 'react';
11
+ import { View as OrigView } 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 View Component (Tailwind 版)
27
+ * - full: 100% 100% 宽度、高度100%
28
+ * - flex: flex: 1 自动适应
29
+ * - row: flex-direction: row 主轴水平
30
+ * - column: flex-direction: column 主轴垂直
31
+ * - wrap: flex-wrap: wrap 换行
32
+ * - around: flex-direction: row justify-content: space-around 主轴平均分布
33
+ * - between: flex-direction: row justify-content: space-between 主轴两端对齐
34
+ * - justifyItems: justify-content 主轴对齐方式
35
+ * - alignItems: align-items 交叉轴对齐方式
36
+ * - alignSelf: align-self 自身对齐方式
37
+ * - gap: gap 间距
38
+ * - rowGap: row-gap 行间距
39
+ * - columnGap: column-gap 列间距
40
+ * - flexShrink: flex-shrink 剩余空间不足时
41
+ * - flexGrow: flex-grow 剩余空间
42
+ * - flexBasis: flex-basis 初始大小
43
+ * - opacity: opacity 透明度
44
+ * - hidden: hidden 隐藏
45
+ * - width: width 宽度
46
+ * - height: height 高度
47
+ * - bgColor: background-color 背景颜色
48
+ * - background: background 背景图片等复杂背景
49
+ * - safeArea: safe-area-inset 安全区域
50
+ * - hover: hover 悬停状态
51
+ * - skeleton: skeleton 骨架屏
52
+ * - position: position 定位
53
+ * - zIndex: z-index 层级
54
+ * - left: left 定位左侧
55
+ * - right: right 定位右侧
56
+ * - top: top 定位上侧
57
+ * - bottom: bottom 定位下侧
58
+ * - overflow: overflow 显示
59
+ * - overflowX: overflow-x 显示
60
+ * - overflowY: overflow-y 显示
61
+ * - radius: border-radius 圆角
62
+ * - border: boolean 边框
63
+ * - borderColor: border-color 边框颜色
64
+ * - borderWidth: border-width 边框宽度
65
+ * - borderStyle: border-style 边框样式
66
+ * - style: style 自定义样式
67
+ * - children: children 子元素
68
+ * - margin: margin 外边距
69
+ * - mTop: margin-top 上外边距
70
+ * - mBottom: margin-bottom 下外边距
71
+ * - mLeft: margin-left 左外边距
72
+ * - mRight: margin-right 右外边距
73
+ * - mHorizontal: margin-horizontal 水平外边距
74
+ * - mVertical: margin-vertical 垂直外边距
75
+ * - padding: padding 内边距
76
+ * - pTop: padding-top 上内边距
77
+ * - pBottom: padding-bottom 下内边距
78
+ * - pLeft: padding-left 左内边距
79
+ * - pRight: padding-right 右内边距
80
+ * - pHorizontal: padding-horizontal 水平内边距
81
+ * - pVertical: padding-vertical 垂直内边距
82
+ * - rest: View组件其他属性
83
+ */
84
+ var View = /*#__PURE__*/forwardRef(function (props, ref) {
85
+ var full = props.full,
86
+ row = props.row,
87
+ column = props.column,
88
+ wrap = props.wrap,
89
+ flex = props.flex,
90
+ around = props.around,
91
+ between = props.between,
92
+ className = props.className,
93
+ justifyItems = props.justifyItems,
94
+ alignItems = props.alignItems,
95
+ alignSelf = props.alignSelf,
96
+ gap = props.gap,
97
+ rowGap = props.rowGap,
98
+ columnGap = props.columnGap,
99
+ flexShrink = props.flexShrink,
100
+ flexGrow = props.flexGrow,
101
+ flexBasis = props.flexBasis,
102
+ opacity = props.opacity,
103
+ hidden = props.hidden,
104
+ width = props.width,
105
+ height = props.height,
106
+ bgColor = props.bgColor,
107
+ background = props.background,
108
+ _props$style = props.style,
109
+ style = _props$style === void 0 ? {} : _props$style,
110
+ children = props.children,
111
+ margin = props.margin,
112
+ mTop = props.mTop,
113
+ mBottom = props.mBottom,
114
+ mLeft = props.mLeft,
115
+ mRight = props.mRight,
116
+ mHorizontal = props.mHorizontal,
117
+ mVertical = props.mVertical,
118
+ padding = props.padding,
119
+ pTop = props.pTop,
120
+ pBottom = props.pBottom,
121
+ pLeft = props.pLeft,
122
+ pRight = props.pRight,
123
+ pHorizontal = props.pHorizontal,
124
+ pVertical = props.pVertical,
125
+ safeArea = props.safeArea,
126
+ hover = props.hover,
127
+ skeleton = props.skeleton,
128
+ position = props.position,
129
+ zIndex = props.zIndex,
130
+ left = props.left,
131
+ right = props.right,
132
+ top = props.top,
133
+ bottom = props.bottom,
134
+ overflow = props.overflow,
135
+ radius = props.radius,
136
+ border = props.border,
137
+ borderColor = props.borderColor,
138
+ borderWidth = props.borderWidth,
139
+ borderStyle = props.borderStyle,
140
+ rest = _objectWithoutProperties(props, _excluded);
141
+ var viewClass = classNames(className, {
142
+ 'zero-flex': true,
143
+ 'zero-flex-1': flex,
144
+ 'zero-flex-col': column,
145
+ 'zero-flex-row': row,
146
+ 'zero-flex-wrap': wrap,
147
+ 'zero-items-start': alignItems === 'flex-start',
148
+ 'zero-items-end': alignItems === 'flex-end',
149
+ 'zero-items-center': alignItems === 'center',
150
+ 'zero-justify-start': justifyItems === 'flex-start',
151
+ 'zero-justify-end': justifyItems === 'flex-end',
152
+ 'zero-justify-center': justifyItems === 'center',
153
+ 'zero-place-content-around': around === 'content-around',
154
+ 'zero-justify-around': around === 'justify-around',
155
+ 'zero-justify-between': between,
156
+ 'zero-hidden': hidden,
157
+ 'zero-animate-pulse zero-bg-gray-200': skeleton
158
+ });
159
+ var getSafeAreaPadding = function getSafeAreaPadding(type, safeAreaVal, userPadding) {
160
+ var isSafe = safeAreaVal === type || safeAreaVal === 'both';
161
+ if (!isSafe) return px(userPadding);
162
+ return userPadding ? "calc(env(safe-area-inset-".concat(type, ") + ").concat(px(userPadding), ")") : "env(safe-area-inset-".concat(type, ")");
163
+ };
164
+ var hasBorder = border || borderColor !== undefined || borderWidth !== undefined;
165
+ var customStyle = _objectSpread({
166
+ width: px(full ? '100%' : width),
167
+ height: px(full ? '100%' : height),
168
+ backgroundColor: bgColor,
169
+ background: background,
170
+ margin: px(margin),
171
+ marginTop: px(mTop !== null && mTop !== void 0 ? mTop : mVertical),
172
+ marginBottom: px(mBottom !== null && mBottom !== void 0 ? mBottom : mVertical),
173
+ marginLeft: px(mLeft !== null && mLeft !== void 0 ? mLeft : mHorizontal),
174
+ marginRight: px(mRight !== null && mRight !== void 0 ? mRight : mHorizontal),
175
+ padding: px(padding),
176
+ paddingTop: getSafeAreaPadding('top', safeArea, pTop !== null && pTop !== void 0 ? pTop : pVertical),
177
+ paddingBottom: getSafeAreaPadding('bottom', safeArea, pBottom !== null && pBottom !== void 0 ? pBottom : pVertical),
178
+ paddingLeft: px(pLeft !== null && pLeft !== void 0 ? pLeft : pHorizontal),
179
+ paddingRight: px(pRight !== null && pRight !== void 0 ? pRight : pHorizontal),
180
+ position: position,
181
+ zIndex: zIndex,
182
+ left: px(left),
183
+ right: px(right),
184
+ top: px(top),
185
+ bottom: px(bottom),
186
+ overflow: overflow,
187
+ borderRadius: px(radius),
188
+ borderWidth: hasBorder ? px(borderWidth !== null && borderWidth !== void 0 ? borderWidth : 1) : undefined,
189
+ borderStyle: hasBorder ? borderStyle !== null && borderStyle !== void 0 ? borderStyle : 'solid' : undefined,
190
+ borderColor: borderColor,
191
+ gap: px(gap),
192
+ rowGap: px(rowGap),
193
+ columnGap: px(columnGap),
194
+ alignSelf: alignSelf,
195
+ flexShrink: flexShrink,
196
+ flexGrow: flexGrow,
197
+ flexBasis: px(flexBasis),
198
+ opacity: opacity,
199
+ display: hidden ? 'none' : undefined,
200
+ color: skeleton ? 'transparent' : undefined
201
+ }, _typeof(style) === 'object' ? style : {});
202
+ var cleanStyle = {};
203
+ for (var key in customStyle) {
204
+ if (customStyle[key] !== undefined && customStyle[key] !== null) {
205
+ // @ts-ignore
206
+ cleanStyle[key] = customStyle[key];
207
+ }
208
+ }
209
+ return /*#__PURE__*/_jsx(OrigView, _objectSpread(_objectSpread({
210
+ ref: ref,
211
+ className: viewClass,
212
+ style: cleanStyle,
213
+ hoverClass: hover ? 'zero:opacity-70' : 'none',
214
+ hoverStayTime: 200
215
+ }, rest), {}, {
216
+ children: children
217
+ }));
218
+ });
219
+ View.displayName = 'View';
220
+ export default View;
@@ -1 +1,3 @@
1
- function _0x25cb(_0x5a9803,_0x238f58){_0x5a9803=_0x5a9803-0x106;var _0x4baea8=_0x4bae();var _0x25cb1c=_0x4baea8[_0x5a9803];return _0x25cb1c;}function _0x4bae(){var _0x425473=['444yotmfm','694641Ojwwkx','1239084IAkUGN','17070wCIjRT','2296280zHOrKb','1557nMJTbs','1AHwfwN','689270MEQuky','2905176gRiROX','21750SHlcUV'];_0x4bae=function(){return _0x425473;};return _0x4bae();}(function(_0x5f2504,_0x180614){var _0x413117=_0x25cb,_0x4c7ef1=_0x5f2504();while(!![]){try{var _0x37e09d=-parseInt(_0x413117(0x10a))/0x1*(parseInt(_0x413117(0x10b))/0x2)+parseInt(_0x413117(0x10f))/0x3+parseInt(_0x413117(0x106))/0x4+parseInt(_0x413117(0x10d))/0x5*(parseInt(_0x413117(0x10e))/0x6)+parseInt(_0x413117(0x108))/0x7+-parseInt(_0x413117(0x10c))/0x8+parseInt(_0x413117(0x109))/0x9*(-parseInt(_0x413117(0x107))/0xa);if(_0x37e09d===_0x180614)break;else _0x4c7ef1['push'](_0x4c7ef1['shift']());}catch(_0x2a794f){_0x4c7ef1['push'](_0x4c7ef1['shift']());}}}(_0x4bae,0x2df05));export*from'./Permission';export{default as View}from'./View';export{default as Text}from'./Text';
1
+ export * from "./Permission";
2
+ export { default as View } from "./View";
3
+ export { default as Text } from "./Text";
@@ -1 +1,6 @@
1
- (function(_0x428817,_0x16e83c){var _0x42aa99=_0xf67c,_0x48cc99=_0x428817();while(!![]){try{var _0x36a3d4=parseInt(_0x42aa99(0x183))/0x1*(-parseInt(_0x42aa99(0x184))/0x2)+parseInt(_0x42aa99(0x181))/0x3+-parseInt(_0x42aa99(0x182))/0x4+parseInt(_0x42aa99(0x18b))/0x5*(-parseInt(_0x42aa99(0x186))/0x6)+-parseInt(_0x42aa99(0x187))/0x7*(parseInt(_0x42aa99(0x18a))/0x8)+parseInt(_0x42aa99(0x189))/0x9*(-parseInt(_0x42aa99(0x18c))/0xa)+parseInt(_0x42aa99(0x185))/0xb*(parseInt(_0x42aa99(0x188))/0xc);if(_0x36a3d4===_0x16e83c)break;else _0x48cc99['push'](_0x48cc99['shift']());}catch(_0x208ba5){_0x48cc99['push'](_0x48cc99['shift']());}}}(_0x44a3,0x8420b));function _0x44a3(){var _0x48c8b2=['5xyxgAB','61600zaDaGE','2577963GoJWCQ','1571044KIglCl','16561ZmZfcr','98ZRGOME','1375NebBVA','3328014UXtvoF','731563eDNojw','269436gkwJuk','774RBOmyt','64PlIFuU'];_0x44a3=function(){return _0x48c8b2;};return _0x44a3();}function _0xf67c(_0x80b4b5,_0xe12628){_0x80b4b5=_0x80b4b5-0x181;var _0x44a3b3=_0x44a3();var _0xf67c4e=_0x44a3b3[_0x80b4b5];return _0xf67c4e;}import{createContext}from'react';export var PermissionContext=createContext({});
1
+ import { createContext } from 'react';
2
+ /**
3
+ * PermissionContext 使用 object 作为基础泛型约束
4
+ * 消费侧通过 usePermission<P, U>() 收窄为具体的业务类型
5
+ */
6
+ export var PermissionContext = /*#__PURE__*/createContext({});
package/es/hooks/index.js CHANGED
@@ -1 +1,2 @@
1
- function _0x17f9(_0x1df851,_0x4397a0){_0x1df851=_0x1df851-0x75;var _0x4d9e7f=_0x4d9e();var _0x17f92c=_0x4d9e7f[_0x1df851];return _0x17f92c;}(function(_0x4d6cea,_0x2c43b8){var _0x2a127c=_0x17f9,_0x459268=_0x4d6cea();while(!![]){try{var _0x4b546c=-parseInt(_0x2a127c(0x79))/0x1*(-parseInt(_0x2a127c(0x77))/0x2)+parseInt(_0x2a127c(0x7b))/0x3*(parseInt(_0x2a127c(0x76))/0x4)+parseInt(_0x2a127c(0x7c))/0x5+-parseInt(_0x2a127c(0x78))/0x6+-parseInt(_0x2a127c(0x75))/0x7+-parseInt(_0x2a127c(0x7a))/0x8+parseInt(_0x2a127c(0x7d))/0x9;if(_0x4b546c===_0x2c43b8)break;else _0x459268['push'](_0x459268['shift']());}catch(_0x2db91c){_0x459268['push'](_0x459268['shift']());}}}(_0x4d9e,0x88334));function _0x4d9e(){var _0x40d42c=['435380qqqhcK','4016835JOtPeE','2861775Llkczm','16888mfDuGy','163966LmMbML','3294006OYLwEG','13JUrDLx','4450656yVSwEr','336UPWEox'];_0x4d9e=function(){return _0x40d42c;};return _0x4d9e();}export{usePermission}from'./usePermission';export{useWeappUpdate}from'./useWeappUpdate';
1
+ export { usePermission } from "./usePermission";
2
+ export { useWeappUpdate } from "./useWeappUpdate";
@@ -1 +1,18 @@
1
- function _0x1f9e(){var _0x274f04=['21432WAhpKS','12mNacBI','9GpNovt','5CIOdpb','1unyFgE','426528JTajnx','granted','function','497uFGXXC','请确保在\x20App\x20根节点包裹了\x20<PermissionProvider\x20store={...}>','2331730cVoveW','1617664kSHWQY','10689FBtTYG','3647809XenVeg','271090sgHiwH'];_0x1f9e=function(){return _0x274f04;};return _0x1f9e();}(function(_0x3bd127,_0x5797e8){var _0x391638=_0x4caa,_0xac6f69=_0x3bd127();while(!![]){try{var _0x2422b1=parseInt(_0x391638(0xd1))/0x1*(parseInt(_0x391638(0xdb))/0x2)+parseInt(_0x391638(0xd9))/0x3+parseInt(_0x391638(0xd2))/0x4*(-parseInt(_0x391638(0xd0))/0x5)+-parseInt(_0x391638(0xdc))/0x6*(parseInt(_0x391638(0xd5))/0x7)+-parseInt(_0x391638(0xd8))/0x8+parseInt(_0x391638(0xcf))/0x9*(parseInt(_0x391638(0xd7))/0xa)+-parseInt(_0x391638(0xda))/0xb*(-parseInt(_0x391638(0xce))/0xc);if(_0x2422b1===_0x5797e8)break;else _0xac6f69['push'](_0xac6f69['shift']());}catch(_0x75f634){_0xac6f69['push'](_0xac6f69['shift']());}}}(_0x1f9e,0x22888));function _0x4caa(_0x521404,_0x20e816){_0x521404=_0x521404-0xce;var _0x1f9e4d=_0x1f9e();var _0x4caa54=_0x1f9e4d[_0x521404];return _0x4caa54;}import{useContext}from'react';import{PermissionContext}from'../context';export function usePermission(){var _0x13dc42=_0x4caa,_0x21700e=useContext(PermissionContext);if(typeof _0x21700e[_0x13dc42(0xd3)]!==_0x13dc42(0xd4))throw new Error('[zero-bits/taro]\x20usePermission\x20must\x20be\x20used\x20within\x20a\x20<PermissionProvider>.\x0a'+_0x13dc42(0xd6));return _0x21700e;}
1
+ import { useContext } from 'react';
2
+ import { PermissionContext } from "../context";
3
+ /**
4
+ * 在任意子孙组件中获取权限状态与操作方法
5
+ * 必须在 PermissionProvider 内部使用
6
+ *
7
+ * @template P - 权限对象类型
8
+ * @template U - 用户对象类型
9
+ * @returns {PermissionContextValue<P, U>} 权限上下文值
10
+ * @throws {Error} 未包裹 PermissionProvider 时抛出异常
11
+ */
12
+ export function usePermission() {
13
+ var ctx = useContext(PermissionContext);
14
+ if (typeof ctx.granted !== 'function') {
15
+ throw new Error('[zero-bits/taro] usePermission must be used within a <PermissionProvider>.\n' + '请确保在 App 根节点包裹了 <PermissionProvider store={...}>');
16
+ }
17
+ return ctx;
18
+ }
@@ -1 +1,33 @@
1
- (function(_0x1d51fb,_0x249ea2){var _0x21b7b8=_0x430c,_0x35d339=_0x1d51fb();while(!![]){try{var _0x4c7f64=parseInt(_0x21b7b8(0x14a))/0x1+parseInt(_0x21b7b8(0x14b))/0x2*(parseInt(_0x21b7b8(0x145))/0x3)+parseInt(_0x21b7b8(0x144))/0x4*(-parseInt(_0x21b7b8(0x153))/0x5)+parseInt(_0x21b7b8(0x148))/0x6+-parseInt(_0x21b7b8(0x151))/0x7+-parseInt(_0x21b7b8(0x147))/0x8*(parseInt(_0x21b7b8(0x140))/0x9)+parseInt(_0x21b7b8(0x143))/0xa;if(_0x4c7f64===_0x249ea2)break;else _0x35d339['push'](_0x35d339['shift']());}catch(_0x383c62){_0x35d339['push'](_0x35d339['shift']());}}}(_0x3bbb,0x20c88));function _0x430c(_0x19ff46,_0x1582e5){_0x19ff46=_0x19ff46-0x140;var _0x3bbbfc=_0x3bbb();var _0x430c07=_0x3bbbfc[_0x19ff46];return _0x430c07;}import{getUpdateManager,showModal}from'@tarojs/taro';import{useEffect}from'react';function _0x3bbb(){var _0x3d7004=['150930tDSBcw','hasUpdate','3113wRPfsx','2934MfKXsz','onUpdateFailed','更新提示','weapp','applyUpdate','新版本已经准备好,是否重启应用?','956081VPOAyL','confirm','265hQGFwb','18NlqPNZ','onUpdateReady','新版本下载失败,请删除当前小程序,重新搜索打开','3895200rPCcHi','14660zymWGI','318zJqQcL','onCheckForUpdate','432728boQTMp'];_0x3bbb=function(){return _0x3d7004;};return _0x3bbb();}export var useWeappUpdate=function useWeappUpdate(){useEffect(function(){var _0x31bdf2=_0x430c;if(process.env.TARO_ENV!==_0x31bdf2(0x14e))return;var _0x1ae3a9=getUpdateManager();_0x1ae3a9[_0x31bdf2(0x146)](function(_0x24cc62){var _0x47ffa2=_0x31bdf2;_0x24cc62[_0x47ffa2(0x149)]&&_0x1ae3a9[_0x47ffa2(0x141)](function(){var _0x311c5a=_0x47ffa2;showModal({'title':_0x311c5a(0x14d),'content':_0x311c5a(0x150),'showCancel':![],'success':function _0x5ae878(_0x573747){var _0x53d50b=_0x311c5a;if(_0x573747[_0x53d50b(0x152)])_0x1ae3a9[_0x53d50b(0x14f)]();}});});}),_0x1ae3a9[_0x31bdf2(0x14c)](function(){var _0x1f721a=_0x31bdf2;showModal({'title':_0x1f721a(0x14d),'content':_0x1f721a(0x142),'showCancel':![]});});},[]);};
1
+ import { getUpdateManager, showModal } from '@tarojs/taro';
2
+ import { useEffect } from 'react';
3
+
4
+ /**
5
+ * 微信小程序自动更新钩子
6
+ */
7
+ export var useWeappUpdate = function useWeappUpdate() {
8
+ useEffect(function () {
9
+ if (process.env.TARO_ENV !== 'weapp') return;
10
+ var updateManager = getUpdateManager();
11
+ updateManager.onCheckForUpdate(function (res) {
12
+ if (res.hasUpdate) {
13
+ updateManager.onUpdateReady(function () {
14
+ showModal({
15
+ title: '更新提示',
16
+ content: '新版本已经准备好,是否重启应用?',
17
+ showCancel: false,
18
+ success: function success(result) {
19
+ if (result.confirm) updateManager.applyUpdate();
20
+ }
21
+ });
22
+ });
23
+ }
24
+ });
25
+ updateManager.onUpdateFailed(function () {
26
+ showModal({
27
+ title: '更新提示',
28
+ content: '新版本下载失败,请删除当前小程序,重新搜索打开',
29
+ showCancel: false
30
+ });
31
+ });
32
+ }, []);
33
+ };
package/es/index.js CHANGED
@@ -1 +1,3 @@
1
- (function(_0xed6f90,_0x4cf6d7){var _0x4164ff=_0x3bc3,_0x2fca7a=_0xed6f90();while(!![]){try{var _0x28f123=parseInt(_0x4164ff(0xaf))/0x1*(-parseInt(_0x4164ff(0xb1))/0x2)+parseInt(_0x4164ff(0xb4))/0x3+parseInt(_0x4164ff(0xb0))/0x4+parseInt(_0x4164ff(0xb5))/0x5+parseInt(_0x4164ff(0xb2))/0x6+parseInt(_0x4164ff(0xb3))/0x7+parseInt(_0x4164ff(0xb6))/0x8*(-parseInt(_0x4164ff(0xae))/0x9);if(_0x28f123===_0x4cf6d7)break;else _0x2fca7a['push'](_0x2fca7a['shift']());}catch(_0xac6103){_0x2fca7a['push'](_0x2fca7a['shift']());}}}(_0x337b,0x5854b));export{View,Text,PermissionProvider,createPermissionStore}from'./components';function _0x337b(){var _0x327748=['1868360gImwpV','142mnUrZX','2789736KszQaE','5052971NWeWQj','1814907HvKYpV','377820xAEWiL','8jhMzUF','11428839WXaxjW','9898UGkKXy'];_0x337b=function(){return _0x327748;};return _0x337b();}export{usePermission,useWeappUpdate}from'./hooks';function _0x3bc3(_0x2a2f58,_0xc5efaa){_0x2a2f58=_0x2a2f58-0xae;var _0x337b0a=_0x337b();var _0x3bc390=_0x337b0a[_0x2a2f58];return _0x3bc390;}export*from'./types';
1
+ export { View, Text, PermissionProvider, createPermissionStore } from "./components";
2
+ export { usePermission, useWeappUpdate } from "./hooks";
3
+ export * from "./types";
@@ -1,63 +1 @@
1
- /*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */
2
- @layer properties;
3
- .visible {
4
- visibility: visible;
5
- }
6
- .absolute {
7
- position: absolute;
8
- }
9
- .fixed {
10
- position: fixed;
11
- }
12
- .relative {
13
- position: relative;
14
- }
15
- .static {
16
- position: static;
17
- }
18
- .sticky {
19
- position: sticky;
20
- }
21
- .flex {
22
- display: flex;
23
- }
24
- .hidden {
25
- display: none;
26
- }
27
- .flex-shrink {
28
- flex-shrink: 1;
29
- }
30
- .flex-grow {
31
- flex-grow: 1;
32
- }
33
- .flex-wrap {
34
- flex-wrap: wrap;
35
- }
36
- .content-around {
37
- align-content: space-around;
38
- }
39
- .justify-around {
40
- justify-content: space-around;
41
- }
42
- .border {
43
- border-style: var(--tw-border-style);
44
- border-width: 1px;
45
- }
46
- .line-through {
47
- text-decoration-line: line-through;
48
- }
49
- .underline {
50
- text-decoration-line: underline;
51
- }
52
- @property --tw-border-style {
53
- syntax: "*";
54
- inherits: false;
55
- initial-value: solid;
56
- }
57
- @layer properties {
58
- @supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))) {
59
- *, ::before, ::after, ::backdrop {
60
- --tw-border-style: solid;
61
- }
62
- }
63
- }
1
+ @tailwind utilities;
package/es/types/index.js CHANGED
@@ -1 +1 @@
1
- export{};
1
+ export {};
@@ -1 +1,41 @@
1
- 'use strict';var _0x1c809a=_0x1b37;(function(_0x1d81f6,_0x4a6c21){var _0xda970f=_0x1b37,_0x9c01fd=_0x1d81f6();while(!![]){try{var _0x1302c6=parseInt(_0xda970f(0x1a9))/0x1*(parseInt(_0xda970f(0x1b8))/0x2)+parseInt(_0xda970f(0x1b3))/0x3+-parseInt(_0xda970f(0x1ba))/0x4+-parseInt(_0xda970f(0x1b2))/0x5*(-parseInt(_0xda970f(0x1b0))/0x6)+parseInt(_0xda970f(0x1b5))/0x7+parseInt(_0xda970f(0x1bd))/0x8*(-parseInt(_0xda970f(0x1b7))/0x9)+parseInt(_0xda970f(0x1a8))/0xa;if(_0x1302c6===_0x4a6c21)break;else _0x9c01fd['push'](_0x9c01fd['shift']());}catch(_0x221e9b){_0x9c01fd['push'](_0x9c01fd['shift']());}}}(_0x1df1,0x4a115));Object[_0x1c809a(0x1ab)](exports,_0x1c809a(0x1b1),{'value':!![]}),exports[_0x1c809a(0x1bb)]=void 0x0;function _0x1df1(){var _0x2ff072=['subscribe','68922VAsfiO','../../context','776367jSQosW','80404eUqtQW','PermissionContext','1256900GeVXpJ','default','displayName','56SlsNvZ','jsx','useRef','Provider','onDenied','getSnapshot','3982900VyUZnI','8tDJFsh','PermissionProvider','defineProperty','useSyncExternalStore','isGranted','current','store','846378njmdrl','__esModule','5qpJYIw','1051896ZGvxEg'];_0x1df1=function(){return _0x2ff072;};return _0x1df1();}function _0x1b37(_0x3cfe42,_0x57d19a){_0x3cfe42=_0x3cfe42-0x1a7;var _0x1df1e2=_0x1df1();var _0x1b37db=_0x1df1e2[_0x3cfe42];return _0x1b37db;}var _react=require('react'),_context=require(_0x1c809a(0x1b6)),_jsxRuntime=require('react/jsx-runtime');function PermissionProvider(_0x483ab2){var _0xd5b28d=_0x1c809a,_0x35a8fc=_0x483ab2['children'],_0x245efb=_0x483ab2[_0xd5b28d(0x1af)],_0x1cd21d=_0x483ab2[_0xd5b28d(0x1c1)],_0x4b3493=(0x0,_react[_0xd5b28d(0x1ac)])(_0x245efb[_0xd5b28d(0x1b4)],_0x245efb[_0xd5b28d(0x1a7)]),_0x97573f=(0x0,_react[_0xd5b28d(0x1bf)])(_0x4b3493[_0xd5b28d(0x1ad)]);return(0x0,_react['useEffect'])(function(){var _0x585ce2=_0xd5b28d;if(_0x97573f[_0x585ce2(0x1ae)]&&!_0x4b3493[_0x585ce2(0x1ad)])_0x1cd21d===null||_0x1cd21d===void 0x0||_0x1cd21d();_0x97573f['current']=_0x4b3493[_0x585ce2(0x1ad)];},[_0x4b3493[_0xd5b28d(0x1ad)],_0x1cd21d]),(0x0,_jsxRuntime[_0xd5b28d(0x1be)])(_context[_0xd5b28d(0x1b9)][_0xd5b28d(0x1c0)],{'value':_0x4b3493,'children':_0x35a8fc});}PermissionProvider[_0x1c809a(0x1bc)]=_0x1c809a(0x1aa);var _default=exports[_0x1c809a(0x1bb)]=PermissionProvider;
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 _context = require("../../context");
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ /**
11
+ * 权限组件 Provider 的属性
12
+ *
13
+ * @template P - 权限对象类型
14
+ * @template U - 用户对象类型
15
+ */
16
+
17
+ /**
18
+ * 权限组件的入口 Provider,通常包裹在 App 根节点
19
+ *
20
+ * @template P - 权限对象类型
21
+ * @template U - 用户对象类型
22
+ * @param {PermissionProviderProps<P, U>} props - 组件属性
23
+ * @returns {JSX.Element}
24
+ */
25
+ function PermissionProvider(_ref) {
26
+ var children = _ref.children,
27
+ store = _ref.store,
28
+ onDenied = _ref.onDenied;
29
+ var state = (0, _react.useSyncExternalStore)(store.subscribe, store.getSnapshot);
30
+ var prevGrantedRef = (0, _react.useRef)(state.isGranted);
31
+ (0, _react.useEffect)(function () {
32
+ if (prevGrantedRef.current && !state.isGranted) onDenied === null || onDenied === void 0 || onDenied();
33
+ prevGrantedRef.current = state.isGranted;
34
+ }, [state.isGranted, onDenied]);
35
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_context.PermissionContext.Provider, {
36
+ value: state,
37
+ children: children
38
+ });
39
+ }
40
+ PermissionProvider.displayName = 'PermissionProvider';
41
+ var _default = exports.default = PermissionProvider;
@@ -1 +1,20 @@
1
- 'use strict';var _0x5c82cb=_0x2a44;(function(_0x34f78e,_0x1084e5){var _0x4e10f0=_0x2a44,_0x28d6f4=_0x34f78e();while(!![]){try{var _0x426865=-parseInt(_0x4e10f0(0x138))/0x1+-parseInt(_0x4e10f0(0x13b))/0x2*(-parseInt(_0x4e10f0(0x134))/0x3)+parseInt(_0x4e10f0(0x12c))/0x4*(parseInt(_0x4e10f0(0x136))/0x5)+-parseInt(_0x4e10f0(0x133))/0x6*(-parseInt(_0x4e10f0(0x13e))/0x7)+-parseInt(_0x4e10f0(0x135))/0x8*(-parseInt(_0x4e10f0(0x13c))/0x9)+-parseInt(_0x4e10f0(0x13d))/0xa*(-parseInt(_0x4e10f0(0x139))/0xb)+parseInt(_0x4e10f0(0x137))/0xc*(-parseInt(_0x4e10f0(0x12b))/0xd);if(_0x426865===_0x1084e5)break;else _0x28d6f4['push'](_0x28d6f4['shift']());}catch(_0x331ef6){_0x28d6f4['push'](_0x28d6f4['shift']());}}}(_0x2139,0xcfefc));function _0x2a44(_0x40b507,_0x7ee956){_0x40b507=_0x40b507-0x12b;var _0x2139ac=_0x2139();var _0x2a44f9=_0x2139ac[_0x40b507];return _0x2a44f9;}Object[_0x5c82cb(0x12e)](exports,_0x5c82cb(0x130),{'value':!![]}),Object[_0x5c82cb(0x12e)](exports,_0x5c82cb(0x12d),{'enumerable':!![],'get':function get(){var _0xb31b51=_0x5c82cb;return _PermissionProvider[_0xb31b51(0x131)];}}),Object[_0x5c82cb(0x12e)](exports,_0x5c82cb(0x132),{'enumerable':!![],'get':function get(){var _0x739bfc=_0x5c82cb;return _store[_0x739bfc(0x132)];}});var _PermissionProvider=_interopRequireDefault(require(_0x5c82cb(0x12f))),_store=require(_0x5c82cb(0x13a));function _0x2139(){var _0x480334=['8486370JcoaEt','7478128clfONW','7501LNXKSu','1651664OWTCZY','PermissionProvider','defineProperty','./PermissionProvider','__esModule','default','createPermissionStore','6ucfHiD','639tGifQk','46072unwuNT','5aqSDHl','30708sZOOsZ','771312eJYvaI','11pRZDQr','./store','1982YncjUU','873TKtPHk'];_0x2139=function(){return _0x480334;};return _0x2139();}function _interopRequireDefault(_0xb6cfef){return _0xb6cfef&&_0xb6cfef['__esModule']?_0xb6cfef:{'default':_0xb6cfef};}
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ Object.defineProperty(exports, "PermissionProvider", {
7
+ enumerable: true,
8
+ get: function get() {
9
+ return _PermissionProvider.default;
10
+ }
11
+ });
12
+ Object.defineProperty(exports, "createPermissionStore", {
13
+ enumerable: true,
14
+ get: function get() {
15
+ return _store.createPermissionStore;
16
+ }
17
+ });
18
+ var _PermissionProvider = _interopRequireDefault(require("./PermissionProvider"));
19
+ var _store = require("./store");
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }