@devgateway/dvz-ui-react 1.4.0 → 1.5.1
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/cjs/common.css +1 -1
- package/dist/cjs/embeddable/big-number-trend/index.js +1 -1
- package/dist/cjs/embeddable/body/index.js +1 -1
- package/dist/cjs/embeddable/chart/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/Line.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ColorProvider.js +1 -1
- package/dist/cjs/embeddable/chart/colors/ManualColors.js +1 -1
- package/dist/cjs/embeddable/chart/colors/SystemColors.js +1 -1
- package/dist/cjs/embeddable/chart/data/Bar.js +1 -1
- package/dist/cjs/embeddable/chart/data/Line.js +1 -1
- package/dist/cjs/embeddable/chart/data/Utils.js +1 -1
- package/dist/cjs/embeddable/d3Map/BaseLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/DataLayer.js +1 -1
- package/dist/cjs/embeddable/d3Map/FlowLayer.js +1 -1
- package/dist/cjs/embeddable/data/DataContext.js +1 -1
- package/dist/cjs/embeddable/featuredtabs/index.js +1 -1
- package/dist/cjs/embeddable/filter/index.js +1 -1
- package/dist/cjs/embeddable/filtered-posts/NoData.js +11 -0
- package/dist/cjs/embeddable/filtered-posts/index.js +1 -0
- package/dist/cjs/embeddable/index.js +1 -1
- package/dist/cjs/embeddable/inlinelist/index.js +1 -1
- package/dist/cjs/embeddable/map/MapDataFrame.js +1 -1
- package/dist/cjs/embeddable/map/index.js +2 -2
- package/dist/cjs/embeddable/map/map.js +4 -4
- package/dist/cjs/embeddable/posts-filter/PostsFilterDropdown.js +1 -0
- package/dist/cjs/embeddable/posts-filter/index.js +1 -0
- package/dist/cjs/embeddable/posts-filters-reset-button/index.js +1 -0
- package/dist/cjs/embeddable/posts-pagination/index.js +1 -0
- package/dist/cjs/embeddable/reducers/data-api.js +1 -1
- package/dist/cjs/embeddable/reducers/data.js +1 -1
- package/dist/cjs/embeddable/showcase/index.js +1 -1
- package/dist/cjs/embeddable/time-line/mobile.js +1 -1
- package/dist/cjs/embeddable/vertical-featuredtabs/index.js +2 -2
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/layout/ClassicHeader.js +1 -1
- package/dist/cjs/layout/CustomSemanticSearch.js +1 -1
- package/dist/cjs/layout/Header.js +3 -3
- package/dist/cjs/layout/Layout.js +1 -1
- package/dist/cjs/layout/SearchControl.js +1 -1
- package/dist/cjs/styles.css +1 -1
- package/dist/cjs/translations/am.json.js +1 -0
- package/dist/cjs/utils/data.js +1 -1
- package/dist/esm/common.css +1 -1
- package/dist/esm/embeddable/big-number-trend/index.js +36 -36
- package/dist/esm/embeddable/body/index.js +141 -95
- package/dist/esm/embeddable/chart/Bar.js +390 -382
- package/dist/esm/embeddable/chart/Line.js +101 -102
- package/dist/esm/embeddable/chart/colors/ColorProvider.js +42 -39
- package/dist/esm/embeddable/chart/colors/ManualColors.js +40 -29
- package/dist/esm/embeddable/chart/colors/SystemColors.js +28 -17
- package/dist/esm/embeddable/chart/data/Bar.js +112 -114
- package/dist/esm/embeddable/chart/data/Line.js +126 -126
- package/dist/esm/embeddable/chart/data/Utils.js +32 -26
- package/dist/esm/embeddable/d3Map/BaseLayer.js +3 -8
- package/dist/esm/embeddable/d3Map/DataLayer.js +2 -9
- package/dist/esm/embeddable/d3Map/FlowLayer.js +12 -15
- package/dist/esm/embeddable/data/DataContext.js +1 -0
- package/dist/esm/embeddable/featuredtabs/index.js +128 -124
- package/dist/esm/embeddable/filter/index.js +207 -206
- package/dist/esm/embeddable/filtered-posts/NoData.js +31 -0
- package/dist/esm/embeddable/filtered-posts/index.js +123 -0
- package/dist/esm/embeddable/index.js +34 -31
- package/dist/esm/embeddable/inlinelist/index.js +82 -70
- package/dist/esm/embeddable/map/MapDataFrame.js +17 -14
- package/dist/esm/embeddable/map/index.js +180 -169
- package/dist/esm/embeddable/map/map.js +520 -437
- package/dist/esm/embeddable/posts-filter/PostsFilterDropdown.js +190 -0
- package/dist/esm/embeddable/posts-filter/index.js +215 -0
- package/dist/esm/embeddable/posts-filters-reset-button/index.js +33 -0
- package/dist/esm/embeddable/posts-pagination/index.js +69 -0
- package/dist/esm/embeddable/reducers/data-api.js +40 -25
- package/dist/esm/embeddable/reducers/data.js +180 -99
- package/dist/esm/embeddable/showcase/index.js +1 -1
- package/dist/esm/embeddable/time-line/mobile.js +158 -182
- package/dist/esm/embeddable/vertical-featuredtabs/index.js +177 -168
- package/dist/esm/index.js +69 -25
- package/dist/esm/layout/ClassicHeader.js +62 -62
- package/dist/esm/layout/CustomSemanticSearch.js +40 -102
- package/dist/esm/layout/Header.js +152 -144
- package/dist/esm/layout/Layout.js +4 -3
- package/dist/esm/layout/SearchControl.js +130 -113
- package/dist/esm/styles.css +1 -1
- package/dist/esm/translations/am.json.js +46 -0
- package/dist/esm/utils/data.js +4 -9
- package/dist/types/dvz-ui/src/countries.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/chart/colors/ManualColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/chart/colors/SystemColors.d.ts +1 -1
- package/dist/types/dvz-ui/src/embeddable/data/DataContext.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/NoData.d.ts +7 -0
- package/dist/types/dvz-ui/src/embeddable/filtered-posts/index.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/inlinelist/index.d.ts +2 -0
- package/dist/types/dvz-ui/src/embeddable/map/MapDataFrame.d.ts +1 -6
- package/dist/types/dvz-ui/src/embeddable/map/map.d.ts +1 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/PostsFilterDropdown.d.ts +21 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filter/index.d.ts +25 -0
- package/dist/types/dvz-ui/src/embeddable/posts-filters-reset-button/index.d.ts +3 -0
- package/dist/types/dvz-ui/src/embeddable/posts-pagination/index.d.ts +10 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/data-api.d.ts +11 -0
- package/dist/types/dvz-ui/src/embeddable/reducers/post-reducer.d.ts +158 -0
- package/dist/types/dvz-ui/src/embeddable/time-line/mobile.d.ts +1 -2
- package/dist/types/dvz-ui/src/embeddable/vertical-featuredtabs/index.d.ts +1 -0
- package/dist/types/dvz-ui/src/index.d.ts +3 -0
- package/dist/types/dvz-ui/src/layout/Header.d.ts +2 -2
- package/dist/types/dvz-ui/src/translations/am.json.d.ts +39 -0
- package/package.json +7 -5
- package/dist/cjs/embeddable/posts-with-filters/DropDownFilter.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/Post.js +0 -1
- package/dist/cjs/embeddable/posts-with-filters/index.js +0 -1
- package/dist/esm/embeddable/posts-with-filters/DropDownFilter.js +0 -25
- package/dist/esm/embeddable/posts-with-filters/Post.js +0 -51
- package/dist/esm/embeddable/posts-with-filters/index.js +0 -206
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/DropDownFilter.d.ts +0 -4
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/Post.d.ts +0 -5
- package/dist/types/dvz-ui/src/embeddable/posts-with-filters/index.d.ts +0 -21
- /package/dist/cjs/{utils/countries.js → countries.js} +0 -0
- /package/dist/cjs/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/esm/{utils/countries.js → countries.js} +0 -0
- /package/dist/esm/embeddable/{posts-with-filters → filtered-posts}/utils.js +0 -0
- /package/dist/types/dvz-ui/src/embeddable/{posts-with-filters → filtered-posts}/utils.d.ts +0 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { DropdownProps } from 'semantic-ui-react';
|
|
3
|
+
export interface PostFilterDropdownProps extends DropdownProps {
|
|
4
|
+
allLabel?: string;
|
|
5
|
+
noneLabel?: string;
|
|
6
|
+
group: string;
|
|
7
|
+
useSingleColumn?: boolean;
|
|
8
|
+
enableTextSearch?: boolean;
|
|
9
|
+
filterType?: string;
|
|
10
|
+
showNoDataOption?: boolean;
|
|
11
|
+
allNoneSameBehaviour?: boolean;
|
|
12
|
+
closeOnSelect?: boolean;
|
|
13
|
+
autoApply?: boolean;
|
|
14
|
+
alphabeticalSort?: boolean;
|
|
15
|
+
ascOrder?: boolean;
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
taxonomy?: string;
|
|
18
|
+
type?: string;
|
|
19
|
+
}
|
|
20
|
+
declare const PostsFilterDropdown: (props: PostFilterDropdownProps) => React.JSX.Element;
|
|
21
|
+
export default PostsFilterDropdown;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
interface PostsFilterProps {
|
|
3
|
+
"data-alphabetical-sort": boolean | string;
|
|
4
|
+
"data-asc-order": boolean | string;
|
|
5
|
+
"data-group": string;
|
|
6
|
+
"data-placeholder"?: string;
|
|
7
|
+
"data-all-label"?: string;
|
|
8
|
+
"data-none-label"?: string;
|
|
9
|
+
"data-use-single-column"?: boolean | string;
|
|
10
|
+
"data-enable-text-search"?: boolean | string;
|
|
11
|
+
"data-filter-type"?: string;
|
|
12
|
+
"data-show-no-data-option"?: boolean | string;
|
|
13
|
+
"data-close-on-select"?: boolean | string;
|
|
14
|
+
"data-all-none-same-behaviour"?: boolean | string;
|
|
15
|
+
"data-auto-apply"?: boolean | string;
|
|
16
|
+
"data-taxonomy"?: string;
|
|
17
|
+
"data-categories"?: string;
|
|
18
|
+
"data-is-country-filter"?: boolean | string;
|
|
19
|
+
"data-is-year-filter"?: boolean | string;
|
|
20
|
+
"data-selected-year"?: number | string;
|
|
21
|
+
"data-type"?: string;
|
|
22
|
+
"data-sort-first-by"?: string;
|
|
23
|
+
}
|
|
24
|
+
declare const PostsFilter: (props: PostsFilterProps) => React.JSX.Element;
|
|
25
|
+
export default PostsFilter;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { WrappedComponentProps } from 'react-intl';
|
|
3
|
+
interface PostsPaginationProps extends WrappedComponentProps {
|
|
4
|
+
"data-group": string;
|
|
5
|
+
"data-number-of-items-per-page": number;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: React.FC<import('react-intl').WithIntlProps<PostsPaginationProps>> & {
|
|
8
|
+
WrappedComponent: React.ComponentType<PostsPaginationProps>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -7,3 +7,14 @@ export function getData({ source, app, params }: {
|
|
|
7
7
|
app: any;
|
|
8
8
|
params: any;
|
|
9
9
|
}): any;
|
|
10
|
+
export function getCustomPosts({ postType, taxonomy, category, taxonomyFilters, before, perPage, page, locale, after }: {
|
|
11
|
+
postType: any;
|
|
12
|
+
taxonomy: any;
|
|
13
|
+
category: any;
|
|
14
|
+
taxonomyFilters: any;
|
|
15
|
+
before: any;
|
|
16
|
+
perPage: any;
|
|
17
|
+
page: any;
|
|
18
|
+
locale: any;
|
|
19
|
+
after: any;
|
|
20
|
+
}): Promise<unknown>;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
interface PostsState {
|
|
2
|
+
posts?: any;
|
|
3
|
+
group: string | null;
|
|
4
|
+
postsFilters: {
|
|
5
|
+
countryFilter: string | null;
|
|
6
|
+
yearFilter: string | null;
|
|
7
|
+
categoryFilter: string | null;
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
interface GetCustomPostsQueryArgs {
|
|
11
|
+
postType?: string;
|
|
12
|
+
taxonomy?: string;
|
|
13
|
+
category?: string;
|
|
14
|
+
before?: Date;
|
|
15
|
+
perPage?: number;
|
|
16
|
+
page?: number;
|
|
17
|
+
locale?: string;
|
|
18
|
+
after?: Date;
|
|
19
|
+
}
|
|
20
|
+
export declare const postsApi: import('@reduxjs/toolkit/query').Api<import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, {
|
|
21
|
+
getCustomPosts: import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>;
|
|
22
|
+
}, "postsApi", never, typeof import('@reduxjs/toolkit/query').coreModuleName | typeof import('@reduxjs/toolkit/query/react').reactHooksModuleName>;
|
|
23
|
+
export declare const useGetCustomPostsQuery: <R extends Record<string, any> = import('@reduxjs/toolkit/query').TSHelpersId<(Omit<{
|
|
24
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
25
|
+
originalArgs?: undefined | undefined;
|
|
26
|
+
data?: undefined | undefined;
|
|
27
|
+
error?: undefined | undefined;
|
|
28
|
+
requestId?: undefined | undefined;
|
|
29
|
+
endpointName?: string | undefined;
|
|
30
|
+
startedTimeStamp?: undefined | undefined;
|
|
31
|
+
fulfilledTimeStamp?: undefined | undefined;
|
|
32
|
+
} & {
|
|
33
|
+
currentData?: any;
|
|
34
|
+
isUninitialized: false;
|
|
35
|
+
isLoading: false;
|
|
36
|
+
isFetching: false;
|
|
37
|
+
isSuccess: false;
|
|
38
|
+
isError: false;
|
|
39
|
+
}, "isUninitialized"> & {
|
|
40
|
+
isUninitialized: true;
|
|
41
|
+
}) | import('@reduxjs/toolkit/query').TSHelpersOverride<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
42
|
+
currentData?: any;
|
|
43
|
+
isUninitialized: false;
|
|
44
|
+
isLoading: false;
|
|
45
|
+
isFetching: false;
|
|
46
|
+
isSuccess: false;
|
|
47
|
+
isError: false;
|
|
48
|
+
}, {
|
|
49
|
+
isLoading: true;
|
|
50
|
+
isFetching: boolean;
|
|
51
|
+
data: undefined;
|
|
52
|
+
} | ({
|
|
53
|
+
isSuccess: true;
|
|
54
|
+
isFetching: true;
|
|
55
|
+
error: undefined;
|
|
56
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
57
|
+
currentData?: any;
|
|
58
|
+
isUninitialized: false;
|
|
59
|
+
isLoading: false;
|
|
60
|
+
isFetching: false;
|
|
61
|
+
isSuccess: false;
|
|
62
|
+
isError: false;
|
|
63
|
+
}, "data" | "fulfilledTimeStamp">>) | ({
|
|
64
|
+
isSuccess: true;
|
|
65
|
+
isFetching: false;
|
|
66
|
+
error: undefined;
|
|
67
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
68
|
+
currentData?: any;
|
|
69
|
+
isUninitialized: false;
|
|
70
|
+
isLoading: false;
|
|
71
|
+
isFetching: false;
|
|
72
|
+
isSuccess: false;
|
|
73
|
+
isError: false;
|
|
74
|
+
}, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
|
|
75
|
+
isError: true;
|
|
76
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
77
|
+
currentData?: any;
|
|
78
|
+
isUninitialized: false;
|
|
79
|
+
isLoading: false;
|
|
80
|
+
isFetching: false;
|
|
81
|
+
isSuccess: false;
|
|
82
|
+
isError: false;
|
|
83
|
+
}, "error">>)>> & {
|
|
84
|
+
status: import('@reduxjs/toolkit/query').QueryStatus;
|
|
85
|
+
}>(arg: GetCustomPostsQueryArgs | typeof import('@reduxjs/toolkit/query').skipToken, options?: (import('@reduxjs/toolkit/query').SubscriptionOptions & {
|
|
86
|
+
skip?: boolean;
|
|
87
|
+
refetchOnMountOrArgChange?: boolean | number;
|
|
88
|
+
} & {
|
|
89
|
+
skip?: boolean;
|
|
90
|
+
selectFromResult?: ((state: import('@reduxjs/toolkit/query').TSHelpersId<(Omit<{
|
|
91
|
+
status: import("@reduxjs/toolkit/query").QueryStatus.uninitialized;
|
|
92
|
+
originalArgs?: undefined | undefined;
|
|
93
|
+
data?: undefined | undefined;
|
|
94
|
+
error?: undefined | undefined;
|
|
95
|
+
requestId?: undefined | undefined;
|
|
96
|
+
endpointName?: string | undefined;
|
|
97
|
+
startedTimeStamp?: undefined | undefined;
|
|
98
|
+
fulfilledTimeStamp?: undefined | undefined;
|
|
99
|
+
} & {
|
|
100
|
+
currentData?: any;
|
|
101
|
+
isUninitialized: false;
|
|
102
|
+
isLoading: false;
|
|
103
|
+
isFetching: false;
|
|
104
|
+
isSuccess: false;
|
|
105
|
+
isError: false;
|
|
106
|
+
}, "isUninitialized"> & {
|
|
107
|
+
isUninitialized: true;
|
|
108
|
+
}) | import('@reduxjs/toolkit/query').TSHelpersOverride<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
109
|
+
currentData?: any;
|
|
110
|
+
isUninitialized: false;
|
|
111
|
+
isLoading: false;
|
|
112
|
+
isFetching: false;
|
|
113
|
+
isSuccess: false;
|
|
114
|
+
isError: false;
|
|
115
|
+
}, {
|
|
116
|
+
isLoading: true;
|
|
117
|
+
isFetching: boolean;
|
|
118
|
+
data: undefined;
|
|
119
|
+
} | ({
|
|
120
|
+
isSuccess: true;
|
|
121
|
+
isFetching: true;
|
|
122
|
+
error: undefined;
|
|
123
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
124
|
+
currentData?: any;
|
|
125
|
+
isUninitialized: false;
|
|
126
|
+
isLoading: false;
|
|
127
|
+
isFetching: false;
|
|
128
|
+
isSuccess: false;
|
|
129
|
+
isError: false;
|
|
130
|
+
}, "data" | "fulfilledTimeStamp">>) | ({
|
|
131
|
+
isSuccess: true;
|
|
132
|
+
isFetching: false;
|
|
133
|
+
error: undefined;
|
|
134
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
135
|
+
currentData?: any;
|
|
136
|
+
isUninitialized: false;
|
|
137
|
+
isLoading: false;
|
|
138
|
+
isFetching: false;
|
|
139
|
+
isSuccess: false;
|
|
140
|
+
isError: false;
|
|
141
|
+
}, "data" | "fulfilledTimeStamp" | "currentData">>) | ({
|
|
142
|
+
isError: true;
|
|
143
|
+
} & Required<Pick<import('@reduxjs/toolkit/query').QuerySubState<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>> & {
|
|
144
|
+
currentData?: any;
|
|
145
|
+
isUninitialized: false;
|
|
146
|
+
isLoading: false;
|
|
147
|
+
isFetching: false;
|
|
148
|
+
isSuccess: false;
|
|
149
|
+
isError: false;
|
|
150
|
+
}, "error">>)>> & {
|
|
151
|
+
status: import('@reduxjs/toolkit/query').QueryStatus;
|
|
152
|
+
}) => R) | undefined;
|
|
153
|
+
}) | undefined) => [R][R extends any ? 0 : never] & {
|
|
154
|
+
refetch: () => import('@reduxjs/toolkit/query').QueryActionCreatorResult<import('@reduxjs/toolkit/query').QueryDefinition<GetCustomPostsQueryArgs, import('@reduxjs/toolkit/query').BaseQueryFn<string | import('@reduxjs/toolkit/query').FetchArgs, unknown, import('@reduxjs/toolkit/query').FetchBaseQueryError, {}, import('@reduxjs/toolkit/query').FetchBaseQueryMeta>, never, any, "postsApi", any>>;
|
|
155
|
+
};
|
|
156
|
+
export declare const setPostsFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<PostsState, "postsReducer/setPostsFilter">, setInitialPostsFilter: import('@reduxjs/toolkit').ActionCreatorWithPayload<any, "postsReducer/setInitialPostsFilter">;
|
|
157
|
+
declare const _default: import('redux').Reducer<PostsState>;
|
|
158
|
+
export default _default;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
export { getComponentByNameIgnoreCase, components, reducers, customizer } from './embeddable/index';
|
|
2
|
+
export * from './conf';
|
|
3
|
+
export * from './layout';
|
|
2
4
|
export * from './tracker';
|
|
3
5
|
export * from './redux';
|
|
4
6
|
export * from './lib';
|
|
5
7
|
export * from './translations';
|
|
8
|
+
export * from './countries';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
declare const _default: React.FC<import('react-intl').WithIntlProps<{
|
|
3
3
|
intl: any;
|
|
4
|
-
settings
|
|
4
|
+
settings: any;
|
|
5
5
|
}>> & {
|
|
6
6
|
WrappedComponent: React.ComponentType<{
|
|
7
7
|
intl: any;
|
|
8
|
-
settings
|
|
8
|
+
settings: any;
|
|
9
9
|
}>;
|
|
10
10
|
};
|
|
11
11
|
export default _default;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
"search.placeholder": "ፈልግ...",
|
|
3
|
+
"search.results.summary": "{count} የ {total} ውጤቶች",
|
|
4
|
+
"oropharyngeal.cancer": "የጉሮሮ ካንሰር",
|
|
5
|
+
"laryngeal.cancer": "የአየር ቧንቧ ካንሰር",
|
|
6
|
+
"oesophageal.cancer": "የምግብ ቧንቧ ካንሰር",
|
|
7
|
+
"tracheal.bronchial.lung.cancer": "የቀሰብ፣ የቀሳቢ እና የሳንባ ካንሰር",
|
|
8
|
+
"acute.myeloid.leukaemia": "የደም ካንሰር",
|
|
9
|
+
"stomach.cancer": "የጨጓራ ካንሰር",
|
|
10
|
+
"liver.cancer": "የጉበት ካንሰር",
|
|
11
|
+
"pancreatic.cancer": "የቆሽት ካንሰር",
|
|
12
|
+
"colorectal.cancer": "የአንጀት ካንሰር",
|
|
13
|
+
"kidney.cancer": "የኩላሊት ካንሰር",
|
|
14
|
+
"bladder.cancer": "የፊኛ ካንሰር",
|
|
15
|
+
"cervical.cancer": "የማህጸን ካንሰር (ሴቶች ብቻ)",
|
|
16
|
+
"stroke": "ስትሮክ",
|
|
17
|
+
"blindness.decreased.eyesight": "የአይን መታወር፣ የማየት ችሎታ መቀነስ",
|
|
18
|
+
"periodontitis": "የድድ በሽታ",
|
|
19
|
+
"aortic.aneurysm": "ኦርቲክ አኑኢሪዜም",
|
|
20
|
+
"heart.disease": "የልብ በሽታ",
|
|
21
|
+
"pneumonia": "የሳንባ ምች በሽታ",
|
|
22
|
+
"atherosclerotic.peripheral.vascular.disease": "የደም ስር መጥበብ በሽታ",
|
|
23
|
+
"copd": "የሳንባ በሽታ",
|
|
24
|
+
"tuberculosis": "የሳንባ ነቀርሳ",
|
|
25
|
+
"asthma": "አስም",
|
|
26
|
+
"diabetes": "የስኳር በሽታ",
|
|
27
|
+
"hip.fractures": "የዳሌ አጥንት መሰንጠቅ",
|
|
28
|
+
"rheumatoid.arthritis": "የሪህ በሽታ",
|
|
29
|
+
"impaired.immune.function": "በሽታ የመከላከል አቅም መቀነስ",
|
|
30
|
+
"erectile.dysfunction": "የብልት ችግር (ወንዶች ብቻ)",
|
|
31
|
+
"ectopic.pregnancy": "ከማህጸን ውጭ የሚፈጠር እርግዝና (ሴቶች ብቻ)",
|
|
32
|
+
"reduced.fertility.women": "የወላድነት መቀነስ (ሴቶች ብቻ)",
|
|
33
|
+
"reduced.fertility.men": "የወላድነት መቀነስ (ወንዶች ብቻ)",
|
|
34
|
+
"ailments.title": "የካንሰር በሽታዎች",
|
|
35
|
+
"ailments.otherConditions": "ሌሎች የጤና ችግሮች"
|
|
36
|
+
}
|
|
37
|
+
;
|
|
38
|
+
|
|
39
|
+
export default _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devgateway/dvz-ui-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.1",
|
|
4
4
|
"main": "dist/cjs/index.js",
|
|
5
5
|
"module": "dist/esm/index.js",
|
|
6
6
|
"types": "dist/types/index.d.ts",
|
|
@@ -56,6 +56,7 @@
|
|
|
56
56
|
"html-react-parser": "^5.2.6",
|
|
57
57
|
"immutable": "^5.1.3",
|
|
58
58
|
"lodash": "^4.17.21",
|
|
59
|
+
"lodash.isequal": "^4.5.0",
|
|
59
60
|
"papaparse": "^5.5.3",
|
|
60
61
|
"pure-react-carousel": "^1.32.0",
|
|
61
62
|
"query-string": "^9.3.1",
|
|
@@ -69,7 +70,7 @@
|
|
|
69
70
|
"react-is": "^18.3.1",
|
|
70
71
|
"react-markdown": "^10.1.0",
|
|
71
72
|
"react-redux": "~9.2.0",
|
|
72
|
-
"react-router": "~7.
|
|
73
|
+
"react-router": "~7.9.4",
|
|
73
74
|
"redux": "^5.0.1",
|
|
74
75
|
"redux-thunk": "^3.1.0",
|
|
75
76
|
"rehype-raw": "^7.0.0",
|
|
@@ -78,8 +79,7 @@
|
|
|
78
79
|
"semantic-ui-react": "^3.0.0-beta.2",
|
|
79
80
|
"string-template": "^1.0.0",
|
|
80
81
|
"topojson-client": "^3.1.0",
|
|
81
|
-
"uuid": "^11.1.0"
|
|
82
|
-
"@devgateway/wp-react-lib": "0.5.0"
|
|
82
|
+
"uuid": "^11.1.0"
|
|
83
83
|
},
|
|
84
84
|
"devDependencies": {
|
|
85
85
|
"@eslint/js": "^9.37.0",
|
|
@@ -88,6 +88,7 @@
|
|
|
88
88
|
"@types/d3-shape": "^3.1.7",
|
|
89
89
|
"@types/file-saver": "^2.0.7",
|
|
90
90
|
"@types/lodash": "^4.17.16",
|
|
91
|
+
"@types/lodash.isequal": "^4.5.8",
|
|
91
92
|
"@types/node": "^22.15.18",
|
|
92
93
|
"@types/papaparse": "^5.3.16",
|
|
93
94
|
"@types/react": "^18.3.11",
|
|
@@ -114,7 +115,8 @@
|
|
|
114
115
|
"vite-plugin-dts": "^4.5.4",
|
|
115
116
|
"vite-plugin-env-compatible": "^2.0.1",
|
|
116
117
|
"vite-plugin-eslint": "^1.8.1",
|
|
117
|
-
"vite-tsconfig-paths": "^5.1.4"
|
|
118
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
119
|
+
"@devgateway/wp-react-lib": "0.5.1"
|
|
118
120
|
},
|
|
119
121
|
"peerDependencies": {
|
|
120
122
|
"react": "^18.3.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const a=require("react/jsx-runtime"),u=require("semantic-ui-react"),r=n=>{const{options:t,onChange:e}=n,i=[{key:"all",value:"all",text:"All"},...t||[]],s=(o,l)=>{e&&(l.value==="all"?e(o,{...l,value:void 0}):e(o,l))};return a.jsx(u.Dropdown,{...n,options:i,onChange:s})};exports.default=r;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),u=require("react"),m=require("semantic-ui-react"),h=require("date-fns"),l=require("../../utils/data.js"),c=require("@devgateway/wp-react-lib"),g=require("react-intl"),x=i=>{const{isPostHovered:t}=i;return e.jsx("div",{className:"post-image",children:e.jsx("img",{loading:"lazy",className:`${t?"highlighted":""}`,src:i.media&&i.media.guid?i.media.guid.rendered:null,alt:i.media&&i.media.alt_text||""})})},j=i=>{var n,d,o,r;const{post:t}=i,[a,s]=u.useState(!1);return e.jsxs("div",{className:"post-card",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[e.jsx("a",{href:t.link,target:"_blank",children:e.jsx(c.MediaProvider,{id:t.featured_media,children:e.jsx(c.MediaConsumer,{children:e.jsx(x,{isPostHovered:a})})})}),e.jsxs("div",{className:"post-content",onMouseEnter:()=>s(!0),onMouseLeave:()=>s(!1),children:[e.jsx("div",{className:"publication-date",children:h.format(new Date(t.date),"MMM dd, yyyy")}),e.jsx("a",{href:t.link,target:"_blank",children:e.jsx("h2",{className:`publication-title ${a?"highlighted":""}`,children:l.decodeHtmlEntitiesToText(((n=t.title)==null?void 0:n.rendered)||((d=t.yoast_head_json)==null?void 0:d.title)||"Publication Title")})}),e.jsx("p",{className:"publication-description",dangerouslySetInnerHTML:{__html:l.decodeHtmlEntitiesToHtml(((o=t.yoast_head_json)==null?void 0:o.og_description)||((r=t.excerpt)==null?void 0:r.rendered)||"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.")}}),e.jsx("a",{href:t.link,children:e.jsx(m.Button,{className:`read-more-button ${a?"highlighted":""}`,children:"Read more"})})]})]},t.id)},v=g.injectIntl(j);exports.default=v;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("react/jsx-runtime"),p=require("react"),A=require("@devgateway/wp-react-lib"),x=require("semantic-ui-react"),W=require("./Post.js"),E=require("./utils.js"),d=require("../../utils/data.js"),V=require("./DropDownFilter.js"),K=P=>{const{posts:o,meta:i,showPaginationOptions:j,currentPage:h,setCurrentPage:S,countryCategory:F,height:r}=P,y=d.toNumber(F),v=Array.isArray(o)?o.filter(s=>s.categories.includes(y)):[],g=Array.isArray(o)?o.filter(s=>!s.categories.includes(y)):[],n=[...v,...g],l=i&&i["x-wp-totalpages"]?i["x-wp-totalpages"]:1;return e.jsxs("div",{children:[e.jsx("div",{className:"posts-grid",children:n==null?void 0:n.map(s=>e.jsx(W.default,{post:s},s.id))}),j&&e.jsxs("div",{className:"pagination-section",children:[e.jsxs("div",{className:"pagination-info",children:["Page ",e.jsx("span",{className:"current-page",children:h})," of ",l]}),e.jsx(x.Pagination,{activePage:h,totalPages:l,onPageChange:(s,{activePage:c})=>S(c),prevItem:{content:e.jsx(x.Icon,{name:"angle left"}),icon:!0},nextItem:{content:e.jsx(x.Icon,{name:"angle right"}),icon:!0},firstItem:null,lastItem:null})]})]})},M=P=>{const{categories:o,selectedCategory:i,setSelectedCategory:j,selectedYear:h,setSelectedYear:S,onResetFilters:F,showCategoryFilter:r,categoryPlaceholder:y,showDateFilter:v,categoriesToBeShown:g,setCurrentPage:n,showCountryFilter:l,countryPlaceholder:s,countryCategory:c,selectedCountry:N,setSelectedCountry:C}=P,[I,Y]=p.useState([]);p.useEffect(()=>{const t=async()=>{const O=(await A.getYearRange()).data.map(b=>({key:b,value:b,text:`Year ${b}`}));Y(O)};return t(),()=>{t()}},[]);const f=o&&g?o.filter(t=>g.includes(t.id)):[],D=o&&c?o.filter(t=>t.parent===parseInt(c)):[];return e.jsx("div",{children:e.jsxs("div",{children:[l&&e.jsx(V.default,{options:D.map(t=>({key:t.id,value:t.id,text:t.name})),placeholder:s,value:N,onChange:(t,{value:a})=>{C(a),n(1)}}),v&&e.jsx(V.default,{options:I,placeholder:"Select Year",value:h,onChange:(t,{value:a})=>{S(a),n(1)},multiple:!1,searchable:!0,showAllNone:!1,closeOnSelect:!0}),r&&e.jsx(V.default,{options:f?f.map(t=>({key:t.id,value:t.id,text:t.name})):[],placeholder:y||"All Countries",value:i,onChange:(t,{value:a})=>{j(a),n(1)},multiple:!1,searchable:!1,showAllNone:!1,closeOnSelect:!0}),e.jsxs(x.Container,{className:`data-filters-reset ignore ${i||h||N?"":"disabled"}`,onClick:F,children:[e.jsx("span",{children:"Reset Filters"}),e.jsx("span",{children:e.jsx(x.Icon,{name:"undo alternate",className:"custom-undo-icon"})})]})]})})},U=P=>{const{"data-height":o,"data-show-pagination":i,"data-show-posts-per-page":j,"data-show-filters":h,"data-show-date-filter":S,"data-show-category-filter":F,"data-categories":r,"data-category-placeholder":y,"data-show-country-filter":v,"data-country-category":g,"data-country-placeholder":n}=P,[l,s]=p.useState(null),[c,N]=p.useState(null),[C,I]=p.useState(null),[Y,f]=p.useState(1),[D,t]=p.useState(0),a=d.toNumber(o),q=d.toBoolean(i),O=d.toNumber(j),b=d.toBoolean(h),B=d.toBoolean(S),R=d.toBoolean(F),k=d.toBoolean(v),T=()=>{s(null),N(null),I(null),f(1),t(u=>u+1)},m=c?E.getStartDateAndEndDateFromYear(c):null;let w=[];try{if(r)if(Array.isArray(r))w=r;else if(typeof r=="string"){const u=decodeURIComponent(r);u&&u!=="undefined"&&(w=JSON.parse(u))}else w=r}catch{w=[]}return console.log(a,"heightValue"),e.jsxs(x.Container,{fluid:!0,className:"container",style:{height:a+"px",minHeight:a+"px"},children:[b&&e.jsx(A.CategoriesProvider,{children:e.jsx(A.CategoriesContext.Consumer,{children:({categories:u})=>e.jsx(M,{showCategoryFilter:R,categoryPlaceholder:y,showDateFilter:B,categories:u||[],categoriesToBeShown:w,selectedCategory:l,setSelectedCategory:s,selectedYear:c,setSelectedYear:N,onResetFilters:T,setCurrentPage:f,showCountryFilter:k,countryPlaceholder:n,countryCategory:g,selectedCountry:C,setSelectedCountry:I})})}),e.jsx(A.PostProvider,{perPage:O||10,store:"posts-with-filters",categories:(C==null?void 0:C.toString())||(l==null?void 0:l.toString())||w.join(","),after:(m==null?void 0:m.startDate)||null,before:(m==null?void 0:m.endDate)||null,page:Y,children:e.jsx(A.PostConsumer,{children:e.jsx(K,{showPaginationOptions:q,currentPage:Y,setCurrentPage:f,countryCategory:g,height:a})})},D)]})};exports.default=U;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Dropdown as s } from "semantic-ui-react";
|
|
3
|
-
const f = (n) => {
|
|
4
|
-
const {
|
|
5
|
-
options: t,
|
|
6
|
-
onChange: o
|
|
7
|
-
} = n, a = [{
|
|
8
|
-
key: "all",
|
|
9
|
-
value: "all",
|
|
10
|
-
text: "All"
|
|
11
|
-
}, ...t || []];
|
|
12
|
-
return /* @__PURE__ */ i(
|
|
13
|
-
s,
|
|
14
|
-
{
|
|
15
|
-
...n,
|
|
16
|
-
options: a,
|
|
17
|
-
onChange: (e, l) => {
|
|
18
|
-
o && (l.value === "all" ? o(e, { ...l, value: void 0 }) : o(e, l));
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
);
|
|
22
|
-
};
|
|
23
|
-
export {
|
|
24
|
-
f as default
|
|
25
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { useState as m } from "react";
|
|
3
|
-
import { Button as c } from "semantic-ui-react";
|
|
4
|
-
import { format as u } from "date-fns";
|
|
5
|
-
import { decodeHtmlEntitiesToText as h, decodeHtmlEntitiesToHtml as g } from "../../utils/data.js";
|
|
6
|
-
import { MediaProvider as f, MediaConsumer as p } from "@devgateway/wp-react-lib";
|
|
7
|
-
import { injectIntl as v } from "react-intl";
|
|
8
|
-
const M = (i) => {
|
|
9
|
-
const { isPostHovered: e } = i;
|
|
10
|
-
return /* @__PURE__ */ t("div", { className: "post-image", children: /* @__PURE__ */ t(
|
|
11
|
-
"img",
|
|
12
|
-
{
|
|
13
|
-
loading: "lazy",
|
|
14
|
-
className: `${e ? "highlighted" : ""}`,
|
|
15
|
-
src: i.media && i.media.guid ? i.media.guid.rendered : null,
|
|
16
|
-
alt: i.media && i.media.alt_text || ""
|
|
17
|
-
}
|
|
18
|
-
) });
|
|
19
|
-
}, _ = (i) => {
|
|
20
|
-
var d, n, r, s;
|
|
21
|
-
const { post: e } = i, [a, o] = m(!1);
|
|
22
|
-
return /* @__PURE__ */ l(
|
|
23
|
-
"div",
|
|
24
|
-
{
|
|
25
|
-
className: "post-card",
|
|
26
|
-
onMouseEnter: () => o(!0),
|
|
27
|
-
onMouseLeave: () => o(!1),
|
|
28
|
-
children: [
|
|
29
|
-
/* @__PURE__ */ t("a", { href: e.link, target: "_blank", children: /* @__PURE__ */ t(f, { id: e.featured_media, children: /* @__PURE__ */ t(p, { children: /* @__PURE__ */ t(M, { isPostHovered: a }) }) }) }),
|
|
30
|
-
/* @__PURE__ */ l(
|
|
31
|
-
"div",
|
|
32
|
-
{
|
|
33
|
-
className: "post-content",
|
|
34
|
-
onMouseEnter: () => o(!0),
|
|
35
|
-
onMouseLeave: () => o(!1),
|
|
36
|
-
children: [
|
|
37
|
-
/* @__PURE__ */ t("div", { className: "publication-date", children: u(new Date(e.date), "MMM dd, yyyy") }),
|
|
38
|
-
/* @__PURE__ */ t("a", { href: e.link, target: "_blank", children: /* @__PURE__ */ t("h2", { className: `publication-title ${a ? "highlighted" : ""}`, children: h(((d = e.title) == null ? void 0 : d.rendered) || ((n = e.yoast_head_json) == null ? void 0 : n.title) || "Publication Title") }) }),
|
|
39
|
-
/* @__PURE__ */ t("p", { className: "publication-description", dangerouslySetInnerHTML: { __html: g(((r = e.yoast_head_json) == null ? void 0 : r.og_description) || ((s = e.excerpt) == null ? void 0 : s.rendered) || "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.") } }),
|
|
40
|
-
/* @__PURE__ */ t("a", { href: e.link, children: /* @__PURE__ */ t(c, { className: `read-more-button ${a ? "highlighted" : ""}`, children: "Read more" }) })
|
|
41
|
-
]
|
|
42
|
-
}
|
|
43
|
-
)
|
|
44
|
-
]
|
|
45
|
-
},
|
|
46
|
-
e.id
|
|
47
|
-
);
|
|
48
|
-
}, k = v(_);
|
|
49
|
-
export {
|
|
50
|
-
k as default
|
|
51
|
-
};
|