3h1-ui 1.0.115 → 1.0.116

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/es/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { h, nextTick, createVNode, defineComponent, ref, computed, unref, watchEffect, watch, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createElementBlock, Fragment, renderList, createTextVNode, toDisplayString, createSlots, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, onMounted, normalizeClass, createCommentVNode, normalizeStyle, Transition, toHandlers, useSlots, withDirectives, vShow, getCurrentInstance, inject, onUnmounted, provide, onBeforeUnmount, resolveDynamicComponent, reactive, toRef, toRefs, TransitionGroup, getCurrentScope, onScopeDispose, readonly, isVNode, shallowReactive, toRaw, shallowRef, withKeys, withModifiers, render as render$1, resolveDirective } from "vue";
2
- import { Radio, Select, Tree, TreeSelect, Cascader, Transfer, Input, Tooltip, Skeleton, Popover, Pagination, Empty, Button as Button$1, Table as Table$1, Form, FormItem, DatePicker, InputNumber, AutoComplete, Switch, Checkbox, Slider, Rate, TimePicker, Divider, Col, Popconfirm, Modal as Modal$2, Row, Dropdown, Menu, MenuItem, MenuDivider, Spin, PageHeader, Image, Badge, Tag, Descriptions, Drawer, Space, Upload, Avatar } from "ant-design-vue";
2
+ import { Radio, Select, Tree, TreeSelect, Cascader, Transfer, Input, Tooltip, Skeleton, Popover, Pagination, Empty, Button as Button$1, Table as Table$1, Form, FormItem, DatePicker, InputNumber, AutoComplete, Switch, Checkbox, Slider, Rate, TimePicker, Divider, Col, Popconfirm, Modal as Modal$2, Row, Dropdown, Menu, MenuItem, MenuDivider, Spin, PageHeader, Image, Badge, Tag, FormItemRest, Descriptions, Drawer, Space, Upload, Avatar } from "ant-design-vue";
3
3
  import { propTypes, isFunction as isFunction$3, isString as isString$3, isArray as isArray$1, getSlot as getSlot$1, addClass as addClass$1, removeClass as removeClass$1, getPopupContainer as getPopupContainer$1, triggerWindowResize, off, on, addResizeListener, removeResizeListener, isNumber as isNumber$2, isBoolean, isNull, extendSlots as extendSlots$1, withInstall, isObject as isObject$2, dateUtil, isNullOrUnDef, isDef as isDef$1, error as error$1, deepMerge as deepMerge$1, getDynamicProps, buildProps, createBEM, forEach as forEach$1, isClient as isClient$1, filter, treeToList, eachTree, isEmpty, isServer, formatToDate, isMap, buildUUID, findNodeAll, getViewportOffset, warn as warn$1, isNullAndUnDef, dataURLtoBlob } from "@shy-plugins/utils";
4
4
  import { useAttrs as useAttrs$1, useRuleFormItem, useTimeoutFn as useTimeoutFn$2, useScrollTo as useScrollTo$1, useIntersectionObserver, useCopyToClipboard, useMessage, usePagination as usePagination$1, createContext as createContext$1, useContext as useContext$2, useBreakpoint, useI18n as useI18n$1, useContentHeight, useDesign as useDesign$1, useWindowSizeFn as useWindowSizeFn$1, onMountedOrActivated, useEventListener as useEventListener$1 } from "@shy-plugins/use";
5
5
  import { omit, get, isNil, cloneDeep, upperFirst as upperFirst$1, set, uniqBy, isEqual, difference, pick, merge } from "lodash-es";
@@ -5598,7 +5598,6 @@ const _sfc_main$K = /* @__PURE__ */ defineComponent({
5598
5598
  });
5599
5599
  }
