@vc-shell/framework 1.0.45 → 1.0.48
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/core/plugins/index.ts +2 -1
- package/core/plugins/moment/humanize.ts +77 -0
- package/core/plugins/moment/index.ts +1 -0
- package/core/plugins/moment/moment.ts +29 -0
- package/core/types/index.ts +11 -6
- package/dist/core/plugins/index.d.ts +2 -1
- package/dist/core/plugins/index.d.ts.map +1 -1
- package/dist/core/plugins/moment/humanize.d.ts +3 -0
- package/dist/core/plugins/moment/humanize.d.ts.map +1 -0
- package/dist/core/plugins/moment/index.d.ts +2 -0
- package/dist/core/plugins/moment/index.d.ts.map +1 -0
- package/dist/core/plugins/moment/moment.d.ts +13 -0
- package/dist/core/plugins/moment/moment.d.ts.map +1 -0
- package/dist/core/types/index.d.ts +13 -7
- package/dist/core/types/index.d.ts.map +1 -1
- package/dist/framework.js +96 -81
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/ui/components/index.d.ts +0 -1
- package/dist/ui/components/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/index.d.ts +1 -1
- package/dist/ui/components/molecules/vc-input/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts +1 -5
- package/dist/ui/components/molecules/vc-input/vc-input-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts +4 -10
- package/dist/ui/components/molecules/vc-input-currency/vc-input-currency-model.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/index.d.ts.map +1 -1
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts +6 -13
- package/dist/ui/components/molecules/vc-select/vc-select-model.d.ts.map +1 -1
- package/dist/ui/types/index.d.ts +6 -6
- package/dist/ui/types/index.d.ts.map +1 -1
- package/dist/ui/types/ts-helpers.d.ts +4 -5
- package/dist/ui/types/ts-helpers.d.ts.map +1 -1
- package/dist/vite.config.d.ts.map +1 -1
- package/package.json +7 -7
- package/shared/assets/components/assets-details/assets-details.vue +9 -10
- package/ui/components/atoms/vc-col/vc-col.vue +10 -6
- package/ui/components/atoms/vc-icon/vc-icon.vue +1 -1
- package/ui/components/index.ts +0 -1
- package/ui/components/molecules/vc-breadcrumbs/vc-breadcrumbs.vue +12 -5
- package/ui/components/molecules/vc-input/index.ts +1 -1
- package/ui/components/molecules/vc-input/vc-input-model.ts +2 -5
- package/ui/components/molecules/vc-input/vc-input.vue +2 -2
- package/ui/components/molecules/vc-input-currency/vc-input-currency-model.ts +4 -10
- package/ui/components/molecules/vc-input-currency/vc-input-currency.vue +2 -5
- package/ui/components/molecules/vc-select/index.ts +1 -0
- package/ui/components/molecules/vc-select/vc-select-model.ts +16 -22
- package/ui/components/molecules/vc-select/vc-select.vue +3 -2
- package/ui/components/molecules/vc-slider/vc-slider.vue +10 -6
- package/ui/components/organisms/vc-app/_internal/vc-app-bar/vc-app-bar.vue +1 -1
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/_internal/vc-app-menu-link.vue +3 -3
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/_internal/vc-app-menu-item/vc-app-menu-item.vue +6 -8
- package/ui/components/organisms/vc-app/_internal/vc-app-menu/vc-app-menu.vue +2 -0
- package/ui/components/organisms/vc-app/vc-app.vue +5 -1
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/_internal/vc-blade-toolbar-button/vc-blade-toolbar-button.vue +22 -36
- package/ui/components/organisms/vc-blade/_internal/vc-blade-toolbar/vc-blade-toolbar.vue +7 -5
- package/ui/components/organisms/vc-blade/vc-blade.vue +5 -2
- package/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue +20 -15
- package/ui/components/organisms/vc-gallery/_internal/vc-gallery-preview/vc-gallery-preview.vue +12 -11
- package/ui/components/organisms/vc-table/vc-table.vue +92 -141
- package/ui/types/index.ts +5 -17
- package/ui/types/ts-helpers.ts +7 -21
- package/dist/framework.js.map +0 -1
- package/ui/components/molecules/vc-currency-input/vc-input.vue +0 -436
- package/ui/components/molecules/vc-multivalue/vc-multivalue.vue +0 -447
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div
|
|
2
|
+
<div
|
|
3
|
+
class="tw-relative tw-overflow-hidden tw-flex tw-flex-col tw-grow tw-basis-0"
|
|
4
|
+
>
|
|
3
5
|
<!-- Header slot with filter and searchbar -->
|
|
4
6
|
<slot
|
|
5
7
|
name="header"
|
|
@@ -11,7 +13,9 @@
|
|
|
11
13
|
activeFilterCount)
|
|
12
14
|
"
|
|
13
15
|
>
|
|
14
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
class="tw-shrink-0 tw-flex tw-items-center tw-justify-between tw-p-4"
|
|
18
|
+
>
|
|
15
19
|
<!-- Table filter mobile button -->
|
|
16
20
|
<div v-if="$isMobile.value && $slots['filters']" class="tw-mr-3">
|
|
17
21
|
<VcTableFilter :counter="activeFilterCount">
|
|
@@ -46,7 +50,7 @@
|
|
|
46
50
|
</div>
|
|
47
51
|
</slot>
|
|
48
52
|
|
|
49
|
-
<div class=
|
|
53
|
+
<div class="tw-flex tw-relative tw-overflow-hidden tw-grow">
|
|
50
54
|
<!-- Table loading overlay -->
|
|
51
55
|
<VcLoading :active="loading"></VcLoading>
|
|
52
56
|
|
|
@@ -92,7 +96,7 @@
|
|
|
92
96
|
class="tw-h-[42px] tw-bg-[#f9f9f9] !tw-border-0 tw-shadow-[inset_0px_1px_0px_#eaedf3,_inset_0px_-1px_0px_#eaedf3] tw-box-border sticky tw-top-0 tw-select-none tw-overflow-hidden tw-z-[1]"
|
|
93
97
|
width="50"
|
|
94
98
|
>
|
|
95
|
-
<div class=
|
|
99
|
+
<div class="tw-flex tw-justify-center tw-items-center">
|
|
96
100
|
<VcCheckbox
|
|
97
101
|
:modelValue="headerCheckbox"
|
|
98
102
|
@update:modelValue="processHeaderCheckbox"
|
|
@@ -111,7 +115,7 @@
|
|
|
111
115
|
@click="handleHeaderClick(item)"
|
|
112
116
|
>
|
|
113
117
|
<div
|
|
114
|
-
class=
|
|
118
|
+
class="tw-flex tw-items-center tw-flex-nowrap"
|
|
115
119
|
:class="tableAlignment[item.align]"
|
|
116
120
|
>
|
|
117
121
|
<div>
|
|
@@ -126,7 +130,7 @@
|
|
|
126
130
|
></VcIcon>
|
|
127
131
|
</div>
|
|
128
132
|
<div
|
|
129
|
-
class=
|
|
133
|
+
class="tw-flex tw-flex-col tw-ml-1 tw-invisible group-hover:tw-visible"
|
|
130
134
|
v-else
|
|
131
135
|
>
|
|
132
136
|
<VcIcon size="xs" icon="fas fa-caret-up"></VcIcon>
|
|
@@ -158,7 +162,7 @@
|
|
|
158
162
|
@mouseleave="closeActions"
|
|
159
163
|
>
|
|
160
164
|
<td v-if="multiselect" width="50">
|
|
161
|
-
<div class=
|
|
165
|
+
<div class="tw-flex tw-justify-center tw-items-center">
|
|
162
166
|
<VcCheckbox
|
|
163
167
|
:modelValue="checkboxes[item.id]"
|
|
164
168
|
@update:modelValue="processCheckbox(item.id, $event)"
|
|
@@ -188,7 +192,7 @@
|
|
|
188
192
|
<button
|
|
189
193
|
class="tw-text-[#319ed4] tw-cursor-pointer tw-border-none tw-bg-transparent disabled:tw-text-[gray]"
|
|
190
194
|
@click.stop="showActions(item, item.id)"
|
|
191
|
-
:ref="(el) => setActionToggleRefs(el, item.id)"
|
|
195
|
+
:ref="(el: Element) => setActionToggleRefs(el, item.id)"
|
|
192
196
|
aria-describedby="tooltip"
|
|
193
197
|
:disabled="!(itemActions && itemActions.length)"
|
|
194
198
|
>
|
|
@@ -198,11 +202,11 @@
|
|
|
198
202
|
class="vc-table__body-tooltip tw-bg-white tw-rounded-l-[4px] tw-p-[15px] tw-z-0 tw-absolute tw-right-0 tw-drop-shadow-[1px_3px_14px_rgba(111,122,131,0.25)]"
|
|
199
203
|
v-show="selectedRow === item.id"
|
|
200
204
|
@mouseleave="closeActions"
|
|
201
|
-
:ref="(el) => setTooltipRefs(el, item.id)"
|
|
205
|
+
:ref="(el: Element) => setTooltipRefs(el, item.id)"
|
|
202
206
|
role="tooltip"
|
|
203
207
|
>
|
|
204
208
|
<div
|
|
205
|
-
class=
|
|
209
|
+
class="tw-flex tw-items-center tw-flex-row tw-text-[#3f3f3f] tw-font-normal not-italic tw-text-base tw-leading-[20px] tw-gap-[25px]"
|
|
206
210
|
>
|
|
207
211
|
<div
|
|
208
212
|
v-for="(itemAction, i) in itemActions"
|
|
@@ -308,129 +312,72 @@ import VcTableFilter from "./_internal/vc-table-filter/vc-table-filter.vue";
|
|
|
308
312
|
import VcTableMobileItem from "./_internal/vc-table-mobile-item/vc-table-mobile-item.vue";
|
|
309
313
|
import VcTableCell from "./_internal/vc-table-cell/vc-table-cell.vue";
|
|
310
314
|
import { createPopper, Instance } from "@popperjs/core";
|
|
311
|
-
import { IActionBuilderResult } from "@/core/types";
|
|
315
|
+
import { IActionBuilderResult, ITableColumns } from "@/core/types";
|
|
316
|
+
|
|
317
|
+
export interface Props {
|
|
318
|
+
columns: ITableColumns[];
|
|
319
|
+
items: { id: string }[];
|
|
320
|
+
itemActionBuilder?: (item: { id: string }) => IActionBuilderResult[];
|
|
321
|
+
sort?: string;
|
|
322
|
+
multiselect?: boolean;
|
|
323
|
+
expanded?: boolean;
|
|
324
|
+
totalLabel?: string;
|
|
325
|
+
totalCount?: number;
|
|
326
|
+
pages?: number;
|
|
327
|
+
currentPage?: number;
|
|
328
|
+
searchPlaceholder?: string;
|
|
329
|
+
searchValue?: string;
|
|
330
|
+
loading?: boolean;
|
|
331
|
+
empty?: StatusImage;
|
|
332
|
+
notfound?: StatusImage;
|
|
333
|
+
header?: boolean;
|
|
334
|
+
footer?: boolean;
|
|
335
|
+
activeFilterCount?: number;
|
|
336
|
+
selectedItemId?: string;
|
|
337
|
+
scrolling?: boolean;
|
|
338
|
+
onItemClick?: () => void;
|
|
339
|
+
}
|
|
312
340
|
|
|
313
|
-
interface
|
|
314
|
-
|
|
315
|
-
|
|
341
|
+
export interface StatusImage {
|
|
342
|
+
image?: string;
|
|
343
|
+
text: string;
|
|
344
|
+
action?: boolean;
|
|
345
|
+
clickHandler?: () => void;
|
|
316
346
|
}
|
|
317
347
|
|
|
318
|
-
const props = defineProps({
|
|
319
|
-
columns:
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
},
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
multiselect: {
|
|
345
|
-
type: Boolean,
|
|
346
|
-
default: false,
|
|
347
|
-
},
|
|
348
|
-
|
|
349
|
-
expanded: {
|
|
350
|
-
type: Boolean,
|
|
351
|
-
default: false,
|
|
352
|
-
},
|
|
353
|
-
|
|
354
|
-
totalLabel: {
|
|
355
|
-
type: String,
|
|
356
|
-
default: "Totals:",
|
|
357
|
-
},
|
|
358
|
-
|
|
359
|
-
totalCount: {
|
|
360
|
-
type: Number,
|
|
361
|
-
default: 0,
|
|
362
|
-
},
|
|
363
|
-
|
|
364
|
-
pages: {
|
|
365
|
-
type: Number,
|
|
366
|
-
default: 0,
|
|
367
|
-
},
|
|
368
|
-
|
|
369
|
-
currentPage: {
|
|
370
|
-
type: Number,
|
|
371
|
-
default: 0,
|
|
372
|
-
},
|
|
373
|
-
|
|
374
|
-
searchPlaceholder: {
|
|
375
|
-
type: String,
|
|
376
|
-
default: "Search...",
|
|
377
|
-
},
|
|
378
|
-
|
|
379
|
-
searchValue: {
|
|
380
|
-
type: String,
|
|
381
|
-
default: undefined,
|
|
382
|
-
},
|
|
383
|
-
|
|
384
|
-
loading: {
|
|
385
|
-
type: Boolean,
|
|
386
|
-
default: false,
|
|
387
|
-
},
|
|
388
|
-
|
|
389
|
-
empty: {
|
|
390
|
-
type: Object,
|
|
391
|
-
default: () => ({
|
|
392
|
-
text: "List is empty.",
|
|
393
|
-
}),
|
|
394
|
-
},
|
|
395
|
-
|
|
396
|
-
notfound: {
|
|
397
|
-
type: Object,
|
|
398
|
-
default: () => ({
|
|
399
|
-
text: "Nothing found.",
|
|
400
|
-
}),
|
|
401
|
-
},
|
|
402
|
-
|
|
403
|
-
header: {
|
|
404
|
-
type: Boolean,
|
|
405
|
-
default: true,
|
|
406
|
-
},
|
|
407
|
-
|
|
408
|
-
footer: {
|
|
409
|
-
type: Boolean,
|
|
410
|
-
default: true,
|
|
411
|
-
},
|
|
412
|
-
|
|
413
|
-
activeFilterCount: {
|
|
414
|
-
type: Number,
|
|
415
|
-
default: 0,
|
|
416
|
-
},
|
|
417
|
-
|
|
418
|
-
selectedItemId: {
|
|
419
|
-
type: String,
|
|
420
|
-
default: undefined,
|
|
421
|
-
},
|
|
422
|
-
|
|
423
|
-
scrolling: {
|
|
424
|
-
type: Boolean,
|
|
425
|
-
default: false,
|
|
426
|
-
},
|
|
427
|
-
|
|
428
|
-
onItemClick: {
|
|
429
|
-
type: Function,
|
|
430
|
-
default: undefined,
|
|
431
|
-
},
|
|
348
|
+
const props = withDefaults(defineProps<Props>(), {
|
|
349
|
+
columns: () => [],
|
|
350
|
+
items: () => [],
|
|
351
|
+
itemActionBuilder: undefined,
|
|
352
|
+
sort: undefined,
|
|
353
|
+
multiselect: false,
|
|
354
|
+
expanded: false,
|
|
355
|
+
totalLabel: "Totals:",
|
|
356
|
+
totalCount: 0,
|
|
357
|
+
pages: 0,
|
|
358
|
+
currentPage: 0,
|
|
359
|
+
searchPlaceholder: "Search...",
|
|
360
|
+
searchValue: undefined,
|
|
361
|
+
loading: false,
|
|
362
|
+
empty: () => ({
|
|
363
|
+
text: "List is empty.",
|
|
364
|
+
}),
|
|
365
|
+
notfound: () => ({
|
|
366
|
+
text: "Nothing found.",
|
|
367
|
+
}),
|
|
368
|
+
header: true,
|
|
369
|
+
footer: true,
|
|
370
|
+
activeFilterCount: 0,
|
|
371
|
+
selectedItemId: undefined,
|
|
372
|
+
scrolling: false,
|
|
373
|
+
onItemClick: undefined,
|
|
432
374
|
});
|
|
433
375
|
|
|
376
|
+
interface ITableItemRef {
|
|
377
|
+
element: Element;
|
|
378
|
+
id: string;
|
|
379
|
+
}
|
|
380
|
+
|
|
434
381
|
const emit = defineEmits([
|
|
435
382
|
"paginationClick",
|
|
436
383
|
"selectionChanged",
|
|
@@ -486,7 +433,7 @@ watch(
|
|
|
486
433
|
}
|
|
487
434
|
);
|
|
488
435
|
|
|
489
|
-
function setTooltipRefs(el:
|
|
436
|
+
function setTooltipRefs(el: Element, id: string) {
|
|
490
437
|
if (el) {
|
|
491
438
|
const isExists = tooltipRefs.value.some((item) => item.id === id);
|
|
492
439
|
if (!isExists) {
|
|
@@ -495,7 +442,7 @@ function setTooltipRefs(el: HTMLDivElement, id: string) {
|
|
|
495
442
|
}
|
|
496
443
|
}
|
|
497
444
|
|
|
498
|
-
function setActionToggleRefs(el:
|
|
445
|
+
function setActionToggleRefs(el: Element, id: string) {
|
|
499
446
|
if (el) {
|
|
500
447
|
const isExists = actionToggleRefs.value.some((item) => item.id === id);
|
|
501
448
|
if (!isExists) {
|
|
@@ -525,18 +472,22 @@ function showActions(item: { id: string }, index: string) {
|
|
|
525
472
|
|
|
526
473
|
if (toggleRef && tooltipRef) {
|
|
527
474
|
nextTick(() => {
|
|
528
|
-
tooltip.value = createPopper(
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
475
|
+
tooltip.value = createPopper(
|
|
476
|
+
toggleRef.element,
|
|
477
|
+
tooltipRef.element as HTMLElement,
|
|
478
|
+
{
|
|
479
|
+
placement: "bottom",
|
|
480
|
+
onFirstUpdate: () => tooltip.value?.update(),
|
|
481
|
+
modifiers: [
|
|
482
|
+
{
|
|
483
|
+
name: "offset",
|
|
484
|
+
options: {
|
|
485
|
+
offset: [-15, 15],
|
|
486
|
+
},
|
|
536
487
|
},
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
488
|
+
],
|
|
489
|
+
}
|
|
490
|
+
);
|
|
540
491
|
});
|
|
541
492
|
}
|
|
542
493
|
}
|
package/ui/types/index.ts
CHANGED
|
@@ -1,38 +1,26 @@
|
|
|
1
1
|
import { GlobalComponentConstructor } from "./ts-helpers";
|
|
2
2
|
import {
|
|
3
|
-
VcInputEmits,
|
|
4
3
|
VcInputProps,
|
|
5
4
|
VcInputSlots,
|
|
6
5
|
} from "../components/molecules/vc-input/vc-input-model";
|
|
7
6
|
import {
|
|
8
|
-
VcSelectEmits,
|
|
9
7
|
VcSelectProps,
|
|
10
8
|
VcSelectSlots,
|
|
11
9
|
} from "../components/molecules/vc-select/vc-select-model";
|
|
12
10
|
import {
|
|
13
11
|
VcInputCurrencyProps,
|
|
14
|
-
VcInputCurrencyEmits,
|
|
15
12
|
VcInputCurrencySlots,
|
|
16
|
-
} from "
|
|
13
|
+
} from "../components/molecules/vc-input-currency/vc-input-currency-model";
|
|
17
14
|
|
|
18
15
|
declare module "@vue/runtime-core" {
|
|
19
16
|
interface GlobalComponents {
|
|
20
|
-
VcInput: GlobalComponentConstructor<
|
|
21
|
-
VcInputProps,
|
|
22
|
-
VcInputSlots,
|
|
23
|
-
VcInputEmits
|
|
24
|
-
>;
|
|
17
|
+
VcInput: GlobalComponentConstructor<VcInputProps, VcInputSlots>;
|
|
25
18
|
VcInputCurrency: GlobalComponentConstructor<
|
|
26
19
|
VcInputCurrencyProps,
|
|
27
|
-
VcInputCurrencySlots
|
|
28
|
-
VcInputCurrencyEmits
|
|
29
|
-
>;
|
|
30
|
-
VcSelect: GlobalComponentConstructor<
|
|
31
|
-
VcSelectProps,
|
|
32
|
-
VcSelectSlots,
|
|
33
|
-
VcSelectEmits
|
|
20
|
+
VcInputCurrencySlots
|
|
34
21
|
>;
|
|
22
|
+
VcSelect: GlobalComponentConstructor<VcSelectProps, VcSelectSlots>;
|
|
35
23
|
}
|
|
36
24
|
}
|
|
37
25
|
|
|
38
|
-
export {};
|
|
26
|
+
export { };
|
package/ui/types/ts-helpers.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
ComponentOptions,
|
|
4
4
|
ComponentPublicInstance,
|
|
5
5
|
ComputedOptions,
|
|
6
|
-
EmitsOptions,
|
|
7
6
|
MethodOptions,
|
|
8
7
|
VNodeProps,
|
|
9
8
|
} from "vue";
|
|
@@ -16,31 +15,18 @@ export type ComponentConstructor<
|
|
|
16
15
|
RawBindings,
|
|
17
16
|
D,
|
|
18
17
|
C,
|
|
19
|
-
M
|
|
20
|
-
E
|
|
18
|
+
M
|
|
21
19
|
> = ComponentPublicInstance<any>,
|
|
22
20
|
Props = any,
|
|
23
21
|
RawBindings = any,
|
|
24
22
|
D = any,
|
|
25
23
|
C extends ComputedOptions = ComputedOptions,
|
|
26
24
|
M extends MethodOptions = MethodOptions,
|
|
27
|
-
|
|
28
|
-
> = { new (): Component } & ComponentOptions<
|
|
29
|
-
Props,
|
|
30
|
-
RawBindings,
|
|
31
|
-
D,
|
|
32
|
-
C,
|
|
33
|
-
M,
|
|
34
|
-
any,
|
|
35
|
-
any,
|
|
36
|
-
E
|
|
37
|
-
>;
|
|
25
|
+
> = { new (): Component } & ComponentOptions<Props, RawBindings, D, C, M>;
|
|
38
26
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
$emit: EmitsOptions & Emits;
|
|
45
|
-
};
|
|
27
|
+
export type GlobalComponentConstructor<Props = {}, Slots = {}> = {
|
|
28
|
+
new (): {
|
|
29
|
+
$props: PublicProps & Props;
|
|
30
|
+
$slots: Slots;
|
|
31
|
+
}
|
|
46
32
|
};
|