@onereach/ui-components-vue2 21.4.1 → 21.4.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.
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, toRefs, computed, watch, getCurrentInstance } from 'vue-demi';
1
+ import { defineComponent, ref, toRefs, computed, watch, getCurrentInstance, nextTick } from 'vue-demi';
2
2
  import { s, c } from '../../dropdown-open-k6cFnrqA-5245a281.js';
3
3
  import { l } from '../../helpers-368c7a99.js';
4
4
  import { a as re, n as ne } from '../../useValidationAttributes-BpeWsfb0-24439d6f.js';
@@ -837,6 +837,7 @@ var script = defineComponent({
837
837
  var _a;
838
838
  return (_a = popover.value) === null || _a === void 0 ? void 0 : _a.state;
839
839
  });
840
+ const isOpen = computed(() => popoverState.value === 'open');
840
841
  // Props
841
842
  const {
842
843
  enableClear,
@@ -880,6 +881,11 @@ var script = defineComponent({
880
881
  }, {
881
882
  deep: true
882
883
  });
884
+ watch(isOpen, value => {
885
+ if (!value) {
886
+ resetSearch();
887
+ }
888
+ });
883
889
  const groupedOptions = computed(() => {
884
890
  const groupBy = props.groupByFunction;
885
891
  if (groupBy) {
@@ -973,7 +979,9 @@ var script = defineComponent({
973
979
  resetSearch();
974
980
  }
975
981
  function resetSearch() {
976
- searchText.value = '';
982
+ nextTick(() => {
983
+ setTimeout(() => searchText.value = '');
984
+ });
977
985
  }
978
986
  // Utils
979
987
  const {
@@ -1003,6 +1011,7 @@ var script = defineComponent({
1003
1011
  proxyModelValue,
1004
1012
  readonly,
1005
1013
  isEmptyModelValue,
1014
+ isOpen,
1006
1015
  showClear,
1007
1016
  searchText,
1008
1017
  internalSearchOptions,
@@ -1070,6 +1079,7 @@ var __vue_render__ = function () {
1070
1079
  "invalid": !!_vm.error,
1071
1080
  "readonly": _vm.readonly,
1072
1081
  "disabled": _vm.disabled,
1082
+ "force-state": _vm.isOpen ? 'focus-within' : undefined,
1073
1083
  "tabindex": !_vm.disabled ? 0 : null
1074
1084
  }
1075
1085
  }, [_c('div', {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components-vue2",
3
- "version": "21.4.1",
3
+ "version": "21.4.2",
4
4
  "description": "Vue components library for v2",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -40,8 +40,8 @@
40
40
  "@codemirror/view": "^6",
41
41
  "@floating-ui/dom": "1.5.3",
42
42
  "@lezer/highlight": "*",
43
- "@onereach/styles": "^21.4.1",
44
- "@onereach/ui-components-common": "^21.4.1",
43
+ "@onereach/styles": "^21.4.2",
44
+ "@onereach/ui-components-common": "^21.4.2",
45
45
  "@splidejs/splide": "4.0.6",
46
46
  "@tiptap/core": "2.0.3",
47
47
  "@tiptap/extension-blockquote": "2.0.3",
@@ -105,5 +105,5 @@
105
105
  "access": "public"
106
106
  },
107
107
  "npmUnpacked": "4.15.2",
108
- "gitHead": "ed1ded657f63a00f392e38abc14b3b8c92d6f048"
108
+ "gitHead": "c1aa388b69aafd6d5d23479c8be7b0dfd38a0ff5"
109
109
  }