@varlet/ui 2.0.0-alpha.1663499244572 → 2.0.0-alpha.1664031123039

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 (112) hide show
  1. package/CHANGELOG.md +1885 -1885
  2. package/LICENCE +21 -21
  3. package/README.md +87 -93
  4. package/README.zh-CN.md +92 -0
  5. package/es/button/Button.js +3 -1
  6. package/es/countdown/Countdown.js +4 -3
  7. package/es/date-picker/DatePicker.js +4 -3
  8. package/es/index.d.ts +1 -1
  9. package/es/input/Input.js +1 -1
  10. package/es/locale/en-US.d.ts +5 -5
  11. package/es/locale/zh-CN.d.ts +5 -5
  12. package/es/space/Space.js +6 -2
  13. package/es/style-provider/index.js +1 -5
  14. package/es/themes/dark/index.d.ts +5 -5
  15. package/es/time-picker/TimePicker.js +3 -2
  16. package/es/time-picker/clock.js +2 -1
  17. package/es/utils/elements.js +3 -0
  18. package/es/utils/{test.js → jest.js} +0 -0
  19. package/es/utils/shared.js +20 -1
  20. package/es/varlet.esm.js +3330 -3320
  21. package/highlight/attributes.json +1882 -1
  22. package/highlight/tags.json +586 -58
  23. package/highlight/web-types.json +5312 -151
  24. package/json/area.json +10706 -10706
  25. package/lib/button/Button.js +3 -1
  26. package/lib/countdown/Countdown.js +8 -6
  27. package/lib/date-picker/DatePicker.js +18 -16
  28. package/lib/date-picker/src/day-picker-panel.js +13 -13
  29. package/lib/date-picker/src/month-picker-panel.js +11 -11
  30. package/lib/date-picker/src/year-picker-panel.js +3 -3
  31. package/lib/index.d.ts +1 -1
  32. package/lib/input/Input.js +1 -1
  33. package/lib/locale/en-US.d.ts +5 -5
  34. package/lib/locale/zh-CN.d.ts +5 -5
  35. package/lib/snackbar/style/index.js +1 -1
  36. package/lib/space/Space.js +6 -2
  37. package/lib/style-provider/index.js +1 -5
  38. package/lib/themes/dark/index.d.ts +5 -5
  39. package/lib/time-picker/TimePicker.js +12 -10
  40. package/lib/time-picker/clock.js +6 -4
  41. package/lib/utils/elements.js +4 -0
  42. package/lib/utils/{test.js → jest.js} +0 -0
  43. package/lib/utils/shared.js +27 -2
  44. package/package.json +11 -12
  45. package/types/actionSheet.d.ts +68 -68
  46. package/types/appBar.d.ts +17 -17
  47. package/types/backTop.d.ts +16 -16
  48. package/types/badge.d.ts +20 -20
  49. package/types/bottomNavigation.d.ts +23 -23
  50. package/types/bottomNavigationItem.d.ts +17 -17
  51. package/types/button.d.ts +29 -29
  52. package/types/card.d.ts +29 -29
  53. package/types/cell.d.ts +18 -18
  54. package/types/checkbox.d.ts +34 -34
  55. package/types/checkboxGroup.d.ts +29 -29
  56. package/types/chip.d.ts +20 -20
  57. package/types/col.d.ts +23 -23
  58. package/types/collapse.d.ts +17 -17
  59. package/types/collapseItem.d.ts +14 -14
  60. package/types/countdown.d.ts +29 -29
  61. package/types/counter.d.ts +44 -44
  62. package/types/datePicker.d.ts +29 -29
  63. package/types/dialog.d.ts +84 -84
  64. package/types/divider.d.ts +15 -15
  65. package/types/form.d.ts +18 -18
  66. package/types/icon.d.ts +16 -16
  67. package/types/image.d.ts +26 -26
  68. package/types/imagePreview.d.ts +51 -51
  69. package/types/indexAnchor.d.ts +11 -11
  70. package/types/indexBar.d.ts +21 -21
  71. package/types/input.d.ts +48 -48
  72. package/types/lazy.d.ts +5 -5
  73. package/types/list.d.ts +21 -21
  74. package/types/loading.d.ts +18 -18
  75. package/types/locale.d.ts +52 -52
  76. package/types/menu.d.ts +46 -46
  77. package/types/option.d.ts +12 -12
  78. package/types/pagination.d.ts +25 -25
  79. package/types/picker.d.ts +85 -85
  80. package/types/popup.d.ts +27 -27
  81. package/types/progress.d.ts +22 -22
  82. package/types/pullRefresh.d.ts +20 -20
  83. package/types/radio.d.ts +34 -34
  84. package/types/radioGroup.d.ts +24 -24
  85. package/types/rate.d.ts +28 -28
  86. package/types/ripple.d.ts +5 -5
  87. package/types/row.d.ts +18 -18
  88. package/types/select.d.ts +48 -48
  89. package/types/skeleton.d.ts +21 -21
  90. package/types/slider.d.ts +30 -30
  91. package/types/snackbar.d.ts +82 -82
  92. package/types/space.d.ts +26 -26
  93. package/types/step.d.ts +13 -13
  94. package/types/steps.d.ts +15 -15
  95. package/types/sticky.d.ts +15 -15
  96. package/types/styleProvider.d.ts +24 -24
  97. package/types/swipe.d.ts +27 -27
  98. package/types/swipeItem.d.ts +9 -9
  99. package/types/switch.d.ts +25 -25
  100. package/types/tab.d.ts +13 -13
  101. package/types/tabItem.d.ts +11 -11
  102. package/types/table.d.ts +11 -11
  103. package/types/tabs.d.ts +29 -29
  104. package/types/tabsItems.d.ts +15 -15
  105. package/types/timePicker.d.ts +30 -30
  106. package/types/uploader.d.ts +65 -65
  107. package/types/varComponent.d.ts +18 -18
  108. package/types/varDirective.d.ts +12 -12
  109. package/umd/varlet.js +6 -6
  110. package/README.en-US.md +0 -86
  111. package/es/themes/dark/tab-item.js +0 -3
  112. package/lib/themes/dark/tab-item.js +0 -8