5600
5600
  if (schema2.component === "Select") {
5601
- console.log("componentProps", componentProps);
5602
5601
  const label = ((_b = componentProps == null ? void 0 : componentProps.fieldNames) == null ? void 0 : _b.label) || "label";
5603
5602
  componentProps = Object.assign({}, componentProps, {
5604
5603
  showSearch: true,
@@ -13394,64 +13393,28 @@ function useTable(tableProps) {
13394
13393
  }
13395
13394
  const _sfc_main$c = /* @__PURE__ */ defineComponent({
13396
13395
  __name: "Table",
13397
- props: {
13398
- columns: {
13399
- default: () => [
13400
- { title: "a", dataIndex: "a" },
13401
- { title: "b", dataIndex: "b" },
13402
- { title: "c", dataIndex: "c" },
13403
- { title: "d", dataIndex: "d" }
13404
- ]
13405
- },
13406
- schemas: {
13407
- default: () => [
13408
- { label: "a", field: "a", component: "Input", colProps: { span: 8 } },
13409
- { label: "b", field: "b", component: "Input", colProps: { span: 8 } }
13410
- ]
13411
- },
13412
- api: {
13413
- default: () => () => new Promise(
13414
- (resolve) => resolve([
13415
- { a: 1, b: 2, c: 3, d: 4, id: "1" },
13416
- { a: 1, b: 2, c: 3, d: 4, id: "2" },
13417
- { a: 1, b: 2, c: 3, d: 4, id: "3" },
13418
- { a: 1, b: 2, c: 3, d: 4, id: "4" },
13419
- { a: 1, b: 2, c: 3, d: 4, id: "5" },
13420
- { a: 1, b: 2, c: 3, d: 4, id: "6" },
13421
- { a: 1, b: 2, c: 3, d: 4, id: "7" },
13422
- { a: 1, b: 2, c: 3, d: 4, id: "8" },
13423
- { a: 1, b: 2, c: 3, d: 4, id: "9" },
13424
- { a: 1, b: 2, c: 3, d: 4, id: "10" }
13425
- ])
13426
- )
13427
- },
13428
- fieldNames: {
13429
- default: () => {
13430
- return { label: "a", value: "id" };
13431
- }
13432
- }
13433
- },
13434
13396
  setup(__props, { expose }) {
13435
- const props2 = __props;
13436
- const [registerTable, { reload, setProps, getSelectRows, getRowSelection }] = useTable({
13437
- api: props2.api,
13397
+ const getTableProps = inject("getTableProps");
13398
+ const [registerTable, tableAction] = useTable({
13399
+ api: () => {
13400
+ },
13438
13401
  title: "\u8D26\u53F7\u5217\u8868",
13439
- isTreeTable: true,
13440
13402
  rowKey: "id",
13441
- columns: props2.columns,
13442
- rowSelection: { type: "checkbox" },
13443
- clickToRowSelect: false,
13403
+ columns: [],
13404
+ rowSelection: { type: "radio" },
13405
+ clickToRowSelect: true,
13444
13406
  useSearchForm: true,
13445
13407
  formConfig: {
13446
13408
  labelWidth: 80,
13447
- schemas: props2.schemas
13409
+ schemas: []
13448
13410
  },
13449
13411
  showIndexColumn: true,
13450
13412
  isCanResizeParent: true,
13451
13413
  canResize: true,
13452
- searchInfo: {}
13414
+ searchInfo: {},
13415
+ ...unref(getTableProps)
13453
13416
  });
13454
- expose({ reload, getRowSelection, setProps, getSelectRows });
13417
+ expose({ ...tableAction });
13455
13418
  return (_ctx, _cache) => {
13456
13419
  return openBlock(), createBlock(unref(BasicTable), {
13457
13420
  class: "flex-1",
@@ -13463,8 +13426,16 @@ const _sfc_main$c = /* @__PURE__ */ defineComponent({
13463
13426
  const _hoisted_1$5 = { class: "wrapper" };
13464
13427
  const _sfc_main$b = /* @__PURE__ */ defineComponent({
13465
13428
  __name: "Modal",
13429
+ props: {
13430
+ title: {
13431
+ type: String,
13432
+ required: true,
13433
+ default: "title"
13434
+ }
13435
+ },
13466
13436
  emits: ["confirm", "register"],
13467
13437
  setup(__props, { emit }) {
13438
+ const props2 = __props;
13468
13439
  const [register, { closeModal }] = useModalInner((data) => {
13469
13440
  });
13470
13441
  const getTreeProps = inject("getTreeProps");
@@ -13475,17 +13446,13 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13475
13446
  tableRef.value.reload();
13476
13447
  };
13477
13448
  const handleComfirm = () => {
13478
- const { selectedRowKeys } = tableRef.value.getRowSelection();
13479
13449
  const rows = tableRef.value.getSelectRows();
13480
- const labelList = rows.map((item) => {
13481
- return item[unref(getTableProps).fieldNames.label];
13482
- });
13483
13450
  closeModal();
13484
- emit("confirm", selectedRowKeys, labelList);
13451
+ emit("confirm", rows);
13485
13452
  };
13486
13453
  return (_ctx, _cache) => {
13487
13454
  return openBlock(), createBlock(unref(BasicModal), {
13488
- title: "title",
13455
+ title: props2.title,
13489
13456
  width: "80%",
13490
13457
  onRegister: unref(register),
13491
13458
  onOk: handleComfirm
@@ -13504,12 +13471,12 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
13504
13471
  ])
13505
13472
  ]),
13506
13473
  _: 1
13507
- }, 8, ["onRegister"]);
13474
+ }, 8, ["title", "onRegister"]);
13508
13475
  };
13509
13476
  }
13510
13477
  });
13511
- const Modal_vue_vue_type_style_index_0_scoped_92d9be8b_lang = "";
13512
- const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-92d9be8b"]]);
13478
+ const Modal_vue_vue_type_style_index_0_scoped_e49b3371_lang = "";
13479
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-e49b3371"]]);
13513
13480
  const _hoisted_1$4 = { class: "api-modal-select" };
13514
13481
  const _sfc_main$a = /* @__PURE__ */ defineComponent({
13515
13482
  __name: "ApiModalSelect",
@@ -13520,7 +13487,7 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13520
13487
  title: {
13521
13488
  default: "title"
13522
13489
  },
13523
- table: {
13490
+ tableComponentProps: {
13524
13491
  type: Object,
13525
13492
  default: () => ({
13526
13493
  api: () => new Promise((resolve) => {
@@ -13537,7 +13504,12 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13537
13504
  { a: 1, b: 2, c: 3, d: 4, id: "10" }
13538
13505
  ]);
13539
13506
  }),
13540
- fieldNames: { label: "a", value: "id" }
13507
+ columns: [
13508
+ { title: "a", dataIndex: "a" },
13509
+ { title: "b", dataIndex: "b" },
13510
+ { title: "c", dataIndex: "c" },
13511
+ { title: "d", dataIndex: "d" }
13512
+ ]
13541
13513
  })
13542
13514
  },
13543
13515
  tree: {
@@ -13558,10 +13530,17 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13558
13530
  ]);
13559
13531
  })
13560
13532
  })
13533
+ },
13534
+ selectMode: {
13535
+ default: "single",
13536
+ type: String
13537
+ },
13538
+ fieldNames: {
13539
+ default: { label: "name", value: "id" }
13561
13540
  }
13562
13541
  },
