xframelib 1.1.1 → 1.1.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/README.md +181 -189
- package/dist/assets/worker-iconv-KS7y7NCM.js +5405 -0
- package/dist/assets/worker-webcache-C22MEJ3V.js +956 -0
- package/dist/assets/worker-xmath-CbuRtVJ1.js +450 -0
- package/dist/controls/ADivider.vue.d.ts +8 -12
- package/dist/controls/ScaleContainer/index.vue.d.ts +13 -0
- package/dist/controls/ScrollSnapContainer/index.vue.d.ts +25 -0
- package/dist/controls/index.d.ts +4 -1
- package/dist/controls/layoutcontainer/LayoutManager.d.ts +8 -2
- package/dist/controls/layoutcontainer/layout.vue.d.ts +22 -35
- package/dist/controls/popover/index.vue.d.ts +33 -0
- package/dist/controls/routertransition/RouterTransition.vue.d.ts +2 -1
- package/dist/controls/routertransition/RouterTransitionAnimate.vue.d.ts +2 -1
- package/dist/controls/routertransition/SuspenseWithError.vue.d.ts +3 -2
- package/dist/controls/splitpanes/pane.vue.d.ts +3 -2
- package/dist/controls/splitpanes/splitpanes.vue.d.ts +3 -2
- package/dist/controls/xwindow/XWindow.vue.d.ts +10 -19
- package/dist/controls/xwindow/XWindowManager.d.ts +3 -3
- package/dist/controls/xwindow/index.d.ts +2 -2
- package/dist/directives/dbClickDirective.d.ts +5 -0
- package/dist/directives/index.d.ts +5 -2
- package/dist/directives/mediaDirective.d.ts +7 -0
- package/dist/index.css +1 -408
- package/dist/index.js +1 -12
- package/dist/utils/H5Tool.d.ts +18 -7
- package/dist/utils/IsTool.d.ts +4 -0
- package/dist/utils/Screen.d.ts +30 -0
- package/dist/utils/WebCacheTool.d.ts +1 -1
- package/dist/utils/index.d.ts +1 -0
- package/dist/workers/index.d.ts +3 -9
- package/package.json +25 -23
- package/dist/assets/worker-iconv-BsNle8M5.js +0 -22
- package/dist/assets/worker-webcache-CkCFZE0-.js +0 -6
- package/dist/assets/worker-xmath-AxRk6MsK.js +0 -6
- /package/dist/directives/{repeatClick.d.ts → repeatClickDirective.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -2,153 +2,112 @@
|
|
|
2
2
|
|
|
3
3
|
<p>
|
|
4
4
|
<a href="https://www.npmjs.com/package/xframelib" target="_blank">
|
|
5
|
-
|
|
5
|
+
<img src="https://img.shields.io/npm/v/xframelib?color=orange&logo=npm" />
|
|
6
6
|
</a>
|
|
7
7
|
<a href="https://www.npmjs.com/package/xframelib" target="_blank">
|
|
8
|
-
|
|
8
|
+
<img src="https://img.shields.io/npm/dt/xframelib?logo=npm" />
|
|
9
9
|
</a>
|
|
10
10
|
</p>
|
|
11
11
|
|
|
12
|
-
## XFramelib
|
|
13
|
-
|
|
14
|
-
>
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
-
|
|
23
|
-
|
|
24
|
-
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
-
|
|
36
|
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
-
|
|
43
|
-
|
|
44
|
-
-
|
|
45
|
-
-
|
|
46
|
-
|
|
47
|
-
-
|
|
48
|
-
|
|
49
|
-
-
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
-
|
|
54
|
-
|
|
55
|
-
-
|
|
56
|
-
|
|
57
|
-
-
|
|
58
|
-
|
|
59
|
-
-
|
|
60
|
-
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
-
|
|
65
|
-
|
|
66
|
-
-
|
|
67
|
-
|
|
68
|
-
-
|
|
69
|
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
|
|
73
|
-
-
|
|
74
|
-
|
|
75
|
-
-
|
|
76
|
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
|
|
80
|
-
-
|
|
81
|
-
|
|
82
|
-
-
|
|
83
|
-
|
|
84
|
-
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
- v0.3.8 取消 init 方法传入 axios 对象(改为内部自带 Global.Axios);完善 AxiosHelper 工具类;增加大文件分片/断点续传下载类 BigFileDownload;
|
|
88
|
-
- v0.3.7 增加 LockHelper 长时间操作退出登录,增加 SystemConfig.UI.LockTime 可选配置和接口 onLockListener、 unLockListener、getLockState;
|
|
89
|
-
- v0.3.6 H5Tool 增加基于 SparkMD5 的 MD5 计算;解决 TokenHelper 与 Global 循环引用问题;增加模仿 JQuery 的 HTML 元素 Style 类名操作 hasClass、addClass、removeClass、toggleClass;完善 getProxyClient 支持 Map 缓存 HproseProxy 对象
|
|
90
|
-
- v0.3.5 增加大文件切片上传 FileUpload;增加 newGuid 方法;
|
|
91
|
-
修改 requestPost 使用 FormData 方式提交数据,增加 requestPostBody 使用 JSON 方式提交;
|
|
92
|
-
移除 UserCookies 和 JS-js-cookie 依赖;
|
|
93
|
-
H5Tool 增加 getFileShortMD5 获取文件 MD5 值,增加 getObjectURL 获取 File 对象的路径;
|
|
94
|
-
- v0.3.4 增加统一用户登录和 Token 支持;解决类循环引用问题;增加系统配置参数为具体接口
|
|
95
|
-
- v0.3.3 解决 支持 Hprose 旧版本不支持 useServiceAsync 的问题
|
|
96
|
-
- v0.3.2 解决 0.3.1 版本更新错误(导致 HproseClient 无法实例化的问题)
|
|
97
|
-
- v0.3.1 修改系统 DefaultProxyClient 初始化弹框报错问题(DefaultHproseAPI 配置项可为空或不设置);增加 getProxyClient 和 initDefaultProxyClient 全局方法。
|
|
98
|
-
- v0.3.0 修改 UserCookies 支持自定义 KEY;修改 H5Tool 增强全屏操作功能方法;升级依赖的基础库
|
|
99
|
-
- v0.2.9 删除 uuid 的 NPM 包,增加 uuid 工具类,解决类型问题
|
|
100
|
-
- v0.2.8 删除对 axios 的依赖(因 axios 使用了 process 对象,vue 中报错)
|
|
101
|
-
- v0.2.7 增加 VUE WINDOW,FileDownload 等,打包入 axios(出现问题)
|
|
102
|
-
- v0.2.6 新建前端 xframelib,支持 VUE 组件打包基于 ESbuild
|
|
103
|
-
- v0.2.5 减小发布包大小,外部依赖 hprose
|
|
104
|
-
- v0.2.4 正式应用于项目中,提供.d.ts 声明文件。
|
|
105
|
-
|
|
106
|
-
## 主要功能:
|
|
107
|
-
|
|
108
|
-
- 网站系统配置Sysconfig.js对应的Global.Config
|
|
109
|
-
- 公共事件总线Global.EventBus
|
|
110
|
-
- Layout布局容器和Widget机制实现
|
|
111
|
-
- Axios的Http请求封装实现Global.Axios、AxiosHelper{get, post, requestPost, requestGet, getData, requestPostBody}
|
|
112
|
-
- Hprose Proxy方式调用后台Hprose服务实现
|
|
113
|
-
- 与用户系统后台服务适配的Token验证/刷新和角色权限过滤
|
|
114
|
-
- 大文件下载BigFileDownload
|
|
115
|
-
- 普通文件下载FileDownload封装{ Download, SaveAs, JsonDownload, HttpDownload, DownloadByUrl }
|
|
116
|
-
- 大文件上传FileUpload
|
|
117
|
-
- H5Tool常用小功能
|
|
118
|
-
- SignalrClient
|
|
119
|
-
- JQuery工具 (hasClass 、addClass、removeClass、toggleClass、setCssProperty)
|
|
120
|
-
- StorageHelper 本地缓存对象
|
|
121
|
-
- IsTool类型判断工具(数字、字符串、对象、数组、函数等)
|
|
122
|
-
- ValidateTool验证工具(身份证、手机号、IP地址、邮箱、密码强度判断、URL、车牌号等)
|
|
123
|
-
- 与后端配合使用的加密解密算法XXTEA
|
|
124
|
-
- 前端缓存功能(WebCacheTool和webCacheWorker)
|
|
125
|
-
- maplibre加载大图展示(使用bigImageWorker)
|
|
126
|
-
|
|
127
|
-
## 使用
|
|
12
|
+
## XFramelib Front-End Basic Library
|
|
13
|
+
|
|
14
|
+
> The core implementation is an enterprise-level micro-front-end architecture based on a Widget mechanism. It accumulates basic functions and components independent of UI interface libraries, improves the stability and high reusability of the basic code, and adheres to the philosophy of originating from and serving projects.
|
|
15
|
+
|
|
16
|
+
[README中文.md](https://share.note.youdao.com/s/bnDqvnDw) | [更新日志-中文](https://share.note.youdao.com/s/MrahKIVA)
|
|
17
|
+
|
|
18
|
+
## Main Functions:
|
|
19
|
+
|
|
20
|
+
- System configuration Sysconfig.js, corresponding Global.Config object
|
|
21
|
+
|
|
22
|
+
- LayoutManager: Implements the Widget scheduling mechanism
|
|
23
|
+
|
|
24
|
+
- Global.EventBus: Public event bus
|
|
25
|
+
|
|
26
|
+
- UI Components:
|
|
27
|
+
- LayoutContainer (Layout container)
|
|
28
|
+
|
|
29
|
+
- ScaleContainer (Scale container)
|
|
30
|
+
|
|
31
|
+
- XWindow (Window-like component)
|
|
32
|
+
|
|
33
|
+
- SplitPanes (Page area splitting panel)
|
|
34
|
+
|
|
35
|
+
- Popover (Floating panel)
|
|
36
|
+
|
|
37
|
+
- RouterTransition related components
|
|
38
|
+
|
|
39
|
+
- Backend Service Calls:
|
|
40
|
+
- HTTP Web Requests: Axios encapsulation implementation Global.Axios, AxiosHelper{get, post, requestPost, requestGet, getData, requestPostBody}
|
|
41
|
+
|
|
42
|
+
- Hprose Service: Hprose Proxy method to call the backend hprose service
|
|
43
|
+
|
|
44
|
+
- Common Basic Functions:
|
|
45
|
+
- H5Tool :General functions
|
|
46
|
+
|
|
47
|
+
- IsTool :type detection tool (number, string, object, array, function, etc.)
|
|
48
|
+
|
|
49
|
+
- ValidateTool: verification tool (ID card, mobile phone number, IP address, email, password strength judgment, URL, license plate number, etc.)
|
|
50
|
+
|
|
51
|
+
- jQuery:jquery tools (hasClass, addClass, removeClass, toggleClass, setCssProperty)
|
|
52
|
+
|
|
53
|
+
- Compression and decompression tools: ZipTool and GzipTool
|
|
54
|
+
|
|
55
|
+
- Caching functions: StorageHelper for operating local cache objects, WebCacheTool for front-end caching
|
|
56
|
+
|
|
57
|
+
- XXTEA encryption and decryption algorithm
|
|
58
|
+
|
|
59
|
+
- Commands: (Register and load commands using setupDirectives)
|
|
60
|
+
- v-wow tiled scrolling display
|
|
61
|
+
|
|
62
|
+
- v-media adaptive style
|
|
63
|
+
|
|
64
|
+
- v-drag draggable
|
|
65
|
+
|
|
66
|
+
- v-repeatClick to avoid repeated clicks
|
|
67
|
+
|
|
68
|
+
- v-dc double-click command
|
|
69
|
+
|
|
70
|
+
- File upload and download:
|
|
71
|
+
- BigFileDownload: large file download
|
|
72
|
+
|
|
73
|
+
- FileUpload: large file upload
|
|
74
|
+
|
|
75
|
+
- FileDownload Encapsulated for regular file downloads, including { Download, SaveAs, JsonDownload, HttpDownload, DownloadByUrl }
|
|
76
|
+
|
|
77
|
+
- WebWorkers:
|
|
78
|
+
- iconvWorker: Text encoding/decoding
|
|
79
|
+
|
|
80
|
+
- webCacheWorker: Front-end caching layer
|
|
81
|
+
|
|
82
|
+
- xmathWorker: General mathematical calculations, large front-end images, tiled loading
|
|
83
|
+
|
|
84
|
+
- NavigatorPlugin :Browser plugin(provides general browser global method encapsulation)
|
|
85
|
+
|
|
86
|
+
## Usage
|
|
128
87
|
|
|
129
88
|
`pnpm add xframelib`
|
|
130
89
|
|
|
131
90
|
or
|
|
132
|
-
|
|
133
91
|
`npm i xframelib`
|
|
134
92
|
|
|
135
|
-
|
|
93
|
+
Globally import library styles:
|
|
136
94
|
|
|
137
95
|
import 'xframelib/dist/index.css';
|
|
138
96
|
|
|
139
|
-
-
|
|
97
|
+
- Open source application example: **Front-end development template vue-widget-template**
|
|
140
98
|
|
|
141
99
|
https://github.com/zorrowm/vue-widget-template
|
|
142
100
|
|
|
143
|
-
|
|
101
|
+
A development template fully based on XFramelib and Widget concepts
|
|
144
102
|
|
|
145
|
-
- **main.ts
|
|
146
|
-
In Typescript:
|
|
103
|
+
- **main.ts file**
|
|
147
104
|
|
|
148
|
-
|
|
105
|
+
In Typescript:
|
|
106
|
+
|
|
107
|
+
```ts
|
|
149
108
|
import { createApp } from 'vue';
|
|
150
109
|
import App from './App.vue';
|
|
151
|
-
|
|
110
|
+
//added by template
|
|
152
111
|
import { setupRouter } from './router/index';
|
|
153
112
|
import {setupGlobDirectives} from './directives/index';
|
|
154
113
|
import { init, Global } from 'xframelib';
|
|
@@ -157,101 +116,134 @@ import { getSystemPKG, getSystemID } from '@/utils/sysTool';
|
|
|
157
116
|
import { createPinia } from 'pinia';
|
|
158
117
|
import { message } from 'ant-design-vue';
|
|
159
118
|
import {Icon} from '@iconify/vue';
|
|
160
|
-
//dev
|
|
119
|
+
//dev phase opens, build logs out
|
|
161
120
|
import 'ant-design-vue/dist/antd.css';
|
|
162
121
|
|
|
163
122
|
|
|
164
|
-
message.config({
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
123
|
+
message.config({
|
|
124
|
+
top: `100px`,
|
|
125
|
+
duration: 1, maxCount: 3
|
|
126
|
+
|
|
168
127
|
});
|
|
169
|
-
|
|
170
|
-
|
|
128
|
+
// Bind messages and initialize xframe
|
|
129
|
+
|
|
130
|
+
// System ID, unique identifier
|
|
131
|
+
|
|
171
132
|
const sysID = getSystemID();
|
|
172
|
-
|
|
133
|
+
|
|
134
|
+
// Group name, project name
|
|
135
|
+
|
|
173
136
|
const sysGroup = getSystemPKG().name;
|
|
137
|
+
|
|
174
138
|
init(message, sysID, sysGroup);
|
|
175
139
|
|
|
176
|
-
//
|
|
140
|
+
// Create a pinia instance
|
|
141
|
+
|
|
177
142
|
const pinia = createPinia();
|
|
143
|
+
|
|
178
144
|
const app = createApp(App);
|
|
179
|
-
|
|
145
|
+
|
|
146
|
+
// Mount to the Vue root instance
|
|
147
|
+
|
|
180
148
|
app.use(pinia);
|
|
181
|
-
|
|
149
|
+
|
|
150
|
+
// Define v-drag commands
|
|
151
|
+
|
|
182
152
|
setupGlobDirectives(app);
|
|
153
|
+
|
|
183
154
|
setupRouter(app);
|
|
184
|
-
//注册全局组件
|
|
185
|
-
app.component('Icon',Icon);
|
|
186
155
|
|
|
187
|
-
|
|
156
|
+
// Register global components
|
|
157
|
+
|
|
158
|
+
app.component('Icon', Icon);
|
|
188
159
|
|
|
160
|
+
app.mount('#app');
|
|
189
161
|
```
|
|
190
162
|
|
|
191
|
-
- **Quasar boot
|
|
163
|
+
- **Quasar boot usage example**
|
|
192
164
|
|
|
193
|
-
```
|
|
165
|
+
```ts
|
|
194
166
|
import { boot } from 'quasar/wrappers';
|
|
195
167
|
import { addAPIProvider, Icon } from '@iconify/vue';
|
|
196
168
|
import { Dropdown } from 'floating-vue';
|
|
197
169
|
import { EmitLoadingInfo } from 'src/events/index';
|
|
198
170
|
import { autoRefresh } from 'src/utils/autoUpdate';
|
|
199
171
|
import { message } from 'src/utils/MessageNotify';
|
|
200
|
-
|
|
172
|
+
|
|
173
|
+
// Encapsulated message notification
|
|
174
|
+
|
|
201
175
|
import { getSystemID, getSystemPKG } from 'src/utils/sysTool';
|
|
176
|
+
|
|
202
177
|
import { Global, init } from 'xframelib';
|
|
178
|
+
|
|
203
179
|
function preInit() {
|
|
204
180
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
181
|
+
// System ID, unique identifier
|
|
182
|
+
|
|
183
|
+
const sysID = getSystemID();
|
|
184
|
+
|
|
185
|
+
// Group name, project name
|
|
186
|
+
|
|
187
|
+
const sysGroup = getSystemPKG().name;
|
|
188
|
+
|
|
189
|
+
init(message, sysID, sysGroup);
|
|
190
|
+
|
|
191
|
+
// Mounting progress notification method
|
|
192
|
+
|
|
193
|
+
Global.Loading = EmitLoadingInfo;
|
|
194
|
+
|
|
195
|
+
// Register your own IconAPIProvider
|
|
196
|
+
|
|
197
|
+
if (Global.Config?.ServiceURL.IconServiceURL)
|
|
198
|
+
|
|
199
|
+
addAPIProvider('', {
|
|
200
|
+
|
|
201
|
+
resources: [Global.Config?.ServiceURL.IconServiceURL]
|
|
202
|
+
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
else {
|
|
206
|
+
|
|
207
|
+
//Offline icon usage: Enabled, IconServiceURL configuration is empty
|
|
208
|
+
|
|
209
|
+
import('../components/IconOffline').then((it) => {
|
|
210
|
+
|
|
211
|
+
it.default();
|
|
212
|
+
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
}
|
|
223
216
|
}
|
|
224
217
|
export default boot(({ app }) => {
|
|
225
|
-
EmitLoadingInfo('XFramelib库');
|
|
226
|
-
//初始化Xframelib
|
|
227
|
-
preInit();
|
|
228
|
-
//启动热更新监测
|
|
229
|
-
if (import.meta.env.DEV) autoRefresh();
|
|
230
|
-
// 创建pinia 实例——20240221这里不需要了,在src/stores/index.ts里挂接的
|
|
231
|
-
// const pinia = createPinia();
|
|
232
|
-
// app.use(pinia);
|
|
233
|
-
//注册全局组件
|
|
234
|
-
app.component('Icon', Icon);
|
|
235
|
-
app.component('VDropdown', Dropdown);
|
|
236
|
-
// app.component('VTooltip', Tooltip);
|
|
237
|
-
// app.component('VMenu', Menu);
|
|
238
|
-
|
|
239
|
-
//开发时,全局注册tiny组件
|
|
240
|
-
// if (import.meta.env.DEV) {
|
|
241
|
-
// // import('@opentiny/vue').then((it) => {
|
|
242
|
-
// // const TinyVue = it.default;
|
|
243
|
-
// // app.use(TinyVue);
|
|
244
|
-
// // });
|
|
245
|
-
// }
|
|
246
|
-
console.log('环境变量',process.env);
|
|
247
|
-
//保存网站根地址
|
|
248
|
-
app.config.globalProperties.$AppURL=process.env.APP_URL;
|
|
249
|
-
});
|
|
250
218
|
|
|
219
|
+
EmitLoadingInfo('XFramelib library');
|
|
220
|
+
|
|
221
|
+
//Initialize Xframelib
|
|
222
|
+
|
|
223
|
+
preInit();
|
|
224
|
+
|
|
225
|
+
//Start hot update monitoring
|
|
226
|
+
|
|
227
|
+
if (import.meta.env.DEV) autoRefresh();
|
|
228
|
+
|
|
229
|
+
// Create pinia instance — 20240221 is not needed here, it is attached in src/stores/index.ts
|
|
230
|
+
|
|
231
|
+
// Register global component
|
|
232
|
+
app.component('Icon', Icon); app.component('VDropdown', Dropdown);
|
|
233
|
+
// app.component('VTooltip', Tooltip);
|
|
234
|
+
// app.component('VMenu', Menu);
|
|
235
|
+
|
|
236
|
+
console.log('Environment Variables',process.env);
|
|
237
|
+
// Save the website root address
|
|
238
|
+
app.config.globalProperties.$AppURL=process.env.APP_URL;
|
|
239
|
+
|
|
240
|
+
});
|
|
251
241
|
```
|
|
252
242
|
|
|
253
|
-
## 应用示例
|
|
254
243
|
|
|
255
|
-

|
|
256
244
|
|
|
257
|
-
|
|
245
|
+
## Application Examples
|
|
246
|
+
|
|
247
|
+

|
|
248
|
+
|
|
249
|
+

|