baaz-custom-components 3.2.1 → 3.2.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.
package/dist/index.js CHANGED
@@ -429,9 +429,11 @@ function ScrollBar(_a) {
429
429
  var import_jsx_runtime6 = require("react/jsx-runtime");
430
430
  function SrpDropDown({
431
431
  hubIds,
432
- onChange
432
+ onChange,
433
+ userData
433
434
  }) {
434
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Select, { onValueChange: onChange, children: [
435
+ const defaultValue = userData.currentHubId.toString();
436
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(Select, { onValueChange: onChange, defaultValue, children: [
435
437
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectTrigger, { className: "w-[100px] cursor-pointer", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectValue, { placeholder: "Hub Id" }) }),
436
438
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectContent, { children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(ScrollArea, { className: "h-40 w-full", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(SelectGroup, { className: "cursor-pointer", children: hubIds == null ? void 0 : hubIds.map((hubId, index) => /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)("div", { children: [
437
439
  /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
@@ -461,7 +463,7 @@ var User = ({
461
463
  role: "User",
462
464
  email: "No email provided",
463
465
  phone: "No phone provided",
464
- currentHubId: 9
466
+ currentHubId: 8
465
467
  };
466
468
  const [selectedHubId, setSelectedHubId] = (0, import_react.useState)(
467
469
  safeUserData.currentHubId
@@ -521,7 +523,11 @@ var User = ({
521
523
  SrpDropDown,
522
524
  {
523
525
  hubIds,
524
- onChange: hubIdChangeHandler ? hubIdChangeHandler : handleChange
526
+ userData: safeUserData,
527
+ onChange: (value) => {
528
+ handleChange(value);
529
+ if (hubIdChangeHandler) hubIdChangeHandler(value);
530
+ }
525
531
  }
526
532
  )
527
533
  ] }),
package/dist/index.mjs CHANGED
@@ -395,9 +395,11 @@ function ScrollBar(_a) {
395
395
  import { jsx as jsx6, jsxs as jsxs4 } from "react/jsx-runtime";
396
396
  function SrpDropDown({
397
397
  hubIds,
398
- onChange
398
+ onChange,
399
+ userData
399
400
  }) {
400
- return /* @__PURE__ */ jsxs4(Select, { onValueChange: onChange, children: [
401
+ const defaultValue = userData.currentHubId.toString();
402
+ return /* @__PURE__ */ jsxs4(Select, { onValueChange: onChange, defaultValue, children: [
401
403
  /* @__PURE__ */ jsx6(SelectTrigger, { className: "w-[100px] cursor-pointer", children: /* @__PURE__ */ jsx6(SelectValue, { placeholder: "Hub Id" }) }),
402
404
  /* @__PURE__ */ jsx6(SelectContent, { children: /* @__PURE__ */ jsx6(ScrollArea, { className: "h-40 w-full", children: /* @__PURE__ */ jsx6(SelectGroup, { className: "cursor-pointer", children: hubIds == null ? void 0 : hubIds.map((hubId, index) => /* @__PURE__ */ jsxs4("div", { children: [
403
405
  /* @__PURE__ */ jsx6(
@@ -427,7 +429,7 @@ var User = ({
427
429
  role: "User",
428
430
  email: "No email provided",
429
431
  phone: "No phone provided",
430
- currentHubId: 9
432
+ currentHubId: 8
431
433
  };
432
434
  const [selectedHubId, setSelectedHubId] = useState2(
433
435
  safeUserData.currentHubId
@@ -487,7 +489,11 @@ var User = ({
487
489
  SrpDropDown,
488
490
  {
489
491
  hubIds,
490
- onChange: hubIdChangeHandler ? hubIdChangeHandler : handleChange
492
+ userData: safeUserData,
493
+ onChange: (value) => {
494
+ handleChange(value);
495
+ if (hubIdChangeHandler) hubIdChangeHandler(value);
496
+ }
491
497
  }
492
498
  )
493
499
  ] }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "baaz-custom-components",
3
- "version": "3.2.1",
3
+ "version": "3.2.3",
4
4
  "private": false,
5
5
  "sideEffects": false,
6
6
  "main": "dist/index.js",