@varlet/ui 1.27.7 → 1.27.9-alpha.1653036733481

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 (77) hide show
  1. package/es/badge/Badge.js +1 -1
  2. package/es/card/Card.js +213 -12
  3. package/es/card/card.css +1 -1
  4. package/es/card/card.less +109 -7
  5. package/es/card/props.js +18 -0
  6. package/es/col/Col.js +6 -6
  7. package/es/col/col.css +1 -1
  8. package/es/col/col.less +27 -2
  9. package/es/index-bar/IndexBar.js +4 -4
  10. package/es/index-bar/props.js +1 -1
  11. package/es/loading/Loading.js +5 -14
  12. package/es/loading/loading.css +1 -1
  13. package/es/loading/loading.less +20 -0
  14. package/es/picker/Picker.js +10 -7
  15. package/es/picker/props.js +4 -0
  16. package/es/progress/Progress.js +14 -11
  17. package/es/progress/progress.css +1 -1
  18. package/es/progress/progress.less +3 -0
  19. package/es/progress/props.js +1 -1
  20. package/es/rate/Rate.js +4 -2
  21. package/es/rate/props.js +2 -4
  22. package/es/rate/rate.css +1 -1
  23. package/es/rate/rate.less +7 -0
  24. package/es/select/Select.js +3 -1
  25. package/es/slider/Slider.js +10 -9
  26. package/es/snackbar/style/index.js +1 -1
  27. package/es/snackbar/style/less.js +1 -1
  28. package/es/style.css +1 -1
  29. package/es/switch/Switch.js +22 -19
  30. package/es/switch/props.js +1 -2
  31. package/es/switch/switch.css +1 -1
  32. package/es/switch/switch.less +18 -4
  33. package/es/utils/elements.js +13 -0
  34. package/es/utils/jest.js +19 -0
  35. package/es/varlet.esm.js +338 -103
  36. package/highlight/attributes.json +24 -4
  37. package/highlight/tags.json +6 -1
  38. package/highlight/web-types.json +58 -5
  39. package/lib/badge/Badge.js +1 -1
  40. package/lib/card/Card.js +213 -8
  41. package/lib/card/card.css +1 -1
  42. package/lib/card/card.less +109 -7
  43. package/lib/card/props.js +18 -0
  44. package/lib/col/Col.js +6 -6
  45. package/lib/col/col.css +1 -1
  46. package/lib/col/col.less +27 -2
  47. package/lib/index-bar/IndexBar.js +3 -3
  48. package/lib/index-bar/props.js +1 -1
  49. package/lib/loading/Loading.js +6 -15
  50. package/lib/loading/loading.css +1 -1
  51. package/lib/loading/loading.less +20 -0
  52. package/lib/picker/Picker.js +10 -7
  53. package/lib/picker/props.js +4 -0
  54. package/lib/progress/Progress.js +15 -11
  55. package/lib/progress/progress.css +1 -1
  56. package/lib/progress/progress.less +3 -0
  57. package/lib/progress/props.js +1 -1
  58. package/lib/rate/Rate.js +3 -1
  59. package/lib/rate/props.js +2 -4
  60. package/lib/rate/rate.css +1 -1
  61. package/lib/rate/rate.less +7 -0
  62. package/lib/select/Select.js +3 -1
  63. package/lib/slider/Slider.js +9 -8
  64. package/lib/snackbar/style/index.js +1 -1
  65. package/lib/snackbar/style/less.js +1 -1
  66. package/lib/style.css +1 -1
  67. package/lib/switch/Switch.js +22 -19
  68. package/lib/switch/props.js +1 -2
  69. package/lib/switch/switch.css +1 -1
  70. package/lib/switch/switch.less +18 -4
  71. package/lib/utils/elements.js +17 -1
  72. package/lib/utils/jest.js +21 -0
  73. package/package.json +10 -9
  74. package/types/card.d.ts +2 -0
  75. package/types/indexBar.d.ts +1 -1
  76. package/types/picker.d.ts +2 -0
  77. package/umd/varlet.js +4 -4
