eco-vue-js 0.10.68 → 0.10.70
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/WButtonMore.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonMore.vue.js +1 -2
- package/dist/components/Button/WButtonUnselect.vue.d.ts +2 -0
- package/dist/components/Button/WButtonUnselect.vue.d.ts.map +1 -1
- package/dist/components/Button/WButtonUnselect.vue.js +4 -3
- package/dist/components/DragContainer/WDragContainer.vue.d.ts +36 -0
- package/dist/components/DragContainer/WDragContainer.vue.d.ts.map +1 -0
- package/dist/components/DragContainer/WDragContainer.vue.js +65 -0
- package/dist/components/DragContainer/WDragContainer.vue2.js +5 -0
- package/dist/components/DragContainer/components/DragItem.vue.d.ts +43 -0
- package/dist/components/DragContainer/components/DragItem.vue.d.ts.map +1 -0
- package/dist/components/DragContainer/components/DragItem.vue.js +46 -0
- package/dist/components/DragContainer/components/DragItem.vue2.js +5 -0
- package/dist/components/DragContainer/use/useDragContainer.d.ts +7 -0
- package/dist/components/DragContainer/use/useDragContainer.d.ts.map +1 -0
- package/dist/components/DragContainer/use/useDragContainer.js +44 -0
- package/dist/components/DropdownMenu/WDropdownMenu.vue.d.ts.map +1 -1
- package/dist/components/HeaderBar/WHeaderBarSearch.vue.d.ts.map +1 -1
- package/dist/components/HeaderBar/WHeaderBarSearch.vue.js +1 -0
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts +135 -3
- package/dist/components/InfiniteList/WInfiniteList.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputAsync.vue.d.ts.map +1 -1
- package/dist/components/Input/WInputAsync.vue.js +7 -35
- package/dist/components/List/WList.vue.d.ts +3 -3
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +9 -5
- package/dist/components/List/WListCard.vue.d.ts.map +1 -1
- package/dist/components/List/WListCard.vue.js +2 -2
- package/dist/components/List/WListHeaderItem.vue.d.ts +3 -1
- package/dist/components/List/WListHeaderItem.vue.d.ts.map +1 -1
- package/dist/components/List/WListHeaderItem.vue.js +3 -2
- package/dist/components/List/components/HeaderFieldNested.vue.d.ts +2 -1
- package/dist/components/List/components/HeaderFieldNested.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderFieldNested.vue.js +7 -5
- package/dist/components/List/components/HeaderSettings.vue.d.ts.map +1 -1
- package/dist/components/List/components/HeaderSettings.vue.js +39 -68
- package/dist/components/List/components/HeaderSettingsList.vue.d.ts +26 -0
- package/dist/components/List/components/HeaderSettingsList.vue.d.ts.map +1 -0
- package/dist/components/List/components/HeaderSettingsList.vue.js +71 -0
- package/dist/components/List/components/HeaderSettingsList.vue2.js +5 -0
- package/dist/components/List/components/ListCardFieldNested.vue.d.ts +2 -1
- package/dist/components/List/components/ListCardFieldNested.vue.d.ts.map +1 -1
- package/dist/components/List/components/ListCardFieldNested.vue.js +7 -4
- package/dist/components/List/components/ListFilterGlobalItem.vue.js +1 -1
- package/dist/components/List/components/ListFilterSelect.vue.d.ts.map +1 -1
- package/dist/components/List/components/ListFilterSelect.vue.js +0 -1
- package/dist/components/List/use/useListConfig.d.ts +1 -0
- package/dist/components/List/use/useListConfig.d.ts.map +1 -1
- package/dist/components/List/use/useListConfig.js +5 -2
- 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/Nav/WNavItem.vue.d.ts +3 -16
- package/dist/components/Nav/WNavItem.vue.d.ts.map +1 -1
- package/dist/components/Nav/WNavItemExpand.vue.d.ts +142 -14
- package/dist/components/Nav/WNavItemExpand.vue.d.ts.map +1 -1
- package/dist/components/Nav/types.d.ts +25 -0
- package/dist/components/Select/components/SelectAsyncList.vue.d.ts.map +1 -1
- package/dist/components/Select/components/SelectAsyncList.vue.js +3 -6
- package/dist/components/Select/types.d.ts +4 -3
- package/dist/components/Select/types.d.ts.map +1 -1
- package/dist/components/Tabs/WTabs.vue.d.ts.map +1 -1
- package/dist/components/Tabs/components/TabItem.vue.d.ts.map +1 -1
- package/dist/components/Tooltip/components/TooltipContainer.vue.d.ts.map +1 -1
- package/dist/imports/componentsPlugin.d.ts +2 -1
- package/dist/imports/componentsPlugin.d.ts.map +1 -1
- package/dist/main.js +1 -0
- package/dist/types/vue-router.d.ts +6 -0
- package/dist/utils/utils.js +1 -1
- package/eslint/configs/configImports.js +44 -3
- package/eslint/configs/configTypescript.js +1 -0
- package/package.json +10 -7
- package/dist/components/List/components/HeaderSettingsItem.vue.d.ts +0 -32
- package/dist/components/List/components/HeaderSettingsItem.vue.d.ts.map +0 -1
- package/dist/components/List/components/HeaderSettingsItem.vue.js +0 -69
- package/dist/components/List/components/HeaderSettingsItem.vue2.js +0 -5
@@ -15,7 +15,7 @@ import _sfc_main$9 from './components/HeaderFieldNested.vue.js';
|
|
15
15
|
import _sfc_main$7 from './components/HeaderSettings.vue.js';
|
16
16
|
import _sfc_main$6 from './components/HeaderSort.vue.js';
|
17
17
|
import _sfc_main$3 from './components/ListCardFieldNested.vue.js';
|
18
|
-
import { filterFields, useListConfig
|
18
|
+
import { filterFields, useListConfig } from './use/useListConfig.js';
|
19
19
|
|
20
20
|
const _hoisted_1 = {
|
21
21
|
key: 1,
|
@@ -83,7 +83,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
83
83
|
updateMode
|
84
84
|
} = useListConfig(toRef(props, "configKey"), fieldsVisible, toRef(props, "defaultConfigMap"), toRef(props, "defaultMode"), props.noHeaderSettings);
|
85
85
|
const fieldsFiltered = computed(() => {
|
86
|
-
return filterFields(fieldsVisible.value, (field) => fieldConfigMap.value[field.label]?.visible)
|
86
|
+
return filterFields(fieldsVisible.value, (field) => fieldConfigMap.value[field.label]?.visible);
|
87
87
|
});
|
88
88
|
const allowSelect = computed(() => props.bulk !== void 0);
|
89
89
|
const allowOpen = computed(() => props.expansion !== void 0);
|
@@ -245,7 +245,10 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
245
245
|
"onUpdate:header": updateHeaderHeight
|
246
246
|
}, {
|
247
247
|
default: withCtx(() => [
|
248
|
-
createVNode(_sfc_main$9, {
|
248
|
+
createVNode(_sfc_main$9, {
|
249
|
+
fields: fieldsFiltered.value,
|
250
|
+
"field-config-map": unref(fieldConfigMap)
|
251
|
+
}, {
|
249
252
|
default: withCtx(({ field, nested }) => [
|
250
253
|
createVNode(_sfc_main$a, {
|
251
254
|
title: typeof field.meta.title === "string" ? field.meta.title : field.meta.title(_ctx.queryParams),
|
@@ -262,7 +265,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
262
265
|
}, null, 8, ["title", "field", "class", "ordering", "disabled", "allow-resize", "item-class", "width-style", "onUpdate:width", "onSave:width"])
|
263
266
|
]),
|
264
267
|
_: 1
|
265
|
-
}, 8, ["fields"])
|
268
|
+
}, 8, ["fields", "field-config-map"])
|
266
269
|
]),
|
267
270
|
_: 2
|
268
271
|
}, 1032, ["allow-select", "tooltip-text", "hide-more", "count", "selection", "onUpdate:header"])) : createCommentVNode("", true)
|
@@ -298,6 +301,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
298
301
|
default: withCtx(({ validate }) => [
|
299
302
|
createVNode(_sfc_main$3, {
|
300
303
|
fields: fieldsFiltered.value,
|
304
|
+
"field-config-map": unref(fieldConfigMap),
|
301
305
|
item,
|
302
306
|
skeleton,
|
303
307
|
card: unref(isGrid),
|
@@ -325,7 +329,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
325
329
|
}, null, 40, ["item", "readonly", "skeleton", "card", "class", "style", "onUpdate:item", "onDelete:item", "onValidate"]))
|
326
330
|
]),
|
327
331
|
_: 2
|
328
|
-
}, 1032, ["fields", "item", "skeleton", "card", "readonly"])
|
332
|
+
}, 1032, ["fields", "field-config-map", "item", "skeleton", "card", "readonly"])
|
329
333
|
]),
|
330
334
|
_: 2
|
331
335
|
}, [
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListCard.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListCard.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListCard.vue"],"names":[],"mappings":"AAsMA;AAgRA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAgB5C,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,MAAM,EAAE,OAAO,GAAG,SAAS,CAAA;IAC3B,QAAQ,EAAE,OAAO,GAAG,SAAS,CAAA;IAC7B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;IACpC,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,WAAW,EAAE,OAAO,GAAG,SAAS,CAAA;IAChC,QAAQ,EAAE,MAAM,GAAG,SAAS,CAAA;IAC5B,IAAI,EAAE,OAAO,CAAA;IACb,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,GAAG,SAAS,CAAA;IAC/B,SAAS,EAAE,OAAO,GAAG,SAAS,CAAA;IAC9B,QAAQ,EAAE,OAAO,CAAA;IAEjB,QAAQ,EAAE,OAAO,CAAA;IACjB,WAAW,EAAE,OAAO,CAAA;IACpB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAC;AAwCF,iBAAS,cAAc;WA0YT,OAAO,IAA6B;;;;;;YAjBpB,GAAG;sBACN,GAAG;sBACH,GAAG;2BACE,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wCAhGV,GAAG,8CAA8C,GAAG,yBAC3D,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;;;EAkH1D;AA2BD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;oCA/II,GAAG,8CAA8C,GAAG,yBAC3D,GAAG,6DAAmC,GAAG;;;;;;;;;;;;;;;;OAsJzD,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
@@ -46,7 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
46
|
isOpen.value = !isOpen.value;
|
47
47
|
};
|
48
48
|
const validate = (...args) => formRef.value?.validate(...args);
|
49
|
-
const isActionShown = computed(() => !props.skeleton && (props.allowOpen || props.to !== void 0 || props.allowSelectHover || props.hasAction));
|
49
|
+
const isActionShown = computed(() => !props.skeleton && (props.allowOpen || props.to !== void 0 || props.allowSelectHover || props.hasAction || props.selected));
|
50
50
|
const toggleMenu = (event) => {
|
51
51
|
if (props.disabled || props.disableMore || !containerRef.value || !moreRef.value || event.ctrlKey) return;
|
52
52
|
const containerRect = containerRef.value.getBoundingClientRect();
|
@@ -139,7 +139,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
139
139
|
renderSlot(_ctx.$slots, "default", normalizeProps(guardReactiveProps({ toggle, isOpen: isOpen.value, validate }))),
|
140
140
|
isActionShown.value ? (openBlock(), createBlock(_sfc_main$3, mergeProps(
|
141
141
|
{ key: 1 },
|
142
|
-
_ctx.allowSelectHover ? { tag: "button", card: _ctx.card, onClick: () => _ctx.$emit("toggle:selected") } : _ctx.hasAction ? { tag: "button", card: _ctx.card, class: "z-[-1]", onClick: () => _ctx.$emit("click:action") } : _ctx.to ? { tag: markRaw(unref(RouterLink)), card: _ctx.card, class: "z-[-1]", props: { to: _ctx.to } } : { tag: "button", card: _ctx.card, class: "z-[-1]", onClick: toggle },
|
142
|
+
_ctx.allowSelectHover ? { tag: "button", card: _ctx.card, onClick: () => _ctx.$emit("toggle:selected") } : _ctx.hasAction ? { tag: "button", card: _ctx.card, class: "z-[-1]", onClick: () => _ctx.$emit("click:action") } : _ctx.to ? { tag: markRaw(unref(RouterLink)), card: _ctx.card, class: "z-[-1]", props: { to: _ctx.to } } : _ctx.allowOpen ? { tag: "button", card: _ctx.card, class: "z-[-1]", onClick: toggle } : { tag: "div", card: _ctx.card, class: "z-[-1]" },
|
143
143
|
{
|
144
144
|
class: {
|
145
145
|
"before:text-primary dark:before:text-primary-dark": _ctx.allowSelectHover || _ctx.selected || unref(moreRef)?.isOpen,
|
@@ -2,9 +2,10 @@ import { StyleValue } from 'vue';
|
|
2
2
|
import { OrderItem } from '../../utils/order';
|
3
3
|
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<{
|
4
4
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
5
|
+
readonly "onSave:width"?: (() => any) | undefined;
|
5
6
|
readonly "onUpdate:width"?: ((value: number) => any) | undefined;
|
6
7
|
readonly "onUpdate:ordering"?: ((value: OrderItem<Field>[]) => any) | undefined;
|
7
|
-
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:width" | "onUpdate:ordering"> & {
|
8
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onSave:width" | "onUpdate:width" | "onUpdate:ordering"> & {
|
8
9
|
title?: string;
|
9
10
|
field: Field;
|
10
11
|
ordering: OrderItem<Field>[];
|
@@ -20,6 +21,7 @@ declare const _default: <Field>(__VLS_props: NonNullable<Awaited<typeof __VLS_se
|
|
20
21
|
};
|
21
22
|
emit: {
|
22
23
|
(e: "update:width", value: number): void;
|
24
|
+
(e: "save:width"): void;
|
23
25
|
(e: "update:ordering", value: OrderItem<Field>[]): void;
|
24
26
|
};
|
25
27
|
}>) => import('vue').VNode & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WListHeaderItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListHeaderItem.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WListHeaderItem.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WListHeaderItem.vue"],"names":[],"mappings":"AAyDA;AAiHA,OAAO,EAAC,KAAK,UAAU,EAA2C,MAAM,KAAK,CAAA;AAI7E,OAAO,EAAQ,KAAK,SAAS,EAAC,MAAM,eAAe,CAAA;yBAIlC,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;WAqNO,mBAAmB,CAAC;;;;;gBAnNlB,MAAM;eACP,KAAK;kBACF,SAAS,CAAC,KAAK,CAAC,EAAE;mBACjB,OAAO;sBACJ,OAAO;oBACT,MAAM;oBACN,UAAU,GAAG,SAAS;mBA6M0D,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;yBAlCmB,GAAG;;;YAxK3B,cAAc,SAAS,MAAM,GAAG,IAAI;YACpC,YAAY,GAAG,IAAI;YACnB,iBAAiB,SAAS,SAAS,CAAC,KAAK,CAAC,EAAE,GAAG,IAAI;;EA4MrD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAhOzE,wBAgO4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -19,7 +19,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
19
|
itemClass: {},
|
20
20
|
widthStyle: { type: [Boolean, null, String, Object, Array] }
|
21
21
|
},
|
22
|
-
emits: ["update:width", "update:ordering"],
|
22
|
+
emits: ["update:width", "save:width", "update:ordering"],
|
23
23
|
setup(__props, { emit: __emit }) {
|
24
24
|
const props = __props;
|
25
25
|
const emit = __emit;
|
@@ -48,7 +48,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
48
48
|
return openBlock(), createBlock(resolveDynamicComponent(_ctx.allowResize ? _sfc_main$1 : "div"), mergeProps({ ref: "container" }, _ctx.allowResize ? { hasStyles: _ctx.widthStyle !== void 0 } : void 0, {
|
49
49
|
class: "text-description shrink-0 select-none overflow-hidden pr-6",
|
50
50
|
style: _ctx.widthStyle ?? widthStyleInner.value,
|
51
|
-
"onUpdate:width": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:width", $event))
|
51
|
+
"onUpdate:width": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:width", $event)),
|
52
|
+
"onSave:width": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("save:width"))
|
52
53
|
}), {
|
53
54
|
default: withCtx(() => [
|
54
55
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.disabled ? "div" : "button"), {
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { FieldComponent, ListField, ListFieldExport, ListFields } from '../types';
|
1
|
+
import { FieldComponent, FieldConfig, ListField, ListFieldExport, ListFields } from '../types';
|
2
2
|
declare const _default: <Data, 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
3
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
|
4
4
|
fields: ListFields<Data, QueryParams>;
|
5
|
+
fieldConfigMap: Record<string, FieldConfig>;
|
5
6
|
} & Partial<{}>> & import('vue').PublicProps;
|
6
7
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
7
8
|
attrs: any;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HeaderFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderFieldNested.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"HeaderFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderFieldNested.vue"],"names":[],"mappings":"AA6CA;AAsEA,OAAO,KAAK,EAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAC,MAAM,UAAU,CAAA;yBAKhF,IAAI,EAAE,WAAW,EACjC,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;WA8GO,mBAAmB,CAAC;gBA5GlB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;wBACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;mBA2GiD,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;iBAxGA,CAAC,KAAK,EAAE;YACf,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAA;YAC1E,MAAM,EAAE,OAAO,CAAA;YACf,KAAK,EAAE,MAAM,CAAA;YACb,MAAM,EAAE,MAAM,CAAA;YACd,KAAK,EAAE,OAAO,CAAA;YACd,IAAI,EAAE,OAAO,CAAA;SACd,KAAK,IAAI;;iBAPD,CAAC,KAAK,EAAE;YACf,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAA;YAC1E,MAAM,EAAE,OAAO,CAAA;YACf,KAAK,EAAE,MAAM,CAAA;YACb,MAAM,EAAE,MAAM,CAAA;YACd,KAAK,EAAE,OAAO,CAAA;YACd,IAAI,EAAE,OAAO,CAAA;SACd,KAAK,IAAI;;UAmGL,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAzHzE,wBAyH4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,16 +1,17 @@
|
|
1
1
|
import { defineComponent, resolveComponent, createElementBlock, openBlock, Fragment, renderList, unref, renderSlot, createBlock, withCtx } from 'vue';
|
2
2
|
import { isField } from '../models/utils.js';
|
3
|
-
import { getFirstFieldLabel } from '../use/useListConfig.js';
|
3
|
+
import { sortFields, getFirstFieldLabel } from '../use/useListConfig.js';
|
4
4
|
|
5
5
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
6
6
|
__name: "HeaderFieldNested",
|
7
7
|
props: {
|
8
|
-
fields: {}
|
8
|
+
fields: {},
|
9
|
+
fieldConfigMap: {}
|
9
10
|
},
|
10
11
|
setup(__props) {
|
11
12
|
return (_ctx, _cache) => {
|
12
13
|
const _component_HeaderFieldNested = resolveComponent("HeaderFieldNested", true);
|
13
|
-
return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fields, (field, index) => {
|
14
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(unref(sortFields)(_ctx.fields, _ctx.fieldConfigMap), (field, index) => {
|
14
15
|
return openBlock(), createElementBlock(Fragment, {
|
15
16
|
key: unref(getFirstFieldLabel)(field)
|
16
17
|
}, [
|
@@ -24,7 +25,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
24
25
|
last: index === _ctx.fields.length - 1
|
25
26
|
}) : (openBlock(), createBlock(_component_HeaderFieldNested, {
|
26
27
|
key: 1,
|
27
|
-
fields: field.meta.fields
|
28
|
+
fields: field.meta.fields,
|
29
|
+
"field-config-map": _ctx.fieldConfigMap
|
28
30
|
}, {
|
29
31
|
default: withCtx((defaultScope) => [
|
30
32
|
defaultScope.length !== 1 ? renderSlot(_ctx.$slots, "default", {
|
@@ -46,7 +48,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
46
48
|
})
|
47
49
|
]),
|
48
50
|
_: 2
|
49
|
-
}, 1032, ["fields"]))
|
51
|
+
}, 1032, ["fields", "field-config-map"]))
|
50
52
|
], 64);
|
51
53
|
}), 128);
|
52
54
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"HeaderSettings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSettings.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"HeaderSettings.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSettings.vue"],"names":[],"mappings":"AAuEA;AAoJA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,UAAU,CAAA;AAWrD,OAAO,EAAC,KAAK,QAAQ,EAAC,MAAM,eAAe,CAAA;yBAQ1B,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;WA6QO,mBAAmB,CAAC;;;;;gBA3QlB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;wBACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;cACrC,QAAQ;qBACD,WAAW;kBACd,OAAO;gBACT,OAAO;mBACJ,OAAO;mBAqQ0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;YAlQL,yBAAyB,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI;YACpE,aAAa,SAAS,QAAQ,GAAG,IAAI;YACrC,aAAa,GAAG,IAAI;;EAoQtB,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAxRzE,wBAwR4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,13 +1,13 @@
|
|
1
1
|
import { defineComponent, ref, createBlock, openBlock, unref, withCtx, createVNode, createElementVNode, createElementBlock, createCommentVNode, Fragment, renderList, normalizeClass, markRaw } from 'vue';
|
2
|
-
import _sfc_main$
|
2
|
+
import _sfc_main$5 from '../../Button/WButtonSelectionAction.vue.js';
|
3
3
|
import _sfc_main$2 from '../../ClickOutside/WClickOutside.vue.js';
|
4
4
|
import _sfc_main$1 from '../../DropdownMenu/WDropdownMenu.vue.js';
|
5
5
|
import IconTableSettings from '../../../assets/icons/sax/IconTableSettings.svg.js';
|
6
6
|
import { HorizontalAlign } from '../../../utils/HorizontalAlign.js';
|
7
|
-
import
|
8
|
-
import _sfc_main$
|
7
|
+
import { isField } from '../models/utils.js';
|
8
|
+
import _sfc_main$4 from './HeaderSettingsList.vue.js';
|
9
9
|
import _sfc_main$3 from './HeaderSettingsModeButton.vue.js';
|
10
|
-
import { listModeList, listModeIconMap } from '../use/useListConfig.js';
|
10
|
+
import { listModeList, listModeIconMap, sortFields } from '../use/useListConfig.js';
|
11
11
|
|
12
12
|
const _hoisted_1 = { class: "p-4" };
|
13
13
|
const _hoisted_2 = { class: "grid grid-cols-[auto,auto,auto] items-start" };
|
@@ -19,9 +19,8 @@ const _hoisted_4 = {
|
|
19
19
|
key: 1,
|
20
20
|
class: "mx-4 h-full border-r border-solid border-gray-200 dark:border-gray-700"
|
21
21
|
};
|
22
|
-
const _hoisted_5 = { class: "
|
23
|
-
const _hoisted_6 =
|
24
|
-
const _hoisted_7 = ["disabled"];
|
22
|
+
const _hoisted_5 = { class: "flex justify-end" };
|
23
|
+
const _hoisted_6 = ["disabled"];
|
25
24
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
26
25
|
__name: "HeaderSettings",
|
27
26
|
props: {
|
@@ -38,48 +37,31 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
38
37
|
const props = __props;
|
39
38
|
const emit = __emit;
|
40
39
|
const isOpen = ref(false);
|
41
|
-
const
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
dragItem.value = label;
|
51
|
-
dragItemNewOrder.value = order;
|
52
|
-
};
|
53
|
-
const dragEnter = (order, nested, first, last) => {
|
54
|
-
if (nested) {
|
55
|
-
if (dragItemNewOrder.value === null) return;
|
56
|
-
if (first) {
|
57
|
-
if (order < dragItemNewOrder.value) dragItemNewOrder.value = order;
|
58
|
-
} else if (last) {
|
59
|
-
if (order > dragItemNewOrder.value) dragItemNewOrder.value = order;
|
40
|
+
const updateOrder = (list) => {
|
41
|
+
let currentIndex = 0;
|
42
|
+
const newConfigMap = {};
|
43
|
+
const processFields = (fields) => {
|
44
|
+
let currentFields;
|
45
|
+
if (list.some((field) => fields.includes(field))) {
|
46
|
+
currentFields = list;
|
47
|
+
} else {
|
48
|
+
currentFields = sortFields(fields, props.fieldConfigMap);
|
60
49
|
}
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
const newConfig = {};
|
71
|
-
const processConfig = (fields) => {
|
72
|
-
fields.forEach((field) => {
|
73
|
-
if ("label" in field.meta) newConfig[field.meta.label] = { ...props.fieldConfigMap[field.meta.label], order: getOrder(field.meta) };
|
74
|
-
if ("fields" in field.meta) processConfig(field.meta.fields);
|
75
|
-
}, {});
|
50
|
+
currentFields.forEach((field) => {
|
51
|
+
currentIndex++;
|
52
|
+
if (isField(field)) {
|
53
|
+
newConfigMap[field.meta.label] = {
|
54
|
+
...props.fieldConfigMap[field.meta.label],
|
55
|
+
order: currentIndex
|
56
|
+
};
|
57
|
+
} else processFields(field.meta.fields);
|
58
|
+
});
|
76
59
|
};
|
77
|
-
|
78
|
-
Object.values(
|
79
|
-
item.order = index;
|
60
|
+
processFields(props.fields);
|
61
|
+
Object.values(newConfigMap).sort((a, b) => a.order - b.order).forEach((item, index) => {
|
62
|
+
item.order = index + 1;
|
80
63
|
});
|
81
|
-
if (Object.keys(
|
82
|
-
dragEnd();
|
64
|
+
if (Object.keys(newConfigMap).some((key) => props.fieldConfigMap[key].order !== newConfigMap[key].order)) emit("update:field-config-map", newConfigMap);
|
83
65
|
};
|
84
66
|
return (_ctx, _cache) => {
|
85
67
|
return openBlock(), createBlock(_sfc_main$1, {
|
@@ -89,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
89
71
|
"horizontal-align": unref(HorizontalAlign).RIGHT_INNER
|
90
72
|
}, {
|
91
73
|
toggle: withCtx(() => [
|
92
|
-
createVNode(_sfc_main$
|
74
|
+
createVNode(_sfc_main$5, {
|
93
75
|
icon: markRaw(unref(IconTableSettings)),
|
94
76
|
disabled: _ctx.disabled,
|
95
77
|
active: isOpen.value,
|
@@ -115,28 +97,17 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
115
97
|
}), 128))
|
116
98
|
])) : createCommentVNode("", true),
|
117
99
|
!_ctx.mobile ? (openBlock(), createElementBlock("div", _hoisted_4)) : createCommentVNode("", true),
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
"disabled-drag": nested,
|
127
|
-
order: getOrder(field.meta),
|
128
|
-
"onDrag:start": ($event) => dragStart(field.meta.label, $event),
|
129
|
-
"onDrag:enter": ($event) => dragEnter($event, nested, first, last),
|
130
|
-
"onDrag:end": drop,
|
131
|
-
"onUpdate:fieldsConfigMap": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:field-config-map", { ..._ctx.fieldConfigMap, ...$event }))
|
132
|
-
}, null, 8, ["field", "field-config", "query-params", "disabled", "disabled-drag", "order", "onDrag:start", "onDrag:enter"])
|
133
|
-
]),
|
134
|
-
_: 1
|
135
|
-
}, 8, ["fields"])
|
136
|
-
])
|
100
|
+
createVNode(_sfc_main$4, {
|
101
|
+
fields: _ctx.fields,
|
102
|
+
"field-config-map": _ctx.fieldConfigMap,
|
103
|
+
"query-params": _ctx.queryParams,
|
104
|
+
class: "text-description",
|
105
|
+
"onUpdate:fieldConfigMap": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:field-config-map", { ..._ctx.fieldConfigMap, ...$event })),
|
106
|
+
"onUpdate:list": updateOrder
|
107
|
+
}, null, 8, ["fields", "field-config-map", "query-params"])
|
137
108
|
]),
|
138
109
|
_cache[4] || (_cache[4] = createElementVNode("div", { class: "my-4 border-b border-solid border-gray-200 dark:border-gray-700" }, null, -1)),
|
139
|
-
createElementVNode("div",
|
110
|
+
createElementVNode("div", _hoisted_5, [
|
140
111
|
createElementVNode("button", {
|
141
112
|
class: normalizeClass(["relative rounded-lg bg-gray-100 px-2 py-1 dark:bg-gray-800", {
|
142
113
|
"w-ripple w-ripple-hover": _ctx.hasSaved,
|
@@ -144,7 +115,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
144
115
|
}]),
|
145
116
|
disabled: !_ctx.hasSaved,
|
146
117
|
onClick: _cache[2] || (_cache[2] = ($event) => _ctx.hasSaved && _ctx.$emit("click:reset"))
|
147
|
-
}, " Reset ", 10,
|
118
|
+
}, " Reset ", 10, _hoisted_6)
|
148
119
|
])
|
149
120
|
])
|
150
121
|
]),
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import { FieldConfig, ListFields } from '../types';
|
2
|
+
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<{
|
3
|
+
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{
|
4
|
+
readonly "onUpdate:list"?: ((value: ListFields<Data, QueryParams>) => any) | undefined;
|
5
|
+
readonly "onUpdate:field-config-map"?: ((value: Record<string, FieldConfig>) => any) | undefined;
|
6
|
+
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:list" | "onUpdate:field-config-map"> & {
|
7
|
+
fields: ListFields<Data, QueryParams>;
|
8
|
+
fieldConfigMap: Record<string, FieldConfig>;
|
9
|
+
queryParams: QueryParams;
|
10
|
+
disabled?: boolean;
|
11
|
+
} & Partial<{}>> & import('vue').PublicProps;
|
12
|
+
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
13
|
+
attrs: any;
|
14
|
+
slots: {};
|
15
|
+
emit: {
|
16
|
+
(e: "update:list", value: ListFields<Data, QueryParams>): void;
|
17
|
+
(e: "update:field-config-map", value: Record<string, FieldConfig>): void;
|
18
|
+
};
|
19
|
+
}>) => import('vue').VNode & {
|
20
|
+
__ctx?: Awaited<typeof __VLS_setup>;
|
21
|
+
};
|
22
|
+
export default _default;
|
23
|
+
type __VLS_PrettifyLocal<T> = {
|
24
|
+
[K in keyof T]: T[K];
|
25
|
+
} & {};
|
26
|
+
//# sourceMappingURL=HeaderSettingsList.vue.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"HeaderSettingsList.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/HeaderSettingsList.vue"],"names":[],"mappings":"AA4DA;AAqFA,OAAO,KAAK,EAAC,WAAW,EAAE,UAAU,EAAC,MAAM,UAAU,CAAA;yBAUpC,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;WAmLO,mBAAmB,CAAC;;;;gBAjLlB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;wBACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;qBAC9B,WAAW;mBACb,OAAO;mBA8K0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;YA3KL,aAAa,SAAS,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,GAAG,IAAI;YAC1D,yBAAyB,SAAS,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI;;EA8KtE,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA9LzE,wBA8L4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import { defineComponent, resolveComponent, createBlock, openBlock, unref, withCtx, createElementBlock, createCommentVNode, normalizeStyle, createVNode, mergeProps, createElementVNode, toDisplayString, resolveDynamicComponent } from 'vue';
|
2
|
+
import _sfc_main$1 from '../../DragContainer/WDragContainer.vue.js';
|
3
|
+
import IconDrag from '../../../assets/icons/sax/IconDrag.svg.js';
|
4
|
+
import IconEye from '../../../assets/icons/sax/IconEye.svg.js';
|
5
|
+
import IconEyeSlash from '../../../assets/icons/sax/IconEyeSlash.svg.js';
|
6
|
+
import { sortFields } from '../use/useListConfig.js';
|
7
|
+
|
8
|
+
const _hoisted_1 = ["onMousedown"];
|
9
|
+
const _hoisted_2 = { class: "col-start-2 self-center truncate px-2 py-1 font-semibold" };
|
10
|
+
const _hoisted_3 = ["onClick"];
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
12
|
+
__name: "HeaderSettingsList",
|
13
|
+
props: {
|
14
|
+
fields: {},
|
15
|
+
fieldConfigMap: {},
|
16
|
+
queryParams: {},
|
17
|
+
disabled: { type: Boolean }
|
18
|
+
},
|
19
|
+
emits: ["update:list", "update:field-config-map"],
|
20
|
+
setup(__props) {
|
21
|
+
return (_ctx, _cache) => {
|
22
|
+
const _component_HeaderSettingsList = resolveComponent("HeaderSettingsList", true);
|
23
|
+
return openBlock(), createBlock(_sfc_main$1, {
|
24
|
+
list: unref(sortFields)(_ctx.fields, _ctx.fieldConfigMap),
|
25
|
+
disabled: _ctx.disabled,
|
26
|
+
class: "grid grid-cols-1",
|
27
|
+
"onUpdate:list": _cache[2] || (_cache[2] = ($event) => _ctx.$emit("update:list", $event))
|
28
|
+
}, {
|
29
|
+
default: withCtx(({ item, container, dragging, initDrag }) => [
|
30
|
+
"fields" in item.meta ? (openBlock(), createElementBlock("div", {
|
31
|
+
key: 0,
|
32
|
+
style: normalizeStyle(container.style),
|
33
|
+
class: "relative isolate"
|
34
|
+
}, [
|
35
|
+
dragging ? (openBlock(), createElementBlock("div", mergeProps({ key: 0 }, container, { class: "absolute inset-x-0 top-0 z-10 h-7" }), null, 16)) : createCommentVNode("", true),
|
36
|
+
createVNode(_component_HeaderSettingsList, {
|
37
|
+
fields: item.meta.fields,
|
38
|
+
"field-config-map": _ctx.fieldConfigMap,
|
39
|
+
"query-params": _ctx.queryParams,
|
40
|
+
disabled: _ctx.disabled,
|
41
|
+
style: normalizeStyle(container.style),
|
42
|
+
"onUpdate:list": _cache[0] || (_cache[0] = ($event) => _ctx.$emit("update:list", $event)),
|
43
|
+
"onUpdate:fieldConfigMap": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:field-config-map", $event))
|
44
|
+
}, null, 8, ["fields", "field-config-map", "query-params", "disabled", "style"])
|
45
|
+
], 4)) : "label" in item.meta ? (openBlock(), createElementBlock("div", mergeProps({
|
46
|
+
key: 1,
|
47
|
+
class: "bg-default dark:bg-default-dark grid select-none grid-cols-[1.75rem,1fr,auto]"
|
48
|
+
}, container), [
|
49
|
+
!_ctx.disabled ? (openBlock(), createElementBlock("button", {
|
50
|
+
key: 0,
|
51
|
+
class: "w-ripple w-ripple-hover relative flex cursor-grab items-center justify-center active:cursor-grabbing",
|
52
|
+
onMousedown: initDrag
|
53
|
+
}, [
|
54
|
+
createVNode(unref(IconDrag), { class: "rotate-90" })
|
55
|
+
], 40, _hoisted_1)) : createCommentVNode("", true),
|
56
|
+
createElementVNode("div", _hoisted_2, toDisplayString(typeof item.meta.title === "string" ? item.meta.title : item.meta.title(_ctx.queryParams)), 1),
|
57
|
+
createElementVNode("button", {
|
58
|
+
class: "w-ripple w-ripple-hover relative flex items-center px-2",
|
59
|
+
onClick: ($event) => _ctx.$emit("update:field-config-map", { [item.meta.label]: { ..._ctx.fieldConfigMap[item.meta.label], visible: !_ctx.fieldConfigMap[item.meta.label].visible } })
|
60
|
+
}, [
|
61
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.fieldConfigMap[item.meta.label].visible ? unref(IconEye) : unref(IconEyeSlash)), { class: "pointer-events-none" }))
|
62
|
+
], 8, _hoisted_3)
|
63
|
+
], 16)) : createCommentVNode("", true)
|
64
|
+
]),
|
65
|
+
_: 1
|
66
|
+
}, 8, ["list", "disabled"]);
|
67
|
+
};
|
68
|
+
}
|
69
|
+
});
|
70
|
+
|
71
|
+
export { _sfc_main as default };
|
@@ -1,7 +1,8 @@
|
|
1
|
-
import { FieldComponent, ListField, ListFieldExport, ListFields } from '../types';
|
1
|
+
import { FieldComponent, FieldConfig, ListField, ListFieldExport, ListFields } from '../types';
|
2
2
|
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<{
|
3
3
|
props: __VLS_PrettifyLocal<Pick<Partial<{}> & Omit<{} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, never> & {
|
4
4
|
fields: ListFields<Data, QueryParams>;
|
5
|
+
fieldConfigMap: Record<string, FieldConfig>;
|
5
6
|
item: Data;
|
6
7
|
nested?: boolean;
|
7
8
|
skeleton: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ListCardFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListCardFieldNested.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ListCardFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListCardFieldNested.vue"],"names":[],"mappings":"AAyEA;AAoGA,OAAO,KAAK,EAAC,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,eAAe,EAAE,UAAU,EAAC,MAAM,UAAU,CAAA;yBAShF,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;WAgMO,mBAAmB,CAAC;gBA9LlB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;wBACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;cACrC,IAAI;iBACD,OAAO;kBACN,OAAO;cACX,OAAO;kBACH,OAAO;mBAwL2E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;iBArLA,CAAC,KAAK,EAAE;YAAC,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;YAAC,IAAI,EAAE,IAAI,CAAC;YAAC,MAAM,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;iBAA1H,CAAC,KAAK,EAAE;YAAC,KAAK,EAAE,eAAe,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC,CAAC;YAAC,IAAI,EAAE,IAAI,CAAC;YAAC,MAAM,EAAE,OAAO,CAAA;SAAC,KAAK,IAAI;;UAuL9H,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA3MzE,wBA2M4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -2,12 +2,13 @@ import { defineComponent, resolveComponent, createElementBlock, openBlock, Fragm
|
|
2
2
|
import _sfc_main$2 from '../../EmptyComponent/WEmptyComponent.vue.js';
|
3
3
|
import _sfc_main$1 from './ListCardFieldNestedItem.vue.js';
|
4
4
|
import { isField } from '../models/utils.js';
|
5
|
-
import { getFirstFieldLabel } from '../use/useListConfig.js';
|
5
|
+
import { sortFields, getFirstFieldLabel } from '../use/useListConfig.js';
|
6
6
|
|
7
7
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
8
8
|
__name: "ListCardFieldNested",
|
9
9
|
props: {
|
10
10
|
fields: {},
|
11
|
+
fieldConfigMap: {},
|
11
12
|
item: {},
|
12
13
|
nested: { type: Boolean },
|
13
14
|
skeleton: { type: Boolean },
|
@@ -17,7 +18,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
17
18
|
setup(__props) {
|
18
19
|
return (_ctx, _cache) => {
|
19
20
|
const _component_ListCardFieldNested = resolveComponent("ListCardFieldNested", true);
|
20
|
-
return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.fields, (field) => {
|
21
|
+
return openBlock(true), createElementBlock(Fragment, null, renderList(unref(sortFields)(_ctx.fields, _ctx.fieldConfigMap), (field) => {
|
21
22
|
return openBlock(), createElementBlock(Fragment, {
|
22
23
|
key: unref(getFirstFieldLabel)(field)
|
23
24
|
}, [
|
@@ -45,6 +46,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
45
46
|
}, [
|
46
47
|
createVNode(_component_ListCardFieldNested, {
|
47
48
|
fields: field.meta.fields,
|
49
|
+
"field-config-map": _ctx.fieldConfigMap,
|
48
50
|
item: inner,
|
49
51
|
skeleton: _ctx.skeleton,
|
50
52
|
card: _ctx.card,
|
@@ -55,7 +57,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
55
57
|
renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, defaultScope))
|
56
58
|
]),
|
57
59
|
_: 2
|
58
|
-
}, 1032, ["fields", "item", "skeleton", "card", "readonly"])
|
60
|
+
}, 1032, ["fields", "field-config-map", "item", "skeleton", "card", "readonly"])
|
59
61
|
], 2)
|
60
62
|
]),
|
61
63
|
_: 2
|
@@ -74,6 +76,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
74
76
|
default: withCtx(() => [
|
75
77
|
createVNode(_component_ListCardFieldNested, {
|
76
78
|
fields: field.meta.fields,
|
79
|
+
"field-config-map": _ctx.fieldConfigMap,
|
77
80
|
item: "keyEntity" in field.meta ? _ctx.item[field.meta.keyEntity] : "getterEntity" in field.meta ? field.meta.getterEntity(_ctx.item) : _ctx.item,
|
78
81
|
skeleton: _ctx.skeleton,
|
79
82
|
card: _ctx.card,
|
@@ -84,7 +87,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
84
87
|
renderSlot(_ctx.$slots, "default", mergeProps({ ref_for: true }, defaultScope))
|
85
88
|
]),
|
86
89
|
_: 2
|
87
|
-
}, 1032, ["fields", "item", "skeleton", "card", "readonly"])
|
90
|
+
}, 1032, ["fields", "field-config-map", "item", "skeleton", "card", "readonly"])
|
88
91
|
]),
|
89
92
|
_: 2
|
90
93
|
}, 1040, ["class"]))
|
@@ -51,7 +51,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
51
51
|
global: "",
|
52
52
|
"onUpdate:queryParams": _cache[1] || (_cache[1] = ($event) => _ctx.$emit("update:query-params", $event))
|
53
53
|
}, null, 40, ["query-params", "readonly"])),
|
54
|
-
!_ctx.readonly ? (openBlock(), createBlock(_sfc_main$2, {
|
54
|
+
!_ctx.readonly && hasChanges.value ? (openBlock(), createBlock(_sfc_main$2, {
|
55
55
|
key: 2,
|
56
56
|
"semantic-type": unref(SemanticType).SECONDARY,
|
57
57
|
disabled: !hasChanges.value,
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ListFilterSelect.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListFilterSelect.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"ListFilterSelect.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListFilterSelect.vue"],"names":[],"mappings":"AA6CA;AA2EA,OAAO,KAAK,EAAC,eAAe,EAAC,MAAM,UAAU,CAAA;yBAe5B,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;WA4KO,mBAAmB,CAAC;;;gBA1KlB,eAAe,CAAC,WAAW,CAAC,EAAE;iBAC7B,MAAM,EAAE;qBACJ,WAAW;mBAwKoE,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;cArKL,QAAQ,SAAS,MAAM,KAAG,IAAI;EAyKhC,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAvLzE,wBAuL4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -14,4 +14,5 @@ export declare const useListConfig: <Fields extends ListFields<any, any>>(key: M
|
|
14
14
|
save: () => void;
|
15
15
|
updateMode: (mode: ListMode) => void;
|
16
16
|
};
|
17
|
+
export declare const sortFields: <Fields extends ListFields<any, any>>(list: Fields, fieldConfigMap: Record<string, FieldConfig>) => (import('../types').ListFieldExport<import('../types').FieldComponent<any>, ListField<any, any>> | import('../types').ListFieldExport<import('../types').FieldComponent<any>, import('../types').ListFieldNested<any, any>> | import('../types').ListFieldExport<import('../types').FieldComponent<any>, import('../types').ListFieldNestedEntity<any, any, string | number>> | import('../types').ListFieldExport<import('../types').FieldComponent<any>, import('../types').ListFieldNestedEntityGetter<any, any, unknown>> | import('../types').ListFieldExport<import('../types').FieldComponent<any>, import('../types').ListFieldNestedArray<any, any, string | number>> | import('../types').ListFieldExport<import('../types').FieldComponent<any>, import('../types').ListFieldNestedArrayGetter<any, any, unknown>>)[];
|
17
18
|
//# sourceMappingURL=useListConfig.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useListConfig.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/use/useListConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAA8C,MAAM,KAAK,CAAA;AAM9E,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAC,MAAM,UAAU,CAAA;AAEhH,eAAO,MAAM,YAAY,YAGxB,CAAA;AAUD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAG1D,CAAA;AAoED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,OAAO,KAAG,CAUxH,CAAA;AAGD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,KAAG,MAErF,CAAA;AAGD,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,OAAO;;;;;;;uBAwC9L,QAAQ;CAyBnC,CAAA"}
|
1
|
+
{"version":3,"file":"useListConfig.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/use/useListConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,KAAK,QAAQ,EAA8C,MAAM,KAAK,CAAA;AAM9E,OAAO,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,KAAK,UAAU,EAAE,KAAK,SAAS,EAAE,KAAK,UAAU,EAAC,MAAM,UAAU,CAAA;AAEhH,eAAO,MAAM,YAAY,YAGxB,CAAA;AAUD,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,YAAY,CAG1D,CAAA;AAoED,eAAO,MAAM,YAAY,GAAI,CAAC,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,QAAQ,CAAC,EAAE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC,OAAO,CAAC,KAAK,OAAO,KAAG,CAUxH,CAAA;AAGD,eAAO,MAAM,kBAAkB,GAAI,CAAC,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,KAAG,MAErF,CAAA;AAGD,eAAO,MAAM,aAAa,GAAI,MAAM,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,KAAK,QAAQ,CAAC,MAAM,CAAC,EAAE,QAAQ,QAAQ,CAAC,MAAM,CAAC,EAAE,kBAAkB,QAAQ,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,OAAO;;;;;;;uBAwC9L,QAAQ;CAyBnC,CAAA;AAGD,eAAO,MAAM,UAAU,GAAI,MAAM,SAAS,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,MAAM,EAAE,gBAAgB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,qyBAExH,CAAA"}
|