@onereach/ui-components 8.16.4 → 8.16.5-beta.3869.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.
Files changed (59) hide show
  1. package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.js +31 -15
  2. package/dist/bundled/v2/components/OrTagInputV3/OrTagInput.vue.d.ts +3 -0
  3. package/dist/bundled/v2/components/OrTagsV3/OrTags.js +2 -2
  4. package/dist/bundled/v2/components/OrTagsV3/types.d.ts +5 -4
  5. package/dist/bundled/v2/components/OrTimeRangePickerV3/OrTimeRangePicker.vue.d.ts +2 -2
  6. package/dist/bundled/v2/index.js +1 -1
  7. package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +1 -1
  8. package/dist/bundled/v3/components/OrSelectV3/index.js +1 -1
  9. package/dist/bundled/v3/components/OrSelectV3/styles.js +1 -1
  10. package/dist/bundled/v3/components/{OrSelectV3-f212f5c6.js → OrSelectV3-5abfcf77.js} +1 -1
  11. package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.js +1 -1
  12. package/dist/bundled/v3/components/OrTagInputV3/OrTagInput.vue.d.ts +2 -0
  13. package/dist/bundled/v3/components/OrTagInputV3/index.js +1 -1
  14. package/dist/bundled/v3/components/OrTagInputV3/styles.js +1 -1
  15. package/dist/bundled/v3/components/{OrTagInputV3-7b240c91.js → OrTagInputV3-072ea345.js} +23 -11
  16. package/dist/bundled/v3/components/OrTagV3/OrTag.js +1 -1
  17. package/dist/bundled/v3/components/OrTagV3/index.js +1 -1
  18. package/dist/bundled/v3/components/OrTagV3/props.js +1 -1
  19. package/dist/bundled/v3/components/OrTagV3/styles.js +1 -1
  20. package/dist/bundled/v3/components/{OrTagV3-43ee9066.js → OrTagV3-045cac0b.js} +1 -1
  21. package/dist/bundled/v3/components/OrTagsV3/OrTags.js +1 -1
  22. package/dist/bundled/v3/components/OrTagsV3/index.js +1 -1
  23. package/dist/bundled/v3/components/OrTagsV3/props.js +1 -1
  24. package/dist/bundled/v3/components/OrTagsV3/styles.js +1 -1
  25. package/dist/bundled/v3/components/OrTagsV3/types.d.ts +5 -4
  26. package/dist/bundled/v3/components/OrTagsV3/utils/castToTag.js +1 -1
  27. package/dist/bundled/v3/components/{OrTagsV3-bbda3acd.js → OrTagsV3-c1cb5281.js} +6 -3
  28. package/dist/bundled/v3/components/index.js +4 -4
  29. package/dist/bundled/v3/index.js +5 -5
  30. package/dist/esm/v2/{OrSelect-30f5ce68.js → OrSelect-11d109b7.js} +2 -2
  31. package/dist/esm/v2/{OrSelectMultipleControl-de32c83c.js → OrSelectMultipleControl-e7aac49f.js} +1 -1
  32. package/dist/esm/v2/{OrTagInput-2642f4d9.js → OrTagInput-ddb47599.js} +32 -16
  33. package/dist/esm/v2/{OrTags-9d3cf104.js → OrTags-64bb3145.js} +2 -2
  34. package/dist/esm/v2/components/index.js +4 -4
  35. package/dist/esm/v2/components/or-select-v3/index.js +3 -3
  36. package/dist/esm/v2/components/or-select-v3/partials/index.js +2 -2
  37. package/dist/esm/v2/components/or-select-v3/partials/or-select-multiple-control/index.js +2 -2
  38. package/dist/esm/v2/components/or-tag-input-v3/OrTagInput.vue.d.ts +3 -0
  39. package/dist/esm/v2/components/or-tag-input-v3/index.js +4 -4
  40. package/dist/esm/v2/components/or-tags-v3/index.js +1 -1
  41. package/dist/esm/v2/components/or-tags-v3/types.d.ts +5 -4
  42. package/dist/esm/v2/index.js +4 -4
  43. package/dist/esm/v3/{OrSelect-a65c0b08.js → OrSelect-3ec8ac94.js} +2 -2
  44. package/dist/esm/v3/{OrSelectMultipleControl-96320988.js → OrSelectMultipleControl-dde9c414.js} +1 -1
  45. package/dist/esm/v3/{OrTagInput-4cec4018.js → OrTagInput-a8115aa4.js} +23 -11
  46. package/dist/esm/v3/{OrTags-384a48e3.js → OrTags-810a6b03.js} +5 -2
  47. package/dist/esm/v3/components/index.js +4 -4
  48. package/dist/esm/v3/components/or-select-v3/index.js +3 -3
  49. package/dist/esm/v3/components/or-select-v3/partials/index.js +2 -2
  50. package/dist/esm/v3/components/or-select-v3/partials/or-select-multiple-control/index.js +2 -2
  51. package/dist/esm/v3/components/or-tag-input-v3/OrTagInput.vue.d.ts +2 -0
  52. package/dist/esm/v3/components/or-tag-input-v3/index.js +4 -4
  53. package/dist/esm/v3/components/or-tags-v3/index.js +1 -1
  54. package/dist/esm/v3/components/or-tags-v3/types.d.ts +5 -4
  55. package/dist/esm/v3/index.js +4 -4
  56. package/package.json +2 -3
  57. package/src/components/or-tag-input-v3/OrTagInput.vue +23 -12
  58. package/src/components/or-tags-v3/OrTags.vue +2 -2
  59. 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
- var _a;
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-d3bbd9d8]{min-width:0;background:0 0;outline:0}";
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
- staticClass: "cursor-text",
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": "0"
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
- staticClass: "grow",
269
+ class: ['grow'],
260
270
  attrs: {
261
- "items": _vm.proxyModelValue,
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-d3bbd9d8";
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
- staticClass: "max-w-full",
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,
@@ -1,6 +1,7 @@
1
- export type SimpleTag = string;
2
- export type Tag = SimpleTag | TagObject;
3
- export interface TagObject {
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
+ };
@@ -1,6 +1,6 @@
1
1
  import { PropType } from 'vue-demi';
2
2
  import { TimeRangePickerFormat, TimeRangePickerSize } from './props';
3
- declare const _default: import("vue2").ComponentOptions<import("vue2").default, import("@vue/composition-api").ShallowUnwrapRef<{
3
+ declare const _default: import("vue").ComponentOptions<import("vue").default, import("@vue/composition-api").ShallowUnwrapRef<{
4
4
  root: import("@vue/composition-api").Ref<HTMLElement | undefined>;
5
5
  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, {
6
6
  [x: string]: ((...args: any[]) => any) | null;
@@ -112,7 +112,7 @@ declare const _default: import("vue2").ComponentOptions<import("vue2").default,
112
112
  type: BooleanConstructor;
113
113
  default: boolean;
114
114
  };
115
- }>> & Omit<import("vue2").VueConstructor<import("vue2").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
115
+ }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
116
116
  modelValue: [Date, Date];
117
117
  format: "auto" | "h12" | "h23";
118
118
  size: "m" | "s";