@opentiny/vue-renderless 3.6.1 → 3.6.6

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.
Files changed (49) hide show
  1. package/action-sheet/index.js +2 -1
  2. package/breadcrumb-item/vue.js +2 -11
  3. package/calendar/index.js +14 -14
  4. package/cascader-panel/node.js +1 -1
  5. package/chart-boxplot/index.js +1 -0
  6. package/chart-line/index.js +1 -1
  7. package/common/bigInt.js +10 -1
  8. package/common/date.js +2 -2
  9. package/common/deps/date.js +2 -2
  10. package/common/deps/memorize.js +3 -3
  11. package/common/deps/popper.js +41 -29
  12. package/common/deps/popup-manager.js +1 -0
  13. package/common/deps/requestAnimationFrame.js +1 -1
  14. package/common/deps/throttle.js +2 -2
  15. package/common/index.js +1 -1
  16. package/common/runtime.js +1 -1
  17. package/credit-card-form/vue.js +2 -2
  18. package/date-panel/index.js +3 -3
  19. package/date-panel/vue.js +1 -1
  20. package/date-range/index.js +6 -6
  21. package/date-range/vue.js +2 -2
  22. package/date-table/index.js +1 -1
  23. package/file-upload/vue.js +1 -0
  24. package/form-item/vue.js +1 -0
  25. package/fullscreen/vue.js +1 -0
  26. package/grid/plugins/exportExcel.js +3 -0
  27. package/grid/static/base/helperGetHGSKeys.js +4 -1
  28. package/ip-address/index.js +1 -1
  29. package/locales/index.js +1 -1
  30. package/month-range/index.js +1 -1
  31. package/month-range/vue.js +2 -2
  32. package/month-table/index.js +2 -2
  33. package/multi-select/index.js +1 -4
  34. package/multi-select/vue.js +5 -4
  35. package/package.json +1 -1
  36. package/picker/index.js +2 -2
  37. package/pull-refresh/index.js +10 -7
  38. package/pull-refresh/vue.js +7 -7
  39. package/select/vue.js +1 -0
  40. package/slider/index.js +12 -5
  41. package/tabs/index.js +1 -0
  42. package/time/index.js +1 -1
  43. package/time/vue.js +3 -3
  44. package/time-range/index.js +4 -4
  45. package/time-range/vue.js +3 -3
  46. package/toggle-menu/vue.js +1 -0
  47. package/tooltip/vue.js +1 -2
  48. package/user/index.js +2 -1
  49. package/year-table/index.js +1 -1
@@ -17,6 +17,7 @@ const setSheetStyle = ({ state, props }) => () => {
17
17
  "max-height": props.height
18
18
  };
19
19
  }
20
+ state.contentStyle = props.contentStyle ? props.contentStyle : "";
20
21
  };
