@almadar/ui 5.32.1 → 5.32.3

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.
@@ -3692,6 +3692,13 @@ var init_Textarea = __esm({
3692
3692
  Textarea.displayName = "Textarea";
3693
3693
  }
3694
3694
  });
3695
+ function dispatchValueChange(onValueChange, eventBus, value) {
3696
+ if (typeof onValueChange === "string") {
3697
+ eventBus.emit(`UI:${onValueChange}`, { value });
3698
+ } else {
3699
+ onValueChange?.(value);
3700
+ }
3701
+ }
3695
3702
  function flatOptions(opts, groups) {
3696
3703
  const flat = opts ?? [];
3697
3704
  const grp = (groups ?? []).flatMap((g) => g.options);
@@ -3715,7 +3722,7 @@ function NativeSelect({
3715
3722
  } else {
3716
3723
  onChange?.(e);
3717
3724
  }
3718
- onValueChange?.(e.target.value);
3725
+ dispatchValueChange(onValueChange, eventBus, e.target.value);
3719
3726
  };
3720
3727
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3721
3728
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3775,7 +3782,7 @@ function RichSelect({
3775
3782
  if (typeof onChange === "string") {
3776
3783
  eventBus.emit(`UI:${onChange}`, { value: next });
3777
3784
  }
3778
- onValueChange?.(next);
3785
+ dispatchValueChange(onValueChange, eventBus, next);
3779
3786
  };
3780
3787
  const clear = (e) => {
3781
3788
  e.stopPropagation();
@@ -3783,7 +3790,7 @@ function RichSelect({
3783
3790
  if (typeof onChange === "string") {
3784
3791
  eventBus.emit(`UI:${onChange}`, { value: next });
3785
3792
  }
3786
- onValueChange?.(next);
3793
+ dispatchValueChange(onValueChange, eventBus, next);
3787
3794
  };
3788
3795
  React80.useEffect(() => {
3789
3796
  const handler = (e) => {
@@ -3643,6 +3643,13 @@ var init_Textarea = __esm({
3643
3643
  Textarea.displayName = "Textarea";
3644
3644
  }
3645
3645
  });
3646
+ function dispatchValueChange(onValueChange, eventBus, value) {
3647
+ if (typeof onValueChange === "string") {
3648
+ eventBus.emit(`UI:${onValueChange}`, { value });
3649
+ } else {
3650
+ onValueChange?.(value);
3651
+ }
3652
+ }
3646
3653
  function flatOptions(opts, groups) {
3647
3654
  const flat = opts ?? [];
3648
3655
  const grp = (groups ?? []).flatMap((g) => g.options);
@@ -3666,7 +3673,7 @@ function NativeSelect({
3666
3673
  } else {
3667
3674
  onChange?.(e);
3668
3675
  }
3669
- onValueChange?.(e.target.value);
3676
+ dispatchValueChange(onValueChange, eventBus, e.target.value);
3670
3677
  };
3671
3678
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3672
3679
  /* @__PURE__ */ jsxs(
@@ -3726,7 +3733,7 @@ function RichSelect({
3726
3733
  if (typeof onChange === "string") {
3727
3734
  eventBus.emit(`UI:${onChange}`, { value: next });
3728
3735
  }
3729
- onValueChange?.(next);
3736
+ dispatchValueChange(onValueChange, eventBus, next);
3730
3737
  };
3731
3738
  const clear = (e) => {
3732
3739
  e.stopPropagation();
@@ -3734,7 +3741,7 @@ function RichSelect({
3734
3741
  if (typeof onChange === "string") {
3735
3742
  eventBus.emit(`UI:${onChange}`, { value: next });
3736
3743
  }
3737
- onValueChange?.(next);
3744
+ dispatchValueChange(onValueChange, eventBus, next);
3738
3745
  };
3739
3746
  useEffect(() => {
3740
3747
  const handler = (e) => {
@@ -3428,6 +3428,13 @@ var init_Textarea = __esm({
3428
3428
  Textarea.displayName = "Textarea";
3429
3429
  }
3430
3430
  });
3431
+ function dispatchValueChange(onValueChange, eventBus, value) {
3432
+ if (typeof onValueChange === "string") {
3433
+ eventBus.emit(`UI:${onValueChange}`, { value });
3434
+ } else {
3435
+ onValueChange?.(value);
3436
+ }
3437
+ }
3431
3438
  function flatOptions(opts, groups) {
3432
3439
  const flat = opts ?? [];
3433
3440
  const grp = (groups ?? []).flatMap((g) => g.options);
@@ -3451,7 +3458,7 @@ function NativeSelect({
3451
3458
  } else {
3452
3459
  onChange?.(e);
3453
3460
  }
3454
- onValueChange?.(e.target.value);
3461
+ dispatchValueChange(onValueChange, eventBus, e.target.value);
3455
3462
  };
3456
3463
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "relative", children: [
3457
3464
  /* @__PURE__ */ jsxRuntime.jsxs(
@@ -3511,7 +3518,7 @@ function RichSelect({
3511
3518
  if (typeof onChange === "string") {
3512
3519
  eventBus.emit(`UI:${onChange}`, { value: next });
3513
3520
  }
3514
- onValueChange?.(next);
3521
+ dispatchValueChange(onValueChange, eventBus, next);
3515
3522
  };
3516
3523
  const clear = (e) => {
3517
3524
  e.stopPropagation();
@@ -3519,7 +3526,7 @@ function RichSelect({
3519
3526
  if (typeof onChange === "string") {
3520
3527
  eventBus.emit(`UI:${onChange}`, { value: next });
3521
3528
  }
3522
- onValueChange?.(next);
3529
+ dispatchValueChange(onValueChange, eventBus, next);
3523
3530
  };
3524
3531
  React79.useEffect(() => {
3525
3532
  const handler = (e) => {
@@ -3379,6 +3379,13 @@ var init_Textarea = __esm({
3379
3379
  Textarea.displayName = "Textarea";
3380
3380
  }
3381
3381
  });
3382
+ function dispatchValueChange(onValueChange, eventBus, value) {
3383
+ if (typeof onValueChange === "string") {
3384
+ eventBus.emit(`UI:${onValueChange}`, { value });
3385
+ } else {
3386
+ onValueChange?.(value);
3387
+ }
3388
+ }
3382
3389
  function flatOptions(opts, groups) {
3383
3390
  const flat = opts ?? [];
3384
3391
  const grp = (groups ?? []).flatMap((g) => g.options);
@@ -3402,7 +3409,7 @@ function NativeSelect({
3402
3409
  } else {
3403
3410
  onChange?.(e);
3404
3411
  }
3405
- onValueChange?.(e.target.value);
3412
+ dispatchValueChange(onValueChange, eventBus, e.target.value);
3406
3413
  };
3407
3414
  return /* @__PURE__ */ jsxs("div", { className: "relative", children: [
3408
3415
  /* @__PURE__ */ jsxs(
@@ -3462,7 +3469,7 @@ function RichSelect({
3462
3469
  if (typeof onChange === "string") {
3463
3470
  eventBus.emit(`UI:${onChange}`, { value: next });
3464
3471
  }
3465
- onValueChange?.(next);
3472
+ dispatchValueChange(onValueChange, eventBus, next);
3466
3473
  };
3467
3474
  const clear = (e) => {
3468
3475
  e.stopPropagation();
@@ -3470,7 +3477,7 @@ function RichSelect({
3470
3477
  if (typeof onChange === "string") {
3471
3478
  eventBus.emit(`UI:${onChange}`, { value: next });
3472
3479
  }
3473
- onValueChange?.(next);
3480
+ dispatchValueChange(onValueChange, eventBus, next);
3474
3481
  };
3475
3482
  useEffect(() => {
3476
3483
  const handler = (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@almadar/ui",
3
- "version": "5.32.1",
3
+ "version": "5.32.3",
4
4
  "description": "React UI components, hooks, and providers for Almadar",
5
5
  "type": "module",
6
6
  "sideEffects": [