zartui 2.0.90 → 2.0.91

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/lib/zart.js CHANGED
@@ -159,7 +159,7 @@ function createBEM(name) {
159
159
  };
160
160
  }
161
161
  // EXTERNAL MODULE: ./es/locale/index.js + 2 modules
162
- var locale = __webpack_require__(8);
162
+ var locale = __webpack_require__(9);
163
163
 
164
164
  // EXTERNAL MODULE: ./es/utils/format/string.js
165
165
  var string = __webpack_require__(5);
@@ -584,197 +584,6 @@ function isNaN(val) {
584
584
 
585
585
  /***/ }),
586
586
  /* 8 */
587
- /***/ (function(module, __webpack_exports__, __webpack_require__) {
588
-
589
- "use strict";
590
-
591
- // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
592
- var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(3);
593
- var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
594
-
595
- // EXTERNAL MODULE: ./es/utils/index.js + 5 modules
596
- var utils = __webpack_require__(0);
597
-
598
- // CONCATENATED MODULE: ./es/utils/deep-assign.js
599
-
600
- var deep_assign_hasOwnProperty = Object.prototype.hasOwnProperty;
601
-
602
- function assignKey(to, from, key) {
603
- var val = from[key];
604
-
605
- if (!Object(utils["e" /* isDef */])(val)) {
606
- return;
607
- }
608
-
609
- if (!deep_assign_hasOwnProperty.call(to, key) || !Object(utils["g" /* isObject */])(val)) {
610
- to[key] = val;
611
- } else {
612
- // eslint-disable-next-line @typescript-eslint/no-use-before-define
613
- to[key] = deepAssign(Object(to[key]), from[key]);
614
- }
615
- }
616
-
617
- function deepAssign(to, from) {
618
- Object.keys(from).forEach(function (key) {
619
- assignKey(to, from, key);
620
- });
621
- return to;
622
- }
623
- // CONCATENATED MODULE: ./es/locale/lang/zh-CN.js
624
- /* harmony default export */ var zh_CN = ({
625
- name: '姓名',
626
- tel: '电话',
627
- save: '保存',
628
- confirm: '确认',
629
- cancel: '取消',
630
- delete: '删除',
631
- complete: '完成',
632
- loading: '加载中...',
633
- telEmpty: '请填写电话',
634
- nameEmpty: '请填写姓名',
635
- nameInvalid: '请输入正确的姓名',
636
- confirmDelete: '确定要删除吗',
637
- telInvalid: '请输入正确的手机号',
638
- ztDateTimePicker: {
639
- year: '年',
640
- month: '月',
641
- day: '日',
642
- hour: '时',
643
- minute: '分'
644
- },
645
- ztCalendar: {
646
- end: '结束',
647
- start: '开始',
648
- title: '日期选择',
649
- confirm: '确定',
650
- startEnd: '开始/结束',
651
- weekdays: ['日', '一', '二', '三', '四', '五', '六'],
652
- monthTitle: function monthTitle(year, month) {
653
- return year + "\u5E74" + month + "\u6708";
654
- },
655
- rangePrompt: function rangePrompt(maxRange) {
656
- return "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 " + maxRange + " \u5929";
657
- }
658
- },
659
- vanCascader: {
660
- select: '请选择'
661
- },
662
- vanContactCard: {
663
- addText: '添加联系人'
664
- },
665
- vanContactList: {
666
- addText: '新建联系人'
667
- },
668
- vanPagination: {
669
- prev: '上一页',
670
- next: '下一页'
671
- },
672
- vanPullRefresh: {
673
- pulling: '下拉即可刷新...',
674
- loosing: '释放即可刷新...'
675
- },
676
- ztSubmitBar: {
677
- label: '合计:'
678
- },
679
- vanCoupon: {
680
- unlimited: '无使用门槛',
681
- discount: function discount(_discount) {
682
- return _discount + "\u6298";
683
- },
684
- condition: function condition(_condition) {
685
- return "\u6EE1" + _condition + "\u5143\u53EF\u7528";
686
- }
687
- },
688
- vanCouponCell: {
689
- title: '优惠券',
690
- tips: '暂无可用',
691
- count: function count(_count) {
692
- return _count + "\u5F20\u53EF\u7528";
693
- }
694
- },
695
- vanCouponList: {
696
- empty: '暂无优惠券',
697
- exchange: '兑换',
698
- close: '不使用优惠券',
699
- enable: '可用',
700
- disabled: '不可用',
701
- placeholder: '请输入优惠码'
702
- },
703
- vanAddressEdit: {
704
- area: '地区',
705
- postal: '邮政编码',
706
- areaEmpty: '请选择地区',
707
- addressEmpty: '请填写详细地址',
708
- postalEmpty: '邮政编码格式不正确',
709
- defaultAddress: '设为默认收货地址',
710
- telPlaceholder: '收货人手机号',
711
- namePlaceholder: '收货人姓名',
712
- areaPlaceholder: '选择省 / 市 / 区'
713
- },
714
- vanAddressEditDetail: {
715
- label: '详细地址',
716
- placeholder: '街道门牌、楼层房间号等信息'
717
- },
718
- vanAddressList: {
719
- add: '新增地址'
720
- },
721
- ztAvatar: {
722
- defaultSrc: "https://zartui.egova.com.cn/static/head_shot.png",
723
- small: "small",
724
- medium: "medium",
725
- large: "large",
726
- square: "square",
727
- circle: "circle",
728
- defaultText: "头像"
729
- },
730
- ztSearch: {
731
- search: '搜索'
732
- },
733
- ztEmpty: {
734
- notSearchResult: '没有搜索结果',
735
- notFound: '页面无法访问',
736
- developing: '项目建设中',
737
- error: '通用错误',
738
- notRight: '您暂未拥有访问权限'
739
- },
740
- ztSignature: {
741
- hint: '请在此签名',
742
- browserUnsupported: '对不起,当前浏览器不支持Canvas,无法使用本控件!',
743
- screenSizeChangeTip: '旋转屏幕或者改变屏幕大小触发重新绘制',
744
- reSign: '重签'
745
- }
746
- });
747
- // CONCATENATED MODULE: ./es/locale/index.js
748
-
749
-
750
-
751
- var proto = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype;
752
- var defineReactive = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.util.defineReactive;
753
- defineReactive(proto, '$zartLang', 'zh-CN');
754
- defineReactive(proto, '$zartMessages', {
755
- 'zh-CN': zh_CN
756
- });
757
- /* harmony default export */ var locale = __webpack_exports__["a"] = ({
758
- messages: function messages() {
759
- return proto.$zartMessages[proto.$zartLang];
760
- },
761
- use: function use(lang, messages) {
762
- var _this$add;
763
-
764
- proto.$zartLang = lang;
765
- this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
766
- },
767
- add: function add(messages) {
768
- if (messages === void 0) {
769
- messages = {};
770
- }
771
-
772
- deepAssign(proto.$zartMessages, messages);
773
- }
774
- });
775
-
776
- /***/ }),
777
- /* 9 */
778
587
  /***/ (function(module, exports, __webpack_require__) {
779
588
 
780
589
  !function (t, e) {
@@ -1104,15 +913,206 @@ defineReactive(proto, '$zartMessages', {
1104
913
  }(),
1105
914
  T = _.prototype;
1106
915
 
1107
- return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
1108
- T[t[1]] = function (e) {
1109
- return this.$g(e, t[0], t[1]);
1110
- };
1111
- }), w.extend = function (t, e) {
1112
- return t.$i || (t(e, _, w), t.$i = !0), w;
1113
- }, w.locale = S, w.isDayjs = p, w.unix = function (t) {
1114
- return w(1e3 * t);
1115
- }, w.en = D[g], w.Ls = D, w.p = {}, w;
916
+ return w.prototype = T, [["$ms", r], ["$s", i], ["$m", s], ["$H", u], ["$W", a], ["$M", f], ["$y", c], ["$D", d]].forEach(function (t) {
917
+ T[t[1]] = function (e) {
918
+ return this.$g(e, t[0], t[1]);
919
+ };
920
+ }), w.extend = function (t, e) {
921
+ return t.$i || (t(e, _, w), t.$i = !0), w;
922
+ }, w.locale = S, w.isDayjs = p, w.unix = function (t) {
923
+ return w(1e3 * t);
924
+ }, w.en = D[g], w.Ls = D, w.p = {}, w;
925
+ });
926
+
927
+ /***/ }),
928
+ /* 9 */
929
+ /***/ (function(module, __webpack_exports__, __webpack_require__) {
930
+
931
+ "use strict";
932
+
933
+ // EXTERNAL MODULE: external {"root":"Vue","commonjs":"vue","commonjs2":"vue","amd":"vue"}
934
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_ = __webpack_require__(3);
935
+ var external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default = /*#__PURE__*/__webpack_require__.n(external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_);
936
+
937
+ // EXTERNAL MODULE: ./es/utils/index.js + 5 modules
938
+ var utils = __webpack_require__(0);
939
+
940
+ // CONCATENATED MODULE: ./es/utils/deep-assign.js
941
+
942
+ var deep_assign_hasOwnProperty = Object.prototype.hasOwnProperty;
943
+
944
+ function assignKey(to, from, key) {
945
+ var val = from[key];
946
+
947
+ if (!Object(utils["e" /* isDef */])(val)) {
948
+ return;
949
+ }
950
+
951
+ if (!deep_assign_hasOwnProperty.call(to, key) || !Object(utils["g" /* isObject */])(val)) {
952
+ to[key] = val;
953
+ } else {
954
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
955
+ to[key] = deepAssign(Object(to[key]), from[key]);
956
+ }
957
+ }
958
+
959
+ function deepAssign(to, from) {
960
+ Object.keys(from).forEach(function (key) {
961
+ assignKey(to, from, key);
962
+ });
963
+ return to;
964
+ }
965
+ // CONCATENATED MODULE: ./es/locale/lang/zh-CN.js
966
+ /* harmony default export */ var zh_CN = ({
967
+ name: '姓名',
968
+ tel: '电话',
969
+ save: '保存',
970
+ confirm: '确认',
971
+ cancel: '取消',
972
+ delete: '删除',
973
+ complete: '完成',
974
+ loading: '加载中...',
975
+ telEmpty: '请填写电话',
976
+ nameEmpty: '请填写姓名',
977
+ nameInvalid: '请输入正确的姓名',
978
+ confirmDelete: '确定要删除吗',
979
+ telInvalid: '请输入正确的手机号',
980
+ ztDateTimePicker: {
981
+ year: '年',
982
+ month: '月',
983
+ day: '日',
984
+ hour: '时',
985
+ minute: '分'
986
+ },
987
+ ztCalendar: {
988
+ end: '结束',
989
+ start: '开始',
990
+ title: '日期选择',
991
+ confirm: '确定',
992
+ startEnd: '开始/结束',
993
+ weekdays: ['日', '一', '二', '三', '四', '五', '六'],
994
+ monthTitle: function monthTitle(year, month) {
995
+ return year + "\u5E74" + month + "\u6708";
996
+ },
997
+ rangePrompt: function rangePrompt(maxRange) {
998
+ return "\u9009\u62E9\u5929\u6570\u4E0D\u80FD\u8D85\u8FC7 " + maxRange + " \u5929";
999
+ }
1000
+ },
1001
+ vanCascader: {
1002
+ select: '请选择'
1003
+ },
1004
+ vanContactCard: {
1005
+ addText: '添加联系人'
1006
+ },
1007
+ vanContactList: {
1008
+ addText: '新建联系人'
1009
+ },
1010
+ vanPagination: {
1011
+ prev: '上一页',
1012
+ next: '下一页'
1013
+ },
1014
+ vanPullRefresh: {
1015
+ pulling: '下拉即可刷新...',
1016
+ loosing: '释放即可刷新...'
1017
+ },
1018
+ ztSubmitBar: {
1019
+ label: '合计:'
1020
+ },
1021
+ vanCoupon: {
1022
+ unlimited: '无使用门槛',
1023
+ discount: function discount(_discount) {
1024
+ return _discount + "\u6298";
1025
+ },
1026
+ condition: function condition(_condition) {
1027
+ return "\u6EE1" + _condition + "\u5143\u53EF\u7528";
1028
+ }
1029
+ },
1030
+ vanCouponCell: {
1031
+ title: '优惠券',
1032
+ tips: '暂无可用',
1033
+ count: function count(_count) {
1034
+ return _count + "\u5F20\u53EF\u7528";
1035
+ }
1036
+ },
1037
+ vanCouponList: {
1038
+ empty: '暂无优惠券',
1039
+ exchange: '兑换',
1040
+ close: '不使用优惠券',
1041
+ enable: '可用',
1042
+ disabled: '不可用',
1043
+ placeholder: '请输入优惠码'
1044
+ },
1045
+ vanAddressEdit: {
1046
+ area: '地区',
1047
+ postal: '邮政编码',
1048
+ areaEmpty: '请选择地区',
1049
+ addressEmpty: '请填写详细地址',
1050
+ postalEmpty: '邮政编码格式不正确',
1051
+ defaultAddress: '设为默认收货地址',
1052
+ telPlaceholder: '收货人手机号',
1053
+ namePlaceholder: '收货人姓名',
1054
+ areaPlaceholder: '选择省 / 市 / 区'
1055
+ },
1056
+ vanAddressEditDetail: {
1057
+ label: '详细地址',
1058
+ placeholder: '街道门牌、楼层房间号等信息'
1059
+ },
1060
+ vanAddressList: {
1061
+ add: '新增地址'
1062
+ },
1063
+ ztAvatar: {
1064
+ defaultSrc: "https://zartui.egova.com.cn/static/head_shot.png",
1065
+ small: "small",
1066
+ medium: "medium",
1067
+ large: "large",
1068
+ square: "square",
1069
+ circle: "circle",
1070
+ defaultText: "头像"
1071
+ },
1072
+ ztSearch: {
1073
+ search: '搜索'
1074
+ },
1075
+ ztEmpty: {
1076
+ notSearchResult: '没有搜索结果',
1077
+ notFound: '页面无法访问',
1078
+ developing: '项目建设中',
1079
+ error: '通用错误',
1080
+ notRight: '您暂未拥有访问权限'
1081
+ },
1082
+ ztSignature: {
1083
+ hint: '请在此签名',
1084
+ browserUnsupported: '对不起,当前浏览器不支持Canvas,无法使用本控件!',
1085
+ screenSizeChangeTip: '旋转屏幕或者改变屏幕大小触发重新绘制',
1086
+ reSign: '重签'
1087
+ }
1088
+ });
1089
+ // CONCATENATED MODULE: ./es/locale/index.js
1090
+
1091
+
1092
+
1093
+ var proto = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.prototype;
1094
+ var defineReactive = external_root_Vue_commonjs_vue_commonjs2_vue_amd_vue_default.a.util.defineReactive;
1095
+ defineReactive(proto, '$zartLang', 'zh-CN');
1096
+ defineReactive(proto, '$zartMessages', {
1097
+ 'zh-CN': zh_CN
1098
+ });
1099
+ /* harmony default export */ var locale = __webpack_exports__["a"] = ({
1100
+ messages: function messages() {
1101
+ return proto.$zartMessages[proto.$zartLang];
1102
+ },
1103
+ use: function use(lang, messages) {
1104
+ var _this$add;
1105
+
1106
+ proto.$zartLang = lang;
1107
+ this.add((_this$add = {}, _this$add[lang] = messages, _this$add));
1108
+ },
1109
+ add: function add(messages) {
1110
+ if (messages === void 0) {
1111
+ messages = {};
1112
+ }
1113
+
1114
+ deepAssign(proto.$zartMessages, messages);
1115
+ }
1116
1116
  });
1117
1117
 
1118
1118
  /***/ }),
@@ -1143,7 +1143,7 @@ module.exports = g;
1143
1143
  /***/ (function(module, exports, __webpack_require__) {
1144
1144
 
1145
1145
  !function (e, _) {
1146
- true ? module.exports = _(__webpack_require__(9)) : undefined;
1146
+ true ? module.exports = _(__webpack_require__(8)) : undefined;
1147
1147
  }(this, function (e) {
1148
1148
  "use strict";
1149
1149
 
@@ -4250,6 +4250,10 @@ var picker_createNamespace = Object(utils["b" /* createNamespace */])('picker'),
4250
4250
  valueKey: {
4251
4251
  type: String,
4252
4252
  default: 'text'
4253
+ },
4254
+ popup: {
4255
+ type: Boolean,
4256
+ default: true
4253
4257
  }
4254
4258
  }),
4255
4259
  data: function data() {
@@ -4512,6 +4516,15 @@ var picker_createNamespace = Object(utils["b" /* createNamespace */])('picker'),
4512
4516
  });
4513
4517
  this.emit('confirm');
4514
4518
  },
4519
+ // @exposed-api
4520
+ pureRecordConfirmIndex: function pureRecordConfirmIndex() {
4521
+ this.children.forEach(function (child) {
4522
+ return child.stopMomentum();
4523
+ });
4524
+ this.children.forEach(function (child) {
4525
+ return child.recordConfirmIndex();
4526
+ });
4527
+ },
4515
4528
  cancel: function cancel() {
4516
4529
  this.$emit('update:showPicker', false);
4517
4530
  this.emit('cancel');
@@ -4645,26 +4658,36 @@ var picker_createNamespace = Object(utils["b" /* createNamespace */])('picker'),
4645
4658
  }
