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,247 @@
1
+ (function (f) {
2
+ if (typeof exports === 'object' && typeof module !== 'undefined') {
3
+ module.exports = f();
4
+ } else if (typeof define === 'function' && define.amd) {
5
+ define([], f);
6
+ } else {
7
+ var g;
8
+ if (typeof window !== 'undefined') {
9
+ g = window;
10
+ } else if (typeof global !== 'undefined') {
11
+ g = global;
12
+ } else if (typeof self !== 'undefined') {
13
+ g = self;
14
+ } else {
15
+ g = this;
16
+ }
17
+ g.protocolCheck = f();
18
+ }
19
+ })(function () {
20
+ return (function e(t, n, r) {
21
+ function s(o, u) {
22
+ if (!n[o]) {
23
+ if (!t[o]) {
24
+ var a = typeof require == 'function' && require;
25
+ if (!u && a) return a(o, true)
26
+ if (i) return i(o, true)
27
+ var f = new Error("Cannot find module '" + o + "'");
28
+ throw ((f.code = 'MODULE_NOT_FOUND'), f)
29
+ }
30
+ var l = (n[o] = { exports: {} });
31
+ t[o][0].call(
32
+ l.exports,
33
+ function (e) {
34
+ var n = t[o][1][e];
35
+ return s(n ? n : e)
36
+ },
37
+ l,
38
+ l.exports,
39
+ e,
40
+ t,
41
+ n,
42
+ r
43
+ );
44
+ }
45
+ return n[o].exports
46
+ }
47
+ var i = typeof require == 'function' && require;
48
+ for (var o = 0; o < r.length; o++) s(r[o]);
49
+ return s
50
+ })(
51
+ {
52
+ 1: [
53
+ function (require, module, exports$1) {
54
+ function _registerEvent(target, eventType, cb) {
55
+ if (target.addEventListener) {
56
+ target.addEventListener(eventType, cb);
57
+ return {
58
+ remove: function () {
59
+ target.removeEventListener(eventType, cb);
60
+ },
61
+ }
62
+ } else {
63
+ target.attachEvent(eventType, cb);
64
+ return {
65
+ remove: function () {
66
+ target.detachEvent(eventType, cb);
67
+ },
68
+ }
69
+ }
70
+ }
71
+
72
+ function _createHiddenIframe(target, uri) {
73
+ var iframe = document.createElement('iframe');
74
+ iframe.src = uri;
75
+ iframe.id = 'hiddenIframe';
76
+ iframe.style.display = 'none';
77
+ target.appendChild(iframe);
78
+
79
+ return iframe
80
+ }
81
+
82
+ function openUriWithHiddenFrame(uri, failCb, successCb) {
83
+ var timeout = setTimeout(function () {
84
+ failCb();
85
+ handler.remove();
86
+ }, 1000);
87
+
88
+ var iframe = document.querySelector('#hiddenIframe');
89
+ if (!iframe) {
90
+ iframe = _createHiddenIframe(document.body, 'about:blank');
91
+ }
92
+
93
+ var handler = _registerEvent(window, 'blur', onBlur);
94
+
95
+ function onBlur() {
96
+ clearTimeout(timeout);
97
+ handler.remove();
98
+ successCb();
99
+ }
100
+
101
+ iframe.contentWindow.location.href = uri;
102
+ }
103
+
104
+ function openUriUsingFirefox(uri, failCb, successCb) {
105
+ var iframe = document.querySelector('#hiddenIframe');
106
+
107
+ if (!iframe) {
108
+ iframe = _createHiddenIframe(document.body, 'about:blank');
109
+ }
110
+
111
+ try {
112
+ iframe.contentWindow.location.href = uri;
113
+ successCb();
114
+ } catch (e) {
115
+ if (e.name == 'NS_ERROR_UNKNOWN_PROTOCOL') {
116
+ failCb();
117
+ }
118
+ }
119
+ }
120
+
121
+ function openUriUsingIEInOlderWindows(uri, failCb, successCb) {
122
+ if (getInternetExplorerVersion() === 10) {
123
+ openUriUsingIE10InWindows7(uri, failCb, successCb);
124
+ } else if (
125
+ getInternetExplorerVersion() === 9 ||
126
+ getInternetExplorerVersion() === 11
127
+ ) {
128
+ openUriWithHiddenFrame(uri, failCb, successCb);
129
+ } else {
130
+ openUriInNewWindowHack(uri, failCb, successCb);
131
+ }
132
+ }
133
+
134
+ function openUriUsingIE10InWindows7(uri, failCb, successCb) {
135
+ var timeout = setTimeout(failCb, 1000);
136
+ window.addEventListener('blur', function () {
137
+ clearTimeout(timeout);
138
+ successCb();
139
+ });
140
+
141
+ var iframe = document.querySelector('#hiddenIframe');
142
+ if (!iframe) {
143
+ iframe = _createHiddenIframe(document.body, 'about:blank');
144
+ }
145
+ try {
146
+ iframe.contentWindow.location.href = uri;
147
+ } catch (e) {
148
+ failCb();
149
+ clearTimeout(timeout);
150
+ }
151
+ }
152
+
153
+ function openUriInNewWindowHack(uri, failCb, successCb) {
154
+ var myWindow = window.open('', '', 'width=0,height=0');
155
+
156
+ myWindow.document.write("<iframe src='" + uri + "'></iframe>");
157
+
158
+ setTimeout(function () {
159
+ try {
160
+ myWindow.location.href;
161
+ myWindow.setTimeout('window.close()', 1000);
162
+ successCb();
163
+ } catch (e) {
164
+ myWindow.close();
165
+ failCb();
166
+ }
167
+ }, 1000);
168
+ }
169
+
170
+ function openUriWithMsLaunchUri(uri, failCb, successCb) {
171
+ navigator.msLaunchUri(uri, successCb, failCb);
172
+ }
173
+
174
+ function checkBrowser() {
175
+ var isOpera =
176
+ !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
177
+ var ua = navigator.userAgent.toLowerCase();
178
+ return {
179
+ isOpera: isOpera,
180
+ isFirefox: typeof InstallTrigger !== 'undefined',
181
+ isSafari:
182
+ (~ua.indexOf('safari') && !~ua.indexOf('chrome')) ||
183
+ Object.prototype.toString
184
+ .call(window.HTMLElement)
185
+ .indexOf('Constructor') > 0,
186
+ isIOS:
187
+ /iPad|iPhone|iPod/.test(navigator.userAgent) &&
188
+ !window.MSStream,
189
+ isChrome: !!window.chrome && !isOpera,
190
+ isIE: /*@cc_on!@*/ !!document.documentMode, // At least IE6
191
+ }
192
+ }
193
+
194
+ function getInternetExplorerVersion() {
195
+ var rv = -1;
196
+ if (navigator.appName === 'Microsoft Internet Explorer') {
197
+ var ua = navigator.userAgent;
198
+ var re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})');
199
+ if (re.exec(ua) != null) rv = parseFloat(RegExp.$1);
200
+ } else if (navigator.appName === 'Netscape') {
201
+ var ua = navigator.userAgent;
202
+ var re = new RegExp('Trident/.*rv:([0-9]{1,}[\.0-9]{0,})');
203
+ if (re.exec(ua) != null) {
204
+ rv = parseFloat(RegExp.$1);
205
+ }
206
+ }
207
+ return rv
208
+ }
209
+
210
+ module.exports = function (uri, failCb, successCb, unsupportedCb) {
211
+ function failCallback() {
212
+ failCb && failCb();
213
+ }
214
+
215
+ function successCallback() {
216
+ successCb && successCb();
217
+ }
218
+
219
+ if (navigator.msLaunchUri) {
220
+ //for IE and Edge in Win 8 and Win 10
221
+ openUriWithMsLaunchUri(uri, failCb, successCb);
222
+ } else {
223
+ var browser = checkBrowser();
224
+
225
+ if (browser.isFirefox) {
226
+ openUriUsingFirefox(uri, failCallback, successCallback);
227
+ } else if (browser.isChrome || browser.isIOS) {
228
+ // openUriWithTimeoutHack(uri, failCallback, successCallback);
229
+ openUriWithHiddenFrame(uri, failCallback, successCallback);
230
+ } else if (browser.isIE) {
231
+ openUriUsingIEInOlderWindows(uri, failCallback, successCallback);
232
+ } else if (browser.isSafari) {
233
+ openUriWithHiddenFrame(uri, failCallback, successCallback);
234
+ } else {
235
+ unsupportedCb();
236
+ //not supported, implement please
237
+ }
238
+ }
239
+ };
240
+ },
241
+ {},
242
+ ],
243
+ },
244
+ {},
245
+ [1]
246
+ )(1)
247
+ });
@@ -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/es/utils/date.mjs CHANGED
@@ -1,3 +1,5 @@
1
+ import { isNumber } from './is.mjs';
2
+
1
3
  function getDefaultValueFormatByType(type = "date") {
2
4
  switch (type) {
3
5
  case "year":
@@ -20,5 +22,27 @@ function getDefaultValueFormatByType(type = "date") {
20
22
  return "YYYY-MM-DD";
21
23
  }
22
24
  }
25
+ function formatDuration(duration, isSecond = false) {
26
+ if (!duration || !isNumber(duration)) return;
27
+ duration = isSecond ? duration * 1e3 : duration;
28
+ const list = [];
29
+ if (duration > 60 * 60 * 1e3) {
30
+ list.push(Math.floor(duration / (60 * 60 * 1e3)));
31
+ duration = duration % (60 * 60 * 1e3);
32
+ }
33
+ if (duration > 60 * 1e3) {
34
+ list.push(Math.floor(duration / (60 * 1e3)));
35
+ duration = duration % (60 * 1e3);
36
+ } else if (!list.length) {
37
+ list.push(0);
38
+ }
39
+ if (duration > 1e3) {
40
+ list.push(Math.floor(duration / 1e3));
41
+ } else {
42
+ list.push(0);
43
+ }
44
+ if (!list.length) return;
45
+ return list.map((val) => val >= 10 ? val : `0${val}`).join(":");
46
+ }
23
47
 
24
- export { getDefaultValueFormatByType };
48
+ export { formatDuration, getDefaultValueFormatByType };
@@ -0,0 +1,69 @@
1
+ import { unref } from 'vue';
2
+ import { createUniqueId } from './handler.mjs';
3
+ import { useApi } from '../hooks/useApi.mjs';
4
+
5
+ function blobToDataURL(bolb) {
6
+ return new Promise((resolve) => {
7
+ const a = new FileReader();
8
+ a.onload = function(e) {
9
+ resolve(e.target.result);
10
+ };
11
+ a.readAsDataURL(bolb);
12
+ });
13
+ }
14
+ async function presignedUrl(file) {
15
+ const { api } = useApi();
16
+ const fileList = file.name.split(".");
17
+ const res = await unref(api).post("file/presignedUrl", {
18
+ fileName: `${createUniqueId(1)}.${fileList[fileList.length - 1]}`
19
+ });
20
+ if (res.code === 200) {
21
+ return res;
22
+ } else {
23
+ return Promise.reject(res);
24
+ }
25
+ }
26
+ async function fileJsonUplaod(file) {
27
+ const { api } = useApi();
28
+ const result = await presignedUrl(file);
29
+ await unref(api).put(result.data.url, file, {
30
+ otherUrl: true,
31
+ xAmzAcl: true
32
+ });
33
+ return result;
34
+ }
35
+ async function fileFormUpload(file) {
36
+ const { api } = useApi();
37
+ try {
38
+ const formData = new FormData();
39
+ formData.append("file", file);
40
+ const res = await unref(api).post("/file/upload", formData, {
41
+ otherUrl: true,
42
+ xAmzAcl: false
43
+ });
44
+ return res;
45
+ } catch (err) {
46
+ return Promise.reject(err);
47
+ }
48
+ }
49
+ async function fileUpload(file, directTransmission = true) {
50
+ if (directTransmission) {
51
+ return await fileJsonUplaod(file);
52
+ } else {
53
+ return await fileFormUpload(file);
54
+ }
55
+ }
56
+ async function sizeToTextHandler(size) {
57
+ if (size < Math.pow(1024, 1)) {
58
+ return `${Math.floor(size / Math.pow(1024, 1) / 100) * 100}KB`;
59
+ }
60
+ if (size < Math.pow(1024, 2)) {
61
+ return `${Math.floor(size / Math.pow(1024, 2) / 100) * 100}MB`;
62
+ }
63
+ if (size < Math.pow(1024, 3)) {
64
+ return `${Math.floor(size / Math.pow(1024, 3) / 100) * 100}GB`;
65
+ }
66
+ return `${Math.floor(size / Math.pow(1024, 4) / 100) * 100}TB`;
67
+ }
68
+
69
+ export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler };
@@ -0,0 +1,52 @@
1
+ import { isString, isArray } from './is.mjs';
2
+
3
+ function getValueByProp(model, prop) {
4
+ if (isString(prop)) {
5
+ prop = prop.split(".").filter(Boolean);
6
+ }
7
+ if (!isArray(prop) || !prop?.length) return;
8
+ return prop.reduce((o, k) => o?.[k], model);
9
+ }
10
+ function setValueByProp(model, prop, value) {
11
+ let keys = [];
12
+ if (isString(prop)) {
13
+ keys = prop.split(".").filter(Boolean);
14
+ }
15
+ if (!isArray(keys) || !keys?.length) return;
16
+ const lastKey = keys.pop();
17
+ const parent = keys.reduce((o, k) => o?.[k], model);
18
+ if (parent) {
19
+ parent[lastKey] = value;
20
+ }
21
+ }
22
+ function genValueByProp(model = {}, prop, value) {
23
+ let keys = [];
24
+ if (isString(prop)) {
25
+ keys = prop.split(".").filter(Boolean);
26
+ }
27
+ if (!isArray(keys) || !keys?.length) return;
28
+ const lastKey = keys.pop();
29
+ const parent = keys.reduce((o, k) => {
30
+ if (!o?.[k]) {
31
+ o[k] = {};
32
+ }
33
+ return o[k];
34
+ }, model);
35
+ parent[lastKey] = value;
36
+ return model;
37
+ }
38
+ function clearSpace(value, type = "between") {
39
+ if (!isString(value)) return value;
40
+ if (type === "between") {
41
+ value = value.replace(/(^ *)|( *$)/g, "");
42
+ } else if (type === "before") {
43
+ value = value.replace(/^ */g, "");
44
+ } else if (type === "after") {
45
+ value = value.replace(/ *$/g, "");
46
+ } else if (type === "all") {
47
+ value = value.replace(/ /g, "");
48
+ }
49
+ return value;
50
+ }
51
+
52
+ export { clearSpace, genValueByProp, getValueByProp, setValueByProp };
@@ -4,7 +4,7 @@ function funRunHandler(target, ...args) {
4
4
  if (isFunction(target)) {
5
5
  return target(...args);
6
6
  }
7
- return target;
7
+ return cloneDeep(target);
8
8
  }
