ht-components-taro-v3 1.0.1 → 1.0.3
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/dist/cjs/index.js +61 -0
- package/dist/esm/index.js +57 -0
- package/package.json +37 -56
- package/.eslintrc +0 -3
- package/babel.config.js +0 -10
- package/componentsDist/index.js +0 -1
- package/project.config.json +0 -13
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var components = require('@tarojs/components');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
|
|
8
|
+
function styleInject(css, ref) {
|
|
9
|
+
if ( ref === void 0 ) ref = {};
|
|
10
|
+
var insertAt = ref.insertAt;
|
|
11
|
+
|
|
12
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
13
|
+
|
|
14
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
15
|
+
var style = document.createElement('style');
|
|
16
|
+
style.type = 'text/css';
|
|
17
|
+
|
|
18
|
+
if (insertAt === 'top') {
|
|
19
|
+
if (head.firstChild) {
|
|
20
|
+
head.insertBefore(style, head.firstChild);
|
|
21
|
+
} else {
|
|
22
|
+
head.appendChild(style);
|
|
23
|
+
}
|
|
24
|
+
} else {
|
|
25
|
+
head.appendChild(style);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
if (style.styleSheet) {
|
|
29
|
+
style.styleSheet.cssText = css;
|
|
30
|
+
} else {
|
|
31
|
+
style.appendChild(document.createTextNode(css));
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
var css_248z = ".taro-ui-btn{border:none;border-radius:8px;font-size:16px;height:48px;line-height:48px}.taro-ui-btn--primary{background:#1677ff;color:#fff}.taro-ui-btn--secondary{background:#f5f5f5;color:#333}.taro-ui-btn--danger{background:#ff4d4f;color:#fff}.taro-ui-btn--default{background:#fff;border:1px solid #e5e5e5;color:#333}.taro-ui-btn{border-radius:6px;cursor:pointer;font-size:14px}.taro-ui-btn:hover{opacity:.9}.taro-ui-btn__icon{background:url(icon.png);display:inline-block;height:12px;margin-left:4px;width:12px}";
|
|
36
|
+
styleInject(css_248z);
|
|
37
|
+
|
|
38
|
+
var TaroButton = function TaroButton(props) {
|
|
39
|
+
var _props$text = props.text,
|
|
40
|
+
text = _props$text === void 0 ? '按钮' : _props$text,
|
|
41
|
+
_props$type = props.type,
|
|
42
|
+
type = _props$type === void 0 ? 'default' : _props$type,
|
|
43
|
+
_props$onClick = props.onClick,
|
|
44
|
+
onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
45
|
+
_props$disabled = props.disabled,
|
|
46
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
47
|
+
|
|
48
|
+
// 组合类名(样式隔离 + 多端适配)
|
|
49
|
+
var btnClass = "taro-ui-btn taro-ui-btn--".concat(type);
|
|
50
|
+
return /*#__PURE__*/jsxRuntime.jsxs(components.Button, {
|
|
51
|
+
className: btnClass,
|
|
52
|
+
disabled: disabled,
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
size: "default",
|
|
55
|
+
children: [text, /*#__PURE__*/jsxRuntime.jsx("i", {
|
|
56
|
+
className: "taro-ui-btn__icon"
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
exports.TaroButton = TaroButton;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Button } from '@tarojs/components';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
|
|
4
|
+
function styleInject(css, ref) {
|
|
5
|
+
if ( ref === void 0 ) ref = {};
|
|
6
|
+
var insertAt = ref.insertAt;
|
|
7
|
+
|
|
8
|
+
if (!css || typeof document === 'undefined') { return; }
|
|
9
|
+
|
|
10
|
+
var head = document.head || document.getElementsByTagName('head')[0];
|
|
11
|
+
var style = document.createElement('style');
|
|
12
|
+
style.type = 'text/css';
|
|
13
|
+
|
|
14
|
+
if (insertAt === 'top') {
|
|
15
|
+
if (head.firstChild) {
|
|
16
|
+
head.insertBefore(style, head.firstChild);
|
|
17
|
+
} else {
|
|
18
|
+
head.appendChild(style);
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
head.appendChild(style);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
if (style.styleSheet) {
|
|
25
|
+
style.styleSheet.cssText = css;
|
|
26
|
+
} else {
|
|
27
|
+
style.appendChild(document.createTextNode(css));
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
var css_248z = ".taro-ui-btn{border:none;border-radius:8px;font-size:16px;height:48px;line-height:48px}.taro-ui-btn--primary{background:#1677ff;color:#fff}.taro-ui-btn--secondary{background:#f5f5f5;color:#333}.taro-ui-btn--danger{background:#ff4d4f;color:#fff}.taro-ui-btn--default{background:#fff;border:1px solid #e5e5e5;color:#333}.taro-ui-btn{border-radius:6px;cursor:pointer;font-size:14px}.taro-ui-btn:hover{opacity:.9}.taro-ui-btn__icon{background:url(icon.png);display:inline-block;height:12px;margin-left:4px;width:12px}";
|
|
32
|
+
styleInject(css_248z);
|
|
33
|
+
|
|
34
|
+
var TaroButton = function TaroButton(props) {
|
|
35
|
+
var _props$text = props.text,
|
|
36
|
+
text = _props$text === void 0 ? '按钮' : _props$text,
|
|
37
|
+
_props$type = props.type,
|
|
38
|
+
type = _props$type === void 0 ? 'default' : _props$type,
|
|
39
|
+
_props$onClick = props.onClick,
|
|
40
|
+
onClick = _props$onClick === void 0 ? function () {} : _props$onClick,
|
|
41
|
+
_props$disabled = props.disabled,
|
|
42
|
+
disabled = _props$disabled === void 0 ? false : _props$disabled;
|
|
43
|
+
|
|
44
|
+
// 组合类名(样式隔离 + 多端适配)
|
|
45
|
+
var btnClass = "taro-ui-btn taro-ui-btn--".concat(type);
|
|
46
|
+
return /*#__PURE__*/jsxs(Button, {
|
|
47
|
+
className: btnClass,
|
|
48
|
+
disabled: disabled,
|
|
49
|
+
onClick: onClick,
|
|
50
|
+
size: "default",
|
|
51
|
+
children: [text, /*#__PURE__*/jsx("i", {
|
|
52
|
+
className: "taro-ui-btn__icon"
|
|
53
|
+
})]
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export { TaroButton };
|
package/package.json
CHANGED
|
@@ -1,66 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ht-components-taro-v3",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "",
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
"
|
|
9
|
-
|
|
3
|
+
"version": "1.0.3",
|
|
4
|
+
"description": "基于 Rollup 构建的 Taro 多端组件库",
|
|
5
|
+
"main": "dist/cjs/index.js",
|
|
6
|
+
"module": "dist/esm/index.js",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"build
|
|
12
|
-
"
|
|
13
|
-
"build:swan": "taro build --type swan",
|
|
14
|
-
"build:alipay": "taro build --type alipay",
|
|
15
|
-
"build:tt": "taro build --type tt",
|
|
16
|
-
"build:h5": "taro build --type h5",
|
|
17
|
-
"build:rn": "taro build --type rn",
|
|
18
|
-
"build:qq": "taro build --type qq",
|
|
19
|
-
"build:jd": "taro build --type jd",
|
|
20
|
-
"build:quickapp": "taro build --type quickapp",
|
|
21
|
-
"dev:weapp": "npm run build:weapp -- --watch",
|
|
22
|
-
"dev:swan": "npm run build:swan -- --watch",
|
|
23
|
-
"dev:alipay": "npm run build:alipay -- --watch",
|
|
24
|
-
"dev:tt": "npm run build:tt -- --watch",
|
|
25
|
-
"dev:h5": "npm run build:h5 -- --watch",
|
|
26
|
-
"dev:rn": "npm run build:rn -- --watch",
|
|
27
|
-
"dev:qq": "npm run build:qq -- --watch",
|
|
28
|
-
"dev:jd": "npm run build:jd -- --watch",
|
|
29
|
-
"dev:quickapp": "npm run build:quickapp -- --watch"
|
|
11
|
+
"build": "rollup -c",
|
|
12
|
+
"prepublishOnly": "npm run build"
|
|
30
13
|
},
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"Android >= 4.1",
|
|
34
|
-
"ios >= 8"
|
|
35
|
-
],
|
|
36
|
-
"author": "",
|
|
37
|
-
"dependencies": {
|
|
38
|
-
"@babel/runtime": "^7.7.7",
|
|
14
|
+
"peerDependencies": {
|
|
15
|
+
"@tarojs/taro": "3.0.17",
|
|
39
16
|
"@tarojs/components": "3.0.17",
|
|
40
17
|
"@tarojs/react": "3.0.17",
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"@tarojs/taro-loader": "^3.0.17",
|
|
44
|
-
"css-loader": "^7.1.2",
|
|
45
|
-
"less-loader": "^12.3.0",
|
|
46
|
-
"mini-css-extract-plugin": "^2.9.4",
|
|
47
|
-
"react": "^16.10.0",
|
|
48
|
-
"react-dom": "^16.10.0",
|
|
49
|
-
"webpack": "^5.104.1",
|
|
50
|
-
"webpack-cli": "^6.0.1"
|
|
18
|
+
"react": "16.10.0",
|
|
19
|
+
"react-dom": "16.10.0"
|
|
51
20
|
},
|
|
52
21
|
"devDependencies": {
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@
|
|
56
|
-
"@babel/
|
|
57
|
-
"@
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
22
|
+
"@babel/core": "^7.20.0",
|
|
23
|
+
"@babel/plugin-transform-runtime": "^7.28.5",
|
|
24
|
+
"@babel/preset-env": "^7.20.0",
|
|
25
|
+
"@babel/preset-react": "^7.18.6",
|
|
26
|
+
"@rollup/plugin-babel": "^5.3.1",
|
|
27
|
+
"@rollup/plugin-commonjs": "^24.0.1",
|
|
28
|
+
"@rollup/plugin-node-resolve": "^15.0.1",
|
|
29
|
+
"core-js": "^3.26.0",
|
|
30
|
+
"postcss": "^8.4.31",
|
|
31
|
+
"rollup": "^2.79.1",
|
|
32
|
+
"rollup-plugin-postcss": "^4.0.2",
|
|
33
|
+
"sass": "^1.56.1"
|
|
34
|
+
},
|
|
35
|
+
"keywords": [
|
|
36
|
+
"taro",
|
|
37
|
+
"rollup",
|
|
38
|
+
"组件库",
|
|
39
|
+
"小程序",
|
|
40
|
+
"H5"
|
|
41
|
+
],
|
|
42
|
+
"author": "",
|
|
43
|
+
"license": "MIT",
|
|
44
|
+
"dependencies": {
|
|
45
|
+
"@babel/runtime": "^7.20.0"
|
|
65
46
|
}
|
|
66
47
|
}
|
package/.eslintrc
DELETED
package/babel.config.js
DELETED
package/componentsDist/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("@tarojs/runtime"),require("react"),require("react-dom"));else if("function"==typeof define&&define.amd)define(["@tarojs/runtime","react","react-dom"],r);else{var t="object"==typeof exports?r(require("@tarojs/runtime"),require("react"),require("react-dom")):r(e["@tarojs/runtime"],e.react,e["react-dom"]);for(var o in t)("object"==typeof exports?exports:e)[o]=t[o]}}(self,function(e,r,t){return function(){"use strict";var o={155:function(e){e.exports=r},320:function(r){r.exports=e},338:function(e,r,t){t.r(r);var o=t(320),n=t(338),u=t(155),i=t(514),f=t.n(i),c=void 0;o.window.__taroAppConfig=c,App((0,o.createReactApp)(n.default,u,f(),c))},514:function(e){e.exports=t}},n={};function u(e){var r=n[e];if(void 0!==r)return r.exports;var t=n[e]={exports:{}};return o[e](t,t.exports,u),t.exports}return u.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return u.d(r,{a:r}),r},u.d=function(e,r){for(var t in r)u.o(r,t)&&!u.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},u.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},u.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},u(338)}()});
|
package/project.config.json
DELETED