13563
- emits: ["update:value"],
13564
- setup(__props, { emit }) {
13542
+ emits: ["update:value", "change"],
13543
+ setup(__props, { expose, emit }) {
13565
13544
  const props2 = __props;
13566
13545
  const [register, { openModal }] = useModal();
13567
13546
  const emitData = ref([]);
@@ -13571,10 +13550,14 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13571
13550
  return { ...props2.tree };
13572
13551
  });
13573
13552
  const getTableProps = computed(() => {
13574
- return { ...props2.table };
13553
+ return { ...props2.tableComponentProps };
13554
+ });
13555
+ const getSelectMode = computed(() => {
13556
+ return props2.selectMode;
13575
13557
  });
13576
13558
  provide("getTreeProps", getTreeProps);
13577
13559
  provide("getTableProps", getTableProps);
13560
+ provide("getSelectMode", getSelectMode);
13578
13561
  watch(
13579
13562
  () => state.value,
13580
13563
  (v) => {
@@ -13584,39 +13567,51 @@ const _sfc_main$a = /* @__PURE__ */ defineComponent({
13584
13567
  const handleClick = () => {
13585
13568
  openModal(true, {});
13586
13569
  };
13587
- const handleConfirm = (list, labelList) => {
13588
- state.value = list.join(",");
13589
- label.value = labelList.join(",");
13570
+ const handleConfirm = (rows) => {
13571
+ state.value = rows.map((item) => {
13572
+ return item[props2.fieldNames.value];
13573
+ }).join(",");
13574
+ label.value = rows.map((item) => {
13575
+ return item[props2.fieldNames.label];
13576
+ }).join(",");
13590
13577
  };
13578
+ const getLabel = () => {
13579
+ return unref(label);
13580
+ };
13581
+ expose({ getLabel });
13591
13582
  return (_ctx, _cache) => {
13592
- return openBlock(), createElementBlock(Fragment, null, [
13593
- createElementVNode("div", _hoisted_1$4, [
13594
- createVNode(unref(Input), {
13595
- value: label.value,
13596
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => label.value = $event),
13597
- readonly: ""
13598
- }, {
13599
- addonAfter: withCtx(() => [
13600
- createElementVNode("div", {
13601
- class: "btn-wrapper",
13602
- onClick: handleClick
13603
- }, [
13604
- createVNode(unref(SmallDashOutlined$1))
13605
- ])
13606
- ]),
13607
- _: 1
13608
- }, 8, ["value"])
13609
- ]),
13610
- createVNode(Modal, {
13611
- onRegister: unref(register),
13612
- onConfirm: handleConfirm
13613
- }, null, 8, ["onRegister"])
13614
- ], 64);
13583
+ return openBlock(), createElementBlock("div", _hoisted_1$4, [
13584
+ createVNode(unref(Input), {
13585
+ value: label.value,
13586
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => label.value = $event),
13587
+ readonly: ""
13588
+ }, {
13589
+ addonAfter: withCtx(() => [
13590
+ createElementVNode("div", {
13591
+ class: "btn-wrapper",
13592
+ onClick: handleClick
13593
+ }, [
13594
+ createVNode(unref(SmallDashOutlined$1))
13595
+ ])
13596
+ ]),
13597
+ _: 1
13598
+ }, 8, ["value"]),
13599
+ createVNode(unref(FormItemRest), null, {
13600
+ default: withCtx(() => [
13601
+ createVNode(Modal, {
13602
+ title: __props.title,
13603
+ onRegister: unref(register),
13604
+ onConfirm: handleConfirm
13605
+ }, null, 8, ["title", "onRegister"])
13606
+ ]),
13607
+ _: 1
13608
+ })
13609
+ ]);
13615
13610
  };
13616
13611
  }
13617
13612
  });
