typescript-overlay-essentials 1.4.0 → 1.4.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.
@@ -2,19 +2,19 @@ import * as React from 'react';
2
2
  import { CSSProperties } from 'react';
3
3
  import './ConfirmationBox.css';
4
4
  export interface ConfirmationBoxState {
5
- headline?: string | undefined;
6
- message?: string | undefined;
7
- message1?: string | undefined;
8
- message2?: string | undefined;
9
- cancelButtonText?: string | undefined;
10
- proceedButtonText?: string | undefined;
11
- handlerOk?: ((args?: unknown) => void) | undefined;
12
- handlerCancel?: ((args?: unknown) => void) | undefined;
5
+ headline?: React.ReactNode;
6
+ message?: React.ReactNode;
7
+ message1?: React.ReactNode;
8
+ message2?: React.ReactNode;
9
+ cancelButtonText?: React.ReactNode;
10
+ proceedButtonText?: React.ReactNode;
11
+ handlerOk?: ((args?: unknown) => void);
12
+ handlerCancel?: ((args?: unknown) => void);
13
13
  handlerArgs?: unknown;
14
- addCloseButton?: boolean | undefined;
15
- activateConfirm?: boolean | undefined;
16
- proceedButtonStyle?: CSSProperties | undefined;
17
- cancelButtonStyle?: CSSProperties | undefined;
14
+ addCloseButton?: boolean;
15
+ activateConfirm?: boolean;
16
+ proceedButtonStyle?: CSSProperties;
17
+ cancelButtonStyle?: CSSProperties;
18
18
  }
19
19
  export declare const defaultConfirmationState: ConfirmationBoxState;
