@apia/components 4.0.68 → 4.0.69

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/index.js CHANGED
@@ -1597,7 +1597,7 @@ class ApiaUtilNotifications {
1597
1597
  if (notification.type === "modal") {
1598
1598
  this.util.modals.open({
1599
1599
  size: "flex",
1600
- children: notification.message,
1600
+ html: notification.message,
1601
1601
  title: notification.title || "",
1602
1602
  onConfirm: () => {
1603
1603
  },
@@ -3512,7 +3512,12 @@ const SearchBox = observer((props) => {
3512
3512
  ) : /* @__PURE__ */ jsxs(
3513
3513
  Box,
3514
3514
  {
3515
- sx: { display: "flex", flexDirection: "row", alignItems: "center" },
3515
+ sx: {
3516
+ display: "flex",
3517
+ flexDirection: "row",
3518
+ alignItems: "center",
3519
+ width: "100%"
3520
+ },
3516
3521
  onClick: () => {
3517
3522
  handler.state.width = boxRef.current?.getBoundingClientRect().width ?? handler.state.width;
3518
3523
  handler.toggleOpen();
@@ -4296,7 +4301,8 @@ class DateInputController {
4296
4301
  }
4297
4302
  }
4298
4303
  onInputChange(ev) {
4299
- this.setValueFromString(ev.target.value);
4304
+ if (!this.state.disabled)
4305
+ this.setValueFromString(ev.target.value);
4300
4306
  }
4301
4307
  onCalendarSelect(value) {
4302
4308
  this.setValue(value);
@@ -4341,43 +4347,39 @@ class DateInputController {
4341
4347
  }
4342
4348
  }
4343
4349
  setValueFromString(str, fire = true) {
4344
- if (!this.state.disabled) {
4345
- if (str === "" || str.replaceAll("_", "9") === getMaskForDateFormat()) {
4346
- this.inputValue = "";
4347
- this.setValue(null, fire);
4348
- } else if (str !== this.inputValue) {
4349
- const hasPlaceHolder = str.match(/_/);
4350
- if (!hasPlaceHolder) {
4351
- const value = dayjs(str, dateFormat);
4352
- const formattedDate = value.format(dateFormat);
4353
- if (value.isValid() && formattedDate === str) {
4354
- this.setValue(value.toDate(), fire);
4355
- } else {
4356
- this.inputValue = str;
4357
- this.props.onError?.(getLabel("msgInvalidDate").text);
4358
- this.error = true;
4359
- }
4350
+ if (str === "" || str.replaceAll("_", "9") === getMaskForDateFormat()) {
4351
+ this.inputValue = "";
4352
+ this.setValue(null, fire);
4353
+ } else if (str !== this.inputValue) {
4354
+ const hasPlaceHolder = str.match(/_/);
4355
+ if (!hasPlaceHolder) {
4356
+ const value = dayjs(str, dateFormat);
4357
+ const formattedDate = value.format(dateFormat);
4358
+ if (value.isValid() && formattedDate === str) {
4359
+ this.setValue(value.toDate(), fire);
4360
4360
  } else {
4361
4361
  this.inputValue = str;
4362
+ this.props.onError?.(getLabel("msgInvalidDate").text);
4363
+ this.error = true;
4362
4364
  }
4365
+ } else {
4366
+ this.inputValue = str;
4363
4367
  }
4364
4368
  }
4365
4369
  }
4366
4370
  async setValue(date, fire = true) {
4367
- if (!this.state.disabled) {
4368
- this.error = false;
4369
- if (date !== this.value) {
4370
- const dateValue = dayjs(date);
4371
- const newValue = dateValue.isValid() ? dateValue.format(dateFormat) : "";
4372
- const res = fire ? await this.props.onChange?.(newValue) : null;
4373
- this.inputValue = newValue || "";
4374
- if (typeof res !== "string") {
4375
- this.value = date;
4376
- } else {
4377
- this.error = true;
4378
- this.value = null;
4379
- this.props.onError?.(res);
4380
- }
4371
+ this.error = false;
4372
+ if (date !== this.value) {
4373
+ const dateValue = dayjs(date);
4374
+ const newValue = dateValue.isValid() ? dateValue.format(dateFormat) : "";
4375
+ const res = fire ? await this.props.onChange?.(newValue) : null;
4376
+ this.inputValue = newValue || "";
4377
+ if (typeof res !== "string") {
4378
+ this.value = date;
4379
+ } else {
4380
+ this.error = true;
4381
+ this.value = null;
4382
+ this.props.onError?.(res);
4381
4383
  }
4382
4384
  }
4383
4385
  }
@@ -9679,9 +9681,6 @@ class TabsController {
9679
9681
  if (tab && tabProps) {
9680
9682
  if (!tabProps.isClosable && !force)
9681
9683
  return false;
9682
- await axios.post(
9683
- window.CONTEXT + "/apia.splash.MenuAction.run?action=removeTab&isAjax=true&tabId=" + tabId + window.TAB_ID_REQUEST
9684
- );
9685
9684
  const { onBeforeClose } = tabProps;
9686
9685
  if (onBeforeClose) {
9687
9686
  const canClose = await onBeforeClose();
@@ -9693,6 +9692,11 @@ class TabsController {
9693
9692
  });
9694
9693
  if (!hasConfirmed)
9695
9694
  return false;
9695
+ else {
9696
+ await axios.post(
9697
+ window.CONTEXT + "/apia.splash.MenuAction.run?action=removeTab&isAjax=true&tabId=" + tabId + window.TAB_ID_REQUEST
9698
+ );
9699
+ }
9696
9700
  }
9697
9701
  }
9698
9702
  this.state.openTabsHistory.delete(tab);