web-component-gallery 1.3.12 → 2.0.2

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.
Files changed (218) hide show
  1. package/dist/923.umd.js +1 -0
  2. package/dist/index.umd.js +1 -12252
  3. package/dist/js.umd.js +1 -0
  4. package/dist/style.css +17 -0
  5. package/dist/style.umd.js +1 -0
  6. package/{method → extensions}/AMap.js +1 -5
  7. package/{plugins/method → extensions}/Dialog.js +2 -2
  8. package/{lib/lazy_use.js → extensions/index.js} +16 -2
  9. package/lib/{amap/components/AmapSearch/index.jsx → amap-comp/AmapSearch.jsx} +3 -5
  10. package/lib/amap-comp/index.js +18 -0
  11. package/{plugins/lib/amap/components/AmapSearch/index.less → lib/amap-comp/style/AmapSearch.less} +5 -3
  12. package/lib/amap-comp/style/index.js +1 -0
  13. package/lib/amap-comp/style/index.less +1 -0
  14. package/lib/{amap/AmapDraw.jsx → amap-draw/index.jsx} +2 -4
  15. package/lib/amap-draw/style/index.js +1 -0
  16. package/lib/{amap/AmapDraw.less → amap-draw/style/index.less} +6 -3
  17. package/lib/browse/index.jsx +0 -2
  18. package/lib/browse/style/index.js +1 -0
  19. package/lib/button/Button.js +1 -3
  20. package/lib/button/style/index.js +1 -0
  21. package/{plugins/lib/dateTime → lib/date-time}/index.vue +3 -13
  22. package/lib/date-time/style/index.js +1 -0
  23. package/lib/date-time/style/index.less +7 -0
  24. package/lib/{descriptions → descriptions-list}/index.jsx +1 -3
  25. package/lib/descriptions-list/style/index.js +1 -0
  26. package/{plugins/lib/tree → lib/directory}/Directory.js +4 -21
  27. package/lib/directory/index.js +8 -0
  28. package/lib/directory/style/index.js +1 -0
  29. package/lib/{tree/style/Directory.less → directory/style/index.less} +3 -4
  30. package/{plugins/lib/form/components → lib/form-comp}/ACascaderMultiple.vue +1 -106
  31. package/lib/form-comp/ARadio.vue +70 -0
  32. package/lib/{form/components → form-comp}/ARangePicker.vue +9 -20
  33. package/lib/{form/components → form-comp}/ASelectCustom.vue +1 -8
  34. package/lib/form-comp/ATagsInput.vue +88 -0
  35. package/lib/form-comp/ATimePicker.vue +127 -0
  36. package/lib/{form/components → form-comp}/AUpload.vue +2 -17
  37. package/lib/form-comp/index.js +37 -0
  38. package/lib/form-comp/style/ACascaderMultiple.less +117 -0
  39. package/lib/form-comp/style/ARadio.less +0 -0
  40. package/lib/form-comp/style/ARangePicker.less +11 -0
  41. package/lib/form-comp/style/ASelectCustom.less +4 -0
  42. package/lib/form-comp/style/ATagsInput.less +24 -0
  43. package/lib/form-comp/style/ATimePicker.less +8 -0
  44. package/lib/form-comp/style/AUpload.less +15 -0
  45. package/lib/form-comp/style/index.js +1 -0
  46. package/lib/form-comp/style/index.less +7 -0
  47. package/lib/index.js +60 -45
  48. package/lib/modal/index.jsx +4 -6
  49. package/lib/modal/style/index.js +1 -0
  50. package/lib/modal/{index.less → style/index.less} +6 -7
  51. package/{plugins/lib/form → lib/model}/Model.js +1 -3
  52. package/lib/model/index.js +7 -0
  53. package/lib/model/style/index.js +1 -0
  54. package/lib/{form/style/Model.less → model/style/index.less} +10 -10
  55. package/{plugins/lib/form → lib/model}/utils/render.js +1 -1
  56. package/lib/{form → model}/utils/resetFields.js +1 -1
  57. package/lib/no-data/directive.js +65 -0
  58. package/lib/no-data/index.js +21 -0
  59. package/lib/no-data/index.vue +35 -0
  60. package/lib/no-data/style/index.js +1 -0
  61. package/lib/no-data/style/index.less +15 -0
  62. package/lib/search/index.js +7 -0
  63. package/{plugins/lib/form/Search.vue → lib/search/index.vue} +3 -6
  64. package/lib/search/style/index.js +1 -0
  65. package/{plugins/lib/form/style/Search.less → lib/search/style/index.less} +7 -8
  66. package/lib/style/mixins.less +1 -1
  67. package/lib/{svgIcon → svg-icon}/index.vue +1 -17
  68. package/lib/svg-icon/style/index.js +1 -0
  69. package/lib/svg-icon/style/index.less +15 -0
  70. package/lib/table/index.vue +4 -8
  71. package/lib/table/style/index.js +1 -0
  72. package/lib/table/style/index.less +12 -13
  73. package/lib/tree/index.js +2 -11
  74. package/{plugins/lib/tree/Tree.vue → lib/tree/index.vue} +2 -5
  75. package/lib/tree/style/index.js +1 -0
  76. package/{plugins/lib/tree/style/Tree.less → lib/tree/style/index.less} +4 -4
  77. package/lib/weather/index.vue +1 -9
  78. package/lib/weather/style/index.js +1 -0
  79. package/lib/weather/style/index.less +7 -0
  80. package/package.json +16 -34
  81. package/utils/Axios.js +91 -82
  82. package/utils/Postcss.js +12 -8
  83. package/README.md +0 -24
  84. package/dist/amap.umd.js +0 -12252
  85. package/dist/avatar.umd.js +0 -5337
  86. package/dist/button.umd.js +0 -5845
  87. package/dist/dateTime.umd.js +0 -1287
  88. package/dist/form.umd.js +0 -9981
  89. package/dist/multiTab.umd.js +0 -5556
  90. package/dist/svgIcon.umd.js +0 -1167
  91. package/dist/table.umd.js +0 -6306
  92. package/dist/tree.umd.js +0 -5393
  93. package/dist/weather.umd.js +0 -1167
  94. package/lib/amap/components/AmapSearch/index.less +0 -16
  95. package/lib/amap/index.js +0 -13
  96. package/lib/avatar/index.js +0 -7
  97. package/lib/avatar/index.vue +0 -47
  98. package/lib/basic/404.vue +0 -24
  99. package/lib/dateTime/index.vue +0 -43
  100. package/lib/form/Model.js +0 -153
  101. package/lib/form/Search.vue +0 -159
  102. package/lib/form/components/ACascaderMultiple.vue +0 -766
  103. package/lib/form/components/ARadio.vue +0 -74
  104. package/lib/form/components/ATagsInput.vue +0 -93
  105. package/lib/form/components/ATimePicker.vue +0 -73
  106. package/lib/form/index.js +0 -55
  107. package/lib/form/style/Search.less +0 -34
  108. package/lib/form/utils/render.js +0 -85
  109. package/lib/iframe/events.js +0 -2
  110. package/lib/iframe/index.jsx +0 -234
  111. package/lib/iframe/index.less +0 -19
  112. package/lib/multiTab/APIEnums.js +0 -17
  113. package/lib/multiTab/MultiTab.jsx +0 -237
  114. package/lib/multiTab/RouteAPI.js +0 -71
  115. package/lib/multiTab/RouteContent.jsx +0 -90
  116. package/lib/multiTab/RouteKeepAlive.js +0 -183
  117. package/lib/multiTab/events.js +0 -2
  118. package/lib/multiTab/index.js +0 -15
  119. package/lib/multiTab/index.less +0 -73
  120. package/lib/style/index.less +0 -2
  121. package/lib/tree/Directory.js +0 -428
  122. package/lib/tree/Tree.vue +0 -181
  123. package/lib/tree/style/Tree.less +0 -52
  124. package/method/Dialog.js +0 -134
  125. package/method/index.js +0 -12
  126. package/plugins/lib/amap/AmapDraw.jsx +0 -349
  127. package/plugins/lib/amap/AmapDraw.less +0 -45
  128. package/plugins/lib/amap/components/AmapSearch/index.jsx +0 -73
  129. package/plugins/lib/amap/index.js +0 -13
  130. package/plugins/lib/avatar/index.js +0 -7
  131. package/plugins/lib/avatar/index.vue +0 -47
  132. package/plugins/lib/basic/404.vue +0 -24
  133. package/plugins/lib/browse/index.jsx +0 -76
  134. package/plugins/lib/browse/index.less +0 -4
  135. package/plugins/lib/button/Button.js +0 -89
  136. package/plugins/lib/button/index.js +0 -7
  137. package/plugins/lib/dateTime/index.js +0 -7
  138. package/plugins/lib/descriptions/index.jsx +0 -108
  139. package/plugins/lib/descriptions/index.less +0 -15
  140. package/plugins/lib/form/components/ARadio.vue +0 -74
  141. package/plugins/lib/form/components/ARangePicker.vue +0 -129
  142. package/plugins/lib/form/components/ASelectCustom.vue +0 -226
  143. package/plugins/lib/form/components/ATagsInput.vue +0 -93
  144. package/plugins/lib/form/components/ATimePicker.vue +0 -73
  145. package/plugins/lib/form/components/AUpload.vue +0 -183
  146. package/plugins/lib/form/components/RenderComp.vue +0 -69
  147. package/plugins/lib/form/index.js +0 -55
  148. package/plugins/lib/form/style/Model.less +0 -53
  149. package/plugins/lib/form/utils/resetFields.js +0 -16
  150. package/plugins/lib/iframe/events.js +0 -2
  151. package/plugins/lib/iframe/index.jsx +0 -234
  152. package/plugins/lib/iframe/index.less +0 -19
  153. package/plugins/lib/index.js +0 -72
  154. package/plugins/lib/lazy_use.js +0 -40
  155. package/plugins/lib/modal/index.jsx +0 -53
  156. package/plugins/lib/modal/index.less +0 -50
  157. package/plugins/lib/multiTab/APIEnums.js +0 -17
  158. package/plugins/lib/multiTab/MultiTab.jsx +0 -237
  159. package/plugins/lib/multiTab/RouteAPI.js +0 -71
  160. package/plugins/lib/multiTab/RouteContent.jsx +0 -90
  161. package/plugins/lib/multiTab/RouteKeepAlive.js +0 -183
  162. package/plugins/lib/multiTab/events.js +0 -2
  163. package/plugins/lib/multiTab/index.js +0 -15
  164. package/plugins/lib/multiTab/index.less +0 -73
  165. package/plugins/lib/style/index.less +0 -2
  166. package/plugins/lib/style/mixins.less +0 -79
  167. package/plugins/lib/svgIcon/index.js +0 -7
  168. package/plugins/lib/svgIcon/index.vue +0 -77
  169. package/plugins/lib/table/index.js +0 -7
  170. package/plugins/lib/table/index.vue +0 -217
  171. package/plugins/lib/table/style/index.less +0 -50
  172. package/plugins/lib/tree/index.js +0 -17
  173. package/plugins/lib/tree/style/Directory.less +0 -119
  174. package/plugins/lib/weather/index.js +0 -7
  175. package/plugins/lib/weather/index.vue +0 -58
  176. package/plugins/method/AMap.js +0 -368
  177. package/plugins/method/PageLoading.jsx +0 -106
  178. package/plugins/method/Theme.js +0 -88
  179. package/plugins/method/index.js +0 -12
  180. package/plugins/store/auth.js +0 -31
  181. package/plugins/store/cache.js +0 -56
  182. package/plugins/store/chat.js +0 -74
  183. package/plugins/store/project.js +0 -46
  184. package/plugins/utils/Axios.js +0 -105
  185. package/plugins/utils/Base64.js +0 -314
  186. package/plugins/utils/Filter.js +0 -249
  187. package/plugins/utils/PostMessage.js +0 -16
  188. package/plugins/utils/Postcss.js +0 -9
  189. package/plugins/utils/Rem.js +0 -24
  190. package/plugins/utils/Request.js +0 -38
  191. package/plugins/utils/Storage.js +0 -73
  192. package/plugins/utils/Tree.js +0 -169
  193. package/plugins/utils/Utils.js +0 -51
  194. package/plugins/utils/Validate.js +0 -33
  195. package/plugins/utils/Websocket.js +0 -186
  196. package/utils/PostMessage.js +0 -16
  197. package/utils/Request.js +0 -38
  198. /package/{method → extensions}/PageLoading.jsx +0 -0
  199. /package/{method → extensions}/Theme.js +0 -0
  200. /package/{plugins/font → font}/DS-DIGI-1.ttf +0 -0
  201. /package/{plugins/font → font}/DS-DIGIB-2.ttf +0 -0
  202. /package/{plugins/font → font}/DS-DIGII-3.ttf +0 -0
  203. /package/{plugins/font → font}/DS-DIGIT-4.ttf +0 -0
  204. /package/{plugins/font → font}/Orbitron-Black.ttf +0 -0
  205. /package/{plugins/font → font}/Orbitron-Bold.ttf +0 -0
  206. /package/{plugins/font → font}/Orbitron-Medium.ttf +0 -0
  207. /package/{plugins/font → font}/Orbitron-Regular.ttf +0 -0
  208. /package/{plugins/font → font}/PANGMENZHENGDAOBIAOTITI-1.TTF +0 -0
  209. /package/{plugins/font → font}/PingFang SC.ttf +0 -0
  210. /package/{plugins/font → font}/YouSheBiaoTiHei.ttf +0 -0
  211. /package/{plugins/font → font}/font.css +0 -0
  212. /package/{plugins/font → font}//345/255/227/351/255/20235/345/217/267-/347/273/217/345/205/270/351/233/205/351/273/221.ttf" +0 -0
  213. /package/lib/browse/{index.less → style/index.less} +0 -0
  214. /package/{dist/css/index.css → lib/button/style/index.less} +0 -0
  215. /package/lib/{dateTime → date-time}/index.js +0 -0
  216. /package/lib/{descriptions → descriptions-list/style}/index.less +0 -0
  217. /package/lib/{form/components → form-comp}/RenderComp.vue +0 -0
  218. /package/lib/{svgIcon → svg-icon}/index.js +0 -0