@@ -239,6 +239,10 @@
239
239
  "type": "string",
240
240
  "description": "图片地址 默认值:-"
241
241
  },
242
+ "var-card/layout": {
243
+ "type": "string",
244
+ "description": "排列方式,可选值为 `row` `column` 默认值:column"
245
+ },
242
246
  "var-card/fit": {
243
247
  "type": "string",
244
248
  "description": "填充模式,可选值为 `fill` `contain` `cover` `none` `scale-down` 默认值:cover"
@@ -251,10 +255,22 @@
251
255
  "type": "string | number",
252
256
  "description": "图片高度 默认值:-"
253
257
  },
258
+ "var-card/width": {
259
+ "type": "string | number",
260
+ "description": "图片宽度 默认值:-"
261
+ },
254
262
  "var-card/ripple": {
255
263
  "type": "boolean",
256
264
  "description": "是否开启水波 默认值:false"
257
265
  },
266
+ "var-card/floating": {
267
+ "type": "boolean",
268
+ "description": "是否开启全屏 默认值:false"
269
+ },
270
+ "var-card/floatingDuration": {
271
+ "type": "number",
272
+ "description": "开关全屏所需时间(ms) 默认值:250"
273
+ },
258
274
  "var-cell/title": {
259
275
  "type": "string | number",
260
276
  "description": "单元格标题 默认值:-"
@@ -800,7 +816,7 @@
800
816
  "description": "是否开启锚点吸顶 默认值:true"
801
817
  },
802
818
  "var-index-bar/sticky-offset-top": {
803
- "type": "number",
819
+ "type": "number | string",
804
820
  "description": "锚点吸顶时与顶部的距离 默认值:0"
805
821
  },
806
822
  "var-index-bar/hide-list": {
@@ -1039,6 +1055,10 @@
1039
1055
  "type": "number[]",
1040
1056
  "description": "级联模式的初始化索引列表 默认值:-"
1041
1057
  },
1058
+ "var-picker/text-formatter": {
1059
+ "type": "(text: any, columnIndex: number) => any",
1060
+ "description": "文本格式化 默认值:text => text"
1061
+ },
1042
1062
  "var-picker/option-height": {
1043
1063
  "type": "string | number",
1044
1064
  "description": "选项的高度(px rem) 默认值:44"
@@ -1249,11 +1269,11 @@
1249
1269
  },
1250
1270
  "var-rate/size": {
1251
1271
  "type": "number | string",
1252
- "description": "图标大小,默认单位为 `px` 默认值:20"
1272
+ "description": "图标大小,默认单位为 `px` 默认值:-"
1253
1273
  },
1254
1274
  "var-rate/gap": {
1255
1275
  "type": "number | string",
1256
- "description": "图标间隔,默认单位为 `px` 默认值:4"
1276
+ "description": "图标间隔,默认单位为 `px` 默认值:-"
1257
1277
  },
1258
1278
  "var-rate/half": {
1259
1279
  "type": "boolean",
@@ -1637,7 +1657,7 @@
1637
1657
  },
1638
1658
  "var-switch/size": {
1639
1659
  "type": "string | number",
1640
- "description": "switch 的大小 默认值:20"
1660
+ "description": "switch 的大小 默认值:-"
1641
1661
  },
1642
1662
  "var-switch/rules": {
1643
1663
  "type": "array",
@@ -89,10 +89,14 @@
89
89
  "description",
90
90
  "elevation",
91
91
  "src",
92
+ "layout",
92
93
  "fit",
93
94
  "alt",
94
95
  "height",
95
- "ripple"
96
+ "width",
97
+ "ripple",
98
+ "floating",
99
+ "floatingDuration"
96
100
  ]
97
101
  },
