zartui 2.0.31 → 2.0.33

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 (49) hide show
  1. package/es/collapse-item/index.css +1 -1
  2. package/es/collapse-item/index.js +68 -31
  3. package/es/collapse-item/index.less +60 -24
  4. package/es/collapse-item/style/index.js +1 -0
  5. package/es/collapse-item/style/less.js +1 -0
  6. package/es/datetime-picker/DatePicker.js +48 -2
  7. package/es/field/index.js +6 -0
  8. package/es/index.js +3 -5
  9. package/es/popup/index.js +18 -9
  10. package/es/style/var.less +6 -5
  11. package/es/utils/format/date-util.js +2 -0
  12. package/lib/collapse-item/index.css +1 -1
  13. package/lib/collapse-item/index.js +71 -30
  14. package/lib/collapse-item/index.less +60 -24
  15. package/lib/collapse-item/style/index.js +1 -0
  16. package/lib/collapse-item/style/less.js +1 -0
  17. package/lib/datetime-picker/DatePicker.js +49 -2
  18. package/lib/field/index.js +6 -0
  19. package/lib/index.css +1 -1
  20. package/lib/index.js +2 -10
  21. package/lib/index.less +1 -3
  22. package/lib/popup/index.js +19 -9
  23. package/lib/style/var.less +6 -5
  24. package/lib/utils/format/date-util.js +2 -0
  25. package/lib/zart.js +24113 -47535
  26. package/lib/zart.min.js +1 -18
  27. package/package.json +1 -3
  28. package/es/pdf-viewer/index.css +0 -1
  29. package/es/pdf-viewer/index.js +0 -444
  30. package/es/pdf-viewer/index.less +0 -69
  31. package/es/pdf-viewer/style/index.js +0 -10
  32. package/es/pdf-viewer/style/less.js +0 -10
  33. package/es/pdf-viewer-v2/index.css +0 -1
  34. package/es/pdf-viewer-v2/index.js +0 -333
  35. package/es/pdf-viewer-v2/index.less +0 -44
  36. package/es/pdf-viewer-v2/style/index.js +0 -10
  37. package/es/pdf-viewer-v2/style/less.js +0 -10
  38. package/lib/7893e51cf0a4877dac80.worker.js +0 -10
  39. package/lib/be09b519a460e229fd8d.worker.js +0 -2527
  40. package/lib/pdf-viewer/index.css +0 -1
  41. package/lib/pdf-viewer/index.js +0 -459
  42. package/lib/pdf-viewer/index.less +0 -69
  43. package/lib/pdf-viewer/style/index.js +0 -10
  44. package/lib/pdf-viewer/style/less.js +0 -10
  45. package/lib/pdf-viewer-v2/index.css +0 -1
  46. package/lib/pdf-viewer-v2/index.js +0 -345
  47. package/lib/pdf-viewer-v2/index.less +0 -44
  48. package/lib/pdf-viewer-v2/style/index.js +0 -10
  49. package/lib/pdf-viewer-v2/style/less.js +0 -10
