dce-reactkit 3.9.4-beta-prompt.1 → 3.9.4-beta-prompt.2
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/index.js +7 -6
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/AppWrapper.d.ts +2 -2
- package/dist/esm/index.js +7 -6
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/AppWrapper.d.ts +2 -2
- package/dist/index.d.ts +2 -2
- package/package.json +1 -1
- package/src/components/AppWrapper.tsx +10 -10
|
@@ -58,9 +58,9 @@ export declare const confirm: (title: string, text: string, opts?: {
|
|
|
58
58
|
* @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
|
|
59
59
|
* @returns Promise that resolves with the input string or null if canceled
|
|
60
60
|
*/
|
|
61
|
-
export declare const prompt: (title: string, text: string,
|
|
62
|
-
placeholder?: string | undefined;
|
|
61
|
+
export declare const prompt: (title: string, text: string, opts?: {
|
|
63
62
|
defaultText?: string | undefined;
|
|
63
|
+
placeholder?: string | undefined;
|
|
64
64
|
confirmButtonText?: string | undefined;
|
|
65
65
|
confirmButtonVariant?: Variant | undefined;
|
|
66
66
|
cancelButtonText?: string | undefined;
|
package/dist/index.d.ts
CHANGED
|
@@ -77,9 +77,9 @@ declare const confirm: (title: string, text: string, opts?: {
|
|
|
77
77
|
* @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
|
|
78
78
|
* @returns Promise that resolves with the input string or null if canceled
|
|
79
79
|
*/
|
|
80
|
-
declare const prompt: (title: string, text: string,
|
|
81
|
-
placeholder?: string | undefined;
|
|
80
|
+
declare const prompt: (title: string, text: string, opts?: {
|
|
82
81
|
defaultText?: string | undefined;
|
|
82
|
+
placeholder?: string | undefined;
|
|
83
83
|
confirmButtonText?: string | undefined;
|
|
84
84
|
confirmButtonVariant?: Variant | undefined;
|
|
85
85
|
cancelButtonText?: string | undefined;
|
package/package.json
CHANGED
|
@@ -285,10 +285,9 @@ let onPromptClosed: (result: string | null) => void;
|
|
|
285
285
|
export const prompt = async (
|
|
286
286
|
title: string,
|
|
287
287
|
text: string,
|
|
288
|
-
currentInputFieldText: string,
|
|
289
288
|
opts?: {
|
|
290
|
-
placeholder?: string,
|
|
291
289
|
defaultText?: string,
|
|
290
|
+
placeholder?: string,
|
|
292
291
|
confirmButtonText?: string,
|
|
293
292
|
confirmButtonVariant?: Variant,
|
|
294
293
|
cancelButtonText?: string,
|
|
@@ -352,7 +351,7 @@ export const prompt = async (
|
|
|
352
351
|
setPromptInfo({
|
|
353
352
|
title,
|
|
354
353
|
text,
|
|
355
|
-
currentInputFieldText,
|
|
354
|
+
currentInputFieldText: (opts?.defaultText ?? ''),
|
|
356
355
|
opts: (opts ?? {}),
|
|
357
356
|
});
|
|
358
357
|
});
|
|
@@ -719,10 +718,11 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
719
718
|
onTopOfOtherModals
|
|
720
719
|
dontAllowBackdropExit
|
|
721
720
|
>
|
|
722
|
-
<div className="
|
|
721
|
+
<div className="p-3">
|
|
723
722
|
<p>{promptInfo.text}</p>
|
|
724
723
|
<input
|
|
725
724
|
type="text"
|
|
725
|
+
className="form-control mb-2"
|
|
726
726
|
placeholder={promptInfo.opts.placeholder}
|
|
727
727
|
value={promptInfo.currentInputFieldText}
|
|
728
728
|
onChange={(e) => {
|
|
@@ -733,14 +733,14 @@ const AppWrapper: React.FC<Props> = (props: Props): React.ReactElement => {
|
|
|
733
733
|
}}
|
|
734
734
|
/>
|
|
735
735
|
{minNumCharsValidationError && (
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
736
|
+
<div className="text-danger fw-bold mt-2">
|
|
737
|
+
{minNumCharsValidationError}
|
|
738
|
+
</div>
|
|
739
739
|
)}
|
|
740
740
|
{customValidationError && (
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
741
|
+
<div className="text-danger fw-bold mt-2">
|
|
742
|
+
{customValidationError}
|
|
743
|
+
</div>
|
|
744
744
|
)}
|
|
745
745
|
</div>
|
|
746
746
|
</ModalForWrapper>
|