zartui 2.0.63 → 2.0.65

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.
@@ -4,8 +4,7 @@ import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
4
4
  import { createNamespace } from '../utils';
5
5
  import { emit, inherit } from '../utils/functional';
6
6
  import { BORDER_SURROUND } from '../utils/constant';
7
- import { routeProps, functionalRoute } from '../utils/router';
8
- import { Telemetry, TelemetryEvent } from "../telemetry"; // Components
7
+ import { routeProps, functionalRoute } from '../utils/router'; // Components
9
8
 
10
9
  import Icon from '../icon';
11
10
  import Loading from '../loading'; // Types
@@ -63,8 +62,6 @@ function Button(h, props, slots, ctx) {
63
62
  if (!loading && !disabled) {
64
63
  emit(ctx, 'click', event);
65
64
  functionalRoute(ctx);
66
- var trackEvent = new TelemetryEvent('button', {});
67
- Telemetry.sharedInstance.trackClick(trackEvent);
68
65
  }
69
66
  }
70
67
 
@@ -1 +1 @@
1
- .zt2-cascader__header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:44px;padding:0 16px}.zt2-cascader__title{font-weight:700;font-size:14px;line-height:44px;color:rgba(45,75,115,.4)}.zt2-cascader__tabs .zt2-tab{-webkit-box-flex:0;-webkit-flex:none;flex:none;margin:0 8px;padding:0}.zt2-cascader__tabs .zt2-tabs__wrap{position:relative;height:44px}.zt2-cascader__tabs .zt2-tabs__wrap::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt2-cascader__tabs .zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-cascader__tab{color:#2d4b73;font-weight:700;font-size:14px;line-height:44px}.zt2-cascader__tab--unselected{color:rgba(45,75,115,.4);font-weight:400}.zt2-cascader__option{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-family:PingFangSC-Regular;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;color:#2d4b73;padding:0 16px;font-weight:400;font-size:14px;line-height:44px}.zt2-cascader__option:active{background-color:rgba(0,0,0,.04)}.zt2-cascader__option--selected{color:#0091fa;font-weight:700}.zt2-cascader__selected-icon{font-size:24px}.zt2-cascader__options{box-sizing:border-box;height:352px;overflow-y:auto;-webkit-overflow-scrolling:touch}.zt2-cascader .zt2-tabs__nav{background:#fff}.zt2-cascader .zt2-cascader__cancel{margin:8px 16px;width:calc(100% - 32px);background:rgba(45,75,115,.04);border-radius:20.5px}
1
+ .zt2-cascader__header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:44px;padding:0 16px}.zt2-cascader__title{font-weight:700;font-size:14px;line-height:44px;color:rgba(45,75,115,.4)}.zt2-cascader__tabs .zt2-tab{-webkit-box-flex:0;-webkit-flex:none;flex:none;margin:0 8px;padding:0}.zt2-cascader__tabs .zt2-tabs__wrap{position:relative;height:44px}.zt2-cascader__tabs .zt2-tabs__wrap::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt2-cascader__tabs .zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-cascader__tab{color:#2d4b73;font-weight:700;font-size:14px;line-height:44px}.zt2-cascader__tab--unselected{color:rgba(45,75,115,.4);font-weight:400}.zt2-cascader__option{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-family:PingFangSC-Regular;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;color:#2d4b73;padding:12px 16px;font-weight:400;font-size:14px;line-height:20px}.zt2-cascader__option:active{background-color:rgba(0,0,0,.04)}.zt2-cascader__option--selected{color:#0091fa;font-weight:700}.zt2-cascader__selected-icon{font-size:24px}.zt2-cascader__options{box-sizing:border-box;height:352px;overflow-y:auto;-webkit-overflow-scrolling:touch}.zt2-cascader .zt2-tabs__nav{background:#fff}.zt2-cascader .zt2-cascader__cancel{margin:8px 16px;width:calc(100% - 32px);background:rgba(45,75,115,.04);border-radius:20.5px}
@@ -57,10 +57,10 @@
57
57
  font-family: PingFangSC-Regular;
58
58
  justify-content: space-between;
59
59
  color: #2D4B73;
60
- padding: 0 @padding-md;
60
+ padding: @padding-sm @padding-md;
61
61
  font-weight: normal;
62
62
  font-size: @font-size-md;
63
- line-height: 44px;
63
+ line-height: @line-height-md;
64
64
 
65
65
  &:active {
66
66
  background-color: @active-color;
package/es/index.js CHANGED
@@ -74,7 +74,7 @@ import Tag from './tag';
74
74
  import Timeline from './timeline';
75
75
  import Toast from './toast';
76
76
  import Uploader from './uploader';
77
- var version = '2.0.63';
77
+ var version = '2.0.65';
78
78
 
79
79
  function install(Vue) {
80
80
  var components = [ActionSheet, Area, Avatar, BackTop, Badge, Button, Calendar, Cascader, Cell, CellGroup, Checkbox, CheckboxGroup, Col, Collapse, CollapseItem, CountDown, DatetimePicker, Dialog, Divider, DropdownItem, DropdownMenu, Empty, Field, FoldDialog, Form, Grid, GridItem, HierarchySelect, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MediaPicker, MediaPlayer, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, Picker, Popover, Popup, PullRefresh, Radio, RadioGroup, Rate, Row, Search, Signature, Skeleton, Slider, Step, Stepper, Steps, Sticky, Swipe, SwipeCell, SwipeItem, Switch, SwitchCell, Tab, Tabbar, TabbarItem, Table, Tabs, Tag, Timeline, Toast, Uploader];
package/es/style/var.less CHANGED
@@ -951,6 +951,7 @@
951
951
  @tabs-default-color: #0091FA;
952
952
  @tabs-line-height: 44px;
953
953
  @tabs-card-height: 32px;
954
+ @tabs-card-margin: 60px;
954
955
  @tabs-nav-background-color: @white;
955
956
  @tabs-bottom-bar-width: 12px;
956
957
  @tabs-bottom-bar-height: 4px;
package/es/tabs/Title.js CHANGED
@@ -50,6 +50,15 @@ export default createComponent({
50
50
 
51
51
  if (!this.scrollable) {
52
52
  style.maxWidth = this.maxWidth;
53
+ } else {
54
+ // tab之间的padding距离
55
+ var OPTIONS_LABEL_PADDING = 24; // 限制最大展示7个字
56
+
57
+ var LIMIT_WORDS_LEN = 7; // 根据实际是否激活状态,设置其字体宽度
58
+
59
+ var FONT_SIZE = isActive ? 16 : 14;
60
+ var scrollAbleWidth = OPTIONS_LABEL_PADDING + LIMIT_WORDS_LEN * FONT_SIZE + 'px';
61
+ style.maxWidth = scrollAbleWidth;
53
62
  }
54
63
 
55
64
  return style;
@@ -63,7 +72,7 @@ export default createComponent({
63
72
  var h = this.$createElement;
64
73
  var Text = h("span", {
65
74
  "class": bem('text', {
66
- ellipsis: !this.scrollable
75
+ ellipsis: true
67
76
  })
68
77
  }, [this.slots() || this.title]);
69
78
 
@@ -92,10 +101,11 @@ export default createComponent({
92
101
  active: this.isActive,
93
102
  disabled: this.disabled
94
103
  })],
95
- "style": this.style,
96
104
  "on": {
97
105
  "click": this.onClick
98
106
  }
99
- }, [this.genText()]);
107
+ }, [this.slots('prefix'), h("div", {
108
+ "style": this.style
109
+ }, [this.genText()]), this.slots('suffix')]);
100
110
  }
101
111
  });
