Skip to content

Commit

Permalink
Merge branch 'acceptance' into feat/add-developer-mode-to-backoffice
Browse files Browse the repository at this point in the history
  • Loading branch information
archan937 authored Nov 20, 2023
2 parents 96329ed + b87e17e commit c81c088
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# [2.169.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.168.0...v2.169.0) (2023-11-20)


### Features

* add disable option ([6a67f1c](https://github.com/bettyblocks/material-ui-component-set/commit/6a67f1cdc5c95800894d78d29c60f5cad3c096ed))

# [2.168.0](https://github.com/bettyblocks/material-ui-component-set/compare/v2.167.1...v2.168.0) (2023-11-17)


Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "component-set",
"version": "2.168.0",
"version": "2.169.0",
"main": "dist/templates.json",
"license": "UNLICENSED",
"private": false,
Expand Down
5 changes: 3 additions & 2 deletions src/components/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
const { env, useText } = B;
const isDev = env === 'dev';
const isEmpty = children.length === 0;
const { label, icon, dataComponentAttribute } = options || {};
const { label, icon, disabled, dataComponentAttribute } = options || {};
const { setStepLabelData, active, isFirstRender } = parent;

const StepContent =
Expand All @@ -33,9 +33,10 @@
...prev,
[`label${index}`]: label,
[`icon${index}`]: icon,
[`disabled${index}`]: disabled,
}));
}
}, [setStepLabelData, index, label, icon]);
}, [setStepLabelData, index, label, icon, disabled]);

return isDev ? <div className={classes.wrapper}>{StepCmp}</div> : StepCmp;
})(),
Expand Down
2 changes: 2 additions & 0 deletions src/components/stepper.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
const {
label = stepLabelData[`label${index}`] || [`Step ${index + 1}`],
icon = stepLabelData[`icon${index}`] || 'None',
disabled = stepLabelData[`disabled${index}`] || 'None',
} = childOptions;
const isActive = index === activeStep || allSteps;
const labelText = useText(label);
Expand Down Expand Up @@ -132,6 +133,7 @@
<StepButton
classes={{ root: classes.stepButton }}
onClick={handleStep(index)}
disabled={disabled}
>
<StepLabel
classes={{ root: classes.stepLabel }}
Expand Down
3 changes: 2 additions & 1 deletion src/prefabs/structures/Step/options/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { variable, icon } from '@betty-blocks/component-sdk';
import { toggle, variable, icon } from '@betty-blocks/component-sdk';
import { advanced } from '../../advanced';

export const categories = [
Expand All @@ -22,6 +22,7 @@ export const stepOptions = {
showOnDrop: true,
},
}),
disabled: toggle('Disabled', { value: false }),

...advanced('Step'),
};

0 comments on commit c81c088

Please sign in to comment.