@onereach/ui-components 5.0.2-beta.3144.0 → 5.0.2-beta.3145.0

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.
@@ -177,7 +177,6 @@ var script = defineComponent({
177
177
  });
178
178
  const control = ref();
179
179
  const searchControl = ref();
180
- const mobileSearchControl = ref();
181
180
  const popover = ref();
182
181
  const popoverRoot = computed(() => {
183
182
  var _a;
@@ -273,16 +272,6 @@ var script = defineComponent({
273
272
  proxyModelValue.value = modelValue.filter(value => value !== option.value);
274
273
  }
275
274
  }
276
- function focusSearchControl() {
277
- setTimeout(() => {
278
- var _a, _b;
279
- if (isMobile.value) {
280
- (_a = mobileSearchControl.value) === null || _a === void 0 ? void 0 : _a.focus();
281
- } else {
282
- (_b = searchControl.value) === null || _b === void 0 ? void 0 : _b.focus();
283
- }
284
- });
285
- }
286
275
  function clearSearchControl() {
287
276
  searchText.value = '';
288
277
  }
@@ -292,15 +281,21 @@ var script = defineComponent({
292
281
  } = useOverflow(control);
293
282
  // Utils
294
283
  const {
284
+ isDesktop,
295
285
  isMobile
296
286
  } = useResponsive();
287
+ // Effects
288
+ watch(searchControl, control => {
289
+ setTimeout(() => {
290
+ control === null || control === void 0 ? void 0 : control.focus();
291
+ });
292
+ });
297
293
  return {
298
294
  root,
299
295
  inputBox,
300
296
  inputBoxRoot,
301
297
  control,
302
298
  searchControl,
303
- mobileSearchControl,
304
299
  popover,
305
300
  popoverRoot,
306
301
  popoverState,
@@ -323,10 +318,10 @@ var script = defineComponent({
323
318
  toggle,
324
319
  close,
325
320
  deselect,
326
- focusSearchControl,
327
321
  clearSearchControl,
328
322
  innerItems,
329
323
  outerItems,
324
+ isDesktop,
330
325
  isMobile
331
326
  };
332
327
  }
@@ -411,7 +406,7 @@ var __vue_render__ = function () {
411
406
  });
412
407
  }, {
413
408
  "model": _vm.proxyModelValue
414
- }), _vm._v(" "), _vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
409
+ }), _vm._v(" "), _vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
415
410
  ref: "searchControl",
416
411
  class: _vm.searchControlStyles,
417
412
  attrs: {
@@ -432,7 +427,7 @@ var __vue_render__ = function () {
432
427
  },
433
428
  expression: "searchText"
434
429
  }
