@onereach/ui-components-vue2 21.4.0 → 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.
|
@@ -13,13 +13,13 @@ import { useResizeObserver, useDebounceFn, onClickOutside } from '@vueuse/core';
|
|
|
13
13
|
import { useFocusTrap } from '@vueuse/integrations/useFocusTrap';
|
|
14
14
|
import { defineComponent, shallowRef, ref, onMounted, onBeforeUnmount, computed, watch, nextTick } from 'vue-demi';
|
|
15
15
|
import { aa as c } from '../../utils-72d9c2bb.js';
|
|
16
|
+
import { u as ue, n as ne } from '../../useValidationAttributes-BpeWsfb0-24439d6f.js';
|
|
16
17
|
import { TextSelection, Selection } from 'prosemirror-state';
|
|
17
18
|
import { exitCode } from 'prosemirror-commands';
|
|
18
19
|
import { EditorState } from '@codemirror/state';
|
|
19
20
|
import { EditorView, highlightActiveLine, highlightActiveLineGutter, lineNumbers, keymap } from '@codemirror/view';
|
|
20
21
|
import { HighlightStyle, syntaxHighlighting } from '@codemirror/language';
|
|
21
22
|
import { tags } from '@lezer/highlight';
|
|
22
|
-
import { u as ue } from '../../useValidationAttributes-BpeWsfb0-24439d6f.js';
|
|
23
23
|
import { minimalSetup } from 'codemirror';
|
|
24
24
|
import { javascript } from '@codemirror/lang-javascript';
|
|
25
25
|
import { defaultMarkdownSerializer, MarkdownSerializer } from 'prosemirror-markdown';
|
|
@@ -110,6 +110,8 @@ const RichTextEditor = [
|
|
|
110
110
|
const RichTextEditorToolbar = [
|
|
111
111
|
// Layout
|
|
112
112
|
'layout-row',
|
|
113
|
+
// Overflow
|
|
114
|
+
'overflow-x-scroll md:overflow-x-hidden', 'scrollbar-hidden',
|
|
113
115
|
// Spacing
|
|
114
116
|
'px-0', 'py-sm',
|
|
115
117
|
// Theme
|
|
@@ -657,7 +659,7 @@ var script = defineComponent({
|
|
|
657
659
|
const textareaRef = ref();
|
|
658
660
|
const containerRef = ref();
|
|
659
661
|
const moreButtonRef = ref();
|
|
660
|
-
const
|
|
662
|
+
const morePopoverRef = ref();
|
|
661
663
|
const toolbarButtonRef = ref();
|
|
662
664
|
const menuRef = ref();
|
|
663
665
|
// isActive should be set with default values for all toolbar buttons, otherwise it will not work in vue2
|
|
@@ -687,6 +689,9 @@ var script = defineComponent({
|
|
|
687
689
|
const link = ref('');
|
|
688
690
|
const countOfNotVisibleTools = ref(0);
|
|
689
691
|
const sourceValue = ref('');
|
|
692
|
+
const {
|
|
693
|
+
isMobile
|
|
694
|
+
} = ne();
|
|
690
695
|
let trap = useFocusTrap(controlRef, {
|
|
691
696
|
fallbackFocus: '.container',
|
|
692
697
|
allowOutsideClick: true
|
|
@@ -855,9 +860,10 @@ var script = defineComponent({
|
|
|
855
860
|
activeHeadingLevel.value = ((_c = (_b = editor.value) === null || _b === void 0 ? void 0 : _b.getAttributes('heading')) === null || _c === void 0 ? void 0 : _c.level) || 0;
|
|
856
861
|
};
|
|
857
862
|
const isVisible = value => {
|
|
863
|
+
if (isMobile.value) return true;
|
|
858
864
|
if (c(value)) {
|
|
859
865
|
const isHaveNotVisibleTools = value.some(item => notVisibleTools.value.has(item));
|
|
860
|
-
return isHaveNotVisibleTools;
|
|
866
|
+
return !isHaveNotVisibleTools;
|
|
861
867
|
}
|
|
862
868
|
return !notVisibleTools.value.has(value);
|
|
863
869
|
};
|
|
@@ -1014,7 +1020,7 @@ var script = defineComponent({
|
|
|
1014
1020
|
toolbarButtonRef,
|
|
1015
1021
|
moreButtonRef,
|
|
1016
1022
|
textareaRef,
|
|
1017
|
-
|
|
1023
|
+
morePopoverRef,
|
|
1018
1024
|
menuRef,
|
|
1019
1025
|
handleToolbarClick,
|
|
1020
1026
|
handleEditorClick,
|
|
@@ -1031,6 +1037,7 @@ var script = defineComponent({
|
|
|
1031
1037
|
link,
|
|
1032
1038
|
isFocused,
|
|
1033
1039
|
isVisible,
|
|
1040
|
+
isMobile,
|
|
1034
1041
|
countOfNotVisibleTools,
|
|
1035
1042
|
notVisibleTools,
|
|
1036
1043
|
handleInput,
|
|
@@ -1093,7 +1100,7 @@ var __vue_render__ = function () {
|
|
|
1093
1100
|
return _c('div', {
|
|
1094
1101
|
key: index,
|
|
1095
1102
|
class: _vm.toolbarGroupStyles.concat([{
|
|
1096
|
-
'hidden': _vm.isVisible(tools)
|
|
1103
|
+
'hidden': !_vm.isVisible(tools)
|
|
1097
1104
|
}]),
|
|
1098
1105
|
attrs: {
|
|
1099
1106
|
"disabled": _vm.disabled || !_vm.isFocused
|
|
@@ -1144,19 +1151,20 @@ var __vue_render__ = function () {
|
|
|
1144
1151
|
}
|
|
1145
1152
|
}) : _vm._e()], 1);
|
|
1146
1153
|
}), 0);
|
|
1147
|
-
}), _vm._v(" "), _vm.countOfNotVisibleTools > 0 ? _c('OrIconButton', {
|
|
1154
|
+
}), _vm._v(" "), _vm.countOfNotVisibleTools > 0 && !_vm.isMobile ? _c('OrIconButton', {
|
|
1148
1155
|
ref: 'moreButtonRef',
|
|
1149
|
-
class: ['
|
|
1156
|
+
class: ['mx-sm'],
|
|
1150
1157
|
attrs: {
|
|
1151
1158
|
"icon": {
|
|
1152
1159
|
icon: 'more_horiz',
|
|
1153
1160
|
variant: 'inherit'
|
|
1154
1161
|
},
|
|
1155
|
-
"disabled": _vm.disabled || !_vm.isFocused
|
|
1162
|
+
"disabled": _vm.disabled || !_vm.isFocused,
|
|
1163
|
+
"force-state": _vm.morePopoverRef && _vm.morePopoverRef.state === 'open' ? 'hover' : undefined
|
|
1156
1164
|
},
|
|
1157
1165
|
on: {
|
|
1158
1166
|
"click": function ($event) {
|
|
1159
|
-
_vm.
|
|
1167
|
+
_vm.morePopoverRef && _vm.morePopoverRef.open();
|
|
1160
1168
|
}
|
|
1161
1169
|
}
|
|
1162
1170
|
}) : _vm._e()], 2), _vm._v(" "), _c('div', {
|
|
@@ -1221,7 +1229,7 @@ var __vue_render__ = function () {
|
|
|
1221
1229
|
"disabled": _vm.disabled
|
|
1222
1230
|
}
|
|
1223
1231
|
}, [_vm._v("\n " + _vm._s(_vm.error) + "\n ")]), _vm._v(" "), _vm.moreButtonRef ? _c('OrPopover', {
|
|
1224
|
-
ref: '
|
|
1232
|
+
ref: 'morePopoverRef',
|
|
1225
1233
|
attrs: {
|
|
1226
1234
|
"trigger": _vm.moreButtonRef && _vm.moreButtonRef.root,
|
|
1227
1235
|
"placement": 'top-end'
|
|
@@ -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
|
-
|
|
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.
|
|
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.
|
|
44
|
-
"@onereach/ui-components-common": "^21.4.
|
|
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": "
|
|
108
|
+
"gitHead": "c1aa388b69aafd6d5d23479c8be7b0dfd38a0ff5"
|
|
109
109
|
}
|