@equinor/apollo-components 3.2.0-beta.3 → 3.2.0-beta.4

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
@@ -3546,7 +3546,12 @@ function addFormMeta(withoutFormMeta) {
3546
3546
 
3547
3547
  // src/form-cells/EditableCheckboxCell.tsx
3548
3548
  var import_jsx_runtime21 = require("react/jsx-runtime");
3549
- function EditableCheckboxCell(context) {
3549
+ function EditableCheckboxCell(_a) {
3550
+ var _b = _a, {
3551
+ onChange: onChangeFromProps
3552
+ } = _b, context = __objRest(_b, [
3553
+ "onChange"
3554
+ ]);
3550
3555
  const editMode = useEditMode();
3551
3556
  if (!editMode)
3552
3557
  return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
@@ -3563,9 +3568,21 @@ function EditableCheckboxCell(context) {
3563
3568
  import_react_hook_form2.Controller,
3564
3569
  {
3565
3570
  name: context.column.id,
3566
- render: (_a) => {
3567
- var { field: _b } = _a, _c = _b, { value } = _c, field = __objRest(_c, ["value"]);
3568
- return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_eds_core_react20.Checkbox, __spreadValues({ enterKeyHint: "send", "aria-label": "editable", checked: value }, field));
3571
+ render: (_a2) => {
3572
+ var { field: _b2 } = _a2, _c = _b2, { value, onChange } = _c, field = __objRest(_c, ["value", "onChange"]);
3573
+ return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
3574
+ import_eds_core_react20.Checkbox,
3575
+ __spreadProps(__spreadValues({
3576
+ enterKeyHint: "send",
3577
+ "aria-label": "editable",
3578
+ checked: value
3579
+ }, field), {
3580
+ onChange: (e) => {
3581
+ onChange(e);
3582
+ onChangeFromProps == null ? void 0 : onChangeFromProps(e.target.checked);
3583
+ }
3584
+ })
3585
+ );
3569
3586
  }
3570
3587
  }
3571
3588
  );
@@ -3647,11 +3664,9 @@ function EditableDateCell(_a) {
3647
3664
  autoComplete: "none",
3648
3665
  value: value ? parseISODate(value) : "",
3649
3666
  onChange: (e) => {
3650
- onChange(e.target.value ? parseISODate(e.target.value) : "");
3651
- onChangeFromProps == null ? void 0 : onChangeFromProps(
3652
- e.target.value ? parseISODate(e.target.value) : "",
3653
- context.row.original
3654
- );
3667
+ const newDateString = e.target.value ? parseISODate(e.target.value) : "";
3668
+ onChange(newDateString);
3669
+ onChangeFromProps == null ? void 0 : onChangeFromProps(newDateString);
3655
3670
  }
3656
3671
  }, getHelperTextProps({ error: errorFromProps != null ? errorFromProps : error })), field)
3657
3672
  );
@@ -3741,10 +3756,12 @@ function buildEmptyOption() {
3741
3756
  function EditableDropdownSingleCell(_a) {
3742
3757
  var _b = _a, {
3743
3758
  options,
3744
- error: errorFromProps
3759
+ error: errorFromProps,
3760
+ onChange: onChangeFromProps
3745
3761
  } = _b, context = __objRest(_b, [
3746
3762
  "options",
3747
- "error"
3763
+ "error",
3764
+ "onChange"
3748
3765
  ]);
3749
3766
  const editMode = useEditMode();
3750
3767
  if (!editMode)
@@ -3774,6 +3791,7 @@ function EditableDropdownSingleCell(_a) {
3774
3791
  onOptionsChange: (changes) => {
3775
3792
  const [change] = changes.selectedItems;
3776
3793
  onChange(change == null ? void 0 : change.value);
3794
+ onChangeFromProps(change);
3777
3795
  }
3778
3796
  }, field)
3779
3797
  ),
