eco-vue-js 0.10.92 → 0.10.94
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/BottomSheet/WBottomSheet.vue.d.ts +1 -0
- package/dist/components/BottomSheet/WBottomSheet.vue.d.ts.map +1 -1
- package/dist/components/BottomSheet/WBottomSheet.vue.js +2 -2
- package/dist/components/Button/WButton.vue.d.ts +8 -2
- package/dist/components/Button/WButton.vue.d.ts.map +1 -1
- package/dist/components/Button/WButton.vue.js +42 -5
- package/dist/components/Button/WButtonGroup.vue.js +4 -0
- package/dist/components/Button/WButtonInput.vue.d.ts.map +1 -1
- package/dist/components/Button/types.d.ts +2 -0
- package/dist/components/Button/types.d.ts.map +1 -1
- package/dist/components/Checkbox/WCheckboxGroup.vue.js +2 -0
- package/dist/components/Checkbox/WCheckboxGroupMultiple.vue.js +2 -0
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +2 -153
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.js +2 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts +1 -0
- package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts.map +1 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.js +20 -13
- package/dist/components/FieldWrapper/types.d.ts +2 -0
- package/dist/components/FieldWrapper/types.d.ts.map +1 -1
- package/dist/components/FieldWrapper/use/useFieldSaved.d.ts +6 -0
- package/dist/components/FieldWrapper/use/useFieldSaved.d.ts.map +1 -0
- package/dist/components/FieldWrapper/use/useFieldSaved.js +29 -0
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.js +4 -0
- package/dist/components/FormAsync/WFormAsyncCheckboxGroup.vue.js +2 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue.d.ts +6 -0
- package/dist/components/FormAsync/WFormAsyncInput.vue.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncInput.vue.js +19 -2
- package/dist/components/FormAsync/WFormAsyncSelect.vue.js +3 -0
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +3 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +3 -0
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +3 -0
- package/dist/components/FormAsync/use/useFormAsync.d.ts.map +1 -1
- package/dist/components/FormAsync/use/useFormAsync.js +3 -2
- package/dist/components/Input/WInput.vue.d.ts +7 -2
- package/dist/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue.js +81 -65
- package/dist/components/Input/WInputAsync.vue.d.ts +6 -0
- package/dist/components/Input/WInputAsync.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputAsync.vue.js +76 -42
- package/dist/components/Input/WInputDate.vue.js +3 -0
- package/dist/components/Input/WInputOptions.vue.js +3 -0
- package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.js +5 -1
- package/dist/components/Input/components/ContentEditable.vue.d.ts +24 -0
- package/dist/components/Input/components/ContentEditable.vue.d.ts.map +1 -0
- package/dist/components/Input/components/ContentEditable.vue.js +123 -0
- package/dist/components/Input/components/ContentEditable.vue2.js +5 -0
- package/dist/components/Input/types.d.ts +2 -1
- package/dist/components/Input/types.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +1 -1
- package/dist/components/Page/WPage.vue.d.ts.map +1 -1
- package/dist/components/Page/WPage.vue.js +9 -10
- package/dist/components/Select/WSelect.vue.js +3 -0
- package/dist/components/Select/WSelectAsync.vue.js +3 -0
- package/dist/components/Select/WSelectAsyncSingle.vue.js +3 -0
- package/dist/components/Select/WSelectSingle.vue.js +3 -0
- package/dist/components/Select/WSelectStringified.vue.js +3 -0
- package/dist/components/Toggle/WToggle.vue.js +3 -3
- package/dist/utils/SemanticType.js +6 -6
- package/package.json +1 -1
- package/tailwind-base/plugins/default.ts +10 -1
@@ -1,4 +1,4 @@
|
|
1
|
-
import { defineComponent, computed, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, renderSlot } from 'vue';
|
1
|
+
import { defineComponent, computed, createBlock, openBlock, mergeProps, unref, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Input/WInputAsync.vue.js';
|
3
3
|
import { validateRequired } from '../../utils/validate.js';
|
4
4
|
import { useFormAsync } from './use/useFormAsync.js';
|
@@ -8,7 +8,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
8
|
props: {
|
9
9
|
validate: {},
|
10
10
|
debounce: {},
|
11
|
-
|
11
|
+
instant: { type: Boolean },
|
12
12
|
type: {},
|
13
13
|
textarea: { type: Boolean },
|
14
14
|
resize: { type: Boolean },
|
@@ -33,6 +33,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
33
33
|
allowPaste: { type: Boolean },
|
34
34
|
hideInput: { type: Boolean },
|
35
35
|
noWrap: { type: Boolean },
|
36
|
+
textTransparent: { type: Boolean },
|
36
37
|
title: {},
|
37
38
|
titleIcon: {},
|
38
39
|
description: {},
|
@@ -52,6 +53,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
52
53
|
filterValue: {},
|
53
54
|
subgrid: { type: Boolean },
|
54
55
|
seamless: { type: Boolean },
|
56
|
+
savedText: {},
|
57
|
+
topText: { type: Boolean },
|
55
58
|
useQueryFn: {},
|
56
59
|
noParams: { type: Boolean },
|
57
60
|
queryParams: {},
|
@@ -102,6 +105,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
102
105
|
renderSlot(_ctx.$slots, "right")
|
103
106
|
]),
|
104
107
|
key: "2"
|
108
|
+
} : void 0,
|
109
|
+
_ctx.$slots.prefix ? {
|
110
|
+
name: "prefix",
|
111
|
+
fn: withCtx((scope) => [
|
112
|
+
renderSlot(_ctx.$slots, "prefix", normalizeProps(guardReactiveProps(scope)))
|
113
|
+
]),
|
114
|
+
key: "3"
|
115
|
+
} : void 0,
|
116
|
+
_ctx.$slots.before ? {
|
117
|
+
name: "before",
|
118
|
+
fn: withCtx((scope) => [
|
119
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(scope)))
|
120
|
+
]),
|
121
|
+
key: "4"
|
105
122
|
} : void 0
|
106
123
|
]), 1040);
|
107
124
|
};
|
@@ -42,6 +42,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
42
|
placeholderSecure: { type: Boolean },
|
43
43
|
allowPaste: { type: Boolean },
|
44
44
|
noWrap: { type: Boolean },
|
45
|
+
textTransparent: { type: Boolean },
|
45
46
|
title: {},
|
46
47
|
titleIcon: {},
|
47
48
|
description: {},
|
@@ -60,6 +61,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
61
|
filterValue: {},
|
61
62
|
subgrid: { type: Boolean },
|
62
63
|
seamless: { type: Boolean },
|
64
|
+
savedText: {},
|
65
|
+
topText: { type: Boolean },
|
63
66
|
parentElement: {},
|
64
67
|
maxHeight: {},
|
65
68
|
maxWidth: {},
|
@@ -47,6 +47,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
47
47
|
placeholderSecure: { type: Boolean },
|
48
48
|
allowPaste: { type: Boolean },
|
49
49
|
noWrap: { type: Boolean },
|
50
|
+
textTransparent: { type: Boolean },
|
50
51
|
title: {},
|
51
52
|
titleIcon: {},
|
52
53
|
description: {},
|
@@ -65,6 +66,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
65
66
|
filterValue: {},
|
66
67
|
subgrid: { type: Boolean },
|
67
68
|
seamless: { type: Boolean },
|
69
|
+
savedText: {},
|
70
|
+
topText: { type: Boolean },
|
68
71
|
parentElement: {},
|
69
72
|
maxHeight: {},
|
70
73
|
maxWidth: {},
|
@@ -43,6 +43,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
43
43
|
placeholderSecure: { type: Boolean },
|
44
44
|
allowPaste: { type: Boolean },
|
45
45
|
noWrap: { type: Boolean },
|
46
|
+
textTransparent: { type: Boolean },
|
46
47
|
title: {},
|
47
48
|
titleIcon: {},
|
48
49
|
description: {},
|
@@ -61,6 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
61
62
|
filterValue: {},
|
62
63
|
subgrid: { type: Boolean },
|
63
64
|
seamless: { type: Boolean },
|
65
|
+
savedText: {},
|
66
|
+
topText: { type: Boolean },
|
64
67
|
parentElement: {},
|
65
68
|
maxHeight: {},
|
66
69
|
maxWidth: {},
|
@@ -43,6 +43,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
43
43
|
placeholderSecure: { type: Boolean },
|
44
44
|
allowPaste: { type: Boolean },
|
45
45
|
noWrap: { type: Boolean },
|
46
|
+
textTransparent: { type: Boolean },
|
46
47
|
title: {},
|
47
48
|
titleIcon: {},
|
48
49
|
description: {},
|
@@ -61,6 +62,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
61
62
|
filterValue: {},
|
62
63
|
subgrid: { type: Boolean },
|
63
64
|
seamless: { type: Boolean },
|
65
|
+
savedText: {},
|
66
|
+
topText: { type: Boolean },
|
64
67
|
parentElement: {},
|
65
68
|
maxHeight: {},
|
66
69
|
maxWidth: {},
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useFormAsync.d.ts","sourceRoot":"","sources":["../../../../../src/components/FormAsync/use/useFormAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,UAAU,CAAA;AAS5C,eAAO,MAAM,YAAY,GAAI,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;;;;;
|
1
|
+
{"version":3,"file":"useFormAsync.d.ts","sourceRoot":"","sources":["../../../../../src/components/FormAsync/use/useFormAsync.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,UAAU,CAAA;AAS5C,eAAO,MAAM,YAAY,GAAI,KAAK,EAAE,SAAS,EAAE,WAAW,EAAE,OAAO,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,WAAW,CAAC,EAAE,WAAW,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI;;;;;uBAkCvH,SAAS;CA8BpC,CAAA"}
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import { toRef, ref, computed, onBeforeUnmount } from 'vue';
|
2
|
+
import { useFieldSaved } from '../../FieldWrapper/use/useFieldSaved.js';
|
2
3
|
import { Modal } from '../../../utils/Modal.js';
|
3
|
-
import { Notify } from '../../../utils/Notify.js';
|
4
4
|
import { handleApiError } from '../../../utils/api.js';
|
5
5
|
import { get, set } from '../../../utils/utils.js';
|
6
6
|
|
7
7
|
const useFormAsync = (props, onSuccess) => {
|
8
8
|
const enabled = toRef(props, "queryEnabled");
|
9
|
+
const { showSaved } = useFieldSaved();
|
9
10
|
const { data, setData, isLoadingError } = props.noParams === true ? props.useQueryFn({ enabled }) : props.useQueryFn(toRef(props, "queryParams"), { enabled });
|
10
11
|
const submitting = ref(false);
|
11
12
|
const modelValue = computed(() => get(data.value ?? {}, props.field));
|
@@ -14,7 +15,7 @@ const useFormAsync = (props, onSuccess) => {
|
|
14
15
|
submitting.value = true;
|
15
16
|
return props.apiMethod(set({}, props.field, value)).then((response) => {
|
16
17
|
setData(response.data);
|
17
|
-
|
18
|
+
showSaved();
|
18
19
|
onSuccess(response.data);
|
19
20
|
}).catch((error) => handleApiError(error, void 0, props.field)).finally(() => {
|
20
21
|
submitting.value = false;
|
@@ -12,12 +12,17 @@ declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullab
|
|
12
12
|
title?(_: {}): any;
|
13
13
|
subtitle?(_: {}): any;
|
14
14
|
prefix?(_: {}): any;
|
15
|
-
prefix?(_: {
|
16
|
-
|
15
|
+
prefix?(_: {
|
16
|
+
modelValue: (Type extends "number" ? number : string) | undefined;
|
17
|
+
}): any;
|
18
|
+
before?(_: {
|
19
|
+
modelValue: (Type extends "number" ? number : string) | undefined;
|
20
|
+
}): any;
|
17
21
|
after?(_: {}): any;
|
18
22
|
suffix?(_: {}): any;
|
19
23
|
inner?(_: {}): any;
|
20
24
|
right?(_: {}): any;
|
25
|
+
bottom?(_: {}): any;
|
21
26
|
};
|
22
27
|
emit: {
|
23
28
|
(e: "update:model-value", value: (Type extends "number" ? number : string) | undefined): void;
|
@@ -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":"AA4NA;AAkcA,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,SAAS,CAAA;yBAatB,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;WAypBO,mBAAmB,CAAC,oCAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;qBA5iB7B,IAAI;oBAOL,IAAI;;;MAqiBgD,GAAG,IAAI;WACpE,GAAG;;uBAxDgB,GAAG;0BACA,GAAG;wBACJ,GAAG;;;YACH,GAAG;;;YACH,GAAG;uBACJ,GAAG;wBACF,GAAG;uBACJ,GAAG;uBACH,GAAG;wBACF,GAAG;;;YA1lB1B,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;;EAgoBhB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AApqBzE,wBAoqB4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,10 +1,12 @@
|
|
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, resolveDynamicComponent, normalizeProps, guardReactiveProps, 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';
|
5
5
|
import { useComponentStates } from '../../utils/useComponentStates.js';
|
6
|
-
import _sfc_main$2 from './components/
|
6
|
+
import _sfc_main$2 from './components/ContentEditable.vue.js';
|
7
|
+
import _sfc_main$3 from './components/InputActions.vue.js';
|
7
8
|
|
9
|
+
const _hoisted_1 = { class: "relative flex min-h-full flex-1" };
|
8
10
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
9
11
|
...{ inheritAttrs: false },
|
10
12
|
__name: "WInput",
|
@@ -35,6 +37,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
37
|
allowPaste: { type: Boolean },
|
36
38
|
hideInput: { type: Boolean },
|
37
39
|
noWrap: { type: Boolean },
|
40
|
+
textTransparent: { type: Boolean },
|
38
41
|
title: {},
|
39
42
|
titleIcon: {},
|
40
43
|
description: {},
|
@@ -53,7 +56,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
53
56
|
filterField: {},
|
54
57
|
filterValue: {},
|
55
58
|
subgrid: { type: Boolean },
|
56
|
-
seamless: { type: Boolean }
|
59
|
+
seamless: { type: Boolean },
|
60
|
+
savedText: {},
|
61
|
+
topText: { type: Boolean }
|
57
62
|
},
|
58
63
|
emits: ["update:model-value", "keypress:enter", "keypress:up", "keypress:down", "keypress:delete", "keypress:backspace", "click:clear", "focus", "blur", "click", "mousedown", "click:suffix", "select:input", "paste"],
|
59
64
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -194,7 +199,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
194
199
|
return (_ctx, _cache) => {
|
195
200
|
return openBlock(), createBlock(_sfc_main$1, mergeProps({ ref: "fieldWrapper" }, props, {
|
196
201
|
class: _ctx.$attrs.class,
|
197
|
-
onClick: _cache[
|
202
|
+
onClick: _cache[9] || (_cache[9] = ($event) => {
|
198
203
|
_ctx.$emit("click:suffix", $event);
|
199
204
|
_ctx.seamless && focus();
|
200
205
|
})
|
@@ -246,9 +251,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
246
251
|
"border-opacity-0 group-hover/field:border-opacity-100 dark:border-opacity-0 dark:group-hover/field:border-opacity-100": _ctx.seamless && !focused,
|
247
252
|
"bg-default dark:bg-default-dark": !_ctx.seamless || focused
|
248
253
|
}]),
|
249
|
-
onClick: focus
|
250
|
-
onMousedown: _cache[9] || (_cache[9] = withModifiers(() => {
|
251
|
-
}, ["prevent"]))
|
254
|
+
onClick: focus
|
252
255
|
}, [
|
253
256
|
_ctx.icon ? (openBlock(), createElementBlock("div", {
|
254
257
|
key: 0,
|
@@ -273,70 +276,76 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
273
276
|
"flex-wrap": !_ctx.noWrap
|
274
277
|
}])
|
275
278
|
}, [
|
276
|
-
renderSlot(_ctx.$slots, "prefix"),
|
279
|
+
renderSlot(_ctx.$slots, "prefix", normalizeProps(guardReactiveProps({ modelValue: _ctx.modelValue }))),
|
277
280
|
createElementVNode("div", {
|
278
|
-
class: normalizeClass(["
|
281
|
+
class: normalizeClass(["overflow-auto font-normal", {
|
279
282
|
"absolute w-0 max-w-0": _ctx.hideInput,
|
280
|
-
"w-
|
283
|
+
"w-full": !_ctx.hideInput,
|
284
|
+
"w-option-has-bg-input": _ctx.$slots.prefix,
|
285
|
+
"resize-y": _ctx.resize && _ctx.textarea,
|
286
|
+
"resize-none": !_ctx.resize && _ctx.textarea,
|
287
|
+
"h-[calc(var(--w-input-height,2.75rem)-2px)]": !_ctx.textarea && !_ctx.$slots.suffix,
|
288
|
+
"w-option": !_ctx.textarea && _ctx.$slots.prefix,
|
289
|
+
"font-mono": _ctx.mono,
|
290
|
+
"text-black-default dark:text-gray-200": !unref(isDisabled),
|
291
|
+
"text-black-default/50 dark:text-gray-200/50": unref(isDisabled),
|
292
|
+
"-p--w-option-padding h-[--w-textarea-height,10rem] min-h-[--w-textarea-height,10rem] w-full": _ctx.textarea
|
281
293
|
}])
|
282
294
|
}, [
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
"
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
_ctx.$emit("
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
},
|
331
|
-
|
332
|
-
|
333
|
-
onSelect: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.$emit("select:input", $event), ["stop"]))
|
334
|
-
}, null, 40, ["id", "class", "value", "placeholder", "type", "name", "disabled", "readonly", "autocomplete", "size", "step", "min", "max", "spellcheck", "onFocus", "onBlur"])),
|
335
|
-
renderSlot(_ctx.$slots, "after")
|
295
|
+
createElementVNode("div", _hoisted_1, [
|
296
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps({ modelValue: _ctx.modelValue }))),
|
297
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.textarea ? _sfc_main$2 : "input"), {
|
298
|
+
id,
|
299
|
+
ref: "input",
|
300
|
+
class: normalizeClass(["w-input min-h-full flex-1 basis-auto appearance-none border-none bg-[inherit] outline-0 placeholder:text-gray-400 disabled:cursor-not-allowed dark:placeholder:text-gray-500", {
|
301
|
+
"text-secure": _ctx.textSecure && !isSecureVisible.value,
|
302
|
+
"[-webkit-text-fill-color:transparent]": _ctx.textTransparent
|
303
|
+
}]),
|
304
|
+
value: _ctx.placeholderSecure && _ctx.modelValue === void 0 && !focused ? "******" : _ctx.modelValue,
|
305
|
+
placeholder: _ctx.placeholder,
|
306
|
+
type: _ctx.type ?? "text",
|
307
|
+
name: _ctx.name,
|
308
|
+
disabled: unref(isDisabled),
|
309
|
+
readonly: unref(isReadonly) || _ctx.unclickable,
|
310
|
+
autocomplete: _ctx.autocomplete,
|
311
|
+
size: _ctx.size || void 0,
|
312
|
+
step: _ctx.step,
|
313
|
+
min: _ctx.min,
|
314
|
+
max: _ctx.max,
|
315
|
+
spellcheck: _ctx.spellcheck ? "true" : "false",
|
316
|
+
"max-length": _ctx.maxLength,
|
317
|
+
onInput: handleInputEvent,
|
318
|
+
onKeypress: _cache[0] || (_cache[0] = withKeys(withModifiers(($event) => !unref(isDisabled) && !unref(isReadonly) && _ctx.$emit("keypress:enter", $event), ["exact"]), ["enter"])),
|
319
|
+
onKeydown: [
|
320
|
+
_cache[1] || (_cache[1] = withKeys(withModifiers(($event) => !unref(isDisabled) && !unref(isReadonly) && _ctx.$emit("keypress:up", $event), ["exact", "stop"]), ["up"])),
|
321
|
+
_cache[2] || (_cache[2] = withKeys(withModifiers(($event) => !unref(isDisabled) && !unref(isReadonly) && _ctx.$emit("keypress:down", $event), ["exact", "stop"]), ["down"])),
|
322
|
+
_cache[3] || (_cache[3] = withKeys(withModifiers(($event) => {
|
323
|
+
!unref(isDisabled) && !unref(isReadonly) && _ctx.$emit("keypress:delete", $event);
|
324
|
+
handleBackspace($event);
|
325
|
+
}, ["exact", "stop"]), ["delete"]))
|
326
|
+
],
|
327
|
+
onFocus: ($event) => {
|
328
|
+
_ctx.$emit("focus", $event);
|
329
|
+
setFocused(true);
|
330
|
+
_ctx.seamless && nextTick(scrollToInput);
|
331
|
+
},
|
332
|
+
onBlur: ($event) => {
|
333
|
+
_ctx.$emit("blur", $event);
|
334
|
+
setFocused(false);
|
335
|
+
isSecureVisible.value = false;
|
336
|
+
_ctx.seamless && unref(contentRef)?.scrollTo({ left: 0 });
|
337
|
+
},
|
338
|
+
onClick: _cache[4] || (_cache[4] = ($event) => _ctx.$emit("click", $event)),
|
339
|
+
onMousedown: _cache[5] || (_cache[5] = withModifiers(($event) => _ctx.$emit("mousedown", $event), ["stop"])),
|
340
|
+
onSelect: _cache[6] || (_cache[6] = withModifiers(($event) => _ctx.$emit("select:input", $event), ["stop"])),
|
341
|
+
"onUpdate:modelValue": updateModelValue
|
342
|
+
}, null, 40, ["id", "class", "value", "placeholder", "type", "name", "disabled", "readonly", "autocomplete", "size", "step", "min", "max", "spellcheck", "max-length", "onFocus", "onBlur"])),
|
343
|
+
renderSlot(_ctx.$slots, "after")
|
344
|
+
])
|
336
345
|
], 2)
|
337
346
|
], 2)
|
338
347
|
], 2),
|
339
|
-
!_ctx.seamless || focused ? (openBlock(), createBlock(_sfc_main$
|
348
|
+
!_ctx.seamless || focused ? (openBlock(), createBlock(_sfc_main$3, {
|
340
349
|
key: 1,
|
341
350
|
"model-value": _ctx.modelValue,
|
342
351
|
loading: _ctx.loading,
|
@@ -369,7 +378,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
369
378
|
} : void 0
|
370
379
|
]), 1032, ["model-value", "loading", "allow-clear", "disabled", "readonly", "text-secure", "is-secure-visible", "allow-paste", "allow-copy", "focused", "onClick:slot"])) : createCommentVNode("", true),
|
371
380
|
renderSlot(_ctx.$slots, "inner")
|
372
|
-
],
|
381
|
+
], 2)
|
373
382
|
]),
|
374
383
|
key: "3"
|
375
384
|
},
|
@@ -379,6 +388,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
379
388
|
renderSlot(_ctx.$slots, "right")
|
380
389
|
]),
|
381
390
|
key: "4"
|
391
|
+
} : void 0,
|
392
|
+
_ctx.$slots.bottom ? {
|
393
|
+
name: "bottom",
|
394
|
+
fn: withCtx(() => [
|
395
|
+
renderSlot(_ctx.$slots, "bottom")
|
396
|
+
]),
|
397
|
+
key: "5"
|
382
398
|
} : void 0
|
383
399
|
]), 1040, ["class"]);
|
384
400
|
};
|
@@ -9,6 +9,12 @@ declare const _default: <Type extends InputType = "text">(__VLS_props: NonNullab
|
|
9
9
|
title?(_: {}): any;
|
10
10
|
subtitle?(_: {}): any;
|
11
11
|
right?(_: {}): any;
|
12
|
+
prefix?(_: {
|
13
|
+
modelValue: string | undefined;
|
14
|
+
}): any;
|
15
|
+
before?(_: {
|
16
|
+
modelValue: string | undefined;
|
17
|
+
}): any;
|
12
18
|
};
|
13
19
|
emit: (e: "update:model-value", value: (Type extends "number" ? number : string) | undefined) => void;
|
14
20
|
}>) => import('vue').VNode & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WInputAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputAsync.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WInputAsync.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Input/WInputAsync.vue"],"names":[],"mappings":"AA2HA;AAgRA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,SAAS,CAAA;yBAU3B,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;WAubO,mBAAmB,CAAC;;kLAAkE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;uBA/CiB,GAAG;0BACA,GAAG;uBACN,GAAG;;;YACF,GAAG;;;YACH,GAAG;;cA9X1B,oBAAoB,SAAS,4CAAa,SAAS,KAAG,IAAI;EA6a5D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAlczE,wBAkc4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,13 +1,12 @@
|
|
1
|
-
import { defineComponent, ref, useTemplateRef, computed, watch, toRef, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot,
|
2
|
-
import _sfc_main$2 from '../Button/
|
1
|
+
import { defineComponent, ref, useTemplateRef, computed, watch, toRef, createBlock, openBlock, mergeProps, createSlots, withCtx, renderSlot, normalizeProps, guardReactiveProps, createElementVNode, createVNode, withModifiers, unref, createTextVNode, Transition, createElementBlock, createCommentVNode, normalizeStyle } from 'vue';
|
2
|
+
import _sfc_main$2 from '../Button/WButton.vue.js';
|
3
3
|
import _sfc_main$1 from './WInput.vue.js';
|
4
|
-
import
|
5
|
-
import IconEdit from '../../assets/icons/sax/IconEdit.svg.js';
|
6
|
-
import IconSlash from '../../assets/icons/sax/IconSlash.svg.js';
|
4
|
+
import { SemanticType } from '../../utils/SemanticType.js';
|
7
5
|
import { useComponentStates } from '../../utils/useComponentStates.js';
|
8
6
|
|
9
|
-
const _hoisted_1 = { class: "
|
10
|
-
const _hoisted_2 = {
|
7
|
+
const _hoisted_1 = { class: "flex justify-end gap-4 pt-4" };
|
8
|
+
const _hoisted_2 = { class: "absolute inset-x-3 bottom-[calc((var(--w-input-height)-1.75em)/2)] isolate h-0.5" };
|
9
|
+
const _hoisted_3 = {
|
11
10
|
key: 0,
|
12
11
|
class: "absolute inset-0 -z-10 bg-gray-200 dark:bg-gray-700"
|
13
12
|
};
|
@@ -17,7 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
16
|
props: {
|
18
17
|
validate: {},
|
19
18
|
debounce: {},
|
20
|
-
|
19
|
+
instant: { type: Boolean },
|
21
20
|
modelValue: {},
|
22
21
|
type: {},
|
23
22
|
textarea: { type: Boolean },
|
@@ -44,6 +43,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
44
43
|
allowPaste: { type: Boolean },
|
45
44
|
hideInput: { type: Boolean },
|
46
45
|
noWrap: { type: Boolean },
|
46
|
+
textTransparent: { type: Boolean },
|
47
47
|
title: {},
|
48
48
|
titleIcon: {},
|
49
49
|
description: {},
|
@@ -62,7 +62,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
62
62
|
filterField: {},
|
63
63
|
filterValue: {},
|
64
64
|
subgrid: { type: Boolean },
|
65
|
-
seamless: { type: Boolean }
|
65
|
+
seamless: { type: Boolean },
|
66
|
+
savedText: {},
|
67
|
+
topText: { type: Boolean }
|
66
68
|
},
|
67
69
|
emits: ["update:model-value"],
|
68
70
|
setup(__props, { emit: __emit }) {
|
@@ -75,7 +77,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
75
77
|
const inputRef = useTemplateRef("input");
|
76
78
|
const errorMessageValue = ref();
|
77
79
|
const hasChangesValue = computed(() => props.modelValue !== value.value);
|
78
|
-
const canSave = computed(() => props.textSecure && focused.value || hasChangesValue.value);
|
79
80
|
const timeout = ref(null);
|
80
81
|
const doClearTimeout = () => {
|
81
82
|
if (timeout.value) {
|
@@ -92,14 +93,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
93
|
reset();
|
93
94
|
inputRef.value?.blur();
|
94
95
|
};
|
95
|
-
const
|
96
|
+
const save = async () => {
|
96
97
|
if (isDisabled.value || isReadonly.value || props.loading) return;
|
97
|
-
|
98
|
-
emitUpdateModelValue(value.value);
|
99
|
-
} else {
|
100
|
-
if (focused.value) cancel();
|
101
|
-
else open();
|
102
|
-
}
|
98
|
+
emitUpdateModelValue(value.value);
|
103
99
|
};
|
104
100
|
const open = () => {
|
105
101
|
if (isDisabled.value || isReadonly.value || props.loading) return;
|
@@ -125,6 +121,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
125
121
|
if (isDisabled.value || isReadonly.value || props.loading) return;
|
126
122
|
if (errorMessageValue.value) return;
|
127
123
|
if (props.placeholderSecure) inputRef.value?.blur();
|
124
|
+
if (timeout.value) clearTimeout(timeout.value);
|
128
125
|
emit("update:model-value", newValue);
|
129
126
|
if (!props.placeholderSecure) saved.value = true;
|
130
127
|
};
|
@@ -133,20 +130,20 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
133
130
|
doClearTimeout();
|
134
131
|
event.stopPropagation();
|
135
132
|
event.preventDefault();
|
136
|
-
if (
|
133
|
+
if (value.value !== props.modelValue) emitUpdateModelValue(value.value);
|
137
134
|
};
|
138
135
|
const handlePaste = () => {
|
139
136
|
doClearTimeout();
|
140
137
|
if (!value.value) return;
|
141
|
-
if (
|
138
|
+
if (value.value !== props.modelValue) emitUpdateModelValue(value.value);
|
142
139
|
};
|
143
140
|
const saveDebounced = () => {
|
144
|
-
if (
|
141
|
+
if (value.value !== props.modelValue) emit("update:model-value", value.value);
|
145
142
|
timeout.value = null;
|
146
143
|
};
|
147
144
|
const updateModelValueDebounced = () => {
|
148
145
|
if (timeout.value) clearTimeout(timeout.value);
|
149
|
-
if (
|
146
|
+
if (value.value === props.modelValue) {
|
150
147
|
timeout.value = null;
|
151
148
|
return;
|
152
149
|
}
|
@@ -168,13 +165,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
168
165
|
class: _ctx.$attrs.class,
|
169
166
|
"onKeypress:enter": handleEnterPress,
|
170
167
|
onClick: open,
|
171
|
-
onBlur: _cache[
|
172
|
-
props.textSecure ? cancel() :
|
168
|
+
onBlur: _cache[2] || (_cache[2] = ($event) => {
|
169
|
+
props.textSecure || !hasChangesValue.value ? cancel() : save();
|
173
170
|
focused.value = false;
|
174
171
|
}),
|
175
|
-
onFocus: _cache[
|
172
|
+
onFocus: _cache[3] || (_cache[3] = ($event) => focused.value = true),
|
176
173
|
onPaste: handlePaste,
|
177
|
-
"onUpdate:modelValue": _cache[
|
174
|
+
"onUpdate:modelValue": _cache[4] || (_cache[4] = ($event) => value.value = $event)
|
178
175
|
}), createSlots({ _: 2 }, [
|
179
176
|
_ctx.$slots.title ? {
|
180
177
|
name: "title",
|
@@ -190,29 +187,66 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
190
187
|
]),
|
191
188
|
key: "1"
|
192
189
|
} : void 0,
|
193
|
-
|
190
|
+
_ctx.$slots.right ? {
|
194
191
|
name: "right",
|
195
192
|
fn: withCtx(() => [
|
196
|
-
renderSlot(_ctx.$slots, "right")
|
197
|
-
!unref(isReadonly) && !_ctx.hideButton ? (openBlock(), createBlock(_sfc_main$2, {
|
198
|
-
key: 0,
|
199
|
-
icon: canSave.value ? markRaw(unref(IconCheck)) : focused.value ? markRaw(unref(IconSlash)) : markRaw(unref(IconEdit)),
|
200
|
-
"tooltip-text": !_ctx.loading && focused.value ? canSave.value ? "Save" : "Cancel" : void 0,
|
201
|
-
loading: _ctx.loading,
|
202
|
-
skeleton: _ctx.skeleton,
|
203
|
-
disabled: _ctx.disabled,
|
204
|
-
class: normalizeClass({
|
205
|
-
"bg-primary dark:bg-primary-dark text-default dark:text-default-dark": canSave.value
|
206
|
-
}),
|
207
|
-
onClick: toggle
|
208
|
-
}, null, 8, ["icon", "tooltip-text", "loading", "skeleton", "disabled", "class"])) : createCommentVNode("", true)
|
193
|
+
renderSlot(_ctx.$slots, "right")
|
209
194
|
]),
|
210
195
|
key: "2"
|
211
196
|
} : void 0,
|
197
|
+
_ctx.$slots.prefix ? {
|
198
|
+
name: "prefix",
|
199
|
+
fn: withCtx((scope) => [
|
200
|
+
renderSlot(_ctx.$slots, "prefix", normalizeProps(guardReactiveProps(scope)))
|
201
|
+
]),
|
202
|
+
key: "3"
|
203
|
+
} : void 0,
|
204
|
+
_ctx.$slots.before ? {
|
205
|
+
name: "before",
|
206
|
+
fn: withCtx((scope) => [
|
207
|
+
renderSlot(_ctx.$slots, "before", normalizeProps(guardReactiveProps(scope)))
|
208
|
+
]),
|
209
|
+
key: "4"
|
210
|
+
} : void 0,
|
211
|
+
!_ctx.skeleton && _ctx.textSecure && focused.value ? {
|
212
|
+
name: "bottom",
|
213
|
+
fn: withCtx(() => [
|
214
|
+
createElementVNode("div", _hoisted_1, [
|
215
|
+
createVNode(_sfc_main$2, {
|
216
|
+
"semantic-type": unref(SemanticType).SECONDARY,
|
217
|
+
disabled: _ctx.disabled || _ctx.loading,
|
218
|
+
class: "basis-32",
|
219
|
+
onMousedown: _cache[0] || (_cache[0] = withModifiers(() => {
|
220
|
+
}, ["prevent"])),
|
221
|
+
onClick: cancel
|
222
|
+
}, {
|
223
|
+
default: withCtx(() => _cache[5] || (_cache[5] = [
|
224
|
+
createTextVNode(" Cancel ")
|
225
|
+
])),
|
226
|
+
_: 1
|
227
|
+
}, 8, ["semantic-type", "disabled"]),
|
228
|
+
createVNode(_sfc_main$2, {
|
229
|
+
"semantic-type": unref(SemanticType).PRIMARY,
|
230
|
+
loading: _ctx.loading,
|
231
|
+
disabled: _ctx.disabled,
|
232
|
+
class: "basis-32",
|
233
|
+
onMousedown: _cache[1] || (_cache[1] = withModifiers(() => {
|
234
|
+
}, ["prevent"])),
|
235
|
+
onClick: save
|
236
|
+
}, {
|
237
|
+
default: withCtx(() => _cache[6] || (_cache[6] = [
|
238
|
+
createTextVNode(" Save ")
|
239
|
+
])),
|
240
|
+
_: 1
|
241
|
+
}, 8, ["semantic-type", "loading", "disabled"])
|
242
|
+
])
|
243
|
+
]),
|
244
|
+
key: "5"
|
245
|
+
} : void 0,
|
212
246
|
_ctx.debounce ? {
|
213
247
|
name: "inner",
|
214
248
|
fn: withCtx(() => [
|
215
|
-
createElementVNode("div",
|
249
|
+
createElementVNode("div", _hoisted_2, [
|
216
250
|
createVNode(Transition, {
|
217
251
|
"enter-active-class": "transition-opacity",
|
218
252
|
"leave-active-class": "transition-opacity",
|
@@ -220,7 +254,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
220
254
|
"leave-to-class": "opacity-0"
|
221
255
|
}, {
|
222
256
|
default: withCtx(() => [
|
223
|
-
timeout.value ? (openBlock(), createElementBlock("div",
|
257
|
+
timeout.value ? (openBlock(), createElementBlock("div", _hoisted_3)) : createCommentVNode("", true)
|
224
258
|
]),
|
225
259
|
_: 1
|
226
260
|
}),
|
@@ -241,7 +275,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
241
275
|
})
|
242
276
|
])
|
243
277
|
]),
|
244
|
-
key: "
|
278
|
+
key: "6"
|
245
279
|
} : void 0
|
246
280
|
]), 1040, ["class"]);
|
247
281
|
};
|