@varlet/ui 1.23.11 → 1.24.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 (46) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/es/card/card.css +1 -1
  3. package/es/card/card.less +1 -0
  4. package/es/icon/icon.css +1 -1
  5. package/es/input/Input.js +1 -1
  6. package/es/input/input.css +1 -1
  7. package/es/input/input.less +6 -2
  8. package/es/loading/Loading.js +33 -6
  9. package/es/loading/loading.css +1 -1
  10. package/es/loading/loading.less +55 -3
  11. package/es/loading/props.js +7 -0
  12. package/es/locale/en-US.d.ts +5 -0
  13. package/es/locale/zh-CN.d.ts +5 -0
  14. package/es/select/Select.js +1 -1
  15. package/es/select/select.css +1 -1
  16. package/es/select/select.less +3 -1
  17. package/es/snackbar/style/index.js +1 -1
  18. package/es/snackbar/style/less.js +1 -1
  19. package/es/styles/common.css +1 -1
  20. package/es/styles/common.less +6 -0
  21. package/es/swipe/Swipe.js +12 -7
  22. package/highlight/attributes.json +11 -3
  23. package/highlight/tags.json +5 -3
  24. package/highlight/web-types.json +32 -5
  25. package/lib/card/card.css +1 -1
  26. package/lib/card/card.less +1 -0
  27. package/lib/icon/icon.css +1 -1
  28. package/lib/input/Input.js +1 -1
  29. package/lib/input/input.css +1 -1
  30. package/lib/input/input.less +6 -2
  31. package/lib/loading/Loading.js +32 -5
  32. package/lib/loading/loading.css +1 -1
  33. package/lib/loading/loading.less +55 -3
  34. package/lib/loading/props.js +7 -0
  35. package/lib/locale/en-US.d.ts +5 -0
  36. package/lib/locale/zh-CN.d.ts +5 -0
  37. package/lib/select/Select.js +1 -1
  38. package/lib/select/select.css +1 -1
  39. package/lib/select/select.less +3 -1
  40. package/lib/style.css +1 -1
  41. package/lib/styles/common.css +1 -1
  42. package/lib/styles/common.less +6 -0
  43. package/lib/swipe/Swipe.js +12 -7
  44. package/package.json +4 -6
  45. package/types/loading.d.ts +2 -0
  46. package/umd/varlet.js +4 -4
