loon-bulma-react 2023.0.8 → 2023.0.10

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/README.md CHANGED
@@ -29,6 +29,7 @@
29
29
  - [Button & ButtonGroup](#component-button)
30
30
  - [Calendar](#components-calendar)
31
31
  - [MonthView](#components-calendar-monthview)
32
+ - [FourweeksView](#components-calendar-fourweeksview)
32
33
  - [WeekView](#components-calendar-weekview)
33
34
  - [DataTable](#component-datatable)
34
35
  - [Icons (FontAwesome)](#component-icons)
@@ -579,7 +580,7 @@ export type BaseEventProps = {
579
580
  };
580
581
  ```
581
582
 
582
- Op dit moment zijn er een `MonthView`-component en een `WeekView`-component.
583
+ Op dit moment zijn er een `MonthView`-component, een `FourweeksView`-component en een `WeekView`-component.
583
584
 
584
585
  De opties voor het instellen van de calendar zijn:
585
586
 
@@ -638,6 +639,23 @@ Deze component toont een maand + de rest van de weken die maar deels in een maan
638
639
  </>
639
640
  ```
640
641
 
642
+ ##### MonthView <a id="components-calendar-fourweeksview"></a>
643
+
644
+ Deze component toont een periode van 4 weken die hetzelfde periodenummer aanhgouden. De periode wordt getoond in een grid-view.
645
+
646
+ ```tsx
647
+ <>
648
+ <Calendar.Fourweeks
649
+ events={events}
650
+ viewDate={viewDate}
651
+ options={options}
652
+ onEventClick={(evt, clck) => console.log(evt, clck)}
653
+ onDayClick={(evt, clck) => console.log(evt, clck)}
654
+ onShowMore={(evt) => <p>Show some JSX</p>}
655
+ />
656
+ </>
657
+ ```
658
+
641
659
  ##### WeekView <A id="components-calendar-weekview"></a>
642
660
 
643
661
  Deze component toont een week. In plaats van een cel per dag werkt deze met cellen per uur per dag.
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { BaseEventProps, CalendarOptions } from './Props';
3
+ import { JSDateTime } from '~/utils';
4
+ declare type DayContainerProps<T extends BaseEventProps> = {
5
+ /** events op deze dag */
6
+ events: T[];
7
+ /** wat te doen als een event aangeklikt wordt */
8
+ onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
9
+ /** wat te doen als een dag aangeklikt wordt */
10
+ onDayClick?: (date: JSDateTime, clickEvent: React.MouseEvent<HTMLElement>) => void;
11
+ /** opties voor deze container */
12
+ options?: CalendarOptions<T>;
13
+ /** de datum voor de container */
14
+ date: JSDateTime;
15
+ };
16
+ /**
17
+ * Component voor de dag-container in de maand-view
18
+ * @param props
19
+ * @returns
20
+ */
21
+ export declare function DayContainer<T extends BaseEventProps>({ options, date, onDayClick, onEventClick, events, }: DayContainerProps<T>): JSX.Element;
22
+ export {};
@@ -0,0 +1,22 @@
1
+ import React from 'react';
2
+ import { BaseEventProps, CalendarOptions } from '../Props';
3
+ import { JSDateTime } from '~/utils';
4
+ declare type DayContainerProps<T extends BaseEventProps> = {
5
+ /** events op deze dag */
6
+ events: T[];
7
+ /** wat te doen als een event aangeklikt wordt */
8
+ onEventClick?: (event: T, clickEvent: React.MouseEvent<HTMLElement>) => void;
9
+ /** wat te doen als een dag aangeklikt wordt */
10
+ onDayClick?: (date: JSDateTime, clickEvent: React.MouseEvent<HTMLElement>) => void;
11
+ /** opties voor deze container */
12
+ options?: CalendarOptions<T>;
13
+ /** de datum voor de container */
14
+ date: JSDateTime;
15
+ };
16
+ /**
17
+ * Component voor de dag-container in de maand-view
18
+ * @param props
19
+ * @returns
20
+ */
21
+ export declare function DayContainer<T extends BaseEventProps>({ options, date, onDayClick, onEventClick, events, }: DayContainerProps<T>): JSX.Element;
22
+ export {};
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { JSDateTime } from '~/utils';
3
+ import { BaseEventProps, CalendarOptions } from '../Props';
4
+ declare type FourweekViewProps<T extends BaseEventProps> = {
5
+ /** events voor deze view */
6
+ events: T[];
7
+ /** opties voor deze view */
8
+ options?: CalendarOptions<T>;
9
+ /** event aangeklikt */
10
+ onEventClick?: (e: T, event: React.MouseEvent<HTMLElement>) => void;
11
+ /** dag-datum geklikt? */
12
+ onDayClick?: (date: JSDateTime, event: React.MouseEvent<HTMLElement>) => void;
13
+ /** huidige geselecteerde datum */
14
+ viewDate: Date | JSDateTime;
15
+ };
16
+ /**
17
+ * maak een vierweken-view (grid) met events
18
+ * @param props
19
+ * @returns
20
+ */
21
+ declare function FourweeksView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, onDayClick, events: orgEvents, }: FourweekViewProps<T>): JSX.Element;
22
+ export { FourweeksView };
23
+ export type { FourweekViewProps };
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import { JSDateTime } from '~/utils';
3
+ import { BaseEventProps, CalendarOptions } from '../Props';
4
+ declare type FourweekViewProps<T extends BaseEventProps> = {
5
+ /** events voor deze view */
6
+ events: T[];
7
+ /** opties voor deze view */
8
+ options?: CalendarOptions<T>;
9
+ /** event aangeklikt */
10
+ onEventClick?: (e: T, event: React.MouseEvent<HTMLElement>) => void;
11
+ /** dag-datum geklikt? */
12
+ onDayClick?: (date: JSDateTime, event: React.MouseEvent<HTMLElement>) => void;
13
+ /** huidige geselecteerde datum */
14
+ viewDate: Date | JSDateTime;
15
+ };
16
+ /**
17
+ * maak een maand-view (grid) met events
18
+ * @param props
19
+ * @returns
20
+ */
21
+ declare function FourweeksView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, onDayClick, events: orgEvents, }: FourweekViewProps<T>): JSX.Element;
22
+ export { FourweeksView };
23
+ export type { FourweekViewProps };
@@ -0,0 +1,20 @@
1
+ import { MouseEvent } from 'react';
2
+ import { BaseEventProps, EventOptions } from '../Props';
3
+ declare type MoreEventsViewProps<T extends BaseEventProps> = {
4
+ /** de events op deze dag */
5
+ events: T[];
6
+ /** event-click handling */
7
+ onEventClick?: (event: T, clickEvent: MouseEvent<HTMLElement>) => void;
8
+ /** global event options */
9
+ options?: {
10
+ allday?: EventOptions<T>;
11
+ timed?: EventOptions<T>;
12
+ };
13
+ };
14
+ /**
15
+ * expandable events als er meer dan 5 events op een dag vallen
16
+ * @param props
17
+ * @returns
18
+ */
19
+ export declare function MoreEventsView<T extends BaseEventProps>({ events, onEventClick, options, }: MoreEventsViewProps<T>): JSX.Element;
20
+ export {};
@@ -19,6 +19,6 @@ declare type WeekViewProps<T extends BaseEventProps> = {
19
19
  * @returns een weekview (grid) met de events
20
20
  * @ex
21
21
  */
22
- declare function WeekView<T extends BaseEventProps>(props: WeekViewProps<T>): JSX.Element;
22
+ declare function WeekView<T extends BaseEventProps>({ viewDate: vd, options, onEventClick, events: orgEvents, onDayClick, }: WeekViewProps<T>): JSX.Element;
23
23
  export { WeekView };
24
24
  export type { WeekViewProps };
@@ -1,8 +1,10 @@
1
+ import { FourweeksView } from "./Fourweeks/FourweeksView";
1
2
  import { MonthView, MonthViewProps } from "./Month/MonthView";
2
3
  import { WeekView, WeekViewProps } from "./Week/WeekView";
3
4
  declare const Calendar: {
4
5
  Month: typeof MonthView;
5
6
  Week: typeof WeekView;
7
+ Fourweeks: typeof FourweeksView;
6
8
  };
7
9
  export { Calendar };
8
10
  export type { WeekViewProps, MonthViewProps };
@@ -26,7 +26,7 @@ export declare type TagsProps = {
26
26
  /** alignment van de tags (default = 'l') */
27
27
  alignment?: AlignmentProp;
28
28
  /** extra classes op de tags container */
29
- className?: string | (() => string);
29
+ className?: string;
30
30
  };
31
31
  /**
32
32
  * Maak een tag
@@ -36,7 +36,7 @@ export declare type TagsProps = {
36
36
  * <Tag>Hello</Tag>
37
37
  * <Tag color='d'>Danger</Tag>
38
38
  */
39
- export declare function Tag(props: TagProps): JSX.Element;
39
+ export declare function Tag({ children, color, size, light, rounded, tooltip, onDismiss }: TagProps): JSX.Element;
40
40
  /**
41
41
  * Maak een tag-container aan. De tags kunnen aan elkaar geplakt worden of niet.
42
42
  * De grootte van de tags kan ook ingesteld worden
@@ -48,4 +48,4 @@ export declare function Tag(props: TagProps): JSX.Element;
48
48
  * <Tag color="i">Tag 2</Tag>
49
49
  * </Tags>
50
50
  */
51
- export declare function Tags(props: TagsProps): JSX.Element;
51
+ export declare function Tags({ children, merged, size, alignment, className }: TagsProps): JSX.Element;
@@ -28,6 +28,8 @@ declare type TitleWithSubtitleProps = {
28
28
  bulmaSize?: '1' | '2' | '3' | '4' | '5' | '6' | number;
29
29
  /** de heading grootte: h1, h2, h3, h4, h5 of h6 */
30
30
  headingSize?: '1' | '2' | '3' | '4' | '5' | '6' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | undefined | number;
31
+ /** (optionele) classes op de omringende container */
32
+ className?: string;
31
33
  };
32
34
  /**
33
35
  * Maak een heading. @see {@link TitleWithSubtitle} voor een combinatie met een subtitle.
@@ -55,6 +57,6 @@ declare function Subtitle(props: SubtitleProps): JSX.Element;
55
57
  * @returns een title met daaronder een subtitle.
56
58
  * @example <TitleWithSubtitle titleTxt="Title" subtitleTxt="Subtitle" bulmaSize={1} headingSize={3} />
57
59
  */
58
- declare function TitleWithSubtitle(props: TitleWithSubtitleProps): JSX.Element;
60
+ declare function TitleWithSubtitle({ bulmaSize: bulmaSizeVal, headingSize, titleTxt, subtitleTxt, className, }: TitleWithSubtitleProps): JSX.Element;
59
61
  export { Title, Subtitle, TitleWithSubtitle };
60
62
  export type { TitleProps, SubtitleProps, TitleWithSubtitleProps };
@@ -8,5 +8,5 @@ declare type InputErrorProps = {
8
8
  touched?: boolean;
9
9
  };
10
10
  /** Toon een erorr bij een input */
11
- declare const InputError: (props: InputErrorProps) => JSX.Element | null;
11
+ declare const InputError: ({ stateError, outsideError, touched }: InputErrorProps) => JSX.Element | null;
12
12
  export { InputError };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export type { SizeProp, AlignmentProp, DirectionProp } from './loon-react-bulma-types';
1
+ export * from './loon-react-bulma-types';
2
2
  export * from './components';
3
3
  export * from './forms';
4
4
  export * from './contexts';