hy-dispatch-ui-v3 0.1.6 → 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 (160) hide show
  1. package/README.md +47 -0
  2. package/dist/tailwind.css +349 -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 +22 -1
  9. package/es/components/appCutter/appCutter.vue.mjs +202 -129
  10. package/es/components/appDatePicker/appDatePicker.vue.mjs +1 -1
  11. package/es/components/appForm/appForm.vue.mjs +132 -209
  12. package/es/components/appForm/cpns/appFormItem.vue.mjs +312 -0
  13. package/es/components/appForm/cpns/arrayItem.vue.mjs +305 -0
  14. package/es/components/appForm/cpns/extraItem.vue.mjs +140 -0
  15. package/es/components/appForm/js/index.mjs +46 -24
  16. package/es/components/appForm/js/useAppForm.mjs +30 -6
  17. package/es/components/appForm/style/appForm.scss +53 -0
  18. package/es/components/appIcon/appIcon.vue.mjs +2 -1
  19. package/es/components/appIconBox/style/appIconBox.scss +0 -1
  20. package/es/components/appInput/appInput.vue.mjs +99 -0
  21. package/es/components/appInput/index.mjs +6 -0
  22. package/es/components/appMenu/appMenu.vue.mjs +129 -0
  23. package/es/components/appMenu/index.mjs +6 -0
  24. package/es/components/appMenu/style/appMenu.scss +145 -0
  25. package/es/components/appOrgCascader/appOrgCascader.vue.mjs +14 -10
  26. package/es/components/appSearch/appSearch.vue.mjs +55 -211
  27. package/es/components/appSearch/cpns/appSearchItem.vue.mjs +238 -0
  28. package/es/components/appSearch/js/index.mjs +20 -8
  29. package/es/components/appSearch/js/useAppSearch.mjs +10 -5
  30. package/es/components/appSearch/style/appSearch.scss +10 -0
  31. package/es/components/appTable/appTable.vue.mjs +312 -158
  32. package/es/components/appTable/cpns/columnSelect.vue.mjs +151 -156
  33. package/es/components/appTable/cpns/columnSelectItem.vue2.mjs +104 -110
  34. package/es/components/appTable/cpns/headerItem.vue.mjs +98 -0
  35. package/es/components/appTable/cpns/virtualTable.vue.mjs +560 -0
  36. package/es/components/appTable/js/index.mjs +46 -20
  37. package/es/components/appTable/js/search.mjs +1 -2
  38. package/es/components/appTable/js/useAppTable.mjs +58 -14
  39. package/es/components/appTable/style/appTable.scss +16 -0
  40. package/es/components/appTooltip/appTooltip.vue.mjs +24 -13
  41. package/es/components/appTree/appTree.vue.mjs +304 -0
  42. package/es/components/appTree/index.mjs +6 -0
  43. package/es/components/appTree/js/index.mjs +531 -0
  44. package/es/components/appUserAvatar/appUserAvatar.vue.mjs +9 -8
  45. package/es/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  46. package/es/components/appVideoPlayer/appVideoPlayer.vue.mjs +647 -0
  47. package/es/components/appVideoPlayer/cpns/mediaLoading.vue.mjs +35 -0
  48. package/es/components/appVideoPlayer/index.mjs +6 -0
  49. package/es/components/appVideoPlayer/js/index.mjs +426 -0
  50. package/es/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  51. package/es/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  52. package/es/components/index.mjs +5 -0
  53. package/es/hooks/index.mjs +3 -0
  54. package/es/hooks/useApi.mjs +4 -4
  55. package/es/hooks/useAudioPlayerConfig.mjs +12 -0
  56. package/es/hooks/useGlobalConfig.mjs +18 -7
  57. package/es/hooks/useLocale.mjs +3 -11
  58. package/es/hooks/useMixins.mjs +1 -1
  59. package/es/hooks/usePermissionMap.mjs +12 -0
  60. package/es/hooks/useUserAvatarMap.mjs +2 -3
  61. package/es/hooks/useVideoPlayerConfig.mjs +12 -0
  62. package/es/index.mjs +14 -4
  63. package/es/locale/en.mjs +52 -3
  64. package/es/locale/zh_CN.mjs +48 -3
  65. package/es/make-installer.mjs +2 -0
  66. package/es/static/hy-svg-icons.js +462 -0
  67. package/es/static/protocolcheck.js +247 -0
  68. package/es/style/element/element.scss +9 -0
  69. package/es/style/element/index.scss +6 -3
  70. package/es/style/index.scss +11 -0
  71. package/es/style/theme.scss +73 -0
  72. package/es/utils/date.mjs +25 -1
  73. package/es/utils/file.mjs +5 -4
  74. package/es/utils/form.mjs +52 -0
  75. package/es/utils/handler.mjs +22 -2
  76. package/es/utils/index.mjs +6 -4
  77. package/es/utils/is.mjs +23 -2
  78. package/es/utils/loadScript.mjs +33 -0
  79. package/es/version.mjs +1 -1
  80. package/lib/components/appAudioPlayer/appAudioPlayer.vue.js +466 -0
  81. package/lib/components/appAudioPlayer/index.js +11 -0
  82. package/lib/components/appAudioPlayer/js/index.js +329 -0
  83. package/lib/components/appAudioPlayer/style/appAudioPlayer.scss +319 -0
  84. package/lib/components/appButton/style/appButton.scss +0 -1
  85. package/lib/components/appConfigProvider/appConfigProvider.vue.js +22 -1
  86. package/lib/components/appCutter/appCutter.vue.js +201 -128
  87. package/lib/components/appDatePicker/appDatePicker.vue.js +1 -1
  88. package/lib/components/appForm/appForm.vue.js +129 -206
  89. package/lib/components/appForm/cpns/appFormItem.vue.js +316 -0
  90. package/lib/components/appForm/cpns/arrayItem.vue.js +309 -0
  91. package/lib/components/appForm/cpns/extraItem.vue.js +144 -0
  92. package/lib/components/appForm/js/index.js +48 -23
  93. package/lib/components/appForm/js/useAppForm.js +30 -6
  94. package/lib/components/appForm/style/appForm.scss +53 -0
  95. package/lib/components/appIcon/appIcon.vue.js +2 -1
  96. package/lib/components/appIconBox/style/appIconBox.scss +0 -1
  97. package/lib/components/appInput/appInput.vue.js +103 -0
  98. package/lib/components/appInput/index.js +11 -0
  99. package/lib/components/appMenu/appMenu.vue.js +133 -0
  100. package/lib/components/appMenu/index.js +11 -0
  101. package/lib/components/appMenu/style/appMenu.scss +145 -0
  102. package/lib/components/appOrgCascader/appOrgCascader.vue.js +14 -10
  103. package/lib/components/appSearch/appSearch.vue.js +51 -207
  104. package/lib/components/appSearch/cpns/appSearchItem.vue.js +242 -0
  105. package/lib/components/appSearch/js/index.js +20 -7
  106. package/lib/components/appSearch/js/useAppSearch.js +10 -5
  107. package/lib/components/appSearch/style/appSearch.scss +10 -0
  108. package/lib/components/appTable/appTable.vue.js +319 -165
  109. package/lib/components/appTable/cpns/columnSelect.vue.js +151 -156
  110. package/lib/components/appTable/cpns/columnSelectItem.vue2.js +105 -111
  111. package/lib/components/appTable/cpns/headerItem.vue.js +102 -0
  112. package/lib/components/appTable/cpns/virtualTable.vue.js +564 -0
  113. package/lib/components/appTable/js/index.js +47 -19
  114. package/lib/components/appTable/js/search.js +1 -2
  115. package/lib/components/appTable/js/useAppTable.js +57 -13
  116. package/lib/components/appTable/style/appTable.scss +16 -0
  117. package/lib/components/appTooltip/appTooltip.vue.js +23 -12
  118. package/lib/components/appTree/appTree.vue.js +308 -0
  119. package/lib/components/appTree/index.js +11 -0
  120. package/lib/components/appTree/js/index.js +533 -0
  121. package/lib/components/appUserAvatar/appUserAvatar.vue.js +9 -8
  122. package/lib/components/appUserAvatar/style/appUserAvatar.scss +0 -1
  123. package/lib/components/appVideoPlayer/appVideoPlayer.vue.js +651 -0
  124. package/lib/components/appVideoPlayer/cpns/mediaLoading.vue.js +39 -0
  125. package/lib/components/appVideoPlayer/index.js +11 -0
  126. package/lib/components/appVideoPlayer/js/index.js +429 -0
  127. package/lib/components/appVideoPlayer/style/appVideoPlayer.scss +275 -0
  128. package/lib/components/appVideoPlayer/style/mediaLoading.scss +62 -0
  129. package/lib/components/index.js +42 -32
  130. package/lib/hooks/index.js +9 -0
  131. package/lib/hooks/useApi.js +4 -4
  132. package/lib/hooks/useAudioPlayerConfig.js +15 -0
  133. package/lib/hooks/useGlobalConfig.js +18 -7
  134. package/lib/hooks/useLocale.js +3 -11
  135. package/lib/hooks/useMixins.js +1 -1
  136. package/lib/hooks/usePermissionMap.js +15 -0
  137. package/lib/hooks/useUserAvatarMap.js +1 -2
  138. package/lib/hooks/useVideoPlayerConfig.js +15 -0
  139. package/lib/index.js +62 -33
  140. package/lib/locale/en.js +52 -3
  141. package/lib/locale/zh_CN.js +48 -3
  142. package/lib/make-installer.js +2 -0
  143. package/lib/static/hy-svg-icons.js +459 -8
  144. package/lib/static/protocolcheck.js +249 -0
  145. package/lib/style/element/element.scss +9 -0
  146. package/lib/style/element/index.scss +6 -3
  147. package/lib/style/index.scss +11 -0
  148. package/lib/style/theme.scss +73 -0
  149. package/lib/utils/date.js +25 -0
  150. package/lib/utils/file.js +4 -4
  151. package/lib/utils/form.js +57 -0
  152. package/lib/utils/handler.js +22 -1
  153. package/lib/utils/index.js +11 -1
  154. package/lib/utils/is.js +23 -1
  155. package/lib/utils/loadScript.js +37 -0
  156. package/lib/version.js +1 -1
  157. package/package.json +12 -10
  158. package/es/config/index.mjs +0 -1
  159. package/es/static/hy-svg-icons.mjs +0 -11
  160. 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;
