udp-react-enterprise-component-library 26.2.0-beta.0 → 26.2.0-beta.2
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/dist/.tsbuildinfo +1 -1
- package/dist/udp/tags/useTags.d.ts +19 -9
- package/dist/udp/tags/useTags.d.ts.map +1 -1
- package/dist/udp/tags/useTags.js +69 -34
- package/dist/udp/tags/useTags.js.map +1 -1
- package/dist/udp/tags/useTags.mjs +91 -27
- package/dist/udp/tags/useTags.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,11 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
export interface
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import type { UdpTag } from 'udp-stencil-component-library';
|
|
2
|
+
export interface UseTagsResult {
|
|
3
|
+
tagMap: ReadonlyMap<string, UdpTag[]>;
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
error: Error | null;
|
|
6
6
|
}
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Fetch and cache tag associations for every record of a single entity type.
|
|
9
|
+
*
|
|
10
|
+
* Pass a type-only prefix ending in `|` — e.g.
|
|
11
|
+
* `Univerus.Unity.Starter.Project.Models.ChargeCodeTask|`.
|
|
12
|
+
*
|
|
13
|
+
* Returns a `Map<entityId, UdpTag[]>` keyed by the GUID portion of the
|
|
14
|
+
* business key. The query is shared across the app via TanStack Query, so
|
|
15
|
+
* multiple components calling this hook with the same prefix dedupe to a
|
|
16
|
+
* single request and stay in sync on invalidation.
|
|
17
|
+
*/
|
|
18
|
+
export declare const useTags: (entityBusinessKeyPrefix: string, options?: {
|
|
19
|
+
enabled?: boolean;
|
|
20
|
+
}) => UseTagsResult;
|
|
11
21
|
//# sourceMappingURL=useTags.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTags.d.ts","sourceRoot":"","sources":["../../../src/udp/tags/useTags.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useTags.d.ts","sourceRoot":"","sources":["../../../src/udp/tags/useTags.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,MAAM,EAEP,MAAM,yCAAyC,CAAC;AA8DjD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IACtC,SAAS,EAAE,OAAO,CAAC;IACnB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,OAAO;;mBAgBnB,CAAC"}
|
package/dist/udp/tags/useTags.js
CHANGED
|
@@ -1,40 +1,75 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const
|
|
1
|
+
import { useQuery } from '@tanstack/react-query';
|
|
2
|
+
import { ConfigService } from 'udp-react-stencil-component-library';
|
|
3
|
+
import { apiMutate } from '../../utilities/useAxiosMutate';
|
|
4
|
+
const TAG_ASSOCIATION_ENDPOINT = 'udpTagAssociation/search';
|
|
5
|
+
const BASE_SEARCH_PAYLOAD = {
|
|
6
|
+
pageNumber: 1,
|
|
7
|
+
pageSize: 200,
|
|
8
|
+
filterElements: [],
|
|
9
|
+
filterGroups: [],
|
|
10
|
+
orderElements: [],
|
|
11
|
+
groupingType: '',
|
|
12
|
+
groupProperty: [],
|
|
13
|
+
groupOperationList: [],
|
|
14
|
+
eagerLoad: true,
|
|
15
|
+
logicalSearchOperator: 1,
|
|
16
|
+
};
|
|
17
|
+
const EMPTY_MAP = new Map();
|
|
18
|
+
const fetchTagAssociations = async (entityBusinessKeyPrefix) => {
|
|
19
|
+
var _a;
|
|
20
|
+
var _b;
|
|
21
|
+
const res = (await apiMutate(ConfigService.productV1ApiUrl, TAG_ASSOCIATION_ENDPOINT, { method: 'post' }, {
|
|
22
|
+
data: Object.assign(Object.assign({}, BASE_SEARCH_PAYLOAD), { getAll: true, filterElements: [
|
|
23
|
+
{
|
|
24
|
+
searchField: 'entityBusinessKey',
|
|
25
|
+
searchOperator: 'STARTSWITH',
|
|
26
|
+
searchValue: entityBusinessKeyPrefix,
|
|
27
|
+
},
|
|
28
|
+
] }),
|
|
29
|
+
}));
|
|
30
|
+
return (_b = (_a = res === null || res === void 0 ? void 0 : res.data) === null || _a === void 0 ? void 0 : _a.pageList) !== null && _b !== void 0 ? _b : [];
|
|
31
|
+
};
|
|
32
|
+
const buildTagMap = (associations) => {
|
|
5
33
|
var _a;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
34
|
+
const map = new Map();
|
|
35
|
+
for (const a of associations) {
|
|
36
|
+
const id = (_a = a.entityBusinessKey) === null || _a === void 0 ? void 0 : _a.split('|')[1];
|
|
37
|
+
const tag = a.udpTagAssociationUdpTag;
|
|
38
|
+
if (!id || !tag)
|
|
39
|
+
continue;
|
|
40
|
+
const existing = map.get(id);
|
|
41
|
+
if (existing) {
|
|
42
|
+
existing.push(tag);
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
map.set(id, [tag]);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
return map;
|
|
9
49
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
* Use this when the caller needs filters beyond a simple entity-key prefix.
|
|
30
|
-
*/
|
|
31
|
-
const searchTagAssociations = useCallback(async (search) => {
|
|
32
|
-
const response = await SearchUtilities.executeSearch(search, TAG_ASSOCIATION_TABLE);
|
|
33
|
-
return unwrap(response);
|
|
34
|
-
}, []);
|
|
50
|
+
/**
|
|
51
|
+
* Fetch and cache tag associations for every record of a single entity type.
|
|
52
|
+
*
|
|
53
|
+
* Pass a type-only prefix ending in `|` — e.g.
|
|
54
|
+
* `Univerus.Unity.Starter.Project.Models.ChargeCodeTask|`.
|
|
55
|
+
*
|
|
56
|
+
* Returns a `Map<entityId, UdpTag[]>` keyed by the GUID portion of the
|
|
57
|
+
* business key. The query is shared across the app via TanStack Query, so
|
|
58
|
+
* multiple components calling this hook with the same prefix dedupe to a
|
|
59
|
+
* single request and stay in sync on invalidation.
|
|
60
|
+
*/
|
|
61
|
+
export const useTags = (entityBusinessKeyPrefix, options) => {
|
|
62
|
+
var _a;
|
|
63
|
+
const query = useQuery({
|
|
64
|
+
queryKey: [TAG_ASSOCIATION_ENDPOINT, entityBusinessKeyPrefix],
|
|
65
|
+
queryFn: () => fetchTagAssociations(entityBusinessKeyPrefix),
|
|
66
|
+
enabled: (options === null || options === void 0 ? void 0 : options.enabled) !== false && !!entityBusinessKeyPrefix,
|
|
67
|
+
select: buildTagMap,
|
|
68
|
+
});
|
|
35
69
|
return {
|
|
36
|
-
|
|
37
|
-
|
|
70
|
+
tagMap: (_a = query.data) !== null && _a !== void 0 ? _a : EMPTY_MAP,
|
|
71
|
+
isLoading: query.isLoading,
|
|
72
|
+
error: query.error,
|
|
38
73
|
};
|
|
39
74
|
};
|
|
40
75
|
//# sourceMappingURL=useTags.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTags.js","sourceRoot":"","sources":["../../../src/udp/tags/useTags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"useTags.js","sourceRoot":"","sources":["../../../src/udp/tags/useTags.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,+CAA+C,CAAC;AAK9E,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAE3D,MAAM,wBAAwB,GAAG,0BAA0B,CA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AC,GAAG,CAAC,EAAE,CAAC,CAAC;QAC7B,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QACrB,CAAC;aAAM,CAAC;YACN,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;QACrB,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AAAA,CACZ,CAAC;AAQF;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CACrB,uBAA+B,EAC/B,OAA+B,EAChB,EAAE,CAAC;;IAClB,MAAM,KAAK,GAAG,QAAQ,CAAC;QACrB,QAAQ,EAAE,CAAC,wBAAwB,EAAE,uBAAuB,CAAC;QAC7D,OAAO,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,uBAAuB,CAAC;QAC5D,OAAO,EAAE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,MAAK,KAAK,IAAI,CAAC,CAAC,uBAAuB;QAChE,MAAM,EAAE,WAAW;KACpB,CAAC,CAAC;IAEH,OAAO;QACL,MAAM,QAAE,KAAK,CAAC,IAAI,mCAAI,SAAS;QAC/B,SAAS,EAAE,KAAK,CAAC,SAAS;QAC1B,KAAK,EAAE,KAAK,CAAC,KAAK;KACnB,CAAC;AAAA,CACH,CAAC"}
|
|
@@ -1,36 +1,100 @@
|
|
|
1
|
+
import { apiMutate } from "../../utilities/useAxiosMutate.mjs";
|
|
1
2
|
import { c } from "react-compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
+
import { ConfigService } from "udp-react-stencil-component-library";
|
|
4
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
5
|
//#region src/udp/tags/useTags.ts
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const TAG_ASSOCIATION_ENDPOINT = "udpTagAssociation/search";
|
|
7
|
+
const BASE_SEARCH_PAYLOAD = {
|
|
8
|
+
pageNumber: 1,
|
|
9
|
+
pageSize: 200,
|
|
10
|
+
filterElements: [],
|
|
11
|
+
filterGroups: [],
|
|
12
|
+
orderElements: [],
|
|
13
|
+
groupingType: "",
|
|
14
|
+
groupProperty: [],
|
|
15
|
+
groupOperationList: [],
|
|
16
|
+
eagerLoad: true,
|
|
17
|
+
logicalSearchOperator: 1
|
|
8
18
|
};
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
const EMPTY_MAP = /* @__PURE__ */ new Map();
|
|
20
|
+
const fetchTagAssociations = async (entityBusinessKeyPrefix) => {
|
|
21
|
+
return (await apiMutate(ConfigService.productV1ApiUrl, TAG_ASSOCIATION_ENDPOINT, { method: "post" }, { data: {
|
|
22
|
+
...BASE_SEARCH_PAYLOAD,
|
|
23
|
+
getAll: true,
|
|
24
|
+
filterElements: [{
|
|
25
|
+
searchField: "entityBusinessKey",
|
|
26
|
+
searchOperator: "STARTSWITH",
|
|
27
|
+
searchValue: entityBusinessKeyPrefix
|
|
28
|
+
}]
|
|
29
|
+
} }))?.data?.pageList ?? [];
|
|
30
|
+
};
|
|
31
|
+
const buildTagMap = (associations) => {
|
|
32
|
+
const map = /* @__PURE__ */ new Map();
|
|
33
|
+
for (const a of associations) {
|
|
34
|
+
const id = a.entityBusinessKey?.split("|")[1];
|
|
35
|
+
const tag = a.udpTagAssociationUdpTag;
|
|
36
|
+
if (!id || !tag) continue;
|
|
37
|
+
const existing = map.get(id);
|
|
38
|
+
if (existing) existing.push(tag);
|
|
39
|
+
else map.set(id, [tag]);
|
|
40
|
+
}
|
|
41
|
+
return map;
|
|
42
|
+
};
|
|
43
|
+
/**
|
|
44
|
+
* Fetch and cache tag associations for every record of a single entity type.
|
|
45
|
+
*
|
|
46
|
+
* Pass a type-only prefix ending in `|` — e.g.
|
|
47
|
+
* `Univerus.Unity.Starter.Project.Models.ChargeCodeTask|`.
|
|
48
|
+
*
|
|
49
|
+
* Returns a `Map<entityId, UdpTag[]>` keyed by the GUID portion of the
|
|
50
|
+
* business key. The query is shared across the app via TanStack Query, so
|
|
51
|
+
* multiple components calling this hook with the same prefix dedupe to a
|
|
52
|
+
* single request and stay in sync on invalidation.
|
|
53
|
+
*/
|
|
54
|
+
const useTags = (entityBusinessKeyPrefix, options) => {
|
|
55
|
+
const $ = c(11);
|
|
13
56
|
let t0;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
57
|
+
let t1;
|
|
58
|
+
if ($[0] !== entityBusinessKeyPrefix) {
|
|
59
|
+
t0 = [TAG_ASSOCIATION_ENDPOINT, entityBusinessKeyPrefix];
|
|
60
|
+
t1 = () => fetchTagAssociations(entityBusinessKeyPrefix);
|
|
61
|
+
$[0] = entityBusinessKeyPrefix;
|
|
62
|
+
$[1] = t0;
|
|
63
|
+
$[2] = t1;
|
|
64
|
+
} else {
|
|
65
|
+
t0 = $[1];
|
|
66
|
+
t1 = $[2];
|
|
67
|
+
}
|
|
68
|
+
const t2 = options?.enabled !== false && !!entityBusinessKeyPrefix;
|
|
69
|
+
let t3;
|
|
70
|
+
if ($[3] !== t0 || $[4] !== t1 || $[5] !== t2) {
|
|
71
|
+
t3 = {
|
|
72
|
+
queryKey: t0,
|
|
73
|
+
queryFn: t1,
|
|
74
|
+
enabled: t2,
|
|
75
|
+
select: buildTagMap
|
|
76
|
+
};
|
|
77
|
+
$[3] = t0;
|
|
78
|
+
$[4] = t1;
|
|
79
|
+
$[5] = t2;
|
|
80
|
+
$[6] = t3;
|
|
81
|
+
} else t3 = $[6];
|
|
82
|
+
const query = useQuery(t3);
|
|
83
|
+
const t4 = query.data ?? EMPTY_MAP;
|
|
84
|
+
let t5;
|
|
85
|
+
if ($[7] !== query.error || $[8] !== query.isLoading || $[9] !== t4) {
|
|
86
|
+
t5 = {
|
|
87
|
+
tagMap: t4,
|
|
88
|
+
isLoading: query.isLoading,
|
|
89
|
+
error: query.error
|
|
18
90
|
};
|
|
19
|
-
$[
|
|
20
|
-
|
|
21
|
-
|
|
91
|
+
$[7] = query.error;
|
|
92
|
+
$[8] = query.isLoading;
|
|
93
|
+
$[9] = t4;
|
|
94
|
+
$[10] = t5;
|
|
95
|
+
} else t5 = $[10];
|
|
96
|
+
return t5;
|
|
22
97
|
};
|
|
23
|
-
async function _temp(entityBusinessKeyPrefix, t0) {
|
|
24
|
-
const { pageNumber: t1, pageSize: t2, eagerLoad: t3 } = t0 === void 0 ? {} : t0;
|
|
25
|
-
const pageNumber = t1 === void 0 ? 1 : t1;
|
|
26
|
-
const pageSize = t2 === void 0 ? 100 : t2;
|
|
27
|
-
const eagerLoad = t3 === void 0 ? true : t3;
|
|
28
|
-
const search = new SearchBuilder(pageNumber, pageSize).addFilter("entityBusinessKey", entityBusinessKeyPrefix, SearchOperators.STARTSWITH).setEagerLoad(eagerLoad).build();
|
|
29
|
-
return unwrap(await SearchUtilities.executeSearch(search, TAG_ASSOCIATION_TABLE));
|
|
30
|
-
}
|
|
31
|
-
async function _temp2(search_0) {
|
|
32
|
-
return unwrap(await SearchUtilities.executeSearch(search_0, TAG_ASSOCIATION_TABLE));
|
|
33
|
-
}
|
|
34
98
|
//#endregion
|
|
35
99
|
export { useTags };
|
|
36
100
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTags.mjs","names":["
|
|
1
|
+
{"version":3,"file":"useTags.mjs","names":["useQuery","ConfigService","UdpTag","UdpTagAssociation","apiMutate","TAG_ASSOCIATION_ENDPOINT","BASE_SEARCH_PAYLOAD","pageNumber","pageSize","filterElements","filterGroups","orderElements","groupingType","groupProperty","groupOperationList","eagerLoad","logicalSearchOperator","EMPTY_MAP","ReadonlyMap","Map","fetchTagAssociations","entityBusinessKeyPrefix","Promise","res","productV1ApiUrl","method","data","getAll","searchField","searchOperator","searchValue","pageList","buildTagMap","associations","map","a","id","entityBusinessKey","split","tag","udpTagAssociationUdpTag","existing","get","push","set","UseTagsResult","tagMap","isLoading","error","Error","useTags","options","$","_c","t0","t1","t2","enabled","t3","queryKey","queryFn","select","query","t4","t5"],"sources":["../../../src/udp/tags/useTags.ts"],"sourcesContent":["import { useQuery } from '@tanstack/react-query';\nimport { ConfigService } from '@univerus/udp-react-stencil-component-library';\nimport type {\n UdpTag,\n UdpTagAssociation,\n} from '@univerus/udp-stencil-component-library';\nimport { apiMutate } from '../../utilities/useAxiosMutate';\n\nconst TAG_ASSOCIATION_ENDPOINT = 'udpTagAssociation/search';\n\nconst BASE_SEARCH_PAYLOAD = {\n pageNumber: 1,\n pageSize: 200,\n filterElements: [],\n filterGroups: [],\n orderElements: [],\n groupingType: '',\n groupProperty: [],\n groupOperationList: [],\n eagerLoad: true,\n logicalSearchOperator: 1,\n};\n\nconst EMPTY_MAP: ReadonlyMap<string, UdpTag[]> = new Map();\n\nconst fetchTagAssociations = async (\n entityBusinessKeyPrefix: string,\n): Promise<UdpTagAssociation[]> => {\n const res = (await apiMutate(\n ConfigService.productV1ApiUrl,\n TAG_ASSOCIATION_ENDPOINT,\n { method: 'post' },\n {\n data: {\n ...BASE_SEARCH_PAYLOAD,\n getAll: true,\n filterElements: [\n {\n searchField: 'entityBusinessKey',\n searchOperator: 'STARTSWITH',\n searchValue: entityBusinessKeyPrefix,\n },\n ],\n },\n },\n )) as { data?: { pageList?: UdpTagAssociation[] } } | undefined;\n return res?.data?.pageList ?? [];\n};\n\nconst buildTagMap = (\n associations: UdpTagAssociation[],\n): Map<string, UdpTag[]> => {\n const map = new Map<string, UdpTag[]>();\n for (const a of associations) {\n const id = a.entityBusinessKey?.split('|')[1];\n const tag = a.udpTagAssociationUdpTag;\n if (!id || !tag) continue;\n const existing = map.get(id);\n if (existing) {\n existing.push(tag);\n } else {\n map.set(id, [tag]);\n }\n }\n return map;\n};\n\nexport interface UseTagsResult {\n tagMap: ReadonlyMap<string, UdpTag[]>;\n isLoading: boolean;\n error: Error | null;\n}\n\n/**\n * Fetch and cache tag associations for every record of a single entity type.\n *\n * Pass a type-only prefix ending in `|` — e.g.\n * `Univerus.Unity.Starter.Project.Models.ChargeCodeTask|`.\n *\n * Returns a `Map<entityId, UdpTag[]>` keyed by the GUID portion of the\n * business key. The query is shared across the app via TanStack Query, so\n * multiple components calling this hook with the same prefix dedupe to a\n * single request and stay in sync on invalidation.\n */\nexport const useTags = (\n entityBusinessKeyPrefix: string,\n options?: { enabled?: boolean },\n): UseTagsResult => {\n const query = useQuery({\n queryKey: [TAG_ASSOCIATION_ENDPOINT, entityBusinessKeyPrefix],\n queryFn: () => fetchTagAssociations(entityBusinessKeyPrefix),\n enabled: options?.enabled !== false && !!entityBusinessKeyPrefix,\n select: buildTagMap,\n });\n\n return {\n tagMap: query.data ?? EMPTY_MAP,\n isLoading: query.isLoading,\n error: query.error,\n };\n};\n"],"mappings":";;;;;AAQA,MAAMK,2BAA2B;AAEjC,MAAMC,sBAAsB;CAC1BC,YAAY;CACZC,UAAU;CACVC,gBAAgB,EAAE;CAClBC,cAAc,EAAE;CAChBC,eAAe,EAAE;CACjBC,cAAc;CACdC,eAAe,EAAE;CACjBC,oBAAoB,EAAE;CACtBC,WAAW;CACXC,uBAAuB;CACxB;AAED,MAAMC,4BAA2C,IAAIE,KAAK;AAE1D,MAAMC,uBAAuB,OAC3BC,4BACiC;AAmBjC,SAlBa,MAAMjB,UACjBH,cAAcuB,iBACdnB,0BACA,EAAEoB,QAAQ,QAAQ,EAClB,EACEC,MAAM;EACJ,GAAGpB;EACHqB,QAAQ;EACRlB,gBAAgB,CACd;GACEmB,aAAa;GACbC,gBAAgB;GAChBC,aAAaT;GACd,CAAA;EAEL,EAEJ,CAAC,GACWK,MAAMK,YAAY,EAAE;;AAGlC,MAAMC,eACJC,iBAC0B;CAC1B,MAAMC,sBAAM,IAAIf,KAAuB;AACvC,MAAK,MAAMgB,KAAKF,cAAc;EAC5B,MAAMG,KAAKD,EAAEE,mBAAmBC,MAAM,IAAI,CAAC;EAC3C,MAAMC,MAAMJ,EAAEK;AACd,MAAI,CAACJ,MAAM,CAACG,IA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1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "udp-react-enterprise-component-library",
|
|
3
|
-
"version": "26.2.0-beta.
|
|
3
|
+
"version": "26.2.0-beta.2",
|
|
4
4
|
"description": "React-based UI component library implementing Fluent UI design for Univerus internal projects",
|
|
5
5
|
"author": "Univerus",
|
|
6
6
|
"license": "MIT",
|
|
@@ -3692,7 +3692,7 @@
|
|
|
3692
3692
|
"@tanstack/react-query": "^5",
|
|
3693
3693
|
"@tanstack/react-query-devtools": "^5",
|
|
3694
3694
|
"udp-react-stencil-component-library": "^26.0.1",
|
|
3695
|
-
"udp-stencil-component-library": "^26.2.0-beta.
|
|
3695
|
+
"udp-stencil-component-library": "^26.2.0-beta.2",
|
|
3696
3696
|
"axios": "^0.27.2",
|
|
3697
3697
|
"axios-hooks": "^2.1.0",
|
|
3698
3698
|
"broadcast-channel": "^4.17.0",
|