4646
4659
  },
4647
4660
  render: function render(h) {
4648
- return h(popup, {
4649
- "attrs": {
4650
- "value": this.showPicker,
4651
- "round": true,
4652
- "position": "bottom",
4653
- "closeOnPopstate": this.closeOnPopstate,
4654
- "closeOnClickOverlay": this.closeOnClickOverlay,
4655
- "customOnClickOverlay": this.onClickOverlay,
4656
- "getContainer": this.getContainer
4657
- }
4658
- }, [h("div", {
4659
- "class": picker_bem(),
4660
- "ref": 'columnParent'
4661
- }, [this.toolbarPosition === 'top' ? this.genToolbar() : h(), this.toolbarPosition === 'top' ? h() : this.genTitle(), this.toolbarPosition === 'top' ? h("div", {
4662
- "class": picker_bem('border')
4663
- }) : h(), this.loading ? h(es_loading, {
4664
- "class": picker_bem('loading')
4665
- }) : h(), this.slots('columns-top'), this.headers && this.headers.length > 0 ? this.genHeaders() : h(), this.headers && this.headers.length > 0 ? h("div", {
4666
- "class": picker_bem('border')
4667
- }) : h(), this.genColumns(), this.slots('columns-bottom'), this.toolbarPosition === 'bottom' ? this.genToolbar() : h()])]);
4661
+ var _this7 = this;
4662
+
4663
+ var renderPicker = function renderPicker() {
4664
+ return h("div", {
4665
+ "class": picker_bem(),
4666
+ "ref": "columnParent"
4667
+ }, [_this7.toolbarPosition === 'top' ? _this7.genToolbar() : h(), _this7.toolbarPosition === 'top' ? h() : _this7.genTitle(), _this7.toolbarPosition === 'top' ? h("div", {
4668
+ "class": picker_bem('border')
4669
+ }) : h(), _this7.loading ? h(es_loading, {
4670
+ "class": picker_bem('loading')
4671
+ }) : h(), _this7.slots('columns-top'), _this7.headers && _this7.headers.length > 0 ? _this7.genHeaders() : h(), _this7.headers && _this7.headers.length > 0 ? h("div", {
4672
+ "class": picker_bem('border')
4673
+ }) : h(), _this7.genColumns(), _this7.slots('columns-bottom'), _this7.toolbarPosition === 'bottom' ? _this7.genToolbar() : h()]);
4674
+ };
4675
+
4676
+ if (this.popup) {
4677
+ return h(popup, {
4678
+ "attrs": {
4679
+ "value": this.showPicker,
4680
+ "round": true,
4681
+ "position": "bottom",
4682
+ "closeOnPopstate": this.closeOnPopstate,
4683
+ "closeOnClickOverlay": this.closeOnClickOverlay,
4684
+ "customOnClickOverlay": this.onClickOverlay,
4685
+ "getContainer": this.getContainer
4686
+ }
4687
+ }, [renderPicker()]);
4688
+ }
4689
+
4690
+ return renderPicker();
4668
4691
  }
