zartui 3.1.83 → 3.1.85

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/lib/zartui.cjs.js CHANGED
@@ -9052,12 +9052,19 @@ const drawerSelectProps = {
9052
9052
  default: false
9053
9053
  },
9054
9054
  defaultSelectNode: Object,
9055
- activeClassName: makeStringProp("")
9055
+ activeClassName: makeStringProp(""),
9056
+ commonTypeList: makeArrayProp(),
9057
+ showCommonTypes: {
9058
+ type: Boolean,
9059
+ default: false
9060
+ },
9061
+ commonTypeVisibleCount: Number,
9062
+ hotTypeList: makeArrayProp()
9056
9063
  };
9057
9064
  var stdin_default$14 = vue.defineComponent({
9058
9065
  name: name$L,
9059
9066
  props: drawerSelectProps,
9060
- emits: ["change", "select"],
9067
+ emits: ["change", "select", "clearAll"],
9061
9068
  setup(props, {
9062
9069
  emit
9063
9070
  }) {
@@ -9069,8 +9076,17 @@ var stdin_default$14 = vue.defineComponent({
9069
9076
  const searchRef = vue.ref();
9070
9077
  const offset = vue.ref(0);
9071
9078
  const historyList = vue.ref([]);
9079
+ const showAllCommonTypes = vue.ref(false);
9080
+ const selectCommonId = vue.ref(-1);
9072
9081
  const defaultTreeNode = vue.ref(props.treeData);
9073
9082
  const fields = vue.computed(() => assignDefaultFields$1(props.treeFieldName));
9083
+ const visibleCommonTypeList = vue.computed(() => {
9084
+ const count = props.commonTypeVisibleCount;
9085
+ if (typeof count !== "number") {
9086
+ return props.commonTypeList;
9087
+ }
9088
+ return props.commonTypeList.slice(0, Math.max(0, count));
9089
+ });
9074
9090
  const {
9075
9091
  value,
9076
9092
  children,
@@ -9154,6 +9170,37 @@ var stdin_default$14 = vue.defineComponent({
9154
9170
  updateOffset();
9155
9171
  });
9156
9172
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9173
+ const syncExpandNodeByParent = (item) => {
9174
+ var _a, _b, _c;
9175
+ const parent = (_a = item.parent) != null ? _a : [];
9176
+ if (parent.length >= 2) {
9177
+ const parentValue = (_b = parent[parent.length - 2]) == null ? void 0 : _b[value];
9178
+ if (parentValue !== void 0) {
9179
+ const stack = [...props.treeData];
9180
+ while (stack.length > 0) {
9181
+ const current2 = stack.shift();
9182
+ if (!current2)
9183
+ continue;
9184
+ if (current2[value] === parentValue) {
9185
+ expandNode.value = {
9186
+ text: current2[key],
9187
+ value: current2[value],
9188
+ children: current2[children]
9189
+ };
9190
+ return;
9191
+ }
9192
+ if ((_c = current2[children]) == null ? void 0 : _c.length) {
9193
+ stack.push(...current2[children]);
9194
+ }
9195
+ }
9196
+ }
9197
+ }
9198
+ expandNode.value = {
9199
+ text: allData[key],
9200
+ value: allData[value],
9201
+ children: allData[children]
9202
+ };
9203
+ };
9157
9204
  const onLabelClick = (item, assign = true) => {
9158
9205
  const {
9159
9206
  text,
@@ -9170,6 +9217,7 @@ var stdin_default$14 = vue.defineComponent({
9170
9217
  }
9171
9218
  if (isEmpty(item)) {
9172
9219
  selectNode.value = item;
9220
+ selectCommonId.value = item[value2];
9173
9221
  emit("select", item);
9174
9222
  }
9175
9223
  item.checked = !item.checked;
@@ -9232,6 +9280,117 @@ var stdin_default$14 = vue.defineComponent({
9232
9280
  }));
9233
9281
  }
9234
9282
  };
9283
+ const findCommonTypeNode = (id) => {
9284
+ return flatArray.value.find((item) => item[value] === id);
9285
+ };
9286
+ const onCommonTypeClick = (item) => {
9287
+ const matchNode = findCommonTypeNode(item.types.id);
9288
+ if (!matchNode)
9289
+ return;
9290
+ selectCommonId.value = item.types.id;
9291
+ syncExpandNodeByParent(matchNode);
9292
+ selectNode.value = matchNode;
9293
+ emit("select", Object.assign(matchNode, {
9294
+ parent: matchNode.parent
9295
+ }));
9296
+ };
9297
+ const onClearCommonTypes = () => {
9298
+ selectCommonId.value = -1;
9299
+ showAllCommonTypes.value = false;
9300
+ emit("clearAll");
9301
+ };
9302
+ const findHotTypeNode = (id) => {
9303
+ return flatArray.value.find((item) => item[value] === id);
9304
+ };
9305
+ const renderCommonTypeButton = (item) => {
9306
+ const active = item.types.id === selectCommonId.value;
9307
+ return vue.createVNode(stdin_default$1L, {
9308
+ "size": "small",
9309
+ "class": [bem$L("common-types--btn")],
9310
+ "type": active ? "primary" : "default",
9311
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9312
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9313
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9314
+ "onClick": () => onCommonTypeClick(item)
9315
+ }, {
9316
+ default: () => [item.types.name]
9317
+ });
9318
+ };
9319
+ const onHotTypeClick = (item) => {
9320
+ const matchNode = findHotTypeNode(item.id);
9321
+ if (!matchNode)
9322
+ return;
9323
+ selectCommonId.value = item.id;
9324
+ syncExpandNodeByParent(matchNode);
9325
+ selectNode.value = matchNode;
9326
+ emit("select", Object.assign(matchNode, {
9327
+ parent: matchNode.parent
9328
+ }));
9329
+ };
9330
+ const renderHotTypeButton = (item) => {
9331
+ const active = item.id === selectCommonId.value;
9332
+ return vue.createVNode(stdin_default$1L, {
9333
+ "size": "small",
9334
+ "class": [bem$L("common-types--btn")],
9335
+ "type": active ? "primary" : "default",
9336
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9337
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9338
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9339
+ "onClick": () => onHotTypeClick(item)
9340
+ }, {
9341
+ default: () => [item.text || item.name]
9342
+ });
9343
+ };
9344
+ const renderCommonTypes = () => {
9345
+ if (!props.showCommonTypes)
9346
+ return null;
9347
+ return vue.createVNode("section", {
9348
+ "class": [bem$L("common-types")]
9349
+ }, [vue.createVNode("div", {
9350
+ "class": [bem$L("common-types--head")]
9351
+ }, [vue.createVNode("span", {
9352
+ "class": [bem$L("common-types--label")]
9353
+ }, [vue.createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? vue.createVNode("div", {
9354
+ "class": [bem$L("common-types--mask")]
9355
+ }, [vue.createVNode("div", {
9356
+ "class": [bem$L("common-types--viewport")]
9357
+ }, [vue.createVNode("div", {
9358
+ "class": [bem$L("common-types--list")]
9359
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : vue.createVNode("div", {
9360
+ "class": [bem$L("common-types--empty")]
9361
+ }, [vue.createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
9362
+ "class": [bem$L("common-types--icon")],
9363
+ "onClick": () => showAllCommonTypes.value = !showAllCommonTypes.value
9364
+ }, [vue.createVNode(stdin_default$1_, {
9365
+ "size": "24",
9366
+ "name": showAllCommonTypes.value ? "keyboard-arrow-up" : "keyboard-arrow-down",
9367
+ "color": showAllCommonTypes.value ? "var(--zt-primary-color)" : void 0
9368
+ }, null)])]), showAllCommonTypes.value && visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
9369
+ "class": [bem$L("common-types--panel")]
9370
+ }, [vue.createVNode("div", {
9371
+ "class": [bem$L("common-types--panel-list")]
9372
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)]), vue.createVNode("div", {
9373
+ "class": [bem$L("common-types--clear")],
9374
+ "onClick": onClearCommonTypes
9375
+ }, [vue.createVNode(stdin_default$1_, {
9376
+ "name": "delete",
9377
+ "size": "20"
9378
+ }, null), vue.createVNode("span", {
9379
+ "class": [bem$L("common-types--clear-text")]
9380
+ }, [vue.createTextVNode("清空常用小类")])])])]);
9381
+ };
9382
+ const renderHotTypes = () => {
9383
+ var _a;
9384
+ if (!((_a = props.hotTypeList) == null ? void 0 : _a.length))
9385
+ return null;
9386
+ return vue.createVNode("section", {
9387
+ "class": [bem$L("hot-types")]
9388
+ }, [vue.createVNode("div", {
9389
+ "class": [bem$L("hot-types--label")]
9390
+ }, [vue.createTextVNode("热点小类")]), vue.createVNode("div", {
9391
+ "class": [bem$L("hot-types--list")]
9392
+ }, [props.hotTypeList.map(renderHotTypeButton)])]);
9393
+ };
9235
9394
  const renderSecondTree = (item) => {
9236
9395
  var _a, _b;
9237
9396
  const text = item[fields.value.text];
@@ -9367,7 +9526,7 @@ var stdin_default$14 = vue.defineComponent({
9367
9526
  }, null), vue.createTextVNode("清空搜索历史")])]), historyList.value.length === 0 && vue.createVNode("div", {
9368
9527
  "class": [bem$L("empty")]
9369
9528
  }, [vue.createTextVNode("暂无搜索记录")])])]
9370
- })]), [[vue.vShow, show.value]])]), vue.createVNode("div", {
9529
+ })]), [[vue.vShow, show.value]])]), renderCommonTypes(), renderHotTypes(), vue.createVNode("div", {
9371
9530
  "class": [bem$L("name"), "zt-hairline--bottom"]
9372
9531
  }, [props.title]), vue.createVNode("main", {
9373
9532
  "class": [bem$L("tree")]
@@ -23670,7 +23829,7 @@ const Lazyload = {
23670
23829
  });
23671
23830
  }
