@varlet/cli 2.0.0-alpha.1664527888620 → 2.0.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/cli",
3
- "version": "2.0.0-alpha.1664527888620",
3
+ "version": "2.0.0",
4
4
  "description": "cli of varlet",
5
5
  "bin": {
6
6
  "varlet-cli": "./lib/index.js"
@@ -32,10 +32,10 @@
32
32
  "@babel/helper-plugin-utils": "^7.14.5",
33
33
  "@babel/preset-env": "^7.14.8",
34
34
  "@babel/preset-typescript": "^7.14.5",
35
- "@varlet/icons": "2.0.0-alpha.1664527888620",
36
- "@varlet/markdown-vite-plugin": "2.0.0-alpha.1664527888620",
37
- "@varlet/shared": "2.0.0-alpha.1664527888620",
38
- "@varlet/touch-emulator": "2.0.0-alpha.1664527888620",
35
+ "@varlet/icons": "2.0.0",
36
+ "@varlet/markdown-vite-plugin": "2.0.0",
37
+ "@varlet/shared": "2.0.0",
38
+ "@varlet/touch-emulator": "2.0.0",
39
39
  "@vitejs/plugin-vue": "3.0.1",
40
40
  "@vitejs/plugin-vue-jsx": "2.0.0",
41
41
  "@vue/babel-plugin-jsx": "1.1.1",
@@ -80,7 +80,7 @@
80
80
  "@types/semver": "^7.3.9"
81
81
  },