9
9
  const cloneDeep = (target) => {
10
10
  if (isVueProxy(target)) {
@@ -78,5 +78,25 @@ const withInstall = (comp) => {
78
78
  };
79
79
  return comp;
80
80
  };
81
+ async function copyText(text) {
82
+ if (navigator.clipboard) {
83
+ try {
84
+ await navigator.clipboard.writeText(text);
85
+ return;
86
+ } catch {
87
+ }
88
+ }
89
+ try {
90
+ const input = document.createElement("textarea");
91
+ input.value = text;
92
+ document.body.appendChild(input);
93
+ input.select();
94
+ document.execCommand("copy");
95
+ document.body.removeChild(input);
96
+ } catch (err) {
97
+ console.error(err);
98
+ return Promise.reject();
99
+ }
100
+ }
81
101
 
82
- export { cloneDeep, createUniqueId, funRunHandler, mergeDeep, withInstall };
102
+ export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall };
@@ -1,6 +1,9 @@
1
1
  export { parseRem, pxTorem, remToPx, vwToPx } from './adaptive.mjs';
2
2
  export { bus } from './bus.mjs';
3
3
  export { base64Decrypt, encryptToBase64, generateRandomCode } from './crypto.mjs';
4
- export { isArray, isBoolean, isEmpty, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSymbol, isUndefined, isVueProxy } from './is.mjs';
5
- export { cloneDeep, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
6
- export { getDefaultValueFormatByType } from './date.mjs';
4
+ export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSupportH265, isSymbol, isUndefined, isVueProxy } from './is.mjs';
5
+ export { cloneDeep, copyText, createUniqueId, funRunHandler, mergeDeep, withInstall } from './handler.mjs';
6
+ export { formatDuration, getDefaultValueFormatByType } from './date.mjs';
7
+ export { blobToDataURL, fileFormUpload, fileJsonUplaod, fileUpload, presignedUrl, sizeToTextHandler } from './file.mjs';
8
+ export { clearSpace, genValueByProp, getValueByProp, setValueByProp } from './form.mjs';
9
+ export { protocolcheckLoad, svgIconLoad } from './loadScript.mjs';
package/es/utils/is.mjs CHANGED
@@ -9,10 +9,34 @@ const isBoolean = (e) => typeof e === "boolean";
9
9
  const isUndefined = (e) => e === void 0;
