@opentiny/vue-renderless 3.9.2 → 3.10.0

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 (198) hide show
  1. package/action-sheet/vue.js +25 -2
  2. package/anchor/index.js +3 -3
  3. package/anchor/vue.js +7 -1
  4. package/area/index.js +4 -4
  5. package/button/vue.js +4 -2
  6. package/button-group/index.js +8 -1
  7. package/button-group/vue.js +5 -10
  8. package/calendar/index.js +14 -14
  9. package/calendar-bar/index.js +3 -3
  10. package/carousel-item/index.js +1 -1
  11. package/cascader/vue.js +1 -1
  12. package/cascader-mobile/index.js +299 -0
  13. package/cascader-mobile/vue.js +102 -0
  14. package/cascader-panel/store.js +3 -1
  15. package/chart-boxplot/index.js +0 -1
  16. package/chart-core/deps/constants.js +20 -2
  17. package/chart-core/index.js +9 -1
  18. package/chart-core/modules/extend.js +14 -1
  19. package/chart-gauge/index.js +3 -1
  20. package/chart-graph/index.js +3 -1
  21. package/chart-map/index.js +11 -1
  22. package/chart-scatter/index.js +10 -2
  23. package/chart-waterfall/index.js +4 -1
  24. package/checkbox/index.js +16 -14
  25. package/checkbox/vue.js +14 -10
  26. package/checkbox-button/vue.js +7 -3
  27. package/column-list-item/vue.js +10 -1
  28. package/common/bigInt.js +4 -11
  29. package/common/date.js +2 -2
  30. package/common/deps/ResizeObserver.js +3 -1
  31. package/common/deps/date-util.js +9 -1
  32. package/common/deps/date.js +18 -5
  33. package/common/deps/fastdom/async.js +41 -0
  34. package/common/deps/fastdom/index.js +9 -0
  35. package/common/deps/fastdom/sandbox.js +53 -0
  36. package/common/deps/fastdom/singleton.js +80 -0
  37. package/common/deps/fullscreen/screenfull.js +16 -2
  38. package/common/deps/memorize.js +3 -3
  39. package/common/deps/popup-manager.js +0 -1
  40. package/common/deps/requestAnimationFrame.js +1 -1
  41. package/common/deps/throttle.js +2 -2
  42. package/common/deps/tree-model/node.js +23 -11
  43. package/common/deps/tree-model/tree-store.js +28 -7
  44. package/common/deps/vue-popper.js +14 -2
  45. package/common/deps/vue-popup.js +16 -23
  46. package/common/index.js +7 -35
  47. package/common/runtime.js +1 -1
  48. package/common/validate/rules/type.js +3 -1
  49. package/credit-card-form/vue.js +2 -2
  50. package/date-panel/index.js +35 -31
  51. package/date-panel/vue.js +12 -12
  52. package/date-picker/index.js +9 -5
  53. package/date-picker/vue.js +20 -8
  54. package/date-picker-mobile/index.js +3 -3
  55. package/date-range/index.js +91 -19
  56. package/date-range/vue.js +19 -11
  57. package/date-table/index.js +39 -6
  58. package/date-table/vue.js +2 -2
  59. package/dept/index.js +1 -1
  60. package/detail-page/vue.js +9 -1
  61. package/dialog-box/index.js +11 -2
  62. package/dialog-box/vue.js +30 -6
  63. package/dialog-select/index.js +27 -5
  64. package/dialog-select/vue.js +11 -4
  65. package/drop-roles/index.js +3 -1
  66. package/dropdown/index.js +28 -7
  67. package/dropdown/vue.js +12 -7
  68. package/dropdown-item/index.js +9 -1
  69. package/dropdown-item/mf.js +3 -3
  70. package/dropdown-item/vue.js +12 -10
  71. package/dropdown-menu/index.js +13 -14
  72. package/dropdown-menu/vue.js +8 -7
  73. package/espace/vue.js +9 -1
  74. package/fall-menu/vue.js +12 -1
  75. package/file-upload/index.js +137 -89
  76. package/file-upload/vue.js +24 -14
  77. package/filter/index.js +1 -1
  78. package/filter/vue.js +1 -3
  79. package/floating-button/index.js +73 -0
  80. package/floating-button/vue.js +35 -0
  81. package/form/index.js +13 -4
  82. package/form/vue.js +7 -2
  83. package/form-item/index.js +4 -1
  84. package/form-item/vue.js +6 -3
  85. package/fullscreen/vue.js +24 -3
  86. package/grid/plugins/exportExcel.js +54 -8
  87. package/grid/static/base/helperGetHGSKeys.js +1 -4
  88. package/grid/utils/common.js +15 -11
  89. package/grid/utils/dom.js +5 -1
  90. package/guide/index.js +2 -3
  91. package/hrapprover/index.js +3 -1
  92. package/index-bar/vue.js +8 -1
  93. package/input/index.js +1 -11
  94. package/input/vue.js +6 -12
  95. package/ip-address/index.js +66 -33
  96. package/ip-address/vue.js +8 -1
  97. package/link-menu/vue.js +22 -2
  98. package/locales/index.js +4 -2
  99. package/logon-user/index.js +3 -1
  100. package/logout/index.js +6 -2
  101. package/milestone/vue.js +1 -1
  102. package/mini-picker/index.js +12 -10
  103. package/mini-picker/vue.js +10 -10
  104. package/modal/index.js +5 -3
  105. package/modal/vue.js +4 -2
  106. package/month-range/index.js +18 -18
  107. package/month-range/vue.js +16 -4
  108. package/month-table/index.js +7 -3
  109. package/multi-select/vue.js +1 -9
  110. package/nav-menu/index.js +33 -4
  111. package/nav-menu/vue.js +9 -1
  112. package/notify/vue.js +12 -1
  113. package/numeric/vue.js +6 -2
  114. package/option/index.js +10 -2
  115. package/option/vue.js +20 -9
  116. package/option-group/index.js +3 -1
  117. package/package.json +2 -1
  118. package/picker/index.js +88 -17
  119. package/picker/vue.js +42 -17
  120. package/picker-column/index.js +6 -6
  121. package/picker-column/vue.js +5 -5
  122. package/popconfirm/vue.js +3 -1
  123. package/popeditor/index.js +55 -13
  124. package/popeditor/vue.js +23 -7
  125. package/popover/vue.js +1 -2
  126. package/popup/vue.js +15 -2
  127. package/progress/index.js +9 -7
  128. package/progress/vue.js +12 -4
  129. package/pull-refresh/vue.js +10 -1
  130. package/query-builder/index.js +9 -0
  131. package/query-builder/vue.js +18 -0
  132. package/radio/vue.js +3 -1
  133. package/radio-button/vue.js +1 -1
  134. package/rate/index.js +8 -2
  135. package/rate/vue.js +27 -4
  136. package/recycle-scroller/index.js +0 -1
  137. package/scrollbar/vue-bar.js +18 -2
  138. package/search/index.js +12 -5
  139. package/search/vue.js +7 -5
  140. package/select/index.js +596 -304
  141. package/select/vue.js +167 -101
  142. package/select-dropdown/vue.js +8 -6
  143. package/select-mobile/index.js +26 -13
  144. package/select-mobile/vue.js +14 -5
  145. package/select-view/index.js +5 -21
  146. package/select-view/vue.js +0 -3
  147. package/selected-box/index.js +3 -1
  148. package/slider/index.js +5 -5
  149. package/slider/vue.js +16 -0
  150. package/slider-button/index.js +41 -0
  151. package/slider-button/vue.js +36 -0
  152. package/slider-button-group/slide-button.js +142 -0
  153. package/slider-button-group/vue.js +52 -0
  154. package/steps/slide-bar.js +0 -1
  155. package/switch/index.js +1 -1
  156. package/switch/vue.js +1 -1
  157. package/tab-bar/index.js +8 -6
  158. package/tab-nav/index.js +19 -13
  159. package/tab-nav/vue.js +10 -9
  160. package/tabs/index.js +21 -17
  161. package/tabs/vue.js +1 -4
  162. package/tag/vue.js +2 -1
  163. package/tag-group/index.js +23 -10
  164. package/tag-group/vue.js +5 -4
  165. package/time/index.js +8 -8
  166. package/time/vue.js +9 -9
  167. package/time-line/index.js +24 -2
  168. package/time-line/vue.js +30 -4
  169. package/time-panel/index.js +2 -2
  170. package/time-panel/vue.js +2 -2
  171. package/time-range/index.js +24 -21
  172. package/time-range/vue.js +26 -16
  173. package/time-spinner/index.js +32 -21
  174. package/time-spinner/vue.js +37 -12
  175. package/timeline-item/index.js +77 -0
  176. package/timeline-item/vue.js +44 -0
  177. package/toggle-menu/vue.js +0 -1
  178. package/tooltip/index.js +11 -12
  179. package/tooltip/vue.js +11 -1
  180. package/top-box/vue.js +13 -1
  181. package/tree/index.js +228 -15
  182. package/tree/vue.js +119 -15
  183. package/tree-menu/index.js +35 -0
  184. package/tree-menu/vue.js +27 -5
  185. package/tree-node/index.js +75 -10
  186. package/tree-node/vue.js +45 -23
  187. package/upload/index.js +90 -49
  188. package/upload/vue.js +22 -10
  189. package/upload-dragger/index.js +4 -3
  190. package/upload-list/index.js +67 -16
  191. package/upload-list/vue.js +26 -9
  192. package/user/index.js +7 -4
  193. package/user-link/index.js +2 -1
  194. package/wizard/index.js +4 -1
  195. package/wizard/vue.js +19 -2
  196. package/year-range/index.js +1 -1
  197. package/year-range/vue.js +3 -3
  198. package/year-table/index.js +2 -2
