@deskhero/dh_ui 1.48.0 → 1.48.2

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/dh_ui.es.js CHANGED
@@ -27149,7 +27149,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
27149
27149
  }
27150
27150
  script.render = render;
27151
27151
  script.__file = "src/Multiselect.vue";
27152
- var default_css_vue_type_style_index_0_src_70b3ed2d_lang = "";
27152
+ var default_css_vue_type_style_index_0_src_766265f0_lang = "";
27153
27153
  var InputList_vue_vue_type_style_index_1_lang = "";
27154
27154
  const _hoisted_1$9 = /* @__PURE__ */ createElementVNode("img", {
27155
27155
  alt: "",
@@ -27186,24 +27186,25 @@ const _sfc_main$a = {
27186
27186
  setup(__props, { emit }) {
27187
27187
  const props = __props;
27188
27188
  useCssVars((_ctx) => ({
27189
- "6af3e44c": __props.maxHeight
27189
+ "2c3afb11": __props.maxHeight
27190
27190
  }));
27191
- const inputVal = ref(null);
27191
+ const inputVal = ref([]);
27192
27192
  function update() {
27193
27193
  emit("update", inputVal.value);
27194
27194
  }
27195
- watch(() => props.selectItems, (value) => {
27196
- if (!value) {
27195
+ watch(() => props.selectItems, (oldValue, newValue) => {
27196
+ if (!oldValue) {
27197
27197
  return;
27198
27198
  }
27199
- if (!inputVal.value) {
27200
- const selectedItems = props.list.filter((item) => value == item.value);
27201
- inputVal.value = selectedItems;
27202
- } else {
27203
- const selectedItems = props.list.filter((item) => value == item.value);
27204
- inputVal.value = [...inputVal.value, ...selectedItems];
27199
+ const selected = props.list.filter((item) => oldValue.includes(item[props.idProp]));
27200
+ if (JSON.stringify(selected) !== JSON.stringify(inputVal.value)) {
27201
+ inputVal.value = [...inputVal.value, ...selected];
27205
27202
  inputVal.value = [...new Set(inputVal.value)];
27206
27203
  }
27204
+ if (newValue.length > oldValue.length) {
27205
+ const difference = newValue.filter((x2) => !oldValue.includes(x2));
27206
+ inputVal.value = inputVal.value.filter((item) => !difference.includes(item[props.idProp]));
27207
+ }
27207
27208
  });
27208
27209
  return (_ctx, _cache) => {
27209
27210
  return openBlock(), createElementBlock(Fragment, null, [
@@ -27332,7 +27333,7 @@ function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
27332
27333
  class: normalizeClass(`
27333
27334
  ${_ctx.hasSideBar ? _ctx.sideBarPosition : ""}
27334
27335
  ${_ctx.hasBodyScrolling ? "" : "modal-auto-height"}
27335
- ${_ctx.fitContent ? "modal-fit-content" : "modal"}
27336
+ ${_ctx.fitContent ? "modal modal-fit-content" : "modal"}
27336
27337
  `),
27337
27338
  role: "dialog",
27338
27339
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {