zartui 0.1.57 → 0.1.60

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.
@@ -1 +1 @@
1
- .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 16px}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-right:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background-color:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}
1
+ .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 0}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-left:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background-color:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}
@@ -15,7 +15,7 @@ export default createComponent({
15
15
  checked: {
16
16
  get: function get() {
17
17
  if (this.parent) {
18
- return this.parent.value.indexOf(this.name) !== -1;
18
+ return this.parent.value && this.parent.value.indexOf(this.name) !== -1;
19
19
  }
20
20
 
21
21
  return this.value;
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  &--horizontal {
20
- margin-right: @padding-sm;
20
+ margin-left: @padding-sm;
21
21
  }
22
22
 
23
23
  &__icon {
package/es/index.js CHANGED
@@ -33,6 +33,7 @@ import Lazyload from './lazyload';
33
33
  import List from './list';
34
34
  import Loading from './loading';
35
35
  import Locale from './locale';
36
+ import MultiplePicker from './multiple-picker';
36
37
  import NavBar from './nav-bar';
37
38
  import NoticeBar from './notice-bar';
38
39
  import NumberKeyboard from './number-keyboard';
@@ -68,10 +69,10 @@ import Tabs from './tabs';
68
69
  import Tag from './tag';
69
70
  import Toast from './toast';
70
71
  import Uploader from './uploader';
71
- var version = '0.1.57';
72
+ var version = '0.1.60';
72
73
 
73
74
  function install(Vue) {
74
- 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, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, 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, Toast, Uploader];
75
+ 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, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, 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, Toast, Uploader];
75
76
  components.forEach(function (item) {
76
77
  if (item.install) {
77
78
  Vue.use(item);
@@ -85,7 +86,7 @@ if (typeof window !== 'undefined' && window.Vue) {
85
86
  install(window.Vue);
86
87
  }
87
88
 
88
- 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, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, 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, Toast, Uploader };
89
+ 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, Icon, Image, ImagePreview, IndexAnchor, IndexBar, Info, Lazyload, List, Loading, Locale, MultiplePicker, NavBar, NoticeBar, NumberKeyboard, Overlay, PasswordInput, PdfViewer, 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, Toast, Uploader };
89
90
  export default {
90
91
  install: install,
91
92
  version: version
@@ -0,0 +1,158 @@
1
+ import _mergeJSXProps2 from "@vue/babel-helper-vue-jsx-merge-props";
2
+ import _mergeJSXProps from "@vue/babel-helper-vue-jsx-merge-props";
3
+ import { deepClone } from '../utils/deep-clone';
4
+ import { createNamespace, isObject } from '../utils';
5
+
6
+ var _createNamespace = createNamespace('multiple-picker-options'),
7
+ createComponent = _createNamespace[0],
8
+ bem = _createNamespace[1];
9
+
10
+ function isOptionDisabled(option) {
11
+ return isObject(option) && option.disabled;
12
+ }
13
+
14
+ export default createComponent({
15
+ props: {
16
+ valueKey: String,
17
+ readonly: Boolean,
18
+ allowHtml: Boolean,
19
+ itemHeight: Number,
20
+ defaultIndexs: {
21
+ type: Array,
22
+ default: function _default() {
23
+ return [];
24
+ }
25
+ },
26
+ columnCounts: Number,
27
+ initialOptions: {
28
+ type: Array,
29
+ default: function _default() {
30
+ return [];
31
+ }
32
+ }
33
+ },
34
+ data: function data() {
35
+ return {
36
+ options: deepClone(this.initialOptions),
37
+ currentIndexs: []
38
+ };
39
+ },
40
+ watch: {
41
+ initialOptions: 'setOptions',
42
+ defaultIndexs: {
43
+ deep: true,
44
+ handler: function handler() {
45
+ this.setDefaultIndexs();
46
+ }
47
+ }
48
+ },
49
+ computed: {
50
+ count: function count() {
51
+ return this.options.length;
52
+ }
53
+ },
54
+ mounted: function mounted() {
55
+ this.setDefaultIndexs();
56
+ },
57
+ methods: {
58
+ setOptions: function setOptions(options) {
59
+ if (JSON.stringify(options) !== JSON.stringify(this.options)) {
60
+ this.options = deepClone(options);
61
+ this.setDefaultIndexs();
62
+ }
63
+ },
64
+ setDefaultIndexs: function setDefaultIndexs() {
65
+ this.currentIndexs = deepClone(this.defaultIndexs);
66
+ },
67
+ onClickItem: function onClickItem(index) {
68
+ var _this = this;
69
+
70
+ if (this.readonly) {
71
+ return;
72
+ }
73
+
74
+ var exist = false;
75
+ this.currentIndexs.forEach(function (v, i) {
76
+ if (v === index) {
77
+ exist = true;
78
+
79
+ _this.currentIndexs.splice(i, 1);
80
+ }
81
+ });
82
+
83
+ if (!exist) {
84
+ this.currentIndexs.push(index);
85
+ }
86
+
87
+ var currentOptions = [];
88
+ this.currentIndexs.forEach(function (index) {
89
+ currentOptions.push(_this.options[index]);
90
+ });
91
+ this.$emit('change');
92
+ },
93
+ getOptionText: function getOptionText(option) {
94
+ if (isObject(option) && this.valueKey in option) {
95
+ return option[this.valueKey];
96
+ }
97
+
98
+ return option;
99
+ },
100
+ genOptions: function genOptions() {
101
+ var _this2 = this;
102
+
103
+ var h = this.$createElement;
104
+ this.columnCounts = Number(this.columnCounts);
105
+
106
+ if (this.columnCounts && this.columnCounts > 3) {
107
+ this.columnCounts = 3;
108
+ }
109
+
110
+ if (this.columnCounts && this.columnCounts < 1) {
111
+ this.columnCounts = 1;
112
+ }
113
+
114
+ var optionStyle = {
115
+ height: this.itemHeight + "px",
116
+ width: 1 / this.columnCounts * 100 + "%"
117
+ };
118
+ return this.options.map(function (option, index) {
119
+ var _domProps;
120
+
121
+ var text = _this2.getOptionText(option);
122
+
123
+ var disabled = isOptionDisabled(option);
124
+ var data = {
125
+ style: optionStyle,
126
+ attrs: {
127
+ role: 'button',
128
+ tabindex: disabled ? -1 : 0
129
+ },
130
+ class: [bem('item', {
131
+ disabled: disabled,
132
+ selected: _this2.currentIndexs.indexOf(index) > -1,
133
+ last: (index + 1) % _this2.columnCounts === 0
134
+ })],
135
+ on: {
136
+ click: function click() {
137
+ _this2.onClickItem(index);
138
+ }
139
+ }
140
+ };
141
+ var childData = {
142
+ class: 'zt-ellipsis',
143
+ domProps: (_domProps = {}, _domProps[_this2.allowHtml ? 'innerHTML' : 'textContent'] = text, _domProps)
144
+ };
145
+ return h("div", _mergeJSXProps2([{}, data]), [_this2.slots('option', option) || h("div", _mergeJSXProps([{}, childData]))]);
146
+ });
147
+ }
148
+ },
149
+ render: function render() {
150
+ var h = arguments[0];
151
+ return h("div", {
152
+ "class": bem()
153
+ }, [h("div", {
154
+ "ref": "wrapper",
155
+ "class": bem('wrapper')
156
+ }, [this.genOptions()])]);
157
+ }
158
+ });
@@ -0,0 +1 @@
1
+ [class*=zt-hairline]::after{position:absolute;box-sizing:border-box;content:' ';pointer-events:none;top:-50%;right:-50%;bottom:-50%;left:-50%;border:0 solid rgba(0,0,0,.1);-webkit-transform:scale(.5);transform:scale(.5)}.zt-hairline,.zt-hairline--bottom,.zt-hairline--left,.zt-hairline--right,.zt-hairline--surround,.zt-hairline--top,.zt-hairline--top-bottom{position:relative}.zt-hairline--top::after{border-top-width:1px}.zt-hairline--left::after{border-left-width:1px}.zt-hairline--right::after{border-right-width:1px}.zt-hairline--bottom::after{border-bottom-width:1px}.zt-hairline--top-bottom::after,.zt-hairline-unset--top-bottom::after{border-width:1px 0}.zt-hairline--surround::after{border-width:1px}.zt-multiple-picker{position:relative;background-color:#fff;-webkit-user-select:none;user-select:none}.zt-multiple-picker__toolbar{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;-webkit-box-pack:justify;-webkit-justify-content:space-between;justify-content:space-between;height:44px}.zt-multiple-picker__border{position:relative}.zt-multiple-picker__border::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)}.zt-multiple-picker__cancel,.zt-multiple-picker__confirm{height:100%;padding:0 16px;font-size:16px;background-color:transparent;border:none;cursor:pointer}.zt-multiple-picker__cancel:active,.zt-multiple-picker__confirm:active{opacity:.7}.zt-multiple-picker__confirm{color:#0091fa;font-weight:700}.zt-multiple-picker__cancel{color:#000;font-weight:400}.zt-multiple-picker__title{max-width:50%;font-weight:400;font-size:14px;line-height:20px;text-align:center;color:rgba(0,0,0,.4)}.zt-multiple-picker__header{width:100%;height:40px;display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;font-size:14px;font-weight:400}.zt-multiple-picker__header>li{-webkit-box-flex:1;-webkit-flex:auto;flex:auto;text-align:center}.zt-multiple-picker__options{position:relative;display:-webkit-box;display:-webkit-flex;display:flex;cursor:grab}.zt-multiple-picker__loading{position:absolute;top:0;right:0;bottom:0;left:0;z-index:3;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;color:#0091fa;background-color:rgba(255,255,255,.9)}.zt-multiple-picker-options{-webkit-box-flex:1;-webkit-flex:1;flex:1;overflow:scroll;font-size:16px}.zt-multiple-picker-options__wrapper{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-flex-wrap:wrap;flex-wrap:wrap;background-color:#fff;padding:12px 4px 4px 4px}.zt-multiple-picker-options__item{color:rgba(0,0,0,.6);padding:0 4px 8px 0;box-sizing:border-box;border-radius:2px;text-align:center;font-size:14px}.zt-multiple-picker-options__item .zt-ellipsis{height:28px;line-height:28px;background-color:rgba(0,0,0,.04)}.zt-multiple-picker-options__item--disabled{cursor:not-allowed;opacity:.3}.zt-multiple-picker-options__item--last{padding-right:0}.zt-multiple-picker-options__item--selected .zt-ellipsis{background:rgba(0,145,250,.1);border:1px solid #0091fa;border-radius:2px;color:#0091fa}
@@ -0,0 +1,208 @@
1
+ import _extends from "@babel/runtime/helpers/esm/extends";
2
+ // Utils
3
+ import { createNamespace } from '../utils';
4
+ import { pickerProps, DEFAULT_ITEM_HEIGHT } from './shared';
5
+ import { unitToPx } from '../utils/format/unit'; // Components
6
+
7
+ import Loading from '../loading';
8
+ import MultiplePickerOptions from './MultiplePickerOptions';
9
+ import Popup from '../popup';
10
+ import { PopupMixin } from '../mixins/popup';
11
+ import { deepClone } from '../utils/deep-clone';
12
+
13
+ var _createNamespace = createNamespace('multiple-picker'),
14
+ createComponent = _createNamespace[0],
15
+ bem = _createNamespace[1],
16
+ t = _createNamespace[2];
17
+
18
+ export default createComponent({
19
+ mixins: [PopupMixin()],
20
+ props: _extends({}, pickerProps, {
21
+ showToolbar: {
22
+ type: Boolean,
23
+ default: true
24
+ },
25
+ defaultIndexs: {
26
+ type: Array,
27
+ default: function _default() {
28
+ return [];
29
+ }
30
+ },
31
+ options: {
32
+ type: Array,
33
+ default: function _default() {
34
+ return [];
35
+ }
36
+ },
37
+ toolbarPosition: {
38
+ type: String,
39
+ default: 'top'
40
+ },
41
+ valueKey: {
42
+ type: String,
43
+ default: 'text'
44
+ },
45
+ columnCounts: {
46
+ type: Number,
47
+ default: 3
48
+ }
49
+ }),
50
+ data: function data() {
51
+ return {};
52
+ },
53
+ computed: {
54
+ itemPxHeight: function itemPxHeight() {
55
+ return this.itemHeight ? unitToPx(this.itemHeight) : DEFAULT_ITEM_HEIGHT;
56
+ }
57
+ },
58
+ methods: {
59
+ onClickOverlay: function onClickOverlay() {
60
+ if (this.closeOnClickOverlay) {
61
+ this.cancel();
62
+ }
63
+ },
64
+ emit: function emit(event) {
65
+ this.$emit(event, this.getOptions());
66
+ },
67
+ getOptions: function getOptions() {
68
+ var _this = this;
69
+
70
+ var indexs = this.$refs.pickerOptions.currentIndexs;
71
+ var result = [];
72
+ indexs.forEach(function (index) {
73
+ result.push(_this.options[index]);
74
+ });
75
+ return result;
76
+ },
77
+ onChange: function onChange() {
78
+ this.$emit('change', this.getOptions());
79
+ },
80
+ cancel: function cancel() {
81
+ this.emit('cancel');
82
+ },
83
+ confirm: function confirm() {
84
+ this.emit('confirm', this.getOptions());
85
+ },
86
+ genTitle: function genTitle() {
87
+ var h = this.$createElement;
88
+ var titleSlot = this.slots('title');
89
+
90
+ if (titleSlot) {
91
+ return titleSlot;
92
+ }
93
+
94
+ if (this.title) {
95
+ return h("div", {
96
+ "class": ['zt-ellipsis', bem('title')]
97
+ }, [this.title]);
98
+ }
99
+ },
100
+ genCancel: function genCancel() {
101
+ var h = this.$createElement;
102
+ return h("button", {
103
+ "attrs": {
104
+ "type": "button"
105
+ },
106
+ "class": bem('cancel'),
107
+ "on": {
108
+ "click": this.cancel
109
+ }
110
+ }, [this.slots('cancel') || this.cancelButtonText || t('cancel')]);
111
+ },
112
+ genConfirm: function genConfirm() {
113
+ var h = this.$createElement;
114
+ return h("button", {
115
+ "attrs": {
116
+ "type": "button"
117
+ },
118
+ "class": bem('confirm'),
119
+ "on": {
120
+ "click": this.confirm
121
+ }
122
+ }, [this.slots('confirm') || this.confirmButtonText || t('confirm')]);
123
+ },
124
+ genToolbar: function genToolbar() {
125
+ var h = this.$createElement;
126
+
127
+ if (this.showToolbar) {
128
+ return h("div", {
129
+ "class": bem('toolbar')
130
+ }, [this.slots() || [this.genCancel(), this.genTitle(), this.genConfirm()]]);
131
+ }
132
+ },
133
+ genOptions: function genOptions() {
134
+ var h = this.$createElement;
135
+ var rowsCount = Math.ceil(this.options.length / this.columnCounts);
136
+ var wrapHeight = 196;
137
+
138
+ if (rowsCount > 5) {
139
+ wrapHeight = 460;
140
+ }
141
+
142
+ var optionsStyle = {
143
+ height: wrapHeight + "px"
144
+ };
145
+ return h("div", {
146
+ "class": bem('options'),
147
+ "style": optionsStyle
148
+ }, [this.genOptionItems()]);
149
+ },
150
+ genOptionItems: function genOptionItems() {
151
+ var _this2 = this;
152
+
153
+ var h = this.$createElement;
154
+ var formatOptions = [];
155
+
156
+ if (this.options && this.options[0] && typeof this.options[0] !== 'object') {
157
+ formatOptions = this.options.map(function (v) {
158
+ return {
159
+ value: v,
160
+ text: v
161
+ };
162
+ });
163
+ } else {
164
+ formatOptions = this.options;
165
+ }
166
+
167
+ return h(MultiplePickerOptions, {
168
+ "ref": "pickerOptions",
169
+ "attrs": {
170
+ "readonly": this.readonly,
171
+ "valueKey": this.valueKey,
172
+ "allowHtml": this.allowHtml,
173
+ "itemHeight": this.itemPxHeight,
174
+ "defaultIndexs": this.defaultIndexs,
175
+ "initialOptions": formatOptions,
176
+ "columnCounts": this.columnCounts
177
+ },
178
+ "scopedSlots": {
179
+ option: this.$scopedSlots.option
180
+ },
181
+ "on": {
182
+ "change": function change() {
183
+ _this2.onChange();
184
+ }
185
+ }
186
+ });
187
+ }
188
+ },
189
+ render: function render(h) {
190
+ return h(Popup, {
191
+ "attrs": {
192
+ "value": this.showPicker,
193
+ "round": true,
194
+ "position": "bottom",
195
+ "closeOnPopstate": this.closeOnPopstate,
196
+ "closeOnClickOverlay": this.closeOnClickOverlay,
197
+ "customOnClickOverlay": this.onClickOverlay
198
+ }
199
+ }, [h("div", {
200
+ "class": bem(),
201
+ "ref": 'columnParent'
202
+ }, [this.toolbarPosition === 'top' ? this.genToolbar() : h(), this.toolbarPosition === 'top' ? h("div", {
203
+ "class": bem('border')
204
+ }) : h(), this.loading ? h(Loading, {
205
+ "class": bem('loading')
206
+ }) : h(), this.genOptions(), this.toolbarPosition === 'bottom' ? this.genToolbar() : h()])]);
207
+ }
208
+ });
@@ -0,0 +1,135 @@
1
+ @import '../style/var';
2
+ @import '../style/hairline';
3
+
4
+ .zt-multiple-picker {
5
+ position: relative;
6
+ background-color: @picker-background-color;
7
+ user-select: none;
8
+
9
+ &__toolbar {
10
+ display: flex;
11
+ align-items: center;
12
+ justify-content: space-between;
13
+ height: @picker-toolbar-height;
14
+ }
15
+
16
+ &__border {
17
+ position: relative;
18
+ }
19
+
20
+ &__border::after {
21
+ .hairline-bottom();
22
+ }
23
+
24
+ &__cancel,
25
+ &__confirm {
26
+ height: 100%;
27
+ padding: @picker-action-padding;
28
+ font-size: @picker-action-font-size;
29
+ background-color: transparent;
30
+ border: none;
31
+ cursor: pointer;
32
+
33
+ &:active {
34
+ opacity: @active-opacity;
35
+ }
36
+ }
37
+
38
+ &__confirm {
39
+ color: @picker-confirm-action-color;
40
+ font-weight: @picker-confirm-action-font-weight;
41
+ }
42
+
43
+ &__cancel {
44
+ color: @picker-cancel-action-color;
45
+ font-weight: @picker-cancel-action-font-weight;
46
+ }
47
+
48
+ &__title {
49
+ max-width: 50%;
50
+ font-weight: @plain-font-weight;
51
+ font-size: @picker-title-font-size;
52
+ line-height: @picker-title-line-height;
53
+ text-align: center;
54
+ color: rgba(0, 0, 0, 0.4);
55
+ }
56
+
57
+ &__header {
58
+ width: 100%;
59
+ height: 40px;
60
+ display: flex;
61
+ align-items: center;
62
+ font-size: @picker-title-font-size;
63
+ font-weight: @plain-font-weight;
64
+
65
+ >li {
66
+ flex: auto;
67
+ text-align: center;
68
+ }
69
+ }
70
+
71
+ &__options {
72
+ position: relative;
73
+ display: flex;
74
+ cursor: grab;
75
+ }
76
+
77
+ &__loading {
78
+ position: absolute;
79
+ top: 0;
80
+ right: 0;
81
+ bottom: 0;
82
+ left: 0;
83
+ z-index: 3;
84
+ display: flex;
85
+ align-items: center;
86
+ justify-content: center;
87
+ color: @picker-loading-icon-color;
88
+ background-color: @picker-loading-mask-color;
89
+ }
90
+
91
+ &-options {
92
+ flex: 1;
93
+ overflow: scroll;
94
+ font-size: @picker-option-font-size;
95
+
96
+ &__wrapper {
97
+ display: flex;
98
+ flex-wrap: wrap;
99
+ background-color: #fff;
100
+ padding: @multiple-picker-warpper-padding;
101
+ }
102
+
103
+ &__item {
104
+ color: @multiple-picker-option-text-color;
105
+ padding: 0 4px 8px 0;
106
+ box-sizing: border-box;
107
+ border-radius: 2px;
108
+ text-align: center;
109
+ font-size: 14px;
110
+ .zt-ellipsis {
111
+ height: 28px;
112
+ line-height: 28px;
113
+ background-color: rgba(0,0,0,.04);
114
+ }
115
+
116
+ &--disabled {
117
+ cursor: not-allowed;
118
+ opacity: @picker-option-disabled-opacity;
119
+ }
120
+
121
+ &--last {
122
+ padding-right: 0;
123
+ }
124
+
125
+ &--selected {
126
+ .zt-ellipsis {
127
+ background: rgba(0,145,250,0.10);
128
+ border: 1px solid #0091FA;
129
+ border-radius: 2px;
130
+ color: #0091FA;
131
+ }
132
+ }
133
+ }
134
+ }
135
+ }
@@ -0,0 +1,26 @@
1
+ export var DEFAULT_ITEM_HEIGHT = 36;
2
+ export var pickerProps = {
3
+ title: String,
4
+ loading: Boolean,
5
+ readonly: Boolean,
6
+ itemHeight: [Number, String],
7
+ showToolbar: Boolean,
8
+ cancelButtonText: String,
9
+ confirmButtonText: String,
10
+ showPicker: {
11
+ type: Boolean,
12
+ default: false
13
+ },
14
+ allowHtml: {
15
+ type: Boolean,
16
+ default: true
17
+ },
18
+ closeOnPopstate: {
19
+ type: Boolean,
20
+ default: true
21
+ },
22
+ closeOnClickOverlay: {
23
+ type: Boolean,
24
+ default: true
25
+ }
26
+ };
@@ -0,0 +1,7 @@
1
+ import '../../style/base.css';
2
+ import '../../overlay/index.css';
3
+ import '../../info/index.css';
4
+ import '../../icon/index.css';
5
+ import '../../popup/index.css';
6
+ import '../../loading/index.css';
7
+ import '../index.css';
@@ -0,0 +1,7 @@
1
+ import '../../style/base.less';
2
+ import '../../overlay/index.less';
3
+ import '../../info/index.less';
4
+ import '../../icon/index.less';
5
+ import '../../popup/index.less';
6
+ import '../../loading/index.less';
7
+ import '../index.less';
@@ -1 +1 @@
1
- .zt-radio{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 16px}.zt-radio__custom-svg{width:24px;height:24px;border-radius:50%}.zt-radio__icon--disabled .zt-radio__custom-svg{opacity:.2}.zt-radio--disabled{cursor:not-allowed}.zt-radio--label-disabled{cursor:default}.zt-radio--horizontal{margin-right:12px}.zt-radio__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-radio__icon i,.zt-radio__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-radio__icon img{width:1em;height:1em}.zt-radio__icon .zt-icon{display:block;box-sizing:border-box;width:1em;height:1em;color:transparent;font-size:1em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-radio__icon--round .zt-icon{border-radius:100%}.zt-radio__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-radio__icon--disabled{cursor:not-allowed}.zt-radio__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-radio__icon--disabled.zt-radio__icon--checked .zt-icon{color:#c8c9cc}.zt-radio__label{margin-left:8px;color:#000;line-height:24px}.zt-radio__label--left{margin:0 8px 0 0}.zt-radio__label--disabled{color:#c8c9cc}
1
+ .zt-radio{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 0}.zt-radio__custom-svg{width:24px;height:24px;border-radius:50%}.zt-radio__icon--disabled .zt-radio__custom-svg{opacity:.2}.zt-radio--disabled{cursor:not-allowed}.zt-radio--label-disabled{cursor:default}.zt-radio--horizontal{margin-left:12px}.zt-radio__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-radio__icon i,.zt-radio__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-radio__icon img{width:1em;height:1em}.zt-radio__icon .zt-icon{display:block;box-sizing:border-box;width:1em;height:1em;color:transparent;font-size:1em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-radio__icon--round .zt-icon{border-radius:100%}.zt-radio__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-radio__icon--disabled{cursor:not-allowed}.zt-radio__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-radio__icon--disabled.zt-radio__icon--checked .zt-icon{color:#c8c9cc}.zt-radio__label{margin-left:8px;color:#000;line-height:24px}.zt-radio__label--left{margin:0 8px 0 0}.zt-radio__label--disabled{color:#c8c9cc}
@@ -26,7 +26,7 @@
26
26
  }
27
27
 
28
28
  &--horizontal {
29
- margin-right: @padding-sm;
29
+ margin-left: @padding-sm;
30
30
  }
31
31
 
32
32
  &__icon {
package/es/style/var.less CHANGED
@@ -267,7 +267,7 @@
267
267
 
268
268
  // Checkbox
269
269
  @checkbox-size: 24px;
270
- @checkbox-padding: 10px 16px;
270
+ @checkbox-padding: 10px 0;
271
271
  @checkbox-border-color: @gray-5;
272
272
  @checkbox-transition-duration: @animation-duration-fast;
273
273
  @checkbox-label-margin: @padding-xs;
@@ -638,6 +638,10 @@
638
638
  @picker-loading-icon-color: @blue;
639
639
  @picker-loading-mask-color: rgba(255, 255, 255, 0.9);
640
640
 
641
+ // MultiplePicker
642
+ @multiple-picker-warpper-padding: 12px 4px 4px 4px;
643
+ @multiple-picker-option-text-color: @gray-a6;
644
+
641
645
  // Popover
642
646
  @popover-arrow-size: 5px;
643
647
  @popover-border-radius: @border-radius-sm;
@@ -680,7 +684,7 @@
680
684
 
681
685
  // Radio
682
686
  @radio-size: 24px;
683
- @radio-padding: 10px 16px;
687
+ @radio-padding: 10px 0;
684
688
  @radio-border-color: @gray-5;
685
689
  @radio-transition-duration: @animation-duration-fast;
686
690
  @radio-label-margin: @padding-xs;
@@ -378,7 +378,7 @@ export default createComponent({
378
378
  "name": "description"
379
379
  }
380
380
  }), h("div", {
381
- "class": [bem('file-name'), 'van-ellipsis']
381
+ "class": [bem('file-name'), 'zt-ellipsis']
382
382
  }, [item.file ? item.file.name : item.url]), PreviewCover]);
383
383
  return h("div", {
384
384
  "class": bem('preview'),
@@ -1 +1 @@
1
- .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 16px}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-right:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background-color:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}
1
+ .zt-checkbox{display:-webkit-box;display:-webkit-flex;display:flex;-webkit-box-align:center;-webkit-align-items:center;align-items:center;overflow:hidden;cursor:pointer;-webkit-user-select:none;user-select:none;padding:10px 0}.zt-checkbox--disabled{cursor:not-allowed}.zt-checkbox--label-disabled{cursor:default}.zt-checkbox--horizontal{margin-left:12px}.zt-checkbox__icon{-webkit-box-flex:0;-webkit-flex:none;flex:none;height:1em;font-size:24px;line-height:1em;cursor:pointer}.zt-checkbox__icon i,.zt-checkbox__icon img{-webkit-transform:scale(.8333);transform:scale(.8333);-webkit-transform-origin:center;transform-origin:center}.zt-checkbox__icon .zt-icon{display:block;box-sizing:border-box;width:1.25em;height:1.25em;color:transparent;font-size:.8em;line-height:1.25;text-align:center;border:1px solid #c8c9cc;-webkit-transition-duration:.2s;transition-duration:.2s;-webkit-transition-property:color,border-color,background-color;transition-property:color,border-color,background-color}.zt-checkbox__icon--round .zt-icon{border-radius:100%}.zt-checkbox__icon--checked .zt-icon{color:#fff;background-color:#0091fa;border-color:#0091fa}.zt-checkbox__icon--disabled{cursor:not-allowed}.zt-checkbox__icon--disabled .zt-icon{background-color:rgba(0,0,0,.1);border-color:#c8c9cc}.zt-checkbox__icon--disabled.zt-checkbox__icon--checked .zt-icon{opacity:.4;background-color:#0091fa;color:#fff}.zt-checkbox__label{margin-left:8px;color:#000;line-height:24px}.zt-checkbox__label--left{margin:0 8px 0 0}.zt-checkbox__label--disabled{color:#c8c9cc}