@ajaxjs/ui 1.1.7 → 1.1.9
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/LICENSE +201 -0
- package/README.md +16 -2
- package/dist/index.d.ts +0 -3
- package/dist/index.js +1 -4
- package/dist/index.js.map +1 -1
- package/dist/util/utils.d.ts +7 -0
- package/dist/util/utils.js +35 -1
- package/dist/util/utils.js.map +1 -1
- package/package.json +3 -3
- package/dist/util/system/config.d.ts +0 -13
- package/dist/util/system/config.js +0 -84
- package/dist/util/system/config.js.map +0 -1
- package/dist/widget/BaiduSearch.vue +0 -50
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
-
|
|
1
|
+
[](https://www.npmjs.com/package/@ajaxjs/ui)
|
|
2
|
+
[](https://vuejs.org)
|
|
3
|
+
[](https://www.typescriptlang.org/)
|
|
4
|
+
[](http://www.apache.org/licenses/LICENSE-2.0.txt)
|
|
5
|
+
[](mailto:frank@ajaxjs.com)
|
|
6
|
+
[](https://shang.qq.com/wpa/qunwpa?idkey=3877893a4ed3a5f0be01e809e7ac120e346102bd550deb6692239bb42de38e22)
|
|
2
7
|
|
|
3
|
-
|
|
8
|
+
|
|
9
|
+
# Simple Widget library
|
|
10
|
+
|
|
11
|
+
A few widgets, vue.js + typescript + less.js
|
|
12
|
+
|
|
13
|
+
NPM: https://www.npmjs.com/package/@ajaxjs/ui
|
|
14
|
+
|
|
15
|
+
## Install
|
|
16
|
+
|
|
17
|
+
npm i @ajaxjs/ui
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as sys_config from './util/system/config';
|
|
2
1
|
import * as util from './util/utils';
|
|
3
2
|
import { setBaseHeadParams } from './util/xhr';
|
|
4
3
|
import { xhr_get, xhr_post, xhr_put, xhr_del } from './util/xhr';
|
|
@@ -7,7 +6,6 @@ import OpacityBanner from "@/widget/OpacityBanner.vue";
|
|
|
7
6
|
* 暴露各个组件
|
|
8
7
|
*/
|
|
9
8
|
declare const _default: {
|
|
10
|
-
system: typeof sys_config;
|
|
11
9
|
/**
|
|
12
10
|
* 设置 API 统一前缀
|
|
13
11
|
*
|
|
@@ -32,7 +30,6 @@ declare const _default: {
|
|
|
32
30
|
ProcessLine: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
33
31
|
AccordionMenu: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
34
32
|
Expander: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
35
|
-
BaiduSearch: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
36
33
|
Article: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
37
34
|
HtmlEditor: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
|
38
35
|
FileUploader: import("vue").VueConstructor<OpacityBanner<Record<string, any>, Record<string, any>, never, never, (event: string, ...args: any[]) => OpacityBanner<Record<string, any>, Record<string, any>, never, never, any>>>;
|
package/dist/index.js
CHANGED
|
@@ -26,7 +26,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const sys_config = __importStar(require("./util/system/config"));
|
|
30
29
|
const util = __importStar(require("./util/utils"));
|
|
31
30
|
const xhr_1 = require("./util/xhr");
|
|
32
31
|
const xhr_2 = require("./util/xhr");
|
|
@@ -34,7 +33,6 @@ const OpacityBanner_vue_1 = __importDefault(require("@/widget/OpacityBanner.vue"
|
|
|
34
33
|
const ProcessLine_vue_1 = __importDefault(require("@/widget/ProcessLine.vue"));
|
|
35
34
|
const AccordionMenu_vue_1 = __importDefault(require("@/widget/AccordionMenu.vue"));
|
|
36
35
|
const Expander_vue_1 = __importDefault(require("@/widget/Expander.vue"));
|
|
37
|
-
const BaiduSearch_vue_1 = __importDefault(require("@/widget/BaiduSearch.vue"));
|
|
38
36
|
const HtmlEditor_vue_1 = __importDefault(require("@/widget/HtmlEditor/HtmlEditor.vue"));
|
|
39
37
|
const FileUploader_vue_1 = __importDefault(require("@/widget/FileUploader/FileUploader.vue"));
|
|
40
38
|
const Calendar_vue_1 = __importDefault(require("@/widget/calendar/Calendar.vue"));
|
|
@@ -47,7 +45,6 @@ let API_BASE_URL;
|
|
|
47
45
|
* 暴露各个组件
|
|
48
46
|
*/
|
|
49
47
|
exports.default = {
|
|
50
|
-
system: sys_config,
|
|
51
48
|
/**
|
|
52
49
|
* 设置 API 统一前缀
|
|
53
50
|
*
|
|
@@ -69,6 +66,6 @@ exports.default = {
|
|
|
69
66
|
xhr: {
|
|
70
67
|
xhr_get: xhr_2.xhr_get, xhr_post: xhr_2.xhr_post, xhr_put: xhr_2.xhr_put, xhr_del: xhr_2.xhr_del
|
|
71
68
|
},
|
|
72
|
-
OpacityBanner: OpacityBanner_vue_1.default, ProcessLine: ProcessLine_vue_1.default, AccordionMenu: AccordionMenu_vue_1.default, Expander: Expander_vue_1.default,
|
|
69
|
+
OpacityBanner: OpacityBanner_vue_1.default, ProcessLine: ProcessLine_vue_1.default, AccordionMenu: AccordionMenu_vue_1.default, Expander: Expander_vue_1.default, Article: Article_vue_1.default, HtmlEditor: HtmlEditor_vue_1.default, FileUploader: FileUploader_vue_1.default, Calendar: Calendar_vue_1.default
|
|
73
70
|
};
|
|
74
71
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAqC;AACrC,oCAA+C;AAC/C,oCAAiE;AAEjE,mFAAuD;AACvD,+EAAmD;AACnD,mFAAuD;AACvD,yEAA6C;AAC7C,wFAA4D;AAC5D,8FAAkE;AAClE,kFAAsD;AACtD,uEAA2C;AAE3C;;GAEG;AACH,IAAI,YAAoB,CAAC;AAEzB;;GAEG;AACH,kBAAe;IACX;;;;OAIG;IACH,aAAa,CAAC,MAAc;QACxB,YAAY,GAAG,MAAM,CAAC;IAC1B,CAAC;IAED;;;;OAIG;IACH,aAAa;QACT,OAAO,YAAY,CAAC;IACxB,CAAC;IAED,iBAAiB,EAAjB,uBAAiB;IAEjB,IAAI,EAAE,IAAI;IAEV,GAAG,EAAE;QACD,OAAO,EAAP,aAAO,EAAE,QAAQ,EAAR,cAAQ,EAAE,OAAO,EAAP,aAAO,EAAE,OAAO,EAAP,aAAO;KACtC;IAED,aAAa,EAAb,2BAAa,EAAE,WAAW,EAAX,yBAAW,EAAE,aAAa,EAAb,2BAAa,EAAE,QAAQ,EAAR,sBAAQ,EAAE,OAAO,EAAP,qBAAO,EAAE,UAAU,EAAV,wBAAU,EAAE,YAAY,EAAZ,0BAAY,EAAE,QAAQ,EAAR,sBAAQ;CACnG,CAAC"}
|
package/dist/util/utils.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
11
|
export declare function isDebug(): boolean;
|
|
12
|
+
export declare function isDev(): boolean;
|
|
12
13
|
/**
|
|
13
14
|
* 日期格式化。详见博客文章:http://blog.csdn.net/zhangxin09/archive/2011/01/01/6111294.aspx
|
|
14
15
|
* e.g: new Date().format("yyyy-MM-dd hh:mm:ss")
|
|
@@ -42,3 +43,9 @@ export declare function parallel(arr: [], _finally: Function): void;
|
|
|
42
43
|
* @param mustRunDelay
|
|
43
44
|
*/
|
|
44
45
|
export declare function throttle(fn: Function, delay: number, mustRunDelay: number): Function;
|
|
46
|
+
/**
|
|
47
|
+
* 复制文字到剪切板
|
|
48
|
+
*
|
|
49
|
+
* @param {*} text
|
|
50
|
+
*/
|
|
51
|
+
export declare function copyToClipboard(text: any): void;
|
package/dist/util/utils.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* 通用工具类
|
|
4
4
|
*/
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.throttle = exports.parallel = exports.dateFormat2 = exports.dateFormat = exports.isDebug = void 0;
|
|
6
|
+
exports.copyToClipboard = exports.throttle = exports.parallel = exports.dateFormat2 = exports.dateFormat = exports.isDev = exports.isDebug = void 0;
|
|
7
7
|
const env = process.env.NODE_ENV;
|
|
8
8
|
/**
|
|
9
9
|
* 是否调试模式中
|
|
@@ -16,6 +16,12 @@ function isDebug() {
|
|
|
16
16
|
return env === 'development';
|
|
17
17
|
}
|
|
18
18
|
exports.isDebug = isDebug;
|
|
19
|
+
function isDev() {
|
|
20
|
+
let currentHostname = window.location.hostname;
|
|
21
|
+
// 判断主机名是否是内网地址
|
|
22
|
+
return (currentHostname.startsWith('192.168.') || currentHostname.startsWith('10.') || currentHostname === 'localhost');
|
|
23
|
+
}
|
|
24
|
+
exports.isDev = isDev;
|
|
19
25
|
/**
|
|
20
26
|
* 日期格式化。详见博客文章:http://blog.csdn.net/zhangxin09/archive/2011/01/01/6111294.aspx
|
|
21
27
|
* e.g: new Date().format("yyyy-MM-dd hh:mm:ss")
|
|
@@ -137,4 +143,32 @@ function throttle(fn, delay, mustRunDelay) {
|
|
|
137
143
|
};
|
|
138
144
|
}
|
|
139
145
|
exports.throttle = throttle;
|
|
146
|
+
/**
|
|
147
|
+
* 复制文字到剪切板
|
|
148
|
+
*
|
|
149
|
+
* @param {*} text
|
|
150
|
+
*/
|
|
151
|
+
function copyToClipboard(text) {
|
|
152
|
+
if (navigator.clipboard) {
|
|
153
|
+
// clipboard api 复制
|
|
154
|
+
navigator.clipboard.writeText(text);
|
|
155
|
+
}
|
|
156
|
+
else {
|
|
157
|
+
let textarea = document.createElement('textarea');
|
|
158
|
+
document.body.appendChild(textarea);
|
|
159
|
+
// 隐藏此输入框
|
|
160
|
+
textarea.style.position = 'fixed';
|
|
161
|
+
textarea.style.clip = 'rect(0 0 0 0)';
|
|
162
|
+
textarea.style.top = '10px';
|
|
163
|
+
// 赋值
|
|
164
|
+
textarea.value = text;
|
|
165
|
+
// 选中
|
|
166
|
+
textarea.select();
|
|
167
|
+
// 复制
|
|
168
|
+
document.execCommand('copy', true);
|
|
169
|
+
// 移除输入框
|
|
170
|
+
document.body.removeChild(textarea);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
exports.copyToClipboard = copyToClipboard;
|
|
140
174
|
//# sourceMappingURL=utils.js.map
|
package/dist/util/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/util/utils.ts"],"names":[],"mappings":";AAAA;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AAC,KAAK,CAAC,IAAI,GAAG,eAAe,CAAC;QACtC,QAAQ,CAAC,KAAK,CAAC,GAAG,GAAG,MAAM,CAAC;QAC5B,KAAK;QACL,QAAQ,CAAC,KAAK,GAAG,IAAI,CAAC;QACtB,KAAK;QACL,QAAQ,CAAC,MAAM,EAAE,CAAC;QAClB,KAAK;QACL,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACnC,QAAQ;QACR,QAAQ,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC;KACvC;AACL,CAAC;AApBD,0CAoBC"}
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ajaxjs/ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.9",
|
|
4
4
|
"description": "real ajaxjs ui library",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/libs/common.d.ts",
|
|
7
7
|
"homepage": "https://framework.ajaxjs.com/",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "https://github.com/
|
|
10
|
+
"url": "https://github.com/lightweight-component/aj-widget"
|
|
11
11
|
},
|
|
12
12
|
"bugs": {
|
|
13
|
-
"url": "https://github.com/
|
|
13
|
+
"url": "https://github.com/lightweight-component/aj-widget/issues"
|
|
14
14
|
},
|
|
15
15
|
"scripts": {
|
|
16
16
|
"dev": "vue-cli-service serve",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 根据配置名称(name/key)获取配置内容(value)
|
|
3
|
-
*
|
|
4
|
-
* @param key 配置名称(name/key)
|
|
5
|
-
* @param defaultValue 如果没有配置,默认使用的配置值。该参数可选的
|
|
6
|
-
* @returns 配置内容(value)Promise
|
|
7
|
-
*/
|
|
8
|
-
export declare function getConfig(key: string, defaultValue?: string): Promise<ConfigJson>;
|
|
9
|
-
type ConfigJson = {
|
|
10
|
-
code: number;
|
|
11
|
-
data: any;
|
|
12
|
-
};
|
|
13
|
-
export {};
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.getConfig = void 0;
|
|
16
|
-
const index_1 = __importDefault(require("./../../index"));
|
|
17
|
-
/**
|
|
18
|
-
* 根据配置名称(name/key)获取配置内容(value)
|
|
19
|
-
*
|
|
20
|
-
* @param key 配置名称(name/key)
|
|
21
|
-
* @param defaultValue 如果没有配置,默认使用的配置值。该参数可选的
|
|
22
|
-
* @returns 配置内容(value)Promise
|
|
23
|
-
*/
|
|
24
|
-
function getConfig(key, defaultValue) {
|
|
25
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
-
return request({ url: 'getConfig/' + key });
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
exports.getConfig = getConfig;
|
|
30
|
-
/**
|
|
31
|
-
* 请求网络
|
|
32
|
-
* @static
|
|
33
|
-
* @template T 指定响应实体
|
|
34
|
-
* @param {RequestConfig} option 请求url+参数+请求方式
|
|
35
|
-
* @return {*} {Promise<T>}
|
|
36
|
-
*/
|
|
37
|
-
function request(option) {
|
|
38
|
-
return new Promise((resolve, reject) => {
|
|
39
|
-
option.url = `${index_1.default.getApiBaseUrl()}/${option.url}`;
|
|
40
|
-
option.method = option.method || "GET"; // 默认get
|
|
41
|
-
// 如果是get请求把参数整合到url后面
|
|
42
|
-
if (option.method === 'GET')
|
|
43
|
-
formatUrl(option);
|
|
44
|
-
let xhr = new XMLHttpRequest();
|
|
45
|
-
xhr.responseType = 'json';
|
|
46
|
-
xhr.onreadystatechange = function (e) {
|
|
47
|
-
var _a;
|
|
48
|
-
if (xhr.readyState === 4) {
|
|
49
|
-
if (xhr.status !== 200)
|
|
50
|
-
return reject({ code: xhr.status, msg: 'request error' }); // 可自行封装错误内容
|
|
51
|
-
if (((_a = xhr.response) === null || _a === void 0 ? void 0 : _a.code) !== undefined) {
|
|
52
|
-
if (xhr.response.code === 200) {
|
|
53
|
-
let t = xhr.response.data;
|
|
54
|
-
return resolve(t);
|
|
55
|
-
}
|
|
56
|
-
else
|
|
57
|
-
// 这里可以通过公共方法 把异常以弹窗形式抛出 如:showRequestError(xhr.response)
|
|
58
|
-
return reject(xhr.response);
|
|
59
|
-
}
|
|
60
|
-
else
|
|
61
|
-
return reject(xhr.response);
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
xhr.open(option.method, option.url, true);
|
|
65
|
-
if (option.method === 'POST')
|
|
66
|
-
xhr.setRequestHeader('Content-Type', 'application/json');
|
|
67
|
-
// xhr.setRequestHeader('token', '')
|
|
68
|
-
xhr.send(option.method === 'POST' ? JSON.stringify(option.param) : null);
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* 格式化get请求url
|
|
73
|
-
*
|
|
74
|
-
* @param {RequestConfig} option
|
|
75
|
-
*/
|
|
76
|
-
function formatUrl(option) {
|
|
77
|
-
let formData = [];
|
|
78
|
-
for (let key in option.param)
|
|
79
|
-
formData.push(''.concat(key, '=', option.param[key]));
|
|
80
|
-
let formStr = formData.join('&');
|
|
81
|
-
if (formData)
|
|
82
|
-
option.url += option.url.indexOf('?') === -1 ? ''.concat('?', formStr) : ''.concat('&', formStr);
|
|
83
|
-
}
|
|
84
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/util/system/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,0DAAiC;AAEjC;;;;;;GAMG;AACH,SAAsB,SAAS,CAAC,GAAW,EAAE,YAAqB;;QAC9D,OAAO,OAAO,CAAa,EAAE,GAAG,EAAE,YAAY,GAAG,GAAG,EAAE,CAAC,CAAC;IAC5D,CAAC;CAAA;AAFD,8BAEC;AAgBD;;;;;;EAME;AACF,SAAS,OAAO,CAAI,MAAqB;IACrC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACnC,MAAM,CAAC,GAAG,GAAG,GAAG,eAAI,CAAC,aAAa,EAAE,IAAI,MAAM,CAAC,GAAG,EAAE,CAAC;QACrD,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,KAAK,CAAC,CAAA,QAAQ;QAC/C,sBAAsB;QACtB,IAAI,MAAM,CAAC,MAAM,KAAK,KAAK;YACvB,SAAS,CAAC,MAAM,CAAC,CAAC;QAEtB,IAAI,GAAG,GAAmB,IAAI,cAAc,EAAE,CAAC;QAC/C,GAAG,CAAC,YAAY,GAAG,MAAM,CAAC;QAE1B,GAAG,CAAC,kBAAkB,GAAG,UAAU,CAAC;;YAChC,IAAI,GAAG,CAAC,UAAU,KAAK,CAAC,EAAE;gBACtB,IAAI,GAAG,CAAC,MAAM,KAAK,GAAG;oBAClB,OAAO,MAAM,CAAC,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,EAAE,eAAe,EAAE,CAAC,CAAC,CAAA,YAAY;gBAE1E,IAAI,CAAA,MAAA,GAAG,CAAC,QAAQ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AC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,CAAA;AACxG,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<form class="aj-widget-baidu-search" method="GET" action="http://www.baidu.com/baidu" onsubmit="//return g(this);">
|
|
3
|
-
<input type="text" name="word" placeholder="请输入搜索之关键字" />
|
|
4
|
-
<input name="tn" value="bds" type="hidden" />
|
|
5
|
-
<input name="cl" value="3" type="hidden" />
|
|
6
|
-
<input name="ct" value="2097152" type="hidden" />
|
|
7
|
-
<input name="si" :value="getSiteDomainName" type="hidden" />
|
|
8
|
-
<div class="searchBtn" onclick="this.parentNode.submit();"></div>
|
|
9
|
-
</form>
|
|
10
|
-
</template>
|
|
11
|
-
|
|
12
|
-
<script lang="ts">
|
|
13
|
-
/**
|
|
14
|
-
* Baidu 自定义搜索
|
|
15
|
-
*/
|
|
16
|
-
export default {
|
|
17
|
-
props: {
|
|
18
|
-
siteDomainName: String,
|
|
19
|
-
},
|
|
20
|
-
computed: {
|
|
21
|
-
getSiteDomainName(): string {
|
|
22
|
-
return this.siteDomainName || location.host || document.domain;
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
</script>
|
|
27
|
-
|
|
28
|
-
<style lang="less" scoped>
|
|
29
|
-
.aj-widget-baidu-search {
|
|
30
|
-
padding: 0;
|
|
31
|
-
margin: 0;
|
|
32
|
-
|
|
33
|
-
input[type="text"] {
|
|
34
|
-
border-radius: 5px;
|
|
35
|
-
border: 1px solid gray;
|
|
36
|
-
padding: 0 2px;
|
|
37
|
-
height: 22px;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.searchBtn {
|
|
41
|
-
background: url("data:image/gif;base64,R0lGODlhEAAQAGYAACH5BAEAAAAALAAAAAAQABAApgEAAOD3//n9/+3//936/xt7uX+x1KAQCyeHwsj1/6QcGZDd+fX+/+oOAFW05FCUxMXs+9P0/+T0+7fv/5rm/6fn/bHr/jCBugt0t0CKv47e+4fW9CaEv6fb8w9/weteSfkEAOsJC8xBKehVP+FZPxF1thZ4uMHx/1FBZQdssQ51uLrk9zlumyB3tDBRir3x/7nm+WK75DKb0z2k2XTG6mXD7Gq/6Euq20yk1EWp20ay5Umv4liw3dUcAKowMBqJycEzB8EqANoZACOa2KQNCp4NCgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAeWgACCDwUIhgaCiYoFNBQWFQs4F4qJBQsRAZkBFTwZlBcbEQMCpAMDCwiUBRQEpCcTCQEwN4iJHBYSAgmwBAEQObWCBRoBAi8JvQMdMsEAGTEQAQTJAw4qlAAmNSsM3RIOPyzYACUzOjY7Qx4uIQfjDykYGC0oHyAN7uOKCiMNQvn6BCkg0SNIkYCJFIgAAhChDyII9QUCADs=")
|
|
42
|
-
no-repeat center;
|
|
43
|
-
width: 25px;
|
|
44
|
-
height: 25px;
|
|
45
|
-
cursor: pointer;
|
|
46
|
-
display: inline-block;
|
|
47
|
-
vertical-align: bottom;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
</style>
|