origam 2.25.0 → 2.26.0
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/CHANGELOG.md +23 -0
- package/dist/src/assets/css/main.css +1 -1
- package/dist/src/assets/css/tokens/dark.css +2 -4
- package/dist/src/assets/css/tokens/light.css +1 -2
- package/dist/src/assets/scss/tokens/_dark.scss +2 -4
- package/dist/src/assets/scss/tokens/_light.scss +1 -2
- package/dist/src/components/Card/OrigamCard.vue +80 -13
- package/dist/src/components/DataTable/OrigamDataTable.vue +26 -1
- package/dist/src/components/DataTable/OrigamDataTableRows.vue +58 -12
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanel.vue +4 -2
- package/dist/src/components/ExpansionPanel/OrigamExpansionPanelContent.vue +12 -3
- package/dist/src/components/Skeleton/OrigamSkeleton.vue +2 -7
- package/dist/src/enums/DataTable/data-table.enum.cjs +8 -2
- package/dist/src/enums/DataTable/data-table.enum.d.ts +16 -0
- package/dist/src/enums/DataTable/data-table.enum.js +6 -0
- package/dist/src/interfaces/Skeleton/skeleton.interface.d.ts +13 -0
- package/dist/src/types/tokens.type.d.ts +1 -1
- package/dist/src/utils/DataTable/skeleton-cell.util.cjs +13 -0
- package/dist/src/utils/DataTable/skeleton-cell.util.d.ts +12 -0
- package/dist/src/utils/DataTable/skeleton-cell.util.js +7 -0
- package/dist/src/utils/Skeleton/skeleton.util.cjs +30 -0
- package/dist/src/utils/Skeleton/skeleton.util.d.ts +33 -0
- package/dist/src/utils/Skeleton/skeleton.util.js +23 -0
- package/dist/src/utils/index.cjs +22 -0
- package/dist/src/utils/index.d.ts +2 -0
- package/dist/src/utils/index.js +2 -0
- package/package.json +1 -1
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
--origam-card--loading---min-height: 120px;
|
|
428
428
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
429
429
|
--origam-card__loader---min-height: 4px;
|
|
430
|
-
--origam-
|
|
430
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
431
431
|
--origam-card__loader---z-index: 3;
|
|
432
432
|
--origam-card__progress---linear-height: 4px;
|
|
433
433
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -1816,7 +1816,6 @@
|
|
|
1816
1816
|
--origam-data-table-rows--no-data---text-align: center;
|
|
1817
1817
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
1818
1818
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
1819
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
1820
1819
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
1821
1820
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
1822
1821
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -3441,7 +3440,7 @@
|
|
|
3441
3440
|
--origam-card--loading---min-height: 120px;
|
|
3442
3441
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
3443
3442
|
--origam-card__loader---min-height: 4px;
|
|
3444
|
-
--origam-
|
|
3443
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
3445
3444
|
--origam-card__loader---z-index: 3;
|
|
3446
3445
|
--origam-card__progress---linear-height: 4px;
|
|
3447
3446
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -4830,7 +4829,6 @@
|
|
|
4830
4829
|
--origam-data-table-rows--no-data---text-align: center;
|
|
4831
4830
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
4832
4831
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
4833
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
4834
4832
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
4835
4833
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
4836
4834
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
--origam-card--loading---min-height: 120px;
|
|
328
328
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
329
329
|
--origam-card__loader---min-height: 4px;
|
|
330
|
-
--origam-
|
|
330
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
331
331
|
--origam-card__loader---z-index: 3;
|
|
332
332
|
--origam-card__progress---linear-height: 4px;
|
|
333
333
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -1718,7 +1718,6 @@
|
|
|
1718
1718
|
--origam-data-table-rows--no-data---text-align: center;
|
|
1719
1719
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
1720
1720
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
1721
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
1722
1721
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
1723
1722
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
1724
1723
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -427,7 +427,7 @@
|
|
|
427
427
|
--origam-card--loading---min-height: 120px;
|
|
428
428
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
429
429
|
--origam-card__loader---min-height: 4px;
|
|
430
|
-
--origam-
|
|
430
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
431
431
|
--origam-card__loader---z-index: 3;
|
|
432
432
|
--origam-card__progress---linear-height: 4px;
|
|
433
433
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -1816,7 +1816,6 @@
|
|
|
1816
1816
|
--origam-data-table-rows--no-data---text-align: center;
|
|
1817
1817
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
1818
1818
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
1819
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
1820
1819
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
1821
1820
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
1822
1821
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -3441,7 +3440,7 @@
|
|
|
3441
3440
|
--origam-card--loading---min-height: 120px;
|
|
3442
3441
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
3443
3442
|
--origam-card__loader---min-height: 4px;
|
|
3444
|
-
--origam-
|
|
3443
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
3445
3444
|
--origam-card__loader---z-index: 3;
|
|
3446
3445
|
--origam-card__progress---linear-height: 4px;
|
|
3447
3446
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -4830,7 +4829,6 @@
|
|
|
4830
4829
|
--origam-data-table-rows--no-data---text-align: center;
|
|
4831
4830
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
4832
4831
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
4833
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
4834
4832
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
4835
4833
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
4836
4834
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
--origam-card--loading---min-height: 120px;
|
|
328
328
|
--origam-card__asset---aspect-ratio: 16 / 9;
|
|
329
329
|
--origam-card__loader---min-height: 4px;
|
|
330
|
-
--origam-
|
|
330
|
+
--origam-card__skeleton---padding: var(--origam-space---4);
|
|
331
331
|
--origam-card__loader---z-index: 3;
|
|
332
332
|
--origam-card__progress---linear-height: 4px;
|
|
333
333
|
--origam-card__progress---circular-margin: 24px auto;
|
|
@@ -1718,7 +1718,6 @@
|
|
|
1718
1718
|
--origam-data-table-rows--no-data---text-align: center;
|
|
1719
1719
|
--origam-data-table-rows--no-data---color: var(--origam-color__text---secondary);
|
|
1720
1720
|
--origam-data-table-rows--loading---color: var(--origam-color__text---secondary);
|
|
1721
|
-
--origam-data-table-rows--skeleton---cell-padding: 4px 8px;
|
|
1722
1721
|
--origam-data-table-header-cell--sortable---cursor: pointer;
|
|
1723
1722
|
--origam-data-table__sortable---icon-color: var(--origam-color__text---primary);
|
|
1724
1723
|
--origam-data-table__sortable---icon-color-active: var(--origam-color__text---primary);
|
|
@@ -28,16 +28,55 @@
|
|
|
28
28
|
<slot name="wrapper">
|
|
29
29
|
<template v-if="hasLoading">
|
|
30
30
|
<slot name="loader">
|
|
31
|
-
<
|
|
31
|
+
<origam-skeleton-group
|
|
32
|
+
v-if="isSkeleton"
|
|
33
|
+
class="origam-card__skeleton"
|
|
34
|
+
v-bind="skeletonOverrides.group"
|
|
35
|
+
>
|
|
32
36
|
<origam-skeleton
|
|
33
|
-
v-if="
|
|
34
|
-
variant="
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
v-if="hasAsset"
|
|
38
|
+
variant="rectangular"
|
|
39
|
+
class="origam-card__skeleton-media"
|
|
40
|
+
v-bind="skeletonOverrides.block"
|
|
41
|
+
/>
|
|
42
|
+
<origam-skeleton
|
|
43
|
+
variant="text"
|
|
44
|
+
class="origam-card__skeleton-title"
|
|
45
|
+
v-bind="skeletonOverrides.block"
|
|
46
|
+
/>
|
|
47
|
+
<origam-skeleton
|
|
48
|
+
variant="text"
|
|
49
|
+
class="origam-card__skeleton-subtitle"
|
|
50
|
+
v-bind="skeletonOverrides.block"
|
|
38
51
|
/>
|
|
52
|
+
<origam-skeleton
|
|
53
|
+
variant="text"
|
|
54
|
+
class="origam-card__skeleton-line"
|
|
55
|
+
v-bind="skeletonOverrides.block"
|
|
56
|
+
/>
|
|
57
|
+
<origam-skeleton
|
|
58
|
+
variant="text"
|
|
59
|
+
class="origam-card__skeleton-line origam-card__skeleton-line--last"
|
|
60
|
+
v-bind="skeletonOverrides.block"
|
|
61
|
+
/>
|
|
62
|
+
<template v-if="hasFooter">
|
|
63
|
+
<origam-skeleton
|
|
64
|
+
variant="pill"
|
|
65
|
+
class="origam-card__skeleton-action"
|
|
66
|
+
v-bind="skeletonOverrides.block"
|
|
67
|
+
/>
|
|
68
|
+
<origam-skeleton
|
|
69
|
+
variant="pill"
|
|
70
|
+
class="origam-card__skeleton-action"
|
|
71
|
+
v-bind="skeletonOverrides.block"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
</origam-skeleton-group>
|
|
75
|
+
<div
|
|
76
|
+
v-else
|
|
77
|
+
class="origam-card__loader"
|
|
78
|
+
>
|
|
39
79
|
<origam-progress
|
|
40
|
-
v-else
|
|
41
80
|
:active="true"
|
|
42
81
|
:color="color"
|
|
43
82
|
:indeterminate="loaderConfig.indeterminate"
|
|
@@ -154,6 +193,7 @@ import OrigamCardText from "./OrigamCardText.vue";
|
|
|
154
193
|
import OrigamImg from "../Img/OrigamImg.vue";
|
|
155
194
|
import OrigamProgress from "../Progress/OrigamProgress.vue";
|
|
156
195
|
import OrigamSkeleton from "../Skeleton/OrigamSkeleton.vue";
|
|
196
|
+
import OrigamSkeletonGroup from "../Skeleton/OrigamSkeletonGroup.vue";
|
|
157
197
|
import { useAdjacent } from "../../composables/Commons/adjacent.composable";
|
|
158
198
|
import { useDensity } from "../../composables/Commons/density.composable";
|
|
159
199
|
import { useDimension } from "../../composables/Commons/dimension.composable";
|
|
@@ -171,6 +211,7 @@ import { DENSITY } from "../../enums/Commons/density.enum";
|
|
|
171
211
|
import { KEYBOARD_VALUES } from "../../enums/Commons/hotkey.enum";
|
|
172
212
|
import { LOADER_KIND } from "../../enums/Commons/loader.enum";
|
|
173
213
|
import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
214
|
+
import { splitSkeletonOverrides } from "../../utils/Skeleton/skeleton.util";
|
|
174
215
|
import { computed, ref, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
175
216
|
const props = defineProps({
|
|
176
217
|
disabled: { type: Boolean, required: false },
|
|
@@ -338,6 +379,8 @@ const handleKeydown = (event) => {
|
|
|
338
379
|
};
|
|
339
380
|
const { loaderClasses, loaderConfig } = useLoader(props, LOADER_KIND.LINE);
|
|
340
381
|
const slots = useSlots();
|
|
382
|
+
const isSkeleton = computed(() => loaderConfig.value.isActive && loaderConfig.value.kind === LOADER_KIND.SKELETON);
|
|
383
|
+
const skeletonOverrides = computed(() => splitSkeletonOverrides(loaderConfig.value.overrides, props.loadingText));
|
|
341
384
|
const hasLoading = computed(() => {
|
|
342
385
|
return slots.loader || loaderConfig.value.isActive;
|
|
343
386
|
});
|
|
@@ -567,15 +610,39 @@ defineExpose({
|
|
|
567
610
|
:deep(.origam-progress--circular) {
|
|
568
611
|
margin: var(--origam-card__progress---circular-margin, 24px auto);
|
|
569
612
|
}
|
|
613
|
+
}
|
|
570
614
|
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
615
|
+
// The silhouette is a grid of light primitives (no wrapper): two
|
|
616
|
+
// columns so the two actions sit side by side, every other part spans
|
|
617
|
+
// both. `>` keeps the selectors above the primitives' own scoped
|
|
618
|
+
// rules, whatever the order the sheets load in.
|
|
619
|
+
&__skeleton {
|
|
620
|
+
grid-template-columns: auto 1fr;
|
|
621
|
+
padding: var(--origam-card__skeleton---padding);
|
|
622
|
+
|
|
623
|
+
> * {
|
|
624
|
+
grid-column: 1 / -1;
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
> .origam-card__skeleton-media {
|
|
628
|
+
height: auto;
|
|
629
|
+
aspect-ratio: var(--origam-card__asset---aspect-ratio, 16 / 9);
|
|
630
|
+
}
|
|
631
|
+
|
|
632
|
+
> .origam-card__skeleton-title {
|
|
633
|
+
width: 62%;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
> .origam-card__skeleton-subtitle {
|
|
637
|
+
width: 38%;
|
|
638
|
+
}
|
|
639
|
+
|
|
640
|
+
> .origam-card__skeleton-line--last {
|
|
641
|
+
width: 84%;
|
|
575
642
|
}
|
|
576
643
|
|
|
577
|
-
|
|
578
|
-
|
|
644
|
+
> .origam-card__skeleton-action {
|
|
645
|
+
grid-column: auto;
|
|
579
646
|
}
|
|
580
647
|
}
|
|
581
648
|
|
|
@@ -6,11 +6,17 @@
|
|
|
6
6
|
:style="dataTableStyles"
|
|
7
7
|
v-bind="tableProps"
|
|
8
8
|
:aria-rowcount="itemsLength"
|
|
9
|
+
:aria-busy="isSkeletonLoading || undefined"
|
|
9
10
|
>
|
|
10
11
|
<template
|
|
11
|
-
v-if="slots.top"
|
|
12
|
+
v-if="slots.top || isSkeletonLoading"
|
|
12
13
|
#top
|
|
13
14
|
>
|
|
15
|
+
<span
|
|
16
|
+
v-if="isSkeletonLoading"
|
|
17
|
+
class="origam-data-table__announcement"
|
|
18
|
+
role="status"
|
|
19
|
+
>{{ skeletonAnnouncement }}</span>
|
|
14
20
|
<slot name="top"/>
|
|
15
21
|
</template>
|
|
16
22
|
|
|
@@ -144,6 +150,7 @@ import { provideExpanded } from "../../composables/DataTable/expand.composable";
|
|
|
144
150
|
import { provideSelection } from "../../composables/DataTable/select.composable";
|
|
145
151
|
import { useDataTableItems } from "../../composables/DataTable/items.composable";
|
|
146
152
|
import { useFilter } from "../../composables/Commons/filters.composable";
|
|
153
|
+
import { useLocale } from "../../composables/Commons/locale.composable";
|
|
147
154
|
import { useGroupedItems } from "../../composables/DataTable/groupedItems.composable";
|
|
148
155
|
import { useOptions } from "../../composables/DataTable/options.composable";
|
|
149
156
|
import { usePaginatedItems } from "../../composables/DataTable/paginatedItems.composable";
|
|
@@ -155,7 +162,9 @@ import {
|
|
|
155
162
|
pickDataTableHeaderColumnSlotNames,
|
|
156
163
|
pickDataTableRowsSlotNames
|
|
157
164
|
} from "../../utils/DataTable/slot-name.util";
|
|
165
|
+
import { splitSkeletonOverrides } from "../../utils/Skeleton/skeleton.util";
|
|
158
166
|
import { DENSITY } from "../../enums/Commons/density.enum";
|
|
167
|
+
import { LOADER_KIND } from "../../enums/Commons/loader.enum";
|
|
159
168
|
import { MDI_ICONS } from "../../enums/Commons/mdi.enum";
|
|
160
169
|
import { computed, provide, Ref, ref, StyleValue, toRef, useAttrs, useSlots } from "vue";
|
|
161
170
|
const props = defineProps({
|
|
@@ -388,6 +397,16 @@ const slotProps = computed(() => {
|
|
|
388
397
|
const dataTableHeadersProps = computed(() => {
|
|
389
398
|
return origamDataTableHeadersRef.value?.filterProps(props);
|
|
390
399
|
});
|
|
400
|
+
const { t } = useLocale();
|
|
401
|
+
const skeletonConfig = computed(() => {
|
|
402
|
+
const loading = props.loading;
|
|
403
|
+
return typeof loading === "object" && loading !== null && loading.type === LOADER_KIND.SKELETON ? loading : null;
|
|
404
|
+
});
|
|
405
|
+
const isSkeletonLoading = computed(() => skeletonConfig.value !== null);
|
|
406
|
+
const skeletonAnnouncement = computed(() => {
|
|
407
|
+
const { group } = splitSkeletonOverrides(skeletonConfig.value, props.loadingText ?? "origam.data_iterator.loading_text");
|
|
408
|
+
return t(group.label ?? "");
|
|
409
|
+
});
|
|
391
410
|
const dataTableRowsProps = computed(() => {
|
|
392
411
|
return origamDataTableRowsRef.value?.filterProps(props, ["class", "style", "id", "items"]);
|
|
393
412
|
});
|
|
@@ -430,6 +449,12 @@ defineExpose({
|
|
|
430
449
|
</script>
|
|
431
450
|
|
|
432
451
|
<style lang="scss" scoped>
|
|
452
|
+
@use '../../assets/scss/helpers' as ds;
|
|
453
|
+
|
|
454
|
+
.origam-data-table__announcement {
|
|
455
|
+
@include ds.ds-visually-hidden;
|
|
456
|
+
}
|
|
457
|
+
|
|
433
458
|
.origam-data-table {
|
|
434
459
|
width: var(--origam-data-table---width, 100%);
|
|
435
460
|
background-color: var(--origam-data-table---background-color, var(--origam-color__surface---default));
|
|
@@ -6,15 +6,13 @@
|
|
|
6
6
|
:id="skeletonRowId(rowIndex)"
|
|
7
7
|
:key="`skeleton-row_${rowIndex}`"
|
|
8
8
|
class="origam-data-table-rows origam-data-table-rows--skeleton"
|
|
9
|
-
aria-
|
|
9
|
+
aria-hidden="true"
|
|
10
10
|
>
|
|
11
11
|
<td
|
|
12
|
-
v-for="
|
|
13
|
-
:key="
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
<origam-skeleton variant="text" :loading="true" />
|
|
17
|
-
</td>
|
|
12
|
+
v-for="cell in skeletonCells"
|
|
13
|
+
:key="cell.key"
|
|
14
|
+
v-bind="cell.attrs"
|
|
15
|
+
/>
|
|
18
16
|
</tr>
|
|
19
17
|
</template>
|
|
20
18
|
<template v-else>
|
|
@@ -136,7 +134,6 @@
|
|
|
136
134
|
<script lang="ts" setup>
|
|
137
135
|
import OrigamDataTableGroupHeaderRow from "./OrigamDataTableGroupHeaderRow.vue";
|
|
138
136
|
import OrigamDataTableRow from "./OrigamDataTableRow.vue";
|
|
139
|
-
import OrigamSkeleton from "../Skeleton/OrigamSkeleton.vue";
|
|
140
137
|
import { useExpanded } from "../../composables/DataTable/expand.composable";
|
|
141
138
|
import { useGroupBy } from "../../composables/DataTable/group.composable";
|
|
142
139
|
import { useHeaders } from "../../composables/DataTable/headers.composable";
|
|
@@ -148,6 +145,8 @@ import { useSelection } from "../../composables/DataTable/select.composable";
|
|
|
148
145
|
import { useTextColor } from "../../composables/Commons/textColor.composable";
|
|
149
146
|
import { LOADER_KIND } from "../../enums/Commons/loader.enum";
|
|
150
147
|
import { getPrefixedEventHandlers } from "../../utils/Commons/event.util";
|
|
148
|
+
import { getSkeletonCellShape } from "../../utils/DataTable/skeleton-cell.util";
|
|
149
|
+
import { getSkeletonHostClasses, splitSkeletonOverrides } from "../../utils/Skeleton/skeleton.util";
|
|
151
150
|
import {
|
|
152
151
|
pickDataTableHeaderColumnSlotNames,
|
|
153
152
|
pickDataTableItemColumnSlotNames
|
|
@@ -182,6 +181,18 @@ const SKELETON_ROW_COUNT = 5;
|
|
|
182
181
|
const skeletonRowId = (index) => props.id ? `${props.id}-skeleton-row-${index}` : void 0;
|
|
183
182
|
const itemRowId = (index) => props.id ? `${props.id}-row-${index}` : void 0;
|
|
184
183
|
const { loaderConfig } = useLoader(props, LOADER_KIND.LINE);
|
|
184
|
+
const skeletonOverrides = computed(() => splitSkeletonOverrides(loaderConfig.value.overrides, props.loadingText));
|
|
185
|
+
const skeletonCells = computed(() => columns.value.map((col) => ({
|
|
186
|
+
key: `skeleton-cell_${col.key}`,
|
|
187
|
+
attrs: {
|
|
188
|
+
"aria-hidden": true,
|
|
189
|
+
class: [
|
|
190
|
+
"origam-data-table-rows__skeleton-cell",
|
|
191
|
+
`origam-data-table-rows__skeleton-cell--${getSkeletonCellShape(col)}`,
|
|
192
|
+
getSkeletonHostClasses(skeletonOverrides.value.group.animation)
|
|
193
|
+
]
|
|
194
|
+
}
|
|
195
|
+
})));
|
|
185
196
|
const { textColorClasses, textColorStyles } = useTextColor(props, "color");
|
|
186
197
|
const { columns } = useHeaders();
|
|
187
198
|
const { expandOnClick, toggleExpand, isExpanded } = useExpanded();
|
|
@@ -288,10 +299,45 @@ defineExpose({
|
|
|
288
299
|
color: var(--origam-data-table-rows--loading---color, var(--origam-color__text---secondary));
|
|
289
300
|
}
|
|
290
301
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
// A placeholder cell is its own host (`.origam--skeleton`, which paints
|
|
305
|
+
// `::after` over the whole cell). It has no content, so it gets the
|
|
306
|
+
// height a real one-line row has, and its `::after` is narrowed to the
|
|
307
|
+
// bar the column would hold. Several rules compete for the `::after`
|
|
308
|
+
// box, so they all live under the same selector and the same `inset`.
|
|
309
|
+
.origam-data-table-rows__skeleton-cell {
|
|
310
|
+
block-size: calc(2 * var(--origam-table__cell---padding-block, 12px) + 1.5em);
|
|
311
|
+
|
|
312
|
+
&::after {
|
|
313
|
+
inset-block: auto;
|
|
314
|
+
inset-block-start: 50%;
|
|
315
|
+
inset-inline: auto;
|
|
316
|
+
inset-inline-start: var(--origam-table__cell---padding-inline, 16px);
|
|
317
|
+
block-size: var(--origam-skeleton---text-height);
|
|
318
|
+
inline-size: 70%;
|
|
319
|
+
translate: 0 -50%;
|
|
320
|
+
border-radius: var(--origam-skeleton---border-radius-pill);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
&--end::after {
|
|
324
|
+
inset-inline-start: auto;
|
|
325
|
+
inset-inline-end: var(--origam-table__cell---padding-inline, 16px);
|
|
326
|
+
inline-size: 40%;
|
|
295
327
|
}
|
|
328
|
+
|
|
329
|
+
&--control::after {
|
|
330
|
+
block-size: var(--origam-skeleton---circular-size);
|
|
331
|
+
inline-size: var(--origam-skeleton---circular-size);
|
|
332
|
+
border-radius: var(--origam-skeleton---border-radius);
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
tr:nth-child(2n) > .origam-data-table-rows__skeleton-cell--text::after {
|
|
337
|
+
inline-size: 52%;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
tr:nth-child(3n) > .origam-data-table-rows__skeleton-cell--text::after {
|
|
341
|
+
inline-size: 84%;
|
|
296
342
|
}
|
|
297
343
|
</style>
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
|
|
14
14
|
<template v-if="hasLoading">
|
|
15
15
|
<slot name="loader">
|
|
16
|
-
<div
|
|
16
|
+
<div
|
|
17
|
+
v-if="loaderConfig.kind !== 'skeleton'"
|
|
18
|
+
class="origam-expansion-panel__loader"
|
|
19
|
+
>
|
|
17
20
|
<origam-progress
|
|
18
|
-
v-if="loaderConfig.kind !== 'skeleton'"
|
|
19
21
|
:active="true"
|
|
20
22
|
:indeterminate="loaderConfig.indeterminate"
|
|
21
23
|
:model-value="loaderConfig.modelValue"
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
<div class="origam-expansion-panel-content__wrapper">
|
|
14
14
|
<template v-if="loaderConfig.isActive && loaderConfig.kind === 'skeleton'">
|
|
15
15
|
<slot name="loader">
|
|
16
|
-
<origam-skeleton
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
<origam-skeleton-group v-bind="skeletonOverrides.group">
|
|
17
|
+
<origam-skeleton variant="text" v-bind="skeletonOverrides.block"/>
|
|
18
|
+
<origam-skeleton variant="text" v-bind="skeletonOverrides.block"/>
|
|
19
|
+
<origam-skeleton variant="text" class="origam-expansion-panel-content__skeleton-line--last" v-bind="skeletonOverrides.block"/>
|
|
20
|
+
</origam-skeleton-group>
|
|
19
21
|
</slot>
|
|
20
22
|
</template>
|
|
21
23
|
|
|
@@ -57,6 +59,7 @@ import { computed, inject, StyleValue, toRef, watchEffect } from "vue";
|
|
|
57
59
|
import OrigamExpandY from "../Transition/OrigamExpandY.vue";
|
|
58
60
|
import OrigamProgress from "../Progress/OrigamProgress.vue";
|
|
59
61
|
import OrigamSkeleton from "../Skeleton/OrigamSkeleton.vue";
|
|
62
|
+
import OrigamSkeletonGroup from "../Skeleton/OrigamSkeletonGroup.vue";
|
|
60
63
|
import vContrast from "../../directives/Contrast/contrast.directive";
|
|
61
64
|
import { useBorder } from "../../composables/Commons/border.composable";
|
|
62
65
|
import { useBothColor } from "../../composables/Commons/bothColor.composable";
|
|
@@ -69,6 +72,7 @@ import { useProps } from "../../composables/Commons/props.composable";
|
|
|
69
72
|
import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
70
73
|
import { useStyle } from "../../composables/Commons/style.composable";
|
|
71
74
|
import { LOADER_KIND } from "../../enums/Commons/loader.enum";
|
|
75
|
+
import { splitSkeletonOverrides } from "../../utils/Skeleton/skeleton.util";
|
|
72
76
|
import { PROGRESS_TYPE } from "../../enums/Progress/progress.enum";
|
|
73
77
|
import { ORIGAM_EXPANSION_PANEL_KEY } from "../../consts/ExpansionPanel/expansion-panel.const";
|
|
74
78
|
const props = defineProps({
|
|
@@ -153,6 +157,7 @@ const isComponent = computed(() => {
|
|
|
153
157
|
return typeof props.content !== "string";
|
|
154
158
|
});
|
|
155
159
|
const { loaderClasses, loaderConfig } = useLoader(props, LOADER_KIND.LINE);
|
|
160
|
+
const skeletonOverrides = computed(() => splitSkeletonOverrides(loaderConfig.value.overrides, props.loadingText));
|
|
156
161
|
const { borderClasses, borderStyles } = useBorder(props);
|
|
157
162
|
const { paddingClasses, paddingStyles } = usePadding(props);
|
|
158
163
|
const { marginClasses, marginStyles } = useMargin(props);
|
|
@@ -211,5 +216,9 @@ defineExpose({
|
|
|
211
216
|
flex: var(--origam-expansion-panel__content---flex, 1 1 auto);
|
|
212
217
|
max-width: var(--origam-expansion-panel__content---max-width, 100%);
|
|
213
218
|
}
|
|
219
|
+
|
|
220
|
+
&__skeleton-line--last.origam-skeleton {
|
|
221
|
+
width: 60%;
|
|
222
|
+
}
|
|
214
223
|
}
|
|
215
224
|
</style>
|
|
@@ -69,6 +69,7 @@ import { useRounded } from "../../composables/Commons/rounded.composable";
|
|
|
69
69
|
import { useSize } from "../../composables/Commons/size.composable";
|
|
70
70
|
import { ORIGAM_SKELETON_GROUP_KEY } from "../../consts/Skeleton/skeleton.const";
|
|
71
71
|
import { SKELETON_ANIMATION, SKELETON_VARIANT } from "../../enums/Skeleton/skeleton.enum";
|
|
72
|
+
import { getSkeletonHostClasses } from "../../utils/Skeleton/skeleton.util";
|
|
72
73
|
import { computed, inject, toRef } from "vue";
|
|
73
74
|
defineOptions({ inheritAttrs: false });
|
|
74
75
|
const props = defineProps({
|
|
@@ -120,13 +121,7 @@ const a11yAttrs = computed(() => {
|
|
|
120
121
|
});
|
|
121
122
|
const isListItem = computed(() => props.variant === SKELETON_VARIANT.LIST_ITEM);
|
|
122
123
|
const isCard = computed(() => props.variant === SKELETON_VARIANT.CARD);
|
|
123
|
-
const animationClasses = computed(() =>
|
|
124
|
-
"origam--skeleton",
|
|
125
|
-
{
|
|
126
|
-
"origam--skeleton-wave": animation.value === SKELETON_ANIMATION.WAVE,
|
|
127
|
-
"origam--skeleton-none": animation.value === SKELETON_ANIMATION.NONE
|
|
128
|
-
}
|
|
129
|
-
]);
|
|
124
|
+
const animationClasses = computed(() => getSkeletonHostClasses(animation.value));
|
|
130
125
|
const skeletonCircularClasses = computed(() => [
|
|
131
126
|
"origam-skeleton",
|
|
132
127
|
"origam-skeleton--circular",
|
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.DATATABLE_SELECT_STRATEGY = void 0;
|
|
6
|
+
exports.DATATABLE_SKELETON_CELL = exports.DATATABLE_SELECT_STRATEGY = void 0;
|
|
7
7
|
var DATATABLE_SELECT_STRATEGY = exports.DATATABLE_SELECT_STRATEGY = /* @__PURE__ */(DATATABLE_SELECT_STRATEGY2 => {
|
|
8
8
|
DATATABLE_SELECT_STRATEGY2["SINGLE"] = "single";
|
|
9
9
|
DATATABLE_SELECT_STRATEGY2["PAGE"] = "page";
|
|
10
10
|
DATATABLE_SELECT_STRATEGY2["ALL"] = "all";
|
|
11
11
|
return DATATABLE_SELECT_STRATEGY2;
|
|
12
|
-
})(DATATABLE_SELECT_STRATEGY || {});
|
|
12
|
+
})(DATATABLE_SELECT_STRATEGY || {});
|
|
13
|
+
var DATATABLE_SKELETON_CELL = exports.DATATABLE_SKELETON_CELL = /* @__PURE__ */(DATATABLE_SKELETON_CELL2 => {
|
|
14
|
+
DATATABLE_SKELETON_CELL2["TEXT"] = "text";
|
|
15
|
+
DATATABLE_SKELETON_CELL2["END"] = "end";
|
|
16
|
+
DATATABLE_SKELETON_CELL2["CONTROL"] = "control";
|
|
17
|
+
return DATATABLE_SKELETON_CELL2;
|
|
18
|
+
})(DATATABLE_SKELETON_CELL || {});
|
|
@@ -3,3 +3,19 @@ export declare enum DATATABLE_SELECT_STRATEGY {
|
|
|
3
3
|
PAGE = "page",
|
|
4
4
|
ALL = "all"
|
|
5
5
|
}
|
|
6
|
+
/*********************************************************
|
|
7
|
+
* DATATABLE_SKELETON_CELL
|
|
8
|
+
*
|
|
9
|
+
* @description
|
|
10
|
+
* Silhouette a placeholder cell draws, derived from the COLUMN it belongs
|
|
11
|
+
* to (the table has no column "type"; its descriptor only carries `align`
|
|
12
|
+
* and the reserved `data-table-select` / `data-table-expand` keys).
|
|
13
|
+
* `text` is a bar from the start edge, `end` a shorter bar flush with the
|
|
14
|
+
* end edge (numbers, amounts), `control` a small square (checkbox,
|
|
15
|
+
* expand chevron).
|
|
16
|
+
********************************************************/
|
|
17
|
+
export declare enum DATATABLE_SKELETON_CELL {
|
|
18
|
+
TEXT = "text",
|
|
19
|
+
END = "end",
|
|
20
|
+
CONTROL = "control"
|
|
21
|
+
}
|
|
@@ -4,3 +4,9 @@ export var DATATABLE_SELECT_STRATEGY = /* @__PURE__ */ ((DATATABLE_SELECT_STRATE
|
|
|
4
4
|
DATATABLE_SELECT_STRATEGY2["ALL"] = "all";
|
|
5
5
|
return DATATABLE_SELECT_STRATEGY2;
|
|
6
6
|
})(DATATABLE_SELECT_STRATEGY || {});
|
|
7
|
+
export var DATATABLE_SKELETON_CELL = /* @__PURE__ */ ((DATATABLE_SKELETON_CELL2) => {
|
|
8
|
+
DATATABLE_SKELETON_CELL2["TEXT"] = "text";
|
|
9
|
+
DATATABLE_SKELETON_CELL2["END"] = "end";
|
|
10
|
+
DATATABLE_SKELETON_CELL2["CONTROL"] = "control";
|
|
11
|
+
return DATATABLE_SKELETON_CELL2;
|
|
12
|
+
})(DATATABLE_SKELETON_CELL || {});
|
|
@@ -4,6 +4,7 @@ import type { IDimensionProps } from '../Commons/dimension.interface';
|
|
|
4
4
|
import type { IRoundedProps } from '../Commons/rounded.interface';
|
|
5
5
|
import type { ISizeProps } from '../Commons/size.interface';
|
|
6
6
|
import type { TSkeletonAnimation, TSkeletonVariant } from '../../types/Skeleton/skeleton.type';
|
|
7
|
+
import type { ISkeletonGroupProps } from './skeleton-group.interface';
|
|
7
8
|
export interface ISkeletonProps extends ICommonsComponentProps, IColorProps, IBgColorProps, ISizeProps, IRoundedProps, IDimensionProps {
|
|
8
9
|
variant?: TSkeletonVariant;
|
|
9
10
|
loading?: boolean;
|
|
@@ -52,3 +53,15 @@ export interface ISkeletonProps extends ICommonsComponentProps, IColorProps, IBg
|
|
|
52
53
|
********************************************************/
|
|
53
54
|
export interface ISkeletonEmits {
|
|
54
55
|
}
|
|
56
|
+
/*********************************************************
|
|
57
|
+
* ISkeletonOverrides
|
|
58
|
+
*
|
|
59
|
+
* @description
|
|
60
|
+
* Result of `splitSkeletonOverrides()`: the `loading="{ type: 'skeleton' }"`
|
|
61
|
+
* bag split between the `<OrigamSkeletonGroup>` (per zone) and each
|
|
62
|
+
* primitive it contains (per block).
|
|
63
|
+
********************************************************/
|
|
64
|
+
export interface ISkeletonOverrides {
|
|
65
|
+
group: ISkeletonGroupProps;
|
|
66
|
+
block: Pick<ISkeletonProps, 'color' | 'bgColor' | 'rounded'>;
|
|
67
|
+
}
|