@dative-gpi/foundation-shared-components 0.0.35 → 0.0.36
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/FSText.vue
CHANGED
|
@@ -662,20 +662,23 @@ export default defineComponent({
|
|
|
662
662
|
const activeFilters: { key: string, filter: FSDataTableFilter }[] = Object.keys(filters.value).reduce((acc, key) => {
|
|
663
663
|
return acc.concat(filters.value[key].filter((filter) => filter.hidden).map((filter) => ({ key, filter })));
|
|
664
664
|
}, []);
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}
|
|
669
|
-
if (innerSearch.value) {
|
|
670
|
-
if (!JSON.stringify(item).toLowerCase().includes(innerSearch.value.toString().toLowerCase())) {
|
|
665
|
+
if (props.items && props.items.length) {
|
|
666
|
+
return props.items.filter((item) => {
|
|
667
|
+
if (props.selectedOnly && !innerValue.value.includes(item[props.itemValue])) {
|
|
671
668
|
return false;
|
|
672
669
|
}
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
670
|
+
if (innerSearch.value) {
|
|
671
|
+
if (!JSON.stringify(item).toLowerCase().includes(innerSearch.value.toString().toLowerCase())) {
|
|
672
|
+
return false;
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
if (activeFilters.some(af => af.filter.filter(af.filter.value, item[af.key], item))) {
|
|
676
|
+
return false;
|
|
677
|
+
}
|
|
678
|
+
return true;
|
|
679
|
+
});
|
|
680
|
+
}
|
|
681
|
+
return [];
|
|
679
682
|
});
|
|
680
683
|
|
|
681
684
|
const headersSlots = computed((): FSDataTableColumn[] => {
|
|
@@ -811,19 +814,21 @@ export default defineComponent({
|
|
|
811
814
|
}));
|
|
812
815
|
}
|
|
813
816
|
else {
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
817
|
+
if (props.items && props.items.length) {
|
|
818
|
+
const mapToInnerValue = header.innerValue ? header.innerValue : (i: any) => i;
|
|
819
|
+
const itemValues = props.items.flatMap((item) => Array.isArray(item[key]) && item[key].length == 0 ? undefined : item[key]).map(mapToInnerValue);
|
|
820
|
+
const distinctValues = [...new Set(itemValues)];
|
|
821
|
+
|
|
822
|
+
value = distinctValues.map((dv): FSDataTableFilter => ({
|
|
823
|
+
hidden: currentFilters?.find((cf) => cf.value == (dv || null))?.hidden ?? false,
|
|
824
|
+
text: dv?.toString() ?? "—",
|
|
825
|
+
value: dv || null,
|
|
826
|
+
filter: header.methodFilter ?? ((_, property) => {
|
|
827
|
+
property = [property].flat().map(mapToInnerValue);
|
|
828
|
+
return Array.isArray(property) ? property.includes(dv) || (!dv && property.length == 0) : (!dv && !property) || dv == property;
|
|
829
|
+
})
|
|
830
|
+
}));
|
|
831
|
+
}
|
|
827
832
|
}
|
|
828
833
|
filterDictionary[key] = value.sort((v1, v2) => {
|
|
829
834
|
return v1.text.localeCompare(v2.text, undefined, { numeric: true });
|
package/composables/useColors.ts
CHANGED
|
@@ -50,7 +50,7 @@ export const useColors = () => {
|
|
|
50
50
|
const getContrasts = (color: ColorBase): ColorVariations => {
|
|
51
51
|
const themed = (Object as any).values(ColorEnum).includes(color);
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
let base = themed ? new Color(theme.colors[color as ColorEnum]) : new Color(color);
|
|
54
54
|
|
|
55
55
|
if (isGrayScale(base)) {
|
|
56
56
|
switch (color) {
|
|
@@ -60,15 +60,15 @@ export const useColors = () => {
|
|
|
60
60
|
return getColors(ColorEnum.Light);
|
|
61
61
|
default:
|
|
62
62
|
if (base.value() > 50) {
|
|
63
|
-
base.value(Math.max(base.value() - 65, 0));
|
|
63
|
+
base = base.value(Math.max(base.value() - 65, 0));
|
|
64
64
|
}
|
|
65
65
|
else {
|
|
66
|
-
base.value(Math.min(base.value() + 65, 100));
|
|
66
|
+
base = base.value(Math.min(base.value() + 65, 100));
|
|
67
67
|
}
|
|
68
68
|
break;
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
|
-
return getColors(
|
|
71
|
+
return getColors(base.hex());
|
|
72
72
|
};
|
|
73
73
|
|
|
74
74
|
const getGradients = (colors: ColorBase | ColorBase[]): ColorVariations => {
|
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.36",
|
|
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.36",
|
|
14
|
+
"@dative-gpi/foundation-shared-services": "0.0.36",
|
|
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": "6480f8ebb0980b81c6eaf46112647148d808afc3"
|
|
36
36
|
}
|