@varlet/ui 1.27.1 → 1.27.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.
Files changed (40) hide show
  1. package/es/bottom-navigation/BottomNavigation.js +1 -1
  2. package/es/bottom-navigation/bottomNavigation.css +1 -1
  3. package/es/bottom-navigation/bottomNavigation.less +5 -0
  4. package/es/bottom-navigation/props.js +4 -0
  5. package/es/rate/Rate.js +1 -1
  6. package/es/rate/rate.css +1 -1
  7. package/es/rate/rate.less +8 -6
  8. package/es/snackbar/style/index.js +1 -1
  9. package/es/snackbar/style/less.js +1 -1
  10. package/es/style.css +1 -1
  11. package/es/tabs/Tabs.js +1 -1
  12. package/es/tabs/props.js +4 -0
  13. package/es/tabs/tabs.css +1 -1
  14. package/es/tabs/tabs.less +6 -0
  15. package/es/uploader/Uploader.js +3 -3
  16. package/es/uploader/uploader.css +1 -1
  17. package/es/uploader/uploader.less +1 -2
  18. package/es/varlet.esm.js +15 -7
  19. package/highlight/attributes.json +9 -1
  20. package/highlight/tags.json +2 -0
  21. package/highlight/web-types.json +20 -2
  22. package/lib/bottom-navigation/BottomNavigation.js +1 -1
  23. package/lib/bottom-navigation/bottomNavigation.css +1 -1
  24. package/lib/bottom-navigation/bottomNavigation.less +5 -0
  25. package/lib/bottom-navigation/props.js +4 -0
  26. package/lib/rate/Rate.js +1 -1
  27. package/lib/rate/rate.css +1 -1
  28. package/lib/rate/rate.less +8 -6
  29. package/lib/style.css +1 -1
  30. package/lib/tabs/Tabs.js +1 -1
  31. package/lib/tabs/props.js +4 -0
  32. package/lib/tabs/tabs.css +1 -1
  33. package/lib/tabs/tabs.less +6 -0
  34. package/lib/uploader/Uploader.js +3 -3
  35. package/lib/uploader/uploader.css +1 -1
  36. package/lib/uploader/uploader.less +1 -2
  37. package/package.json +4 -4
  38. package/types/bottomNavigation.d.ts +2 -1
  39. package/types/tabs.d.ts +1 -0
  40. package/umd/varlet.js +3 -3
