@opentiny/vue-renderless 3.15.0 → 3.16.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 (47) hide show
  1. package/calendar-view/vue.js +1 -1
  2. package/common/index.js +1 -1
  3. package/common/runtime.js +1 -1
  4. package/dialog-box/index.js +26 -3
  5. package/dialog-box/vue.js +7 -3
  6. package/drawer/index.js +15 -4
  7. package/drawer/vue.js +2 -1
  8. package/espace/index.js +2 -1
  9. package/file-upload/index.js +27 -16
  10. package/file-upload/vue.js +9 -3
  11. package/grid/utils/common.js +7 -3
  12. package/grid/utils/dom.js +2 -1
  13. package/milestone/index.js +4 -3
  14. package/modal/index.js +6 -1
  15. package/option/index.js +1 -1
  16. package/option/vue.js +2 -8
  17. package/package.json +1 -1
  18. package/recycle-scroller/vue.js +2 -1
  19. package/rich-text/index.js +2 -2
  20. package/select/index.js +2 -0
  21. package/slider/index.js +1 -0
  22. package/tab-nav/index.js +6 -5
  23. package/tab-nav/vue.js +1 -1
  24. package/tabs/index.js +8 -2
  25. package/time-range/index.js +2 -2
  26. package/time-spinner/index.js +11 -1
  27. package/time-spinner/vue.js +1 -1
  28. package/tree/index.js +4 -1
  29. package/tree/vue.js +1 -4
  30. package/types/checkbox.type.d.ts +4 -0
  31. package/types/date-picker.type.d.ts +1 -1
  32. package/types/dialog-box.type.d.ts +5 -1
  33. package/types/drawer.type.d.ts +13 -0
  34. package/types/file-upload.type.d.ts +1 -1
  35. package/types/{index-b012f687.d.ts → index-a975a7a2.d.ts} +2 -0
  36. package/types/picker.type.d.ts +1 -1
  37. package/types/popeditor.type.d.ts +2 -2
  38. package/types/statistic.type.d.ts +2 -3
  39. package/types/tab-bar.type.d.ts +1 -1
  40. package/types/tab-nav.type.d.ts +1 -1
  41. package/types/tabs.type.d.ts +3 -0
  42. package/types/tree-menu.type.d.ts +1 -1
  43. package/types/upload-dragger.type.d.ts +1 -1
  44. package/types/{upload-list.type-f34997c8.d.ts → upload-list.type-02a1effb.d.ts} +4 -0
  45. package/types/upload-list.type.d.ts +1 -1
  46. package/types/upload.type.d.ts +1 -1
  47. package/user/index.js +21 -6
