hy-dispatch-ui-v3 0.1.5 → 0.2.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.
Files changed (174) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +408 -4
  3. package/es/components/appAudioPlayer/appAudioPlayer.vue.mjs +462 -0
  4. package/es/components/appAudioPlayer/index.mjs +6 -0
  5. package/es/components/appAudioPlayer/js/index.mjs +327 -0
  6. package/es/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  7. package/es/components/appButton/style/appButton.scss +0 -1
  8. package/es/components/appConfigProvider/appConfigProvider.vue.mjs +25 -4
  9. package/es/components/appConfirmDialog/appConfirmDialog.vue.mjs +3 -3
  10. package/es/components/appConfirmDialog/appConfirmMethod.mjs +13 -13
  11. package/es/components/appCutter/appCutter.vue.mjs +358 -0
  12. package/es/components/appCutter/index.mjs +6 -0
  13. package/es/components/appCutter/style/appCutter.scss +51 -0
  14. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  15. package/es/components/appDialog/appDialog.vue.mjs +205 -0
  16. package/es/components/appDialog/index.mjs +6 -0
  17. package/es/components/appDialog/style/appDialog.scss +0 -0
  18. package/es/components/appForm/appForm.vue.mjs +132 -209
  19. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  20. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  21. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  22. package/es/components/appForm/js/index.mjs +46 -24
  23. package/es/components/appForm/js/useAppForm.mjs +30 -6
  24. package/es/components/appForm/style/appForm.scss +53 -0
  25. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  26. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  27. package/es/components/appInput/appInput.vue.mjs +99 -0
  28. package/es/components/appInput/index.mjs +6 -0
  29. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  30. package/es/components/appMenu/index.mjs +6 -0
  31. package/es/components/appMenu/style/appMenu.scss +145 -0
  32. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  33. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  34. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  35. package/es/components/appSearch/js/index.mjs +20 -8
  36. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  37. package/es/components/appSearch/style/appSearch.scss +10 -0
  38. package/es/components/appTable/appTable.vue.mjs +313 -159
  39. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  40. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  41. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  42. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  43. package/es/components/appTable/js/index.mjs +46 -20
  44. package/es/components/appTable/js/search.mjs +1 -2
  45. package/es/components/appTable/js/useAppTable.mjs +58 -14
  46. package/es/components/appTable/style/appTable.scss +16 -0
  47. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  48. package/es/components/appTree/appTree.vue.mjs +304 -0
  49. package/es/components/appTree/index.mjs +6 -0
  50. package/es/components/appTree/js/index.mjs +531 -0
  51. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  52. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  53. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  54. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  55. package/es/components/appVideoPlayer/index.mjs +6 -0
  56. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  57. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  58. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  59. package/es/components/index.mjs +7 -0
  60. package/es/hooks/index.mjs +3 -0
  61. package/es/hooks/useApi.mjs +7 -3
  62. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  63. package/es/hooks/useGlobalConfig.mjs +20 -9
  64. package/es/hooks/useLocale.mjs +10 -8
  65. package/es/hooks/useMixins.mjs +1 -1
  66. package/es/hooks/usePermissionMap.mjs +12 -0
  67. package/es/hooks/useUserAvatarMap.mjs +6 -3
  68. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  69. package/es/index.mjs +16 -3
  70. package/es/locale/en.mjs +58 -4
  71. package/es/locale/zh_CN.mjs +56 -6
  72. package/es/make-installer.mjs +2 -0
  73. package/es/static/hy-svg-icons.js +462 -0
  74. package/es/static/protocolcheck.js +247 -0
  75. package/es/style/element/element.scss +9 -0
  76. package/es/style/element/index.scss +6 -3
  77. package/es/style/index.scss +11 -0
  78. package/es/style/theme.scss +73 -0
  79. package/es/utils/date.mjs +25 -1
  80. package/es/utils/file.mjs +69 -0
  81. package/es/utils/form.mjs +52 -0
  82. package/es/utils/handler.mjs +22 -2
  83. package/es/utils/index.mjs +6 -3
  84. package/es/utils/is.mjs +26 -2
  85. package/es/utils/loadScript.mjs +33 -0
  86. package/es/version.mjs +1 -1
  87. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  88. package/lib/components/appAudioPlayer/index.js +11 -0
  89. package/lib/components/appAudioPlayer/js/index.js +329 -0
  90. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  91. package/lib/components/appButton/style/appButton.scss +0 -1
  92. package/lib/components/appConfigProvider/appConfigProvider.vue.js +23 -2
  93. package/lib/components/appConfirmDialog/appConfirmDialog.vue.js +3 -3
  94. package/lib/components/appConfirmDialog/appConfirmMethod.js +13 -13
  95. package/lib/components/appCutter/appCutter.vue.js +362 -0
  96. package/lib/components/appCutter/index.js +11 -0
  97. package/lib/components/appCutter/style/appCutter.scss +51 -0
  98. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  99. package/lib/components/appDialog/appDialog.vue.js +209 -0
  100. package/lib/components/appDialog/index.js +11 -0
  101. package/lib/components/appDialog/style/appDialog.scss +0 -0
  102. package/lib/components/appForm/appForm.vue.js +129 -206
  103. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  104. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  105. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  106. package/lib/components/appForm/js/index.js +48 -23
  107. package/lib/components/appForm/js/useAppForm.js +30 -6
  108. package/lib/components/appForm/style/appForm.scss +53 -0
  109. package/lib/components/appIcon/appIcon.vue.js +2 -1
  110. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  111. package/lib/components/appInput/appInput.vue.js +103 -0
  112. package/lib/components/appInput/index.js +11 -0
  113. package/lib/components/appMenu/appMenu.vue.js +133 -0
  114. package/lib/components/appMenu/index.js +11 -0
  115. package/lib/components/appMenu/style/appMenu.scss +145 -0
  116. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  117. package/lib/components/appSearch/appSearch.vue.js +51 -207
  118. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  119. package/lib/components/appSearch/js/index.js +20 -7
  120. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  121. package/lib/components/appSearch/style/appSearch.scss +10 -0
  122. package/lib/components/appTable/appTable.vue.js +320 -166
  123. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  124. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  125. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  126. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  127. package/lib/components/appTable/js/index.js +47 -19
  128. package/lib/components/appTable/js/search.js +1 -2
  129. package/lib/components/appTable/js/useAppTable.js +57 -13
  130. package/lib/components/appTable/style/appTable.scss +16 -0
  131. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  132. package/lib/components/appTree/appTree.vue.js +308 -0
  133. package/lib/components/appTree/index.js +11 -0
  134. package/lib/components/appTree/js/index.js +533 -0
  135. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  136. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  137. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  138. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  139. package/lib/components/appVideoPlayer/index.js +11 -0
  140. package/lib/components/appVideoPlayer/js/index.js +429 -0
  141. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  142. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  143. package/lib/components/index.js +42 -28
  144. package/lib/hooks/index.js +9 -0
  145. package/lib/hooks/useApi.js +7 -3
  146. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  147. package/lib/hooks/useGlobalConfig.js +18 -7
  148. package/lib/hooks/useLocale.js +9 -7
  149. package/lib/hooks/useMixins.js +1 -1
  150. package/lib/hooks/usePermissionMap.js +15 -0
  151. package/lib/hooks/useUserAvatarMap.js +5 -2
  152. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  153. package/lib/index.js +70 -28
  154. package/lib/locale/en.js +58 -4
  155. package/lib/locale/zh_CN.js +56 -6
  156. package/lib/make-installer.js +2 -0
  157. package/lib/static/hy-svg-icons.js +459 -8
  158. package/lib/static/protocolcheck.js +249 -0
  159. package/lib/style/element/element.scss +9 -0
  160. package/lib/style/element/index.scss +6 -3
  161. package/lib/style/index.scss +11 -0
  162. package/lib/style/theme.scss +73 -0
  163. package/lib/utils/date.js +25 -0
  164. package/lib/utils/file.js +76 -0
  165. package/lib/utils/form.js +57 -0
  166. package/lib/utils/handler.js +22 -1
  167. package/lib/utils/index.js +19 -0
  168. package/lib/utils/is.js +27 -1
  169. package/lib/utils/loadScript.js +37 -0
  170. package/lib/version.js +1 -1
  171. package/package.json +13 -12
  172. package/es/config/index.mjs +0 -1
  173. package/es/static/hy-svg-icons.mjs +0 -11
  174. package/lib/config/index.js +0 -2
