@varlet/ui 1.20.0 → 1.22.0-alpha.10

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 (75) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/es/action-sheet/ActionSheet.js +15 -19
  3. package/es/app-bar/AppBar.js +14 -19
  4. package/es/back-top/BackTop.js +7 -10
  5. package/es/badge/Badge.js +7 -12
  6. package/es/button/Button.js +14 -13
  7. package/es/card/Card.js +19 -23
  8. package/es/cell/Cell.js +14 -19
  9. package/es/checkbox/Checkbox.js +14 -19
  10. package/es/checkbox-group/CheckboxGroup.js +6 -11
  11. package/es/chip/Chip.js +8 -11
  12. package/es/col/Col.js +8 -11
  13. package/es/collapse/Collapse.js +5 -10
  14. package/es/collapse-item/CollapseItem.js +16 -21
  15. package/es/countdown/Countdown.js +5 -10
  16. package/es/counter/Counter.js +18 -22
  17. package/es/date-picker/DatePicker.js +23 -28
  18. package/es/date-picker/src/day-picker-panel.js +14 -19
  19. package/es/date-picker/src/month-picker-panel.js +12 -17
  20. package/es/date-picker/src/panel-header.js +12 -17
  21. package/es/date-picker/src/year-picker-panel.js +12 -16
  22. package/es/dialog/Dialog.js +12 -17
  23. package/es/divider/Divider.js +8 -13
  24. package/es/form/Form.js +5 -10
  25. package/es/form-details/FormDetails.js +6 -11
  26. package/es/icon/Icon.js +6 -9
  27. package/es/icon/icon.less +1 -1
  28. package/es/image/Image.js +23 -21
  29. package/es/image-preview/ImagePreview.js +20 -24
  30. package/es/index-anchor/IndexAnchor.js +17 -9
  31. package/es/index-bar/IndexBar.js +26 -20
  32. package/es/index-bar/props.js +4 -0
  33. package/es/input/Input.js +33 -37
  34. package/es/list/List.js +10 -15
  35. package/es/loading/Loading.js +21 -24
  36. package/es/menu/Menu.js +9 -12
  37. package/es/option/Option.js +16 -21
  38. package/es/picker/Picker.js +33 -36
  39. package/es/popup/Popup.js +14 -17
  40. package/es/progress/Progress.js +30 -32
  41. package/es/pull-refresh/PullRefresh.js +12 -15
  42. package/es/radio/Radio.js +14 -19
  43. package/es/radio-group/RadioGroup.js +6 -11
  44. package/es/rate/Rate.js +12 -16
  45. package/es/row/Row.js +7 -10
  46. package/es/select/Select.js +42 -47
  47. package/es/skeleton/Skeleton.js +41 -39
  48. package/es/slider/Slider.js +32 -36
  49. package/es/snackbar/Snackbar.js +8 -11
  50. package/es/snackbar/core.js +14 -19
  51. package/es/snackbar/style/index.js +1 -1
  52. package/es/snackbar/style/less.js +1 -1
  53. package/es/step/Step.js +42 -97
  54. package/es/steps/Steps.js +6 -9
  55. package/es/sticky/Sticky.js +38 -33
  56. package/es/sticky/props.js +8 -0
  57. package/es/sticky/sticky.css +1 -1
  58. package/es/sticky/sticky.less +6 -2
  59. package/es/swipe/Swipe.js +20 -24
  60. package/es/swipe-item/SwipeItem.js +6 -9
  61. package/es/switch/Switch.js +16 -21
  62. package/es/tab/Tab.js +8 -11
  63. package/es/tab-item/TabItem.js +5 -8
  64. package/es/tabs/Tabs.js +10 -13
  65. package/es/tabs-items/TabsItems.js +4 -7
  66. package/es/time-picker/TimePicker.js +32 -37
  67. package/es/time-picker/clock.js +15 -20
  68. package/es/uploader/Uploader.js +31 -31
  69. package/highlight/attributes.json +12 -0
  70. package/highlight/tags.json +4 -1
  71. package/highlight/web-types.json +27 -0
  72. package/package.json +4 -4
  73. package/types/indexBar.d.ts +1 -0
  74. package/types/sticky.d.ts +2 -0
  75. package/umd/varlet.js +3 -1
@@ -1,13 +1,11 @@
1
1
  import { computed, defineComponent, ref, watch } from 'vue';
