PluginProbe
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder / 2.9.1
aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder v2.9.1
2.13.0 2.13.1 2.12.0 2.11.1 2.11.0 2.10.0 2.9.0 2.7.4 2.7.5 2.7.6 2.7.7 2.8.0 2.8.1 2.9.1 trunk 1.0 1.0-beta1 1.0-beta2 1.0-beta3 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 All 80 releases
ablocks / includes / blocks / toggle / attributes.php

attributes.php in aBlocks – Gutenberg Blocks, User Dashboard Builder, Popup Builder, Form Builder & Animation Builder 2.9.1, at includes/blocks/toggle/attributes.php

104 lines 2.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if ( ! defined( 'ABSPATH' ) ) {
4 exit;
5 }
6
7 use ABlocks\Controls\Alignment;
8 use ABlocks\Controls\Typography;
9 use ABlocks\Controls\Range;
10 use ABlocks\Controls\Dimensions;
11 use ABlocks\Controls\Border;
12 use ABlocks\Components\ButtonGroup;
13
14 $attributes = [
15 'block_id' => [
16 'type' => 'string',
17 'default' => ''
18 ],
19 'isSwitch' => [
20 'type' => 'boolean',
21 'default' => false,
22 ],
23 'leftLabel' => [
24 'type' => 'string',
25 'default' => 'Monthly',
26 ],
27 'rightLabel' => [
28 'type' => 'string',
29 'default' => 'Yearly',
30 ],
31 'toggleBarBgColor' => [
32 'type' => 'string',
33 'default' => ''
34 ],
35 'labelNormalColor' => [
36 'type' => 'string',
37 'default' => 'black',
38 ],
39 'labelActiveColor' => [
40 'type' => 'string',
41 'default' => '#562DD4',
42 ],
43 'toggleNormalColor' => [
44 'type' => 'string',
45 'default' => 'white',
46 ],
47 'toggleNormalBgColor' => [
48 'type' => 'string',
49 'default' => '#562DD4',
50 ],
51 'toggleActiveColor' => [
52 'type' => 'string',
53 'default' => 'white',
54 ],
55 'toggleActiveBgColor' => [
56 'type' => 'string',
57 'default' => '#d4552d',
58 ],
59 ];
60
61 $attributes = array_merge(
62 $attributes,
63 Alignment::get_attribute( 'alignment', true, [ 'value' => 'center' ] ),
64 Typography::get_attribute( 'labelTypography', true ),
65 Dimensions::get_attribute( 'toggleBarPadding', true ),
66 Border::get_attribute( 'toggleBarBorder', true ),
67 ButtonGroup::get_attribute( 'toggleDirection', false, [
68 'value' => 'row',
69 ] ),
70 ButtonGroup::get_attribute( 'labelColorState', false, [
71 'value' => 'normal',
72 ] ),
73 ButtonGroup::get_attribute( 'toggleColorState', false, [
74 'value' => 'normal',
75 ] ),
76 Range::get_attribute([
77 'attributeName' => 'space',
78 'isResponsive' => true,
79 'attributeObjectKey' => 'value',
80 'defaultValue' => 0,
81 'hasUnit' => false,
82 ]),
83 Range::get_attribute([
84 'attributeName' => 'gap',
85 'isResponsive' => true,
86 'attributeObjectKey' => 'value',
87 'defaultValue' => 0,
88 'hasUnit' => false,
89 ]),
90 Range::get_attribute([
91 'attributeName' => 'toggleWidth',
92 'isResponsive' => false,
93 'defaultValue' => 60,
94 ]),
95 Range::get_attribute([
96 'attributeName' => 'toggleHeight',
97 'isResponsive' => false,
98 'defaultValue' => 28,
99 ]),
100 );
101
102 return array_merge( $attributes, \ABlocks\Classes\BlockGlobal::get_attributes() );
103
104