@@ -0,0 +1,249 @@
1
+ 'use strict';
2
+
3
+ (function (f) {
4
+ if (typeof exports === 'object' && typeof module !== 'undefined') {
5
+ module.exports = f();
6
+ } else if (typeof define === 'function' && define.amd) {
7
+ define([], f);
8
+ } else {
9
+ var g;
10
+ if (typeof window !== 'undefined') {
11
+ g = window;
12
+ } else if (typeof global !== 'undefined') {
13
+ g = global;
14
+ } else if (typeof self !== 'undefined') {
15
+ g = self;
16
+ } else {
17
+ g = this;
18
+ }
19
+ g.protocolCheck = f();
20
+ }
21
+ })(function () {
22
+ return (function e(t, n, r) {
23
+ function s(o, u) {
24
+ if (!n[o]) {
25
+ if (!t[o]) {
26
+ var a = typeof require == 'function' && require;
27
+ if (!u && a) return a(o, true)
28
+ if (i) return i(o, true)
29
+ var f = new Error("Cannot find module '" + o + "'");
30
+ throw ((f.code = 'MODULE_NOT_FOUND'), f)
31
+ }
32
+ var l = (n[o] = { exports: {} });
33
+ t[o][0].call(
34
+ l.exports,
35
+ function (e) {
36
+ var n = t[o][1][e];
37
+ return s(n ? n : e)
38
+ },
39
+ l,
40
+ l.exports,
41
+ e,
42
+ t,
43
+ n,
44
+ r
45
+ );
46
+ }
47
+ return n[o].exports
48
+ }
49
+ var i = typeof require == 'function' && require;
50
+ for (var o = 0; o < r.length; o++) s(r[o]);
51
+ return s
52
+ })(
53
+ {
54
+ 1: [
55
+ function (require, module, exports$1) {
56
+ function _registerEvent(target, eventType, cb) {
57
+ if (target.addEventListener) {
58
+ target.addEventListener(eventType, cb);
59
+ return {
60
+ remove: function () {
61
+ target.removeEventListener(eventType, cb);
62
+ },
63
+ }
64
+ } else {
65
+ target.attachEvent(eventType, cb);
66
+ return {
67
+ remove: function () {
68
+ target.detachEvent(eventType, cb);
69
+ },
70
+ }
71
+ }
72
+ }
73
+
74
+ function _createHiddenIframe(target, uri) {
75
+ var iframe = document.createElement('iframe');
76
+ iframe.src = uri;
77
+ iframe.id = 'hiddenIframe';
78
+ iframe.style.display = 'none';
79
+ target.appendChild(iframe);
80
+
81
+ return iframe
82
+ }
83
+
84
+ function openUriWithHiddenFrame(uri, failCb, successCb) {
85
+ var timeout = setTimeout(function () {
86
+ failCb();
87
+ handler.remove();
88
+ }, 1000);
89
+
90
+ var iframe = document.querySelector('#hiddenIframe');
91
+ if (!iframe) {
92
+ iframe = _createHiddenIframe(document.body, 'about:blank');
93
+ }
94
+
95
+ var handler = _registerEvent(window, 'blur', onBlur);
96
+
97
+ function onBlur() {
98
+ clearTimeout(timeout);
99
+ handler.remove();
100
+ successCb();
101
+ }
102
+
103
+ iframe.contentWindow.location.href = uri;
104
+ }
105
+
106
+ function openUriUsingFirefox(uri, failCb, successCb) {
107
+ var iframe = document.querySelector('#hiddenIframe');
108
+
109
+ if (!iframe) {
110
+ iframe = _createHiddenIframe(document.body, 'about:blank');
111
+ }
112
+
113
+ try {
114
+ iframe.contentWindow.location.href = uri;
115
+ successCb();
116
+ } catch (e) {
117
+ if (e.name == 'NS_ERROR_UNKNOWN_PROTOCOL') {
118
+ failCb();
119
+ }
120
+ }
121
+ }
122
+
123
+ function openUriUsingIEInOlderWindows(uri, failCb, successCb) {
124
+ if (getInternetExplorerVersion() === 10) {
125
+ openUriUsingIE10InWindows7(uri, failCb, successCb);
126
+ } else if (
127
+ getInternetExplorerVersion() === 9 ||
128
+ getInternetExplorerVersion() === 11
129
+ ) {
130
+ openUriWithHiddenFrame(uri, failCb, successCb);
131
+ } else {
132
+ openUriInNewWindowHack(uri, failCb, successCb);
133
+ }
134
+ }
135
+
136
+ function openUriUsingIE10InWindows7(uri, failCb, successCb) {
137
+ var timeout = setTimeout(failCb, 1000);
138
+ window.addEventListener('blur', function () {
139
+ clearTimeout(timeout);
140
+ successCb();
141
+ });
142
+
143
+ var iframe = document.querySelector('#hiddenIframe');
144
+ if (!iframe) {
145
+ iframe = _createHiddenIframe(document.body, 'about:blank');
146
+ }
147
+ try {
148
+ iframe.contentWindow.location.href = uri;
149
+ } catch (e) {
150
+ failCb();
151
+ clearTimeout(timeout);
152
+ }
153
+ }
154
+
155
+ function openUriInNewWindowHack(uri, failCb, successCb) {
156
+ var myWindow = window.open('', '', 'width=0,height=0');
157
+
158
+ myWindow.document.write("<iframe src='" + uri + "'></iframe>");
159
+
160
+ setTimeout(function () {
161
+ try {
162
+ myWindow.location.href;
163
+ myWindow.setTimeout('window.close()', 1000);
164
+ successCb();
165
+ } catch (e) {
166
+ myWindow.close();
167
+ failCb();
168
+ }
169
+ }, 1000);
170
+ }
171
+
172
+ function openUriWithMsLaunchUri(uri, failCb, successCb) {
173
+ navigator.msLaunchUri(uri, successCb, failCb);
174
+ }
175
+
176
+ function checkBrowser() {
177
+ var isOpera =
178
+ !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
179
+ var ua = navigator.userAgent.toLowerCase();
180
+ return {
181
+ isOpera: isOpera,
182
+ isFirefox: typeof InstallTrigger !== 'undefined',
183
+ isSafari:
184
+ (~ua.indexOf('safari') && !~ua.indexOf('chrome')) ||
185
+ Object.prototype.toString
186
+ .call(window.HTMLElement)
187
+ .indexOf('Constructor') > 0,
188
+ isIOS:
189
+ /iPad|iPhone|iPod/.test(navigator.userAgent) &&
190
+ !window.MSStream,
191
+ isChrome: !!window.chrome && !isOpera,
192
+ isIE: /*@cc_on!@*/ !!document.documentMode, // At least IE6
193
+ }
194
+ }
195
+
196
+ function getInternetExplorerVersion() {
197
+ var rv = -1;
198
+ if (navigator.appName === 'Microsoft Internet Explorer') {
199
+ var ua = navigator.userAgent;
200
+ var re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');
201
+ if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
202
+ } else if (navigator.appName === 'Netscape') {
203
+ var ua = navigator.userAgent;
204
+ var re = new RegExp('Trident/.*rv:([0-9]{1,}[\.0-9]{0,})');
205
+ if (re.exec(ua) != null) {
206
+ rv = parseFloat(RegExp.$1);
207
+ }
208
+ }
209
+ return rv
210
+ }
211
+
212
+ module.exports = function (uri, failCb, successCb, unsupportedCb) {
213
+ function failCallback() {
214
+ failCb && failCb();
215
+ }
216
+
217
+ function successCallback() {
218
+ successCb && successCb();
219
+ }
220
+
221
+ if (navigator.msLaunchUri) {
222
+ //for IE and Edge in Win 8 and Win 10
223
+ openUriWithMsLaunchUri(uri, failCb, successCb);
224
+ } else {
225
+ var browser = checkBrowser();
226
+
227
+ if (browser.isFirefox) {
228
+ openUriUsingFirefox(uri, failCallback, successCallback);
229
+ } else if (browser.isChrome || browser.isIOS) {
230
+ // openUriWithTimeoutHack(uri, failCallback, successCallback);
231
+ openUriWithHiddenFrame(uri, failCallback, successCallback);
232
+ } else if (browser.isIE) {
233
+ openUriUsingIEInOlderWindows(uri, failCallback, successCallback);
234
+ } else if (browser.isSafari) {
235
+ openUriWithHiddenFrame(uri, failCallback, successCallback);
236
+ } else {
237
+ unsupportedCb();
238
+ //not supported, implement please
239
+ }
240
+ }
241
+ };
242
+ },
243
+ {},
244
+ ],
245
+ },
246
+ {},
247
+ [1]
248
+ )(1)
249
+ });
@@ -16311,3 +16311,12 @@
16311
16311
  overflow: auto;
