feat: 顺利打包并上传es与lib
This commit is contained in:
parent
72ba7bcc83
commit
d36518078d
4
.gitignore
vendored
4
.gitignore
vendored
@ -7,8 +7,8 @@ node_modules
|
||||
/docs-dist
|
||||
vueuse
|
||||
/temp
|
||||
packages/**/es
|
||||
packages/**/lib
|
||||
# packages/**/es
|
||||
# packages/**/lib
|
||||
/es
|
||||
/lib
|
||||
pnpm-lock.yaml
|
||||
|
16
packages/icon/es/Iconfont.d.ts
vendored
Normal file
16
packages/icon/es/Iconfont.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
interface IconFontProps {
|
||||
styles?: React.CSSProperties;
|
||||
icon: string;
|
||||
size?: number;
|
||||
color?: string;
|
||||
title?: string;
|
||||
className?: string;
|
||||
onIconClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
children?: ReactNode;
|
||||
active?: boolean;
|
||||
disable?: boolean;
|
||||
}
|
||||
declare const IconFont: React.FC<IconFontProps>;
|
||||
export default IconFont;
|
42
packages/icon/es/Iconfont.js
Normal file
42
packages/icon/es/Iconfont.js
Normal file
@ -0,0 +1,42 @@
|
||||
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); }
|
||||
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; }
|
||||
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; }
|
||||
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; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
||||
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); }
|
||||
import { createFromIconfontCN } from '@ant-design/icons';
|
||||
import React from 'react';
|
||||
var Icon = createFromIconfontCN({
|
||||
scriptUrl: require("./font_1739270_pqkfa2ldec/iconfont.js")
|
||||
});
|
||||
var IconFont = function IconFont(props) {
|
||||
var _ref = props || {},
|
||||
_ref$title = _ref.title,
|
||||
title = _ref$title === void 0 ? '' : _ref$title,
|
||||
_ref$styles = _ref.styles,
|
||||
styles = _ref$styles === void 0 ? {} : _ref$styles,
|
||||
icon = _ref.icon,
|
||||
_ref$size = _ref.size,
|
||||
size = _ref$size === void 0 ? 14 : _ref$size,
|
||||
onIconClick = _ref.onIconClick,
|
||||
children = _ref.children,
|
||||
_ref$active = _ref.active,
|
||||
active = _ref$active === void 0 ? false : _ref$active,
|
||||
_ref$color = _ref.color,
|
||||
color = _ref$color === void 0 ? '' : _ref$color;
|
||||
return /*#__PURE__*/React.createElement(Icon, {
|
||||
title: title,
|
||||
onClick: function onClick(e) {
|
||||
onIconClick && onIconClick(e);
|
||||
},
|
||||
style: _objectSpread(_objectSpread({}, styles), {}, {
|
||||
cursor: 'pointer',
|
||||
fontSize: size,
|
||||
color: color
|
||||
}, active ? {
|
||||
color: '#09f'
|
||||
} : {}),
|
||||
type: icon
|
||||
}, children);
|
||||
};
|
||||
export default IconFont;
|
3
packages/icon/es/demo/basic.d.ts
vendored
Normal file
3
packages/icon/es/demo/basic.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const demo: () => React.JSX.Element;
|
||||
export default demo;
|
8
packages/icon/es/demo/basic.js
Normal file
8
packages/icon/es/demo/basic.js
Normal file
@ -0,0 +1,8 @@
|
||||
import React from 'react';
|
||||
import { IconFont } from '@zhst/icon';
|
||||
var demo = function demo() {
|
||||
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(IconFont, {
|
||||
icon: "icon-daoru1"
|
||||
}));
|
||||
};
|
||||
export default demo;
|
1743
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.css
Normal file
1743
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.css
Normal file
File diff suppressed because it is too large
Load Diff
1
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.js
Normal file
1
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.js
Normal file
File diff suppressed because one or more lines are too long
3033
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.json
Normal file
3033
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.ttf
Normal file
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.ttf
Normal file
Binary file not shown.
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.woff
Normal file
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.woff
Normal file
Binary file not shown.
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.woff2
Normal file
BIN
packages/icon/es/font_1739270_pqkfa2ldec/iconfont.woff2
Normal file
Binary file not shown.
1
packages/icon/es/index.d.ts
vendored
Normal file
1
packages/icon/es/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { default as IconFont } from './Iconfont';
|
1
packages/icon/es/index.js
Normal file
1
packages/icon/es/index.js
Normal file
@ -0,0 +1 @@
|
||||
export { default as IconFont } from "./Iconfont";
|
3
packages/icon/es/index.less
Normal file
3
packages/icon/es/index.less
Normal file
@ -0,0 +1,3 @@
|
||||
.icon:hover {
|
||||
color: #6accca !important;
|
||||
}
|
16
packages/icon/lib/Iconfont.d.ts
vendored
Normal file
16
packages/icon/lib/Iconfont.d.ts
vendored
Normal file
@ -0,0 +1,16 @@
|
||||
import React from 'react';
|
||||
import { ReactNode } from 'react';
|
||||
interface IconFontProps {
|
||||
styles?: React.CSSProperties;
|
||||
icon: string;
|
||||
size?: number;
|
||||
color?: string;
|
||||
title?: string;
|
||||
className?: string;
|
||||
onIconClick?: (e: React.MouseEvent<HTMLElement, MouseEvent>) => void;
|
||||
children?: ReactNode;
|
||||
active?: boolean;
|
||||
disable?: boolean;
|
||||
}
|
||||
declare const IconFont: React.FC<IconFontProps>;
|
||||
export default IconFont;
|
70
packages/icon/lib/Iconfont.js
Normal file
70
packages/icon/lib/Iconfont.js
Normal file
@ -0,0 +1,70 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/Iconfont.tsx
|
||||
var Iconfont_exports = {};
|
||||
__export(Iconfont_exports, {
|
||||
default: () => Iconfont_default
|
||||
});
|
||||
module.exports = __toCommonJS(Iconfont_exports);
|
||||
var import_icons = require("@ant-design/icons");
|
||||
var import_react = __toESM(require("react"));
|
||||
var Icon = (0, import_icons.createFromIconfontCN)({
|
||||
scriptUrl: require("./font_1739270_pqkfa2ldec/iconfont.js")
|
||||
});
|
||||
var IconFont = (props) => {
|
||||
const {
|
||||
title = "",
|
||||
styles = {},
|
||||
icon,
|
||||
size = 14,
|
||||
onIconClick,
|
||||
children,
|
||||
active = false,
|
||||
color = ""
|
||||
} = props || {};
|
||||
return /* @__PURE__ */ import_react.default.createElement(
|
||||
Icon,
|
||||
{
|
||||
title,
|
||||
onClick: (e) => {
|
||||
onIconClick && onIconClick(e);
|
||||
},
|
||||
style: {
|
||||
...styles,
|
||||
cursor: "pointer",
|
||||
fontSize: size,
|
||||
color,
|
||||
...active ? { color: "#09f" } : {}
|
||||
},
|
||||
type: icon
|
||||
},
|
||||
children
|
||||
);
|
||||
};
|
||||
var Iconfont_default = IconFont;
|
3
packages/icon/lib/demo/basic.d.ts
vendored
Normal file
3
packages/icon/lib/demo/basic.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import React from 'react';
|
||||
declare const demo: () => React.JSX.Element;
|
||||
export default demo;
|
40
packages/icon/lib/demo/basic.js
Normal file
40
packages/icon/lib/demo/basic.js
Normal file
@ -0,0 +1,40 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/demo/basic.tsx
|
||||
var basic_exports = {};
|
||||
__export(basic_exports, {
|
||||
default: () => basic_default
|
||||
});
|
||||
module.exports = __toCommonJS(basic_exports);
|
||||
var import_react = __toESM(require("react"));
|
||||
var import_icon = require("@zhst/icon");
|
||||
var demo = () => {
|
||||
return /* @__PURE__ */ import_react.default.createElement("div", null, /* @__PURE__ */ import_react.default.createElement(import_icon.IconFont, { icon: "icon-daoru1" }));
|
||||
};
|
||||
var basic_default = demo;
|
1743
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.css
Normal file
1743
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.css
Normal file
File diff suppressed because it is too large
Load Diff
36
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.js
Normal file
36
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.js
Normal file
File diff suppressed because one or more lines are too long
3033
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.json
Normal file
3033
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.ttf
Normal file
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.ttf
Normal file
Binary file not shown.
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.woff
Normal file
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.woff
Normal file
Binary file not shown.
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.woff2
Normal file
BIN
packages/icon/lib/font_1739270_pqkfa2ldec/iconfont.woff2
Normal file
Binary file not shown.
1
packages/icon/lib/index.d.ts
vendored
Normal file
1
packages/icon/lib/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export { default as IconFont } from './Iconfont';
|
39
packages/icon/lib/index.js
Normal file
39
packages/icon/lib/index.js
Normal file
@ -0,0 +1,39 @@
|
||||
var __create = Object.create;
|
||||
var __defProp = Object.defineProperty;
|
||||
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
||||
var __getOwnPropNames = Object.getOwnPropertyNames;
|
||||
var __getProtoOf = Object.getPrototypeOf;
|
||||
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
||||
var __export = (target, all) => {
|
||||
for (var name in all)
|
||||
__defProp(target, name, { get: all[name], enumerable: true });
|
||||
};
|
||||
var __copyProps = (to, from, except, desc) => {
|
||||
if (from && typeof from === "object" || typeof from === "function") {
|
||||
for (let key of __getOwnPropNames(from))
|
||||
if (!__hasOwnProp.call(to, key) && key !== except)
|
||||
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
||||
}
|
||||
return to;
|
||||
};
|
||||
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
||||
// If the importer is in node compatibility mode or this is not an ESM
|
||||
// file that has been converted to a CommonJS file using a Babel-
|
||||
// compatible transform (i.e. "__esModule" has not been set), then set
|
||||
// "default" to the CommonJS "module.exports" for node compatibility.
|
||||
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
||||
mod
|
||||
));
|
||||
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
||||
|
||||
// src/index.ts
|
||||
var src_exports = {};
|
||||
__export(src_exports, {
|
||||
IconFont: () => import_Iconfont.default
|
||||
});
|
||||
module.exports = __toCommonJS(src_exports);
|
||||
var import_Iconfont = __toESM(require("./Iconfont"));
|
||||
// Annotate the CommonJS export names for ESM import in node:
|
||||
0 && (module.exports = {
|
||||
IconFont
|
||||
});
|
3
packages/icon/lib/index.less
Normal file
3
packages/icon/lib/index.less
Normal file
@ -0,0 +1,3 @@
|
||||
.icon:hover {
|
||||
color: #6accca !important;
|
||||
}
|
@ -4,7 +4,7 @@ import { ReactNode } from 'react';
|
||||
|
||||
interface IconFontProps {
|
||||
styles?: React.CSSProperties;
|
||||
icon?: string;
|
||||
icon: string;
|
||||
size?: number;
|
||||
color?: string;
|
||||
title?: string;
|
||||
|
Loading…
Reference in New Issue
Block a user