10
10
  const isNull = (e) => e === null;
11
11
  const isSymbol = (e) => typeof e === "symbol";
12
- const isEmpty = (e) => isUndefined(e) || isNull(e) || !isNumber(e) && !e;
12
+ const isEmpty = (e) => !isBoolean(e) && (isUndefined(e) || isNull(e) || !isNumber(e) && !e);
13
13
  const isOverflowing = (e) => e.clientWidth < e.scrollWidth || e.clientHeight < e.scrollHeight;
14
14
  const isVueProxy = (e) => {
15
15
  return isRef(e) || isReactive(e) || isReadonly(e) || isProxy(e);
16
16
  };
17
+ const isFile = (e) => {
18
+ return e instanceof File;
19
+ };
20
+ function isSupportH265() {
21
+ const ua = navigator.userAgent.toLocaleLowerCase();
22
+ let isSupport = true;
23
+ let isVersionLow = false;
24
+ const chromeMatch = ua.match(/chrome\/(\d+)/) || ua.match(/chromium\/(\d+)/);
25
+ if (ua.match(/edge\/(\d+)/)) {
26
+ isSupport = false;
27
+ } else if (ua.match(/edg\/(\d+)/)) {
28
+ isSupport = false;
29
+ } else if (chromeMatch) {
30
+ const version2 = parseInt(chromeMatch[1], 10);
31
+ isSupport = true;
32
+ isVersionLow = !version2 || version2 < 104;
33
+ } else if (ua.match(/firefox\/(\d+)/)) {
34
+ isSupport = false;
35
+ } else if (ua.match(/version\/(\d+)/) && ua.indexOf("safari") > -1) {
36
+ version = parseInt(RegExp.$1, 10);
37
+ isSupport = true;
38
+ }
39
+ return { isSupport, isVersionLow };
40
+ }
17
41
 