23672
23831
  };
23673
- const version = "3.1.83";
23832
+ const version = "3.1.85";
23674
23833
  function install(app) {
23675
23834
  const components = [
23676
23835
  ActionSheet,
package/lib/zartui.es.js CHANGED
@@ -9050,12 +9050,19 @@ const drawerSelectProps = {
9050
9050
  default: false
9051
9051
  },
9052
9052
  defaultSelectNode: Object,
9053
- activeClassName: makeStringProp("")
9053
+ activeClassName: makeStringProp(""),
9054
+ commonTypeList: makeArrayProp(),
9055
+ showCommonTypes: {
9056
+ type: Boolean,
9057
+ default: false
9058
+ },
9059
+ commonTypeVisibleCount: Number,
9060
+ hotTypeList: makeArrayProp()
9054
9061
  };
9055
9062
  var stdin_default$14 = defineComponent({
9056
9063
  name: name$L,
9057
9064
  props: drawerSelectProps,
9058
- emits: ["change", "select"],
9065
+ emits: ["change", "select", "clearAll"],
9059
9066
  setup(props, {
9060
9067
  emit
9061
9068
  }) {
@@ -9067,8 +9074,17 @@ var stdin_default$14 = defineComponent({
9067
9074
  const searchRef = ref();
9068
9075
  const offset2 = ref(0);
9069
9076
  const historyList = ref([]);
9077
+ const showAllCommonTypes = ref(false);
9078
+ const selectCommonId = ref(-1);
9070
9079
  const defaultTreeNode = ref(props.treeData);
9071
9080
  const fields = computed(() => assignDefaultFields$1(props.treeFieldName));
9081
+ const visibleCommonTypeList = computed(() => {
9082
+ const count = props.commonTypeVisibleCount;
9083
+ if (typeof count !== "number") {
9084
+ return props.commonTypeList;
9085
+ }
9086
+ return props.commonTypeList.slice(0, Math.max(0, count));
9087
+ });
9072
9088
  const {
9073
9089
  value,
9074
9090
  children,
@@ -9152,6 +9168,37 @@ var stdin_default$14 = defineComponent({
9152
9168
  updateOffset();
9153
9169
  });
9154
9170
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9171
+ const syncExpandNodeByParent = (item) => {
9172
+ var _a, _b, _c;
9173
+ const parent = (_a = item.parent) != null ? _a : [];
9174
+ if (parent.length >= 2) {
9175
+ const parentValue = (_b = parent[parent.length - 2]) == null ? void 0 : _b[value];
9176
+ if (parentValue !== void 0) {
9177
+ const stack = [...props.treeData];
9178
+ while (stack.length > 0) {
9179
+ const current2 = stack.shift();
9180
+ if (!current2)
9181
+ continue;
9182
+ if (current2[value] === parentValue) {
9183
+ expandNode.value = {
9184
+ text: current2[key],
9185
+ value: current2[value],
9186
+ children: current2[children]
9187
+ };
9188
+ return;
9189
+ }
9190
+ if ((_c = current2[children]) == null ? void 0 : _c.length) {
9191
+ stack.push(...current2[children]);
9192
+ }
9193
+ }
9194
+ }
9195
+ }
9196
+ expandNode.value = {
9197
+ text: allData[key],
9198
+ value: allData[value],
9199
+ children: allData[children]
9200
+ };
9201
+ };
9155
9202
  const onLabelClick = (item, assign = true) => {
9156
9203
  const {
9157
9204
  text,
@@ -9168,6 +9215,7 @@ var stdin_default$14 = defineComponent({
9168
9215
  }
9169
9216
  if (isEmpty(item)) {
9170
9217
  selectNode.value = item;
9218
+ selectCommonId.value = item[value2];
9171
9219
  emit("select", item);
9172
9220
  }
9173
9221
  item.checked = !item.checked;
@@ -9230,6 +9278,117 @@ var stdin_default$14 = defineComponent({
9230
9278
  }));
9231
9279
  }
9232
9280
  };
9281
+ const findCommonTypeNode = (id) => {
9282
+ return flatArray.value.find((item) => item[value] === id);
9283
+ };
9284
+ const onCommonTypeClick = (item) => {
9285
+ const matchNode = findCommonTypeNode(item.types.id);
9286
+ if (!matchNode)
9287
+ return;
9288
+ selectCommonId.value = item.types.id;
9289
+ syncExpandNodeByParent(matchNode);
9290
+ selectNode.value = matchNode;
9291
+ emit("select", Object.assign(matchNode, {
9292
+ parent: matchNode.parent
9293
+ }));
9294
+ };
9295
+ const onClearCommonTypes = () => {
9296
+ selectCommonId.value = -1;
9297
+ showAllCommonTypes.value = false;
9298
+ emit("clearAll");
9299
+ };
9300
+ const findHotTypeNode = (id) => {
9301
+ return flatArray.value.find((item) => item[value] === id);
9302
+ };
9303
+ const renderCommonTypeButton = (item) => {
9304
+ const active = item.types.id === selectCommonId.value;
9305
+ return createVNode(stdin_default$1L, {
9306
+ "size": "small",
9307
+ "class": [bem$L("common-types--btn")],
9308
+ "type": active ? "primary" : "default",
9309
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9310
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9311
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9312
+ "onClick": () => onCommonTypeClick(item)
9313
+ }, {
9314
+ default: () => [item.types.name]
9315
+ });
9316
+ };
9317
+ const onHotTypeClick = (item) => {
9318
+ const matchNode = findHotTypeNode(item.id);
9319
+ if (!matchNode)
9320
+ return;
9321
+ selectCommonId.value = item.id;
9322
+ syncExpandNodeByParent(matchNode);
9323
+ selectNode.value = matchNode;
9324
+ emit("select", Object.assign(matchNode, {
9325
+ parent: matchNode.parent
9326
+ }));
9327
+ };
9328
+ const renderHotTypeButton = (item) => {
9329
+ const active = item.id === selectCommonId.value;
9330
+ return createVNode(stdin_default$1L, {
9331
+ "size": "small",
9332
+ "class": [bem$L("common-types--btn")],
9333
+ "type": active ? "primary" : "default",
9334
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9335
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9336
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9337
+ "onClick": () => onHotTypeClick(item)
9338
+ }, {
9339
+ default: () => [item.text || item.name]
9340
+ });
9341
+ };
9342
+ const renderCommonTypes = () => {
9343
+ if (!props.showCommonTypes)
9344
+ return null;
9345
+ return createVNode("section", {
9346
+ "class": [bem$L("common-types")]
9347
+ }, [createVNode("div", {
9348
+ "class": [bem$L("common-types--head")]
9349
+ }, [createVNode("span", {
9350
+ "class": [bem$L("common-types--label")]
9351
+ }, [createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? createVNode("div", {
9352
+ "class": [bem$L("common-types--mask")]
9353
+ }, [createVNode("div", {
9354
+ "class": [bem$L("common-types--viewport")]
9355
+ }, [createVNode("div", {
9356
+ "class": [bem$L("common-types--list")]
9357
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : createVNode("div", {
9358
+ "class": [bem$L("common-types--empty")]
9359
+ }, [createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && createVNode("div", {
9360
+ "class": [bem$L("common-types--icon")],
9361
+ "onClick": () => showAllCommonTypes.value = !showAllCommonTypes.value
9362
+ }, [createVNode(stdin_default$1_, {
9363
+ "size": "24",
9364
+ "name": showAllCommonTypes.value ? "keyboard-arrow-up" : "keyboard-arrow-down",
9365
+ "color": showAllCommonTypes.value ? "var(--zt-primary-color)" : void 0
9366
+ }, null)])]), showAllCommonTypes.value && visibleCommonTypeList.value.length > 0 && createVNode("div", {
9367
+ "class": [bem$L("common-types--panel")]
9368
+ }, [createVNode("div", {
9369
+ "class": [bem$L("common-types--panel-list")]
9370
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)]), createVNode("div", {
9371
+ "class": [bem$L("common-types--clear")],
9372
+ "onClick": onClearCommonTypes
9373
+ }, [createVNode(stdin_default$1_, {
9374
+ "name": "delete",
9375
+ "size": "20"
9376
+ }, null), createVNode("span", {
9377
+ "class": [bem$L("common-types--clear-text")]
9378
+ }, [createTextVNode("清空常用小类")])])])]);
9379
+ };
9380
+ const renderHotTypes = () => {
9381
+ var _a;
9382
+ if (!((_a = props.hotTypeList) == null ? void 0 : _a.length))
9383
+ return null;
9384
+ return createVNode("section", {
9385
+ "class": [bem$L("hot-types")]
9386
+ }, [createVNode("div", {
9387
+ "class": [bem$L("hot-types--label")]
9388
+ }, [createTextVNode("热点小类")]), createVNode("div", {
9389
+ "class": [bem$L("hot-types--list")]
9390
+ }, [props.hotTypeList.map(renderHotTypeButton)])]);
9391
+ };
9233
9392
  const renderSecondTree = (item) => {
9234
9393
  var _a, _b;
9235
9394
  const text = item[fields.value.text];
@@ -9365,7 +9524,7 @@ var stdin_default$14 = defineComponent({
9365
9524
  }, null), createTextVNode("清空搜索历史")])]), historyList.value.length === 0 && createVNode("div", {
9366
9525
  "class": [bem$L("empty")]
9367
9526
  }, [createTextVNode("暂无搜索记录")])])]
9368
- })]), [[vShow, show.value]])]), createVNode("div", {
9527
+ })]), [[vShow, show.value]])]), renderCommonTypes(), renderHotTypes(), createVNode("div", {
9369
9528
  "class": [bem$L("name"), "zt-hairline--bottom"]
9370
9529
  }, [props.title]), createVNode("main", {
9371
9530
  "class": [bem$L("tree")]
@@ -23668,7 +23827,7 @@ const Lazyload = {
23668
23827
  });
23669
23828
  }
23670
23829
  };
23671
- const version = "3.1.83";
23830
+ const version = "3.1.85";
23672
23831
  function install(app) {
23673
23832
  const components = [
23674
23833
  ActionSheet,
package/lib/zartui.js CHANGED
@@ -9301,12 +9301,19 @@ var __publicField = (obj, key, value) => {
9301
9301
  default: false
9302
9302
  },
9303
9303
  defaultSelectNode: Object,
9304
- activeClassName: makeStringProp("")
9304
+ activeClassName: makeStringProp(""),
9305
+ commonTypeList: makeArrayProp(),
9306
+ showCommonTypes: {
9307
+ type: Boolean,
9308
+ default: false
9309
+ },
9310
+ commonTypeVisibleCount: Number,
9311
+ hotTypeList: makeArrayProp()
9305
9312
  };
9306
9313
  var stdin_default$14 = vue.defineComponent({
9307
9314
  name: name$L,
9308
9315
  props: drawerSelectProps,
9309
- emits: ["change", "select"],
9316
+ emits: ["change", "select", "clearAll"],
9310
9317
  setup(props, {
9311
9318
  emit
9312
9319
  }) {
@@ -9318,8 +9325,17 @@ var __publicField = (obj, key, value) => {
9318
9325
  const searchRef = vue.ref();
9319
9326
  const offset2 = vue.ref(0);
9320
9327
  const historyList = vue.ref([]);
9328
+ const showAllCommonTypes = vue.ref(false);
9329
+ const selectCommonId = vue.ref(-1);
9321
9330
  const defaultTreeNode = vue.ref(props.treeData);
9322
9331
  const fields = vue.computed(() => assignDefaultFields$1(props.treeFieldName));
9332
+ const visibleCommonTypeList = vue.computed(() => {
9333
+ const count = props.commonTypeVisibleCount;
9334
+ if (typeof count !== "number") {
9335
+ return props.commonTypeList;
9336
+ }
9337
+ return props.commonTypeList.slice(0, Math.max(0, count));
9338
+ });
9323
9339
  const {
9324
9340
  value,
9325
9341
  children,
@@ -9403,6 +9419,37 @@ var __publicField = (obj, key, value) => {
9403
9419
  updateOffset();
9404
9420
  });
9405
9421
  const isEmpty = (item) => !item[children] || item[children].length === 0;
9422
+ const syncExpandNodeByParent = (item) => {
9423
+ var _a, _b, _c;
9424
+ const parent = (_a = item.parent) != null ? _a : [];
9425
+ if (parent.length >= 2) {
9426
+ const parentValue = (_b = parent[parent.length - 2]) == null ? void 0 : _b[value];
9427
+ if (parentValue !== void 0) {
9428
+ const stack = [...props.treeData];
9429
+ while (stack.length > 0) {
9430
+ const current2 = stack.shift();
9431
+ if (!current2)
9432
+ continue;
9433
+ if (current2[value] === parentValue) {
9434
+ expandNode.value = {
9435
+ text: current2[key],
9436
+ value: current2[value],
9437
+ children: current2[children]
9438
+ };
9439
+ return;
9440
+ }
9441
+ if ((_c = current2[children]) == null ? void 0 : _c.length) {
9442
+ stack.push(...current2[children]);
9443
+ }
9444
+ }
9445
+ }
9446
+ }
9447
+ expandNode.value = {
9448
+ text: allData[key],
9449
+ value: allData[value],
9450
+ children: allData[children]
9451
+ };
9452
+ };
9406
9453
  const onLabelClick = (item, assign = true) => {
9407
9454
  const {
9408
9455
  text,
@@ -9419,6 +9466,7 @@ var __publicField = (obj, key, value) => {
9419
9466
  }
9420
9467
  if (isEmpty(item)) {
9421
9468
  selectNode.value = item;
9469
+ selectCommonId.value = item[value2];
9422
9470
  emit("select", item);
9423
9471
  }
9424
9472
  item.checked = !item.checked;
@@ -9481,6 +9529,117 @@ var __publicField = (obj, key, value) => {
9481
9529
  }));
9482
9530
  }
9483
9531
  };
9532
+ const findCommonTypeNode = (id) => {
9533
+ return flatArray.value.find((item) => item[value] === id);
9534
+ };
9535
+ const onCommonTypeClick = (item) => {
9536
+ const matchNode = findCommonTypeNode(item.types.id);
9537
+ if (!matchNode)
9538
+ return;
9539
+ selectCommonId.value = item.types.id;
9540
+ syncExpandNodeByParent(matchNode);
9541
+ selectNode.value = matchNode;
9542
+ emit("select", Object.assign(matchNode, {
9543
+ parent: matchNode.parent
9544
+ }));
9545
+ };
9546
+ const onClearCommonTypes = () => {
9547
+ selectCommonId.value = -1;
9548
+ showAllCommonTypes.value = false;
9549
+ emit("clearAll");
9550
+ };
9551
+ const findHotTypeNode = (id) => {
9552
+ return flatArray.value.find((item) => item[value] === id);
9553
+ };
9554
+ const renderCommonTypeButton = (item) => {
9555
+ const active = item.types.id === selectCommonId.value;
9556
+ return vue.createVNode(stdin_default$1L, {
9557
+ "size": "small",
9558
+ "class": [bem$L("common-types--btn")],
9559
+ "type": active ? "primary" : "default",
9560
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9561
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9562
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9563
+ "onClick": () => onCommonTypeClick(item)
9564
+ }, {
9565
+ default: () => [item.types.name]
9566
+ });
9567
+ };
9568
+ const onHotTypeClick = (item) => {
9569
+ const matchNode = findHotTypeNode(item.id);
9570
+ if (!matchNode)
9571
+ return;
9572
+ selectCommonId.value = item.id;
9573
+ syncExpandNodeByParent(matchNode);
9574
+ selectNode.value = matchNode;
9575
+ emit("select", Object.assign(matchNode, {
9576
+ parent: matchNode.parent
9577
+ }));
9578
+ };
9579
+ const renderHotTypeButton = (item) => {
9580
+ const active = item.id === selectCommonId.value;
9581
+ return vue.createVNode(stdin_default$1L, {
9582
+ "size": "small",
9583
+ "class": [bem$L("common-types--btn")],
9584
+ "type": active ? "primary" : "default",
9585
+ "backgroundColor": active ? "#3388ff" : "var(--zt-background)",
9586
+ "borderColor": active ? "#3388ff" : "var(--zt-border-color)",
9587
+ "color": active ? "var(--zt-white)" : "var(--zt-text-color)",
9588
+ "onClick": () => onHotTypeClick(item)
9589
+ }, {
9590
+ default: () => [item.text || item.name]
9591
+ });
9592
+ };
9593
+ const renderCommonTypes = () => {
9594
+ if (!props.showCommonTypes)
9595
+ return null;
9596
+ return vue.createVNode("section", {
9597
+ "class": [bem$L("common-types")]
9598
+ }, [vue.createVNode("div", {
9599
+ "class": [bem$L("common-types--head")]
9600
+ }, [vue.createVNode("span", {
9601
+ "class": [bem$L("common-types--label")]
9602
+ }, [vue.createTextVNode("常用小类")]), visibleCommonTypeList.value.length > 0 ? vue.createVNode("div", {
9603
+ "class": [bem$L("common-types--mask")]
9604
+ }, [vue.createVNode("div", {
9605
+ "class": [bem$L("common-types--viewport")]
9606
+ }, [vue.createVNode("div", {
9607
+ "class": [bem$L("common-types--list")]
9608
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)])])]) : vue.createVNode("div", {
9609
+ "class": [bem$L("common-types--empty")]
9610
+ }, [vue.createTextVNode("暂无常用小类")]), visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
9611
+ "class": [bem$L("common-types--icon")],
9612
+ "onClick": () => showAllCommonTypes.value = !showAllCommonTypes.value
9613
+ }, [vue.createVNode(stdin_default$1_, {
9614
+ "size": "24",
9615
+ "name": showAllCommonTypes.value ? "keyboard-arrow-up" : "keyboard-arrow-down",
9616
+ "color": showAllCommonTypes.value ? "var(--zt-primary-color)" : void 0
9617
+ }, null)])]), showAllCommonTypes.value && visibleCommonTypeList.value.length > 0 && vue.createVNode("div", {
9618
+ "class": [bem$L("common-types--panel")]
9619
+ }, [vue.createVNode("div", {
9620
+ "class": [bem$L("common-types--panel-list")]
9621
+ }, [visibleCommonTypeList.value.map(renderCommonTypeButton)]), vue.createVNode("div", {
9622
+ "class": [bem$L("common-types--clear")],
9623
+ "onClick": onClearCommonTypes
9624
+ }, [vue.createVNode(stdin_default$1_, {
9625
+ "name": "delete",
9626
+ "size": "20"
9627
+ }, null), vue.createVNode("span", {
9628
+ "class": [bem$L("common-types--clear-text")]
9629
+ }, [vue.createTextVNode("清空常用小类")])])])]);
9630
+ };
9631
+ const renderHotTypes = () => {
9632
+ var _a;
9633
+ if (!((_a = props.hotTypeList) == null ? void 0 : _a.length))
9634
+ return null;
9635
+ return vue.createVNode("section", {
9636
+ "class": [bem$L("hot-types")]
9637
+ }, [vue.createVNode("div", {
9638
+ "class": [bem$L("hot-types--label")]
9639
+ }, [vue.createTextVNode("热点小类")]), vue.createVNode("div", {
9640
+ "class": [bem$L("hot-types--list")]
9641
+ }, [props.hotTypeList.map(renderHotTypeButton)])]);
9642
+ };
9484
9643
  const renderSecondTree = (item) => {
9485
9644
  var _a, _b;
9486
9645
  const text = item[fields.value.text];
@@ -9616,7 +9775,7 @@ var __publicField = (obj, key, value) => {
9616
9775
  }, null), vue.createTextVNode("清空搜索历史")])]), historyList.value.length === 0 && vue.createVNode("div", {
9617
9776
  "class": [bem$L("empty")]
9618
9777
  }, [vue.createTextVNode("暂无搜索记录")])])]
9619
- })]), [[vue.vShow, show.value]])]), vue.createVNode("div", {
9778
+ })]), [[vue.vShow, show.value]])]), renderCommonTypes(), renderHotTypes(), vue.createVNode("div", {
9620
9779
  "class": [bem$L("name"), "zt-hairline--bottom"]
9621
9780
  }, [props.title]), vue.createVNode("main", {
9622
9781
  "class": [bem$L("tree")]
@@ -31183,7 +31342,7 @@ var __publicField = (obj, key, value) => {
31183
31342
  });
31184
31343
  }
31185
31344
  };
31186
- const version = "3.1.83";
31345
+ const version = "3.1.85";
31187
31346
  function install(app) {
31188
31347
  const components = [
31189
31348
  ActionSheet,