@@ -1 +1 @@
1
- .var--box { box-sizing: border-box;}.var--box * { box-sizing: border-box;}.var--relative { position: relative;}.var--absolute { position: absolute;}.var--hidden { overflow: hidden;}.var--lock { overflow: hidden;}.var--block { display: block;}.var--inline-block { display: inline-block;}.var--flex { display: flex;}.var--inline-flex { display: inline-flex;}:root { --font-size-xs: 10px; --font-size-sm: 12px; --font-size-md: 14px; --font-size-lg: 16px; --icon-size-xs: 16px; --icon-size-sm: 18px; --icon-size-md: 20px; --icon-size-lg: 22px; --color-body: #fff; --color-text: #333; --color-primary: #3a7afe; --color-info: #00afef; --color-success: #00c48f; --color-warning: #ff9f00; --color-danger: #f44336; --color-disabled: #e0e0e0; --color-text-disabled: #aaa; --cubic-bezier: cubic-bezier(0.25, 0.8, 0.5, 1); --shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2); --shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14); --shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);}
1
+ .var--box { box-sizing: border-box;}.var--box * { box-sizing: border-box;}.var--relative { position: relative;}.var--absolute { position: absolute;}.var--hidden { overflow: hidden;}.var--lock { overflow: hidden;}.var--block { display: block;}.var--ellipsis { overflow-x: hidden; text-overflow: ellipsis; white-space: nowrap;}.var--inline-block { display: inline-block;}.var--flex { display: flex;}.var--inline-flex { display: inline-flex;}:root { --font-size-xs: 10px; --font-size-sm: 12px; --font-size-md: 14px; --font-size-lg: 16px; --icon-size-xs: 16px; --icon-size-sm: 18px; --icon-size-md: 20px; --icon-size-lg: 22px; --color-body: #fff; --color-text: #333; --color-primary: #3a7afe; --color-info: #00afef; --color-success: #00c48f; --color-warning: #ff9f00; --color-danger: #f44336; --color-disabled: #e0e0e0; --color-text-disabled: #aaa; --cubic-bezier: cubic-bezier(0.25, 0.8, 0.5, 1); --shadow-key-umbra-opacity: rgba(0, 0, 0, 0.2); --shadow-key-penumbra-opacity: rgba(0, 0, 0, 0.14); --shadow-key-ambient-opacity: rgba(0, 0, 0, 0.12);}
@@ -29,6 +29,12 @@
29
29
  display: block;
30
30
  }
31
31
 
32
+ &--ellipsis {
33
+ overflow-x: hidden;
34
+ text-overflow: ellipsis;
35
+ white-space: nowrap;
36
+ }
37
+
32
38
  &--inline-block {
33
39
  display: inline-block;
34
40
  }
@@ -187,12 +187,7 @@ var _default = (0, _vue.defineComponent)({
187
187
  };
188
188
 
189
189
  var initialIndex = () => {
190
- lockDuration.value = true;
191
190
  index.value = boundaryIndex((0, _shared.toNumber)(props.initialIndex));
192
- translate.value = index.value * -size.value;
193
- (0, _elements.nextTickFrame)(() => {
194
- lockDuration.value = false;
195
- });
196
191
  };
197
192
 
198
193
  var startAutoplay = () => {
@@ -300,10 +295,17 @@ var _default = (0, _vue.defineComponent)({
300
295
 
301
296
 
302
297
  var resize = () => {
298
+ lockDuration.value = true;
303
299
  size.value = props.vertical ? swipeEl.value.offsetHeight : swipeEl.value.offsetWidth;
304
300
  trackSize.value = size.value * length.value;
305
- initialIndex();
301
+ translate.value = index.value * -size.value;
302
+ swipeItems.forEach(swipeItem => {
303
+ swipeItem.setTranslate(0);
304
+ });
306
305
  startAutoplay();
306
+ setTimeout(() => {
307
+ lockDuration.value = false;
308
+ });
307
309
  }; // expose
308
310
 
309
311
 
@@ -377,7 +379,10 @@ var _default = (0, _vue.defineComponent)({
377
379
  vertical
378
380
  };
379
381
  bindSwipeItems(swipeProvider);
380
- (0, _vue.watch)(() => length.value, resize);
382
+ (0, _vue.watch)(() => length.value, () => {
383
+ initialIndex();
384
+ resize();
385
+ });
381
386
  (0, _vue.onMounted)(() => {
382
387
  window.addEventListener('resize', resize);
383
388
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "1.23.11",
3
+ "version": "1.24.0",
4
4
  "description": "A material like components library",
5
5
  "module": "es/index.js",
6
6
  "main": "lib/index.js",
@@ -22,9 +22,7 @@
22
22
  "umd",
23
23
  "highlight",
24
24
  "types",
25
- "CHANGELOG.md",
26
- "README.md",
27
- "README.zh-CN.md"
25
+ "CHANGELOG.md"
28
26
  ],
29
27
  "author": "haoziqaq <357229046@qq.com>",
30
28
  "license": "MIT",
@@ -49,9 +47,9 @@
49
47
  "peerDependencies": {
50
48
  "vue": "^3.2.0"
51
49
  },
52
- "gitHead": "449df88f0ff65a2ad89fa48a5d443ab864bd0bb3",
50
+ "gitHead": "859769307c762134844c0ddfdb69452631f76d62",
53
51
  "devDependencies": {
54
- "@varlet/cli": "^1.23.11"
52
+ "@varlet/cli": "^1.24.0"
55
53
  },
56
54
  "dependencies": {
57
55
  "dayjs": "^1.10.4",
@@ -5,6 +5,8 @@ export interface LoadingProps {
5
5
  radius?: string | number
6
6
  size?: 'normal' | 'mini' | 'small' | 'large'
7
7
  color?: string
8
+ description?: string
9
+ show?: boolean
8
10
  }
9
11
 
10
12
  export class Loading extends VarComponent {