@dative-gpi/foundation-shared-components 0.0.115 → 0.0.117
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/components/FSFadeOut.vue
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
<div
|
|
3
3
|
class="fs-fade-out"
|
|
4
4
|
ref="fadeOutRef"
|
|
5
|
+
:id="elementId"
|
|
5
6
|
:style="style"
|
|
6
7
|
@scroll="debounceMasks"
|
|
7
8
|
>
|
|
@@ -15,6 +16,7 @@ import { computed, defineComponent, onMounted, onUnmounted, PropType, ref, watch
|
|
|
15
16
|
import { useBreakpoints, useColors, useDebounce } from "@dative-gpi/foundation-shared-components/composables";
|
|
16
17
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
17
18
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
19
|
+
import { uuidv4 } from "@dative-gpi/bones-ui/tools";
|
|
18
20
|
|
|
19
21
|
export default defineComponent({
|
|
20
22
|
name: "FSFadeOut",
|
|
@@ -54,6 +56,8 @@ export default defineComponent({
|
|
|
54
56
|
|
|
55
57
|
const resizeObserver = ref<ResizeObserver | null>(null);
|
|
56
58
|
|
|
59
|
+
const elementId = `id${uuidv4()}`;
|
|
60
|
+
|
|
57
61
|
const style = computed((): { [key: string] : string | null | undefined } => {
|
|
58
62
|
return {
|
|
59
63
|
"--fs-fade-out-height" : sizeToVar(props.height),
|
|
@@ -72,13 +76,13 @@ export default defineComponent({
|
|
|
72
76
|
topMaskHeight.value = "0px";
|
|
73
77
|
return;
|
|
74
78
|
}
|
|
75
|
-
if ((fadeOutRef.value as any).scrollHeight - (fadeOutRef.value as any).scrollTop - (fadeOutRef.value as any).clientHeight < 1) {
|
|
79
|
+
if ((fadeOutRef.value as any).scrollHeight - (fadeOutRef.value as any).scrollTop - (fadeOutRef.value as any).clientHeight < 1.5) {
|
|
76
80
|
bottomMaskHeight.value = "0px";
|
|
77
81
|
}
|
|
78
82
|
else {
|
|
79
83
|
bottomMaskHeight.value = sizeToVar(props.maskHeight);
|
|
80
84
|
}
|
|
81
|
-
if ((fadeOutRef.value as any).scrollTop
|
|
85
|
+
if ((fadeOutRef.value as any).scrollTop < 0.5) {
|
|
82
86
|
topMaskHeight.value = "0px";
|
|
83
87
|
}
|
|
84
88
|
else {
|
|
@@ -107,8 +111,8 @@ export default defineComponent({
|
|
|
107
111
|
debounceMasks();
|
|
108
112
|
});
|
|
109
113
|
});
|
|
110
|
-
if (document.querySelector(
|
|
111
|
-
resizeObserver.value.observe(document.querySelector(
|
|
114
|
+
if (document.querySelector(`#${elementId}`)) {
|
|
115
|
+
resizeObserver.value.observe(document.querySelector(`#${elementId}`)!);
|
|
112
116
|
}
|
|
113
117
|
});
|
|
114
118
|
|
|
@@ -122,6 +126,7 @@ export default defineComponent({
|
|
|
122
126
|
|
|
123
127
|
return {
|
|
124
128
|
fadeOutRef,
|
|
129
|
+
elementId,
|
|
125
130
|
style,
|
|
126
131
|
debounceMasks
|
|
127
132
|
};
|
|
@@ -3,21 +3,15 @@
|
|
|
3
3
|
class="fs-slide-group"
|
|
4
4
|
ref="slideGroupRef"
|
|
5
5
|
:showArrows="true"
|
|
6
|
+
:id="elementId"
|
|
6
7
|
:style="style"
|
|
7
8
|
v-bind="$attrs"
|
|
8
9
|
>
|
|
9
10
|
<template
|
|
10
11
|
#prev
|
|
11
12
|
>
|
|
12
|
-
<FSButton
|
|
13
|
-
v-if="$props.dash"
|
|
14
|
-
icon="mdi-chevron-double-left"
|
|
15
|
-
variant="icon"
|
|
16
|
-
@click="goToStart"
|
|
17
|
-
/>
|
|
18
13
|
<FSButtonPreviousIcon
|
|
19
14
|
:color="ColorEnum.Dark"
|
|
20
|
-
:disabled="false"
|
|
21
15
|
@click="goToPrev"
|
|
22
16
|
/>
|
|
23
17
|
</template>
|
|
@@ -38,15 +32,9 @@
|
|
|
38
32
|
>
|
|
39
33
|
<FSButtonNextIcon
|
|
40
34
|
:color="ColorEnum.Dark"
|
|
41
|
-
:
|
|
35
|
+
:class="nextClasses"
|
|
42
36
|
@click="goToNext"
|
|
43
37
|
/>
|
|
44
|
-
<FSButton
|
|
45
|
-
v-if="$props.dash"
|
|
46
|
-
icon="mdi-chevron-double-right"
|
|
47
|
-
variant="icon"
|
|
48
|
-
@click="goToEnd"
|
|
49
|
-
/>
|
|
50
38
|
</template>
|
|
51
39
|
</v-slide-group>
|
|
52
40
|
</template>
|
|
@@ -57,6 +45,7 @@ import { computed, defineComponent, onMounted, onUnmounted, PropType, ref } from
|
|
|
57
45
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
58
46
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
59
47
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
48
|
+
import { uuidv4 } from "@dative-gpi/bones-ui/tools";
|
|
60
49
|
|
|
61
50
|
import FSButtonPreviousIcon from "./buttons/FSButtonPreviousIcon.vue";
|
|
62
51
|
import FSButtonNextIcon from "./buttons/FSButtonNextIcon.vue";
|
|
@@ -80,11 +69,6 @@ export default defineComponent({
|
|
|
80
69
|
required: false,
|
|
81
70
|
default: "8px"
|
|
82
71
|
},
|
|
83
|
-
dash: {
|
|
84
|
-
type: Boolean,
|
|
85
|
-
required: false,
|
|
86
|
-
default: false
|
|
87
|
-
},
|
|
88
72
|
speed: {
|
|
89
73
|
type: Number,
|
|
90
74
|
required: false,
|
|
@@ -97,23 +81,29 @@ export default defineComponent({
|
|
|
97
81
|
|
|
98
82
|
const darks = getColors(ColorEnum.Dark);
|
|
99
83
|
|
|
84
|
+
const forceActive = ref(false);
|
|
85
|
+
|
|
100
86
|
const slideGroupRef = ref<HTMLElement | null>(null);
|
|
101
87
|
const resizeObserver = ref<ResizeObserver | null>(null);
|
|
88
|
+
|
|
89
|
+
const elementId = `id${uuidv4()}`;
|
|
102
90
|
|
|
103
91
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
104
|
-
"--fs-group-
|
|
105
|
-
"--fs-group-
|
|
106
|
-
"--fs-group-
|
|
107
|
-
"--fs-group-color"
|
|
108
|
-
"--fs-group-hover-color": darks.dark
|
|
92
|
+
"--fs-group-padding" : sizeToVar(props.padding),
|
|
93
|
+
"--fs-group-gap" : sizeToVar(props.gap),
|
|
94
|
+
"--fs-group-color" : darks.light,
|
|
95
|
+
"--fs-group-hover-color" : darks.dark
|
|
109
96
|
}));
|
|
110
97
|
|
|
111
|
-
const
|
|
98
|
+
const nextClasses = computed((): string[] => {
|
|
99
|
+
const classes = ["fs-slide-group-next"];
|
|
112
100
|
if (slideGroupRef.value) {
|
|
113
|
-
(
|
|
114
|
-
|
|
101
|
+
if (forceActive.value) {
|
|
102
|
+
classes.push("fs-slide-group-next-active");
|
|
103
|
+
}
|
|
115
104
|
}
|
|
116
|
-
|
|
105
|
+
return classes;
|
|
106
|
+
});
|
|
117
107
|
|
|
118
108
|
const goToPrev = () => {
|
|
119
109
|
if (slideGroupRef.value) {
|
|
@@ -121,16 +111,10 @@ export default defineComponent({
|
|
|
121
111
|
}
|
|
122
112
|
};
|
|
123
113
|
|
|
124
|
-
const goToEnd = () => {
|
|
125
|
-
if (slideGroupRef.value) {
|
|
126
|
-
(slideGroupRef.value as any).scrollTo("next");
|
|
127
|
-
(slideGroupRef.value as any).scrollTo("next");
|
|
128
|
-
}
|
|
129
|
-
};
|
|
130
|
-
|
|
131
114
|
const goToNext = () => {
|
|
132
115
|
if (slideGroupRef.value) {
|
|
133
116
|
(slideGroupRef.value as any).scrollTo("next");
|
|
117
|
+
forceActive.value = false;
|
|
134
118
|
}
|
|
135
119
|
};
|
|
136
120
|
|
|
@@ -138,10 +122,11 @@ export default defineComponent({
|
|
|
138
122
|
resizeObserver.value = new ResizeObserver(entries => {
|
|
139
123
|
entries.forEach(() => {
|
|
140
124
|
(slideGroupRef.value as any).scrollTo("prev");
|
|
125
|
+
forceActive.value = true;
|
|
141
126
|
});
|
|
142
127
|
});
|
|
143
|
-
if (document.querySelector(
|
|
144
|
-
resizeObserver.value.observe(document.querySelector(
|
|
128
|
+
if (document.querySelector(`#${elementId}`)) {
|
|
129
|
+
resizeObserver.value.observe(document.querySelector(`#${elementId}`)!);
|
|
145
130
|
}
|
|
146
131
|
});
|
|
147
132
|
|
|
@@ -153,13 +138,13 @@ export default defineComponent({
|
|
|
153
138
|
|
|
154
139
|
return {
|
|
155
140
|
slideGroupRef,
|
|
141
|
+
nextClasses,
|
|
156
142
|
ColorEnum,
|
|
143
|
+
elementId,
|
|
157
144
|
style,
|
|
158
145
|
getChildren,
|
|
159
|
-
goToStart,
|
|
160
146
|
goToPrev,
|
|
161
|
-
goToNext
|
|
162
|
-
goToEnd
|
|
147
|
+
goToNext
|
|
163
148
|
};
|
|
164
149
|
}
|
|
165
150
|
});
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
<v-slide-group
|
|
3
3
|
class="fs-wrap-group"
|
|
4
4
|
ref="wrapGroupRef"
|
|
5
|
+
:showArrows="false"
|
|
6
|
+
:id="elementId"
|
|
5
7
|
:style="style"
|
|
6
8
|
v-bind="$attrs"
|
|
7
9
|
>
|
|
@@ -22,6 +24,7 @@ import { computed, defineComponent, onMounted, onUnmounted, PropType, ref } from
|
|
|
22
24
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
23
25
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
24
26
|
import { sizeToVar } from "@dative-gpi/foundation-shared-components/utils";
|
|
27
|
+
import { uuidv4 } from "@dative-gpi/bones-ui/tools";
|
|
25
28
|
|
|
26
29
|
export default defineComponent({
|
|
27
30
|
name: "FSWrapGroup",
|
|
@@ -46,6 +49,8 @@ export default defineComponent({
|
|
|
46
49
|
const wrapGroupRef = ref<HTMLElement | null>(null);
|
|
47
50
|
const resizeObserver = ref<ResizeObserver | null>(null);
|
|
48
51
|
|
|
52
|
+
const elementId = `id${uuidv4()}`;
|
|
53
|
+
|
|
49
54
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
50
55
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
51
56
|
"--fs-group-gap" : sizeToVar(props.gap),
|
|
@@ -59,8 +64,8 @@ export default defineComponent({
|
|
|
59
64
|
(wrapGroupRef.value as any).scrollTo("prev");
|
|
60
65
|
});
|
|
61
66
|
});
|
|
62
|
-
if (document.querySelector(
|
|
63
|
-
resizeObserver.value.observe(document.querySelector(
|
|
67
|
+
if (document.querySelector(`#${elementId}`)) {
|
|
68
|
+
resizeObserver.value.observe(document.querySelector(`#${elementId}`)!);
|
|
64
69
|
}
|
|
65
70
|
});
|
|
66
71
|
|
|
@@ -72,6 +77,7 @@ export default defineComponent({
|
|
|
72
77
|
|
|
73
78
|
return {
|
|
74
79
|
wrapGroupRef,
|
|
80
|
+
elementId,
|
|
75
81
|
style,
|
|
76
82
|
getChildren
|
|
77
83
|
};
|
|
@@ -385,7 +385,6 @@
|
|
|
385
385
|
v-if="innerRowsPerPage !== -1"
|
|
386
386
|
class="fs-data-table-pagination fs-small-input"
|
|
387
387
|
variant="slide"
|
|
388
|
-
:dash="pageOptions.length > 8"
|
|
389
388
|
:values="pageOptions"
|
|
390
389
|
:required="true"
|
|
391
390
|
v-model="innerPage"
|
|
@@ -542,7 +541,6 @@
|
|
|
542
541
|
v-if="innerRowsPerPage !== -1"
|
|
543
542
|
class="fs-data-table-pagination fs-small-input"
|
|
544
543
|
variant="slide"
|
|
545
|
-
:dash="pageOptions.length > 8"
|
|
546
544
|
:values="pageOptions"
|
|
547
545
|
:required="true"
|
|
548
546
|
v-model="innerPage"
|
|
@@ -634,6 +632,7 @@
|
|
|
634
632
|
</template>
|
|
635
633
|
<div
|
|
636
634
|
class="fs-data-table-intersection"
|
|
635
|
+
:id="elementId"
|
|
637
636
|
/>
|
|
638
637
|
</FSCol>
|
|
639
638
|
</template>
|
|
@@ -645,6 +644,7 @@ import { useRouter } from "vue-router";
|
|
|
645
644
|
import { ColorEnum, FSDataTableColumn, FSDataTableFilter, FSDataTableOrder, FSToggle } from "@dative-gpi/foundation-shared-components/models";
|
|
646
645
|
import { useBreakpoints, useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
647
646
|
import { useTranslations as useTranslationsProvider } from "@dative-gpi/bones-ui/composables";
|
|
647
|
+
import { uuidv4 } from "@dative-gpi/bones-ui/tools"
|
|
648
648
|
|
|
649
649
|
import { alphanumericSort, sizeToVar } from "../../utils";
|
|
650
650
|
|
|
@@ -841,6 +841,8 @@ export default defineComponent({
|
|
|
841
841
|
const intersectionObserver = ref<IntersectionObserver | null>(null);
|
|
842
842
|
const size = ref(props.sizeIterator);
|
|
843
843
|
|
|
844
|
+
const elementId = `id${uuidv4()}`;
|
|
845
|
+
|
|
844
846
|
const modeOptions: FSToggle[] = [
|
|
845
847
|
{ id: "table", prependIcon: "mdi-table" },
|
|
846
848
|
{ id: "iterator", prependIcon: "mdi-apps" }
|
|
@@ -1227,8 +1229,8 @@ export default defineComponent({
|
|
|
1227
1229
|
const observeIntersection = (): void => {
|
|
1228
1230
|
switch (innerMode.value) {
|
|
1229
1231
|
case "table":
|
|
1230
|
-
if (intersectionObserver.value && document.querySelector(
|
|
1231
|
-
intersectionObserver.value.unobserve(document.querySelector(
|
|
1232
|
+
if (intersectionObserver.value && document.querySelector(`#${elementId}`)) {
|
|
1233
|
+
intersectionObserver.value.unobserve(document.querySelector(`#${elementId}`)!);
|
|
1232
1234
|
}
|
|
1233
1235
|
return;
|
|
1234
1236
|
case "iterator":
|
|
@@ -1243,8 +1245,8 @@ export default defineComponent({
|
|
|
1243
1245
|
});
|
|
1244
1246
|
}, { threshold: [0.9] });
|
|
1245
1247
|
}
|
|
1246
|
-
if (document.querySelector(
|
|
1247
|
-
intersectionObserver.value.observe(document.querySelector(
|
|
1248
|
+
if (document.querySelector(`#${elementId}`)) {
|
|
1249
|
+
intersectionObserver.value.observe(document.querySelector(`#${elementId}`)!);
|
|
1248
1250
|
}
|
|
1249
1251
|
return;
|
|
1250
1252
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dative-gpi/foundation-shared-components",
|
|
3
3
|
"sideEffects": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.117",
|
|
5
5
|
"description": "",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
"author": "",
|
|
11
11
|
"license": "ISC",
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@dative-gpi/foundation-shared-domain": "0.0.
|
|
14
|
-
"@dative-gpi/foundation-shared-services": "0.0.
|
|
13
|
+
"@dative-gpi/foundation-shared-domain": "0.0.117",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.117",
|
|
15
15
|
"@fontsource/montserrat": "^5.0.16",
|
|
16
16
|
"@lexical/clipboard": "^0.12.5",
|
|
17
17
|
"@lexical/history": "^0.12.5",
|
|
@@ -32,5 +32,5 @@
|
|
|
32
32
|
"sass": "^1.69.5",
|
|
33
33
|
"sass-loader": "^13.3.2"
|
|
34
34
|
},
|
|
35
|
-
"gitHead": "
|
|
35
|
+
"gitHead": "434ff73f13f863998d707d010b4d9e2323e8391e"
|
|
36
36
|
}
|
|
@@ -138,13 +138,28 @@ $nthOverlay: 25;
|
|
|
138
138
|
.v-slide-group__prev,
|
|
139
139
|
.v-slide-group__next {
|
|
140
140
|
color: var(--fs-group-color);
|
|
141
|
-
min-width:
|
|
142
|
-
width:
|
|
141
|
+
min-width: 32px !important;
|
|
142
|
+
width: 32px !important;
|
|
143
143
|
flex: 1 1 0 !important;
|
|
144
144
|
|
|
145
145
|
@include touchscreen {
|
|
146
146
|
display: none !important;
|
|
147
147
|
}
|
|
148
|
+
|
|
149
|
+
& > .v-icon {
|
|
150
|
+
@include web {
|
|
151
|
+
font-size: 24px !important;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
@include mobile {
|
|
155
|
+
font-size: 20px !important;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.v-slide-group__next--disabled:has(.fs-slide-group-next-active) {
|
|
161
|
+
pointer-events: all !important;
|
|
162
|
+
opacity: 1 !important;
|
|
148
163
|
}
|
|
149
164
|
|
|
150
165
|
// Change color on arrows when hovered
|
package/utils/sort.ts
CHANGED
|
@@ -1,3 +1,18 @@
|
|
|
1
|
+
const asString = (value: any): string => {
|
|
2
|
+
if (value == null) {
|
|
3
|
+
return "";
|
|
4
|
+
}
|
|
5
|
+
switch (typeof value) {
|
|
6
|
+
case "string" : return value;
|
|
7
|
+
case "boolean" : return value ? '1' : '0';
|
|
8
|
+
case "number" :
|
|
9
|
+
case "bigint" :
|
|
10
|
+
case "symbol" :
|
|
11
|
+
case "function": return value.toString();
|
|
12
|
+
default : return JSON.stringify(value);
|
|
13
|
+
}
|
|
14
|
+
};
|
|
15
|
+
|
|
1
16
|
export const alphanumericSort = (a: any, b: any) => {
|
|
2
17
|
if (a == null && b == null) {
|
|
3
18
|
return 0;
|
|
@@ -8,11 +23,7 @@ export const alphanumericSort = (a: any, b: any) => {
|
|
|
8
23
|
if (b == null) {
|
|
9
24
|
return 1;
|
|
10
25
|
}
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
if (typeof(b) !== 'string') {
|
|
15
|
-
b = JSON.stringify(b);
|
|
16
|
-
}
|
|
26
|
+
a = asString(a);
|
|
27
|
+
b = asString(b);
|
|
17
28
|
return a.localeCompare(b, undefined, { numeric: true });
|
|
18
|
-
}
|
|
29
|
+
};
|