package/input/vue.js CHANGED
@@ -30,9 +30,7 @@ import {
30
30
  handleEnterDisplayOnlyContent,
31
31
  hiddenPassword,
32
32
  dispatchDisplayedValue,
33
- getDisplayedValue,
34
- handleDrop,
35
- handleDragStart
33
+ getDisplayedValue
36
34
  } from "./index";
37
35
  import useStorageBox from "../tall-storage/vue-storage-box";
38
36
  const api = [
@@ -65,11 +63,9 @@ const api = [
65
63
  "isMemoryStorage",
66
64
  "hasSelection",
67
65
  "handleEnterDisplayOnlyContent",
68
- "hiddenPassword",
69
- "handleDrop",
70
- "handleDragStart"
66
+ "hiddenPassword"
71
67
  ];
72
- const initState = ({ reactive, computed, mode, props, parent, constants }) => {
68
+ const initState = ({ reactive, computed, mode, props, parent, constants, api: api2 }) => {
73
69
  const state = reactive({
74
70
  mode,
75
71
  focused: false,
@@ -111,7 +107,7 @@ const initState = ({ reactive, computed, mode, props, parent, constants }) => {
111
107
  () => (props.displayOnly || (parent.tinyForm || {}).displayOnly) && ["text", "textarea", "password", "number"].includes(props.type)
112
108
  ),
113
109
  displayOnlyTooltip: "",
114
- hiddenPassword: computed(() => api.hiddenPassword())
110
+ hiddenPassword: computed(() => api2.hiddenPassword())
115
111
  });
116
112
  return state;
117
113
  };
@@ -131,9 +127,7 @@ const initApi = ({ api: api2, state, dispatch, broadcast, emit, refs, props, CLA
131
127
  handleCompositionStart: handleCompositionStart(state),
132
128
  handleCompositionUpdate: handleCompositionUpdate(state),
133
129
  dispatchDisplayedValue: dispatchDisplayedValue({ state, props, dispatch, api: api2 }),
134
- getDisplayedValue: getDisplayedValue({ state, props }),
135
- handleDrop: handleDrop(emit),
136
- handleDragStart: handleDragStart(emit)
130
+ getDisplayedValue: getDisplayedValue({ state, props })
137
131
  });
138
132
  };
139
133
  const mergeApi = ({ storages, api: api2, componentName, props, emit, eventName, nextTick, parent, state, refs }) => {
@@ -233,7 +227,7 @@ const renderless = (props, { computed, onMounted, onUpdated, reactive, toRefs, w
233
227
  Input: constants.inputMode(mode),
234
228
  InputGroup: constants.inputGroupMode(mode)
235
229
  };
236
- const state = initState({ reactive, computed, mode, props, parent, constants });
230
+ const state = initState({ reactive, computed, mode, props, parent, constants, api: api2 });
237
231
  initApi({ api: api2, state, dispatch, broadcast, emit, refs, props, CLASS_PREFIX, parent });
238
232
  const storages = useStorageBox({ api: api2, props, reactive, toRefs });
239
233
  parent.tinyForm = parent.tinyForm || inject("form", null);
@@ -6,7 +6,7 @@ const ipValidator = ({ props, api }) => (value) => {
6
6
  let result = true;
7
7
  if (props.type) {
8
8
  if (api.isIP6(props.type)) {
9
- result = typeof value === "string";
9
+ result = /^(((([\da-fA-F]{1,4}):){7}([\da-fA-F]{1,4}))|(((([\da-fA-F]{1,4}):){1,7}:)|((([\da-fA-F]{1,4}):){6}:([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){5}:(([\da-fA-F]{1,4}):)?([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){4}:(([\da-fA-F]{1,4}):){0,2}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){3}:(([\da-fA-F]{1,4}):){0,3}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){2}:(([\da-fA-F]{1,4}):){0,4}([\da-fA-F]{1,4}))|((([\da-fA-F]{1,4}):){1}:(([\da-fA-F]{1,4}):){0,5}([\da-fA-F]{1,4}))|(::(([\da-fA-F]{1,4}):){0,6}([\da-fA-F]{1,4}))|(::([\da-fA-F]{1,4})?))|(((([\da-fA-F]{1,4}):){6}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){5}:(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){4}:(([\da-fA-F]{1,4}):)?(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){3}:(([\da-fA-F]{1,4}):){0,2}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|((([\da-fA-F]{1,4}):){2}:(([\da-fA-F]{1,4}):){0,3}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(([\da-fA-F]{1,4})::(([\da-fA-F]{1,4}):){0,4}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))|(::(([\da-fA-F]{1,4}):){0,5}(((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5]))\.){3}((1?[1-9]?\d)|(10\d)|(2[0-4]\d)|(25[0-5])))))$/.test(value);
10
10
  } else if (api.isIP4(props.type)) {
11
11
  result = /^((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})(\.((2(5[0-5]|[0-4]\d))|[0-1]?\d{1,2})){3}$/.test(value);
12
12
  }
@@ -30,7 +30,13 @@ const getValue = ({ api, props, state }) => () => {
30
30
  const valueArr = [];
31
31
  let result = "";
32
32
  if (api.isIP6(props.type)) {
33
- result = state.address[0].value || "";
33
+ state.address.forEach((item) => {
34
+ if (item.value) {
35
+ item.value = item.value.replace(/[^a-fA-F\d]/g, "");
36
+ }
37
+ item.value && valueArr.push(item.value);
38
+ });
39
+ result = state.address.filter((item) => item.value).length === 8 ? valueArr.join(":") : "";
34
40
  } else {
35
41
  state.address.forEach((item) => {
36
42
  if (api.isIP4(props.type) && item.value) {
@@ -46,13 +52,25 @@ const setValue = ({ api, props, state }) => (value) => {
46
52
  if (value) {
47
53
  if (api.ipValidator(value)) {
48
54
  if (api.isIP6(props.type)) {
49
- state.address = [{ value }];
55
+ state.address = value.split(":").map((item) => ({ value: item }));
56
+ if (state.address.length < 8) {
57
+ let insertIndex = 0;
58
+ state.address.forEach((item, index) => {
59
+ if (item.value === "") {
60
+ item.value = "0000";
61
+ insertIndex = index;
62
+ }
63
+ });
64
+ for (var i = 0; i <= 8 - state.address.length; i++) {
65
+ state.address.splice(insertIndex, 0, { value: "0000" });
66
+ }
67
+ }
50
68
  } else {
51
69
  state.address = value.split(".").map((item) => ({ value: item }));
52
70
  }
53
71
  }
54
72
  } else {
55
- state.address = api.isIP6(props.type) ? [{ value: "" }] : [{ value: "" }, { value: "" }, { value: "" }, { value: "" }];
73
+ state.address = api.isIP6(props.type) ? new Array(8).fill({ value: "" }) : new Array(4).fill({ value: "" });
56
74
  }
57
75
  };
58
76
  const activeEvent = ({ emit, parent, state, index, event, type }) => {
@@ -87,7 +105,11 @@ const inputEvent = ({ api, componentName, emit, eventName, props }) => ({ item,
87
105
  item.value = "";
88
106
  }
89
107
  } else {
90
- item.value = val.replace(/[\u4E00-\u9FA5]/g, "");
108
+ if (!index && api.ipValidator(val)) {
109
+ api.setValue(val);
110
+ } else if (val.length > 4) {
111
+ item.value = item.value.slice(0, 4);
112
+ }
91
113
  }
92
114
  value = api.getValue();
93
115
  emit("update:modelValue", value, index);
@@ -125,6 +147,17 @@ const keyup = ({ api, props }) => ({ item, index, event }) => {
125
147
  return false;
126
148
  }
127
149
  }
150
+ if (api.isIP6(props.type)) {
151
+ if ([KEY_CODE.Tab, KEY_CODE.Space, KEY_CODE.NumpadDecimal, KEY_CODE.NumpadComma].includes(keyCode) && value) {
152
+ api.select({ index: nextIndex });
153
+ return false;
154
+ }
155
+ if ((value.length === 4 || value === "0000") && (!isNaN(event.key) || keyCode >= KEY_CODE.KeyA && keyCode <= KEY_CODE.KeyF)) {
156
+ api.focus({ index: nextIndex });
157
+ api.select({ index: nextIndex });
158
+ return false;
159
+ }
160
+ }
128
161
  };
129
162
  const checkError1 = ({ Tab, Space, NumpadDecimal, NumpadComma, keyCode, value }) => [Tab, Space, NumpadDecimal, NumpadComma].includes(keyCode) && value;
130
163
  const checkError2 = (newValue) => newValue && (isNaN(newValue) || newValue > IPTHRESHOLD.Max);
@@ -146,34 +179,34 @@ const keydown = ({ api, props, state }) => ({ item, index, event }) => {
146
179
  const nextIndex = index + 1;
147
180
  const lastIndex = index - 1;
148
181
  const newValue = isSelected && !isfilterKeyCodes && value.substr(0, selectionStart) + key + value.substr(selectionEnd);
149
- if (api.isIP4(props.type)) {
150
- state.isDel = keyCode === KEY_CODE.Backspace || keyCode === KEY_CODE.Delete;
151
- if (keyCode === KEY_CODE.Backspace && cursorPosition === 0 && !selectionEnd) {
152
- api.focus({ index: lastIndex });
153
- return false;
154
- }
155
- if (keyCode === KEY_CODE.ArrowLeft && cursorPosition === 0) {
156
- api.focus({ index: lastIndex });
157
- event.preventDefault();
158
- return false;
159
- }
160
- if (keyCode === KEY_CODE.ArrowRight && cursorPosition === value.length) {
161
- api.focus({ index: nextIndex });
162
- event.preventDefault();
163
- return false;
164
- }
165
- if (isError({
166
- key,
167
- value,
168
- isSelected,
169
- isfilterKeyCodes,
170
- ctrlKey,
171
- keyCode,
172
- newValue
173
- })) {
174
- event.preventDefault();
175
- return false;
176
- }
182
+ state.isDel = keyCode === KEY_CODE.Backspace || keyCode === KEY_CODE.Delete;
183
+ if (keyCode === KEY_CODE.Backspace && cursorPosition === 0 && !selectionEnd) {
184
+ api.focus({ index: lastIndex });
185
+ return false;
186
+ }
187
+ if (keyCode === KEY_CODE.ArrowLeft && cursorPosition === 0) {
188
+ api.focus({ index: lastIndex });
189
+ event.preventDefault();
190
+ return false;
191
+ }
192
+ if (keyCode === KEY_CODE.ArrowRight && cursorPosition === value.length) {
193
+ api.focus({ index: nextIndex });
194
+ event.preventDefault();
195
+ return false;
196
+ }
197
+ if (isError({
198
+ key,
199
+ value,
200
+ isSelected,
201
+ isfilterKeyCodes,
202
+ ctrlKey,
203
+ keyCode,
204
+ newValue,
205
+ api,
206
+ props
207
+ })) {
208
+ event.preventDefault();
209
+ return false;
177
210
  }
178
211
  };
179
212
  const getHeightOfSize = (size, isLineHeight = "height") => {
package/ip-address/vue.js CHANGED
@@ -24,7 +24,14 @@ const initState = ({ reactive, computed, handleValue, parent, props }) => {
24
24
  const state = reactive(__spreadProps(__spreadValues({}, handleValue.state), {
25
25
  active: false,
26
26
  isSelected: false,
27
- filterKeyCodes: [KEY_CODE.AtMark, KEY_CODE.Backspace, KEY_CODE.ArrowLeft, KEY_CODE.ArrowRight, KEY_CODE.Tab, KEY_CODE.Delete],
27
+ filterKeyCodes: [
28
+ KEY_CODE.AtMark,
29
+ KEY_CODE.Backspace,
30
+ KEY_CODE.ArrowLeft,
31
+ KEY_CODE.ArrowRight,
32
+ KEY_CODE.Tab,
33
+ KEY_CODE.Delete
34
+ ],
28
35
  formDisabled: computed(() => (parent.tinyForm || {}).disabled),
29
36
  disabled: computed(() => props.disabled || state.formDisabled),
30
37
  heightStyle: computed(() => getHeightOfSize(props.size)),
package/link-menu/vue.js CHANGED
@@ -1,8 +1,28 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import { initData, dialogTitle, disabledParentNode, filterNode, getValue, hideDialog, showDialog, sureNodevalue, disabledTreeNode, initService } from "./index";
2
+ import {
3
+ initData,
4
+ dialogTitle,
5
+ disabledParentNode,
6
+ filterNode,
7
+ getValue,
8
+ hideDialog,
9
+ showDialog,
10
+ sureNodevalue,
11
+ disabledTreeNode,
12
+ initService
13
+ } from "./index";
3
14
  import { copyArray } from "../common/object";
4
15
  import { setMenuKey } from "../tree-menu";
5
- const api = ["state", "initData", "filterNode", "getValue", "hideDialog", "setMenuKey", "showDialog", "sureNodevalue"];
16
+ const api = [
17
+ "state",
18
+ "initData",
19
+ "filterNode",
20
+ "getValue",
21
+ "hideDialog",
22
+ "setMenuKey",
23
+ "showDialog",
24
+ "sureNodevalue"
25
+ ];
6
26
  const initState = ({ reactive, computed, api: api2 }) => {
7
27
  const state = reactive({
8
28
  filterText: "",
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((/* @__PURE__ */ new Date()).getTime() + 36e5).toGMTString();
20
+ const expires = new Date(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();
@@ -59,7 +59,9 @@ const initService = ({ props, service }) => {
59
59
  const { options = {} } = setting;
60
60
  const noopFnCreator = (propName) => () => {
61
61
  if (propName) {
62
- return Promise.reject(new Error(`[TINY Error][Locale] Prop ${propName} is not configured`));
62
+ return Promise.reject(
63
+ new Error(`[TINY Error][Locale] Prop ${propName} is mandatory when the framework service is not used`)
64
+ );
63
65
  } else {
64
66
  return Promise.resolve(null);
65
67
  }
@@ -7,7 +7,9 @@ const init = ({ service, state }) => () => {
7
7
  };
8
8
  const initService = ({ props, service }) => {
9
9
  const { base = {} } = service || {};
10
- const getUserInfoNoop = () => Promise.reject(new Error("[TINY Error][LogonUser] Prop getUserInfo is not configured"));
10
+ const getUserInfoNoop = () => Promise.reject(
11
+ new Error("[TINY Error][LogonUser] Prop getUserInfo is mandatory when the framework service is not used")
12
+ );
11
13
  return {
12
14
  getUserInfo: props.getUserInfo || base.getUserInfo || getUserInfoNoop
13
15
  };
package/logout/index.js CHANGED
@@ -38,9 +38,13 @@ const logout = ({ service, state, props }) => () => {
38
38
  const initService = ({ props, service }) => {
39
39
  const noopFnCreator = (propName) => () => {
40
40
  if (propName) {
41
- return Promise.reject(new Error(`[TINY Error][Logout] Prop ${propName} is not configured`));
41
+ return Promise.reject(
42
+ new Error(`[TINY Error][Logout] Prop ${propName} is mandatory when the framework service is not used`)
43
+ );
42
44
  } else {
43
- return Promise.reject(new Error("[TINY Error][Logout] This component depends on @opentiny/vue-service"));
45
+ return Promise.reject(
46
+ new Error("[TINY Error][Logout] Prop service is mandatory when the framework service is not used")
47
+ );
44
48
  }
45
49
  };
46
50
  const { base = {}, common = {}, setting = {}, network = {}, ajax = {}, message = {} } = service || {};
package/milestone/vue.js CHANGED
@@ -21,7 +21,7 @@ const renderless = (props, { reactive }, { emit, refs, constants }) => {
21
21
  getLineColor: getLineColor(props),
22
22
  getMileContent: getMileContent(props),
23
23
  handleFlagClick: handleFlagClick(emit),
24
- handleClick: handleClick({ emit, state }),
24
+ handleClick: handleClick({ emit }),
25
25
  getMileIcon: getMileIcon({ constants, props }),
26
26
  flagOprate: flagOprate({ constants, refs, state })
27
27
  };
@@ -56,8 +56,8 @@ const getColumnValue = (api) => (index) => {
56
56
  const column = api.getColumn(index);
57
57
  return column && column.getValue();
58
58
  };
59
- const confirm = ({ api, refs }) => () => {
60
- const children = refs.childrenPicker;
59
+ const confirm = ({ api, childrenPickerRefs }) => () => {
60
+ const children = childrenPickerRefs.childrenPicker;
61
61
  children && children.forEach((child) => child.onTransitionEnd());
62
62
  api.emitEvent("confirm");
63
63
  api.visibleHandle();
@@ -73,13 +73,13 @@ const emitEvent = ({ api, state, emit }) => (event) => {
73
73
  emit(event, api.getValues(), api.getIndexes());
74
74
  }
75
75
  };
76
- const getColumn = (refs) => (index) => {
77
- const children = refs.childrenPicker;
76
+ const getColumn = (childrenPickerRefs) => (index) => {
77
+ const children = childrenPickerRefs.childrenPicker;
78
78
  return children[index];
79
79
  };
80
80
  const getColumnIndex = (api) => (columnIndex) => (api.getColumn(columnIndex) || {}).state.currentIndex;
81
- const getValues = (refs) => () => refs.childrenPicker && refs.childrenPicker.map((child) => child.getValue());
82
- const getIndexes = (refs) => () => refs.childrenPicker && refs.childrenPicker.map((child) => child.state.currentIndex);
81
+ const getValues = (childrenPickerRefs) => () => childrenPickerRefs.childrenPicker && childrenPickerRefs.childrenPicker.map((child) => child.getValue());
82
+ const getIndexes = (childrenPickerRefs) => () => childrenPickerRefs.childrenPicker && childrenPickerRefs.childrenPicker.map((child) => child.state.currentIndex);
83
83
  const setIndexes = (api) => (indexes) => {
84
84
  indexes.forEach((optionIndex, columnIndex) => {
85
85
  api.setColumnIndex(columnIndex, optionIndex);
@@ -89,9 +89,9 @@ const setColumnIndex = (api) => (columnIndex, optionIndex) => {
89
89
  const column = api.getColumn(columnIndex);
90
90
  column && column.setIndex(optionIndex);
91
91
  };
92
- const getColumnValues = (refs) => (index) => (refs.childrenPicker[index] || {}).state.columnsItem.values;
93
- const setColumnValues = (refs) => (index, options) => {
94
- const children = refs.childrenPicker;
92
+ const getColumnValues = (childrenPickerRefs) => (index) => (childrenPickerRefs.childrenPicker[index] || {}).state.columnsItem.values;
93
+ const setColumnValues = (childrenPickerRefs) => (index, options) => {
94
+ const children = childrenPickerRefs.childrenPicker;
95
95
  const column = children[index];
96
96
  if (column) {
97
97
  column.setOptions(options);
@@ -132,7 +132,9 @@ const getChildrenComponent = ({ state, vm, constants }) => {
132
132
  const childrenName = constants.CHILDREN_PICKER;
133
133
  const children = [];
134
134
  for (let index = 0; index < state.formattedColumns.length; index++) {
135
- children.push(Array.isArray(vm.$refs[childrenName + index]) ? vm.$refs[childrenName + index][0] : vm.$refs[childrenName + index]);
135
+ children.push(
136
+ Array.isArray(vm.$refs[childrenName + index]) ? vm.$refs[childrenName + index][0] : vm.$refs[childrenName + index]
137
+ );
136
138
  }
137
139
  return children;
138
140
  };
@@ -59,22 +59,22 @@ const initState = ({ reactive, computed, props, api: api2 }) => {
59
59
  });
60
60
  return state;
61
61
  };
62
- const initApi = ({ api: api2, props, state, emit, refs }) => {
62
+ const initApi = ({ api: api2, props, state, emit, childrenPickerRefs }) => {
63
63
  Object.assign(api2, {
64
64
  state,
65
- getColumn: getColumn(refs),
66
- getValues: getValues(refs),
67
- getIndexes: getIndexes(refs),
65
+ getColumn: getColumn(childrenPickerRefs),
66
+ getValues: getValues(childrenPickerRefs),
67
+ getIndexes: getIndexes(childrenPickerRefs),
68
68
  getDataType: getDataType(state),
69
69
  visibleHandle: visibleHandle(emit),
70
70
  formatCascade: formatCascade({ state, props }),
71
- getColumnValues: getColumnValues(refs),
72
- setColumnValues: setColumnValues(refs),
71
+ getColumnValues: getColumnValues(childrenPickerRefs),
72
+ setColumnValues: setColumnValues(childrenPickerRefs),
73
73
  emitEvent: emitEvent({ api: api2, state, emit }),
74
74
  change: change(api2),
75
75
  onChange: onChange({ api: api2, state, emit }),
76
76
  cancel: cancel({ api: api2, emit }),
77
- confirm: confirm({ api: api2, refs }),
77
+ confirm: confirm({ api: api2, childrenPickerRefs }),
78
78
  format: format({ state, api: api2 }),
79
79
  setValues: setValues(api2),
80
80
  setIndexes: setIndexes(api2),
@@ -103,13 +103,13 @@ const initWatch = ({ watch, props, state, api: api2 }) => {
103
103
  };
104
104
  const renderless = (props, { computed, onMounted, reactive, watch }, { emit, nextTick, vm, constants }) => {
105
105
  const api2 = {};
106
- const refs = { childrenPicker: null };
106
+ const childrenPickerRefs = { childrenPicker: null };
107
107
  const state = initState({ reactive, computed, props, api: api2 });
108
- initApi({ api: api2, props, state, emit, refs });
108
+ initApi({ api: api2, props, state, emit, childrenPickerRefs });
109
109
  initWatch({ watch, props, state, api: api2 });
110
110
  onMounted(() => {
111
111
  nextTick(() => {
112
- refs.childrenPicker = getChildrenComponent({ state, vm, constants });
112
+ childrenPickerRefs.childrenPicker = getChildrenComponent({ state, vm, constants });
113
113
  });
114
114
  api2.format();
115
115
  state.clumnsWrapHeight = state.itemHeight * state.visibleItemCount;
package/modal/index.js CHANGED
@@ -132,14 +132,16 @@ const removeMsgQueue = ({ api, parent }) => () => {
132
132
  }
133
133
  api.updateStyle();
134
134
  };
135
- const updateStyle = (nextTick) => () => {
135
+ const updateStyle = ({ nextTick, props }) => () => {
136
136
  nextTick(() => {
137
137
  let offsetTop = 0;
138
+ let distance = props.top;
138
139
  MsgQueue.forEach((comp) => {
139
- offsetTop += parseFloat(comp.top);
140
+ offsetTop += parseFloat(distance);
140
141
  comp.state.modalTop = offsetTop;
141
- const modalBox = comp.$el.querySelector(".tiny-modal__box");
142
+ const modalBox = comp.$refs.modalBox;
142
143
  offsetTop += modalBox.clientHeight;
144
+ distance = 15;
143
145
  });
144
146
  });
145
147
  };
package/modal/vue.js CHANGED
@@ -55,13 +55,15 @@ const renderless = (props, { computed, onMounted, onBeforeUnmount, reactive, wat
55
55
  modalZindex: 0,
56
56
  zoomLocat: null,
57
57
  isMsg: computed(() => api2.computedIsMsg(props)),
58
- prevEvent: null
58
+ prevEvent: null,
59
+ options: [],
60
+ theme: props.tiny_theme
59
61
  });
60
62
  Object.assign(api2, {
61
63
  state,
62
64
  broadcast,
63
65
  computedIsMsg: computedIsMsg(),
64
- updateStyle: updateStyle(nextTick),
66
+ updateStyle: updateStyle({ nextTick, props }),
65
67
  getBox: getBox(refs),
66
68
  watchValue: watchValue(api2),
67
69
  created: created({ api: api2, props, state }),
@@ -6,20 +6,20 @@ const calcDefaultValue = (defaultValue) => {
6
6
  } else if (defaultValue) {
7
7
  return [new Date(defaultValue), nextMonth(new Date(defaultValue))];
8
8
  }
9
- return [/* @__PURE__ */ new Date(), nextMonth(/* @__PURE__ */ new Date())];
9
+ return [new Date(), nextMonth(new Date())];
10
10
  };
11
- const watchValue = ({ state }) => (value) => {
12
- if (!value) {
11
+ const watchValue = ({ state }) => (val) => {
12
+ if (!val) {
13
13
  state.maxDate = null;
14
14
  state.minDate = null;
15
- } else if (Array.isArray(value)) {
16
- if (isDate(value[0])) {
17
- state.minDate = new Date(value[0]);
15
+ } else if (Array.isArray(val)) {
16
+ if (isDate(val[0])) {
17
+ state.minDate = new Date(val[0]);
18
18
  } else {
19
19
  state.minDate = null;
20
20
  }
21
- if (isDate(value[1])) {
22
- state.maxDate = new Date(value[1]);
21
+ if (isDate(val[1])) {
22
+ state.maxDate = new Date(val[1]);
23
23
  } else {
24
24
  state.maxDate = null;
25
25
  }
@@ -59,33 +59,33 @@ const handleChangeRange = (state) => (val) => {
59
59
  };
60
60
  const handleRangePick = ({ api, state, t }) => (val, close = true) => {
61
61
  const defaultTime = state.defaultTime || [];
62
- const maxDate = modifyWithTimeString(val.maxDate, defaultTime[1], t);
63
- const minDate = modifyWithTimeString(val.minDate, defaultTime[0], t);
64
- if (state.minDate === minDate && state.maxDate === maxDate) {
62
+ const max = modifyWithTimeString(val.maxDate, defaultTime[1], t);
63
+ const min = modifyWithTimeString(val.minDate, defaultTime[0], t);
64
+ if (state.minDate === min && state.maxDate === max) {
65
65
  return;
66
66
  }
67
67
  if (state.onPick) {
68
68
  state.onPick(val);
69
69
  }
70
- state.minDate = minDate;
71
- state.maxDate = maxDate;
70
+ state.minDate = min;
71
+ state.maxDate = max;
72
72
  setTimeout(() => {
73
- state.minDate = minDate;
74
- state.maxDate = maxDate;
73
+ state.minDate = min;
74
+ state.maxDate = max;
75
75
  }, 10);
76
76
  if (!close) {
77
77
  return;
78
78
  }
79
79
  api.handleConfirm();
80
80
  };
81
- const handleShortcutClick = (api) => (shortcut) => {
82
- if (shortcut.onClick) {
81
+ const handleShortcutClick = (api) => (shortcutObj) => {
82
+ if (shortcutObj.onClick) {
83
83
  const choose = {
84
84
  $emit: (type, [start, end]) => {
85
85
  api.doPick(start, end);
86
86
  }
87
87
  };
88
- shortcut.onClick(choose);
88
+ shortcutObj.onClick(choose);
89
89
  }
90
90
  };
91
91
  const doPick = (emit) => (begin, end) => {
@@ -16,7 +16,17 @@ import {
16
16
  doPick
17
17
  } from "./index";
18
18
  import { nextYear } from "../common/deps/date-util";
19
- const api = ["state", "rightNextYear", "rightPrevYear", "handleRangePick", "handleShortcutClick", "handleChangeRange", "leftPrevYear", "leftNextYear"];
19
+ const api = [
20
+ "state",
21
+ "rightNextYear",
22
+ "rightPrevYear",
23
+ "handleRangePick",
24
+ "handleShortcutClick",
25
+ "handleChangeRange",
26
+ "leftPrevYear",
27
+ "leftNextYear",
28
+ "isValidValue"
29
+ ];
20
30
  const initState = ({ reactive, computed, api: api2, t }) => {
21
31
  const state = reactive({
22
32
  popperClass: "",
@@ -25,8 +35,8 @@ const initState = ({ reactive, computed, api: api2, t }) => {
25
35
  defaultTime: null,
26
36
  minDate: "",
27
37
  maxDate: "",
28
- leftDate: /* @__PURE__ */ new Date(),
29
- rightDate: nextYear(/* @__PURE__ */ new Date()),
38
+ leftDate: new Date(),
39
+ rightDate: nextYear(new Date()),
30
40
  rangeState: { endDate: null, selecting: false, row: null, column: null },
31
41
  shortcuts: "",
32
42
  visible: "",
@@ -34,7 +44,9 @@ const initState = ({ reactive, computed, api: api2, t }) => {
34
44
  format: "",
35
45
  arrowControl: false,
36
46
  unlinkPanels: false,
37
- btnDisabled: computed(() => !(state.minDate && state.maxDate && !state.selecting && api2.isValidValue([state.minDate, state.maxDate]))),
47
+ btnDisabled: computed(
48
+ () => !(state.minDate && state.maxDate && !state.selecting && api2.isValidValue([state.minDate, state.maxDate]))
49
+ ),
38
50
  leftLabel: computed(() => state.leftDate.getFullYear() + " " + t("ui.datepicker.year")),
39
51
  rightLabel: computed(() => state.rightDate.getFullYear() + " " + t("ui.datepicker.year")),
40
52
  leftYear: computed(() => state.leftDate.getFullYear()),
@@ -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(/* @__PURE__ */ new Date());
25
+ const now = getMonthTimestamp(new Date());
26
26
  const { date, minDate, maxDate } = props;
27
27
  for (let i = 0; i < 3; i++) {
28
28
  const row = tableRows[i];
@@ -61,6 +61,7 @@ const markRange = ({ props, state }) => (minDate, maxDate) => {
61
61
  minDate = getMonthTimestamp(minDate);
62
62
  maxDate = getMonthTimestamp(maxDate);
63
63
  if (minDate > maxDate) {
64
+ ;
64
65
  [minDate, maxDate] = [maxDate, minDate];
65
66
  }
66
67
  const rows = state.rows;
@@ -155,12 +156,15 @@ const cellMatchesDate = (props) => (cell, date) => {
155
156
  const getCellStyle = ({ api, props }) => (cell) => {
156
157
  const style = {};
157
158
  const year = props.date.getFullYear();
158
- const today = /* @__PURE__ */ new Date();
159
+ const today = new Date();
159
160
  const month = cell.text;
160
161
  const defaultValue = props.defaultValue ? Array.isArray(props.defaultValue) ? props.defaultValue : [props.defaultValue] : [];
161
162
  style.disabled = typeof props.disabledDate === "function" ? datesInMonth(year, month).every(props.disabledDate) : false;
162
163
  const execDate = typeof props.value === "object" ? props.value : toDate(props.value);
163
- style.current = arrayFindIndex(coerceTruthyValueToArray(execDate), (date) => date.getFullYear() === year && date.getMonth() === month) >= 0;
164
+ style.current = arrayFindIndex(
165
+ coerceTruthyValueToArray(execDate),
166
+ (date) => date.getFullYear() === year && date.getMonth() === month
167
+ ) >= 0;
164
168
  style.today = today.getFullYear() === year && today.getMonth() === month;
165
169
  style.default = defaultValue.some((date) => api.cellMatchesDate(cell, date));
166
170
  if (cell.inRange) {
@@ -1,13 +1,5 @@
1
1
  import "../chunk-PKUHTIDK.js";
2
- import {
3
- created,
4
- handleClick,
5
- confirm,
6
- reset,
7
- wheelChange,
8
- clickWheelItem,
9
- loadDefault
10
- } from "./index";
2
+ import { created, handleClick, confirm, reset, wheelChange, clickWheelItem, loadDefault } from "./index";
11
3
  const api = [
12
4
  "state",
13
5
  "created",