@vyr/design 0.0.33 → 0.0.35

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.
@@ -1,6 +1,7 @@
1
1
  import '../font/iconfont.css'
2
2
  import '../theme/global.less'
3
3
  import { reactive } from "vue"
4
+ import { ThemeService } from './ThemeService'
4
5
 
5
6
  interface ThemeConfig {
6
7
  whiteColor: string
@@ -126,7 +127,7 @@ class Theme {
126
127
  optionDisabledBackgroundColor: 'rgba(77, 77, 77, 1)',
127
128
 
128
129
  optionsScrollMargin: { unit: 'px', value: 6 },
129
- optionsBorderColor: 'rgba(77, 77, 77, 1)',
130
+ optionsBorderColor: 'rgba(45, 45, 45, 1)',
130
131
  optionsBackgroundColor: 'rgba(30, 30, 30, 1)',
131
132
 
132
133
  dialogHeaderBackgroundColor: 'rgba(30, 30, 30, 0.9)',
@@ -156,4 +157,11 @@ class Theme {
156
157
 
157
158
  Theme.update(Theme.config)
158
159
 
159
- export { ThemeConfig, Theme }
160
+ export { ThemeConfig, Theme }
161
+
162
+ //使用主题服务,代替现在的旧的主题处理方式,且将css预处理器替换为 sass
163
+ const themeService = new ThemeService()
164
+
165
+ export {
166
+ themeService
167
+ }
@@ -0,0 +1,24 @@
1
+ function fallbackCopyTextToClipboard(text: string) {
2
+ const textArea = document.createElement("textarea")
3
+ textArea.setAttribute('style', 'position:fixed;z-index:-999;')
4
+ textArea.value = text
5
+ document.body.appendChild(textArea)
6
+ textArea.focus()
7
+ textArea.select()
8
+
9
+ try {
10
+ document.execCommand('copy');
11
+ } catch (err) {
12
+ console.log('复制失败')
13
+ }
14
+
15
+ document.body.removeChild(textArea);
16
+ }
17
+
18
+ const copy = (content: string) => {
19
+ return navigator.clipboard ? navigator.clipboard.writeText(content) : fallbackCopyTextToClipboard(content)
20
+ }
21
+
22
+ export {
23
+ copy
24
+ }
package/src/tool/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './ArrayUtils'
2
2
  export * from './Color'
3
3
  export * from './Listener'
4
- export * from './Draggable'
4
+ export * from './Draggable'
5
+ export * from './copy'