@onereach/ui-components 4.3.11-beta.2667.0 → 4.3.11
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/OrSelectV3/OrSelect.js +1 -2
- package/dist/bundled/v2/components/OrTextV3/OrText.js +6 -6
- package/dist/bundled/v3/{OrText.vue_vue_type_script_lang-23ff666f.js → OrText.vue_vue_type_script_lang-6ce019db.js} +6 -6
- package/dist/bundled/v3/components/OrSelectV3/OrSelect.js +1 -2
- package/dist/bundled/v3/components/OrTextV3/OrText.js +2 -2
- package/dist/bundled/v3/components/OrTextV3/index.js +1 -1
- package/dist/bundled/v3/components/index.js +1 -1
- package/dist/bundled/v3/index.js +1 -1
- package/dist/esm/v2/{OrSelect-9d6b3363.js → OrSelect-9c8f96b2.js} +1 -2
- package/dist/esm/v2/{OrText-6097bca5.js → OrText-44449e7b.js} +6 -6
- package/dist/esm/v2/components/index.js +2 -2
- package/dist/esm/v2/components/or-select-v3/index.js +1 -1
- package/dist/esm/v2/components/or-text-v3/index.js +1 -1
- package/dist/esm/v2/index.js +2 -2
- package/dist/esm/v3/{OrSelect-3dbddc6b.js → OrSelect-b1d7651a.js} +1 -2
- package/dist/esm/v3/{OrText-de6b2fe2.js → OrText-d54c951d.js} +6 -6
- package/dist/esm/v3/components/index.js +2 -2
- package/dist/esm/v3/components/or-select-v3/index.js +1 -1
- package/dist/esm/v3/components/or-text-v3/index.js +1 -1
- package/dist/esm/v3/index.js +2 -2
- package/package.json +3 -2
- package/src/components/or-select-v3/OrSelect.stories3.ts +1 -39
- package/src/components/or-select-v3/OrSelect.vue +0 -1
- package/src/components/or-text-v3/OrText.vue +11 -6
|
@@ -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
|
|
41
|
+
* Preserves whitespace at the first position as <code> </code>
|
|
42
42
|
* @param str A string to escape
|
|
43
43
|
*/
|
|
44
|
-
const
|
|
44
|
+
const escapeFirst = str => str && '\xa0' + str.slice(1);
|
|
45
45
|
/**
|
|
46
|
-
* Preserves whitespace at the
|
|
46
|
+
* Preserves whitespace at the last position as <code> </code>
|
|
47
47
|
* @param str A string to escape
|
|
48
48
|
*/
|
|
49
|
-
const
|
|
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,
|
|
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
|
|
40
|
+
* Preserves whitespace at the first position as <code> </code>
|
|
41
41
|
* @param str A string to escape
|
|
42
42
|
*/
|
|
43
|
-
const
|
|
43
|
+
const escapeFirst = str => str && '\xa0' + str.slice(1);
|
|
44
44
|
/**
|
|
45
|
-
* Preserves whitespace at the
|
|
45
|
+
* Preserves whitespace at the last position as <code> </code>
|
|
46
46
|
* @param str A string to escape
|
|
47
47
|
*/
|
|
48
|
-
const
|
|
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,
|
|
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
|
}
|
|
@@ -143,13 +143,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
143
143
|
return openBlock(), createBlock(_component_OrTag, {
|
|
144
144
|
key: option.value,
|
|
145
145
|
variant: 'reset',
|
|
146
|
-
disabled: _ctx.disabled || _ctx.readonly,
|
|
147
146
|
onReset: $event => _ctx.deselect(option)
|
|
148
147
|
}, {
|
|
149
148
|
default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
|
|
150
149
|
|
|
151
150
|
_: 2 /* DYNAMIC */
|
|
152
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["
|
|
151
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onReset"]);
|
|
153
152
|
}), 128 /* KEYED_FRAGMENT */)) : (openBlock(), createElementBlock("span", {
|
|
154
153
|
key: 1,
|
|
155
154
|
class: normalizeClass(_ctx.placeholderStyles)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { s as script } from '../../OrText.vue_vue_type_script_lang-
|
|
2
|
-
export { s as default } from '../../OrText.vue_vue_type_script_lang-
|
|
1
|
+
import { s as script } from '../../OrText.vue_vue_type_script_lang-6ce019db.js';
|
|
2
|
+
export { s as default } from '../../OrText.vue_vue_type_script_lang-6ce019db.js';
|
|
3
3
|
import { openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString } from 'vue';
|
|
4
4
|
import 'vue-demi';
|
|
5
5
|
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-
|
|
138
|
+
export { s as OrTextV3 } from '../OrText.vue_vue_type_script_lang-6ce019db.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';
|
package/dist/bundled/v3/index.js
CHANGED
|
@@ -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-
|
|
113
|
+
export { s as OrTextV3 } from './OrText.vue_vue_type_script_lang-6ce019db.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
|
|
56
|
+
* Preserves whitespace at the first position as <code> </code>
|
|
57
57
|
* @param str A string to escape
|
|
58
58
|
*/
|
|
59
|
-
const
|
|
59
|
+
const escapeFirst = str => str && '\xa0' + str.slice(1);
|
|
60
60
|
/**
|
|
61
|
-
* Preserves whitespace at the
|
|
61
|
+
* Preserves whitespace at the last position as <code> </code>
|
|
62
62
|
* @param str A string to escape
|
|
63
63
|
*/
|
|
64
|
-
const
|
|
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,
|
|
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
|
}
|
|
@@ -73,7 +73,7 @@ export { _ as OrSearch } from '../OrSearch-330e9af0.js';
|
|
|
73
73
|
export { _ as OrSearchV3 } from '../OrSearch-7ccc1f33.js';
|
|
74
74
|
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-a1ea5b72.js';
|
|
75
75
|
export { _ as OrSelect } from '../OrSelect-22eea9cc.js';
|
|
76
|
-
export { _ as OrSelectV3 } from '../OrSelect-
|
|
76
|
+
export { _ as OrSelectV3 } from '../OrSelect-9c8f96b2.js';
|
|
77
77
|
export { _ as OrSidebar, O as OrSidebarSide } from '../OrSidebar-feacf13a.js';
|
|
78
78
|
export { _ as OrSidebarV3 } from '../OrSidebar-b8387abe.js';
|
|
79
79
|
export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-4bf3bad8.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-
|
|
101
|
+
export { _ as OrTextV3 } from '../OrText-44449e7b.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,4 +1,4 @@
|
|
|
1
|
-
export { _ as OrSelectV3 } from '../../OrSelect-
|
|
1
|
+
export { _ as OrSelectV3 } from '../../OrSelect-9c8f96b2.js';
|
|
2
2
|
export { I as SelectSize } from '../../OrInputBox.vue_rollup-plugin-vue_script-fe250f7a.js';
|
|
3
3
|
import 'vue-demi';
|
|
4
4
|
import '../../dropdown-open-e1f90e0a.js';
|
package/dist/esm/v2/index.js
CHANGED
|
@@ -73,7 +73,7 @@ export { _ as OrSearch } from './OrSearch-330e9af0.js';
|
|
|
73
73
|
export { _ as OrSearchV3 } from './OrSearch-7ccc1f33.js';
|
|
74
74
|
export { _ as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-a1ea5b72.js';
|
|
75
75
|
export { _ as OrSelect } from './OrSelect-22eea9cc.js';
|
|
76
|
-
export { _ as OrSelectV3 } from './OrSelect-
|
|
76
|
+
export { _ as OrSelectV3 } from './OrSelect-9c8f96b2.js';
|
|
77
77
|
export { _ as OrSidebar, O as OrSidebarSide } from './OrSidebar-feacf13a.js';
|
|
78
78
|
export { _ as OrSidebarV3 } from './OrSidebar-b8387abe.js';
|
|
79
79
|
export { O as OrSidebarPlacement } from './OrSidebarCollapseButton-4bf3bad8.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-
|
|
101
|
+
export { _ as OrTextV3 } from './OrText-44449e7b.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';
|
|
@@ -359,13 +359,12 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
359
359
|
return openBlock(), createBlock(_component_OrTag, {
|
|
360
360
|
key: option.value,
|
|
361
361
|
variant: 'reset',
|
|
362
|
-
disabled: _ctx.disabled || _ctx.readonly,
|
|
363
362
|
onReset: $event => _ctx.deselect(option)
|
|
364
363
|
}, {
|
|
365
364
|
default: withCtx(() => [createTextVNode(toDisplayString(option.label), 1 /* TEXT */)]),
|
|
366
365
|
|
|
367
366
|
_: 2 /* DYNAMIC */
|
|
368
|
-
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["
|
|
367
|
+
}, 1032 /* PROPS, DYNAMIC_SLOTS */, ["onReset"]);
|
|
369
368
|
}), 128 /* KEYED_FRAGMENT */)) : (openBlock(), createElementBlock("span", {
|
|
370
369
|
key: 1,
|
|
371
370
|
class: normalizeClass(_ctx.placeholderStyles)
|
|
@@ -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
|
|
56
|
+
* Preserves whitespace at the first position as <code> </code>
|
|
57
57
|
* @param str A string to escape
|
|
58
58
|
*/
|
|
59
|
-
const
|
|
59
|
+
const escapeFirst = str => str && '\xa0' + str.slice(1);
|
|
60
60
|
/**
|
|
61
|
-
* Preserves whitespace at the
|
|
61
|
+
* Preserves whitespace at the last position as <code> </code>
|
|
62
62
|
* @param str A string to escape
|
|
63
63
|
*/
|
|
64
|
-
const
|
|
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,
|
|
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
|
}
|
|
@@ -71,7 +71,7 @@ export { s as OrSearch } from '../OrSearch-f4ad73db.js';
|
|
|
71
71
|
export { s as OrSearchV3 } from '../OrSearch-e15c7fd2.js';
|
|
72
72
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from '../OrSegmentedControl-359fbf3a.js';
|
|
73
73
|
export { s as OrSelect } from '../OrSelect-6ff34196.js';
|
|
74
|
-
export { s as OrSelectV3 } from '../OrSelect-
|
|
74
|
+
export { s as OrSelectV3 } from '../OrSelect-b1d7651a.js';
|
|
75
75
|
export { s as OrSidebar, O as OrSidebarSide } from '../OrSidebar-375c85a3.js';
|
|
76
76
|
export { s as OrSidebarV3 } from '../OrSidebar-bfd19c4c.js';
|
|
77
77
|
export { O as OrSidebarPlacement } from '../OrSidebarCollapseButton-63914891.js';
|
|
@@ -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-
|
|
99
|
+
export { s as OrTextV3 } from '../OrText-d54c951d.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/dist/esm/v3/index.js
CHANGED
|
@@ -71,7 +71,7 @@ export { s as OrSearch } from './OrSearch-f4ad73db.js';
|
|
|
71
71
|
export { s as OrSearchV3 } from './OrSearch-e15c7fd2.js';
|
|
72
72
|
export { s as OrSegmentedControlV3, S as SegmentedControlSize } from './OrSegmentedControl-359fbf3a.js';
|
|
73
73
|
export { s as OrSelect } from './OrSelect-6ff34196.js';
|
|
74
|
-
export { s as OrSelectV3 } from './OrSelect-
|
|
74
|
+
export { s as OrSelectV3 } from './OrSelect-b1d7651a.js';
|
|
75
75
|
export { s as OrSidebar, O as OrSidebarSide } from './OrSidebar-375c85a3.js';
|
|
76
76
|
export { s as OrSidebarV3 } from './OrSidebar-bfd19c4c.js';
|
|
77
77
|
export { O as OrSidebarPlacement } from './OrSidebarCollapseButton-63914891.js';
|
|
@@ -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-
|
|
99
|
+
export { s as OrTextV3 } from './OrText-d54c951d.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.11
|
|
3
|
+
"version": "4.3.11",
|
|
4
4
|
"description": "Vue components library for v2/3",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"main": "./dist/auto/index.js",
|
|
@@ -153,5 +153,6 @@
|
|
|
153
153
|
"default": "./dist/bundled/v3/components/*/index.js"
|
|
154
154
|
},
|
|
155
155
|
"./package.json": "./package.json"
|
|
156
|
-
}
|
|
156
|
+
},
|
|
157
|
+
"gitHead": "b11ae2e324c85b8d9a760aa7027fc6fdd2796bcc"
|
|
157
158
|
}
|
|
@@ -168,7 +168,7 @@ const Template: StoryFn<typeof OrSelect> = (args) => ({
|
|
|
168
168
|
|
|
169
169
|
setup() {
|
|
170
170
|
// State
|
|
171
|
-
const model = ref<string | string[]>(
|
|
171
|
+
const model = ref<string | string[]>();
|
|
172
172
|
const searchOptions = ref<SelectOption[]>(args.options);
|
|
173
173
|
|
|
174
174
|
// Handlers
|
|
@@ -468,41 +468,3 @@ WithLongStrings.args = {
|
|
|
468
468
|
|
|
469
469
|
placeholder: 'Wery Wery Wery WeryWeryWeryWery Wery Wery long placeholder',
|
|
470
470
|
};
|
|
471
|
-
|
|
472
|
-
export const MultipleReadonly = Template.bind({});
|
|
473
|
-
|
|
474
|
-
MultipleReadonly.args = {
|
|
475
|
-
...Default.args,
|
|
476
|
-
readonly: true,
|
|
477
|
-
options: Array.from<string, SelectOption>([
|
|
478
|
-
'Alfa',
|
|
479
|
-
'Bravo',
|
|
480
|
-
'Charlie',
|
|
481
|
-
'Delta',
|
|
482
|
-
'Echo',
|
|
483
|
-
], (item) => ({
|
|
484
|
-
value: item.toLowerCase().replace(/\s/g, ''),
|
|
485
|
-
label: item,
|
|
486
|
-
})),
|
|
487
|
-
multiple: true,
|
|
488
|
-
modelValue: ['alfa', 'bravo'],
|
|
489
|
-
};
|
|
490
|
-
export const MultipleDisabled = Template.bind({});
|
|
491
|
-
|
|
492
|
-
MultipleDisabled.args = {
|
|
493
|
-
...Default.args,
|
|
494
|
-
options: Array.from<string, SelectOption>([
|
|
495
|
-
'Alfa',
|
|
496
|
-
'Bravo',
|
|
497
|
-
'Charlie',
|
|
498
|
-
'Delta',
|
|
499
|
-
'Echo',
|
|
500
|
-
], (item) => ({
|
|
501
|
-
value: item.toLowerCase().replace(/\s/g, ''),
|
|
502
|
-
label: item,
|
|
503
|
-
})),
|
|
504
|
-
disabled: true,
|
|
505
|
-
multiple: true,
|
|
506
|
-
modelValue: ['alfa', 'bravo'],
|
|
507
|
-
paceholder: 'disabled placeholder',
|
|
508
|
-
};
|
|
@@ -70,23 +70,26 @@ export default defineComponent({
|
|
|
70
70
|
]);
|
|
71
71
|
|
|
72
72
|
/**
|
|
73
|
-
* Preserves whitespace at the
|
|
73
|
+
* Preserves whitespace at the first position as <code> </code>
|
|
74
74
|
* @param str A string to escape
|
|
75
75
|
*/
|
|
76
|
-
const
|
|
76
|
+
const escapeFirst = (str: string): string => str && ('\xa0' + str.slice(1));
|
|
77
|
+
|
|
77
78
|
/**
|
|
78
|
-
* Preserves whitespace at the
|
|
79
|
+
* Preserves whitespace at the last position as <code> </code>
|
|
79
80
|
* @param str A string to escape
|
|
80
81
|
*/
|
|
81
|
-
const
|
|
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,
|
|
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
|
|