2
- import dayjs from 'dayjs';
2
+ import dayjs from 'dayjs/esm';
3
3
  import { hoursAmpm, hours24, minSec } from './props';
4
4
  import { notConvert, convertHour, getIsDisableMinute, getIsDisableSecond, getNumberTime } from './utils';
5
5
  import { toNumber } from '../utils/shared';
6
- import { createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
6
+ import { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
7
7
 
8
- var _withId = /*#__PURE__*/_withScopeId("");
9
-
10
- _pushScopeId("");
8
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
11
9
 
12
10
  var _hoisted_1 = {
13
11
  class: "var-time-picker-clock"
@@ -17,30 +15,27 @@ var _hoisted_2 = {
17
15
  class: "var-time-picker-clock__inner",
18
16
  ref: "inner"
19
17
  };
20
-
21
- _popScopeId();
22
-
23
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
24
- return _openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", {
18
+ export function render(_ctx, _cache) {
19
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", {
25
20
  class: "var-time-picker-clock__hand",
26
- style: _ctx.handStyle
21
+ style: _normalizeStyle(_ctx.handStyle)
27
22
  }, null, 4
28
23
  /* STYLE */
29
- ), (_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.timeScales, (timeScale, index) => {
30
- return _openBlock(), _createBlock("div", {
31
- class: ["var-time-picker-clock__item", [_ctx.isActive(index, false) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(timeScale) ? 'var-time-picker-clock__item--disable' : null]],
24
+ ), (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.timeScales, (timeScale, index) => {
25
+ return _openBlock(), _createElementBlock("div", {
26
+ class: _normalizeClass(["var-time-picker-clock__item", [_ctx.isActive(index, false) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(timeScale) ? 'var-time-picker-clock__item--disable' : null]]),
32
27
  key: timeScale,
33
- style: _ctx.getStyle(index, timeScale, false)
28
+ style: _normalizeStyle(_ctx.getStyle(index, timeScale, false))
34
29
  }, _toDisplayString(timeScale), 7
35
30
  /* TEXT, CLASS, STYLE */
36
31
  );
37
32
  }), 128
38
33
  /* KEYED_FRAGMENT */
39
- )), _ctx.format === '24hr' && _ctx.type === 'hour' ? (_openBlock(), _createBlock("div", _hoisted_2, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.hours24, (hour, index) => {
40
- return _openBlock(), _createBlock("div", {
41
- class: ["var-time-picker-clock__item", [_ctx.isActive(index, true) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(hour) ? 'var-time-picker-clock__item--disable' : null]],
34
+ )), _ctx.format === '24hr' && _ctx.type === 'hour' ? (_openBlock(), _createElementBlock("div", _hoisted_2, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.hours24, (hour, index) => {
35
+ return _openBlock(), _createElementBlock("div", {
36
+ class: _normalizeClass(["var-time-picker-clock__item", [_ctx.isActive(index, true) ? 'var-time-picker-clock__item--active' : null, _ctx.isDisable(hour) ? 'var-time-picker-clock__item--disable' : null]]),
42
37
  key: hour,
43
- style: _ctx.getStyle(index, hour, true)
38
+ style: _normalizeStyle(_ctx.getStyle(index, hour, true))
44
39
  }, _toDisplayString(hour), 7
45
40
  /* TEXT, CLASS, STYLE */
46
41
  );
@@ -49,7 +44,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
49
44
  ))], 512
50
45
  /* NEED_PATCH */
51
46
  )) : _createCommentVNode("v-if", true)]);
52
- });
47
+ }
53
48
  export default defineComponent({
54
49
  render,
55
50
  name: 'Clock',
@@ -12,11 +12,9 @@ import { props } from './props';
12
12
  import { isNumber, isHTMLSupportImage, isHTMLSupportVideo, toNumber, isString } from '../utils/shared';
13
13
  import { useValidation } from '../utils/components';
14
14
  import { useForm } from '../form/provide';
15
- import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createBlock as _createBlock, toDisplayString as _toDisplayString, createVNode as _createVNode, resolveComponent as _resolveComponent, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, renderSlot as _renderSlot, withScopeId as _withScopeId, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
15
+ import { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, renderSlot as _renderSlot, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from "vue";
16
16
 
17
- var _withId = /*#__PURE__*/_withScopeId("");
18
-
19
- _pushScopeId("");
17
+ var _withScopeId = n => (_pushScopeId(""), n = n(), _popScopeId(), n);
20
18
 
21
19
  var _hoisted_1 = {
22
20
  class: "var-uploader var--box"
@@ -24,13 +22,15 @@ var _hoisted_1 = {
24
22
  var _hoisted_2 = {
25
23
  class: "var-uploader__file-list"
26
24
  };
27
- var _hoisted_3 = {
25
+ var _hoisted_3 = ["onClick"];
26
+ var _hoisted_4 = {
28
27
  class: "var-uploader__file-name"
29
28
  };
30
-
31
- _popScopeId();
32
-
33
- export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
29
+ var _hoisted_5 = ["onClick"];
30
+ var _hoisted_6 = ["src", "alt"];
31
+ var _hoisted_7 = ["multiple", "accept", "capture", "disabled"];
32
+ var _hoisted_8 = ["src"];
33
+ export function render(_ctx, _cache) {
34
34
  var _component_var_icon = _resolveComponent("var-icon");
35
35
 
36
36
  var _component_var_form_details = _resolveComponent("var-form-details");
@@ -39,14 +39,14 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
39
39
 
40
40
  var _directive_ripple = _resolveDirective("ripple");
41
41
 
42
- return _openBlock(), _createBlock("div", _hoisted_1, [_createVNode("div", _hoisted_2, [(_openBlock(true), _createBlock(_Fragment, null, _renderList(_ctx.modelValue, f => {
43
- return _withDirectives((_openBlock(), _createBlock("div", {
44
- class: ["var-uploader__file var-elevation--2", [f.state === 'loading' ? 'var-uploader--loading' : null]],
42
+ return _openBlock(), _createElementBlock("div", _hoisted_1, [_createElementVNode("div", _hoisted_2, [(_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_ctx.modelValue, f => {
43
+ return _withDirectives((_openBlock(), _createElementBlock("div", {
44
+ class: _normalizeClass(["var-uploader__file var-elevation--2", [f.state === 'loading' ? 'var-uploader--loading' : null]]),
45
45
  key: f,
46
46
  onClick: $event => _ctx.preview(f)
47
- }, [_createVNode("div", _hoisted_3, _toDisplayString(f.name || f.url), 1
47
+ }, [_createElementVNode("div", _hoisted_4, _toDisplayString(f.name || f.url), 1
48
48
  /* TEXT */
49
- ), _ctx.removable ? (_openBlock(), _createBlock("div", {
49
+ ), _ctx.removable ? (_openBlock(), _createElementBlock("div", {
50
50
  key: 0,
51
51
  class: "var-uploader__file-close",
52
52
  onClick: _withModifiers($event => _ctx.handleRemove(f), ["stop"])
@@ -56,41 +56,41 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
56
56
  name: "delete"
57
57
  })], 8
58
58
  /* PROPS */
59
- , ["onClick"])) : _createCommentVNode("v-if", true), f.cover ? (_openBlock(), _createBlock("img", {
59
+ , _hoisted_5)) : _createCommentVNode("v-if", true), f.cover ? (_openBlock(), _createElementBlock("img", {
60
60
  key: 1,
61
61
  class: "var-uploader__file-cover",
62
- style: {
62
+ style: _normalizeStyle({
63
63
  objectFit: f.fit
64
- },
64
+ }),
65
65
  src: f.cover,
66
66
  alt: f.name
67
67
  }, null, 12
68
68
  /* STYLE, PROPS */
69
- , ["src", "alt"])) : _createCommentVNode("v-if", true), _createVNode("div", {
70
- class: ["var-uploader__file-indicator", [f.state === 'success' ? 'var-uploader--success' : null, f.state === 'error' ? 'var-uploader--error' : null]]
69
+ , _hoisted_6)) : _createCommentVNode("v-if", true), _createElementVNode("div", {
70
+ class: _normalizeClass(["var-uploader__file-indicator", [f.state === 'success' ? 'var-uploader--success' : null, f.state === 'error' ? 'var-uploader--error' : null]])
71
71
  }, null, 2
72
72
  /* CLASS */
73
73
  )], 10
74
74
  /* CLASS, PROPS */
75
- , ["onClick"])), [[_directive_ripple, {
75
+ , _hoisted_3)), [[_directive_ripple, {
76
76
  disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly || !_ctx.ripple
77
77
  }]]);
78
78
  }), 128
79
79
  /* KEYED_FRAGMENT */
80
- )), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? _withDirectives((_openBlock(), _createBlock("div", {
80
+ )), !_ctx.maxlength || _ctx.modelValue.length < _ctx.maxlength ? _withDirectives((_openBlock(), _createElementBlock("div", {
81
81
  key: 0,
82
- class: ["var--relative", [!_ctx.$slots.default ? 'var-uploader__action var-elevation--2' : null, _ctx.disabled || _ctx.formDisabled ? 'var-uploader--disabled' : null]]
83
- }, [_createVNode("input", {
82
+ class: _normalizeClass(["var--relative", [!_ctx.$slots.default ? 'var-uploader__action var-elevation--2' : null, _ctx.disabled || _ctx.formDisabled ? 'var-uploader--disabled' : null]])
83
+ }, [_createElementVNode("input", {
84
84
  class: "var-uploader__action-input",
85
85
  type: "file",
86
86
  multiple: _ctx.multiple,
87
87
  accept: _ctx.accept,
88
88
  capture: _ctx.capture,
89
89
  disabled: _ctx.disabled || _ctx.formDisabled || _ctx.readonly || _ctx.formReadonly,
90
- onChange: _cache[1] || (_cache[1] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
90
+ onChange: _cache[0] || (_cache[0] = (...args) => _ctx.handleChange && _ctx.handleChange(...args))
91
91
  }, null, 40
92
92
  /* PROPS, HYDRATE_EVENTS */
93
- , ["multiple", "accept", "capture", "disabled"]), _renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_icon, {
93
+ , _hoisted_7), _renderSlot(_ctx.$slots, "default", {}, () => [_createVNode(_component_var_icon, {
94
94
  class: "var-uploader__action-icon",
95
95
  "var-uploader-cover": "",
96
96
  name: "plus"
@@ -108,13 +108,13 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
108
108
  "var-uploader-cover": "",
109
109
  position: "center",
110
110
  show: _ctx.showPreview,
111
- "onUpdate:show": _cache[2] || (_cache[2] = $event => _ctx.showPreview = $event),
112
- onClosed: _cache[3] || (_cache[3] = $event => _ctx.currentPreview = null)
111
+ "onUpdate:show": _cache[1] || (_cache[1] = $event => _ctx.showPreview = $event),
112
+ onClosed: _cache[2] || (_cache[2] = $event => _ctx.currentPreview = null)
113
113
  }, {
114
- default: _withId(() => {
114
+ default: _withCtx(() => {
115
115
  var _ctx$currentPreview, _ctx$currentPreview2;
116
116
 
117
- return [_ctx.currentPreview && _ctx.isHTMLSupportVideo((_ctx$currentPreview = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview.url) ? (_openBlock(), _createBlock("video", {
117
+ return [_ctx.currentPreview && _ctx.isHTMLSupportVideo((_ctx$currentPreview = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview.url) ? (_openBlock(), _createElementBlock("video", {
118
118
  key: 0,
119
119
  class: "var-uploader__preview-video",
120
120
  playsinline: "true",
@@ -126,7 +126,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
126
126
  src: (_ctx$currentPreview2 = _ctx.currentPreview) == null ? void 0 : _ctx$currentPreview2.url
127
127
  }, null, 8
128
128
  /* PROPS */
129
- , ["src"])) : _createCommentVNode("v-if", true)];
129
+ , _hoisted_8)) : _createCommentVNode("v-if", true)];
130
130
  }),
131
131
  _: 1
132
132
  /* STABLE */
@@ -134,7 +134,7 @@ export var render = /*#__PURE__*/_withId((_ctx, _cache) => {
134
134
  }, 8
135
135
  /* PROPS */
136
136
  , ["show"])]);
137
- });
137
+ }
138
138
  export default defineComponent({
139
139
  render,
140
140
  name: 'VarUploader',
@@ -711,6 +711,10 @@
711
711
  "type": "boolean",
712
712
  "description": "是否隐藏锚点列表 默认值:false"
713
713
  },
714
+ "var-index-bar/css-mode": {
715
+ "type": "boolean",
716
+ "description": "开启原生`css sticky`模式 默认值:false"
717
+ },
714
718
  "var-index-bar/z-index": {
715
719
  "type": "number | string",
716
720
  "description": "z-index 层级 默认值:1"
@@ -1359,6 +1363,14 @@
1359
1363
  "type": "string | number",
1360
1364
  "description": "吸顶时的层级 默认值:0"
1361
1365
  },
1366
+ "var-sticky/css-mode": {
1367
+ "type": "boolean",
1368
+ "description": "开启原生`css sticky`模式 默认值:false"
1369
+ },
1370
+ "var-sticky/disabled": {
1371
+ "type": "boolean",
1372
+ "description": "禁用吸顶, 设置为`true`时, 元素会回到文档流中 默认值:false"
1373
+ },
1362
1374
  "var-style-provider/style-vars": {
1363
1375
  "type": "Record<string, string>",
1364
1376
  "description": "css变量 默认值:{}"
@@ -274,6 +274,7 @@
274
274
  "sticky",
275
275
  "sticky-offset-top",
276
276
  "hide-list",
277
+ "css-mode",
277
278
  "z-index",
278
279
  "highlight-color",
279
280
  "duration"
@@ -524,7 +525,9 @@
524
525
  "var-sticky": {
525
526
  "attributes": [
526
527
  "offset-top",
527
- "z-index"
528
+ "z-index",
529
+ "css-mode",
530
+ "disabled"
528
531
  ]
529
532
  },
530
533
  "var-style-provider": {
@@ -2150,6 +2150,15 @@
2150
2150
  "kind": "expression"
2151
2151
  }
2152
2152
  },
2153
+ {
2154
+ "name": "css-mode",
2155
+ "description": "开启原生`css sticky`模式",
2156
+ "default": "false",
2157
+ "value": {
2158
+ "type": "boolean",
2159
+ "kind": "expression"
2160
+ }
2161
+ },
2153
2162
  {
2154
2163
  "name": "z-index",
2155
2164
  "description": "z-index 层级",
@@ -4078,6 +4087,24 @@
4078
4087
  "type": "string | number",
4079
4088
  "kind": "expression"
4080
4089
  }
4090
+ },
4091
+ {
4092
+ "name": "css-mode",
4093
+ "description": "开启原生`css sticky`模式",
4094
+ "default": "false",
4095
+ "value": {
4096
+ "type": "boolean",
4097
+ "kind": "expression"
4098
+ }
4099
+ },
4100
+ {
4101
+ "name": "disabled",
4102
+ "description": "禁用吸顶, 设置为`true`时, 元素会回到文档流中",
4103
+ "default": "false",
4104
+ "value": {
4105
+ "type": "boolean",
4106
+ "kind": "expression"
4107
+ }
4081
4108
  }
4082
4109
  ],
4083
4110
  "events": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@varlet/ui",
3
- "version": "1.20.0",
3
+ "version": "1.22.0-alpha.10+6b74530c",
4
4
  "description": "A material like components library",
5
5
  "module": "es/index.js",
6
6
  "typings": "types/index.d.ts",
@@ -43,11 +43,11 @@
43
43
  "test:watch": "varlet-cli jest -w"
44
44
  },
45
45
  "peerDependencies": {
46
- "vue": "^3.0.0"
46
+ "vue": "^3.2.0"
47
47
  },
48
- "gitHead": "ec0aa70ef11d945d8dfb7cf88879e1447b3de9d9",
48
+ "gitHead": "6b74530cf52ce08997a311d1a63402585c23be18",
49
49
  "devDependencies": {
50
- "@varlet/cli": "^1.20.0"
50
+ "@varlet/cli": "^1.22.0-alpha.10+6b74530c"
51
51
  },
52
52
  "dependencies": {
53
53
  "dayjs": "^1.10.4",
@@ -4,6 +4,7 @@ export interface IndexBarProps {
4
4
  sticky?: boolean
5
5
  stickyOffsetTop?: number
6
6
  hideList?: boolean
7
+ cssMode?: boolean
7
8
  zIndex?: number | string
8
9
  highlightColor?: string
9
10
  duration?: number | string
package/types/sticky.d.ts CHANGED
@@ -3,6 +3,8 @@ import { VarComponent } from './varComponent'
3
3
  export interface StickyProps {
4
4
  offsetTop?: string | number
5
5
  zIndex?: string | number
6
+ cssMode?: boolean
7
+ disabled?: boolean
6
8
  onScroll?: (offsetTop: number, isFixed: boolean) => void
7
9
  }
8
10