zartui 2.0.77 → 2.0.79-beta.1

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.
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.76';
77
+ var version = '2.0.79-beta.1';
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];
@@ -1,7 +1,7 @@
1
1
  // Utils
2
2
  import { createNamespace } from '../utils';
3
3
  import { preventDefault } from '../utils/dom/event';
4
- import { getScrollTop, getScroller } from '../utils/dom/scroll'; // Mixins
4
+ import { getScrollTop, getScroller, getTargetDom } from '../utils/dom/scroll'; // Mixins
5
5
 
6
6
  import { TouchMixin } from '../mixins/touch'; // Components
7
7
 
@@ -21,21 +21,25 @@ export default createComponent({
21
21
  successText: String,
22
22
  pullingText: {
23
23
  type: String,
24
- default: "下拉即可刷新..."
24
+ default: '下拉即可刷新...'
25
25
  },
26
26
  loosingText: {
27
27
  type: String,
28
- default: "释放即可刷新..."
28
+ default: '释放即可刷新...'
29
29
  },
30
30
  loadingText: {
31
31
  type: String,
32
- default: "加载中..."
32
+ default: '加载中...'
33
33
  },
34
34
  pullDistance: [Number, String],
35
35
  value: {
36
36
  type: Boolean,
37
37
  required: true
38
38
  },
39
+ scrollElement: {
40
+ type: [String, Function, HTMLElement],
41
+ required: false
42
+ },
39
43
  successDuration: {
40
44
  type: [Number, String],
41
45
  default: 500
@@ -66,6 +70,17 @@ export default createComponent({
66
70
  height: this.headHeight + "px"
67
71
  };
68
72
  }
73
+ },
74
+ scrollEl: function scrollEl() {
75
+ if (this.scrollElement) {
76
+ if (this.scrollElement) {
77
+ return getTargetDom(this.scrollElement);
78
+ }
79
+
80
+ return this.scrollElement();
81
+ }
82
+
83
+ return getScroller(this.$el);
69
84
  }
70
85
  },
71
86
  watch: {
@@ -83,7 +98,6 @@ export default createComponent({
83
98
  },
84
99
  mounted: function mounted() {
85
100
  this.bindTouchEvent(this.$refs.track);
86
- this.scrollEl = getScroller(this.$el);
87
101
  },
88
102
  methods: {
89
103
  checkPullStart: function checkPullStart(event) {
@@ -1 +1 @@
1
- .zt2-search{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:8px 16px;min-height:54px;background-color:#f5faff}.zt2-search__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;background-color:rgba(45,75,115,.04);border:1px solid transparent;border-radius:2px;box-shadow:inset 4px 4px 8px 0 rgba(45,75,115,.1);background-clip:padding-box;position:relative}.zt2-search__content::before{content:'';position:absolute;top:0;right:0;left:0;bottom:0;z-index:-1;margin:-1px;border-radius:inherit;background:-webkit-linear-gradient(#fff,rgba(255,255,255,.4));background:linear-gradient(#fff,rgba(255,255,255,.4))}.zt2-search__content--round{border-radius:999px}.zt2-search__label{padding:8px 0 8px 12px;color:rgba(0,0,0,.6);font-weight:400;font-size:14px;line-height:20px}.zt2-search .zt2-field__root{background-color:transparent;padding:0}.zt2-search .zt2-field__label{margin-right:0}.zt2-search .zt2-cell__title.zt2-field__label{-webkit-box-flex:unset;-webkit-flex:unset;flex:unset}.zt2-search .zt2-cell{-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 12px;background:0 0;line-height:20px;font-size:14px;font-weight:400}.zt2-search .zt2-cell__left-icon{color:#969799}.zt2-search .zt2-field{margin:0}.zt2-search .zt2-field__control{color:#2d4b73}.zt2-search--show-action{padding-right:0}.zt2-search input{caret-color:#0091fa}.zt2-search input::-webkit-search-cancel-button,.zt2-search input::-webkit-search-decoration,.zt2-search input::-webkit-search-results-button,.zt2-search input::-webkit-search-results-decoration{display:none}.zt2-search input::-webkit-input-placeholder{color:rgba(45,75,115,.2)}.zt2-search input::placeholder{color:rgba(45,75,115,.2)}.zt2-search__action{padding:0 16px 0 12px;color:#0091fa;font-size:14px;height:28px;cursor:pointer;-webkit-user-select:none;user-select:none;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}
1
+ .zt2-search{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;box-sizing:border-box;padding:8px 16px;min-height:54px;background-color:#f5faff}.zt2-search__content{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-flex:1;-webkit-flex:1;flex:1;background-color:rgba(45,75,115,.04);border:1px solid transparent;border-radius:2px;box-shadow:inset 4px 4px 8px 0 rgba(45,75,115,.1);background-clip:padding-box;position:relative}.zt2-search__content::before{content:'';position:absolute;top:0;right:0;left:0;bottom:0;z-index:-1;margin:-1px;border-radius:inherit;background:-webkit-linear-gradient(#fff,rgba(255,255,255,.4));background:linear-gradient(#fff,rgba(255,255,255,.4))}.zt2-search__content--round{border-radius:999px}.zt2-search__label{padding:8px 0 8px 12px;color:rgba(0,0,0,.6);font-weight:400;font-size:14px;line-height:20px}.zt2-search .zt2-field__root{background-color:transparent;padding:0}.zt2-search .zt2-field__root .zt2-cell{-webkit-box-flex:1;-webkit-flex:1;flex:1;padding:8px 12px;background:0 0;line-height:20px;font-size:14px;font-weight:400}.zt2-search .zt2-field__root .zt2-cell__left-icon{color:#969799}.zt2-search .zt2-field__label{margin-right:0}.zt2-search .zt2-cell__title.zt2-field__label{-webkit-box-flex:unset;-webkit-flex:unset;flex:unset}.zt2-search .zt2-field{margin:0}.zt2-search .zt2-field__control{color:#2d4b73}.zt2-search--show-action{padding-right:0}.zt2-search input{caret-color:#0091fa}.zt2-search input::-webkit-search-cancel-button,.zt2-search input::-webkit-search-decoration,.zt2-search input::-webkit-search-results-button,.zt2-search input::-webkit-search-results-decoration{display:none}.zt2-search input::-webkit-input-placeholder{color:rgba(45,75,115,.2)}.zt2-search input::placeholder{color:rgba(45,75,115,.2)}.zt2-search__action{padding:0 16px 0 12px;color:#0091fa;font-size:14px;height:28px;cursor:pointer;-webkit-user-select:none;user-select:none;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-pack:center;-webkit-justify-content:center;justify-content:center;-webkit-box-align:center;-webkit-align-items:center;align-items:center}
@@ -47,6 +47,18 @@
47
47
  .@{base-prefix}-field__root {
48
48
  background-color: transparent;
49
49
  padding: 0;
50
+
51
+ .@{base-prefix}-cell {
52
+ flex: 1;
53
+ padding: @search-cell-padding;
54
+ background: transparent;
55
+ line-height: @search-input-height;
56
+ font-size: @font-size-md;
57
+ font-weight: 400;
58
+ &__left-icon {
59
+ color: @search-left-icon-color;
60
+ }
61
+ }
50
62
  }
51
63
 
52
64
  .@{base-prefix}-field__label {
@@ -57,18 +69,6 @@
57
69
  flex: unset;
58
70
  }
59
71
 
60
- .@{base-prefix}-cell {
61
- flex: 1;
62
- padding: @search-cell-padding;
63
- background: transparent;
64
- line-height: @search-input-height;
65
- font-size: @font-size-md;
66
- font-weight: 400;
67
- &__left-icon {
68
- color: @search-left-icon-color;
69
- }
70
- }
71
-
72
72
  .@{base-prefix}-field {
73
73
  margin: 0
74
74
  }
@@ -66,4 +66,21 @@ export function getVisibleTop(el) {
66
66
  }
67
67
 
68
68
  return el.getBoundingClientRect().top;
69
- }
69
+ }
70
+ export var getTargetDom = function getTargetDom(target) {
71
+ if (target) {
72
+ if (typeof target === 'string') {
73
+ return document.querySelectorAll(target)[0];
74
+ }
75
+
76
+ if (typeof target === 'function') {
77
+ return target();
78
+ }
79
+
80
+ if (typeof target === 'object' && target instanceof window.HTMLElement) {
81
+ return target;
82
+ }
83
+ }
84
+
85
+ return document.body;
86
+ };