@onereach/ui-components 8.16.4 → 8.16.5-beta.3872.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/bundled/v2/components/OrTagInputV3/OrTagInput.js +31 -15
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +3 -0
- package/dist/bundled/v2/components/OrTagsV3/OrTags.js +3 -3
- package/dist/bundled/v2/components/OrTagsV3/types.d.ts +5 -4
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrSelectV3-f212f5c6.js → OrSelectV3-e0de09af.js} +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +2 -0
- package/dist/bundled/v3/components/OrTagInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrTagInputV3-7b240c91.js → OrTagInputV3-e1596983.js} +23 -11
- package/dist/bundled/v3/components/OrTagV3/OrTag.js +1 -1
- package/dist/bundled/v3/components/OrTagV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagV3/props.js +1 -1
- package/dist/bundled/v3/components/OrTagV3/styles.js +1 -1
- package/dist/bundled/v3/components/{OrTagV3-43ee9066.js → OrTagV3-045cac0b.js} +1 -1
- package/dist/bundled/v3/components/OrTagsV3/OrTags.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/props.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/types.d.ts +5 -4
- package/dist/bundled/v3/components/OrTagsV3/utils/castToTag.js +1 -1
- package/dist/bundled/v3/components/{OrTagsV3-bbda3acd.js → OrTagsV3-6c4fb22c.js} +10 -4
- package/dist/bundled/v3/components/index.js +4 -4
- package/dist/bundled/v3/index.js +5 -5
- package/dist/esm/v2/{OrSelect-30f5ce68.js → OrSelect-4768c12b.js} +2 -2
- package/dist/esm/v2/{OrSelectMultipleControl-de32c83c.js → OrSelectMultipleControl-685d5af4.js} +1 -1
- package/dist/esm/v2/{OrTagInput-2642f4d9.js → OrTagInput-c4110c0b.js} +32 -16
- package/dist/esm/v2/{OrTags-9d3cf104.js → OrTags-f6434f9b.js} +3 -3
- package/dist/esm/v2/components/index.js +4 -4
- package/dist/esm/v2/components/or-select-v3/index.js +3 -3
- package/dist/esm/v2/components/or-select-v3/partials/index.js +2 -2
- package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/index.js +2 -2
- package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +3 -0
- package/dist/esm/v2/components/or-tag-input-v3/index.js +4 -4
- package/dist/esm/v2/components/or-tags-v3/index.js +1 -1
- package/dist/esm/v2/components/or-tags-v3/types.d.ts +5 -4
- package/dist/esm/v2/index.js +4 -4
- package/dist/esm/v3/{OrSelect-a65c0b08.js → OrSelect-5a22c1da.js} +2 -2
- package/dist/esm/v3/{OrSelectMultipleControl-96320988.js → OrSelectMultipleControl-6b5a831d.js} +1 -1
- package/dist/esm/v3/{OrTagInput-4cec4018.js → OrTagInput-6e9c7a94.js} +23 -11
- package/dist/esm/v3/{OrTags-384a48e3.js → OrTags-801c20ad.js} +9 -3
- package/dist/esm/v3/components/index.js +4 -4
- package/dist/esm/v3/components/or-select-v3/index.js +3 -3
- package/dist/esm/v3/components/or-select-v3/partials/index.js +2 -2
- package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/index.js +2 -2
- package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +2 -0
- package/dist/esm/v3/components/or-tag-input-v3/index.js +4 -4
- package/dist/esm/v3/components/or-tags-v3/index.js +1 -1
- package/dist/esm/v3/components/or-tags-v3/types.d.ts +5 -4
- package/dist/esm/v3/index.js +4 -4
- package/package.json +2 -3
- package/src/components/or-tag-input-v3/OrTagInput.vue +23 -12
- package/src/components/or-tags-v3/OrTags.vue +5 -3
- package/src/components/or-tags-v3/types.ts +7 -4
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export type Tag =
|
|
3
|
-
export
|
|
1
|
+
import { OrTag } from '../or-tag';
|
|
2
|
+
export type Tag = string | TagObject;
|
|
3
|
+
export type TagObject = {
|
|
4
4
|
label: string;
|
|
5
5
|
value: string | number | object;
|
|
6
|
-
|
|
6
|
+
tagProps?: InstanceType<typeof OrTag>['$props'];
|
|
7
|
+
};
|
package/dist/esm/v3/index.js
CHANGED
|
@@ -98,7 +98,7 @@ export { s as OrSearch } from './OrSearch-aa57d4e8.js';
|
|
|
98
98
|
export { s as OrSearchV3 } from './OrSearch-fccacdba.js';
|
|
99
99
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-adbf7f4e.js';
|
|
100
100
|
export { s as OrSelect } from './OrSelect-a366e668.js';
|
|
101
|
-
export { s as OrSelectV3 } from './OrSelect-
|
|
101
|
+
export { s as OrSelectV3 } from './OrSelect-5a22c1da.js';
|
|
102
102
|
export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-4ab42b93.js';
|
|
103
103
|
export { S as OrSidebarPlacement, s as OrSidebarV3, S as SidebarPlacement } from './OrSidebar-62009372.js';
|
|
104
104
|
export { s as OrSkeletonCircle } from './OrSkeletonCircle-66e175a0.js';
|
|
@@ -120,9 +120,9 @@ export { s as OrTabV3 } from './OrTab-42be32d1.js';
|
|
|
120
120
|
export { s as OrTabs } from './OrTabs-3da3ea89.js';
|
|
121
121
|
export { s as OrTabsV3, T as TabsVariant } from './OrTabs-e53980aa.js';
|
|
122
122
|
export { s as OrTag } from './OrTag-bc8177a4.js';
|
|
123
|
-
export { s as OrTagInputV3 } from './OrTagInput-
|
|
123
|
+
export { s as OrTagInputV3 } from './OrTagInput-6e9c7a94.js';
|
|
124
124
|
export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-ccb7734c.js';
|
|
125
|
-
export { s as OrTagsV3, T as TagsOverflow } from './OrTags-
|
|
125
|
+
export { s as OrTagsV3, T as TagsOverflow } from './OrTags-801c20ad.js';
|
|
126
126
|
export { s as OrTeleport } from './OrTeleport.vue3-9bce0c02.js';
|
|
127
127
|
export { s as OrTeleportV3 } from './OrTeleport.vue3-bf77eed4.js';
|
|
128
128
|
export { s as OrTextV3 } from './OrText-d54c951d.js';
|
|
@@ -201,7 +201,7 @@ import './codemirrorView-020fe885.js';
|
|
|
201
201
|
import 'prosemirror-state';
|
|
202
202
|
import 'prosemirror-commands';
|
|
203
203
|
import 'lodash/keyBy';
|
|
204
|
-
import './OrSelectMultipleControl-
|
|
204
|
+
import './OrSelectMultipleControl-6b5a831d.js';
|
|
205
205
|
import './OrSelectPlaceholder-10e3bf5e.js';
|
|
206
206
|
import './OrSelectControlInput-3297e30d.js';
|
|
207
207
|
import './OrSelectSingleControl-5e78d499.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@onereach/ui-components",
|
|
3
|
-
"version": "8.16.
|
|
3
|
+
"version": "8.16.5-beta.3872.0",
|
|
4
4
|
"npmUnpacked": "4.15.2",
|
|
5
5
|
"description": "Vue components library for v2/3",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -176,6 +176,5 @@
|
|
|
176
176
|
"default": "./dist/bundled/v3/components/*/index.js"
|
|
177
177
|
},
|
|
178
178
|
"./package.json": "./package.json"
|
|
179
|
-
}
|
|
180
|
-
"gitHead": "7302352c135f6dcd05f25ecb3c646017ce025ad9"
|
|
179
|
+
}
|
|
181
180
|
}
|
|
@@ -20,24 +20,21 @@
|
|
|
20
20
|
|
|
21
21
|
<OrInputBox
|
|
22
22
|
ref="inputBox"
|
|
23
|
+
:class="['interactivity-select']"
|
|
23
24
|
:variant="disableDefaultStyles ? 'unstyled' : 'styled'"
|
|
24
|
-
:force-state="activated ? 'focus-within': undefined"
|
|
25
|
-
class="cursor-text"
|
|
26
25
|
:invalid="!!error"
|
|
27
26
|
:readonly="readonly"
|
|
28
27
|
:disabled="disabled"
|
|
29
|
-
tabindex="0"
|
|
28
|
+
:tabindex="0"
|
|
29
|
+
:force-state="activated ? 'focus-within': undefined"
|
|
30
30
|
@focus="activate"
|
|
31
31
|
>
|
|
32
32
|
<OrTags
|
|
33
33
|
ref="tags"
|
|
34
|
-
:
|
|
35
|
-
|
|
34
|
+
:class="['grow']"
|
|
35
|
+
:items="tagsItems"
|
|
36
36
|
:disabled="disabled"
|
|
37
|
-
:tag-props="{
|
|
38
|
-
variant: readonly || disabled ? 'tag' : 'reset',
|
|
39
|
-
disabled: disabled
|
|
40
|
-
}"
|
|
37
|
+
:tag-props="{ variant: readonly || disabled ? 'tag' : 'reset', disabled }"
|
|
41
38
|
:overflow="overflow"
|
|
42
39
|
@reset="remove($event)"
|
|
43
40
|
>
|
|
@@ -48,7 +45,7 @@
|
|
|
48
45
|
<div class="inline-flex w-fit max-w-full">
|
|
49
46
|
<input
|
|
50
47
|
ref="control"
|
|
51
|
-
v-model="draftModelValue"
|
|
48
|
+
v-model.trim="draftModelValue"
|
|
52
49
|
v-bind="controlAttributes"
|
|
53
50
|
:class="controlStyles"
|
|
54
51
|
:style="controlInlineStyles"
|
|
@@ -120,15 +117,17 @@
|
|
|
120
117
|
</template>
|
|
121
118
|
|
|
122
119
|
<script lang="ts">
|
|
123
|
-
import { PropType, computed, defineComponent, reactive, ref, toRefs, nextTick, watch } from 'vue-demi';
|
|
124
120
|
import { MaybeElementRef, onClickOutside } from '@vueuse/core';
|
|
121
|
+
import { PropType, computed, defineComponent, nextTick, reactive, ref, toRefs, watch } from 'vue-demi';
|
|
125
122
|
import { useControlAttributes, useIdAttribute, useProxyModelValue, useValidationAttributes } from '../../hooks';
|
|
126
123
|
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
127
124
|
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
128
125
|
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
129
126
|
import { OrInputBoxV3 as OrInputBox } from '../or-input-box-v3';
|
|
130
127
|
import { OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
128
|
+
import { TagColor } from '../or-tag-v3';
|
|
131
129
|
import { OrTagsV3 as OrTags, TagsOverflow } from '../or-tags-v3';
|
|
130
|
+
import { TagObject } from '../or-tags-v3/types';
|
|
132
131
|
import { TagInput, TagInputControl, TagInputItem } from './styles';
|
|
133
132
|
|
|
134
133
|
export default defineComponent({
|
|
@@ -256,6 +255,17 @@ export default defineComponent({
|
|
|
256
255
|
const proxyModelValue = useProxyModelValue(modelValue, context.emit);
|
|
257
256
|
const draftModelValue = ref<string>('');
|
|
258
257
|
|
|
258
|
+
const tagsItems = computed(() => {
|
|
259
|
+
return proxyModelValue.value.map((item) => ({
|
|
260
|
+
label: item,
|
|
261
|
+
value: item,
|
|
262
|
+
|
|
263
|
+
tagProps: {
|
|
264
|
+
color: item === draftModelValue.value ? TagColor.Danger : TagColor.Default,
|
|
265
|
+
},
|
|
266
|
+
} as TagObject));
|
|
267
|
+
});
|
|
268
|
+
|
|
259
269
|
const currentLength = computed(() => proxyModelValue.value?.length ?? 0);
|
|
260
270
|
const maxLength = computed(() => controlAttributes.maxlength);
|
|
261
271
|
|
|
@@ -299,7 +309,7 @@ export default defineComponent({
|
|
|
299
309
|
}
|
|
300
310
|
|
|
301
311
|
function add(): void {
|
|
302
|
-
const newItem = draftModelValue.value
|
|
312
|
+
const newItem = draftModelValue.value;
|
|
303
313
|
|
|
304
314
|
if (!newItem) return;
|
|
305
315
|
if (proxyModelValue.value.includes(newItem)) return;
|
|
@@ -343,6 +353,7 @@ export default defineComponent({
|
|
|
343
353
|
controlAttributes,
|
|
344
354
|
proxyModelValue,
|
|
345
355
|
draftModelValue,
|
|
356
|
+
tagsItems,
|
|
346
357
|
currentLength,
|
|
347
358
|
maxLength,
|
|
348
359
|
activated,
|
|
@@ -10,13 +10,14 @@
|
|
|
10
10
|
>
|
|
11
11
|
<OrTag
|
|
12
12
|
v-for="item in localItems"
|
|
13
|
-
v-bind="tagProps"
|
|
13
|
+
v-bind="{ ...tagProps, ...item.tagProps }"
|
|
14
14
|
:key="item.value"
|
|
15
|
-
class="max-w-full"
|
|
15
|
+
:class="['max-w-full']"
|
|
16
16
|
@reset="$emit('reset', item.value)"
|
|
17
17
|
>
|
|
18
18
|
{{ item.label }}
|
|
19
19
|
</OrTag>
|
|
20
|
+
|
|
20
21
|
<slot
|
|
21
22
|
v-if="localOverflow === 'wrap'"
|
|
22
23
|
name="tail"
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
<div :class="overflowPopoverStyles">
|
|
46
47
|
<OrTag
|
|
47
48
|
v-for="item in overflowItems"
|
|
48
|
-
v-bind="tagProps"
|
|
49
|
+
v-bind="{ ...tagProps, ...item.tagProps }"
|
|
49
50
|
:key="item.value"
|
|
50
51
|
@reset="$emit('reset', item.value)"
|
|
51
52
|
>
|
|
@@ -54,6 +55,7 @@
|
|
|
54
55
|
</div>
|
|
55
56
|
</OrPopover>
|
|
56
57
|
</template>
|
|
58
|
+
|
|
57
59
|
<slot
|
|
58
60
|
v-if="localOverflow != 'wrap' || items.length === 0"
|
|
59
61
|
name="tail"
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
1
|
+
import { OrTag } from '../or-tag';
|
|
2
|
+
|
|
3
|
+
export type Tag = string | TagObject;
|
|
4
|
+
|
|
5
|
+
export type TagObject = {
|
|
4
6
|
label: string;
|
|
5
7
|
value: string | number | object;
|
|
6
|
-
|
|
8
|
+
tagProps?: InstanceType<typeof OrTag>['$props'];
|
|
9
|
+
};
|