@dative-gpi/foundation-shared-components 0.0.112 → 0.0.114
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/FSForm.vue +13 -1
- package/components/FSSlideGroup.vue +21 -1
- package/components/FSWrapGroup.vue +20 -2
- package/components/autocompletes/FSAutocompleteTimeZone.vue +6 -0
- package/components/lists/FSDataTableUI.vue +18 -21
- package/package.json +4 -4
- package/styles/components/index.scss +0 -1
- package/styles/globals/overrides.scss +11 -0
- package/styles/components/fs_toggle_set.scss +0 -4
package/components/FSForm.vue
CHANGED
|
@@ -55,6 +55,16 @@ export default defineComponent({
|
|
|
55
55
|
emit("update:modelValue", !!((formRef.value as any).isValid ?? true));
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
+
const reset = () => {
|
|
59
|
+
submitted.value = false;
|
|
60
|
+
(formRef.value as any).reset();
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const resetValidation = () => {
|
|
64
|
+
submitted.value = false;
|
|
65
|
+
(formRef.value as any).resetValidation();
|
|
66
|
+
};
|
|
67
|
+
|
|
58
68
|
provide("validateOn", validateOn);
|
|
59
69
|
provide("submitted", submitted);
|
|
60
70
|
|
|
@@ -62,8 +72,10 @@ export default defineComponent({
|
|
|
62
72
|
validateOn,
|
|
63
73
|
submitted,
|
|
64
74
|
formRef,
|
|
75
|
+
reset,
|
|
76
|
+
validate,
|
|
65
77
|
onSubmit,
|
|
66
|
-
|
|
78
|
+
resetValidation
|
|
67
79
|
};
|
|
68
80
|
}
|
|
69
81
|
});
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
/>
|
|
18
18
|
<FSButtonPreviousIcon
|
|
19
19
|
:color="ColorEnum.Dark"
|
|
20
|
+
:disabled="false"
|
|
20
21
|
@click="goToPrev"
|
|
21
22
|
/>
|
|
22
23
|
</template>
|
|
@@ -37,6 +38,7 @@
|
|
|
37
38
|
>
|
|
38
39
|
<FSButtonNextIcon
|
|
39
40
|
:color="ColorEnum.Dark"
|
|
41
|
+
:disabled="false"
|
|
40
42
|
@click="goToNext"
|
|
41
43
|
/>
|
|
42
44
|
<FSButton
|
|
@@ -50,7 +52,7 @@
|
|
|
50
52
|
</template>
|
|
51
53
|
|
|
52
54
|
<script lang="ts">
|
|
53
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
55
|
+
import { computed, defineComponent, onMounted, onUnmounted, PropType, ref } from "vue";
|
|
54
56
|
|
|
55
57
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
56
58
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -96,6 +98,7 @@ export default defineComponent({
|
|
|
96
98
|
const darks = getColors(ColorEnum.Dark);
|
|
97
99
|
|
|
98
100
|
const slideGroupRef = ref<HTMLElement | null>(null);
|
|
101
|
+
const resizeObserver = ref<ResizeObserver | null>(null);
|
|
99
102
|
|
|
100
103
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
101
104
|
"--fs-group-arrows-width": props.dash ? "52px" : "32px",
|
|
@@ -131,6 +134,23 @@ export default defineComponent({
|
|
|
131
134
|
}
|
|
132
135
|
};
|
|
133
136
|
|
|
137
|
+
onMounted((): void => {
|
|
138
|
+
resizeObserver.value = new ResizeObserver(entries => {
|
|
139
|
+
entries.forEach(() => {
|
|
140
|
+
(slideGroupRef.value as any).scrollTo("prev");
|
|
141
|
+
});
|
|
142
|
+
});
|
|
143
|
+
if (document.querySelector(".fs-slide-group")) {
|
|
144
|
+
resizeObserver.value.observe(document.querySelector(".fs-slide-group")!);
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
onUnmounted((): void => {
|
|
149
|
+
if (resizeObserver.value) {
|
|
150
|
+
resizeObserver.value.disconnect();
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
|
|
134
154
|
return {
|
|
135
155
|
slideGroupRef,
|
|
136
156
|
ColorEnum,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
</template>
|
|
18
18
|
|
|
19
19
|
<script lang="ts">
|
|
20
|
-
import { computed, defineComponent, PropType, ref } from "vue";
|
|
20
|
+
import { computed, defineComponent, onMounted, onUnmounted, PropType, ref } from "vue";
|
|
21
21
|
|
|
22
22
|
import { useColors, useSlots } from "@dative-gpi/foundation-shared-components/composables";
|
|
23
23
|
import { ColorEnum } from "@dative-gpi/foundation-shared-components/models";
|
|
@@ -43,7 +43,8 @@ export default defineComponent({
|
|
|
43
43
|
|
|
44
44
|
const darks = getColors(ColorEnum.Dark);
|
|
45
45
|
|
|
46
|
-
const wrapGroupRef = ref(null);
|
|
46
|
+
const wrapGroupRef = ref<HTMLElement | null>(null);
|
|
47
|
+
const resizeObserver = ref<ResizeObserver | null>(null);
|
|
47
48
|
|
|
48
49
|
const style = computed((): { [key: string] : string | null | undefined } => ({
|
|
49
50
|
"--fs-group-padding" : sizeToVar(props.padding),
|
|
@@ -52,6 +53,23 @@ export default defineComponent({
|
|
|
52
53
|
"--fs-group-hover-color": darks.dark
|
|
53
54
|
}));
|
|
54
55
|
|
|
56
|
+
onMounted((): void => {
|
|
57
|
+
resizeObserver.value = new ResizeObserver(entries => {
|
|
58
|
+
entries.forEach(() => {
|
|
59
|
+
(wrapGroupRef.value as any).scrollTo("prev");
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
if (document.querySelector(".fs-wrap-group")) {
|
|
63
|
+
resizeObserver.value.observe(document.querySelector(".fs-wrap-group")!);
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
onUnmounted((): void => {
|
|
68
|
+
if (resizeObserver.value) {
|
|
69
|
+
resizeObserver.value.disconnect();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
|
|
55
73
|
return {
|
|
56
74
|
wrapGroupRef,
|
|
57
75
|
style,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<FSAutocompleteField
|
|
3
3
|
:toggleSet="!$props.toggleSetDisabled && toggleSet"
|
|
4
|
+
:customFilter="customFilter"
|
|
4
5
|
:multiple="$props.multiple"
|
|
5
6
|
:loading="loading"
|
|
6
7
|
:items="timeZones"
|
|
@@ -127,6 +128,10 @@ export default defineComponent({
|
|
|
127
128
|
return getManyTimeZones({ ...props.timeZoneFilters, search: search ?? undefined });
|
|
128
129
|
};
|
|
129
130
|
|
|
131
|
+
const customFilter = (_: any, search: string, item: any): boolean => {
|
|
132
|
+
return item.raw.id.toLowerCase().includes(search.toLowerCase());
|
|
133
|
+
};
|
|
134
|
+
|
|
130
135
|
const { toggleSet, search, init, onUpdate } = useAutocomplete(
|
|
131
136
|
timeZones,
|
|
132
137
|
[() => props.timeZoneFilters],
|
|
@@ -142,6 +147,7 @@ export default defineComponent({
|
|
|
142
147
|
toggleSet,
|
|
143
148
|
loading,
|
|
144
149
|
search,
|
|
150
|
+
customFilter,
|
|
145
151
|
onUpdate
|
|
146
152
|
};
|
|
147
153
|
}
|
|
@@ -124,7 +124,7 @@
|
|
|
124
124
|
:class="classes"
|
|
125
125
|
:page="innerPage"
|
|
126
126
|
:itemsPerPage="innerRowsPerPage"
|
|
127
|
-
:modelValue="
|
|
127
|
+
:modelValue="$props.modelValue"
|
|
128
128
|
@auxclick:row="onClickRow"
|
|
129
129
|
@click:row="onClickRow"
|
|
130
130
|
@update:sortBy="innerSortBy = $event ? $event[0] : null"
|
|
@@ -167,7 +167,7 @@
|
|
|
167
167
|
width="hug"
|
|
168
168
|
>
|
|
169
169
|
<FSCheckbox
|
|
170
|
-
:modelValue="
|
|
170
|
+
:modelValue="$props.modelValue.includes(props.item[$props.itemValue])"
|
|
171
171
|
@update:modelValue="toggleSelect(props.item)"
|
|
172
172
|
/>
|
|
173
173
|
</FSRow>
|
|
@@ -237,8 +237,8 @@
|
|
|
237
237
|
>
|
|
238
238
|
<FSCheckbox
|
|
239
239
|
v-if="$props.showSelect"
|
|
240
|
-
:modelValue="props.item.items.every((item) =>
|
|
241
|
-
:indeterminate="
|
|
240
|
+
:modelValue="props.item.items.every((item) => $props.modelValue.includes(item.key))"
|
|
241
|
+
:indeterminate="$props.modelValue.some((id) => props.item.items.some((item) => item.key === id)) && !props.item.items.every((item) => $props.modelValue.includes(item.key))"
|
|
242
242
|
@update:modelValue="toggleSelectGroup(props.item)"
|
|
243
243
|
/>
|
|
244
244
|
<FSText>
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
:color="$props.color"
|
|
442
442
|
:item="item.raw"
|
|
443
443
|
:key="index"
|
|
444
|
-
:modelValue="
|
|
444
|
+
:modelValue="$props.modelValue.includes(item.raw[$props.itemValue])"
|
|
445
445
|
@update:modelValue="toggleSelect"
|
|
446
446
|
>
|
|
447
447
|
<template
|
|
@@ -591,7 +591,7 @@
|
|
|
591
591
|
:color="$props.color"
|
|
592
592
|
:item="item.raw"
|
|
593
593
|
:key="index"
|
|
594
|
-
:modelValue="
|
|
594
|
+
:modelValue="$props.modelValue.includes(item.raw[$props.itemValue])"
|
|
595
595
|
@update:modelValue="toggleSelect"
|
|
596
596
|
>
|
|
597
597
|
<template
|
|
@@ -831,7 +831,6 @@ export default defineComponent({
|
|
|
831
831
|
const filters = ref<{ [key: string]: FSDataTableFilter[] }>({});
|
|
832
832
|
const innerSearch: Ref<string | null> = ref(null);
|
|
833
833
|
const innerRowsPerPage = ref(props.rowsPerPage);
|
|
834
|
-
const innerValue = ref(props.modelValue);
|
|
835
834
|
const innerSortBy = ref(props.sortBy);
|
|
836
835
|
const innerMode = ref(props.mode);
|
|
837
836
|
const innerPage = ref(props.page);
|
|
@@ -976,7 +975,7 @@ export default defineComponent({
|
|
|
976
975
|
}, [] as { key: string, filter: FSDataTableFilter }[]);
|
|
977
976
|
if (props.items && props.items.length) {
|
|
978
977
|
return props.items.filter((item) => {
|
|
979
|
-
if (props.selectedOnly && !
|
|
978
|
+
if (props.selectedOnly && !props.modelValue.includes(item[props.itemValue])) {
|
|
980
979
|
return false;
|
|
981
980
|
}
|
|
982
981
|
if (innerSearch.value) {
|
|
@@ -1055,38 +1054,37 @@ export default defineComponent({
|
|
|
1055
1054
|
|
|
1056
1055
|
const toggleSelectAll = (allSelected: boolean): void => {
|
|
1057
1056
|
if (allSelected) {
|
|
1058
|
-
|
|
1057
|
+
emit("update:modelValue", []);
|
|
1059
1058
|
}
|
|
1060
1059
|
else {
|
|
1061
|
-
|
|
1060
|
+
emit("update:modelValue", innerItems.value.map((item) => item[props.itemValue]));
|
|
1062
1061
|
}
|
|
1063
|
-
emit("update:modelValue", innerValue.value);
|
|
1064
1062
|
};
|
|
1065
1063
|
|
|
1066
1064
|
const toggleSelectGroup = (group: any): void => {
|
|
1067
|
-
if (group.items.every((item: any) =>
|
|
1068
|
-
|
|
1065
|
+
if (group.items.every((item: any) => props.modelValue.includes(item.key))) {
|
|
1066
|
+
emit("update:modelValue", props.modelValue.filter((id) => !group.items.some((item: any) => item.key === id)));
|
|
1069
1067
|
}
|
|
1070
1068
|
else {
|
|
1071
|
-
|
|
1069
|
+
emit("update:modelValue", [...new Set(props.modelValue.concat(group.items.map((item: any) => item.key)))]);
|
|
1072
1070
|
}
|
|
1073
|
-
emit("update:modelValue", innerValue.value);
|
|
1074
1071
|
};
|
|
1075
1072
|
|
|
1076
1073
|
const toggleSelect = (item: any): void => {
|
|
1077
|
-
|
|
1074
|
+
let values = props.modelValue.slice();
|
|
1075
|
+
const index = values.indexOf(item[props.itemValue]);
|
|
1078
1076
|
if (index > -1) {
|
|
1079
|
-
|
|
1077
|
+
values.splice(index, 1);
|
|
1080
1078
|
}
|
|
1081
1079
|
else {
|
|
1082
1080
|
if (props.singleSelect) {
|
|
1083
|
-
|
|
1081
|
+
values = [item[props.itemValue]];
|
|
1084
1082
|
}
|
|
1085
1083
|
else {
|
|
1086
|
-
|
|
1084
|
+
values.push(item[props.itemValue]);
|
|
1087
1085
|
}
|
|
1088
1086
|
}
|
|
1089
|
-
emit("update:modelValue",
|
|
1087
|
+
emit("update:modelValue", values);
|
|
1090
1088
|
};
|
|
1091
1089
|
|
|
1092
1090
|
const toggleFilter = (header: string, value: FSDataTableFilter[]): void => {
|
|
@@ -1461,7 +1459,6 @@ export default defineComponent({
|
|
|
1461
1459
|
innerItems,
|
|
1462
1460
|
headersSlots,
|
|
1463
1461
|
itemsSlots,
|
|
1464
|
-
innerValue,
|
|
1465
1462
|
classes,
|
|
1466
1463
|
style,
|
|
1467
1464
|
size,
|
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.114",
|
|
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.114",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.114",
|
|
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": "10b5d9cd947ab4de3f652d69bee6e2ec4f6a3d37"
|
|
36
36
|
}
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
.v-input {
|
|
31
31
|
padding: 0px !important;
|
|
32
32
|
|
|
33
|
+
&.fs-small-input {
|
|
34
|
+
flex: 0 0 auto;
|
|
35
|
+
}
|
|
36
|
+
|
|
33
37
|
&:not(.v-checkbox):not(.v-slider):not(.fs-small-input) {
|
|
34
38
|
min-width: 200px;
|
|
35
39
|
width: 100%;
|
|
@@ -121,6 +125,13 @@ $nthOverlay: 25;
|
|
|
121
125
|
}
|
|
122
126
|
|
|
123
127
|
/***** Applies to all slide groups (FSTabs, FSSlideGroup, FSWrapGroup) *****/
|
|
128
|
+
.fs-slide-group {
|
|
129
|
+
max-width: 100%;
|
|
130
|
+
|
|
131
|
+
& > .v-slide-group__container > .v-slide-group__content {
|
|
132
|
+
margin: 0 2px 0.2px 0 !important;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
124
135
|
|
|
125
136
|
// On touchscreen, hide arrows
|
|
126
137
|
// Otherwise show small ones with base text color
|