package/es/tabs/index.css CHANGED
@@ -1 +1 @@
1
- .zt2-tab{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0 16px;color:rgba(45,75,115,.6);font-size:14px;line-height:20px;cursor:pointer}.zt2-tab--active{color:#2d4b73;font-weight:700;font-size:16px}.zt2-tab--disabled{color:#c8c9cc;cursor:not-allowed}.zt2-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.zt2-tab__text-wrapper{position:relative}.zt2-tabs{position:relative}.zt2-tabs__wrap{overflow:hidden}.zt2-tabs__wrap--page-top{position:fixed}.zt2-tabs__wrap--content-bottom{top:auto;bottom:0}.zt2-tabs__wrap--scrollable .zt2-tab{-webkit-box-flex:1;-webkit-flex:1 0 auto;flex:1 0 auto;padding:0 12px}.zt2-tabs__wrap--scrollable .zt2-tabs__nav{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.zt2-tabs__wrap--scrollable .zt2-tabs__nav::-webkit-scrollbar{display:none}.zt2-tabs__nav{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;background-color:#f5faff;-webkit-user-select:none;user-select:none}.zt2-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:15px}.zt2-tabs__nav--line.zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-tabs__nav--card{-webkit-box-flex:1;-webkit-flex:1;flex:1;margin:0 60px;-webkit-justify-content:space-around;justify-content:space-around;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;height:32px;background:rgba(45,75,115,.04);box-shadow:inset 4px 4px 8px 0 rgba(45,75,115,.1);border-radius:16px}.zt2-tabs__nav--card .zt2-tab{color:#000}.zt2-tabs__nav--card .zt2-tab.zt2-tab--active{height:24px;color:#fff;font-size:14px;background-image:-webkit-linear-gradient(top,#3cafff 0,#0091fa 100%);background-image:linear-gradient(180deg,#3cafff 0,#0091fa 100%);box-shadow:0 2px 4px 0 rgba(0,145,250,.24);border-radius:14px}.zt2-tabs__nav--card .zt2-tab--disabled{color:#c8c9cc}.zt2-tabs__line{position:absolute;bottom:15px;left:0;z-index:1;width:12px;height:4px;background-color:#0091fa;border-radius:2px}.zt2-tabs__track{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;width:100%;height:100%;will-change:left}.zt2-tabs__content--animated{overflow:hidden}.zt2-tabs--line .zt2-tabs__wrap{height:44px}.zt2-tabs--card>.zt2-tabs__wrap{height:32px}
1
+ .zt2-tab{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;box-sizing:border-box;padding:0 16px;color:rgba(45,75,115,.6);font-size:14px;line-height:20px;cursor:pointer}.zt2-tab--active{color:#2d4b73;font-weight:700;font-size:16px}.zt2-tab--disabled{color:#c8c9cc;cursor:not-allowed}.zt2-tab__text{word-break:break-all}.zt2-tab__text--ellipsis{display:-webkit-box;overflow:hidden;-webkit-line-clamp:1;-webkit-box-orient:vertical}.zt2-tab__text-wrapper{position:relative}.zt2-tabs{position:relative}.zt2-tabs__wrap{overflow:hidden}.zt2-tabs__wrap--page-top{position:fixed}.zt2-tabs__wrap--content-bottom{top:auto;bottom:0}.zt2-tabs__wrap--scrollable .zt2-tab{-webkit-box-flex:1;-webkit-flex:1 0 auto;flex:1 0 auto;padding:0 12px}.zt2-tabs__wrap--scrollable .zt2-tabs__nav{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch}.zt2-tabs__wrap--scrollable .zt2-tabs__nav::-webkit-scrollbar{display:none}.zt2-tabs__nav{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;background-color:#f5faff;-webkit-user-select:none;user-select:none}.zt2-tabs__nav--line{box-sizing:content-box;height:100%;padding-bottom:15px}.zt2-tabs__nav--line.zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-tabs__nav--card{max-width:calc(100vw - 60px * 2);-webkit-box-pack:start;-webkit-justify-content:flex-start;justify-content:flex-start;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;height:32px;background:rgba(45,75,115,.04);box-shadow:inset 4px 4px 8px 0 rgba(45,75,115,.1);border-radius:16px}.zt2-tabs__nav--card .zt2-tab{color:#000}.zt2-tabs__nav--card .zt2-tab.zt2-tab--active{height:24px;color:#fff;font-size:14px;background-image:-webkit-linear-gradient(top,#3cafff 0,#0091fa 100%);background-image:linear-gradient(180deg,#3cafff 0,#0091fa 100%);box-shadow:0 2px 4px 0 rgba(0,145,250,.24);border-radius:14px}.zt2-tabs__nav--card .zt2-tab--disabled{color:#c8c9cc}.zt2-tabs__line{position:absolute;bottom:15px;left:0;z-index:1;width:12px;height:4px;background-color:#0091fa;border-radius:2px}.zt2-tabs__track{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;width:100%;height:100%;will-change:left}.zt2-tabs__content--animated{overflow:hidden}.zt2-tabs--line .zt2-tabs__wrap{height:44px}.zt2-tabs--card>.zt2-tabs__wrap{height:32px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center}
package/es/tabs/index.js CHANGED
@@ -79,7 +79,7 @@ export default createComponent({
79
79
  },
80
80
  swipeThreshold: {
81
81
  type: [Number, String],
82
- default: 5
82
+ default: 3
83
83
  },
84
84
  divider: {
85
85
  type: Boolean,
@@ -382,6 +382,12 @@ export default createComponent({
382
382
  "scopedSlots": {
383
383
  default: function _default() {
384
384
  return item.slots('title');
385
+ },
386
+ prefix: function prefix() {
387
+ return item.slots('prefix');
388
+ },
389
+ suffix: function suffix() {
390
+ return item.slots('suffix');
385
391
  }
386
392
  },
387
393
  "on": {
@@ -25,6 +25,8 @@
25
25
  }
26
26
 
27
27
  &__text {
28
+ // 处理title尾部全为字母数字换行导致省略后title显示怪异问题
29
+ word-break: break-all;
28
30
  &--ellipsis {
29
31
  display: -webkit-box;
30
32
  overflow: hidden;
@@ -90,9 +92,8 @@
90
92
  }
91
93
 
92
94
  &--card {
93
- flex: 1;
94
- margin: 0 60px;
95
- justify-content: space-around;
95
+ max-width: calc(100vw - @tabs-card-margin * 2);
96
+ justify-content: flex-start;
96
97
  align-items: center;
97
98
  box-sizing: border-box;
98
99
  height: @tabs-card-height;
@@ -154,6 +155,8 @@
154
155
  &--card {
155
156
  > .@{base-prefix}-tabs__wrap {
156
157
  height: @tabs-card-height;
158
+ display: flex;
159
+ justify-content: center;
157
160
  }
158
161
  }
159
162
  }
@@ -5,9 +5,7 @@ import '../../locale';
5
5
  import { isFunction } from '..';
6
6
  import { camelize } from '../format/string';
7
7
  import { SlotsMixin } from '../../mixins/slots';
8
- import { TelemetryMixin } from "../../mixins/telemetry";
9
8
  import Vue from 'vue';
10
- import { Telemetry, TelemetryEvent } from "../../telemetry";
11
9
 
12
10
  function install(Vue) {
13
11
  var name = this.name;
@@ -36,8 +34,6 @@ function transformFunctionComponent(pure, name) {
36
34
  props: pure.props,
37
35
  model: pure.model,
38
36
  render: function render(h, context) {
39
- var event = new TelemetryEvent(name);
40
- Telemetry.sharedInstance.trackAppear(event);
41
37
  return pure(h, context.props, unifySlots(context), context);
42
38
  }
43
39
  };
@@ -52,7 +48,6 @@ export function createComponent(name) {
52
48
  if (!sfc.functional) {
53
49
  sfc.mixins = sfc.mixins || [];
54
50
  sfc.mixins.push(SlotsMixin);
55
- sfc.mixins.push(TelemetryMixin);
56
51
  }
57
52
 
58
53
  sfc.name = name;
@@ -17,8 +17,6 @@ var _constant = require("../utils/constant");
17
17
 
18
18
  var _router = require("../utils/router");
19
19
 
20
- var _telemetry = require("../telemetry");
21
-
22
20
  var _icon = _interopRequireDefault(require("../icon"));
23
21
 
24
22
  var _loading = _interopRequireDefault(require("../loading"));
@@ -78,9 +76,6 @@ function Button(h, props, slots, ctx) {
78
76
  if (!loading && !disabled) {
79
77
  (0, _functional.emit)(ctx, 'click', event);
80
78
  (0, _router.functionalRoute)(ctx);
81
- var trackEvent = new _telemetry.TelemetryEvent('button', {});
82
-
83
- _telemetry.Telemetry.sharedInstance.trackClick(trackEvent);
84
79
  }
85
80
  }
86
81
 
@@ -1 +1 @@
1
- .zt2-cascader__header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:44px;padding:0 16px}.zt2-cascader__title{font-weight:700;font-size:14px;line-height:44px;color:rgba(45,75,115,.4)}.zt2-cascader__tabs .zt2-tab{-webkit-box-flex:0;-webkit-flex:none;flex:none;margin:0 8px;padding:0}.zt2-cascader__tabs .zt2-tabs__wrap{position:relative;height:44px}.zt2-cascader__tabs .zt2-tabs__wrap::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt2-cascader__tabs .zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-cascader__tab{color:#2d4b73;font-weight:700;font-size:14px;line-height:44px}.zt2-cascader__tab--unselected{color:rgba(45,75,115,.4);font-weight:400}.zt2-cascader__option{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-family:PingFangSC-Regular;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;color:#2d4b73;padding:0 16px;font-weight:400;font-size:14px;line-height:44px}.zt2-cascader__option:active{background-color:rgba(0,0,0,.04)}.zt2-cascader__option--selected{color:#0091fa;font-weight:700}.zt2-cascader__selected-icon{font-size:24px}.zt2-cascader__options{box-sizing:border-box;height:352px;overflow-y:auto;-webkit-overflow-scrolling:touch}.zt2-cascader .zt2-tabs__nav{background:#fff}.zt2-cascader .zt2-cascader__cancel{margin:8px 16px;width:calc(100% - 32px);background:rgba(45,75,115,.04);border-radius:20.5px}
1
+ .zt2-cascader__header{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;height:44px;padding:0 16px}.zt2-cascader__title{font-weight:700;font-size:14px;line-height:44px;color:rgba(45,75,115,.4)}.zt2-cascader__tabs .zt2-tab{-webkit-box-flex:0;-webkit-flex:none;flex:none;margin:0 8px;padding:0}.zt2-cascader__tabs .zt2-tabs__wrap{position:relative;height:44px}.zt2-cascader__tabs .zt2-tabs__wrap::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;right:0;bottom:0;left:0;border-bottom:1px solid rgba(0,0,0,.1);-webkit-transform:scaleY(.5);transform:scaleY(.5)}.zt2-cascader__tabs .zt2-tabs__nav--complete{padding-right:8px;padding-left:8px}.zt2-cascader__tab{color:#2d4b73;font-weight:700;font-size:14px;line-height:44px}.zt2-cascader__tab--unselected{color:rgba(45,75,115,.4);font-weight:400}.zt2-cascader__option{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-family:PingFangSC-Regular;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;color:#2d4b73;padding:12px 16px;font-weight:400;font-size:14px;line-height:20px}.zt2-cascader__option:active{background-color:rgba(0,0,0,.04)}.zt2-cascader__option--selected{color:#0091fa;font-weight:700}.zt2-cascader__selected-icon{font-size:24px}.zt2-cascader__options{box-sizing:border-box;height:352px;overflow-y:auto;-webkit-overflow-scrolling:touch}.zt2-cascader .zt2-tabs__nav{background:#fff}.zt2-cascader .zt2-cascader__cancel{margin:8px 16px;width:calc(100% - 32px);background:rgba(45,75,115,.04);border-radius:20.5px}
@@ -57,10 +57,10 @@
57
57
  font-family: PingFangSC-Regular;
58
58
  justify-content: space-between;
59
59
  color: #2D4B73;
60
- padding: 0 @padding-md;
60
+ padding: @padding-sm @padding-md;
61
61
  font-weight: normal;
62
62
  font-size: @font-size-md;
63
- line-height: 44px;
63
+ line-height: @line-height-md;
64
64
 
65
65
  &:active {
66
66
  background-color: @active-color;