package/es/tabs/Tabs.js CHANGED
@@ -19,7 +19,7 @@ export function render(_ctx, _cache) {
19
19
  "offset-top": _ctx.sticky ? _ctx.offsetTop : null
20
20
  }, {
21
21
  default: _withCtx(() => [_createElementVNode("div", _mergeProps({
22
- class: _ctx.classes(_ctx.n(), 'var--box', _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, 'var-elevation--4'], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')]),
22
+ class: _ctx.classes(_ctx.n(), 'var--box', _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, 'var-elevation--4'], [_ctx.fixedBottom, _ctx.n('--fixed-bottom')], [_ctx.safeArea, _ctx.n('--safe-area')]),
23
23
  style: {
24
24
  background: _ctx.color
25
25
  }
package/es/tabs/props.js CHANGED
@@ -50,6 +50,10 @@ export var props = {
50
50
  type: Boolean,
51
51
  default: false
52
52
  },
53
+ safeArea: {
54
+ type: Boolean,
55
+ default: false
56
+ },
53
57
  offsetTop: pickProps(stickyProps, 'offsetTop'),
54
58
  onClick: {
55
59
  type: Function
package/es/tabs/tabs.css CHANGED
@@ -1 +1 @@
1
- :root { --tabs-item-horizontal-height: 44px; --tabs-item-vertical-height: 66px; --tabs-radius: 2px; --tabs-padding: 12px; --tabs-indicator-size: 2px; --tabs-indicator-background: var(--color-primary); --tabs-background: #fff;}.var-tabs { border-radius: var(--tabs-radius); background: var(--tabs-background); overflow: hidden; transition: background-color 0.25s;}.var-tabs__tab-wrap { position: relative; display: flex; height: 100%;}.var-tabs__indicator { position: absolute; z-index: 10; transition-property: width, transform; transition-duration: 0.3s;}.var-tabs--layout-horizontal { flex-direction: row;}.var-tabs--layout-horizontal-scrollable { overflow-x: auto; overflow-y: hidden;}.var-tabs--layout-horizontal-padding { padding: 0 var(--tabs-padding);}.var-tabs--layout-horizontal-indicator { left: 0; bottom: 0; height: var(--tabs-indicator-size); background: var(--tabs-indicator-background);}.var-tabs--layout-vertical { flex-direction: column;}.var-tabs--layout-vertical-scrollable { overflow-x: hidden; overflow-y: auto;}.var-tabs--layout-vertical-padding { padding: 0;}.var-tabs--layout-vertical-indicator { left: 0; top: 0; width: var(--tabs-indicator-size); background: var(--tabs-indicator-background);}.var-tabs--item-horizontal { height: var(--tabs-item-horizontal-height);}.var-tabs--item-vertical { height: var(--tabs-item-vertical-height);}.var-tabs--fixed-bottom { position: fixed; width: 100%; left: 0; bottom: 0; z-index: 99;}
1
+ :root { --tabs-item-horizontal-height: 44px; --tabs-item-vertical-height: 66px; --tabs-radius: 2px; --tabs-padding: 12px; --tabs-indicator-size: 2px; --tabs-indicator-background: var(--color-primary); --tabs-background: #fff;}.var-tabs { border-radius: var(--tabs-radius); background: var(--tabs-background); overflow: hidden; transition: background-color 0.25s;}.var-tabs__tab-wrap { position: relative; display: flex; height: 100%;}.var-tabs__indicator { position: absolute; z-index: 10; transition-property: width, transform; transition-duration: 0.3s;}.var-tabs--layout-horizontal { flex-direction: row;}.var-tabs--layout-horizontal-scrollable { overflow-x: auto; overflow-y: hidden;}.var-tabs--layout-horizontal-padding { padding: 0 var(--tabs-padding);}.var-tabs--layout-horizontal-indicator { left: 0; bottom: 0; height: var(--tabs-indicator-size); background: var(--tabs-indicator-background);}.var-tabs--layout-vertical { flex-direction: column;}.var-tabs--layout-vertical-scrollable { overflow-x: hidden; overflow-y: auto;}.var-tabs--layout-vertical-padding { padding: 0;}.var-tabs--layout-vertical-indicator { left: 0; top: 0; width: var(--tabs-indicator-size); background: var(--tabs-indicator-background);}.var-tabs--item-horizontal { height: var(--tabs-item-horizontal-height);}.var-tabs--item-vertical { height: var(--tabs-item-vertical-height);}.var-tabs--fixed-bottom { position: fixed; width: 100%; left: 0; bottom: 0; z-index: 99;}.var-tabs--safe-area { padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom); box-sizing: content-box !important;}
package/es/tabs/tabs.less CHANGED
@@ -90,4 +90,10 @@
90
90
  bottom: 0;
91
91
  z-index: 99;
92
92
  }
93
+
94
+ &--safe-area {
95
+ padding-bottom: constant(safe-area-inset-bottom); // iOS < 11.2
96
+ padding-bottom: env(safe-area-inset-bottom); // iOS >= 11.2
97
+ box-sizing: content-box !important;
98
+ }
93
99
  }
@@ -88,8 +88,8 @@ export function render(_ctx, _cache) {
88
88
  return _ctx.triggerAction && _ctx.triggerAction(...arguments);
89
89
  })
90
90
  }, [_createElementVNode("input", {
91
- class: _normalizeClass(_ctx.n('action-input')),
92
91
  ref: "input",
92
+ class: _normalizeClass(_ctx.n('action-input')),
93
93
  type: "file",
94
94
  multiple: _ctx.multiple,
95
95
  accept: _ctx.accept,
@@ -165,7 +165,7 @@ export default defineComponent({
165
165
  props,
166
166
 
167
167
  setup(props) {
168
- var input = ref();
168
+ var input = ref(null);
169
169
  var showPreview = ref(false);
170
170
  var currentPreview = ref(null);
171
171
  var maxlengthText = computed(() => {
@@ -433,8 +433,8 @@ export default defineComponent({
433
433
  isHTMLSupportImage,
434
434
  formDisabled: form == null ? void 0 : form.disabled,
435
435
  formReadonly: form == null ? void 0 : form.readonly,
436
- triggerAction,
437
436
  preview,
437
+ triggerAction,
438
438
  handleChange,
439
439
  handleRemove,
440
440
  getSuccess,
@@ -1 +1 @@
1
- :root { --uploader-action-background: #f7f8fa; --uploader-action-icon-color: #888; --uploader-action-icon-size: 24px; --uploader-action-margin: 0 10px 10px 0; --uploader-file-size: 80px; --uploader-file-margin: 0 10px 10px 0; --uploader-file-name-background: #f7f8fa; --uploader-file-name-color: #888; --uploader-file-name-font-size: 12px; --uploader-file-name-padding: 10px; --uploader-file-text-align: center; --uploader-file-close-background: rgba(0, 0, 0, 0.3); --uploader-file-close-size: 24px; --uploader-file-close-icon-font-size: 14px; --uploader-file-close-icon-color: #fff; --uploader-file-cover-fit: cover; --uploader-file-cover-background: #f7f8fa; --uploader-preview-video-width: 100vw; --uploader-preview-video-height: 100vw; --uploader-file-indicator-height: 4px; --uploader-file-indicator-normal-color: var(--color-disabled); --uploader-file-indicator-success-color: var(--color-success); --uploader-file-indicator-error-color: var(--color-danger); --uploader-disabled-color: var(--color-disabled); --uploader-disabled-text-color: var(--color-text-disabled); --uploader-loading-background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.3), hsla(0, 0%, 100%, 0));}@keyframes var-uploader-loading-animation { from { transform: translateX(-100%); } to { transform: translateX(100%); }}.var-uploader { width: 100%;}.var-uploader__file-list { width: 100%; display: flex; flex-wrap: wrap;}.var-uploader__file { position: relative; width: var(--uploader-file-size); height: var(--uploader-file-size); margin: var(--uploader-file-margin); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-uploader__file-name { position: absolute; width: 100%; height: 100%; line-height: calc(var(--uploader-file-size) - var(--uploader-file-name-padding) * 2); font-size: var(--uploader-file-name-font-size); z-index: 0; background: var(--uploader-file-name-background); padding: var(--uploader-file-name-padding); color: var(--uploader-file-name-color); text-align: var(--uploader-file-text-align); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; user-select: none; transition: background-color 0.25s;}.var-uploader__file-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: var(--uploader-file-cover-background); object-fit: var(--uploader-file-cover-fit); pointer-events: none; transition: background-color 0.25s;}.var-uploader__file-close { position: absolute; top: 0; right: 0; z-index: 2; border-top: var(--uploader-file-close-size) solid var(--uploader-file-close-background); border-left: var(--uploader-file-close-size) solid transparent;}.var-uploader__file-close-icon[var-uploader-cover] { position: absolute; top: calc(-1 * var(--uploader-file-close-size)); right: 0; font-size: var(--uploader-file-close-icon-font-size); color: var(--uploader-file-close-icon-color);}.var-uploader__file-indicator { position: absolute; left: 0; bottom: 0; z-index: 2; width: 100%; height: var(--uploader-file-indicator-height); transition: all 0.25s; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--uploader-file-indicator-normal-color);}.var-uploader__action { position: relative; display: flex; justify-content: center; align-items: center; color: var(--uploader-action-icon-color); width: var(--uploader-file-size); height: var(--uploader-file-size); background: var(--uploader-action-background); margin: var(--uploader-action-margin); transition: background-color 0.25s; cursor: pointer;}.var-uploader__action-icon[var-uploader-cover] { font-size: var(--uploader-action-icon-size);}.var-uploader__action-input { display: block; z-index: 1; width: 0; height: 0; opacity: 0;}.var-uploader__preview[var-uploader-cover] { background: #000; box-shadow: none;}.var-uploader__preview-video { width: var(--uploader-preview-video-width); height: var(--uploader-preview-video-height);}.var-uploader--loading::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; animation: var-uploader-loading-animation 0.6s infinite; background: var(--uploader-loading-background); transition: background-color 0.25s;}.var-uploader--success { background: var(--uploader-file-indicator-success-color);}.var-uploader--error { background: var(--uploader-file-indicator-error-color);}.var-uploader--disabled { background: var(--uploader-disabled-color); color: var(--uploader-disabled-text-color); cursor: not-allowed;}
1
+ :root { --uploader-action-background: #f7f8fa; --uploader-action-icon-color: #888; --uploader-action-icon-size: 24px; --uploader-action-margin: 0 10px 10px 0; --uploader-file-size: 80px; --uploader-file-margin: 0 10px 10px 0; --uploader-file-name-background: #f7f8fa; --uploader-file-name-color: #888; --uploader-file-name-font-size: 12px; --uploader-file-name-padding: 10px; --uploader-file-text-align: center; --uploader-file-close-background: rgba(0, 0, 0, 0.3); --uploader-file-close-size: 24px; --uploader-file-close-icon-font-size: 14px; --uploader-file-close-icon-color: #fff; --uploader-file-cover-fit: cover; --uploader-file-cover-background: #f7f8fa; --uploader-preview-video-width: 100vw; --uploader-preview-video-height: 100vw; --uploader-file-indicator-height: 4px; --uploader-file-indicator-normal-color: var(--color-disabled); --uploader-file-indicator-success-color: var(--color-success); --uploader-file-indicator-error-color: var(--color-danger); --uploader-disabled-color: var(--color-disabled); --uploader-disabled-text-color: var(--color-text-disabled); --uploader-loading-background: linear-gradient(90deg, hsla(0, 0%, 100%, 0), hsla(0, 0%, 100%, 0.3), hsla(0, 0%, 100%, 0));}@keyframes var-uploader-loading-animation { from { transform: translateX(-100%); } to { transform: translateX(100%); }}.var-uploader { width: 100%;}.var-uploader__file-list { width: 100%; display: flex; flex-wrap: wrap;}.var-uploader__file { position: relative; width: var(--uploader-file-size); height: var(--uploader-file-size); margin: var(--uploader-file-margin); overflow: hidden; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-uploader__file-name { position: absolute; width: 100%; height: 100%; line-height: calc(var(--uploader-file-size) - var(--uploader-file-name-padding) * 2); font-size: var(--uploader-file-name-font-size); z-index: 0; background: var(--uploader-file-name-background); padding: var(--uploader-file-name-padding); color: var(--uploader-file-name-color); text-align: var(--uploader-file-text-align); white-space: nowrap; text-overflow: ellipsis; overflow: hidden; user-select: none; transition: background-color 0.25s;}.var-uploader__file-cover { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; background: var(--uploader-file-cover-background); object-fit: var(--uploader-file-cover-fit); pointer-events: none; transition: background-color 0.25s;}.var-uploader__file-close { position: absolute; top: 0; right: 0; z-index: 2; border-top: var(--uploader-file-close-size) solid var(--uploader-file-close-background); border-left: var(--uploader-file-close-size) solid transparent;}.var-uploader__file-close-icon[var-uploader-cover] { position: absolute; top: calc(-1 * var(--uploader-file-close-size)); right: 0; font-size: var(--uploader-file-close-icon-font-size); color: var(--uploader-file-close-icon-color);}.var-uploader__file-indicator { position: absolute; left: 0; bottom: 0; z-index: 2; width: 100%; height: var(--uploader-file-indicator-height); transition: all 0.25s; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--uploader-file-indicator-normal-color);}.var-uploader__action { position: relative; display: flex; justify-content: center; align-items: center; color: var(--uploader-action-icon-color); width: var(--uploader-file-size); height: var(--uploader-file-size); background: var(--uploader-action-background); margin: var(--uploader-action-margin); transition: background-color 0.25s; cursor: pointer;}.var-uploader__action-icon[var-uploader-cover] { font-size: var(--uploader-action-icon-size);}.var-uploader__action-input { display: block; width: 0; height: 0; visibility: hidden;}.var-uploader__preview[var-uploader-cover] { background: #000; box-shadow: none;}.var-uploader__preview-video { width: var(--uploader-preview-video-width); height: var(--uploader-preview-video-height);}.var-uploader--loading::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 1; animation: var-uploader-loading-animation 0.6s infinite; background: var(--uploader-loading-background); transition: background-color 0.25s;}.var-uploader--success { background: var(--uploader-file-indicator-success-color);}.var-uploader--error { background: var(--uploader-file-indicator-error-color);}.var-uploader--disabled { background: var(--uploader-disabled-color); color: var(--uploader-disabled-text-color); cursor: not-allowed;}
@@ -170,10 +170,9 @@
170
170
 
171
171
  &__action-input {
172
172
  display: block;
173
- z-index: 1;
174
173
  width: 0;
175
174
  height: 0;
176
- opacity: 0;
175
+ visibility: hidden;
177
176
  }
178
177
 
179
178
  &__preview[var-uploader-cover] {
package/es/varlet.esm.js CHANGED
@@ -2158,6 +2158,10 @@ var props$M = {
2158
2158
  type: Boolean,
2159
2159
  default: false
2160
2160
  },
2161
+ safeArea: {
2162
+ type: Boolean,
2163
+ default: false
2164
+ },
2161
2165
  zIndex: {
2162
2166
  type: [Number, String],
2163
2167
  default: 1
@@ -2230,7 +2234,7 @@ var defaultFabProps = {
2230
2234
  function render$S(_ctx, _cache) {
2231
2235
  var _component_var_button = resolveComponent("var-button");
2232
2236
  return openBlock(), createElementBlock("div", {
2233
- class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.fixed, _ctx.n("--fixed")], [_ctx.border, _ctx.n("--border")])),
2237
+ class: normalizeClass(_ctx.classes(_ctx.n(), [_ctx.fixed, _ctx.n("--fixed")], [_ctx.border, _ctx.n("--border")], [_ctx.safeArea, _ctx.n("--safe-area")])),
2234
2238
  ref: "bottomNavigationDom",
2235
2239
  style: normalizeStyle("z-index:" + _ctx.zIndex)
2236
2240
  }, [renderSlot(_ctx.$slots, "default"), _ctx.$slots.fab ? (openBlock(), createBlock(_component_var_button, mergeProps({
@@ -13019,7 +13023,7 @@ var Rate = defineComponent({
13019
13023
  } = transformValue(val);
13020
13024
  return {
13021
13025
  [n$j("content")]: true,
13022
- [n$j("--disabled")]: form == null ? void 0 : form.disabled.value,
13026
+ [n$j("--disabled")]: (form == null ? void 0 : form.disabled.value) || props2.disabled,
13023
13027
  [n$j("--error")]: errorMessage.value,
13024
13028
  [n$j("--primary")]: type !== "empty" && !color
13025
13029
  };
@@ -15543,6 +15547,10 @@ var props$3 = {
15543
15547
  type: Boolean,
15544
15548
  default: false
15545
15549
  },
15550
+ safeArea: {
15551
+ type: Boolean,
15552
+ default: false
15553
+ },
15546
15554
  offsetTop: pickProps(props$s, "offsetTop"),
15547
15555
  onClick: {
15548
15556
  type: Function
@@ -15592,7 +15600,7 @@ function render$4(_ctx, _cache) {
15592
15600
  "offset-top": _ctx.sticky ? _ctx.offsetTop : null
15593
15601
  }, {
15594
15602
  default: withCtx(() => [createElementVNode("div", mergeProps({
15595
- class: _ctx.classes(_ctx.n(), "var--box", _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, "var-elevation--4"], [_ctx.fixedBottom, _ctx.n("--fixed-bottom")]),
15603
+ class: _ctx.classes(_ctx.n(), "var--box", _ctx.n("--item-" + _ctx.itemDirection), _ctx.n("--layout-" + _ctx.layoutDirection + "-padding"), [_ctx.elevation, "var-elevation--4"], [_ctx.fixedBottom, _ctx.n("--fixed-bottom")], [_ctx.safeArea, _ctx.n("--safe-area")]),
15596
15604
  style: {
15597
15605
  background: _ctx.color
15598
15606
  }
@@ -16832,8 +16840,8 @@ function render(_ctx, _cache) {
16832
16840
  return _ctx.triggerAction && _ctx.triggerAction(...arguments);
16833
16841
  })
16834
16842
  }, [createElementVNode("input", {
16835
- class: normalizeClass(_ctx.n("action-input")),
16836
16843
  ref: "input",
16844
+ class: normalizeClass(_ctx.n("action-input")),
16837
16845
  type: "file",
16838
16846
  multiple: _ctx.multiple,
16839
16847
  accept: _ctx.accept,
@@ -16889,7 +16897,7 @@ var Uploader = defineComponent({
16889
16897
  },
16890
16898
  props,
16891
16899
  setup(props2) {
16892
- var input2 = ref();
16900
+ var input2 = ref(null);
16893
16901
  var showPreview = ref(false);
16894
16902
  var currentPreview = ref(null);
16895
16903
  var maxlengthText = computed(() => {
@@ -17114,8 +17122,8 @@ var Uploader = defineComponent({
17114
17122
  isHTMLSupportImage,
17115
17123
  formDisabled: form == null ? void 0 : form.disabled,
17116
17124
  formReadonly: form == null ? void 0 : form.readonly,
17117
- triggerAction,
17118
17125
  preview,
17126
+ triggerAction,
17119
17127
  handleChange,
17120
17128
  handleRemove,
17121
17129
  getSuccess,
@@ -17218,9 +17226,9 @@ var skeleton = "";
17218
17226
  var SkeletonSfc = "";
17219
17227
  var slider = "";
17220
17228
  var SliderSfc = "";
17229
+ var SnackbarSfc = "";
17221
17230
  var snackbar = "";
17222
17231
  var coreSfc = "";
17223
- var SnackbarSfc = "";
17224
17232
  var space = "";
17225
17233
  var step = "";
17226
17234
  var StepSfc = "";
@@ -119,6 +119,10 @@
119
119
  "type": "boolean",
120
120
  "description": "是否显示外边框 默认值:false"
121
121
  },
122
+ "var-bottom-navigation/safe-area": {
123
+ "type": "boolean",
124
+ "description": "是否开启底部安全区适配 默认值:false"
125
+ },
122
126
  "var-bottom-navigation/z-index": {
123
127
  "type": "number | string",
124
128
  "description": "元素 z-index 默认值:1"
@@ -1265,7 +1269,7 @@
1265
1269
  },
1266
1270
  "var-rate/disabled-color": {
1267
1271
  "type": "string",
1268
- "description": "禁止评分时图标的颜色,只有在 `disabled` 为 `true` 时才有效,优先级高于 `color`、`empty-color` 默认值:-"
1272
+ "description": "禁止评分时图标的颜色,只有在 `disabled` 为 `true` 时才有效,优先级高于 `color`、`empty-color` 默认值:#aaa"
1269
1273
  },
1270
1274
  "var-rate/readonly": {
1271
1275
  "type": "boolean",
@@ -1699,6 +1703,10 @@
1699
1703
  "type": "boolean",
1700
1704
  "description": "是否启用粘性布局 默认值:false"
1701
1705
  },
1706
+ "var-tabs/safe-area": {
1707
+ "type": "boolean",
1708
+ "description": "是否开启底部安全区适配 默认值:false"
1709
+ },
1702
1710
  "var-tabs/offset-top": {
1703
1711
  "type": "string | number",
1704
1712
  "description": "吸顶距离 默认值:0"
@@ -47,6 +47,7 @@
47
47
  "v-model:active",
48
48
  "fixed",
49
49
  "border",
50
+ "safe-area",
50
51
  "z-index",
51
52
  "active-color",
52
53
  "inactive-color",
@@ -660,6 +661,7 @@
660
661
  "indicator-size",
661
662
  "elevation",
662
663
  "sticky",
664
+ "safe-area",
663
665
  "offset-top"
664
666
  ]
665
667
  },
@@ -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.0",
4
+ "version": "1.27.3",
5
5
  "name": "VARLET",
6
6
  "contributions": {
7
7
  "html": {
@@ -369,6 +369,15 @@
369
369
  "kind": "expression"
370
370
  }
371
371
  },
372
+ {
373
+ "name": "safe-area",
374
+ "description": "是否开启底部安全区适配",
375
+ "default": "false",
376
+ "value": {
377
+ "type": "boolean",
378
+ "kind": "expression"
379
+ }
380
+ },
372
381
  {
373
382
  "name": "z-index",
374
383
  "description": "元素 z-index",
@@ -3771,7 +3780,7 @@
3771
3780
  {
3772
3781
  "name": "disabled-color",
3773
3782
  "description": "禁止评分时图标的颜色,只有在 `disabled` 为 `true` 时才有效,优先级高于 `color`、`empty-color`",
3774
- "default": "-",
3783
+ "default": "#aaa",
3775
3784
  "value": {
3776
3785
  "type": "string",
3777
3786
  "kind": "expression"
@@ -5059,6 +5068,15 @@
5059
5068
  "kind": "expression"
5060
5069
  }
5061
5070
  },
5071
+ {
5072
+ "name": "safe-area",
5073
+ "description": "是否开启底部安全区适配",
5074
+ "default": "false",
5075
+ "value": {
5076
+ "type": "boolean",
5077
+ "kind": "expression"
5078
+ }
5079
+ },
5062
5080
  {
5063
5081
  "name": "offset-top",
5064
5082
  "description": "吸顶距离",
@@ -38,7 +38,7 @@ function render(_ctx, _cache) {
38
38
  var _component_var_button = (0, _vue.resolveComponent)("var-button");
39
39
 
40
40
  return (0, _vue.openBlock)(), (0, _vue.createElementBlock)("div", {
41
- class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.fixed, _ctx.n('--fixed')], [_ctx.border, _ctx.n('--border')])),
41
+ class: (0, _vue.normalizeClass)(_ctx.classes(_ctx.n(), [_ctx.fixed, _ctx.n('--fixed')], [_ctx.border, _ctx.n('--border')], [_ctx.safeArea, _ctx.n('--safe-area')])),
42
42
  ref: "bottomNavigationDom",
43
43
  style: (0, _vue.normalizeStyle)("z-index:" + _ctx.zIndex)
44
44
  }, [(0, _vue.renderSlot)(_ctx.$slots, "default"), _ctx.$slots.fab ? ((0, _vue.openBlock)(), (0, _vue.createBlock)(_component_var_button, (0, _vue.mergeProps)({
@@ -1 +1 @@
1
- :root { --bottom-navigation-height: 50px; --bottom-navigation-z-index: 1; --bottom-navigation-background-color: #fff; --bottom-navigation-border-color: #e3e3e3; --bottom-navigation-fab-offset: 4px;}.var-bottom-navigation { width: 100%; height: var(--bottom-navigation-height); display: flex; position: relative; background-color: var(--bottom-navigation-background-color); transition: background-color 250ms, border-color 250ms; -webkit-tap-highlight-color: transparent;}.var-bottom-navigation--fixed { position: fixed; left: 0; bottom: 0;}.var-bottom-navigation--border { border-top: 1px solid var(--bottom-navigation-border-color);}.var-bottom-navigation__fab[var-bottom-navigation__fab] { width: var(--bottom-navigation-height); height: var(--bottom-navigation-height); position: absolute; z-index: 2; transform: translateY(-50%); overflow: hidden; transition: right 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.var-bottom-navigation--fab-center { right: calc(50% - var(--bottom-navigation-height) / 2);}.var-bottom-navigation--fab-right { right: var(--bottom-navigation-fab-offset);}
1
+ :root { --bottom-navigation-height: 50px; --bottom-navigation-z-index: 1; --bottom-navigation-background-color: #fff; --bottom-navigation-border-color: #e3e3e3; --bottom-navigation-fab-offset: 4px;}.var-bottom-navigation { width: 100%; height: var(--bottom-navigation-height); display: flex; position: relative; background-color: var(--bottom-navigation-background-color); transition: background-color 250ms, border-color 250ms; -webkit-tap-highlight-color: transparent;}.var-bottom-navigation--safe-area { padding-bottom: constant(safe-area-inset-bottom); padding-bottom: env(safe-area-inset-bottom);}.var-bottom-navigation--fixed { position: fixed; left: 0; bottom: 0;}.var-bottom-navigation--border { border-top: 1px solid var(--bottom-navigation-border-color);}.var-bottom-navigation__fab[var-bottom-navigation__fab] { width: var(--bottom-navigation-height); height: var(--bottom-navigation-height); position: absolute; z-index: 2; transform: translateY(-50%); overflow: hidden; transition: right 250ms cubic-bezier(0.4, 0, 0.2, 1) 0ms;}.var-bottom-navigation--fab-center { right: calc(50% - var(--bottom-navigation-height) / 2);}.var-bottom-navigation--fab-right { right: var(--bottom-navigation-fab-offset);}
@@ -21,6 +21,11 @@
21
21
  transition: background-color 250ms, border-color 250ms;
22
22
  -webkit-tap-highlight-color: transparent;
23
23
 
24
+ &--safe-area {
25
+ padding-bottom: constant(safe-area-inset-bottom); // iOS < 11.2
26
+ padding-bottom: env(safe-area-inset-bottom); // iOS >= 11.2
27
+ }
28
+
24
29
  &--fixed {
25
30
  position: fixed;
26
31
  left: 0;
@@ -15,6 +15,10 @@ var props = {
15
15
  type: Boolean,
16
16
  default: false
17
17
  },
18
+ safeArea: {
19
+ type: Boolean,
20
+ default: false
21
+ },
18
22
  zIndex: {
19
23
  type: [Number, String],
20
24
  default: 1
package/lib/rate/Rate.js CHANGED
@@ -122,7 +122,7 @@ var _default = (0, _vue.defineComponent)({
122
122
  } = transformValue(val);
123
123
  return {
124
124
  [n('content')]: true,
125
- [n('--disabled')]: form == null ? void 0 : form.disabled.value,
125
+ [n('--disabled')]: (form == null ? void 0 : form.disabled.value) || props.disabled,
126
126
  [n('--error')]: errorMessage.value,
127
127
  [n('--primary')]: type !== 'empty' && !color
128
128
  };
package/lib/rate/rate.css CHANGED
@@ -1 +1 @@
1
- :root { --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__content { padding: var(--rate-action-padding); box-sizing: unset; cursor: pointer; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate--disabled { color: var(--rate-disabled-color) !important;}.var-rate--error { color: var(--rate-error-color) !important;}.var-rate--primary { color: var(--rate-primary-color);}
1
+ :root { --rate-disabled-color: var(--color-text-disabled); --rate-error-color: var(--color-danger); --rate-action-padding: 4px; --rate-primary-color: var(--color-primary);}.var-rate { display: flex; transform: translateX(calc(-1 * var(--rate-action-padding)));}.var-rate__content { padding: var(--rate-action-padding); box-sizing: unset; cursor: pointer; display: flex; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);}.var-rate--primary { color: var(--rate-primary-color);}.var-rate--disabled { color: var(--rate-disabled-color); cursor: not-allowed;}.var-rate--error { color: var(--rate-error-color);}
@@ -18,18 +18,20 @@
18
18
  padding: var(--rate-action-padding);
19
19
  box-sizing: unset;
20
20
  cursor: pointer;
21
+ display: flex;
21
22
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
22
23
  }
23
24
 
24
- &--disabled {
25
- color: var(--rate-disabled-color) !important;
25
+ &--primary {
26
+ color: var(--rate-primary-color);
26
27
  }
27
28
 
28
- &--error {
29
- color: var(--rate-error-color) !important;
29
+ &--disabled {
30
+ color: var(--rate-disabled-color);
31
+ cursor: not-allowed;
30
32
  }
31
33
 
32
- &--primary {
33
- color: var(--rate-primary-color);
34
+ &--error {
35
+ color: var(--rate-error-color);
34
36
  }
35
37
  }