eco-vue-js 0.9.20 → 0.9.21
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/Button/WButtonGroup.vue.js +3 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.d.ts.map +1 -1
- package/dist/components/FieldWrapper/WFieldWrapper.vue.js +54 -19
- package/dist/components/FieldWrapper/components/FilterButton.vue.d.ts +9 -0
- package/dist/components/FieldWrapper/components/FilterButton.vue.d.ts.map +1 -0
- package/dist/components/FieldWrapper/components/FilterButton.vue.js +25 -0
- package/dist/components/FieldWrapper/components/FilterButton.vue2.js +5 -0
- package/dist/components/FieldWrapper/types.d.ts +2 -0
- package/dist/components/FieldWrapper/types.d.ts.map +1 -1
- package/dist/components/FormAsync/WFormAsyncButtonGroup.vue.js +3 -1
- package/dist/components/FormAsync/WFormAsyncInput.vue.js +3 -1
- package/dist/components/FormAsync/WFormAsyncSelect.vue.js +2 -0
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +2 -0
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +2 -0
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +2 -0
- package/dist/components/Input/WInput.vue.js +3 -1
- package/dist/components/Input/WInputAsync.vue.js +3 -1
- package/dist/components/Input/WInputDate.vue.js +2 -0
- package/dist/components/Input/WInputOptions.vue.js +2 -0
- package/dist/components/Input/WInputSuggest.vue.js +2 -0
- package/dist/components/Select/WSelect.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelect.vue.js +4 -1
- package/dist/components/Select/WSelectAsync.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +4 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectAsyncSingle.vue.js +4 -1
- package/dist/components/Select/WSelectSingle.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +4 -1
- package/dist/components/Select/WSelectStringified.vue.d.ts.map +1 -1
- package/dist/components/Select/WSelectStringified.vue.js +4 -1
- package/dist/main.js +1 -1
- package/dist/types/global.d.ts +10 -0
- package/dist/types/types.d.ts +1 -1
- package/dist/utils/api.d.ts +2 -0
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +20 -1
- package/package.json +1 -1
@@ -32,7 +32,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
32
32
|
noMargin: { type: Boolean },
|
33
33
|
allowCopy: { type: Boolean },
|
34
34
|
emptyValue: {},
|
35
|
-
leftError: { type: Boolean }
|
35
|
+
leftError: { type: Boolean },
|
36
|
+
filterField: {},
|
37
|
+
filterValue: {}
|
36
38
|
},
|
37
39
|
emits: ["update:model-value"],
|
38
40
|
setup(__props, { emit: __emit }) {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WFieldWrapper.vue.d.ts","sourceRoot":"","sources":["../../../src/components/FieldWrapper/WFieldWrapper.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WFieldWrapper.vue.d.ts","sourceRoot":"","sources":["../../../src/components/FieldWrapper/WFieldWrapper.vue"],"names":[],"mappings":"AAoNA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,SAAS,CAAA;AA6C9C,iBAAS,cAAc;;uBA6PI,GAAG;0BACC,GAAG;;;gCAzQP,OAAO,KAAG,IAAI;;YA0Qb,GAAG;;;gCA1QJ,OAAO,KAAG,IAAI;;YA2QX,GAAG;uBACL,GAAG;;;;;WAUjB,OAAO,IAA6B;EAEjD;AAoBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;kFASnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAWpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -1,24 +1,36 @@
|
|
1
|
-
import { defineComponent, useId, ref, openBlock, createElementBlock, normalizeClass, createElementVNode, unref, Fragment, renderSlot, createTextVNode, toDisplayString, createVNode, Transition, withCtx, createCommentVNode, createBlock, normalizeProps, guardReactiveProps } from 'vue';
|
2
|
-
import _sfc_main$
|
1
|
+
import { defineComponent, useId, ref, computed, openBlock, createElementBlock, normalizeClass, createElementVNode, unref, Fragment, renderSlot, createTextVNode, toDisplayString, createVNode, Transition, withCtx, createCommentVNode, createBlock, normalizeProps, guardReactiveProps } from 'vue';
|
2
|
+
import _sfc_main$2 from '../Button/WButtonCopy.vue.js';
|
3
3
|
import WSkeleton from '../Skeleton/WSkeleton.vue.js';
|
4
|
-
import _sfc_main$
|
4
|
+
import _sfc_main$3 from '../Tooltip/WTooltip.vue.js';
|
5
|
+
import '../Button/WButtonAction.vue.js';
|
6
|
+
import '../Button/WButton.vue.js';
|
7
|
+
import '../Button/WButtonDropdown.vue.js';
|
5
8
|
import { numberFormatter } from '../../utils/utils.js';
|
9
|
+
import _sfc_main$1 from './components/FilterButton.vue.js';
|
10
|
+
import '../../utils/supportsPassive.js';
|
11
|
+
import '../Dropdown/utils/DropdownStyle.js';
|
12
|
+
import 'vue-router';
|
13
|
+
import '../../utils/Modal.js';
|
14
|
+
import { encodeQueryParam } from '../../utils/api.js';
|
15
|
+
import '../Input/WInputSuggest.vue.js';
|
16
|
+
import '../Input/WInputDate.vue.js';
|
17
|
+
import '../Link/WLink.vue.js';
|
18
|
+
import '@tanstack/vue-query';
|
6
19
|
|
7
20
|
const _hoisted_1 = ["for"];
|
8
21
|
const _hoisted_2 = {
|
9
22
|
key: 0,
|
10
23
|
class: "text-negative dark:text-negative-dark"
|
11
24
|
};
|
12
|
-
const _hoisted_3 = {
|
13
|
-
const _hoisted_4 = {
|
25
|
+
const _hoisted_3 = {
|
14
26
|
key: 0,
|
15
27
|
class: "square-2 absolute right-0 top-0 rounded-full bg-[var(--has-changes-bg)] transition-colors"
|
16
28
|
};
|
17
|
-
const
|
29
|
+
const _hoisted_4 = {
|
18
30
|
key: 1,
|
19
31
|
class: "text-description absolute right-0 top-full whitespace-nowrap pt-0.5 text-xs font-normal"
|
20
32
|
};
|
21
|
-
const
|
33
|
+
const _hoisted_5 = {
|
22
34
|
key: 2,
|
23
35
|
ref: "rightContainer",
|
24
36
|
class: "sm-not:flex-col flex gap-4 pl-4"
|
@@ -42,12 +54,19 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
42
54
|
noMargin: { type: Boolean },
|
43
55
|
allowCopy: { type: Boolean },
|
44
56
|
emptyValue: {},
|
45
|
-
leftError: { type: Boolean }
|
57
|
+
leftError: { type: Boolean },
|
58
|
+
filterField: {},
|
59
|
+
filterValue: {}
|
46
60
|
},
|
47
61
|
emits: ["click"],
|
48
62
|
setup(__props) {
|
63
|
+
const props = __props;
|
49
64
|
const id = useId();
|
50
65
|
const focused = ref(false);
|
66
|
+
const encodedQueryParam = computed(() => {
|
67
|
+
if (!props.filterField) return void 0;
|
68
|
+
return encodeQueryParam(props.filterValue === void 0 ? props.modelValue : props.filterValue);
|
69
|
+
});
|
51
70
|
const setFocused = (value) => {
|
52
71
|
focused.value = value;
|
53
72
|
};
|
@@ -65,9 +84,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
65
84
|
"cursor-not-allowed": _ctx.disabled && !_ctx.skeleton
|
66
85
|
})
|
67
86
|
}, [
|
68
|
-
_ctx.title || _ctx.$slots.title
|
87
|
+
_ctx.title || _ctx.$slots.title ? (openBlock(), createElementBlock("div", {
|
69
88
|
key: 0,
|
70
|
-
class: normalizeClass(["text-accent mb-2 text-xs font-semibold duration-500", {
|
89
|
+
class: normalizeClass(["text-accent relative mb-2 pr-6 text-xs font-semibold duration-500", {
|
71
90
|
"opacity-50": _ctx.disabled && !_ctx.skeleton
|
72
91
|
}])
|
73
92
|
}, [
|
@@ -85,14 +104,24 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
85
104
|
_ctx.required ? (openBlock(), createElementBlock("span", _hoisted_2, " * ")) : createCommentVNode("", true)
|
86
105
|
]),
|
87
106
|
_: 1
|
88
|
-
})
|
107
|
+
}),
|
108
|
+
_ctx.filterField && encodedQueryParam.value ? (openBlock(), createBlock(_sfc_main$1, {
|
109
|
+
key: 0,
|
110
|
+
"filter-field": _ctx.filterField,
|
111
|
+
"encoded-query-param": encodedQueryParam.value,
|
112
|
+
class: "absolute -top-0.5 ml-1"
|
113
|
+
}, null, 8, ["filter-field", "encoded-query-param"])) : createCommentVNode("", true)
|
89
114
|
], 64)) : (openBlock(), createBlock(WSkeleton, {
|
90
115
|
key: 1,
|
91
116
|
class: "w-skeleton-h-4 w-skeleton-w-16"
|
92
117
|
}))
|
93
118
|
], 2)) : createCommentVNode("", true),
|
94
119
|
renderSlot(_ctx.$slots, "subtitle"),
|
95
|
-
createElementVNode("div",
|
120
|
+
createElementVNode("div", {
|
121
|
+
class: normalizeClass(["grid grid-cols-[1fr,auto]", {
|
122
|
+
"pr-9": !_ctx.title && !_ctx.$slots.title && _ctx.filterField && encodedQueryParam.value
|
123
|
+
}])
|
124
|
+
}, [
|
96
125
|
!_ctx.skeleton ? (openBlock(), createElementBlock("div", {
|
97
126
|
key: 0,
|
98
127
|
class: normalizeClass(["w-has-changes-color-info dark:w-has-changes-color-info-dark relative grid grid-cols-1", {
|
@@ -109,7 +138,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
109
138
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ id: unref(id), setFocused, focused: focused.value })), () => [
|
110
139
|
createTextVNode(toDisplayString(typeof _ctx.modelValue === "number" ? unref(numberFormatter).format(_ctx.modelValue) : _ctx.modelValue === null ? _ctx.emptyValue ?? "N / A" : _ctx.modelValue || _ctx.emptyValue), 1)
|
111
140
|
]),
|
112
|
-
_ctx.allowCopy && _ctx.modelValue ? (openBlock(), createBlock(_sfc_main$
|
141
|
+
_ctx.allowCopy && _ctx.modelValue ? (openBlock(), createBlock(_sfc_main$2, {
|
113
142
|
key: 0,
|
114
143
|
value: `${_ctx.modelValue}`,
|
115
144
|
class: "ml-2"
|
@@ -123,7 +152,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
123
152
|
"leave-to-class": "opacity-0"
|
124
153
|
}, {
|
125
154
|
default: withCtx(() => [
|
126
|
-
_ctx.hasChanges ? (openBlock(), createElementBlock("span",
|
155
|
+
_ctx.hasChanges ? (openBlock(), createElementBlock("span", _hoisted_3)) : createCommentVNode("", true)
|
127
156
|
]),
|
128
157
|
_: 1
|
129
158
|
}),
|
@@ -140,7 +169,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
140
169
|
"right-0 text-end": !_ctx.leftError,
|
141
170
|
"left-0 text-start": _ctx.leftError
|
142
171
|
}])
|
143
|
-
}, toDisplayString(_ctx.errorMessage), 3)) : _ctx.maxLength !== void 0 && focused.value ? (openBlock(), createElementBlock("div",
|
172
|
+
}, toDisplayString(_ctx.errorMessage), 3)) : _ctx.maxLength !== void 0 && focused.value ? (openBlock(), createElementBlock("div", _hoisted_4, toDisplayString(unref(numberFormatter).format(`${typeof _ctx.modelValue === "number" ? _ctx.modelValue : _ctx.modelValue || ""}`.length)) + " / " + toDisplayString(unref(numberFormatter).format(_ctx.maxLength)), 1)) : createCommentVNode("", true)
|
144
173
|
]),
|
145
174
|
_: 1
|
146
175
|
})
|
@@ -148,10 +177,16 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
148
177
|
key: 1,
|
149
178
|
class: "w-skeleton-w-full w-skeleton-rounded-xl w-skeleton-h-[calc(var(--field-height,2.125rem)+0.625rem)]"
|
150
179
|
})),
|
151
|
-
_ctx.$slots.right
|
180
|
+
_ctx.$slots.right ? (openBlock(), createElementBlock("div", _hoisted_5, [
|
152
181
|
renderSlot(_ctx.$slots, "right")
|
153
|
-
], 512)) : createCommentVNode("", true)
|
154
|
-
|
182
|
+
], 512)) : createCommentVNode("", true),
|
183
|
+
!_ctx.title && !_ctx.$slots.title && _ctx.filterField && encodedQueryParam.value ? (openBlock(), createBlock(_sfc_main$1, {
|
184
|
+
key: 3,
|
185
|
+
"filter-field": _ctx.filterField,
|
186
|
+
"encoded-query-param": encodedQueryParam.value,
|
187
|
+
class: "absolute right-0 self-center"
|
188
|
+
}, null, 8, ["filter-field", "encoded-query-param"])) : createCommentVNode("", true)
|
189
|
+
], 2)
|
155
190
|
], 10, _hoisted_1),
|
156
191
|
_ctx.description ? (openBlock(), createElementBlock("div", {
|
157
192
|
key: 0,
|
@@ -163,7 +198,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
163
198
|
createTextVNode(toDisplayString(_ctx.description), 1)
|
164
199
|
], 64))
|
165
200
|
], 2)) : createCommentVNode("", true),
|
166
|
-
_ctx.tooltipText && !_ctx.skeleton ? (openBlock(), createBlock(_sfc_main$
|
201
|
+
_ctx.tooltipText && !_ctx.skeleton ? (openBlock(), createBlock(_sfc_main$3, {
|
167
202
|
key: 1,
|
168
203
|
text: _ctx.tooltipText
|
169
204
|
}, null, 8, ["text"])) : createCommentVNode("", true)
|
@@ -0,0 +1,9 @@
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{
|
2
|
+
filterField: string;
|
3
|
+
encodedQueryParam: EncodeQueryParam<unknown>;
|
4
|
+
}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{
|
5
|
+
filterField: string;
|
6
|
+
encodedQueryParam: EncodeQueryParam<unknown>;
|
7
|
+
}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
8
|
+
export default _default;
|
9
|
+
//# sourceMappingURL=FilterButton.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"FilterButton.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/FieldWrapper/components/FilterButton.vue"],"names":[],"mappings":";iBA2Be,MAAM;uBACA,gBAAgB,CAAC,OAAO,CAAC;;iBAD/B,MAAM;uBACA,gBAAgB,CAAC,OAAO,CAAC;;AAyE9C,wBAMG"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createVNode, unref } from 'vue';
|
2
|
+
import IconFilter from '../../../assets/icons/sax/IconFilter.svg.js';
|
3
|
+
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
5
|
+
__name: "FilterButton",
|
6
|
+
props: {
|
7
|
+
filterField: {},
|
8
|
+
encodedQueryParam: {}
|
9
|
+
},
|
10
|
+
setup(__props) {
|
11
|
+
return (_ctx, _cache) => {
|
12
|
+
return openBlock(), createElementBlock("button", {
|
13
|
+
class: normalizeClass(["w-ripple w-ripple-hover rounded p-0.5", {
|
14
|
+
"text-description": _ctx.$route.query[_ctx.filterField] !== _ctx.encodedQueryParam,
|
15
|
+
"bg-primary-default dark:bg-primary-dark text-default dark:text-default-dark": _ctx.$route.query[_ctx.filterField] === _ctx.encodedQueryParam
|
16
|
+
}]),
|
17
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$router.replace({ query: { ..._ctx.$route.query, [_ctx.filterField]: _ctx.$route.query[_ctx.filterField] === _ctx.encodedQueryParam ? void 0 : _ctx.encodedQueryParam } }))
|
18
|
+
}, [
|
19
|
+
createVNode(unref(IconFilter), { class: "square-4" })
|
20
|
+
], 2);
|
21
|
+
};
|
22
|
+
}
|
23
|
+
});
|
24
|
+
|
25
|
+
export { _sfc_main as default };
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/components/FieldWrapper/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB;IAChC,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,CAAA;IAC7C,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ACnB,SAAS,CAAC,EAAE,OAAO,CAAA;IACnB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,WAAW,CAAC,EAAE,OAAO,CAAA;CACtB"}
|
@@ -38,7 +38,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
38
|
noMargin: { type: Boolean },
|
39
39
|
allowCopy: { type: Boolean },
|
40
40
|
emptyValue: {},
|
41
|
-
leftError: { type: Boolean }
|
41
|
+
leftError: { type: Boolean },
|
42
|
+
filterField: {},
|
43
|
+
filterValue: {}
|
42
44
|
},
|
43
45
|
setup(__props) {
|
44
46
|
const props = __props;
|
@@ -53,7 +53,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
53
53
|
noMargin: { type: Boolean },
|
54
54
|
allowCopy: { type: Boolean },
|
55
55
|
emptyValue: {},
|
56
|
-
leftError: { type: Boolean }
|
56
|
+
leftError: { type: Boolean },
|
57
|
+
filterField: {},
|
58
|
+
filterValue: {}
|
57
59
|
},
|
58
60
|
emits: ["success"],
|
59
61
|
setup(__props, { emit: __emit }) {
|
@@ -52,7 +52,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
52
52
|
noMargin: { type: Boolean },
|
53
53
|
allowCopy: { type: Boolean },
|
54
54
|
emptyValue: {},
|
55
|
-
leftError: { type: Boolean }
|
55
|
+
leftError: { type: Boolean },
|
56
|
+
filterField: {},
|
57
|
+
filterValue: {}
|
56
58
|
},
|
57
59
|
emits: ["update:modelValue", "keypress:enter", "keypress:up", "keypress:down", "keypress:delete", "keypress:backspace", "click:clear", "focus", "blur", "click", "mousedown", "click:suffix", "select:input", "paste"],
|
58
60
|
setup(__props, { expose: __expose, emit: __emit }) {
|
@@ -52,7 +52,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
52
52
|
noMargin: { type: Boolean },
|
53
53
|
allowCopy: { type: Boolean },
|
54
54
|
emptyValue: {},
|
55
|
-
leftError: { type: Boolean }
|
55
|
+
leftError: { type: Boolean },
|
56
|
+
filterField: {},
|
57
|
+
filterValue: {}
|
56
58
|
},
|
57
59
|
emits: ["update:modelValue"],
|
58
60
|
setup(__props, { emit: __emit }) {
|
@@ -51,6 +51,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
51
51
|
allowCopy: { type: Boolean },
|
52
52
|
emptyValue: {},
|
53
53
|
leftError: { type: Boolean },
|
54
|
+
filterField: {},
|
55
|
+
filterValue: {},
|
54
56
|
teleport: { type: Boolean },
|
55
57
|
noZIndex: { type: Boolean },
|
56
58
|
maxHeight: { default: 440 },
|
@@ -52,6 +52,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
52
52
|
allowCopy: { type: Boolean },
|
53
53
|
emptyValue: {},
|
54
54
|
leftError: { type: Boolean },
|
55
|
+
filterField: {},
|
56
|
+
filterValue: {},
|
55
57
|
teleport: { type: Boolean },
|
56
58
|
noZIndex: { type: Boolean },
|
57
59
|
maxHeight: { default: 320 },
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelect.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelect.vue"],"names":[],"mappings":"AAgaA,OAAO,KAAK,EAAC,qBAAqB,EAA8B,WAAW,EAAC,MAAM,SAAS,CAAA;yBAc1E,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eACnI,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW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
65
|
emptyValue: {},
|
66
66
|
leftError: { type: Boolean },
|
67
|
+
filterField: {},
|
68
|
+
filterValue: {},
|
67
69
|
teleport: { type: Boolean },
|
68
70
|
noZIndex: { type: Boolean },
|
69
71
|
maxHeight: {},
|
@@ -238,7 +240,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
238
240
|
...props,
|
239
241
|
modelValue: search.value,
|
240
242
|
hideInput: _ctx.modelValue.length === 0 ? false : unref(isMobile) ? !focused.value : !isOpen.value,
|
241
|
-
loading: _ctx.loading || unref(isLoading) || loadingCreate.value
|
243
|
+
loading: _ctx.loading || unref(isLoading) || loadingCreate.value,
|
244
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
242
245
|
}, {
|
243
246
|
class: _ctx.$attrs.class,
|
244
247
|
"onUpdate:modelValue": _cache[2] || (_cache[2] = ($event) => !_ctx.loading && !unref(isLoading) && (search.value = $event ?? "")),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectAsync.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsync.vue"],"names":[],"mappings":"AAuRA,OAAO,KAAK,EAAC,gBAAgB,EAAE,qBAAqB,EAA6B,MAAM,SAAS,CAAA;yBAY/E,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eAC5H,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,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AC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -61,6 +61,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
61
61
|
allowCopy: { type: Boolean },
|
62
62
|
emptyValue: {},
|
63
63
|
leftError: { type: Boolean },
|
64
|
+
filterField: {},
|
65
|
+
filterValue: {},
|
64
66
|
teleport: { type: Boolean },
|
65
67
|
noZIndex: { type: Boolean },
|
66
68
|
maxHeight: {},
|
@@ -165,7 +167,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
165
167
|
...props,
|
166
168
|
modelValue: search.value,
|
167
169
|
loading: _ctx.loading || isFetchingPrefix.value || loadingCreate.value,
|
168
|
-
hideInput: unref(isMobile) ? !focused.value : !isOpen.value
|
170
|
+
hideInput: unref(isMobile) ? !focused.value : !isOpen.value,
|
171
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
169
172
|
}, {
|
170
173
|
class: _ctx.$attrs.class,
|
171
174
|
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => !_ctx.loading && !isFetchingPrefix.value && (search.value = $event ?? "")),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectAsyncSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncSingle.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectAsyncSingle.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectAsyncSingle.vue"],"names":[],"mappings":"AAyFA,OAAO,KAAK,EAAC,sBAAsB,EAAE,qBAAqB,EAAC,MAAM,SAAS,CAAA;yBAOzD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,uBACxJ,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAwNxD,mBAAmB,CAAC;;;4OAAyD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAlCe,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YAhLzB,mBAAmB,0DAAoB,IAAI;YAC3C,YAAY,GAAG,IAAI;;;;;YAmNmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AAlOvE,wBAkO4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -59,6 +59,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
59
59
|
allowCopy: { type: Boolean },
|
60
60
|
emptyValue: {},
|
61
61
|
leftError: { type: Boolean },
|
62
|
+
filterField: {},
|
63
|
+
filterValue: {},
|
62
64
|
teleport: { type: Boolean },
|
63
65
|
noZIndex: { type: Boolean },
|
64
66
|
maxHeight: {},
|
@@ -90,7 +92,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
90
92
|
disableClear: !_ctx.allowClear,
|
91
93
|
previewData: _ctx.previewData ? [_ctx.previewData] : void 0,
|
92
94
|
createdData: _ctx.createdData ? [_ctx.createdData] : void 0,
|
93
|
-
hidePrefix: true
|
95
|
+
hidePrefix: true,
|
96
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
94
97
|
}, {
|
95
98
|
class: _ctx.$attrs.class,
|
96
99
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
@@ -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":"AA4FA,OAAO,KAAK,EAAC,qBAAqB,EAAE,iBAAiB,EAAC,MAAM,SAAS,CAAA;yBAOpD,KAAK,SAAS,MAAM,GAAG,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,EAAE,UAAU,SAAS,OAAO,uBAC/J,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WA6OxD,mBAAmB,CAAC;;;;gRAAyD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAnCe,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YApMzB,oBAAoB,0DAAoB,IAAI;YAC5C,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YAuOmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AAvPvE,wBAuP4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -55,6 +55,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
55
|
allowCopy: { type: Boolean },
|
56
56
|
emptyValue: {},
|
57
57
|
leftError: { type: Boolean },
|
58
|
+
filterField: {},
|
59
|
+
filterValue: {},
|
58
60
|
teleport: { type: Boolean },
|
59
61
|
noZIndex: { type: Boolean },
|
60
62
|
maxHeight: {},
|
@@ -89,7 +91,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
89
91
|
modelValue: arrayValue.value,
|
90
92
|
disableClear: !_ctx.allowClear,
|
91
93
|
createdData: _ctx.createdData ? [_ctx.createdData] : void 0,
|
92
|
-
hidePrefix: true
|
94
|
+
hidePrefix: true,
|
95
|
+
filterValue: _ctx.filterValue === void 0 ? _ctx.modelValue : _ctx.filterValue
|
93
96
|
}, {
|
94
97
|
class: _ctx.$attrs.class,
|
95
98
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event)),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WSelectStringified.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectStringified.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WSelectStringified.vue.d.ts","sourceRoot":"","sources":["../../../src/components/Select/WSelectStringified.vue"],"names":[],"mappings":"AA8FA,OAAO,KAAK,EAAC,qBAAqB,EAAE,sBAAsB,EAAC,MAAM,SAAS,CAAA;yBAOzD,KAAK,SAAS,MAAM,EAAE,IAAI,SAAS,WAAW,EAAE,kBAAkB,EAAE,eAAe,SAAS,qBAAqB,CAAC,IAAI,CAAC,eAC1H,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,cAClD,mBAAmB,CAAC,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,OAAO,CAAC,CAAC,iBAC5F,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,QAAQ,CAAC;WAgOxD,mBAAmB,CAAC;;;;yQAAyD,CAAC,4BAA2B;oBAChG,OAAO,KAAK,EAAE,gBAAgB;;MAAsB,GAAG,IAAI;WACpE,GAAG;;uBAnCe,GAAG;0BACA,GAAG;;;;;;YACL,GAAG;uBACJ,GAAG;;;YAzLzB,oBAAoB,SAAS,KAAK,GAAG,IAAI,GAAG,IAAI;YAChD,4BAA4B,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;YAC9D,YAAY,GAAG,IAAI;;;;;YA4NmB,OAAO,CAAC,OAAO,WAAW,CAAC;;AA1OvE,wBA0O4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -55,6 +55,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
55
|
allowCopy: { type: Boolean },
|
56
56
|
emptyValue: {},
|
57
57
|
leftError: { type: Boolean },
|
58
|
+
filterField: {},
|
59
|
+
filterValue: {},
|
58
60
|
teleport: { type: Boolean },
|
59
61
|
noZIndex: { type: Boolean },
|
60
62
|
maxHeight: {},
|
@@ -92,7 +94,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
92
94
|
return (_ctx, _cache) => {
|
93
95
|
return openBlock(), createBlock(_sfc_main$1, mergeProps({ ref: "selectComponent" }, {
|
94
96
|
...props,
|
95
|
-
modelValue: arrayValue.value
|
97
|
+
modelValue: arrayValue.value,
|
98
|
+
filterValue: _ctx.filterValue === void 0 ? arrayValue.value : _ctx.filterValue
|
96
99
|
}, {
|
97
100
|
class: _ctx.$attrs.class,
|
98
101
|
onSelect: _cache[0] || (_cache[0] = ($event) => updateModelValue($event, true)),
|
package/dist/main.js
CHANGED
@@ -79,7 +79,7 @@ export { default as WTabsItem } from './components/Tabs/WTabsItem.vue.js';
|
|
79
79
|
export { default as WToggle } from './components/Toggle/WToggle.vue.js';
|
80
80
|
export { default as WTooltip } from './components/Tooltip/WTooltip.vue.js';
|
81
81
|
export { default as WTooltipContainer } from './components/Tooltip/WTooltipContainer.vue.js';
|
82
|
-
export { ApiError, ApiErrorCancel, handleApiError } from './utils/api.js';
|
82
|
+
export { ApiError, ApiErrorCancel, encodeQueryParam, encodeQueryParams, handleApiError } from './utils/api.js';
|
83
83
|
export { Notify, initNotify } from './utils/Notify.js';
|
84
84
|
export { Modal, initModal } from './utils/Modal.js';
|
85
85
|
import * as DOMListenerContainer from './utils/DOMListenerContainer.js';
|
package/dist/types/global.d.ts
CHANGED
@@ -25,6 +25,16 @@ declare type PaginatedResponse<ValueType extends Record<string, unknown> | unkno
|
|
25
25
|
results: ValueType[]
|
26
26
|
}
|
27
27
|
|
28
|
+
declare type EncodeQueryParam<T> = string extends T
|
29
|
+
? string
|
30
|
+
: number extends T
|
31
|
+
? T
|
32
|
+
: string
|
33
|
+
|
34
|
+
declare type EncodeQueryParams<T> = {
|
35
|
+
[Key in keyof T]: EncodeQueryParam<T[Key]>
|
36
|
+
}
|
37
|
+
|
28
38
|
declare type ValidateFn = (value: string | number | undefined | string[] | boolean | null) => string | undefined
|
29
39
|
|
30
40
|
declare type InputType = 'number' | 'text' | 'tel' | 'search' | 'password' | 'email' | 'search' | 'url'
|
package/dist/types/types.d.ts
CHANGED
package/dist/utils/api.d.ts
CHANGED
@@ -15,5 +15,7 @@ export declare const handleApiError: <Error>(error: Error, form?: {
|
|
15
15
|
} | null, field?: string, formValidator?: {
|
16
16
|
invalidate: ComponentInstance<typeof WFormValidator>["invalidate"];
|
17
17
|
} | null) => Promise<Error>;
|
18
|
+
export declare const encodeQueryParam: <T>(value: T) => EncodeQueryParam<T> | undefined;
|
19
|
+
export declare const encodeQueryParams: <T>(params: T) => EncodeQueryParams<T>;
|
18
20
|
export {};
|
19
21
|
//# sourceMappingURL=api.d.ts.map
|
package/dist/utils/api.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAA;AACpD,OAAO,KAAK,cAAc,MAAM,sCAAsC,CAAA;AAMtE,KAAK,aAAa,CAAC,QAAQ,IAAI;KAC5B,GAAG,IAAI,QAAQ,GAAG,kBAAkB,GAAG,MAAM,QAAQ,CAAC,CAAC,EAAE,GAAG,SAAS,QAAQ,GAAG,MAAM,GAAG,MAAM,EAAE;CACnG,CAAA;AAED,qBAAa,QAAQ,CAAC,IAAI,SAAS,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAE,SAAQ,KAAK;aACvF,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;gBAA1C,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;CAGvE;AAED,qBAAa,cAAc,CAAC,IAAI,SAAS,WAAW,GAAG,WAAW,CAAC,OAAO,CAAC,CAAE,SAAQ,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;gBAChG,QAAQ,EAAE,eAAe,CAAC,SAAS,EAAE,IAAI,CAAC;CAGvD;AAED,eAAO,MAAM,cAAc,GAAI,KAAK,SAC3B,KAAK,SACL;IAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,KAAK,CAAC,CAAC,YAAY,CAAC,CAAA;CAAC,GAAG,IAAI,UACjE,MAAM,kBACE;IAAC,UAAU,EAAE,iBAAiB,CAAC,OAAO,cAAc,CAAC,CAAC,YAAY,CAAC,CAAA;CAAC,GAAG,IAAI,KAC1F,OAAO,CAAC,KAAK,CAgBf,CAAA"}
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/utils/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,6BAA6B,CAAA;AACpD,OAAO,KAAK,c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reject(error);
|
26
26
|
};
|
27
|
+
const encodeQueryParam = (value) => {
|
28
|
+
if (value === void 0) return void 0;
|
29
|
+
if (Array.isArray(value)) {
|
30
|
+
if (value.length === 0) return void 0;
|
31
|
+
if (value.every(Number.isInteger) || value.every((item) => typeof item === "string")) return value.join(",");
|
32
|
+
else return JSON.stringify(value);
|
33
|
+
} else {
|
34
|
+
if (value instanceof Object) return JSON.stringify(value);
|
35
|
+
else return `${value}`;
|
36
|
+
}
|
37
|
+
};
|
38
|
+
const encodeQueryParams = (params) => {
|
39
|
+
const result = {};
|
40
|
+
for (const key in params) {
|
41
|
+
const value = encodeQueryParam(params[key]);
|
42
|
+
if (value !== void 0) result[key] = value;
|
43
|
+
}
|
44
|
+
return result;
|
45
|
+
};
|
27
46
|
|
28
|
-
export { ApiError, ApiErrorCancel, handleApiError };
|
47
|
+
export { ApiError, ApiErrorCancel, encodeQueryParam, encodeQueryParams, handleApiError };
|