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.
@@ -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, currentInputFieldText: string, opts?: {
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/esm/index.js CHANGED
@@ -1076,7 +1076,7 @@ let onPromptClosed;
1076
1076
  * @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
1077
1077
  * @returns Promise that resolves with the input string or null if canceled
1078
1078
  */
1079
- const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, void 0, void 0, function* () {
1079
+ const prompt = (title, text, opts) => __awaiter(void 0, void 0, void 0, function* () {
1080
1080
  var _a;
1081
1081
  // Wait for helper to exist
1082
1082
  yield waitForHelper(() => {
@@ -1109,6 +1109,7 @@ const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, v
1109
1109
  }
1110
1110
  // Return promise that resolves with result of prompt
1111
1111
  return new Promise((resolve) => {
1112
+ var _a;
1112
1113
  // Setup handler
1113
1114
  onPromptClosed = (result) => {
1114
1115
  resolve(result);
@@ -1117,7 +1118,7 @@ const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, v
1117
1118
  setPromptInfo({
1118
1119
  title,
1119
1120
  text,
1120
- currentInputFieldText,
1121
+ currentInputFieldText: ((_a = opts === null || opts === void 0 ? void 0 : opts.defaultText) !== null && _a !== void 0 ? _a : ''),
1121
1122
  opts: (opts !== null && opts !== void 0 ? opts : {}),
1122
1123
  });
1123
1124
  });
@@ -1328,13 +1329,13 @@ const AppWrapper = (props) => {
1328
1329
  onPromptClosed(result);
1329
1330
  }
1330
1331
  }, onTopOfOtherModals: true, dontAllowBackdropExit: true },
1331
- React__default.createElement("div", { className: "d-flex flex-column align-items-center" },
1332
+ React__default.createElement("div", { className: "p-3" },
1332
1333
  React__default.createElement("p", null, promptInfo.text),
1333
- React__default.createElement("input", { type: "text", placeholder: promptInfo.opts.placeholder, value: promptInfo.currentInputFieldText, onChange: (e) => {
1334
+ React__default.createElement("input", { type: "text", className: "form-control mb-2", placeholder: promptInfo.opts.placeholder, value: promptInfo.currentInputFieldText, onChange: (e) => {
1334
1335
  return setPromptInfo(Object.assign(Object.assign({}, promptInfo), { currentInputFieldText: e.target.value }));
1335
1336
  } }),
1336
- minNumCharsValidationError && (React__default.createElement("div", { className: "text-danger bg-danger bg-opacity-25 p-2 m-1 rounded" }, minNumCharsValidationError)),
1337
- customValidationError && (React__default.createElement("div", { className: "text-danger bg-danger bg-opacity-25 p-2 m-1 rounded" }, customValidationError)))));
1337
+ minNumCharsValidationError && (React__default.createElement("div", { className: "text-danger fw-bold mt-2" }, minNumCharsValidationError)),
1338
+ customValidationError && (React__default.createElement("div", { className: "text-danger fw-bold mt-2" }, customValidationError)))));
1338
1339
  }
1339
1340
  /* ------ Custom Modal Portals ------ */
1340
1341
  // Custom modal portals