435
- })] : _vm._e()] : [_vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
430
+ })] : _vm._e()] : [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
436
431
  ref: "searchControl",
437
432
  class: _vm.searchControlStyles,
438
433
  attrs: {
@@ -458,7 +453,7 @@ var __vue_render__ = function () {
458
453
  attrs: {
459
454
  "disabled": _vm.disabled ? '' : null
460
455
  }
461
- }, [_vm._v("\n " + _vm._s(_vm.placeholder) + "\n ")])]]] : [_vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
456
+ }, [_vm._v("\n " + _vm._s(_vm.placeholder) + "\n ")])]]] : [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
462
457
  ref: "searchControl",
463
458
  class: _vm.searchControlStyles,
464
459
  attrs: {
@@ -520,15 +515,12 @@ var __vue_render__ = function () {
520
515
  "disable-default-styles": true
521
516
  },
522
517
  on: {
523
- "open": function ($event) {
524
- return _vm.focusSearchControl();
525
- },
526
518
  "close": function ($event) {
527
519
  return _vm.clearSearchControl();
528
520
  }
529
521
  }
530
- }, [_vm.isMobile ? [_c('OrInput', {
531
- ref: "mobileSearchControl",
522
+ }, [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isMobile ? [_c('OrInput', {
523
+ ref: "searchControl",
532
524
  class: _vm.searchControlStyles,
533
525
  attrs: {
534
526
  "type": 'search',
@@ -11,7 +11,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
11
11
  inputBoxRoot: import("@vue/composition-api").ComputedRef<undefined>;
12
12
  control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
13
13
  searchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
14
- mobileSearchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
15
14
  popover: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
16
15
  [x: string]: ((...args: any[]) => any) | null;
17
16
  } | string[], {} & {}, {
@@ -41,10 +40,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
41
40
  toggle: () => void;
42
41
  close: () => void;
43
42
  deselect: (option: SelectOption) => void;
44
- focusSearchControl: () => void;
45
43
  clearSearchControl: () => void;
46
44
  innerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
47
45
  outerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
46
+ isDesktop: import("@vue/composition-api").Ref<boolean>;
48
47
  isMobile: import("@vue/composition-api").Ref<boolean>;
49
48
  }> & import("@vue/composition-api").Data, {}, {}, {
50
49
  options: {
@@ -205,7 +204,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
205
204
  inputBoxRoot: import("@vue/composition-api").ComputedRef<undefined>;
206
205
  control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
207
206
  searchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
208
- mobileSearchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
209
207
  popover: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
210
208
  [x: string]: ((...args: any[]) => any) | null;
211
209
  } | string[], {} & {}, {
@@ -235,10 +233,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
235
233
  toggle: () => void;
236
234
  close: () => void;
237
235
  deselect: (option: SelectOption) => void;
238
- focusSearchControl: () => void;
239
236
  clearSearchControl: () => void;
240
237
  innerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
241
238
  outerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
239
+ isDesktop: import("@vue/composition-api").Ref<boolean>;
242
240
  isMobile: import("@vue/composition-api").Ref<boolean>;
243
241
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
244
242
  modelValue: string | number | object | string[] | object[] | number[];
@@ -142,7 +142,6 @@ var script = defineComponent({
142
142
  });
143
143
  const control = ref();
144
144
  const searchControl = ref();
145
- const mobileSearchControl = ref();
146
145
  const popover = ref();
147
146
  const popoverRoot = computed(() => {
148
147
  var _a;
@@ -238,16 +237,6 @@ var script = defineComponent({
238
237
  proxyModelValue.value = modelValue.filter(value => value !== option.value);
239
238
  }
240
239
  }
241
- function focusSearchControl() {
242
- setTimeout(() => {
243
- var _a, _b;
244
- if (isMobile.value) {
245
- (_a = mobileSearchControl.value) === null || _a === void 0 ? void 0 : _a.focus();
246
- } else {
247
- (_b = searchControl.value) === null || _b === void 0 ? void 0 : _b.focus();
248
- }
249
- });
250
- }
251
240
  function clearSearchControl() {
252
241
  searchText.value = '';
253
242
  }
@@ -257,15 +246,21 @@ var script = defineComponent({
257
246
  } = useOverflow(control);
258
247
  // Utils
259
248
  const {
249
+ isDesktop,
260
250
  isMobile
261
251
  } = useResponsive();
252
+ // Effects
253
+ watch(searchControl, control => {
254
+ setTimeout(() => {
255
+ control === null || control === void 0 ? void 0 : control.focus();
256
+ });
257
+ });
262
258
  return {
263
259
  root,
264
260
  inputBox,
265
261
  inputBoxRoot,
266
262
  control,
267
263
  searchControl,
268
- mobileSearchControl,
269
264
  popover,
270
265
  popoverRoot,
271
266
  popoverState,
@@ -288,10 +283,10 @@ var script = defineComponent({
288
283
  toggle,
289
284
  close,
290
285
  deselect,
291
- focusSearchControl,
292
286
  clearSearchControl,
293
287
  innerItems,
294
288
  outerItems,
289
+ isDesktop,
295
290
  isMobile
296
291
  };
297
292
  }
@@ -1,5 +1,5 @@
1
- import { s as script } from '../../OrSelect.vue_vue_type_script_lang-5f42a363.js';
2
- export { s as default } from '../../OrSelect.vue_vue_type_script_lang-5f42a363.js';
1
+ import { s as script } from '../../OrSelect.vue_vue_type_script_lang-4a6e81f8.js';
2
+ export { s as default } from '../../OrSelect.vue_vue_type_script_lang-4a6e81f8.js';
3
3
  import { resolveComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, createCommentVNode, withDirectives, createElementVNode, Fragment, renderList, withModifiers, createVNode, vShow } from 'vue';
4
4
  import 'vue-demi';
5
5
  import '../../utils/isEmptyValue.js';
@@ -163,7 +163,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
163
163
 
164
164
  _: 2 /* DYNAMIC */
165
165
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled", "onReset"]);
166
- }), 128 /* KEYED_FRAGMENT */))]), _ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
166
+ }), 128 /* KEYED_FRAGMENT */))]), _ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
167
167
  key: 0,
168
168
  ref: "searchControl",
169
169
  modelValue: _ctx.searchText,
@@ -176,7 +176,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
176
176
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
177
177
  }, null, 8 /* PROPS */, ["modelValue", "class", "size"])) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createElementBlock(Fragment, {
178
178
  key: 1
179
- }, [_ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
179
+ }, [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
180
180
  key: 0,
181
181
  ref: "searchControl",
182
182
  modelValue: _ctx.searchText,
@@ -193,7 +193,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
193
193
  disabled: _ctx.disabled ? '' : null
194
194
  }, toDisplayString(_ctx.placeholder), 11 /* TEXT, CLASS, PROPS */, _hoisted_2))], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createElementBlock(Fragment, {
195
195
  key: 1
196
- }, [_ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
196
+ }, [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
197
197
  key: 0,
198
198
  ref: "searchControl",
199
199
  modelValue: _ctx.searchText,
@@ -232,12 +232,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
232
232
  "full-width": true,
233
233
  "custom-styles": _ctx.dropdownStyles,
234
234
  "disable-default-styles": true,
235
- onOpen: _cache[12] || (_cache[12] = $event => _ctx.focusSearchControl()),
236
- onClose: _cache[13] || (_cache[13] = $event => _ctx.clearSearchControl())
235
+ onClose: _cache[12] || (_cache[12] = $event => _ctx.clearSearchControl())
237
236
  }, {
238
- default: withCtx(() => [_ctx.isMobile ? (openBlock(), createBlock(_component_OrInput, {
237
+ default: withCtx(() => [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isMobile ? (openBlock(), createBlock(_component_OrInput, {
239
238
  key: 0,
240
- ref: "mobileSearchControl",
239
+ ref: "searchControl",
241
240
  modelValue: _ctx.searchText,
242
241
  "onUpdate:modelValue": _cache[9] || (_cache[9] = $event => _ctx.searchText = $event),
243
242
  class: normalizeClass(_ctx.searchControlStyles),
@@ -72,7 +72,6 @@ declare const _default: import("vue-demi").DefineComponent<{
72
72
  inputBoxRoot: import("vue-demi").ComputedRef<any>;
73
73
  control: import("vue-demi").Ref<HTMLElement | undefined>;
74
74
  searchControl: import("vue-demi").Ref<HTMLElement | undefined>;
75
- mobileSearchControl: import("vue-demi").Ref<HTMLElement | undefined>;
76
75
  popover: import("vue-demi").Ref<any>;
77
76
  popoverRoot: import("vue-demi").ComputedRef<any>;
78
77
  popoverState: import("vue-demi").ComputedRef<any>;
@@ -98,10 +97,10 @@ declare const _default: import("vue-demi").DefineComponent<{
98
97
  toggle: () => void;
99
98
  close: () => void;
100
99
  deselect: (option: SelectOption) => void;
101
- focusSearchControl: () => void;
102
100
  clearSearchControl: () => void;
103
101
  innerItems: import("vue-demi").Ref<HTMLElement[]>;
104
102
  outerItems: import("vue-demi").Ref<HTMLElement[]>;
103
+ isDesktop: import("vue-demi").Ref<boolean>;
105
104
  isMobile: import("vue-demi").Ref<boolean>;
106
105
  }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("search" | "update:modelValue" | "focus" | "blur")[], "search" | "update:modelValue" | "focus" | "blur", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
107
106
  options: {
@@ -1,4 +1,4 @@
1
- export { s as OrSelectV3 } from '../../OrSelect.vue_vue_type_script_lang-5f42a363.js';
1
+ export { s as OrSelectV3 } from '../../OrSelect.vue_vue_type_script_lang-4a6e81f8.js';
2
2
  export { InputBoxSize as SelectSize } from '../OrInputBoxV3/props.js';
3
3
  import 'vue-demi';
4
4
  import '../../utils/isEmptyValue.js';
@@ -114,7 +114,7 @@ export { s as OrSearchV3 } from '../OrSearch.vue_vue_type_script_lang-12bbade9.j
114
114
  export { s as OrSegmentedControlV3 } from '../OrSegmentedControl.vue_vue_type_script_lang-3a7df112.js';
115
115
  export { SegmentedControlSize } from './OrSegmentedControlV3/props.js';
116
116
  export { s as OrSelect } from '../OrSelect.vue_vue_type_script_lang-2516881b.js';
117
- export { s as OrSelectV3 } from '../OrSelect.vue_vue_type_script_lang-5f42a363.js';
117
+ export { s as OrSelectV3 } from '../OrSelect.vue_vue_type_script_lang-4a6e81f8.js';
118
118
  export { s as OrSidebar } from '../OrSidebar.vue_vue_type_script_lang-81941fe6.js';
119
119
  export { OrSidebarSide } from './OrSidebar/constants.js';
120
120
  export { s as OrSidebarV3 } from '../OrSidebar.vue_vue_type_script_lang-a7103da5.js';
@@ -74,7 +74,7 @@ export { s as OrSegmentedControlV3 } from './OrSegmentedControl.vue_vue_type_scr
74
74
  import './components/OrSelect/OrSelect.js';
75
75
  export { s as OrSelect } from './OrSelect.vue_vue_type_script_lang-2516881b.js';
76
76
  import './components/OrSelectV3/OrSelect.js';
77
- export { s as OrSelectV3 } from './OrSelect.vue_vue_type_script_lang-5f42a363.js';
77
+ export { s as OrSelectV3 } from './OrSelect.vue_vue_type_script_lang-4a6e81f8.js';
78
78
  import './components/OrSidebar/OrSidebar.js';
79
79
  export { s as OrSidebar } from './OrSidebar.vue_vue_type_script_lang-81941fe6.js';
80
80
  import './components/OrSidebarV3/OrSidebar.js';
@@ -192,7 +192,6 @@ var script = defineComponent({
192
192
  });
193
193
  const control = ref();
194
194
  const searchControl = ref();
195
- const mobileSearchControl = ref();
196
195
  const popover = ref();
197
196
  const popoverRoot = computed(() => {
198
197
  var _a;
@@ -288,16 +287,6 @@ var script = defineComponent({
288
287
  proxyModelValue.value = modelValue.filter(value => value !== option.value);
289
288
  }
290
289
  }
291
- function focusSearchControl() {
292
- setTimeout(() => {
293
- var _a, _b;
294
- if (isMobile.value) {
295
- (_a = mobileSearchControl.value) === null || _a === void 0 ? void 0 : _a.focus();
296
- } else {
297
- (_b = searchControl.value) === null || _b === void 0 ? void 0 : _b.focus();
298
- }
299
- });
300
- }
301
290
  function clearSearchControl() {
302
291
  searchText.value = '';
303
292
  }
@@ -307,15 +296,21 @@ var script = defineComponent({
307
296
  } = useOverflow(control);
308
297
  // Utils
309
298
  const {
299
+ isDesktop,
310
300
  isMobile
311
301
  } = useResponsive();
302
+ // Effects
303
+ watch(searchControl, control => {
304
+ setTimeout(() => {
305
+ control === null || control === void 0 ? void 0 : control.focus();
306
+ });
307
+ });
312
308
  return {
313
309
  root,
314
310
  inputBox,
315
311
  inputBoxRoot,
316
312
  control,
317
313
  searchControl,
318
- mobileSearchControl,
319
314
  popover,
320
315
  popoverRoot,
321
316
  popoverState,
@@ -338,10 +333,10 @@ var script = defineComponent({
338
333
  toggle,
339
334
  close,
340
335
  deselect,
341
- focusSearchControl,
342
336
  clearSearchControl,
343
337
  innerItems,
344
338
  outerItems,
339
+ isDesktop,
345
340
  isMobile
346
341
  };
347
342
  }
@@ -426,7 +421,7 @@ var __vue_render__ = function () {
426
421
  });
427
422
  }, {
428
423
  "model": _vm.proxyModelValue
429
- }), _vm._v(" "), _vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
424
+ }), _vm._v(" "), _vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
430
425
  ref: "searchControl",
431
426
  class: _vm.searchControlStyles,
432
427
  attrs: {
@@ -447,7 +442,7 @@ var __vue_render__ = function () {
447
442
  },
448
443
  expression: "searchText"
449
444
  }
450
- })] : _vm._e()] : [_vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
445
+ })] : _vm._e()] : [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
451
446
  ref: "searchControl",
452
447
  class: _vm.searchControlStyles,
453
448
  attrs: {
@@ -473,7 +468,7 @@ var __vue_render__ = function () {
473
468
  attrs: {
474
469
  "disabled": _vm.disabled ? '' : null
475
470
  }
476
- }, [_vm._v("\n " + _vm._s(_vm.placeholder) + "\n ")])]]] : [_vm.popoverState === 'open' && _vm.enableSearch ? [_c('OrInput', {
471
+ }, [_vm._v("\n " + _vm._s(_vm.placeholder) + "\n ")])]]] : [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isDesktop ? [_c('OrInput', {
477
472
  ref: "searchControl",
478
473
  class: _vm.searchControlStyles,
479
474
  attrs: {
@@ -535,15 +530,12 @@ var __vue_render__ = function () {
535
530
  "disable-default-styles": true
536
531
  },
537
532
  on: {
538
- "open": function ($event) {
539
- return _vm.focusSearchControl();
540
- },
541
533
  "close": function ($event) {
542
534
  return _vm.clearSearchControl();
543
535
  }
544
536
  }
545
- }, [_vm.isMobile ? [_c('OrInput', {
546
- ref: "mobileSearchControl",
537
+ }, [_vm.popoverState === 'open' && _vm.enableSearch && _vm.isMobile ? [_c('OrInput', {
538
+ ref: "searchControl",
547
539
  class: _vm.searchControlStyles,
548
540
  attrs: {
549
541
  "type": 'search',
@@ -78,7 +78,7 @@ export { _ as OrSearch } from '../OrSearch-ac542dd6.js';
78
78
  export { _ as OrSearchV3 } from '../OrSearch-598dee09.js';
79
79
  export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-d4e32f80.js';
80
80
  export { _ as OrSelect } from '../OrSelect-c0d04cf6.js';
81
- export { _ as OrSelectV3 } from '../OrSelect-36461157.js';
81
+ export { _ as OrSelectV3 } from '../OrSelect-4f215342.js';
82
82
  export { _ as OrSidebar, O as OrSidebarSide } from '../OrSidebar-c56a9221.js';
83
83
  export { _ as OrSidebarV3 } from '../OrSidebar-0539d572.js';
84
84
  export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-8474d9c3.js';
@@ -11,7 +11,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
11
11
  inputBoxRoot: import("@vue/composition-api").ComputedRef<undefined>;
12
12
  control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
13
13
  searchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
14
- mobileSearchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
15
14
  popover: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
16
15
  [x: string]: ((...args: any[]) => any) | null;
17
16
  } | string[], {} & {}, {
@@ -41,10 +40,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
41
40
  toggle: () => void;
42
41
  close: () => void;
43
42
  deselect: (option: SelectOption) => void;
44
- focusSearchControl: () => void;
45
43
  clearSearchControl: () => void;
46
44
  innerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
47
45
  outerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
46
+ isDesktop: import("@vue/composition-api").Ref<boolean>;
48
47
  isMobile: import("@vue/composition-api").Ref<boolean>;
49
48
  }> & import("@vue/composition-api").Data, {}, {}, {
50
49
  options: {
@@ -205,7 +204,6 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
205
204
  inputBoxRoot: import("@vue/composition-api").ComputedRef<undefined>;
206
205
  control: import("@vue/composition-api").Ref<HTMLElement | undefined>;
207
206
  searchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
208
- mobileSearchControl: import("@vue/composition-api").Ref<HTMLElement | undefined>;
209
207
  popover: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
210
208
  [x: string]: ((...args: any[]) => any) | null;
211
209
  } | string[], {} & {}, {
@@ -235,10 +233,10 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
235
233
  toggle: () => void;
236
234
  close: () => void;
237
235
  deselect: (option: SelectOption) => void;
238
- focusSearchControl: () => void;
239
236
  clearSearchControl: () => void;
240
237
  innerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
241
238
  outerItems: import("@vue/composition-api").Ref<HTMLElement[]>;
239
+ isDesktop: import("@vue/composition-api").Ref<boolean>;
242
240
  isMobile: import("@vue/composition-api").Ref<boolean>;
243
241
  }>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
244
242
  modelValue: string | number | object | string[] | object[] | number[];
@@ -1,4 +1,4 @@
1
- export { _ as OrSelectV3 } from '../../OrSelect-36461157.js';
1
+ export { _ as OrSelectV3 } from '../../OrSelect-4f215342.js';
2
2
  export { I as SelectSize } from '../../OrInputBox.vue_rollup-plugin-vue_script-4fde9829.js';
3
3
  import 'vue-demi';
4
4
  import '../../dropdown-open-06d651cf.js';
@@ -78,7 +78,7 @@ export { _ as OrSearch } from './OrSearch-ac542dd6.js';
78
78
  export { _ as OrSearchV3 } from './OrSearch-598dee09.js';
79
79
  export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-d4e32f80.js';
80
80
  export { _ as OrSelect } from './OrSelect-c0d04cf6.js';
81
- export { _ as OrSelectV3 } from './OrSelect-36461157.js';
81
+ export { _ as OrSelectV3 } from './OrSelect-4f215342.js';
82
82
  export { _ as OrSidebar, O as OrSidebarSide } from './OrSidebar-c56a9221.js';
83
83
  export { _ as OrSidebarV3 } from './OrSidebar-0539d572.js';
84
84
  export { O as OrSidebarPlacement } from './OrSidebarCollapseButton-8474d9c3.js';
@@ -191,7 +191,6 @@ var script = defineComponent({
191
191
  });
192
192
  const control = ref();
193
193
  const searchControl = ref();
194
- const mobileSearchControl = ref();
195
194
  const popover = ref();
196
195
  const popoverRoot = computed(() => {
197
196
  var _a;
@@ -287,16 +286,6 @@ var script = defineComponent({
287
286
  proxyModelValue.value = modelValue.filter(value => value !== option.value);
288
287
  }
289
288
  }
290
- function focusSearchControl() {
291
- setTimeout(() => {
292
- var _a, _b;
293
- if (isMobile.value) {
294
- (_a = mobileSearchControl.value) === null || _a === void 0 ? void 0 : _a.focus();
295
- } else {
296
- (_b = searchControl.value) === null || _b === void 0 ? void 0 : _b.focus();
297
- }
298
- });
299
- }
300
289
  function clearSearchControl() {
301
290
  searchText.value = '';
302
291
  }
@@ -306,15 +295,21 @@ var script = defineComponent({
306
295
  } = useOverflow(control);
307
296
  // Utils
308
297
  const {
298
+ isDesktop,
309
299
  isMobile
310
300
  } = useResponsive();
301
+ // Effects
302
+ watch(searchControl, control => {
303
+ setTimeout(() => {
304
+ control === null || control === void 0 ? void 0 : control.focus();
305
+ });
306
+ });
311
307
  return {
312
308
  root,
313
309
  inputBox,
314
310
  inputBoxRoot,
315
311
  control,
316
312
  searchControl,
317
- mobileSearchControl,
318
313
  popover,
319
314
  popoverRoot,
320
315
  popoverState,
@@ -337,10 +332,10 @@ var script = defineComponent({
337
332
  toggle,
338
333
  close,
339
334
  deselect,
340
- focusSearchControl,
341
335
  clearSearchControl,
342
336
  innerItems,
343
337
  outerItems,
338
+ isDesktop,
344
339
  isMobile
345
340
  };
346
341
  }
@@ -424,7 +419,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
424
419
 
425
420
  _: 2 /* DYNAMIC */
426
421
  }, 1032 /* PROPS, DYNAMIC_SLOTS */, ["disabled", "onReset"]);
427
- }), 128 /* KEYED_FRAGMENT */))]), _ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
422
+ }), 128 /* KEYED_FRAGMENT */))]), _ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
428
423
  key: 0,
429
424
  ref: "searchControl",
430
425
  modelValue: _ctx.searchText,
@@ -437,7 +432,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
437
432
  onClick: _cache[1] || (_cache[1] = withModifiers(() => {}, ["stop"]))
438
433
  }, null, 8 /* PROPS */, ["modelValue", "class", "size"])) : createCommentVNode("v-if", true)], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createElementBlock(Fragment, {
439
434
  key: 1
440
- }, [_ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
435
+ }, [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
441
436
  key: 0,
442
437
  ref: "searchControl",
443
438
  modelValue: _ctx.searchText,
@@ -454,7 +449,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
454
449
  disabled: _ctx.disabled ? '' : null
455
450
  }, toDisplayString(_ctx.placeholder), 11 /* TEXT, CLASS, PROPS */, _hoisted_2))], 64 /* STABLE_FRAGMENT */))], 64 /* STABLE_FRAGMENT */)) : (openBlock(), createElementBlock(Fragment, {
456
451
  key: 1
457
- }, [_ctx.popoverState === 'open' && _ctx.enableSearch ? (openBlock(), createBlock(_component_OrInput, {
452
+ }, [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isDesktop ? (openBlock(), createBlock(_component_OrInput, {
458
453
  key: 0,
459
454
  ref: "searchControl",
460
455
  modelValue: _ctx.searchText,
@@ -493,12 +488,11 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
493
488
  "full-width": true,
494
489
  "custom-styles": _ctx.dropdownStyles,
495
490
  "disable-default-styles": true,
496
- onOpen: _cache[12] || (_cache[12] = $event => _ctx.focusSearchControl()),
497
- onClose: _cache[13] || (_cache[13] = $event => _ctx.clearSearchControl())
491
+ onClose: _cache[12] || (_cache[12] = $event => _ctx.clearSearchControl())
498
492
  }, {
499
- default: withCtx(() => [_ctx.isMobile ? (openBlock(), createBlock(_component_OrInput, {
493
+ default: withCtx(() => [_ctx.popoverState === 'open' && _ctx.enableSearch && _ctx.isMobile ? (openBlock(), createBlock(_component_OrInput, {
500
494
  key: 0,
501
- ref: "mobileSearchControl",
495
+ ref: "searchControl",
502
496
  modelValue: _ctx.searchText,
503
497
  "onUpdate:modelValue": _cache[9] || (_cache[9] = $event => _ctx.searchText = $event),
504
498
  class: normalizeClass(_ctx.searchControlStyles),
@@ -75,7 +75,7 @@ export { s as OrSearch } from '../OrSearch-2800e9bf.js';
75
75
  export { s as OrSearchV3 } from '../OrSearch-998e4390.js';
76
76
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-c8eb217d.js';
77
77
  export { s as OrSelect } from '../OrSelect-9520d6e6.js';
78
- export { s as OrSelectV3 } from '../OrSelect-1ef6f9d9.js';
78
+ export { s as OrSelectV3 } from '../OrSelect-f1ab4b44.js';
79
79
  export { s as OrSidebar, O as OrSidebarSide } from '../OrSidebar-aaf73310.js';
80
80
  export { s as OrSidebarV3 } from '../OrSidebar-d8e70813.js';
81
81
  export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-7a9f76cf.js';
@@ -72,7 +72,6 @@ declare const _default: import("vue-demi").DefineComponent<{
72
72
  inputBoxRoot: import("vue-demi").ComputedRef<any>;
73
73
  control: import("vue-demi").Ref<HTMLElement | undefined>;
74
74
  searchControl: import("vue-demi").Ref<HTMLElement | undefined>;
75
- mobileSearchControl: import("vue-demi").Ref<HTMLElement | undefined>;
76
75
  popover: import("vue-demi").Ref<any>;
77
76
  popoverRoot: import("vue-demi").ComputedRef<any>;
78
77
  popoverState: import("vue-demi").ComputedRef<any>;
@@ -98,10 +97,10 @@ declare const _default: import("vue-demi").DefineComponent<{
98
97
  toggle: () => void;
99
98
  close: () => void;
100
99
  deselect: (option: SelectOption) => void;
101
- focusSearchControl: () => void;
102
100
  clearSearchControl: () => void;
103
101
  innerItems: import("vue-demi").Ref<HTMLElement[]>;
104
102
  outerItems: import("vue-demi").Ref<HTMLElement[]>;
103
+ isDesktop: import("vue-demi").Ref<boolean>;
105
104
  isMobile: import("vue-demi").Ref<boolean>;
106
105
  }, unknown, {}, {}, import("vue-demi").ComponentOptionsMixin, import("vue-demi").ComponentOptionsMixin, ("search" | "update:modelValue" | "focus" | "blur")[], "search" | "update:modelValue" | "focus" | "blur", import("vue-demi").VNodeProps & import("vue-demi").AllowedComponentProps & import("vue-demi").ComponentCustomProps, Readonly<import("vue-demi").ExtractPropTypes<{
107
106
  options: {
@@ -1,4 +1,4 @@
1
- export { s as OrSelectV3 } from '../../OrSelect-1ef6f9d9.js';
1
+ export { s as OrSelectV3 } from '../../OrSelect-f1ab4b44.js';
2
2
  export { I as SelectSize } from '../../OrInputBox-912a6254.js';
3
3
  import 'vue-demi';
4
4
  import '../../dropdown-open-06d651cf.js';
@@ -75,7 +75,7 @@ export { s as OrSearch } from './OrSearch-2800e9bf.js';
75
75
  export { s as OrSearchV3 } from './OrSearch-998e4390.js';
76
76
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-c8eb217d.js';
77
77
  export { s as OrSelect } from './OrSelect-9520d6e6.js';
78
- export { s as OrSelectV3 } from './OrSelect-1ef6f9d9.js';
78
+ export { s as OrSelectV3 } from './OrSelect-f1ab4b44.js';
79
79
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-aaf73310.js';
80
80
  export { s as OrSidebarV3 } from './OrSidebar-d8e70813.js';
81
81
  export { O as OrSidebarPlacement } from './OrSidebarCollapseButton-7a9f76cf.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "5.0.2-beta.3144.0",
3
+ "version": "5.0.2-beta.3145.0",
4
4
  "npmUnpacked": "4.15.2",
5
5
  "description": "Vue components library for v2/3",
6
6
  "sideEffects": false,
@@ -55,7 +55,7 @@
55
55
  </OrTag>
56
56
  </slot>
57
57
 
58
- <template v-if="popoverState === 'open' && enableSearch">
58
+ <template v-if="popoverState === 'open' && enableSearch && isDesktop">
59
59
  <OrInput
60
60
  ref="searchControl"
61
61
  v-model="searchText"
@@ -70,7 +70,7 @@
70
70
  </template>
71
71
 
72
72
  <template v-else>
73
- <template v-if="popoverState === 'open' && enableSearch">
73
+ <template v-if="popoverState === 'open' && enableSearch && isDesktop">
74
74
  <OrInput
75
75
  ref="searchControl"
76
76
  v-model="searchText"
@@ -95,7 +95,7 @@
95
95
  </template>
96
96
 
97
97
  <template v-else>
98
- <template v-if="popoverState === 'open' && enableSearch">
98
+ <template v-if="popoverState === 'open' && enableSearch && isDesktop">
99
99
  <OrInput
100
100
  ref="searchControl"
101
101
  v-model="searchText"
@@ -160,12 +160,11 @@
160
160
  :full-width="true"
161
161
  :custom-styles="dropdownStyles"
162
162
  :disable-default-styles="true"
163
- @open="focusSearchControl()"
164
163
  @close="clearSearchControl()"
165
164
  >
166
- <template v-if="isMobile">
165
+ <template v-if="popoverState === 'open' && enableSearch && isMobile">
167
166
  <OrInput
168
- ref="mobileSearchControl"
167
+ ref="searchControl"
169
168
  v-model="searchText"
170
169
  :class="searchControlStyles"
171
170
  :type="'search'"
@@ -452,7 +451,6 @@ export default defineComponent({
452
451
  const control = ref<HTMLElement>();
453
452
 
454
453
  const searchControl = ref<HTMLElement>();
455
- const mobileSearchControl = ref<HTMLElement>();
456
454
 
457
455
  const popover = ref<InstanceType<typeof OrPopover>>();
458
456
  const popoverRoot = computed(() => popover.value?.root);
@@ -593,16 +591,6 @@ export default defineComponent({
593
591
  }
594
592
  }
595
593
 
596
- function focusSearchControl(): void {
597
- setTimeout(() => {
598
- if (isMobile.value) {
599
- mobileSearchControl.value?.focus();
600
- } else {
601
- searchControl.value?.focus();
602
- }
603
- });
604
- }
605
-
606
594
  function clearSearchControl(): void {
607
595
  searchText.value = '';
608
596
  }
@@ -610,7 +598,14 @@ export default defineComponent({
610
598
  const { innerItems, outerItems } = useOverflow(control);
611
599
 
612
600
  // Utils
613
- const { isMobile } = useResponsive();
601
+ const { isDesktop, isMobile } = useResponsive();
602
+
603
+ // Effects
604
+ watch(searchControl, (control) => {
605
+ setTimeout(() => {
606
+ control?.focus();
607
+ });
608
+ });
614
609
 
615
610
  return {
616
611
  root,
@@ -618,7 +613,6 @@ export default defineComponent({
618
613
  inputBoxRoot,
619
614
  control,
620
615
  searchControl,
621
- mobileSearchControl,
622
616
  popover,
623
617
  popoverRoot,
624
618
  popoverState,
@@ -641,10 +635,10 @@ export default defineComponent({
641
635
  toggle,
642
636
  close,
643
637
  deselect,
644
- focusSearchControl,
645
638
  clearSearchControl,
646
639
  innerItems,
647
640
  outerItems,
641
+ isDesktop,
648
642
  isMobile,
649
643
  };
650
644
  },