@xfe-repo/web-components 1.0.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/README.md ADDED
@@ -0,0 +1,3 @@
1
+ # `@xfe-repo/web-components`
2
+
3
+ web组件库
package/dist/index.css ADDED
@@ -0,0 +1,4 @@
1
+ /* src/Loading/index.module.less */
2
+ .index_module_loading {
3
+ display: block;
4
+ }
@@ -0,0 +1,10 @@
1
+ import { PureComponent } from 'react';
2
+
3
+ type Props = {
4
+ loading: boolean;
5
+ };
6
+ declare class Loading extends PureComponent<Props> {
7
+ render(): JSX.Element | null;
8
+ }
9
+
10
+ export { Loading };
@@ -0,0 +1,10 @@
1
+ import { PureComponent } from 'react';
2
+
3
+ type Props = {
4
+ loading: boolean;
5
+ };
6
+ declare class Loading extends PureComponent<Props> {
7
+ render(): JSX.Element | null;
8
+ }
9
+
10
+ export { Loading };
package/dist/index.js ADDED
@@ -0,0 +1,180 @@
1
+ "use strict";
2
+ function _assert_this_initialized(self) {
3
+ if (self === void 0) {
4
+ throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5
+ }
6
+ return self;
7
+ }
8
+ function _class_call_check(instance, Constructor) {
9
+ if (!(instance instanceof Constructor)) {
10
+ throw new TypeError("Cannot call a class as a function");
11
+ }
12
+ }
13
+ function _defineProperties(target, props) {
14
+ for(var i = 0; i < props.length; i++){
15
+ var descriptor = props[i];
16
+ descriptor.enumerable = descriptor.enumerable || false;
17
+ descriptor.configurable = true;
18
+ if ("value" in descriptor) descriptor.writable = true;
19
+ Object.defineProperty(target, descriptor.key, descriptor);
20
+ }
21
+ }
22
+ function _create_class(Constructor, protoProps, staticProps) {
23
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
24
+ if (staticProps) _defineProperties(Constructor, staticProps);
25
+ return Constructor;
26
+ }
27
+ function _get_prototype_of(o) {
28
+ _get_prototype_of = Object.setPrototypeOf ? Object.getPrototypeOf : function getPrototypeOf(o) {
29
+ return o.__proto__ || Object.getPrototypeOf(o);
30
+ };
31
+ return _get_prototype_of(o);
32
+ }
33
+ function _inherits(subClass, superClass) {
34
+ if (typeof superClass !== "function" && superClass !== null) {
35
+ throw new TypeError("Super expression must either be null or a function");
36
+ }
37
+ subClass.prototype = Object.create(superClass && superClass.prototype, {
38
+ constructor: {
39
+ value: subClass,
40
+ writable: true,
41
+ configurable: true
42
+ }
43
+ });
44
+ if (superClass) _set_prototype_of(subClass, superClass);
45
+ }
46
+ function _possible_constructor_return(self, call) {
47
+ if (call && (_type_of(call) === "object" || typeof call === "function")) {
48
+ return call;
49
+ }
50
+ return _assert_this_initialized(self);
51
+ }
52
+ function _set_prototype_of(o, p) {
53
+ _set_prototype_of = Object.setPrototypeOf || function setPrototypeOf(o, p) {
54
+ o.__proto__ = p;
55
+ return o;
56
+ };
57
+ return _set_prototype_of(o, p);
58
+ }
59
+ function _type_of(obj) {
60
+ "@swc/helpers - typeof";
61
+ return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
62
+ }
63
+ function _is_native_reflect_construct() {
64
+ if (typeof Reflect === "undefined" || !Reflect.construct) return false;
65
+ if (Reflect.construct.sham) return false;
66
+ if (typeof Proxy === "function") return true;
67
+ try {
68
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
69
+ return true;
70
+ } catch (e) {
71
+ return false;
72
+ }
73
+ }
74
+ function _create_super(Derived) {
75
+ var hasNativeReflectConstruct = _is_native_reflect_construct();
76
+ return function _createSuperInternal() {
77
+ var Super = _get_prototype_of(Derived), result;
78
+ if (hasNativeReflectConstruct) {
79
+ var NewTarget = _get_prototype_of(this).constructor;
80
+ result = Reflect.construct(Super, arguments, NewTarget);
81
+ } else {
82
+ result = Super.apply(this, arguments);
83
+ }
84
+ return _possible_constructor_return(this, result);
85
+ };
86
+ }
87
+ var __defProp = Object.defineProperty;
88
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
89
+ var __getOwnPropNames = Object.getOwnPropertyNames;
90
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
91
+ var __export = function(target, all) {
92
+ for(var name in all)__defProp(target, name, {
93
+ get: all[name],
94
+ enumerable: true
95
+ });
96
+ };
97
+ var __copyProps = function(to, from, except, desc) {
98
+ if (from && typeof from === "object" || typeof from === "function") {
99
+ var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
100
+ try {
101
+ var _loop = function() {
102
+ var key = _step.value;
103
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
104
+ get: function() {
105
+ return from[key];
106
+ },
107
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
108
+ });
109
+ };
110
+ for(var _iterator = __getOwnPropNames(from)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)_loop();
111
+ } catch (err) {
112
+ _didIteratorError = true;
113
+ _iteratorError = err;
114
+ } finally{
115
+ try {
116
+ if (!_iteratorNormalCompletion && _iterator.return != null) {
117
+ _iterator.return();
118
+ }
119
+ } finally{
120
+ if (_didIteratorError) {
121
+ throw _iteratorError;
122
+ }
123
+ }
124
+ }
125
+ }
126
+ return to;
127
+ };
128
+ var __toCommonJS = function(mod) {
129
+ return __copyProps(__defProp({}, "__esModule", {
130
+ value: true
131
+ }), mod);
132
+ };
133
+ // src/index.ts
134
+ var src_exports = {};
135
+ __export(src_exports, {
136
+ Loading: function() {
137
+ return Loading_default;
138
+ }
139
+ });
140
+ module.exports = __toCommonJS(src_exports);
141
+ // src/Loading/index.tsx
142
+ var import_react = require("react");
143
+ // src/Loading/index.module.less
144
+ var index_module_default = {
145
+ loading: "index_module_loading"
146
+ };
147
+ // src/Loading/index.tsx
148
+ var import_antd = require("antd");
149
+ var import_jsx_runtime = require("react/jsx-runtime");
150
+ var Loading = /*#__PURE__*/ function(_import_react_PureComponent) {
151
+ _inherits(Loading, _import_react_PureComponent);
152
+ var _super = _create_super(Loading);
153
+ function Loading() {
154
+ _class_call_check(this, Loading);
155
+ return _super.apply(this, arguments);
156
+ }
157
+ _create_class(Loading, [
158
+ {
159
+ key: "render",
160
+ value: function render() {
161
+ var loading = this.props.loading;
162
+ if (!loading) return null;
163
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("div", {
164
+ className: index_module_default.loading,
165
+ children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_antd.Spin, {
166
+ spinning: loading,
167
+ delay: 200,
168
+ className: index_module_default.loading_icon
169
+ })
170
+ });
171
+ }
172
+ }
173
+ ]);
174
+ return Loading;
175
+ }(import_react.PureComponent);
176
+ var Loading_default = Loading;
177
+ // Annotate the CommonJS export names for ESM import in node:
178
+ 0 && (module.exports = {
179
+ Loading: Loading
180
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,23 @@
1
+ // src/Loading/index.tsx
2
+ import { PureComponent } from "react";
3
+
4
+ // src/Loading/index.module.less
5
+ var index_module_default = {
6
+ loading: "index_module_loading"
7
+ };
8
+
9
+ // src/Loading/index.tsx
10
+ import { Spin } from "antd";
11
+ import { jsx } from "react/jsx-runtime";
12
+ var Loading = class extends PureComponent {
13
+ render() {
14
+ const { loading } = this.props;
15
+ if (!loading)
16
+ return null;
17
+ return /* @__PURE__ */ jsx("div", { className: index_module_default.loading, children: /* @__PURE__ */ jsx(Spin, { spinning: loading, delay: 200, className: index_module_default.loading_icon }) });
18
+ }
19
+ };
20
+ var Loading_default = Loading;
21
+ export {
22
+ Loading_default as Loading
23
+ };
package/package.json ADDED
@@ -0,0 +1,35 @@
1
+ {
2
+ "name": "@xfe-repo/web-components",
3
+ "version": "1.0.0",
4
+ "sideEffects": false,
5
+ "exports": {
6
+ ".": {
7
+ "import": "./dist/index.mjs",
8
+ "require": "./dist/index.js",
9
+ "types": "./dist/index.d.ts"
10
+ }
11
+ },
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "devDependencies": {
16
+ "@swc/core": "^1.3.100",
17
+ "@types/react": "^18.2.0",
18
+ "esbuild-plugin-less": "^1.3.1",
19
+ "eslint": "^8.53.0",
20
+ "react": "^18.2.0",
21
+ "tsup": "^8.0.1",
22
+ "typescript": "^5.2.2",
23
+ "@xfe-repo/eslint-config": "0.0.0",
24
+ "@xfe-repo/typescript-config": "0.0.0"
25
+ },
26
+ "dependencies": {
27
+ "antd": "^5.12.1"
28
+ },
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "dev": "tsup --watch",
32
+ "lint": "eslint \"src/**/*.ts*\"",
33
+ "clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
34
+ }
35
+ }