@@ -1 +1 @@
1
- .zt-collapse-item{position:relative}.zt-collapse-item__title{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;background-color:transparent;padding:10px 16px}.zt-collapse-item__title .zt-cell{padding-left:12px}.zt-collapse-item__bar{position:absolute;left:0;width:4px;height:16px;background:#0091fa}.zt-collapse-item__bar--custom{background:#fff}.zt-collapse-item__icon{font-size:24px;color:rgba(0,0,0,.2);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.zt-collapse-item__icon--expanded{color:#0091fa;-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.zt-collapse-item__icon--custom{color:#fff}.zt-collapse-item__text{-webkit-box-flex:1;-webkit-flex:1;flex:1;font-weight:700;font-size:16px;color:#2d4b73;line-height:20px}.zt-collapse-item__text--custom{color:#fff}.zt-collapse-item__text--disabled{cursor:not-allowed}.zt-collapse-item__wrapper{overflow:hidden;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out;will-change:height}.zt-collapse-item__content{color:#2d4b73;font-size:14px;line-height:20px;background-color:transparent}
1
+ .zt-collapse-item{position:relative}.zt-collapse-item__container{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;background-color:transparent}.zt-collapse-item__container .zt-cell{padding:10px 16px;background-color:transparent}.zt-collapse-item__bar{position:absolute;left:0;width:4px;height:16px;background:#0091fa}.zt-collapse-item__title--iconWhite .zt-icon::before{color:#fff!important}.zt-collapse-item__title--titleWhite .zt-cell__title .zt-cell__title-content{color:#fff}.zt-collapse-item__title--titleWhite .zt-cell__value{color:#fff}.zt-collapse-item__title .zt-cell__title{line-height:24px;font-weight:700;font-size:16px;color:#2d4b73}.zt-collapse-item__title .zt-collapse-item__right-icon::before{font-size:24px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;color:rgba(0,0,0,.2)}.zt-collapse-item__title::after{right:16px;display:none}.zt-collapse-item__title--expanded .zt-collapse-item__right-icon::before{-webkit-transform:rotate(-180deg);transform:rotate(-180deg);color:#0091fa}.zt-collapse-item__title--expanded::after{display:block}.zt-collapse-item__title--borderless::after{display:none}.zt-collapse-item__title--disabled{cursor:not-allowed}.zt-collapse-item__title--disabled,.zt-collapse-item__title--disabled .zt-cell__right-icon{color:#c8c9cc}.zt-collapse-item__title--disabled:active{background-color:#fff}.zt-collapse-item__wrapper{overflow:hidden;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out;will-change:height}.zt-collapse-item__content{color:#2d4b73;font-size:14px;line-height:20px;background-color:transparent}
@@ -1,26 +1,33 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
1
2
  // Utils
2
3
  import { createNamespace } from '../utils';
3
4
  import { raf, doubleRaf } from '../utils/dom/raf'; // Mixins
4
5
 
5
6
  import { ChildrenMixin } from '../mixins/relation'; // Components
6
7
 
7
- import Icon from '../icon';
8
+ import Cell from '../cell';
9
+ import { cellProps } from '../cell/shared';
10
+ import Icon from "../icon";
8
11
 
9
12
  var _createNamespace = createNamespace('collapse-item'),
10
13
  createComponent = _createNamespace[0],
11
14
  bem = _createNamespace[1];
12
15
 
16
+ var CELL_SLOTS = ['title', 'icon', 'right-icon'];
13
17
  export default createComponent({
14
18
  mixins: [ChildrenMixin('ztCollapse')],
15
- props: {
19
+ props: _extends({}, cellProps, {
16
20
  name: [Number, String],
17
- title: [Number, String],
21
+ disabled: Boolean,
22
+ isLink: {
23
+ type: Boolean,
24
+ default: true
25
+ },
18
26
  titleBG: {
19
27
  type: String,
20
28
  default: ""
21
- },
22
- color: String
23
- },
29
+ }
30
+ }),
24
31
  data: function data() {
25
32
  return {
26
33
  show: null,
@@ -100,7 +107,9 @@ export default createComponent({
100
107
  },
101
108
  methods: {
102
109
  onClick: function onClick() {
103
- this.toggle();
110
+ if (!this.disabled) {
111
+ this.toggle();
112
+ }
104
113
  },
105
114
  // @exposed-api
106
115
  toggle: function toggle(expanded) {
@@ -122,35 +131,63 @@ export default createComponent({
122
131
  }
123
132
  },
124
133
  genTitle: function genTitle() {
134
+ var _this3 = this;
135
+
125
136
  var h = this.$createElement;
126
- var expanded = this.expanded,
127
- titleBG = this.titleBG,
128
- color = this.color;
129
- return h("div", {
130
- "class": [bem("title"), expanded ? " half-border-bottom" : ""],
131
- "style": titleBG ? "background:" + titleBG + ";color:#fff;" : "",
132
- "on": {
133
- "click": this.onClick
137
+ var border = this.border,
138
+ disabled = this.disabled,
139
+ expanded = this.expanded,
140
+ titleBG = this.titleBG;
141
+ var titleSlots = CELL_SLOTS.reduce(function (slots, name) {
142
+ slots['right-icon'] = function () {
143
+ return h(Icon, {
144
+ "class": bem('right-icon'),
145
+ "attrs": {
146
+ "name": 'keyboard-arrow-up'
147
+ }
148
+ });
149
+ };
150
+
151
+ if (_this3.slots(name)) {
152
+ slots[name] = function () {
153
+ return _this3.slots(name);
154
+ };
134
155
  }
135
- }, [h("span", {
136
- "class": bem("bar", {
137
- custom: titleBG
138
- }),
139
- "style": color ? "background:" + color + ";" : ''
140
- }), h("span", {
141
- "class": bem("text", {
142
- custom: titleBG
143
- }),
144
- "style": color ? "color:" + color + ";" : ''
145
- }, [this.title]), h(Icon, {
156
+
157
+ return slots;
158
+ }, {});
159
+
160
+ if (this.slots('value')) {
161
+ titleSlots.default = function () {
162
+ return _this3.slots('value');
163
+ };
164
+ }
165
+
166
+ return h("div", {
167
+ "class": bem("container") + " half-border-bottom",
168
+ "style": titleBG ? "background:" + titleBG + ";color:#fff;" : ""
169
+ }, [h("div", {
170
+ "class": bem("bar"),
171
+ "style": titleBG ? 'background-color:#fff;' : ''
172
+ }), h(Cell, {
146
173
  "attrs": {
147
- "name": "keyboard-arrow-up"
174
+ "role": "button",
175
+ "tabindex": disabled ? -1 : 0,
176
+ "aria-expanded": String(expanded)
148
177
  },
149
- "style": color ? "color:" + color + ";" : '',
150
- "class": bem('icon', {
178
+ "class": bem('title', {
179
+ disabled: disabled,
151
180
  expanded: expanded,
152
- custom: titleBG
153
- })
181
+ borderless: !border,
182
+ iconWhite: titleBG,
183
+ titleWhite: titleBG
184
+ }),
185
+ "on": {
186
+ "click": this.onClick
187
+ },
188
+ "scopedSlots": titleSlots,
189
+ "style": titleBG ? "background:" + titleBG + ";color:#fff;" : "",
190
+ "props": _extends({}, this.$props)
154
191
  })]);
155
192
  },
156
193
  genContent: function genContent() {
@@ -4,13 +4,13 @@
4
4
  .zt-collapse-item {
5
5
  position: relative;
6
6
 
7
- &__title {
7
+ &__container {
8
8
  display: flex;
9
9
  align-items: center;
10
10
  background-color: @collapse-item-content-background-color;
11
- padding: @collapse-item-title-padding;
12
11
  .zt-cell {
13
- padding-left: @collapse-item-title-cell-padding;
12
+ padding: @collapse-item-content-padding;
13
+ background-color: @collapse-item-content-background-color;
14
14
  }
15
15
  }
16
16
  &__bar {
@@ -19,38 +19,74 @@
19
19
  width: @collapse-item-bar-width;
20
20
  height: @collapse-item-bar-height;
21
21
  background: @blue;
22
- &--custom {
23
- background: @white;
24
- }
25
22
  }
26
- &__icon {
27
- font-size: @collapse-item-icon-font-size;
28
- color: @gray-a2;
29
- transition: transform 0.3s;
30
23
 
31
- &--expanded {
32
- color: @blue;
33
- transform: rotate(-180deg);
24
+ &__title {
25
+ &--iconWhite {
26
+ .zt-icon::before {
27
+ color: @white !important;
28
+ }
34
29
  }
35
30
 
36
- &--custom {
37
- color: @white;
31
+ &--titleWhite {
32
+ .zt-cell__title {
33
+ .zt-cell__title-content {
34
+ color: @white;
35
+ }
36
+ }
37
+
38
+ .zt-cell__value {
39
+ color: @white;
40
+ }
38
41
  }
39
- }
40
42
 
41
- &__text {
42
- flex: 1;
43
- font-weight: @font-weight-bold;
44
- font-size: @collapse-item-title-font-size;
45
- color: @collapse-item-content-text-color;
46
- line-height: @collapse-item-content-line-height;
43
+ .zt-cell__title {
44
+ line-height: @collapse-item-title-line-height;
45
+ font-weight: bold;
46
+ font-size: @collapse-item-title-font-size;
47
+ color: @collapse-item-content-text-color;
48
+ }
49
+ .zt-collapse-item__right-icon::before {
50
+ // using translateZ to fix safari rendering issues
51
+ // see: https://github.com/youzan/vant/issues/8608
52
+ font-size: @collapse-item-icon-size;
53
+ transition: transform @collapse-item-transition-duration;
54
+ color: @gray-a2;
55
+ }
56
+
57
+ &::after {
58
+ right: @padding-md;
59
+ display: none;
60
+ }
61
+
62
+ &--expanded {
63
+ .zt-collapse-item__right-icon::before {
64
+ transform: rotate(-180deg);
65
+ color: @blue;
66
+ }
47
67
 
48
- &--custom {
49
- color: @white;
68
+ &::after {
69
+ display: block;
70
+ }
71
+ }
72
+
73
+ &--borderless {
74
+ &::after {
75
+ display: none;
76
+ }
50
77
  }
51
78
 
52
79
  &--disabled {
53
80
  cursor: not-allowed;
81
+
82
+ &,
83
+ & .zt-cell__right-icon {
84
+ color: @collapse-item-title-disabled-color;
85
+ }
86
+
87
+ &:active {
88
+ background-color: @white;
89
+ }
54
90
  }
55
91
  }
56
92
 
@@ -1,4 +1,5 @@
1
1
  import '../../style/base.css';
2
2
  import '../../info/index.css';
3
3
  import '../../icon/index.css';
4
+ import '../../cell/index.css';
4
5
  import '../index.css';
@@ -1,4 +1,5 @@
1
1
  import '../../style/base.less';
2
2
  import '../../info/index.less';
3
3
  import '../../icon/index.less';
4
+ import '../../cell/index.less';
4
5
  import '../index.less';
@@ -5,6 +5,7 @@ import { isDate } from '../utils/validate/date';
5
5
  import { padZero } from '../utils/format/string';
6
6
  import { getTrueValue, getMonthEndDay } from './utils';
7
7
  import { sharedProps, TimePickerMixin } from './shared';
8
+ import { formatDateByDate, FORMAT } from '../utils/format/date-util';
8
9
  var currentYear = new Date().getFullYear();
9
10
 
10
11
  var _createNamespace = createNamespace('date-picker'),
@@ -313,9 +314,54 @@ export default createComponent({
313
314
  updateColumnValue: function updateColumnValue() {
314
315
  var _this5 = this;
315
316
 
316
- var defaultValue = new Date();
317
+ // 根据type将默认时间和最大最小时间转换后再比较
318
+ // 如果调用者传入new Date(),与此处new Date()会有时间差,目前只支持到分钟,可以忽略时间差
319
+ var now = new Date();
320
+ var dStr = "";
321
+ var minStr = "";
322
+ var maxStr = "";
317
323
 
318
- if (defaultValue.getTime() < this.minDate.getTime() || defaultValue.getTime() > this.maxDate.getTime()) {
324
+ switch (this.type) {
325
+ case "date":
326
+ dStr = formatDateByDate(now, FORMAT.FORMAT_YMD);
327
+ minStr = formatDateByDate(this.minDate, FORMAT.FORMAT_YMD);
328
+ maxStr = formatDateByDate(this.maxDate, FORMAT.FORMAT_YMD);
329
+ break;
330
+
331
+ case "year-month":
332
+ dStr = formatDateByDate(now, FORMAT.FORMAT_YM);
333
+ minStr = formatDateByDate(this.minDate, FORMAT.FORMAT_YM);
334
+ maxStr = formatDateByDate(this.maxDate, FORMAT.FORMAT_YM);
335
+ break;
336
+
337
+ case "month-day":
338
+ dStr = formatDateByDate(now, FORMAT.FORMAT_MD);
339
+ minStr = formatDateByDate(this.minDate, FORMAT.FORMAT_MD);
340
+ maxStr = formatDateByDate(this.maxDate, FORMAT.FORMAT_MD);
341
+ break;
342
+
343
+ case "datetime":
344
+ dStr = formatDateByDate(now, FORMAT.FORMAT_YMDHM);
345
+ minStr = formatDateByDate(this.minDate, FORMAT.FORMAT_YMDHM);
346
+ maxStr = formatDateByDate(this.maxDate, FORMAT.FORMAT_YMDHM);
347
+ break;
348
+
349
+ case "datehour":
350
+ // "2022/11/11 14"这种格式无法使用new Date
351
+ dStr = formatDateByDate(now, FORMAT.FORMAT_YMDH) + ":00:00";
352
+ minStr = formatDateByDate(this.minDate, FORMAT.FORMAT_YMDH) + ":00:00";
353
+ maxStr = formatDateByDate(this.maxDate, FORMAT.FORMAT_YMDH) + ":00:00";
354
+ break;
355
+
356
+ default:
357
+ break;
358
+ }
359
+
360
+ var defaultValue = new Date(dStr.replace(/-/g, "/"));
361
+ var minDate = new Date(minStr.replace(/-/g, "/"));
362
+ var maxDate = new Date(maxStr.replace(/-/g, "/"));
363
+
364
+ if (defaultValue < minDate || defaultValue > maxDate) {
319
365
  defaultValue = this.minDate;
320
366
  }
321
367
 
package/es/field/index.js CHANGED
@@ -100,6 +100,12 @@ export default createComponent({
100
100
  this.resetValidation();
101
101
  this.validateWithTrigger('onChange');
102
102
  this.$nextTick(this.adjustSize);
103
+ },
104
+ autosize: {
105
+ deep: true,
106
+ handler: function handler() {
107
+ this.$nextTick(this.adjustSize);
108
+ }
103
109
  }
104
110
  },
105
111
  mounted: function mounted() {
package/es/index.js CHANGED
@@ -44,8 +44,6 @@ import NoticeBar from './notice-bar';
44
44
  import NumberKeyboard from './number-keyboard';
45
45
  import Overlay from './overlay';
46
46
  import PasswordInput from './password-input';
47
- import PdfViewer from './pdf-viewer';
48
- import PdfViewerV2 from './pdf-viewer-v2';
49
47
  import Picker from './picker';
50
48
  import Popover from './popover';
51
49
  import Popup from './popup';
@@ -76,10 +74,10 @@ import Tag from './tag';
76
74
  import Timeline from './timeline';
77
75
  import Toast from './toast';
78
76
  import Uploader from './uploader';
79
- var version = '2.0.31';
77
+ var version = '2.0.33';
80
78
 
81
79
  function install(Vue) {
82
- 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, PdfViewer, PdfViewerV2, 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];
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];
83
81
  components.forEach(function (item) {
84
82
  if (item.install) {
85
83
  Vue.use(item);
@@ -93,7 +91,7 @@ if (typeof window !== 'undefined' && window.Vue) {
93
91
  install(window.Vue);
94
92
  }
95
93
 
96
- export { install, version, 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, PdfViewer, PdfViewerV2, 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 };
94
+ export { install, version, 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 };
97
95
  export default {
98
96
  install: install,
99
97
  version: version
package/es/popup/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { createNamespace, isDef } from '../utils';
2
2
  import { PopupMixin } from '../mixins/popup';
3
3
  import Icon from '../icon';
4
+ import { unitToPx } from "../utils/format/unit";
4
5
 
5
6
  var _createNamespace = createNamespace('popup'),
6
7
  createComponent = _createNamespace[0],
@@ -42,6 +43,15 @@ export default createComponent({
42
43
  type: Number,
43
44
  default: 60
44
45
  },
46
+ // 控制滑动区域的高度,滑动的最小高
47
+ minDragHeight: {
48
+ type: String,
49
+ default: '40px'
50
+ },
51
+ maxDragHeight: {
52
+ type: String,
53
+ default: '85vh'
54
+ },
45
55
  sliderShow: {
46
56
  type: Boolean,
47
57
  default: false
@@ -69,13 +79,10 @@ export default createComponent({
69
79
  },
70
80
  data: function data() {
71
81
  return {
72
- positionY: 0,
73
82
  timerId: null,
74
83
  contentStyle: "height:" + this.sliderContentHeight + "px;",
75
84
  touchHeight: 0,
76
- touchPoint: 0,
77
- // 控制滑动区域的高度
78
- touchAreaHeight: 40
85
+ touchPoint: 0
79
86
  };
80
87
  },
81
88
  methods: {
@@ -98,14 +105,15 @@ export default createComponent({
98
105
  }
99
106
 
100
107
  var h = window.innerHeight || document.documentElement.clientHeight || document.body.clientHeight;
101
- this.positionY = event.touches[0].clientY;
108
+ var touchAreaHeight = unitToPx(this.minDragHeight);
109
+ var positionY = event.touches[0].clientY;
102
110
  this.timerId = setTimeout(function () {
103
- if (_this2.positionY === 0 || _this2.positionY < h * 0.15) {
111
+ if (positionY === 0 || positionY < h - unitToPx(_this2.maxDragHeight)) {
104
112
  return;
105
113
  }
106
114
 
107
- _this2.touchHeight = _this2.positionY - _this2.touchAreaHeight > h - _this2.touchAreaHeight ? h - _this2.touchAreaHeight + _this2.touchPoint : _this2.positionY;
108
- _this2.contentStyle = "height:" + (h - _this2.touchHeight - _this2.touchAreaHeight + _this2.touchPoint) + "px;";
115
+ _this2.touchHeight = positionY - touchAreaHeight > h - touchAreaHeight ? h - touchAreaHeight + _this2.touchPoint : positionY;
116
+ _this2.contentStyle = "height:" + (h - _this2.touchHeight - touchAreaHeight + _this2.touchPoint) + "px;";
109
117
  }, 10);
110
118
  },
111
119
  endMove: function endMove() {
@@ -154,7 +162,8 @@ export default createComponent({
154
162
  "touchmove": this.move,
155
163
  "touchend": this.endMove,
156
164
  "touchstart": this.startMove
157
- }
165
+ },
166
+ "style": "height:" + this.minDragHeight
158
167
  }, [h("div", {
159
168
  "class": bem('slider-bar')
160
169
  })]), h("div", {
package/es/style/var.less CHANGED
@@ -325,16 +325,17 @@
325
325
 
326
326
  // Collapse
327
327
  @collapse-item-transition-duration: @animation-duration-base;
328
- @collapse-item-title-padding: 10px 16px;
329
- @collapse-item-title-cell-padding: @padding-sm;
330
- @collapse-item-bar-width: 4px;
331
- @collapse-item-bar-height: 16px;
332
- @collapse-item-icon-font-size: 24px;
328
+ @collapse-item-content-padding: 10px @padding-md;
333
329
  @collapse-item-title-font-size: @font-size-lg;
330
+ @collapse-item-title-line-height: 24px;
331
+ @collapse-item-icon-size: 24px;
334
332
  @collapse-item-content-font-size: @font-size-md;
335
333
  @collapse-item-content-line-height: @line-height-md;
336
334
  @collapse-item-content-text-color: #2D4B73;
337
335
  @collapse-item-content-background-color: transparent;
336
+ @collapse-item-title-disabled-color: @gray-5;
337
+ @collapse-item-bar-height: 16px;
338
+ @collapse-item-bar-width: 4px;
338
339
 
339
340
  // ContactCard
340
341
  @contact-card-padding: @padding-md;
@@ -21,6 +21,8 @@ export var FORMAT = {
21
21
  FORMAT_YMD_SLASH: "yyyy/MM/dd",
22
22
  //英文简写(默认)如:2010-12
23
23
  FORMAT_YM: "yyyy-MM",
24
+ //英文全称 如:2010-12-01 23
25
+ FORMAT_YMDH: "yyyy-MM-dd HH",
24
26
  //英文全称 如:2010-12-01 23:15
25
27
  FORMAT_YMDHM: "yyyy-MM-dd HH:mm",
26
28
  //英文全称 如:2010-12-01 23:15:06
@@ -1 +1 @@
1
- .zt-collapse-item{position:relative}.zt-collapse-item__title{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;background-color:transparent;padding:10px 16px}.zt-collapse-item__title .zt-cell{padding-left:12px}.zt-collapse-item__bar{position:absolute;left:0;width:4px;height:16px;background:#0091fa}.zt-collapse-item__bar--custom{background:#fff}.zt-collapse-item__icon{font-size:24px;color:rgba(0,0,0,.2);-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s}.zt-collapse-item__icon--expanded{color:#0091fa;-webkit-transform:rotate(-180deg);transform:rotate(-180deg)}.zt-collapse-item__icon--custom{color:#fff}.zt-collapse-item__text{-webkit-box-flex:1;-webkit-flex:1;flex:1;font-weight:700;font-size:16px;color:#2d4b73;line-height:20px}.zt-collapse-item__text--custom{color:#fff}.zt-collapse-item__text--disabled{cursor:not-allowed}.zt-collapse-item__wrapper{overflow:hidden;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out;will-change:height}.zt-collapse-item__content{color:#2d4b73;font-size:14px;line-height:20px;background-color:transparent}
1
+ .zt-collapse-item{position:relative}.zt-collapse-item__container{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;background-color:transparent}.zt-collapse-item__container .zt-cell{padding:10px 16px;background-color:transparent}.zt-collapse-item__bar{position:absolute;left:0;width:4px;height:16px;background:#0091fa}.zt-collapse-item__title--iconWhite .zt-icon::before{color:#fff!important}.zt-collapse-item__title--titleWhite .zt-cell__title .zt-cell__title-content{color:#fff}.zt-collapse-item__title--titleWhite .zt-cell__value{color:#fff}.zt-collapse-item__title .zt-cell__title{line-height:24px;font-weight:700;font-size:16px;color:#2d4b73}.zt-collapse-item__title .zt-collapse-item__right-icon::before{font-size:24px;-webkit-transition:-webkit-transform .3s;transition:-webkit-transform .3s;transition:transform .3s;transition:transform .3s,-webkit-transform .3s;color:rgba(0,0,0,.2)}.zt-collapse-item__title::after{right:16px;display:none}.zt-collapse-item__title--expanded .zt-collapse-item__right-icon::before{-webkit-transform:rotate(-180deg);transform:rotate(-180deg);color:#0091fa}.zt-collapse-item__title--expanded::after{display:block}.zt-collapse-item__title--borderless::after{display:none}.zt-collapse-item__title--disabled{cursor:not-allowed}.zt-collapse-item__title--disabled,.zt-collapse-item__title--disabled .zt-cell__right-icon{color:#c8c9cc}.zt-collapse-item__title--disabled:active{background-color:#fff}.zt-collapse-item__wrapper{overflow:hidden;-webkit-transition:height .3s ease-in-out;transition:height .3s ease-in-out;will-change:height}.zt-collapse-item__content{color:#2d4b73;font-size:14px;line-height:20px;background-color:transparent}
@@ -5,12 +5,18 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
5
5
  exports.__esModule = true;
6
6
  exports.default = void 0;
7
7
 
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
+
8
10
  var _utils = require("../utils");
9
11
 
10
12
  var _raf = require("../utils/dom/raf");
11
13
 
12
14
  var _relation = require("../mixins/relation");
13
15
 
16
+ var _cell = _interopRequireDefault(require("../cell"));
17
+
18
+ var _shared = require("../cell/shared");
19
+
14
20
  var _icon = _interopRequireDefault(require("../icon"));
15
21
 
16
22
  // Utils
@@ -20,17 +26,22 @@ var _createNamespace = (0, _utils.createNamespace)('collapse-item'),
20
26
  createComponent = _createNamespace[0],
21
27
  bem = _createNamespace[1];
22
28
 
29
+ var CELL_SLOTS = ['title', 'icon', 'right-icon'];
30
+
23
31
  var _default = createComponent({
24
32
  mixins: [(0, _relation.ChildrenMixin)('ztCollapse')],
25
- props: {
33
+ props: (0, _extends2.default)({}, _shared.cellProps, {
26
34
  name: [Number, String],
27
- title: [Number, String],
35
+ disabled: Boolean,
36
+ isLink: {
37
+ type: Boolean,
38
+ default: true
39
+ },
28
40
  titleBG: {
29
41
  type: String,
30
42
  default: ""
31
- },
32
- color: String
33
- },
43
+ }
44
+ }),
34
45
  data: function data() {
35
46
  return {
36
47
  show: null,
@@ -110,7 +121,9 @@ var _default = createComponent({
110
121
  },
111
122
  methods: {
112
123
  onClick: function onClick() {
113
- this.toggle();
124
+ if (!this.disabled) {
125
+ this.toggle();
126
+ }
114
127
  },
115
128
  // @exposed-api
116
129
  toggle: function toggle(expanded) {
@@ -132,35 +145,63 @@ var _default = createComponent({
132
145
  }
133
146
  },
134
147
  genTitle: function genTitle() {
148
+ var _this3 = this;
149
+
135
150
  var h = this.$createElement;
136
- var expanded = this.expanded,
137
- titleBG = this.titleBG,
138
- color = this.color;
139
- return h("div", {
140
- "class": [bem("title"), expanded ? " half-border-bottom" : ""],
141
- "style": titleBG ? "background:" + titleBG + ";color:#fff;" : "",
142
- "on": {
143
- "click": this.onClick
151
+ var border = this.border,
152
+ disabled = this.disabled,
153
+ expanded = this.expanded,
154
+ titleBG = this.titleBG;
155
+ var titleSlots = CELL_SLOTS.reduce(function (slots, name) {
156
+ slots['right-icon'] = function () {
157
+ return h(_icon.default, {
158
+ "class": bem('right-icon'),
159
+ "attrs": {
160
+ "name": 'keyboard-arrow-up'
161
+ }
162
+ });
163
+ };
164
+
165
+ if (_this3.slots(name)) {
166
+ slots[name] = function () {
167
+ return _this3.slots(name);
168
+ };
144
169
  }
145
- }, [h("span", {
146
- "class": bem("bar", {
147
- custom: titleBG
148
- }),
149
- "style": color ? "background:" + color + ";" : ''
150
- }), h("span", {
151
- "class": bem("text", {
152
- custom: titleBG
153
- }),
154
- "style": color ? "color:" + color + ";" : ''
155
- }, [this.title]), h(_icon.default, {
170
+
171
+ return slots;
172
+ }, {});
173
+
174
+ if (this.slots('value')) {
175
+ titleSlots.default = function () {
176
+ return _this3.slots('value');
177
+ };
178
+ }
179
+
180
+ return h("div", {
181
+ "class": bem("container") + " half-border-bottom",
182
+ "style": titleBG ? "background:" + titleBG + ";color:#fff;" : ""
183
+ }, [h("div", {
184
+ "class": bem("bar"),
185
+ "style": titleBG ? 'background-color:#fff;' : ''
186
+ }), h(_cell.default, {
156
187
  "attrs": {
157
- "name": "keyboard-arrow-up"
188
+ "role": "button",
189
+ "tabindex": disabled ? -1 : 0,
190
+ "aria-expanded": String(expanded)
158
191
  },
159
- "style": color ? "color:" + color + ";" : '',
160
- "class": bem('icon', {
192
+ "class": bem('title', {
193
+ disabled: disabled,
161
194
  expanded: expanded,
162
- custom: titleBG
163
- })
195
+ borderless: !border,
196
+ iconWhite: titleBG,
197
+ titleWhite: titleBG
198
+ }),
199
+ "on": {
200
+ "click": this.onClick
201
+ },
202
+ "scopedSlots": titleSlots,
203
+ "style": titleBG ? "background:" + titleBG + ";color:#fff;" : "",
204
+ "props": (0, _extends2.default)({}, this.$props)
164
205
  })]);
165
206
  },
166
207
  genContent: function genContent() {