@grafana/k6-test-builder 0.8.21 → 0.8.24

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
@@ -10833,14 +10833,12 @@ const $ab4876a2c16b3c35$export$f348fa2be2f68942 = /*#__PURE__*/ (0, ($parcel$int
10833
10833
 
10834
10834
  const $473b9ed3fed6b67a$export$73be308c62ac8dac = ({ labelMap: labelMap, index: index, variable: variable, onChange: onChange, deleteCheck: deleteCheck, showAttributeColumn: showAttributeColumn })=>{
10835
10835
  const [itemState, setItemState] = (0, $bc2668a655363c50$export$64bcfd5faff4adc3)(variable);
10836
- const hasChanged = (0, $gkIgo$react.useCallback)(()=>{
10837
- return !(0, $gkIgo$lodashes.isEqual)(variable, itemState);
10838
- }, [
10836
+ const hasChanged = (0, $gkIgo$react.useMemo)(()=>!(0, $gkIgo$lodashes.isEqual)(variable, itemState), [
10839
10837
  itemState,
10840
10838
  variable
10841
10839
  ]);
10842
10840
  const updateVariable = (0, $gkIgo$react.useCallback)(()=>{
10843
- if (hasChanged()) {
10841
+ if (hasChanged) {
10844
10842
  const newAttribute = {
10845
10843
  ...itemState
10846
10844
  };
@@ -10853,12 +10851,6 @@ const $473b9ed3fed6b67a$export$73be308c62ac8dac = ({ labelMap: labelMap, index:
10853
10851
  itemState,
10854
10852
  onChange
10855
10853
  ]);
10856
- (0, $gkIgo$react.useEffect)(()=>{
10857
- updateVariable();
10858
- }, [
10859
- itemState.attribute,
10860
- updateVariable
10861
- ]);
10862
10854
  const handleDelete = ()=>{
10863
10855
  deleteCheck(index);
10864
10856
  };
@@ -10874,6 +10866,10 @@ const $473b9ed3fed6b67a$export$73be308c62ac8dac = ({ labelMap: labelMap, index:
10874
10866
  setItemState({
10875
10867
  attribute: attribute
10876
10868
  });
10869
+ onChange(index, {
10870
+ ...itemState,
10871
+ attribute: attribute
10872
+ });
10877
10873
  };
10878
10874
  const selectorType = itemState.attribute === undefined ? (0, $fa7352d9619e086b$export$1e2bdbe61d832736).InnerHTML : (0, $fa7352d9619e086b$export$1e2bdbe61d832736).Attribute;
10879
10875
  const showAttributeInput = showAttributeColumn && selectorType === (0, $fa7352d9619e086b$export$1e2bdbe61d832736).Attribute;
@@ -15756,7 +15752,7 @@ const $420b9b2911eb0b31$export$692b9323eea6a0ee = ()=>{
15756
15752
  children: [
15757
15753
  /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsx)((0, $723b70ee4d7f62e8$export$1ae172e61ce3735b), {}),
15758
15754
  /*#__PURE__*/ (0, $gkIgo$reactjsxruntime.jsxs)($420b9b2911eb0b31$var$VUhContainer, {
15759
- hasResult: !isCalculating && !!vuhUsage,
15755
+ $hasResult: !isCalculating && !!vuhUsage,
15760
15756
  children: [
15761
15757
  (0, $4bac6ee95b8c8b72$export$24567f54a9be5ab9)(vuhUsage || 0),
15762
15758
  " VUh"
@@ -15772,7 +15768,7 @@ const $420b9b2911eb0b31$var$VUhContainer = /*#__PURE__*/ (0, ($parcel$interopDef
15772
15768
  })([
15773
15769
  "opacity:",
15774
15770
  ";"
15775
- ], ({ hasResult: hasResult })=>hasResult ? 1 : 0.5);
15771
+ ], ({ $hasResult: $hasResult })=>$hasResult ? 1 : 0.5);
15776
15772
 
15777
15773
 
15778
15774
 
package/dist/module.js CHANGED
@@ -10809,14 +10809,12 @@ const $bc03e5cfae4eab78$export$f348fa2be2f68942 = /*#__PURE__*/ (0, $b7VBt$style
10809
10809
 
10810
10810
  const $811fb252c4c3a84c$export$73be308c62ac8dac = ({ labelMap: labelMap, index: index, variable: variable, onChange: onChange, deleteCheck: deleteCheck, showAttributeColumn: showAttributeColumn })=>{
10811
10811
  const [itemState, setItemState] = (0, $7e9300d00e06714c$export$64bcfd5faff4adc3)(variable);
10812
- const hasChanged = (0, $b7VBt$useCallback)(()=>{
10813
- return !(0, $b7VBt$isEqual)(variable, itemState);
10814
- }, [
10812
+ const hasChanged = (0, $b7VBt$useMemo)(()=>!(0, $b7VBt$isEqual)(variable, itemState), [
10815
10813
  itemState,
10816
10814
  variable
10817
10815
  ]);
10818
10816
  const updateVariable = (0, $b7VBt$useCallback)(()=>{
10819
- if (hasChanged()) {
10817
+ if (hasChanged) {
10820
10818
  const newAttribute = {
10821
10819
  ...itemState
10822
10820
  };
@@ -10829,12 +10827,6 @@ const $811fb252c4c3a84c$export$73be308c62ac8dac = ({ labelMap: labelMap, index:
10829
10827
  itemState,
10830
10828
  onChange
10831
10829
  ]);
10832
- (0, $b7VBt$useEffect)(()=>{
10833
- updateVariable();
10834
- }, [
10835
- itemState.attribute,
10836
- updateVariable
10837
- ]);
10838
10830
  const handleDelete = ()=>{
10839
10831
  deleteCheck(index);
10840
10832
  };
@@ -10850,6 +10842,10 @@ const $811fb252c4c3a84c$export$73be308c62ac8dac = ({ labelMap: labelMap, index:
10850
10842
  setItemState({
10851
10843
  attribute: attribute
10852
10844
  });
10845
+ onChange(index, {
10846
+ ...itemState,
10847
+ attribute: attribute
10848
+ });
10853
10849
  };
10854
10850
  const selectorType = itemState.attribute === undefined ? (0, $60e34da73f3806b9$export$1e2bdbe61d832736).InnerHTML : (0, $60e34da73f3806b9$export$1e2bdbe61d832736).Attribute;
10855
10851
  const showAttributeInput = showAttributeColumn && selectorType === (0, $60e34da73f3806b9$export$1e2bdbe61d832736).Attribute;
@@ -15732,7 +15728,7 @@ const $d8f115728c3a4b86$export$692b9323eea6a0ee = ()=>{
15732
15728
  children: [
15733
15729
  /*#__PURE__*/ (0, $b7VBt$jsx)((0, $f90e6ac18264291c$export$1ae172e61ce3735b), {}),
15734
15730
  /*#__PURE__*/ (0, $b7VBt$jsxs)($d8f115728c3a4b86$var$VUhContainer, {
15735
- hasResult: !isCalculating && !!vuhUsage,
15731
+ $hasResult: !isCalculating && !!vuhUsage,
15736
15732
  children: [
15737
15733
  (0, $f54872b9dc7588c3$export$24567f54a9be5ab9)(vuhUsage || 0),
15738
15734
  " VUh"
@@ -15748,7 +15744,7 @@ const $d8f115728c3a4b86$var$VUhContainer = /*#__PURE__*/ (0, $b7VBt$styledcompon
15748
15744
  })([
15749
15745
  "opacity:",
15750
15746
  ";"
15751
- ], ({ hasResult: hasResult })=>hasResult ? 1 : 0.5);
15747
+ ], ({ $hasResult: $hasResult })=>$hasResult ? 1 : 0.5);
15752
15748
 
15753
15749
 
15754
15750
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafana/k6-test-builder",
3
- "version": "0.8.21",
3
+ "version": "0.8.24",
4
4
  "license": "AGPL-3.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/module.js",