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 CHANGED
@@ -1104,7 +1104,7 @@ let onPromptClosed;
1104
1104
  * @param [opts.cancelButtonVariant=Variant.Secondary] the variant of the cancel button
1105
1105
  * @returns Promise that resolves with the input string or null if canceled
1106
1106
  */
1107
- const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, void 0, void 0, function* () {
1107
+ const prompt = (title, text, opts) => __awaiter(void 0, void 0, void 0, function* () {
1108
1108
  var _a;
1109
1109
  // Wait for helper to exist
1110
1110
  yield waitForHelper(() => {
@@ -1137,6 +1137,7 @@ const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, v
1137
1137
  }
1138
1138
  // Return promise that resolves with result of prompt
1139
1139
  return new Promise((resolve) => {
1140
+ var _a;
1140
1141
  // Setup handler
1141
1142
  onPromptClosed = (result) => {
1142
1143
  resolve(result);
@@ -1145,7 +1146,7 @@ const prompt = (title, text, currentInputFieldText, opts) => __awaiter(void 0, v
1145
1146
  setPromptInfo({
1146
1147
  title,
1147
1148
  text,
1148
- currentInputFieldText,
1149
+ currentInputFieldText: ((_a = opts === null || opts === void 0 ? void 0 : opts.defaultText) !== null && _a !== void 0 ? _a : ''),
1149
1150
  opts: (opts !== null && opts !== void 0 ? opts : {}),
1150
1151
  });
1151
1152
  });
@@ -1356,13 +1357,13 @@ const AppWrapper = (props) => {
1356
1357
  onPromptClosed(result);
1357
1358
  }
1358
1359
  }, onTopOfOtherModals: true, dontAllowBackdropExit: true },
1359
- React__default["default"].createElement("div", { className: "d-flex flex-column align-items-center" },
1360
+ React__default["default"].createElement("div", { className: "p-3" },
1360
1361
  React__default["default"].createElement("p", null, promptInfo.text),
1361
- React__default["default"].createElement("input", { type: "text", placeholder: promptInfo.opts.placeholder, value: promptInfo.currentInputFieldText, onChange: (e) => {
1362
+ React__default["default"].createElement("input", { type: "text", className: "form-control mb-2", placeholder: promptInfo.opts.placeholder, value: promptInfo.currentInputFieldText, onChange: (e) => {
1362
1363
  return setPromptInfo(Object.assign(Object.assign({}, promptInfo), { currentInputFieldText: e.target.value }));
1363
1364
  } }),
1364
- minNumCharsValidationError && (React__default["default"].createElement("div", { className: "text-danger bg-danger bg-opacity-25 p-2 m-1 rounded" }, minNumCharsValidationError)),
1365
- customValidationError && (React__default["default"].createElement("div", { className: "text-danger bg-danger bg-opacity-25 p-2 m-1 rounded" }, customValidationError)))));
1365
+ minNumCharsValidationError && (React__default["default"].createElement("div", { className: "text-danger fw-bold mt-2" }, minNumCharsValidationError)),
1366
+ customValidationError && (React__default["default"].createElement("div", { className: "text-danger fw-bold mt-2" }, customValidationError)))));
1366
1367
  }
1367
1368
  /* ------ Custom Modal Portals ------ */
1368
1369
  // Custom modal portals