package/lib/utils/file.js CHANGED
@@ -48,10 +48,11 @@ async function fileFormUpload(file) {
48
48
  return Promise.reject(err);
49
49
  }
50
50
  }
51
- let directTransmission = true;
52
- async function fileUpload(file) {
53
- {
51
+ async function fileUpload(file, directTransmission = true) {
52
+ if (directTransmission) {
54
53
  return await fileJsonUplaod(file);
54
+ } else {
55
+ return await fileFormUpload(file);
55
56
  }
56
57
  }
57
58
  async function sizeToTextHandler(size) {
@@ -68,7 +69,6 @@ async function sizeToTextHandler(size) {
68
69
  }
69
70
 
70
71
  exports.blobToDataURL = blobToDataURL;
71
- exports.directTransmission = directTransmission;
72
72
  exports.fileFormUpload = fileFormUpload;
73
73
  exports.fileJsonUplaod = fileJsonUplaod;
74
74
  exports.fileUpload = fileUpload;
@@ -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;
@@ -7,6 +7,8 @@ var is = require('./is.js');
7
7
  var handler = require('./handler.js');
8
8
  var date = require('./date.js');
9
9
  var file = require('./file.js');
10
+ var form = require('./form.js');
11
+ var loadScript = require('./loadScript.js');
10
12
 
11
13
 
12
14
 
@@ -28,19 +30,27 @@ exports.isNumber = is.isNumber;
28
30
  exports.isObject = is.isObject;
29
31
  exports.isOverflowing = is.isOverflowing;
30
32
  exports.isString = is.isString;
33
+ exports.isSupportH265 = is.isSupportH265;
31
34
  exports.isSymbol = is.isSymbol;
32
35
  exports.isUndefined = is.isUndefined;
33
36
  exports.isVueProxy = is.isVueProxy;
34
37
  exports.cloneDeep = handler.cloneDeep;
38
+ exports.copyText = handler.copyText;
35
39
  exports.createUniqueId = handler.createUniqueId;
36
40
  exports.funRunHandler = handler.funRunHandler;
37
41
  exports.mergeDeep = handler.mergeDeep;
38
42
  exports.withInstall = handler.withInstall;
43
+ exports.formatDuration = date.formatDuration;
39
44
  exports.getDefaultValueFormatByType = date.getDefaultValueFormatByType;
40
45
  exports.blobToDataURL = file.blobToDataURL;
41
- exports.directTransmission = file.directTransmission;
42
46
  exports.fileFormUpload = file.fileFormUpload;
43
47
  exports.fileJsonUplaod = file.fileJsonUplaod;
44
48
  exports.fileUpload = file.fileUpload;
45
49
  exports.presignedUrl = file.presignedUrl;
46
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,7 +11,7 @@ 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);
@@ -19,6 +19,27 @@ const isVueProxy = (e) => {
19
19
  const isFile = (e) => {
20
20
  return e instanceof File;
21
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
+ }
22
43
 
23
44
  exports.isArray = isArray;
24
45
  exports.isBoolean = isBoolean;
@@ -30,6 +51,7 @@ exports.isNumber = isNumber;
30
51
  exports.isObject = isObject;
31
52
  exports.isOverflowing = isOverflowing;
32
53
  exports.isString = isString;
54
+ exports.isSupportH265 = isSupportH265;
33
55
  exports.isSymbol = isSymbol;
34
56
  exports.isUndefined = isUndefined;
35
57
  exports.isVueProxy = isVueProxy;
@@ -0,0 +1,37 @@
1
+ 'use strict';
2
+
3
+ var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
4
+ async function loadPlugins(src) {
5
+ const res = await fetch(src);
6
+ const jsCode = await res.text();
7
+ const runner = new Function(jsCode);
8
+ runner.call(window);
9
+ }
10
+ let isLoadProtocolcheck = false;
11
+ async function protocolcheckLoad() {
12
+ if (window.protocolCheck || isLoadProtocolcheck) return;
13
+ try {
14
+ await loadPlugins(
15
+ new URL("../static/protocolcheck.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/loadScript.js', document.baseURI).href))).href
16
+ );
17
+ } catch (err) {
18
+ console.error(err);
19
+ }
20
+ isLoadSvgIcon = false;
21
+ }
22
+ let isLoadSvgIcon = false;
23
+ async function svgIconLoad() {
24
+ if (isLoadSvgIcon) return;
25
+ isLoadSvgIcon = true;
26
+ try {
27
+ await loadPlugins(
28
+ new URL("../static/hy-svg-icons.js", (typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils/loadScript.js', document.baseURI).href))).href
29
+ );
30
+ } catch (err) {
31
+ console.error(err);
32
+ }
33
+ isLoadSvgIcon = false;
34
+ }
35
+
36
+ exports.protocolcheckLoad = protocolcheckLoad;
37
+ exports.svgIconLoad = svgIconLoad;
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.1.6";
3
+ const version = "0.2.0";
4
4
 
5
5
  exports.version = version;