diff --git a/eightshift-forms.php b/eightshift-forms.php index f6e87a74d..82235b237 100644 --- a/eightshift-forms.php +++ b/eightshift-forms.php @@ -6,7 +6,7 @@ * Description: Eightshift Forms is a complete form builder plugin that utilizes modern Block editor features with multiple third-party integrations, bringing your project to a new level. * Author: WordPress team @Infinum * Author URI: https://eightshift.com/ - * Version: 4.0.74 + * Version: 4.0.75 * Text Domain: eightshift-forms * * @package EightshiftForms diff --git a/src/Blocks/components/form/assets/state/init.js b/src/Blocks/components/form/assets/state/init.js index d01a5ccbe..a04be09a6 100644 --- a/src/Blocks/components/form/assets/state/init.js +++ b/src/Blocks/components/form/assets/state/init.js @@ -544,7 +544,7 @@ export function setSteps(formElement, formId) { setState([StateEnum.FORM, StateEnum.STEPS, StateEnum.STEPS_PROGRESS_BAR], stepsProgressBar, formId); setState([StateEnum.FORM, StateEnum.STEPS, StateEnum.STEPS_ELEMENTS_PROGRESS_BAR], {}, formId); - Object.values(stepsProgressBar).forEach((item) => { + [...stepsProgressBar.children].forEach((item) => { const stepId = item.getAttribute(getStateAttribute('stepId')); setState([StateEnum.FORM, StateEnum.STEPS, StateEnum.STEPS_ELEMENTS_PROGRESS_BAR, stepId], item, formId); }); diff --git a/src/Blocks/components/form/assets/step.js b/src/Blocks/components/form/assets/step.js index 3fe0587d6..d3e225eda 100644 --- a/src/Blocks/components/form/assets/step.js +++ b/src/Blocks/components/form/assets/step.js @@ -257,7 +257,7 @@ export class Steps { // Multistep setup. // Find current step. const currentStep = this.state.getStateFormStepsCurrent(formId); - + // Remove active from current step. this.state.getStateFormStepsElementProgressBar(currentStep, formId)?.classList?.remove(this.state.getStateSelectorsClassActive()); @@ -266,7 +266,7 @@ export class Steps { // Reset filled steps. this.state.getStateFormStepsElementsProgressBar(formId).forEach((item) => item?.classList?.remove(this.state.getStateSelectorsClassFilled())); - + // Add filled to all filled steps. flow.forEach((item) => { this.state.getStateFormStepsElementProgressBar(item, formId)?.classList?.add(this.state.getStateSelectorsClassFilled()); diff --git a/src/Blocks/components/progress-bar/components/progress-bar-options.js b/src/Blocks/components/progress-bar/components/progress-bar-options.js index bf9e35d24..40dfbb91b 100644 --- a/src/Blocks/components/progress-bar/components/progress-bar-options.js +++ b/src/Blocks/components/progress-bar/components/progress-bar-options.js @@ -12,6 +12,7 @@ export const ProgressBarOptions = (attributes) => { } = attributes; const progressBarUse = checkAttr('progressBarUse', attributes, manifest); + const progressBarHideLabels = checkAttr('progressBarHideLabels', attributes, manifest); const progressBarMultiflowUse = checkAttr('progressBarMultiflowUse', attributes, manifest); const progressBarMultiflowInitCount = checkAttr('progressBarMultiflowInitCount', attributes, manifest); @@ -26,6 +27,15 @@ export const ProgressBarOptions = (attributes) => { }} /> + { + setAttributes({ [getAttrKey('progressBarHideLabels', attributes, manifest)]: value }); + }} + /> + {progressBarMultiflowUse &&
>
"> - +
$progressBarSteps, 'componentClass' => $componentClass, 'componentJsClass' => $componentJsClass, + 'hideLabels' => Components::checkAttr('progressBarHideLabels', $attributes, $manifest), ]); } else { echo Components::renderPartial('component', $manifest['componentName'], 'multiflow', [ // phpcs:ignore Eightshift.Security.ComponentsEscape.OutputNotEscaped - 'count' => $progressBarMultiflowInitCount, + 'count' => Components::checkAttr('progressBarMultiflowInitCount', $attributes, $manifest), ]); } ?> diff --git a/src/Form/Form.php b/src/Form/Form.php index ee224100a..6856354bb 100644 --- a/src/Form/Form.php +++ b/src/Form/Form.php @@ -318,6 +318,7 @@ public function updateFormsBlockOutput(array $blocks, array $attributes): array $innerBlock['attrs']["{$blockName}FormProgressBarMultiflowUse"] = $innerBlock['attrs']["{$blockName}StepMultiflowUse"] ?? false; $innerBlock['attrs']["{$blockName}FormProgressBarMultiflowInitCount"] = $innerBlock['attrs']["{$blockName}StepProgressBarMultiflowInitCount"] ?? ''; $innerBlock['attrs']["{$blockName}FormProgressBarUse"] = $innerBlock['attrs']["{$blockName}StepProgressBarUse"] ?? false; + $innerBlock['attrs']["{$blockName}FormProgressBarHideLabels"] = $innerBlock['attrs']["{$blockName}StepProgressBarHideLabels"] ?? false; $innerBlock['attrs']["{$blockName}FormHasSteps"] = true; $inBlockOutput = \array_values($inBlockOutput);