96cd2f8d5ef0f3c852fdff67feea84245a19ee45dcce8281bf90bf476a446db7d278ba36b9012362c1a9528e4e427c65158cfae0abc7b2e38d50b45adba820 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. 'use strict';
  2. Object.defineProperty(exports, '__esModule', { value: true });
  3. var vue = require('vue');
  4. var lodashUnified = require('lodash-unified');
  5. var index = require('../../select/index.js');
  6. var index$1 = require('../../tree/index.js');
  7. var select = require('./select.js');
  8. var tree = require('./tree.js');
  9. var cacheOptions = require('./cache-options.js');
  10. var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
  11. const _sfc_main = vue.defineComponent({
  12. name: "ElTreeSelect",
  13. inheritAttrs: false,
  14. props: {
  15. ...index.ElSelect.props,
  16. ...index$1.ElTree.props,
  17. cacheData: {
  18. type: Array,
  19. default: () => []
  20. }
  21. },
  22. setup(props, context) {
  23. const { slots, expose } = context;
  24. const select$1 = vue.ref();
  25. const tree$1 = vue.ref();
  26. const key = vue.computed(() => props.nodeKey || props.valueKey || "value");
  27. const selectProps = select.useSelect(props, context, { select: select$1, tree: tree$1, key });
  28. const { cacheOptions: cacheOptions$1, ...treeProps } = tree.useTree(props, context, {
  29. select: select$1,
  30. tree: tree$1,
  31. key
  32. });
  33. const methods = vue.reactive({});
  34. expose(methods);
  35. vue.onMounted(() => {
  36. Object.assign(methods, {
  37. ...lodashUnified.pick(tree$1.value, [
  38. "filter",
  39. "updateKeyChildren",
  40. "getCheckedNodes",
  41. "setCheckedNodes",
  42. "getCheckedKeys",
  43. "setCheckedKeys",
  44. "setChecked",
  45. "getHalfCheckedNodes",
  46. "getHalfCheckedKeys",
  47. "getCurrentKey",
  48. "getCurrentNode",
  49. "setCurrentKey",
  50. "setCurrentNode",
  51. "getNode",
  52. "remove",
  53. "append",
  54. "insertBefore",
  55. "insertAfter"
  56. ]),
  57. ...lodashUnified.pick(select$1.value, ["focus", "blur", "selectedLabel"]),
  58. treeRef: tree$1.value,
  59. selectRef: select$1.value
  60. });
  61. });
  62. return () => vue.h(index.ElSelect, vue.reactive({
  63. ...selectProps,
  64. ref: (ref2) => select$1.value = ref2
  65. }), {
  66. ...slots,
  67. default: () => [
  68. vue.h(cacheOptions["default"], { data: cacheOptions$1.value }),
  69. vue.h(index$1.ElTree, vue.reactive({
  70. ...treeProps,
  71. ref: (ref2) => tree$1.value = ref2
  72. }))
  73. ]
  74. });
  75. }
  76. });
  77. var TreeSelect = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "tree-select.vue"]]);
  78. exports["default"] = TreeSelect;
  79. //# sourceMappingURL=tree-select.js.map