@onereach/ui-components 2.72.2-beta.2278.0 → 2.72.2-beta.2283.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 (94) hide show
  1. package/dist/bundled/v2/{OrCardCollection-4ac89ea5.js → OrCardCollection-80ac6444.js} +1 -1
  2. package/dist/bundled/v2/{OrConfirm-8c0e957d.js → OrConfirm-ea6ea2f7.js} +1 -1
  3. package/dist/bundled/v2/{OrInput-00070eee.js → OrInput-57a47093.js} +28 -11
  4. package/dist/bundled/v2/{OrInputBox-2f559e98.js → OrInputBox-e54dcef9.js} +3 -3
  5. package/dist/bundled/v2/{OrSearch-09fd004c.js → OrSearch-2ff8cadd.js} +3 -4
  6. package/dist/bundled/v2/{OrSelect-2ececfc1.js → OrSelect-359e891b.js} +2 -2
  7. package/dist/bundled/v2/{OrText-15bf85c4.js → OrText-a665b991.js} +3 -36
  8. package/dist/bundled/v2/{OrTextarea-5c57c02b.js → OrTextarea-1201353b.js} +1 -1
  9. package/dist/bundled/v2/components/index.js +9 -9
  10. package/dist/bundled/v2/components/or-card-collection-v3/index.js +4 -4
  11. package/dist/bundled/v2/components/or-confirm-v3/index.js +3 -3
  12. package/dist/bundled/v2/components/or-input-box-v3/index.js +1 -1
  13. package/dist/bundled/v2/components/or-input-v3/OrInput.vue.d.ts +13 -0
  14. package/dist/bundled/v2/components/or-input-v3/index.js +3 -2
  15. package/dist/bundled/v2/components/or-search-v3/index.js +4 -3
  16. package/dist/bundled/v2/components/or-select-v3/index.js +4 -3
  17. package/dist/bundled/v2/components/or-text-v3/OrText.stories3.d.ts +1 -13
  18. package/dist/bundled/v2/components/or-text-v3/OrText.vue.d.ts +2 -27
  19. package/dist/bundled/v2/components/or-text-v3/index.js +1 -1
  20. package/dist/bundled/v2/components/or-textarea-v3/index.js +2 -2
  21. package/dist/bundled/v2/index.js +9 -9
  22. package/dist/bundled/v3/{OrCardCollection.vue_vue_type_script_lang-f76c3264.js → OrCardCollection.vue_vue_type_script_lang-09e66060.js} +1 -1
  23. package/dist/bundled/v3/{OrConfirm.vue_vue_type_script_lang-eb2bfce2.js → OrConfirm.vue_vue_type_script_lang-9aff9db3.js} +2 -2
  24. package/dist/bundled/v3/{OrInput-dcf2606e.js → OrInput-44a32124.js} +15 -6
  25. package/dist/bundled/v3/{OrInput.vue_vue_type_script_lang-27220623.js → OrInput.vue_vue_type_script_lang-4d9e2f4a.js} +15 -3
  26. package/dist/bundled/v3/{OrInputBox-4c7900c2.js → OrInputBox-358d4856.js} +1 -1
  27. package/dist/bundled/v3/{OrInputBox.vue_vue_type_script_lang-47d98e81.js → OrInputBox.vue_vue_type_script_lang-b387d4ba.js} +3 -3
  28. package/dist/bundled/v3/{OrSearch.vue_vue_type_script_lang-c054c8db.js → OrSearch.vue_vue_type_script_lang-faec384c.js} +4 -5
  29. package/dist/bundled/v3/{OrSelect.vue_vue_type_script_lang-7fd5e2f0.js → OrSelect.vue_vue_type_script_lang-c7a9bec2.js} +4 -4
  30. package/dist/bundled/v3/OrText.vue_vue_type_script_lang-271fb345.js +60 -0
  31. package/dist/bundled/v3/{OrTextarea.vue_vue_type_script_lang-296da567.js → OrTextarea.vue_vue_type_script_lang-de99a858.js} +2 -2
  32. package/dist/bundled/v3/components/index.js +11 -11
  33. package/dist/bundled/v3/components/or-card-collection-v3/index.js +6 -6
  34. package/dist/bundled/v3/components/or-confirm-v3/index.js +5 -5
  35. package/dist/bundled/v3/components/or-input-box-v3/index.js +1 -1
  36. package/dist/bundled/v3/components/or-input-v3/OrInput.vue.d.ts +13 -0
  37. package/dist/bundled/v3/components/or-input-v3/index.js +5 -3
  38. package/dist/bundled/v3/components/or-search-v3/index.js +7 -5
  39. package/dist/bundled/v3/components/or-select-v3/index.js +7 -5
  40. package/dist/bundled/v3/components/or-text-v3/OrText.stories3.d.ts +1 -13
  41. package/dist/bundled/v3/components/or-text-v3/OrText.vue.d.ts +2 -27
  42. package/dist/bundled/v3/components/or-text-v3/index.js +1 -1
  43. package/dist/bundled/v3/components/or-textarea-v3/index.js +3 -3
  44. package/dist/bundled/v3/index.js +16 -16
  45. package/dist/esm/v2/{OrCardCollection-5a9eda35.js → OrCardCollection-079828a4.js} +2 -2
  46. package/dist/esm/v2/{OrConfirm-9dbdedd7.js → OrConfirm-7dc26526.js} +1 -1
  47. package/dist/esm/v2/{OrInput-59a15d80.js → OrInput-3d8c8925.js} +28 -11
  48. package/dist/esm/v2/{OrInputBox-9ceb9fc4.js → OrInputBox-53d1f66d.js} +3 -3
  49. package/dist/esm/v2/{OrSearch-7411388b.js → OrSearch-f9b7e168.js} +3 -4
  50. package/dist/esm/v2/{OrSelect-e31d1c8b.js → OrSelect-bdb9a78a.js} +2 -2
  51. package/dist/esm/v2/{OrText-91d662a0.js → OrText-b12d0682.js} +3 -36
  52. package/dist/esm/v2/{OrTextarea-a5a3572b.js → OrTextarea-373d0554.js} +1 -1
  53. package/dist/esm/v2/components/index.js +9 -9
  54. package/dist/esm/v2/components/or-card-collection-v3/index.js +4 -4
  55. package/dist/esm/v2/components/or-confirm-v3/index.js +4 -4
  56. package/dist/esm/v2/components/or-input-box-v3/index.js +1 -1
  57. package/dist/esm/v2/components/or-input-v3/OrInput.vue.d.ts +13 -0
  58. package/dist/esm/v2/components/or-input-v3/index.js +4 -3
  59. package/dist/esm/v2/components/or-search-v3/index.js +5 -4
  60. package/dist/esm/v2/components/or-select-v3/index.js +5 -4
  61. package/dist/esm/v2/components/or-text-v3/OrText.stories3.d.ts +1 -13
  62. package/dist/esm/v2/components/or-text-v3/OrText.vue.d.ts +2 -27
  63. package/dist/esm/v2/components/or-text-v3/index.js +1 -1
  64. package/dist/esm/v2/components/or-textarea-v3/index.js +2 -2
  65. package/dist/esm/v2/index.js +8 -8
  66. package/dist/esm/v3/{OrCardCollection-e4fde5b4.js → OrCardCollection-c3a7cc7a.js} +2 -2
  67. package/dist/esm/v3/{OrConfirm-37454a63.js → OrConfirm-403896ca.js} +1 -1
  68. package/dist/esm/v3/{OrInput-bd054213.js → OrInput-71075f51.js} +27 -7
  69. package/dist/esm/v3/{OrInputBox-e16ade90.js → OrInputBox-2467d7e4.js} +3 -3
  70. package/dist/esm/v3/{OrSearch-5406bf03.js → OrSearch-21ac89f3.js} +3 -4
  71. package/dist/esm/v3/{OrSelect-466e50ca.js → OrSelect-c64eda46.js} +2 -2
  72. package/dist/esm/v3/{OrText-a3b00048.js → OrText-6b4f7cd1.js} +3 -36
  73. package/dist/esm/v3/{OrTextarea-37566985.js → OrTextarea-42d21f77.js} +1 -1
  74. package/dist/esm/v3/components/index.js +9 -9
  75. package/dist/esm/v3/components/or-card-collection-v3/index.js +4 -4
  76. package/dist/esm/v3/components/or-confirm-v3/index.js +4 -4
  77. package/dist/esm/v3/components/or-input-box-v3/index.js +1 -1
  78. package/dist/esm/v3/components/or-input-v3/OrInput.vue.d.ts +13 -0
  79. package/dist/esm/v3/components/or-input-v3/index.js +4 -3
  80. package/dist/esm/v3/components/or-search-v3/index.js +5 -4
  81. package/dist/esm/v3/components/or-select-v3/index.js +5 -4
  82. package/dist/esm/v3/components/or-text-v3/OrText.stories3.d.ts +1 -13
  83. package/dist/esm/v3/components/or-text-v3/OrText.vue.d.ts +2 -27
  84. package/dist/esm/v3/components/or-text-v3/index.js +1 -1
  85. package/dist/esm/v3/components/or-textarea-v3/index.js +2 -2
  86. package/dist/esm/v3/index.js +8 -8
  87. package/package.json +1 -1
  88. package/src/components/or-input-box-v3/styles.ts +3 -6
  89. package/src/components/or-input-v3/OrInput.stories3.ts +4 -0
  90. package/src/components/or-input-v3/OrInput.vue +39 -19
  91. package/src/components/or-search-v3/OrSearch.vue +1 -2
  92. package/src/components/or-text-v3/OrText.stories3.ts +5 -81
  93. package/src/components/or-text-v3/OrText.vue +3 -37
  94. package/dist/bundled/v3/OrText.vue_vue_type_script_lang-e93438ea.js +0 -93
@@ -6,42 +6,22 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
6
6
  mainText: import("@vue/composition-api").ComputedRef<string>;
7
7
  restText: import("@vue/composition-api").ComputedRef<string>;
8
8
  }> & import("@vue/composition-api").Data, {}, {}, {
9
- /**
10
- * Text to crop.
11
- */
12
9
  text: {
13
10
  type: StringConstructor;
14
11
  required: true;
15
12
  };
16
- /**
17
- * The index counted from the end of the string where ellipsis will be placed.
18
- * Defines how many ending characters will remain visible.
19
- * By default, ellipsis is placed in the end of the line.
20
- *
21
- * Note: Negative values behave same as corresponding positives still counting from the end of the line.
22
- */
23
13
  sliceIndex: {
24
14
  type: NumberConstructor;
25
- default: number;
15
+ default: undefined;
26
16
  };
27
17
  }, import("@vue/composition-api").ExtractPropTypes<{
28
- /**
29
- * Text to crop.
30
- */
31
18
  text: {
32
19
  type: StringConstructor;
33
20
  required: true;
34
21
  };
35
- /**
36
- * The index counted from the end of the string where ellipsis will be placed.
37
- * Defines how many ending characters will remain visible.
38
- * By default, ellipsis is placed in the end of the line.
39
- *
40
- * Note: Negative values behave same as corresponding positives still counting from the end of the line.
41
- */
42
22
  sliceIndex: {
43
23
  type: NumberConstructor;
44
- default: number;
24
+ default: undefined;
45
25
  };
46
26
  }>> & Omit<import("vue").VueConstructor<import("vue").default>, never> & (new (...args: any[]) => import("@vue/composition-api").ComponentRenderProxy<{
47
27
  text: string;
@@ -59,9 +39,4 @@ declare const _default: import("vue").ComponentOptions<import("vue").default, im
59
39
  } & {}, {
60
40
  sliceIndex: number;
61
41
  }, true>);
62
- /**
63
- * Use `OrText` component to crop un-wrapped single-line text with ellipsis inside narrow containers.
64
- * Ellipsis can be placed in the end or in the middle of the text. Convenient for displaying long labels,
65
- * that have same beginning and differ in the ending part.
66
- */
67
42
  export default _default;
@@ -1,3 +1,3 @@
1
- export { s as OrTextV3 } from '../../OrText-a3b00048.js';
1
+ export { s as OrTextV3 } from '../../OrText-6b4f7cd1.js';
2
2
  import 'vue-demi';
3
3
  import 'vue';
@@ -1,5 +1,5 @@
1
- export { s as OrTextareaV3 } from '../../OrTextarea-37566985.js';
2
- export { a as TextareaSize } from '../../OrInputBox-e16ade90.js';
1
+ export { s as OrTextareaV3 } from '../../OrTextarea-42d21f77.js';
2
+ export { a as TextareaSize } from '../../OrInputBox-2467d7e4.js';
3
3
  import 'vue-demi';
4
4
  import '../../useIdAttribute-859439f0.js';
5
5
  import '@vueuse/core';
@@ -6,7 +6,7 @@ export { b as BUTTON_COLOR, d as BUTTON_LOADER_TYPE, c as BUTTON_SIZE, B as BUTT
6
6
  export { a as ButtonColor, b as ButtonType, B as ButtonVariant, s as OrButtonV3 } from './OrButton-c56998e7.js';
7
7
  export { s as OrCard } from './OrCard-e3a5aea4.js';
8
8
  export { C as CARD_COLLECTION_LAYOUT, s as OrCardCollection } from './OrCardCollection-1e44c758.js';
9
- export { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from './OrCardCollection-e4fde5b4.js';
9
+ export { D as DefaultCardCollectionViews, s as OrCardCollectionV3, d as defaultViewModes, g as gridView, l as listView } from './OrCardCollection-c3a7cc7a.js';
10
10
  export { s as OrCardV3 } from './OrCard-cd6af82e.js';
11
11
  export { a as OrCarousel, s as OrCarouselItem } from './OrCarouselItem-636d99a1.js';
12
12
  export { s as OrCheckbox } from './OrCheckbox-ed4a19cf.js';
@@ -16,7 +16,7 @@ export { s as OrCode, O as OrCodeLanguages } from './OrCode-5ed69c23.js';
16
16
  export { s as OrCollapse } from './OrCollapse-445141ab.js';
17
17
  export { s as OrColorPicker, h as amber, n as black, b as blue, m as blueGrey, k as brown, c as cyan, j as deepOrange, d as deepPurple, g as green, i as indigo, l as lightBlue, e as lightGreen, f as lime, o as orange, p as pink, a as purple, r as red, t as teal, w as white, y as yellow } from './OrColorPicker-189cb097.js';
18
18
  export { s as OrConfirm } from './OrConfirm-c11ee2ec.js';
19
- export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-37454a63.js';
19
+ export { C as ConfirmType, s as OrConfirmV3 } from './OrConfirm-403896ca.js';
20
20
  export { D as DEFAULT_TEXT, s as OrDateTimePicker, a as OrDateTimePickerItemTypes, O as OrDateTimePickerTypes } from './OrDateTimePicker-f2e08564.js';
21
21
  export { s as OrError } from './OrError-f90296db.js';
22
22
  export { s as OrErrorTagV3 } from './OrErrorTag-308119de.js';
@@ -34,8 +34,8 @@ export { I as InlineInputBoxSize, I as InlineInputSize, s as OrInlineInputBoxV3
34
34
  export { I as InlineInputType, s as OrInlineInputV3 } from './OrInlineInput-fbc35f85.js';
35
35
  export { a as InlineTextEditTrimmingTypes, I as InlineTextEditTypes, s as OrInlineTextEdit } from './OrInlineTextEdit-1aa477b5.js';
36
36
  export { s as OrInlineTextareaV3 } from './OrInlineTextarea-79da8697.js';
37
- export { a as InputBoxSize, I as InputBoxVariant, a as InputSize, s as OrInputBoxV3, a as SearchSize, a as SelectSize, a as TextareaSize } from './OrInputBox-e16ade90.js';
38
- export { I as InputType, s as OrInputV3 } from './OrInput-bd054213.js';
37
+ export { a as InputBoxSize, I as InputBoxVariant, a as InputSize, s as OrInputBoxV3, a as SearchSize, a as SelectSize, a as TextareaSize } from './OrInputBox-2467d7e4.js';
38
+ export { I as InputType, s as OrInputV3 } from './OrInput-71075f51.js';
39
39
  export { s as OrInput } from './OrInput-81125804.js';
40
40
  export { s as OrLabel } from './OrLabel-876f8729.js';
41
41
  export { L as LabelVariant, s as OrLabelV3 } from './OrLabel-f700f9fb.js';
@@ -63,10 +63,10 @@ export { s as OrRadio } from './OrRadio-c3ab11f2.js';
63
63
  export { s as OrRadioGroup } from './OrRadioGroup-00785e41.js';
64
64
  export { s as OrRadioV3 } from './OrRadio-bb9b37c1.js';
65
65
  export { s as OrSearch } from './OrSearch-11fdf667.js';
66
- export { s as OrSearchV3 } from './OrSearch-5406bf03.js';
66
+ export { s as OrSearchV3 } from './OrSearch-21ac89f3.js';
67
67
  export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-880b4911.js';
68
68
  export { s as OrSelect } from './OrSelect-0821b907.js';
69
- export { s as OrSelectV3 } from './OrSelect-466e50ca.js';
69
+ export { s as OrSelectV3 } from './OrSelect-c64eda46.js';
70
70
  export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
71
71
  export { O as OrSidebarPlacement, s as OrSidebarV3 } from './OrSidebar-a62972f5.js';
72
72
  export { s as OrSkeletonCircle, a as OrSkeletonRect, b as OrSkeletonText, O as OrSkeletonTextSizes } from './OrSkeletonText-2b1610ce.js';
@@ -85,9 +85,9 @@ export { s as OrTag } from './OrTag-1b5e43fa.js';
85
85
  export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-148ff9ae.js';
86
86
  export { s as OrTeleport } from './OrTeleportVue3-ad639f12.js';
87
87
  export { s as OrTeleportV3 } from './OrTeleport.vue3-8099178c.js';
88
- export { s as OrTextV3 } from './OrText-a3b00048.js';
88
+ export { s as OrTextV3 } from './OrText-6b4f7cd1.js';
89
89
  export { s as OrTextarea } from './OrTextarea-1f5c3be1.js';
90
- export { s as OrTextareaV3 } from './OrTextarea-37566985.js';
90
+ export { s as OrTextareaV3 } from './OrTextarea-42d21f77.js';
91
91
  export { s as OrTextbox, T as TextboxTypes } from './OrTextbox-2f33e9c3.js';
92
92
  export { s as OrToast, a as OrToastContainer } from './OrToastContainer-40c4c1c8.js';
93
93
  export { P as PositionsX, b as PositionsY, c as ToastType, T as TransitionType, a as useQueue, u as useToast } from './useToast-4fbe0e5a.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "2.72.2-beta.2278.0",
3
+ "version": "2.72.2-beta.2283.0",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -90,13 +90,11 @@ export const InputBoxRootVariants: Record<InputBoxVariant, string[]> = {
90
90
  export const InputBoxRootSizes: Record<InputBoxSize, string[]> = {
91
91
  'm': [
92
92
  // Box
93
- 'children:min-h-[34px]',
93
+ 'children:min-h-[46px] children:md:min-h-[34px]',
94
94
 
95
95
  // Spacing
96
96
  'first-child:pl-md first-child:md:pl-sm+',
97
97
  'last-child:pr-md last-child:md:pr-sm+',
98
- 'children:pt-[11px] children:md:pt-[7px]',
99
- 'children:pb-[11px] children:md:pb-[6px]',
100
98
 
101
99
  'gap-sm+ md:gap-sm',
102
100
 
@@ -109,9 +107,8 @@ export const InputBoxRootSizes: Record<InputBoxSize, string[]> = {
109
107
  'children:min-h-[30px]',
110
108
 
111
109
  // Spacing
112
- 'first-child:pl-sm',
113
- 'last-child:pr-sm',
114
- 'children:py-[6px]',
110
+ 'first-child:pl-md first-child:md:pl-sm+',
111
+ 'last-child:pr-md last-child:md:pr-sm+',
115
112
 
116
113
  'gap-[6px]',
117
114
 
@@ -62,6 +62,10 @@ export default {
62
62
  control: { type: 'text' },
63
63
  },
64
64
 
65
+ loading: {
66
+ control: { type: 'boolean' },
67
+ },
68
+
65
69
  required: {
66
70
  control: { type: 'boolean' },
67
71
  },
@@ -22,7 +22,7 @@
22
22
  :variant="disableDefaultStyles ? 'unstyled' : 'styled'"
23
23
  :size="size"
24
24
  :invalid="invalid"
25
- :readonly="readonly"
25
+ :readonly="readonly || loading"
26
26
  :disabled="disabled"
27
27
  >
28
28
  <input
@@ -33,7 +33,7 @@
33
33
  :type="type === 'password' && disclosed ? 'text' : type"
34
34
  :placeholder="placeholder"
35
35
  :required="required"
36
- :readonly="readonly"
36
+ :readonly="readonly || loading"
37
37
  :disabled="disabled"
38
38
  @keydown="$emit('keydown', $event)"
39
39
  @keyup="$emit('keyup', $event)"
@@ -42,30 +42,40 @@
42
42
  >
43
43
 
44
44
  <div :class="['layout-row']">
45
- <template v-if="type === 'password'">
46
- <OrIconButton
47
- :icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
48
- :color="'inherit'"
49
- :disabled="disabled"
50
- @click.stop="disclosed = !disclosed"
45
+ <template v-if="loading">
46
+ <OrLoader
47
+ :variant="'circular'"
48
+ :color="'primary'"
49
+ :size="isMobile ? 'm' : 's'"
51
50
  />
52
51
  </template>
53
52
 
54
- <template v-if="type === 'search'">
55
- <template v-if="modelValue">
53
+ <template v-else>
54
+ <template v-if="type === 'password'">
56
55
  <OrIconButton
57
- :icon="'close'"
56
+ :icon="{ icon: disclosed ? 'visibility_off' : 'visibility', variant: 'filled' }"
58
57
  :color="'inherit'"
59
- :disabled="readonly || disabled"
60
- @click.stop="$emit('update:modelValue', '')"
58
+ :disabled="disabled"
59
+ @click.stop="disclosed = !disclosed"
61
60
  />
62
61
  </template>
63
62
 
64
- <template v-else>
65
- <OrIcon
66
- :icon="'search'"
67
- :variant="'outlined'"
68
- />
63
+ <template v-if="type === 'search'">
64
+ <template v-if="modelValue">
65
+ <OrIconButton
66
+ :icon="'close'"
67
+ :color="'inherit'"
68
+ :disabled="readonly || disabled"
69
+ @click.stop="$emit('update:modelValue', '')"
70
+ />
71
+ </template>
72
+
73
+ <template v-else>
74
+ <OrIcon
75
+ :icon="'search'"
76
+ :variant="'outlined'"
77
+ />
78
+ </template>
69
79
  </template>
70
80
  </template>
71
81
  </div>
@@ -103,13 +113,14 @@
103
113
 
104
114
  <script lang="ts">
105
115
  import { computed, defineComponent, PropType, reactive, ref } from 'vue-demi';
106
- import { useControlAttributes, useIdAttribute, useValidationAttributes } from '../../hooks';
116
+ import { useControlAttributes, useIdAttribute, useResponsive, useValidationAttributes } from '../../hooks';
107
117
  import { OrErrorV3 as OrError } from '../or-error-v3';
108
118
  import { OrHintV3 as OrHint } from '../or-hint-v3';
109
119
  import { OrIconButtonV3 as OrIconButton } from '../or-icon-button-v3';
110
120
  import { OrIconV3 as OrIcon } from '../or-icon-v3';
111
121
  import { OrInputBoxV3 as OrInputBox } from '../or-input-box-v3';
112
122
  import { OrLabelV3 as OrLabel } from '../or-label-v3';
123
+ import { OrLoaderV3 as OrLoader } from '../or-loader-v3';
113
124
  import { InputSize, InputType } from './props';
114
125
  import { InputControl, InputRoot } from './styles';
115
126
 
@@ -123,6 +134,7 @@ export default defineComponent({
123
134
  OrIconButton,
124
135
  OrInputBox,
125
136
  OrLabel,
137
+ OrLoader,
126
138
  },
127
139
 
128
140
  model: {
@@ -166,6 +178,11 @@ export default defineComponent({
166
178
  default: undefined,
167
179
  },
168
180
 
181
+ loading: {
182
+ type: Boolean,
183
+ default: false,
184
+ },
185
+
169
186
  required: {
170
187
  type: Boolean,
171
188
  default: false,
@@ -240,6 +257,8 @@ export default defineComponent({
240
257
 
241
258
  const disclosed = ref(false);
242
259
 
260
+ const { isMobile } = useResponsive();
261
+
243
262
  // Methods
244
263
  function focus(): void {
245
264
  control.value?.focus();
@@ -260,6 +279,7 @@ export default defineComponent({
260
279
  maxLength,
261
280
  invalid,
262
281
  disclosed,
282
+ isMobile,
263
283
  focus,
264
284
  blur,
265
285
  };
@@ -94,13 +94,12 @@ export default defineComponent({
94
94
  // Events
95
95
  debouncedWatch(
96
96
  localModelValue,
97
- () => localModelValue.value.length > 0 && context.emit('search', localModelValue.value),
97
+ () => context.emit('search', localModelValue.value),
98
98
  { debounce: props.debounce },
99
99
  );
100
100
 
101
101
  watch(localModelValue, (val, beforeVal) => {
102
102
  if (val.length === 0 && beforeVal.length > 0) {
103
- context.emit('search');
104
103
  context.emit('clear');
105
104
  }
106
105
  });
@@ -34,89 +34,13 @@ const Template: StoryFn<typeof OrText> = (args) => ({
34
34
  },
35
35
 
36
36
  template: `
37
- <div class="w-2/5 mx-auto px-md bg-surface-2 dark:bg-surface-2-dark">
38
- <OrText v-bind="args" />
39
- </div>
37
+ <OrText v-bind="args" />
40
38
  `,
41
39
  });
42
40
 
43
- export const Default = Template.bind({});
44
- Default.args = {
45
- // Props
46
- text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt \
47
- ut labore et dolore magna aliqua.',
48
- };
49
-
50
- export const MiddleCrop = Template.bind({});
51
- MiddleCrop.args = {
52
- ...Default.args,
53
- sliceIndex: 12,
54
- };
55
-
56
- export const TooFarLeft = Template.bind({});
57
- TooFarLeft.args = {
58
- ...Default.args,
59
- sliceIndex: 120,
60
- };
61
- TooFarLeft.parameters = {
62
- docs: {
63
- description: {
64
- story: 'Caution. If `sliceIndex` is greater than the visible part length, \
65
- then beginning part with ellipsis is not displayed and ending part overflows the container.',
66
- },
67
- },
68
- };
69
-
70
- export const ComplexContainer: StoryFn<typeof OrText> = (args) => ({
71
- components: {
72
- OrText,
73
- },
74
-
75
- setup() {
76
- return { args };
77
- },
41
+ export const Text = Template.bind({});
78
42
 
79
- template: `
80
- <h3 class="typography-headline-3 mb-md">Flex container side effect</h3>
81
- <div class="w-[300px] flex bg-surface-2 dark:bg-surface-2-dark">
82
- <!-- fixed part -->
83
- <div class="w-[20px]" />
84
- <!-- growing part -->
85
- <div class="grow px-md">
86
- <OrText v-bind="args" />
87
- </div>
88
- </div>
89
- <h3 class="typography-headline-3 my-md">Solution with a wrapper</h3>
90
- <div class="w-[300px] flex bg-surface-2 dark:bg-surface-2-dark">
91
- <!-- fixed part -->
92
- <div class="w-[20px]" />
93
- <!-- growing part -->
94
- <div class="grow px-md min-w-0">
95
- <OrText v-bind="args" />
96
- </div>
97
- </div>
98
- <h3 class="typography-headline-3 my-md">Solution without a wrapper</h3>
99
- <div class="w-[300px] flex bg-surface-2 dark:bg-surface-2-dark">
100
- <!-- fixed part -->
101
- <div class="w-[20px]" />
102
- <!-- growing part -->
103
- <OrText v-bind="args" class="grow px-md min-w-0"/>
104
- </div>
105
- `,
106
- });
107
- ComplexContainer.storyName = 'Growing Flex Container';
108
- ComplexContainer.args = {
109
- ...Default.args,
110
- sliceIndex: 12,
111
- };
112
- ComplexContainer.parameters = {
113
- docs: {
114
- description: {
115
- story: 'In a special case when OrText is placed inside a variable width container,\
116
- such as a flexbox growing block, or when it is itself a growing flexbox item,\
117
- there is a problem for a browser to proper calculate the cropping position.\
118
- As a solution place a `min-width: 0;` style (tailwind class `min-w-0`)\
119
- to the growing item - container or the OrText itself.',
120
- },
121
- },
43
+ Text.args = {
44
+ // Props
45
+ text: 'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
122
46
  };
@@ -17,33 +17,18 @@
17
17
  import { computed, defineComponent, ref } from 'vue-demi';
18
18
  import { MainText, RestText, TextRoot } from './styles';
19
19
 
20
- /**
21
- * Use `OrText` component to crop un-wrapped single-line text with ellipsis inside narrow containers.
22
- * Ellipsis can be placed in the end or in the middle of the text. Convenient for displaying long labels,
23
- * that have same beginning and differ in the ending part.
24
- */
25
20
  export default defineComponent({
26
21
  name: 'OrText',
27
22
 
28
23
  props: {
29
- /**
30
- * Text to crop.
31
- */
32
24
  text: {
33
25
  type: String,
34
26
  required: true,
35
27
  },
36
28
 
37
- /**
38
- * The index counted from the end of the string where ellipsis will be placed.
39
- * Defines how many ending characters will remain visible.
40
- * By default, ellipsis is placed in the end of the line.
41
- *
42
- * Note: Negative values behave same as corresponding positives still counting from the end of the line.
43
- */
44
29
  sliceIndex: {
45
30
  type: Number,
46
- default: 0,
31
+ default: undefined,
47
32
  },
48
33
  },
49
34
 
@@ -69,36 +54,17 @@ export default defineComponent({
69
54
  ...RestText,
70
55
  ]);
71
56
 
72
- /**
73
- * Preserves whitespace at the last position as <code>&nbsp;</code>
74
- * @param str A string to escape
75
- */
76
- const escapeLast = (str: string): string => str && (str.slice(0, -1) + '\xa0');
77
- /**
78
- * Preserves whitespace at the first position as <code>&nbsp;</code>
79
- * @param str A string to escape
80
- */
81
- const escapeFirst = (str: string): string => str && ('\xa0' + str.slice(1));
82
-
83
57
  // State
84
58
  const mainText = computed(() => {
85
59
  if (props.sliceIndex) {
86
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
87
- if (mainPart[mainPart.length - 1] === ' ') {
88
- mainPart = escapeLast(mainPart);
89
- }
90
- return mainPart;
60
+ return props.text.slice(0, Math.abs(props.sliceIndex) * -1);
91
61
  }
92
62
 
93
63
  return props.text;
94
64
  });
95
65
 
96
66
  const restText = computed(() => {
97
- let restPart = props.text.slice(mainText.value.length);
98
- if (restPart[0] === ' ') {
99
- restPart = escapeFirst(restPart);
100
- }
101
- return restPart;
67
+ return props.text.slice(mainText.value.length);
102
68
  });
103
69
 
104
70
  return {
@@ -1,93 +0,0 @@
1
- import { defineComponent, ref, computed } from 'vue';
2
-
3
- const TextRoot = [
4
- // Layout
5
- 'inline-flex',
6
- // Box
7
- 'max-w-full',
8
- // Typography
9
- 'whitespace-nowrap'];
10
- const MainText = [
11
- // Layout
12
- 'overflow-hidden',
13
- // Typography
14
- 'text-ellipsis'];
15
- const RestText = [
16
- // Layout
17
- 'shrink'];
18
-
19
- /**
20
- * Use `OrText` component to crop un-wrapped single-line text with ellipsis inside narrow containers.
21
- * Ellipsis can be placed in the end or in the middle of the text. Convenient for displaying long labels,
22
- * that have same beginning and differ in the ending part.
23
- */
24
- var script = defineComponent({
25
- name: 'OrText',
26
- props: {
27
- /**
28
- * Text to crop.
29
- */
30
- text: {
31
- type: String,
32
- required: true
33
- },
34
- /**
35
- * The index counted from the end of the string where ellipsis will be placed.
36
- * Defines how many ending characters will remain visible.
37
- * By default, ellipsis is placed in the end of the line.
38
- *
39
- * Note: Negative values behave same as corresponding positives still counting from the end of the line.
40
- */
41
- sliceIndex: {
42
- type: Number,
43
- default: 0
44
- }
45
- },
46
- expose: ['root'],
47
- setup(props) {
48
- // Refs
49
- const root = ref();
50
- // Styles
51
- const rootStyles = computed(() => ['or-text', ...TextRoot]);
52
- const mainTextStyles = computed(() => [...MainText]);
53
- const restTextStyles = computed(() => [...RestText]);
54
- /**
55
- * Preserves whitespace at the last position as <code>&nbsp;</code>
56
- * @param str A string to escape
57
- */
58
- const escapeLast = str => str && str.slice(0, -1) + '\xa0';
59
- /**
60
- * Preserves whitespace at the first position as <code>&nbsp;</code>
61
- * @param str A string to escape
62
- */
63
- const escapeFirst = str => str && '\xa0' + str.slice(1);
64
- // State
65
- const mainText = computed(() => {
66
- if (props.sliceIndex) {
67
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
68
- if (mainPart[mainPart.length - 1] === ' ') {
69
- mainPart = escapeLast(mainPart);
70
- }
71
- return mainPart;
72
- }
73
- return props.text;
74
- });
75
- const restText = computed(() => {
76
- let restPart = props.text.slice(mainText.value.length);
77
- if (restPart[0] === ' ') {
78
- restPart = escapeFirst(restPart);
79
- }
80
- return restPart;
81
- });
82
- return {
83
- root,
84
- rootStyles,
85
- mainTextStyles,
86
- restTextStyles,
87
- mainText,
88
- restText
89
- };
90
- }
91
- });
92
-
93
- export { script as s };