@onereach/ui-components 6.4.7 → 6.4.8-beta.3470.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/OrInputBoxV3/OrInputBox.js +6 -0
- package/dist/bundled/v2/components/OrInputBoxV3/OrInputBox.vue.d.ts +7 -3
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.js +138 -60
- package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +59 -2
- package/dist/bundled/v2/components/OrTagInputV3/styles.js +1 -1
- package/dist/bundled/v2/components/OrTagsV3/OrTags.js +24 -10
- package/dist/bundled/v2/components/OrTagsV3/OrTags.vue.d.ts +9 -5
- package/dist/bundled/v2/components/OrTagsV3/props.d.ts +3 -1
- package/dist/bundled/v2/components/OrTagsV3/props.js +4 -0
- package/dist/bundled/v2/components/OrTagsV3/styles.js +13 -3
- package/dist/bundled/v2/hooks/useOverflow.js +1 -1
- package/dist/bundled/v2/index.js +1 -1
- package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-3b37f8da.js → OrCardCollection.vue_vue_type_script_lang-519a5968.js} +1 -1
- package/dist/bundled/v3/{OrCode.vue_vue_type_script_lang-126d56f7.js → OrCode.vue_vue_type_script_lang-c360396d.js} +1 -1
- package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-56a57a28.js → OrConfirm.vue_vue_type_script_lang-b3dfc56e.js} +1 -1
- package/dist/bundled/v3/{OrDatePicker.vue_vue_type_script_lang-7d8b90bc.js → OrDatePicker.vue_vue_type_script_lang-be208d62.js} +1 -1
- package/dist/bundled/v3/{OrDateTimePicker.vue_vue_type_script_lang-090b5555.js → OrDateTimePicker.vue_vue_type_script_lang-297ed75c.js} +1 -1
- package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-bd483fbc.js → OrInput.vue_vue_type_script_lang-dddbcae1.js} +1 -1
- package/dist/bundled/v3/{OrInputBox.vue_vue_type_script_lang-137cb650.js → OrInputBox.vue_vue_type_script_lang-dede5b69.js} +1 -0
- package/dist/bundled/v3/{OrRichTextEditor.vue_vue_type_script_lang-b9bfac12.js → OrRichTextEditor.vue_vue_type_script_lang-583a4bae.js} +1 -1
- package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-e76fd9bd.js → OrSearch.vue_vue_type_script_lang-f50c9bbc.js} +1 -1
- package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-c0bcc2b5.js → OrSelect.vue_vue_type_script_lang-982f9498.js} +2 -2
- package/dist/bundled/v3/{OrTagInput.vue_vue_type_script_lang-108a1678.js → OrTagInput.vue_vue_type_script_lang-a7282068.js} +72 -8
- package/dist/bundled/v3/{OrTags.vue_vue_type_script_lang-a6fed075.js → OrTags.vue_vue_type_script_lang-d083e203.js} +18 -5
- package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-a7cfbe82.js → OrTextarea.vue_vue_type_script_lang-60883233.js} +1 -1
- package/dist/bundled/v3/{OrTimePicker.vue_vue_type_script_lang-18f5c74e.js → OrTimePicker.vue_vue_type_script_lang-ee21c668.js} +1 -1
- package/dist/bundled/v3/components/OrCardCollectionV3/OrCardCollection.js +2 -2
- package/dist/bundled/v3/components/OrCardCollectionV3/index.js +1 -1
- package/dist/bundled/v3/components/OrCodeV3/OrCode.js +2 -2
- package/dist/bundled/v3/components/OrCodeV3/index.js +1 -1
- package/dist/bundled/v3/components/OrConfirmV3/OrConfirm.js +2 -2
- package/dist/bundled/v3/components/OrConfirmV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDatePickerV3/OrDatePicker.js +2 -2
- package/dist/bundled/v3/components/OrDatePickerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrDateTimePickerV3/OrDateTimePicker.js +2 -2
- package/dist/bundled/v3/components/OrDateTimePickerV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.js +5 -4
- package/dist/bundled/v3/components/OrInputBoxV3/OrInputBox.vue.d.ts +4 -2
- package/dist/bundled/v3/components/OrInputBoxV3/index.js +1 -1
- package/dist/bundled/v3/components/OrInputV3/OrInput.js +2 -2
- package/dist/bundled/v3/components/OrInputV3/index.js +1 -1
- package/dist/bundled/v3/components/OrRichTextEditorV3/OrRichTextEditor.js +2 -2
- package/dist/bundled/v3/components/OrRichTextEditorV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSearchV3/OrSearch.js +2 -2
- package/dist/bundled/v3/components/OrSearchV3/index.js +1 -1
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +2 -2
- package/dist/bundled/v3/components/OrSelectV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +59 -38
- package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +31 -2
- 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/OrTagsV3/OrTags.js +14 -8
- package/dist/bundled/v3/components/OrTagsV3/OrTags.vue.d.ts +5 -3
- package/dist/bundled/v3/components/OrTagsV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTagsV3/props.d.ts +3 -1
- package/dist/bundled/v3/components/OrTagsV3/props.js +4 -0
- package/dist/bundled/v3/components/OrTagsV3/styles.js +13 -3
- package/dist/bundled/v3/components/OrTextareaV3/OrTextarea.js +2 -2
- package/dist/bundled/v3/components/OrTextareaV3/index.js +1 -1
- package/dist/bundled/v3/components/OrTimePickerV3/OrTimePicker.js +2 -2
- package/dist/bundled/v3/components/OrTimePickerV3/index.js +1 -1
- package/dist/bundled/v3/components/index.js +14 -14
- package/dist/bundled/v3/hooks/useOverflow.js +1 -1
- package/dist/bundled/v3/index.js +15 -15
- package/dist/esm/v2/{OrCardCollection-45c66d62.js → OrCardCollection-1e564f10.js} +2 -2
- package/dist/esm/v2/{OrCode-57bd041c.js → OrCode-cb4f5246.js} +2 -2
- package/dist/esm/v2/{OrCombinedInput-08f20c4c.js → OrCombinedInput-5b710ae4.js} +1 -1
- package/dist/esm/v2/{OrConfirm-3ff773e4.js → OrConfirm-f3a8c7d7.js} +1 -1
- package/dist/esm/v2/{OrDateFormat-d06e6a17.js → OrDateFormat-e65a57be.js} +3 -3
- package/dist/esm/v2/{OrDatePicker-8590a3e0.js → OrDatePicker-d0b137f9.js} +5 -5
- package/dist/esm/v2/{OrDateTimeFormat-958ac2b5.js → OrDateTimeFormat-bc6b4742.js} +3 -3
- package/dist/esm/v2/{OrDateTimePicker-43e5c95b.js → OrDateTimePicker-d53a45b3.js} +1 -1
- package/dist/esm/v2/{OrDateTimePicker.vue_rollup-plugin-vue_script-c15c0ff1.js → OrDateTimePicker.vue_rollup-plugin-vue_script-31aa2dea.js} +4 -4
- package/dist/esm/v2/{OrDateTimePickerTimeSelect-a122ae93.js → OrDateTimePickerTimeSelect-89a31a71.js} +1 -1
- package/dist/esm/v2/{OrInput-794bc2f6.js → OrInput-9b7bc7c7.js} +2 -2
- package/dist/esm/v2/{OrInputBox-7dc5b9e9.js → OrInputBox-54d34025.js} +6 -1
- package/dist/esm/v2/{OrInputBox.vue_rollup-plugin-vue_script-4fde9829.js → OrInputBox.vue_rollup-plugin-vue_script-8549f215.js} +1 -0
- package/dist/esm/v2/{OrRichTextEditor-b12605d3.js → OrRichTextEditor-bb5f6ec0.js} +1 -1
- package/dist/esm/v2/{OrSearch-21ae4e63.js → OrSearch-2a42defc.js} +2 -2
- package/dist/esm/v2/{OrSelect-0a5c0317.js → OrSelect-c87358c4.js} +4 -4
- package/dist/esm/v2/{OrTagInput-ebfaeaca.js → OrTagInput-0ac007eb.js} +141 -65
- package/dist/esm/v2/{OrTags-b02fadce.js → OrTags-b3f626d1.js} +42 -14
- package/dist/esm/v2/{OrTextarea-58bd5e83.js → OrTextarea-5f4a6d2a.js} +2 -2
- package/dist/esm/v2/{OrTimeFormat-c369099a.js → OrTimeFormat-1f20464e.js} +3 -3
- package/dist/esm/v2/{OrTimePicker-444a7d26.js → OrTimePicker-9c1501e2.js} +5 -5
- package/dist/esm/v2/components/index.js +23 -23
- package/dist/esm/v2/components/or-card-collection-v3/index.js +5 -5
- package/dist/esm/v2/components/or-code-v3/index.js +3 -3
- 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-format-v3/index.js +6 -6
- package/dist/esm/v2/components/or-date-picker-v3/index.js +6 -6
- package/dist/esm/v2/components/or-date-time-format-v3/index.js +6 -6
- package/dist/esm/v2/components/or-date-time-picker-v3/index.js +6 -6
- package/dist/esm/v2/components/or-date-time-picker-v3/partials/index.js +3 -3
- package/dist/esm/v2/components/or-date-time-picker-v3/utils/index.js +2 -2
- package/dist/esm/v2/components/or-input-box-v3/OrInputBox.vue.d.ts +7 -3
- 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-rich-text-editor-v3/index.js +4 -4
- package/dist/esm/v2/components/or-search-v3/index.js +4 -4
- package/dist/esm/v2/components/or-select-v3/index.js +5 -5
- package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +59 -2
- package/dist/esm/v2/components/or-tag-input-v3/index.js +6 -6
- package/dist/esm/v2/components/or-tags-v3/OrTags.vue.d.ts +9 -5
- package/dist/esm/v2/components/or-tags-v3/index.js +2 -2
- package/dist/esm/v2/components/or-tags-v3/props.d.ts +3 -1
- package/dist/esm/v2/components/or-textarea-v3/index.js +3 -3
- package/dist/esm/v2/components/or-time-format-v3/index.js +6 -6
- package/dist/esm/v2/components/or-time-picker-v3/index.js +6 -6
- package/dist/esm/v2/{getTimePlaceholder-06d57fcf.js → getTimePlaceholder-4a7e7a31.js} +1 -1
- package/dist/esm/v2/hooks/index.js +1 -1
- package/dist/esm/v2/index.js +23 -23
- package/dist/esm/v2/{useOverflow-ff9ae748.js → useOverflow-122c613d.js} +1 -1
- package/dist/esm/v3/{OrCardCollection-64175d94.js → OrCardCollection-307a4c3d.js} +2 -2
- package/dist/esm/v3/{OrCode-56268647.js → OrCode-b4fe3443.js} +1 -1
- package/dist/esm/v3/{OrCombinedInput-b8a868cb.js → OrCombinedInput-28a8d0b4.js} +1 -1
- package/dist/esm/v3/{OrConfirm-658dfa58.js → OrConfirm-4d88e0c8.js} +1 -1
- package/dist/esm/v3/{OrDateFormat-8322187d.js → OrDateFormat-c2d94f69.js} +3 -3
- package/dist/esm/v3/{OrDatePicker-a6518904.js → OrDatePicker-7d148993.js} +4 -4
- package/dist/esm/v3/{OrDateTimeFormat-fc9a09d9.js → OrDateTimeFormat-2061b8a0.js} +3 -3
- package/dist/esm/v3/{OrDateTimePicker-e13abe97.js → OrDateTimePicker-765046c1.js} +3 -3
- package/dist/esm/v3/{OrDateTimePickerTimeSelect-1a7950ad.js → OrDateTimePickerTimeSelect-ae6165f0.js} +1 -1
- package/dist/esm/v3/{OrInput-30df8d73.js → OrInput-b7b6e94d.js} +1 -1
- package/dist/esm/v3/{OrInputBox-912a6254.js → OrInputBox-893ccc8d.js} +4 -2
- package/dist/esm/v3/{OrRichTextEditor-bdf2e88f.js → OrRichTextEditor-29838f8d.js} +1 -1
- package/dist/esm/v3/{OrSearch-04fdc116.js → OrSearch-a7b923ca.js} +2 -2
- package/dist/esm/v3/{OrSelect-559c6cf5.js → OrSelect-aa023d90.js} +3 -3
- package/dist/esm/v3/{OrTagInput-6824b64e.js → OrTagInput-7225068a.js} +129 -46
- package/dist/esm/v3/{OrTags-ba7e85ee.js → OrTags-5b795df2.js} +48 -15
- package/dist/esm/v3/{OrTextarea-aa1cf564.js → OrTextarea-5159520e.js} +1 -1
- package/dist/esm/v3/{OrTimeFormat-845f1078.js → OrTimeFormat-dc1ab7ee.js} +3 -3
- package/dist/esm/v3/{OrTimePicker-294ab841.js → OrTimePicker-a77919b5.js} +4 -4
- package/dist/esm/v3/components/index.js +21 -21
- package/dist/esm/v3/components/or-card-collection-v3/index.js +4 -4
- package/dist/esm/v3/components/or-code-v3/index.js +2 -2
- 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-format-v3/index.js +5 -5
- package/dist/esm/v3/components/or-date-picker-v3/index.js +5 -5
- package/dist/esm/v3/components/or-date-time-format-v3/index.js +5 -5
- package/dist/esm/v3/components/or-date-time-picker-v3/index.js +4 -4
- package/dist/esm/v3/components/or-date-time-picker-v3/partials/index.js +3 -3
- package/dist/esm/v3/components/or-date-time-picker-v3/utils/index.js +2 -2
- package/dist/esm/v3/components/or-input-box-v3/OrInputBox.vue.d.ts +4 -2
- 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-rich-text-editor-v3/index.js +3 -3
- package/dist/esm/v3/components/or-search-v3/index.js +3 -3
- package/dist/esm/v3/components/or-select-v3/index.js +4 -4
- package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +31 -2
- package/dist/esm/v3/components/or-tag-input-v3/index.js +5 -5
- package/dist/esm/v3/components/or-tags-v3/OrTags.vue.d.ts +5 -3
- package/dist/esm/v3/components/or-tags-v3/index.js +2 -2
- package/dist/esm/v3/components/or-tags-v3/props.d.ts +3 -1
- package/dist/esm/v3/components/or-textarea-v3/index.js +2 -2
- package/dist/esm/v3/components/or-time-format-v3/index.js +5 -5
- package/dist/esm/v3/components/or-time-picker-v3/index.js +5 -5
- package/dist/esm/v3/{getTimePlaceholder-09859f55.js → getTimePlaceholder-60978b3e.js} +1 -1
- package/dist/esm/v3/hooks/index.js +1 -1
- package/dist/esm/v3/index.js +21 -21
- package/dist/esm/v3/{useOverflow-ff9ae748.js → useOverflow-122c613d.js} +1 -1
- package/package.json +2 -3
- package/src/components/or-input-box-v3/OrInputBox.vue +4 -0
- package/src/components/or-tag-input-v3/OrTagInput.vue +122 -36
- package/src/components/or-tag-input-v3/styles.ts +1 -1
- package/src/components/or-tags-v3/OrTags.vue +33 -5
- package/src/components/or-tags-v3/props.ts +4 -0
- package/src/components/or-tags-v3/styles.ts +15 -0
- package/src/hooks/useOverflow.ts +1 -1
|
@@ -104,6 +104,7 @@ var script = defineComponent({
|
|
|
104
104
|
}
|
|
105
105
|
},
|
|
106
106
|
expose: ['root'],
|
|
107
|
+
emits: ['focus'],
|
|
107
108
|
setup(props) {
|
|
108
109
|
// Refs
|
|
109
110
|
const root = ref();
|
|
@@ -131,6 +132,11 @@ var __vue_render__ = function () {
|
|
|
131
132
|
"invalid": _vm.invalid ? '' : null,
|
|
132
133
|
"readonly": _vm.readonly ? '' : null,
|
|
133
134
|
"disabled": _vm.disabled ? '' : null
|
|
135
|
+
},
|
|
136
|
+
on: {
|
|
137
|
+
"focus": function ($event) {
|
|
138
|
+
return _vm.$emit('focus');
|
|
139
|
+
}
|
|
134
140
|
}
|
|
135
141
|
}, [_vm._t("default"), _vm._v(" "), _vm.$slots.addon ? [_c('OrInputBoxAddon', {
|
|
136
142
|
attrs: {
|
|
@@ -51,16 +51,20 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
51
51
|
invalid: boolean;
|
|
52
52
|
readonly: boolean;
|
|
53
53
|
disabled: boolean;
|
|
54
|
-
} & {}
|
|
54
|
+
} & {} & {
|
|
55
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
56
|
+
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
55
57
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
56
58
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
57
|
-
}>, import("@vue/composition-api").Data, {}, {}, {}, {},
|
|
59
|
+
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
58
60
|
variant: "styled" | "unstyled";
|
|
59
61
|
size: "m" | "s";
|
|
60
62
|
invalid: boolean;
|
|
61
63
|
readonly: boolean;
|
|
62
64
|
disabled: boolean;
|
|
63
|
-
} & {}
|
|
65
|
+
} & {} & {
|
|
66
|
+
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
67
|
+
}, {
|
|
64
68
|
variant: "styled" | "unstyled";
|
|
65
69
|
size: "m" | "s";
|
|
66
70
|
invalid: boolean;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, reactive,
|
|
1
|
+
import { defineComponent, ref, toRefs, computed, reactive, watch, nextTick } from 'vue-demi';
|
|
2
|
+
import { o as onClickOutside } from '../../index-a488b35e.js';
|
|
2
3
|
import { TagInput, TagInputControl, TagInputItem } from './styles.js';
|
|
3
4
|
import __vue_component__$1 from '../OrErrorV3/OrError.js';
|
|
4
5
|
import __vue_component__$2 from '../OrHintV3/OrHint.js';
|
|
@@ -6,6 +7,7 @@ import __vue_component__$3 from '../OrIconButtonV3/OrIconButton.js';
|
|
|
6
7
|
import __vue_component__$4 from '../OrInputBoxV3/OrInputBox.js';
|
|
7
8
|
import __vue_component__$5 from '../OrLabelV3/OrLabel.js';
|
|
8
9
|
import __vue_component__$6 from '../OrTagsV3/OrTags.js';
|
|
10
|
+
import { TagsOverflow } from '../OrTagsV3/props.js';
|
|
9
11
|
import { InputBoxSize } from '../OrInputBoxV3/props.js';
|
|
10
12
|
import { useIdAttribute } from '../../hooks/useIdAttribute.js';
|
|
11
13
|
import { useControlAttributes } from '../../hooks/useControlAttributes.js';
|
|
@@ -68,14 +70,31 @@ var script = defineComponent({
|
|
|
68
70
|
disableDefaultStyles: {
|
|
69
71
|
type: Boolean,
|
|
70
72
|
default: false
|
|
73
|
+
},
|
|
74
|
+
overflow: {
|
|
75
|
+
type: String,
|
|
76
|
+
default: TagsOverflow.Hidden
|
|
77
|
+
},
|
|
78
|
+
// todo: review default state, disabling will breaking
|
|
79
|
+
enableClear: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
default: true
|
|
71
82
|
}
|
|
72
83
|
},
|
|
73
|
-
emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur'],
|
|
84
|
+
emits: ['update:modelValue', 'keydown', 'keyup', 'focus', 'blur', 'reset'],
|
|
74
85
|
expose: ['root', 'focus', 'blur'],
|
|
75
86
|
setup(props, context) {
|
|
76
87
|
// Refs
|
|
77
88
|
const root = ref();
|
|
78
89
|
const control = ref();
|
|
90
|
+
const inputBox = ref();
|
|
91
|
+
const tags = ref();
|
|
92
|
+
// Props
|
|
93
|
+
const {
|
|
94
|
+
modelValue,
|
|
95
|
+
overflow,
|
|
96
|
+
placeholder
|
|
97
|
+
} = toRefs(props);
|
|
79
98
|
// Styles
|
|
80
99
|
const rootStyles = computed(() => ['or-tag-input-v3', ...TagInput]);
|
|
81
100
|
const controlStyles = computed(() => [...TagInputControl]);
|
|
@@ -86,13 +105,24 @@ var script = defineComponent({
|
|
|
86
105
|
...useControlAttributes(),
|
|
87
106
|
...useValidationAttributes()
|
|
88
107
|
});
|
|
89
|
-
const
|
|
90
|
-
const
|
|
108
|
+
const activated = ref(false);
|
|
109
|
+
const proxyModelValue = useProxyModelValue(modelValue, context.emit);
|
|
110
|
+
const draftModelValue = ref('');
|
|
91
111
|
const currentLength = computed(() => {
|
|
92
112
|
var _a, _b;
|
|
93
113
|
return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
94
114
|
});
|
|
95
115
|
const maxLength = computed(() => controlAttributes.maxlength);
|
|
116
|
+
const controlInlineStyles = computed(() => {
|
|
117
|
+
var _a, _b;
|
|
118
|
+
const chars = draftModelValue.value.length > 0 ? draftModelValue.value.length : currentLength.value === 0 ? (_b = (_a = placeholder.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 : 0;
|
|
119
|
+
return {
|
|
120
|
+
width: `${Math.max(chars + 1 || 0, 3)}ch`
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
const showControl = computed(() => {
|
|
124
|
+
return draftModelValue.value.length > 0 || currentLength.value === 0 || activated.value;
|
|
125
|
+
});
|
|
96
126
|
// Methods
|
|
97
127
|
function focus() {
|
|
98
128
|
var _a;
|
|
@@ -102,6 +132,16 @@ var script = defineComponent({
|
|
|
102
132
|
var _a;
|
|
103
133
|
(_a = control.value) === null || _a === void 0 ? void 0 : _a.blur();
|
|
104
134
|
}
|
|
135
|
+
function deactivate() {
|
|
136
|
+
activated.value = false;
|
|
137
|
+
nextTick(() => blur());
|
|
138
|
+
context.emit('blur');
|
|
139
|
+
}
|
|
140
|
+
function activate() {
|
|
141
|
+
activated.value = true;
|
|
142
|
+
nextTick(() => focus());
|
|
143
|
+
context.emit('focus');
|
|
144
|
+
}
|
|
105
145
|
function add() {
|
|
106
146
|
var _a;
|
|
107
147
|
const newItem = (_a = draftModelValue.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
@@ -109,36 +149,60 @@ var script = defineComponent({
|
|
|
109
149
|
if (proxyModelValue.value.includes(newItem)) return;
|
|
110
150
|
if (maxLength.value && currentLength.value >= maxLength.value) return;
|
|
111
151
|
proxyModelValue.value = [...proxyModelValue.value, newItem];
|
|
112
|
-
draftModelValue.value =
|
|
152
|
+
draftModelValue.value = '';
|
|
113
153
|
}
|
|
114
154
|
function remove(value) {
|
|
115
155
|
proxyModelValue.value = proxyModelValue.value.filter(item => item !== value);
|
|
116
156
|
}
|
|
117
157
|
function reset() {
|
|
118
158
|
proxyModelValue.value = [];
|
|
119
|
-
draftModelValue.value =
|
|
159
|
+
draftModelValue.value = '';
|
|
160
|
+
context.emit('reset');
|
|
120
161
|
}
|
|
162
|
+
// Effects
|
|
163
|
+
onClickOutside(inputBox, () => {
|
|
164
|
+
var _a, _b;
|
|
165
|
+
if (activated.value === false || ((_b = (_a = tags.value) === null || _a === void 0 ? void 0 : _a.overflowPopover) === null || _b === void 0 ? void 0 : _b.state) === 'open') return;
|
|
166
|
+
deactivate();
|
|
167
|
+
});
|
|
168
|
+
watch(proxyModelValue, (items, prevItems) => {
|
|
169
|
+
if (items.length != prevItems.length && overflow.value === TagsOverflow.Scroll) {
|
|
170
|
+
nextTick(() => {
|
|
171
|
+
var _a, _b, _c;
|
|
172
|
+
(_c = (_b = (_a = tags.value) === null || _a === void 0 ? void 0 : _a.container) === null || _b === void 0 ? void 0 : _b.lastElementChild) === null || _c === void 0 ? void 0 : _c.scrollIntoView({
|
|
173
|
+
behavior: 'smooth'
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
});
|
|
121
178
|
return {
|
|
122
179
|
root,
|
|
123
180
|
control,
|
|
181
|
+
inputBox,
|
|
182
|
+
tags,
|
|
124
183
|
rootStyles,
|
|
125
184
|
controlStyles,
|
|
126
185
|
itemStyles,
|
|
186
|
+
controlInlineStyles,
|
|
127
187
|
controlAttributes,
|
|
128
188
|
proxyModelValue,
|
|
129
189
|
draftModelValue,
|
|
130
190
|
currentLength,
|
|
131
191
|
maxLength,
|
|
192
|
+
activated,
|
|
193
|
+
showControl,
|
|
132
194
|
focus,
|
|
133
195
|
blur,
|
|
134
196
|
add,
|
|
197
|
+
activate,
|
|
198
|
+
deactivate,
|
|
135
199
|
remove,
|
|
136
200
|
reset
|
|
137
201
|
};
|
|
138
202
|
}
|
|
139
203
|
});
|
|
140
204
|
|
|
141
|
-
var css_248z = "input[data-v-
|
|
205
|
+
var css_248z = "input[data-v-58e82b38]{min-width:0;background:0 0;outline:0}";
|
|
142
206
|
styleInject(css_248z);
|
|
143
207
|
|
|
144
208
|
/* script */
|
|
@@ -166,14 +230,21 @@ var __vue_render__ = function () {
|
|
|
166
230
|
proxy: true
|
|
167
231
|
}], null, true)
|
|
168
232
|
}, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")])] : _vm._e(), _vm._v(" "), _c('OrInputBox', {
|
|
233
|
+
ref: "inputBox",
|
|
234
|
+
staticClass: "cursor-text",
|
|
169
235
|
attrs: {
|
|
170
236
|
"variant": _vm.disableDefaultStyles ? 'unstyled' : 'styled',
|
|
171
237
|
"size": _vm.size,
|
|
238
|
+
"force-state": _vm.activated ? 'focus-within' : undefined,
|
|
172
239
|
"invalid": !!_vm.error,
|
|
173
240
|
"readonly": _vm.readonly,
|
|
174
|
-
"disabled": _vm.disabled
|
|
241
|
+
"disabled": _vm.disabled,
|
|
242
|
+
"tabindex": "0"
|
|
175
243
|
},
|
|
176
|
-
|
|
244
|
+
on: {
|
|
245
|
+
"focus": _vm.activate
|
|
246
|
+
},
|
|
247
|
+
scopedSlots: _vm._u([_vm.enableClear ? {
|
|
177
248
|
key: "addon",
|
|
178
249
|
fn: function () {
|
|
179
250
|
return [_vm.proxyModelValue.length > 0 || _vm.draftModelValue ? [_c('OrIconButton', {
|
|
@@ -184,74 +255,81 @@ var __vue_render__ = function () {
|
|
|
184
255
|
},
|
|
185
256
|
on: {
|
|
186
257
|
"click": function ($event) {
|
|
187
|
-
$event.stopPropagation();
|
|
188
258
|
return _vm.reset();
|
|
189
259
|
}
|
|
190
260
|
}
|
|
191
261
|
})] : _vm._e()];
|
|
192
262
|
},
|
|
193
263
|
proxy: true
|
|
194
|
-
}])
|
|
195
|
-
}, [
|
|
264
|
+
} : null], null, true)
|
|
265
|
+
}, [_c('OrTags', {
|
|
266
|
+
ref: "tags",
|
|
267
|
+
staticClass: "grow",
|
|
196
268
|
attrs: {
|
|
197
269
|
"items": _vm.proxyModelValue,
|
|
198
270
|
"tag-props": {
|
|
199
271
|
variant: _vm.readonly || _vm.disabled ? 'tag' : 'reset',
|
|
200
272
|
disabled: _vm.disabled
|
|
201
|
-
}
|
|
273
|
+
},
|
|
274
|
+
"overflow": _vm.overflow
|
|
202
275
|
},
|
|
203
276
|
on: {
|
|
204
277
|
"reset": function ($event) {
|
|
205
278
|
return _vm.remove($event);
|
|
206
279
|
}
|
|
207
|
-
}
|
|
208
|
-
})] : _vm._e(), _vm._v(" "), _c('input', _vm._b({
|
|
209
|
-
directives: [{
|
|
210
|
-
name: "model",
|
|
211
|
-
rawName: "v-model",
|
|
212
|
-
value: _vm.draftModelValue,
|
|
213
|
-
expression: "draftModelValue"
|
|
214
|
-
}],
|
|
215
|
-
ref: "control",
|
|
216
|
-
class: _vm.controlStyles,
|
|
217
|
-
attrs: {
|
|
218
|
-
"placeholder": _vm.proxyModelValue.length === 0 ? _vm.placeholder : undefined,
|
|
219
|
-
"readonly": _vm.readonly,
|
|
220
|
-
"disabled": _vm.disabled,
|
|
221
|
-
"autocomplete": 'off',
|
|
222
|
-
"minlength": undefined,
|
|
223
|
-
"maxlength": undefined,
|
|
224
|
-
"type": 'text'
|
|
225
280
|
},
|
|
226
|
-
|
|
227
|
-
"
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
281
|
+
scopedSlots: _vm._u([_vm.showControl ? {
|
|
282
|
+
key: "tail",
|
|
283
|
+
fn: function () {
|
|
284
|
+
return [_c('div', {
|
|
285
|
+
staticClass: "inline-flex w-fit"
|
|
286
|
+
}, [_c('input', _vm._b({
|
|
287
|
+
directives: [{
|
|
288
|
+
name: "model",
|
|
289
|
+
rawName: "v-model",
|
|
290
|
+
value: _vm.draftModelValue,
|
|
291
|
+
expression: "draftModelValue"
|
|
292
|
+
}],
|
|
293
|
+
ref: "control",
|
|
294
|
+
class: _vm.controlStyles,
|
|
295
|
+
style: _vm.controlInlineStyles,
|
|
296
|
+
attrs: {
|
|
297
|
+
"placeholder": _vm.proxyModelValue.length === 0 ? _vm.placeholder : undefined,
|
|
298
|
+
"readonly": _vm.readonly,
|
|
299
|
+
"disabled": _vm.disabled,
|
|
300
|
+
"autocomplete": 'off',
|
|
301
|
+
"minlength": undefined,
|
|
302
|
+
"maxlength": undefined,
|
|
303
|
+
"type": 'text'
|
|
304
|
+
},
|
|
305
|
+
domProps: {
|
|
306
|
+
"value": _vm.draftModelValue
|
|
307
|
+
},
|
|
308
|
+
on: {
|
|
309
|
+
"keydown": [function ($event) {
|
|
310
|
+
if (!$event.type.indexOf('key') && _vm._k($event.keyCode, "enter", 13, $event.key, "Enter")) {
|
|
311
|
+
return null;
|
|
312
|
+
}
|
|
313
|
+
return _vm.add();
|
|
314
|
+
}, function ($event) {
|
|
315
|
+
return _vm.$emit('keydown', $event);
|
|
316
|
+
}],
|
|
317
|
+
"keyup": function ($event) {
|
|
318
|
+
return _vm.$emit('keyup', $event);
|
|
319
|
+
},
|
|
320
|
+
"focus": _vm.activate,
|
|
321
|
+
"input": function ($event) {
|
|
322
|
+
if ($event.target.composing) {
|
|
323
|
+
return;
|
|
324
|
+
}
|
|
325
|
+
_vm.draftModelValue = $event.target.value;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}, 'input', _vm.controlAttributes, false))])];
|
|
246
329
|
},
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
}
|
|
251
|
-
_vm.draftModelValue = $event.target.value;
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
}, 'input', _vm.controlAttributes, false))], 2), _vm._v(" "), _c('div', {
|
|
330
|
+
proxy: true
|
|
331
|
+
} : null], null, true)
|
|
332
|
+
})], 1), _vm._v(" "), _c('div', {
|
|
255
333
|
directives: [{
|
|
256
334
|
name: "show",
|
|
257
335
|
rawName: "v-show",
|
|
@@ -296,7 +374,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
296
374
|
/* style */
|
|
297
375
|
const __vue_inject_styles__ = undefined;
|
|
298
376
|
/* scoped */
|
|
299
|
-
const __vue_scope_id__ = "data-v-
|
|
377
|
+
const __vue_scope_id__ = "data-v-58e82b38";
|
|
300
378
|
/* module identifier */
|
|
301
379
|
const __vue_module_identifier__ = undefined;
|
|
302
380
|
/* functional template */
|
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
|
+
import { TagsOverflow } from '../or-tags-v3';
|
|
2
3
|
import { TagInputSize } from './props';
|
|
3
4
|
declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
4
5
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
5
6
|
control: import("@vue/composition-api").Ref<HTMLInputElement | undefined>;
|
|
7
|
+
inputBox: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
8
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
9
|
+
} | string[], {} & {}, {
|
|
10
|
+
[x: number]: string;
|
|
11
|
+
} | {}, true> | undefined>;
|
|
12
|
+
tags: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
13
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
14
|
+
} | string[], {} & {}, {
|
|
15
|
+
[x: number]: string;
|
|
16
|
+
} | {}, true> | undefined>;
|
|
6
17
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
7
18
|
controlStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
8
19
|
itemStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
20
|
+
controlInlineStyles: import("@vue/composition-api").ComputedRef<{
|
|
21
|
+
width: string;
|
|
22
|
+
}>;
|
|
9
23
|
controlAttributes: {
|
|
10
24
|
required: boolean | undefined;
|
|
11
25
|
minlength: number | undefined;
|
|
@@ -20,12 +34,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
20
34
|
id: string | undefined;
|
|
21
35
|
};
|
|
22
36
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<string[]>;
|
|
23
|
-
draftModelValue: import("@vue/composition-api").Ref<string
|
|
37
|
+
draftModelValue: import("@vue/composition-api").Ref<string>;
|
|
24
38
|
currentLength: import("@vue/composition-api").ComputedRef<number>;
|
|
25
39
|
maxLength: import("@vue/composition-api").ComputedRef<number | undefined>;
|
|
40
|
+
activated: import("@vue/composition-api").Ref<boolean>;
|
|
41
|
+
showControl: import("@vue/composition-api").ComputedRef<boolean>;
|
|
26
42
|
focus: () => void;
|
|
27
43
|
blur: () => void;
|
|
28
44
|
add: () => void;
|
|
45
|
+
activate: () => void;
|
|
46
|
+
deactivate: () => void;
|
|
29
47
|
remove: (value: string) => void;
|
|
30
48
|
reset: () => void;
|
|
31
49
|
}> & import("@vue/composition-api").Data, {}, {}, {
|
|
@@ -69,6 +87,14 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
69
87
|
type: BooleanConstructor;
|
|
70
88
|
default: boolean;
|
|
71
89
|
};
|
|
90
|
+
overflow: {
|
|
91
|
+
type: PropType<"default" | "wrap" | "hidden" | "scroll">;
|
|
92
|
+
default: TagsOverflow;
|
|
93
|
+
};
|
|
94
|
+
enableClear: {
|
|
95
|
+
type: BooleanConstructor;
|
|
96
|
+
default: boolean;
|
|
97
|
+
};
|
|
72
98
|
}, import("@vue/composition-api").ExtractPropTypes<{
|
|
73
99
|
modelValue: {
|
|
74
100
|
type: PropType<string[]>;
|
|
@@ -110,6 +136,14 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
110
136
|
type: BooleanConstructor;
|
|
111
137
|
default: boolean;
|
|
112
138
|
};
|
|
139
|
+
overflow: {
|
|
140
|
+
type: PropType<"default" | "wrap" | "hidden" | "scroll">;
|
|
141
|
+
default: TagsOverflow;
|
|
142
|
+
};
|
|
143
|
+
enableClear: {
|
|
144
|
+
type: BooleanConstructor;
|
|
145
|
+
default: boolean;
|
|
146
|
+
};
|
|
113
147
|
}>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
|
|
114
148
|
modelValue: string[];
|
|
115
149
|
size: "m" | "s";
|
|
@@ -121,14 +155,29 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
121
155
|
readonly: boolean;
|
|
122
156
|
disabled: boolean;
|
|
123
157
|
disableDefaultStyles: boolean;
|
|
158
|
+
overflow: "default" | "wrap" | "hidden" | "scroll";
|
|
159
|
+
enableClear: boolean;
|
|
124
160
|
} & {} & {
|
|
125
161
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
126
162
|
}, import("@vue/composition-api").ShallowUnwrapRef<{
|
|
127
163
|
root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
|
|
128
164
|
control: import("@vue/composition-api").Ref<HTMLInputElement | undefined>;
|
|
165
|
+
inputBox: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
166
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
167
|
+
} | string[], {} & {}, {
|
|
168
|
+
[x: number]: string;
|
|
169
|
+
} | {}, true> | undefined>;
|
|
170
|
+
tags: import("@vue/composition-api").Ref<import("@vue/composition-api").ComponentRenderProxy<{} & {}, import("@vue/composition-api").ShallowUnwrapRef<unknown>, unknown, import("@vue/composition-api").ComputedOptions, import("@vue/composition-api").MethodOptions, unknown, unknown, {
|
|
171
|
+
[x: string]: ((...args: any[]) => any) | null;
|
|
172
|
+
} | string[], {} & {}, {
|
|
173
|
+
[x: number]: string;
|
|
174
|
+
} | {}, true> | undefined>;
|
|
129
175
|
rootStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
130
176
|
controlStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
131
177
|
itemStyles: import("@vue/composition-api").ComputedRef<string[]>;
|
|
178
|
+
controlInlineStyles: import("@vue/composition-api").ComputedRef<{
|
|
179
|
+
width: string;
|
|
180
|
+
}>;
|
|
132
181
|
controlAttributes: {
|
|
133
182
|
required: boolean | undefined;
|
|
134
183
|
minlength: number | undefined;
|
|
@@ -143,12 +192,16 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
143
192
|
id: string | undefined;
|
|
144
193
|
};
|
|
145
194
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<string[]>;
|
|
146
|
-
draftModelValue: import("@vue/composition-api").Ref<string
|
|
195
|
+
draftModelValue: import("@vue/composition-api").Ref<string>;
|
|
147
196
|
currentLength: import("@vue/composition-api").ComputedRef<number>;
|
|
148
197
|
maxLength: import("@vue/composition-api").ComputedRef<number | undefined>;
|
|
198
|
+
activated: import("@vue/composition-api").Ref<boolean>;
|
|
199
|
+
showControl: import("@vue/composition-api").ComputedRef<boolean>;
|
|
149
200
|
focus: () => void;
|
|
150
201
|
blur: () => void;
|
|
151
202
|
add: () => void;
|
|
203
|
+
activate: () => void;
|
|
204
|
+
deactivate: () => void;
|
|
152
205
|
remove: (value: string) => void;
|
|
153
206
|
reset: () => void;
|
|
154
207
|
}>, import("@vue/composition-api").Data, {}, {}, {}, {}, string[], {
|
|
@@ -162,6 +215,8 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
162
215
|
readonly: boolean;
|
|
163
216
|
disabled: boolean;
|
|
164
217
|
disableDefaultStyles: boolean;
|
|
218
|
+
overflow: "default" | "wrap" | "hidden" | "scroll";
|
|
219
|
+
enableClear: boolean;
|
|
165
220
|
} & {} & {
|
|
166
221
|
[x: `on${Capitalize<string>}`]: ((...args: any[]) => any) | undefined;
|
|
167
222
|
}, {
|
|
@@ -175,5 +230,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
175
230
|
readonly: boolean;
|
|
176
231
|
disabled: boolean;
|
|
177
232
|
disableDefaultStyles: boolean;
|
|
233
|
+
overflow: "default" | "wrap" | "hidden" | "scroll";
|
|
234
|
+
enableClear: boolean;
|
|
178
235
|
}, true>);
|
|
179
236
|
export default _default;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, computed } from 'vue-demi';
|
|
1
|
+
import { defineComponent, ref, toRefs, computed } from 'vue-demi';
|
|
2
2
|
import { TagsOverflow } from './props.js';
|
|
3
3
|
import { Tags, TagsContainer, TagsContainerOverflows, TagsOverflowButton, TagsOverflowPopover } from './styles.js';
|
|
4
4
|
import __vue_component__$1 from '../OrButtonV3/OrButton.js';
|
|
@@ -21,7 +21,7 @@ var script = defineComponent({
|
|
|
21
21
|
},
|
|
22
22
|
overflow: {
|
|
23
23
|
type: String,
|
|
24
|
-
default: TagsOverflow.
|
|
24
|
+
default: TagsOverflow.Hidden
|
|
25
25
|
},
|
|
26
26
|
tagProps: {
|
|
27
27
|
type: Object,
|
|
@@ -29,11 +29,18 @@ var script = defineComponent({
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
emits: ['click', 'focus', 'blur', 'reset'],
|
|
32
|
-
expose: ['root'],
|
|
32
|
+
expose: ['root', 'container', 'overflowPopover'],
|
|
33
33
|
setup(props) {
|
|
34
34
|
// Refs
|
|
35
35
|
const root = ref();
|
|
36
36
|
const container = ref();
|
|
37
|
+
// Props
|
|
38
|
+
const {
|
|
39
|
+
overflow
|
|
40
|
+
} = toRefs(props);
|
|
41
|
+
const localOverflow = computed(() => {
|
|
42
|
+
return overflow.value === TagsOverflow.Default ? TagsOverflow.Hidden : overflow.value;
|
|
43
|
+
});
|
|
37
44
|
const overflowButton = ref();
|
|
38
45
|
const overflowButtonRoot = computed(() => {
|
|
39
46
|
var _a;
|
|
@@ -46,7 +53,7 @@ var script = defineComponent({
|
|
|
46
53
|
});
|
|
47
54
|
// Styles
|
|
48
55
|
const rootStyles = computed(() => ['or-tags-v3', ...Tags]);
|
|
49
|
-
const containerStyles = computed(() => [...TagsContainer, ...TagsContainerOverflows[
|
|
56
|
+
const containerStyles = computed(() => [...TagsContainer, ...TagsContainerOverflows[localOverflow.value]]);
|
|
50
57
|
const overflowButtonStyles = computed(() => [...TagsOverflowButton]);
|
|
51
58
|
const overflowPopoverStyles = computed(() => [...TagsOverflowPopover]);
|
|
52
59
|
// State
|
|
@@ -56,9 +63,14 @@ var script = defineComponent({
|
|
|
56
63
|
const overflowItems = computed(() => {
|
|
57
64
|
return props.items.slice(innerItems.value.length);
|
|
58
65
|
});
|
|
66
|
+
// Methods
|
|
67
|
+
function togglePopover() {
|
|
68
|
+
overflowPopover.value.toggle();
|
|
69
|
+
}
|
|
59
70
|
return {
|
|
60
71
|
root,
|
|
61
72
|
container,
|
|
73
|
+
localOverflow,
|
|
62
74
|
overflowButton,
|
|
63
75
|
overflowButtonRoot,
|
|
64
76
|
overflowPopover,
|
|
@@ -67,7 +79,8 @@ var script = defineComponent({
|
|
|
67
79
|
containerStyles,
|
|
68
80
|
overflowButtonStyles,
|
|
69
81
|
overflowPopoverStyles,
|
|
70
|
-
overflowItems
|
|
82
|
+
overflowItems,
|
|
83
|
+
togglePopover
|
|
71
84
|
};
|
|
72
85
|
}
|
|
73
86
|
});
|
|
@@ -83,19 +96,20 @@ var __vue_render__ = function () {
|
|
|
83
96
|
return _c('div', {
|
|
84
97
|
ref: "root",
|
|
85
98
|
class: _vm.rootStyles
|
|
86
|
-
}, [_c('div', {
|
|
99
|
+
}, [_vm.items.length > 0 ? _c('div', {
|
|
87
100
|
ref: "container",
|
|
88
101
|
class: _vm.containerStyles
|
|
89
|
-
}, _vm._l(_vm.items, function (item) {
|
|
102
|
+
}, [_vm._l(_vm.items, function (item) {
|
|
90
103
|
return _c('OrTag', _vm._b({
|
|
91
104
|
key: item,
|
|
105
|
+
staticClass: "max-w-full",
|
|
92
106
|
on: {
|
|
93
107
|
"reset": function ($event) {
|
|
94
108
|
return _vm.$emit('reset', item);
|
|
95
109
|
}
|
|
96
110
|
}
|
|
97
111
|
}, 'OrTag', _vm.tagProps, false), [_vm._v("\n " + _vm._s(item) + "\n ")]);
|
|
98
|
-
}),
|
|
112
|
+
}), _vm._v(" "), _vm.localOverflow === 'wrap' ? _vm._t("tail") : _vm._e()], 2) : _vm._e(), _vm._v(" "), _vm.localOverflow === 'hidden' && _vm.overflowItems.length > 0 ? [_c('OrButton', {
|
|
99
113
|
ref: "overflowButton",
|
|
100
114
|
class: _vm.overflowButtonStyles,
|
|
101
115
|
attrs: {
|
|
@@ -106,7 +120,7 @@ var __vue_render__ = function () {
|
|
|
106
120
|
on: {
|
|
107
121
|
"click": function ($event) {
|
|
108
122
|
$event.stopPropagation();
|
|
109
|
-
return _vm.
|
|
123
|
+
return _vm.togglePopover.apply(null, arguments);
|
|
110
124
|
}
|
|
111
125
|
}
|
|
112
126
|
}, [_vm._v("\n +" + _vm._s(_vm.overflowItems.length) + "\n ")]), _vm._v(" "), _c('OrPopover', {
|
|
@@ -125,7 +139,7 @@ var __vue_render__ = function () {
|
|
|
125
139
|
}
|
|
126
140
|
}
|
|
127
141
|
}, 'OrTag', _vm.tagProps, false), [_vm._v("\n " + _vm._s(item) + "\n ")]);
|
|
128
|
-
}), 1)])] : _vm._e()], 2);
|
|
142
|
+
}), 1)])] : _vm._e(), _vm._v(" "), _vm.localOverflow != 'wrap' || _vm.items.length === 0 ? _vm._t("tail") : _vm._e()], 2);
|
|
129
143
|
};
|
|
130
144
|
var __vue_staticRenderFns__ = [];
|
|
131
145
|
|