@onereach/ui-components 8.16.3-beta.3862.0 → 8.16.3
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/bundled/v2/components/OrRichTextEditorV3/OrRichTextEditor.js +5 -5
- package/dist/bundled/v2/components/OrSearchV3/OrSearch.js +19 -37
- package/dist/bundled/v2/components/OrSearchV3/OrSearch.vue.d.ts +4 -6
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/props.js +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/props.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorNode.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/codemirrorView.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/codemirror/theme.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/utils/markdown.js +1 -1
- package/dist/bundled/v3/components/{OrRichTextEditorV3-5265594a.js → OrRichTextEditorV3-6d7b206f.js} +5 -5
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.vue.d.ts +4 -5
- package/dist/bundled/v3/components/OrSearchV3/index.js +22 -40
- package/dist/bundled/v3/components/index.js +2 -2
- package/dist/bundled/v3/index.js +2 -2
- package/dist/esm/v2/{OrCardCollection-f2870c25.js → OrCardCollection-e7c0c61d.js} +1 -1
- package/dist/esm/v2/{OrRichTextEditor-f05d2e66.js → OrRichTextEditor-7466a45d.js} +5 -5
- package/dist/esm/v2/{OrSearch-2910207c.js → OrSearch-de2423bc.js} +21 -39
- package/dist/esm/v2/components/index.js +3 -3
- package/dist/esm/v2/components/or-card-collection-v3/index.js +3 -3
- package/dist/esm/v2/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v2/components/or-search-v3/OrSearch.vue.d.ts +4 -6
- package/dist/esm/v2/components/or-search-v3/index.js +3 -3
- package/dist/esm/v2/index.js +3 -3
- package/dist/esm/v3/{OrCardCollection-fc6fd56c.js → OrCardCollection-ce6c8201.js} +1 -1
- package/dist/esm/v3/{OrRichTextEditor-cfa0b54a.js → OrRichTextEditor-d9182fa2.js} +5 -5
- package/dist/esm/v3/{OrSearch-fccacdba.js → OrSearch-9c6f1e16.js} +24 -42
- package/dist/esm/v3/components/index.js +3 -3
- package/dist/esm/v3/components/or-card-collection-v3/index.js +3 -3
- package/dist/esm/v3/components/or-rich-text-editor-v3/index.js +1 -1
- package/dist/esm/v3/components/or-search-v3/OrSearch.vue.d.ts +4 -5
- package/dist/esm/v3/components/or-search-v3/index.js +3 -3
- package/dist/esm/v3/index.js +3 -3
- package/package.json +3 -2
- package/src/components/or-rich-text-editor-v3/OrRichTextEditor.vue +5 -5
- package/src/components/or-search-v3/OrSearch.vue +19 -46
- package/src/hooks/useProxyModelValue.ts +1 -1
- /package/dist/bundled/v3/components/{OrCardCollectionV3-dfd98c34.js → OrCardCollectionV3-6b1266a6.js} +0 -0
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
ref="toolbarButtonRef"
|
|
31
31
|
:selected="isActive[item]"
|
|
32
32
|
:disabled="!isFocused"
|
|
33
|
-
:tooltip="{
|
|
33
|
+
:tooltip="{content: item, placement: 'top'}"
|
|
34
34
|
:icon="{icon: headingIcon, variant: 'inherit', size: 'm'}"
|
|
35
35
|
@click="menuRef.open()"
|
|
36
36
|
/>
|
|
37
37
|
<or-icon-button
|
|
38
38
|
v-else-if="isVisible(item)"
|
|
39
|
-
:tooltip="{
|
|
39
|
+
:tooltip="{content: iconTooltipsEnum[item], placement: 'top'}"
|
|
40
40
|
:selected="isActive[item]"
|
|
41
41
|
:disabled="!isFocused"
|
|
42
42
|
:icon="{icon: iconsEnum[item], variant: 'inherit', size: 'm'}"
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
<or-popover
|
|
75
75
|
v-if="moreButtonRef"
|
|
76
76
|
ref="moreRef"
|
|
77
|
-
:trigger="moreButtonRef.root"
|
|
77
|
+
:trigger="moreButtonRef && moreButtonRef.root"
|
|
78
78
|
placement="top-end"
|
|
79
79
|
>
|
|
80
80
|
<div class="flex p-sm gap-md bg-on-primary">
|
|
81
81
|
<or-icon-button
|
|
82
82
|
v-for="item in notVisibleTools"
|
|
83
83
|
:key="item"
|
|
84
|
-
:tooltip="{
|
|
84
|
+
:tooltip="{content: iconTooltipsEnum[item], placement: 'top'}"
|
|
85
85
|
:selected="isActive[item]"
|
|
86
86
|
:icon="{icon: iconsEnum[item], variant: 'inherit', size: 'm'}"
|
|
87
87
|
@click="handleToolbarClick(item)"
|
|
@@ -91,7 +91,7 @@
|
|
|
91
91
|
<or-menu
|
|
92
92
|
v-if="toolbarButtonRef"
|
|
93
93
|
ref="menuRef"
|
|
94
|
-
:trigger="toolbarButtonRef[getIndexOfHeading].root"
|
|
94
|
+
:trigger="toolbarButtonRef[getIndexOfHeading] && toolbarButtonRef[getIndexOfHeading].root"
|
|
95
95
|
placement="bottom-start"
|
|
96
96
|
class="bg-on-primary"
|
|
97
97
|
>
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<OrInput
|
|
3
3
|
ref="root"
|
|
4
|
-
v-model.trim="
|
|
5
|
-
v-bind="controlAttributes"
|
|
4
|
+
v-model.trim="localModelValue"
|
|
6
5
|
:class="rootStyles"
|
|
7
6
|
:type="'search'"
|
|
8
7
|
:size="size"
|
|
9
8
|
:placeholder="placeholder"
|
|
9
|
+
:debounce="debounce"
|
|
10
10
|
:disable-default-styles="disableDefaultStyles"
|
|
11
|
+
v-bind="controlAttributes"
|
|
11
12
|
@input="$emit('input', $event)"
|
|
12
13
|
@keydown="$emit('keydown', $event)"
|
|
13
14
|
@keyup="$emit('keyup', $event)"
|
|
@@ -17,11 +18,11 @@
|
|
|
17
18
|
</template>
|
|
18
19
|
|
|
19
20
|
<script lang="ts">
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import { useControlAttributes, useIdAttribute, useProxyModelValue, useValidationAttributes } from '../../hooks';
|
|
21
|
+
import { debouncedWatch } from '@vueuse/core';
|
|
22
|
+
import { computed, defineComponent, PropType, reactive, ref, watch } from 'vue-demi';
|
|
23
23
|
import { OrInputV3 as OrInput } from '../or-input-v3';
|
|
24
24
|
import { SearchSize } from './props';
|
|
25
|
+
import { useControlAttributes, useIdAttribute, useValidationAttributes } from '../../hooks';
|
|
25
26
|
|
|
26
27
|
export default defineComponent({
|
|
27
28
|
name: 'OrSearch',
|
|
@@ -30,15 +31,11 @@ export default defineComponent({
|
|
|
30
31
|
OrInput,
|
|
31
32
|
},
|
|
32
33
|
|
|
33
|
-
model: {
|
|
34
|
-
prop: 'modelValue',
|
|
35
|
-
event: 'update:modelValue',
|
|
36
|
-
},
|
|
37
|
-
|
|
38
34
|
props: {
|
|
39
35
|
modelValue: {
|
|
40
36
|
type: String,
|
|
41
37
|
default: '',
|
|
38
|
+
required: false,
|
|
42
39
|
},
|
|
43
40
|
|
|
44
41
|
size: {
|
|
@@ -63,23 +60,18 @@ export default defineComponent({
|
|
|
63
60
|
},
|
|
64
61
|
|
|
65
62
|
emits: [
|
|
66
|
-
'
|
|
67
|
-
|
|
63
|
+
'search',
|
|
68
64
|
'input',
|
|
69
65
|
'keydown',
|
|
70
66
|
'keyup',
|
|
71
67
|
'focus',
|
|
72
68
|
'blur',
|
|
73
|
-
|
|
74
|
-
'search',
|
|
75
69
|
'clear',
|
|
76
70
|
],
|
|
77
71
|
|
|
78
72
|
expose: [
|
|
79
73
|
'root',
|
|
80
|
-
|
|
81
74
|
'focus',
|
|
82
|
-
'blur',
|
|
83
75
|
'clear',
|
|
84
76
|
],
|
|
85
77
|
|
|
@@ -93,33 +85,22 @@ export default defineComponent({
|
|
|
93
85
|
]);
|
|
94
86
|
|
|
95
87
|
// State
|
|
88
|
+
const localModelValue = ref(props.modelValue ?? '');
|
|
96
89
|
const controlAttributes = reactive({
|
|
97
90
|
id: useIdAttribute(),
|
|
98
91
|
...useControlAttributes(),
|
|
99
92
|
...useValidationAttributes(),
|
|
100
93
|
});
|
|
101
94
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
watchDebounced(draftModelValue, (value) => {
|
|
110
|
-
if (value.length > 0) {
|
|
111
|
-
proxyModelValue.value = value;
|
|
112
|
-
|
|
113
|
-
context.emit('search', value);
|
|
114
|
-
}
|
|
115
|
-
}, {
|
|
116
|
-
debounce: toRef(props, 'debounce'),
|
|
117
|
-
});
|
|
118
|
-
|
|
119
|
-
watch(draftModelValue, (nextValue, prevValue) => {
|
|
120
|
-
if (nextValue.length === 0 && prevValue.length > 0) {
|
|
121
|
-
proxyModelValue.value = nextValue;
|
|
95
|
+
// Events
|
|
96
|
+
debouncedWatch(
|
|
97
|
+
localModelValue,
|
|
98
|
+
() => localModelValue.value.length > 0 && context.emit('search', localModelValue.value),
|
|
99
|
+
{ debounce: props.debounce },
|
|
100
|
+
);
|
|
122
101
|
|
|
102
|
+
watch(localModelValue, (val, beforeVal) => {
|
|
103
|
+
if (val.length === 0 && beforeVal.length > 0) {
|
|
123
104
|
context.emit('search', '');
|
|
124
105
|
context.emit('clear');
|
|
125
106
|
}
|
|
@@ -130,24 +111,16 @@ export default defineComponent({
|
|
|
130
111
|
(root.value as { focus: () => void; } | undefined)?.focus(); // fixes error TS2349
|
|
131
112
|
}
|
|
132
113
|
|
|
133
|
-
function blur(): void {
|
|
134
|
-
(root.value as { blur: () => void; } | undefined)?.blur(); // fixes error TS2349
|
|
135
|
-
}
|
|
136
|
-
|
|
137
114
|
function clear(): void {
|
|
138
|
-
|
|
115
|
+
localModelValue.value = '';
|
|
139
116
|
}
|
|
140
117
|
|
|
141
118
|
return {
|
|
142
119
|
root,
|
|
143
120
|
rootStyles,
|
|
144
|
-
|
|
121
|
+
localModelValue,
|
|
145
122
|
controlAttributes,
|
|
146
|
-
proxyModelValue,
|
|
147
|
-
draftModelValue,
|
|
148
|
-
|
|
149
123
|
focus,
|
|
150
|
-
blur,
|
|
151
124
|
clear,
|
|
152
125
|
};
|
|
153
126
|
},
|
|
File without changes
|