@ray-js/smart-ui 2.10.1-beta-1 → 2.10.1-beta-2
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/popup/Popup.d.ts +5 -2
- package/es/popup/Popup.js +25 -2
- package/es/tabs/Tabs.d.ts +2 -3
- package/es/tabs/Tabs.js +4 -4
- package/lib/popup/Popup.d.ts +5 -2
- package/lib/popup/Popup.js +36 -1
- package/lib/tabs/Tabs.d.ts +2 -3
- package/lib/tabs/Tabs.js +3 -2
- package/package.json +2 -2
package/es/popup/Popup.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export default function Popup({ children, show, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
children: any;
|
|
4
|
+
show: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/es/popup/Popup.js
CHANGED
|
@@ -1,4 +1,27 @@
|
|
|
1
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
+
var t = {};
|
|
3
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
+
t[p] = s[p];
|
|
5
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
+
t[p[i]] = s[p[i]];
|
|
9
|
+
}
|
|
10
|
+
return t;
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
1
13
|
// @ts-ignore
|
|
2
|
-
import
|
|
14
|
+
import PopupMini from '@tuya-miniapp/smart-ui/dist/popup/index';
|
|
15
|
+
import { useEffect, useState } from 'react';
|
|
3
16
|
import { withReactProps } from '../common/withReactProps';
|
|
4
|
-
|
|
17
|
+
const PopupComp = withReactProps(PopupMini);
|
|
18
|
+
export default function Popup(_a) {
|
|
19
|
+
var { children, show } = _a, rest = __rest(_a, ["children", "show"]);
|
|
20
|
+
const [init, setInit] = useState(show);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
if (!show)
|
|
23
|
+
return;
|
|
24
|
+
setInit(show);
|
|
25
|
+
}, [show]);
|
|
26
|
+
return (_jsx(PopupComp, Object.assign({ show: show }, rest, { children: init && children })));
|
|
27
|
+
}
|
package/es/tabs/Tabs.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export default function Tabs({ children, inactiveDestroy, active, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
inactiveDestroy?: boolean;
|
|
5
5
|
active: any;
|
|
6
|
-
})
|
|
7
|
-
export default _default;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/es/tabs/Tabs.js
CHANGED
|
@@ -11,11 +11,11 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
// @ts-ignore
|
|
14
|
-
import
|
|
14
|
+
import TabsMini from '@tuya-miniapp/smart-ui/dist/tabs/index';
|
|
15
15
|
import { cloneElement, Children } from 'react';
|
|
16
16
|
import { withReactProps } from '../common/withReactProps';
|
|
17
|
-
const TabsComp = withReactProps(
|
|
18
|
-
export default (_a)
|
|
17
|
+
const TabsComp = withReactProps(TabsMini);
|
|
18
|
+
export default function Tabs(_a) {
|
|
19
19
|
var { children, inactiveDestroy = false, active } = _a, rest = __rest(_a, ["children", "inactiveDestroy", "active"]);
|
|
20
20
|
return (_jsx(TabsComp, Object.assign({}, rest, { inactiveDestroy: inactiveDestroy, active: active }, { children: children &&
|
|
21
21
|
Children.map(children, (child, index) => {
|
|
@@ -24,4 +24,4 @@ export default (_a) => {
|
|
|
24
24
|
isActive: inactiveDestroy ? active === ((_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : index) : true,
|
|
25
25
|
});
|
|
26
26
|
}) })));
|
|
27
|
-
}
|
|
27
|
+
}
|
package/lib/popup/Popup.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
export default function Popup({ children, show, ...rest }: {
|
|
2
|
+
[x: string]: any;
|
|
3
|
+
children: any;
|
|
4
|
+
show: any;
|
|
5
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/lib/popup/Popup.js
CHANGED
|
@@ -1,9 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
14
|
+
var t = {};
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
18
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
19
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
20
|
+
t[p[i]] = s[p[i]];
|
|
21
|
+
}
|
|
22
|
+
return t;
|
|
23
|
+
};
|
|
2
24
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
25
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
26
|
};
|
|
5
27
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
var jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
29
|
// @ts-ignore
|
|
7
30
|
var index_1 = __importDefault(require("@tuya-miniapp/smart-ui/dist/popup/index"));
|
|
31
|
+
var react_1 = require("react");
|
|
8
32
|
var withReactProps_1 = require("../common/withReactProps");
|
|
9
|
-
|
|
33
|
+
var PopupComp = (0, withReactProps_1.withReactProps)(index_1.default);
|
|
34
|
+
function Popup(_a) {
|
|
35
|
+
var children = _a.children, show = _a.show, rest = __rest(_a, ["children", "show"]);
|
|
36
|
+
var _b = (0, react_1.useState)(show), init = _b[0], setInit = _b[1];
|
|
37
|
+
(0, react_1.useEffect)(function () {
|
|
38
|
+
if (!show)
|
|
39
|
+
return;
|
|
40
|
+
setInit(show);
|
|
41
|
+
}, [show]);
|
|
42
|
+
return ((0, jsx_runtime_1.jsx)(PopupComp, __assign({ show: show }, rest, { children: init && children })));
|
|
43
|
+
}
|
|
44
|
+
exports.default = Popup;
|
package/lib/tabs/Tabs.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
export default function Tabs({ children, inactiveDestroy, active, ...rest }: {
|
|
2
2
|
[x: string]: any;
|
|
3
3
|
children: any;
|
|
4
4
|
inactiveDestroy?: boolean;
|
|
5
5
|
active: any;
|
|
6
|
-
})
|
|
7
|
-
export default _default;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
package/lib/tabs/Tabs.js
CHANGED
|
@@ -31,7 +31,7 @@ var index_1 = __importDefault(require("@tuya-miniapp/smart-ui/dist/tabs/index"))
|
|
|
31
31
|
var react_1 = require("react");
|
|
32
32
|
var withReactProps_1 = require("../common/withReactProps");
|
|
33
33
|
var TabsComp = (0, withReactProps_1.withReactProps)(index_1.default);
|
|
34
|
-
|
|
34
|
+
function Tabs(_a) {
|
|
35
35
|
var children = _a.children, _b = _a.inactiveDestroy, inactiveDestroy = _b === void 0 ? false : _b, active = _a.active, rest = __rest(_a, ["children", "inactiveDestroy", "active"]);
|
|
36
36
|
return ((0, jsx_runtime_1.jsx)(TabsComp, __assign({}, rest, { inactiveDestroy: inactiveDestroy, active: active }, { children: children &&
|
|
37
37
|
react_1.Children.map(children, function (child, index) {
|
|
@@ -40,4 +40,5 @@ exports.default = (function (_a) {
|
|
|
40
40
|
isActive: inactiveDestroy ? active === ((_b = (_a = child.props) === null || _a === void 0 ? void 0 : _a.name) !== null && _b !== void 0 ? _b : index) : true,
|
|
41
41
|
});
|
|
42
42
|
}) })));
|
|
43
|
-
}
|
|
43
|
+
}
|
|
44
|
+
exports.default = Tabs;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ray-js/smart-ui",
|
|
3
|
-
"version": "2.10.1-beta-
|
|
3
|
+
"version": "2.10.1-beta-2",
|
|
4
4
|
"description": "轻量、可靠的智能小程序 UI 组件库",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"syncMiniappData": "node ./build/syncMiniappData.js",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
44
|
"@ray-js/components-ty-slider": "^0.3.8",
|
|
45
|
-
"@tuya-miniapp/smart-ui": "2.10.1-beta-
|
|
45
|
+
"@tuya-miniapp/smart-ui": "2.10.1-beta-2",
|
|
46
46
|
"lodash-es": "^4.17.21"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|