eco-vue-js 0.10.40 → 0.10.42
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/ActionsBar/WActionsBar.vue.d.ts +0 -1
- package/dist/components/ActionsBar/WActionsBar.vue.d.ts.map +1 -1
- package/dist/components/ActionsBar/WActionsBar.vue.js +24 -38
- package/dist/components/ActionsBar/WActionsBarFilter.vue.d.ts +24 -0
- package/dist/components/ActionsBar/WActionsBarFilter.vue.d.ts.map +1 -0
- package/dist/components/ActionsBar/WActionsBarFilter.vue.js +25 -0
- package/dist/components/ActionsBar/WActionsBarFilter.vue2.js +5 -0
- package/dist/components/ActionsBar/use/useActionsBarFilter.d.ts +12 -0
- package/dist/components/ActionsBar/use/useActionsBarFilter.d.ts.map +1 -0
- package/dist/components/ActionsBar/use/useActionsBarFilter.js +20 -0
- package/dist/components/BottomSheet/WBottomSheet.vue.d.ts.map +1 -1
- package/dist/components/BottomSheet/WBottomSheet.vue.js +16 -14
- package/dist/components/Button/WButtonDropdown.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonDropdown.vue.js +3 -4
- package/dist/components/Button/WButtonTab.vue.d.ts +42 -0
- package/dist/components/Button/WButtonTab.vue.d.ts.map +1 -0
- package/dist/components/Button/WButtonTab.vue.js +135 -0
- package/dist/components/Button/WButtonTab.vue2.js +5 -0
- package/dist/components/DatePicker/WDatePicker.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/WDatePicker.vue.js +4 -2
- package/dist/components/DatePicker/WDatePickerSingle.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/WDatePickerSingle.vue.js +4 -2
- package/dist/components/DatePicker/components/CalendarDay.vue.d.ts +1 -0
- package/dist/components/DatePicker/components/CalendarDay.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/components/CalendarDay.vue.js +4 -2
- package/dist/components/DatePicker/components/CalendarMonth.vue.d.ts +1 -0
- package/dist/components/DatePicker/components/CalendarMonth.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/components/CalendarMonth.vue.js +7 -4
- package/dist/components/DatePicker/components/CalendarWeek.vue.d.ts +1 -0
- package/dist/components/DatePicker/components/CalendarWeek.vue.d.ts.map +1 -1
- package/dist/components/DatePicker/components/CalendarWeek.vue.js +6 -3
- package/dist/components/Dropdown/WDropdown.vue.d.ts.map +1 -1
- package/dist/components/Dropdown/WDropdown.vue.js +4 -2
- package/dist/components/Dropdown/types.d.ts +2 -1
- package/dist/components/Dropdown/types.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts +4 -2
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/DropdownMenu/WDropdownMenu.vue.js +7 -7
- package/dist/components/DropdownMenu/types.d.ts +0 -1
- package/dist/components/DropdownMenu/types.d.ts.map +1 -1
- package/dist/components/Expansion/WExpansionItem.vue.d.ts +1 -0
- package/dist/components/Expansion/WExpansionItem.vue.d.ts.map +1 -1
- package/dist/components/Expansion/WExpansionItem.vue.js +16 -15
- package/dist/components/FieldWrapper/WFieldWrapper.vue.js +1 -1
- package/dist/components/Form/WForm.vue.d.ts.map +1 -1
- package/dist/components/Form/WForm.vue.js +3 -2
- package/dist/components/FormAsync/WFormAsyncSelect.vue.js +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectInfiniteSingle.vue.js +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectSingle.vue.js +1 -1
- package/dist/components/FormAsync/WFormAsyncSelectStringified.vue.js +1 -1
- package/dist/components/HeaderBar/WHeaderBar.vue.d.ts +1 -20
- package/dist/components/HeaderBar/WHeaderBar.vue.d.ts.map +1 -1
- package/dist/components/HeaderBar/WHeaderBar.vue.js +30 -79
- package/dist/components/HeaderBar/WHeaderBarSearch.vue.d.ts +27 -0
- package/dist/components/HeaderBar/WHeaderBarSearch.vue.d.ts.map +1 -0
- package/dist/components/HeaderBar/WHeaderBarSearch.vue.js +24 -0
- package/dist/components/HeaderBar/WHeaderBarSearch.vue2.js +5 -0
- package/dist/components/HeaderBar/use/useHeaderSearch.d.ts +10 -0
- package/dist/components/HeaderBar/use/useHeaderSearch.d.ts.map +1 -0
- package/dist/components/HeaderBar/use/useHeaderSearch.js +14 -0
- package/dist/components/HeaderBar/use/useHeaderSearchVisible.d.ts +5 -0
- package/dist/components/HeaderBar/use/useHeaderSearchVisible.d.ts.map +1 -0
- package/dist/components/HeaderBar/use/useHeaderSearchVisible.js +14 -0
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.d.ts.map +1 -1
- package/dist/components/InfiniteList/WInfiniteListWrapper.vue.js +12 -20
- package/dist/components/InfiniteList/use/useInfiniteListHeader.d.ts +8 -8
- package/dist/components/InfiniteList/use/useInfiniteListHeader.d.ts.map +1 -1
- package/dist/components/InfiniteList/use/useInfiniteListHeader.js +16 -3
- package/dist/components/Input/WInput.vue.d.ts +1 -1
- package/dist/components/Input/WInput.vue.d.ts.map +1 -1
- package/dist/components/Input/WInput.vue.js +8 -3
- package/dist/components/Input/WInputDate.vue.js +2 -2
- package/dist/components/Input/WInputOptions.vue.js +2 -2
- package/dist/components/Input/WInputSuggest.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputSuggest.vue.js +2 -3
- package/dist/components/List/WList.vue.d.ts +11 -2
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +266 -228
- package/dist/components/List/WListHeader.vue.js +1 -1
- package/dist/components/List/WListHeaderItem.vue.d.ts +6 -2
- package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeaderItem.vue.js +22 -10
- package/dist/components/List/components/HeaderSort.vue.d.ts +3 -1
- package/dist/components/List/components/HeaderSort.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderSort.vue.js +4 -3
- package/dist/components/List/components/HeaderSortItem.vue.d.ts +7 -5
- package/dist/components/List/components/HeaderSortItem.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderSortItem.vue.js +23 -10
- package/dist/components/List/components/ListFilterGlobal.vue.d.ts +25 -0
- package/dist/components/List/components/ListFilterGlobal.vue.d.ts.map +1 -0
- package/dist/components/List/components/ListFilterGlobal.vue.js +154 -0
- package/dist/components/List/components/ListFilterGlobal.vue2.js +5 -0
- package/dist/components/List/components/ListFilterGlobalItem.vue.d.ts +29 -0
- package/dist/components/List/components/ListFilterGlobalItem.vue.d.ts.map +1 -0
- package/dist/components/List/components/ListFilterGlobalItem.vue.js +49 -0
- package/dist/components/List/components/ListFilterGlobalItem.vue2.js +5 -0
- package/dist/components/List/components/ListFilterLocal.vue.d.ts +23 -0
- package/dist/components/List/components/ListFilterLocal.vue.d.ts.map +1 -0
- package/dist/components/List/components/ListFilterLocal.vue.js +148 -0
- package/dist/components/List/components/ListFilterLocal.vue2.js +5 -0
- package/dist/components/List/components/ListFilterSelect.vue.d.ts +21 -0
- package/dist/components/List/components/ListFilterSelect.vue.d.ts.map +1 -0
- package/dist/components/List/components/ListFilterSelect.vue.js +72 -0
- package/dist/components/List/components/ListFilterSelect.vue2.js +5 -0
- package/dist/components/List/models/utils.d.ts +3 -0
- package/dist/components/List/models/utils.d.ts.map +1 -0
- package/dist/components/List/models/utils.js +7 -0
- package/dist/components/List/types.d.ts +11 -0
- package/dist/components/List/types.d.ts.map +1 -1
- package/dist/components/Modal/WModal.vue.d.ts.map +1 -1
- package/dist/components/Modal/WModal.vue.js +8 -7
- package/dist/components/Modal/WModalStepper.vue.d.ts +28 -52
- package/dist/components/Modal/WModalStepper.vue.d.ts.map +1 -1
- package/dist/components/Modal/WModalWrapper.vue.d.ts.map +1 -1
- package/dist/components/Modal/WModalWrapper.vue.js +11 -4
- package/dist/components/Modal/models/injection.d.ts +1 -1
- package/dist/components/Modal/models/injection.d.ts.map +1 -1
- package/dist/components/Modal/models/injection.js +2 -2
- package/dist/components/Nav/WNavBar.vue.d.ts.map +1 -1
- package/dist/components/Nav/WNavBar.vue.js +13 -8
- package/dist/components/Select/WSelect.vue.js +1 -1
- package/dist/components/Select/WSelectAsync.vue.js +1 -1
- package/dist/components/Select/WSelectAsyncList.vue.d.ts +2 -2
- package/dist/components/Select/WSelectAsyncSingle.vue.js +1 -1
- package/dist/components/Select/WSelectSingle.vue.js +1 -1
- package/dist/components/Select/WSelectStringified.vue.js +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts +2 -2
- package/dist/components/Tabs/WTabs.vue.d.ts +18 -45
- package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.js +9 -18
- package/dist/components/Tabs/components/TabItem.vue.d.ts +1 -1
- package/dist/components/Tabs/components/TabItem.vue.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabTitleButton.vue.d.ts +2 -14
- package/dist/components/Tabs/components/TabTitleButton.vue.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabTitleButton.vue.js +19 -119
- package/dist/components/Tabs/types.d.ts +2 -1
- package/dist/components/Tabs/types.d.ts.map +1 -1
- package/dist/imports/componentsPlugin.d.ts +4 -1
- package/dist/imports/componentsPlugin.d.ts.map +1 -1
- package/dist/main.js +6 -3
- package/dist/types/global.d.ts +19 -4
- package/dist/utils/api.d.ts +14 -0
- package/dist/utils/api.d.ts.map +1 -1
- package/dist/utils/api.js +46 -2
- package/dist/utils/dateTime.d.ts +1 -0
- package/dist/utils/dateTime.d.ts.map +1 -1
- package/dist/utils/dateTime.js +4 -1
- package/dist/utils/utils.d.ts +18 -3
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +42 -1
- package/package.json +10 -1
- package/tailwind-base/plugins/default.ts +1 -0
- package/tailwind-base/theme/sizes.ts +2 -0
- package/dist/components/List/use/useOrdering.d.ts +0 -7
- package/dist/components/List/use/useOrdering.d.ts.map +0 -1
- package/dist/components/List/use/useOrdering.js +0 -36
@@ -1,7 +1,7 @@
|
|
1
|
-
import { defineComponent, useTemplateRef,
|
1
|
+
import { defineComponent, useTemplateRef, computed, ref, onMounted, createBlock, openBlock, resolveDynamicComponent, mergeProps, withCtx, normalizeClass, createElementVNode, createCommentVNode, renderSlot, createTextVNode, toDisplayString, Transition, createElementBlock, createVNode, unref } from 'vue';
|
2
2
|
import IconBack from '../../assets/icons/default/IconBack.svg.js';
|
3
|
+
import { Order } from '../../utils/order.js';
|
3
4
|
import _sfc_main$1 from './components/HeaderItemResizer.vue.js';
|
4
|
-
import { useOrdering } from './use/useOrdering.js';
|
5
5
|
|
6
6
|
const _hoisted_1 = {
|
7
7
|
key: 0,
|
@@ -19,11 +19,23 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
19
|
itemClass: {},
|
20
20
|
widthStyle: { type: [Boolean, null, String, Object, Array] }
|
21
21
|
},
|
22
|
-
emits: ["update:width"],
|
23
|
-
setup(__props) {
|
22
|
+
emits: ["update:width", "update:ordering"],
|
23
|
+
setup(__props, { emit: __emit }) {
|
24
24
|
const props = __props;
|
25
|
+
const emit = __emit;
|
25
26
|
const containerRef = useTemplateRef("container");
|
26
|
-
const
|
27
|
+
const index = computed(() => props.ordering.findIndex((item) => item.field === props.field));
|
28
|
+
const setOrdering = () => {
|
29
|
+
const newOrdering = props.ordering.slice();
|
30
|
+
if (index.value === -1) {
|
31
|
+
newOrdering.push({ field: props.field, order: Order.DESC });
|
32
|
+
} else if (newOrdering[index.value].order === Order.DESC) {
|
33
|
+
newOrdering[index.value].order = Order.ASC;
|
34
|
+
} else {
|
35
|
+
newOrdering.splice(index.value, 1);
|
36
|
+
}
|
37
|
+
emit("update:ordering", newOrdering);
|
38
|
+
};
|
27
39
|
const widthStyleInner = ref();
|
28
40
|
onMounted(() => {
|
29
41
|
if (!props.allowResize && containerRef.value instanceof HTMLDivElement) {
|
@@ -45,7 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
45
57
|
[_ctx.itemClass ?? ""]: true,
|
46
58
|
"items-center whitespace-nowrap font-semibold": !_ctx.itemClass
|
47
59
|
}]),
|
48
|
-
onClick: _cache[0] || (_cache[0] = ($event) => !_ctx.disabled &&
|
60
|
+
onClick: _cache[0] || (_cache[0] = ($event) => !_ctx.disabled && setOrdering())
|
49
61
|
}, {
|
50
62
|
default: withCtx(() => [
|
51
63
|
createElementVNode("div", {
|
@@ -65,14 +77,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
65
77
|
"leave-to-class": "opacity-0"
|
66
78
|
}, {
|
67
79
|
default: withCtx(() => [
|
68
|
-
|
80
|
+
index.value !== -1 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
69
81
|
createVNode(unref(IconBack), {
|
70
82
|
class: normalizeClass(["square-3 transition-transform", {
|
71
|
-
"rotate-90": _ctx.ordering[
|
72
|
-
"-rotate-90": _ctx.ordering[
|
83
|
+
"rotate-90": _ctx.ordering[index.value]?.order === "ASC",
|
84
|
+
"-rotate-90": _ctx.ordering[index.value]?.order === "DESC"
|
73
85
|
}])
|
74
86
|
}, null, 8, ["class"]),
|
75
|
-
_ctx.ordering.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(
|
87
|
+
_ctx.ordering.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_2, toDisplayString(index.value + 1), 1)) : createCommentVNode("", true)
|
76
88
|
])) : createCommentVNode("", true)
|
77
89
|
]),
|
78
90
|
_: 1
|
@@ -3,10 +3,11 @@ import { OrderItem } from '../../../utils/order';
|
|
3
3
|
import { ListMode } from '../../../utils/utils';
|
4
4
|
declare const _default: <Data extends DefaultData, QueryParams>(__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<{
|
5
5
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
6
|
+
readonly "onUpdate:ordering"?: ((value: OrderItem<keyof Data>[]) => any) | undefined;
|
6
7
|
readonly "onUpdate:field-config-map"?: ((value: Record<string, FieldConfig>) => any) | undefined;
|
7
8
|
readonly "onUpdate:mode"?: ((value: ListMode) => any) | undefined;
|
8
9
|
readonly "onClick:reset"?: (() => any) | undefined;
|
9
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:field-config-map" | "onUpdate:mode" | "onClick:reset"> & {
|
10
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:ordering" | "onUpdate:field-config-map" | "onUpdate:mode" | "onClick:reset"> & {
|
10
11
|
ordering: OrderItem<keyof Data>[];
|
11
12
|
fields: ListFields<Data, QueryParams>;
|
12
13
|
queryParams: QueryParams;
|
@@ -19,6 +20,7 @@ declare const _default: <Data extends DefaultData, QueryParams>(__VLS_props: Non
|
|
19
20
|
(e: "update:field-config-map", value: Record<string, FieldConfig>): void;
|
20
21
|
(e: "update:mode", value: ListMode): void;
|
21
22
|
(e: "click:reset"): void;
|
23
|
+
(e: "update:ordering", value: OrderItem<keyof Data>[]): void;
|
22
24
|
};
|
23
25
|
}>) => import('vue').VNode & {
|
24
26
|
__ctx?: Awaited<typeof __VLS_setup>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HeaderSort.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSort.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"HeaderSort.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSort.vue"],"names":[],"mappings":"AAmCA;AAqFA,OAAO,KAAK,EAAC,WAAW,EAAa,UAAU,EAAC,MAAM,UAAU,CAAA;AAChE,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;yBAc1B,IAAI,SAAS,WAAW,EAAE,WAAW,EACrD,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;WA2LO,mBAAmB,CAAC;;;;;;kBAvLhB,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE;gBACzB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;qBACxB,WAAW;mBACb,OAAO;mBAoL0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;YAjLL,yBAAyB,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI;YACpE,aAAa,SAAS,QAAQ,GAAG,IAAI;YACrC,aAAa,GAAG,IAAI;YACpB,iBAAiB,SAAS,SAAS,CAAC,MAAM,IAAI,CAAC,EAAE,GAAG,IAAI;;EAkL1D,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAtMzE,wBAsM4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -14,7 +14,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
14
|
queryParams: {},
|
15
15
|
disabled: { type: Boolean }
|
16
16
|
},
|
17
|
-
emits: ["update:field-config-map", "update:mode", "click:reset"],
|
17
|
+
emits: ["update:field-config-map", "update:mode", "click:reset", "update:ordering"],
|
18
18
|
setup(__props) {
|
19
19
|
const props = __props;
|
20
20
|
const isOpen = ref(false);
|
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
46
|
content: withCtx(() => [
|
47
47
|
createVNode(_sfc_main$2, {
|
48
48
|
class: "bg-default dark:bg-default-dark my-2 grid grid-cols-1 overflow-hidden rounded-xl shadow-md dark:outline dark:outline-1 dark:outline-gray-800",
|
49
|
-
onClick: _cache[
|
49
|
+
onClick: _cache[2] || (_cache[2] = ($event) => isOpen.value = false)
|
50
50
|
}, {
|
51
51
|
default: withCtx(() => [
|
52
52
|
(openBlock(true), createElementBlock(Fragment, null, renderList(fieldsFlat.value, (field) => {
|
@@ -55,7 +55,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
55
|
title: typeof field.title === "string" ? field.title : field.title(_ctx.queryParams),
|
56
56
|
field: typeof field.field === "string" ? field.field : field.field(_ctx.queryParams),
|
57
57
|
ordering: _ctx.ordering,
|
58
|
-
disabled: _ctx.disabled
|
58
|
+
disabled: _ctx.disabled,
|
59
|
+
"onUpdate:ordering": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:ordering", $event))
|
59
60
|
}, null, 8, ["title", "field", "ordering", "disabled"]);
|
60
61
|
}), 128))
|
61
62
|
]),
|
@@ -1,15 +1,17 @@
|
|
1
1
|
import { OrderItem } from '../../../utils/order';
|
2
|
-
declare const _default: <
|
3
|
-
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
-
ordering: OrderItem<
|
5
|
-
|
2
|
+
declare const _default: <Field>(__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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:ordering"?: ((value: OrderItem<Field>[]) => any) | undefined;
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:ordering"> & {
|
6
|
+
ordering: OrderItem<Field>[];
|
7
|
+
field: Field;
|
6
8
|
title: string;
|
7
9
|
disabled?: boolean;
|
8
10
|
} & Partial<{}>> & import('vue').PublicProps;
|
9
11
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
10
12
|
attrs: any;
|
11
13
|
slots: {};
|
12
|
-
emit:
|
14
|
+
emit: (e: "update:ordering", value: OrderItem<Field>[]) => void;
|
13
15
|
}>) => import('vue').VNode & {
|
14
16
|
__ctx?: Awaited<typeof __VLS_setup>;
|
15
17
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HeaderSortItem.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSortItem.vue"],"names":[],"mappings":"AA0CA;
|
1
|
+
{"version":3,"file":"HeaderSortItem.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSortItem.vue"],"names":[],"mappings":"AA0CA;AAuFA,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,eAAe,CAAA;yBAElC,KAAK,EACrB,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;WAgKO,mBAAmB,CAAC;;;kBA9JhB,SAAS,CAAC,KAAK,CAAC,EAAE;eACrB,KAAK;eACL,MAAM;mBACF,OAAO;mBA2J0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cAxJL,iBAAiB,SAAS,SAAS,CAAC,KAAK,CAAC,EAAE,KAAG,IAAI;EA4JrD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA3KzE,wBA2K4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,7 +1,7 @@
|
|
1
|
-
import { defineComponent,
|
1
|
+
import { defineComponent, computed, createBlock, openBlock, withCtx, createElementVNode, toDisplayString, createVNode, Transition, createCommentVNode, unref, normalizeClass, createElementBlock } from 'vue';
|
2
2
|
import _sfc_main$1 from '../../MenuItem/WMenuItem.vue.js';
|
3
3
|
import IconBack from '../../../assets/icons/default/IconBack.svg.js';
|
4
|
-
import {
|
4
|
+
import { Order } from '../../../utils/order.js';
|
5
5
|
|
6
6
|
const _hoisted_1 = { class: "flex-1 truncate font-normal" };
|
7
7
|
const _hoisted_2 = { class: "ml-auto flex w-8 items-center justify-between" };
|
@@ -17,13 +17,26 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
17
|
title: {},
|
18
18
|
disabled: { type: Boolean }
|
19
19
|
},
|
20
|
-
|
20
|
+
emits: ["update:ordering"],
|
21
|
+
setup(__props, { emit: __emit }) {
|
21
22
|
const props = __props;
|
22
|
-
const
|
23
|
+
const emit = __emit;
|
24
|
+
const index = computed(() => props.ordering.findIndex((item) => item.field === props.field));
|
25
|
+
const setOrdering = () => {
|
26
|
+
const newOrdering = props.ordering.slice();
|
27
|
+
if (index.value === -1) {
|
28
|
+
newOrdering.push({ field: props.field, order: Order.DESC });
|
29
|
+
} else if (newOrdering[index.value].order === Order.DESC) {
|
30
|
+
newOrdering[index.value].order = Order.ASC;
|
31
|
+
} else {
|
32
|
+
newOrdering.splice(index.value, 1);
|
33
|
+
}
|
34
|
+
emit("update:ordering", newOrdering);
|
35
|
+
};
|
23
36
|
return (_ctx, _cache) => {
|
24
37
|
return openBlock(), createBlock(_sfc_main$1, {
|
25
38
|
disabled: _ctx.disabled,
|
26
|
-
onClick:
|
39
|
+
onClick: setOrdering
|
27
40
|
}, {
|
28
41
|
default: withCtx(() => [
|
29
42
|
createElementVNode("div", _hoisted_1, toDisplayString(_ctx.title), 1),
|
@@ -35,11 +48,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
35
48
|
"leave-to-class": "opacity-0"
|
36
49
|
}, {
|
37
50
|
default: withCtx(() => [
|
38
|
-
|
51
|
+
index.value !== -1 ? (openBlock(), createBlock(unref(IconBack), {
|
39
52
|
key: 0,
|
40
53
|
class: normalizeClass(["square-4 transition-transform", {
|
41
|
-
"rotate-90": _ctx.ordering[
|
42
|
-
"-rotate-90": _ctx.ordering[
|
54
|
+
"rotate-90": _ctx.ordering[index.value]?.order === "ASC",
|
55
|
+
"-rotate-90": _ctx.ordering[index.value]?.order === "DESC"
|
43
56
|
}])
|
44
57
|
}, null, 8, ["class"])) : createCommentVNode("", true)
|
45
58
|
]),
|
@@ -52,14 +65,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
52
65
|
"leave-to-class": "opacity-0"
|
53
66
|
}, {
|
54
67
|
default: withCtx(() => [
|
55
|
-
|
68
|
+
index.value !== -1 && _ctx.ordering.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_3, toDisplayString(index.value + 1), 1)) : createCommentVNode("", true)
|
56
69
|
]),
|
57
70
|
_: 1
|
58
71
|
})
|
59
72
|
])
|
60
73
|
]),
|
61
74
|
_: 1
|
62
|
-
}, 8, ["disabled"
|
75
|
+
}, 8, ["disabled"]);
|
63
76
|
};
|
64
77
|
}
|
65
78
|
});
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import { FilterComponent } from '../types';
|
2
|
+
declare const _default: <QueryParams>(__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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:query-params"?: ((value: QueryParams) => any) | undefined;
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:query-params"> & {
|
6
|
+
filter: FilterComponent<QueryParams>[] | undefined;
|
7
|
+
filterSearch: FilterComponent<QueryParams> | undefined;
|
8
|
+
search: boolean;
|
9
|
+
queryParams: QueryParams;
|
10
|
+
disabledFilterFields: Array<keyof QueryParams>;
|
11
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
13
|
+
attrs: any;
|
14
|
+
slots: {
|
15
|
+
bottom?(_: {}): any;
|
16
|
+
};
|
17
|
+
emit: (e: "update:query-params", value: QueryParams) => void;
|
18
|
+
}>) => import('vue').VNode & {
|
19
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
20
|
+
};
|
21
|
+
export default _default;
|
22
|
+
type __VLS_PrettifyLocal<T> = {
|
23
|
+
[K in keyof T]: T[K];
|
24
|
+
} & {};
|
25
|
+
//# sourceMappingURL=ListFilterGlobal.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ListFilterGlobal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListFilterGlobal.vue"],"names":[],"mappings":"AA6FA;AAkKA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;yBAmB5B,WAAW,EAC3B,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;WAiYO,mBAAmB,CAAC;;;gBA/XlB,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,SAAS;sBACpC,eAAe,CAAC,WAAW,CAAC,GAAG,SAAS;gBAC9C,OAAO;qBACF,WAAW;8BACF,KAAK,CAAC,MAAM,WAAW,CAAC;mBA2X8C,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;wBA7CkB,GAAG;;cA3U1B,qBAAqB,SAAS,WAAW,KAAG,IAAI;EA4XlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA5YzE,wBA4Y4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,154 @@
|
|
1
|
+
import { defineComponent, ref, useTemplateRef, computed, createElementBlock, openBlock, Fragment, createBlock, createCommentVNode, withCtx, createElementVNode, unref, markRaw, resolveDynamicComponent, createSlots, renderList, renderSlot, createVNode, createTextVNode } from 'vue';
|
2
|
+
import _sfc_main$4 from '../../ActionsBar/WActionsBarFilter.vue.js';
|
3
|
+
import _sfc_main$6 from '../../Button/WButton.vue.js';
|
4
|
+
import _sfc_main$1 from '../../HeaderBar/WHeaderBarSearch.vue.js';
|
5
|
+
import _sfc_main$3 from '../../Input/WInput.vue.js';
|
6
|
+
import _sfc_main$2 from '../../Input/WInputSuggest.vue.js';
|
7
|
+
import IconFilterRemove from '../../../assets/icons/sax/IconFilterRemove.svg.js';
|
8
|
+
import IconSearch from '../../../assets/icons/sax/IconSearch.svg.js';
|
9
|
+
import { Modal } from '../../../utils/Modal.js';
|
10
|
+
import { SemanticType } from '../../../utils/SemanticType.js';
|
11
|
+
import { useIsMobile } from '../../../utils/mobile.js';
|
12
|
+
import _sfc_main$5 from './ListFilterGlobalItem.vue.js';
|
13
|
+
|
14
|
+
const _hoisted_1 = { class: "px-3" };
|
15
|
+
const _hoisted_2 = { class: "-px--inner-margin grid grid-cols-2 gap-4" };
|
16
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
17
|
+
__name: "ListFilterGlobal",
|
18
|
+
props: {
|
19
|
+
filter: {},
|
20
|
+
filterSearch: {},
|
21
|
+
search: { type: Boolean },
|
22
|
+
queryParams: {},
|
23
|
+
disabledFilterFields: {}
|
24
|
+
},
|
25
|
+
emits: ["update:query-params"],
|
26
|
+
setup(__props, { emit: __emit }) {
|
27
|
+
const emit = __emit;
|
28
|
+
const { isMobile } = useIsMobile();
|
29
|
+
const open = ref(null);
|
30
|
+
const inputRef = useTemplateRef("input");
|
31
|
+
const filterItemRef = useTemplateRef("filterItem");
|
32
|
+
const count = computed(() => filterItemRef.value?.filter((item) => item.hasChanges).length ?? 0);
|
33
|
+
let closeModal = null;
|
34
|
+
const openConfirmReset = () => {
|
35
|
+
closeModal?.();
|
36
|
+
closeModal = Modal.addConfirm(
|
37
|
+
{
|
38
|
+
title: "Are you sure?",
|
39
|
+
description: "Do you want to reset filters?",
|
40
|
+
acceptText: "Reset Filters",
|
41
|
+
onAccept: () => {
|
42
|
+
closeModal = null;
|
43
|
+
const result = {};
|
44
|
+
filterItemRef.value?.forEach((item) => {
|
45
|
+
Object.assign(result, item.getDefaultQuery());
|
46
|
+
});
|
47
|
+
emit("update:query-params", result);
|
48
|
+
}
|
49
|
+
}
|
50
|
+
);
|
51
|
+
};
|
52
|
+
return (_ctx, _cache) => {
|
53
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
54
|
+
_ctx.search ? (openBlock(), createBlock(_sfc_main$1, { key: 0 }, {
|
55
|
+
default: withCtx(({ visible, hide }) => [
|
56
|
+
createElementVNode("div", null, [
|
57
|
+
_ctx.filterSearch && unref(isMobile) ? (openBlock(), createBlock(_sfc_main$2, {
|
58
|
+
key: 0,
|
59
|
+
ref: "input",
|
60
|
+
"model-value": _ctx.queryParams.search,
|
61
|
+
autofocus: visible,
|
62
|
+
placeholder: "Search..",
|
63
|
+
"allow-clear": "",
|
64
|
+
persist: "",
|
65
|
+
teleport: "",
|
66
|
+
"no-margin": "",
|
67
|
+
class: "w-full",
|
68
|
+
icon: markRaw(unref(IconSearch)),
|
69
|
+
"onClick:clear": unref(inputRef)?.close,
|
70
|
+
onClose: ($event) => !_ctx.queryParams.search && hide?.(),
|
71
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:query-params", { search: $event || void 0 }))
|
72
|
+
}, {
|
73
|
+
content: withCtx(() => [
|
74
|
+
createElementVNode("div", _hoisted_1, [
|
75
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.filterSearch), {
|
76
|
+
"query-params": _ctx.queryParams,
|
77
|
+
"onUpdate:queryParams": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:query-params", $event))
|
78
|
+
}, null, 40, ["query-params"]))
|
79
|
+
])
|
80
|
+
]),
|
81
|
+
_: 2
|
82
|
+
}, 1032, ["model-value", "autofocus", "icon", "onClick:clear", "onClose"])) : (openBlock(), createBlock(_sfc_main$3, {
|
83
|
+
key: 1,
|
84
|
+
ref: "input",
|
85
|
+
"model-value": _ctx.queryParams.search,
|
86
|
+
autofocus: visible,
|
87
|
+
placeholder: "Search..",
|
88
|
+
"allow-clear": "",
|
89
|
+
"no-margin": "",
|
90
|
+
class: "w-full",
|
91
|
+
icon: markRaw(unref(IconSearch)),
|
92
|
+
onBlur: ($event) => !_ctx.queryParams.search && hide?.(),
|
93
|
+
"onClick:clear": hide,
|
94
|
+
"onUpdate:modelValue": _cache[3] || (_cache[3] = ($event) => _ctx.$emit("update:query-params", { search: $event || void 0 }))
|
95
|
+
}, createSlots({ _: 2 }, [
|
96
|
+
_ctx.filterSearch ? {
|
97
|
+
name: "right",
|
98
|
+
fn: withCtx(() => [
|
99
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.filterSearch), {
|
100
|
+
"query-params": _ctx.queryParams,
|
101
|
+
"onUpdate:queryParams": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:query-params", $event))
|
102
|
+
}, null, 40, ["query-params"]))
|
103
|
+
]),
|
104
|
+
key: "0"
|
105
|
+
} : void 0
|
106
|
+
]), 1032, ["model-value", "autofocus", "icon", "onBlur", "onClick:clear"]))
|
107
|
+
])
|
108
|
+
]),
|
109
|
+
_: 1
|
110
|
+
})) : createCommentVNode("", true),
|
111
|
+
_ctx.filter ? (openBlock(), createBlock(_sfc_main$4, {
|
112
|
+
key: 1,
|
113
|
+
count: count.value
|
114
|
+
}, {
|
115
|
+
default: withCtx(() => [
|
116
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.filter, (item, index) => {
|
117
|
+
return openBlock(), createBlock(_sfc_main$5, {
|
118
|
+
key: index,
|
119
|
+
ref_for: true,
|
120
|
+
ref: "filterItem",
|
121
|
+
item,
|
122
|
+
"query-params": _ctx.queryParams,
|
123
|
+
"is-open": open.value === index,
|
124
|
+
"disabled-filter-fields": _ctx.disabledFilterFields,
|
125
|
+
class: "-px--inner-margin",
|
126
|
+
onToggle: ($event) => open.value = open.value === index ? null : index,
|
127
|
+
"onUpdate:queryParams": _cache[4] || (_cache[4] = ($event) => _ctx.$emit("update:query-params", $event))
|
128
|
+
}, null, 8, ["item", "query-params", "is-open", "disabled-filter-fields", "onToggle"]);
|
129
|
+
}), 128)),
|
130
|
+
_cache[6] || (_cache[6] = createElementVNode("div", { class: "-mx--inner-margin my-8 h-0.5 rounded bg-gray-400" }, null, -1)),
|
131
|
+
createElementVNode("div", _hoisted_2, [
|
132
|
+
renderSlot(_ctx.$slots, "bottom"),
|
133
|
+
createVNode(_sfc_main$6, {
|
134
|
+
"semantic-type": unref(SemanticType).SECONDARY,
|
135
|
+
disabled: !count.value,
|
136
|
+
class: "col-start-2",
|
137
|
+
onClick: openConfirmReset
|
138
|
+
}, {
|
139
|
+
default: withCtx(() => [
|
140
|
+
createVNode(unref(IconFilterRemove)),
|
141
|
+
_cache[5] || (_cache[5] = createTextVNode(" Reset Filters "))
|
142
|
+
]),
|
143
|
+
_: 1
|
144
|
+
}, 8, ["semantic-type", "disabled"])
|
145
|
+
])
|
146
|
+
]),
|
147
|
+
_: 3
|
148
|
+
}, 8, ["count"])) : createCommentVNode("", true)
|
149
|
+
], 64);
|
150
|
+
};
|
151
|
+
}
|
152
|
+
});
|
153
|
+
|
154
|
+
export { _sfc_main as default };
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { FilterComponent } from '../types';
|
2
|
+
declare const _default: <QueryParams>(__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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:query-params"?: ((value: QueryParams) => any) | undefined;
|
5
|
+
readonly onToggle?: (() => any) | undefined;
|
6
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onToggle" | "onUpdate:query-params"> & {
|
7
|
+
item: FilterComponent<QueryParams>;
|
8
|
+
queryParams: QueryParams;
|
9
|
+
isOpen: boolean;
|
10
|
+
disabledFilterFields: Array<keyof QueryParams>;
|
11
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{
|
13
|
+
hasChanges: import('vue').ComputedRef<boolean>;
|
14
|
+
getDefaultQuery: () => Partial<Record<keyof QueryParams, undefined>>;
|
15
|
+
}>): void;
|
16
|
+
attrs: any;
|
17
|
+
slots: {};
|
18
|
+
emit: {
|
19
|
+
(e: "update:query-params", value: QueryParams): void;
|
20
|
+
(e: "toggle"): void;
|
21
|
+
};
|
22
|
+
}>) => import('vue').VNode & {
|
23
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
24
|
+
};
|
25
|
+
export default _default;
|
26
|
+
type __VLS_PrettifyLocal<T> = {
|
27
|
+
[K in keyof T]: T[K];
|
28
|
+
} & {};
|
29
|
+
//# sourceMappingURL=ListFilterGlobalItem.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ListFilterGlobalItem.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListFilterGlobalItem.vue"],"names":[],"mappings":"AAgBA;AAuDA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;yBAQ5B,WAAW,EAC3B,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;WA+HO,mBAAmB,CAAC;;;;cA7HpB,eAAe,CAAC,WAAW,CAAC;qBACrB,WAAW;gBAChB,OAAO;8BACO,KAAK,CAAC,MAAM,WAAW,CAAC;mBA0H8C,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB;;+BA7GnB,OAAO,CAAC,MAAM,CAAC,MAAM,WAAW,EAAE,SAAS,CAAC,CAAC;MA6GJ,GAAG,IAAI;WACpE,GAAG;;;YAvHL,qBAAqB,SAAS,WAAW,GAAG,IAAI;YAChD,QAAQ,GAAG,IAAI;;EA0HjB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA1IzE,wBA0I4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import { defineComponent, computed, createBlock, createCommentVNode, unref, openBlock, withCtx, resolveDynamicComponent } from 'vue';
|
2
|
+
import _sfc_main$1 from '../../Expansion/WExpansionItem.vue.js';
|
3
|
+
import { getItemProp } from '../models/utils.js';
|
4
|
+
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
|
+
__name: "ListFilterGlobalItem",
|
7
|
+
props: {
|
8
|
+
item: {},
|
9
|
+
queryParams: {},
|
10
|
+
isOpen: { type: Boolean },
|
11
|
+
disabledFilterFields: {}
|
12
|
+
},
|
13
|
+
emits: ["update:query-params", "toggle"],
|
14
|
+
setup(__props, { expose: __expose }) {
|
15
|
+
const props = __props;
|
16
|
+
const fields = computed(() => getItemProp(props.queryParams, props.item, "fields") ?? []);
|
17
|
+
const hasChanges = computed(() => fields.value.some((field) => field in props.queryParams));
|
18
|
+
const getDefaultQuery = () => {
|
19
|
+
return fields.value.reduce((result, field) => {
|
20
|
+
result[field] = void 0;
|
21
|
+
return result;
|
22
|
+
}, {}) ?? {};
|
23
|
+
};
|
24
|
+
__expose({
|
25
|
+
hasChanges,
|
26
|
+
getDefaultQuery
|
27
|
+
});
|
28
|
+
return (_ctx, _cache) => {
|
29
|
+
return !unref(getItemProp)(_ctx.queryParams, _ctx.item, "hidden") && !fields.value.some((field) => _ctx.disabledFilterFields.includes(field)) ? (openBlock(), createBlock(_sfc_main$1, {
|
30
|
+
key: 0,
|
31
|
+
title: unref(getItemProp)(_ctx.queryParams, _ctx.item, "title"),
|
32
|
+
icon: unref(getItemProp)(_ctx.queryParams, _ctx.item, "icon"),
|
33
|
+
"is-open": _ctx.isOpen,
|
34
|
+
"has-flag": hasChanges.value,
|
35
|
+
onToggle: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("toggle"))
|
36
|
+
}, {
|
37
|
+
default: withCtx(() => [
|
38
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.item), {
|
39
|
+
"query-params": _ctx.queryParams,
|
40
|
+
"onUpdate:queryParams": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:query-params", $event))
|
41
|
+
}, null, 40, ["query-params"]))
|
42
|
+
]),
|
43
|
+
_: 1
|
44
|
+
}, 8, ["title", "icon", "is-open", "has-flag"])) : createCommentVNode("", true);
|
45
|
+
};
|
46
|
+
}
|
47
|
+
});
|
48
|
+
|
49
|
+
export { _sfc_main as default };
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { FilterComponent } from '../types';
|
2
|
+
declare const _default: <QueryParams>(__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
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:query-params"?: ((value: QueryParams) => any) | undefined;
|
5
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:query-params"> & {
|
6
|
+
filter: FilterComponent<QueryParams>[] | undefined;
|
7
|
+
filterSearch: FilterComponent<QueryParams> | undefined;
|
8
|
+
search: boolean;
|
9
|
+
queryParams: QueryParams;
|
10
|
+
disabledFilterFields: Array<keyof QueryParams>;
|
11
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
13
|
+
attrs: any;
|
14
|
+
slots: {};
|
15
|
+
emit: (e: "update:query-params", value: QueryParams) => void;
|
16
|
+
}>) => import('vue').VNode & {
|
17
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
18
|
+
};
|
19
|
+
export default _default;
|
20
|
+
type __VLS_PrettifyLocal<T> = {
|
21
|
+
[K in keyof T]: T[K];
|
22
|
+
} & {};
|
23
|
+
//# sourceMappingURL=ListFilterLocal.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ListFilterLocal.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListFilterLocal.vue"],"names":[],"mappings":"AAoFA;AA0JA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;yBAiB5B,WAAW,EAC3B,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;WAqUO,mBAAmB,CAAC;;;gBAnUlB,eAAe,CAAC,WAAW,CAAC,EAAE,GAAG,SAAS;sBACpC,eAAe,CAAC,WAAW,CAAC,GAAG,SAAS;gBAC9C,OAAO;qBACF,WAAW;8BACF,KAAK,CAAC,MAAM,WAAW,CAAC;mBA+T8C,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cA5TL,qBAAqB,SAAS,WAAW,KAAG,IAAI;EAgUlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhVzE,wBAgV4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|