Skip to content

Commit

Permalink
Add additional properties for repeater widget in form builder.
Browse files Browse the repository at this point in the history
- Style
- Minimum Items
- Title From

Fixes #324.
  • Loading branch information
Ben Thomson committed Apr 17, 2020
1 parent 13307b0 commit 1a5ba80
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 1 deletion.
40 changes: 39 additions & 1 deletion classes/StandardControlsRegistry.php
Original file line number Diff line number Diff line change
Expand Up @@ -369,16 +369,54 @@ protected function registerRepeaterWidget()
'default' => Lang::get('rainlab.builder::lang.form.property_prompt_default'),
'sortOrder' => 81
],
'titleFrom' => [
'title' => Lang::get('rainlab.builder::lang.form.property_title_from'),
'description' => Lang::get('rainlab.builder::lang.form.property_title_from_description'),
'type' => 'string',
'ignoreIfEmpty' => true,
'sortOrder' => 82
],
'form' => [
'type' => 'control-container'
],
'minItems' => [
'title' => Lang::get('rainlab.builder::lang.form.property_min_items'),
'description' => Lang::get('rainlab.builder::lang.form.property_min_items_description'),
'type' => 'string',
'ignoreIfEmpty' => true,
'sortOrder' => 83,
'validation' => [
'integer' => [
'message' => Lang::get('rainlab.builder::lang.form.property_min_items_integer'),
'allowNegative' => false,
]
],
],
'maxItems' => [
'title' => Lang::get('rainlab.builder::lang.form.property_max_items'),
'description' => Lang::get('rainlab.builder::lang.form.property_max_items_description'),
'type' => 'string',
'ignoreIfEmpty' => true,
'sortOrder' => 82
'sortOrder' => 84,
'validation' => [
'integer' => [
'message' => Lang::get('rainlab.builder::lang.form.property_max_items_integer'),
'allowNegative' => false,
]
],
],
'style' => [
'title' => Lang::get('rainlab.builder::lang.form.property_style'),
'description' => Lang::get('rainlab.builder::lang.form.property_style_description'),
'type' => 'dropdown',
'default' => 'default',
'options' => [
'default' => Lang::get('rainlab.builder::lang.form.style_default'),
'collapsed' => Lang::get('rainlab.builder::lang.form.style_collapsed'),
'accordion' => Lang::get('rainlab.builder::lang.form.style_accordion'),
],
'sortOrder' => 85,
]
];

$ignoreProperties = [
Expand Down
11 changes: 11 additions & 0 deletions lang/en/lang.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,16 @@
'property_empty_option_description' => 'The empty option corresponds to the empty selection, but unlike the placeholder it can be reselected.',
'property_show_search' => 'Show search',
'property_show_search_description' => 'Enables the search feature for this dropdown.',
'property_title_from' => 'Title from',
'property_title_from_description' => 'Specify a child field name to use the value of that field as the title for each repeater item.',
'property_min_items' => 'Min items',
'property_min_items_description' => 'Minimum number of items to allow within the repeater.',
'property_min_items_integer' => 'Min items must be a positive integer.',
'property_max_items' => 'Max items',
'property_max_items_description' => 'Maximum number of items to allow within the repeater.',
'property_max_items_integer' => 'Max items must be a positive integer.',
'property_style' => 'Style',
'property_style_description' => 'Defines the behaviour to apply to this repeater.',
'control_group_standard' => 'Standard',
'control_group_widgets' => 'Widgets',
'click_to_add_control' => 'Add control',
Expand Down Expand Up @@ -352,6 +360,9 @@
'span_right' => 'Right',
'span_full' => 'Full',
'span_auto' => 'Auto',
'style_default' => 'Default',
'style_collapsed' => 'Collapsed',
'style_accordion' => 'Accordion',
'empty_tab' => 'Empty tab',
'confirm_close_tab' => 'The tab contains controls which will be deleted. Continue?',
'tab' => 'Form tab',
Expand Down

0 comments on commit 1a5ba80

Please sign in to comment.