21
22
  const initScrollMenu = ({ state, nextTick, refs, BScroll }) => () => {
22
23
  nextTick(() => {
@@ -24,7 +25,7 @@ const initScrollMenu = ({ state, nextTick, refs, BScroll }) => () => {
24
25
  if (!state.scroll) {
25
26
  state.scroll = new BScroll(scrollMenu, {
26
27
  probeType: 3,
27
- click: true
28
+ tap: "tap"
28
29
  });
29
30
  } else {
30
31
  state.scroll.refresh();
@@ -1,23 +1,14 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
3
2
  import { linkClick } from "./index";
4
3
  const api = ["linkClick"];
5
- const renderless = (props, { onMounted, onBeforeUnmount, inject }, { refs, router, emit }) => {
4
+ const renderless = (props, { inject }, { refs, router, emit }) => {
6
5
  const breadcrumbEmitter = inject("breadcrumbEmitter");
7
6
  const breadcrumb = inject("breadcrumb");
8
7
  const constants = breadcrumb._constants;
9
8
  const api2 = {
10
9
  linkClick: linkClick({ props, refs, router, emit, breadcrumbEmitter, constants })
11
10
  };
12
- onMounted(() => {
13
- on(refs.link, "click", api2.linkClick);
14
- });
15
- onBeforeUnmount(() => {
16
- off(refs.link, "click", api2.linkClick);
17
- });
18
- return {
19
- api: api2
20
- };
11
+ return api2;
21
12
  };
22
13
  export {
23
14
  api,
package/calendar/index.js CHANGED
@@ -2,7 +2,7 @@ import "../chunk-PKUHTIDK.js";
2
2
  import { isLeapYear } from "@opentiny/vue-renderless/common/date";
3
3
  import { copyArray } from "@opentiny/vue-renderless/common/object";
4
4
  const getDays = (year, month) => [31, isLeapYear(year) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month - 1];
5
- const getWeek = (year, month, day) => new Date(`${year}/${month}/${day}`).getDay();
5
+ const getWeek = (year, month, day) => (/* @__PURE__ */ new Date(`${year}/${month}/${day}`)).getDay();
6
6
  const lastMonth = (year, month) => {
7
7
  year = Number(year);
8
8
  month = Number(month);
@@ -133,7 +133,7 @@ const selectDay = (state) => (day) => {
133
133
  state.activeYear = year;
134
134
  }
135
135
  state.selectedTip = `You selected date: ${state.activeYear}-${state.activeMonth}-${day.value}`;
136
- state.selectedDate = Number(new Date(`${state.activeYear}/${state.activeMonth}/${day.value}`));
136
+ state.selectedDate = Number(/* @__PURE__ */ new Date(`${state.activeYear}/${state.activeMonth}/${day.value}`));
137
137
  }
138
138
  };
139
139
  const getEventByDay = (state) => (day) => {
@@ -162,9 +162,9 @@ const getEventByMonth = ({ props, state }) => (month) => {
162
162
  }
163
163
  return events;
164
164
  };
165
- const getTime = (state) => (day) => Number(new Date(`${state.activeYear}/${state.activeMonth}/${day}`));
165
+ const getTime = (state) => (day) => Number(/* @__PURE__ */ new Date(`${state.activeYear}/${state.activeMonth}/${day}`));
166
166
  const getYearList = () => () => {
167
- const date = new Date();
167
+ const date = /* @__PURE__ */ new Date();
168
168
  const year = date.getFullYear();
169
169
  const yesrs = [];
170
170
  for (let i = year - 10; i < year + 10; i++) {
@@ -173,7 +173,7 @@ const getYearList = () => () => {
173
173
  return yesrs;
174
174
  };
175
175
  const isToday = (state) => (day) => {
176
- const date = new Date();
176
+ const date = /* @__PURE__ */ new Date();
177
177
  let year = Number(state.activeYear);
178
178
  let month = Number(state.activeMonth);
179
179
  if (day.isLast) {
@@ -189,7 +189,7 @@ const isToday = (state) => (day) => {
189
189
  return date.getDate() === day.value && date.getFullYear() === year && date.getMonth() + 1 === month;
190
190
  };
191
191
  const isThisMonth = (state) => (month) => {
192
- const date = new Date();
192
+ const date = /* @__PURE__ */ new Date();
193
193
  const year = Number(state.activeYear);
194
194
  return date.getMonth() + 1 === month && date.getFullYear() === year;
195
195
  };
@@ -205,19 +205,19 @@ const genMonths = () => {
205
205
  return result;
206
206
  };
207
207
  const toToday = (state) => () => {
208
- const year = new Date().getFullYear();
209
- const month = new Date().getMonth() + 1;
210
- const day = new Date().getDate();
208
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
209
+ const month = (/* @__PURE__ */ new Date()).getMonth() + 1;
210
+ const day = (/* @__PURE__ */ new Date()).getDate();
211
211
  state.activeMonth = month;
212
212
  state.activeYear = year;
213
213
  state.selectedTip = `You selected date: ${year}-${month}-${day}`;
214
- state.selectedDate = Number(new Date(`${year}/${month}/${day}`));
214
+ state.selectedDate = Number(/* @__PURE__ */ new Date(`${year}/${month}/${day}`));
215
215
  };
216
216
  const getCurrentDate = () => {
217
- const day = new Date().getDate();
218
- const month = new Date().getMonth() + 1;
219
- const year = new Date().getFullYear();
220
- return Number(new Date(`${year}/${month}/${day}`));
217
+ const day = (/* @__PURE__ */ new Date()).getDate();
218
+ const month = (/* @__PURE__ */ new Date()).getMonth() + 1;
219
+ const year = (/* @__PURE__ */ new Date()).getFullYear();
220
+ return Number(/* @__PURE__ */ new Date(`${year}/${month}/${day}`));
221
221
  };
222
222
  export {
223
223
  computedCalendar,
@@ -24,7 +24,7 @@ class Node {
24
24
  const { config } = this;
25
25
  const childrenKey = config.children;
26
26
  const childrenData = this.data[childrenKey];
27
- this.hasChildren = Array.isArray(childrenData);
27
+ this.hasChildren = Array.isArray(childrenData) && childrenData.length > 0;
28
28
  this.children = (childrenData || []).map((child) => new Node(child, config, this));
29
29
  }
30
30
  get isLeaf() {
@@ -77,6 +77,7 @@ const getTooltip = (args) => {
77
77
  const { tooltipFormatter, tooltipLabel } = args;
78
78
  return {
79
79
  trigger: "item",
80
+ // axis item
80
81
  formatter(items) {
81
82
  if (tooltipFormatter) {
82
83
  return tooltipFormatter.apply(null, arguments);
@@ -160,7 +160,7 @@ const line = (columns, rows, settings, extra) => {
160
160
  Object.assign(seriesParam, { label, labelMap, metrics, nullAddZero, rows, xAxisType, stack, color, smooth });
161
161
  const series = getLineSeries(seriesParam);
162
162
  let options = { legend, xAxis, series, yAxis, tooltip };
163
- return options;
163
+ return __spreadValues(__spreadValues({}, options), settings);
164
164
  };
165
165
  export {
166
166
  line
package/common/bigInt.js CHANGED
@@ -42,7 +42,12 @@ function validateNumber(num) {
42
42
  if (!num) {
43
43
  return false;
44
44
  }
45
- return /^\s*-?\d+(\.\d+)?\s*$/.test(num) || /^\s*-?\d+\.\s*$/.test(num) || /^\s*-?\.\d+\s*$/.test(num);
45
+ return (
46
+ // Normal type: 11.28
47
+ /^\s*-?\d+(\.\d+)?\s*$/.test(num) || // Pre-number: 1.
48
+ /^\s*-?\d+\.\s*$/.test(num) || // Post-number: .1
49
+ /^\s*-?\.\d+\s*$/.test(num)
50
+ );
46
51
  }
47
52
  function getNumberPrecision(number) {
48
53
  let numStr = String(number);
@@ -132,6 +137,10 @@ class BigIntDecimal {
132
137
  getMark() {
133
138
  return this.negative ? "-" : "";
134
139
  }
140
+ /**
141
+ * Align BigIntDecimal with same decimal length. e.g. 12.3 + 5 = 1230000
142
+ * This is used for add function only.
143
+ */
135
144
  alignDecimal(decimalLength) {
136
145
  const string = `${this.getMark()}${this.getIntegerStr()}${this.getDecimalStr().padEnd(decimalLength, "0")}`;
137
146
  return BigInt(string);
package/common/date.js CHANGED
@@ -314,7 +314,7 @@ const toDateStr = (date, dateFormat, timezone) => {
314
314
  };
315
315
  const getWeekOfFirstDay = (date, isSunFirst) => {
316
316
  typeof date === "boolean" && (isSunFirst = date);
317
- isDate(date) || (date = new Date());
317
+ isDate(date) || (date = /* @__PURE__ */ new Date());
318
318
  const day = date.getDay();
319
319
  let dayOfMonth = date.getDate();
320
320
  if (day === 0) {
@@ -325,7 +325,7 @@ const getWeekOfFirstDay = (date, isSunFirst) => {
325
325
  return new Date(date.getFullYear(), date.getMonth(), dayOfMonth);
326
326
  };
327
327
  const TZRE = /(-|\+)(\d{2}):?(\d{2})$/;
328
- const getLocalTimezone = () => 0 - new Date().getTimezoneOffset() / 60;
328
+ const getLocalTimezone = () => 0 - (/* @__PURE__ */ new Date()).getTimezoneOffset() / 60;
329
329
  const getStrTimezone = (value) => {
330
330
  const localTimeZone = getLocalTimezone();
331
331
  const match = typeof value === "string" && value.match(TZRE);
@@ -109,7 +109,7 @@ const parseFlags = {
109
109
  yy: [
110
110
  twoDigits,
111
111
  (date, value) => {
112
- const now = new Date();
112
+ const now = /* @__PURE__ */ new Date();
113
113
  const cent = Number(String(now.getFullYear()).substr(0, 2));
114
114
  date.year = String(value > 68 ? cent - 1 : cent) + value;
115
115
  }
@@ -225,7 +225,7 @@ const getNewFormat = (format, parseInfo) => {
225
225
  };
226
226
  const getDate = (dateInfo) => {
227
227
  let date;
228
- const today = new Date();
228
+ const today = /* @__PURE__ */ new Date();
229
229
  if (!isNull(dateInfo.timezoneOffset)) {
230
230
  dateInfo.minute = Number(dateInfo.minute || 0) - Number(dateInfo.timezoneOffset);
231
231
  const { year, month, day, hour, minute, second, millisecond } = dateInfo;
@@ -24,7 +24,7 @@ class Memorize {
24
24
  this.assemble(value);
25
25
  }
26
26
  setKey(storeKey) {
27
- this._storeKey = this._prefix + (storeKey || Number(new Date()));
27
+ this._storeKey = this._prefix + (storeKey || Number(/* @__PURE__ */ new Date()));
28
28
  }
29
29
  getValue(isSort = true) {
30
30
  const storeVlue = window.localStorage[this._storeKey] || "";
@@ -54,7 +54,7 @@ class Memorize {
54
54
  key: dataKey
55
55
  };
56
56
  newData[this._customField1] = 1;
57
- newData[this._customField2] = Number(new Date());
57
+ newData[this._customField2] = Number(/* @__PURE__ */ new Date());
58
58
  if (list.length < this._cacheNum) {
59
59
  list.push(newData);
60
60
  this.setValue(list);
@@ -66,7 +66,7 @@ class Memorize {
66
66
  list.some((item) => {
67
67
  if (item.key === dataKey) {
68
68
  item[this._customField1] = (item[this._customField1] || 0) + 1;
69
- item[this._customField2] = Number(new Date());
69
+ item[this._customField2] = Number(/* @__PURE__ */ new Date());
70
70
  isChanged = true;
71
71
  return true;
72
72
  }
@@ -93,36 +93,36 @@ const isScrollElement = (el) => {
93
93
  return scrollTypes.includes(getStyleComputedProperty(el, "overflow")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-x")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-y"));
94
94
  };
95
95
  const getScrollParent = (el) => {
96
- let parent = el.parentNode;
97
- if (!parent) {
96
+ let parent2 = el.parentNode;
97
+ if (!parent2) {
98
98
  return el;
99
99
  }
100
- if (parent === win.document) {
100
+ if (parent2 === win.document) {
101
101
  if (win.document.body.scrollTop || win.document.body.scrollLeft) {
102
102
  return win.document.body;
103
103
  }
104
104
  return win.document.documentElement;
105
105
  }
106
- if (isScrollElement(parent)) {
107
- return parent;
106
+ if (isScrollElement(parent2)) {
107
+ return parent2;
108
108
  }
109
109
  return getScrollParent(el.parentNode);
110
110
  };
111
- const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
111
+ const getOffsetRectRelativeToCustomPopper = (el, popper, fixed) => {
112
112
  let { top, left, width, height } = getBoundingClientRect(el);
113
- let parentRect = getBoundingClientRect(parent);
113
+ let popperRect = getBoundingClientRect(popper);
114
114
  if (fixed) {
115
115
  let { scrollTop, scrollLeft } = getScrollParent(parent);
116
- parentRect.top += scrollTop;
117
- parentRect.bottom += scrollTop;
118
- parentRect.left += scrollLeft;
119
- parentRect.right += scrollLeft;
116
+ popperRect.top += scrollTop;
117
+ popperRect.bottom += scrollTop;
118
+ popperRect.left += scrollLeft;
119
+ popperRect.right += scrollLeft;
120
120
  }
121
121
  let rect = {
122
- top: top - parentRect.top,
123
- left: left - parentRect.left,
124
- bottom: top - parentRect.top + height,
125
- right: left - parentRect.left + width,
122
+ top: top - popperRect.top,
123
+ left: left - popperRect.left,
124
+ bottom: top - popperRect.top + height,
125
+ right: left - popperRect.left + width,
126
126
  width,
127
127
  height
128
128
  };
@@ -180,10 +180,10 @@ const getArrayKeyIndex = (arr, keyToFind) => {
180
180
  return null;
181
181
  };
182
182
  const getAllScrollParents = (el, parents = []) => {
183
- const parent = el.parentNode;
184
- if (parent) {
185
- isScrollElement(parent) && parents.push(parent);
186
- return getAllScrollParents(parent, parents);
183
+ const parent2 = el.parentNode;
184
+ if (parent2) {
185
+ isScrollElement(parent2) && parents.push(parent2);
186
+ return getAllScrollParents(parent2, parents);
187
187
  }
188
188
  return parents;
189
189
  };
@@ -229,6 +229,7 @@ function Popper(reference, popper, options) {
229
229
  Popper.prototype.destroy = function() {
230
230
  this._popper.removeAttribute("x-placement");
231
231
  const popperStyle = this._reference === this._oldreference && this._oldreference._popper || {};
232
+ this._popper.style.display = "none";
232
233
  this._popper.style.position = "";
233
234
  this._popper.style.top = popperStyle.top || "";
234
235
  this._popper.style.left = popperStyle.left || "";
@@ -285,19 +286,19 @@ Popper.prototype.parse = function(config) {
285
286
  addAttributes(arrow, config.arrowAttributes);
286
287
  popper.appendChild(arrow);
287
288
  }
288
- let parent = getRealElement(config.parent);
289
- if (typeof parent === "string") {
290
- parent = docEl.querySelectorAll(config.parent);
291
- if (parent && parent.length) {
292
- parent = parent[0];
289
+ let parent2 = getRealElement(config.parent);
290
+ if (typeof parent2 === "string") {
291
+ parent2 = docEl.querySelectorAll(config.parent);
292
+ if (parent2 && parent2.length) {
293
+ parent2 = parent2[0];
293
294
  } else {
294
295
  throw new Error("ERROR: the given `parent` does not exists!");
295
296
  }
296
297
  }
297
- if (parent.length > 1 && parent instanceof Element === false) {
298
- parent = parent[0];
298
+ if (parent2.length > 1 && parent2 instanceof Element === false) {
299
+ parent2 = parent2[0];
299
300
  }
300
- parent.appendChild(popper);
301
+ parent2.appendChild(popper);
301
302
  return popper;
302
303
  };
303
304
  Popper.prototype._getPosition = function(popper, reference) {
@@ -310,10 +311,21 @@ Popper.prototype._getPosition = function(popper, reference) {
310
311
  };
311
312
  Popper.prototype._getOffsets = function(popper, reference, placement) {
312
313
  placement = placement.split("-")[0];
313
- let popperOffsets = {};
314
+ let popperOffsets = {
315
+ position: this.state.position,
316
+ left: 0,
317
+ top: 0,
318
+ width: 0,
319
+ height: 0
320
+ };
314
321
  popperOffsets.position = this.state.position;
315
322
  let isParentFixed = popperOffsets.position === "fixed";
316
- let referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
323
+ popper.style.left = "0";
324
+ popper.style.top = "0";
325
+ const originMargin = popper.style.margin;
326
+ popper.style.margin = "0";
327
+ let referenceOffsets = getOffsetRectRelativeToCustomPopper(reference, popper, isParentFixed);
328
+ popper.style.margin = originMargin;
317
329
  let { width, height } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper);
318
330
  if (~["right", "left"].indexOf(placement)) {
319
331
  popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
@@ -22,6 +22,7 @@ const PopupManager = {
22
22
  step: 2,
23
23
  zIndex: 2e3,
24
24
  globalScroll: false,
25
+ // 是否打开全局滚动监听
25
26
  modalFade: true,
26
27
  modalStack: [],
27
28
  deregister: (id) => {
@@ -7,7 +7,7 @@
7
7
  }
8
8
  if (!window.requestAnimationFrame) {
9
9
  window.requestAnimationFrame = function(callback) {
10
- const now = new Date().getTime();
10
+ const now = (/* @__PURE__ */ new Date()).getTime();
11
11
  const timeToCall = Math.max(0, 16 - (now - lastTime));
12
12
  const timeCallback = now + timeToCall;
13
13
  const id = window.setTimeout(() => {
@@ -9,10 +9,10 @@ function throttle_default(delay, noTrailing, callback, debounceMode) {
9
9
  }
10
10
  function wrapper() {
11
11
  const me = this;
12
- const elapsed = new Date().valueOf() - lastExec;
12
+ const elapsed = (/* @__PURE__ */ new Date()).valueOf() - lastExec;
13
13
  const args = arguments;
14
14
  function exec() {
15
- lastExec = new Date().valueOf();
15
+ lastExec = (/* @__PURE__ */ new Date()).valueOf();
16
16
  callback.apply(me, args);
17
17
  }
18
18
  function clear() {
package/common/index.js CHANGED
@@ -251,7 +251,7 @@ const EDOC = {
251
251
  constants: 320,
252
252
  twenty: 20
253
253
  };
254
- const version = "3.6.1";
254
+ const version = "3.6.6";
255
255
  const log = (data, type = "log") => {
256
256
  uLog.logger[type](data);
257
257
  };
package/common/runtime.js CHANGED
@@ -22,7 +22,7 @@ import vuePopup from "@opentiny/vue-renderless/common/deps/vue-popup";
22
22
  import validate from "@opentiny/vue-renderless/common/validate";
23
23
  import memorize from "@opentiny/vue-renderless/common/deps/memorize";
24
24
  import * as common from "@opentiny/vue-renderless/common";
25
- const version = "3.6.1";
25
+ const version = "3.6.6";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
@@ -39,14 +39,14 @@ const initState = ({ reactive, props, computed }) => {
39
39
  cardMonth: "v-card-month",
40
40
  cardNumber: "v-card-number"
41
41
  },
42
- minCardYear: new Date().getFullYear(),
42
+ minCardYear: (/* @__PURE__ */ new Date()).getFullYear(),
43
43
  isCardNumberMasked: true,
44
44
  mainCardNumber: props.formData.cardNumber,
45
45
  cardNumberMaxLength: 19,
46
46
  cardMonth: props.formData.cardMonth,
47
47
  cardYear: props.formData.cardYear,
48
48
  formData: props.formData,
49
- minCardMonth: computed(() => props.formData.cardYear === state.minCardYear ? new Date().getMonth() + 1 : 1)
49
+ minCardMonth: computed(() => props.formData.cardYear === state.minCardYear ? (/* @__PURE__ */ new Date()).getMonth() + 1 : 1)
50
50
  });
51
51
  return state;
52
52
  };
@@ -48,7 +48,7 @@ const watchValue = ({ api, state }) => (value) => {
48
48
  };
49
49
  const watchDefaultValue = ({ state }) => (value) => {
50
50
  if (!isDate(state.value)) {
51
- state.date = value ? new Date(value) : new Date();
51
+ state.date = value ? new Date(value) : /* @__PURE__ */ new Date();
52
52
  }
53
53
  };
54
54
  const watchTimePickerVisible = ({ nextTick, vm }) => (value) => {
@@ -202,7 +202,7 @@ const dateToLocaleStringForIE = (timezone, value) => {
202
202
  return new Date(offsetTime);
203
203
  };
204
204
  const changeToNow = ({ api, state }) => () => {
205
- const now = new Date();
205
+ const now = /* @__PURE__ */ new Date();
206
206
  const timezone = state.timezone;
207
207
  const isServiceTimezone = timezone.isServiceTimezone;
208
208
  let disabledDate = !state.disabledDate;
@@ -322,7 +322,7 @@ const handleVisibleDateChange = ({ api, state, t }) => (value) => {
322
322
  }
323
323
  };
324
324
  const isValidValue = ({ api, state }) => (value) => value && !isNaN(value) && (typeof state.disabledDate === "function" ? !state.disabledDate(value) : true) && api.checkDateWithinRange(value);
325
- const getDefaultValue = (state) => () => state.defaultValue ? new Date(state.defaultValue) : new Date();
325
+ const getDefaultValue = (state) => () => state.defaultValue ? new Date(state.defaultValue) : /* @__PURE__ */ new Date();
326
326
  const checkDateWithinRange = ({ state }) => (date) => state.selectableRange.length > 0 ? timeWithinRange(date, state.selectableRange, state.format || "HH:mm:ss") : true;
327
327
  const selectTz = ({ emit, state }) => (tz) => {
328
328
  if (state.timezone.isServiceTimezone) {
package/date-panel/vue.js CHANGED
@@ -75,7 +75,7 @@ const api = [
75
75
  const initState = ({ reactive, computed, api: api2, i18n }) => {
76
76
  const state = reactive({
77
77
  popperClass: "",
78
- date: new Date(),
78
+ date: /* @__PURE__ */ new Date(),
79
79
  value: "",
80
80
  defaultValue: null,
81
81
  defaultTime: null,
@@ -18,7 +18,7 @@ const calcDefaultValue = (defaultValue) => {
18
18
  } else if (defaultValue) {
19
19
  return [new Date(defaultValue), nextDate(new Date(defaultValue), 1)];
20
20
  }
21
- return [new Date(), nextDate(new Date(), 1)];
21
+ return [/* @__PURE__ */ new Date(), nextDate(/* @__PURE__ */ new Date(), 1)];
22
22
  };
23
23
  const getMinVisibleDate = ({ state, t }) => () => {
24
24
  if (state.dateUserInput.min !== null) {
@@ -154,13 +154,13 @@ const handleDateInput = ({ state, t }) => (value, type) => {
154
154
  return;
155
155
  }
156
156
  if (type === "min") {
157
- state.minDate = modifyDate(state.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
157
+ state.minDate = modifyDate(state.minDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
158
158
  state.leftDate = new Date(parsedValue);
159
159
  if (!state.unlinkPanels) {
160
160
  state.rightDate = nextMonth(state.leftDate);
161
161
  }
162
162
  } else {
163
- state.maxDate = modifyDate(state.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
163
+ state.maxDate = modifyDate(state.maxDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
164
164
  state.rightDate = new Date(parsedValue);
165
165
  if (!state.unlinkPanels) {
166
166
  state.leftDate = prevMonth(parsedValue);
@@ -172,12 +172,12 @@ const handleDateChange = ({ state, t }) => (value, type) => {
172
172
  const parsedValue = parseDate(value, state.dateFormat, t);
173
173
  if (parsedValue) {
174
174
  if (type === "min") {
175
- state.minDate = modifyDate(state.minDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
175
+ state.minDate = modifyDate(state.minDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
176
176
  if (state.minDate > state.maxDate) {
177
177
  state.maxDate = state.minDate;
178
178
  }
179
179
  } else {
180
- state.maxDate = modifyDate(state.maxDate || new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
180
+ state.maxDate = modifyDate(state.maxDate || /* @__PURE__ */ new Date(), parsedValue.getFullYear(), parsedValue.getMonth(), parsedValue.getDate());
181
181
  if (state.maxDate < state.minDate) {
182
182
  state.minDate = state.maxDate;
183
183
  }
@@ -251,7 +251,7 @@ const doPick = (emit) => (start, end) => {
251
251
  emit("pick", [start, end], false);
252
252
  };
253
253
  const handleMinTimePick = ({ state }) => (value, visible, first) => {
254
- state.minDate = state.minDate || new Date();
254
+ state.minDate = state.minDate || /* @__PURE__ */ new Date();
255
255
  if (value) {
256
256
  state.minDate = modifyTime(state.minDate, value.getHours(), value.getMinutes(), value.getSeconds());
257
257
  }
package/date-range/vue.js CHANGED
@@ -74,8 +74,8 @@ const initState = ({ reactive, computed, api: api2 }) => {
74
74
  defaultTime: null,
75
75
  minDate: "",
76
76
  maxDate: "",
77
- leftDate: new Date(),
78
- rightDate: nextMonth(new Date()),
77
+ leftDate: /* @__PURE__ */ new Date(),
78
+ rightDate: nextMonth(/* @__PURE__ */ new Date()),
79
79
  rangeState: { endDate: null, selecting: false, row: null, column: null },
80
80
  showTime: false,
81
81
  format: "",
@@ -50,7 +50,7 @@ const getSelected = ({ props, cell, format, t, cellDate, selectedDate }) => {
50
50
  return selected;
51
51
  };
52
52
  const getCell = ({ state, props }) => (row, i, j) => {
53
- const now = getDateTimestamp(new Date());
53
+ const now = getDateTimestamp(/* @__PURE__ */ new Date());
54
54
  let cell = row[props.showWeekNumber ? j + 1 : j];
55
55
  if (!cell) {
56
56
  cell = {
@@ -80,6 +80,7 @@ const initState = ({ api: api2, reactive, computed, inject, ref, vm, props, http
80
80
  form: inject("form", ref({ default: "" })),
81
81
  listeners: vm.$listeners,
82
82
  docSize: 0,
83
+ // unit(B)
83
84
  chunkSize: 0,
84
85
  chunkBatchLimit: 20,
85
86
  downloadChunkLimit: 5,
package/form-item/vue.js CHANGED
@@ -50,6 +50,7 @@ const initState = ({ reactive, computed, api: api2, mode, inject, props }) => {
50
50
  computedLabelWidth: "",
51
51
  initialValue: null,
52
52
  canShowTip: false,
53
+ // 兼容 2.0 validation 的 required
53
54
  validationRequired: false,
54
55
  tooltip: null,
55
56
  formInstance: inject("form", null),
package/fullscreen/vue.js CHANGED
@@ -8,6 +8,7 @@ const renderless = (props, { reactive, computed, watch }, { vm, emit }) => {
8
8
  isFullscreen: false,
9
9
  isEnabled: false,
10
10
  support: computed(() => state.isEnabled),
11
+ // 如果不支持浏览器全屏,改用网页全屏
11
12
  isPageOnly: computed(() => props.pageOnly || !sf.isEnabled),
12
13
  wrapperStyle: computed(() => api2.computeWrapperStyle())
13
14
  });
@@ -47,8 +47,11 @@ function funcFromCodePoint() {
47
47
  const defaultOptions = {
48
48
  plugins: {
49
49
  XLSX: null,
50
+ // xlsx 插件
50
51
  XLSXX: null,
52
+ // xlsx-style 插件
51
53
  FileSaver: null
54
+ // FileSaver 插件
52
55
  },
53
56
  table: {
54
57
  sheetName: "tiny-sheet",
@@ -1,5 +1,8 @@
1
1
  import "../../../chunk-PKUHTIDK.js";
2
- const helperGetHGSKeys = (property) => property ? property.splice && property.join ? property : String(property).split(".") : [];
2
+ const helperGetHGSKeys = (property) => (
3
+ // 以最快的方式判断数组,可忽略准确性
4
+ property ? property.splice && property.join ? property : String(property).split(".") : []
5
+ );
3
6
  var helperGetHGSKeys_default = helperGetHGSKeys;
4
7
  export {
5
8
  helperGetHGSKeys_default as default
@@ -115,7 +115,7 @@ const keyup = ({ api, props }) => ({ item, index, event }) => {
115
115
  item.value = item.value.replace(/\D/g, "");
116
116
  return false;
117
117
  }
118
- if ([KEY_CODE.Tab, KEY_CODE.Space, KEY_CODE.NumpadDecimal, KEY_CODE.NumpadComma].includes(keyCode) && value) {
118
+ if ([KEY_CODE.Space, KEY_CODE.NumpadDecimal, KEY_CODE.NumpadComma].includes(keyCode) && value) {
119
119
  api.select({ index: nextIndex });
120
120
  return false;
121
121
  }
package/locales/index.js CHANGED
@@ -17,7 +17,7 @@ const switchLanguage = ({ api, state, service }) => (lang) => {
17
17
  const domain = service.getDomain();
18
18
  const hasMultiLocale = state.locales.length === 2;
19
19
  state.current = hasMultiLocale ? state.current = locales.indexOf(current) === 0 ? locales[1] : locales[0] : lang;
20
- const expires = new Date(new Date().getTime() + 36e5).toGMTString();
20
+ const expires = new Date((/* @__PURE__ */ new Date()).getTime() + 36e5).toGMTString();
21
21
  const currLang = state.current.substring(0, 2) === "zh" ? "zh" : "en";
22
22
  document.cookie = `lang=${currLang};expires=${expires};domain=${domain};path=/`;
23
23
  api.setText();
@@ -6,7 +6,7 @@ const calcDefaultValue = (defaultValue) => {
6
6
  } else if (defaultValue) {
7
7
  return [new Date(defaultValue), nextMonth(new Date(defaultValue))];
8
8
  }
9
- return [new Date(), nextMonth(new Date())];
9
+ return [/* @__PURE__ */ new Date(), nextMonth(/* @__PURE__ */ new Date())];
10
10
  };
11
11
  const watchValue = ({ state }) => (value) => {
12
12
  if (!value) {
@@ -25,8 +25,8 @@ const initState = ({ reactive, computed, api: api2, t }) => {
25
25
  defaultTime: null,
26
26
  minDate: "",
27
27
  maxDate: "",
28
- leftDate: new Date(),
29
- rightDate: nextYear(new Date()),
28
+ leftDate: /* @__PURE__ */ new Date(),
29
+ rightDate: nextYear(/* @__PURE__ */ new Date()),
30
30
  rangeState: { endDate: null, selecting: false, row: null, column: null },
31
31
  shortcuts: "",
32
32
  visible: "",
@@ -22,7 +22,7 @@ const getRows = ({ props, state, vm }) => () => {
22
22
  const tableRows = state.tableRows;
23
23
  const disabledDate = state.disabledDate;
24
24
  const selectedDate = [];
25
- const now = getMonthTimestamp(new Date());
25
+ const now = getMonthTimestamp(/* @__PURE__ */ new Date());
26
26
  const { date, minDate, maxDate } = props;
27
27
  for (let i = 0; i < 3; i++) {
28
28
  const row = tableRows[i];
@@ -152,7 +152,7 @@ const cellMatchesDate = (props) => (cell, date) => {
152
152
  const getCellStyle = ({ api, props }) => (cell) => {
153
153
  const style = {};
154
154
  const year = props.date.getFullYear();
155
- const today = new Date();
155
+ const today = /* @__PURE__ */ new Date();
156
156
  const month = cell.text;
157
157
  const defaultValue = props.defaultValue ? Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue] : [];
158
158
  style.disabled = typeof props.disabledDate === "function" ? datesInMonth(year, month).every(props.disabledDate) : false;
@@ -163,10 +163,7 @@ const getLabelsStyle = (state) => {
163
163
  const over25Labels = state.labelLevelsInfo.filter((i) => i && !i.isOver25);
164
164
  let widthInfo = over25Labels;
165
165
  const len = state.dataSource.length;
166
- if (len >= 4) {
167
- return getStyleConfig(state.labelLevelsInfo, { width: `${(1 / len * 100).toFixed(2)}%` });
168
- }
169
- if (!widthInfo.length || widthInfo.length === state.labelLevelsInfo.length) {
166
+ if (!widthInfo.length || widthInfo.length === state.labelLevelsInfo.length || len >= 4) {
170
167
  return getStyleConfig(state.labelLevelsInfo, { maxWidth: `${(1 / len * 100).toFixed(2)}%` });
171
168
  }
172
169
  let fillArr;
@@ -18,7 +18,7 @@ const api = [
18
18
  "clickWheelItem",
19
19
  "loadDefault"
20
20
  ];
21
- const initState = (reactive) => {
21
+ const initState = ({ computed, reactive }) => {
22
22
  const state = reactive({
23
23
  dataSource: [],
24
24
  wheelData: [],
@@ -30,7 +30,8 @@ const initState = (reactive) => {
30
30
  wheelText: "",
31
31
  headerInfo: [],
32
32
  defaultSelectedIndexs: [],
33
- defaultSelectedArray: []
33
+ defaultSelectedArray: [],
34
+ isActive: computed(() => state.headerInfo.some((item) => item.isUP))
34
35
  });
35
36
  return state;
36
37
  };
@@ -60,9 +61,9 @@ const initWatch = ({ watch, props, state, refs, nextTick }) => {
60
61
  }
61
62
  );
62
63
  };
63
- const renderless = (props, { onMounted, reactive, watch }, { emit, nextTick, refs }) => {
64
+ const renderless = (props, { computed, onMounted, reactive, watch }, { emit, nextTick, refs }) => {
64
65
  const api2 = {};
65
- const state = initState(reactive);
66
+ const state = initState({ computed, reactive });
66
67
  initApi({ api: api2, props, state, emit, nextTick, refs });
67
68
  initWatch({ watch, props, state, refs, nextTick });
68
69
  onMounted(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.6.1",
3
+ "version": "3.6.6",
4
4
  "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
5
5
  "homepage": "https://opentiny.design/tiny-vue",
6
6
  "keywords": [
package/picker/index.js CHANGED
@@ -366,7 +366,7 @@ const handleStartChange = ({ api, state }) => () => {
366
366
  state.userInput = [api.formatToString(value), state.displayValue[1]];
367
367
  newValue = [value, state.picker.state.value && state.picker.state.value[1]];
368
368
  } else {
369
- let now = new Date();
369
+ let now = /* @__PURE__ */ new Date();
370
370
  if (now.getTime() < value.getTime()) {
371
371
  state.userInput = [api.formatToString(value), api.formatToString(value)];
372
372
  newValue = [value, value];
@@ -390,7 +390,7 @@ const handleEndChange = ({ api, state }) => () => {
390
390
  state.userInput = [state.displayValue[0], api.formatToString(value)];
391
391
  newValue = [state.picker.state.value && state.picker.state.value[0], value];
392
392
  } else {
393
- let now = new Date();
393
+ let now = /* @__PURE__ */ new Date();
394
394
  if (now.getTime() < value.getTime()) {
395
395
  state.userInput = [api.formatToString(now), api.formatToString(value)];
396
396
  newValue = [now, value];
@@ -3,7 +3,6 @@ import {
3
3
  } from "../chunk-PKUHTIDK.js";
4
4
  import { on, off } from "@opentiny/vue-renderless/common/deps/dom";
5
5
  const initPullRefresh = ({ t, props, state }) => () => {
6
- var _a, _b, _c;
7
6
  const defaultOption = {
8
7
  pullingUpText: t("ui.pullRefresh.pullingUp"),
9
8
  pullingDownText: t("ui.pullRefresh.pullingDown"),
@@ -18,16 +17,17 @@ const initPullRefresh = ({ t, props, state }) => () => {
18
17
  paddingTop: state.pullDown.headHeight + "px",
19
18
  paddingBottom: state.pullUp.footHeight + "px"
20
19
  };
21
- state.loosingText = (_a = props.loosingText) != null ? _a : t("ui.pullRefresh.loosing");
22
- state.successText = (_b = props.successText) != null ? _b : t("ui.pullRefresh.success");
23
- state.failedText = (_c = props.failedText) != null ? _c : t("ui.pullRefresh.failed");
24
20
  };
25
21
  const onTouchstart = (state) => (event) => {
26
22
  state.draggposition = event.touches[0].clientY;
27
23
  };
28
- const onTouchmove = ({ props, state }) => (event) => {
24
+ const onTouchmove = ({ props, state, refs }) => (event) => {
29
25
  if (event.touches[0].clientY < state.draggposition) {
30
- if (!state.pullUp.pullUpDisabled) {
26
+ const scrollBottom = refs.content.scrollHeight - refs.content.clientHeight - refs.content.scrollTop;
27
+ if (scrollBottom > 10) {
28
+ return;
29
+ }
30
+ if (!state.pullUp.pullUpDisabled && state.pullUp.handler) {
31
31
  if (props.hasMore) {
32
32
  state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
33
33
  state.pullUpReplaces = Math.abs(state.translate3d) > state.pullUp.footHeight ? state.loosingText : state.pullUp.pullingUpText;
@@ -35,7 +35,10 @@ const onTouchmove = ({ props, state }) => (event) => {
35
35
  }
36
36
  }
37
37
  } else {
38
- if (!state.pullDown.pullDownDisabled) {
38
+ if (refs.content.scrollTop > 10) {
39
+ return;
40
+ }
41
+ if (!state.pullDown.pullDownDisabled && state.pullDown.handler) {
39
42
  state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
40
43
  state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
41
44
  state.pullUpReplaces = "";
@@ -1,7 +1,7 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
2
  import { mountedHandler, beforeUnmountHandler, handlerModelValue, onTouchstart, onTouchmove, onTouchend, initPullRefresh, clearPullRefresh } from "./index";
3
3
  const api = ["state"];
4
- const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs }) => {
4
+ const renderless = (props, { watch, onMounted, computed, reactive, onBeforeUnmount }, { t, refs }) => {
5
5
  const api2 = {};
6
6
  const state = reactive({
7
7
  pullUpReplaces: "",
@@ -11,10 +11,10 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
11
11
  draggposition: 0,
12
12
  pullUpLoading: false,
13
13
  pullDownLoading: false,
14
- loosingText: "",
15
- successText: "",
16
- failedText: "",
17
- noMoreText: "",
14
+ loosingText: computed(() => props.loosingText || t("ui.pullRefresh.loosing")),
15
+ successText: computed(() => props.successText || t("ui.pullRefresh.success")),
16
+ failedText: computed(() => props.failedText || t("ui.pullRefresh.failed")),
17
+ noMoreText: computed(() => !props.hasMore ? t("ui.pullRefresh.noMore") : ""),
18
18
  pullUp: null,
19
19
  pullDown: null,
20
20
  successDuration: props.successDuration,
@@ -23,7 +23,7 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
23
23
  Object.assign(api2, {
24
24
  state,
25
25
  onTouchstart: onTouchstart(state),
26
- onTouchmove: onTouchmove({ props, state }),
26
+ onTouchmove: onTouchmove({ props, state, refs }),
27
27
  onTouchend: onTouchend({ api: api2, props, state }),
28
28
  mountedHandler: mountedHandler({ api: api2, refs }),
29
29
  beforeUnmountHandler: beforeUnmountHandler({ api: api2, refs }),
@@ -35,7 +35,7 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
35
35
  () => props.hasMore,
36
36
  (value) => {
37
37
  if (!value) {
38
- state.noMoreText = t("ui.pullRefresh.noMore");
38
+ state.pullUpLoading = false;
39
39
  api2.clearPullRefresh();
40
40
  }
41
41
  }
package/select/vue.js CHANGED
@@ -187,6 +187,7 @@ const initState = ({ reactive, computed, props, api: api2, emitter, parent, cons
187
187
  visible: false,
188
188
  showCopy: computed(() => props.multiple && props.copyable && state.inputHovering && state.selected.length),
189
189
  showWarper: true,
190
+ // 显示下拉外层控制
190
191
  selected: props.multiple ? [] : {},
191
192
  softFocus: false,
192
193
  hover: false,
package/slider/index.js CHANGED
@@ -152,10 +152,17 @@ const calcCurrentValue = ({ currentValue, props, state }) => {
152
152
  currentValue = props.max;
153
153
  } else {
154
154
  const step = props.step > 0 ? props.step : 1;
155
+ let stepPrecision = 0;
156
+ if (step - parseInt(step) > 0) {
157
+ stepPrecision = step.toString().split(".")[1].length;
158
+ }
155
159
  const stepValue = (currentValue - props.min) % step;
156
- if (stepValue > props.step / 10) {
160
+ if (stepValue) {
157
161
  currentValue -= stepValue;
158
162
  currentValue += stepValue * 2 > step ? Number(step) : 0;
163
+ if (stepPrecision) {
164
+ currentValue = currentValue.toFixed(stepPrecision);
165
+ }
159
166
  }
160
167
  if (state.isDouble) {
161
168
  if (state.activeIndex === 0 && currentValue >= state.rightBtnValue) {
@@ -259,11 +266,11 @@ const autoSlider = (api) => (value) => {
259
266
  };
260
267
  const customBeforeAppearHook = (props) => (el) => {
261
268
  if (props.vertical) {
262
- el.style.bottom = 0 + "%";
263
- el.style.height = 0 + "%";
269
+ el.style.bottom = "0%";
270
+ el.style.height = "0%";
264
271
  } else {
265
- el.style.left = 0 + "%";
266
- el.style.width = 0 + "%";
272
+ el.style.left = "0%";
273
+ el.style.width = "0%";
267
274
  }
268
275
  };
269
276
  const customAfterAppearHook = ({ state, props }) => (el) => {
package/tabs/index.js CHANGED
@@ -60,6 +60,7 @@ const handleTabClick = ({ api, emit, props, refs }) => (pane, tabName, event) =>
60
60
  if (pane.disabled) {
61
61
  return;
62
62
  }
63
+ event.stopPropagation();
63
64
  api.setCurrentName(tabName);
64
65
  emit("click", pane, event);
65
66
  if (props.showExpandTabs) {
package/time/index.js CHANGED
@@ -5,7 +5,7 @@ const watchValue = ({ api, nextTick, state }) => (value) => {
5
5
  if (value instanceof Date) {
6
6
  date = limitTimeRange(value, state.selectableRange, state.format);
7
7
  } else if (!value) {
8
- date = state.defaultValue ? new Date(state.defaultValue) : new Date();
8
+ date = state.defaultValue ? new Date(state.defaultValue) : /* @__PURE__ */ new Date();
9
9
  }
10
10
  state.date = date;
11
11
  if (state.visible && state.needInitAdjust) {
package/time/vue.js CHANGED
@@ -20,8 +20,8 @@ const initState = ({ reactive, props, computed, api: api2 }) => {
20
20
  format: "HH:mm:ss",
21
21
  value: "",
22
22
  defaultValue: null,
23
- date: props.value || new Date(),
24
- oldValue: new Date(),
23
+ date: props.value || /* @__PURE__ */ new Date(),
24
+ oldValue: /* @__PURE__ */ new Date(),
25
25
  selectableRange: [],
26
26
  selectionRange: [0, 2],
27
27
  disabled: false,
@@ -67,7 +67,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, {
67
67
  );
68
68
  watch(
69
69
  () => state.defaultValue,
70
- (value) => !isDate(state.value) && (state.date = value ? new Date(value) : new Date())
70
+ (value) => !isDate(state.value) && (state.date = value ? new Date(value) : /* @__PURE__ */ new Date())
71
71
  );
72
72
  onMounted(() => {
73
73
  api2.handleConfirm(true, true);
@@ -17,12 +17,12 @@ const watchValue = ({ api, state }) => (value) => {
17
17
  if (value[0]) {
18
18
  state.minDate = new Date(value[0]);
19
19
  } else {
20
- state.minDate = value[1] ? new Date(api.minTimeOfDay(new Date(value[1])).getTime()) : new Date();
20
+ state.minDate = value[1] ? new Date(api.minTimeOfDay(new Date(value[1])).getTime()) : /* @__PURE__ */ new Date();
21
21
  }
22
22
  if (value[1]) {
23
23
  state.maxDate = new Date(value[1]);
24
24
  } else {
25
- state.maxDate = value[0] ? api.advanceTime(new Date(value[0]), 60 * 60 * 1e3) : api.advanceTime(new Date(), 60 * 60 * 1e3);
25
+ state.maxDate = value[0] ? api.advanceTime(new Date(value[0]), 60 * 60 * 1e3) : api.advanceTime(/* @__PURE__ */ new Date(), 60 * 60 * 1e3);
26
26
  }
27
27
  } else {
28
28
  if (Array.isArray(state.defaultValue)) {
@@ -32,8 +32,8 @@ const watchValue = ({ api, state }) => (value) => {
32
32
  state.minDate = new Date(state.defaultValue);
33
33
  state.maxDate = api.advanceTime(new Date(state.defaultValue), 60 * 60 * 1e3);
34
34
  } else {
35
- state.minDate = new Date();
36
- state.maxDate = api.advanceTime(new Date(), 60 * 60 * 1e3);
35
+ state.minDate = /* @__PURE__ */ new Date();
36
+ state.maxDate = api.advanceTime(/* @__PURE__ */ new Date(), 60 * 60 * 1e3);
37
37
  }
38
38
  }
39
39
  };
package/time-range/vue.js CHANGED
@@ -27,11 +27,11 @@ const initState = ({ reactive, computed, refs, api: api2 }) => {
27
27
  format: "HH:mm:ss",
28
28
  visible: false,
29
29
  value: [],
30
- oldValue: [new Date(), new Date()],
30
+ oldValue: [/* @__PURE__ */ new Date(), /* @__PURE__ */ new Date()],
31
31
  selectionRange: [0, 2],
32
32
  arrowControl: false,
33
- maxDate: new Date(),
34
- minDate: new Date(),
33
+ maxDate: /* @__PURE__ */ new Date(),
34
+ minDate: /* @__PURE__ */ new Date(),
35
35
  showSeconds: computed(() => (state.format || "").includes("ss")),
36
36
  offset: computed(() => state.showSeconds ? 11 : 8),
37
37
  spinner: computed(() => state.selectionRange[0] < state.offset ? refs.minSpinner : refs.maxSpinner),
@@ -47,6 +47,7 @@ const renderless = (props, { reactive, watch, computed, onMounted }, { t, servic
47
47
  service = service || { base: {} };
48
48
  service = {
49
49
  getMenuDataSync: props.getMenuDataSync || service.base.getMenuDataSync,
50
+ // deprecated v3.4.0废弃, v3.16.0移除;移除原因:如果是同步数据则和:data功能重复
50
51
  getMenuDataAsync: props.getMenuDataAsync
51
52
  };
52
53
  Object.assign(api2, {
package/tooltip/vue.js CHANGED
@@ -24,7 +24,6 @@ const api = [
24
24
  "show",
25
25
  "doDestroy",
26
26
  "handleFocus",
27
- "setExpectedState",
28
27
  "debounceClose",
29
28
  "handleShowPopper",
30
29
  "handleClosePopper",
@@ -56,7 +55,7 @@ const renderless = (props, { watch, toRefs, reactive, onBeforeUnmount, onDeactiv
56
55
  show: show({ api: api2, state, props }),
57
56
  hide: hide(api2),
58
57
  destroyed: destroyed({ state, api: api2 }),
59
- bindPopper: bindPopper({ vm, refs, state, nextTick }),
58
+ bindPopper: bindPopper({ vm, refs, nextTick }),
60
59
  watchFocusing: watchFocusing(state),
61
60
  removeFocusing: removeFocusing(state),
62
61
  handleBlur: handleBlur({ api: api2, state }),
package/user/index.js CHANGED
@@ -316,7 +316,7 @@ const getUsers = ({ api, props, state }) => (value) => {
316
316
  };
317
317
  const updateCache = ({ props, state }) => () => {
318
318
  const users = toJson(window.localStorage.getItem(props.cacheKey)) || {};
319
- const currDate = toDateStr(new Date(), "yyyyMMdd");
319
+ const currDate = toDateStr(/* @__PURE__ */ new Date(), "yyyyMMdd");
320
320
  if (currDate !== users.t) {
321
321
  users.t = currDate;
322
322
  for (let u in users) {
@@ -349,6 +349,7 @@ const cacheUser = ({ api, props, service }) => (users) => {
349
349
  } else {
350
350
  const us = {
351
351
  p: u[valueField],
352
+ // 增加一个主键
352
353
  i: u[cacheFields.userId],
353
354
  u: u[cacheFields.userCN],
354
355
  d: u[cacheFields.dept],
@@ -10,7 +10,7 @@ const datesInYear = (year) => {
10
10
  };
11
11
  const getCellStyle = ({ props }) => (year) => {
12
12
  const style = {};
13
- const today = new Date();
13
+ const today = /* @__PURE__ */ new Date();
14
14
  style.disabled = typeof props.disabledDate === "function" ? datesInYear(year).every(props.disabledDate) : false;
15
15
  const execDate = typeof props.value === "object" ? props.value : toDate(props.value);
16
16
  style.current = arrayFindIndex(coerceTruthyValueToArray(execDate), (date) => date.getFullYear() === year) >= 0;