@opentiny/vue-renderless 3.19.3 → 3.19.5

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/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.19.3";
240
+ const version = "3.19.5";
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.19.3";
25
+ const version = "3.19.5";
26
26
  const Renderless = {
27
27
  browser,
28
28
  array,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opentiny/vue-renderless",
3
- "version": "3.19.3",
3
+ "version": "3.19.5",
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
  "author": "OpenTiny Team",
6
6
  "license": "MIT",
package/transfer/index.js CHANGED
@@ -142,13 +142,15 @@ const clearQuery = (refs) => (which) => {
142
142
  refs.rightPanel.state.query = "";
143
143
  }
144
144
  };
145
- const logicFun = ({ props, emit, state }) => ({ event, isAdd, pullMode }) => {
145
+ const logicFun = ({ props, emit, state, vm }) => ({ event, isAdd, pullMode }) => {
146
146
  let currentValue = props.modelValue.slice();
147
147
  let movedKeys = [];
148
148
  if (pullMode) {
149
149
  currentValue.splice(event.newIndex, 0, currentValue.splice(event.oldIndex, 1)[0]);
150
150
  } else {
151
- const key = isAdd ? state.targetData[event.oldIndex][props.props.key] : state.sourceData[event.oldIndex][props.props.key];
151
+ const rightPanel = vm.$refs.rightPanel;
152
+ const leftPanel = vm.$refs.leftPanel;
153
+ const key = isAdd ? rightPanel.state.filteredData[event.oldIndex][props.props.key] : leftPanel.state.filteredData[event.oldIndex][props.props.key];
152
154
  const index = isAdd ? state.rightChecked.indexOf(key) : state.leftChecked.indexOf(key);
153
155
  const valueIndex = currentValue.indexOf(key);
154
156
  if (isAdd) {
package/transfer/vue.js CHANGED
@@ -34,7 +34,7 @@ const initState = ({ reactive, computed, api: api2, props, h, slots }) => reacti
34
34
  return h("span", option[props.props.label] || option[props.props.key]);
35
35
  })
36
36
  });
37
- const renderless = (props, { computed, onMounted, reactive, h }, { $prefix, emit, refs, parent, slots }) => {
37
+ const renderless = (props, { computed, onMounted, reactive, h }, { $prefix, emit, refs, parent, slots, vm }) => {
38
38
  const api2 = {};
39
39
  const Tree = $prefix + "Tree";
40
40
  const Table = $prefix + "Table";
@@ -51,7 +51,7 @@ const renderless = (props, { computed, onMounted, reactive, h }, { $prefix, emit
51
51
  addToRight: addToRight({ emit, refs, props, state, Tree }),
52
52
  onTargetCheckedChange: onTargetCheckedChange({ emit, state }),
53
53
  onSourceCheckedChange: onSourceCheckedChange({ emit, state }),
54
- logicFun: logicFun({ props, emit, state }),
54
+ logicFun: logicFun({ props, emit, state, vm }),
55
55
  getTargetData: getTargetData({ props, state, Tree, Table }),
56
56
  sortableEvent: sortableEvent({ api: api2, droppanel: DROPPANEL, props, queryDom: TRANSFERPANEL, refs })
57
57
  });
@@ -48,6 +48,10 @@ const handleSelectChange = ({ props, state }) => (checked, indeterminate) => {
48
48
  state.indeterminate = indeterminate;
49
49
  };
50
50
  const handleClick = ({ api, vm, props, state }) => (e) => {
51
+ const contentElm = vm.$refs.content;
52
+ if (contentElm && !contentElm.contains(e == null ? void 0 : e.target)) {
53
+ return;
54
+ }
51
55
  const store = state.tree.state.store;
52
56
  state.tree.clearCurrentStore(props.node);
53
57
  if (!state.tree.onlyCheckChildren) {
@@ -120,7 +120,7 @@ declare const addToRight: ({ emit, refs, props, state, Tree }: Pick<ITransferRen
120
120
  }) => (value: undefined | 'all') => void;
121
121
  declare const clearQuery: (refs: ITransferRenderlessParams['refs']) => (which: 'left' | 'right') => void;
122
122
  /** SortableJs 插件的回调逻辑, 添加,删除,更新事件后,触发本函数 */
123
- declare const logicFun: ({ props, emit, state }: Pick<ITransferRenderlessParams, 'emit' | 'props' | 'state'>) => ({ event, isAdd, pullMode }: {
123
+ declare const logicFun: ({ props, emit, state, vm }: Pick<ITransferRenderlessParams, 'emit' | 'props' | 'state'>) => ({ event, isAdd, pullMode }: {
124
124
  event: any;
125
125
  isAdd?: boolean | undefined;
126
126
  pullMode?: "sort" | undefined;