-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #651 from getformwork/feature/text-input-icons
Add icons support to select and text-based inputs
- Loading branch information
Showing
19 changed files
with
212 additions
and
157 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
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
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 |
---|---|---|
@@ -1,17 +1,20 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'number', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'min' => $field->get('min'), | ||
'max' => $field->get('max'), | ||
'step' => $field->get('step'), | ||
'value' => $field->value(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
'data-field' => 'duration', | ||
'data-unit' => $field->get('unit', 'seconds'), | ||
'data-intervals' => $field->has('intervals') ? implode(', ', $field->get('intervals')) : null, | ||
]) ?>> | ||
<div class="form-input-wrap"> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon', 'hourglass')) ?></span> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'number', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'min' => $field->get('min'), | ||
'max' => $field->get('max'), | ||
'step' => $field->get('step'), | ||
'value' => $field->value(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
'data-field' => 'duration', | ||
'data-unit' => $field->get('unit', 'seconds'), | ||
'data-intervals' => $field->has('intervals') ? implode(', ', $field->get('intervals')) : null, | ||
]) ?>> | ||
</div> |
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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'email', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'minlength' => $field->get('min'), | ||
'maxlength' => $field->get('max'), | ||
'pattern' => $field->get('pattern'), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<div class="form-input-wrap"> | ||
<?php if ($field->has('icon')) : ?> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon')) ?></span> | ||
<?php endif ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'email', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'minlength' => $field->get('min'), | ||
'maxlength' => $field->get('max'), | ||
'pattern' => $field->get('pattern'), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
</div> |
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 |
---|---|---|
@@ -1,15 +1,20 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'number', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'min' => $field->get('min'), | ||
'max' => $field->get('max'), | ||
'step' => $field->get('step'), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<div class="form-input-wrap"> | ||
<?php if ($field->has('icon')) : ?> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon')) ?></span> | ||
<?php endif ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'number', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'min' => $field->get('min'), | ||
'max' => $field->get('max'), | ||
'step' => $field->get('step'), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
</div> |
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 |
---|---|---|
@@ -1,29 +1,32 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<select <?= $this->attr([ | ||
'class' => 'form-select', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<?php if (!$field->isRequired()) : ?> | ||
<option <?= $this->attr([ | ||
'value' => '', | ||
'selected' => $field->value() === '', | ||
]) ?>><?= $this->translate('page.none') ?></option> | ||
<?php endif ?> | ||
<?php if ($field->get('allowSite')) : ?> | ||
<option <?= $this->attr([ | ||
'value' => '.', | ||
'selected' => $field->value() === '.', | ||
]) ?>><?= $this->translate('panel.pages.newPage.site') ?> (/)</option> | ||
<?php endif ?> | ||
<?php foreach ($field->collection() as $page) : ?> | ||
<option <?= $this->attr([ | ||
'value' => $page->route(), | ||
'selected' => $page->route() === $field->value(), | ||
'data-allowed-templates' => $page->scheme()->options()->get('children.templates'), | ||
]) ?>><?= str_repeat('— ', $page->level() - 1) . $this->escape($page->title()) ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
<div class="form-input-wrap"> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon', 'page')) ?></span> | ||
<select <?= $this->attr([ | ||
'class' => 'form-select', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<?php if (!$field->isRequired()) : ?> | ||
<option <?= $this->attr([ | ||
'value' => '', | ||
'selected' => $field->value() === '', | ||
]) ?>><?= $this->translate('page.none') ?></option> | ||
<?php endif ?> | ||
<?php if ($field->get('allowSite')) : ?> | ||
<option <?= $this->attr([ | ||
'value' => '.', | ||
'selected' => $field->value() === '.', | ||
]) ?>><?= $this->translate('panel.pages.newPage.site') ?> (/)</option> | ||
<?php endif ?> | ||
<?php foreach ($field->collection() as $page) : ?> | ||
<option <?= $this->attr([ | ||
'value' => $page->route(), | ||
'selected' => $page->route() === $field->value(), | ||
'data-allowed-templates' => $page->scheme()->options()->get('children.templates'), | ||
]) ?>><?= str_repeat('— ', $page->level() - 1) . $this->escape($page->title()) ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> |
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 |
---|---|---|
@@ -1,16 +1,21 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'password', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'minlength' => $field->get('min'), | ||
'maxlength' => $field->get('max'), | ||
'pattern' => $field->get('pattern'), | ||
'autocomplete' => $field->get('autocomplete'), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<div class="form-input-wrap"> | ||
<?php if ($field->has('icon')) : ?> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon')) ?></span> | ||
<?php endif ?> | ||
<input <?= $this->attr([ | ||
'class' => 'form-input', | ||
'type' => 'password', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'value' => $field->value(), | ||
'placeholder' => $field->placeholder(), | ||
'minlength' => $field->get('min'), | ||
'maxlength' => $field->get('max'), | ||
'pattern' => $field->get('pattern'), | ||
'autocomplete' => $field->get('autocomplete'), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
</div> |
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 |
---|---|---|
@@ -1,13 +1,18 @@ | ||
<?php $this->layout('fields.field') ?> | ||
<select <?= $this->attr([ | ||
'class' => 'form-select', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<?php foreach ($field->options() as $value => $label) : ?> | ||
<option <?= $this->attr(['value' => $value, 'selected' => $value == $field->value()]) ?>><?= $this->escape($label) ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
<div class="form-input-wrap"> | ||
<?php if ($field->has('icon')) : ?> | ||
<span class="form-input-icon"><?= $this->icon($field->get('icon')) ?></span> | ||
<?php endif ?> | ||
<select <?= $this->attr([ | ||
'class' => 'form-select', | ||
'id' => $field->name(), | ||
'name' => $field->formName(), | ||
'required' => $field->isRequired(), | ||
'disabled' => $field->isDisabled(), | ||
'hidden' => $field->isHidden(), | ||
]) ?>> | ||
<?php foreach ($field->options() as $value => $label) : ?> | ||
<option <?= $this->attr(['value' => $value, 'selected' => $value == $field->value()]) ?>><?= $this->escape($label) ?></option> | ||
<?php endforeach ?> | ||
</select> | ||
</div> |
Oops, something went wrong.