@@ -1,186 +0,0 @@
1
- /**
2
- * 自动转换HTTP/HTTPS为WS/WSS协议
3
- * @param {string} url 原始URL
4
- * @returns {string} 转换后的WebSocket URL
5
- */
6
- function normalizeWebSocketUrl(url) {
7
- // 已经是ws/wss协议直接返回
8
- if (/^wss?:/i.test(url)) return url
9
-
10
- // 处理相对路径(如 /socket)
11
- if (url.startsWith('/')) {
12
- const protocol = window.location.protocol === 'https:' ? 'wss:' : 'ws:'
13
- return `${protocol}//${window.location.host}${url}`
14
- }
15
-
16
- // 处理完整HTTP/HTTPS URL
17
- const isSecure = window.location.protocol === 'https:'
18
- return url.replace(/^http(s?):/i, isSecure ? 'wss:' : 'ws:')
19
- }
20
-
21
- /**
22
- * 校验WebSocket URL有效性
23
- * @param {string} url 待校验URL
24
- * @returns {boolean} 是否有效
25
- */
26
- function isValidWebSocketUrl(url) {
27
- try {
28
- const { protocol, hostname } = new URL(url)
29
- return /^wss?:$/i.test(protocol) && hostname
30
- } catch {
31
- return false
32
- }
33
- }
34
-
35
- const WebSocketManager = {
36
- install(Vue, options = {}) {
37
- const defaultConfig = {
38
- reconnectDelay: 3000,
39
- maxReconnect: 5,
40
- heartbeatInterval: 30000,
41
- heartbeatTimeout: 60000
42
- }
43
- const config = { ...defaultConfig, ...options }
44
-
45
- const instances = new Map()
46
-
47
- const createInstance = (url) => {
48
- let socket = null
49
- let reconnectCount = 0
50
- let heartbeatTimer = null
51
- let heartbeatTimeoutTimer = null
52
- const callbacks = []
53
-
54
- const connect = () => {
55
- return new Promise((resolve, reject) => {
56
- if (instances.get(url)?.socket?.readyState === WebSocket.OPEN) {
57
- resolve(instance)
58
- return
59
- }
60
-
61
- /** 拼接时间戳及传递token */
62
- const finalUrl = normalizeWebSocketUrl(url) + `/${new Date().getTime()}?token=${Vue.prototype.$store.getters.token}`
63
- if (!isValidWebSocketUrl(finalUrl)) {
64
- throw new Error(`无效的WebSocket URL: ${finalUrl}`)
65
- }
66
-
67
- socket = new WebSocket(finalUrl)
68
- instances.set(url, { socket, callbacks })
69
-
70
- socket.onopen = () => {
71
- reconnectCount = 0
72
- startHeartbeat()
73
- resolve(instance)
74
- }
75
-
76
- socket.onmessage = (e) => {
77
- resetHeartbeat()
78
- try {
79
- const data = JSON.parse(e.data)
80
- if (data.type !== 'heartbeat') {
81
- callbacks.forEach(cb => cb(data))
82
- }
83
- } catch (err) {
84
- callbacks.forEach(cb => cb(e.data))
85
- }
86
- }
87
-
88
- socket.onclose = (e) => {
89
- handleClose(e)
90
- if (e.code !== 1000) {
91
- reject(new Error(`连接关闭: ${e.reason || '未知原因'}`))
92
- }
93
- }
94
-
95
- socket.onerror = (e) => {
96
- handleError(e)
97
- reject(new Error('连接错误'))
98
- }
99
- })
100
- }
101
-
102
- const startHeartbeat = () => {
103
- clearTimeout(heartbeatTimeoutTimer)
104
- heartbeatTimer = setInterval(() => {
105
- if (socket?.readyState === WebSocket.OPEN) {
106
- socket.send(JSON.stringify({ type: 'heartbeat' }))
107
- heartbeatTimeoutTimer = setTimeout(() => {
108
- socket.close(1006, '心跳超时')
109
- }, config.heartbeatTimeout)
110
- }
111
- }, config.heartbeatInterval)
112
- }
113
-
114
- const resetHeartbeat = () => {
115
- clearTimeout(heartbeatTimeoutTimer)
116
- clearInterval(heartbeatTimer)
117
- startHeartbeat()
118
- }
119
-
120
- const handleClose = (e) => {
121
- clearTimeout(heartbeatTimeoutTimer)
122
- clearInterval(heartbeatTimer)
123
- if (e.code !== 1000 && reconnectCount < config.maxReconnect) {
124
- setTimeout(() => {
125
- reconnectCount++
126
- connect()
127
- }, config.reconnectDelay)
128
- }
129
- }
130
-
131
- const handleError = (e) => {
132
- if (e.code === 1006) {
133
- instances.delete(url)
134
- }
135
- }
136
-
137
- const close = () => {
138
- clearTimeout(heartbeatTimeoutTimer)
139
- clearInterval(heartbeatTimer)
140
- socket?.close(1000, '正常关闭')
141
- instances.delete(url)
142
- }
143
-
144
- const instance = {
145
- connect,
146
- close,
147
- readyState: () => socket?.readyState,
148
- onMessage: (callback) => {
149
- callbacks.push(callback)
150
- return () => {
151
- const index = callbacks.indexOf(callback)
152
- if (index > -1) callbacks.splice(index, 1)
153
- }
154
- },
155
- send: (data) => {
156
- if (socket?.readyState === WebSocket.OPEN) {
157
- socket.send(JSON.stringify(data))
158
- return true
159
- }
160
- return false
161
- }
162
- }
163
- return instance
164
- }
165
-
166
- Vue.prototype.$ws = {
167
- async getInstance(url) {
168
- if (!instances.has(url)) {
169
- const instance = createInstance(url)
170
- instances.set(url, instance)
171
- return instance.connect()
172
- }
173
- const instance = instances.get(url)
174
- return instance.readyState() === WebSocket.OPEN
175
- ? Promise.resolve(instance)
176
- : instance.connect()
177
- },
178
- closeAll() {
179
- instances.forEach(instance => instance.close())
180
- instances.clear()
181
- }
182
- }
183
- }
184
- }
185
-
186
- export default WebSocketManager
@@ -1,16 +0,0 @@
1
- import notification from 'ant-design-vue/es/notification'
2
-
3
- /* 抛出401错误码 用于处理不同项目下处理方式 */
4
- export function errorMessage(status, { msg }, callBack = () => {}) {
5
- /* 200为正常状态码 捕捉到直接返回 */
6
- if(status === 200) return
7
- if(status === 401) return callBack()
8
- notification.error({
9
- message: '请求失败!',
10
- description: msg || '服务器请求失败'
11
- })
12
- }
13
-
14
- export default {
15
- errorMessage
16
- }
package/utils/Request.js DELETED
@@ -1,38 +0,0 @@
1
- import { createAxiosService } from './Axios.js'
2
-
3
- const axiosPlugin = {
4
- install(Vue, options) {
5
-
6
- const service = createAxiosService({
7
- baseURL: window.https.WEBSWG,
8
- token: Vue.prototype.$store.getters.token,
9
- ...options
10
- })
11
-
12
- // 全局挂载
13
- Vue.config.globalProperties.$http = service
14
-
15
- // 提供独立的 API 方法
16
- Vue.provide('axios', service)
17
-
18
- // 添加自定义方法
19
- service.uploadFile = (url, file, onProgress) => {
20
- const formData = new FormData()
21
- formData.append('file', file)
22
-
23
- return service.post(url, formData, {
24
- headers: { 'Content-Type': 'multipart/form-data' },
25
- onUploadProgress: (progressEvent) => {
26
- if (progressEvent.lengthComputable && onProgress) {
27
- const percent = Math.round(
28
- (progressEvent.loaded * 100) / progressEvent.total
29
- )
30
- onProgress(percent)
31
- }
32
- }
33
- })
34
- }
35
- }
36
- }
37
-
38
- export default axiosPlugin
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes