@onereach/ui-components 4.3.10 → 4.3.11-beta.2661.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.
@@ -38,19 +38,19 @@ var script = defineComponent({
38
38
  const mainTextStyles = computed(() => [...MainText]);
39
39
  const restTextStyles = computed(() => [...RestText]);
40
40
  /**
41
- * Preserves whitespace at the last position as <code>&nbsp;</code>
41
+ * Preserves whitespace at the first position as <code>&nbsp;</code>
42
42
  * @param str A string to escape
43
43
  */
44
- const escapeLast = str => str && str.slice(0, -1) + '\xa0';
44
+ const escapeFirst = str => str && '\xa0' + str.slice(1);
45
45
  /**
46
- * Preserves whitespace at the first position as <code>&nbsp;</code>
46
+ * Preserves whitespace at the last position as <code>&nbsp;</code>
47
47
  * @param str A string to escape
48
48
  */
49
- const escapeFirst = str => str && '\xa0' + str.slice(1);
49
+ const escapeLast = str => str && str.slice(0, -1) + '\xa0';
50
50
  // State
51
51
  const mainText = computed(() => {
52
- if (props.sliceIndex) {
53
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
52
+ if (props.sliceIndex && props.sliceIndex <= props.text.length) {
53
+ let mainPart = props.text.slice(0, Math.abs(props.sliceIndex) * -1);
54
54
  if (mainPart[mainPart.length - 1] === ' ') {
55
55
  mainPart = escapeLast(mainPart);
56
56
  }
@@ -37,19 +37,19 @@ var script = defineComponent({
37
37
  const mainTextStyles = computed(() => [...MainText]);
38
38
  const restTextStyles = computed(() => [...RestText]);
39
39
  /**
40
- * Preserves whitespace at the last position as <code>&nbsp;</code>
40
+ * Preserves whitespace at the first position as <code>&nbsp;</code>
41
41
  * @param str A string to escape
42
42
  */
43
- const escapeLast = str => str && str.slice(0, -1) + '\xa0';
43
+ const escapeFirst = str => str && '\xa0' + str.slice(1);
44
44
  /**
45
- * Preserves whitespace at the first position as <code>&nbsp;</code>
45
+ * Preserves whitespace at the last position as <code>&nbsp;</code>
46
46
  * @param str A string to escape
47
47
  */
48
- const escapeFirst = str => str && '\xa0' + str.slice(1);
48
+ const escapeLast = str => str && str.slice(0, -1) + '\xa0';
49
49
  // State
50
50
  const mainText = computed(() => {
51
- if (props.sliceIndex) {
52
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
51
+ if (props.sliceIndex && props.sliceIndex <= props.text.length) {
52
+ let mainPart = props.text.slice(0, Math.abs(props.sliceIndex) * -1);
53
53
  if (mainPart[mainPart.length - 1] === ' ') {
54
54
  mainPart = escapeLast(mainPart);
55
55
  }
@@ -1,5 +1,5 @@
1
- import { s as script } from '../../OrText.vue_vue_type_script_lang-23ff666f.js';
2
- export { s as default } from '../../OrText.vue_vue_type_script_lang-23ff666f.js';
1
+ import { s as script } from '../../OrText.vue_vue_type_script_lang-6563b52f.js';
2
+ export { s as default } from '../../OrText.vue_vue_type_script_lang-6563b52f.js';
3
3
  import { openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString } from 'vue';
4
4
  import 'vue-demi';
5
5
  import './styles.js';
@@ -1,3 +1,3 @@
1
- export { s as OrTextV3 } from '../../OrText.vue_vue_type_script_lang-23ff666f.js';
1
+ export { s as OrTextV3 } from '../../OrText.vue_vue_type_script_lang-6563b52f.js';
2
2
  import 'vue-demi';
3
3
  import './styles.js';
@@ -135,7 +135,7 @@ export { s as OrTagV3 } from '../OrTag.vue_vue_type_script_lang-8643b784.js';
135
135
  export { TagColor, TagVariant } from './OrTagV3/props.js';
136
136
  export { default as OrTeleport } from './OrTeleport/OrTeleport.js';
137
137
  export { s as OrTeleportV3 } from '../OrTeleport.vue3.vue_vue_type_script_lang-a6ce162e.js';
138
- export { s as OrTextV3 } from '../OrText.vue_vue_type_script_lang-23ff666f.js';
138
+ export { s as OrTextV3 } from '../OrText.vue_vue_type_script_lang-6563b52f.js';
139
139
  export { s as OrTextarea } from '../OrTextarea.vue_vue_type_script_lang-048cb245.js';
140
140
  export { s as OrTextareaV3 } from '../OrTextarea.vue_vue_type_script_lang-f287189f.js';
141
141
  export { s as OrTextbox } from '../OrTextbox.vue_vue_type_script_lang-dad835c3.js';
@@ -110,7 +110,7 @@ export { s as OrTabsV3 } from './OrTabs.vue_vue_type_script_lang-6d47e560.js';
110
110
  import './components/OrTag/OrTag.js';
111
111
  export { s as OrTag } from './OrTag.vue_vue_type_script_lang-4e98d8a0.js';
112
112
  import './components/OrTextV3/OrText.js';
113
- export { s as OrTextV3 } from './OrText.vue_vue_type_script_lang-23ff666f.js';
113
+ export { s as OrTextV3 } from './OrText.vue_vue_type_script_lang-6563b52f.js';
114
114
  import './components/OrTextarea/OrTextarea.js';
115
115
  export { s as OrTextarea } from './OrTextarea.vue_vue_type_script_lang-048cb245.js';
116
116
  import './components/OrTextareaV3/OrTextarea.js';
@@ -53,19 +53,19 @@ var script = defineComponent({
53
53
  const mainTextStyles = computed(() => [...MainText]);
54
54
  const restTextStyles = computed(() => [...RestText]);
55
55
  /**
56
- * Preserves whitespace at the last position as <code>&nbsp;</code>
56
+ * Preserves whitespace at the first position as <code>&nbsp;</code>
57
57
  * @param str A string to escape
58
58
  */
59
- const escapeLast = str => str && str.slice(0, -1) + '\xa0';
59
+ const escapeFirst = str => str && '\xa0' + str.slice(1);
60
60
  /**
61
- * Preserves whitespace at the first position as <code>&nbsp;</code>
61
+ * Preserves whitespace at the last position as <code>&nbsp;</code>
62
62
  * @param str A string to escape
63
63
  */
64
- const escapeFirst = str => str && '\xa0' + str.slice(1);
64
+ const escapeLast = str => str && str.slice(0, -1) + '\xa0';
65
65
  // State
66
66
  const mainText = computed(() => {
67
- if (props.sliceIndex) {
68
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
67
+ if (props.sliceIndex && props.sliceIndex <= props.text.length) {
68
+ let mainPart = props.text.slice(0, Math.abs(props.sliceIndex) * -1);
69
69
  if (mainPart[mainPart.length - 1] === ' ') {
70
70
  mainPart = escapeLast(mainPart);
71
71
  }
@@ -98,7 +98,7 @@ export { _ as OrTag } from '../OrTag-8ded4261.js';
98
98
  export { _ as OrTagV3, a as TagColor, T as TagVariant } from '../OrTag-843ec724.js';
99
99
  export { _ as OrTeleport } from '../OrTeleport.vue2-f0c16c71.js';
100
100
  export { _ as OrTeleportV3 } from '../OrTeleport.vue2-424c7f33.js';
101
- export { _ as OrTextV3 } from '../OrText-6097bca5.js';
101
+ export { _ as OrTextV3 } from '../OrText-912e8ba8.js';
102
102
  export { _ as OrTextarea } from '../OrTextarea-226ab7a2.js';
103
103
  export { _ as OrTextareaV3 } from '../OrTextarea-800f63d4.js';
104
104
  export { _ as OrTextbox, T as TextboxTypes } from '../OrTextbox-90badc95.js';
@@ -1,3 +1,3 @@
1
- export { _ as OrTextV3 } from '../../OrText-6097bca5.js';
1
+ export { _ as OrTextV3 } from '../../OrText-912e8ba8.js';
2
2
  import 'vue-demi';
3
3
  import '../../normalize-component-6e8e3d80.js';
@@ -98,7 +98,7 @@ export { _ as OrTag } from './OrTag-8ded4261.js';
98
98
  export { _ as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-843ec724.js';
99
99
  export { _ as OrTeleport } from './OrTeleport.vue2-f0c16c71.js';
100
100
  export { _ as OrTeleportV3 } from './OrTeleport.vue2-424c7f33.js';
101
- export { _ as OrTextV3 } from './OrText-6097bca5.js';
101
+ export { _ as OrTextV3 } from './OrText-912e8ba8.js';
102
102
  export { _ as OrTextarea } from './OrTextarea-226ab7a2.js';
103
103
  export { _ as OrTextareaV3 } from './OrTextarea-800f63d4.js';
104
104
  export { _ as OrTextbox, T as TextboxTypes } from './OrTextbox-90badc95.js';
@@ -53,19 +53,19 @@ var script = defineComponent({
53
53
  const mainTextStyles = computed(() => [...MainText]);
54
54
  const restTextStyles = computed(() => [...RestText]);
55
55
  /**
56
- * Preserves whitespace at the last position as <code>&nbsp;</code>
56
+ * Preserves whitespace at the first position as <code>&nbsp;</code>
57
57
  * @param str A string to escape
58
58
  */
59
- const escapeLast = str => str && str.slice(0, -1) + '\xa0';
59
+ const escapeFirst = str => str && '\xa0' + str.slice(1);
60
60
  /**
61
- * Preserves whitespace at the first position as <code>&nbsp;</code>
61
+ * Preserves whitespace at the last position as <code>&nbsp;</code>
62
62
  * @param str A string to escape
63
63
  */
64
- const escapeFirst = str => str && '\xa0' + str.slice(1);
64
+ const escapeLast = str => str && str.slice(0, -1) + '\xa0';
65
65
  // State
66
66
  const mainText = computed(() => {
67
- if (props.sliceIndex) {
68
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
67
+ if (props.sliceIndex && props.sliceIndex <= props.text.length) {
68
+ let mainPart = props.text.slice(0, Math.abs(props.sliceIndex) * -1);
69
69
  if (mainPart[mainPart.length - 1] === ' ') {
70
70
  mainPart = escapeLast(mainPart);
71
71
  }
@@ -96,7 +96,7 @@ export { s as OrTag } from '../OrTag-2d9eacf8.js';
96
96
  export { s as OrTagV3, a as TagColor, T as TagVariant } from '../OrTag-6116c6e3.js';
97
97
  export { s as OrTeleport } from '../OrTeleport.vue3-9bce0c02.js';
98
98
  export { s as OrTeleportV3 } from '../OrTeleport.vue3-8099178c.js';
99
- export { s as OrTextV3 } from '../OrText-de6b2fe2.js';
99
+ export { s as OrTextV3 } from '../OrText-fcff0bf7.js';
100
100
  export { s as OrTextarea } from '../OrTextarea-f6722edc.js';
101
101
  export { s as OrTextareaV3 } from '../OrTextarea-fa1454e3.js';
102
102
  export { s as OrTextbox, T as TextboxTypes } from '../OrTextbox-6e585202.js';
@@ -1,3 +1,3 @@
1
- export { s as OrTextV3 } from '../../OrText-de6b2fe2.js';
1
+ export { s as OrTextV3 } from '../../OrText-fcff0bf7.js';
2
2
  import 'vue-demi';
3
3
  import 'vue';
@@ -96,7 +96,7 @@ export { s as OrTag } from './OrTag-2d9eacf8.js';
96
96
  export { s as OrTagV3, a as TagColor, T as TagVariant } from './OrTag-6116c6e3.js';
97
97
  export { s as OrTeleport } from './OrTeleport.vue3-9bce0c02.js';
98
98
  export { s as OrTeleportV3 } from './OrTeleport.vue3-8099178c.js';
99
- export { s as OrTextV3 } from './OrText-de6b2fe2.js';
99
+ export { s as OrTextV3 } from './OrText-fcff0bf7.js';
100
100
  export { s as OrTextarea } from './OrTextarea-f6722edc.js';
101
101
  export { s as OrTextareaV3 } from './OrTextarea-fa1454e3.js';
102
102
  export { s as OrTextbox, T as TextboxTypes } from './OrTextbox-6e585202.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onereach/ui-components",
3
- "version": "4.3.10",
3
+ "version": "4.3.11-beta.2661.0",
4
4
  "description": "Vue components library for v2/3",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/auto/index.js",
@@ -153,6 +153,5 @@
153
153
  "default": "./dist/bundled/v3/components/*/index.js"
154
154
  },
155
155
  "./package.json": "./package.json"
156
- },
157
- "gitHead": "f510f92b3e6a4396b0450a84d60904d61f8c815e"
156
+ }
158
157
  }
@@ -70,23 +70,26 @@ export default defineComponent({
70
70
  ]);
71
71
 
72
72
  /**
73
- * Preserves whitespace at the last position as <code>&nbsp;</code>
73
+ * Preserves whitespace at the first position as <code>&nbsp;</code>
74
74
  * @param str A string to escape
75
75
  */
76
- const escapeLast = (str: string): string => str && (str.slice(0, -1) + '\xa0');
76
+ const escapeFirst = (str: string): string => str && ('\xa0' + str.slice(1));
77
+
77
78
  /**
78
- * Preserves whitespace at the first position as <code>&nbsp;</code>
79
+ * Preserves whitespace at the last position as <code>&nbsp;</code>
79
80
  * @param str A string to escape
80
81
  */
81
- const escapeFirst = (str: string): string => str && ('\xa0' + str.slice(1));
82
+ const escapeLast = (str: string): string => str && (str.slice(0, -1) + '\xa0');
82
83
 
83
84
  // State
84
85
  const mainText = computed(() => {
85
- if (props.sliceIndex) {
86
- let mainPart = props.text.slice(0, -Math.abs(props.sliceIndex));
86
+ if (props.sliceIndex && props.sliceIndex <= props.text.length) {
87
+ let mainPart = props.text.slice(0, Math.abs(props.sliceIndex) * -1);
88
+
87
89
  if (mainPart[mainPart.length - 1] === ' ') {
88
90
  mainPart = escapeLast(mainPart);
89
91
  }
92
+
90
93
  return mainPart;
91
94
  }
92
95
 
@@ -95,9 +98,11 @@ export default defineComponent({
95
98
 
96
99
  const restText = computed(() => {
97
100
  let restPart = props.text.slice(mainText.value.length);
101
+
98
102
  if (restPart[0] === ' ') {
99
103
  restPart = escapeFirst(restPart);
100
104
  }
105
+
101
106
  return restPart;
102
107
  });
103
108