@@ -152,7 +152,7 @@ const initWatch = ({ watch, props, state, emit, api: api2, nextTick }) => {
152
152
  () => state.mode,
153
153
  (val) => {
154
154
  emit("mode-change", val);
155
- if (val === "timeline") {
155
+ if (val === "schedule") {
156
156
  api2.getCurWeekEvent();
157
157
  }
158
158
  }
package/common/index.js CHANGED
@@ -237,7 +237,7 @@ const CASCADER = {
237
237
  PropsHover: "hoverThreshold",
238
238
  MenuConnector: "cascader-menu-"
239
239
  };
240
- const version = "3.15.0";
240
+ const version = "3.16.0";
241
241
  const log = (data, type = "log") => {
242
242
  uLog.logger[type](data);
243
243
  };
package/common/runtime.js CHANGED
@@ -22,7 +22,7 @@ import vuePopup from "./deps/vue-popup";
22
22
  import validate from "./validate";
23
23
  import memorize from "./deps/memorize";
24
24
  import * as common from ".";
25
- const version = "3.15.0";
25
+ const version = "3.16.0";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
@@ -29,15 +29,29 @@ const computedStyle = ({ props, state, designConfig }) => () => {
29
29
  }
30
30
  if (state.dragStyle) {
31
31
  style = __spreadValues(__spreadValues({}, style), state.dragStyle);
32
+ if (state.isFull) {
33
+ style = { left: "0px", top: "0px" };
34
+ }
32
35
  }
33
36
  return style;
34
37
  };
35
- const computedBodyStyle = ({ props }) => () => {
38
+ const computedBodyStyle = ({ vm, props, state }) => () => {
36
39
  const style = {
37
40
  maxHeight: ""
38
41
  };
42
+ const headerHeight = vm.$refs.header && vm.$refs.header.offsetHeight || 0;
43
+ const footerHeight = vm.$refs.footer && vm.$refs.footer.offsetHeight || 0;
39
44
  let { maxHeight } = props;
40
- if (maxHeight) {
45
+ if (state.isFull || props.rightSlide) {
46
+ if (vm.$slots.footer) {
47
+ style.maxHeight = `calc(100vh - ${headerHeight + footerHeight}px)`;
48
+ } else {
49
+ style.maxHeight = `calc(100vh - ${headerHeight}px)`;
50
+ }
51
+ } else {
52
+ style.maxHeight = "65vh";
53
+ }
54
+ if (maxHeight && !state.isFull) {
41
55
  style.maxHeight = "none";
42
56
  }
43
57
  return style;
@@ -236,7 +250,9 @@ const handleDrag = ({
236
250
  left = event2.clientX < 0 ? -disX : left > maxX ? maxX : left;
237
251
  top = event2.clientY < 0 ? -disY : top > maxY ? maxY : top;
238
252
  }
239
- state.dragStyle = { left: `${left}px`, top: `${top}px` };
253
+ if (!state.isFull) {
254
+ state.dragStyle = { left: `${left}px`, top: `${top}px` };
255
+ }
240
256
  state.left = `${left}px`;
241
257
  state.top = `${top}px`;
242
258
  state.emitter.emit("boxdrag");
@@ -255,6 +271,12 @@ const showScrollbar = (lockScrollClass) => () => {
255
271
  const hideScrollbar = (lockScrollClass) => () => {
256
272
  removeClass(document.body, lockScrollClass);
257
273
  };
274
+ const toggleFullScreen = ({ state, emit, nextTick, vm }) => (isFull) => {
275
+ state.isFull = isFull;
276
+ nextTick(() => {
277
+ emit("resize", { fullscreen: isFull, dialog: vm.$refs.dialog });
278
+ });
279
+ };
258
280
  export {
259
281
  afterEnter,
260
282
  afterLeave,
@@ -271,6 +293,7 @@ export {
271
293
  hideScrollbar,
272
294
  mounted,
273
295
  showScrollbar,
296
+ toggleFullScreen,
274
297
  unMounted,
275
298
  updatePopper,
276
299
  useMouseEventDown,
package/dialog-box/vue.js CHANGED
@@ -20,7 +20,8 @@ import {
20
20
  handleDrag,
21
21
  showScrollbar,
22
22
  hideScrollbar,
23
- computedBodyStyle
23
+ computedBodyStyle,
24
+ toggleFullScreen
24
25
  } from "./index";
25
26
  import usePopup from "../common/deps/vue-popup";
26
27
  const api = [
@@ -33,6 +34,7 @@ const api = [
33
34
  "handleCancel",
34
35
  "handleConfirm",
35
36
  "handleDrag",
37
+ "toggleFullScreen",
36
38
  "state"
37
39
  ];
38
40
  const initState = ({
@@ -111,7 +113,7 @@ const initApi = ({
111
113
  state
112
114
  }),
113
115
  computedStyle: computedStyle({ state, props, designConfig }),
114
- computedBodyStyle: computedBodyStyle({ props }),
116
+ computedBodyStyle: computedBodyStyle({ vm, props, state }),
115
117
  mounted: mounted({ api: api2, parent, props }),
116
118
  unMounted: unMounted({ api: api2, parent, props }),
117
119
  computedAnimationName: computedAnimationName({ constants, props }),
@@ -119,7 +121,9 @@ const initApi = ({
119
121
  afterLeave: afterLeave(emit),
120
122
  hideScrollbar: hideScrollbar(lockScrollClass),
121
123
  showScrollbar: showScrollbar(lockScrollClass),
122
- handleDrag: handleDrag({ parent, props, state, emit, vm })
124
+ handleDrag: handleDrag({ parent, props, state, emit, vm }),
125
+ // tiny 新增
126
+ toggleFullScreen: toggleFullScreen({ state, emit, nextTick, vm })
123
127
  });
124
128
  };
125
129
  const initWatch = ({ watch, state, api: api2, props }) => {
package/drawer/index.js CHANGED
@@ -35,8 +35,10 @@ const handleClose = ({ emit, props, state }) => (type, force) => {
35
35
  if (isMaskNotClosable || isBlockClose) {
36
36
  return;
37
37
  }
38
- state.toggle = false;
39
- emit(["close", "confirm"].includes(type) ? type : "close", state);
38
+ if (type !== "confirm") {
39
+ state.toggle = false;
40
+ }
41
+ emit(["close", "confirm"].includes(type) ? type : "close");
40
42
  };
41
43
  const mousedown = ({ state, vm }) => (event2) => {
42
44
  event2.preventDefault();
@@ -44,7 +46,9 @@ const mousedown = ({ state, vm }) => (event2) => {
44
46
  const drawerBox = vm.$refs.drawerBox;
45
47
  state.dragEvent.isDrag = true;
46
48
  state.dragEvent.x = touch.clientX;
49
+ state.dragEvent.y = touch.clientY;
47
50
  state.dragEvent.offsetWidth = drawerBox.offsetWidth;
51
+ state.dragEvent.offsetHeight = drawerBox.offsetHeight;
48
52
  };
49
53
  const mousemove = ({ state, props }) => debounce(1, (event2) => {
50
54
  if (!state.dragEvent.isDrag) {
@@ -53,16 +57,23 @@ const mousemove = ({ state, props }) => debounce(1, (event2) => {
53
57
  event2.preventDefault();
54
58
  const { placement } = props;
55
59
  const {
56
- dragEvent: { x, offsetWidth }
60
+ dragEvent: { x, y, offsetWidth, offsetHeight }
57
61
  } = state;
58
62
  const { touches, targetTouches, changedTouches } = event2;
59
63
  const touch = touches && touches[0] || targetTouches && targetTouches[0] || changedTouches && changedTouches[0];
60
- const { clientX } = touch || event2;
64
+ const { clientX, clientY } = touch || event2;
61
65
  const offsetX = clientX - x;
66
+ const offsetY = clientY - y;
62
67
  if (placement === "left") {
63
68
  state.width = offsetWidth + offsetX;
64
69
  } else if (placement === "right") {
65
70
  state.width = offsetWidth - offsetX;
71
+ } else if (placement === "top") {
72
+ const height = offsetHeight + offsetY;
73
+ state.height = height > 10 ? height : 10;
74
+ } else if (placement === "bottom") {
75
+ const height = offsetHeight - offsetY;
76
+ state.height = height > 10 ? height : 10;
66
77
  }
67
78
  });
68
79
  const mouseup = ({ state }) => () => {
package/drawer/vue.js CHANGED
@@ -23,7 +23,8 @@ const renderless = (props, { reactive, watch, onMounted, onBeforeUnmount, comput
23
23
  const state = reactive({
24
24
  toggle: false,
25
25
  width: 0,
26
- dragEvent: { x: 0, isDrag: false, offsetWidth: 0 },
26
+ height: 0,
27
+ dragEvent: { x: 0, y: 0, isDrag: false, offsetWidth: 0, offsetHeight: 0 },
27
28
  computedWidth: computed(() => api2.computedWidth()),
28
29
  btnOrderReversed: vm.theme === "saas" || ((_a = designConfig == null ? void 0 : designConfig.state) == null ? void 0 : _a.btnOrderReversed)
29
30
  });
package/espace/index.js CHANGED
@@ -24,7 +24,8 @@ const getUserTitle = (item) => {
24
24
  const title = `${type}:${value}`;
25
25
  return title;
26
26
  };
27
- const doUserAction = ({ api, props, state, eSpaceCtrl }) => (item) => {
27
+ const doUserAction = ({ api, props, state, eSpaceCtrl }) => (item, ev) => {
28
+ ev == null ? void 0 : ev.preventDefault();
28
29
  state.dataItem = item;
29
30
  const type = item.type ? String(item.type).toLocaleLowerCase() : "";
30
31
  if (props.isNewImMode) {
@@ -269,22 +269,20 @@ const properFileSize = ({
269
269
  return true;
270
270
  let maxSize = 0;
271
271
  if (Array.isArray(props.fileSize) && props.fileSize[1]) {
272
- maxSize = Math.min(state.singleMaxSize, props.fileSize[1] / 1024).toFixed(2);
272
+ maxSize = state.isEdm ? Math.min(state.singleMaxSize, props.fileSize[1] / 1024) : Math.max(props.fileSize[0] / 1024, props.fileSize[1] / 1024);
273
273
  } else {
274
- maxSize = Math.min(state.singleMaxSize);
274
+ maxSize = state.isEdm ? Math.min(state.singleMaxSize) : props.fileSize / 1024;
275
275
  }
276
- if (state.isEdm || !state.isEdm && Array.isArray(props.fileSize) && props.fileSize[1]) {
277
- if (file.size > maxSize * 1024 * 1024) {
278
- Modal.message({
279
- message: t(constants.EDM.EXCEED, { maxSize: api.formatFileSize(Number(maxSize), "M") }),
280
- status: "warning"
281
- });
282
- return false;
283
- }
276
+ if (!isNaN(Number(maxSize)) && file.size > maxSize * 1024 * 1024) {
277
+ Modal.message({
278
+ message: t(constants.EDM.EXCEED, { maxSize: api.formatFileSize(Number(maxSize * 1024 * 1024)) }),
279
+ status: "warning"
280
+ });
281
+ return false;
284
282
  }
285
283
  if (file.size <= 0) {
286
284
  Modal.message({
287
- message: `${file.name} ${t(constants.EDM.FILEEMPTY)}`,
285
+ message: t(constants.EDM.FILEEMPTY),
288
286
  status: "warning"
289
287
  });
290
288
  return false;
@@ -789,6 +787,10 @@ const updateUrl = ({ api, props, state }) => () => {
789
787
  api.getFileUploadUrl().then((url) => state.url = url);
790
788
  }
791
789
  };
790
+ const handleFileClick = ({ props, emit }) => (file) => {
791
+ emit("preview", file);
792
+ props.preview && props.preview(file);
793
+ };
792
794
  const getTranslateFile = ({
793
795
  api,
794
796
  isChunk,
@@ -1019,7 +1021,7 @@ const downloadFileBatch = ({
1019
1021
  state,
1020
1022
  emit
1021
1023
  }) => (args) => {
1022
- let { downloadOps, file, calcProgress, handleSuccess: handleSuccess2, range = {} } = args;
1024
+ let { downloadOps, file, calcProgress, handleSuccess: handleSuccess2, range = {}, isLessThan17G } = args;
1023
1025
  let tokenParams = { token: downloadOps.packageToken, file, type: "download" };
1024
1026
  const { asyncPackages } = downloadOps || {};
1025
1027
  api.getToken(tokenParams).then((data) => {
@@ -1058,6 +1060,8 @@ const downloadFileBatch = ({
1058
1060
  ).then((data2) => {
1059
1061
  if (api.getKiaScanTip({ data: data2 }))
1060
1062
  return;
1063
+ if (api.validateDownloadStatus({ downloadOps: props.edm.download || {}, file, isLessThan17G, data: data2 }))
1064
+ return;
1061
1065
  const { "content-size": fileSize, checkcode } = data2.headers;
1062
1066
  emit("download", 100, "", { fileSize, checkcode });
1063
1067
  handleSuccess2(data2, "zip");
@@ -1295,7 +1299,7 @@ const downloadFileInner = ({ api, props, state }) => ({ batchIndex, file, range,
1295
1299
  api.downloadFileSingle(args);
1296
1300
  return;
1297
1301
  }
1298
- const params = { downloadOps, file, calcProgress, handleSuccess: handleSuccess2, range };
1302
+ const params = { downloadOps, file, calcProgress, handleSuccess: handleSuccess2, range, isLessThan17G };
1299
1303
  isBatch && api.downloadFileBatch(params);
1300
1304
  };
1301
1305
  const afterDownload = ({ api, state }) => ({ batchIndex, range, data, file, isBatch, isChunk, isLessThan17G }) => {
@@ -1432,7 +1436,7 @@ const largeDocumentUpload = ({
1432
1436
  file.chunkSize = chunkSize;
1433
1437
  file.cancelToken = [];
1434
1438
  api.segmentUploadInit(file).then((data) => {
1435
- if (data) {
1439
+ if (data && data.docId) {
1436
1440
  file.records = data.chunks;
1437
1441
  file.docId = data.docId;
1438
1442
  state.largeFileInfo[data.docId] = file;
@@ -1734,7 +1738,11 @@ const getToken = ({
1734
1738
  const result = data || {};
1735
1739
  const whitelist = result.config && result.config.fileWhiteList || "";
1736
1740
  state.isSuccess = true;
1737
- state.accept = type === "download" || type === "preview" ? props.accept : `${whitelist}${props.accept ? `,${props.accept}` : ""}`;
1741
+ if (["preview", "download"].includes(type) && props.accept) {
1742
+ state.accept = props.accept;
1743
+ } else if (whitelist) {
1744
+ state.accept = `${whitelist}${props.accept ? `,${props.accept}` : ""}`;
1745
+ }
1738
1746
  state.headers[constants.EDM.EDMTOKEN] = result.edmToken || "";
1739
1747
  state.headers[constants.EDM.TRACEID] = result.traceId || "";
1740
1748
  if (result.config) {
@@ -2105,7 +2113,9 @@ const getTipMessage = ({ t, api, constants }) => ({ accept, fileSize, limit }) =
2105
2113
  if (typeof fileSize === "number") {
2106
2114
  fileSizeTip = `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(fileSize * kibibyte)}`;
2107
2115
  } else if (Array.isArray(fileSize)) {
2108
- fileSizeTip += !isNaN(fileSize[0]) ? `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(Number(fileSize[0]) * kibibyte)}${t(constants.COMMA)}` : "";
2116
+ fileSizeTip += !isNaN(fileSize[0]) && fileSize[0] !== 0 ? `${t(constants.FILE_NOT_LESS_THAN)}${api.formatFileSize(Number(fileSize[0]) * kibibyte)}${t(
2117
+ constants.COMMA
2118
+ )}` : "";
2109
2119
  fileSizeTip += !isNaN(fileSize[1]) ? `${t(constants.FILE_NOT_MORE_THAN)}${api.formatFileSize(Number(fileSize[1]) * kibibyte)}` : "";
2110
2120
  }
2111
2121
  let limitTip = limit ? t(constants.NUMBER_LIMIT, { number: limit }) : "";
@@ -2157,6 +2167,7 @@ export {
2157
2167
  handleClick,
2158
2168
  handleClickFileList,
2159
2169
  handleError,
2170
+ handleFileClick,
2160
2171
  handleProgress,
2161
2172
  handleReUpload,
2162
2173
  handleReUploadTotal,
@@ -30,6 +30,7 @@ import {
30
30
  watchListType,
31
31
  watchFileList,
32
32
  handleClick,
33
+ handleFileClick,
33
34
  getFileUploadUrl,
34
35
  updateUrl,
35
36
  previewImage,
@@ -93,6 +94,7 @@ const api = [
93
94
  "handleReUploadTotal",
94
95
  "submit",
95
96
  "handleClick",
97
+ "handleFileClick",
96
98
  "getFileUploadUrl",
97
99
  "updateUrl",
98
100
  "previewImage",
@@ -186,13 +188,14 @@ const initState = ({
186
188
  });
187
189
  return state;
188
190
  };
189
- const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal }) => {
191
+ const initApi = ({ api: api2, state, props, constants, vm, $service, t, Modal, emit }) => {
190
192
  Object.assign(api2, {
191
193
  state,
192
194
  sliceChunk: sliceChunk({ state }),
193
195
  getFormData: getFormData({ constants, props, state }),
194
196
  abort: abort({ constants, vm, state }),
195
197
  handleClick: handleClick({ constants, vm }),
198
+ handleFileClick: handleFileClick({ props, emit }),
196
199
  getFile: getFile(state),
197
200
  clearFiles: clearFiles(state),
198
201
  watchFileList: watchFileList({ constants, state, props, api: api2 }),
@@ -270,7 +273,10 @@ const mergeApi = ({ api: api2, props, $service, state, constants, emit, mode, Mo
270
273
  };
271
274
  const initWatch = ({ watch, state, api: api2, props, $service }) => {
272
275
  watch(
273
- () => props.edm.upload,
276
+ () => {
277
+ var _a;
278
+ return (_a = props.edm) == null ? void 0 : _a.upload;
279
+ },
274
280
  (value) => value && api2.getToken({ token: value.token, isinit: true }),
275
281
  { immediate: true, deep: true }
276
282
  );
@@ -313,7 +319,7 @@ const renderless = (props, { computed, inject, onBeforeUnmount, provide, reactiv
313
319
  service,
314
320
  useBreakpoint
315
321
  });
316
- initApi({ api: api2, state, props, constants, vm, $service, t, Modal });
322
+ initApi({ api: api2, state, props, constants, vm, $service, t, Modal, emit });
317
323
  mergeApi({ api: api2, props, $service, state, constants, emit, mode, Modal, t, vm, CryptoJS, Streamsaver });
318
324
  getApi = () => api2;
319
325
  provide("uploader", parent);
@@ -90,9 +90,9 @@ const emitEvent = (vm, type, args) => {
90
90
  }
91
91
  };
92
92
  const assemColumn = ($table, $column, instance) => {
93
- const { columnConfig, $el: elm, $scopedSlots, $slots, $parent } = instance;
93
+ const { columnConfig, $el: elm, slots, $parent } = instance;
94
94
  const { collectColumn } = $table;
95
- columnConfig.slots = $scopedSlots || $slots;
95
+ columnConfig.slots = slots;
96
96
  const parentNode = elm.parentNode;
97
97
  const insertIndex = [].indexOf.call(parentNode.children, elm);
98
98
  if (!$column || $column !== $parent) {
@@ -106,7 +106,11 @@ const assemColumn = ($table, $column, instance) => {
106
106
  }
107
107
  $table.collectColumn = collectColumn.slice(0);
108
108
  };
109
- const getCellValue = (row, column) => get(row, column.property);
109
+ const getCellValue = (row, column) => {
110
+ const { field, prop } = column.own;
111
+ const property = field || prop;
112
+ return get(row, property);
113
+ };
110
114
  const getListeners = ($attrs, $listeners) => {
111
115
  const regHyphenate = /\B([A-Z])/g;
112
116
  const regEventPrefix = /^on[A-Z]/;
package/grid/utils/dom.js CHANGED
@@ -117,8 +117,9 @@ const colToVisible = ($table, column, move) => {
117
117
  });
118
118
  };
119
119
  const hasDataTag = (el, value) => {
120
- if (!el || !value)
120
+ if (!el || !value || !el.getAttribute) {
121
121
  return false;
122
+ }
122
123
  return (" " + el.getAttribute("data-tag") + " ").includes(" " + value + " ");
123
124
  };
124
125
  const getEventTargetNode = (event, container, queryCls) => {
@@ -5,7 +5,7 @@ const hexToRgb = (hex) => {
5
5
  hex = getComputedStyle(document.documentElement).getPropertyValue(hex);
6
6
  }
7
7
  hex = hex.replace(/\s*#/g, "");
8
- if (hex.length == 3) {
8
+ if (hex.length === 3) {
9
9
  hex = hex[0] + hex[0] + hex[1] + hex[1] + hex[2] + hex[2];
10
10
  }
11
11
  return {
@@ -37,8 +37,8 @@ const getMileIcon = ({ constants, props }) => (node) => {
37
37
  const switchColor = isCompleted && !props.solid;
38
38
  const { r, g, b } = hexToRgb(status);
39
39
  return {
40
- background: switchColor ? constants.DEFAULT_BACK_COLOR : status,
41
- color: switchColor ? status : constants.DEFAULT_BACK_COLOR,
40
+ background: (switchColor ? constants.DEFAULT_BACK_COLOR : status) + "!important",
41
+ color: (switchColor ? status : constants.DEFAULT_BACK_COLOR) + "!important",
42
42
  boxShadow: `rgba(${r},${g},${b},.4) ${constants.BOX_SHADOW_PX}`
43
43
  };
44
44
  };
@@ -57,6 +57,7 @@ const getLineColor = (props) => (status) => {
57
57
  } else if (props.lineStyle === 1) {
58
58
  background = status === props.completedField ? props.milestonesStatus[status] : "";
59
59
  }
60
+ background += " !important";
60
61
  }
61
62
  return { background };
62
63
  };
package/modal/index.js CHANGED
@@ -170,7 +170,12 @@ const open = ({
170
170
  const viewportWindow = getViewportWindow();
171
171
  let clientVisibleWidth = viewportWindow.document.documentElement.clientWidth || viewportWindow.document.body.clientWidth;
172
172
  let clientVisibleHeight = viewportWindow.document.documentElement.clientHeight || viewportWindow.document.body.clientHeight;
173
- modalBoxElem.style.left = `${clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2}px`;
173
+ let width = isNaN(props.width) ? props.width : `${props.width}px`;
174
+ if (width) {
175
+ modalBoxElem.style.left = "calc((100vw - " + width + ") / 2)";
176
+ } else {
177
+ modalBoxElem.style.left = `${clientVisibleWidth / 2 - modalBoxElem.offsetWidth / 2}px`;
178
+ }
174
179
  if (modalBoxElem.offsetHeight + modalBoxElem.offsetTop + props.marginSize > clientVisibleHeight) {
175
180
  modalBoxElem.style.top = `${props.marginSize}px`;
176
181
  }
package/option/index.js CHANGED
@@ -46,7 +46,7 @@ const selectOptionClick = ({ props, state, select, constants, vm }) => () => {
46
46
  };
47
47
  const queryChange = ({ select, props, state }) => (query) => {
48
48
  const oldVisible = state.visible;
49
- const newVisible = new RegExp(escapeRegexpString(query), "i").test(state.currentLabel) || !!props.created;
49
+ const newVisible = state.currentLabel.toLowerCase().includes(query.toLowerCase()) || !!props.created;
50
50
  if (oldVisible !== newVisible) {
51
51
  state.visible = newVisible;
52
52
  select.state.filteredOptionsCount += newVisible ? 1 : -1;
package/option/vue.js CHANGED
@@ -16,10 +16,10 @@ const api = ["state", "visible", "hoverItem", "selectOptionClick"];
16
16
  const initState = ({ reactive, computed, props, api: api2, markRaw, select, parent }) => {
17
17
  const state = reactive({
18
18
  parent: markRaw(parent),
19
+ selectMultiple: computed(() => select.multiple),
19
20
  created: computed(() => props.created),
20
21
  index: -1,
21
- select: markRaw(select),
22
- hover: computed(() => !state.select.optimization && state.select.state.hoverValue === state.index),
22
+ hover: computed(() => !select.optimization && select.state.hoverValue === state.index),
23
23
  visible: true,
24
24
  hitState: false,
25
25
  groupDisabled: false,
@@ -82,12 +82,6 @@ const initWatch = ({ watch, props, state, select, constants }) => {
82
82
  }
83
83
  }
84
84
  );
85
- watch(
86
- () => state.visible,
87
- () => {
88
- select.state.filteredOptionsCount += state.visible ? 1 : -1;
89
- }
90
- );
91
85
  };
92
86
  const initOnMounted = ({ onMounted, props, api: api2, vm, state, constants, select }) => {
93
87
  onMounted(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.15.0",
3
+ "version": "3.16.0",
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": [
@@ -26,7 +26,8 @@ const api = [
26
26
  "handleScroll",
27
27
  "scrollToItem",
28
28
  "computeViewStyle",
29
- "computeViewEvent"
29
+ "computeViewEvent",
30
+ "updateVisibleItems"
30
31
  ];
31
32
  const addWatchers = ({ watch, props, api: api2, state }) => {
32
33
  watch(
@@ -132,8 +132,8 @@ const textChange = ({ emit, vm, state, Modal, t }) => (delta, oldDelta) => {
132
132
  Modal.message({ message: `${t("ui.richText.maxLength")}${state.maxLength}`, status: "warning" });
133
133
  return;
134
134
  }
135
- const text = quill.getText();
136
- const currentLength = text.length;
135
+ const text = state.quill.getText();
136
+ const currentLength = text.length - 1;
137
137
  const maxLength2 = state.maxLength;
138
138
  if (currentLength > maxLength2) {
139
139
  quill.setContents(oldDelta);
package/select/index.js CHANGED
@@ -607,6 +607,7 @@ const setSoftFocus = ({ vm, state }) => () => {
607
607
  if (input) {
608
608
  input.focus();
609
609
  }
610
+ state.softFocus = false;
610
611
  };
611
612
  const getValueIndex = (props) => (arr = [], value = null) => {
612
613
  const isObject = Object.prototype.toString.call(value).toLowerCase() === "[object object]";
@@ -1070,6 +1071,7 @@ const watchVisible = ({ api, constants, emit, state, vm, props }) => (value) =>
1070
1071
  if (value && vm.$refs.scrollbar) {
1071
1072
  if (props.optimization) {
1072
1073
  optmzApis.setScrollTop({ refs: vm.$refs, state });
1074
+ vm.$refs.scrollbar.updateVisibleItems(true, true);
1073
1075
  } else {
1074
1076
  vm.$refs.scrollbar.handleScroll();
1075
1077
  }
package/slider/index.js CHANGED
@@ -82,6 +82,7 @@ const bindMouseDown = ({
82
82
  state.activeIndex = -1;
83
83
  return;
84
84
  }
85
+ api.bindResize();
85
86
  on(window, "mouseup", api.bindMouseUp);
86
87
  on(window, "mousemove", api.bindMouseMove);
87
88
  on(window, "touchend", api.bindMouseUp);
package/tab-nav/index.js CHANGED
@@ -300,9 +300,13 @@ const watchCurrentName = ({ nextTick, vm, state }) => () => {
300
300
  }
301
301
  });
302
302
  };
303
- const handleTitleMouseenter = ({ state, vm }) => (e, title) => {
303
+ const handleTitleMouseenter = ({ state, vm, props }) => (e, title) => {
304
304
  const dom = e.target;
305
- if (dom && dom.scrollWidth > dom.offsetWidth) {
305
+ const el = title == null ? void 0 : title.el;
306
+ if (props.tooltipConfig) {
307
+ return;
308
+ }
309
+ if (dom && el && el.scrollWidth > el.offsetWidth) {
306
310
  const tooltip = vm.$refs.tooltip;
307
311
  tooltip.state.referenceElm = dom;
308
312
  tooltip.state.popperElm && (tooltip.state.popperElm.style.display = "none");
@@ -314,9 +318,6 @@ const handleTitleMouseenter = ({ state, vm }) => (e, title) => {
314
318
  };
315
319
  const handleTitleMouseleave = ({ state }) => () => {
316
320
  state.tooltipVisible = false;
317
- setTimeout(() => {
318
- state.tooltipContent = "";
319
- }, 20);
320
321
  };
321
322
  export {
322
323
  beforeUnmount,
package/tab-nav/vue.js CHANGED
@@ -90,7 +90,7 @@ const renderless = (props, { computed, inject, onBeforeUnmount, onMounted, onUpd
90
90
  handleTabDragStart: handleTabDragStart({ state, vm, emit }),
91
91
  handleTabDragEnd: handleTabDragEnd({ state, vm, nextTick }),
92
92
  sortableEvent: sortableEvent({ api: api2, props, state, vm, emit, markRaw }),
93
- handleTitleMouseenter: handleTitleMouseenter({ state, vm }),
93
+ handleTitleMouseenter: handleTitleMouseenter({ state, vm, props }),
94
94
  handleTitleMouseleave: handleTitleMouseleave({ state })
95
95
  });
96
96
  Object.assign(api2, { updated: updated({ api: api2, vm, state }), changeTab: changeTab(api2) });
package/tabs/index.js CHANGED
@@ -13,10 +13,12 @@ const calcPaneInstances = ({
13
13
  if (Array.isArray(vnode.children)) {
14
14
  vnode.children.forEach((child) => {
15
15
  var _a2;
16
- orderPanes.push((_a2 = child.props) == null ? void 0 : _a2.name);
16
+ const name = (_a2 = child.props) == null ? void 0 : _a2.name;
17
+ name && orderPanes.push(name);
17
18
  });
18
19
  } else {
19
- orderPanes.push((_a = vnode.props) == null ? void 0 : _a.name);
20
+ const name = (_a = vnode.props) == null ? void 0 : _a.name;
21
+ name && orderPanes.push(name);
20
22
  }
21
23
  });
22
24
  const currentPanes = [];
@@ -54,6 +56,10 @@ const calcMorePanes = ({ parent, props, state, refs }) => () => {
54
56
  const el = parent.$el;
55
57
  const tabs = el.querySelectorAll(".tiny-tabs__item");
56
58
  const tabNavRefs = refs.nav.$refs;
59
+ if (props.moreShowAll) {
60
+ state.showPanesCount = 0;
61
+ return;
62
+ }
57
63
  if (tabs && tabs.length) {
58
64
  let tabsAllWidth = 0;
59
65
  for (let i = 0; i < tabs.length; i++) {
@@ -39,8 +39,8 @@ const watchValue = ({ api, state }) => (value) => {
39
39
  };
40
40
  const adjustSpinners = ({ vm }) => () => {
41
41
  if (vm.$refs.minSpinner) {
42
- vm.$refs.minSpinner.adjustSpinners();
43
- vm.$refs.maxSpinner.adjustSpinners();
42
+ vm.$refs.minSpinner.adjustSpinners("min");
43
+ vm.$refs.maxSpinner.adjustSpinners("max");
44
44
  }
45
45
  };
46
46
  const setMaxMinData = (state) => {
@@ -123,7 +123,17 @@ const selectDateScroll = ({ state, props }) => (type, value) => {
123
123
  }
124
124
  return value;
125
125
  };
126
- const adjustSpinners = ({ api, state }) => () => {
126
+ const adjustSpinners = ({ api, state, vm }) => (type) => {
127
+ if (type) {
128
+ const year = vm.date.getFullYear();
129
+ const month = vm.date.getUTCMonth() + 1;
130
+ const day = vm.date.getDate();
131
+ if (type === "min" && vm.endDate instanceof Date) {
132
+ state.selectableRange = [[/* @__PURE__ */ new Date(`${year}-${month}-${day} 00:00:00`), vm.endDate]];
133
+ } else if (type === "max" && vm.startDate instanceof Date) {
134
+ state.selectableRange = [[vm.startDate, /* @__PURE__ */ new Date(`${year}-${month}-${day} 23:59:59`)]];
135
+ }
136
+ }
127
137
  api.adjustSpinner("hours", state.hours);
128
138
  api.adjustSpinner("minutes", state.minutes);
129
139
  api.adjustSpinner("seconds", state.seconds);
@@ -75,7 +75,7 @@ const renderless = (props, { computed, onMounted, reactive, watch, nextTick }, {
75
75
  emitSelectRange: emitSelectRange({ emit, state }),
76
76
  modifyDateField: modifyDateField({ emit, props, state }),
77
77
  bindScrollEvent: bindScrollEvent({ api: api2, vm }),
78
- adjustSpinners: adjustSpinners({ api: api2, state }),
78
+ adjustSpinners: adjustSpinners({ api: api2, state, vm }),
79
79
  adjustSpinner: adjustSpinner({ api: api2, props, vm, state }),
80
80
  increase: increase({ api: api2, state }),
81
81
  decrease: decrease({ api: api2, state }),
package/tree/index.js CHANGED
@@ -291,11 +291,14 @@ const updated = ({ vm, state }) => () => {
291
291
  state.treeItems = vm.$el.querySelectorAll("[role=treeitem]");
292
292
  state.checkboxItems = vm.$el.querySelectorAll("input[type=checkbox]");
293
293
  };
294
- const filter = ({ props, state }) => (value) => {
294
+ const filter = ({ props, state, api }) => (value) => {
295
295
  if (!props.filterNodeMethod) {
296
296
  throw new Error("[Tree] filterNodeMethod is required when filter");
297
297
  }
298
298
  state.store.filter(value);
299
+ if (props.willChangeView) {
300
+ api.initPlainNodeStore();
301
+ }
299
302
  };
300
303
  const getNodeKey = (props) => (node) => innerGetNodekey(props.nodekey, node.data);
301
304
  const getNodePath = ({ props, state }) => (data) => {
package/tree/vue.js CHANGED
@@ -177,7 +177,7 @@ const initApi = ({ state, dispatch, broadcast, props, vm, constants, t, emit, ap
177
177
  watchCheckboxItems: watchCheckboxItems(),
178
178
  watchCheckStrictly: watchCheckStrictly(state),
179
179
  updated: updated({ vm, state }),
180
- filter: filter({ props, state }),
180
+ filter: filter({ props, state, api: api2 }),
181
181
  getNodeKey: getNodeKey(props),
182
182
  getNodePath: getNodePath({ props, state }),
183
183
  getCheckedNodes: getCheckedNodes(state),
@@ -231,9 +231,6 @@ const initWatcher = ({ watch, props, api: api2, state, isVue2 }) => {
231
231
  (value) => state.action.addDisabled = value || [],
232
232
  { immediate: true }
233
233
  );
234
- if (props.willChangeView) {
235
- watch(() => state.root, api2.initPlainNodeStore, { deep: true });
236
- }
237
234
  };
238
235
  const renderless = (props, { computed, onMounted, onUpdated, reactive, watch, provide, onBeforeUnmount }, { vm, t, emit, constants, broadcast, dispatch, service, emitter, nextTick }, { isVue2 }) => {
239
236
  const api2 = {};
@@ -58,6 +58,10 @@ declare const checkboxProps: {
58
58
  type: StringConstructor;
59
59
  default: string;
60
60
  };
61
+ tabindex: {
62
+ type: StringConstructor;
63
+ default: string;
64
+ };
61
65
  tiny_mode: StringConstructor;
62
66
  tiny_mode_root: BooleanConstructor;
63
67
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -106,7 +106,7 @@ declare const datePickerProps: {
106
106
  type: ObjectConstructor;
107
107
  default(): vue.Raw<_opentiny_vue_common.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
108
108
  [key: string]: any;
109
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
109
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
110
110
  };
111
111
  name: {
112
112
  default: string;
@@ -124,6 +124,10 @@ declare const dialogBoxProps: {
124
124
  type: StringConstructor;
125
125
  default: () => string;
126
126
  };
127
+ dialogTransition: {
128
+ type: StringConstructor;
129
+ default: string;
130
+ };
127
131
  tiny_mode: StringConstructor;
128
132
  tiny_mode_root: BooleanConstructor;
129
133
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -146,7 +150,7 @@ declare const dialogBoxProps: {
146
150
 
147
151
  declare const computedAnimationName: ({ constants, props }: Pick<IDialogBoxRenderlessParams, 'constants' | 'props'>) => () => string;
148
152
  declare const computedStyle: ({ props, state, designConfig }: Pick<IDialogBoxRenderlessParams, 'props' | 'state' | 'designConfig'>) => () => IDialogBoxStyle;
149
- declare const computedBodyStyle: ({ props }: Pick<IDialogBoxRenderlessParams, 'props'>) => () => {
153
+ declare const computedBodyStyle: ({ vm, props, state }: Pick<IDialogBoxRenderlessParams, 'vm' | 'props' | 'state'>) => () => {
150
154
  maxHeight?: string | undefined;
151
155
  };
152
156
  declare const watchVisible: ({ api, constants, emit, nextTick, parent, props, vm, state }: Pick<IDialogBoxRenderlessParams, 'api' | 'constants' | 'emit' | 'nextTick' | 'parent' | 'props' | 'vm' | 'state'>) => (val: boolean) => void;
@@ -65,6 +65,14 @@ declare const drawerProps: {
65
65
  tiny_chart_theme: ObjectConstructor;
66
66
  };
67
67
 
68
+ declare const computedWidth: ({ state, designConfig, props, constants }: Pick<ISharedRenderlessParamUtils<{
69
+ SCROLL_LOCK_CLASS(mode: string): string;
70
+ DEFAULT_WIDTH: string;
71
+ }>, "designConfig" | "constants"> & {
72
+ state: IDrawerState;
73
+ } & {
74
+ props: IDrawerProps;
75
+ }) => () => string;
68
76
  declare const close: ({ api }: {
69
77
  api: any;
70
78
  }) => (force?: boolean) => void;
@@ -106,12 +114,16 @@ declare const watchVisibleNotImmediate: ({ api, props }: {
106
114
  interface IDrawerState {
107
115
  toggle: boolean;
108
116
  width: number;
117
+ height: number;
109
118
  dragEvent: {
110
119
  x: number;
120
+ y: number;
111
121
  isDrag: boolean;
112
122
  offsetWidth: number;
123
+ offsetHeight: number;
113
124
  };
114
125
  computedWidth: ComputedRef<string>;
126
+ btnOrderReversed: boolean;
115
127
  }
116
128
  type IDrawerProps = ExtractPropTypes<typeof drawerProps>;
117
129
  interface IDrawerApi {
@@ -128,6 +140,7 @@ interface IDrawerApi {
128
140
  showScrollbar: ReturnType<typeof showScrollbar>;
129
141
  hideScrollbar: ReturnType<typeof hideScrollbar>;
130
142
  watchVisibleNotImmediate: ReturnType<typeof watchVisibleNotImmediate>;
143
+ computedWidth: ReturnType<typeof computedWidth>;
131
144
  }
132
145
  type IDrawerCT = ReturnType<typeof drawerProps._constants.default>;
133
146
 
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-f34997c8.js';
2
+ export { C as IFileUploadAfterDownload, m as IFileUploadApi, D as IFileUploadBatchSegmentDownload, y as IFileUploadBatchSegmentUpload, a as IFileUploadConstants, w as IFileUploadDownloadFileInner, x as IFileUploadDownloadFileSingle, u as IFileUploadDownloadFileSingleInner, t as IFileUploadEdmDownload, s as IFileUploadFile, A as IFileUploadGetFormData, v as IFileUploadLargeDocumentDownload, r as IFileUploadModalVm, o as IFileUploadProps, p as IFileUploadRenderlessParamUtils, q as IFileUploadRenderlessParams, z as IFileUploadSegmentUploadInner, n as IFileUploadService, B as IFileUploadSetWriterFile, E as IFileUploadSliceDownloadChunk, l as IFileUploadState, F as IFileUploadStreamsaver, I as IFileUploadVm } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';
@@ -32,6 +32,8 @@ declare const tabNavPcProps: {
32
32
  default: string;
33
33
  };
34
34
  tooltipConfig: (StringConstructor | ObjectConstructor)[];
35
+ panelMaxHeight: StringConstructor;
36
+ panelWidth: StringConstructor;
35
37
  tiny_mode: StringConstructor;
36
38
  tiny_mode_root: BooleanConstructor;
37
39
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -33,7 +33,7 @@ declare const pickerProps: {
33
33
  type: ObjectConstructor;
34
34
  default(): vue.Raw<vue.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
35
35
  [key: string]: any;
36
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>>;
36
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<vue.ExtractPropTypes<{}>>, {}, {}>>;
37
37
  };
38
38
  name: {
39
39
  default: string;
@@ -80,13 +80,13 @@ declare const popeditorProps: {
80
80
  type: ObjectConstructor;
81
81
  default(): vue.Raw<_opentiny_vue_common.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
82
82
  [key: string]: any;
83
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
83
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
84
84
  };
85
85
  iconSearch: {
86
86
  type: ObjectConstructor;
87
87
  default(): vue.Raw<_opentiny_vue_common.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
88
88
  [key: string]: any;
89
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
89
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
90
90
  };
91
91
  title: {
92
92
  type: StringConstructor;
@@ -1,5 +1,4 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
- import { PropType } from '@opentiny/vue-common';
3
2
  import { ISharedRenderlessFunctionParams } from './shared.type.js';
4
3
 
5
4
  declare const $constants: {
@@ -18,14 +17,14 @@ declare const statisticProps: {
18
17
  };
19
18
  formatter: FunctionConstructor;
20
19
  value: {
21
- type: PropType<number | object>;
20
+ type: NumberConstructor;
22
21
  default: number;
23
22
  };
24
23
  prefix: StringConstructor;
25
24
  suffix: StringConstructor;
26
25
  title: (StringConstructor | ObjectConstructor)[];
27
26
  valueStyle: {
28
- type: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
27
+ type: (ObjectConstructor | ArrayConstructor)[];
29
28
  };
30
29
  groupSeparator: {
31
30
  type: StringConstructor;
@@ -1,7 +1,7 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { ITabsVm } from './tabs.type.js';
3
3
  import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
4
- import { t as tabBarProps } from './index-b012f687.js';
4
+ import { t as tabBarProps } from './index-a975a7a2.js';
5
5
 
6
6
  /**
7
7
  * Copyright (c) 2022 - present TinyVue Authors.
@@ -1,7 +1,7 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { ITabsProps, ITabsVm } from './tabs.type.js';
3
3
  import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
4
- import { a as tabNavPcProps } from './index-b012f687.js';
4
+ import { a as tabNavPcProps } from './index-a975a7a2.js';
5
5
 
6
6
  /**
7
7
  * Copyright (c) 2022 - present TinyVue Authors.
@@ -54,6 +54,9 @@ declare const tabsProps: {
54
54
  beforeClose: FunctionConstructor;
55
55
  overflowTitle: BooleanConstructor;
56
56
  titleWidth: StringConstructor;
57
+ moreShowAll: BooleanConstructor;
58
+ panelMaxHeight: StringConstructor;
59
+ panelWidth: StringConstructor;
57
60
  tiny_mode: StringConstructor;
58
61
  tiny_mode_root: BooleanConstructor;
59
62
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -17,7 +17,7 @@ declare const treeMenuProps: {
17
17
  type: ObjectConstructor;
18
18
  default: () => vue.Raw<_opentiny_vue_common.DefineComponent<{}, () => vue.VNode<vue.RendererNode, vue.RendererElement, {
19
19
  [key: string]: any;
20
- }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.VNodeProps & vue.AllowedComponentProps & vue.ComponentCustomProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
20
+ }>, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {}, string, vue.PublicProps, Readonly<_opentiny_vue_common.ExtractPropTypes<{}>>, {}, {}>>;
21
21
  };
22
22
  props: ObjectConstructor;
23
23
  draggable: {
@@ -1,6 +1,6 @@
1
1
  import { ExtractPropTypes } from 'vue';
2
2
  import { ISharedRenderlessParamUtils, ISharedRenderlessFunctionParams } from './shared.type.js';
3
- import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-f34997c8.js';
3
+ import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-02a1effb.js';
4
4
 
5
5
  declare const UploadDraggerProps: {
6
6
  disabled: BooleanConstructor;
@@ -374,6 +374,7 @@ declare const fileUploadProps: {
374
374
  };
375
375
  reUploadable: BooleanConstructor;
376
376
  reUploadTip: FunctionConstructor;
377
+ imageBgColor: StringConstructor;
377
378
  tiny_mode: StringConstructor;
378
379
  tiny_mode_root: BooleanConstructor;
379
380
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -431,6 +432,7 @@ declare const submit: ({ api, constants, vm, state, props }: Pick<IFileUploadRen
431
432
  declare const handleClick$2: ({ constants, vm }: Pick<IFileUploadRenderlessParams, 'constants' | 'vm'>) => () => any;
432
433
  declare const getFileUploadUrl: (service: IFileUploadRenderlessParams['service']) => () => Promise<string>;
433
434
  declare const updateUrl: ({ api, props, state }: Pick<IFileUploadRenderlessParams, 'api' | 'props' | 'state'>) => () => void;
435
+ declare const handleFileClick: ({ props, emit }: Pick<IFileUploadRenderlessParams, 'props' | 'emit'>) => (file: IFileUploadFile) => void;
434
436
  declare const getTranslateFile: ({ api, isChunk, isLessThan17G, file, state }: Pick<IFileUploadRenderlessParams, "state" | "api"> & {
435
437
  isChunk: boolean;
436
438
  isLessThan17G: boolean;
@@ -848,6 +850,7 @@ interface IFileUploadApi {
848
850
  getFormData: ReturnType<typeof getFormData$1>;
849
851
  abort: ReturnType<typeof abort$1>;
850
852
  handleClick: ReturnType<typeof handleClick$2>;
853
+ handleFileClick: ReturnType<typeof handleFileClick>;
851
854
  getFile: ReturnType<typeof getFile>;
852
855
  clearFiles: ReturnType<typeof clearFiles>;
853
856
  watchFileList: ReturnType<typeof watchFileList>;
@@ -1108,6 +1111,7 @@ declare const uploadListProps: {
1108
1111
  type: BooleanConstructor;
1109
1112
  default: boolean;
1110
1113
  };
1114
+ imageBgColor: StringConstructor;
1111
1115
  tiny_mode: StringConstructor;
1112
1116
  tiny_mode_root: BooleanConstructor;
1113
1117
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-f34997c8.js';
2
+ export { H as IUploadListApi, J as IUploadListProps, K as IUploadListRenderlessParamUtils, L as IUploadListRenderlessParams, G as IUploadListState, M as IUploadListVideoParam } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-f34997c8.js';
2
+ export { d as IUploadApi, i as IUploadFormData, k as IUploadOptionsOfHwh5, j as IUploadOptionsOfPost, e as IUploadProps, h as IUploadRenderlessOtherParams, f as IUploadRenderlessParamUtils, g as IUploadRenderlessParams, c as IUploadState, b as IUploadStateHeader } from './upload-list.type-02a1effb.js';
3
3
  import './shared.type.js';
package/user/index.js CHANGED
@@ -4,6 +4,19 @@ import { toDateStr } from "../common/date";
4
4
  import { toJsonStr } from "../common/object";
5
5
  import { toJson } from "../common/string";
6
6
  import { log } from "../common/xss";
7
+ const toLowerCase = (val) => {
8
+ return typeof val === "string" ? val.toLowerCase() : val;
9
+ };
10
+ const getUserById = (obj, id) => {
11
+ return obj && obj[toLowerCase(id)];
12
+ };
13
+ const getLowerCaseObj = (obj) => {
14
+ const newObj = {};
15
+ Object.keys(obj).forEach((key) => {
16
+ newObj[toLowerCase(key)] = obj[key];
17
+ });
18
+ return newObj;
19
+ };
7
20
  const request = {
8
21
  timmer: null,
9
22
  group: {},
@@ -61,7 +74,7 @@ const request = {
61
74
  for (let key in this.group) {
62
75
  if (!me.cache[key])
63
76
  me.cache[key] = {};
64
- me.cache[key][item[key]] = item;
77
+ me.cache[key][toLowerCase(item[key])] = item;
65
78
  }
66
79
  });
67
80
  },
@@ -90,7 +103,7 @@ const request = {
90
103
  const { queryIds, valueField } = param;
91
104
  cb(result);
92
105
  queryIds.forEach((id) => {
93
- if (!this.cache[valueField] || !this.cache[valueField][id]) {
106
+ if (!getUserById(this.cache[valueField], id)) {
94
107
  errors.push(id);
95
108
  }
96
109
  });
@@ -107,7 +120,7 @@ const request = {
107
120
  const { param, cb } = reqItem;
108
121
  const { queryIds, valueField } = param;
109
122
  queryIds.forEach((id) => {
110
- const user = me.cache[valueField] && me.cache[valueField][id];
123
+ const user = getUserById(me.cache[valueField], id);
111
124
  user && !reqItem.result.includes(user) && reqItem.result.push(user);
112
125
  });
113
126
  if (reqItem.result.length === queryIds.length) {
@@ -270,9 +283,11 @@ const syncCacheIds = ({ props, state }) => (ids, queryIds, cacheData) => {
270
283
  const { cacheFields, cacheKey } = props;
271
284
  const { valueField } = state;
272
285
  const cacheUsers = toJson(window.localStorage.getItem(cacheKey)) || {};
286
+ const caseCacheUsers = getLowerCaseObj(cacheUsers);
273
287
  ids.forEach((id) => {
274
- if (cacheUsers[id]) {
275
- const cacheUser2 = cacheUsers[id];
288
+ const caseId = toLowerCase(id);
289
+ const cacheUser2 = caseCacheUsers[caseId];
290
+ if (cacheUser2) {
276
291
  const textField = state.textField === "userCN" || state.textField === "userId" || state.textField === "dept" ? "" : state.textField;
277
292
  if (textField !== "" && !cacheUser2.a) {
278
293
  window.localStorage.removeItem(cacheKey);
@@ -290,7 +305,7 @@ const syncCacheIds = ({ props, state }) => (ids, queryIds, cacheData) => {
290
305
  });
291
306
  cacheData.push(
292
307
  Object.assign(user, {
293
- [valueField]: cacheUsers[id].p || cacheUsers[id].i
308
+ [valueField]: cacheUser2.p || cacheUser2.i
294
309
  })
295
310
  );
296
311
  } else {