@apolitical/component-library 6.6.7-beta.0 → 6.6.8-beta.0

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.
@@ -1,4 +1,4 @@
1
1
  import type { IFormValues } from '../../../form';
2
2
  import type { IRTEValues } from './form.type';
3
- import { ITransformedPollData } from './../../shared';
3
+ import type { ITransformedPollData } from './../../shared';
4
4
  export declare const transformPollData: (data: IRTEValues & IFormValues) => ITransformedPollData;
@@ -1,7 +1,7 @@
1
1
  import type { IMutationContext } from '../../../../../../discussion/shared';
2
2
  import type { ICache, ICacheItem } from '../..';
3
3
  import { ResultsVisibility } from '../../../../../../polls';
4
- interface ICreatePollVars {
4
+ export interface ICreatePollVars {
5
5
  title: {
6
6
  [key: string]: string;
7
7
  };
@@ -20,5 +20,4 @@ interface ICreatePollVars {
20
20
  results_visibility?: ResultsVisibility;
21
21
  };
22
22
  }
23
- export declare function useCreatePoll({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, queryClient, queryKey, user, }: IMutationContext<ICacheItem, Error, ICreatePollVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateFunction<import('../../../../../../discussion/shared').IActivity, Error, ICreatePollVars, ICache>;
24
- export {};
23
+ export declare function useCreatePoll({ mutationFn, mutationHandlers: { mutate: mutateWrapper, error: onError }, queryClient, queryKey, user, }: IMutationContext<ICacheItem, Error, ICreatePollVars, ICache>): import("@tanstack/react-query/build/legacy/types").UseMutateAsyncFunction<import('../../../../../../discussion/shared').IActivity, Error, ICreatePollVars, ICache>;
@@ -1 +1,2 @@
1
1
  export { default as ActivitiesFeed } from './activities-feed';
2
+ export type { ICreatePollVars } from './cache';
@@ -1,8 +1,9 @@
1
+ import type { IObject } from '../../../types';
1
2
  import type { MemberProps, MemberDetailsProps } from '../../../user';
2
3
  import type { ListMembers, ClickMentionFallback } from '../../../form';
3
4
  import type { IEnrichedUrlData } from '../../../navigation';
4
5
  import type { ICategory } from './community.category.interface';
5
- import type { ILikesFeedQueryFns } from '../../../discussion/feeds/likes-feed';
6
+ import type { ILikesFeedQueryFns, ICreatePollVars } from '../../../discussion/feeds';
6
7
  export declare enum DiscussionContentType {
7
8
  Answer = "answer",
8
9
  Poll = "poll",
@@ -72,6 +73,7 @@ export type IForceHide = {
72
73
  likes?: boolean;
73
74
  };
74
75
  export type DiscussionCreateContentFunction = (args1: void | object, args2?: object) => void;
76
+ export type DiscussionCreatePollFunction = (args: ITransformedPollData) => Promise<IObject>;
75
77
  export type DiscussionCreateLikeFunction = (args1: object) => void;
76
78
  export type DiscussionDeleteLikeFunction = (args: object) => void;
77
79
  export type DiscussionListLikesFunction = ILikesFeedQueryFns['list'];
@@ -111,19 +113,19 @@ export interface IConversation {
111
113
  prepopulateForm?: string;
112
114
  mentionData?: IListMemberData;
113
115
  }
114
- export interface ITransformedPollData {
115
- [key: string]: string | number | {
116
- [key: string]: string | number;
117
- } | {
118
- [key: string]: string | number;
119
- }[];
116
+ export interface ITransformedPollDataType {
117
+ [key: string]: string | number | boolean | {
118
+ [key: string]: string | number | boolean;
119
+ };
120
+ }
121
+ export interface ITransformedPollData extends ICreatePollVars {
120
122
  }
121
123
  export interface IDiscussionFormFunctions extends IDiscussionFormFns {
122
124
  onChange?: (args: {
123
125
  [key: string]: string | string[] | boolean;
124
126
  }) => void;
125
127
  create: DiscussionCreateContentFunction;
126
- createPoll?: (args: ITransformedPollData) => void;
128
+ createPoll?: DiscussionCreatePollFunction;
127
129
  handleSaveEdit?: // eslint-disable-next-line @typescript-eslint/no-explicit-any
128
130
  ((args: any) => Promise<void>) | (() => void);
129
131
  handleCancel?: () => void;
@@ -33,6 +33,7 @@ export declare const Checkbox: ({ className, disabled, element, functions: allFu
33
33
  defaultInputs?: number | undefined;
34
34
  maxInputs: number;
35
35
  hasButton?: false | import("../../../../../..").ButtonPropsType | undefined;
36
+ allowDuplicateValues?: boolean | undefined;
36
37
  } | undefined;
37
38
  name?: string | undefined;
38
39
  options?: import("../../../form.types").IFieldOption[] | undefined;
@@ -46,6 +46,7 @@ export declare const Input: ({ className, element, id, inputRef: ref, functions,
46
46
  defaultInputs?: number | undefined;
47
47
  maxInputs: number;
48
48
  hasButton?: false | import("../../../../../..").ButtonPropsType | undefined;
49
+ allowDuplicateValues?: boolean | undefined;
49
50
  } | undefined;
50
51
  options?: import("../../../form.types").IFieldOption[] | undefined;
51
52
  props?: {
@@ -159,6 +159,8 @@ export interface IField {
159
159
  maxInputs: number;
160
160
  /** Whether to add options with a button */
161
161
  hasButton?: false | ButtonPropsType;
162
+ /** Whether we can have the same value across multiple input fields */
163
+ allowDuplicateValues?: boolean;
162
164
  };
163
165
  /** The name of the field */
164
166
  name?: string;
package/helpers/intl.d.ts CHANGED
@@ -236,6 +236,7 @@ export declare const checkIntlPathExists: (path: string, language?: {
236
236
  form_error_numbers: string;
237
237
  form_error_email: string;
238
238
  form_error_url: string;
239
+ form_error_multipleInputs_same: string;
239
240
  form_cancel: string;
240
241
  form_submit: string;
241
242
  form_submitting: string;