98
102
  "var-cell": {
@@ -398,6 +402,7 @@
398
402
  "toolbar",
399
403
  "cascade",
400
404
  "cascade-initial-indexes",
405
+ "text-formatter",
401
406
  "option-height",
402
407
  "option-count",
403
408
  "confirm-button-text",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
- "version": "1.27.6",
4
+ "version": "1.27.8",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -706,6 +706,15 @@
706
706
  "kind": "expression"
707
707
  }
708
708
  },
709
+ {
710
+ "name": "layout",
711
+ "description": "排列方式,可选值为 `row` `column`",
712
+ "default": "column",
713
+ "value": {
714
+ "type": "string",
715
+ "kind": "expression"
716
+ }
717
+ },
709
718
  {
710
719
  "name": "fit",
711
720
  "description": "填充模式,可选值为 `fill` `contain` `cover` `none` `scale-down`",
@@ -733,6 +742,15 @@
733
742
  "kind": "expression"
734
743
  }
735
744
  },
745
+ {
746
+ "name": "width",
747
+ "description": "图片宽度",
748
+ "default": "-",
749
+ "value": {
750
+ "type": "string | number",
751
+ "kind": "expression"
752
+ }
753
+ },
736
754
  {
737
755
  "name": "ripple",
738
756
  "description": "是否开启水波",
@@ -741,6 +759,24 @@
741
759
  "type": "boolean",
742
760
  "kind": "expression"
743
761
  }
762
+ },
763
+ {
764
+ "name": "floating",
765
+ "description": "是否开启全屏",
766
+ "default": "false",
767
+ "value": {
768
+ "type": "boolean",
769
+ "kind": "expression"
770
+ }
771
+ },
772
+ {
773
+ "name": "floatingDuration",
774
+ "description": "开关全屏所需时间(ms)",
775
+ "default": "250",
776
+ "value": {
777
+ "type": "number",
778
+ "kind": "expression"
779
+ }
744
780
  }
745
781
  ],
746
782
  "events": [
@@ -766,9 +802,17 @@
766
802
  "name": "description",
767
803
  "description": "自定义描述"
768
804
  },
805
+ {
806
+ "name": "content",
807
+ "description": "自定义正文"
808
+ },
769
809
  {
770
810
  "name": "extra",
771
811
  "description": "自定义底部内容"
812
+ },
813
+ {
814
+ "name": "toolbar-close",
815
+ "description": "工具栏自定义关闭"
772
816
  }
773
817
  ]
774
818
  },
@@ -2403,7 +2447,7 @@
2403
2447
  "description": "锚点吸顶时与顶部的距离",
2404
2448
  "default": "0",
2405
2449
  "value": {
2406
- "type": "number",
2450
+ "type": "number | string",
2407
2451
  "kind": "expression"
2408
2452
  }
2409
2453
  },
@@ -3123,6 +3167,15 @@
3123
3167
  "kind": "expression"
3124
3168
  }
3125
3169
  },
