@onereach/ui-components 4.7.4-beta.2870.0 → 4.7.4
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/OrCardCollectionV3/styles.js +6 -2
- package/dist/bundled/v2/components/OrInlineInputV3/styles.js +1 -1
- package/dist/bundled/v2/components/OrInlineTextareaV3/styles.js +1 -1
- package/dist/bundled/v2/components/OrInputBoxV3/styles.js +0 -2
- package/dist/bundled/v2/components/OrInputV3/styles.js +2 -2
- package/dist/bundled/v2/components/OrTagsV3/OrTags.js +2 -14
- package/dist/bundled/v2/components/OrTagsV3/OrTags.vue.d.ts +3 -7
- package/dist/bundled/v2/components/OrTagsV3/styles.js +0 -2
- package/dist/bundled/v2/components/OrTextareaV3/styles.js +1 -1
- package/dist/bundled/v2/components/index.d.ts +1 -2
- package/dist/bundled/v2/components/index.js +4 -6
- package/dist/bundled/v2/hooks/useTheme.js +0 -6
- package/dist/bundled/v2/index.js +6 -8
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-748fb337.js → OrCardCollection.vue_vue_type_script_lang-ec925f28.js} +1 -1
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-93458f1f.js → OrConfirm.vue_vue_type_script_lang-0f1a6320.js} +1 -1
- package/dist/bundled/v3/{OrDatePicker.vue_vue_type_script_lang-8ec017e2.js → OrDatePicker.vue_vue_type_script_lang-3f8700f9.js} +1 -1
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-fec947db.js → OrDateTimePicker.vue_vue_type_script_lang-ecd7cbd1.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-66363c62.js → OrInput.vue_vue_type_script_lang-a9fe34c8.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-18dc2df8.js → OrSearch.vue_vue_type_script_lang-8a82fdc6.js} +1 -1
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-359bac94.js → OrSelect.vue_vue_type_script_lang-ba73f458.js} +2 -2
- package/dist/bundled/v3/{OrTags.vue_vue_type_script_lang-45bbc68e.js → OrTags.vue_vue_type_script_lang-c14463c4.js} +0 -2
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-0d1a7a48.js → OrTextarea.vue_vue_type_script_lang-af284089.js} +1 -1
- package/dist/bundled/v3/{OrTimePicker.vue_vue_type_script_lang-c737eaa8.js → OrTimePicker.vue_vue_type_script_lang-845ec78b.js} +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +5 -5
- package/dist/bundled/v3/components/OrCardCollectionV3/index.js +4 -4
- package/dist/bundled/v3/components/OrCardCollectionV3/styles.js +6 -2
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +4 -4
- package/dist/bundled/v3/components/OrConfirmV3/index.js +3 -3
- package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.js +3 -3
- package/dist/bundled/v3/components/OrDatePickerV3/index.js +2 -2
- package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.js +3 -3
- package/dist/bundled/v3/components/OrDateTimePickerV3/index.js +2 -2
- package/dist/bundled/v3/components/OrInlineInputV3/OrInlineInput.js +2 -2
- package/dist/bundled/v3/components/OrInlineInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInlineInputV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrInlineTextareaV3/OrInlineTextarea.js +2 -2
- package/dist/bundled/v3/components/OrInlineTextareaV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInlineTextareaV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.js +2 -2
- package/dist/bundled/v3/components/OrInputBoxV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInputBoxV3/styles.js +0 -2
- package/dist/bundled/v3/components/OrInputV3/OrInput.js +3 -3
- package/dist/bundled/v3/components/OrInputV3/index.js +2 -2
- package/dist/bundled/v3/components/OrInputV3/styles.js +2 -2
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.js +4 -4
- package/dist/bundled/v3/components/OrSearchV3/index.js +3 -3
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +4 -4
- package/dist/bundled/v3/components/OrSelectV3/index.js +3 -3
- package/dist/bundled/v3/components/OrTagsV3/OrTags.js +6 -8
- package/dist/bundled/v3/components/OrTagsV3/OrTags.vue.d.ts +2 -7
- package/dist/bundled/v3/components/OrTagsV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/styles.js +0 -2
- package/dist/bundled/v3/components/OrTextareaV3/OrTextarea.js +3 -3
- package/dist/bundled/v3/components/OrTextareaV3/index.js +2 -2
- package/dist/bundled/v3/components/OrTextareaV3/styles.js +1 -1
- package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.js +3 -3
- package/dist/bundled/v3/components/OrTimePickerV3/index.js +2 -2
- package/dist/bundled/v3/components/index.d.ts +1 -2
- package/dist/bundled/v3/components/index.js +17 -20
- package/dist/bundled/v3/hooks/useTheme.js +0 -6
- package/dist/bundled/v3/index.js +19 -22
- package/dist/esm/v2/{OrCardCollection-bd173449.js → OrCardCollection-a9736f16.js} +8 -4
- package/dist/esm/v2/{OrCombinedInput-ed20e33b.js → OrCombinedInput-9c2b15fe.js} +1 -1
- package/dist/esm/v2/{OrConfirm-0b56c11f.js → OrConfirm-fc656b7e.js} +1 -1
- package/dist/esm/v2/{OrDatePicker-0989a40c.js → OrDatePicker-73c19c1c.js} +2 -2
- package/dist/esm/v2/{OrDateTimePicker-ac766f04.js → OrDateTimePicker-aff87aaa.js} +2 -2
- package/dist/esm/v2/{OrInlineInput-84a8398c.js → OrInlineInput-252510d7.js} +1 -1
- package/dist/esm/v2/{OrInlineTextarea-f2ecbd39.js → OrInlineTextarea-8df56c4d.js} +1 -1
- package/dist/esm/v2/{OrInput-2eeff16a.js → OrInput-39feafce.js} +4 -4
- package/dist/esm/v2/{OrInputBox-11227ecd.js → OrInputBox-7f3c0ee9.js} +1 -1
- package/dist/esm/v2/{OrInputBox.vue_rollup-plugin-vue_script-1715021a.js → OrInputBox.vue_rollup-plugin-vue_script-906b3ef8.js} +0 -2
- package/dist/esm/v2/{OrSearch-33e3b0e4.js → OrSearch-cbd7fd0b.js} +2 -2
- package/dist/esm/v2/{OrSelect-340ae8d0.js → OrSelect-1132c7dc.js} +3 -3
- package/dist/esm/v2/{OrTags-9048733c.js → OrTags-e80cd854.js} +2 -16
- package/dist/esm/v2/{OrTextarea-978fb518.js → OrTextarea-01df0715.js} +3 -3
- package/dist/esm/v2/{OrTimePicker-5fd08ad2.js → OrTimePicker-00b7319c.js} +2 -2
- package/dist/esm/v2/components/index.d.ts +1 -2
- package/dist/esm/v2/components/index.js +16 -17
- package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -5
- package/dist/esm/v2/components/or-combined-input-v3/index.js +2 -2
- package/dist/esm/v2/components/or-confirm-v3/index.js +4 -4
- package/dist/esm/v2/components/or-date-picker-v3/index.js +3 -3
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +3 -3
- package/dist/esm/v2/components/or-inline-input-v3/index.js +1 -1
- package/dist/esm/v2/components/or-inline-textarea-v3/index.js +1 -1
- package/dist/esm/v2/components/or-input-box-v3/index.js +2 -2
- package/dist/esm/v2/components/or-input-v3/index.js +3 -3
- package/dist/esm/v2/components/or-search-v3/index.js +4 -4
- package/dist/esm/v2/components/or-select-v3/index.js +4 -4
- package/dist/esm/v2/components/or-tags-v3/OrTags.vue.d.ts +3 -7
- package/dist/esm/v2/components/or-tags-v3/index.js +1 -1
- package/dist/esm/v2/components/or-textarea-v3/index.js +3 -3
- package/dist/esm/v2/components/or-time-picker-v3/index.js +3 -3
- package/dist/esm/v2/index.js +16 -17
- package/dist/esm/v3/{OrCardCollection-c5d5506c.js → OrCardCollection-8d41fafc.js} +8 -4
- package/dist/esm/v3/{OrCombinedInput-e3891038.js → OrCombinedInput-b5ba46a1.js} +1 -1
- package/dist/esm/v3/{OrConfirm-5509c440.js → OrConfirm-e8ee0b8f.js} +1 -1
- package/dist/esm/v3/{OrDatePicker-6ac8578a.js → OrDatePicker-19a07bb4.js} +1 -1
- package/dist/esm/v3/{OrDateTimePicker-b15d4198.js → OrDateTimePicker-219fa71d.js} +1 -1
- package/dist/esm/v3/{OrInlineInput-a6c33dc0.js → OrInlineInput-5d452b98.js} +1 -1
- package/dist/esm/v3/{OrInlineTextarea-f060dab5.js → OrInlineTextarea-1a769972.js} +1 -1
- package/dist/esm/v3/{OrInput-c653aedb.js → OrInput-a303f924.js} +3 -3
- package/dist/esm/v3/{OrInputBox-32b37b17.js → OrInputBox-32814878.js} +0 -2
- package/dist/esm/v3/{OrSearch-b945651d.js → OrSearch-c5ecb005.js} +2 -2
- package/dist/esm/v3/{OrSelect-a9be2490.js → OrSelect-9432ac4d.js} +2 -2
- package/dist/esm/v3/{OrTags-1621cbb9.js → OrTags-3f0ab56f.js} +4 -10
- package/dist/esm/v3/{OrTextarea-1e19417a.js → OrTextarea-0f9a2a27.js} +2 -2
- package/dist/esm/v3/{OrTimePicker-d66edf77.js → OrTimePicker-5cb9eb34.js} +1 -1
- package/dist/esm/v3/components/index.d.ts +1 -2
- package/dist/esm/v3/components/index.js +15 -16
- package/dist/esm/v3/components/or-card-collection-v3/index.js +4 -4
- package/dist/esm/v3/components/or-combined-input-v3/index.js +2 -2
- package/dist/esm/v3/components/or-confirm-v3/index.js +3 -3
- package/dist/esm/v3/components/or-date-picker-v3/index.js +2 -2
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +2 -2
- package/dist/esm/v3/components/or-inline-input-v3/index.js +1 -1
- package/dist/esm/v3/components/or-inline-textarea-v3/index.js +1 -1
- package/dist/esm/v3/components/or-input-box-v3/index.js +1 -1
- package/dist/esm/v3/components/or-input-v3/index.js +2 -2
- package/dist/esm/v3/components/or-search-v3/index.js +3 -3
- package/dist/esm/v3/components/or-select-v3/index.js +3 -3
- package/dist/esm/v3/components/or-tags-v3/OrTags.vue.d.ts +2 -7
- package/dist/esm/v3/components/or-tags-v3/index.js +1 -1
- package/dist/esm/v3/components/or-textarea-v3/index.js +2 -2
- package/dist/esm/v3/components/or-time-picker-v3/index.js +2 -2
- package/dist/esm/v3/index.js +15 -16
- package/package.json +4 -3
- package/src/components/index.ts +1 -2
- package/src/components/or-card-collection-v3/styles.ts +7 -0
- package/src/components/or-inline-input-v3/styles.ts +1 -1
- package/src/components/or-inline-textarea-v3/styles.ts +1 -1
- package/src/components/or-input-box-v3/styles.ts +0 -3
- package/src/components/or-input-v3/styles.ts +2 -2
- package/src/components/or-tags-v3/OrTags.vue +0 -14
- package/src/components/or-tags-v3/styles.ts +0 -3
- package/src/components/or-textarea-v3/styles.ts +1 -1
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.js +0 -359
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +0 -179
- package/dist/bundled/v2/components/OrTagInputV3/index.d.ts +0 -2
- package/dist/bundled/v2/components/OrTagInputV3/index.js +0 -55
- package/dist/bundled/v2/components/OrTagInputV3/props.d.ts +0 -1
- package/dist/bundled/v2/components/OrTagInputV3/props.js +0 -1
- package/dist/bundled/v2/components/OrTagInputV3/styles.d.ts +0 -3
- package/dist/bundled/v2/components/OrTagInputV3/styles.js +0 -17
- package/dist/bundled/v3/OrTagInput.vue_vue_type_script_lang-60f6d6de.js +0 -149
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +0 -170
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +0 -131
- package/dist/bundled/v3/components/OrTagInputV3/index.d.ts +0 -2
- package/dist/bundled/v3/components/OrTagInputV3/index.js +0 -68
- package/dist/bundled/v3/components/OrTagInputV3/props.d.ts +0 -1
- package/dist/bundled/v3/components/OrTagInputV3/props.js +0 -1
- package/dist/bundled/v3/components/OrTagInputV3/styles.d.ts +0 -3
- package/dist/bundled/v3/components/OrTagInputV3/styles.js +0 -17
- package/dist/esm/v2/OrTagInput-0a313fa1.js +0 -336
- package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +0 -179
- package/dist/esm/v2/components/or-tag-input-v3/index.d.ts +0 -2
- package/dist/esm/v2/components/or-tag-input-v3/index.js +0 -31
- package/dist/esm/v2/components/or-tag-input-v3/props.d.ts +0 -1
- package/dist/esm/v2/components/or-tag-input-v3/styles.d.ts +0 -3
- package/dist/esm/v3/OrTagInput-14f5f8c9.js +0 -261
- package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +0 -131
- package/dist/esm/v3/components/or-tag-input-v3/index.d.ts +0 -2
- package/dist/esm/v3/components/or-tag-input-v3/index.js +0 -29
- package/dist/esm/v3/components/or-tag-input-v3/props.d.ts +0 -1
- package/dist/esm/v3/components/or-tag-input-v3/styles.d.ts +0 -3
- package/src/components/or-tag-input-v3/OrTagInput.vue +0 -296
- package/src/components/or-tag-input-v3/index.ts +0 -2
- package/src/components/or-tag-input-v3/props.ts +0 -1
- package/src/components/or-tag-input-v3/styles.ts +0 -24
- /package/dist/bundled/v3/{OrInlineInput.vue_vue_type_script_lang-820cc7e9.js → OrInlineInput.vue_vue_type_script_lang-c4fb7c0e.js} +0 -0
- /package/dist/bundled/v3/{OrInlineTextarea.vue_vue_type_script_lang-8e639991.js → OrInlineTextarea.vue_vue_type_script_lang-4569f111.js} +0 -0
- /package/dist/bundled/v3/{OrInputBox.vue_vue_type_script_lang-49fb179a.js → OrInputBox.vue_vue_type_script_lang-ede24b04.js} +0 -0
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
ref="root"
|
|
4
|
-
:class="rootStyles"
|
|
5
|
-
>
|
|
6
|
-
<template v-if="label">
|
|
7
|
-
<OrLabel
|
|
8
|
-
:control-id="controlAttributes.id"
|
|
9
|
-
:variant="'input'"
|
|
10
|
-
:required="required"
|
|
11
|
-
:disabled="disabled"
|
|
12
|
-
>
|
|
13
|
-
{{ label }}
|
|
14
|
-
|
|
15
|
-
<template v-slot:addon>
|
|
16
|
-
<slot name="addon" />
|
|
17
|
-
</template>
|
|
18
|
-
</OrLabel>
|
|
19
|
-
</template>
|
|
20
|
-
|
|
21
|
-
<OrInputBox
|
|
22
|
-
:variant="disableDefaultStyles ? 'unstyled' : 'styled'"
|
|
23
|
-
:size="size"
|
|
24
|
-
:invalid="!!error"
|
|
25
|
-
:readonly="readonly"
|
|
26
|
-
:disabled="disabled"
|
|
27
|
-
>
|
|
28
|
-
<OrTags
|
|
29
|
-
:items="proxyModelValue"
|
|
30
|
-
:tag-props="{
|
|
31
|
-
variant: readonly || disabled ? 'tag' : 'reset',
|
|
32
|
-
disabled: disabled
|
|
33
|
-
}"
|
|
34
|
-
@reset="remove($event)"
|
|
35
|
-
/>
|
|
36
|
-
|
|
37
|
-
<input
|
|
38
|
-
ref="control"
|
|
39
|
-
v-model="draftModelValue"
|
|
40
|
-
v-bind="controlAttributes"
|
|
41
|
-
:class="controlStyles"
|
|
42
|
-
:type="'text'"
|
|
43
|
-
:placeholder="!proxyModelValue.length ? placeholder : undefined"
|
|
44
|
-
:readonly="readonly"
|
|
45
|
-
:disabled="disabled"
|
|
46
|
-
:autocomplete="'off'"
|
|
47
|
-
:minlength="undefined"
|
|
48
|
-
:maxlength="undefined"
|
|
49
|
-
@keydown.enter="add()"
|
|
50
|
-
@keydown="$emit('keydown', $event)"
|
|
51
|
-
@keyup="$emit('keyup', $event)"
|
|
52
|
-
@focus="$emit('focus', $event)"
|
|
53
|
-
@blur="$emit('blur', $event)"
|
|
54
|
-
>
|
|
55
|
-
|
|
56
|
-
<template v-slot:addon>
|
|
57
|
-
<template v-if="proxyModelValue.length > 0 || draftModelValue">
|
|
58
|
-
<OrIconButton
|
|
59
|
-
:icon="'close'"
|
|
60
|
-
:color="'inherit'"
|
|
61
|
-
:disabled="readonly || disabled"
|
|
62
|
-
@click.stop="reset()"
|
|
63
|
-
/>
|
|
64
|
-
</template>
|
|
65
|
-
</template>
|
|
66
|
-
</OrInputBox>
|
|
67
|
-
|
|
68
|
-
<div
|
|
69
|
-
v-show="!error"
|
|
70
|
-
:class="['contents']"
|
|
71
|
-
>
|
|
72
|
-
<template v-if="hint || maxLength">
|
|
73
|
-
<OrHint :disabled="disabled">
|
|
74
|
-
{{ hint }}
|
|
75
|
-
|
|
76
|
-
<template
|
|
77
|
-
v-if="maxLength"
|
|
78
|
-
v-slot:addon
|
|
79
|
-
>
|
|
80
|
-
{{ currentLength }} / {{ maxLength }}
|
|
81
|
-
</template>
|
|
82
|
-
</OrHint>
|
|
83
|
-
</template>
|
|
84
|
-
</div>
|
|
85
|
-
|
|
86
|
-
<div
|
|
87
|
-
v-show="typeof error === 'string'"
|
|
88
|
-
:class="['contents']"
|
|
89
|
-
>
|
|
90
|
-
<OrError :disabled="disabled">
|
|
91
|
-
{{ error }}
|
|
92
|
-
|
|
93
|
-
<template
|
|
94
|
-
v-if="maxLength"
|
|
95
|
-
v-slot:addon
|
|
96
|
-
>
|
|
97
|
-
{{ currentLength }} / {{ maxLength }}
|
|
98
|
-
</template>
|
|
99
|
-
</OrError>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</template>
|
|
103
|
-
|
|
104
|
-
<script lang="ts">
|
|
105
|
-
import { PropType, computed, defineComponent, reactive, ref } from 'vue-demi';
|
|
106
|
-
import { useControlAttributes, useIdAttribute, useValidationAttributes } from '../../hooks';
|
|
107
|
-
import { OrErrorV3 as OrError } from '../or-error-v3';
|
|
108
|
-
import { OrHintV3 as OrHint } from '../or-hint-v3';
|
|
109
|
-
import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
|
|
110
|
-
import { OrInputBoxV3 as OrInputBox } from '../or-input-box-v3';
|
|
111
|
-
import { OrLabelV3 as OrLabel } from '../or-label-v3';
|
|
112
|
-
import { OrTagsV3 as OrTags } from '../or-tags-v3';
|
|
113
|
-
import { TagInputSize } from './props';
|
|
114
|
-
import { TagInput, TagInputControl, TagInputItem } from './styles';
|
|
115
|
-
|
|
116
|
-
export default defineComponent({
|
|
117
|
-
name: 'OrTagInput',
|
|
118
|
-
|
|
119
|
-
components: {
|
|
120
|
-
OrError,
|
|
121
|
-
OrHint,
|
|
122
|
-
OrIconButton,
|
|
123
|
-
OrInputBox,
|
|
124
|
-
OrLabel,
|
|
125
|
-
OrTags,
|
|
126
|
-
},
|
|
127
|
-
|
|
128
|
-
model: {
|
|
129
|
-
prop: 'modelValue',
|
|
130
|
-
event: 'update:modelValue',
|
|
131
|
-
},
|
|
132
|
-
|
|
133
|
-
props: {
|
|
134
|
-
modelValue: {
|
|
135
|
-
type: Array as PropType<string[]>,
|
|
136
|
-
default: () => [],
|
|
137
|
-
},
|
|
138
|
-
|
|
139
|
-
size: {
|
|
140
|
-
type: String as PropType<`${TagInputSize}`>,
|
|
141
|
-
default: TagInputSize.M,
|
|
142
|
-
},
|
|
143
|
-
|
|
144
|
-
label: {
|
|
145
|
-
type: String,
|
|
146
|
-
default: undefined,
|
|
147
|
-
},
|
|
148
|
-
|
|
149
|
-
placeholder: {
|
|
150
|
-
type: String,
|
|
151
|
-
default: undefined,
|
|
152
|
-
},
|
|
153
|
-
|
|
154
|
-
hint: {
|
|
155
|
-
type: String,
|
|
156
|
-
default: undefined,
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
error: {
|
|
160
|
-
type: [String, Boolean],
|
|
161
|
-
default: undefined,
|
|
162
|
-
},
|
|
163
|
-
|
|
164
|
-
required: {
|
|
165
|
-
type: Boolean,
|
|
166
|
-
default: false,
|
|
167
|
-
},
|
|
168
|
-
|
|
169
|
-
readonly: {
|
|
170
|
-
type: Boolean,
|
|
171
|
-
default: false,
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
disabled: {
|
|
175
|
-
type: Boolean,
|
|
176
|
-
default: false,
|
|
177
|
-
},
|
|
178
|
-
|
|
179
|
-
disableDefaultStyles: {
|
|
180
|
-
type: Boolean,
|
|
181
|
-
default: false,
|
|
182
|
-
},
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
emits: [
|
|
186
|
-
'update:modelValue',
|
|
187
|
-
|
|
188
|
-
'keydown',
|
|
189
|
-
'keyup',
|
|
190
|
-
'focus',
|
|
191
|
-
'blur',
|
|
192
|
-
],
|
|
193
|
-
|
|
194
|
-
expose: [
|
|
195
|
-
'root',
|
|
196
|
-
|
|
197
|
-
'focus',
|
|
198
|
-
'blur',
|
|
199
|
-
],
|
|
200
|
-
|
|
201
|
-
setup(props, context) {
|
|
202
|
-
// Refs
|
|
203
|
-
const root = ref<HTMLElement>();
|
|
204
|
-
const control = ref<HTMLInputElement>();
|
|
205
|
-
|
|
206
|
-
// Styles
|
|
207
|
-
const rootStyles = computed(() => [
|
|
208
|
-
'or-tag-input-v3',
|
|
209
|
-
...TagInput,
|
|
210
|
-
]);
|
|
211
|
-
|
|
212
|
-
const controlStyles = computed(() => [
|
|
213
|
-
...TagInputControl,
|
|
214
|
-
]);
|
|
215
|
-
|
|
216
|
-
const itemStyles = computed(() => [
|
|
217
|
-
...TagInputItem,
|
|
218
|
-
]);
|
|
219
|
-
|
|
220
|
-
// State
|
|
221
|
-
const controlAttributes = reactive({
|
|
222
|
-
id: useIdAttribute(),
|
|
223
|
-
...useControlAttributes(),
|
|
224
|
-
...useValidationAttributes(),
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
const proxyModelValue = computed({
|
|
228
|
-
get: () => props.modelValue,
|
|
229
|
-
|
|
230
|
-
set: (value) => {
|
|
231
|
-
context.emit('update:modelValue', value);
|
|
232
|
-
},
|
|
233
|
-
});
|
|
234
|
-
|
|
235
|
-
const draftModelValue = ref<string>();
|
|
236
|
-
|
|
237
|
-
const currentLength = computed(() => proxyModelValue.value?.length ?? 0);
|
|
238
|
-
const maxLength = computed(() => controlAttributes.maxlength);
|
|
239
|
-
|
|
240
|
-
// Methods
|
|
241
|
-
function focus(): void {
|
|
242
|
-
control.value?.focus();
|
|
243
|
-
}
|
|
244
|
-
|
|
245
|
-
function blur(): void {
|
|
246
|
-
control.value?.blur();
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
function add(): void {
|
|
250
|
-
const newItem = draftModelValue.value?.trim();
|
|
251
|
-
|
|
252
|
-
if (!newItem) return;
|
|
253
|
-
if (proxyModelValue.value.includes(newItem)) return;
|
|
254
|
-
if (maxLength.value && currentLength.value >= maxLength.value) return;
|
|
255
|
-
|
|
256
|
-
proxyModelValue.value = [...proxyModelValue.value, newItem];
|
|
257
|
-
draftModelValue.value = undefined;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
function remove(value: string): void {
|
|
261
|
-
proxyModelValue.value = proxyModelValue.value.filter((item) => item !== value);
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
function reset(): void {
|
|
265
|
-
proxyModelValue.value = [];
|
|
266
|
-
draftModelValue.value = undefined;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
return {
|
|
270
|
-
root,
|
|
271
|
-
control,
|
|
272
|
-
rootStyles,
|
|
273
|
-
controlStyles,
|
|
274
|
-
itemStyles,
|
|
275
|
-
controlAttributes,
|
|
276
|
-
proxyModelValue,
|
|
277
|
-
draftModelValue,
|
|
278
|
-
currentLength,
|
|
279
|
-
maxLength,
|
|
280
|
-
focus,
|
|
281
|
-
blur,
|
|
282
|
-
add,
|
|
283
|
-
remove,
|
|
284
|
-
reset,
|
|
285
|
-
};
|
|
286
|
-
},
|
|
287
|
-
});
|
|
288
|
-
</script>
|
|
289
|
-
|
|
290
|
-
<style scoped>
|
|
291
|
-
input {
|
|
292
|
-
min-width: 0;
|
|
293
|
-
background: none;
|
|
294
|
-
outline: none;
|
|
295
|
-
}
|
|
296
|
-
</style>
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { InputBoxSize as TagInputSize } from '../or-input-box-v3';
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export const TagInput: string[] = [
|
|
2
|
-
// Layout
|
|
3
|
-
'layout-column',
|
|
4
|
-
|
|
5
|
-
// Spacing
|
|
6
|
-
'gap-xs',
|
|
7
|
-
];
|
|
8
|
-
|
|
9
|
-
export const TagInputControl: string[] = [
|
|
10
|
-
// Layout
|
|
11
|
-
'flex-auto',
|
|
12
|
-
|
|
13
|
-
// Typography
|
|
14
|
-
'typography-inherit',
|
|
15
|
-
|
|
16
|
-
// Theme (placeholder)
|
|
17
|
-
'placeholder:theme-foreground-outline',
|
|
18
|
-
'dark:placeholder:theme-foreground-outline-dark',
|
|
19
|
-
];
|
|
20
|
-
|
|
21
|
-
export const TagInputItem: string[] = [
|
|
22
|
-
// Box
|
|
23
|
-
'!min-h-0',
|
|
24
|
-
];
|
|
File without changes
|
|
File without changes
|