@varlet/ui 1.23.6 → 1.23.7-alpha.4

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,4 +1,4 @@
1
- import { defineComponent } from 'vue';
1
+ import { computed, defineComponent } from 'vue';
2
2
  import { props } from './props';
3
3
  import { toNumber } from '../utils/shared';
4
4
  import { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
@@ -29,8 +29,9 @@ export function render(_ctx, _cache) {
29
29
  return _openBlock(), _createElementBlock("div", _hoisted_1, [_ctx.type === 'circle' ? (_openBlock(), _createElementBlock("div", _hoisted_2, [_createElementVNode("span", {
30
30
  class: "var-loading__circle-block",
31
31
  style: _normalizeStyle({
32
- width: _ctx.toNumber(_ctx.radius) * 2 + 'px',
33
- height: _ctx.toNumber(_ctx.radius) * 2 + 'px'
32
+ width: _ctx.getRadius * 2 + 'px',
33
+ height: _ctx.getRadius * 2 + 'px',
34
+ color: _ctx.color
34
35
  })
35
36
  }, _hoisted_4, 4
36
37
  /* STYLE */
@@ -66,16 +67,25 @@ export default defineComponent({
66
67
  name: 'VarLoading',
67
68
  props,
68
69
 
69
- setup() {
70
+ setup(props) {
70
71
  var loadingTypeDict = {
71
72
  wave: 5,
72
73
  cube: 4,
73
74
  rect: 8,
74
75
  disappear: 3
75
76
  };
77
+ var sizeDict = {
78
+ mini: 9,
79
+ small: 12,
80
+ normal: 15,
81
+ large: 18
82
+ };
83
+ var getRadius = computed(() => {
84
+ return props.radius ? toNumber(props.radius) : sizeDict[props.size];
85
+ });
76
86
  return {
77
87
  loadingTypeDict,
78
- toNumber
88
+ getRadius
79
89
  };
80
90
  }
81
91
 
@@ -12,8 +12,7 @@ export var props = {
12
12
  validator: typeValidator
13
13
  },
14
14
  radius: {
15
- type: [String, Number],
16
- default: 15
15
+ type: [String, Number]
17
16
  },
18
17
  // loading尺寸
19
18
  size: {
@@ -0,0 +1,5 @@
1
+ import { StyleVars } from '../../../types'
2
+
3
+ declare const dark: StyleVars
4
+
5
+ export default dark
@@ -839,6 +839,10 @@
839
839
  "type": "string",
840
840
  "description": "loading 的大小,可选值位 `large` `normal` `small` `mini` 默认值:normal"
841
841
  },
842
+ "var-loading/radius": {
843
+ "type": "string | number",
844
+ "description": "loading 的类型为`circle`时,可设置其大小 默认值:-"
845
+ },
842
846
  "var-menu/v-model:show": {
843
847
  "type": "string",
844
848
  "description": "是否显示菜单 默认值:default"
@@ -320,7 +320,8 @@
320
320
  "attributes": [
321
321
  "color",
322
322
  "type",
323
- "size"
323
+ "size",
324
+ "radius"
324
325
  ]
325
326
  },
326
327
  "var-locale": {
@@ -2534,6 +2534,15 @@
2534
2534
  "type": "string",
2535
2535
  "kind": "expression"
2536
2536
  }
2537
+ },
2538
+ {
2539
+ "name": "radius",
2540
+ "description": "loading 的类型为`circle`时,可设置其大小",
2541
+ "default": "-",
2542
+ "value": {
2543
+ "type": "string | number",
2544
+ "kind": "expression"
2545
+ }
2537
2546
  }
2538
2547
  ],
2539
2548
  "events": [],
@@ -37,8 +37,9 @@ function render(_ctx, _cache) {
37
37
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_1, [_ctx.type === 'circle' ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", _hoisted_2, [(0, _vue.createElementVNode)("span", {
38
38
  class: "var-loading__circle-block",
39
39
  style: (0, _vue.normalizeStyle)({
40
- width: _ctx.toNumber(_ctx.radius) * 2 + 'px',
41
- height: _ctx.toNumber(_ctx.radius) * 2 + 'px'
40
+ width: _ctx.getRadius * 2 + 'px',
41
+ height: _ctx.getRadius * 2 + 'px',
42
+ color: _ctx.color
42
43
  })
43
44
  }, _hoisted_4, 4
44
45
  /* STYLE */
@@ -75,16 +76,25 @@ var _default = (0, _vue.defineComponent)({
75
76
  name: 'VarLoading',
76
77
  props: _props.props,
77
78
 
78
- setup() {
79
+ setup(props) {
79
80
  var loadingTypeDict = {
80
81
  wave: 5,
81
82
  cube: 4,
82
83
  rect: 8,
83
84
  disappear: 3
84
85
  };
86
+ var sizeDict = {
87
+ mini: 9,
88
+ small: 12,
89
+ normal: 15,
90
+ large: 18
91
+ };
92
+ var getRadius = (0, _vue.computed)(() => {
93
+ return props.radius ? (0, _shared.toNumber)(props.radius) : sizeDict[props.size];
94
+ });
85
95
  return {
86
96
  loadingTypeDict,
87
- toNumber: _shared.toNumber
97
+ getRadius
88
98
  };
89
99
  }
90
100
 
@@ -21,8 +21,7 @@ var props = {
21
21
  validator: typeValidator
22
22
  },
23
23
  radius: {
24
- type: [String, Number],
25
- default: 15
24
+ type: [String, Number]
26
25
  },
27
26
  // loading尺寸
28
27
  size: {
@@ -0,0 +1,5 @@
1
+ import { StyleVars } from '../../../types'
2
+
3
+ declare const dark: StyleVars
4
+
5
+ export default dark
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "1.23.6",
3
+ "version": "1.23.7-alpha.4+21c1a885",
4
4
  "description": "A material like components library",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",
@@ -49,7 +49,7 @@
49
49
  "peerDependencies": {
50
50
  "vue": "^3.2.0"
51
51
  },
52
- "gitHead": "3bc826ed4004dbfeebfd5b8399508e248a71828b",
52
+ "gitHead": "21c1a8859ba686314f1422afdc34e881fbcc92eb",
53
53
  "devDependencies": {
54
54
  "@varlet/cli": "^1.23.5"
55
55
  },