eco-vue-js 0.11.6 → 0.11.7
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/components/Input/WInput.vue.d.ts +10 -1
- package/dist/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue.js +8 -1
- package/dist/components/Input/WInputDate.vue.d.ts +16 -4
- package/dist/components/Input/WInputDate.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.d.ts +11 -3
- package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.js +20 -13
- package/dist/components/Input/components/ContentEditable.vue.d.ts +7 -0
- package/dist/components/Input/components/ContentEditable.vue.d.ts.map +1 -1
- package/dist/components/Input/components/ContentEditable.vue.js +52 -37
- package/dist/components/Input/types.d.ts +4 -0
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.d.ts +5 -1
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +8 -4
- package/package.json +1 -1
@@ -1,9 +1,15 @@
|
|
1
|
-
import { InputProps } from './types';
|
1
|
+
import { InputProps, WrapSelection } from './types';
|
2
2
|
declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
3
3
|
props: __VLS_PrettifyLocal<any & InputProps<Type> & Partial<{}>> & import('vue').PublicProps;
|
4
4
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
5
5
|
focus: () => void;
|
6
6
|
blur: () => void;
|
7
|
+
wrapSelection: (value: WrapSelection) => void;
|
8
|
+
setCaret: (indexStart: number, indexEnd?: number) => void;
|
9
|
+
getSelectionOffsets: () => {
|
10
|
+
start: number;
|
11
|
+
end: number;
|
12
|
+
} | undefined;
|
7
13
|
fieldRef: import('vue').ComputedRef<HTMLDivElement | null | undefined>;
|
8
14
|
scrollToInput: () => void;
|
9
15
|
}>): void;
|
@@ -15,6 +21,9 @@ declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullab
|
|
15
21
|
prefix?(_: {
|
16
22
|
modelValue: (Type extends "number" ? number : string) | undefined;
|
17
23
|
}): any;
|
24
|
+
toolbar?(_: {
|
25
|
+
wrapSelection: (value: WrapSelection) => void;
|
26
|
+
}): any;
|
18
27
|
before?(_: {
|
19
28
|
modelValue: (Type extends "number" ? number : string) | undefined;
|
20
29
|
}): any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInput.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInput.vue"],"names":[],"mappings":"AAoOA;AAidA,OAAO,KAAK,EAAC,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;yBAarC,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,EAC3G,eAAe,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC,EACjE;WA8qBO,mBAAmB,CAAC,oCAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;qBAjkB7B,IAAI;oBAOL,IAAI;+BA2DS,aAAa;+BACb,MAAM,aAAa,MAAM;;;;;;;MA8fc,GAAG,IAAI;WACpE,GAAG;;uBA1DgB,GAAG;0BACA,GAAG;wBACJ,GAAG;;;YAEH,GAAG;;mCA1cF,aAAa;YAycb,GAAG;;;YAEJ,GAAG;uBACJ,GAAG;wBACF,GAAG;uBACJ,GAAG;uBACH,GAAG;wBACF,GAAG;;;YA9mB1B,oBAAoB,SAAS,4CAAa,SAAS,GAAG,IAAI;YAC1D,gBAAgB,SAAS,aAAa,GAAG,IAAI;YAC7C,aAAa,SAAS,aAAa,GAAG,IAAI;YAC1C,eAAe,SAAS,aAAa,GAAG,IAAI;YAC5C,iBAAiB,SAAS,aAAa,GAAG,IAAI;YAC9C,oBAAoB,SAAS,aAAa,GAAG,IAAI;YACjD,aAAa,GAAG,IAAI;YACpB,OAAO,SAAS,UAAU,GAAG,SAAS,GAAG,IAAI;YAC7C,MAAM,SAAS,UAAU,GAAG,IAAI;YAChC,OAAO,SAAS,UAAU,GAAG,IAAI;YACjC,WAAW,SAAS,UAAU,GAAG,IAAI;YACrC,cAAc,SAAS,UAAU,GAAG,IAAI;YACxC,cAAc,SAAS,KAAK,GAAG,IAAI;YACnC,OAAO,GAAG,IAAI;;EAqpBhB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAzrBzE,wBAyrB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, useTemplateRef, ref, watch, nextTick, onMounted, onBeforeUnmount, computed, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot, unref, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, toDisplayString,
|
1
|
+
import { defineComponent, useTemplateRef, ref, watch, nextTick, onMounted, onBeforeUnmount, computed, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot, unref, createElementVNode, normalizeClass, createElementBlock, createCommentVNode, toDisplayString, normalizeProps, guardReactiveProps, resolveDynamicComponent, withModifiers, withKeys } from 'vue';
|
2
2
|
import _sfc_main$1 from '../FieldWrapper/WFieldWrapper.vue.js';
|
3
3
|
import { useTabActiveListener } from '../Tabs/use/useTabActiveListener.js';
|
4
4
|
import { Notify } from '../../utils/Notify.js';
|
@@ -166,6 +166,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
166
166
|
if (!contentRef.value || !inputRef.value) return;
|
167
167
|
contentRef.value.scrollTo({ left: contentRef.value.scrollWidth - inputRef.value.offsetWidth - 40 });
|
168
168
|
};
|
169
|
+
const wrapSelection = (value) => inputRef.value && "wrapSelection" in inputRef.value ? inputRef.value.wrapSelection(value) : void 0;
|
170
|
+
const setCaret = (indexStart, indexEnd) => inputRef.value && "setCaret" in inputRef.value ? inputRef.value.setCaret(indexStart, indexEnd) : void 0;
|
171
|
+
const getSelectionOffsets = () => inputRef.value && "getSelectionOffsets" in inputRef.value ? inputRef.value.getSelectionOffsets() : void 0;
|
169
172
|
let timeout;
|
170
173
|
const autofocusDebounced = () => {
|
171
174
|
if (timeout) clearTimeout(timeout);
|
@@ -193,6 +196,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
193
196
|
__expose({
|
194
197
|
focus,
|
195
198
|
blur,
|
199
|
+
wrapSelection,
|
200
|
+
setCaret,
|
201
|
+
getSelectionOffsets,
|
196
202
|
fieldRef: computed(() => fieldWrapperRef.value?.fieldRef),
|
197
203
|
scrollToInput
|
198
204
|
});
|
@@ -255,6 +261,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
255
261
|
}]),
|
256
262
|
onClick: focus
|
257
263
|
}, [
|
264
|
+
renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps({ wrapSelection }))),
|
258
265
|
_ctx.icon ? (openBlock(), createElementBlock("div", {
|
259
266
|
key: 0,
|
260
267
|
class: normalizeClass(["flex h-full w-[--w-input-height,2.75rem] select-none items-center justify-center", {
|
@@ -10,10 +10,16 @@ declare function __VLS_template(): {
|
|
10
10
|
refs: {
|
11
11
|
inputComponent: import('vue').ShallowUnwrapRef<{
|
12
12
|
focus: () => void;
|
13
|
-
blur: () => void;
|
13
|
+
blur: () => void | undefined;
|
14
14
|
close: () => void;
|
15
15
|
updateDropdown: () => void;
|
16
|
-
scrollToInput: () => void;
|
16
|
+
scrollToInput: () => void | undefined;
|
17
|
+
wrapSelection: (value: import('./types').WrapSelection) => void | undefined;
|
18
|
+
setCaret: (indexStart: number, indexEnd?: number) => void | undefined;
|
19
|
+
getSelectionOffsets: () => {
|
20
|
+
start: number;
|
21
|
+
end: number;
|
22
|
+
} | undefined;
|
17
23
|
}> | null;
|
18
24
|
};
|
19
25
|
rootEl: any;
|
@@ -34,10 +40,16 @@ declare const __VLS_component: import('vue').DefineComponent<InputDateProps, {},
|
|
34
40
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
35
41
|
inputComponent: import('vue').ShallowUnwrapRef<{
|
36
42
|
focus: () => void;
|
37
|
-
blur: () => void;
|
43
|
+
blur: () => void | undefined;
|
38
44
|
close: () => void;
|
39
45
|
updateDropdown: () => void;
|
40
|
-
scrollToInput: () => void;
|
46
|
+
scrollToInput: () => void | undefined;
|
47
|
+
wrapSelection: (value: import('./types').WrapSelection) => void | undefined;
|
48
|
+
setCaret: (indexStart: number, indexEnd?: number) => void | undefined;
|
49
|
+
getSelectionOffsets: () => {
|
50
|
+
start: number;
|
51
|
+
end: number;
|
52
|
+
} | undefined;
|
41
53
|
}> | null;
|
42
54
|
}, any>;
|
43
55
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInputDate.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputDate.vue"],"names":[],"mappings":"AAiDA;AAmHA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAO3C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAuEvD,iBAAS,cAAc;WA6HT,OAAO,IAA6B;;uBAbtB,GAAG;0BACA,GAAG;uBACN,GAAG
|
1
|
+
{"version":3,"file":"WInputDate.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputDate.vue"],"names":[],"mappings":"AAiDA;AAmHA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,SAAS,CAAA;AAO3C,OAAO,EAAC,eAAe,EAAC,MAAM,yBAAyB,CAAA;AAuEvD,iBAAS,cAAc;WA6HT,OAAO,IAA6B;;uBAbtB,GAAG;0BACA,GAAG;uBACN,GAAG;;;;;;;;;;;;;;;;;;EAgB9B;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;OASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,19 +1,26 @@
|
|
1
|
-
import { InputSuggestProps } from './types';
|
1
|
+
import { InputSuggestProps, WrapSelection } from './types';
|
2
2
|
import { VNode } from 'vue';
|
3
3
|
declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_PrettifyLocal<any & InputSuggestProps<Type> & Partial<{}>> & import('vue').PublicProps;
|
5
5
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
6
6
|
focus: () => void;
|
7
|
-
blur: () => void;
|
7
|
+
blur: () => void | undefined;
|
8
8
|
close: () => void;
|
9
9
|
updateDropdown: () => void;
|
10
|
-
scrollToInput: () => void;
|
10
|
+
scrollToInput: () => void | undefined;
|
11
|
+
wrapSelection: (value: WrapSelection) => void | undefined;
|
12
|
+
setCaret: (indexStart: number, indexEnd?: number) => void | undefined;
|
13
|
+
getSelectionOffsets: () => {
|
14
|
+
start: number;
|
15
|
+
end: number;
|
16
|
+
} | undefined;
|
11
17
|
}>): void;
|
12
18
|
attrs: any;
|
13
19
|
slots: Readonly<{
|
14
20
|
title?: () => void;
|
15
21
|
bottom?: () => void;
|
16
22
|
subtitle?: () => void;
|
23
|
+
toolbar?: () => void;
|
17
24
|
prefix?: (props: {
|
18
25
|
unclickable?: boolean | null;
|
19
26
|
}) => void;
|
@@ -23,6 +30,7 @@ declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullab
|
|
23
30
|
title?: () => void;
|
24
31
|
bottom?: () => void;
|
25
32
|
subtitle?: () => void;
|
33
|
+
toolbar?: () => void;
|
26
34
|
prefix?: (props: {
|
27
35
|
unclickable?: boolean | null;
|
28
36
|
}) => void;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInputSuggest.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputSuggest.vue"],"names":[],"mappings":"AAyHA;AAqOA,OAAO,KAAK,EAAC,iBAAiB,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAE7D,OAAO,EAAC,KAAK,KAAK,EAAgC,MAAM,KAAK,CAAA;yBAe5C,IAAI,SAAS,SAAS,GAAG,MAAM,EAC/C,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OA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7C,MAAM,SAAS,UAAU,GAAG,IAAI;;EAsYlC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAvazE,wBAua4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, ref, useTemplateRef, computed, createBlock, openBlock, resolveDynamicComponent, unref, mergeProps, createSlots, withCtx, createVNode, createCommentVNode, normalizeClass, renderSlot } from 'vue';
|
1
|
+
import { defineComponent, ref, useTemplateRef, computed, createBlock, openBlock, resolveDynamicComponent, unref, mergeProps, createSlots, withCtx, createVNode, createCommentVNode, normalizeClass, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
2
2
|
import _sfc_main$1 from '../BottomSheet/WBottomSheet.vue.js';
|
3
3
|
import _sfc_main$2 from '../DropdownMenu/WDropdownMenu.vue.js';
|
4
4
|
import _sfc_main$4 from '../InfiniteList/WInfiniteListScrollingElement.vue.js';
|
@@ -92,21 +92,21 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
92
|
if (isMobile.value) open();
|
93
93
|
inputRef.value?.focus();
|
94
94
|
};
|
95
|
-
const blur = () =>
|
96
|
-
|
97
|
-
|
98
|
-
const
|
99
|
-
|
100
|
-
|
101
|
-
const updateDropdown = () => {
|
102
|
-
if (dropdownMenuRef.value && "updateDropdown" in dropdownMenuRef.value) dropdownMenuRef.value.updateDropdown();
|
103
|
-
};
|
95
|
+
const blur = () => inputRef.value?.blur();
|
96
|
+
const scrollToInput = () => inputRef.value?.scrollToInput();
|
97
|
+
const wrapSelection = (value) => inputRef.value?.wrapSelection(value);
|
98
|
+
const setCaret = (indexStart, indexEnd) => inputRef.value?.setCaret(indexStart, indexEnd);
|
99
|
+
const getSelectionOffsets = () => inputRef.value?.getSelectionOffsets();
|
100
|
+
const updateDropdown = () => dropdownMenuRef.value && "updateDropdown" in dropdownMenuRef.value ? dropdownMenuRef.value.updateDropdown() : void 0;
|
104
101
|
__expose({
|
105
102
|
focus,
|
106
103
|
blur,
|
107
104
|
close,
|
108
105
|
updateDropdown,
|
109
|
-
scrollToInput
|
106
|
+
scrollToInput,
|
107
|
+
wrapSelection,
|
108
|
+
setCaret,
|
109
|
+
getSelectionOffsets
|
110
110
|
});
|
111
111
|
return (_ctx, _cache) => {
|
112
112
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.static ? InputSuggestStatic : unref(isMobile) ? _sfc_main$1 : _sfc_main$2), mergeProps({ ref: "dropdownMenu" }, _ctx.static ? void 0 : unref(isMobile) ? {
|
@@ -180,20 +180,27 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
180
180
|
]),
|
181
181
|
key: "1"
|
182
182
|
} : void 0,
|
183
|
+
_ctx.$slots.toolbar ? {
|
184
|
+
name: "toolbar",
|
185
|
+
fn: withCtx((scope) => [
|
186
|
+
renderSlot(_ctx.$slots, "toolbar", normalizeProps(guardReactiveProps(scope)))
|
187
|
+
]),
|
188
|
+
key: "2"
|
189
|
+
} : void 0,
|
183
190
|
_ctx.$slots.bottom || _ctx.static && _ctx.$slots.content ? {
|
184
191
|
name: "bottom",
|
185
192
|
fn: withCtx(() => [
|
186
193
|
renderSlot(_ctx.$slots, "content"),
|
187
194
|
renderSlot(_ctx.$slots, "bottom")
|
188
195
|
]),
|
189
|
-
key: "
|
196
|
+
key: "3"
|
190
197
|
} : void 0,
|
191
198
|
_ctx.$slots.right ? {
|
192
199
|
name: "right",
|
193
200
|
fn: withCtx(() => [
|
194
201
|
renderSlot(_ctx.$slots, "right")
|
195
202
|
]),
|
196
|
-
key: "
|
203
|
+
key: "4"
|
197
204
|
} : void 0
|
198
205
|
]), 1040, ["class", "onFocus", "onBlur", "onClick", "onClick:suffix"])
|
199
206
|
]),
|
@@ -1,3 +1,4 @@
|
|
1
|
+
import { WrapSelection } from '../types';
|
1
2
|
type __VLS_Props = {
|
2
3
|
value: string;
|
3
4
|
placeholder?: string;
|
@@ -6,6 +7,12 @@ type __VLS_Props = {
|
|
6
7
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
7
8
|
focus: () => void;
|
8
9
|
blur: () => void;
|
10
|
+
wrapSelection: (value: WrapSelection) => void;
|
11
|
+
setCaret: (indexStart: number, indexEnd?: number) => void;
|
12
|
+
getSelectionOffsets: () => {
|
13
|
+
start: number;
|
14
|
+
end: number;
|
15
|
+
};
|
9
16
|
offsetWidth: number;
|
10
17
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
11
18
|
blur: (value: FocusEvent) => any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ContentEditable.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/components/ContentEditable.vue"],"names":[],"mappings":"AAqBA;AAqLA,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,UAAU,CAAA;AAI3C,KAAK,WAAW,GAAG;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAC;;;;2BAgH4B,aAAa,KAAG,IAAI;2BAlBpB,MAAM,aAAa,MAAM;;;;;;;;;;;;;;;;;;;AAiIvD,wBAUG"}
|
@@ -13,6 +13,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
13
|
const props = __props;
|
14
14
|
const emit = __emit;
|
15
15
|
const elementRef = useTemplateRef("element");
|
16
|
+
const insertParagraph = (e) => {
|
17
|
+
if (e.inputType === "insertParagraph") {
|
18
|
+
e.preventDefault();
|
19
|
+
insertPlain("\n");
|
20
|
+
}
|
21
|
+
};
|
16
22
|
const onInput = (e) => {
|
17
23
|
e.stopImmediatePropagation();
|
18
24
|
if (!(e.target instanceof HTMLDivElement)) return;
|
@@ -33,59 +39,64 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
33
39
|
const text = (e.clipboardData?.getData("text/plain") || await navigator.clipboard.readText()).replace(/\r\n?/g, "\n");
|
34
40
|
insertPlain(text);
|
35
41
|
};
|
36
|
-
const onKeyDown = (e) => {
|
37
|
-
if (e.key === "Enter") {
|
38
|
-
e.preventDefault();
|
39
|
-
insertPlain("\n");
|
40
|
-
} else {
|
41
|
-
emit("keydown", e);
|
42
|
-
}
|
43
|
-
};
|
44
42
|
const insertPlain = (text) => {
|
45
43
|
const root = elementRef.value;
|
46
44
|
if (!root) return;
|
47
|
-
const { start, end } = getSelectionOffsets(
|
45
|
+
const { start, end } = getSelectionOffsets();
|
48
46
|
const next = (props.value ?? "").slice(0, start) + text + ((props.value ?? "").slice(end) || " ");
|
49
47
|
const caretAfter = start + text.length;
|
50
48
|
emit("update:model-value", next);
|
51
|
-
nextTick(() =>
|
49
|
+
nextTick(() => setCaret(caretAfter));
|
52
50
|
};
|
53
|
-
const getSelectionOffsets = (
|
51
|
+
const getSelectionOffsets = () => {
|
54
52
|
const selection = window.getSelection();
|
55
|
-
if (!selection || selection.rangeCount === 0) return { start: 0, end: 0 };
|
53
|
+
if (!elementRef.value || !selection || selection.rangeCount === 0) return { start: 0, end: 0 };
|
56
54
|
const range = selection.getRangeAt(0);
|
57
55
|
const pre = range.cloneRange();
|
58
|
-
pre.selectNodeContents(
|
56
|
+
pre.selectNodeContents(elementRef.value);
|
59
57
|
pre.setEnd(range.startContainer, range.startOffset);
|
60
58
|
const start = pre.toString().length;
|
61
59
|
const selected = range.toString().length;
|
62
60
|
return { start, end: start + selected };
|
63
61
|
};
|
64
|
-
const
|
65
|
-
if (!
|
66
|
-
|
67
|
-
|
62
|
+
const getNodeOffset = (index) => {
|
63
|
+
if (!elementRef.value || index === void 0) return void 0;
|
64
|
+
if (!elementRef.value.firstChild) elementRef.value.appendChild(document.createTextNode(""));
|
65
|
+
const walker = document.createTreeWalker(elementRef.value, NodeFilter.SHOW_TEXT, null);
|
66
|
+
let node, offset = index;
|
68
67
|
while (node = walker.nextNode()) {
|
69
68
|
const len = node.nodeValue?.length ?? 0;
|
70
|
-
if (
|
71
|
-
|
72
|
-
r2.setStart(node, pos);
|
73
|
-
r2.collapse(true);
|
74
|
-
const selection2 = window.getSelection();
|
75
|
-
selection2?.removeAllRanges();
|
76
|
-
selection2?.addRange(r2);
|
77
|
-
return;
|
78
|
-
}
|
79
|
-
pos -= len;
|
69
|
+
if (offset <= len) return { node, offset };
|
70
|
+
offset -= len;
|
80
71
|
}
|
81
|
-
const last =
|
82
|
-
if (!last) return;
|
83
|
-
|
84
|
-
|
85
|
-
|
72
|
+
const last = elementRef.value.lastChild;
|
73
|
+
if (!last) return void 0;
|
74
|
+
return { node: last, offset: last.nodeType === Node.TEXT_NODE && last.nodeValue ? last.nodeValue.length : last.childNodes.length };
|
75
|
+
};
|
76
|
+
const setCaret = (indexStart, indexEnd) => {
|
77
|
+
const start = getNodeOffset(indexStart);
|
78
|
+
if (start === void 0) return;
|
79
|
+
const range = document.createRange();
|
80
|
+
range.setStart(start.node, start.offset);
|
81
|
+
const end = getNodeOffset(indexEnd);
|
82
|
+
if (end !== void 0) range.setEnd(end.node, end.offset);
|
83
|
+
else range.collapse(true);
|
86
84
|
const selection = window.getSelection();
|
87
85
|
selection?.removeAllRanges();
|
88
|
-
selection?.addRange(
|
86
|
+
selection?.addRange(range);
|
87
|
+
};
|
88
|
+
const wrapSelection = (value) => {
|
89
|
+
const root = elementRef.value;
|
90
|
+
if (!root) return;
|
91
|
+
const { start, end } = getSelectionOffsets();
|
92
|
+
const currentText = props.value ?? "";
|
93
|
+
const selectedText = currentText.slice(start, end);
|
94
|
+
const beforeSelection = currentText.slice(0, start);
|
95
|
+
const afterSelection = currentText.slice(end);
|
96
|
+
const newText = beforeSelection + (value.start || "") + selectedText + (value.end || "") + afterSelection;
|
97
|
+
const cursorPosition = start + (value.start?.length ?? 0) + (value.end ? selectedText.length : 0);
|
98
|
+
emit("update:model-value", newText);
|
99
|
+
nextTick(() => setCaret(cursorPosition));
|
89
100
|
};
|
90
101
|
const focus = () => {
|
91
102
|
elementRef.value?.focus();
|
@@ -96,6 +107,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
96
107
|
__expose({
|
97
108
|
focus,
|
98
109
|
blur,
|
110
|
+
wrapSelection,
|
111
|
+
setCaret,
|
112
|
+
getSelectionOffsets,
|
99
113
|
get offsetWidth() {
|
100
114
|
return elementRef.value?.offsetWidth ?? 0;
|
101
115
|
}
|
@@ -109,12 +123,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
109
123
|
spellcheck: "false",
|
110
124
|
textContent: _ctx.value,
|
111
125
|
placeholder: _ctx.placeholder,
|
112
|
-
class: "whitespace-pre empty:before:pointer-events-none empty:before:text-gray-400 empty:before:[content:attr(placeholder)] dark:empty:before:text-gray-500",
|
126
|
+
class: "relative whitespace-pre empty:before:pointer-events-none empty:before:text-gray-400 empty:before:[content:attr(placeholder)] dark:empty:before:text-gray-500",
|
113
127
|
onInput,
|
128
|
+
onBeforeinput: insertParagraph,
|
114
129
|
onPaste,
|
115
|
-
onKeydown:
|
116
|
-
onFocus: _cache[
|
117
|
-
onBlur: _cache[
|
130
|
+
onKeydown: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("keydown", $event)),
|
131
|
+
onFocus: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("focus", $event)),
|
132
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => _ctx.$emit("blur", $event))
|
118
133
|
}, null, 40, _hoisted_1);
|
119
134
|
};
|
120
135
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/types.ts"],"names":[],"mappings":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CAAC;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,OAAO,CAAA;KAAC,CAAC,CAAA;CACnF;AAED,MAAM,WAAW,cAAe,SAAQ,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,EAAE,YAAY,CAAC;IACnF,UAAU,CAAC,EAAE,IAAI,GAAG,SAAS,CAAA;IAC7B,OAAO,CAAC,EAAE,IAAI,CAAA;IACd,OAAO,CAAC,EAAE,IAAI,CAAA;CACf;AAED,MAAM,MAAM,aAAa,GAAG;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAAA"}
|
@@ -2,10 +2,12 @@ import { SelectOptionComponent, SelectOptionProps, SelectSingleProps } from './t
|
|
2
2
|
import { VNode } from 'vue';
|
3
3
|
declare const _default: <Model extends number | string, Data extends DefaultData, QueryParamsOptions, OptionComponent extends SelectOptionComponent<Data>, AllowClear extends boolean = false>(__VLS_props: NonNullable<Awaited<typeof __VLS_setup>>["props"], __VLS_ctx?: __VLS_PrettifyLocal<Pick<NonNullable<Awaited<typeof __VLS_setup>>, "attrs" | "emit" | "slots">>, __VLS_expose?: NonNullable<Awaited<typeof __VLS_setup>>["expose"], __VLS_setup?: Promise<{
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
5
|
+
readonly onBlur?: ((value: FocusEvent) => any) | undefined;
|
6
|
+
readonly onFocus?: ((value: FocusEvent | undefined) => any) | undefined;
|
5
7
|
readonly "onUpdate:model-value"?: ((value: AllowClear extends true ? Model | null : Model) => any) | undefined;
|
6
8
|
readonly "onInit-model"?: (() => any) | undefined;
|
7
9
|
readonly "onUpdate:query-options-error"?: ((value: string | undefined) => any) | undefined;
|
8
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:model-value" | "onInit-model" | "onUpdate:query-options-error"> & SelectSingleProps<Model, Data, QueryParamsOptions, OptionComponent, AllowClear> & Partial<{}>> & import('vue').PublicProps;
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onFocus" | "onBlur" | "onUpdate:model-value" | "onInit-model" | "onUpdate:query-options-error"> & SelectSingleProps<Model, Data, QueryParamsOptions, OptionComponent, AllowClear> & Partial<{}>> & import('vue').PublicProps;
|
9
11
|
expose(exposed: import('vue').ShallowUnwrapRef<{
|
10
12
|
blur: () => void;
|
11
13
|
}>): void;
|
@@ -25,6 +27,8 @@ declare const _default: <Model extends number | string, Data extends DefaultData
|
|
25
27
|
(e: "update:model-value", value: AllowClear extends true ? Model | null : Model): void;
|
26
28
|
(e: "update:query-options-error", value: string | undefined): void;
|
27
29
|
(e: "init-model"): void;
|
30
|
+
(e: "focus", value: FocusEvent | undefined): void;
|
31
|
+
(e: "blur", value: FocusEvent): void;
|
28
32
|
};
|
29
33
|
}>) => import('vue').VNode & {
|
30
34
|
__ctx?: Awaited<typeof __VLS_setup>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectSingle.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Select/WSelectSingle.vue"],"names":[],"mappings":"AAqDA;AA+GA,OAAO,KAAK,EAAC,qBAAqB,EAAE,iBAAiB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;AAExF,OAAO,EAAC,KAAK,KAAK,EAAyC,MAAM,KAAK,CAAA;yBAIrD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,GAAG,KAAK,EACpL,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO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ions: {},
|
77
77
|
options: {}
|
78
78
|
},
|
79
|
-
emits: ["update:model-value", "update:query-options-error", "init-model"],
|
79
|
+
emits: ["update:model-value", "update:query-options-error", "init-model", "focus", "blur"],
|
80
80
|
setup(__props, { expose: __expose, emit: __emit }) {
|
81
81
|
const props = __props;
|
82
82
|
const emit = __emit;
|
@@ -107,9 +107,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
107
107
|
class: _ctx.$attrs.class,
|
108
108
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
109
109
|
onUnselect: _cache[1] || (_cache[1] = ($event) => updateModelValue(_ctx.allowClear ? null : $event)),
|
110
|
-
onFocus: _cache[2] || (_cache[2] = ($event) =>
|
111
|
-
|
112
|
-
|
110
|
+
onFocus: _cache[2] || (_cache[2] = ($event) => {
|
111
|
+
_ctx.searchModel && typeof _ctx.modelValue === "string" ? unref(selectComponentRef)?.setSearch(_ctx.modelValue) : void 0;
|
112
|
+
_ctx.$emit("focus", $event);
|
113
|
+
}),
|
114
|
+
onBlur: _cache[3] || (_cache[3] = ($event) => _ctx.$emit("blur", $event)),
|
115
|
+
"onUpdate:queryOptionsError": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("update:query-options-error", $event)),
|
116
|
+
onInitModel: _cache[5] || (_cache[5] = ($event) => _ctx.$emit("init-model"))
|
113
117
|
}), createSlots({ _: 2 }, [
|
114
118
|
_ctx.$slots.title ? {
|
115
119
|
name: "title",
|