@@ -3850,10 +3868,12 @@ var import_jsx_runtime27 = require("react/jsx-runtime");
3850
3868
  function EditableTextAreaCell(_a) {
3851
3869
  var _b = _a, {
3852
3870
  title,
3853
- error: errorFromProps
3871
+ error: errorFromProps,
3872
+ onChange: onChangeFromProps
3854
3873
  } = _b, context = __objRest(_b, [
3855
3874
  "title",
3856
- "error"
3875
+ "error",
3876
+ "onChange"
3857
3877
  ]);
3858
3878
  const [textareaValue, setTextareaValue] = (0, import_react9.useState)(context.getValue());
3859
3879
  const [open, setOpen] = (0, import_react9.useState)(false);
@@ -3898,6 +3918,7 @@ function EditableTextAreaCell(_a) {
3898
3918
  onClose: () => {
3899
3919
  closeDialog();
3900
3920
  onChange(textareaValue);
3921
+ onChangeFromProps == null ? void 0 : onChangeFromProps(textareaValue);
3901
3922
  },
3902
3923
  isDismissable: true,
3903
3924
  style: { width: "min(50rem, calc(100vw - 4rem))" },
@@ -3927,6 +3948,7 @@ function EditableTextAreaCell(_a) {
3927
3948
  onClick: () => {
3928
3949
  closeDialog();
3929
3950
  onChange(textareaValue);
3951
+ onChangeFromProps == null ? void 0 : onChangeFromProps(textareaValue);
3930
3952
  },
3931
3953
  children: "Submit"
3932
3954
  }
package/dist/index.mjs CHANGED
@@ -3509,7 +3509,12 @@ function addFormMeta(withoutFormMeta) {
3509
3509
 
3510
3510
  // src/form-cells/EditableCheckboxCell.tsx
3511
3511
  import { jsx as jsx21 } from "react/jsx-runtime";
3512
- function EditableCheckboxCell(context) {
3512
+ function EditableCheckboxCell(_a) {
3513
+ var _b = _a, {
3514
+ onChange: onChangeFromProps
3515
+ } = _b, context = __objRest(_b, [
3516
+ "onChange"
3517
+ ]);
3513
3518
  const editMode = useEditMode();
3514
3519
  if (!editMode)
3515
3520
  return /* @__PURE__ */ jsx21(
@@ -3526,9 +3531,21 @@ function EditableCheckboxCell(context) {
3526
3531
  Controller,
3527
3532
  {
3528
3533
  name: context.column.id,
3529
- render: (_a) => {
3530
- var { field: _b } = _a, _c = _b, { value } = _c, field = __objRest(_c, ["value"]);
3531
- return /* @__PURE__ */ jsx21(Checkbox4, __spreadValues({ enterKeyHint: "send", "aria-label": "editable", checked: value }, field));
3534
+ render: (_a2) => {
3535
+ var { field: _b2 } = _a2, _c = _b2, { value, onChange } = _c, field = __objRest(_c, ["value", "onChange"]);
3536
+ return /* @__PURE__ */ jsx21(
3537
+ Checkbox4,
3538
+ __spreadProps(__spreadValues({
3539
+ enterKeyHint: "send",
3540
+ "aria-label": "editable",
3541
+ checked: value
3542
+ }, field), {
3543
+ onChange: (e) => {
3544
+ onChange(e);
3545
+ onChangeFromProps == null ? void 0 : onChangeFromProps(e.target.checked);
3546
+ }
3547
+ })
3548
+ );
3532
3549
  }
3533
3550
  }
3534
3551
  );
@@ -3610,11 +3627,9 @@ function EditableDateCell(_a) {
3610
3627
  autoComplete: "none",
3611
3628
  value: value ? parseISODate(value) : "",
3612
3629
  onChange: (e) => {
3613
- onChange(e.target.value ? parseISODate(e.target.value) : "");
3614
- onChangeFromProps == null ? void 0 : onChangeFromProps(
3615
- e.target.value ? parseISODate(e.target.value) : "",
3616
- context.row.original
3617
- );
3630
+ const newDateString = e.target.value ? parseISODate(e.target.value) : "";
3631
+ onChange(newDateString);
3632
+ onChangeFromProps == null ? void 0 : onChangeFromProps(newDateString);
3618
3633
  }
3619
3634
  }, getHelperTextProps({ error: errorFromProps != null ? errorFromProps : error })), field)
3620
3635
  );
@@ -3704,10 +3719,12 @@ function buildEmptyOption() {
3704
3719
  function EditableDropdownSingleCell(_a) {
3705
3720
  var _b = _a, {
3706
3721
  options,
3707
- error: errorFromProps
3722
+ error: errorFromProps,
3723
+ onChange: onChangeFromProps
3708
3724
  } = _b, context = __objRest(_b, [
3709
3725
  "options",
3710
- "error"
3726
+ "error",
3727
+ "onChange"
3711
3728
  ]);
3712
3729
  const editMode = useEditMode();
3713
3730
  if (!editMode)
@@ -3737,6 +3754,7 @@ function EditableDropdownSingleCell(_a) {
3737
3754
  onOptionsChange: (changes) => {
3738
3755
  const [change] = changes.selectedItems;
3739
3756
  onChange(change == null ? void 0 : change.value);
3757
+ onChangeFromProps(change);
3740
3758
  }
3741
3759
  }, field)
3742
3760
  ),
@@ -3813,10 +3831,12 @@ import { Fragment as Fragment7, jsx as jsx27, jsxs as jsxs14 } from "react/jsx-r
3813
3831
  function EditableTextAreaCell(_a) {
3814
3832
  var _b = _a, {
3815
3833
  title,
3816
- error: errorFromProps
3834
+ error: errorFromProps,
3835
+ onChange: onChangeFromProps
3817
3836
  } = _b, context = __objRest(_b, [
3818
3837
  "title",
3819
- "error"
3838
+ "error",
3839
+ "onChange"
3820
3840
  ]);
3821
3841
  const [textareaValue, setTextareaValue] = useState7(context.getValue());
3822
3842
  const [open, setOpen] = useState7(false);
@@ -3861,6 +3881,7 @@ function EditableTextAreaCell(_a) {
3861
3881
  onClose: () => {
3862
3882
  closeDialog();
3863
3883
  onChange(textareaValue);
3884
+ onChangeFromProps == null ? void 0 : onChangeFromProps(textareaValue);
3864
3885
  },
3865
3886
  isDismissable: true,
3866
3887
  style: { width: "min(50rem, calc(100vw - 4rem))" },
@@ -3890,6 +3911,7 @@ function EditableTextAreaCell(_a) {
3890
3911
  onClick: () => {
3891
3912
  closeDialog();
3892
3913
  onChange(textareaValue);
3914
+ onChangeFromProps == null ? void 0 : onChangeFromProps(textareaValue);
3893
3915
  },
3894
3916
  children: "Submit"
3895
3917
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@equinor/apollo-components",
3
- "version": "3.2.0-beta.3",
3
+ "version": "3.2.0-beta.4",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",