16312
16312
  scrollbar-width: thin;
16313
16313
  }
16314
+
16315
+ // 虚拟表格
16316
+ .hy-el-table-v2 {
16317
+ color: rgba(var(--hy-main));
16318
+ }
16319
+ .hy-el-table-v2__header-cell,
16320
+ .hy-el-table-v2__row-cell {
16321
+ padding: 0 12px;
16322
+ }
@@ -39,7 +39,6 @@
39
39
  --hy-el-table-index: var(--hy-el-index-normal);
40
40
  position: relative;
41
41
  overflow: hidden;
42
- box-sizing: border-box;
43
42
  height: -moz-fit-content;
44
43
  height: fit-content;
45
44
  width: 100%;
@@ -175,13 +174,12 @@
175
174
  --hy-el-input-clear-hover-color: var(--hy-el-text-color-secondary);
176
175
  --hy-el-input-focus-border-color: rgb(var(--hy-theme));
177
176
  --hy-el-input-width: 100%;
178
- --hy-el-input-height: var(--hy-el-component-size);
177
+ // --hy-el-input-height: var(--hy-el-component-size);
179
178
  position: relative;
180
179
  font-size: var(--hy-el-font-size-base);
181
180
  display: inline-flex;
182
181
  width: var(--hy-el-input-width);
