zartui 2.1.22 → 2.1.24
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/button/index.css +1 -1
- package/es/checkbox/index.css +1 -1
- package/es/checkbox/index.less +4 -0
- package/es/index.js +1 -1
- package/es/media-picker/index.js +2 -2
- package/es/mixins/checkbox.js +19 -7
- package/es/multiple-picker/index.css +1 -1
- package/es/multiple-picker/index.js +93 -11
- package/es/multiple-picker/index.less +58 -0
- package/es/multiple-picker/style/index.js +1 -0
- package/es/multiple-picker/style/less.js +1 -0
- package/es/style/var.less +1 -1
- package/lib/button/index.css +1 -1
- package/lib/checkbox/index.css +1 -1
- package/lib/checkbox/index.less +4 -0
- package/lib/index.css +1 -1
- package/lib/index.js +1 -1
- package/lib/media-picker/index.js +2 -2
- package/lib/mixins/checkbox.js +19 -7
- package/lib/multiple-picker/index.css +1 -1
- package/lib/multiple-picker/index.js +93 -11
- package/lib/multiple-picker/index.less +58 -0
- package/lib/multiple-picker/style/index.js +1 -0
- package/lib/multiple-picker/style/less.js +1 -0
- package/lib/style/var.less +1 -1
- package/lib/zart.js +115 -21
- package/lib/zart.min.js +3 -3
- package/package.json +1 -1
package/lib/zart.js
CHANGED
|
@@ -8006,6 +8006,10 @@ var checkbox_CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
8006
8006
|
bindGroup: {
|
|
8007
8007
|
type: Boolean,
|
|
8008
8008
|
default: true
|
|
8009
|
+
},
|
|
8010
|
+
indeterminate: {
|
|
8011
|
+
type: Boolean,
|
|
8012
|
+
default: false
|
|
8009
8013
|
}
|
|
8010
8014
|
},
|
|
8011
8015
|
computed: {
|
|
@@ -8023,7 +8027,7 @@ var checkbox_CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
8023
8027
|
var boxShadow = this.boxShadow || this.parent && this.parent.boxShadow;
|
|
8024
8028
|
var border = this.border || this.parent && this.parent.border;
|
|
8025
8029
|
var iconColor = this.iconColor || this.parent && this.parent.iconColor;
|
|
8026
|
-
if ((boxShadow || checkedColor) && this.checked && !this.isDisabled) {
|
|
8030
|
+
if ((boxShadow || checkedColor) && (this.checked || this.indeterminate) && !this.isDisabled) {
|
|
8027
8031
|
return {
|
|
8028
8032
|
color: iconColor,
|
|
8029
8033
|
boxShadow: boxShadow,
|
|
@@ -8059,24 +8063,31 @@ var checkbox_CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
8059
8063
|
},
|
|
8060
8064
|
genIcon: function genIcon() {
|
|
8061
8065
|
var h = this.$createElement;
|
|
8062
|
-
var checked = this.checked
|
|
8066
|
+
var checked = this.checked,
|
|
8067
|
+
indeterminate = this.indeterminate;
|
|
8063
8068
|
var iconSize = this.iconSize || this.parent && this.parent.iconSize;
|
|
8064
8069
|
return h("div", {
|
|
8065
8070
|
"ref": "icon",
|
|
8066
8071
|
"class": bem('icon', [this.shape, {
|
|
8067
8072
|
disabled: this.isDisabled,
|
|
8068
|
-
checked: checked
|
|
8073
|
+
checked: checked || indeterminate
|
|
8069
8074
|
}]),
|
|
8070
8075
|
"style": {
|
|
8071
8076
|
fontSize: Object(utils["a" /* addUnit */])(iconSize)
|
|
8072
8077
|
}
|
|
8073
8078
|
}, [this.slots('icon', {
|
|
8074
|
-
checked: checked
|
|
8079
|
+
checked: checked,
|
|
8080
|
+
indeterminate: indeterminate
|
|
8075
8081
|
}) || (role === 'radio' ? h(es_icon, {
|
|
8076
8082
|
"style": this.iconStyle
|
|
8077
8083
|
}, [checked ? h("div", {
|
|
8078
8084
|
"class": bem('dot')
|
|
8079
|
-
}) : '']) : h(es_icon, {
|
|
8085
|
+
}) : '']) : indeterminate ? h(es_icon, {
|
|
8086
|
+
"attrs": {
|
|
8087
|
+
"name": "minus"
|
|
8088
|
+
},
|
|
8089
|
+
"style": this.iconStyle
|
|
8090
|
+
}) : h(es_icon, {
|
|
8080
8091
|
"attrs": {
|
|
8081
8092
|
"name": "checkBox-select"
|
|
8082
8093
|
},
|
|
@@ -8103,7 +8114,8 @@ var checkbox_CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
8103
8114
|
} else {
|
|
8104
8115
|
Children.push(this.genLabel());
|
|
8105
8116
|
}
|
|
8106
|
-
var checked = this.checked
|
|
8117
|
+
var checked = this.checked,
|
|
8118
|
+
indeterminate = this.indeterminate;
|
|
8107
8119
|
return h("div", {
|
|
8108
8120
|
"attrs": {
|
|
8109
8121
|
"role": role,
|
|
@@ -8113,7 +8125,7 @@ var checkbox_CheckboxMixin = function CheckboxMixin(_ref) {
|
|
|
8113
8125
|
"class": [bem([{
|
|
8114
8126
|
disabled: this.isDisabled,
|
|
8115
8127
|
'label-disabled': this.labelDisabled
|
|
8116
|
-
}, this.direction]), checked ? '' : bem('disable-icon')],
|
|
8128
|
+
}, this.direction]), checked || indeterminate ? '' : bem('disable-icon')],
|
|
8117
8129
|
"on": {
|
|
8118
8130
|
"click": this.onClick
|
|
8119
8131
|
}
|
|
@@ -25640,8 +25652,8 @@ var media_picker_createNamespace = Object(utils["b" /* createNamespace */])('med
|
|
|
25640
25652
|
*/
|
|
25641
25653
|
renderMediaThumbnail: function renderMediaThumbnail(media) {
|
|
25642
25654
|
var h = this.$createElement;
|
|
25643
|
-
if (this.$scopedSlots
|
|
25644
|
-
return this.slots('
|
|
25655
|
+
if (this.$scopedSlots.thumbnail) {
|
|
25656
|
+
return this.slots('thumbnail', {
|
|
25645
25657
|
file: media
|
|
25646
25658
|
});
|
|
25647
25659
|
}
|
|
@@ -25955,6 +25967,7 @@ function MultiplePickerOptions_isOptionDisabled(option) {
|
|
|
25955
25967
|
}));
|
|
25956
25968
|
// CONCATENATED MODULE: ./es/multiple-picker/index.js
|
|
25957
25969
|
|
|
25970
|
+
|
|
25958
25971
|
// Utils
|
|
25959
25972
|
|
|
25960
25973
|
|
|
@@ -25965,6 +25978,7 @@ function MultiplePickerOptions_isOptionDisabled(option) {
|
|
|
25965
25978
|
|
|
25966
25979
|
|
|
25967
25980
|
|
|
25981
|
+
|
|
25968
25982
|
var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('multiple-picker'),
|
|
25969
25983
|
multiple_picker_createComponent = multiple_picker_createNamespace[0],
|
|
25970
25984
|
multiple_picker_bem = multiple_picker_createNamespace[1],
|
|
@@ -26003,10 +26017,15 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26003
26017
|
safeAreaInsetBottom: {
|
|
26004
26018
|
type: Boolean,
|
|
26005
26019
|
default: false
|
|
26020
|
+
},
|
|
26021
|
+
showSelectAll: {
|
|
26022
|
+
type: Boolean,
|
|
26023
|
+
default: false
|
|
26006
26024
|
}
|
|
26007
26025
|
}),
|
|
26008
26026
|
data: function data() {
|
|
26009
26027
|
return {
|
|
26028
|
+
currentIndexs: [],
|
|
26010
26029
|
confirmIndexs: null
|
|
26011
26030
|
};
|
|
26012
26031
|
},
|
|
@@ -26028,6 +26047,12 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26028
26047
|
}
|
|
26029
26048
|
},
|
|
26030
26049
|
computed: {
|
|
26050
|
+
isAllSelected: function isAllSelected() {
|
|
26051
|
+
return this.currentIndexs.length > 0 && this.currentIndexs.length === this.options.length;
|
|
26052
|
+
},
|
|
26053
|
+
isIndeterminate: function isIndeterminate() {
|
|
26054
|
+
return this.currentIndexs.length > 0 && this.currentIndexs.length < this.options.length;
|
|
26055
|
+
},
|
|
26031
26056
|
itemPxHeight: function itemPxHeight() {
|
|
26032
26057
|
return this.itemHeight ? Object(unit["b" /* unitToPx */])(this.itemHeight) : shared_DEFAULT_ITEM_HEIGHT;
|
|
26033
26058
|
}
|
|
@@ -26053,6 +26078,10 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26053
26078
|
return result;
|
|
26054
26079
|
},
|
|
26055
26080
|
onChange: function onChange() {
|
|
26081
|
+
// 同步 currentIndexs 以触发计算属性更新
|
|
26082
|
+
if (this.$refs.pickerOptions) {
|
|
26083
|
+
this.currentIndexs = [].concat(this.$refs.pickerOptions.currentIndexs);
|
|
26084
|
+
}
|
|
26056
26085
|
this.$emit('change', this.getOptions());
|
|
26057
26086
|
},
|
|
26058
26087
|
cancel: function cancel() {
|
|
@@ -26066,6 +26095,28 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26066
26095
|
});
|
|
26067
26096
|
this.emit('confirm', options);
|
|
26068
26097
|
},
|
|
26098
|
+
handleSelectAll: function handleSelectAll() {
|
|
26099
|
+
var newIndexs = !this.isAllSelected ? this.options && this.options.map(function (_, index) {
|
|
26100
|
+
return index;
|
|
26101
|
+
}) : [];
|
|
26102
|
+
this.currentIndexs = newIndexs;
|
|
26103
|
+
if (this.$refs.pickerOptions) {
|
|
26104
|
+
this.$refs.pickerOptions.setConfirmIndex(newIndexs);
|
|
26105
|
+
}
|
|
26106
|
+
},
|
|
26107
|
+
onSelectOther: function onSelectOther() {
|
|
26108
|
+
var _this3 = this;
|
|
26109
|
+
var newIndexs = [];
|
|
26110
|
+
this.options && this.options.forEach(function (_, index) {
|
|
26111
|
+
if (!_this3.currentIndexs.includes(index)) {
|
|
26112
|
+
newIndexs.push(index);
|
|
26113
|
+
}
|
|
26114
|
+
});
|
|
26115
|
+
this.currentIndexs = newIndexs;
|
|
26116
|
+
if (this.$refs.pickerOptions) {
|
|
26117
|
+
this.$refs.pickerOptions.setConfirmIndex(newIndexs);
|
|
26118
|
+
}
|
|
26119
|
+
},
|
|
26069
26120
|
genTitle: function genTitle() {
|
|
26070
26121
|
var h = this.$createElement;
|
|
26071
26122
|
var titleSlot = this.slots('title');
|
|
@@ -26078,13 +26129,32 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26078
26129
|
}, [this.title]);
|
|
26079
26130
|
}
|
|
26080
26131
|
},
|
|
26081
|
-
|
|
26132
|
+
genOther: function genOther() {
|
|
26082
26133
|
var h = this.$createElement;
|
|
26083
26134
|
return h(es_button, {
|
|
26135
|
+
"class": multiple_picker_bem('select-other'),
|
|
26084
26136
|
"attrs": {
|
|
26085
|
-
"size": "
|
|
26086
|
-
"block": true
|
|
26137
|
+
"size": "medium"
|
|
26087
26138
|
},
|
|
26139
|
+
"style": {
|
|
26140
|
+
marginLeft: '12px',
|
|
26141
|
+
marginRight: '8px'
|
|
26142
|
+
},
|
|
26143
|
+
"on": {
|
|
26144
|
+
"click": this.onSelectOther
|
|
26145
|
+
}
|
|
26146
|
+
}, [this.slots('selectOther') || '其他']);
|
|
26147
|
+
},
|
|
26148
|
+
genCancel: function genCancel() {
|
|
26149
|
+
var h = this.$createElement;
|
|
26150
|
+
return h(es_button, helper_default()([{
|
|
26151
|
+
"class": [this.showSelectAll ? multiple_picker_bem('in-select-all') : ''],
|
|
26152
|
+
"attrs": {
|
|
26153
|
+
"size": this.showSelectAll ? "medium" : "normal"
|
|
26154
|
+
}
|
|
26155
|
+
}, this.showSelectAll ? {
|
|
26156
|
+
block: true
|
|
26157
|
+
} : {}, {
|
|
26088
26158
|
"style": {
|
|
26089
26159
|
marginRigth: "4px",
|
|
26090
26160
|
backgroundColor: "white"
|
|
@@ -26092,30 +26162,54 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26092
26162
|
"on": {
|
|
26093
26163
|
"click": this.cancel
|
|
26094
26164
|
}
|
|
26095
|
-
}, [this.slots('cancel') || this.cancelButtonText || multiple_picker_t('cancel')]);
|
|
26165
|
+
}]), [this.slots('cancel') || this.cancelButtonText || multiple_picker_t('cancel')]);
|
|
26096
26166
|
},
|
|
26097
26167
|
genConfirm: function genConfirm() {
|
|
26098
26168
|
var h = this.$createElement;
|
|
26099
|
-
return h(es_button, {
|
|
26169
|
+
return h(es_button, helper_default()([{
|
|
26100
26170
|
"attrs": {
|
|
26101
26171
|
"type": "primary",
|
|
26102
|
-
"size": "normal"
|
|
26103
|
-
"block": true
|
|
26172
|
+
"size": this.showSelectAll ? "medium" : "normal"
|
|
26104
26173
|
},
|
|
26174
|
+
"class": [this.showSelectAll ? multiple_picker_bem('in-select-all') : '']
|
|
26175
|
+
}, this.showSelectAll ? {
|
|
26176
|
+
block: true
|
|
26177
|
+
} : {}, {
|
|
26105
26178
|
"style": {
|
|
26106
26179
|
marginLeft: "8px"
|
|
26107
26180
|
},
|
|
26108
26181
|
"on": {
|
|
26109
26182
|
"click": this.confirm
|
|
26110
26183
|
}
|
|
26111
|
-
}, [this.slots('confirm') || this.confirmButtonText || multiple_picker_t('confirm')]);
|
|
26184
|
+
}]), [this.slots('confirm') || this.confirmButtonText || multiple_picker_t('confirm')]);
|
|
26185
|
+
},
|
|
26186
|
+
genSelectAll: function genSelectAll() {
|
|
26187
|
+
var h = this.$createElement;
|
|
26188
|
+
return h("div", {
|
|
26189
|
+
"class": multiple_picker_bem('toolbar-select-all')
|
|
26190
|
+
}, [h(es_checkbox, {
|
|
26191
|
+
"class": multiple_picker_bem('toolbar-checkbox'),
|
|
26192
|
+
"attrs": {
|
|
26193
|
+
"shape": 'square',
|
|
26194
|
+
"value": this.isAllSelected,
|
|
26195
|
+
"indeterminate": this.isIndeterminate
|
|
26196
|
+
},
|
|
26197
|
+
"on": {
|
|
26198
|
+
"click": this.handleSelectAll
|
|
26199
|
+
}
|
|
26200
|
+
}, ["\u5168\u9009"]), h("div", {
|
|
26201
|
+
"class": multiple_picker_bem('toolbar-divider')
|
|
26202
|
+
}), h("span", {
|
|
26203
|
+
"class": multiple_picker_bem('toolbar-checkbox-text')
|
|
26204
|
+
}, ["\u5DF2\u9009 ", this.currentIndexs && this.currentIndexs.length || 0])]);
|
|
26112
26205
|
},
|
|
26113
26206
|
genToolbar: function genToolbar() {
|
|
26114
26207
|
var h = this.$createElement;
|
|
26115
26208
|
if (this.showToolbar) {
|
|
26209
|
+
var toolbar = this.showSelectAll ? [this.genSelectAll(), this.genOther(), this.genCancel(), this.genConfirm()] : [this.genCancel(), this.genConfirm()];
|
|
26116
26210
|
return h("div", {
|
|
26117
26211
|
"class": multiple_picker_bem('toolbar')
|
|
26118
|
-
}, [this.slots() ||
|
|
26212
|
+
}, [this.slots() || toolbar]);
|
|
26119
26213
|
}
|
|
26120
26214
|
},
|
|
26121
26215
|
genOptions: function genOptions() {
|
|
@@ -26134,7 +26228,7 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26134
26228
|
}, [this.genOptionItems()]);
|
|
26135
26229
|
},
|
|
26136
26230
|
genOptionItems: function genOptionItems() {
|
|
26137
|
-
var
|
|
26231
|
+
var _this4 = this;
|
|
26138
26232
|
var h = this.$createElement;
|
|
26139
26233
|
var formatOptions = [];
|
|
26140
26234
|
if (this.options && this.options[0] && typeof this.options[0] !== 'object') {
|
|
@@ -26163,7 +26257,7 @@ var multiple_picker_createNamespace = Object(utils["b" /* createNamespace */])('
|
|
|
26163
26257
|
},
|
|
26164
26258
|
"on": {
|
|
26165
26259
|
"change": function change() {
|
|
26166
|
-
|
|
26260
|
+
_this4.onChange();
|
|
26167
26261
|
}
|
|
26168
26262
|
}
|
|
26169
26263
|
});
|
|
@@ -35100,7 +35194,7 @@ var uploader_createNamespace = Object(utils["b" /* createNamespace */])('uploade
|
|
|
35100
35194
|
|
|
35101
35195
|
|
|
35102
35196
|
|
|
35103
|
-
var es_version = '2.1.
|
|
35197
|
+
var es_version = '2.1.24';
|
|
35104
35198
|
function install(Vue) {
|
|
35105
35199
|
var components = [action_sheet, es_area, avatar, back_top, badge, es_button, calendar, cascader, cell, cell_group, es_checkbox, checkbox_group, col, collapse, collapse_item, count_down, datetime_picker, dialog, divider, dropdown_item, dropdown_menu, empty, es_field, fold_dialog, es_form, grid, grid_item, hierarchy_select, es_icon, es_image, image_preview, index_anchor, index_bar, es_info, lazyload, es_list, es_loading, locale["a" /* default */], media_picker, media_player, multiple_picker, nav_bar, notice_bar, number_keyboard, es_overlay, password_input, es_picker, popover, popup, pull_refresh, es_radio, radio_group, rate, row, search, signature, skeleton, slider, speech_recognizer, es_step, stepper, steps, es_sticky, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, table, tabs, es_tag, text_ellipsis, timeline, es_toast, uploader];
|
|
35106
35200
|
components.forEach(function (item) {
|