This repository has been archived by the owner on Apr 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
575 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0"?> | ||
<page | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" | ||
> | ||
<head> | ||
<remove src="MageMe_WebForms::css/styles.css"/> | ||
<remove src="MageMe_Core::css/styles.css"/> | ||
</head> | ||
</page> |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
$webforms_please-wait-padding : $spacer $spacer--medium !default; | ||
$webforms_please-wait-align-items : center !default; | ||
$webforms_please-wait-justify-content: center !default; | ||
$webforms_please-wait-height : 100% !default; | ||
|
||
.webforms { | ||
.form { | ||
.actions-toolbar { | ||
@extend .dashboard-actions-toolbar; | ||
} | ||
|
||
.actions-toolbar, | ||
.fieldset, | ||
.field { | ||
padding: 0; | ||
float: none; | ||
} | ||
|
||
.validation-advice__number { | ||
margin: -$spacer 0 $spacer--medium; | ||
} | ||
|
||
.please-wait { | ||
display: flex; | ||
padding: $webforms_please-wait-padding; | ||
align-items: $webforms_please-wait-align-items; | ||
justify-content: $webforms_please-wait-justify-content; | ||
height: $webforms_please-wait-height; | ||
} | ||
} | ||
|
||
.webforms-field { | ||
float: none; | ||
} | ||
|
||
&__modal-container { | ||
overflow: auto; | ||
} | ||
|
||
&__modal-content { | ||
padding-top: $spacer--semi-medium; | ||
} | ||
|
||
// critical input extends in Magento_Theme/styles/modules/_input-extends.scss | ||
.type-select, | ||
.type-country { | ||
@extend .select--native; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
<?php | ||
|
||
use MageMe\WebForms\Block\Widget\Button; | ||
|
||
/** @var Button $block */ | ||
?> | ||
|
||
<button | ||
class=" | ||
button | ||
primary | ||
<?= $block->escapeHtmlAttr($this->getButtonCssClass()) ?> | ||
" | ||
data-modal-trigger="<?= $block->escapeHtmlAttr($this->getContainerId()) ?>" | ||
data-mage-init='{ | ||
"modal": { | ||
"useAjax": true, | ||
"ajaxUrl": "<?= $block->escapeUrl($block->getAjaxUrl()) ?>", | ||
"ajaxTarget": "#target_<?= $block->escapeHtmlAttr($this->getContainerId()) ?>", | ||
"ajaxErrorMessage": "<?= $block->escapeHtmlAttr(__('Failed to load modal content.')) ?>" | ||
} | ||
}' | ||
type="button" | ||
title="<?= $block->escapeHtmlAttr($this->getButtonText()) ?>" | ||
> | ||
<?= $block->escapeHtml(__($this->getButtonText())) ?> | ||
</button> | ||
<div | ||
role="dialog" | ||
aria-hidden="true" | ||
id="<?= $block->escapeHtmlAttr($this->getContainerId()) ?>" | ||
data-modal="<?= $block->escapeHtmlAttr($this->getContainerId()) ?>" | ||
class=" | ||
modal | ||
modal--button | ||
<?= str_replace('"', '\"', $block->escapeHtmlAttr($this->getPopupCssClass())) ?> | ||
" | ||
> | ||
<div | ||
class="modal__container webforms__modal-container" | ||
role="document" | ||
tabindex="0" | ||
> | ||
<div class="modal__content webforms__modal-content"> | ||
<div | ||
id="target_<?= $block->escapeHtmlAttr($this->getContainerId()) ?>" | ||
class=" | ||
webforms-popup | ||
mfp-hide | ||
" | ||
> | ||
<!-- webform modal content --> | ||
</div> | ||
</div> | ||
<button | ||
class=" | ||
button | ||
button--icon | ||
button--rotate-icon | ||
modal__close-button | ||
" | ||
type="button" | ||
aria-label="<?= $block->escapeHtmlAttr(__('Close modal')) ?>" | ||
> | ||
<svg | ||
class=" | ||
icon | ||
button__icon | ||
modal__close-button-icon | ||
" | ||
role="presentation" | ||
focusable="false" | ||
> | ||
<use href="<?= $block->escapeUrl($block->getViewFileUrl('images/icons-sprite.svg#close')); ?>"></use> | ||
</svg> | ||
</button> | ||
</div> | ||
</div> |
82 changes: 82 additions & 0 deletions
82
MageMe_WebForms/templates/form/element/field/type/select.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
<?php | ||
/** | ||
* @var Select $block | ||
*/ | ||
|
||
use MageMe\WebForms\Block\Form\Element\Field\Type\Select; | ||
|
||
$validationRules = $block->getValidationRules(); | ||
$validationDescriptions = $block->getValidationDescriptions(); | ||
?> | ||
<div class="select select--native"> | ||
<select | ||
id='<?= $block->escapeHtmlAttr($block->getFieldId()) ?>' | ||
name='<?= $block->escapeHtmlAttr($block->getFieldName()) ?>' | ||
class=' | ||
select__field | ||
<?= $block->escapeHtmlAttr($block->getFieldClass()) ?> | ||
' | ||
data-mage-init='{ | ||
"select": { | ||
"options": { | ||
"shouldSort": false | ||
} | ||
} | ||
}' | ||
style='<?= $block->escapeHtmlAttr($block->getFieldStyle()) ?>' | ||
<?php if ($validationRules): ?> | ||
data-validate="{<?= implode(", ", $validationRules); ?>}" | ||
<?php endif; ?> | ||
<?php foreach ($validationDescriptions as $key => $data): ?> | ||
<?= /* @noEscape */ $key . '=' . '"' . htmlspecialchars((string)$data) . '"'; ?> | ||
<?php endforeach; ?> | ||
<?php if ($block->getIsLabelHidden()): ?> | ||
aria-label="<?= $block->escapeHtmlAttr($block->getFieldLabel()) ?>" | ||
<?php else: ?> | ||
aria-labelledby="label_<?= $block->escapeHtmlAttr($block->getFieldId()) ?>" | ||
<?php endif; ?> | ||
<?php if ($block->getIsRequired()): ?> | ||
aria-required="true" | ||
<?php endif; ?> | ||
<?php if ($block->getAutocomplete()): ?> | ||
autocomplete="<?= $block->escapeHtmlAttr($block->getAutocomplete()) ?>" | ||
<?php endif; ?> | ||
<?php if ($block->getIsMultiselect()): ?> | ||
multiple | ||
<?php endif; ?> | ||
<?= /* @noEscape */ htmlspecialchars((string)$block->getCustomAttributes()) ?> | ||
> | ||
<?php | ||
foreach ($block->getFieldOptions() as $option): ?> | ||
<?php | ||
$checked = false; | ||
$disabled = false; | ||
if ($option["checked"]) { | ||
$checked = 'selected'; | ||
} | ||
if ($option["disabled"]) { | ||
$disabled = 'disabled'; | ||
} | ||
if (isset($option["value"])): ?> | ||
<?php | ||
$value = htmlspecialchars((string)$option["value"]); | ||
if ($option['null']) { | ||
$value = ''; | ||
} | ||
if (!empty($option['optgroup']) && !empty($option['label'])): ?> | ||
<optgroup label="<?= $block->escapeHtmlAttr($block->applyTranslation($option['label'])); ?>"> | ||
<?php elseif (!empty($option['optgroup_close'])): ?> | ||
</optgroup> | ||
<?php else: ?> | ||
<option | ||
value="<?= $block->escapeHtmlAttr($value) ?>" | ||
<?= /* @noEscape */ $checked ?> | ||
<?= /* @noEscape */ $disabled ?> | ||
> | ||
<?= $block->escapeHtml($block->applyTranslation($option['label'])); ?> | ||
</option> | ||
<?php endif; ?> | ||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
</select> | ||
</div> |
91 changes: 91 additions & 0 deletions
91
MageMe_WebForms/templates/form/element/field/type/select_checkbox.phtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<?php | ||
/** | ||
* @var SelectCheckbox $block | ||
*/ | ||
|
||
use MageMe\WebForms\Block\Form\Element\Field\Type\SelectCheckbox; | ||
|
||
$validationRules = $block->getValidationRules(); | ||
$validationDescriptions = $block->getValidationDescriptions(); | ||
$escapedFieldId = $block->escapeHtmlAttr($block->getFieldId()); | ||
?> | ||
|
||
<div> | ||
<?php | ||
$options = $block->getFieldOptions(); | ||
foreach ($block->getFieldOptions() as $i => $option): ?> | ||
<?php | ||
$checked = false; | ||
if ($option["checked"]) { | ||
$checked = 'checked'; | ||
} | ||
if (isset($option["value"]) && empty($option['optgroup']) && empty($option['optgroup_close'])): ?> | ||
<?php | ||
$label = $block->applyTranslation($option["label"]); | ||
if ($option["image_src"]) { | ||
$label = "<figure><img src='{$option['image_src']}'/><figcaption>{$label}</figcaption></figure>"; | ||
} | ||
?> | ||
|
||
<div | ||
class=" | ||
field | ||
choice | ||
option-<?= $block->escapeHtmlAttr($i) ?> | ||
checkbox | ||
" | ||
style='<?= $block->escapeHtmlAttr($block->getFieldStyle()) ?>' | ||
> | ||
<input | ||
id='<?= $escapedFieldId . $block->escapeHtmlAttr($i) ?>' | ||
name='<?= $block->escapeHtmlAttr($block->getFieldName()) ?>' | ||
type='checkbox' | ||
value="<?= /* @noEscape */ htmlspecialchars((string)$option["value"]) ?>" | ||
class='checkbox__field' | ||
<?php if ($validationRules): ?> | ||
data-validate="{<?= implode(", ", $validationRules); ?>}" | ||
<?php endif; ?> | ||
<?php foreach ($validationDescriptions as $key => $data): ?> | ||
<?= $key . '=' . '"' . $block->escapeHtmlAttr(htmlspecialchars((string)$data)) . '"'; ?> | ||
<?php endforeach; ?> | ||
data-uid="<?= $block->escapeHtmlAttr($block->getFieldUid()) ?>" | ||
aria-labelledby=" | ||
<?= $escapedFieldId . $block->escapeHtmlAttr($i) ?>_label | ||
<?php if(!$block->getField()->getIsLabelHidden()): ?> | ||
label_<?= $escapedFieldId ?> | ||
<?php endif; ?> | ||
" | ||
<?= /* @noEscape */ $checked ?> | ||
<?= /* @noEscape */ htmlspecialchars((string)$block->getCustomAttributes()) ?> | ||
/> | ||
|
||
<svg | ||
class="checkbox__icon checkbox__icon--checked" | ||
role="presentation" | ||
focusable="false" | ||
> | ||
<use href="<?= $block->escapeUrl($block->getViewFileUrl('images/icons-sprite.svg#checked')) ?>"/> | ||
</svg> | ||
<svg | ||
class="checkbox__icon checkbox__icon--unchecked" | ||
role="presentation" | ||
focusable="false" | ||
> | ||
<use href="<?= $block->escapeUrl($block->getViewFileUrl('images/icons-sprite.svg#unchecked')) ?>"/> | ||
</svg> | ||
<label | ||
class="checkbox__label" | ||
id="<?= $escapedFieldId . $block->escapeHtmlAttr($i) ?>_label" | ||
for='<?= $escapedFieldId . $block->escapeHtmlAttr($i) ?>' | ||
> | ||
<?= $block->escapeHtml($label) ?> | ||
</label> | ||
<?php | ||
$tooltip = $block->getField()->getTooltip($option["value"]); | ||
if ($tooltip): ?> | ||
<?= $block->getTooltipBlock()->setTooltip($tooltip)->toHtml(); ?> | ||
<?php endif; ?> | ||
</div> | ||
<?php endif; ?> | ||
<?php endforeach; ?> | ||
</div> |
Oops, something went wrong.
dbac9eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
alpaca-docs – ./docs
magento2-alpaca-docs.vercel.app
alpaca-docs-git-master-snowdog1.vercel.app
alpaca-docs-snowdog1.vercel.app
dbac9eb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
magento2-alpaca-theme – ./
magento2-alpaca-theme-snowdog1.vercel.app
magento2-alpaca-theme.vercel.app
magento2-alpaca-theme-git-master-snowdog1.vercel.app