183
182
  line-height: var(--hy-el-input-height);
184
- box-sizing: border-box;
185
183
  vertical-align: middle;
186
184
  }
187
185
 
@@ -591,6 +589,7 @@
591
589
  // 下拉框
592
590
  .hy-el-dropdown__popper.hy-el-popper {
593
591
  --hy-el-border-color-light: rgb(var(--hy-border));
592
+ --hy-el-dropdown-menuItem-hover-fill: rgb(var(--hy-background-3));
594
593
  }
595
594
 
596
595
  .hy-el-dropdown-menu {
@@ -930,3 +929,7 @@
930
929
  .hy-el-switch__core .hy-el-switch__inner-wrapper {
931
930
  color: rgb(var(--hy-auxiliary));
932
931
  }
932
+
933
+ .hy-el-slider {
934
+ --hy-el-slider-runway-bg-color: rgba(var(--hy-background));
935
+ }
@@ -3,6 +3,7 @@
3
3
  * {
4
4
  margin: 0;
5
5
  padding: 0;
6
+ box-sizing: border-box;
6
7
  }
7
8
  html,
8
9
  body,
@@ -79,3 +80,13 @@ video {
79
80
  -webkit-box-orient: vertical;
80
81
  word-break: break-all;
81
82
  }
83
+
84
+ /*禁止选中文本*/
85
+ .user-select-none {
86
+ -webkit-touch-callout: none; /*系统默认菜单被禁用*/
87
+ -webkit-user-select: none; /*webkit浏览器*/
88
+ -khtml-user-select: none; /*早期浏览器*/
89
+ -moz-user-select: none; /*火狐*/
90
+ -ms-user-select: none; /*IE10*/
91
+ user-select: none;
92
+ }
@@ -19,3 +19,76 @@
19
19
  --hy-background-4: 16, 38, 59; // 斑马纹备用色
20
20
  --hy-border: 54, 93, 132;
21
21
  }
