@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,5 +1,5 @@
|
|
|
1
|
-
import { defineComponent, ref, toRefs, computed, reactive, watch, nextTick } from 'vue-demi';
|
|
2
1
|
import { o as onClickOutside } from '../../index-cc89d6b7.js';
|
|
2
|
+
import { defineComponent, ref, toRefs, computed, reactive, watch, nextTick } from 'vue-demi';
|
|
3
3
|
import { TagInput, TagInputControl, TagInputItem } from './styles.js';
|
|
4
4
|
import __vue_component__$1 from '../OrErrorV3/OrError.js';
|
|
5
5
|
import __vue_component__$2 from '../OrHintV3/OrHint.js';
|
|
@@ -7,6 +7,7 @@ import __vue_component__$3 from '../OrIconButtonV3/OrIconButton.js';
|
|
|
7
7
|
import __vue_component__$4 from '../OrInputBoxV3/OrInputBox.js';
|
|
8
8
|
import __vue_component__$5 from '../OrLabelV3/OrLabel.js';
|
|
9
9
|
import __vue_component__$6 from '../OrTagsV3/OrTags.js';
|
|
10
|
+
import { TagColor } from '../OrTagV3/props.js';
|
|
10
11
|
import { TagsOverflow } from '../OrTagsV3/props.js';
|
|
11
12
|
import { useIdAttribute } from '../../hooks/useIdAttribute.js';
|
|
12
13
|
import { useControlAttributes } from '../../hooks/useControlAttributes.js';
|
|
@@ -104,6 +105,15 @@ var script = defineComponent({
|
|
|
104
105
|
const activated = ref(false);
|
|
105
106
|
const proxyModelValue = useProxyModelValue(modelValue, context.emit);
|
|
106
107
|
const draftModelValue = ref('');
|
|
108
|
+
const tagsItems = computed(() => {
|
|
109
|
+
return proxyModelValue.value.map(item => ({
|
|
110
|
+
label: item,
|
|
111
|
+
value: item,
|
|
112
|
+
tagProps: {
|
|
113
|
+
color: item === draftModelValue.value ? TagColor.Danger : TagColor.Default
|
|
114
|
+
}
|
|
115
|
+
}));
|
|
116
|
+
});
|
|
107
117
|
const currentLength = computed(() => {
|
|
108
118
|
var _a, _b;
|
|
109
119
|
return (_b = (_a = proxyModelValue.value) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
@@ -140,8 +150,7 @@ var script = defineComponent({
|
|
|
140
150
|
context.emit('focus');
|
|
141
151
|
}
|
|
142
152
|
function add() {
|
|
143
|
-
|
|
144
|
-
const newItem = (_a = draftModelValue.value) === null || _a === void 0 ? void 0 : _a.trim();
|
|
153
|
+
const newItem = draftModelValue.value;
|
|
145
154
|
if (!newItem) return;
|
|
146
155
|
if (proxyModelValue.value.includes(newItem)) return;
|
|
147
156
|
if (maxLength.value && currentLength.value >= maxLength.value) return;
|
|
@@ -180,6 +189,7 @@ var script = defineComponent({
|
|
|
180
189
|
controlAttributes,
|
|
181
190
|
proxyModelValue,
|
|
182
191
|
draftModelValue,
|
|
192
|
+
tagsItems,
|
|
183
193
|
currentLength,
|
|
184
194
|
maxLength,
|
|
185
195
|
activated,
|
|
@@ -195,7 +205,7 @@ var script = defineComponent({
|
|
|
195
205
|
}
|
|
196
206
|
});
|
|
197
207
|
|
|
198
|
-
var css_248z = "input[data-v-
|
|
208
|
+
var css_248z = "input[data-v-cfe6b850]{min-width:0;background:0 0;outline:0}";
|
|
199
209
|
styleInject(css_248z);
|
|
200
210
|
|
|
201
211
|
/* script */
|
|
@@ -224,14 +234,14 @@ var __vue_render__ = function () {
|
|
|
224
234
|
}], null, true)
|
|
225
235
|
}, [_vm._v("\n " + _vm._s(_vm.label) + "\n\n ")])] : _vm._e(), _vm._v(" "), _c('OrInputBox', {
|
|
226
236
|
ref: "inputBox",
|
|
227
|
-
|
|
237
|
+
class: ['interactivity-select'],
|
|
228
238
|
attrs: {
|
|
229
239
|
"variant": _vm.disableDefaultStyles ? 'unstyled' : 'styled',
|
|
230
|
-
"force-state": _vm.activated ? 'focus-within' : undefined,
|
|
231
240
|
"invalid": !!_vm.error,
|
|
232
241
|
"readonly": _vm.readonly,
|
|
233
242
|
"disabled": _vm.disabled,
|
|
234
|
-
"tabindex":
|
|
243
|
+
"tabindex": 0,
|
|
244
|
+
"force-state": _vm.activated ? 'focus-within' : undefined
|
|
235
245
|
},
|
|
236
246
|
on: {
|
|
237
247
|
"focus": _vm.activate
|
|
@@ -256,9 +266,9 @@ var __vue_render__ = function () {
|
|
|
256
266
|
} : null], null, true)
|
|
257
267
|
}, [_c('OrTags', {
|
|
258
268
|
ref: "tags",
|
|
259
|
-
|
|
269
|
+
class: ['grow'],
|
|
260
270
|
attrs: {
|
|
261
|
-
"items": _vm.
|
|
271
|
+
"items": _vm.tagsItems,
|
|
262
272
|
"disabled": _vm.disabled,
|
|
263
273
|
"tag-props": {
|
|
264
274
|
variant: _vm.readonly || _vm.disabled ? 'tag' : 'reset',
|
|
@@ -279,21 +289,24 @@ var __vue_render__ = function () {
|
|
|
279
289
|
}, [_c('input', _vm._b({
|
|
280
290
|
directives: [{
|
|
281
291
|
name: "model",
|
|
282
|
-
rawName: "v-model",
|
|
292
|
+
rawName: "v-model.trim",
|
|
283
293
|
value: _vm.draftModelValue,
|
|
284
|
-
expression: "draftModelValue"
|
|
294
|
+
expression: "draftModelValue",
|
|
295
|
+
modifiers: {
|
|
296
|
+
"trim": true
|
|
297
|
+
}
|
|
285
298
|
}],
|
|
286
299
|
ref: "control",
|
|
287
300
|
class: _vm.controlStyles,
|
|
288
301
|
style: _vm.controlInlineStyles,
|
|
289
302
|
attrs: {
|
|
303
|
+
"type": 'text',
|
|
290
304
|
"placeholder": _vm.proxyModelValue.length === 0 ? _vm.placeholder : undefined,
|
|
291
305
|
"readonly": _vm.readonly,
|
|
292
306
|
"disabled": _vm.disabled,
|
|
293
307
|
"autocomplete": 'off',
|
|
294
308
|
"minlength": undefined,
|
|
295
|
-
"maxlength": undefined
|
|
296
|
-
"type": 'text'
|
|
309
|
+
"maxlength": undefined
|
|
297
310
|
},
|
|
298
311
|
domProps: {
|
|
299
312
|
"value": _vm.draftModelValue
|
|
@@ -315,7 +328,10 @@ var __vue_render__ = function () {
|
|
|
315
328
|
if ($event.target.composing) {
|
|
316
329
|
return;
|
|
317
330
|
}
|
|
318
|
-
_vm.draftModelValue = $event.target.value;
|
|
331
|
+
_vm.draftModelValue = $event.target.value.trim();
|
|
332
|
+
},
|
|
333
|
+
"blur": function ($event) {
|
|
334
|
+
return _vm.$forceUpdate();
|
|
319
335
|
}
|
|
320
336
|
}
|
|
321
337
|
}, 'input', _vm.controlAttributes, false))])];
|
|
@@ -367,7 +383,7 @@ var __vue_staticRenderFns__ = [];
|
|
|
367
383
|
/* style */
|
|
368
384
|
const __vue_inject_styles__ = undefined;
|
|
369
385
|
/* scoped */
|
|
370
|
-
const __vue_scope_id__ = "data-v-
|
|
386
|
+
const __vue_scope_id__ = "data-v-cfe6b850";
|
|
371
387
|
/* module identifier */
|
|
372
388
|
const __vue_module_identifier__ = undefined;
|
|
373
389
|
/* functional template */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { PropType } from 'vue-demi';
|
|
2
2
|
import { TagsOverflow } from '../or-tags-v3';
|
|
3
|
+
import { TagObject } from '../or-tags-v3/types';
|
|
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>;
|
|
@@ -34,6 +35,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
34
35
|
};
|
|
35
36
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<string[]>;
|
|
36
37
|
draftModelValue: import("@vue/composition-api").Ref<string>;
|
|
38
|
+
tagsItems: import("@vue/composition-api").ComputedRef<TagObject[]>;
|
|
37
39
|
currentLength: import("@vue/composition-api").ComputedRef<number>;
|
|
38
40
|
maxLength: import("@vue/composition-api").ComputedRef<number | undefined>;
|
|
39
41
|
activated: import("@vue/composition-api").Ref<boolean>;
|
|
@@ -183,6 +185,7 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
|
|
|
183
185
|
};
|
|
184
186
|
proxyModelValue: import("../../hooks").UseProxyModelValueReturn<string[]>;
|
|
185
187
|
draftModelValue: import("@vue/composition-api").Ref<string>;
|
|
188
|
+
tagsItems: import("@vue/composition-api").ComputedRef<TagObject[]>;
|
|
186
189
|
currentLength: import("@vue/composition-api").ComputedRef<number>;
|
|
187
190
|
maxLength: import("@vue/composition-api").ComputedRef<number | undefined>;
|
|
188
191
|
activated: import("@vue/composition-api").Ref<boolean>;
|
|
@@ -127,13 +127,13 @@ var __vue_render__ = function () {
|
|
|
127
127
|
}, [_vm._l(_vm.localItems, function (item) {
|
|
128
128
|
return _c('OrTag', _vm._b({
|
|
129
129
|
key: item.value,
|
|
130
|
-
|
|
130
|
+
class: ['max-w-full'],
|
|
131
131
|
on: {
|
|
132
132
|
"reset": function ($event) {
|
|
133
133
|
return _vm.$emit('reset', item.value);
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
}, 'OrTag', _vm.tagProps, false), [_vm._v("\n " + _vm._s(item.label) + "\n ")]);
|
|
136
|
+
}, 'OrTag', Object.assign({}, _vm.tagProps, item.tagProps), false), [_vm._v("\n " + _vm._s(item.label) + "\n ")]);
|
|
137
137
|
}), _vm._v(" "), _vm.localOverflow === 'wrap' ? _vm._t("tail") : _vm._e()], 2) : _vm._e(), _vm._v(" "), _vm.localOverflow === 'hidden' && _vm.overflowItems.length > 0 ? [_c('OrButton', {
|
|
138
138
|
ref: "overflowButton",
|
|
139
139
|
class: _vm.overflowButtonStyles,
|
|
@@ -166,7 +166,7 @@ var __vue_render__ = function () {
|
|
|
166
166
|
return _vm.$emit('reset', item.value);
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
|
-
}, 'OrTag', _vm.tagProps, false), [_vm._v("\n " + _vm._s(item.label) + "\n ")]);
|
|
169
|
+
}, 'OrTag', Object.assign({}, _vm.tagProps, item.tagProps), false), [_vm._v("\n " + _vm._s(item.label) + "\n ")]);
|
|
170
170
|
}), 1)])] : _vm._e(), _vm._v(" "), _vm.localOverflow != 'wrap' || _vm.items.length === 0 ? _vm._t("tail") : _vm._e()], 2);
|
|
171
171
|
};
|
|
172
172
|
var __vue_staticRenderFns__ = [];
|
|
@@ -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
|
+
};
|