@opentiny/vue-renderless 3.10.1 → 3.10.3

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.
@@ -65,17 +65,14 @@ const getStyleComputedProperty = (el, property) => {
65
65
  let css = window.getComputedStyle(el, null);
66
66
  return css[property];
67
67
  };
68
- const isFixed = (el, offsetParent) => {
68
+ const isFixed = (el) => {
69
69
  if (el === window.document.body) {
70
70
  return false;
71
71
  }
72
72
  if (getStyleComputedProperty(el, "position") === "fixed") {
73
73
  return true;
74
74
  }
75
- if (el === offsetParent) {
76
- return false;
77
- }
78
- return el.parentNode ? isFixed(el.parentNode, offsetParent) : false;
75
+ return el.parentNode ? isFixed(el.parentNode) : false;
79
76
  };
80
77
  const getBoundingClientRect = (el) => {
81
78
  let rectObj = el.getBoundingClientRect();
@@ -293,11 +290,10 @@ Popper.prototype.parse = function(config) {
293
290
  return popper;
294
291
  };
295
292
  Popper.prototype._getPosition = function(popper, reference) {
296
- let offsetParent = getOffsetParent(reference);
297
293
  if (this._options.forceAbsolute) {
298
294
  return "absolute";
299
295
  }
300
- let isParentFixed = isFixed(reference, offsetParent);
296
+ let isParentFixed = isFixed(reference);
301
297
  return isParentFixed ? "fixed" : "absolute";
302
298
  };
303
299
  Popper.prototype._getOffsets = function(popper, reference, placement) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.10.1",
3
+ "version": "3.10.3",
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/search/index.js CHANGED
@@ -31,9 +31,9 @@ const searchClick = ({ emit, props, state }) => (e) => {
31
31
  emit("search", state.searchValue, state.currentValue);
32
32
  }
33
33
  };
34
- const searchEnterKey = ({ api, props, refs, nextTick }) => () => {
34
+ const searchEnterKey = ({ api, props, refs, nextTick }) => (event) => {
35
35
  if (props.isEnterSearch) {
36
- api.searchClick();
36
+ api.searchClick(event);
37
37
  nextTick(() => refs.input.blur());
38
38
  }
39
39
  };
package/select/index.js CHANGED
@@ -189,8 +189,9 @@ const getOption = ({ props, state }) => (value) => {
189
189
  const isObject = Object.prototype.toString.call(value).toLowerCase() === "[object object]";
190
190
  const isNull2 = Object.prototype.toString.call(value).toLowerCase() === "[object null]";
191
191
  const isUndefined = Object.prototype.toString.call(value).toLowerCase() === "[object undefined]";
192
- for (let i = state.cachedOptions.length - 1; i >= 0; i--) {
193
- const cachedOption = state.cachedOptions[i];
192
+ const optionsList = props.optimization ? props.options : state.cachedOptions;
193
+ for (let i = optionsList.length - 1; i >= 0; i--) {
194
+ const cachedOption = optionsList[i];
194
195
  const isEqual2 = isObject ? getObj(cachedOption.value, props.valueKey) === getObj(value, props.valueKey) : cachedOption.value === value;
195
196
  if (isEqual2) {
196
197
  option = cachedOption;
@@ -198,6 +199,9 @@ const getOption = ({ props, state }) => (value) => {
198
199
  }
199
200
  }
200
201
  if (option) {
202
+ if (!option.currentLabel) {
203
+ option.currentLabel = option[props.textField];
204
+ }
201
205
  return option;
202
206
  }
203
207
  const label = !isObject && !isNull2 && !isUndefined ? value : "";
package/slider/index.js CHANGED
@@ -175,18 +175,22 @@ const calcCurrentValue = ({ currentValue, props, state }) => {
175
175
  return currentValue;
176
176
  };
177
177
  const setActiveButtonValue = ({ api, emit, props, state }) => (value) => {
178
- let currentValue = value;
179
- currentValue = calcCurrentValue({ currentValue, props, state });
180
- if (!state.isDouble) {
181
- state.leftBtnValue = currentValue;
178
+ if (Array.isArray(value)) {
179
+ ;
180
+ [state.leftBtnValue, state.rightBtnValue] = value;
182
181
  } else {
183
- if (state.activeIndex === 0) {
182
+ let currentValue = calcCurrentValue({ currentValue: value, props, state });
183
+ if (!state.isDouble) {
184
184
  state.leftBtnValue = currentValue;
185
185
  } else {
186
- state.rightBtnValue = currentValue;
186
+ if (state.activeIndex === 0) {
187
+ state.leftBtnValue = currentValue;
188
+ } else {
189
+ state.rightBtnValue = currentValue;
190
+ }
187
191
  }
192
+ state.activeValue = currentValue;
188
193
  }
189
- state.activeValue = currentValue;
190
194
  state.innerTrigger = true;
191
195
  emit("update:modelValue", api.getActiveButtonValue());
192
196
  };