package/LICENCE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2020 varlet
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 varlet
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,93 +1,87 @@
1
-
2
- <div align="center">
3
- <a href="https://varlet.gitee.io/varlet-ui">
4
- <img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
5
- </a>
6
- <h1>VARLET</h1>
7
- <p>基于 Vue3 的 Material design 风格移动端组件库</p>
8
- <p>
9
- <a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
10
- <a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a> |
11
- <a href="https://github.com/varletjs/varlet/blob/dev/README.en-US.md">English Readme</a>
12
- </p>
13
- <p>
14
- <img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
15
- <img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
16
- <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
17
- <img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
18
- <img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
19
- <img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
20
- <img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
21
- </p>
22
- </div>
23
-
24
- ---
25
-
26
- ### 介绍
27
-
28
- Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全面拥抱 `Vue3` 生态,由社区建立起来的组件库团队进行维护。
29
-
30
- ### 特性
31
- - 🚀 &nbsp; 提供50+个高质量通用组件
32
- - 🚀 &nbsp; 组件十分轻量
33
- - 💪 &nbsp; 由国人开发,完善的中英文文档和后勤保障
34
- - 🛠️ &nbsp; 支持按需引入
35
- - 🛠️ &nbsp; 支持主题定制
36
- - 🌍 &nbsp; 支持国际化
37
- - 💡 &nbsp; 支持 webstorm,vscode 组件属性高亮
38
- - 💪 &nbsp; 支持 SSR
39
- - 💡 &nbsp; 支持 Typescript
40
- - 💪 &nbsp; 确保90%以上单元测试覆盖率,提供稳定性保证
41
- - 🛠️ &nbsp; 支持暗黑模式
42
-
43
- ### 安装
44
-
45
- ### CDN
46
- `varlet.js` 包含组件库的所有样式和逻辑,引入即可。
47
-
48
- ```html
49
- <div id="app"></div>
50
- <script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
51
- <script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
52
- <script>
53
- const app = Vue.createApp({
54
- template: '<var-button>按钮</var-button>'
55
- })
56
- app.use(Varlet).mount('#app')
57
- </script>
58
- ```
59
-
60
- ### Webpack / Vite
61
- ```shell
62
- # 通过 npm 或 yarn 或 pnpm 安装
63
-
64
- # npm
65
- npm i @varlet/ui -S
66
-
67
- # yarn
68
- yarn add @varlet/ui
69
-
70
- # pnpm
71
- pnpm add @varlet/ui
72
- ```
73
-
74
- ```js
75
- import App from './App.vue'
76
- import Varlet from '@varlet/ui'
77
- import { createApp } from 'vue'
78
- import '@varlet/ui/es/style.js'
79
-
80
- createApp(App).use(Varlet).mount('#app')
81
- ```
82
-
83
- ### 反馈和交流
84
-
85
- 我们推荐使用`issue`列表进行最直接有效的反馈,也可以通过扫描下方二维码进入微信群进行交流
86
-
87
- <img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/community.png?raw=true" />
88
-
89
- ### 感谢贡献者们做出的努力
90
-
91
- <a href="https://github.com/varletjs/varlet/graphs/contributors">
92
- <img src="https://contrib.rocks/image?repo=varletjs/varlet" />
93
- </a>
1
+ <div align="center">
2
+ <a href="https://varlet.gitee.io/varlet-ui/#/en-US/home">
3
+ <img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
4
+ </a>
5
+ <h1>VARLET</h1>
6
+ <p>Material design mobile component library for Vue3</p>
7
+ <p>
8
+ <a href="https://varlet-varletjs.vercel.app/#/en-US/home">Documentation(Vercel)</a> |
9
+ <a href="https://varlet.gitee.io/varlet-ui/#/en-US/home">Documentation(Gitee)</a> |
10
+ <a href="https://github.com/varletjs/varlet/blob/dev/README.zh-CN.md">中文</a>
11
+ </p>
12
+ <p>
13
+ <img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
14
+ <img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
15
+ <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
16
+ <img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
17
+ <img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
18
+ <img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
19
+ <img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
20
+ </p>
21
+ </div>
22
+
23
+ ---
24
+
25
+ ### Intro
26
+
27
+ Varlet is a Material design mobile component library developed based on `Vue3`, developed and maintained by partners in the community.
28
+
29
+
30
+ ### Features
31
+ - 🚀 &nbsp; Provide 50+ high quality general purpose components
32
+ - 🚀 &nbsp; Components are very lightweight
33
+ - 💪 &nbsp; Developed by Chinese, complete Chinese and English documentation and logistics support
34
+ - 🛠️ &nbsp; Support on-demand introduction
35
+ - 🛠️ &nbsp; Support theme customization
36
+ - 🌍 &nbsp; Support internationalization
37
+ - 💡 &nbsp; Support WebStorm, VS Code component syntax highlighting
38
+ - 💪 &nbsp; Support the SSR
39
+ - 💡 &nbsp; Support the Typescript
40
+ - 💪 &nbsp; Make sure more than 90 percent unit test coverage, providing stability assurance
41
+ - 🛠️ &nbsp; Support dark mode
42
+
43
+ ### Install
44
+
45
+ ### CDN
46
+ `varlet.js` contain all the styles and logic of the component library, and you can import them.
47
+
48
+ ```html
49
+ <div id="app"></div>
50
+ <script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
51
+ <script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
52
+ <script>
53
+ const app = Vue.createApp({
54
+ template: '<var-button>Button</var-button>'
55
+ })
56
+ app.use(Varlet).mount('#app')
57
+ </script>
58
+ ```
59
+
60
+ ### Webpack / Vite
61
+ ```shell
62
+ # Install with npm or yarn or pnpm
63
+
64
+ # npm
65
+ npm i @varlet/ui -S
66
+
67
+ # yarn
68
+ yarn add @varlet/ui
69
+
70
+ # pnpm
71
+ pnpm add @varlet/ui
72
+ ```
73
+
74
+ ```js
75
+ import App from './App.vue'
76
+ import Varlet from '@varlet/ui'
77
+ import { createApp } from 'vue'
78
+ import '@varlet/ui/es/style.js'
79
+
80
+ createApp(App).use(Varlet).mount('#app')
81
+ ```
82
+
83
+ ### Thanks to contributors
84
+
85
+ <a href="https://github.com/varletjs/varlet/graphs/contributors">
86
+ <img src="https://contrib.rocks/image?repo=varletjs/varlet" />
87
+ </a>
@@ -0,0 +1,92 @@
1
+
2
+ <div align="center">
3
+ <a href="https://varlet.gitee.io/varlet-ui">
4
+ <img src="https://varlet.gitee.io/varlet-ui/logo.svg" width="150">
5
+ </a>
6
+ <h1>VARLET</h1>
7
+ <p>基于 Vue3 的 Material design 风格移动端组件库</p>
8
+ <p>
9
+ <a href="https://varlet-varletjs.vercel.app">文档(Vercel)</a> |
10
+ <a href="https://varlet.gitee.io/varlet-ui">文档(Gitee)</a>
11
+ </p>
12
+ <p>
13
+ <img src="https://img.shields.io/npm/v/@varlet/ui?style=flat-square" alt="version">
14
+ <img src="https://img.shields.io/github/stars/varletjs/varlet" alt="stars">
15
+ <img src="https://img.shields.io/badge/vue-v3.2.0%2B-%23407fbc" alt="vue">
16
+ <img src="https://img.shields.io/npm/l/@varlet/ui.svg" alt="licence">
17
+ <img src="https://img.shields.io/codecov/c/github/varletjs/varlet" alt="coverage">
18
+ <img src="https://img.badgesize.io/https://unpkg.com/@varlet/ui/umd/varlet.js?compression=gzip&label=gzip" alt="gzip" />
19
+ <img src="https://github.com/varletjs/varlet/workflows/CI/badge.svg" alt="ci">
20
+ </p>
21
+ </div>
22
+
23
+ ---
24
+
25
+ ### 介绍
26
+
27
+ Varlet 是一个基于 `Vue3` 开发的 Material 风格移动端组件库,全面拥抱 `Vue3` 生态,由社区建立起来的组件库团队进行维护。
28
+
29
+ ### 特性
30
+ - 🚀 &nbsp; 提供50+个高质量通用组件
31
+ - 🚀 &nbsp; 组件十分轻量
32
+ - 💪 &nbsp; 由国人开发,完善的中英文文档和后勤保障
33
+ - 🛠️ &nbsp; 支持按需引入
34
+ - 🛠️ &nbsp; 支持主题定制
35
+ - 🌍 &nbsp; 支持国际化
36
+ - 💡 &nbsp; 支持 webstorm,vscode 组件属性高亮
37
+ - 💪 &nbsp; 支持 SSR
38
+ - 💡 &nbsp; 支持 Typescript
39
+ - 💪 &nbsp; 确保90%以上单元测试覆盖率,提供稳定性保证
40
+ - 🛠️ &nbsp; 支持暗黑模式
41
+
42
+ ### 安装
43
+
44
+ ### CDN
45
+ `varlet.js` 包含组件库的所有样式和逻辑,引入即可。
46
+
47
+ ```html
48
+ <div id="app"></div>
49
+ <script src="https://cdn.jsdelivr.net/npm/vue@next"></script>
50
+ <script src="https://cdn.jsdelivr.net/npm/@varlet/ui/umd/varlet.js"></script>
51
+ <script>
52
+ const app = Vue.createApp({
53
+ template: '<var-button>按钮</var-button>'
54
+ })
55
+ app.use(Varlet).mount('#app')
56
+ </script>
57
+ ```
58
+
59
+ ### Webpack / Vite
60
+ ```shell
61
+ # 通过 npm 或 yarn 或 pnpm 安装
62
+
63
+ # npm
64
+ npm i @varlet/ui -S
65
+
66
+ # yarn
67
+ yarn add @varlet/ui
68
+
69
+ # pnpm
70
+ pnpm add @varlet/ui
71
+ ```
72
+
73
+ ```js
74
+ import App from './App.vue'
75
+ import Varlet from '@varlet/ui'
76
+ import { createApp } from 'vue'
77
+ import '@varlet/ui/es/style.js'
78
+
79
+ createApp(App).use(Varlet).mount('#app')
80
+ ```
81
+
82
+ ### 反馈和交流
83
+
84
+ 我们推荐使用`issue`列表进行最直接有效的反馈,也可以通过扫描下方二维码进入微信群进行交流
85
+
86
+ <img style="width: 25%" src="https://github.com/varletjs/varlet/blob/dev/sponsor/community.png?raw=true" />
87
+
88
+ ### 感谢贡献者们做出的努力
89
+
90
+ <a href="https://github.com/varletjs/varlet/graphs/contributors">
91
+ <img src="https://contrib.rocks/image?repo=varletjs/varlet" />
92
+ </a>
@@ -67,7 +67,9 @@ export default defineComponent({
67
67
  var attemptAutoLoading = result => {
68
68
  if (props.autoLoading) {
69
69
  pending.value = true;
70
- Promise.resolve(result).finally(() => {
70
+ Promise.resolve(result).then(() => {
71
+ pending.value = false;
72
+ }).catch(() => {
71
73
  pending.value = false;
72
74
  });
73
75
  }
@@ -1,8 +1,9 @@
1
1
  import { defineComponent, ref, watch } from 'vue';
2
2
  import { props } from './props';
3
3
  import { requestAnimationFrame, cancelAnimationFrame } from '../utils/elements';
4
- import { toNumber } from '@varlet/shared';
5
4
  import { call, createNamespace } from '../utils/components';
5
+ import { padStart } from '../utils/shared';
6
+ import { toNumber } from '@varlet/shared';
6
7
  var {
7
8
  n
8
9
  } = createNamespace('countdown');
@@ -47,12 +48,12 @@ export default defineComponent({
47
48
  if (!format.includes(scannedFormat)) {
48
49
  scannedTimes[index + 1] += scannedTimes[index] * padValues[index];
49
50
  } else {
50
- format = format.replace(scannedFormat, String(scannedTimes[index]).padStart(2, '0'));
51
+ format = format.replace(scannedFormat, padStart("" + scannedTimes[index], 2, '0'));
51
52
  }
52
53
  });
53
54
 
54
55
  if (format.includes('S')) {
55
- var ms = String(scannedTimes[scannedTimes.length - 1]).padStart(3, '0');
56
+ var ms = padStart("" + scannedTimes[scannedTimes.length - 1], 3, '0');
56
57
 
57
58
  if (format.includes('SSS')) {
58
59
  format = format.replace('SSS', ms);
@@ -7,6 +7,7 @@ import { props, MONTH_LIST, WEEK_HEADER } from './props';
7
7
  import { isArray, toNumber } from '@varlet/shared';
8
8
  import { nextTickFrame } from '../utils/elements';
9
9
  import { createNamespace, call } from '../utils/components';
10
+ import { padStart } from '../utils/shared';
10
11
  import { pack } from '../locale';
11
12
  var {
12
13
  n,
@@ -243,7 +244,7 @@ export default defineComponent({
243
244
  var week = WEEK_HEADER.find(value => value.index === "" + weekIndex);
244
245
  var weekName = (_pack$value$datePicke3 = (_pack$value$datePicke4 = pack.value.datePickerWeekDict) == null ? void 0 : _pack$value$datePicke4[week.index].name) != null ? _pack$value$datePicke3 : '';
245
246
  var monthName = (_pack$value$datePicke5 = (_pack$value$datePicke6 = pack.value.datePickerMonthDict) == null ? void 0 : _pack$value$datePicke6[chooseMonth.value.index].name) != null ? _pack$value$datePicke5 : '';
246
- var showDay = chooseDay.value.padStart(2, '0');
247
+ var showDay = padStart(chooseDay.value, 2, '0');
247
248
  if (pack.value.lang === 'zh-CN') return chooseMonth.value.index + "-" + showDay + " " + weekName.slice(0, 3);
248
249
  return weekName.slice(0, 3) + ", " + monthName.slice(0, 3) + " " + chooseDay.value;
249
250
  });
@@ -257,10 +258,10 @@ export default defineComponent({
257
258
  return !props.touchable || ['', 'year'].includes(getPanelType.value);
258
259
  });
259
260
  var slotProps = computed(() => {
260
- var _chooseMonth$value, _chooseDay$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
261
+ var _chooseMonth$value, _chooseYear$value, _chooseMonth$value$in, _chooseMonth$value2;
261
262
 
262
263
  var weekIndex = dayjs(chooseYear.value + "-" + ((_chooseMonth$value = chooseMonth.value) == null ? void 0 : _chooseMonth$value.index) + "-" + chooseDay.value).day();
263
- var date = chooseDay.value ? (_chooseDay$value = chooseDay.value) == null ? void 0 : _chooseDay$value.padStart(2, '0') : '';
264
+ var date = chooseDay.value ? padStart(chooseDay.value, 2, '0') : '';
264
265
  return {
265
266
  week: "" + weekIndex,
266
267
  year: (_chooseYear$value = chooseYear.value) != null ? _chooseYear$value : '',
package/es/index.d.ts CHANGED
@@ -1 +1 @@
1
- export * from '..\types'
1
+ export * from '../types'
package/es/input/Input.js CHANGED
@@ -73,7 +73,7 @@ export function render(_ctx, _cache) {
73
73
  onTouchstart: _cache[4] || (_cache[4] = function () {
74
74
  return _ctx.handleTouchstart && _ctx.handleTouchstart(...arguments);
75
75
  })
76
- }, "\r\n ", 46
76
+ }, "\n ", 46
77
77
  /* CLASS, STYLE, PROPS, HYDRATE_EVENTS */
78
78
  , _hoisted_1)) : (_openBlock(), _createElementBlock("input", {
79
79
  key: 2,
@@ -1,5 +1,5 @@
1
- import type { Pack } from '../../types'
2
-
3
- declare const enUS: Pack
4
-
5
- export default enUS
1
+ import type { Pack } from '../../types'
2
+
3
+ declare const enUS: Pack
4
+
5
+ export default enUS
@@ -1,5 +1,5 @@
1
- import type { Pack } from '../../types'
2
-
3
- declare const zhCN: Pack
4
-
5
- export default zhCN
1
+ import type { Pack } from '../../types'
2
+
3
+ declare const zhCN: Pack
4
+
5
+ export default zhCN
package/es/space/Space.js CHANGED
@@ -29,6 +29,10 @@ export default defineComponent({
29
29
  return isInternalSize ? internalSizes[size] : isArray(size) ? size.map(toPxNum) : [toPxNum(size), toPxNum(size)];
30
30
  };
31
31
 
32
+ var padStartFlex = style => {
33
+ return style === 'start' || style === 'end' ? "flex-" + style : style;
34
+ };
35
+
32
36
  return () => {
33
37
  var _call;
34
38
 
@@ -102,8 +106,8 @@ export default defineComponent({
102
106
  "class": classes(n(), 'var--box', [inline, n('--inline')]),
103
107
  "style": {
104
108
  flexDirection: direction,
105
- justifyContent: justify,
106
- alignItems: align,
109
+ justifyContent: padStartFlex(justify),
110
+ alignItems: padStartFlex(align),
107
111
  flexWrap: wrap ? 'wrap' : 'nowrap',
108
112
  margin: direction === 'row' ? "-" + y / 2 + "px 0" : undefined
109
113
  }
@@ -3,13 +3,9 @@ import { formatStyleVars } from '../utils/elements';
3
3
  var mountedVarKeys = [];
4
4
 
5
5
  function StyleProvider(styleVars) {
6
- if (styleVars === void 0) {
7
- styleVars = {};
8
- }
9
-
10
6
  mountedVarKeys.forEach(key => document.documentElement.style.removeProperty(key));
11
7
  mountedVarKeys.length = 0;
12
- var styles = formatStyleVars(styleVars);
8
+ var styles = formatStyleVars(styleVars != null ? styleVars : {});
13
9
  Object.entries(styles).forEach(_ref => {
14
10
  var [key, value] = _ref;
15
11
  document.documentElement.style.setProperty(key, value);
@@ -1,5 +1,5 @@
1
- import { StyleVars } from '../../../types'
2
-
3
- declare const dark: StyleVars
4
-
5
- export default dark
1
+ import { StyleVars } from '../../../types'
2
+
3
+ declare const dark: StyleVars
4
+
5
+ export default dark
@@ -4,6 +4,7 @@ import Clock from './clock.js'
4
4
  import { props, hoursAmpm, hours24 } from './props';
5
5
  import { toNumber } from '@varlet/shared';
6
6
  import { createNamespace, call } from '../utils/components';
7
+ import { padStart } from '../utils/shared';
7
8
  import { getNumberTime, getIsDisableMinute, getIsDisableSecond } from './utils';
8
9
  var {
9
10
  n,
@@ -195,7 +196,7 @@ export default defineComponent({
195
196
  var newHour = findAvailableHour(ampmType);
196
197
  if (!newHour) return;
197
198
  var second = props.useSeconds ? ":" + time.value.second : '';
198
- var newTime = newHour.padStart(2, '0') + ":" + time.value.minute + second;
199
+ var newTime = padStart(newHour, 2, '0') + ":" + time.value.minute + second;
199
200
  update(newTime);
200
201
  };
201
202
 
@@ -374,7 +375,7 @@ export default defineComponent({
374
375
  time.value = getTime(value);
375
376
 
376
377
  if (props.format !== '24hr') {
377
- ampm.value = ("" + hour).padStart(2, '0') === formatHour24 && hours24.includes(formatHour24) ? 'pm' : 'am';
378
+ ampm.value = padStart("" + hour, 2, '0') === formatHour24 && hours24.includes(formatHour24) ? 'pm' : 'am';
378
379
  }
379
380
 
380
381
  isInner.value = props.format === '24hr' && hours24.includes(formatHour24);
@@ -4,6 +4,7 @@ import { hoursAmpm, hours24, minSec } from './props';
4
4
  import { notConvert, convertHour, getIsDisableMinute, getIsDisableSecond, getNumberTime } from './utils';
5
5
  import { toNumber } from '@varlet/shared';
6
6
  import { createNamespace } from '../utils/components';
7
+ import { padStart } from '../utils/shared';
7
8
  var {
8
9
  n,
9
10
  classes
@@ -218,7 +219,7 @@ export default defineComponent({
218
219
  var getHour = () => {
219
220
  if (activeItemIndex.value === undefined) return undefined;
220
221
  var hours = props.ampm === 'am' ? hoursAmpm : hours24;
221
- return hours[activeItemIndex.value].padStart(2, '0');
222
+ return padStart(hours[activeItemIndex.value], 2, '0');
222
223
  };
223
224
 
224
225
  watch([activeItemIndex, () => props.isInner], (_ref2, _ref3) => {
@@ -3,6 +3,7 @@ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try
3
3
  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); }); }; }
4
4
 
5
5
  import { isNumber, isString, kebabCase, toNumber } from '@varlet/shared';
6
+ import { getGlobalThis } from './shared';
6
7
  export function getLeft(element) {
7
8
  var {
8
9
  left
@@ -159,9 +160,11 @@ export var multiplySizeUnit = function (value, quantity) {
159
160
  return "" + parseFloat(legalSize) * quantity + unit;
160
161
  };
161
162
  export function requestAnimationFrame(fn) {
163
+ var globalThis = getGlobalThis();
162
164
  return globalThis.requestAnimationFrame ? globalThis.requestAnimationFrame(fn) : globalThis.setTimeout(fn, 16);
163
165
  }
164
166
  export function cancelAnimationFrame(handle) {
167
+ var globalThis = getGlobalThis();
165
168
  globalThis.cancelAnimationFrame ? globalThis.cancelAnimationFrame(handle) : globalThis.clearTimeout(handle);
166
169
  }
167
170
  export function nextTickFrame(fn) {
File without changes
@@ -44,4 +44,23 @@ export var createCache = max => {
44
44
  export var linear = value => value;
45
45
  export var cubic = value => Math.pow(value, 3);
46
46
  export var easeInOutCubic = value => value < 0.5 ? cubic(value * 2) / 2 : 1 - cubic((1 - value) * 2) / 2;
47
- export var dt = (value, defaultText) => value == null ? defaultText : value;
47
+ export var dt = (value, defaultText) => value == null ? defaultText : value;
48
+ export var getGlobalThis = () => {
49
+ if (typeof globalThis !== 'undefined') return globalThis;
50
+ if (typeof window !== 'undefined') return window;
51
+ return typeof global !== 'undefined' ? global : self;
52
+ };
53
+ export var padStart = function (str, maxLength, fillString) {
54
+ if (str === void 0) {
55
+ str = '';
56
+ }
57
+
58
+ if (fillString === void 0) {
59
+ fillString = '';
60
+ }
61
+
62
+ if (str.length >= maxLength) return str;
63
+ var len = maxLength - str.length;
64
+ var repeatCount = Math.floor(len / fillString.length);
65
+ return fillString.repeat(repeatCount) + fillString.slice(0, len % fillString.length) + str;
66
+ };