3170
+ {
3171
+ "name": "text-formatter",
3172
+ "description": "文本格式化",
3173
+ "default": "text => text",
3174
+ "value": {
3175
+ "type": "(text: any, columnIndex: number) => any",
3176
+ "kind": "expression"
3177
+ }
3178
+ },
3126
3179
  {
3127
3180
  "name": "option-height",
3128
3181
  "description": "选项的高度(px rem)",
@@ -3735,7 +3788,7 @@
3735
3788
  {
3736
3789
  "name": "size",
3737
3790
  "description": "图标大小,默认单位为 `px`",
3738
- "default": "20",
3791
+ "default": "-",
3739
3792
  "value": {
3740
3793
  "type": "number | string",
3741
3794
  "kind": "expression"
@@ -3744,7 +3797,7 @@
3744
3797
  {
3745
3798
  "name": "gap",
3746
3799
  "description": "图标间隔,默认单位为 `px`",
3747
- "default": "4",
3800
+ "default": "-",
3748
3801
  "value": {
3749
3802
  "type": "number | string",
3750
3803
  "kind": "expression"
@@ -4857,7 +4910,7 @@
4857
4910
  {
4858
4911
  "name": "size",
4859
4912
  "description": "switch 的大小",
4860
- "default": "20",
4913
+ "default": "-",
4861
4914
  "value": {
4862
4915
  "type": "string | number",
4863
4916
  "kind": "expression"
@@ -80,7 +80,7 @@ var _default = (0, _vue.defineComponent)({
80
80
  icon
81
81
  } = props;
82
82
  var positionBasic = slots.default && n('position') + " " + n("--" + position);
83
- var dotClass = dot && n('dot');
83
+ var dotClass = dot ? n('dot') : null;
84
84
  var positionClass = getPositionClass();
85
85
  var iconClass = icon ? n('icon') : null;
86
86
  return [n("--" + type), positionBasic, dotClass, positionClass, iconClass];
package/lib/card/Card.js CHANGED
@@ -6,6 +6,10 @@ exports.render = render;
6
6
 
7
7
  var _ripple = _interopRequireDefault(require("../ripple"));
8
8
 
9
+ var _icon = _interopRequireDefault(require("../icon"));
10
+
11
+ var _button = _interopRequireDefault(require("../button"));
12
+
9
13
  var _vue = require("vue");
10
14
 
11
15
  var _props = require("./props");
@@ -14,37 +18,68 @@ var _elements = require("../utils/elements");
14
18
 
15
19
  var _components = require("../utils/components");
16
20
 
21
+ var _zIndex = require("../context/zIndex");
22
+
23
+ var _lock = require("../context/lock");
24
+
17
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
18
26
 
27
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
28
+
29
+ function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
30
+
19
31
  var {
20
32
  n,
21
33
  classes
22
34
  } = (0, _components.createNamespace)('card');
35
+ var RIPPLE_DELAY = 500;
23
36
 
24
37
  var _withScopeId = n => ((0, _vue.pushScopeId)(""), n = n(), (0, _vue.popScopeId)(), n);
25
38
 
26
39
  var _hoisted_1 = ["src", "alt"];
27
40
 
28
41
  function render(_ctx, _cache) {
42
+ var _component_var_icon = (0, _vue.resolveComponent)("var-icon");
43
+
44
+ var _component_var_button = (0, _vue.resolveComponent)("var-button");
45
+
29
46
  var _directive_ripple = (0, _vue.resolveDirective)("ripple");
30
47
 
31
- return (0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
32
- class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.elevation, "var-elevation--" + _ctx.elevation, 'var-elevation--2'])),
48
+ return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
49
+ ref: "card",
50
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.isRow, _ctx.n('--layout-row')])),
33
51
  onClick: _cache[0] || (_cache[0] = function () {
34
52
  return _ctx.onClick && _ctx.onClick(...arguments);
35
53
  })
54
+ }, [(0, _vue.withDirectives)(((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
55
+ ref: "cardFloater",
56
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('floater'), [_ctx.elevation, "var-elevation--" + _ctx.elevation, 'var-elevation--1'])),
57
+ style: (0, _vue.normalizeStyle)({
58
+ width: _ctx.floaterWidth,
59
+ height: _ctx.floaterHeight,
60
+ top: _ctx.floaterTop,
61
+ left: _ctx.floaterLeft,
62
+ overflow: _ctx.floaterOverflow,
63
+ position: _ctx.floaterPosition,
64
+ borderRadius: _ctx.floating ? '0px' : undefined,
65
+ zIndex: _ctx.floated ? _ctx.zIndex : undefined,
66
+ transition: _ctx.floated ? "background-color " + _ctx.floatingDuration + "ms, border-radius " + _ctx.floatingDuration + "ms, width " + _ctx.floatingDuration + "ms, height " + _ctx.floatingDuration + "ms, top " + _ctx.floatingDuration + "ms, left " + _ctx.floatingDuration + "ms" : undefined
67
+ })
36
68
  }, [(0, _vue.renderSlot)(_ctx.$slots, "image", {}, () => [_ctx.src ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("img", {
37
69
  key: 0,
38
70
  class: (0, _vue.normalizeClass)(_ctx.n('image')),
39
71
  style: (0, _vue.normalizeStyle)({
40
72
  objectFit: _ctx.fit,
41
- height: _ctx.toSizeUnit(_ctx.height)
73
+ height: _ctx.toSizeUnit(_ctx.height),
74
+ width: _ctx.toSizeUnit(_ctx.width)
42
75
  }),
43
76
  src: _ctx.src,
44
77
  alt: _ctx.alt
45
78
  }, null, 14
46
79
  /* CLASS, STYLE, PROPS */
47
- , _hoisted_1)) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.renderSlot)(_ctx.$slots, "title", {}, () => [_ctx.title ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
80
+ , _hoisted_1)) : (0, _vue.createCommentVNode)("v-if", true)]), (0, _vue.createElementVNode)("div", {
81
+ class: (0, _vue.normalizeClass)(_ctx.n('container'))
82
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "title", {}, () => [_ctx.title ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
48
83
  key: 0,
49
84
  class: (0, _vue.normalizeClass)(_ctx.n('title'))
50
85
  }, (0, _vue.toDisplayString)(_ctx.title), 3
@@ -64,11 +99,58 @@ function render(_ctx, _cache) {
64
99
  class: (0, _vue.normalizeClass)(_ctx.n('footer'))
65
100
  }, [(0, _vue.renderSlot)(_ctx.$slots, "extra")], 2
66
101
  /* CLASS */
102
+ )) : (0, _vue.createCommentVNode)("v-if", true), _ctx.$slots.content && !_ctx.isRow ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
103
+ key: 1,
104
+ class: (0, _vue.normalizeClass)(_ctx.n('content')),
105
+ style: (0, _vue.normalizeStyle)({
106
+ height: _ctx.contentHeight,
107
+ opacity: _ctx.opacity,
108
+ transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
109
+ })
110
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "content")], 6
111
+ /* CLASS, STYLE */
67
112
  )) : (0, _vue.createCommentVNode)("v-if", true)], 2
