@opentiny/vue-renderless 3.13.0 → 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.
package/cascader/index.js CHANGED
@@ -268,7 +268,7 @@ const calcCollapseTags = ({ state, refs, nextTick }) => () => {
268
268
  const collapseTagWidth = tagsLength && parseFloat(collapseTagContentWidth) + parseFloat(marginRight) + parseFloat(marginLeft);
269
269
  const tags = Array.from(content.querySelectorAll(".tiny-tag"));
270
270
  let { total, dom, idx } = { total: collapseTagWidth, dom: null, idx: 0 };
271
- tags.some((tag, index) => {
271
+ tags.forEach((tag, index) => {
272
272
  if (tag !== tagsLength) {
273
273
  const { width: tagContentWidth, marginRight: marginRight2, marginLeft: marginLeft2 } = tag && window.getComputedStyle(tag);
274
274
  total += parseFloat(tagContentWidth) + parseFloat(marginRight2) + parseFloat(marginLeft2);
@@ -399,7 +399,8 @@ const updateStyle = ({ parent, refs, state, updatePopper, nextTick, props }) =>
399
399
  }
400
400
  const tags = $el.querySelector(CASCADER.TagClass);
401
401
  let suggestionPanelEl = null;
402
- if (suggestionPanel && (suggestionPanelEl = suggestionPanel.$el)) {
402
+ if (suggestionPanel) {
403
+ suggestionPanelEl = suggestionPanel.$el;
403
404
  const suggestionList = suggestionPanelEl.querySelector(CASCADER.ListClass);
404
405
  suggestionList.style.minWidth = inputInner.offsetWidth + "px";
405
406
  }
@@ -68,6 +68,22 @@ const isScrollElement = (el) => {
68
68
  const scrollTypes = ["scroll", "auto"];
69
69
  return scrollTypes.includes(getStyleComputedProperty(el, "overflow")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-x")) || scrollTypes.includes(getStyleComputedProperty(el, "overflow-y"));
70
70
  };
71
+ const getAdjustOffset = (parent) => {
72
+ const placeholder = document.createElement("div");
73
+ setStyle(placeholder, {
74
+ opacity: 0,
75
+ position: "fixed",
76
+ width: 1,
77
+ height: 1,
78
+ top: 0,
79
+ left: 0,
80
+ "z-index": "-99"
81
+ });
82
+ parent.appendChild(placeholder);
83
+ const result = getBoundingClientRect(placeholder);
84
+ parent.removeChild(placeholder);
85
+ return result;
86
+ };
71
87
  const getScrollParent = (el) => {
72
88
  let parent = el.parentNode;
73
89
  if (!parent) {
@@ -84,9 +100,14 @@ const getScrollParent = (el) => {
84
100
  }
85
101
  return getScrollParent(parent);
86
102
  };
87
- const getOffsetRectRelativeToCustomParent = (el, parent, fixed) => {
103
+ const getOffsetRectRelativeToCustomParent = (el, parent, fixed, popper) => {
88
104
  let { top, left, width, height } = getBoundingClientRect(el);
89
105
  if (fixed) {
106
+ if (popper.parentElement) {
107
+ const { top: adjustTop, left: adjustLeft } = getAdjustOffset(popper.parentElement);
108
+ top -= adjustTop;
109
+ left -= adjustLeft;
110
+ }
90
111
  return {
91
112
  top,
92
113
  left,
@@ -429,7 +450,12 @@ class Popper {
429
450
  placement = placement.split("-")[0];
430
451
  let popperOffsets = { position: this.state.position };
431
452
  let isParentFixed = popperOffsets.position === "fixed";
432
- let referenceOffsets = getOffsetRectRelativeToCustomParent(reference, getOffsetParent(popper), isParentFixed);
453
+ let referenceOffsets = getOffsetRectRelativeToCustomParent(
454
+ reference,
455
+ getOffsetParent(popper),
456
+ isParentFixed,
457
+ popper
458
+ );
433
459
  const { width, height } = this.popperOuterSize ? this.popperOuterSize : this.popperOuterSize = getOuterSizes(popper);
434
460
  if (~["right", "left"].indexOf(placement)) {
435
461
  popperOffsets.top = referenceOffsets.top + referenceOffsets.height / 2 - height / 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.13.0",
3
+ "version": "3.13.1",
4
4
  "description": "An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.",
5
5
  "homepage": "https://opentiny.design/tiny-vue",
6
6
  "keywords": [
package/select/index.js CHANGED
@@ -396,16 +396,16 @@ const blur = ({ vm, state }) => () => {
396
396
  (_a = vm.$refs.reference) == null ? void 0 : _a.blur();
397
397
  };
398
398
  const handleBlur = ({ constants, dispatch, emit, state }) => (event) => {
399
+ var _a;
399
400
  clearTimeout(state.timer);
400
401
  state.timer = setTimeout(() => {
401
- var _a;
402
402
  if (state.isSilentBlur) {
403
403
  state.isSilentBlur = false;
404
404
  } else {
405
405
  emit("blur", event);
406
406
  }
407
- dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value);
408
407
  }, 200);
408
+ dispatch(constants.COMPONENT_NAME.FormItem, constants.EVENT_NAME.formBlur, (_a = event == null ? void 0 : event.target) == null ? void 0 : _a.value);
409
409
  state.softFocus = false;
410
410
  };
411
411
  const handleClearClick = (api) => (event) => {
@@ -76,7 +76,7 @@ declare const alertProps: {
76
76
  type: BooleanConstructor;
77
77
  default: boolean;
78
78
  };
79
- customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
79
+ customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
80
80
  offset: {
81
81
  type: (StringConstructor | NumberConstructor)[];
82
82
  default: number;
@@ -20,10 +20,10 @@ declare const checkboxProps: {
20
20
  };
21
21
  };
22
22
  modelValue: {
23
- type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
23
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
24
24
  };
25
25
  label: {
26
- type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
26
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
27
27
  default: string;
28
28
  };
29
29
  indeterminate: BooleanConstructor;
@@ -40,7 +40,7 @@ declare const checkboxProps: {
40
40
  border: BooleanConstructor;
41
41
  size: StringConstructor;
42
42
  text: StringConstructor;
43
- customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
43
+ customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
44
44
  validateEvent: {
45
45
  type: BooleanConstructor;
46
46
  default: boolean;
@@ -24,7 +24,7 @@ declare const collapseProps: {
24
24
  accordion: BooleanConstructor;
25
25
  beforeClose: FunctionConstructor;
26
26
  modelValue: {
27
- type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
27
+ type: (StringConstructor | ArrayConstructor | NumberConstructor)[];
28
28
  default: () => never[];
29
29
  };
30
30
  tiny_mode: StringConstructor;
@@ -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-f76f2393.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-343e8c11.js';
3
3
  import './shared.type.js';
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-654dccd8.js';
2
+ export { i as IFormItemApi, f as IFormItemConstants, I as IFormItemDisplayedValueParam, k as IFormItemInstance, c as IFormItemLabelStyle, g as IFormItemProps, j as IFormItemRenderlessParamUtils, h as IFormItemRenderlessParams, d as IFormItemRule, e as IFormItemState, b as IFormItemTrigger, a as IFormItemValidateStatus } from './form.type-d0fd42f3.js';
3
3
  import './shared.type.js';
@@ -138,7 +138,7 @@ declare const formItemProps: {
138
138
  type: BooleanConstructor;
139
139
  default: boolean;
140
140
  };
141
- rules: (ArrayConstructor | ObjectConstructor)[];
141
+ rules: (ObjectConstructor | ArrayConstructor)[];
142
142
  showMessage: {
143
143
  type: BooleanConstructor;
144
144
  default: boolean;
@@ -1,3 +1,3 @@
1
1
  import 'vue';
2
- export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-654dccd8.js';
2
+ export { p as IFormApi, r as IFormInstance, n as IFormProps, q as IFormRenderlessParamUtils, o as IFormRenderlessParams, l as IFormRules, m as IFormState } from './form.type-d0fd42f3.js';
3
3
  import './shared.type.js';
@@ -69,7 +69,7 @@ declare const milestoneProps: {
69
69
  type: StringConstructor;
70
70
  default: string;
71
71
  };
72
- data: (ArrayConstructor | ObjectConstructor)[];
72
+ data: (ObjectConstructor | ArrayConstructor)[];
73
73
  space: NumberConstructor;
74
74
  start: {
75
75
  type: NumberConstructor;
@@ -46,7 +46,7 @@ declare const pagerProps: {
46
46
  default: () => boolean;
47
47
  };
48
48
  customTotal: {
49
- type: (BooleanConstructor | StringConstructor)[];
49
+ type: (StringConstructor | BooleanConstructor)[];
50
50
  default: () => boolean;
51
51
  };
52
52
  popperClass: StringConstructor;
@@ -60,7 +60,7 @@ declare const popeditorProps: {
60
60
  };
61
61
  };
62
62
  modelValue: {
63
- type: (ArrayConstructor | StringConstructor | NumberConstructor)[];
63
+ type: (StringConstructor | ArrayConstructor | NumberConstructor)[];
64
64
  default: string;
65
65
  };
66
66
  tabindex: {
@@ -67,7 +67,7 @@ declare const popoverProps: {
67
67
  maxHeight: {
68
68
  type: (StringConstructor | NumberConstructor)[];
69
69
  };
70
- listData: (ArrayConstructor | ObjectConstructor)[];
70
+ listData: (ObjectConstructor | ArrayConstructor)[];
71
71
  genArrowByHtml: {
72
72
  type: BooleanConstructor;
73
73
  default: () => boolean;
@@ -92,7 +92,7 @@ declare const progressProps: {
92
92
  };
93
93
  };
94
94
  color: {
95
- type: (ArrayConstructor | StringConstructor | FunctionConstructor)[];
95
+ type: (StringConstructor | FunctionConstructor | ArrayConstructor)[];
96
96
  default: string;
97
97
  };
98
98
  info: StringConstructor;
@@ -14,7 +14,7 @@ declare const stepsProps: {
14
14
  type: StringConstructor;
15
15
  default: string;
16
16
  };
17
- data: (ArrayConstructor | ObjectConstructor)[];
17
+ data: (ObjectConstructor | ArrayConstructor)[];
18
18
  space: (StringConstructor | NumberConstructor)[];
19
19
  active: {
20
20
  type: NumberConstructor;
@@ -30,7 +30,7 @@ declare const switchProps: {
30
30
  };
31
31
  falseColor: StringConstructor;
32
32
  falseValue: {
33
- type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
33
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
34
34
  default: boolean;
35
35
  };
36
36
  mini: {
@@ -38,7 +38,7 @@ declare const switchProps: {
38
38
  default: boolean;
39
39
  };
40
40
  modelValue: {
41
- type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
41
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
42
42
  default: boolean;
43
43
  };
44
44
  size: (StringConstructor | NumberConstructor)[];
@@ -48,7 +48,7 @@ declare const switchProps: {
48
48
  };
49
49
  trueColor: StringConstructor;
50
50
  trueValue: {
51
- type: (BooleanConstructor | StringConstructor | NumberConstructor)[];
51
+ type: (StringConstructor | BooleanConstructor | NumberConstructor)[];
52
52
  default: boolean;
53
53
  };
54
54
  beforeChange: FunctionConstructor;
@@ -1,10 +1,10 @@
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-f76f2393.js';
3
+ import { I as IFileUploadVm, a as IFileUploadConstants } from './upload-list.type-343e8c11.js';
4
4
 
5
5
  declare const UploadDraggerProps: {
6
6
  disabled: BooleanConstructor;
7
- customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
7
+ customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
8
8
  tiny_mode: StringConstructor;
9
9
  tiny_mode_root: BooleanConstructor;
10
10
  tiny_template: (FunctionConstructor | ObjectConstructor)[];
@@ -322,7 +322,7 @@ declare const fileUploadProps: {
322
322
  type: BooleanConstructor;
323
323
  default: boolean;
324
324
  };
325
- customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
325
+ customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
326
326
  hwh5: ObjectConstructor;
327
327
  mode: {
328
328
  type: StringConstructor;
@@ -644,7 +644,7 @@ declare const uploadProps: {
644
644
  type: BooleanConstructor;
645
645
  default: boolean;
646
646
  };
647
- customClass: (ArrayConstructor | StringConstructor | ObjectConstructor)[];
647
+ customClass: (StringConstructor | ObjectConstructor | ArrayConstructor)[];
648
648
  handleTriggerClick: {
649
649
  type: FunctionConstructor;
650
650
  default: () => void;
@@ -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-f76f2393.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-343e8c11.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-f76f2393.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-343e8c11.js';
3
3
  import './shared.type.js';