@opentiny/vue-renderless 3.12.1 → 3.13.1

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 (60) hide show
  1. package/alert/index.js +50 -1
  2. package/alert/vue.js +36 -9
  3. package/calendar-bar/index.js +2 -2
  4. package/calendar-view/index.js +5 -11
  5. package/calendar-view/vue.js +1 -1
  6. package/cascader/index.js +3 -2
  7. package/cascader-mobile/index.js +1 -1
  8. package/cascader-mobile/vue.js +1 -1
  9. package/cascader-view/index.js +1 -1
  10. package/checkbox/vue.js +1 -0
  11. package/checkbox-group/vue.js +1 -0
  12. package/col/vue.js +3 -2
  13. package/common/date.js +2 -0
  14. package/common/deps/popper.js +42 -3
  15. package/common/index.js +1 -1
  16. package/common/runtime.js +1 -1
  17. package/container/index.js +17 -1
  18. package/container/vue.js +12 -3
  19. package/dropdown-item/vue.js +1 -1
  20. package/grid/utils/common.js +10 -5
  21. package/input/index.js +8 -2
  22. package/input/vue.js +13 -8
  23. package/label/index.js +56 -0
  24. package/label/vue.js +26 -0
  25. package/mask/index.js +13 -0
  26. package/mask/vue.js +18 -0
  27. package/numeric/index.js +13 -3
  28. package/numeric/vue.js +6 -1
  29. package/option/index.js +1 -2
  30. package/option/vue.js +7 -1
  31. package/package.json +1 -1
  32. package/pager/index.js +358 -0
  33. package/pager/vue.js +114 -2
  34. package/picker/index.js +1 -1
  35. package/pop-upload/index.js +0 -2
  36. package/pop-upload/vue.js +0 -4
  37. package/pull-refresh/index.js +55 -63
  38. package/pull-refresh/vue.js +20 -7
  39. package/select/index.js +11 -3
  40. package/select/vue.js +5 -4
  41. package/slider/index.js +27 -3
  42. package/slider/vue.js +26 -6
  43. package/tag/vue.js +5 -1
  44. package/tall-storage/index.js +4 -5
  45. package/types/action-menu.type.d.ts +5 -0
  46. package/types/alert.type.d.ts +16 -1
  47. package/types/button.type.d.ts +1 -0
  48. package/types/checkbox.type.d.ts +3 -0
  49. package/types/date-picker.type.d.ts +1 -1
  50. package/types/{dropdown-item.type-bf83e929.d.ts → dropdown-item.type-8ea6c633.d.ts} +1 -1
  51. package/types/dropdown-item.type.d.ts +1 -1
  52. package/types/dropdown-menu.type.d.ts +1 -1
  53. package/types/dropdown.type.d.ts +1 -0
  54. package/types/input.type.d.ts +21 -3
  55. package/types/label.type.d.ts +81 -0
  56. package/types/numeric.type.d.ts +1 -1
  57. package/types/pager.type.d.ts +159 -1
  58. package/types/slider.type.d.ts +8 -0
  59. package/types/tab-item.type.d.ts +0 -1
  60. package/types/tag.type.d.ts +12 -0
@@ -43,7 +43,6 @@ const watchDisabled = (state) => (value) => state.disabled = value;
43
43
  const watchAccept = (state) => (value) => state.accept = value;
44
44
  const closeErrorTips = (state) => () => state.errorTips = [];
45
45
  const closeSuccessTips = (state) => () => state.successTips = [];