4669
4692
  }));
4670
4693
  // CONCATENATED MODULE: ./es/area/index.js
@@ -10346,6 +10369,10 @@ var sharedProps = _extends({}, pickerProps, {
10346
10369
  default: function _default(type, value) {
10347
10370
  return value;
10348
10371
  }
10372
+ },
10373
+ showRange: {
10374
+ type: Boolean,
10375
+ default: false
10349
10376
  }
10350
10377
  });
10351
10378
  var TimePickerMixin = {
@@ -10400,12 +10427,12 @@ var TimePickerMixin = {
10400
10427
  var hour = shared_t('hour');
10401
10428
  var minute = shared_t('minute');
10402
10429
  var presetHeaders = {
10403
- 'date': [year, month, day],
10430
+ date: [year, month, day],
10404
10431
  'year-month': [year, month],
10405
10432
  'month-day': [month, day],
10406
- 'time': [hour, minute],
10407
- 'datetime': [year, month, day, hour, minute],
10408
- 'datehour': [year, month, day, hour]
10433
+ time: [hour, minute],
10434
+ datetime: [year, month, day, hour, minute],
10435
+ datehour: [year, month, day, hour]
10409
10436
  }; // console.log('type ' + this.type + ' ' + JSON.stringify(presetHeaders[this.type]))
10410
10437
 
10411
10438
  return presetHeaders[this.type] || [];
@@ -10493,6 +10520,15 @@ var TimePickerMixin = {
10493
10520
  Object.keys(pickerProps).forEach(function (key) {
10494
10521
  props[key] = _this6[key];
10495
10522
  });
10523
+
10524
+ if (this.showRange) {
10525
+ _extends(props, {
10526
+ popup: false,
10527
+ showToolbar: false,
10528
+ title: ''
10529
+ });
10530
+ }
10531
+
10496
10532
  return h(es_picker, {
10497
10533
  "attrs": {
10498
10534
  "show-picker": this.showPicker,
@@ -11787,27 +11823,332 @@ var DatePicker_createNamespace = Object(utils["b" /* createNamespace */])('date-
11787
11823
  }
11788
11824
  }
11789
11825
  }));
11826
+ // EXTERNAL MODULE: ./node_modules/dayjs/dayjs.min.js
11827
+ var dayjs_min = __webpack_require__(8);
11828
+ var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
11829
+
11790
11830
  // CONCATENATED MODULE: ./es/datetime-picker/index.js
11791
11831
 
11792
11832
 
11793
11833
 
11794
11834
 
11795
11835
 
11836
+
11837
+
11838
+
11839
+
11840
+
11796
11841
  var datetime_picker_createNamespace = Object(utils["b" /* createNamespace */])('datetime-picker'),
11797
11842
  datetime_picker_createComponent = datetime_picker_createNamespace[0],
11798
11843
  datetime_picker_bem = datetime_picker_createNamespace[1];
11799
11844
 
11845
+ var RANGE_START_PICKER = 0;
11846
+ var RANGE_END_PICKER = 1;
11800
11847
  /* harmony default export */ var datetime_picker = (datetime_picker_createComponent({
11801
- props: _extends({}, TimePicker.props, DatePicker.props),
11848
+ props: _extends({}, TimePicker.props, DatePicker.props, {
11849
+ // 是否开启时间范围选择
11850
+ range: {
11851
+ type: Boolean,
11852
+ default: false
11853
+ },
11854
+ startValue: {
11855
+ type: Date,
11856
+ default: function _default() {
11857
+ return new Date();
11858
+ },
11859
+ validator: isDate
11860
+ },
11861
+ endValue: {
11862
+ type: Date,
11863
+ default: function _default() {
11864
+ return new Date();
11865
+ },
11866
+ validator: isDate
11867
+ },
11868
+ rangeHeaderStartText: {
11869
+ type: String,
11870
+ default: '开始时间'
11871
+ },
11872
+ rangeHeaderEndText: {
11873
+ type: String,
11874
+ default: '结束时间'
11875
+ }
11876
+ }),
11877
+ data: function data() {
11878
+ return {
11879
+ rangeSelectedIndex: RANGE_START_PICKER,
11880
+ refreshComputedKey: new Date().getTime(),
11881
+ innerStartValue: this.startValue,
11882
+ innerEndValue: this.endValue,
11883
+ confirmedPopupPickerIndex: false
11884
+ };
11885
+ },
11886
+ computed: {
11887
+ currentStartText: function currentStartText() {
11888
+ return this.genOriginValueText(this.innerStartValue);
11889
+ },
11890
+ currentEndText: function currentEndText() {
11891
+ return this.genOriginValueText(this.innerEndValue);
11892
+ }
11893
+ },
11894
+ watch: {
11895
+ showPicker: function showPicker(val) {
11896
+ var _this = this; // 在第一次打开popup时,需要初始化内部picker存储的时间列index,避免初次打开直接关闭,导致picker内部index丢失
11897
+
11898
+
11899
+ if (val && !this.confirmedPopupPickerIndex) {
11900
+ // 注意这里实际上是双层nextTick,为了解决picker组件setConfirmIndex也在nextTick中执行,导致无法正确设置index的问题
11901
+ this.$nextTick(function () {
11902
+ _this.updatePickerConfirm();
11903
+
11904
+ _this.confirmedPopupPickerIndex = true;
11905
+ });
11906
+ }
11907
+ }
11908
+ },
11802
11909
  methods: {
11803
11910
  // @exposed-api
11804
11911
  getPicker: function getPicker() {
11912
+ if (this.range) {
11913
+ return [this.$refs.rangeStart.getProxiedPicker(), this.$refs.rangeEnd.getProxiedPicker()];
11914
+ }
11915
+
11805
11916
  return this.$refs.root.getProxiedPicker();
11917
+ },
11918
+ genValueText: function genValueText(dateValue, timeValue) {
11919
+ var text = '';
11920
+
11921
+ if (dateValue.length > 0) {
11922
+ text += dateValue.join('/');
11923
+ }
11924
+
11925
+ if (timeValue.length > 0) {
11926
+ text = text + ' ' + timeValue.join(':');
11927
+ }
11928
+
11929
+ return text;
11930
+ },
11931
+ genOriginValueText: function genOriginValueText(values) {
11932
+ if (!values) return '-';
11933
+ var dateTime = dayjs_min_default()(values).format('YYYY-MM-DDTHH:mm:ss');
11934
+ var dateTimeArr = dateTime.split(/[-T:]/);
11935
+ var dateValues = [];
11936
+ var timeValues = [];
11937
+
11938
+ if (this.$refs.rangeStart && this.$refs.rangeStart.originColumns) {
11939
+ this.$refs.rangeStart.originColumns.forEach(function (_ref, index) {
11940
+ var type = _ref.type;
11941
+
11942
+ if (index < dateTimeArr.length) {
11943
+ if (['year', 'month', 'day'].includes(type)) {
11944
+ dateValues.push(dateTimeArr[index]);
11945
+ } else if (['hour', 'minute', 'second'].includes(type)) {
11946
+ timeValues.push(dateTimeArr[index]);
11947
+ }
11948
+ }
11949
+ });
11950
+ return this.genValueText(dateValues, timeValues);
11951
+ }
11952
+ },
11953
+ genRangeHeader: function genRangeHeader() {
11954
+ var _this2 = this;
11955
+
11956
+ var h = this.$createElement;
11957
+ return h("div", {
11958
+ "class": datetime_picker_bem('title-tab-bar')
11959
+ }, [h("div", {
11960
+ "class": [datetime_picker_bem('title-bar', {
11961
+ selected: this.rangeSelectedIndex === RANGE_START_PICKER,
11962
+ unselected: this.rangeSelectedIndex === RANGE_END_PICKER
11963
+ })],
11964
+ "on": {
11965
+ "click": function click() {
11966
+ _this2.rangeSelectedIndex = RANGE_START_PICKER;
11967
+ }
11968
+ }
11969
+ }, [h("div", {
11970
+ "class": ['zt2-ellipsis', datetime_picker_bem('title', {
11971
+ selected: this.rangeSelectedIndex === RANGE_START_PICKER,
11972
+ unselected: this.rangeSelectedIndex === RANGE_END_PICKER
11973
+ })]
11974
+ }, [this.rangeHeaderStartText]), h("div", {
11975
+ "class": ['zt2-ellipsis', datetime_picker_bem('value')]
11976
+ }, [this.currentStartText])]), h("span", {
11977
+ "class": datetime_picker_bem('title-separator')
11978
+ }), h("div", {
11979
+ "class": [datetime_picker_bem('title-bar', {
11980
+ selected: this.rangeSelectedIndex === RANGE_END_PICKER,
11981
+ unselected: this.rangeSelectedIndex === RANGE_START_PICKER
11982
+ })],
11983
+ "on": {
11984
+ "click": function click() {
11985
+ _this2.rangeSelectedIndex = RANGE_END_PICKER;
11986
+ }
11987
+ }
11988
+ }, [h("div", {
11989
+ "class": ['zt2-ellipsis', datetime_picker_bem('title', {
11990
+ selected: this.rangeSelectedIndex === RANGE_END_PICKER,
11991
+ unselected: this.rangeSelectedIndex === RANGE_START_PICKER
11992
+ })]
11993
+ }, [this.rangeHeaderEndText]), h("div", {
11994
+ "class": ['zt2-ellipsis', datetime_picker_bem('value')]
11995
+ }, [this.currentEndText])])]);
11996
+ },
11997
+ genCancel: function genCancel() {
11998
+ var h = this.$createElement;
11999
+ return h(es_button, {
12000
+ "attrs": {
12001
+ "size": "normal",
12002
+ "block": true
12003
+ },
12004
+ "style": {
12005
+ marginRigth: '4px',
12006
+ backgroundColor: 'white'
12007
+ },
12008
+ "on": {
12009
+ "click": this.onCancel
12010
+ }
12011
+ }, [this.cancelButtonText || '取消']);
12012
+ },
12013
+ genConfirm: function genConfirm() {
12014
+ var h = this.$createElement;
12015
+ return h(es_button, {
12016
+ "attrs": {
12017
+ "type": "primary",
12018
+ "size": "normal",
12019
+ "block": true
12020
+ },
12021
+ "style": {
12022
+ marginLeft: '8px'
12023
+ },
12024
+ "on": {
12025
+ "click": this.onConfirm
12026
+ }
12027
+ }, [this.confirmButtonText || '确认']);
12028
+ },
12029
+ genToolbar: function genToolbar() {
12030
+ var h = this.$createElement;
12031
+
12032
+ if (this.showToolbar) {
12033
+ return h("div", {
12034
+ "class": datetime_picker_bem('toolbar')
12035
+ }, [[this.genCancel(), this.genConfirm()]]);
12036
+ }
12037
+ },
12038
+
12039
+ /**
12040
+ * 这里必须手动调用一次picker组件内部pureRecordConfirmIndex,保证picker组件内部confirmIndex是当前选中的时间项index
12041
+ */
12042
+ updatePickerConfirm: function updatePickerConfirm() {
12043
+ var _this3 = this;
12044
+
12045
+ this.$nextTick(function () {
12046
+ var pickers = _this3.getPicker();
12047
+
12048
+ if (Array.isArray(pickers)) {
12049
+ pickers.forEach(function (p) {
12050
+ return p.pureRecordConfirmIndex();
12051
+ });
12052
+ }
12053
+ });
12054
+ },
12055
+ checkRangeValid: function checkRangeValid() {
12056
+ return dayjs_min_default()(this.innerEndValue).isAfter(this.innerStartValue);
12057
+ },
12058
+ onConfirm: function onConfirm() {
12059
+ if (!this.checkRangeValid()) {
12060
+ es_toast('结束日期不能早于开始日期');
12061
+ return;
12062
+ }
12063
+
12064
+ this.updatePickerConfirm();
12065
+ this.$emit('update:startValue', this.innerStartValue);
12066
+ this.$emit('update:endValue', this.innerEndValue);
12067
+ this.$emit('confirm', [this.innerStartValue, this.innerEndValue]);
12068
+ },
12069
+ onCancel: function onCancel() {
12070
+ this.$emit('update:showPicker', false);
12071
+ this.$emit('cancel');
11806
12072
  }
11807
12073
  },
11808
12074
  render: function render() {
12075
+ var _this4 = this;
12076
+
11809
12077
  var h = arguments[0];
11810
12078
  var Component = this.type === 'time' ? TimePicker : DatePicker;
12079
+
12080
+ if (this.range) {
12081
+ var props = _extends({}, this.$props, {
12082
+ bem: datetime_picker_bem,
12083
+ showRange: true
12084
+ });
12085
+
12086
+ var startRangeProps = _extends({}, props, {
12087
+ value: this.startValue
12088
+ });
12089
+
12090
+ var startListener = _extends({}, this.$listeners, {
12091
+ input: function input(val) {
12092
+ _this4.innerStartValue = val;
12093
+ },
12094
+ change: function change(pickerRef) {
12095
+ _this4.$emit('startChange', pickerRef);
12096
+ }
12097
+ });
12098
+
12099
+ var endRangeProps = _extends({}, props, {
12100
+ value: this.endValue
12101
+ });
12102
+
12103
+ var endListener = _extends({}, this.$listeners, {
12104
+ input: function input(val) {
12105
+ _this4.innerEndValue = val;
12106
+ },
12107
+ change: function change(pickerRef) {
12108
+ _this4.$emit('endChange', pickerRef);
12109
+ }
12110
+ });
12111
+
12112
+ return h(popup, {
12113
+ "attrs": {
12114
+ "value": this.showPicker,
12115
+ "round": true,
12116
+ "position": "bottom"
12117
+ },
12118
+ "on": {
12119
+ "input": function input(val) {
12120
+ if (val) {
12121
+ _this4.$emit('update:showPicker', true);
12122
+ } else {
12123
+ _this4.$emit('update:showPicker', false);
12124
+ }
12125
+ }
12126
+ }
12127
+ }, [this.genRangeHeader(), h("div", {
12128
+ "class": datetime_picker_bem('range')
12129
+ }, [h(Component, {
12130
+ "ref": "rangeStart",
12131
+ "directives": [{
12132
+ name: "show",
12133
+ value: this.rangeSelectedIndex === RANGE_START_PICKER
12134
+ }],
12135
+ "class": datetime_picker_bem(),
12136
+ "scopedSlots": this.$scopedSlots,
12137
+ "props": _extends({}, startRangeProps),
12138
+ "on": _extends({}, startListener)
12139
+ }), h(Component, {
12140
+ "ref": "rangeEnd",
12141
+ "directives": [{
12142
+ name: "show",
12143
+ value: this.rangeSelectedIndex === RANGE_END_PICKER
12144
+ }],
12145
+ "class": datetime_picker_bem(),
12146
+ "scopedSlots": this.$scopedSlots,
12147
+ "props": _extends({}, endRangeProps),
12148
+ "on": _extends({}, endListener)
12149
+ })]), this.genToolbar()]);
12150
+ }
12151
+
11811
12152
  return h(Component, {
11812
12153
  "ref": "root",
11813
12154
  "class": datetime_picker_bem(),
@@ -20007,7 +20348,7 @@ var list_createNamespace = Object(utils["b" /* createNamespace */])('list'),
20007
20348
  }
20008
20349
  }));
20009
20350
  // EXTERNAL MODULE: ./es/locale/index.js + 2 modules
20010
- var locale = __webpack_require__(8);
20351
+ var locale = __webpack_require__(9);
20011
20352
 
20012
20353
  // CONCATENATED MODULE: ./es/media-picker/type.js
20013
20354
  var MediaUploadStatus;
@@ -20407,10 +20748,6 @@ function checkIsWindows() {
20407
20748
 
20408
20749
 
20409
20750
 
20410
- // EXTERNAL MODULE: ./node_modules/dayjs/dayjs.min.js
20411
- var dayjs_min = __webpack_require__(9);
20412
- var dayjs_min_default = /*#__PURE__*/__webpack_require__.n(dayjs_min);
20413
-
20414
20751
  // EXTERNAL MODULE: ./node_modules/dayjs/locale/zh-cn.js
20415
20752
  var zh_cn = __webpack_require__(11);
20416
20753