eco-vue-js 0.10.79 → 0.10.80
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/Chart/WChartLine.vue.d.ts +4 -1
- package/dist/components/Chart/WChartLine.vue.d.ts.map +1 -1
- package/dist/components/Chart/WChartLine.vue.js +79 -38
- package/dist/components/List/WList.vue.d.ts +2 -2
- package/dist/components/List/WList.vue.d.ts.map +1 -1
- package/dist/components/List/WList.vue.js +2 -1
- package/dist/components/List/components/ListCardFieldNested.vue.d.ts.map +1 -1
- package/dist/components/List/components/ListCardFieldNested.vue.js +3 -2
- package/dist/components/List/types.d.ts +2 -0
- package/dist/components/List/types.d.ts.map +1 -1
- package/dist/utils/dateTime.d.ts +1 -1
- package/dist/utils/dateTime.d.ts.map +1 -1
- package/dist/utils/dateTime.js +8 -8
- package/package.json +1 -1
@@ -4,12 +4,14 @@ declare const _default: <Data extends Record<string, number>>(__VLS_props: NonNu
|
|
4
4
|
data: Data[];
|
5
5
|
xKey: keyof Data;
|
6
6
|
yKey: keyof Data;
|
7
|
+
yKeyMin?: keyof Data;
|
8
|
+
yKeyMax?: keyof Data;
|
7
9
|
strokeStyle?: "solid" | "dashed" | "dotted";
|
8
10
|
strokeWidth?: number;
|
9
11
|
hasArea?: boolean;
|
10
12
|
showPoints?: boolean;
|
11
13
|
pointRadius?: number;
|
12
|
-
|
14
|
+
emptyStub?: string;
|
13
15
|
} & ChartContext) & Partial<{}>> & import('vue').PublicProps;
|
14
16
|
expose(exposed: import('vue').ShallowUnwrapRef<{}>): void;
|
15
17
|
attrs: any;
|
@@ -26,6 +28,7 @@ declare const _default: <Data extends Record<string, number>>(__VLS_props: NonNu
|
|
26
28
|
y: number;
|
27
29
|
index: number | null;
|
28
30
|
}): any;
|
31
|
+
empty?(_: {}): any;
|
29
32
|
};
|
30
33
|
emit: {};
|
31
34
|
}>) => import('vue').VNode & {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WChartLine.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/WChartLine.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WChartLine.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/Chart/WChartLine.vue"],"names":[],"mappings":"AAiJA;AAoYA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAA;yBAMxB,IAAI,SAAS,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,EACnD,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;WAucO,mBAAmB,CAAC;cAncpB,IAAI,EAAE;cACN,MAAM,IAAI;cACV,MAAM,IAAI;kBACN,MAAM,IAAI;kBACV,MAAM,IAAI;sBACN,OAAO,GAAG,QAAQ,GAAG,QAAQ;sBAC7B,MAAM;kBACV,OAAO;qBACJ,OAAO;sBACN,MAAM;oBACR,MAAM;mCAyb0E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;;;mCAhPmB,MAAM,KAAG,MAAM;;;YAiMf,GAAG;;;;;;YACJ,GAAG;uBACL,GAAG;;UA+CvB,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAldzE,wBAkd4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { defineComponent, useId, useTemplateRef, ref, computed, watch, nextTick, onUnmounted, createElementBlock, openBlock, createElementVNode, createCommentVNode, unref, renderSlot, normalizeProps, guardReactiveProps, createVNode, withCtx, toDisplayString } from 'vue';
|
1
|
+
import { defineComponent, useId, useTemplateRef, ref, computed, watch, nextTick, onUnmounted, createElementBlock, openBlock, createElementVNode, createCommentVNode, unref, renderSlot, normalizeProps, guardReactiveProps, Fragment, createVNode, withCtx, toDisplayString } from 'vue';
|
2
2
|
import _sfc_main$1 from '../Tooltip/WTooltip.vue.js';
|
3
3
|
|
4
4
|
const _hoisted_1 = { key: 0 };
|
5
5
|
const _hoisted_2 = ["id"];
|
6
6
|
const _hoisted_3 = ["id"];
|
7
7
|
const _hoisted_4 = ["id"];
|
8
|
-
const _hoisted_5 = ["d"
|
9
|
-
const _hoisted_6 = ["d", "
|
10
|
-
const _hoisted_7 =
|
11
|
-
const _hoisted_8 =
|
12
|
-
const _hoisted_9 =
|
13
|
-
const _hoisted_10 =
|
14
|
-
const _hoisted_11 = ["
|
15
|
-
const _hoisted_12 = ["
|
16
|
-
const _hoisted_13 = ["
|
17
|
-
const _hoisted_14 =
|
8
|
+
const _hoisted_5 = ["d"];
|
9
|
+
const _hoisted_6 = ["d", "fill"];
|
10
|
+
const _hoisted_7 = ["d", "stroke-width", "stroke-dasharray"];
|
11
|
+
const _hoisted_8 = { key: 3 };
|
12
|
+
const _hoisted_9 = ["cx", "cy", "r"];
|
13
|
+
const _hoisted_10 = { key: 0 };
|
14
|
+
const _hoisted_11 = ["transform"];
|
15
|
+
const _hoisted_12 = ["x", "y1", "y2"];
|
16
|
+
const _hoisted_13 = ["y"];
|
17
|
+
const _hoisted_14 = ["fill", "mask"];
|
18
|
+
const _hoisted_15 = {
|
18
19
|
key: 1,
|
19
20
|
y: "0",
|
20
21
|
x: "0",
|
21
22
|
width: "100%",
|
22
23
|
height: "100%"
|
23
24
|
};
|
24
|
-
const
|
25
|
-
const _hoisted_16 = { class: "pl-36" };
|
25
|
+
const _hoisted_16 = { class: "text-description text-2xs flex size-full cursor-not-allowed items-center opacity-40" };
|
26
26
|
const ROUND_FACTOR = 100;
|
27
27
|
const _sfc_main = /* @__PURE__ */ defineComponent({
|
28
28
|
__name: "WChartLine",
|
@@ -30,12 +30,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
30
30
|
data: {},
|
31
31
|
xKey: {},
|
32
32
|
yKey: {},
|
33
|
+
yKeyMin: {},
|
34
|
+
yKeyMax: {},
|
33
35
|
strokeStyle: {},
|
34
36
|
strokeWidth: {},
|
35
37
|
hasArea: { type: Boolean },
|
36
38
|
showPoints: { type: Boolean },
|
37
39
|
pointRadius: {},
|
38
|
-
|
40
|
+
emptyStub: {},
|
39
41
|
scaleX: { type: Function },
|
40
42
|
scaleY: { type: Function },
|
41
43
|
svgWidth: {},
|
@@ -74,11 +76,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
74
76
|
);
|
75
77
|
const round = (value) => Math.round(value * ROUND_FACTOR) / ROUND_FACTOR;
|
76
78
|
const preparedData = computed(() => {
|
77
|
-
const result = dataFiltered.value.map((d) =>
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
79
|
+
const result = dataFiltered.value.map((d) => {
|
80
|
+
const item = {
|
81
|
+
x: round(Math.min(Math.max(props.scaleX(d[props.xKey]), props.left), props.svgWidth - props.right)),
|
82
|
+
y: round(props.scaleY(d[props.yKey])),
|
83
|
+
yMin: round(props.scaleY(d[props.yKeyMin])),
|
84
|
+
yMax: round(props.scaleY(d[props.yKeyMax])),
|
85
|
+
d
|
86
|
+
};
|
87
|
+
item.yMin = props.yKeyMin && typeof d[props.yKeyMin] === "number" ? round(props.scaleY(d[props.yKeyMin])) : item.y;
|
88
|
+
item.yMax = props.yKeyMax && typeof d[props.yKeyMax] === "number" ? round(props.scaleY(d[props.yKeyMax])) : item.y;
|
89
|
+
return item;
|
90
|
+
});
|
82
91
|
const lastIndex = result.length - 1;
|
83
92
|
if (result[lastIndex] && result[lastIndex].x !== props.left) result.push({ ...result[lastIndex], x: props.left });
|
84
93
|
if (result[0] && result[0].x !== props.right) result.unshift({ ...result[0], x: props.svgWidth - props.right });
|
@@ -128,6 +137,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
128
137
|
hoveredIndex.value = null;
|
129
138
|
}
|
130
139
|
};
|
140
|
+
const handleMouseEnter = () => {
|
141
|
+
if (!tooltipRef.value?.isOpen) hoveredIndex.value = null;
|
142
|
+
};
|
131
143
|
const closeTooltip = () => {
|
132
144
|
if (tooltipRef.value) tooltipRef.value?.close();
|
133
145
|
else hoveredIndex.value = null;
|
@@ -152,10 +164,28 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
152
164
|
path += " Z";
|
153
165
|
return path;
|
154
166
|
});
|
167
|
+
const minMaxAreaPath = computed(() => {
|
168
|
+
if (!props.yKeyMin || !props.yKeyMax || preparedData.value.length === 0) return "";
|
169
|
+
const data = preparedData.value;
|
170
|
+
let path = `M ${data[0].x} ${data[0].yMax}`;
|
171
|
+
for (let i = 1; i < data.length; i++) {
|
172
|
+
path += ` L ${data[i].x} ${data[i].yMax}`;
|
173
|
+
}
|
174
|
+
for (let i = data.length - 1; i >= 0; i--) {
|
175
|
+
path += ` L ${data[i].x} ${data[i].yMin}`;
|
176
|
+
}
|
177
|
+
path += " Z";
|
178
|
+
return path;
|
179
|
+
});
|
155
180
|
const yExtent = computed(() => {
|
156
181
|
if (props.data.length === 0) return [0, 100];
|
157
|
-
|
158
|
-
|
182
|
+
let maxValue = 0;
|
183
|
+
dataFiltered.value.forEach((item) => {
|
184
|
+
if (typeof item[props.yKey] === "number" && item[props.yKey] > maxValue) maxValue = item[props.yKey];
|
185
|
+
if (props.yKeyMin && typeof item[props.yKeyMin] === "number" && item[props.yKeyMin] > maxValue) maxValue = item[props.yKeyMin];
|
186
|
+
if (props.yKeyMax && typeof item[props.yKeyMax] === "number" && item[props.yKeyMax] > maxValue) maxValue = item[props.yKeyMax];
|
187
|
+
});
|
188
|
+
return [0, maxValue || 100];
|
159
189
|
});
|
160
190
|
const emitDomainUpdate = () => {
|
161
191
|
props.onUpdateDomain?.(lineId, yExtent.value);
|
@@ -188,7 +218,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
188
218
|
bottomPercent: 1 - _ctx.bottom / _ctx.svgHeight
|
189
219
|
})))
|
190
220
|
], 8, _hoisted_2)) : createCommentVNode("", true),
|
191
|
-
_ctx.hasArea ? (openBlock(), createElementBlock("linearGradient", {
|
221
|
+
_ctx.hasArea && !_ctx.yKeyMin && !_ctx.yKeyMax ? (openBlock(), createElementBlock("linearGradient", {
|
192
222
|
key: 1,
|
193
223
|
id: unref(gradientAreaId),
|
194
224
|
gradientTransform: "rotate(90)"
|
@@ -207,14 +237,22 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
207
237
|
}, null, -1)
|
208
238
|
]), 8, _hoisted_3)) : createCommentVNode("", true),
|
209
239
|
createElementVNode("mask", { id: unref(maskId) }, [
|
210
|
-
_ctx.
|
211
|
-
|
240
|
+
_ctx.yKeyMin && _ctx.yKeyMax ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
241
|
+
minMaxAreaPath.value ? (openBlock(), createElementBlock("path", {
|
242
|
+
key: 0,
|
243
|
+
d: minMaxAreaPath.value,
|
244
|
+
fill: "white",
|
245
|
+
"fill-opacity": "0.2",
|
246
|
+
class: "transition-[d]"
|
247
|
+
}, null, 8, _hoisted_5)) : createCommentVNode("", true)
|
248
|
+
], 64)) : _ctx.hasArea && areaPath.value ? (openBlock(), createElementBlock("path", {
|
249
|
+
key: 1,
|
212
250
|
d: areaPath.value,
|
213
251
|
fill: `url(#${unref(gradientAreaId)})`,
|
214
252
|
class: "transition-[d]"
|
215
|
-
}, null, 8,
|
253
|
+
}, null, 8, _hoisted_6)) : createCommentVNode("", true),
|
216
254
|
linePath.value ? (openBlock(), createElementBlock("path", {
|
217
|
-
key:
|
255
|
+
key: 2,
|
218
256
|
d: linePath.value,
|
219
257
|
fill: "none",
|
220
258
|
"stroke-width": _ctx.strokeWidth ?? 2,
|
@@ -223,18 +261,18 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
223
261
|
"stroke-linejoin": "round",
|
224
262
|
"stroke-linecap": "round",
|
225
263
|
class: "transition-[d]"
|
226
|
-
}, null, 8,
|
227
|
-
_ctx.$slots.tooltip && hoveredData.value && unref(tooltipRef)?.isOpen ? (openBlock(), createElementBlock("g",
|
264
|
+
}, null, 8, _hoisted_7)) : createCommentVNode("", true),
|
265
|
+
_ctx.$slots.tooltip && hoveredData.value && unref(tooltipRef)?.isOpen ? (openBlock(), createElementBlock("g", _hoisted_8, [
|
228
266
|
createElementVNode("circle", {
|
229
267
|
cx: hoveredData.value.x,
|
230
268
|
cy: hoveredData.value.y,
|
231
269
|
r: _ctx.pointRadius ?? 3,
|
232
270
|
fill: "white"
|
233
|
-
}, null, 8,
|
271
|
+
}, null, 8, _hoisted_9)
|
234
272
|
])) : createCommentVNode("", true)
|
235
273
|
], 8, _hoisted_4)
|
236
274
|
]),
|
237
|
-
_ctx.$slots.tooltip && tooltipData.value.length !== 0 ? (openBlock(), createElementBlock("g",
|
275
|
+
_ctx.$slots.tooltip && tooltipData.value.length !== 0 ? (openBlock(), createElementBlock("g", _hoisted_10, [
|
238
276
|
createElementVNode("rect", {
|
239
277
|
ref: "overlay",
|
240
278
|
width: "100%",
|
@@ -242,7 +280,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
242
280
|
fill: "transparent",
|
243
281
|
class: "cursor-crosshair",
|
244
282
|
onMousemove: handleMouseMove,
|
245
|
-
onMouseleave: closeTooltip
|
283
|
+
onMouseleave: closeTooltip,
|
284
|
+
onMouseenter: handleMouseEnter
|
246
285
|
}, null, 544),
|
247
286
|
createElementVNode("g", {
|
248
287
|
transform: `translate(${hoveredData.value?.x ?? 0} 0)`
|
@@ -255,7 +294,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
255
294
|
stroke: "currentColor",
|
256
295
|
"stroke-width": "1",
|
257
296
|
class: "text-description pointer-events-none"
|
258
|
-
}, null, 8,
|
297
|
+
}, null, 8, _hoisted_12)) : createCommentVNode("", true),
|
259
298
|
(openBlock(), createElementBlock("foreignObject", {
|
260
299
|
y: _ctx.svgHeight - _ctx.bottom
|
261
300
|
}, [
|
@@ -274,8 +313,8 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
274
313
|
]),
|
275
314
|
_: 3
|
276
315
|
}, 512)
|
277
|
-
], 8,
|
278
|
-
], 8,
|
316
|
+
], 8, _hoisted_13))
|
317
|
+
], 8, _hoisted_11)
|
279
318
|
])) : createCommentVNode("", true),
|
280
319
|
createElementVNode("rect", {
|
281
320
|
width: "100%",
|
@@ -283,10 +322,12 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
283
322
|
fill: _ctx.$slots.gradient ? `url(#${unref(gradientId)})` : "currentColor",
|
284
323
|
mask: `url(#${unref(maskId)})`,
|
285
324
|
class: "pointer-events-none transition-[color]"
|
286
|
-
}, null, 8,
|
287
|
-
])) : (openBlock(), createElementBlock("foreignObject",
|
288
|
-
createElementVNode("div",
|
289
|
-
|
325
|
+
}, null, 8, _hoisted_14)
|
326
|
+
])) : (openBlock(), createElementBlock("foreignObject", _hoisted_15, [
|
327
|
+
createElementVNode("div", _hoisted_16, [
|
328
|
+
renderSlot(_ctx.$slots, "empty", {}, () => [
|
329
|
+
createElementVNode("div", null, toDisplayString(_ctx.emptyStub ?? "No data"), 1)
|
330
|
+
])
|
290
331
|
])
|
291
332
|
]));
|
292
333
|
};
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { ActionComponent, BulkComponent, CardActionParams, CardAreas,
|
1
|
+
import { ActionComponent, BulkComponent, CardActionParams, CardAreas, ExpansionComponent, FieldConfigMap, GridCol, ListFields, MenuComponent } from './types';
|
2
2
|
import { LinkProps } from '../../types/types';
|
3
3
|
import { ApiError } from '../../utils/api';
|
4
4
|
import { ListMode } from '../../utils/utils';
|
@@ -14,7 +14,7 @@ declare const _default: <Data extends DefaultData, QueryParams, Fields extends L
|
|
14
14
|
} & import('vue').VNodeProps & import('vue').AllowedComponentProps & import('vue').ComponentCustomProps, never>, "onUpdate:count" | "onUpdate:error" | "onClick:action" | "onUpdate:query-params"> & {
|
15
15
|
count?: number;
|
16
16
|
fields: Fields;
|
17
|
-
expansion?:
|
17
|
+
expansion?: ExpansionComponent<Data>;
|
18
18
|
useQueryFn: UseQueryPaginated<Data, QueryParams>;
|
19
19
|
queryParams: QueryParams;
|
20
20
|
queryOptions?: Partial<QueryOptions<PaginatedResponse<Data>>>;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WList.vue"],"names":[],"mappings":"
|
1
|
+
{"version":3,"file":"WList.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/List/WList.vue"],"names":[],"mappings":"AAqTA;AAseA,OAAO,KAAK,EAAC,eAAe,EAAE,aAAa,EAAE,gBAAgB,EAAE,SAAS,EAAE,kBAAkB,EAAE,cAAc,EAAE,OAAO,EAAE,UAAU,EAAE,aAAa,EAAC,MAAM,SAAS,CAAA;AAChK,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,eAAe,CAAA;AAC5C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAA;AAczC,OAAO,EAAuB,QAAQ,EAAC,MAAM,eAAe,CAAA;yBAW3C,IAAI,SAAS,WAAW,EAAE,WAAW,EAAE,MAAM,SAAS,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC,EAAE,WAAW,SAAS,SAAS,OAAO,EAAE,EAC3I,aAAa,WAAW,CAAC,OAAO,CAAC,OAAO,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,EAC9D,YAAY,mBAAmB,CAAC,IAAI,CAAC,WAAW,CA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G;;;;YA3EiB,GAAG;2BACC,GAAG;;;;;YACP,GAAG;uBACF,GAAG;;;YAzxB1B,cAAc,SAAS,QAAQ,GAAG,IAAI;YACtC,cAAc,SAAS,gBAAgB,CAAC,IAAI,CAAC,GAAG,IAAI;YACpD,qBAAqB,SAAS,WAAW,GAAG,IAAI;YAChD,cAAc,SAAS,MAAM,GAAG,SAAS,GAAG,IAAI;;EAk2BlD,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AAl5BzE,wBAk5B4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -348,6 +348,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
348
348
|
readonly: _ctx.readonly || (_ctx.readonlyGetter?.(defaultScope.item) ?? false),
|
349
349
|
skeleton,
|
350
350
|
card: unref(isGrid),
|
351
|
+
config: unref(fieldConfigMap)[defaultScope.field.meta.label],
|
351
352
|
class: normalizeClass({
|
352
353
|
[defaultScope.field.meta.cssClass ?? ""]: true,
|
353
354
|
"items-center": !_ctx.alignTop,
|
@@ -367,7 +368,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
367
368
|
refetch();
|
368
369
|
},
|
369
370
|
onValidate: ($event) => validate()
|
370
|
-
}, null, 40, ["item", "readonly", "skeleton", "card", "class", "style", "onUpdate:item", "onDelete:item", "onValidate"]))
|
371
|
+
}, null, 40, ["item", "readonly", "skeleton", "card", "config", "class", "style", "onUpdate:item", "onDelete:item", "onValidate"]))
|
371
372
|
]),
|
372
373
|
_: 2
|
373
374
|
}, 1032, ["fields", "field-config-map", "item", "skeleton", "card", "readonly"])
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"ListCardFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListCardFieldNested.vue"],"names":[],"mappings":"AAyEA;
|
1
|
+
{"version":3,"file":"ListCardFieldNested.vue.d.ts","sourceRoot":"","sources":["../../../../../src/components/List/components/ListCardFieldNested.vue"],"names":[],"mappings":"AAyEA;AAsGA,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;WAmMO,mBAAmB,CAAC;gBA/LlB,UAAU,CAAC,IAAI,EAAE,WAAW,CAAC;wBACrB,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC;cACrC,IAAI;iBACD,OAAO;kBACN,OAAO;cACX,OAAO;kBACH,OAAO;mBAyL2E,CAAC,4BAA2B;oBACzG,OAAO,KAAK,EAAE,gBAAgB,CAAC,EAAE,CAAC,GAAG,IAAI;WAClD,GAAG;;iBAtLA,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;;UAwL9H,EAAE;EAEL,KACQ,OAAO,KAAK,EAAE,KAAK,GAAG;IAAE,KAAK,CAAC,EAAE,OAAO,CAAC,OAAO,WAAW,CAAC,CAAA;CAAE;AA9MzE,wBA8M4E;AAC5E,KAAK,mBAAmB,CAAC,CAAC,IAAI;KAAG,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;CAAG,GAAG,EAAE,CAAC"}
|
@@ -16,6 +16,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
16
|
readonly: { type: Boolean }
|
17
17
|
},
|
18
18
|
setup(__props) {
|
19
|
+
const config = { width: null, visible: true, order: 0, sticky: false };
|
19
20
|
return (_ctx, _cache) => {
|
20
21
|
const _component_ListCardFieldNested = resolveComponent("ListCardFieldNested", true);
|
21
22
|
return openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.card ? _ctx.fields : unref(sortFields)(_ctx.fields, _ctx.fieldConfigMap), (field) => {
|
@@ -31,7 +32,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
31
32
|
"keyArray" in field.meta || "getterArray" in field.meta ? (openBlock(), createBlock(resolveDynamicComponent(field.default ?? "div"), mergeProps({
|
32
33
|
key: 0,
|
33
34
|
ref_for: true
|
34
|
-
}, field.default ? { item: _ctx.item, skeleton: _ctx.skeleton, card: _ctx.card, readonly: _ctx.readonly } : void 0, {
|
35
|
+
}, field.default ? { item: _ctx.item, skeleton: _ctx.skeleton, card: _ctx.card, readonly: _ctx.readonly, config } : void 0, {
|
35
36
|
class: field.meta.cssClassArray
|
36
37
|
}), {
|
37
38
|
default: withCtx(() => [
|
@@ -70,7 +71,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
70
71
|
}, 1040, ["class"])) : (openBlock(), createBlock(resolveDynamicComponent(field.default ?? "div"), mergeProps({
|
71
72
|
key: 1,
|
72
73
|
ref_for: true
|
73
|
-
}, field.default ? { item: _ctx.item, skeleton: _ctx.skeleton, card: _ctx.card, readonly: _ctx.readonly } : void 0, {
|
74
|
+
}, field.default ? { item: _ctx.item, skeleton: _ctx.skeleton, card: _ctx.card, readonly: _ctx.readonly, config } : void 0, {
|
74
75
|
class: [field.meta.cssClass, "flex"]
|
75
76
|
}), {
|
76
77
|
default: withCtx(() => [
|
@@ -5,8 +5,10 @@ export type FieldProps<Data> = {
|
|
5
5
|
skeleton: boolean;
|
6
6
|
readonly: boolean;
|
7
7
|
card: boolean;
|
8
|
+
config: FieldConfig;
|
8
9
|
};
|
9
10
|
export type FieldComponent<Data> = Component<FieldProps<Data>>;
|
11
|
+
export type ExpansionComponent<Data> = Component<Omit<FieldProps<Data>, 'config'>>;
|
10
12
|
export type FieldComponentItem<Data> = Component<{
|
11
13
|
item: Data;
|
12
14
|
skeleton: boolean;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/List/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,KAAK,CAAA;AAEvC,MAAM,MAAM,UAAU,CAAC,IAAI,IAAI;IAC7B,IAAI,EAAE,IAAI,CAAA;IACV,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,OAAO,CAAA;
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/List/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,eAAe,CAAA;AAC3C,OAAO,KAAK,EAAC,SAAS,EAAE,GAAG,EAAC,MAAM,KAAK,CAAA;AAEvC,MAAM,MAAM,UAAU,CAAC,IAAI,IAAI;IAC7B,IAAI,EAAE,IAAI,CAAA;IACV,QA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,GAAG,IAAI,CAAA;IACjE,CAAC,CAAC,EAAE,OAAO,GAAG,IAAI,CAAA;CACnB,CAAA;AAED,MAAM,MAAM,eAAe,CAAC,WAAW,IAAI,eAAe,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC,GAAG;IACzH,eAAe,CAAC,SAAS,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,UAAU,CAAC,WAAW,CAAC,CAAC;IAC7E;SAAE,GAAG,IAAI,MAAM,CAAC,CAAC,EAAE,GAAG,SAAS,MAAM,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,EAAE,aAAa,CAAC,GAC5E,KAAK,GACL,GAAG,SAAS,MAAM,WAAW,CAAC,WAAW,CAAC,GAC1C,WAAW,CAAC,WAAW,CAAC,CAAC,GAAG,CAAC,GAE7B,GAAG;KACR;CACF,CAAA"}
|
package/dist/utils/dateTime.d.ts
CHANGED
@@ -31,7 +31,7 @@ export declare function dateFormat(date: Date): string;
|
|
31
31
|
export declare function timeFormat(date: Date): string;
|
32
32
|
export declare function timeFormatShort(date: Date): string;
|
33
33
|
export declare function datetimeFormat(date: Date): string;
|
34
|
-
export declare function durationHumanize(durationSeconds: number, full?: boolean): string;
|
34
|
+
export declare function durationHumanize(durationSeconds: number, full?: boolean, round?: boolean): string;
|
35
35
|
export declare function getDurationRound(seconds: number): number;
|
36
36
|
export declare function getStartOfMonth(date?: Date): Date;
|
37
37
|
export declare function addDay(date: Date | undefined, count: number): Date;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"dateTime.d.ts","sourceRoot":"","sources":["../../../src/utils/dateTime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,qBAAgD,CAAA;AAClF,eAAO,MAAM,mBAAmB,qBAA8C,CAAA;AAC9E,eAAO,MAAM,aAAa,qBAAiF,CAAA;AAE3G,eAAO,MAAM,UAAU,QAA0B,CAAA;AAEjD,eAA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AAI,CAYjG;AAED,wBAAgB,aAAa,CAAC,IAAI,GAAE,IAAiB,GAAG,IAAI,CAM3D;AAED,wBAAgB,iBAAiB,CAAC,IAAI,GAAE,IAAiB,GAAG,IAAI,CAM/D;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAEpD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAEpD;AAED,wBAAgB,WAAW,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAErD;AAED,wBAAgB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,GAAG,OAAO,CAEpD"}
|
package/dist/utils/dateTime.js
CHANGED
@@ -52,29 +52,29 @@ function timeFormatShort(date) {
|
|
52
52
|
function datetimeFormat(date) {
|
53
53
|
return `${dateFormat(date)} ${timeFormat(date)}`;
|
54
54
|
}
|
55
|
-
function durationHumanize(durationSeconds, full) {
|
55
|
+
function durationHumanize(durationSeconds, full, round) {
|
56
56
|
const cb = full ? getDurationStringFull : getDurationString;
|
57
57
|
const seconds = durationSeconds % 60;
|
58
|
-
if (durationSeconds === seconds) return cb(seconds);
|
58
|
+
if (durationSeconds === seconds) return round ? cb(Math.round(seconds)) : cb(seconds);
|
59
59
|
const durationMinutes = (durationSeconds - seconds) / 60;
|
60
60
|
const minutes = durationMinutes % 60;
|
61
|
-
if (durationMinutes === minutes) return cb(seconds, minutes);
|
61
|
+
if (durationMinutes === minutes) return round ? cb(0, Math.round(minutes)) : cb(seconds, minutes);
|
62
62
|
const durationHours = (durationMinutes - minutes) / 60;
|
63
63
|
const hours = durationHours % 24;
|
64
|
-
if (durationHours === hours) return cb(seconds, minutes, hours);
|
64
|
+
if (durationHours === hours) return round ? cb(0, 0, Math.round(hours)) : cb(seconds, minutes, hours);
|
65
65
|
const durationDays = (durationHours - hours) / 24;
|
66
66
|
const days = durationDays % 365;
|
67
67
|
if (durationDays === days) {
|
68
|
-
if (days < 30) return cb(seconds, minutes, hours, days);
|
68
|
+
if (days < 30) return round ? cb(0, 0, 0, Math.round(days)) : cb(seconds, minutes, hours, days);
|
69
69
|
const newDays = days % 30;
|
70
70
|
const months = (days - newDays) / 30;
|
71
|
-
return cb(seconds, minutes, hours, newDays, months);
|
71
|
+
return round ? cb(0, 0, 0, 0, Math.round(months)) : cb(seconds, minutes, hours, newDays, months);
|
72
72
|
} else {
|
73
73
|
const durationYears = (durationDays - days) / 365;
|
74
|
-
if (days < 30) return cb(seconds, minutes, hours, days, 0, durationYears);
|
74
|
+
if (days < 30) return round ? cb(0, 0, 0, 0, 0, Math.round(durationYears)) : cb(seconds, minutes, hours, days, 0, durationYears);
|
75
75
|
const newDays = days % 30;
|
76
76
|
const months = (days - newDays) / 30;
|
77
|
-
return cb(seconds, minutes, hours, newDays, months, durationYears);
|
77
|
+
return round ? cb(0, 0, 0, 0, 0, Math.round(durationYears)) : cb(seconds, minutes, hours, newDays, months, durationYears);
|
78
78
|
}
|
79
79
|
}
|
80
80
|
function getDurationString(seconds, minutes, hours, days, months, years) {
|