13618
- const ApiModalSelect_vue_vue_type_style_index_0_scoped_841335d3_lang = "";
13619
- const ApiModalSelect = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-841335d3"]]);
13613
+ const ApiModalSelect_vue_vue_type_style_index_0_scoped_0547c2d8_lang = "";
13614
+ const ApiModalSelect = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0547c2d8"]]);
13620
13615
  function _isSlot(s) {
13621
13616
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !isVNode(s);
13622
13617
  }
package/es/style.css CHANGED
@@ -1047,22 +1047,22 @@ span.iconify {
1047
1047
  /* stylelint-disable no-duplicate-selectors */
1048
1048
  /* stylelint-disable */
1049
1049
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
1050
- .wrapper[data-v-92d9be8b] {
1050
+ .wrapper[data-v-e49b3371] {
1051
1051
  display: flex;
1052
1052
  }
1053
- .tree[data-v-92d9be8b] {
1053
+ .tree[data-v-e49b3371] {
1054
1054
  flex: none;
1055
1055
  }
1056
- .table[data-v-92d9be8b] {
1056
+ .table[data-v-e49b3371] {
1057
1057
  flex: auto;
1058
1058
  }
1059
1059
  /* stylelint-disable no-duplicate-selectors */
1060
1060
  /* stylelint-disable */
1061
1061
  /* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */
1062
- [data-v-841335d3] .ant-input-group-addon {
1062
+ [data-v-0547c2d8] .ant-input-group-addon {
1063
1063
  padding: 0;
1064
1064
  }
1065
- .btn-wrapper[data-v-841335d3] {
1065
+ .btn-wrapper[data-v-0547c2d8] {
1066
1066
  padding: 0 5px;
1067
1067
  display: flex;
1068
1068
  align-items: center;
package/lib/index.js CHANGED
@@ -5603,7 +5603,6 @@ const _sfc_main$K = /* @__PURE__ */ vue.defineComponent({
5603
5603
  });
5604
5604
  }
5605
5605
  if (schema2.component === "Select") {
5606
- console.log("componentProps", componentProps);
5607
5606
  const label = ((_b = componentProps == null ? void 0 : componentProps.fieldNames) == null ? void 0 : _b.label) || "label";
5608
5607
  componentProps = Object.assign({}, componentProps, {
5609
5608
  showSearch: true,
@@ -13399,64 +13398,28 @@ function useTable(tableProps) {
13399
13398
  }
13400
13399
  const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
13401
13400
  __name: "Table",
13402
- props: {
13403
- columns: {
13404
- default: () => [
13405
- { title: "a", dataIndex: "a" },
13406
- { title: "b", dataIndex: "b" },
13407
- { title: "c", dataIndex: "c" },
13408
- { title: "d", dataIndex: "d" }
13409
- ]
13410
- },
13411
- schemas: {
13412
- default: () => [
13413
- { label: "a", field: "a", component: "Input", colProps: { span: 8 } },
13414
- { label: "b", field: "b", component: "Input", colProps: { span: 8 } }
13415
- ]
13416
- },
13417
- api: {
13418
- default: () => () => new Promise(
13419
- (resolve) => resolve([
13420
- { a: 1, b: 2, c: 3, d: 4, id: "1" },
13421
- { a: 1, b: 2, c: 3, d: 4, id: "2" },
13422
- { a: 1, b: 2, c: 3, d: 4, id: "3" },
13423
- { a: 1, b: 2, c: 3, d: 4, id: "4" },
13424
- { a: 1, b: 2, c: 3, d: 4, id: "5" },
13425
- { a: 1, b: 2, c: 3, d: 4, id: "6" },
13426
- { a: 1, b: 2, c: 3, d: 4, id: "7" },
13427
- { a: 1, b: 2, c: 3, d: 4, id: "8" },
13428
- { a: 1, b: 2, c: 3, d: 4, id: "9" },
13429
- { a: 1, b: 2, c: 3, d: 4, id: "10" }
13430
- ])
13431
- )
13432
- },
13433
- fieldNames: {
13434
- default: () => {
13435
- return { label: "a", value: "id" };
13436
- }
13437
- }
13438
- },
13439
13401
  setup(__props, { expose }) {
13440
- const props2 = __props;
13441
- const [registerTable, { reload, setProps, getSelectRows, getRowSelection }] = useTable({
13442
- api: props2.api,
13402
+ const getTableProps = vue.inject("getTableProps");
13403
+ const [registerTable, tableAction] = useTable({
13404
+ api: () => {
13405
+ },
13443
13406
  title: "\u8D26\u53F7\u5217\u8868",
13444
- isTreeTable: true,
13445
13407
  rowKey: "id",
13446
- columns: props2.columns,
13447
- rowSelection: { type: "checkbox" },
13448
- clickToRowSelect: false,
13408
+ columns: [],
13409
+ rowSelection: { type: "radio" },
13410
+ clickToRowSelect: true,
13449
13411
  useSearchForm: true,
13450
13412
  formConfig: {
13451
13413
  labelWidth: 80,
13452
- schemas: props2.schemas
13414
+ schemas: []
13453
13415
  },
13454
13416
  showIndexColumn: true,
13455
13417
  isCanResizeParent: true,
13456
13418
  canResize: true,
13457
- searchInfo: {}
13419
+ searchInfo: {},
13420
+ ...vue.unref(getTableProps)
13458
13421
  });
13459
- expose({ reload, getRowSelection, setProps, getSelectRows });
13422
+ expose({ ...tableAction });
13460
13423
  return (_ctx, _cache) => {
13461
13424
  return vue.openBlock(), vue.createBlock(vue.unref(BasicTable), {
13462
13425
  class: "flex-1",
@@ -13468,8 +13431,16 @@ const _sfc_main$c = /* @__PURE__ */ vue.defineComponent({
13468
13431
  const _hoisted_1$5 = { class: "wrapper" };
13469
13432
  const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
13470
13433
  __name: "Modal",
13434
+ props: {
13435
+ title: {
13436
+ type: String,
13437
+ required: true,
13438
+ default: "title"
13439
+ }
13440
+ },
13471
13441
  emits: ["confirm", "register"],
13472
13442
  setup(__props, { emit }) {
13443
+ const props2 = __props;
13473
13444
  const [register, { closeModal }] = useModalInner((data) => {
13474
13445
  });
13475
13446
  const getTreeProps = vue.inject("getTreeProps");
@@ -13480,17 +13451,13 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
13480
13451
  tableRef.value.reload();
13481
13452
  };
13482
13453
  const handleComfirm = () => {
13483
- const { selectedRowKeys } = tableRef.value.getRowSelection();
13484
13454
  const rows = tableRef.value.getSelectRows();
13485
- const labelList = rows.map((item) => {
13486
- return item[vue.unref(getTableProps).fieldNames.label];
13487
- });
13488
13455
  closeModal();
13489
- emit("confirm", selectedRowKeys, labelList);
13456
+ emit("confirm", rows);
13490
13457
  };
13491
13458
  return (_ctx, _cache) => {
13492
13459
  return vue.openBlock(), vue.createBlock(vue.unref(BasicModal), {
13493
- title: "title",
13460
+ title: props2.title,
13494
13461
  width: "80%",
13495
13462
  onRegister: vue.unref(register),
13496
13463
  onOk: handleComfirm
@@ -13509,12 +13476,12 @@ const _sfc_main$b = /* @__PURE__ */ vue.defineComponent({
13509
13476
  ])
13510
13477
  ]),
13511
13478
  _: 1
13512
- }, 8, ["onRegister"]);
13479
+ }, 8, ["title", "onRegister"]);
13513
13480
  };
13514
13481
  }
13515
13482
  });
13516
- const Modal_vue_vue_type_style_index_0_scoped_92d9be8b_lang = "";
13517
- const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-92d9be8b"]]);
13483
+ const Modal_vue_vue_type_style_index_0_scoped_e49b3371_lang = "";
13484
+ const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$b, [["__scopeId", "data-v-e49b3371"]]);
13518
13485
  const _hoisted_1$4 = { class: "api-modal-select" };
13519
13486
  const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13520
13487
  __name: "ApiModalSelect",
@@ -13525,7 +13492,7 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13525
13492
  title: {
13526
13493
  default: "title"
13527
13494
  },
13528
- table: {
13495
+ tableComponentProps: {
13529
13496
  type: Object,
13530
13497
  default: () => ({
13531
13498
  api: () => new Promise((resolve) => {
@@ -13542,7 +13509,12 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13542
13509
  { a: 1, b: 2, c: 3, d: 4, id: "10" }
13543
13510
  ]);
13544
13511
  }),
13545
- fieldNames: { label: "a", value: "id" }
13512
+ columns: [
13513
+ { title: "a", dataIndex: "a" },
13514
+ { title: "b", dataIndex: "b" },
13515
+ { title: "c", dataIndex: "c" },
13516
+ { title: "d", dataIndex: "d" }
13517
+ ]
13546
13518
  })
13547
13519
  },
13548
13520
  tree: {
@@ -13563,10 +13535,17 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13563
13535
  ]);
13564
13536
  })
13565
13537
  })
13538
+ },
13539
+ selectMode: {
13540
+ default: "single",
13541
+ type: String
13542
+ },
13543
+ fieldNames: {
13544
+ default: { label: "name", value: "id" }
13566
13545
  }
13567
13546
  },
13568
- emits: ["update:value"],
13569
- setup(__props, { emit }) {
13547
+ emits: ["update:value", "change"],
13548
+ setup(__props, { expose, emit }) {
13570
13549
  const props2 = __props;
13571
13550
  const [register, { openModal }] = useModal();
13572
13551
  const emitData = vue.ref([]);
@@ -13576,10 +13555,14 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13576
13555
  return { ...props2.tree };
13577
13556
  });
13578
13557
  const getTableProps = vue.computed(() => {
13579
- return { ...props2.table };
13558
+ return { ...props2.tableComponentProps };
13559
+ });
13560
+ const getSelectMode = vue.computed(() => {
13561
+ return props2.selectMode;
13580
13562
  });
13581
13563
  vue.provide("getTreeProps", getTreeProps);
13582
13564
  vue.provide("getTableProps", getTableProps);
13565
+ vue.provide("getSelectMode", getSelectMode);
13583
13566
  vue.watch(
13584
13567
  () => state.value,
13585
13568
  (v) => {
@@ -13589,39 +13572,51 @@ const _sfc_main$a = /* @__PURE__ */ vue.defineComponent({
13589
13572
  const handleClick = () => {
13590
13573
  openModal(true, {});
13591
13574
  };
13592
- const handleConfirm = (list, labelList) => {
13593
- state.value = list.join(",");
13594
- label.value = labelList.join(",");
13575
+ const handleConfirm = (rows) => {
13576
+ state.value = rows.map((item) => {
13577
+ return item[props2.fieldNames.value];
13578
+ }).join(",");
13579
+ label.value = rows.map((item) => {
13580
+ return item[props2.fieldNames.label];
13581
+ }).join(",");
13595
13582
  };
13583
+ const getLabel = () => {
13584
+ return vue.unref(label);
13585
+ };
13586
+ expose({ getLabel });
13596
13587
  return (_ctx, _cache) => {
13597
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
13598
- vue.createElementVNode("div", _hoisted_1$4, [
13599
- vue.createVNode(vue.unref(antDesignVue.Input), {
13600
- value: label.value,
13601
- "onUpdate:value": _cache[0] || (_cache[0] = ($event) => label.value = $event),
13602
- readonly: ""
13603
- }, {
13604
- addonAfter: vue.withCtx(() => [
13605
- vue.createElementVNode("div", {
13606
- class: "btn-wrapper",
13607
- onClick: handleClick
13608
- }, [
13609
- vue.createVNode(vue.unref(SmallDashOutlined$1))
13610
- ])
13611
- ]),
13612
- _: 1
13613
- }, 8, ["value"])
13614
- ]),
13615
- vue.createVNode(Modal, {
13616
- onRegister: vue.unref(register),
13617
- onConfirm: handleConfirm
13618
- }, null, 8, ["onRegister"])
13619
- ], 64);
13588
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$4, [
13589
+ vue.createVNode(vue.unref(antDesignVue.Input), {
13590
+ value: label.value,
13591
+ "onUpdate:value": _cache[0] || (_cache[0] = ($event) => label.value = $event),
13592
+ readonly: ""
13593
+ }, {
13594
+ addonAfter: vue.withCtx(() => [
13595
+ vue.createElementVNode("div", {
13596
+ class: "btn-wrapper",
13597
+ onClick: handleClick
13598
+ }, [
13599
+ vue.createVNode(vue.unref(SmallDashOutlined$1))
13600
+ ])
13601
+ ]),
13602
+ _: 1
13603
+ }, 8, ["value"]),
13604
+ vue.createVNode(vue.unref(antDesignVue.FormItemRest), null, {
13605
+ default: vue.withCtx(() => [
13606
+ vue.createVNode(Modal, {
13607
+ title: __props.title,
13608
+ onRegister: vue.unref(register),
13609
+ onConfirm: handleConfirm
13610
+ }, null, 8, ["title", "onRegister"])
13611
+ ]),
13612
+ _: 1
13613
+ })
13614
+ ]);
13620
13615
  };
13621
13616
  }
13622
13617
  });
13623
- const ApiModalSelect_vue_vue_type_style_index_0_scoped_841335d3_lang = "";
13624
- const ApiModalSelect = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-841335d3"]]);
13618
+ const ApiModalSelect_vue_vue_type_style_index_0_scoped_0547c2d8_lang = "";
13619
+ const ApiModalSelect = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-0547c2d8"]]);
13625
13620
  function _isSlot(s) {
13626
13621
  return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !vue.isVNode(s);
13627
13622
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "3h1-ui",
3
- "version": "1.0.115",
3
+ "version": "1.0.116",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",