22
+
23
+ .search_lightColor {
24
+ min-width: 254px;
25
+ line-height: 32px;
26
+ background: rgba(var(--hy-background), 1);
27
+ border-radius: 8px;
28
+ padding: 4px;
29
+ display: flex;
30
+ border: 1px solid rgba(var(--hy-border), 1);
31
+ transition: 0.3s;
32
+ position: relative;
33
+ z-index: 1;
34
+ }
35
+
36
+ .search_lightColor:focus,
37
+ .search_lightColor:hover {
38
+ border-color: rgba(var(--hy-theme), 1);
39
+ }
40
+
41
+ .search_lightColor .hy-el-input .hy-el-input__wrapper {
42
+ background: rgba(var(--hy-background), 1);
43
+ border-color: rgba(var(--hy-background), 1);
44
+ box-shadow: none;
45
+ padding: 0 26px 0 10px;
46
+ font-size: 12px;
47
+ color: rgba(var(--hy-main), 1);
48
+ }
49
+
50
+ .search_lightColor .hy-el-input .hy-el-input__wrapper:focus,
51
+ .search_lightColor .hy-el-input .hy-el-input__wrapper:hover {
52
+ border-color: rgba(var(--hy-background), 1);
53
+ box-shadow: none;
54
+ }
55
+
56
+ .search_lightColor .searchBox:active {
57
+ opacity: 0.6;
58
+ }
59
+
60
+ .search_lightColor .searchBox {
61
+ width: 42px;
62
+ height: 32px;
63
+ background: rgba(var(--hy-background-3), 1);
64
+ border-radius: 8px;
65
+ line-height: 30px;
66
+ text-align: center;
67
+ display: flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ cursor: pointer;
71
+ }
72
+
73
+ .search_lightColor .searchBox .svgBox {
74
+ width: 18px;
75
+ height: 18px;
76
+ vertical-align: middle;
77
+ }
78
+
79
+ .deviceType-sos {
80
+ font-size: 14px;
81
+ font-weight: bold;
82
+ color: rgba(var(--hy-danger), 1);
83
+ position: relative;
84
+ top: 2px;
85
+ }
86
+
87
+ .deviceType {
88
+ font-size: 12px;
89
+ font-weight: bold;
90
+ color: rgba(var(--hy-main), 1);
91
+ background: linear-gradient(270deg, #27acff 0%, #2ddbf4 100%);
92
+ -webkit-background-clip: text;
93
+ -webkit-text-fill-color: transparent;
94
+ }
package/lib/utils/date.js CHANGED
@@ -1,5 +1,7 @@
1
1
  'use strict';
2
2
 
3
+ var is = require('./is.js');
4
+
3
5
  function getDefaultValueFormatByType(type = "date") {
4
6
  switch (type) {
5
7
  case "year":
@@ -22,5 +24,28 @@ function getDefaultValueFormatByType(type = "date") {
22
24
  return "YYYY-MM-DD";
23
25
  }
24
26
  }
27
+ function formatDuration(duration, isSecond = false) {
28
+ if (!duration || !is.isNumber(duration)) return;
29
+ duration = isSecond ? duration * 1e3 : duration;
30
+ const list = [];
31
+ if (duration > 60 * 60 * 1e3) {
32
+ list.push(Math.floor(duration / (60 * 60 * 1e3)));
33
+ duration = duration % (60 * 60 * 1e3);
34
+ }
35
+ if (duration > 60 * 1e3) {
36
+ list.push(Math.floor(duration / (60 * 1e3)));
37
+ duration = duration % (60 * 1e3);
38
+ } else if (!list.length) {
39
+ list.push(0);
40
+ }
41
+ if (duration > 1e3) {
42
+ list.push(Math.floor(duration / 1e3));
43
+ } else {
44
+ list.push(0);
45
+ }
46
+ if (!list.length) return;
47
+ return list.map((val) => val >= 10 ? val : `0${val}`).join(":");
48
+ }
25
49
 
50
+ exports.formatDuration = formatDuration;
26
51
  exports.getDefaultValueFormatByType = getDefaultValueFormatByType;
@@ -0,0 +1,76 @@
1
+ 'use strict';
2
+
3
+ var vue = require('vue');
4
+ var handler = require('./handler.js');
5
+ var useApi = require('../hooks/useApi.js');
6
+
7
+ function blobToDataURL(bolb) {
8
+ return new Promise((resolve) => {
9
+ const a = new FileReader();
10
+ a.onload = function(e) {
11
+ resolve(e.target.result);
12
+ };
13
+ a.readAsDataURL(bolb);
14
+ });
15
+ }
16
+ async function presignedUrl(file) {
17
+ const { api } = useApi.useApi();
18
+ const fileList = file.name.split(".");
19
+ const res = await vue.unref(api).post("file/presignedUrl", {
20
+ fileName: `${handler.createUniqueId(1)}.${fileList[fileList.length - 1]}`
21
+ });
22
+ if (res.code === 200) {
23
+ return res;
24
+ } else {
25
+ return Promise.reject(res);
26
+ }
27
+ }
28
+ async function fileJsonUplaod(file) {
29
+ const { api } = useApi.useApi();
30
+ const result = await presignedUrl(file);
31
+ await vue.unref(api).put(result.data.url, file, {
32
+ otherUrl: true,
33
+ xAmzAcl: true
34
+ });
35
+ return result;
36
+ }
37
+ async function fileFormUpload(file) {
38
+ const { api } = useApi.useApi();
39
+ try {
40
+ const formData = new FormData();
41
+ formData.append("file", file);
42
+ const res = await vue.unref(api).post("/file/upload", formData, {
43
+ otherUrl: true,
44
+ xAmzAcl: false
45
+ });
46
+ return res;
47
+ } catch (err) {
48
+ return Promise.reject(err);
49
+ }
50
+ }
51
+ async function fileUpload(file, directTransmission = true) {
52
+ if (directTransmission) {
53
+ return await fileJsonUplaod(file);
54
+ } else {
55
+ return await fileFormUpload(file);
56
+ }
57
+ }
58
+ async function sizeToTextHandler(size) {
59
+ if (size < Math.pow(1024, 1)) {
60
+ return `${Math.floor(size / Math.pow(1024, 1) / 100) * 100}KB`;
61
+ }
62
+ if (size < Math.pow(1024, 2)) {
63
+ return `${Math.floor(size / Math.pow(1024, 2) / 100) * 100}MB`;
64
+ }
65
+ if (size < Math.pow(1024, 3)) {
66
+ return `${Math.floor(size / Math.pow(1024, 3) / 100) * 100}GB`;
67
+ }
68
+ return `${Math.floor(size / Math.pow(1024, 4) / 100) * 100}TB`;
69
+ }
70
+
71
+ exports.blobToDataURL = blobToDataURL;
72
+ exports.fileFormUpload = fileFormUpload;
73
+ exports.fileJsonUplaod = fileJsonUplaod;
74
+ exports.fileUpload = fileUpload;
75
+ exports.presignedUrl = presignedUrl;
76
+ exports.sizeToTextHandler = sizeToTextHandler;
@@ -0,0 +1,57 @@
1
+ 'use strict';
2
+
3
+ var is = require('./is.js');
4
+
5
+ function getValueByProp(model, prop) {
6
+ if (is.isString(prop)) {
7
+ prop = prop.split(".").filter(Boolean);
8
+ }
9
+ if (!is.isArray(prop) || !prop?.length) return;
10
+ return prop.reduce((o, k) => o?.[k], model);
11
+ }
12
+ function setValueByProp(model, prop, value) {
13
+ let keys = [];
14
+ if (is.isString(prop)) {
15
+ keys = prop.split(".").filter(Boolean);
16
+ }
17
+ if (!is.isArray(keys) || !keys?.length) return;
18
+ const lastKey = keys.pop();
19
+ const parent = keys.reduce((o, k) => o?.[k], model);
20
+ if (parent) {
21
+ parent[lastKey] = value;
22
+ }
23
+ }
24
+ function genValueByProp(model = {}, prop, value) {
25
+ let keys = [];
26
+ if (is.isString(prop)) {
27
+ keys = prop.split(".").filter(Boolean);
28
+ }
29
+ if (!is.isArray(keys) || !keys?.length) return;
30
+ const lastKey = keys.pop();
31
+ const parent = keys.reduce((o, k) => {
32
+ if (!o?.[k]) {
33
+ o[k] = {};
34
+ }
35
+ return o[k];
36
+ }, model);
37
+ parent[lastKey] = value;
38
+ return model;
39
+ }
40
+ function clearSpace(value, type = "between") {
41
+ if (!is.isString(value)) return value;
42
+ if (type === "between") {
43
+ value = value.replace(/(^ *)|( *$)/g, "");
44
+ } else if (type === "before") {
45
+ value = value.replace(/^ */g, "");
46
+ } else if (type === "after") {
47
+ value = value.replace(/ *$/g, "");
48
+ } else if (type === "all") {
49
+ value = value.replace(/ /g, "");
50
+ }
51
+ return value;
52
+ }
53
+
54
+ exports.clearSpace = clearSpace;
55
+ exports.genValueByProp = genValueByProp;
56
+ exports.getValueByProp = getValueByProp;
57
+ exports.setValueByProp = setValueByProp;
@@ -6,7 +6,7 @@ function funRunHandler(target, ...args) {
6
6
  if (is.isFunction(target)) {
7
7
  return target(...args);
8
8
  }
9
- return target;
9
+ return cloneDeep(target);
10
10
  }
11
11
  const cloneDeep = (target) => {
12
12
  if (is.isVueProxy(target)) {
@@ -80,8 +80,29 @@ const withInstall = (comp) => {
80
80
  };
81
81
  return comp;
82
82
  };
83
+ async function copyText(text) {
84
+ if (navigator.clipboard) {
85
+ try {
86
+ await navigator.clipboard.writeText(text);
87
+ return;
88
+ } catch {
89
+ }
90
+ }
91
+ try {
92
+ const input = document.createElement("textarea");
93
+ input.value = text;
94
+ document.body.appendChild(input);
95
+ input.select();
96
+ document.execCommand("copy");
97
+ document.body.removeChild(input);
98
+ } catch (err) {
99
+ console.error(err);
100
+ return Promise.reject();
101
+ }
102
+ }
83
103
 
84
104
  exports.cloneDeep = cloneDeep;
105
+ exports.copyText = copyText;
85
106
  exports.createUniqueId = createUniqueId;
86
107
  exports.funRunHandler = funRunHandler;
87
108
  exports.mergeDeep = mergeDeep;
@@ -6,6 +6,9 @@ var crypto = require('./crypto.js');
6
6
  var is = require('./is.js');
7
7
  var handler = require('./handler.js');
8
8
  var date = require('./date.js');
9
+ var file = require('./file.js');
10
+ var form = require('./form.js');
11
+ var loadScript = require('./loadScript.js');
9
12
 
10
13
 
11
14
 
@@ -20,18 +23,34 @@ exports.generateRandomCode = crypto.generateRandomCode;
20
23
  exports.isArray = is.isArray;
21
24
  exports.isBoolean = is.isBoolean;
22
25
  exports.isEmpty = is.isEmpty;
26
+ exports.isFile = is.isFile;
23
27
  exports.isFunction = is.isFunction;
24
28
  exports.isNull = is.isNull;
25
29
  exports.isNumber = is.isNumber;
26
30
  exports.isObject = is.isObject;
27
31
  exports.isOverflowing = is.isOverflowing;
28
32
  exports.isString = is.isString;
33
+ exports.isSupportH265 = is.isSupportH265;
29
34
  exports.isSymbol = is.isSymbol;
30
35
  exports.isUndefined = is.isUndefined;
31
36
  exports.isVueProxy = is.isVueProxy;
32
37
  exports.cloneDeep = handler.cloneDeep;
38
+ exports.copyText = handler.copyText;
33
39
  exports.createUniqueId = handler.createUniqueId;
34
40
  exports.funRunHandler = handler.funRunHandler;
35
41
  exports.mergeDeep = handler.mergeDeep;
36
42
  exports.withInstall = handler.withInstall;
43
+ exports.formatDuration = date.formatDuration;
37
44
  exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
45
+ exports.blobToDataURL = file.blobToDataURL;
46
+ exports.fileFormUpload = file.fileFormUpload;
47
+ exports.fileJsonUplaod = file.fileJsonUplaod;
48
+ exports.fileUpload = file.fileUpload;
49
+ exports.presignedUrl = file.presignedUrl;
50
+ exports.sizeToTextHandler = file.sizeToTextHandler;
51
+ exports.clearSpace = form.clearSpace;
52
+ exports.genValueByProp = form.genValueByProp;
53
+ exports.getValueByProp = form.getValueByProp;
54
+ exports.setValueByProp = form.setValueByProp;
55
+ exports.protocolcheckLoad = loadScript.protocolcheckLoad;
56
+ exports.svgIconLoad = loadScript.svgIconLoad;
package/lib/utils/is.js CHANGED
@@ -11,21 +11,47 @@ const isBoolean = (e) => typeof e === "boolean";
11
11
  const isUndefined = (e) => e === void 0;
12
12
  const isNull = (e) => e === null;
13
13
  const isSymbol = (e) => typeof e === "symbol";
14
- const isEmpty = (e) => isUndefined(e) || isNull(e) || !isNumber(e) && !e;
14
+ const isEmpty = (e) => !isBoolean(e) && (isUndefined(e) || isNull(e) || !isNumber(e) && !e);
15
15
  const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight;
16
16
  const isVueProxy = (e) => {
17
17
  return vue.isRef(e) || vue.isReactive(e) || vue.isReadonly(e) || vue.isProxy(e);
18
18
  };
19
+ const isFile = (e) => {
20
+ return e instanceof File;
21
+ };
22
+ function isSupportH265() {
23
+ const ua = navigator.userAgent.toLocaleLowerCase();
24
+ let isSupport = true;
25
+ let isVersionLow = false;
26
+ const chromeMatch = ua.match(/chrome\/(\d+)/) || ua.match(/chromium\/(\d+)/);
27
+ if (ua.match(/edge\/(\d+)/)) {
28
+ isSupport = false;
29
+ } else if (ua.match(/edg\/(\d+)/)) {
30
+ isSupport = false;
31
+ } else if (chromeMatch) {
32
+ const version2 = parseInt(chromeMatch[1], 10);
33
+ isSupport = true;
34
+ isVersionLow = !version2 || version2 < 104;
35
+ } else if (ua.match(/firefox\/(\d+)/)) {
36
+ isSupport = false;
37
+ } else if (ua.match(/version\/(\d+)/) && ua.indexOf("safari") > -1) {
38
+ version = parseInt(RegExp.$1, 10);
39
+ isSupport = true;
40
+ }
41
+ return { isSupport, isVersionLow };
42
+ }
19
43
 
20
44
  exports.isArray = isArray;
21
45
  exports.isBoolean = isBoolean;
22
46
  exports.isEmpty = isEmpty;
47
+ exports.isFile = isFile;
23
48
  exports.isFunction = isFunction;
24
49
  exports.isNull = isNull;
25
50
  exports.isNumber = isNumber;
26
51
  exports.isObject = isObject;
27
52
  exports.isOverflowing = isOverflowing;
28
53
  exports.isString = isString;
54
+ exports.isSupportH265 = isSupportH265;
29
55
  exports.isSymbol = isSymbol;
30
56
  exports.isUndefined = isUndefined;
31
57
  exports.isVueProxy = isVueProxy;