68
113
  /* CLASS */
114
+ ), _ctx.showToolBar ? ((0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
115
+ key: 0,
116
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('toolbar'), 'var--box')),
117
+ style: (0, _vue.normalizeStyle)({
118
+ zIndex: _ctx.zIndex,
119
+ opacity: _ctx.opacity,
120
+ transition: "opacity " + _ctx.floatingDuration * 2 + "ms"
121
+ })
122
+ }, [(0, _vue.renderSlot)(_ctx.$slots, "toolbar-close", {}, () => [(0, _vue.createVNode)(_component_var_button, {
123
+ size: "large",
124
+ round: "",
125
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n('toolbar-close'), 'var-elevation--6')),
126
+ onClick: (0, _vue.withModifiers)(_ctx.close, ["stop"])
127
+ }, {
128
+ default: (0, _vue.withCtx)(() => [(0, _vue.createVNode)(_component_var_icon, {
129
+ name: "window-close",
130
+ size: "24px"
131
+ })]),
132
+ _: 1
133
+ /* STABLE */
134
+
135
+ }, 8
136
+ /* PROPS */
137
+ , ["class", "onClick"])]), (0, _vue.renderSlot)(_ctx.$slots, "toolbar-extra")], 6
138
+ /* CLASS, STYLE */
139
+ )) : (0, _vue.createCommentVNode)("v-if", true)], 6
140
+ /* CLASS, STYLE */
69
141
  )), [[_directive_ripple, {
70
- disabled: !_ctx.ripple
71
- }]]);
142
+ disabled: !_ctx.ripple || _ctx.floater
143
+ }]]), (0, _vue.createElementVNode)("div", {
144
+ class: (0, _vue.normalizeClass)(_ctx.n('holder')),
145
+ style: (0, _vue.normalizeStyle)({
146
+ width: _ctx.holderWidth,
147
+ height: _ctx.holderHeight
148
+ })
149
+ }, null, 6
150
+ /* CLASS, STYLE */
151
+ )], 2
152
+ /* CLASS */
153
+ );
72
154
  }
