sevago-library 1.7.8 → 1.7.9
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/CHANGELOG.md +6 -0
- package/dist/index.cjs.js +72 -72
- package/dist/index.esm.js +8612 -8422
- package/dist/src/components/elements/floating-tools/floating-tools.element.stories.d.ts +1 -0
- package/dist/src/components/elements/text-field/text-field.element.stories.d.ts +0 -11
- package/dist/src/components/elements/text-field/use-scan-replace-input.constant.d.ts +6 -0
- package/dist/src/components/elements/text-field/use-scan-replace-input.d.ts +2 -20
- package/dist/src/components/elements/text-field/use-scan-replace-input.interface.d.ts +27 -0
- package/package.json +1 -1
|
@@ -3,15 +3,4 @@ import { TextFieldElement } from './text-field.element';
|
|
|
3
3
|
declare const meta: Meta<typeof TextFieldElement>;
|
|
4
4
|
export default meta;
|
|
5
5
|
type Story = StoryObj<typeof TextFieldElement>;
|
|
6
|
-
export declare const Default: Story;
|
|
7
|
-
export declare const WithoutLabel: Story;
|
|
8
|
-
export declare const Required: Story;
|
|
9
|
-
export declare const ErrorState: Story;
|
|
10
|
-
export declare const Multiline: Story;
|
|
11
6
|
export declare const ScanReplace: Story;
|
|
12
|
-
export declare const ScanVietnameseIme: Story;
|
|
13
|
-
export declare const ScanVietnameseLayout: Story;
|
|
14
|
-
export declare const ScanVietnameseImeRewrite: Story;
|
|
15
|
-
export declare const ScanAlwaysEnglish: Story;
|
|
16
|
-
export declare const VietnameseTyping: Story;
|
|
17
|
-
export declare const ScanDisabledVietnamese: Story;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const DEFAULT_SCAN_THRESHOLD_MS = 80;
|
|
2
|
+
export declare const DEFAULT_SCAN_MIN_LENGTH = 4;
|
|
3
|
+
export declare const MODIFIER_KEYS: Set<string>;
|
|
4
|
+
export declare const SCANNER_REVERSE_MAP: Record<string, string>;
|
|
5
|
+
export declare const SHIFTED_DIGITS: Record<string, string>;
|
|
6
|
+
export declare const PUNCTUATION: Record<string, string>;
|
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
type Options = {
|
|
4
|
-
enabled: boolean;
|
|
5
|
-
onReplace: (value: string) => void;
|
|
6
|
-
thresholdMs?: number;
|
|
7
|
-
minLength?: number;
|
|
8
|
-
};
|
|
9
|
-
export declare const useScanReplaceInput: ({ enabled, onReplace, thresholdMs, minLength }: Options) => {
|
|
10
|
-
inputRef: React.RefObject<ScanInputNode | null>;
|
|
11
|
-
resetScan: () => void;
|
|
12
|
-
selectInput: () => void;
|
|
13
|
-
handleChange: React.ChangeEventHandler<ScanInputNode>;
|
|
14
|
-
handleInputCapture: React.FormEventHandler<HTMLElement>;
|
|
15
|
-
handleCompositionEnd: React.CompositionEventHandler<HTMLElement>;
|
|
16
|
-
handlePaste: React.ClipboardEventHandler<HTMLElement>;
|
|
17
|
-
handleKeyDownCapture: React.KeyboardEventHandler<HTMLElement>;
|
|
18
|
-
handleKeyUpCapture: React.KeyboardEventHandler<HTMLElement>;
|
|
19
|
-
};
|
|
20
|
-
export {};
|
|
1
|
+
import { UseScanReplaceInputOptions, UseScanReplaceInputResult } from './use-scan-replace-input.interface';
|
|
2
|
+
export declare const useScanReplaceInput: ({ enabled, onReplace, thresholdMs, minLength, }: UseScanReplaceInputOptions) => UseScanReplaceInputResult;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type * as React from 'react';
|
|
2
|
+
export type ScanInputNode = HTMLInputElement | HTMLTextAreaElement;
|
|
3
|
+
export interface ScanCandidate {
|
|
4
|
+
value: string;
|
|
5
|
+
time: number;
|
|
6
|
+
}
|
|
7
|
+
export interface ScanState extends ScanCandidate {
|
|
8
|
+
active: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface UseScanReplaceInputOptions {
|
|
11
|
+
enabled: boolean;
|
|
12
|
+
onReplace: (value: string) => void;
|
|
13
|
+
thresholdMs?: number;
|
|
14
|
+
minLength?: number;
|
|
15
|
+
}
|
|
16
|
+
export interface UseScanReplaceInputResult {
|
|
17
|
+
inputRef: React.RefObject<ScanInputNode | null>;
|
|
18
|
+
resetScan: () => void;
|
|
19
|
+
selectInput: () => void;
|
|
20
|
+
handleBeforeInput: React.FormEventHandler<HTMLElement>;
|
|
21
|
+
handleChange: React.ChangeEventHandler<ScanInputNode>;
|
|
22
|
+
handleInputCapture: React.FormEventHandler<HTMLElement>;
|
|
23
|
+
handleCompositionEnd: React.CompositionEventHandler<HTMLElement>;
|
|
24
|
+
handlePaste: React.ClipboardEventHandler<HTMLElement>;
|
|
25
|
+
handleKeyDownCapture: React.KeyboardEventHandler<HTMLElement>;
|
|
26
|
+
handleKeyUpCapture: React.KeyboardEventHandler<HTMLElement>;
|
|
27
|
+
}
|