zartui 2.0.79 → 2.0.80-beta.2

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,6 +1,7 @@
1
1
  // Utils
2
2
  import { createNamespace } from '../utils';
3
- import { off, on } from '../utils/dom/event'; // Mixins
3
+ import { off, on } from '../utils/dom/event';
4
+ import { deepClone } from '../utils/deep-clone'; // Mixins
4
5
 
5
6
  import { PortalMixin } from '../mixins/portal';
6
7
  import { ChildrenMixin } from '../mixins/relation'; // Components
@@ -21,6 +22,7 @@ export default createComponent({
21
22
  }), ChildrenMixin('ztDropdownMenu')],
22
23
  props: {
23
24
  value: null,
25
+ resetDefaultValue: null,
24
26
  title: String,
25
27
  disabled: Boolean,
26
28
  titleClass: String,
@@ -144,11 +146,17 @@ export default createComponent({
144
146
  }
145
147
  },
146
148
  select: function select(value) {
149
+ // 标识是否是取消选中这一元素
150
+ var isCancelSelect = true;
151
+
147
152
  if (this.innerValue.indexOf(value) >= 0) {
148
153
  this.innerValue.splice(this.innerValue.indexOf(value), 1);
149
154
  } else {
150
155
  this.innerValue.push(value);
156
+ isCancelSelect = false;
151
157
  }
158
+
159
+ this.$emit('item-select', value, isCancelSelect);
152
160
  },
153
161
  isSelect: function isSelect(value) {
154
162
  if (this.innerValue.indexOf(value) >= 0) {
@@ -158,13 +166,23 @@ export default createComponent({
158
166
  return false;
159
167
  },
160
168
  reset: function reset() {
161
- this.innerValue = [];
169
+ if (Array.isArray(this.resetDefaultValue)) {
170
+ this.innerValue = deepClone(this.resetDefaultValue);
171
+ } else {
172
+ this.innerValue = [];
173
+ }
174
+
175
+ this.$emit('reset', this.innerValue);
162
176
  },
163
177
  confirm: function confirm() {
164
178
  this.showPopup = false;
165
179
  this.$emit('input', this.innerValue);
166
180
  this.$emit('change', this.innerValue);
167
181
  this.$emit('confirm', this.innerValue);
182
+ },
183
+ // @exposed-api 给灵珑侧提供的实现修改已选中值的函数
184
+ updateInnerValue: function updateInnerValue(updateValue) {
185
+ this.innerValue = updateValue;
168
186
  }
169
187
  },
170
188
  render: function render() {
@@ -233,6 +251,8 @@ export default createComponent({
233
251
  _this3.$emit('input', option.value);
234
252
 
235
253
  _this3.$emit('change', option.value);
254
+
255
+ _this3.$emit('item-select', option.value);
236
256
  }
237
257
  }
238
258
  }
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.79';
77
+ var version = '2.0.80-beta.2';
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,5 +1,5 @@
1
1
  // Utils
2
- import { createNamespace, isDef, isPromise, noop } from '../utils';
2
+ import { createNamespace, isDef, isPromise } from '../utils';
3
3
  import Icon from "../icon";
4
4
  import Loading from "../loading";
5
5
  import ZtImage from "../image";
@@ -8,7 +8,7 @@ import ZtMediaPlayer from "../media-player";
8
8
  import ZtActionSheet from "../action-sheet";
9
9
  import ZtGrid from "../grid"; // Types
10
10
 
11
- import { MediaAddType, MediaType, Media, MediaUploadStatus } from "./type";
11
+ import { MediaAddType, MediaType, MediaUploadStatus } from "./type";
12
12
  import { checkWatermarkConfigSupported, CompressOptions, file2DataURL, ImageProcessor, ResizeOptions, WatermarkOptions } from "@egova/media"; // import components
13
13
 
14
14
  import Toast from '../toast';
@@ -73,11 +73,13 @@ export default createComponent({
73
73
  },
74
74
  scrollEl: function scrollEl() {
75
75
  if (this.scrollElement) {
76
- if (this.scrollElement) {
77
- return getTargetDom(this.scrollElement);
78
- }
76
+ var targetDom = getTargetDom(this.scrollElement);
79
77
 
80
- return this.scrollElement();
78
+ if (targetDom) {
79
+ return targetDom;
80
+ } else {
81
+ console.warn('请检查props scroll-element元素是否存在!');
82
+ }
81
83
  }
82
84
 
83
85
  return getScroller(this.$el);
@@ -2,7 +2,8 @@
2
2
  * Vue Router support
3
3
  */
4
4
  function isRedundantNavigation(err) {
5
- return err.name === 'NavigationDuplicated' || err.message && err.message.indexOf('redundant navigation') !== -1;
5
+ return err.name === 'NavigationDuplicated' || // compatible with vue-router@3.3
6
+ err.message && err.message.indexOf('redundant navigation') !== -1;
6
7
  }
7
8
 
8
9
  export function route(router, config) {
@@ -9,6 +9,8 @@ var _utils = require("../utils");
9
9
 
10
10
  var _event = require("../utils/dom/event");
11
11
 
12
+ var _deepClone = require("../utils/deep-clone");
13
+
12
14
  var _portal = require("../mixins/portal");
13
15
 
14
16
  var _relation = require("../mixins/relation");
@@ -36,6 +38,7 @@ var _default2 = createComponent({
36
38
  }), (0, _relation.ChildrenMixin)('ztDropdownMenu')],
37
39
  props: {
38
40
  value: null,
41
+ resetDefaultValue: null,
39
42
  title: String,
40
43
  disabled: Boolean,
41
44
  titleClass: String,
@@ -159,11 +162,17 @@ var _default2 = createComponent({
159
162
  }
160
163
  },
161
164
  select: function select(value) {
165
+ // 标识是否是取消选中这一元素
166
+ var isCancelSelect = true;
167
+
162
168
  if (this.innerValue.indexOf(value) >= 0) {
163
169
  this.innerValue.splice(this.innerValue.indexOf(value), 1);
164
170
  } else {
165
171
  this.innerValue.push(value);
172
+ isCancelSelect = false;
166
173
  }
174
+
175
+ this.$emit('item-select', value, isCancelSelect);
167
176
  },
168
177
  isSelect: function isSelect(value) {
169
178
  if (this.innerValue.indexOf(value) >= 0) {
@@ -173,13 +182,23 @@ var _default2 = createComponent({
173
182
  return false;
174
183
  },
175
184
  reset: function reset() {
176
- this.innerValue = [];
185
+ if (Array.isArray(this.resetDefaultValue)) {
186
+ this.innerValue = (0, _deepClone.deepClone)(this.resetDefaultValue);
187
+ } else {
188
+ this.innerValue = [];
189
+ }
190
+
191
+ this.$emit('reset', this.innerValue);
177
192
  },
178
193
  confirm: function confirm() {
179
194
  this.showPopup = false;
180
195
  this.$emit('input', this.innerValue);
181
196
  this.$emit('change', this.innerValue);
182
197
  this.$emit('confirm', this.innerValue);
198
+ },
199
+ // @exposed-api 给灵珑侧提供的实现修改已选中值的函数
200
+ updateInnerValue: function updateInnerValue(updateValue) {
201
+ this.innerValue = updateValue;
183
202
  }
184
203
  },
185
204
  render: function render() {
@@ -248,6 +267,8 @@ var _default2 = createComponent({
248
267
  _this3.$emit('input', option.value);
249
268
 
250
269
  _this3.$emit('change', option.value);
270
+
271
+ _this3.$emit('item-select', option.value);
251
272
  }
252
273
  }
253
274
  }
package/lib/index.js CHANGED
@@ -309,7 +309,7 @@ exports.Toast = _toast.default;
309
309
  var _uploader = _interopRequireDefault(require("./uploader"));
310
310
 
311
311
  exports.Uploader = _uploader.default;
312
- var version = '2.0.79';
312
+ var version = '2.0.80-beta.2';
313
313
  exports.version = version;
314
314
 
315
315
  function install(Vue) {
@@ -85,11 +85,13 @@ var _default = createComponent({
85
85
  },
86
86
  scrollEl: function scrollEl() {
87
87
  if (this.scrollElement) {
88
- if (this.scrollElement) {
89
- return (0, _scroll.getTargetDom)(this.scrollElement);
90
- }
88
+ var targetDom = (0, _scroll.getTargetDom)(this.scrollElement);
91
89
 
92
- return this.scrollElement();
90
+ if (targetDom) {
91
+ return targetDom;
92
+ } else {
93
+ console.warn('请检查props scroll-element元素是否存在!');
94
+ }
93
95
  }
94
96
 
95
97
  return (0, _scroll.getScroller)(this.$el);
@@ -9,7 +9,8 @@ exports.routeProps = void 0;
9
9
  * Vue Router support
10
10
  */
11
11
  function isRedundantNavigation(err) {
12
- return err.name === 'NavigationDuplicated' || err.message && err.message.indexOf('redundant navigation') !== -1;
12
+ return err.name === 'NavigationDuplicated' || // compatible with vue-router@3.3
13
+ err.message && err.message.indexOf('redundant navigation') !== -1;
13
14
  }
14
15
 
15
16
  function route(router, config) {
package/lib/zart.js CHANGED
@@ -3242,7 +3242,8 @@ var BORDER_UNSET_TOP_BOTTOM = BORDER + "-unset--top-bottom";
3242
3242
  * Vue Router support
3243
3243
  */
3244
3244
  function isRedundantNavigation(err) {
3245
- return err.name === 'NavigationDuplicated' || err.message && err.message.indexOf('redundant navigation') !== -1;
3245
+ return err.name === 'NavigationDuplicated' || // compatible with vue-router@3.3
3246
+ err.message && err.message.indexOf('redundant navigation') !== -1;
3246
3247
  }
3247
3248
 
3248
3249
  function route(router, config) {
@@ -11406,6 +11407,7 @@ external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype.$ztDial
11406
11407
  // CONCATENATED MODULE: ./es/dropdown-item/index.js
11407
11408
  // Utils
11408
11409
 
11410
+
11409
11411
  // Mixins
11410
11412
 
11411
11413
 
@@ -11427,6 +11429,7 @@ var dropdown_item_createNamespace = Object(utils["b" /* createNamespace */])('dr
11427
11429
  }), ChildrenMixin('ztDropdownMenu')],
11428
11430
  props: {
11429
11431
  value: null,
11432
+ resetDefaultValue: null,
11430
11433
  title: String,
11431
11434
  disabled: Boolean,
11432
11435
  titleClass: String,
@@ -11550,11 +11553,17 @@ var dropdown_item_createNamespace = Object(utils["b" /* createNamespace */])('dr
11550
11553
  }
11551
11554
  },
11552
11555
  select: function select(value) {
11556
+ // 标识是否是取消选中这一元素
11557
+ var isCancelSelect = true;
11558
+
11553
11559
  if (this.innerValue.indexOf(value) >= 0) {
11554
11560
  this.innerValue.splice(this.innerValue.indexOf(value), 1);
11555
11561
  } else {
11556
11562
  this.innerValue.push(value);
11563
+ isCancelSelect = false;
11557
11564
  }
11565
+
11566
+ this.$emit('item-select', value, isCancelSelect);
11558
11567
  },
11559
11568
  isSelect: function isSelect(value) {
11560
11569
  if (this.innerValue.indexOf(value) >= 0) {
@@ -11564,13 +11573,23 @@ var dropdown_item_createNamespace = Object(utils["b" /* createNamespace */])('dr
11564
11573
  return false;
11565
11574
  },
11566
11575
  reset: function reset() {
11567
- this.innerValue = [];
11576
+ if (Array.isArray(this.resetDefaultValue)) {
11577
+ this.innerValue = deepClone(this.resetDefaultValue);
11578
+ } else {
11579
+ this.innerValue = [];
11580
+ }
11581
+
11582
+ this.$emit('reset', this.innerValue);
11568
11583
  },
11569
11584
  confirm: function confirm() {
11570
11585
  this.showPopup = false;
11571
11586
  this.$emit('input', this.innerValue);
11572
11587
  this.$emit('change', this.innerValue);
11573
11588
  this.$emit('confirm', this.innerValue);
11589
+ },
11590
+ // @exposed-api 给灵珑侧提供的实现修改已选中值的函数
11591
+ updateInnerValue: function updateInnerValue(updateValue) {
11592
+ this.innerValue = updateValue;
11574
11593
  }
11575
11594
  },
11576
11595
  render: function render() {
@@ -11639,6 +11658,8 @@ var dropdown_item_createNamespace = Object(utils["b" /* createNamespace */])('dr
11639
11658
  _this3.$emit('input', option.value);
11640
11659
 
11641
11660
  _this3.$emit('change', option.value);
11661
+
11662
+ _this3.$emit('item-select', option.value);
11642
11663
  }
11643
11664
  }
11644
11665
  }
@@ -19694,7 +19715,9 @@ var WatermarkImageEnum;
19694
19715
  WatermarkImageEnum[WatermarkImageEnum["POSITION_RIGHT"] = 1] = "POSITION_RIGHT";
19695
19716
  })(WatermarkImageEnum || (WatermarkImageEnum = {}));
19696
19717
 
19697
- var Point = function () {
19718
+ var Point =
19719
+ /** @class */
19720
+ function () {
19698
19721
  function Point(x, y) {
19699
19722
  this.x = x;
19700
19723
  this.y = y;
@@ -19703,7 +19726,9 @@ var Point = function () {
19703
19726
  return Point;
19704
19727
  }();
19705
19728
 
19706
- var Size = function () {
19729
+ var Size =
19730
+ /** @class */
19731
+ function () {
19707
19732
  function Size(width, height) {
19708
19733
  this.width = width;
19709
19734
  this.height = height;
@@ -19809,7 +19834,9 @@ var DEFAULT_CANVAS_SIZE = 480.0;
19809
19834
  var DEFAULT_BACKGROUND_OPACITY = 128;
19810
19835
  var LOGO_DEFAULT_PADDING = 4;
19811
19836
 
19812
- var WatermarkStyle = function () {
19837
+ var WatermarkStyle =
19838
+ /** @class */
19839
+ function () {
19813
19840
  /**
19814
19841
  * Watermark Style
19815
19842
  * @param fontName
@@ -19841,7 +19868,9 @@ var WatermarkStyle = function () {
19841
19868
  return WatermarkStyle;
19842
19869
  }();
19843
19870
 
19844
- var WatermarkImage = function () {
19871
+ var WatermarkImage =
19872
+ /** @class */
19873
+ function () {
19845
19874
  function WatermarkImage(image, width, height, position) {
19846
19875
  if (image === void 0) {
19847
19876
  image = "";
@@ -19868,7 +19897,9 @@ var WatermarkImage = function () {
19868
19897
  return WatermarkImage;
19869
19898
  }();
19870
19899
 
19871
- var Watermark = function () {
19900
+ var Watermark =
19901
+ /** @class */
19902
+ function () {
19872
19903
  /**
19873
19904
  * 水印对象,包含需要渲染的文本、图像,以及相应的style
19874
19905
  * @param content
@@ -19883,7 +19914,9 @@ var Watermark = function () {
19883
19914
  return Watermark;
19884
19915
  }();
19885
19916
 
19886
- var WatermarkContext = function () {
19917
+ var WatermarkContext =
19918
+ /** @class */
19919
+ function () {
19887
19920
  /**
19888
19921
  * 打水印需要的环境信息
19889
19922
  * @param address
@@ -19906,7 +19939,9 @@ var WatermarkContext = function () {
19906
19939
 
19907
19940
 
19908
19941
 
19909
- var WatermarkOptions = function () {
19942
+ var WatermarkOptions =
19943
+ /** @class */
19944
+ function () {
19910
19945
  /**
19911
19946
  * 水印配置项
19912
19947
  * @param enabled, 是否开启水印
@@ -20072,7 +20107,9 @@ function parseWatermarkStyle(styleString, canvasSize) {
20072
20107
  */
20073
20108
 
20074
20109
 
20075
- var watermark_TextScanner = function () {
20110
+ var watermark_TextScanner =
20111
+ /** @class */
20112
+ function () {
20076
20113
  /**
20077
20114
  * The content to scan
20078
20115
  * @param text
@@ -20290,7 +20327,9 @@ function parseWatermarks(watermarkConfigString, canvasSize, watermarkContext) {
20290
20327
  */
20291
20328
 
20292
20329
 
20293
- var Tile = function () {
20330
+ var Tile =
20331
+ /** @class */
20332
+ function () {
20294
20333
  function Tile(origin, size, lineHeight, lineWidths, lines, style, watermarkImage) {
20295
20334
  this.origin = origin;
20296
20335
  this.size = size;
@@ -21178,7 +21217,9 @@ var DEFAULT_JPEG_QUALITY = 0.8;
21178
21217
  var MIN_JPEG_QUALITY = 0.1;
21179
21218
  var JPEG_QUALITY_STEP = 0.05;
21180
21219
 
21181
- var image_processor_ResizeOptions = function () {
21220
+ var image_processor_ResizeOptions =
21221
+ /** @class */
21222
+ function () {
21182
21223
  function ResizeOptions(maxSideLength) {
21183
21224
  if (checkIsUndefinedOrNull(maxSideLength)) {
21184
21225
  this.maxSideLength = MAX_SIDE_LENGTH;
@@ -21198,7 +21239,9 @@ var image_processor_ResizeOptions = function () {
21198
21239
 
21199
21240
 
21200
21241
 
21201
- var image_processor_CompressOptions = function () {
21242
+ var image_processor_CompressOptions =
21243
+ /** @class */
21244
+ function () {
21202
21245
  function CompressOptions(photoFileSizeLimit) {
21203
21246
  if (checkIsUndefinedOrNull(photoFileSizeLimit)) {
21204
21247
  this.photoFileSizeLimit = PHOTO_FILE_SIZE_LIMIT;
@@ -21212,7 +21255,9 @@ var image_processor_CompressOptions = function () {
21212
21255
 
21213
21256
 
21214
21257
 
21215
- var image_processor_ImageProcessor = function () {
21258
+ var image_processor_ImageProcessor =
21259
+ /** @class */
21260
+ function () {
21216
21261
  function ImageProcessor(file, resizeOptions, watermarkOptions, compressOptions) {
21217
21262
  this.file = file;
21218
21263
  this.resizeOptions = resizeOptions;
@@ -26553,11 +26598,13 @@ var TEXT_STATUS = ['pulling', 'loosing', 'success'];
26553
26598
  },
26554
26599
  scrollEl: function scrollEl() {
26555
26600
  if (this.scrollElement) {
26556
- if (this.scrollElement) {
26557
- return getTargetDom(this.scrollElement);
26558
- }
26601
+ var targetDom = getTargetDom(this.scrollElement);
26559
26602
 
26560
- return this.scrollElement();
26603
+ if (targetDom) {
26604
+ return targetDom;
26605
+ } else {
26606
+ console.warn('请检查props scroll-element元素是否存在!');
26607
+ }
26561
26608
  }
26562
26609
 
26563
26610
  return getScroller(this.$el);
@@ -30733,7 +30780,7 @@ var uploader_createNamespace = Object(utils["b" /* createNamespace */])('uploade
30733
30780
 
30734
30781
 
30735
30782
 
30736
- var version = '2.0.79';
30783
+ var version = '2.0.80-beta.2';
30737
30784
 
30738
30785
  function install(Vue) {
30739
30786
  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, es_step, stepper, es_steps, es_sticky, swipe, swipe_cell, swipe_item, es_switch, switch_cell, tab, tabbar, tabbar_item, table, tabs, es_tag, timeline, es_toast, uploader];