@onereach/ui-components 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.
@@ -111,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
111
111
  proxyModelValue: import("@onereach/ui-components-common/hooks").UseProxyModelValueReturn<SelectModelValue>;
112
112
  readonly: import("vue").ComputedRef<boolean>;
113
113
  isEmptyModelValue: import("vue").ComputedRef<boolean>;
114
+ isOpen: import("vue").ComputedRef<boolean>;
114
115
  showClear: import("vue").ComputedRef<boolean>;
115
116
  searchText: import("vue").Ref<string>;
116
117
  internalSearchOptions: import("vue").Ref<{
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, toRefs, computed, withDirectives, openBlock, createElementBlock, normalizeStyle, normalizeClass, vModelDynamic, renderSlot, watch, resolveComponent, createVNode, createSlots, withCtx, createTextVNode, toDisplayString, createElementVNode, vShow, createBlock, createCommentVNode, Fragment, getCurrentInstance, resolveDirective, withModifiers, renderList } from 'vue';
1
+ import { defineComponent, ref, toRefs, computed, withDirectives, openBlock, createElementBlock, normalizeStyle, normalizeClass, vModelDynamic, renderSlot, watch, resolveComponent, createVNode, createSlots, withCtx, createTextVNode, toDisplayString, createElementVNode, vShow, createBlock, createCommentVNode, Fragment, getCurrentInstance, nextTick, resolveDirective, withModifiers, renderList } from 'vue';
2
2
  import { r as re, l as u, F as Ft, m as d, $ as $t, s, f as c, n as ne, H as Ht, P as Pt } from '../OrAutocompleteV3-961163d0.js';
3
3
  import { l } from '../OrEditorTabsV3-856e42f1.js';
4
4
  import { useFocus } from '@vueuse/core';
@@ -695,6 +695,7 @@ var script = defineComponent({
695
695
  var _a;
696
696
  return (_a = popover.value) === null || _a === void 0 ? void 0 : _a.state;
697
697
  });
698
+ const isOpen = computed(() => popoverState.value === 'open');
698
699
  // Props
699
700
  const {
700
701
  enableClear,
@@ -738,6 +739,11 @@ var script = defineComponent({
738
739
  }, {
739
740
  deep: true
740
741
  });
742
+ watch(isOpen, value => {
743
+ if (!value) {
744
+ resetSearch();
745
+ }
746
+ });
741
747
  const groupedOptions = computed(() => {
742
748
  const groupBy = props.groupByFunction;
743
749
  if (groupBy) {
@@ -831,7 +837,9 @@ var script = defineComponent({
831
837
  resetSearch();
832
838
  }
833
839
  function resetSearch() {
834
- searchText.value = '';
840
+ nextTick(() => {
841
+ setTimeout(() => searchText.value = '');
842
+ });
835
843
  }
836
844
  // Utils
837
845
  const {
@@ -861,6 +869,7 @@ var script = defineComponent({
861
869
  proxyModelValue,
862
870
  readonly,
863
871
  isEmptyModelValue,
872
+ isOpen,
864
873
  showClear,
865
874
  searchText,
866
875
  internalSearchOptions,
@@ -928,6 +937,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
928
937
  invalid: !!_ctx.error,
929
938
  readonly: _ctx.readonly,
930
939
  disabled: _ctx.disabled,
940
+ "force-state": _ctx.isOpen ? 'focus-within' : undefined,
931
941
  tabindex: !_ctx.disabled ? 0 : null
932
942
  }, {
933
943
  default: withCtx(() => [createElementVNode("div", {
@@ -1116,7 +1126,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1116
1126
  _: 3 /* FORWARDED */
1117
1127
  }, 8 /* PROPS */, ["class", "custom-styles", "trigger"])]),
1118
1128
  _: 3 /* FORWARDED */
1119
- }, 8 /* PROPS */, ["class", "variant", "size", "invalid", "readonly", "disabled", "tabindex"])), [[_directive_dropdown_open, _ctx.toggle], [_directive_dropdown_close, _ctx.close]]), _ctx.$slots.hint || _ctx.hint ? withDirectives((openBlock(), createBlock(_component_OrHint, {
1129
+ }, 8 /* PROPS */, ["class", "variant", "size", "invalid", "readonly", "disabled", "force-state", "tabindex"])), [[_directive_dropdown_open, _ctx.toggle], [_directive_dropdown_close, _ctx.close]]), _ctx.$slots.hint || _ctx.hint ? withDirectives((openBlock(), createBlock(_component_OrHint, {
1120
1130
  key: 1,
1121
1131
  disabled: _ctx.disabled
1122
1132
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "21.4.1",
3
+ "version": "21.4.2",
4
4
  "description": "Vue components library for v3",
5
5
  "license": "Apache-2.0",
6
6
  "sideEffects": false,
@@ -45,8 +45,8 @@
45
45
  "@codemirror/view": "^6",
46
46
  "@floating-ui/dom": "1.5.3",
47
47
  "@lezer/highlight": "*",
48
- "@onereach/styles": "^21.4.1",
49
- "@onereach/ui-components-common": "^21.4.1",
48
+ "@onereach/styles": "^21.4.2",
49
+ "@onereach/ui-components-common": "^21.4.2",
50
50
  "@splidejs/splide": "4.0.6",
51
51
  "@tiptap/core": "2.0.3",
52
52
  "@tiptap/extension-blockquote": "2.0.3",
@@ -103,5 +103,5 @@
103
103
  "access": "public"
104
104
  },
105
105
  "npmUnpacked": "4.15.2",
106
- "gitHead": "ed1ded657f63a00f392e38abc14b3b8c92d6f048"
106
+ "gitHead": "c1aa388b69aafd6d5d23479c8be7b0dfd38a0ff5"
107
107
  }