bkui-vue 0.0.1-beta.443 → 0.0.1-beta.445

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/dist/index.esm.js CHANGED
@@ -14844,7 +14844,10 @@ function toLowerCase(value = "") {
14844
14844
  var BkOption = defineComponent({
14845
14845
  name: "Option",
14846
14846
  props: {
14847
- value: PropTypes.any,
14847
+ value: {
14848
+ type: [String, Number, Object],
14849
+ require: true
14850
+ },
14848
14851
  label: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).def(""),
14849
14852
  disabled: PropTypes.bool.def(false)
14850
14853
  },
@@ -16094,7 +16097,10 @@ var SelectTagInput = defineComponent({
16094
16097
  [resolveClassName("select-tag--default")]: true,
16095
16098
  "is-disabled": this.disabled,
16096
16099
  "collapse-tag": this.collapseTags,
16097
- "has-prefix": !!prefix
16100
+ "has-prefix": !!prefix && (prefix == null ? void 0 : prefix.every((item) => {
16101
+ var _a2;
16102
+ return !!((_a2 = item.children) == null ? void 0 : _a2.length);
16103
+ }))
16098
16104
  });
16099
16105
  const tagWrapperClass = classes({
16100
16106
  [resolveClassName("select-tag-wrapper")]: true
@@ -16205,6 +16211,7 @@ var Component$k = defineComponent({
16205
16211
  scrollHeight,
16206
16212
  list,
16207
16213
  displayKey,
16214
+ idKey,
16208
16215
  collapseTags,
16209
16216
  autoHeight,
16210
16217
  popoverOptions,
@@ -16265,6 +16272,10 @@ var Component$k = defineComponent({
16265
16272
  return pre;
16266
16273
  }, {}));
16267
16274
  const activeOptionValue = ref();
16275
+ const listMap = computed(() => list.value.reduce((pre, item) => {
16276
+ pre[item[idKey.value]] = item[displayKey.value];
16277
+ return pre;
16278
+ }, {}));
16268
16279
  watch(modelValue, () => {
16269
16280
  var _a;
16270
16281
  handleSetSelectedData();
@@ -16285,7 +16296,7 @@ var Component$k = defineComponent({
16285
16296
  const isDisabled = computed(() => disabled.value || loading2.value);
16286
16297
  const selectedLabel = computed(() => selected.value.map((item) => {
16287
16298
  var _a, _b;
16288
- return ((_b = (_a = optionsMap.value) == null ? void 0 : _a.get(item.value)) == null ? void 0 : _b.label) || item.label;
16299
+ return ((_b = (_a = optionsMap.value) == null ? void 0 : _a.get(item.value)) == null ? void 0 : _b.label) || item.label || listMap.value[item.value];
16289
16300
  }));
16290
16301
  const isAllSelected = computed(() => {
16291
16302
  const normalSelectedValues = options.value.reduce((pre, option) => {
@@ -16536,7 +16547,7 @@ var Component$k = defineComponent({
16536
16547
  }
16537
16548
  }
16538
16549
  }
16539
- return ((_b = (_a = optionsMap.value) == null ? void 0 : _a.get(tmpValue)) == null ? void 0 : _b.label) || cacheSelectedMap.value[tmpValue] || tmpValue;
16550
+ return ((_b = (_a = optionsMap.value) == null ? void 0 : _a.get(tmpValue)) == null ? void 0 : _b.label) || cacheSelectedMap.value[tmpValue] || listMap.value[tmpValue] || tmpValue;
16540
16551
  };
16541
16552
  const handleSetSelectedData = () => {
16542
16553
  if (Array.isArray(modelValue.value)) {
@@ -19198,6 +19209,7 @@ var HeadFilter = defineComponent({
19198
19209
  state.isOpen = false;
19199
19210
  return;
19200
19211
  }
19212
+ filter.value.checked = state.checked;
19201
19213
  emit("change", [...state.checked], filterFn);
19202
19214
  }
19203
19215
  };
@@ -40165,6 +40177,7 @@ var SearchSelectInput = defineComponent({
40165
40177
  showInputBefore: Boolean,
40166
40178
  showCondition: Boolean,
40167
40179
  clickOutside: Function,
40180
+ placeholder: String,
40168
40181
  conditions: {
40169
40182
  type: Array,
40170
40183
  default: () => []
@@ -40668,7 +40681,7 @@ var SearchSelectInput = defineComponent({
40668
40681
  "input-after": showInputAfter
40669
40682
  },
40670
40683
  "contenteditable": true,
40671
- "data-placeholder": !inputInnerHtml && !this.keyword ? this.t.pleaseSelect : "",
40684
+ "data-placeholder": !inputInnerHtml && !this.keyword ? this.placeholder : "",
40672
40685
  "data-tips": placeholder || "",
40673
40686
  "spellcheck": "false",
40674
40687
  "onFocus": this.handleInputFocus,
@@ -40847,6 +40860,7 @@ const SearchSelectProps = {
40847
40860
  type: Boolean,
40848
40861
  default: true
40849
40862
  },
40863
+ placeholder: String,
40850
40864
  getMenuList: Function,
40851
40865
  validateValues: Function,
40852
40866
  valueSplitCode: {
@@ -40871,7 +40885,7 @@ var Component$1 = defineComponent({
40871
40885
  clickoutside: ClickOutside
40872
40886
  },
40873
40887
  props: SearchSelectProps,
40874
- emits: ["update:modelValue"],
40888
+ emits: ["update:modelValue", "search"],
40875
40889
  setup(props2, {
40876
40890
  emit
40877
40891
  }) {
@@ -41032,9 +41046,16 @@ var Component$1 = defineComponent({
41032
41046
  emit("update:modelValue", list.map((item) => item.toValue()));
41033
41047
  }
41034
41048
  function handleInputFocus(v2) {
41049
+ var _a;
41035
41050
  v2 && (overflowIndex.value = -1);
41051
+ if (v2 === false) {
41052
+ (_a = wrapRef.value.querySelector(".bk-search-select-container")) == null ? void 0 : _a.scrollTo(0, 0);
41053
+ }
41036
41054
  isFocus.value = v2;
41037
41055
  }
41056
+ function handleClickSearch(e) {
41057
+ emit("search", e);
41058
+ }
41038
41059
  return {
41039
41060
  inputRef,
41040
41061
  wrapRef,
@@ -41053,7 +41074,9 @@ var Component$1 = defineComponent({
41053
41074
  handleInputOutside,
41054
41075
  handleAddSelected,
41055
41076
  handleDeleteSelected,
41056
- localConditions
41077
+ handleClickSearch,
41078
+ localConditions,
41079
+ t: t2
41057
41080
  };
41058
41081
  },
41059
41082
  render() {
@@ -41099,6 +41122,7 @@ var Component$1 = defineComponent({
41099
41122
  "showInputBefore": !this.selectedList.length,
41100
41123
  "showCondition": showCondition,
41101
41124
  "conditions": this.localConditions,
41125
+ "placeholder": this.placeholder || this.t.pleaseSelect,
41102
41126
  "clickOutside": this.handleInputOutside,
41103
41127
  "getMenuList": this.getMenuList,
41104
41128
  "validateValues": this.validateValues,
@@ -41112,6 +41136,7 @@ var Component$1 = defineComponent({
41112
41136
  "class": "search-clear",
41113
41137
  "onClick": this.handleClearAll
41114
41138
  }, null), this.$slots.append ? this.$slots.append() : createVNode(search, {
41139
+ "onClick": this.handleClickSearch,
41115
41140
  "class": `search-nextfix-icon ${this.isFocus ? "is-focus" : ""}`
41116
41141
  }, null)])]), !!this.validateStr.length && createVNode("div", {
41117
41142
  "class": "bk-search-select-tips"