@onereach/ui-components-vue2 25.1.2-beta.5762.0 → 25.1.2-beta.5764.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.
- package/dist/esm/components/index.d.ts +0 -1
- package/dist/esm/components/index.js +3 -4
- package/dist/esm/components/or-autocomplete-v3/index.js +3 -6
- package/dist/esm/components/or-editor-tabs-v3/index.js +1 -1
- package/dist/esm/components/or-menu-item-v3/index.js +2 -14
- package/dist/esm/components/or-menu-v3/index.js +3 -15
- package/dist/esm/components/or-popover-v3/index.js +9 -9
- package/dist/esm/components/or-tag-input-v3/index.js +6 -5
- package/dist/esm/index.js +0 -1
- package/package.json +3 -3
- package/src/components/index.ts +0 -1
- package/dist/esm/components/or-sub-menu-item-v3/OrSubMenuItem.vue.d.ts +0 -2
- package/dist/esm/components/or-sub-menu-item-v3/index.d.ts +0 -1
- package/dist/esm/components/or-sub-menu-item-v3/index.js +0 -218
|
@@ -66,7 +66,6 @@ export * from './or-skeleton-v3';
|
|
|
66
66
|
export * from './or-slider-v3';
|
|
67
67
|
export * from './or-sorting-v3';
|
|
68
68
|
export * from './or-status-v3';
|
|
69
|
-
export * from './or-sub-menu-item-v3';
|
|
70
69
|
export * from './or-switch-v3';
|
|
71
70
|
export * from './or-tab-v3';
|
|
72
71
|
export * from './or-tabs-v3';
|
|
@@ -82,7 +82,6 @@ export { OrSliderV3 } from './or-slider-v3/index.js';
|
|
|
82
82
|
export { S as SliderColor, a as SliderOrientation } from '../types-75a1cc13.js';
|
|
83
83
|
export { OrSortingV3 } from './or-sorting-v3/index.js';
|
|
84
84
|
export { OrStatusV3, StatusSize, StatusVariant } from './or-status-v3/index.js';
|
|
85
|
-
export { OrSubMenuItemV3 } from './or-sub-menu-item-v3/index.js';
|
|
86
85
|
export { OrSwitchV3 } from './or-switch-v3/index.js';
|
|
87
86
|
export { OrTabV3 } from './or-tab-v3/index.js';
|
|
88
87
|
export { OrTabsV3, TabsSpacing, TabsVariant } from './or-tabs-v3/index.js';
|
|
@@ -98,13 +97,13 @@ export { OrTimeRangePickerV3 } from './or-time-range-picker-v3/index.js';
|
|
|
98
97
|
export { OrToastContainerV3, OrToastV3, PropsV3, TypesV3, useQueueV3, useToastV3 } from './or-toast-v3/index.js';
|
|
99
98
|
export { OrTooltipV3 } from './or-tooltip-v3/index.js';
|
|
100
99
|
export { OrTreeV3, TreeNodeDropPosition } from './or-tree-v3/index.js';
|
|
101
|
-
import '
|
|
102
|
-
import 'vue-demi';
|
|
100
|
+
import '../directives-0869d2a4.js';
|
|
103
101
|
import '../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
102
|
+
import 'vue-demi';
|
|
104
103
|
import '../dom-qGGG2YCX-4d4cca6e.js';
|
|
104
|
+
import '@vueuse/core';
|
|
105
105
|
import '@onereach/styles/screens.json';
|
|
106
106
|
import '@onereach/styles/tailwind.config.json';
|
|
107
|
-
import '../directives-0869d2a4.js';
|
|
108
107
|
import '../utils-72d9c2bb.js';
|
|
109
108
|
import '../normalize-component-cf2db48b.js';
|
|
110
109
|
import '../constants-2e3ea701.js';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { computedAsync, watchTriggerable } from '@vueuse/core';
|
|
2
|
-
import { defineComponent, reactive, ref, computed, toRef, nextTick } from 'vue-demi';
|
|
3
|
-
import { J, Q, c as ie, a as re, n as ne } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
4
1
|
import { a, c } from '../../directives-0869d2a4.js';
|
|
2
|
+
import { J, Q, c as ie, a as re, n as ne } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
5
3
|
import { a8 as Ht, ae as u, an as Ft, P as Pt } from '../../utils-72d9c2bb.js';
|
|
4
|
+
import { computedAsync, watchTriggerable } from '@vueuse/core';
|
|
5
|
+
import { defineComponent, reactive, ref, computed, toRef, nextTick } from 'vue-demi';
|
|
6
6
|
import { OrErrorV3 as OrError } from '../or-error-v3/index.js';
|
|
7
7
|
import { OrHintV3 as OrHint } from '../or-hint-v3/index.js';
|
|
8
8
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3/index.js';
|
|
@@ -297,9 +297,6 @@ var script = defineComponent({
|
|
|
297
297
|
}
|
|
298
298
|
function onBlur(event) {
|
|
299
299
|
activated.value = false;
|
|
300
|
-
if (props.multiple) {
|
|
301
|
-
clear();
|
|
302
|
-
}
|
|
303
300
|
context.emit('blur', event);
|
|
304
301
|
}
|
|
305
302
|
function openMobilePopover() {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
|
|
1
2
|
import { s } from '../../helpers-368c7a99.js';
|
|
2
3
|
import { n as ne, a as re } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
3
4
|
import { ae as u } from '../../utils-72d9c2bb.js';
|
|
4
|
-
import { defineComponent, ref, computed, toRef, watch } from 'vue-demi';
|
|
5
5
|
import { a as isVue2 } from '../../constants-2e3ea701.js';
|
|
6
6
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3/index.js';
|
|
7
7
|
import { n as normalizeComponent } from '../../normalize-component-cf2db48b.js';
|
|
@@ -74,7 +74,7 @@ var script = defineComponent({
|
|
|
74
74
|
default: ''
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
emits: ['click', 'focus', 'blur', '
|
|
77
|
+
emits: ['click', 'focus', 'blur', 'close'],
|
|
78
78
|
expose: ['root'],
|
|
79
79
|
setup(props) {
|
|
80
80
|
// Refs
|
|
@@ -147,18 +147,6 @@ var __vue_render__ = function () {
|
|
|
147
147
|
},
|
|
148
148
|
"blur": function ($event) {
|
|
149
149
|
return _vm.$emit('blur', $event);
|
|
150
|
-
},
|
|
151
|
-
"mouseover": function ($event) {
|
|
152
|
-
return _vm.$emit('mouseover', $event);
|
|
153
|
-
},
|
|
154
|
-
"mouseout": function ($event) {
|
|
155
|
-
return _vm.$emit('mouseout', $event);
|
|
156
|
-
},
|
|
157
|
-
"mouseenter": function ($event) {
|
|
158
|
-
return _vm.$emit('mouseenter', $event);
|
|
159
|
-
},
|
|
160
|
-
"mouseleave": function ($event) {
|
|
161
|
-
return _vm.$emit('mouseleave', $event);
|
|
162
150
|
}
|
|
163
151
|
}
|
|
164
152
|
}, [_vm.icon && _vm.iconProps.icon ? [_c('OrIcon', _vm._b({
|
|
@@ -174,7 +162,7 @@ var __vue_render__ = function () {
|
|
|
174
162
|
_vm.tooltip && _vm.tooltip.close();
|
|
175
163
|
}
|
|
176
164
|
}
|
|
177
|
-
}, [_vm._t("default")], 2), _vm._v(" "), _vm.
|
|
165
|
+
}, [_vm._t("default")], 2), _vm._v(" "), _vm.closeButton ? [_c('div', {
|
|
178
166
|
class: ['grow']
|
|
179
167
|
}), _vm._v(" "), _c('OrIconButton', {
|
|
180
168
|
attrs: {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as te } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
2
1
|
import { defineComponent, ref, computed, toRef } from 'vue-demi';
|
|
2
|
+
import { t as te } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
3
3
|
import { OrPopoverV3 as OrPopover, PopoverPlacement } from '../or-popover-v3/index.js';
|
|
4
4
|
import { n as normalizeComponent } from '../../normalize-component-cf2db48b.js';
|
|
5
5
|
import '../../dom-qGGG2YCX-4d4cca6e.js';
|
|
@@ -48,12 +48,11 @@ var script = defineComponent({
|
|
|
48
48
|
default: () => []
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
|
-
emits: ['update:state', 'open', 'close'
|
|
52
|
-
expose: ['root', '
|
|
51
|
+
emits: ['update:state', 'open', 'close'],
|
|
52
|
+
expose: ['root', 'state', 'open', 'close', 'toggle'],
|
|
53
53
|
setup(props, context) {
|
|
54
54
|
// Refs
|
|
55
55
|
const root = ref();
|
|
56
|
-
const popover = ref();
|
|
57
56
|
// Styles
|
|
58
57
|
const rootStyles = computed(() => ['or-menu-v3', ...Menu]);
|
|
59
58
|
const popoverStyles = computed(() => ['or-menu-popover-v3']);
|
|
@@ -75,7 +74,6 @@ var script = defineComponent({
|
|
|
75
74
|
}
|
|
76
75
|
return {
|
|
77
76
|
root,
|
|
78
|
-
popover,
|
|
79
77
|
rootStyles,
|
|
80
78
|
popoverStyles,
|
|
81
79
|
state,
|
|
@@ -96,7 +94,6 @@ var __vue_render__ = function () {
|
|
|
96
94
|
var _h = _vm.$createElement;
|
|
97
95
|
var _c = _vm._self._c || _h;
|
|
98
96
|
return _c('OrPopover', {
|
|
99
|
-
ref: _vm.popover,
|
|
100
97
|
class: _vm.popoverStyles,
|
|
101
98
|
attrs: {
|
|
102
99
|
"custom-styles": _vm.popoverStyles,
|
|
@@ -119,15 +116,6 @@ var __vue_render__ = function () {
|
|
|
119
116
|
"click": function ($event) {
|
|
120
117
|
$event.stopPropagation();
|
|
121
118
|
return _vm.onClick($event);
|
|
122
|
-
},
|
|
123
|
-
"mouseout": function ($event) {
|
|
124
|
-
return _vm.$emit('mouseout', $event);
|
|
125
|
-
},
|
|
126
|
-
"mouseleave": function ($event) {
|
|
127
|
-
return _vm.$emit('mouseleave', $event);
|
|
128
|
-
},
|
|
129
|
-
"mouseenter": function ($event) {
|
|
130
|
-
return _vm.$emit('mouseenter', $event);
|
|
131
119
|
}
|
|
132
120
|
}
|
|
133
121
|
}, 'div', _vm.$attrs, false), [_vm._t("default")], 2)]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { computePosition, offset, shift, flip, hide, size, autoUpdate } from '@floating-ui/dom';
|
|
2
|
-
import { t as te, a as re, G } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
3
2
|
import { onClickOutside } from '@vueuse/core';
|
|
4
3
|
import { computed, unref, ref, shallowRef, watch, getCurrentScope, onScopeDispose, shallowReadonly, defineComponent, toRefs, toRef } from 'vue-demi';
|
|
4
|
+
import { t as te, a as re, G } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
5
5
|
import { a9 as p } from '../../utils-72d9c2bb.js';
|
|
6
6
|
import { OrBottomSheetV3 as OrBottomSheet } from '../or-bottom-sheet-v3/index.js';
|
|
7
7
|
import { OrTeleportV3 as OrTeleport } from '../or-teleport-v3/index.js';
|
|
@@ -296,7 +296,7 @@ var script = defineComponent({
|
|
|
296
296
|
}
|
|
297
297
|
},
|
|
298
298
|
emits: ['update:state', 'open', 'close'],
|
|
299
|
-
expose: ['root', '
|
|
299
|
+
expose: ['root', 'state', 'isFlipped', 'isHidden', 'open', 'close', 'toggle', 'bottomSheet'],
|
|
300
300
|
setup(props, context) {
|
|
301
301
|
// Refs
|
|
302
302
|
const root = ref();
|
|
@@ -313,14 +313,9 @@ var script = defineComponent({
|
|
|
313
313
|
fullWidth,
|
|
314
314
|
hideOptions
|
|
315
315
|
} = toRefs(props);
|
|
316
|
-
const isFlipped = computed(() => computedPlacement.value !== placement.value);
|
|
317
|
-
const isHidden = computed(() => {
|
|
318
|
-
var _a;
|
|
319
|
-
return Boolean((_a = middlewareData.value.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden);
|
|
320
|
-
});
|
|
321
316
|
// Styles
|
|
322
317
|
const rootStyles = computed(() => ['or-popover-v3', ...Popover, ...('class' in context.attrs ? [] : props.customStyles)]);
|
|
323
|
-
const bodyStyles = computed(() => [...PopoverBody, ...PopoverBodyPlacements[
|
|
318
|
+
const bodyStyles = computed(() => [...PopoverBody, ...PopoverBodyPlacements[placement.value]]);
|
|
324
319
|
// State
|
|
325
320
|
const {
|
|
326
321
|
state,
|
|
@@ -354,6 +349,11 @@ var script = defineComponent({
|
|
|
354
349
|
});
|
|
355
350
|
}
|
|
356
351
|
});
|
|
352
|
+
const isFlipped = computed(() => computedPlacement.value !== placement.value);
|
|
353
|
+
const isHidden = computed(() => {
|
|
354
|
+
var _a;
|
|
355
|
+
return Boolean((_a = middlewareData.value.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden);
|
|
356
|
+
});
|
|
357
357
|
// Helpers
|
|
358
358
|
const {
|
|
359
359
|
isDesktop,
|
|
@@ -407,7 +407,7 @@ var __vue_render__ = function () {
|
|
|
407
407
|
expression: "state === 'open'"
|
|
408
408
|
}],
|
|
409
409
|
ref: 'containerRoot',
|
|
410
|
-
class: ['contents']
|
|
410
|
+
class: ['contents', 'my-state' + _vm.state]
|
|
411
411
|
}, [_vm.isDesktop && _vm.variant === 'auto' || _vm.variant === 'popover' ? [_c('div', _vm._b({
|
|
412
412
|
directives: [{
|
|
413
413
|
name: "show",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { onClickOutside } from '@vueuse/core';
|
|
2
|
-
import { defineComponent, ref, toRefs, computed, reactive, watch, nextTick } from 'vue-demi';
|
|
3
1
|
import { a as re, J, Q, c as ie, n as ne } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
4
2
|
import { an as Ft, a8 as Ht, P as Pt } from '../../utils-72d9c2bb.js';
|
|
3
|
+
import { onClickOutside } from '@vueuse/core';
|
|
4
|
+
import { defineComponent, ref, toRefs, computed, reactive, watch, nextTick } from 'vue-demi';
|
|
5
5
|
import { OrErrorV3 as OrError } from '../or-error-v3/index.js';
|
|
6
6
|
import { OrHintV3 as OrHint } from '../or-hint-v3/index.js';
|
|
7
7
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3/index.js';
|
|
@@ -9,8 +9,8 @@ import { OrInputBoxV3 as OrInputBox } from '../or-input-box-v3/index.js';
|
|
|
9
9
|
import { OrLabelV3 as OrLabel } from '../or-label-v3/index.js';
|
|
10
10
|
import { OrLoaderV3 as OrLoader } from '../or-loader-v3/index.js';
|
|
11
11
|
import { OrTagsV3 as OrTags, TagsOverflow } from '../or-tags-v3/index.js';
|
|
12
|
-
import { a as InputBoxVariant } from '../../types-98e9a758.js';
|
|
13
12
|
import { TagColor } from '../or-tag-v3/index.js';
|
|
13
|
+
import { a as InputBoxVariant } from '../../types-98e9a758.js';
|
|
14
14
|
import { s as styleInject } from '../../style-inject.es-87955792.js';
|
|
15
15
|
import { n as normalizeComponent } from '../../normalize-component-cf2db48b.js';
|
|
16
16
|
import '../../dom-qGGG2YCX-4d4cca6e.js';
|
|
@@ -188,6 +188,7 @@ var script = defineComponent({
|
|
|
188
188
|
function blur() {
|
|
189
189
|
var _a;
|
|
190
190
|
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
191
|
+
draftModelValue.value = '';
|
|
191
192
|
}
|
|
192
193
|
function deactivate() {
|
|
193
194
|
activated.value = false;
|
|
@@ -270,7 +271,7 @@ var script = defineComponent({
|
|
|
270
271
|
}
|
|
271
272
|
});
|
|
272
273
|
|
|
273
|
-
var css_248z = "input[data-v-
|
|
274
|
+
var css_248z = "input[data-v-6d0368d7]{min-width:0;background:0 0;outline:0}";
|
|
274
275
|
styleInject(css_248z);
|
|
275
276
|
|
|
276
277
|
/* script */
|
|
@@ -480,7 +481,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
480
481
|
/* style */
|
|
481
482
|
const __vue_inject_styles__ = undefined;
|
|
482
483
|
/* scoped */
|
|
483
|
-
const __vue_scope_id__ = "data-v-
|
|
484
|
+
const __vue_scope_id__ = "data-v-6d0368d7";
|
|
484
485
|
/* module identifier */
|
|
485
486
|
const __vue_module_identifier__ = undefined;
|
|
486
487
|
/* functional template */
|
package/dist/esm/index.js
CHANGED
|
@@ -88,7 +88,6 @@ export { OrSliderV3 } from './components/or-slider-v3/index.js';
|
|
|
88
88
|
export { S as SliderColor, a as SliderOrientation } from './types-75a1cc13.js';
|
|
89
89
|
export { OrSortingV3 } from './components/or-sorting-v3/index.js';
|
|
90
90
|
export { OrStatusV3, StatusSize, StatusVariant } from './components/or-status-v3/index.js';
|
|
91
|
-
export { OrSubMenuItemV3 } from './components/or-sub-menu-item-v3/index.js';
|
|
92
91
|
export { OrSwitchV3 } from './components/or-switch-v3/index.js';
|
|
93
92
|
export { OrTabV3 } from './components/or-tab-v3/index.js';
|
|
94
93
|
export { OrTabsV3, TabsSpacing, TabsVariant } from './components/or-tabs-v3/index.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components-vue2",
|
|
3
|
-
"version": "25.1.2-beta.
|
|
3
|
+
"version": "25.1.2-beta.5764.0",
|
|
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": "^25.1.2-beta.
|
|
44
|
-
"@onereach/ui-components-common": "^25.1.2-beta.
|
|
43
|
+
"@onereach/styles": "^25.1.2-beta.5764.0",
|
|
44
|
+
"@onereach/ui-components-common": "^25.1.2-beta.5764.0",
|
|
45
45
|
"@splidejs/splide": "4.0.6",
|
|
46
46
|
"@tiptap/core": "2.0.3",
|
|
47
47
|
"@tiptap/extension-blockquote": "2.0.3",
|
package/src/components/index.ts
CHANGED
|
@@ -66,7 +66,6 @@ export * from './or-skeleton-v3';
|
|
|
66
66
|
export * from './or-slider-v3';
|
|
67
67
|
export * from './or-sorting-v3';
|
|
68
68
|
export * from './or-status-v3';
|
|
69
|
-
export * from './or-sub-menu-item-v3';
|
|
70
69
|
export * from './or-switch-v3';
|
|
71
70
|
export * from './or-tab-v3';
|
|
72
71
|
export * from './or-tabs-v3';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default as OrSubMenuItemV3 } from './OrSubMenuItem.vue';
|
|
@@ -1,218 +0,0 @@
|
|
|
1
|
-
import '../../dom-qGGG2YCX-4d4cca6e.js';
|
|
2
|
-
import { t as te, a as re } from '../../useValidationAttributes-BLzi0C4L-6839e2c2.js';
|
|
3
|
-
import { defineComponent, toRef, ref, nextTick } from 'vue-demi';
|
|
4
|
-
import { OrMenuItemV3 as OrMenuItem } from '../or-menu-item-v3/index.js';
|
|
5
|
-
import { OrIconV3 as OrIcon } from '../or-icon-v3/index.js';
|
|
6
|
-
import { OrMenuV3 as OrMenu } from '../or-menu-v3/index.js';
|
|
7
|
-
import { PopoverPlacement } from '../or-popover-v3/index.js';
|
|
8
|
-
import { n as normalizeComponent } from '../../normalize-component-cf2db48b.js';
|
|
9
|
-
import '@vueuse/core';
|
|
10
|
-
import '@onereach/styles/screens.json';
|
|
11
|
-
import '@onereach/styles/tailwind.config.json';
|
|
12
|
-
import '../or-icon-button-v3/index.js';
|
|
13
|
-
import '../../constants-2e3ea701.js';
|
|
14
|
-
import '../or-tooltip-v3/index.js';
|
|
15
|
-
import '@floating-ui/dom';
|
|
16
|
-
import '../../utils-72d9c2bb.js';
|
|
17
|
-
import '../or-bottom-sheet-v3/index.js';
|
|
18
|
-
import '../or-overlay-v3/index.js';
|
|
19
|
-
import '../or-teleport-v3/index.js';
|
|
20
|
-
import 'portal-vue';
|
|
21
|
-
|
|
22
|
-
var script = defineComponent({
|
|
23
|
-
name: 'OrSubMenuItem',
|
|
24
|
-
components: {
|
|
25
|
-
OrMenuItem,
|
|
26
|
-
OrIcon,
|
|
27
|
-
OrMenu
|
|
28
|
-
},
|
|
29
|
-
props: {
|
|
30
|
-
icon: {
|
|
31
|
-
type: [String, Object],
|
|
32
|
-
default: undefined
|
|
33
|
-
},
|
|
34
|
-
selected: {
|
|
35
|
-
type: Boolean,
|
|
36
|
-
default: false
|
|
37
|
-
},
|
|
38
|
-
disabled: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: false
|
|
41
|
-
},
|
|
42
|
-
placement: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: () => PopoverPlacement.RightStart
|
|
45
|
-
},
|
|
46
|
-
tooltipText: {
|
|
47
|
-
type: String,
|
|
48
|
-
default: ''
|
|
49
|
-
}
|
|
50
|
-
},
|
|
51
|
-
emits: ['open', 'close', 'update:state', 'click', 'focus', 'blur'],
|
|
52
|
-
expose: ['root'],
|
|
53
|
-
setup(props, context) {
|
|
54
|
-
const {
|
|
55
|
-
state,
|
|
56
|
-
open,
|
|
57
|
-
close
|
|
58
|
-
} = te(toRef(props, 'selected'), context.emit);
|
|
59
|
-
const {
|
|
60
|
-
isMobile
|
|
61
|
-
} = re();
|
|
62
|
-
const root = ref(null);
|
|
63
|
-
const menu = ref(null);
|
|
64
|
-
const capturedContent = ref(null);
|
|
65
|
-
function handleMouseLeaveSubMenuItem(event) {
|
|
66
|
-
nextTick(() => {
|
|
67
|
-
var _a, _b;
|
|
68
|
-
if (!((_b = (_a = menu.value) === null || _a === void 0 ? void 0 : _a.root) === null || _b === void 0 ? void 0 : _b.contains(event.relatedTarget))) {
|
|
69
|
-
close();
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
function handleMouseLeaveMenu(event) {
|
|
74
|
-
const relatedTarget = event.relatedTarget;
|
|
75
|
-
capturePopoverContent();
|
|
76
|
-
nextTick(() => {
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
nextTick(() => {
|
|
79
|
-
var _a;
|
|
80
|
-
if (relatedTarget instanceof HTMLElement) {
|
|
81
|
-
const relatedTargetHtml = (relatedTarget === null || relatedTarget === void 0 ? void 0 : relatedTarget.outerHTML) || '';
|
|
82
|
-
const isInsideCapturedContent = (_a = capturedContent.value) === null || _a === void 0 ? void 0 : _a.includes(relatedTargetHtml);
|
|
83
|
-
if (!isInsideCapturedContent) {
|
|
84
|
-
close();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
function handleMouseEnterSubMenuItem() {
|
|
92
|
-
if (isMobile.value) return;
|
|
93
|
-
open();
|
|
94
|
-
capturePopoverContent();
|
|
95
|
-
}
|
|
96
|
-
function handleClickMenu() {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
const event = new MouseEvent('click', {
|
|
99
|
-
bubbles: true,
|
|
100
|
-
cancelable: true,
|
|
101
|
-
view: window
|
|
102
|
-
});
|
|
103
|
-
event.isSimulated = true;
|
|
104
|
-
(_b = (_a = root.value) === null || _a === void 0 ? void 0 : _a.root) === null || _b === void 0 ? void 0 : _b.dispatchEvent(event);
|
|
105
|
-
}
|
|
106
|
-
function handleClickOnTrigger(event) {
|
|
107
|
-
var _a;
|
|
108
|
-
if (isMobile.value) {
|
|
109
|
-
event.stopPropagation();
|
|
110
|
-
open();
|
|
111
|
-
} else {
|
|
112
|
-
if (event.isSimulated) {
|
|
113
|
-
return;
|
|
114
|
-
}
|
|
115
|
-
if (event.currentTarget === ((_a = root.value) === null || _a === void 0 ? void 0 : _a.root)) {
|
|
116
|
-
event.stopPropagation();
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
function capturePopoverContent() {
|
|
121
|
-
nextTick(() => setTimeout(() => {
|
|
122
|
-
var _a;
|
|
123
|
-
if ((_a = menu.value) === null || _a === void 0 ? void 0 : _a.root) {
|
|
124
|
-
capturedContent.value = menu.value.root.innerHTML;
|
|
125
|
-
}
|
|
126
|
-
}));
|
|
127
|
-
}
|
|
128
|
-
return {
|
|
129
|
-
root,
|
|
130
|
-
menu,
|
|
131
|
-
open,
|
|
132
|
-
close,
|
|
133
|
-
state,
|
|
134
|
-
handleMouseLeaveMenu,
|
|
135
|
-
handleMouseLeaveSubMenuItem,
|
|
136
|
-
handleMouseEnterSubMenuItem,
|
|
137
|
-
handleClickMenu,
|
|
138
|
-
handleClickOnTrigger,
|
|
139
|
-
capturedContent
|
|
140
|
-
};
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
|
|
144
|
-
/* script */
|
|
145
|
-
const __vue_script__ = script;
|
|
146
|
-
|
|
147
|
-
/* template */
|
|
148
|
-
var __vue_render__ = function () {
|
|
149
|
-
var _vm = this;
|
|
150
|
-
var _h = _vm.$createElement;
|
|
151
|
-
var _c = _vm._self._c || _h;
|
|
152
|
-
return _c('OrMenuItem', {
|
|
153
|
-
ref: "root",
|
|
154
|
-
staticClass: "or-sub-menu-item-v3",
|
|
155
|
-
attrs: {
|
|
156
|
-
"icon": _vm.icon,
|
|
157
|
-
"selected": _vm.selected || _vm.state === 'open',
|
|
158
|
-
"disabled": _vm.disabled,
|
|
159
|
-
"tooltip-text": _vm.tooltipText
|
|
160
|
-
},
|
|
161
|
-
on: {
|
|
162
|
-
"click": _vm.handleClickOnTrigger,
|
|
163
|
-
"mouseenter": _vm.handleMouseEnterSubMenuItem,
|
|
164
|
-
"mouseleave": _vm.handleMouseLeaveSubMenuItem
|
|
165
|
-
},
|
|
166
|
-
scopedSlots: _vm._u([{
|
|
167
|
-
key: "append",
|
|
168
|
-
fn: function () {
|
|
169
|
-
return [_c('OrIcon', {
|
|
170
|
-
attrs: {
|
|
171
|
-
"icon": "arrow_right"
|
|
172
|
-
}
|
|
173
|
-
})];
|
|
174
|
-
},
|
|
175
|
-
proxy: true
|
|
176
|
-
}])
|
|
177
|
-
}, [_vm._t("default"), _vm._v(" "), _vm._v(" "), _c('OrMenu', {
|
|
178
|
-
ref: "menu",
|
|
179
|
-
attrs: {
|
|
180
|
-
"is-open": _vm.state === 'open',
|
|
181
|
-
"trigger": _vm.root && _vm.root.root,
|
|
182
|
-
"placement": _vm.placement,
|
|
183
|
-
"offset": 0
|
|
184
|
-
},
|
|
185
|
-
on: {
|
|
186
|
-
"mouseleave": _vm.handleMouseLeaveMenu,
|
|
187
|
-
"click": _vm.handleClickMenu
|
|
188
|
-
}
|
|
189
|
-
}, [_vm._t("items")], 2), _vm._v(" "), _vm.capturedContent ? _c('div', {
|
|
190
|
-
staticClass: "hidden",
|
|
191
|
-
domProps: {
|
|
192
|
-
"innerHTML": _vm._s(_vm.capturedContent)
|
|
193
|
-
}
|
|
194
|
-
}) : _vm._e()], 2);
|
|
195
|
-
};
|
|
196
|
-
var __vue_staticRenderFns__ = [];
|
|
197
|
-
|
|
198
|
-
/* style */
|
|
199
|
-
const __vue_inject_styles__ = undefined;
|
|
200
|
-
/* scoped */
|
|
201
|
-
const __vue_scope_id__ = undefined;
|
|
202
|
-
/* module identifier */
|
|
203
|
-
const __vue_module_identifier__ = undefined;
|
|
204
|
-
/* functional template */
|
|
205
|
-
const __vue_is_functional_template__ = false;
|
|
206
|
-
/* style inject */
|
|
207
|
-
|
|
208
|
-
/* style inject SSR */
|
|
209
|
-
|
|
210
|
-
/* style inject shadow dom */
|
|
211
|
-
|
|
212
|
-
const __vue_component__ = /*#__PURE__*/normalizeComponent({
|
|
213
|
-
render: __vue_render__,
|
|
214
|
-
staticRenderFns: __vue_staticRenderFns__
|
|
215
|
-
}, __vue_inject_styles__, __vue_script__, __vue_scope_id__, __vue_is_functional_template__, __vue_module_identifier__, false, undefined, undefined, undefined);
|
|
216
|
-
var __vue_component__$1 = __vue_component__;
|
|
217
|
-
|
|
218
|
-
export { __vue_component__$1 as OrSubMenuItemV3 };
|