82
82
  "peerDependencies": {
83
- "@varlet/touch-emulator": "2.0.0-alpha.1664527888620",
83
+ "@varlet/touch-emulator": "2.0.0",
84
84
  "@vue/runtime-core": "3.2.16",
85
85
  "@vue/test-utils": "^2.0.2",
86
86
  "clipboard": "^2.0.6",
@@ -1,14 +1,14 @@
1
1
  <template>
2
2
  <div :class="n()">
3
3
  <div :class="n('linear')" v-if="mode === 'linear'">
4
- <div :class="n('linear-block')" :style="{ height: toSizeUnit(lineWidth) }" v-bind="$attrs">
4
+ <div :class="n('linear-block')" :style="{ height: toSizeUnit(lineWidth) }">
5
5
  <div :class="n('linear-background')" v-if="track" :style="{ background: trackColor }"></div>
6
6
  <div
7
7
  :class="classes(n('linear-certain'), [ripple, n('linear-ripple')])"
8
8
  :style="{ background: color, width: linearProps.width }"
9
9
  ></div>
10
10
  </div>
11
- <div :class="n('linear-label')" v-bind="$attrs" v-if="label">
11
+ <div :class="classes(n('linear-label'), [labelClass, labelClass])" v-if="label">
12
12
  <slot>
13
13
  {{ linearProps.roundValue }}
14
14
  </slot>
@@ -44,7 +44,7 @@
44
44
  ></circle>
45
45
  </svg>
46
46
 
47
- <div :class="n('circle-label')" v-if="label" v-bind="$attrs">
47
+ <div :class="classes(n('circle-label'), [labelClass, labelClass])" v-if="label">
48
48
  <slot>
49
49
  {{ circleProps.roundValue }}
50
50
  </slot>
@@ -64,7 +64,6 @@ const { n, classes } = createNamespace('progress')
64
64
 
65
65
  export default defineComponent({
66
66
  name: 'VarProgress',
67
- inheritAttrs: false,
68
67
  props,
69
68
  setup(props) {
70
69
  const linearProps = computed(() => {
@@ -1,55 +1,52 @@
1
+ import { type PropType } from 'vue'
2
+
1
3
  function modeValidator(mode: string): boolean {
2
4
  return ['linear', 'circle'].includes(mode)
3
5
  }
4
6
 
7
+ type ProgressMode = 'linear' | 'circle'
8
+
5
9
  export const props = {
6
- // progress 模式
7
10
  mode: {
8
- type: String,
11
+ type: String as PropType<ProgressMode>,
9
12
  default: 'linear',
10
13
  validator: modeValidator,
11
14
  },
12
- // progress 线宽
13
15
  lineWidth: {
14
16
  type: [Number, String],
15
17
  default: 4,
16
18
  },
17
- // progress 颜色
18
19
  color: {
19
20
  type: String,
20
21
  },
21
- // progress 轨道颜色
22
22
  trackColor: {
23
23
  type: String,
24
24
  },
25
- // 是否添加水波纹效果
26
25
  ripple: {
27
26
  type: Boolean,
28
27
  default: false,
29
28
  },
30
- // progress 值
31
29
  value: {
32
30
  type: [Number, String],
33
31
  default: 0,
34
32
  },
35
- // 是否显示label
36
33
  label: {
37
34
  type: Boolean,
38
35
  default: false,
39
36
  },
40
- // circle 的尺寸
37
+ labelClass: {
38
+ type: String,
39
+ },
41
40
  size: {
42
41
  type: [Number, String],
43
42
  default: 40,
44
43
  },
45
- // circle的原点
46
44
  rotate: {
47
45
  type: Number,
48
46
  default: 0,
49
47
  },
50
- // 是否显示 circle 轨道
51
48
  track: {
52
49
  type: Boolean,
53
50
  default: true,
54
- },
51
+ }
55
52
  }
@@ -50,10 +50,16 @@ const handleSidebarChange = (menu: Menu) => {
50
50
  }
51
51
 
52
52
  const confirmClose = () => {
53
- if (!window.confirm('The code will no longer be saved after closing. Are you sure you want to close?')) {
53
+ const key = 'VARLET_UI_PLAYGROUND_HAS_BEEN_CLOSED'
54
+
55
+ if (
56
+ !localStorage.getItem(key) &&
57
+ !window.confirm('The code will no longer be saved after closing. Are you sure you want to close?')
58
+ ) {
54
59
  return
55
60
  }
56
61
 
62
+ localStorage.setItem(key, 'true')
57
63
  context.showPlayground = false
58
64
  }
59
65
 
@@ -305,7 +311,7 @@ iframe {
305
311
  }
306
312
 
307
313
  h2 {
308
- margin: 30px 0 20px;
314
+ margin: 30px 0;
309
315
  font-size: 25px;
310
316
  }
311
317
 
@@ -327,9 +333,16 @@ iframe {
327
333
  line-height: 26px;
328
334
  border-radius: 4px;
329
335
  background: var(--site-config-color-bar);
330
- list-style: none;
331
336
  margin: 14px 0 0;
332
337
  padding: 0;
338
+
339
+ li {
340
+ margin-bottom: 4px;
341
+ }
342
+ }
343
+
344
+ ul,ol {
345
+ padding: 0 0 0 18px;
333
346
  }
334
347
 
335
348
  pre {
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <var-button>组件库从我开始</var-button>
5
+ <var-button>按钮起步</var-button>
6
6
  ```
7
7
 
8
8
  ```vue
@@ -11,7 +11,7 @@ import BasicUse from '../example/BasicUse'
11
11
 
12
12
  ### 主题色按钮
13
13
  ```html
14
- <var-button color="#009688">组件库从我开始</var-button>
14
+ <var-button color="#009688">按钮起步</var-button>
15
15
  ```
16
16
 
17
17
  ```vue
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <var-button>组件库从我开始</var-button>
5
+ <var-button>按钮起步</var-button>
6
6
  ```
7
7
 
8
8
  ```vue
@@ -11,7 +11,7 @@ import BasicUse from '../example/BasicUse'
11
11
 
12
12
  ### 主题色按钮
13
13
  ```html
14
- <var-button color="#009688">组件库从我开始</var-button>
14
+ <var-button color="#009688">按钮起步</var-button>
15
15
  ```
16
16
 
17
17
  ```vue
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <button class="var-button" :style="{ background: color }">
3
- {{ pack.button }} ->
3
+ {{ pack.button }}
4
4
  <slot />
5
5
  </button>
6
6
  </template>
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <var-button>组件库从我开始</var-button>
5
+ <var-button>按钮起步</var-button>
6
6
  ```
7
7
 
8
8
  ```vue
@@ -11,7 +11,7 @@ import BasicUse from '../example/BasicUse'
11
11
 
12
12
  ### 主题色按钮
13
13
  ```html
14
- <var-button color="#009688">组件库从我开始</var-button>
14
+ <var-button color="#009688">按钮起步</var-button>
15
15
  ```
16
16
 
17
17
  ```vue
@@ -22,7 +22,7 @@ export default defineComponent({
22
22
 
23
23
  return (
24
24
  <button class="var-button" style={{ background: color }} onClick={handleClick}>
25
- {pack.value.button} -{'> '}
25
+ {pack.value.button}
26
26
  {slots.default?.()}
27
27
  </button>
28
28
  )
@@ -2,7 +2,7 @@
2
2
 
3
3
  ### 基本使用
4
4
  ```html
5
- <var-button>组件库从我开始</var-button>
5
+ <var-button>按钮起步</var-button>
6
6
  ```
7
7
 
8
8
  ```vue
@@ -11,7 +11,7 @@ import BasicUse from '../example/BasicUse'
11
11
 
12
12
  ### 主题色按钮
13
13
  ```html
14
- <var-button color="#009688">组件库从我开始</var-button>
14
+ <var-button color="#009688">按钮起步</var-button>
15
15
  ```
16
16
 
17
17
  ```vue
@@ -152,7 +152,7 @@ module.exports = {
152
152
  },
153
153
  versions: null,
154
154
  github: 'https://github.com/varletjs/varlet',
155
- playground: 'https://varlet-ui-playground-git-dev-varletjs.vercel.app',
155
+ playground: 'https://varlet.gitee.io/varlet-ui-playground',
156
156
  darkMode: true,
157
157
  },
158
158
  clipboard: {