bkui-vue 2.0.2-beta.22 → 2.0.2-beta.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.
@@ -13,6 +13,7 @@ import "../button/button.less";
13
13
  import * as __WEBPACK_EXTERNAL_MODULE_js_calendar_b62d9a01__ from "js-calendar";
14
14
  import * as __WEBPACK_EXTERNAL_MODULE_date_fns_f4130be9__ from "date-fns";
15
15
  import * as __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__ from "lodash/debounce";
16
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash_cloneDeep_13f2b125__ from "lodash/cloneDeep";
16
17
  /******/ var __webpack_modules__ = ({
17
18
 
18
19
  /***/ 205:
@@ -2792,7 +2793,7 @@ var formatDateLabels = function () {
2792
2793
  }();
2793
2794
  var clearHours = function clearHours(time) {
2794
2795
  var cloneDate = new Date(time);
2795
- cloneDate.setHours(0, 0, 0, 0);
2796
+ cloneDate.setHours(23, 59, 59, 999);
2796
2797
  return cloneDate.getTime();
2797
2798
  };
2798
2799
  var isInRange = function isInRange(time, a, b) {
@@ -2813,31 +2814,20 @@ var isInRange = function isInRange(time, a, b) {
2813
2814
  end = _sort2[1];
2814
2815
  return time >= start && time <= end;
2815
2816
  };
2816
- /**
2817
- * firstUpperCase
2818
- *
2819
- * @param {string} str str
2820
- *
2821
- * @return {string} str
2822
- */
2823
- function firstUpperCase(str) {
2817
+ var firstUpperCase = function firstUpperCase(str) {
2824
2818
  return str.toString()[0].toUpperCase() + str.toString().slice(1);
2825
- }
2819
+ };
2826
2820
  /**
2827
2821
  * 根据 date 设置 h, m, s
2828
- *
2829
- * @param {Date} date date 对象
2830
- * @param {number} h 小时数
2831
- * @param {number} m 分钟数
2832
- * @param {number} s 秒数
2833
- *
2834
- * @return {Date} date 对象
2822
+ * @param date Date对象
2823
+ * @param hms [小时数,分钟数,秒数]
2835
2824
  */
2836
2825
  var mergeDateHMS = function mergeDateHMS(date) {
2826
+ var hms = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [0, 0, 0];
2837
2827
  var newDate = new Date(date.getTime());
2838
- newDate.setHours(arguments.length <= 1 ? undefined : arguments[1]);
2839
- newDate.setMinutes(arguments.length <= 2 ? undefined : arguments[2]);
2840
- newDate.setSeconds(arguments.length <= 3 ? undefined : arguments[3]);
2828
+ newDate.setHours(hms[0]);
2829
+ newDate.setMinutes(hms[1]);
2830
+ newDate.setSeconds(hms[2] - 1);
2841
2831
  return newDate;
2842
2832
  };
2843
2833
  var capitalize = function capitalize(str) {
@@ -4021,10 +4011,15 @@ var timeParts = ['hours', 'minutes', 'seconds'];
4021
4011
  })])]), [[external_vue_.vShow, this.showSeconds]])]);
4022
4012
  }
4023
4013
  }));
4014
+ ;// external "lodash/cloneDeep"
4015
+ var cloneDeep_x = (y) => {
4016
+ var x = {}; __webpack_require__.d(x, y); return x
4017
+ }
4018
+ var cloneDeep_y = (x) => (() => (x))
4019
+ const cloneDeep_namespaceObject = cloneDeep_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_cloneDeep_13f2b125__["default"]) });
4024
4020
  ;// ../../packages/date-picker/src/panel/time.tsx
4025
4021
 
4026
4022
 
4027
-
4028
4023
  function time_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4029