20
20
  export declare function ConfirmationBox({ state, setState }: {
@@ -2,13 +2,13 @@ import { CSSProperties } from 'react';
2
2
  import * as React from 'react';
3
3
  import './InfoOverlay.css';
4
4
  export interface InfoOverlayState {
5
- headline?: string | undefined;
6
- message?: string | undefined;
7
- proceedButtonText?: string | undefined;
8
- handler?: ((args?: unknown) => void) | undefined;
5
+ headline?: React.ReactNode;
6
+ message?: React.ReactNode;
7
+ proceedButtonText?: React.ReactNode;
8
+ handler?: ((args?: unknown) => void);
9
9
  handlerArgs?: unknown;
10
- addCloseButton?: boolean | undefined;
11
- style?: CSSProperties | undefined;
10
+ addCloseButton?: boolean;
11
+ style?: CSSProperties;
12
12
  }
13
13
  export declare const defaultInfoOverlayState: InfoOverlayState;
14
14
  export declare function InfoOverlay({ state, setState }: {
@@ -2,18 +2,18 @@ import { CSSProperties } from 'react';
2
2
  import * as React from 'react';
3
3
  import './InfoOverlayWithInput.css';
4
4
  export interface InfoOverlayWithInputState {
5
- headline?: string | undefined;
6
- message?: string | undefined;
7
- preInput?: string | undefined;
8
- placeholder?: string | undefined;
9
- cancelButtonText?: string | undefined;
10
- proceedButtonText?: string | undefined;
11
- handlerOk?: ((userInput: string, args?: unknown) => void) | undefined;
12
- handlerCancel?: ((args?: unknown) => void) | undefined;
5
+ headline?: React.ReactNode;
6
+ message?: React.ReactNode;
7
+ preInput?: string;
8
+ placeholder?: string;
9
+ cancelButtonText?: React.ReactNode;
10
+ proceedButtonText?: React.ReactNode;
11
+ handlerOk?: ((userInput: string, args?: unknown) => void);
12
+ handlerCancel?: ((args?: unknown) => void);
13
13
  handlerArgs?: unknown;
14
- addCloseButton?: boolean | undefined;
15
- proceedButtonStyle?: CSSProperties | undefined;
16
- cancelButtonStyle?: CSSProperties | undefined;
14
+ addCloseButton?: boolean;
15
+ proceedButtonStyle?: CSSProperties;
16
+ cancelButtonStyle?: CSSProperties;
17
17
  }
18
18
  export declare const defaultInfoOverlayWithInputState: InfoOverlayWithInputState;
19
19
  export declare function InfoOverlayWithInput({ state, setState }: {
@@ -1 +1 @@
1
- export declare function setInputFilter(textbox: HTMLElement | undefined, inputFilter: (value: string) => boolean, errMsg: string): void;
1
+ export declare function setInputFilter(inputFilter: (value: string) => boolean, errMsg: string, textbox?: HTMLElement): void;
@@ -1,5 +1,5 @@
1
1
  // Restricts input for the given textbox to the given inputFilter function.
2
- export function setInputFilter(textbox, inputFilter, errMsg) {
2
+ export function setInputFilter(inputFilter, errMsg, textbox) {
3
3
  ["input", "keydown", "keyup", "mousedown", "mouseup", "select", "contextmenu", "drop", "focusout"].forEach(function (event) {
4
4
  if (textbox) {
5
5
  textbox.addEventListener(event, function (e) {
@@ -1,10 +1,11 @@
1
1
  import { ReactElement } from 'react';
2
+ import * as React from 'react';
2
3
  import './LoadingOverlay.css';
3
4
  export interface LoadingOverlayState {
4
5
  isActive?: boolean;
5
- message?: string | undefined;
6
- color?: string | undefined;
7
- showSuccess?: boolean | undefined;
6
+ message?: React.ReactNode;
7
+ color?: string;
8
+ showSuccess?: boolean;
8
9
  }
9
10
  export declare const defaultLoadingOverlayState: LoadingOverlayState;
10
11
  export declare function LoadingOverlay({ state, setState }: {
@@ -2,18 +2,18 @@ import { CSSProperties } from 'react';
2
2
  import * as React from 'react';
3
3
  import './MultipleChoiceOverlay.css';
4
4
  export interface MultipleChoiceOverlayState {
5
- headline?: string | undefined;
6
- message?: string | undefined;
5
+ headline?: React.ReactNode;
6
+ message?: React.ReactNode;
7
7
  choices: string[] | [];
8
- preInput?: string[] | undefined;
9
- cancelButtonText?: string | undefined;
10
- proceedButtonText?: string | undefined;
11
- handlerOk?: ((userInput: string[], args?: unknown) => void) | undefined;
12
- handlerCancel?: ((args?: unknown) => void) | undefined;
8
+ preInput?: string[];
9
+ cancelButtonText?: React.ReactNode;
10
+ proceedButtonText?: React.ReactNode;
11
+ handlerOk?: ((userInput: string[], args?: unknown) => void);
12
+ handlerCancel?: ((args?: unknown) => void);
13
13
  handlerArgs?: unknown;
14
- addCloseButton?: boolean | undefined;
15
- proceedButtonStyle?: CSSProperties | undefined;
16
- cancelButtonStyle?: CSSProperties | undefined;
14
+ addCloseButton?: boolean;
15
+ proceedButtonStyle?: CSSProperties;
16
+ cancelButtonStyle?: CSSProperties;
17
17
  }
18
18
  export declare const defaultMultipleChoiceState: MultipleChoiceOverlayState;
19
19
  export declare function MultipleChoiceOverlay({ state, setState }: {
@@ -2,18 +2,18 @@ import { CSSProperties } from 'react';
2
2
  import * as React from 'react';
3
3
  import './MultipleRadioOverlay.css';
4
4
  export interface MultipleRadioOverlayState {
5
- headline?: string | undefined;
6
- message?: string | undefined;
5
+ headline?: React.ReactNode;
6
+ message?: React.ReactNode;
7
7
  choices: string[] | [];
8
- preInput?: string | undefined;
9
- cancelButtonText?: string | undefined;
10
- proceedButtonText?: string | undefined;
11
- handlerOk?: ((userInput: string, args?: unknown) => void) | undefined;
12
- handlerCancel?: ((args?: unknown) => void) | undefined;
8
+ preInput?: string;
9
+ cancelButtonText?: React.ReactNode;
10
+ proceedButtonText?: React.ReactNode;
11
+ handlerOk?: ((userInput: string, args?: unknown) => void);
12
+ handlerCancel?: ((args?: unknown) => void);
13
13
  handlerArgs?: unknown;
14
- addCloseButton?: boolean | undefined;
15
- proceedButtonStyle?: CSSProperties | undefined;
16
- cancelButtonStyle?: CSSProperties | undefined;
14
+ addCloseButton?: boolean;
15
+ proceedButtonStyle?: CSSProperties;
16
+ cancelButtonStyle?: CSSProperties;
17
17
  }
18
18
  export declare const defaultMultipleRadioState: MultipleRadioOverlayState;
19
19
  export declare function MultipleRadioOverlay({ state, setState }: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-overlay-essentials",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Eine kleine Ansammlung an praktischen Tools, die out of the Box genutzt werden können. Alle enthaltenen Overlays können als Reaktion auf etwas geöffnet werden und schließen sich danach automatisch. Es beinhaltet: \\n - [ConfirmationBox]: Ein Overlay mit einer ConfirmationBox (Fortfahren / Abbrechen), \\n - [InfoOverlay]: ein simples Overlay mit einer Informationsbox die man bestätigen kann, \\n - [InfoOverlayWithInput]: Ein Overlay bei dem ein User zusätzlich ein Freitext-Feld zur Eingabe hat, \\n - [LoadingOverlay]: Ein simples Overlay mit einer Lade-animation und optionalem Ladetext, \\n - [MultipleChoiceOverlay]: Ein simples Overlay bei dem ein Nutzer aus mehreren gegebenen Aktionen auswählen kann, \\n - [MultipleRadioOverlay]: Ein simples Overlay bei dem ein Nutzer genau eine aus mehreren gegebenen Aktionen auswählen kann, \\n - [Toast]: Ein simpler Toast der für kurze Zeit grün hinterlegt in der oberen rechten Ecke des Bildschirms angezeigt wird, \\n - [ToggleSwitch]: Eine Auswahl aus zwei Optionen aus denen ein Nutzer wählen kann in der Darstellung (Option 1 | Option 2), \\n - [Dropdown]: Ein simples Dropdown-Menü (auf Basis von react-select), welches einfacherer zu Konfigurieren ist und einige default-Einstellungen hat, \\n - [InputFilter]: Ein Tool was genutzt werden kann um auf einem Inputfeld einen Regex-Filter anzuwenden und dem User so nur Eingaben erlaubt die dem Filter entsprechen.",
5
5
  "keywords": [
6
6
  "typescript",