18
- export { isArray, isBoolean, isEmpty, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSymbol, isUndefined, isVueProxy };
42
+ export { isArray, isBoolean, isEmpty, isFile, isFunction, isNull, isNumber, isObject, isOverflowing, isString, isSupportH265, isSymbol, isUndefined, isVueProxy };
@@ -0,0 +1,33 @@
1
+ async function loadPlugins(src) {
2
+ const res = await fetch(src);
3
+ const jsCode = await res.text();
4
+ const runner = new Function(jsCode);
5
+ runner.call(window);
6
+ }
7
+ let isLoadProtocolcheck = false;
8
+ async function protocolcheckLoad() {
9
+ if (window.protocolCheck || isLoadProtocolcheck) return;
10
+ try {
11
+ await loadPlugins(
12
+ new URL("../static/protocolcheck.js", import.meta.url).href
13
+ );
14
+ } catch (err) {
15
+ console.error(err);
16
+ }
17
+ isLoadSvgIcon = false;
18
+ }
19
+ let isLoadSvgIcon = false;
20
+ async function svgIconLoad() {
21
+ if (isLoadSvgIcon) return;
22
+ isLoadSvgIcon = true;
23
+ try {
24
+ await loadPlugins(
25
+ new URL("../static/hy-svg-icons.js", import.meta.url).href
26
+ );
27
+ } catch (err) {
28
+ console.error(err);
29
+ }
30
+ isLoadSvgIcon = false;
31
+ }
32
+
33
+ export { protocolcheckLoad, svgIconLoad };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.1.5";
1
+ const version = "0.2.0";
2
2
 
3
3
  export { version };