4024
  function time_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? time_ownKeys(Object(t), !0).forEach(function (r) { (0,defineProperty["default"])(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : time_ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4030
4025
  /*
@@ -4059,6 +4054,7 @@ function time_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var
4059
4054
 
4060
4055
 
4061
4056
 
4057
+
4062
4058
  var timeProps = {
4063
4059
  disabledDate: {
4064
4060
  type: Function,
@@ -4122,7 +4118,7 @@ var timeProps = {
4122
4118
  var showSeconds = (0,external_vue_.computed)(function () {
4123
4119
  return !(props.format || '').match(/mm$/);
4124
4120
  });
4125
- var timeSlots = (0,external_vue_.computed)(function () {
4121
+ var localTimeValues = (0,external_vue_.computed)(function () {
4126
4122
  if (!props.value[0]) {
4127
4123
  return [];
4128
4124
  }
@@ -4141,28 +4137,25 @@ var timeProps = {
4141
4137
  }, {});
4142
4138
  return _disabled;
4143
4139
  }
4144
- var slots = [24, 60, 60];
4140
+ var HMSMax = [24, 60, 60];
4145
4141
  var disabled = ['Hours', 'Minutes', 'Seconds'].map(function (type) {
4146
- return props["disabled".concat(type)];
4142
+ return (0,cloneDeep_namespaceObject["default"])(props["disabled".concat(type)]);
4147
4143
  });
4148
- var disabledHMS = disabled.map(function (preDisabled, j) {
4149
- var slot = slots[j];
4150
- var toDisable = preDisabled;
4151
- var _loop = function _loop(i) {
4152
- var hms = timeSlots.value.map(function (slot, x) {
4153
- return x === j ? i : slot;
4144
+ var disabledHMS = disabled.map(function (currentDisable, disableIndex) {
4145
+ var itemMax = HMSMax[disableIndex];
4146
+ var _loop = function _loop(itemIndex) {
4147
+ var hms = localTimeValues.value.map(function (value, index) {
4148
+ return index === disableIndex ? itemIndex : value;
4154
4149
  });
4155
- var testDateTime = mergeDateHMS.apply(void 0, [state.date].concat((0,toConsumableArray["default"])(hms)));
4156
- if (props.disabledDate(testDateTime, true)) {
4157
- toDisable.push(i);
4150
+ var testDateTime = mergeDateHMS(state.date, hms);
4151
+ if (props.disabledDate(testDateTime)) {
4152
+ currentDisable.push(itemIndex);
4158
4153
  }
4159
4154
  };
4160
- for (var i = 0; i < slot; i += props.steps[j] || 1) {
4161
- _loop(i);
4155
+ for (var itemIndex = 0; itemIndex < itemMax; itemIndex += props.steps[disableIndex] || 1) {
4156
+ _loop(itemIndex);
4162
4157
  }
4163
- return toDisable.filter(function (el, i, arr) {
4164
- return arr.indexOf(el) === i;
4165
- });
4158
+ return currentDisable;
4166
4159
  });
4167
4160
  return disabledTypes.reduce(function (obj, type, i) {
4168
4161
  obj[type] = disabledHMS[i];
@@ -4204,7 +4197,7 @@ var timeProps = {
4204
4197
  return time_objectSpread(time_objectSpread({}, (0,external_vue_.toRefs)(state)), {}, {
4205
4198
  visibleDate: visibleDate,
4206
4199
  showSeconds: showSeconds,
4207
- timeSlots: timeSlots,
4200
+ localTimeValues: localTimeValues,
4208
4201
  disabledHMS: disabledHMS,
4209
4202
  timeSpinnerRef: timeSpinnerRef,
4210
4203
  handlePickClick: handlePickClick,
@@ -4233,9 +4226,9 @@ var timeProps = {
4233
4226
  "disabledMinutes": this.disabledHMS.disabledMinutes,
4234
4227
  "disabledSeconds": this.disabledHMS.disabledSeconds,
4235
4228
  "hideDisabledOptions": this.hideDisabledOptions,
4236
- "hours": this.timeSlots[0],
4237
- "minutes": this.timeSlots[1],
4238
- "seconds": this.timeSlots[2],
4229
+ "hours": this.localTimeValues[0],
4230
+ "minutes": this.localTimeValues[1],
4231
+ "seconds": this.localTimeValues[2],
4239
4232
  "showSeconds": this.showSeconds,
4240
4233
  "steps": this.steps,
4241
4234
  "onChange": this.handleChange,
@@ -188,7 +188,7 @@ declare const _default: import("vue").DefineComponent<{
188
188
  }, {
189
189
  visibleDate: import("vue").Ref<any>;
190
190
  showSeconds: import("vue").ComputedRef<boolean>;
191
- timeSlots: import("vue").ComputedRef<any[]>;
191
+ localTimeValues: import("vue").ComputedRef<number[]>;
192
192
  disabledHMS: import("vue").ComputedRef<IDisabledHMS>;
193
193
  timeSpinnerRef: import("vue").Ref<any>;
194
194
  handlePickClick: () => void;
@@ -103,23 +103,11 @@ export declare const formatDateLabels: (locale: any, format: any, date: any) =>
103
103
  };
104
104
  export declare const clearHours: (time: any) => number;
105
105
  export declare const isInRange: (time: any, a: any, b: any) => boolean;
106
- /**
107
- * firstUpperCase
108
- *
109
- * @param {string} str str
110
- *
111
- * @return {string} str
112
- */
113
- export declare function firstUpperCase(str: any): any;
106
+ export declare const firstUpperCase: (str: string) => string;
114
107
  /**
115
108
  * 根据 date 设置 h, m, s
116
- *
117
- * @param {Date} date date 对象
118
- * @param {number} h 小时数
119
- * @param {number} m 分钟数
120
- * @param {number} s 秒数
121
- *
122
- * @return {Date} date 对象
109
+ * @param date Date对象
110
+ * @param hms [小时数,分钟数,秒数]
123
111
  */
124
- export declare const mergeDateHMS: (date: any, ...hms: any[]) => Date;
125
- export declare const capitalize: (str: any) => any;
112
+ export declare const mergeDateHMS: (date: Date, hms?: number[]) => Date;
113
+ export declare const capitalize: (str: string) => string;
package/lib/index.js CHANGED
@@ -3,5 +3,5 @@ export * from './hooks';
3
3
  export { default } from './preset';
4
4
  export * from './config-provider';
5
5
  export * from './directives';
6
- export const version = "2.0.2-beta.22";
6
+ export const version = "2.0.2-beta.24";
7
7
  window.__bkui_vue_version__ = version;
@@ -3587,9 +3587,9 @@ function input_objectSpread(e) { for (var r = 1; r < arguments.length; r++) { va
3587
3587
  function clearInput() {
3588
3588
  if (!inputRef.value) return;
3589
3589
  keyword.value = '';
3590
- (0,external_vue_namespaceObject.nextTick)(function () {
3590
+ setTimeout(function () {
3591
3591
  return inputRef.value.innerText = '';
3592
- });
3592
+ }, 16);
3593
3593
  }
3594
3594
  function str2SelectedItem(str) {
3595
3595
  var _str$split = str.split(':'),
@@ -658,7 +658,9 @@ sliderProps.width["default"] = '400';
658
658
  "class": "".concat(resolveClassName('sideslider-header'))
659
659
  }, [(0,external_vue_namespaceObject.createVNode)("div", {
660
660
  "class": "".concat(resolveClassName('sideslider-close')),
661
- "onClick": handleClose
661
+ "onClick": function onClick() {
662
+ return void handleClose();
663
+ }
662
664
  }, [props.direction === 'left' ? (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.AngleLeft, null, null) : (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.AngleRight, null, null)]), (0,external_vue_namespaceObject.createVNode)("div", {
663
665
  "class": "".concat(resolveClassName('sideslider-title'))
664
666
  }, [(_slots$header = (_slots$header2 = slots.header) === null || _slots$header2 === void 0 ? void 0 : _slots$header2.call(slots)) !== null && _slots$header !== void 0 ? _slots$header : props.title])])]);