1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-19 11:21:30 +02:00

feat(core): add sizes for Forms #218 #186

New sizes:
'1/12' => 'col-1',
'2/12' => 'col-2',
'3/12' => 'col-3',
'4/12' => 'col-4',
'5/12' => 'col-5',
'6/12' => 'col-6',
'7/12' => 'col-7',
'8/12' => 'col-8',
'9/12' => 'col-9',
'10/12' => 'col-19',
'12/12' => 'col-11',
'12' => 'col-12'
This commit is contained in:
Awilum
2019-08-25 21:06:33 +03:00
parent b8d5b9c6f8
commit 3e79febcd4
7 changed files with 53 additions and 38 deletions

View File

@@ -27,6 +27,21 @@ class Forms
*/
private $flextype;
private $sizes = [
'1/12' => 'col-1',
'2/12' => 'col-2',
'3/12' => 'col-3',
'4/12' => 'col-4',
'5/12' => 'col-5',
'6/12' => 'col-6',
'7/12' => 'col-7',
'8/12' => 'col-8',
'9/12' => 'col-9',
'10/12' => 'col-19',
'12/12' => 'col-11',
'12' => 'col-12'
];
/**
* Constructor
*
@@ -78,7 +93,7 @@ class Forms
$property['attributes']['class'] = Arr::keyExists($property, 'attributes.class') ? 'form-control ' . $property['attributes']['class'] : 'form-control';
// Create attribute size
$property['size'] = Arr::keyExists($property, 'size') ? $property['size'] : 'col-12';
$property['size'] = Arr::keyExists($property, 'size') ? $this->sizes[$property['size']] : $this->sizes['12'];
// Create attribute value
$property['value'] = Arr::keyExists($property, 'value') ? $property['value'] : '';

View File

@@ -7,33 +7,33 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
content:
title: admin_content
type: html
size: col-12
size: 12
image:
title: admin_media
type: media_select
size: col-3
size: 3/12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 12
menu:
title: Menu
fields:
menu_item_title:
title: admin_menu_item_title
type: text
size: col-4
size: 4/12
menu_item_url:
title: admin_menu_item_url
type: text
size: col-4
size: 4/12
menu_item_target:
title: admin_menu_item_target
type: select
@@ -42,8 +42,8 @@ sections:
_blank: _blank
_parent: _parent
_top: _top
size: col-4
size: 4/12
menu_item_order:
title: admin_menu_item_order
type: text
size: col-4
size: 4/12

View File

@@ -7,19 +7,19 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
summary:
title: admin_summary
type: html
size: col-12
size: 12
content:
title: admin_content
type: html
size: col-12
size: 12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 12

View File

@@ -7,29 +7,29 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
entries_limit:
title: admin_entries_limit
type: text
size: col-4
size: 4/12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 4/12
menu:
title: Menu
fields:
menu_item_title:
title: admin_menu_item_title
type: text
size: col-4
size: 4/12
menu_item_url:
title: admin_menu_item_url
type: text
size: col-4
size: 4/12
menu_item_target:
title: admin_menu_item_target
type: select
@@ -38,8 +38,8 @@ sections:
_blank: _blank
_parent: _parent
_top: _top
size: col-4
size: 4/12
menu_item_order:
title: admin_menu_item_order
type: text
size: col-4
size: 4/12

View File

@@ -7,37 +7,37 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
content:
title: admin_content
type: html
size: col-12
size: 12
template:
title: admin_template
type: template_select
size: col-4
size: 4/12
visibility:
title: admin_visibility
type: visibility_select
size: col-4
size: 4/12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 12
menu:
title: Menu
fields:
menu_item_title:
title: admin_menu_item_title
type: text
size: col-4
size: 4/12
menu_item_url:
title: admin_menu_item_url
type: text
size: col-4
size: 4/12
menu_item_target:
title: admin_menu_item_target
type: select
@@ -46,8 +46,8 @@ sections:
_blank: _blank
_parent: _parent
_top: _top
size: col-4
size: 4/12
menu_item_order:
title: admin_menu_item_order
type: text
size: col-4
size: 4/12

View File

@@ -7,15 +7,15 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
gallery_img:
title: admin_gallery_img
type: media_select
size: col-4
size: 4/12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 12

View File

@@ -7,25 +7,25 @@ sections:
title:
title: admin_title
type: text
size: col-12
size: 12
seo:
title: Seo
fields:
description:
title: admin_description
type: textarea
size: col-12
size: 12
menu:
title: Menu
fields:
menu_item_title:
title: admin_menu_item_title
type: text
size: col-4
size: 4/12
menu_item_url:
title: admin_menu_item_url
type: text
size: col-4
size: 4/12
menu_item_target:
title: admin_menu_item_target
type: select
@@ -34,8 +34,8 @@ sections:
_blank: _blank
_parent: _parent
_top: _top
size: col-4
size: 4/12
menu_item_order:
title: admin_menu_item_order
type: text
size: col-4
size: 4/12