73
155
 
74
156
  var _default = (0, _vue.defineComponent)({
@@ -77,13 +159,136 @@ var _default = (0, _vue.defineComponent)({
77
159
  directives: {
78
160
  Ripple: _ripple.default
79
161
  },
162
+ components: {
163
+ VarIcon: _icon.default,
164
+ VarButton: _button.default
165
+ },
80
166
  props: _props.props,
81
167
 
82
- setup() {
168
+ setup(props) {
169
+ var card = (0, _vue.ref)(null);
170
+ var cardFloater = (0, _vue.ref)(null);
171
+ var holderWidth = (0, _vue.ref)('auto');
172
+ var holderHeight = (0, _vue.ref)('auto');
173
+ var floaterWidth = (0, _vue.ref)('100%');
174
+ var floaterHeight = (0, _vue.ref)('100%');
175
+ var floaterTop = (0, _vue.ref)('auto');
176
+ var floaterLeft = (0, _vue.ref)('auto');
177
+ var floaterPosition = (0, _vue.ref)('static');
178
+ var floaterOverflow = (0, _vue.ref)('hidden');
179
+ var contentHeight = (0, _vue.ref)('0px');
180
+ var opacity = (0, _vue.ref)('0');
181
+ var {
182
+ zIndex
183
+ } = (0, _zIndex.useZIndex)(() => props.floating, 1);
184
+ var isRow = (0, _vue.computed)(() => props.layout === 'row');
185
+ var showToolBar = (0, _vue.ref)(false);
186
+ var floated = (0, _vue.ref)(false);
187
+ (0, _lock.useLock)(() => props.floating, () => isRow);
188
+ var dropdownFloaterTop = 'auto';
189
+ var dropdownFloaterLeft = 'auto';
190
+ var dropper = null;
191
+ var floater = (0, _vue.ref)(null);
192
+
193
+ var floating = /*#__PURE__*/function () {
194
+ var _ref = _asyncToGenerator(function* () {
195
+ clearTimeout(floater.value);
196
+ clearTimeout(dropper);
197
+ floater.value = null;
198
+ floater.value = setTimeout( /*#__PURE__*/_asyncToGenerator(function* () {
199
+ var {
200
+ width,
201
+ height,
202
+ left,
203
+ top
204
+ } = card.value.getBoundingClientRect();
205
+ holderWidth.value = (0, _elements.toSizeUnit)(width);
206
+ holderHeight.value = (0, _elements.toSizeUnit)(height);
207
+ floaterWidth.value = holderWidth.value;
208
+ floaterHeight.value = holderHeight.value;
209
+ floaterTop.value = (0, _elements.toSizeUnit)(top);
210
+ floaterLeft.value = (0, _elements.toSizeUnit)(left);
211
+ floaterPosition.value = 'fixed';
212
+ dropdownFloaterTop = floaterTop.value;
213
+ dropdownFloaterLeft = floaterLeft.value;
214
+ showToolBar.value = true;
215
+ yield (0, _elements.doubleRaf)();
216
+ floaterTop.value = '0';
217
+ floaterLeft.value = '0';
218
+ floaterWidth.value = '100vw';
219
+ floaterHeight.value = '100vh';
220
+ contentHeight.value = 'auto';
221
+ opacity.value = '1';
222
+ floaterOverflow.value = 'auto';
223
+ floated.value = true;
224
+ }), props.ripple ? RIPPLE_DELAY : 0);
225
+ });
226
+
227
+ return function floating() {
228
+ return _ref.apply(this, arguments);
229
+ };
230
+ }();
231
+
232
+ var dropdown = () => {
233
+ clearTimeout(dropper);
234
+ clearTimeout(floater.value);
235
+ floater.value = null;
236
+ floaterWidth.value = holderWidth.value;
237
+ floaterHeight.value = holderHeight.value;
238
+ floaterTop.value = dropdownFloaterTop;
239
+ floaterLeft.value = dropdownFloaterLeft;
240
+ contentHeight.value = '0px';
241
+ opacity.value = '0';
242
+ showToolBar.value = false;
243
+ dropper = setTimeout(() => {
244
+ holderWidth.value = 'auto';
245
+ holderHeight.value = 'auto';
246
+ floaterWidth.value = '100%';
247
+ floaterHeight.value = '100%';
248
+ floaterTop.value = 'auto';
249
+ floaterLeft.value = 'auto';
250
+ dropdownFloaterTop = 'auto';
251
+ dropdownFloaterLeft = 'auto';
252
+ floaterOverflow.value = 'hidden';
253
+ floaterPosition.value = 'static';
254
+ floated.value = false;
255
+ }, props.floatingDuration);
256
+ };
257
+
258
+ var close = () => {
259
+ (0, _components.call)(props['onUpdate:floating'], false);
260
+ };
261
+
262
+ (0, _vue.watch)(() => props.floating, value => {
263
+ if (isRow.value) return;
264
+ (0, _vue.nextTick)(() => {
265
+ value ? floating() : dropdown();
266
+ });
267
+ }, {
268
+ immediate: true
269
+ });
83
270
  return {
84
271
  n,
85
272
  classes,
86
- toSizeUnit: _elements.toSizeUnit
273
+ toSizeUnit: _elements.toSizeUnit,
274
+ card,
275
+ cardFloater,
276
+ holderWidth,
277
+ holderHeight,
278
+ floater,
279
+ floaterWidth,
280
+ floaterHeight,
281
+ floaterTop,
282
+ floaterLeft,
283
+ floaterPosition,
284
+ floaterOverflow,
285
+ contentHeight,
286
+ opacity,
287
+ zIndex,
288
+ isRow,
289
+ close,
290
+ showToolBar,
291
+ floated
87
292
  };
88
293
  }
89
294
 
package/lib/card/card.css CHANGED
@@ -1 +1 @@
1
- :root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-border-radius: 4px; --card-image-width: 100%; --card-image-height: 200px; --card-title-color: #333; --card-title-font-size: 20px; --card-title-padding: 0 12px; --card-title-margin: 15px 0 0 0; --card-subtitle-color: rgba(0, 0, 0, 0.6); --card-subtitle-font-size: 14px; --card-subtitle-padding: 0 13px; --card-subtitle-margin: 10px 0 0 0; --card-description-color: rgba(0, 0, 0, 0.6); --card-description-font-size: 14px; --card-description-margin: 20px 0 0 0; --card-description-padding: 0 13px; --card-footer-padding: 0 12px; --card-footer-margin: 30px 0 0px 0; --card-line-height: 22px;}.var-card { border-radius: var(--card-border-radius); overflow: hidden; padding: var(--card-padding); line-height: var(--card-line-height); background: var(--card-background); transition: background-color 0.25s;}.var-card__image { width: var(--card-image-width); height: var(--card-image-height); display: block;}.var-card__title { font-size: var(--card-title-font-size); padding: var(--card-title-padding); margin: var(--card-title-margin); color: var(--card-title-color);}.var-card__subtitle { font-size: var(--card-subtitle-font-size); color: var(--card-subtitle-color); padding: var(--card-subtitle-padding); margin: var(--card-subtitle-margin);}.var-card__description { font-size: var(--card-description-font-size); color: var(--card-description-color); margin: var(--card-description-margin); padding: var(--card-description-padding); word-break: break-all;}.var-card__footer { padding: var(--card-footer-padding); margin: var(--card-footer-margin);}
1
+ :root { --card-padding: 0 0 15px 0; --card-background: #fff; --card-border-radius: 4px; --card-image-width: 100%; --card-row-image-width: 150px; --card-image-height: 200px; --card-row-height: 150px; --card-title-color: #333; --card-title-font-size: 20px; --card-title-padding: 0 12px; --card-title-margin: 15px 0 0 0; --card-title-row-margin: 12px 0; --card-subtitle-color: rgba(0, 0, 0, 0.6); --card-subtitle-font-size: 14px; --card-subtitle-padding: 0 12px; --card-subtitle-margin: 10px 0 0 0; --card-subtitle-row-margin: -8px 0 0 0; --card-description-color: rgba(0, 0, 0, 0.6); --card-description-font-size: 14px; --card-description-margin: 20px 0 0 0; --card-description-padding: 0 13px; --card-footer-padding: 0 12px; --card-footer-right: 13px; --card-footer-bottom: 9px; --card-footer-margin: 30px 0 0px 0; --card-line-height: 22px; --card-row-line-height: 1.5; --card-floater-toolbar-bottom: 16px; --card-floater-toolbar-right: 16px; --card-floater-toolbar-color: #fff; --card-floater-toolbar-close-size: 24px; --card-floater-toolbar-close-padding: 16px; --card-floater-toolbar-close-primary-color: #212121;}.var-card--layout-row { height: var(--card-row-height); position: relative;}.var-card__floater { border-radius: var(--card-border-radius); display: flex; flex-direction: column; line-height: var(--card-line-height); background: var(--card-background); transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__container { padding: var(--card-padding); flex-grow: 1; min-width: 0;}.var-card--layout-row .var-card__floater { flex-direction: row; line-height: var(--card-row-line-height);}.var-card__image { width: var(--card-image-width); height: var(--card-image-height); display: block;}.var-card--layout-row .var-card__image { width: var(--card-row-image-width); height: 100%; display: block; flex-shrink: 0;}.var-card__title { font-size: var(--card-title-font-size); padding: var(--card-title-padding); margin: var(--card-title-margin); color: var(--card-title-color); word-break: break-word;}.var-card--layout-row .var-card__title { max-width: 100%; overflow: hidden; margin: var(--card-title-row-margin); text-overflow: ellipsis; white-space: nowrap;}.var-card__subtitle { font-size: var(--card-subtitle-font-size); color: var(--card-subtitle-color); padding: var(--card-subtitle-padding); margin: var(--card-subtitle-margin); word-break: break-word;}.var-card--layout-row .var-card__subtitle { margin: var(--card-subtitle-row-margin); text-overflow: ellipsis; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;}.var-card__description { font-size: var(--card-description-font-size); color: var(--card-description-color); margin: var(--card-description-margin); padding: var(--card-description-padding); word-break: break-all;}.var-card__footer { display: flex; justify-content: flex-end; padding: var(--card-footer-padding); margin: var(--card-footer-margin);}.var-card--layout-row .var-card__footer { position: absolute; padding: 0; right: var(--card-footer-right); bottom: var(--card-footer-bottom);}.var-card__content { overflow: hidden; transition-timing-function: cubic-bezier(0.45, 0.19, 0.06, 0.89);}.var-card__toolbar { position: fixed; bottom: var(--card-floater-toolbar-bottom); right: var(--card-floater-toolbar-right);}.var-card__toolbar-close { padding: var(--card-floater-toolbar-close-padding); background-color: var(--card-floater-toolbar-close-primary-color); color: var(--card-floater-toolbar-color);}.var-card__toolbar-close .var-icon { width: var(--card-floater-toolbar-close-size); height: var(--card-floater-toolbar-close-size); font-size: var(--card-floater-toolbar-close-size);}