46
- const watchFilters = (state) => (value) => state.filters = value;
47
46
  const watchLimit = (state) => (value) => {
48
47
  state.limit = value;
49
48
  if (value != void 0 && value > 0) {
@@ -157,7 +156,6 @@ export {
157
156
  watchAccept,
158
157
  watchAction,
159
158
  watchDisabled,
160
- watchFilters,
161
159
  watchHeaders,
162
160
  watchLimit,
163
161
  watchMaxUploadFileSize,
package/pop-upload/vue.js CHANGED
@@ -24,7 +24,6 @@ import {
24
24
  closeErrorTips,
25
25
  watchUploaFileType,
26
26
  watchMaxUploadFileSize,
27
- watchFilters,
28
27
  watchAccept,
29
28
  computedUploadButtonText,
30
29
  computedUploadsButtonText,
@@ -66,7 +65,6 @@ const initState = ({ reactive, props, computed, api: api2 }) => reactive({
66
65
  isShowDialog: false,
67
66
  accept: props.accept,
68
67
  action: props.action,
69
- filters: props.filters,
70
68
  headers: props.headers,
71
69
  disabled: props.disabled,
72
70
  multiple: props.multiple,
@@ -103,7 +101,6 @@ const initApi = ({ api: api2, state, refs, emit, props, constants, t }) => {
103
101
  watchAccept: watchAccept(state),
104
102
  progressEvent: progressEvent(emit),
105
103
  watchHeaders: watchHeaders(state),
106
- watchFilters: watchFilters(state),
107
104
  watchMultiple: watchMultiple(state),
108
105
  watchDisabled: watchDisabled(state),
109
106
  closeErrorTips: closeErrorTips(state),
@@ -146,7 +143,6 @@ const initWatch = ({ watch, props, api: api2 }) => {
146
143
  watch(() => props.multiple, api2.watchMultiple, { immediate: true });
147
144
  watch(() => props.action, api2.watchAction, { immediate: true });
148
145
  watch(() => props.headers, api2.watchHeaders, { immediate: true });
149
- watch(() => props.filters, api2.watchFilters, { immediate: true });
150
146
  watch(() => props.limit, api2.watchLimit, { immediate: true });
151
147
  };
152
148
  const renderless = (props, { computed, reactive, watch }, { t, constants, emit, refs }) => {
@@ -9,15 +9,10 @@ const initPullRefresh = ({ t, props, state }) => () => {
9
9
  pullingDownText: t("ui.pullRefresh.pullingDown"),
10
10
  pullUpDisabled: false,
11
11
  pullDownDisabled: false,
12
- headHeight: 50,
13
- footHeight: 50
12
+ headHeight: 48
14
13
  };
15
14
  state.pullUp = __spreadValues(__spreadValues({}, defaultOption), props.pullUp);
16
15
  state.pullDown = __spreadValues(__spreadValues({}, defaultOption), props.pullDown);
17
- state.refreshStyle = {
18
- paddingTop: state.pullDown.headHeight + "px",
19
- paddingBottom: state.pullUp.footHeight + "px"
20
- };
21
16
  state.loosingText = (_a = props.loosingText) != null ? _a : t("ui.pullRefresh.loosing");
22
17
  state.successText = (_b = props.successText) != null ? _b : t("ui.pullRefresh.success");
23
18
  state.failedText = (_c = props.failedText) != null ? _c : t("ui.pullRefresh.failed");
@@ -25,70 +20,62 @@ const initPullRefresh = ({ t, props, state }) => () => {
25
20
  const onTouchstart = (state) => (event) => {
26
21
  state.draggposition = event.touches[0].clientY;
27
22
  };
28
- const onTouchmove = ({ props, state }) => (event) => {
23
+ const onTouchmove = ({ state, refs }) => (event) => {
29
24
  if (event.touches[0].clientY < state.draggposition) {
30
- if (!state.pullUp.pullUpDisabled) {
31
- if (props.hasMore) {
32
- state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
33
- state.pullUpReplaces = Math.abs(state.translate3d) > state.pullUp.footHeight ? state.loosingText : state.pullUp.pullingUpText;
34
- state.pullDownReplaces = "";
35
- }
36
- }
25
+ pullUpTouchMove(state);
37
26
  } else {
38
- if (!state.pullDown.pullDownDisabled) {
39
- state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
40
- state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
41
- state.pullUpReplaces = "";
42
- }
27
+ pullDownTouchMove(state, refs, event);
28
+ }
29
+ };
30
+ const pullUpTouchMove = (state) => {
31
+ if (state.disabledPullUp || state.pullUpLoading || !state.hasMore) {
32
+ return;
33
+ }
34
+ };
35
+ const pullDownTouchMove = (state, refs, event) => {
36
+ if (state.disabledPullDown || state.pullDownLoading) {
37
+ return;
38
+ }
39
+ if (refs.content.scrollTop <= 0) {
40
+ event.preventDefault();
41
+ state.translate3d = (event.touches[0].clientY - state.draggposition) / 2;
42
+ state.pullDownReplaces = Math.abs(state.translate3d) > state.pullDown.headHeight ? state.loosingText : state.pullDown.pullingDownText;
43
43
  }
44
44
  state.animationDuration = 0;
45
- state.pullUpLoading = false;
46
- state.pullDownLoading = false;
47
45
  };
48
- const onTouchend = ({ api, props, state }) => () => {
46
+ const onTouchend = ({ api, props, state, emit, refs }) => (event) => {
49
47
  state.animationDuration = props.animationDuration;
50
- if (Math.abs(state.translate3d) >= state.pullDown.headHeight || Math.abs(state.translate3d) >= state.pullUp.footHeight) {
51
- if (state.translate3d >= 0) {
52
- state.translate3d = state.pullDown.headHeight;
53
- const { handler } = state.pullDown;
54
- const pullDownPromise = handler && handler();
55
- state.pullDownLoading = true;
56
- if (pullDownPromise == null ? void 0 : pullDownPromise.then) {
57
- pullDownPromise.then(
58
- () => {
59
- api.handlerModelValue("down", "success");
60
- },
61
- (e) => {
62
- api.handlerModelValue("down", "failed");
63
- }
64
- );
65
- return;
66
- }
67
- console.error(new Error("handler down is not promise"));
68
- } else {
69
- state.translate3d = -state.pullUp.footHeight;
70
- const { handler } = state.pullUp;
71
- const pullUpPromise = handler && handler();
72
- state.pullUpLoading = true;
73
- if (pullUpPromise == null ? void 0 : pullUpPromise.then) {
74
- pullUpPromise.then(
75
- () => {
76
- api.handlerModelValue("up", "success");
77
- },
78
- (e) => {
79
- api.handlerModelValue("up", "failed");
80
- }
81
- );
82
- return;
83
- }
84
- console.error(new Error("handler up is not promise"));
85
- }
86
- api.clearPullRefresh();
48
+ if (event.changedTouches[0].clientY < state.draggposition) {
49
+ pullUpTouchEnd(state, emit, refs);
87
50
  } else {
88
- state.pullUpLoading = false;
51
+ pullDownTouchEnd(api, state, emit);
52
+ }
53
+ };
54
+ const pullDownTouchEnd = (api, state, emit) => {
55
+ if (Math.abs(state.translate3d) < state.pullDown.headHeight) {
89
56
  state.pullDownLoading = false;
90
57
  api.clearPullRefresh();
58
+ return;
91
59
  }
60
+ state.translate3d = state.pullDown.headHeight;
61
+ state.pullDownLoading = true;
62
+ emit("update:modelValue", true);
63
+ emit("pullDown");
64
+ };
65
+ const pullUpTouchEnd = (state, emit, refs) => {
66
+ setTimeout(() => {
67
+ const footNode = refs.foot;
68
+ if (!state.hasMore || !footNode) {
69
+ return;
70
+ }
71
+ const contentNode = refs.content;
72
+ const bottomDis = footNode.offsetTop + footNode.clientHeight - contentNode.scrollTop - contentNode.clientHeight;
73
+ if (bottomDis <= state.pullUpDistance) {
74
+ state.pullUpLoading = true;
75
+ emit("update:modelValue", true);
76
+ emit("pullUp");
77
+ }
78
+ }, 300);
92
79
  };
93
80
  const mountedHandler = ({ api, refs }) => () => {
94
81
  const track = refs.track;
@@ -108,7 +95,7 @@ const handlerModelValue = ({ api, state }) => (value, result) => {
108
95
  if (value === "down") {
109
96
  state.pullDownReplaces = state[`${result}Text`];
110
97
  } else {
111
- state.pullUpReplaces = state[`${result}Text`];
98
+ state.pullUpStateText = state[`${result}Text`];
112
99
  }
113
100
  setTimeout(() => {
114
101
  api.clearPullRefresh();
@@ -116,8 +103,9 @@ const handlerModelValue = ({ api, state }) => (value, result) => {
116
103
  };
117
104
  const clearPullRefresh = (state) => () => {
118
105
  state.translate3d = 0;
119
- state.pullUpReplaces = "";
120
106
  state.pullDownReplaces = "";
107
+ state.pullDownLoading = false;
108
+ state.pullUpLoading = false;
121
109
  };
122
110
  export {
123
111
  beforeUnmountHandler,
@@ -127,5 +115,9 @@ export {
127
115
  mountedHandler,
128
116
  onTouchend,
129
117
  onTouchmove,
130
- onTouchstart
118
+ onTouchstart,
119
+ pullDownTouchEnd,
120
+ pullDownTouchMove,
121
+ pullUpTouchEnd,
122
+ pullUpTouchMove
131
123
  };
@@ -10,10 +10,9 @@ import {
10
10
  clearPullRefresh
11
11
  } from "./index";
12
12
  const api = ["state"];
13
- const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs }) => {
13
+ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t, refs, emit, nextTick }) => {
14
14
  const api2 = {};
15
15
  const state = reactive({
16
- pullUpReplaces: "",
17
16
  pullDownReplaces: "",
18
17
  refreshStyle: {},
19
18
  translate3d: 0,
@@ -23,17 +22,23 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
23
22
  loosingText: "",
24
23
  successText: "",
25
24
  failedText: "",
26
- noMoreText: "",
25
+ noMoreText: t("ui.pullRefresh.noMore"),
26
+ pullUpLoadingText: props.pullUpLoadingText,
27
+ pullDownLoadingText: props.pullDownLoadingText,
27
28
  pullUp: null,
28
29
  pullDown: null,
30
+ hasMore: true,
29
31
  successDuration: props.successDuration,
30
- animationDuration: props.animationDuration
32
+ animationDuration: props.animationDuration,
33
+ disabledPullDown: props.disabledPullDown,
34
+ disabledPullUp: props.disabledPullUp,
35
+ pullUpDistance: typeof props.pullUpDistance === "string" ? Number(props.pullUpDistance) : props.pullUpDistance
31
36
  });
32
37
  Object.assign(api2, {
33
38
  state,
34
39
  onTouchstart: onTouchstart(state),
35
- onTouchmove: onTouchmove({ props, state }),
36
- onTouchend: onTouchend({ api: api2, props, state }),
40
+ onTouchmove: onTouchmove({ state, refs }),
41
+ onTouchend: onTouchend({ api: api2, props, state, emit, refs }),
37
42
  mountedHandler: mountedHandler({ api: api2, refs }),
38
43
  beforeUnmountHandler: beforeUnmountHandler({ api: api2, refs }),
39
44
  handlerModelValue: handlerModelValue({ api: api2, state }),
@@ -44,7 +49,15 @@ const renderless = (props, { watch, onMounted, reactive, onBeforeUnmount }, { t,
44
49
  () => props.hasMore,
45
50
  (value) => {
46
51
  if (!value) {
47
- state.noMoreText = t("ui.pullRefresh.noMore");
52
+ state.hasMore = false;
53
+ }
54
+ },
55
+ { immediate: true }
56
+ );
57
+ watch(
58
+ () => props.modelValue,
59
+ (value) => {
60
+ if (!value) {
48
61
  api2.clearPullRefresh();
49
62
  }
50
63
  }
package/select/index.js CHANGED
@@ -86,7 +86,6 @@ const defaultOnQueryChange = ({ props, state, constants, api }) => (value) => {
86
86
  props.filterMethod(value);
87
87
  state.selectEmitter.emit(constants.COMPONENT_NAME.OptionGroup, constants.EVENT_NAME.queryChange);
88
88
  } else {
89
- state.filteredOptionsCount = state.optionsCount;
90
89
  state.selectEmitter.emit(constants.EVENT_NAME.queryChange, value);
91
90
  }
92
91
  if (props.defaultFirstOption && (props.filterable || props.remote) && state.filteredOptionsCount) {
@@ -134,6 +133,13 @@ const handleQueryChange = ({ api, constants, nextTick, props, vm, state }) => (v
134
133
  }
135
134
  api.defaultOnQueryChange(value);
136
135
  };
136
+ const debouncedQueryChange = ({ props, api }) => (event) => {
137
+ const value = props.shape ? event : event.target.value;
138
+ api.handleDebouncedQueryChange(value);
139
+ };
140
+ const handleDebouncedQueryChange = ({ state, api }) => debounce(state.debounce, (value) => {
141
+ api.handleQueryChange(value);
142
+ });
137
143
  const scrollToOption = ({ vm, constants }) => (option) => {
138
144
  const target = Array.isArray(option) && option[0] ? option[0].el : option.el;
139
145
  if (vm.$refs.popper && target) {
@@ -390,16 +396,16 @@ const blur = ({ vm, state }) => () => {
390
396
  (_a = vm.$refs.reference) == null ? void 0 : _a.blur();
391
397
  };
392
398
  const handleBlur = ({ constants, dispatch, emit, state }) => (event) => {
399
+ var _a;
393
400
  clearTimeout(state.timer);
394
401
  state.timer = setTimeout(() => {
395
- var _a;
396
402
  if (state.isSilentBlur) {
397
403
  state.isSilentBlur = false;
398
404
  } else {
399
405
  emit("blur", event);
400
406
  }
401
- dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value);
402
407
  }, 200);
408
+ dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value);
403
409
  state.softFocus = false;
404
410
  };
405
411
  const handleClearClick = (api) => (event) => {
@@ -1553,6 +1559,7 @@ export {
1553
1559
  computedShowNewOption,
1554
1560
  computedTagsStyle,
1555
1561
  debouncRquest,
1562
+ debouncedQueryChange,
1556
1563
  defaultOnQueryChange,
1557
1564
  deletePrevTag,
1558
1565
  deleteSelected,
@@ -1576,6 +1583,7 @@ export {
1576
1583
  handleClose,
1577
1584
  handleComposition,
1578
1585
  handleCopyClick,
1586
+ handleDebouncedQueryChange,
1579
1587
  handleDropdownClick,
1580
1588
  handleEnterTag,
1581
1589
  handleFocus,
package/select/vue.js CHANGED
@@ -99,7 +99,9 @@ import {
99
99
  computedGetIcon,
100
100
  computedGetTagType,
101
101
  computedShowDropdownIcon,
102
- clearNoMatchValue
102
+ clearNoMatchValue,
103
+ debouncedQueryChange,
104
+ handleDebouncedQueryChange
103
105
  } from "./index";
104
106
  import debounce from "../common/deps/debounce";
105
107
  import { isNumber } from "../common/type";
@@ -276,9 +278,8 @@ const addApi = ({ api: api2, props, state, emit, constants, parent, nextTick, di
276
278
  handleOptionSelect: handleOptionSelect({ api: api2, nextTick, props, vm, state }),
277
279
  getPluginOption: getPluginOption({ api: api2, props, state }),
278
280
  toggleCheckAll: toggleCheckAll({ api: api2, emit, state, props }),
279
- debouncedQueryChange: debounce(state.debounce, (event) => {
280
- api2.handleQueryChange(props.shape ? event : event.target.value);
281
- }),
281
+ handleDebouncedQueryChange: handleDebouncedQueryChange({ state, api: api2 }),
282
+ debouncedQueryChange: debouncedQueryChange({ props, api: api2 }),
282
283
  debouncedOnInputChange: debounce(state.debounce, () => {
283
284
  api2.onInputChange();
284
285
  }),
package/slider/index.js CHANGED
@@ -17,6 +17,7 @@ const bindKeyDown = ({ api, props, state }) => (event) => {
17
17
  if (state.disabled || state.activeIndex < 0) {
18
18
  return;
19
19
  }
20
+ event.preventDefault();
20
21
  let currentValue = 0;
21
22
  switch (event.keyCode) {
22
23
  case KEY_CODE.Home:
@@ -114,7 +115,9 @@ const bindMouseUp = ({ api, emit, state }) => () => {
114
115
  if (state.disabled || !state.isDrag) {
115
116
  return;
116
117
  }
117
- state.showTip = false;
118
+ if (state.mouseOuterBtn) {
119
+ state.showTip = false;
120
+ }
118
121
  state.isDrag = false;
119
122
  off(window, "mouseup", api.bindMouseUp);
120
123
  off(window, "mousemove", api.bindMouseMove);
@@ -123,6 +126,7 @@ const bindMouseUp = ({ api, emit, state }) => () => {
123
126
  emit("stop", api.getActiveButtonValue());
124
127
  };
125
128
  const displayTip = ({ api, nextTick, state }) => (event) => {
129
+ state.mouseOuterBtn = false;
126
130
  if (!state.showTip) {
127
131
  state.showTip = true;
128
132
  api.changeActiveValue(api.getActiveButtonIndex(event) === 0);
@@ -131,7 +135,10 @@ const displayTip = ({ api, nextTick, state }) => (event) => {
131
135
  });
132
136
  }
133
137
  };
134
- const hideTip = (state) => () => !state.isDrag && (state.showTip = false);
138
+ const hideTip = (state) => () => {
139
+ state.mouseOuterBtn = true;
140
+ !state.isDrag && (state.showTip = false);
141
+ };
135
142
  const setTipStyle = ({
136
143
  constants,
137
144
  mode,
@@ -288,7 +295,7 @@ const initSlider = ({ api, props, state }) => (value) => {
288
295
  };
289
296
  const calculateValue = ({ props, state, vm }) => (event) => {
290
297
  let currentValue = 0;
291
- if (state.sliderSize == 0) {
298
+ if (state.sliderSize === 0) {
292
299
  const handleEl = vm.$refs.slider;
293
300
  state.sliderSize = handleEl["client" + (props.vertical ? "Height" : "Width")];
294
301
  state.sliderOffset = handleEl.getBoundingClientRect();
@@ -362,9 +369,13 @@ const watchActiveValue = ({ api, emit, props, state }) => (newValue, oldValue) =
362
369
  } else {
363
370
  state.activeValue = nNewValue || 0;
364
371
  }
372
+ if (!state.isSlotTyping) {
373
+ state.slotValue = state.activeValue;
374
+ }
365
375
  };
366
376
  const watchModelValue = ({ api, state }) => (value) => {
367
377
  if (!state.innerTrigger) {
378
+ state.isInit = true;
368
379
  api.initSlider(value);
369
380
  api.setActiveButtonValue(value);
370
381
  } else {
@@ -417,6 +428,16 @@ const inputValueChange = ({ props, state, api }) => ($event, pos) => {
417
428
  }
418
429
  api.initSlider([Math.min(...state.inputValue), Math.max(...state.inputValue)]);
419
430
  };
431
+ const handleSlotInputFocus = (state) => () => {
432
+ state.isSlotTyping = true;
433
+ };
434
+ const handleSlotInputBlur = (state) => () => {
435
+ state.isSlotTyping = false;
436
+ state.slotValue = state.activeValue;
437
+ };
438
+ const handleSlotInput = (state) => (event) => {
439
+ state.activeValue = Number(event.target.value);
440
+ };
420
441
  export {
421
442
  autoSlider,
422
443
  bindEvent,
@@ -436,6 +457,9 @@ export {
436
457
  getActiveButtonValue,
437
458
  getLabels,
438
459
  getPoints,
460
+ handleSlotInput,
461
+ handleSlotInputBlur,
462
+ handleSlotInputFocus,
439
463
  hideTip,
440
464
  initSlider,
441
465
  inputValueChange,
package/slider/vue.js CHANGED
@@ -27,7 +27,10 @@ import {
27
27
  watchModelValue,
28
28
  getPoints,
29
29
  getLabels,
30
- inputValueChange
30
+ inputValueChange,
31
+ handleSlotInputFocus,
32
+ handleSlotInputBlur,
33
+ handleSlotInput
31
34
  } from "./index";
32
35
  const api = [
33
36
  "state",
@@ -54,7 +57,10 @@ const api = [
54
57
  "customBeforeAppearHook",
55
58
  "customAppearHook",
56
59
  "customAfterAppearHook",
57
- "inputValueChange"
60
+ "inputValueChange",
61
+ "handleSlotInputFocus",
62
+ "handleSlotInputBlur",
63
+ "handleSlotInput"
58
64
  ];
59
65
  const initState = ({ reactive, computed, props, api: api2, parent, inject }) => {
60
66
  const state = reactive({
@@ -85,7 +91,10 @@ const initState = ({ reactive, computed, props, api: api2, parent, inject }) =>
85
91
  rangeDiff: computed(() => props.max - props.min),
86
92
  tipValue: computed(() => api2.formatTipValue(state.activeValue)),
87
93
  formDisabled: computed(() => (parent.tinyForm || {}).disabled),
88
- disabled: computed(() => props.disabled || state.formDisabled)
94
+ disabled: computed(() => props.disabled || state.formDisabled),
95
+ slotValue: "",
96
+ isSlotTyping: false,
97
+ mouseOuterBtn: false
89
98
  });
90
99
  return state;
91
100
  };
@@ -122,9 +131,21 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
122
131
  watchActiveValue: watchActiveValue({ api: api2, emit, props, state }),
123
132
  getPoints: getPoints({ props, state }),
124
133
  getLabels: getLabels({ props, state }),
125
- inputValueChange: inputValueChange({ props, api: api2, state })
134
+ inputValueChange: inputValueChange({ props, api: api2, state }),
135
+ handleSlotInputFocus: handleSlotInputFocus(state),
136
+ handleSlotInputBlur: handleSlotInputBlur(state),
137
+ handleSlotInput: handleSlotInput(state)
126
138
  });
127
- watch(() => props.modelValue, api2.watchModelValue, { immediate: true });
139
+ watch(
140
+ () => props.modelValue,
141
+ (value) => {
142
+ if (props.max < props.min) {
143
+ throw new Error("Slider min should not be greater than max.");
144
+ }
145
+ api2.watchModelValue(value);
146
+ },
147
+ { immediate: true }
148
+ );
128
149
  watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
129
150
  watch(
130
151
  () => props.min,
@@ -142,7 +163,6 @@ const renderless = (props, { computed, onBeforeUnmount, onMounted, reactive, wat
142
163
  api2.setActiveButtonValue(value);
143
164
  }
144
165
  );
145
- watch(() => state.activeValue, api2.watchActiveValue, { immediate: true });
146
166
  watch(
147
167
  () => state.leftBtnValue,
148
168
  (newVal) => {
package/tag/vue.js CHANGED
@@ -5,7 +5,11 @@ const renderless = (props, { reactive, computed }, { emit, parent }) => {
5
5
  const state = reactive({
6
6
  type: computed(() => props.theme || props.type),
7
7
  show: true,
8
- selected: false
8
+ selected: false,
9
+ mini: props.mini,
10
+ color: props.color,
11
+ text: props.text,
12
+ maxWidth: props.maxWidth
9
13
  });
10
14
  const api2 = {
11
15
  state,
@@ -38,8 +38,7 @@ const keydown = ({ emit, props, state }) => () => {
38
38
  }
39
39
  }
40
40
  };
41
- const sortDeduplication = (array) => {
42
- const memorySpace = 5;
41
+ const sortDeduplication = (array, memorySpace = 5) => {
43
42
  const length = array.length;
44
43
  let newArray = [];
45
44
  let fillterObj = {};
@@ -74,7 +73,7 @@ const isJSONobject = (string, type) => {
74
73
  }
75
74
  }
76
75
  };
77
- const setLocalStorageage = (name, value) => {
76
+ const setLocalStorageage = (name, value, memorySpace = 5) => {
78
77
  if (typeof value === "string") {
79
78
  const oldValue = localStorage.getItem(name);
80
79
  const isArray = isJSONobject(oldValue, Array);
@@ -82,7 +81,7 @@ const setLocalStorageage = (name, value) => {
82
81
  if (oldValue && isArray) {
83
82
  let oldArray = JSON.parse(localStorage.getItem(name));
84
83
  oldArray.unshift(value);
85
- oldArray = sortDeduplication(oldArray);
84
+ oldArray = sortDeduplication(oldArray, memorySpace);
86
85
  newValue = JSON.stringify(oldArray);
87
86
  } else if (oldValue === null || oldValue === value) {
88
87
  newValue = value;
@@ -94,7 +93,7 @@ const setLocalStorageage = (name, value) => {
94
93
  };
95
94
  const addMemory = (props) => (value) => {
96
95
  if (props.name && value) {
97
- setLocalStorageage(props.name, value);
96
+ setLocalStorageage(props.name, value, props.memorySpace);
98
97
  }
99
98
  };
100
99
  const searchMemory = ({ props, state }) => (inputVal) => {
@@ -42,6 +42,11 @@ declare const actionMenuProps: {
42
42
  type: StringConstructor;
43
43
  default: string;
44
44
  };
45
+ suffixIcon: ObjectConstructor;
46
+ showIcon: {
47
+ type: BooleanConstructor;
48
+ default: boolean;
49
+ };
45
50
  tiny_mode: StringConstructor;
46
51
  tiny_mode_root: BooleanConstructor;
47
52
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -1,4 +1,4 @@
1
- import { ExtractPropTypes } from 'vue';
1
+ import { ExtractPropTypes, CSSProperties } from 'vue';
2
2
  import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
3
3
 
4
4
  declare const $constants: {
@@ -77,6 +77,18 @@ declare const alertProps: {
77
77
  default: boolean;
78
78
  };
79
79
  customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
80
+ offset: {
81
+ type: (StringConstructor | NumberConstructor)[];
82
+ default: number;
83
+ };
84
+ autoHide: {
85
+ type: BooleanConstructor;
86
+ default: boolean;
87
+ };
88
+ target: {
89
+ type: StringConstructor;
90
+ default: string;
91
+ };
80
92
  tiny_mode: StringConstructor;
81
93
  tiny_mode_root: BooleanConstructor;
82
94
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -98,6 +110,7 @@ interface IAlertState {
98
110
  type IAlertProps = ExtractPropTypes<typeof alertProps>;
99
111
  type IAlertConstants = typeof $constants;
100
112
  type IAlertRenderlessParams = ISharedRenderlessFunctionParams<IAlertConstants> & {
113
+ api: IAlertApi;
101
114
  state: IAlertState;
102
115
  props: IAlertProps;
103
116
  };
@@ -107,6 +120,8 @@ interface IAlertApi {
107
120
  computedGetTitle: () => string;
108
121
  handleClose: () => void;
109
122
  handleHeaderClick: () => void;
123
+ watchAutoHide: (value: boolean) => void;
124
+ computedStyle: () => CSSProperties;
110
125
  }
111
126
  type IAlertRenderlessParamUtils = ISharedRenderlessParamUtils<IAlertConstants>;
112
127
 
@@ -45,6 +45,7 @@ declare const buttonProps: {
45
45
  type: BooleanConstructor;
46
46
  default: boolean;
47
47
  };
48
+ ghost: BooleanConstructor;
48
49
  tiny_mode: StringConstructor;
49
50
  tiny_mode_root: BooleanConstructor;
50
51
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -1,6 +1,8 @@
1
1
  import { ExtractPropTypes, ComputedRef } from 'vue';
2
+ import { PropType } from '@opentiny/vue-common';
2
3
  import { ISharedRenderlessFunctionParams, ISharedRenderlessParamUtils } from './shared.type.js';
3
4
 
5
+ type IconPosition = 'center' | 'top';
4
6
  declare const $constants: {
5
7
  FORM_ITEM: string;
6
8
  FORM_CHANGE: string;
@@ -51,6 +53,7 @@ declare const checkboxProps: {
51
53
  type: BooleanConstructor;
52
54
  default: boolean;
53
55
  };
56
+ iconPosition: PropType<IconPosition>;
54
57
  tiny_mode: StringConstructor;
55
58
  tiny_mode_root: BooleanConstructor;
56
59
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -28,7 +28,7 @@ declare const $constants: {
28
28
  };
29
29
  declare const datePickerProps: {
30
30
  type: {
31
- type: PropType<"date" | "dates" | "year" | "years" | "yearrange" | "month" | "week" | "daterange" | "datetimerange" | "monthrange" | "datetime">;
31
+ type: PropType<"date" | "dates" | "daterange" | "week" | "month" | "monthrange" | "year" | "years" | "yearrange" | "datetime" | "datetimerange">;
32
32
  default: string;
33
33
  };
34
34
  _constants: {
@@ -250,7 +250,7 @@ declare const confirm: ({ emit, props, state }: Pick<IDropdownItemRenderlessPara
250
250
  declare const reset: ({ emit, props }: Pick<IDropdownItemRenderlessParams, 'emit' | 'props'>) => () => void;
251
251
  declare const clickOutside: (parent: IDropdownItemRenderlessParams['parent']) => () => void;
252
252
  declare const handleClick: ({ props, dispatch, vm, emit }: Pick<IDropdownItemRenderlessParams, 'props' | 'dispatch' | 'vm' | 'emit'>) => (event: MouseEvent) => void;
253
- declare const computedGetIcon: ({ constants, designConfig }: Pick<IDropdownItemRenderlessParams, 'constants' | 'designConfig'>) => (name?: string) => object;
253
+ declare const computedGetIcon: ({ constants, designConfig }: Pick<IDropdownItemRenderlessParams, 'constants' | 'designConfig'>) => (name?: string) => object | string;
254
254
  declare const getTip: ({ props, vm }: Pick<IDropdownItemRenderlessParams, 'props' | 'vm'>) => string;
255
255
 
256
256
  type IDropdownItemVm = ComponentPublicInstance & {
@@ -1,4 +1,4 @@
1
1
  import 'vue';
2
- export { k as IDropdownItemApi, i as IDropdownItemConstants, q as IDropdownItemMfDataStore, p as IDropdownItemOptionStyle, h as IDropdownItemProps, m as IDropdownItemRenderlessParamUtils, l as IDropdownItemRenderlessParams, j as IDropdownItemState, n as IDropdownItemStyle, o as IDropdownItemTag, g as IDropdownItemVm } from './dropdown-item.type-bf83e929.js';
2
+ export { k as IDropdownItemApi, i as IDropdownItemConstants, q as IDropdownItemMfDataStore, p as IDropdownItemOptionStyle, h as IDropdownItemProps, m as IDropdownItemRenderlessParamUtils, l as IDropdownItemRenderlessParams, j as IDropdownItemState, n as IDropdownItemStyle, o as IDropdownItemTag, g as IDropdownItemVm } from './dropdown-item.type-8ea6c633.js';
3
3
  import './shared.type.js';
4
4
  import './dropdown.type.js';
@@ -1,4 +1,4 @@
1
1
  import 'vue';
2
- export { b as IDropdownMenuApi, e as IDropdownMenuPopperParams, I as IDropdownMenuProps, d as IDropdownMenuRenderlessParamUtils, c as IDropdownMenuRenderlessParams, a as IDropdownMenuState, f as IDropdownMenuVm } from './dropdown-item.type-bf83e929.js';
2
+ export { b as IDropdownMenuApi, e as IDropdownMenuPopperParams, I as IDropdownMenuProps, d as IDropdownMenuRenderlessParamUtils, c as IDropdownMenuRenderlessParams, a as IDropdownMenuState, f as IDropdownMenuVm } from './dropdown-item.type-8ea6c633.js';
3
3
  import './shared.type.js';
4
4
  import './dropdown.type.js';