| @@ -1,1757 +1,1764 @@ | ||
| 1 | -<?php | |
| 2 | -namespace Easyel\EasyElements\Widgets; | |
| 3 | -use \Elementor\Controls_Manager; | |
| 4 | -use \Elementor\Repeater; | |
| 5 | -use \Elementor\Group_Control_Border; | |
| 6 | -use \Elementor\Group_Control_Typography; | |
| 7 | - | |
| 8 | -if ( ! defined( 'ABSPATH' ) ) { | |
| 9 | - exit; | |
| 10 | -} | |
| 11 | -/** | |
| 12 | - * Elementor Table Widget. | |
| 13 | - * | |
| 14 | - * @since 1.0.0 | |
| 15 | - */ | |
| 16 | - | |
| 17 | -class Easyel_Table_Elementor_Widget extends \Elementor\Widget_Base { | |
| 18 | - | |
| 19 | - | |
| 20 | - public function get_name() { | |
| 21 | - return 'eel-table'; | |
| 22 | - } | |
| 23 | - | |
| 24 | - /** | |
| 25 | - * Get widget title. | |
| 26 | - * | |
| 27 | - * Retrieve oEmbed widget title. | |
| 28 | - * | |
| 29 | - * @since 1.0.0 | |
| 30 | - * @access public | |
| 31 | - * | |
| 32 | - * @return string Widget title. | |
| 33 | - */ | |
| 34 | - public function get_title() { | |
| 35 | - return esc_html__( 'Table', 'easy-elements' ); | |
| 36 | - } | |
| 37 | - | |
| 38 | - /** | |
| 39 | - * Get widget icon. | |
| 40 | - * | |
| 41 | - * Retrieve oEmbed widget icon. | |
| 42 | - * | |
| 43 | - * @since 1.0.0 | |
| 44 | - * @access public | |
| 45 | - * | |
| 46 | - * @return string Widget icon. | |
| 47 | - */ | |
| 48 | - public function get_icon() { | |
| 49 | - return 'easyicon easyelIcon-clients-logo-grid'; | |
| 50 | - } | |
| 51 | - | |
| 52 | - /** | |
| 53 | - * Get widget categories. | |
| 54 | - * | |
| 55 | - * Retrieve the list of categories the oEmbed widget belongs to. | |
| 56 | - * | |
| 57 | - * @since 1.0.0 | |
| 58 | - * @access public | |
| 59 | - * | |
| 60 | - * @return array Widget categories. | |
| 61 | - */ | |
| 62 | - public function get_categories() { | |
| 63 | - return [ 'easyelements_category' ]; | |
| 64 | - } | |
| 65 | - | |
| 66 | - /** | |
| 67 | - * Register oEmbed widget controls. | |
| 68 | - * | |
| 69 | - * Adds different input fields to allow the user to change and customize the widget settings. | |
| 70 | - * | |
| 71 | - * @since 1.0.0 | |
| 72 | - * @access protected | |
| 73 | - */ | |
| 74 | - | |
| 75 | - public function get_keywords() { | |
| 76 | - return [ 'table', 'simple', 'data', 'click', 'text' ]; | |
| 77 | - } | |
| 78 | - | |
| 79 | - public function get_style_depends() { | |
| 80 | - return [ | |
| 81 | - 'eel-table', | |
| 82 | - ]; | |
| 83 | - } | |
| 84 | - | |
| 85 | - public function get_script_depends() { | |
| 86 | - return [ | |
| 87 | - 'eel-table', | |
| 88 | - ]; | |
| 89 | - } | |
| 90 | - | |
| 91 | - protected function register_controls() { | |
| 92 | - | |
| 93 | - $this->start_controls_section( | |
| 94 | - 'content_table_header', | |
| 95 | - [ | |
| 96 | - 'label' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 97 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 98 | - ] | |
| 99 | - ); | |
| 100 | - | |
| 101 | - $this->add_control( | |
| 102 | - 'table_header', | |
| 103 | - [ | |
| 104 | - 'label' => esc_html__( 'Table Header Cell', 'easy-elements' ), | |
| 105 | - 'type' => Controls_Manager::REPEATER, | |
| 106 | - 'prevent_empty' => false, | |
| 107 | - 'fields' => [ | |
| 108 | - [ | |
| 109 | - 'name' => 'text', | |
| 110 | - 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 111 | - 'type' => Controls_Manager::TEXT, | |
| 112 | - 'label_block' => true, | |
| 113 | - 'placeholder' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 114 | - 'default' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 115 | - 'dynamic' => [ | |
| 116 | - 'active' => true, | |
| 117 | - ] | |
| 118 | - ], | |
| 119 | - [ | |
| 120 | - 'name' => 'header_icon', | |
| 121 | - 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 122 | - 'type' => Controls_Manager::SWITCHER, | |
| 123 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 124 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 125 | - ], | |
| 126 | - [ | |
| 127 | - 'name' => 'table_head_icon', | |
| 128 | - 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 129 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 130 | - 'default' => [ | |
| 131 | - 'value' => 'far fa-user-circle', | |
| 132 | - 'library' => 'fa-solid', | |
| 133 | - ], | |
| 134 | - 'condition' => [ | |
| 135 | - 'header_icon' => 'yes', | |
| 136 | - ], | |
| 137 | - ], | |
| 138 | - [ | |
| 139 | - 'name' => 'advance', | |
| 140 | - 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 141 | - 'type' => Controls_Manager::SWITCHER, | |
| 142 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 143 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 144 | - ], | |
| 145 | - [ | |
| 146 | - 'name' => 'colspan', | |
| 147 | - 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 148 | - 'type' => Controls_Manager::SWITCHER, | |
| 149 | - 'condition' => [ | |
| 150 | - 'advance' => 'yes', | |
| 151 | - ], | |
| 152 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 153 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 154 | - ], | |
| 155 | - [ | |
| 156 | - 'name' => 'colspannumber', | |
| 157 | - 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 158 | - 'type' => Controls_Manager::TEXT, | |
| 159 | - 'condition' => [ | |
| 160 | - 'advance' => 'yes', | |
| 161 | - 'colspan' => 'yes', | |
| 162 | - ], | |
| 163 | - 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 164 | - 'default' => esc_html__( '1', 'easy-elements' ), | |
| 165 | - ], | |
| 166 | - [ | |
| 167 | - 'name' => 'customwidth', | |
| 168 | - 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 169 | - 'type' => Controls_Manager::SWITCHER, | |
| 170 | - 'condition' => [ | |
| 171 | - 'advance' => 'yes', | |
| 172 | - ], | |
| 173 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 174 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 175 | - ], | |
| 176 | - [ | |
| 177 | - 'name' => 'width', | |
| 178 | - 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 179 | - 'type' => Controls_Manager::SLIDER, | |
| 180 | - 'condition' => [ | |
| 181 | - 'advance' => 'yes', | |
| 182 | - 'customwidth' => 'yes', | |
| 183 | - ], | |
| 184 | - 'range' => [ | |
| 185 | - '%' => [ | |
| 186 | - 'min' => 0, | |
| 187 | - 'max' => 100, | |
| 188 | - ], | |
| 189 | - 'px' => [ | |
| 190 | - 'min' => 1, | |
| 191 | - 'max' => 1000, | |
| 192 | - ], | |
| 193 | - ], | |
| 194 | - 'default' => [ | |
| 195 | - 'size' => 30, | |
| 196 | - 'unit' => '%', | |
| 197 | - ], | |
| 198 | - 'size_units' => [ '%', 'px' ], | |
| 199 | - 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 200 | - ] | |
| 201 | - ], | |
| 202 | - [ | |
| 203 | - 'name' => 'align', | |
| 204 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 205 | - 'type' => Controls_Manager::CHOOSE, | |
| 206 | - 'condition' => [ | |
| 207 | - 'advance' => 'yes', | |
| 208 | - ], | |
| 209 | - 'options' => [ | |
| 210 | - 'left' => [ | |
| 211 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 212 | - 'icon' => 'eicon-text-align-left', | |
| 213 | - ], | |
| 214 | - 'center' => [ | |
| 215 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 216 | - 'icon' => 'eicon-text-align-center', | |
| 217 | - ], | |
| 218 | - 'right' => [ | |
| 219 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 220 | - 'icon' => 'eicon-text-align-right', | |
| 221 | - ], | |
| 222 | - 'justify' => [ | |
| 223 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 224 | - 'icon' => 'eicon-text-align-justify', | |
| 225 | - ], | |
| 226 | - ], | |
| 227 | - 'default' => '', | |
| 228 | - 'selectors' => [ | |
| 229 | - '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 230 | - ] | |
| 231 | - ], | |
| 232 | - [ | |
| 233 | - 'name' => 'vertical_align', | |
| 234 | - 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ), | |
| 235 | - 'type' => Controls_Manager::CHOOSE, | |
| 236 | - 'condition' => [ | |
| 237 | - 'advance' => 'yes', | |
| 238 | - ], | |
| 239 | - 'options' => [ | |
| 240 | - 'top' => [ | |
| 241 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 242 | - 'icon' => 'fa fa-arrow-up', | |
| 243 | - ], | |
| 244 | - 'middle' => [ | |
| 245 | - 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 246 | - 'icon' => 'fa fa-arrows-v', | |
| 247 | - ], | |
| 248 | - 'bottom' => [ | |
| 249 | - 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 250 | - 'icon' => 'fa fa-arrow-down', | |
| 251 | - ], | |
| 252 | - ], | |
| 253 | - 'default' => 'top', | |
| 254 | - 'toggle' => true, | |
| 255 | - 'selectors' => [ | |
| 256 | - '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', | |
| 257 | - ] | |
| 258 | - ], | |
| 259 | - | |
| 260 | - [ | |
| 261 | - 'name' => 'decoration', | |
| 262 | - 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 263 | - 'type' => Controls_Manager::SELECT, | |
| 264 | - 'condition' => [ | |
| 265 | - 'advance' => 'yes', | |
| 266 | - ], | |
| 267 | - 'options' => [ | |
| 268 | - '' => esc_html__( 'Default', 'easy-elements' ), | |
| 269 | - 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 270 | - 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 271 | - 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 272 | - 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 273 | - ], | |
| 274 | - 'default' => '', | |
| 275 | - 'selectors' => [ | |
| 276 | - '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};', | |
| 277 | - ], | |
| 278 | - ], | |
| 279 | - [ | |
| 280 | - 'name' => 'table_head_tooltip', | |
| 281 | - 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 282 | - 'type' => Controls_Manager::SWITCHER, | |
| 283 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 284 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 285 | - ], | |
| 286 | - [ | |
| 287 | - 'name' => 'table_head_tooltip_icon', | |
| 288 | - 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 289 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 290 | - 'default' => [ | |
| 291 | - 'value' => 'fas fa-question-circle', | |
| 292 | - 'library' => 'fa-solid', | |
| 293 | - ], | |
| 294 | - 'condition' => [ | |
| 295 | - 'table_head_tooltip' => 'yes', | |
| 296 | - ], | |
| 297 | - ], | |
| 298 | - [ | |
| 299 | - 'name' => 'table_head_tooltip_description', | |
| 300 | - 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 301 | - 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 302 | - 'rows' => 10, | |
| 303 | - 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 304 | - 'condition' => [ | |
| 305 | - 'table_head_tooltip' => 'yes', | |
| 306 | - ], | |
| 307 | - ], | |
| 308 | - ], | |
| 309 | - 'default' => [ | |
| 310 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 311 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 312 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 313 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 314 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 315 | - [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 316 | - ], | |
| 317 | - 'title_field' => '{{{ text }}}', | |
| 318 | - ] | |
| 319 | - ); | |
| 320 | - | |
| 321 | - $this->end_controls_section(); | |
| 322 | - | |
| 323 | - $this->start_controls_section( | |
| 324 | - 'content_table_body', | |
| 325 | - [ | |
| 326 | - 'label' => esc_html__( 'Table Body', 'easy-elements' ), | |
| 327 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 328 | - ] | |
| 329 | - ); | |
| 330 | - | |
| 331 | - $repeater = new Repeater(); | |
| 332 | - | |
| 333 | - | |
| 334 | - $repeater->add_control( | |
| 335 | - 'row', [ | |
| 336 | - 'label' => esc_html__( 'New Row', 'easy-elements' ), | |
| 337 | - 'type' => Controls_Manager::SWITCHER, | |
| 338 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 339 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 340 | - ] | |
| 341 | - ); | |
| 342 | - | |
| 343 | - $repeater->add_control( | |
| 344 | - 'table_body_choose_img_icon', | |
| 345 | - [ | |
| 346 | - 'label' => esc_html__( 'Select Type', 'easy-elements' ), | |
| 347 | - 'type' => \Elementor\Controls_Manager::SELECT, | |
| 348 | - 'default' => 'icon', | |
| 349 | - 'options' => [ | |
| 350 | - 'icon' => esc_html__( 'Icon', 'easy-elements' ), | |
| 351 | - 'image' => esc_html__( 'Image', 'easy-elements' ), | |
| 352 | - ], | |
| 353 | - ] | |
| 354 | - ); | |
| 355 | - | |
| 356 | - $repeater->add_control( | |
| 357 | - 'table_icon', | |
| 358 | - [ | |
| 359 | - 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 360 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 361 | - 'condition' => [ | |
| 362 | - 'table_body_choose_img_icon' => ['icon'] | |
| 363 | - ] | |
| 364 | - ] | |
| 365 | - ); | |
| 366 | - | |
| 367 | - $repeater->add_control( | |
| 368 | - 'table_image', | |
| 369 | - [ | |
| 370 | - 'label' => esc_html__( 'Image', 'easy-elements' ), | |
| 371 | - 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 372 | - 'default' => [ | |
| 373 | - 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 374 | - ], | |
| 375 | - 'condition' => [ | |
| 376 | - 'table_body_choose_img_icon' => ['image'] | |
| 377 | - ] | |
| 378 | - ] | |
| 379 | - ); | |
| 380 | - | |
| 381 | - $repeater->add_control( | |
| 382 | - 'text', [ | |
| 383 | - 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 384 | - 'type' => Controls_Manager::WYSIWYG, | |
| 385 | - 'label_block' => true, | |
| 386 | - 'placeholder' => esc_html__( 'Table Data', 'easy-elements' ), | |
| 387 | - 'default' => esc_html__( 'Table Data', 'easy-elements' ), | |
| 388 | - 'dynamic' => [ | |
| 389 | - 'active' => true, | |
| 390 | - ] | |
| 391 | - ] | |
| 392 | - ); | |
| 393 | - | |
| 394 | - $repeater->add_control( | |
| 395 | - 'advance', [ | |
| 396 | - 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 397 | - 'type' => Controls_Manager::SWITCHER, | |
| 398 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 399 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 400 | - ] | |
| 401 | - ); | |
| 402 | - | |
| 403 | - $repeater->add_control( | |
| 404 | - 'colspan', [ | |
| 405 | - 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 406 | - 'type' => Controls_Manager::SWITCHER, | |
| 407 | - 'condition' => [ | |
| 408 | - 'advance' => 'yes', | |
| 409 | - ], | |
| 410 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 411 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 412 | - ] | |
| 413 | - ); | |
| 414 | - | |
| 415 | - $repeater->add_control( | |
| 416 | - 'colspannumber', [ | |
| 417 | - 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 418 | - 'type' => Controls_Manager::TEXT, | |
| 419 | - 'condition' => [ | |
| 420 | - 'advance' => 'yes', | |
| 421 | - 'colspan' => 'yes', | |
| 422 | - ], | |
| 423 | - 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 424 | - 'default' => esc_html__( '1', 'easy-elements' ), | |
| 425 | - ] | |
| 426 | - ); | |
| 427 | - | |
| 428 | - $repeater->add_control( | |
| 429 | - 'rowspan', [ | |
| 430 | - 'label' => esc_html__( 'rowSpan', 'easy-elements' ), | |
| 431 | - 'type' => Controls_Manager::SWITCHER, | |
| 432 | - 'condition' => [ | |
| 433 | - 'advance' => 'yes', | |
| 434 | - ], | |
| 435 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 436 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 437 | - ] | |
| 438 | - ); | |
| 439 | - | |
| 440 | - $repeater->add_control( | |
| 441 | - 'rowspannumber', [ | |
| 442 | - 'label' => esc_html__( 'rowSpan Number', 'easy-elements' ), | |
| 443 | - 'type' => Controls_Manager::TEXT, | |
| 444 | - 'condition' => [ | |
| 445 | - 'advance' => 'yes', | |
| 446 | - 'rowspan' => 'yes', | |
| 447 | - ], | |
| 448 | - 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 449 | - 'default' => esc_html__( '1', 'easy-elements' ), | |
| 450 | - ] | |
| 451 | - ); | |
| 452 | - | |
| 453 | - $repeater->add_control( | |
| 454 | - 'table_body_data_flex', | |
| 455 | - [ | |
| 456 | - 'label' => esc_html__( 'Data Flex', 'easy-elements' ), | |
| 457 | - 'type' => Controls_Manager::SWITCHER, | |
| 458 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 459 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 460 | - 'condition' => [ | |
| 461 | - 'advance' => 'yes', | |
| 462 | - ] | |
| 463 | - ] | |
| 464 | - ); | |
| 465 | - | |
| 466 | - $repeater->add_control( | |
| 467 | - 'data-flex-align', [ | |
| 468 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 469 | - 'type' => Controls_Manager::CHOOSE, | |
| 470 | - 'condition' => [ | |
| 471 | - 'advance' => 'yes', | |
| 472 | - 'table_body_data_flex' => 'yes', | |
| 473 | - ], | |
| 474 | - 'options' => [ | |
| 475 | - 'start' => [ | |
| 476 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 477 | - 'icon' => 'eicon-text-align-left', | |
| 478 | - ], | |
| 479 | - 'center' => [ | |
| 480 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 481 | - 'icon' => 'eicon-text-align-center', | |
| 482 | - ], | |
| 483 | - 'end' => [ | |
| 484 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 485 | - 'icon' => 'eicon-text-align-right', | |
| 486 | - ], | |
| 487 | - 'space-between' => [ | |
| 488 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 489 | - 'icon' => 'eicon-text-align-justify', | |
| 490 | - ], | |
| 491 | - ], | |
| 492 | - 'selectors' => [ | |
| 493 | - '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'justify-content: {{VALUE}};', | |
| 494 | - ], | |
| 495 | - ] | |
| 496 | - ); | |
| 497 | - | |
| 498 | - $repeater->add_responsive_control( | |
| 499 | - 'flex-data-mid-gap', | |
| 500 | - [ | |
| 501 | - 'label' => esc_html__( 'Middle Gap', 'easy-elements' ), | |
| 502 | - 'type' => Controls_Manager::SLIDER, | |
| 503 | - 'size_units' => [ '%', 'px' ], | |
| 504 | - 'condition' => [ | |
| 505 | - 'advance' => 'yes', | |
| 506 | - 'table_body_data_flex' => 'yes', | |
| 507 | - ], | |
| 508 | - 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'gap: {{SIZE}}{{UNIT}};', | |
| 509 | - ] | |
| 510 | - ], | |
| 511 | - ); | |
| 512 | - | |
| 513 | - $repeater->add_control( | |
| 514 | - 'align', [ | |
| 515 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 516 | - 'type' => Controls_Manager::CHOOSE, | |
| 517 | - 'condition' => [ | |
| 518 | - 'advance' => 'yes', | |
| 519 | - 'table_body_data_flex!' => 'yes', | |
| 520 | - ], | |
| 521 | - 'options' => [ | |
| 522 | - 'left' => [ | |
| 523 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 524 | - 'icon' => 'eicon-text-align-left', | |
| 525 | - ], | |
| 526 | - 'center' => [ | |
| 527 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 528 | - 'icon' => 'eicon-text-align-center', | |
| 529 | - ], | |
| 530 | - 'right' => [ | |
| 531 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 532 | - 'icon' => 'eicon-text-align-right', | |
| 533 | - ], | |
| 534 | - 'justify' => [ | |
| 535 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 536 | - 'icon' => 'eicon-text-align-justify', | |
| 537 | - ], | |
| 538 | - ], | |
| 539 | - 'default' => '', | |
| 540 | - 'selectors' => [ | |
| 541 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 542 | - ], | |
| 543 | - ] | |
| 544 | - ); | |
| 545 | - | |
| 546 | - $repeater->add_control( | |
| 547 | - 'vertical_align', [ | |
| 548 | - 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ), | |
| 549 | - 'type' => Controls_Manager::CHOOSE, | |
| 550 | - 'condition' => [ | |
| 551 | - 'advance' => 'yes', | |
| 552 | - ], | |
| 553 | - 'options' => [ | |
| 554 | - 'top' => [ | |
| 555 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 556 | - 'icon' => 'eicon-v-align-top', | |
| 557 | - ], | |
| 558 | - 'middle' => [ | |
| 559 | - 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 560 | - 'icon' => 'eicon-v-align-middle', | |
| 561 | - ], | |
| 562 | - 'bottom' => [ | |
| 563 | - 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 564 | - 'icon' => 'eicon-v-align-bottom', | |
| 565 | - ], | |
| 566 | - ], | |
| 567 | - 'default' => '', | |
| 568 | - 'selectors' => [ | |
| 569 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', | |
| 570 | - ], | |
| 571 | - ] | |
| 572 | - ); | |
| 573 | - $repeater->add_control( | |
| 574 | - 'advanced_item_bg_color', | |
| 575 | - [ | |
| 576 | - 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 577 | - 'type' => Controls_Manager::COLOR, | |
| 578 | - 'selectors' => [ | |
| 579 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', | |
| 580 | - ] | |
| 581 | - ] | |
| 582 | - ); | |
| 583 | - $repeater->add_control( | |
| 584 | - 'advanced_item_text_color', | |
| 585 | - [ | |
| 586 | - 'label' => esc_html__( 'Color', 'easy-elements' ), | |
| 587 | - 'type' => Controls_Manager::COLOR, | |
| 588 | - 'selectors' => [ | |
| 589 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'color: {{VALUE}};', | |
| 590 | - ] | |
| 591 | - ] | |
| 592 | - ); | |
| 593 | - $repeater->add_control( | |
| 594 | - 'advanced_item_icon_color', | |
| 595 | - [ | |
| 596 | - 'label' => esc_html__( 'Icon Color', 'easy-elements' ), | |
| 597 | - 'type' => Controls_Manager::COLOR, | |
| 598 | - 'selectors' => [ | |
| 599 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} i' => 'color: {{VALUE}};', | |
| 600 | - '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}};', | |
| 601 | - ] | |
| 602 | - ] | |
| 603 | - ); | |
| 604 | - $repeater->add_control( | |
| 605 | - 'tb_cswidthS', | |
| 606 | - [ | |
| 607 | - 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 608 | - 'type' => Controls_Manager::SELECT, | |
| 609 | - 'type' => Controls_Manager::SWITCHER, | |
| 610 | - 'condition' => [ | |
| 611 | - 'advance' => 'yes', | |
| 612 | - ], | |
| 613 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 614 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 615 | - ] | |
| 616 | - ); | |
| 617 | - $repeater->add_responsive_control( | |
| 618 | - 'tb_cswidth', | |
| 619 | - [ | |
| 620 | - 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 621 | - 'type' => Controls_Manager::SLIDER, | |
| 622 | - 'size_units' => [ '%', 'px' ], | |
| 623 | - 'condition' => [ | |
| 624 | - 'advance' => 'yes', | |
| 625 | - 'tb_cswidthS' => 'yes', | |
| 626 | - ], | |
| 627 | - 'range' => [ | |
| 628 | - '%' => [ | |
| 629 | - 'min' => 0, | |
| 630 | - 'max' => 100, | |
| 631 | - ], | |
| 632 | - 'px' => [ | |
| 633 | - 'min' => 1, | |
| 634 | - 'max' => 1000, | |
| 635 | - ], | |
| 636 | - ], | |
| 637 | - | |
| 638 | - 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 639 | - ] | |
| 640 | - ], | |
| 641 | - ); | |
| 642 | - | |
| 643 | - $repeater->add_control( | |
| 644 | - 'decoration', | |
| 645 | - [ | |
| 646 | - 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 647 | - 'type' => Controls_Manager::SELECT, | |
| 648 | - 'condition' => [ | |
| 649 | - 'advance' => 'yes', | |
| 650 | - ], | |
| 651 | - 'options' => [ | |
| 652 | - '' => esc_html__( 'Default', 'easy-elements' ), | |
| 653 | - 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 654 | - 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 655 | - 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 656 | - 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 657 | - ], | |
| 658 | - 'default' => '', | |
| 659 | - 'selectors' => [ | |
| 660 | - '{{WRAPPER}} table.easyel-table {{CURRENT_ITEM}}' => 'text-decoration:{{VALUE}};', | |
| 661 | - ], | |
| 662 | - ] | |
| 663 | - ); | |
| 664 | - $repeater->add_control( | |
| 665 | - 'table_body_tooltip', | |
| 666 | - [ | |
| 667 | - 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 668 | - 'type' => Controls_Manager::SWITCHER, | |
| 669 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 670 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 671 | - ] | |
| 672 | - ); | |
| 673 | - $repeater->add_control( | |
| 674 | - 'table_body_tooltip_icon', | |
| 675 | - [ | |
| 676 | - 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 677 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 678 | - 'default' => [ | |
| 679 | - 'value' => 'fas fa-question-circle', | |
| 680 | - 'library' => 'fa-solid', | |
| 681 | - ], | |
| 682 | - 'condition' => [ | |
| 683 | - 'table_body_tooltip' => 'yes', | |
| 684 | - ], | |
| 685 | - ] | |
| 686 | - ); | |
| 687 | - $repeater->add_control( | |
| 688 | - 'table_body_tooltip_description', | |
| 689 | - [ | |
| 690 | - 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 691 | - 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 692 | - 'rows' => 10, | |
| 693 | - 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 694 | - 'condition' => [ | |
| 695 | - 'table_body_tooltip' => 'yes', | |
| 696 | - ], | |
| 697 | - ] | |
| 698 | - ); | |
| 699 | - | |
| 700 | - $this->add_control( | |
| 701 | - 'table_body', | |
| 702 | - [ | |
| 703 | - 'label' => esc_html__( 'Table Body Cell', 'easy-elements' ), | |
| 704 | - 'type' => Controls_Manager::REPEATER, | |
| 705 | - 'fields' => $repeater->get_controls(), | |
| 706 | - | |
| 707 | - 'default' => [ | |
| 708 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 709 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 710 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 711 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 712 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 713 | - [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 714 | - ], | |
| 715 | - | |
| 716 | - 'title_field' => '{{{ text }}}', | |
| 717 | - ] | |
| 718 | - ); | |
| 719 | - | |
| 720 | - | |
| 721 | - $this->end_controls_section(); | |
| 722 | - | |
| 723 | - $this->start_controls_section( | |
| 724 | - 'content_table_footer', | |
| 725 | - [ | |
| 726 | - 'label' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 727 | - 'tab' => Controls_Manager::TAB_CONTENT, | |
| 728 | - ] | |
| 729 | - ); | |
| 730 | - $this->add_control( | |
| 731 | - 'table_footer', | |
| 732 | - [ | |
| 733 | - 'label' => esc_html__( 'Table footer Cell', 'easy-elements' ), | |
| 734 | - 'type' => Controls_Manager::REPEATER, | |
| 735 | - 'prevent_empty' => false, | |
| 736 | - 'default' => [ | |
| 737 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 738 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 739 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 740 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 741 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 742 | - [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 743 | - ], | |
| 744 | - | |
| 745 | - 'fields' => [ | |
| 746 | - [ | |
| 747 | - 'name' => 'text', | |
| 748 | - 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 749 | - 'type' => Controls_Manager::TEXT, | |
| 750 | - 'label_block' => true, | |
| 751 | - 'placeholder' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 752 | - 'default' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 753 | - 'dynamic' => [ | |
| 754 | - 'active' => true, | |
| 755 | - ] | |
| 756 | - ], | |
| 757 | - [ | |
| 758 | - 'name' => 'advance', | |
| 759 | - 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 760 | - 'type' => Controls_Manager::SWITCHER, | |
| 761 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 762 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 763 | - ], | |
| 764 | - [ | |
| 765 | - 'name' => 'colspan', | |
| 766 | - 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 767 | - 'type' => Controls_Manager::SWITCHER, | |
| 768 | - 'condition' => [ | |
| 769 | - 'advance' => 'yes', | |
| 770 | - ], | |
| 771 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 772 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 773 | - ], | |
| 774 | - [ | |
| 775 | - 'name' => 'colspannumber', | |
| 776 | - 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 777 | - 'type' => Controls_Manager::TEXT, | |
| 778 | - 'condition' => [ | |
| 779 | - 'advance' => 'yes', | |
| 780 | - 'colspan' => 'yes', | |
| 781 | - ], | |
| 782 | - 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 783 | - 'default' => esc_html__( '1', 'easy-elements' ), | |
| 784 | - ], | |
| 785 | - [ | |
| 786 | - 'name' => 'customwidth', | |
| 787 | - 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 788 | - 'type' => Controls_Manager::SWITCHER, | |
| 789 | - 'condition' => [ | |
| 790 | - 'advance' => 'yes', | |
| 791 | - ], | |
| 792 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 793 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 794 | - ], | |
| 795 | - [ | |
| 796 | - 'name' => 'width', | |
| 797 | - 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 798 | - 'type' => Controls_Manager::SLIDER, | |
| 799 | - 'condition' => [ | |
| 800 | - 'advance' => 'yes', | |
| 801 | - 'customwidth' => 'yes', | |
| 802 | - ], | |
| 803 | - 'range' => [ | |
| 804 | - '%' => [ | |
| 805 | - 'min' => 0, | |
| 806 | - 'max' => 100, | |
| 807 | - ], | |
| 808 | - 'px' => [ | |
| 809 | - 'min' => 1, | |
| 810 | - 'max' => 1000, | |
| 811 | - ], | |
| 812 | - ], | |
| 813 | - 'default' => [ | |
| 814 | - 'size' => 30, | |
| 815 | - 'unit' => '%', | |
| 816 | - ], | |
| 817 | - 'size_units' => [ '%', 'px' ], | |
| 818 | - 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 819 | - ] | |
| 820 | - ], | |
| 821 | - [ | |
| 822 | - 'name' => 'align', | |
| 823 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 824 | - 'type' => Controls_Manager::CHOOSE, | |
| 825 | - 'condition' => [ | |
| 826 | - 'advance' => 'yes', | |
| 827 | - ], | |
| 828 | - 'options' => [ | |
| 829 | - 'left' => [ | |
| 830 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 831 | - 'icon' => 'eicon-text-align-left', | |
| 832 | - ], | |
| 833 | - 'center' => [ | |
| 834 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 835 | - 'icon' => 'eicon-text-align-center', | |
| 836 | - ], | |
| 837 | - 'right' => [ | |
| 838 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 839 | - 'icon' => 'eicon-text-align-right', | |
| 840 | - ], | |
| 841 | - 'justify' => [ | |
| 842 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 843 | - 'icon' => 'eicon-text-align-justify', | |
| 844 | - ], | |
| 845 | - ], | |
| 846 | - 'default' => '', | |
| 847 | - 'selectors' => [ | |
| 848 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 849 | - ] | |
| 850 | - ], | |
| 851 | - [ | |
| 852 | - 'name' => 'vertical_align', | |
| 853 | - 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ), | |
| 854 | - 'type' => Controls_Manager::CHOOSE, | |
| 855 | - 'condition' => [ | |
| 856 | - 'advance' => 'yes', | |
| 857 | - ], | |
| 858 | - 'options' => [ | |
| 859 | - 'top' => [ | |
| 860 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 861 | - 'icon' => 'eicon-v-align-up', | |
| 862 | - ], | |
| 863 | - 'middle' => [ | |
| 864 | - 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 865 | - 'icon' => 'eicon-v-align-middle', | |
| 866 | - ], | |
| 867 | - 'bottom' => [ | |
| 868 | - 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 869 | - 'icon' => 'eicon-v-align-bottom', | |
| 870 | - ], | |
| 871 | - ], | |
| 872 | - 'default' => '', | |
| 873 | - 'selectors' => [ | |
| 874 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 875 | - ] | |
| 876 | - ], | |
| 877 | - | |
| 878 | - [ | |
| 879 | - 'name' => 'decoration', | |
| 880 | - 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 881 | - 'type' => Controls_Manager::SELECT, | |
| 882 | - 'condition' => [ | |
| 883 | - 'advance' => 'yes', | |
| 884 | - ], | |
| 885 | - 'options' => [ | |
| 886 | - '' => esc_html__( 'Default', 'easy-elements' ), | |
| 887 | - 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 888 | - 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 889 | - 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 890 | - 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 891 | - ], | |
| 892 | - 'default' => '', | |
| 893 | - 'selectors' => [ | |
| 894 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};', | |
| 895 | - ], | |
| 896 | - ], | |
| 897 | - [ | |
| 898 | - 'name' => 'table_foot_tooltip', | |
| 899 | - 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 900 | - 'type' => Controls_Manager::SWITCHER, | |
| 901 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 902 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 903 | - ], | |
| 904 | - [ | |
| 905 | - 'name' => 'table_foot_tooltip_icon', | |
| 906 | - 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 907 | - 'type' => \Elementor\Controls_Manager::ICONS, | |
| 908 | - 'default' => [ | |
| 909 | - 'value' => 'fas fa-question-circle', | |
| 910 | - 'library' => 'fa-solid', | |
| 911 | - ], | |
| 912 | - 'condition' => [ | |
| 913 | - 'table_foot_tooltip' => 'yes', | |
| 914 | - ], | |
| 915 | - ], | |
| 916 | - [ | |
| 917 | - 'name' => 'table_foot_tooltip_description', | |
| 918 | - 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 919 | - 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 920 | - 'rows' => 10, | |
| 921 | - 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 922 | - 'condition' => [ | |
| 923 | - 'table_foot_tooltip' => 'yes', | |
| 924 | - ], | |
| 925 | - ], | |
| 926 | - ], | |
| 927 | - 'title_field' => '{{{ text }}}', | |
| 928 | - ] | |
| 929 | - ); | |
| 930 | - $this->end_controls_section(); | |
| 931 | - | |
| 932 | - $this->start_controls_section( | |
| 933 | - 'section_style', | |
| 934 | - [ | |
| 935 | - 'label' => esc_html__( 'General Style', 'easy-elements' ), | |
| 936 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 937 | - ] | |
| 938 | - ); | |
| 939 | - | |
| 940 | - $this->add_control( | |
| 941 | - 'vertical_align_table', [ | |
| 942 | - 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ), | |
| 943 | - 'type' => Controls_Manager::CHOOSE, | |
| 944 | - 'options' => [ | |
| 945 | - 'top' => [ | |
| 946 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 947 | - 'icon' => 'eicon-v-align-top', | |
| 948 | - ], | |
| 949 | - 'middle' => [ | |
| 950 | - 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 951 | - 'icon' => 'eicon-v-align-middle', | |
| 952 | - ], | |
| 953 | - 'bottom' => [ | |
| 954 | - 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 955 | - 'icon' => 'eicon-v-align-bottom', | |
| 956 | - ], | |
| 957 | - ], | |
| 958 | - 'default' => '', | |
| 959 | - 'selectors' => [ | |
| 960 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'vertical-align: {{VALUE}};', | |
| 961 | - '{{WRAPPER}} table.easyel-table .easyel-table-body th' => 'vertical-align: {{VALUE}};', | |
| 962 | - ], | |
| 963 | - ] | |
| 964 | - ); | |
| 965 | - $this->add_responsive_control( | |
| 966 | - 'table_margin', | |
| 967 | - [ | |
| 968 | - 'label' => esc_html__( 'Table Margin', 'easy-elements' ), | |
| 969 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 970 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 971 | - 'selectors' => [ | |
| 972 | - '{{WRAPPER}} table.easyel-table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 973 | - ], | |
| 974 | - ] | |
| 975 | - ); | |
| 976 | - $this->add_responsive_control( | |
| 977 | - 'table_padding', | |
| 978 | - [ | |
| 979 | - 'label' => esc_html__( 'Table Padding', 'easy-elements' ), | |
| 980 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 981 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 982 | - 'selectors' => [ | |
| 983 | - '{{WRAPPER}} table.easyel-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 984 | - '{{WRAPPER}} table.easyel-table tbody td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 985 | - ], | |
| 986 | - ] | |
| 987 | - ); | |
| 988 | - | |
| 989 | - $this->add_group_control( | |
| 990 | - Group_Control_Border::get_type(), | |
| 991 | - [ | |
| 992 | - 'name' => 'table_border', | |
| 993 | - 'label' => esc_html__( 'Border', 'easy-elements' ), | |
| 994 | - 'selector' => '{{WRAPPER}} table.easyel-table tbody', | |
| 995 | - ] | |
| 996 | - ); | |
| 997 | - $this->add_responsive_control( | |
| 998 | - 'table_radius', | |
| 999 | - [ | |
| 1000 | - 'label' => esc_html__( 'Table Border Radius', 'easy-elements' ), | |
| 1001 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1002 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1003 | - 'selectors' => [ | |
| 1004 | - '{{WRAPPER}} table.easyel-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1005 | - ], | |
| 1006 | - ] | |
| 1007 | - ); | |
| 1008 | - $this->end_controls_section(); | |
| 1009 | - | |
| 1010 | - $this->start_controls_section( | |
| 1011 | - 'table_header_style', | |
| 1012 | - [ | |
| 1013 | - 'label' => esc_html__( 'Table Header Style', 'easy-elements' ), | |
| 1014 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 1015 | - ] | |
| 1016 | - ); | |
| 1017 | - | |
| 1018 | - $this->add_responsive_control( | |
| 1019 | - 'header_align', | |
| 1020 | - [ | |
| 1021 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1022 | - 'type' => Controls_Manager::CHOOSE, | |
| 1023 | - 'options' => [ | |
| 1024 | - 'left' => [ | |
| 1025 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1026 | - 'icon' => 'eicon-text-align-left', | |
| 1027 | - ], | |
| 1028 | - 'center' => [ | |
| 1029 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1030 | - 'icon' => 'eicon-text-align-center', | |
| 1031 | - ], | |
| 1032 | - 'right' => [ | |
| 1033 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1034 | - 'icon' => 'eicon-text-align-right', | |
| 1035 | - ], | |
| 1036 | - 'justify' => [ | |
| 1037 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1038 | - 'icon' => 'eicon-text-align-justify', | |
| 1039 | - ], | |
| 1040 | - ], | |
| 1041 | - 'selectors' => [ | |
| 1042 | - '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'text-align: {{VALUE}};', | |
| 1043 | - ], | |
| 1044 | - ] | |
| 1045 | - ); | |
| 1046 | - | |
| 1047 | - $this->add_control( | |
| 1048 | - 'header_text_color', | |
| 1049 | - [ | |
| 1050 | - 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1051 | - 'type' => Controls_Manager::COLOR, | |
| 1052 | - 'selectors' => [ | |
| 1053 | - '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'color: {{VALUE}};', | |
| 1054 | - ] | |
| 1055 | - ] | |
| 1056 | - ); | |
| 1057 | - | |
| 1058 | - $this->add_group_control( | |
| 1059 | - Group_Control_Typography::get_type(), | |
| 1060 | - [ | |
| 1061 | - 'name' => 'header_typography', | |
| 1062 | - 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-header', | |
| 1063 | - | |
| 1064 | - ] | |
| 1065 | - ); | |
| 1066 | - | |
| 1067 | - $this->add_control( | |
| 1068 | - 'header_bg_color', | |
| 1069 | - [ | |
| 1070 | - 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1071 | - 'type' => Controls_Manager::COLOR, | |
| 1072 | - 'selectors' => [ | |
| 1073 | - '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'background-color: {{VALUE}};', | |
| 1074 | - ] | |
| 1075 | - ] | |
| 1076 | - ); | |
| 1077 | - $this->add_group_control( | |
| 1078 | - \Elementor\Group_Control_Border::get_type(), | |
| 1079 | - [ | |
| 1080 | - 'name' => 'body_head_border', | |
| 1081 | - 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-header th', | |
| 1082 | - ] | |
| 1083 | - ); | |
| 1084 | - $this->add_responsive_control( | |
| 1085 | - 'table_thead_radius', | |
| 1086 | - [ | |
| 1087 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1088 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1089 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1090 | - 'selectors' => [ | |
| 1091 | - '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1092 | - ], | |
| 1093 | - ] | |
| 1094 | - ); | |
| 1095 | - $this->add_responsive_control( | |
| 1096 | - 'table_thead_padding', | |
| 1097 | - [ | |
| 1098 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1099 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1100 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1101 | - 'selectors' => [ | |
| 1102 | - '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1103 | - ], | |
| 1104 | - ] | |
| 1105 | - ); | |
| 1106 | - | |
| 1107 | - // header icon settings | |
| 1108 | - $this->add_control( | |
| 1109 | - 'header_icon_styles', | |
| 1110 | - [ | |
| 1111 | - 'label' => esc_html__( 'Icon Style', 'easy-elements' ), | |
| 1112 | - 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1113 | - 'separator' => 'before', | |
| 1114 | - ] | |
| 1115 | - ); | |
| 1116 | - | |
| 1117 | - $this->add_control( | |
| 1118 | - 'header_icon_color', | |
| 1119 | - [ | |
| 1120 | - 'label' => esc_html__( 'Color', 'easy-elements' ), | |
| 1121 | - 'type' => Controls_Manager::COLOR, | |
| 1122 | - 'selectors' => [ | |
| 1123 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'color: {{VALUE}} !important;', | |
| 1124 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon svg path' => 'fill: {{VALUE}} !important;', | |
| 1125 | - ], | |
| 1126 | - ] | |
| 1127 | - ); | |
| 1128 | - | |
| 1129 | - $this->add_responsive_control( | |
| 1130 | - 'header_icon_size', | |
| 1131 | - [ | |
| 1132 | - 'label' => esc_html__( 'Size', 'easy-elements' ), | |
| 1133 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1134 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1135 | - 'selectors' => [ | |
| 1136 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'font-size: {{SIZE}}{{UNIT}} !important;', | |
| 1137 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', | |
| 1138 | - ], | |
| 1139 | - ] | |
| 1140 | - ); | |
| 1141 | - | |
| 1142 | - $this->add_responsive_control( | |
| 1143 | - 'header_icon_y_position', | |
| 1144 | - [ | |
| 1145 | - 'label' => esc_html__( 'Pisition ( Vertical )', 'easy-elements' ), | |
| 1146 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1147 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1148 | - 'selectors' => [ | |
| 1149 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'top: {{SIZE}}{{UNIT}} !important;', | |
| 1150 | - ], | |
| 1151 | - ] | |
| 1152 | - ); | |
| 1153 | - | |
| 1154 | - $this->add_responsive_control( | |
| 1155 | - 'header_icon_margin', | |
| 1156 | - [ | |
| 1157 | - 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1158 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1159 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1160 | - 'selectors' => [ | |
| 1161 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1162 | - '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1163 | - ], | |
| 1164 | - ] | |
| 1165 | - ); | |
| 1166 | - $this->end_controls_section(); | |
| 1167 | - | |
| 1168 | - | |
| 1169 | - $this->start_controls_section( | |
| 1170 | - 'table_body_style', | |
| 1171 | - [ | |
| 1172 | - 'label' => esc_html__( 'Table Body Style', 'easy-elements' ), | |
| 1173 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 1174 | - ] | |
| 1175 | - ); | |
| 1176 | - | |
| 1177 | - $this->add_responsive_control( | |
| 1178 | - 'body_align', | |
| 1179 | - [ | |
| 1180 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1181 | - 'type' => Controls_Manager::CHOOSE, | |
| 1182 | - 'options' => [ | |
| 1183 | - 'left' => [ | |
| 1184 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1185 | - 'icon' => 'eicon-text-align-left', | |
| 1186 | - ], | |
| 1187 | - 'center' => [ | |
| 1188 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1189 | - 'icon' => 'eicon-text-align-center', | |
| 1190 | - ], | |
| 1191 | - 'right' => [ | |
| 1192 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1193 | - 'icon' => 'eicon-text-align-right', | |
| 1194 | - ], | |
| 1195 | - 'justify' => [ | |
| 1196 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1197 | - 'icon' => 'eicon-text-align-justify', | |
| 1198 | - ], | |
| 1199 | - ], | |
| 1200 | - 'selectors' => [ | |
| 1201 | - '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'text-align: {{VALUE}};', | |
| 1202 | - ], | |
| 1203 | - ] | |
| 1204 | - ); | |
| 1205 | - | |
| 1206 | - $this->add_control( | |
| 1207 | - 'body_text_color', | |
| 1208 | - [ | |
| 1209 | - 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1210 | - 'type' => Controls_Manager::COLOR, | |
| 1211 | - 'selectors' => [ | |
| 1212 | - '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'color: {{VALUE}};', | |
| 1213 | - ] | |
| 1214 | - ] | |
| 1215 | - ); | |
| 1216 | - | |
| 1217 | - | |
| 1218 | - $this->add_group_control( | |
| 1219 | - Group_Control_Typography::get_type(), | |
| 1220 | - [ | |
| 1221 | - 'name' => 'body_typography', | |
| 1222 | - 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-body', | |
| 1223 | - | |
| 1224 | - ] | |
| 1225 | - ); | |
| 1226 | - | |
| 1227 | - $this->add_control( | |
| 1228 | - 'body_bg_color', | |
| 1229 | - [ | |
| 1230 | - 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1231 | - 'type' => Controls_Manager::COLOR, | |
| 1232 | - 'selectors' => [ | |
| 1233 | - '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'background-color: {{VALUE}};', | |
| 1234 | - ] | |
| 1235 | - ] | |
| 1236 | - ); | |
| 1237 | - | |
| 1238 | - $this->add_control( | |
| 1239 | - 'striped_bg', | |
| 1240 | - [ | |
| 1241 | - 'label' => esc_html__( 'Striped Background', 'easy-elements' ), | |
| 1242 | - 'type' => Controls_Manager::SWITCHER, | |
| 1243 | - 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 1244 | - 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 1245 | - ] | |
| 1246 | - ); | |
| 1247 | - $this->add_control( | |
| 1248 | - 'striped_bg_color', | |
| 1249 | - [ | |
| 1250 | - 'label' => esc_html__( 'Secondary Background Color', 'easy-elements' ), | |
| 1251 | - 'type' => Controls_Manager::COLOR, | |
| 1252 | - 'condition' => [ | |
| 1253 | - 'striped_bg' => 'yes', | |
| 1254 | - ], | |
| 1255 | - 'selectors' => [ | |
| 1256 | - '{{WRAPPER}} table.easyel-table .easyel-table-body tr:nth-of-type(2n)' => 'background-color: {{VALUE}};', | |
| 1257 | - ] | |
| 1258 | - ] | |
| 1259 | - ); | |
| 1260 | - $this->add_control( | |
| 1261 | - 'body_icon_color', | |
| 1262 | - [ | |
| 1263 | - 'label' => esc_html__( 'Icon Color', 'easy-elements' ), | |
| 1264 | - 'type' => Controls_Manager::COLOR, | |
| 1265 | - 'selectors' => [ | |
| 1266 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'color: {{VALUE}};', | |
| 1267 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td svg path' => 'fill: {{VALUE}};', | |
| 1268 | - ] | |
| 1269 | - ] | |
| 1270 | - ); | |
| 1271 | - $this->add_control( | |
| 1272 | - 'body_icon_size', | |
| 1273 | - [ | |
| 1274 | - 'label' => esc_html__( 'Icon Size', 'easy-elements' ), | |
| 1275 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1276 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1277 | - 'range' => [ | |
| 1278 | - 'px' => [ | |
| 1279 | - 'min' => 0, | |
| 1280 | - 'max' => 1000, | |
| 1281 | - ], | |
| 1282 | - ], | |
| 1283 | - 'default' => [ | |
| 1284 | - 'unit' => 'px', | |
| 1285 | - 'size' => 16, | |
| 1286 | - ], | |
| 1287 | - 'selectors' => [ | |
| 1288 | - '{{WRAPPER}} .table.easyel-table .easyel-table-body td i' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 1289 | - '{{WRAPPER}} .table.easyel-table .easyel-table-body td svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', | |
| 1290 | - ], | |
| 1291 | - ] | |
| 1292 | - ); | |
| 1293 | - $this->add_responsive_control( | |
| 1294 | - 'body_icon_gap', | |
| 1295 | - [ | |
| 1296 | - 'label' => esc_html__( 'Icon Margin', 'easy-elements' ), | |
| 1297 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1298 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1299 | - 'selectors' => [ | |
| 1300 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1301 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1302 | - ], | |
| 1303 | - ] | |
| 1304 | - ); | |
| 1305 | - $this->add_responsive_control( | |
| 1306 | - 'table_tbody_radius', | |
| 1307 | - [ | |
| 1308 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1309 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1310 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1311 | - 'selectors' => [ | |
| 1312 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1313 | - ], | |
| 1314 | - ] | |
| 1315 | - ); | |
| 1316 | - $this->add_responsive_control( | |
| 1317 | - 'table_tbody_padding', | |
| 1318 | - [ | |
| 1319 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1320 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1321 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1322 | - 'selectors' => [ | |
| 1323 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1324 | - ], | |
| 1325 | - ] | |
| 1326 | - ); | |
| 1327 | - $this->add_responsive_control( | |
| 1328 | - 'table_tbody_margin', | |
| 1329 | - [ | |
| 1330 | - 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1331 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1332 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1333 | - 'selectors' => [ | |
| 1334 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1335 | - '{{WRAPPER}} table.easyel-table .easyel-table-body td p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1336 | - ], | |
| 1337 | - ] | |
| 1338 | - ); | |
| 1339 | - $this->add_group_control( | |
| 1340 | - \Elementor\Group_Control_Border::get_type(), | |
| 1341 | - [ | |
| 1342 | - 'name' => 'body_border', | |
| 1343 | - 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-body td', | |
| 1344 | - ] | |
| 1345 | - ); | |
| 1346 | - $this->add_control( | |
| 1347 | - 'tooltip_heading', | |
| 1348 | - [ | |
| 1349 | - 'label' => esc_html__( 'Tooltip Options', 'easy-elements' ), | |
| 1350 | - 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1351 | - 'separator' => 'before', | |
| 1352 | - ] | |
| 1353 | - ); | |
| 1354 | - $this->add_control( | |
| 1355 | - 'tooltip_icon_color', | |
| 1356 | - [ | |
| 1357 | - 'label' => esc_html__( 'Tooltip Icon Color', 'easy-elements' ), | |
| 1358 | - 'type' => Controls_Manager::COLOR, | |
| 1359 | - 'selectors' => [ | |
| 1360 | - '{{WRAPPER}} table.easyel-table .easyel-tooltip i' => 'color: {{VALUE}} !important;', | |
| 1361 | - '{{WRAPPER}} table.easyel-table .easyel-tooltip svg path' => 'fill: {{VALUE}} !important;', | |
| 1362 | - ] | |
| 1363 | - ] | |
| 1364 | - ); | |
| 1365 | - $this->add_control( | |
| 1366 | - 'tooltip_icon_size', | |
| 1367 | - [ | |
| 1368 | - 'label' => esc_html__( 'Tooltip Icon Size', 'easy-elements' ), | |
| 1369 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1370 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1371 | - 'range' => [ | |
| 1372 | - 'px' => [ | |
| 1373 | - 'min' => 0, | |
| 1374 | - 'max' => 1000, | |
| 1375 | - ], | |
| 1376 | - ], | |
| 1377 | - 'default' => [ | |
| 1378 | - 'unit' => 'px', | |
| 1379 | - 'size' => 16, | |
| 1380 | - ], | |
| 1381 | - 'selectors' => [ | |
| 1382 | - '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'font-size: {{SIZE}}{{UNIT}} !important;', | |
| 1383 | - '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', | |
| 1384 | - ], | |
| 1385 | - ] | |
| 1386 | - ); | |
| 1387 | - $this->add_responsive_control( | |
| 1388 | - 'tooltip_icon_margin', | |
| 1389 | - [ | |
| 1390 | - 'label' => esc_html__( 'Tooltip Icon Margin', 'easy-elements' ), | |
| 1391 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1392 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1393 | - 'selectors' => [ | |
| 1394 | - '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1395 | - '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1396 | - ], | |
| 1397 | - ] | |
| 1398 | - ); | |
| 1399 | - $this->add_responsive_control( | |
| 1400 | - 'tooltip_align', | |
| 1401 | - [ | |
| 1402 | - 'label' => esc_html__( 'Tooltip Align', 'easy-elements' ), | |
| 1403 | - 'type' => Controls_Manager::CHOOSE, | |
| 1404 | - 'options' => [ | |
| 1405 | - 'left' => [ | |
| 1406 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1407 | - 'icon' => 'eicon-h-align-left', | |
| 1408 | - ], | |
| 1409 | - 'top' => [ | |
| 1410 | - 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 1411 | - 'icon' => 'eicon-v-align-top', | |
| 1412 | - ], | |
| 1413 | - 'right' => [ | |
| 1414 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1415 | - 'icon' => 'eicon-h-align-right', | |
| 1416 | - ], | |
| 1417 | - 'bottom' => [ | |
| 1418 | - 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 1419 | - 'icon' => 'eicon-v-align-bottom', | |
| 1420 | - ], | |
| 1421 | - ], | |
| 1422 | - 'default' => 'left', | |
| 1423 | - 'toggle' => true, | |
| 1424 | - ] | |
| 1425 | - ); | |
| 1426 | - | |
| 1427 | - // image style | |
| 1428 | - $this->add_control( | |
| 1429 | - 'table_img_heading', | |
| 1430 | - [ | |
| 1431 | - 'label' => esc_html__( 'Image Options', 'easy-elements' ), | |
| 1432 | - 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1433 | - 'separator' => 'before', | |
| 1434 | - ] | |
| 1435 | - ); | |
| 1436 | - | |
| 1437 | - $this->add_control( | |
| 1438 | - 'table_img_size', | |
| 1439 | - [ | |
| 1440 | - 'label' => esc_html__( 'Size', 'easy-elements' ), | |
| 1441 | - 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1442 | - 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1443 | - 'selectors' => [ | |
| 1444 | - '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'max-width: {{SIZE}}{{UNIT}} !important;height: {{SIZE}}{{UNIT}} !important;', | |
| 1445 | - ], | |
| 1446 | - ] | |
| 1447 | - ); | |
| 1448 | - | |
| 1449 | - $this->add_responsive_control( | |
| 1450 | - 'table_img_radius', | |
| 1451 | - [ | |
| 1452 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1453 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1454 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1455 | - 'selectors' => [ | |
| 1456 | - '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1457 | - ], | |
| 1458 | - ] | |
| 1459 | - ); | |
| 1460 | - | |
| 1461 | - $this->end_controls_section(); | |
| 1462 | - | |
| 1463 | - $this->start_controls_section( | |
| 1464 | - 'table_footer_style', | |
| 1465 | - [ | |
| 1466 | - 'label' => esc_html__( 'Table footer Style', 'easy-elements' ), | |
| 1467 | - 'tab' => Controls_Manager::TAB_STYLE, | |
| 1468 | - ] | |
| 1469 | - ); | |
| 1470 | - | |
| 1471 | - $this->add_responsive_control( | |
| 1472 | - 'footer_align', | |
| 1473 | - [ | |
| 1474 | - 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1475 | - 'type' => Controls_Manager::CHOOSE, | |
| 1476 | - 'options' => [ | |
| 1477 | - 'left' => [ | |
| 1478 | - 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1479 | - 'icon' => 'eicon-text-align-left', | |
| 1480 | - ], | |
| 1481 | - 'center' => [ | |
| 1482 | - 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1483 | - 'icon' => 'eicon-text-align-center', | |
| 1484 | - ], | |
| 1485 | - 'right' => [ | |
| 1486 | - 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1487 | - 'icon' => 'eicon-text-align-right', | |
| 1488 | - ], | |
| 1489 | - 'justify' => [ | |
| 1490 | - 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1491 | - 'icon' => 'eicon-text-align-justify', | |
| 1492 | - ], | |
| 1493 | - ], | |
| 1494 | - 'selectors' => [ | |
| 1495 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'text-align: {{VALUE}};', | |
| 1496 | - ], | |
| 1497 | - ] | |
| 1498 | - ); | |
| 1499 | - | |
| 1500 | - | |
| 1501 | - $this->add_control( | |
| 1502 | - 'footer_text_color', | |
| 1503 | - [ | |
| 1504 | - 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1505 | - 'type' => Controls_Manager::COLOR, | |
| 1506 | - 'selectors' => [ | |
| 1507 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'color: {{VALUE}};', | |
| 1508 | - ] | |
| 1509 | - ] | |
| 1510 | - ); | |
| 1511 | - | |
| 1512 | - $this->add_group_control( | |
| 1513 | - Group_Control_Typography::get_type(), | |
| 1514 | - [ | |
| 1515 | - 'name' => 'footer_typography', | |
| 1516 | - 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-footer', | |
| 1517 | - | |
| 1518 | - ] | |
| 1519 | - ); | |
| 1520 | - | |
| 1521 | - $this->add_control( | |
| 1522 | - 'footer_bg_color', | |
| 1523 | - [ | |
| 1524 | - 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1525 | - 'type' => Controls_Manager::COLOR, | |
| 1526 | - 'selectors' => [ | |
| 1527 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'background-color: {{VALUE}};', | |
| 1528 | - ] | |
| 1529 | - ] | |
| 1530 | - ); | |
| 1531 | - $this->add_responsive_control( | |
| 1532 | - 'table_tfoot_radius', | |
| 1533 | - [ | |
| 1534 | - 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1535 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1536 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1537 | - 'selectors' => [ | |
| 1538 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1539 | - ], | |
| 1540 | - ] | |
| 1541 | - ); | |
| 1542 | - $this->add_responsive_control( | |
| 1543 | - 'table_tfoot_padding', | |
| 1544 | - [ | |
| 1545 | - 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1546 | - 'type' => Controls_Manager::DIMENSIONS, | |
| 1547 | - 'size_units' => [ 'px', '%', 'em' ], | |
| 1548 | - 'selectors' => [ | |
| 1549 | - '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1550 | - ], | |
| 1551 | - ] | |
| 1552 | - ); | |
| 1553 | - $this->add_group_control( | |
| 1554 | - \Elementor\Group_Control_Border::get_type(), | |
| 1555 | - [ | |
| 1556 | - 'name' => 'body_foot_border', | |
| 1557 | - 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-footer th', | |
| 1558 | - ] | |
| 1559 | - ); | |
| 1560 | - | |
| 1561 | - $this->end_controls_section(); | |
| 1562 | - | |
| 1563 | - } | |
| 1564 | - /** | |
| 1565 | - * Render oEmbed widget output on the frontend. | |
| 1566 | - * | |
| 1567 | - * Written in PHP and used to generate the final HTML. | |
| 1568 | - * | |
| 1569 | - * @since 1.0.0 | |
| 1570 | - * @access protected | |
| 1571 | - */ | |
| 1572 | - protected function render() { | |
| 1573 | - $settings = $this->get_settings_for_display(); | |
| 1574 | - $unique = wp_rand(10,6554120); | |
| 1575 | - $tooltip_align = $settings['tooltip_align']; | |
| 1576 | - ?> | |
| 1577 | - <!-- Tooltip element --> | |
| 1578 | - <table class="easyel-table table single-plan" id="table-<?php echo esc_attr($unique);?>"> | |
| 1579 | - <?php if ($settings['table_header']):?> | |
| 1580 | - <thead class="easyel-table-header"> | |
| 1581 | - <tr class="single-plan__header"> | |
| 1582 | - <?php | |
| 1583 | - foreach ( $settings['table_header'] as $index => $headeritem ) { | |
| 1584 | - | |
| 1585 | - $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_header', $index ); | |
| 1586 | - $this->add_inline_editing_attributes( $repeater_setting_key ); | |
| 1587 | - | |
| 1588 | - $colspan = ( isset( $headeritem['colspan'], $headeritem['advance'] ) && $headeritem['colspan'] === 'yes' && $headeritem['advance'] === 'yes' ) ? 'colspan="' . esc_attr( $headeritem['colspannumber'] ) . '"' : ''; | |
| 1589 | - | |
| 1590 | - echo '<th class="header-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $headeritem['_id'] ) . '" ' | |
| 1591 | - . esc_attr( $colspan ) . ' ' | |
| 1592 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1593 | - . $this->get_render_attribute_string( $repeater_setting_key ) . '>'; | |
| 1594 | - | |
| 1595 | - // Header Icon | |
| 1596 | - if ( isset( $headeritem['header_icon'] ) && $headeritem['header_icon'] === 'yes' && ! empty( $headeritem['table_head_icon']['value'] ) ) { | |
| 1597 | - echo '<span class="easyel-header-icon">'; | |
| 1598 | - | |
| 1599 | - // Render icon safely | |
| 1600 | - \Elementor\Icons_Manager::render_icon( | |
| 1601 | - $headeritem['table_head_icon'], | |
| 1602 | - [ 'aria-hidden' => 'true' ] | |
| 1603 | - ); | |
| 1604 | - | |
| 1605 | - echo '</span>'; | |
| 1606 | - } | |
| 1607 | - | |
| 1608 | - echo wp_kses_post( $headeritem['text'] ); | |
| 1609 | - | |
| 1610 | - if ( isset( $headeritem['table_head_tooltip'] ) && $headeritem['table_head_tooltip'] === 'yes' ) { | |
| 1611 | - echo '<span class="easyel-tooltip" ' | |
| 1612 | - . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1613 | - . 'data-bs-toggle="tooltip" ' | |
| 1614 | - . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1615 | - . 'title="' . esc_attr( $headeritem['table_head_tooltip_description'] ) . '">'; | |
| 1616 | - | |
| 1617 | - \Elementor\Icons_Manager::render_icon( | |
| 1618 | - $headeritem['table_head_tooltip_icon'], | |
| 1619 | - [ 'aria-hidden' => 'true' ] | |
| 1620 | - ); | |
| 1621 | - | |
| 1622 | - echo '</span>'; | |
| 1623 | - } | |
| 1624 | - | |
| 1625 | - echo '</th>'; | |
| 1626 | - } | |
| 1627 | - ?> | |
| 1628 | - </tr> | |
| 1629 | - </thead> | |
| 1630 | - <?php endif;?> | |
| 1631 | - <?php if ($settings['table_body']):?> | |
| 1632 | - <tbody class="easyel-table-body"> | |
| 1633 | - <tr class="single-plan__content"> | |
| 1634 | - <?php | |
| 1635 | - foreach ( $settings['table_body'] as $index => $item ) { | |
| 1636 | - | |
| 1637 | - // Flex data condition | |
| 1638 | - $flex_data = ( !empty( $item['table_body_data_flex'] ) && $item['table_body_data_flex'] === 'yes' ) ? 'data-flex' : ''; | |
| 1639 | - | |
| 1640 | - $table_icon = ! empty( $item['table_icon'] ) ? $item['table_icon'] : ''; | |
| 1641 | - | |
| 1642 | - | |
| 1643 | - $table_body_key = $this->get_repeater_setting_key( 'text', 'table_body', $index ); | |
| 1644 | - | |
| 1645 | - $this->add_render_attribute( $table_body_key, 'class', 'plan-title ' . $flex_data . ' elementor-repeater-item-' . esc_attr( $item['_id'] ) ); | |
| 1646 | - | |
| 1647 | - $this->add_inline_editing_attributes( $table_body_key ); | |
| 1648 | - | |
| 1649 | - if ( isset( $item['row'] ) && $item['row'] === 'yes' ) { | |
| 1650 | - echo '</tr><tr class="single-plan__content">'; | |
| 1651 | - } | |
| 1652 | - | |
| 1653 | - $colspan = ( isset( $item['colspan'], $item['advance'] ) && $item['colspan'] === 'yes' && $item['advance'] === 'yes' ) | |
| 1654 | - ? 'colspan="' . esc_attr( $item['colspannumber'] ) . '"' | |
| 1655 | - : ''; | |
| 1656 | - | |
| 1657 | - $rowspan = ( isset( $item['rowspan'], $item['advance'] ) && $item['rowspan'] === 'yes' && $item['advance'] === 'yes' ) | |
| 1658 | - ? 'rowspan="' . esc_attr( $item['rowspannumber'] ) . '"' | |
| 1659 | - : ''; | |
| 1660 | - | |
| 1661 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1662 | - echo '<td ' . $colspan . ' ' . $rowspan . ' ' . $this->get_render_attribute_string( $table_body_key ) . '>'; | |
| 1663 | - | |
| 1664 | - // table icon | |
| 1665 | - if ( ! empty( $table_icon ) ) { | |
| 1666 | - \Elementor\Icons_Manager::render_icon( $table_icon, [ 'aria-hidden' => 'true' ] ); | |
| 1667 | - } | |
| 1668 | - | |
| 1669 | - // table image | |
| 1670 | - $image_id = ! empty( $item['table_image']['id'] ) ? absint( $item['table_image']['id'] ) : ''; | |
| 1671 | - $image_url = ! empty( $item['table_image']['url'] ) ? esc_url( $item['table_image']['url'] ) : ''; | |
| 1672 | - // Case 1: Attachment ID exists and is an image | |
| 1673 | - if ( $image_id && wp_attachment_is_image( $image_id ) ) { | |
| 1674 | - echo wp_get_attachment_image( | |
| 1675 | - $image_id, | |
| 1676 | - 'thumbnail', | |
| 1677 | - false, | |
| 1678 | - [ | |
| 1679 | - 'class' => 'easyel-table-image', | |
| 1680 | - 'alt' => esc_attr( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ), | |
| 1681 | - ] | |
| 1682 | - ); | |
| 1683 | - } | |
| 1684 | - | |
| 1685 | - // Case 2: Fallback to URL | |
| 1686 | - elseif ( $image_url ) { | |
| 1687 | - echo '<img src="' . esc_url( $image_url ) . '" class="easyel-table-image" alt="">'; | |
| 1688 | - } | |
| 1689 | - | |
| 1690 | - echo wp_kses_post( $item['text'] ); | |
| 1691 | - | |
| 1692 | - if ( isset( $item['table_body_tooltip'] ) && $item['table_body_tooltip'] === 'yes' ) { | |
| 1693 | - echo '<span class="easyel-tooltip" ' | |
| 1694 | - . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1695 | - . 'data-bs-toggle="tooltip" ' | |
| 1696 | - . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1697 | - . 'title="' . esc_attr( $item['table_body_tooltip_description'] ) . '">'; | |
| 1698 | - | |
| 1699 | - \Elementor\Icons_Manager::render_icon( | |
| 1700 | - $item['table_body_tooltip_icon'], | |
| 1701 | - [ 'aria-hidden' => 'true' ] | |
| 1702 | - ); | |
| 1703 | - echo '</span>'; | |
| 1704 | - } | |
| 1705 | - | |
| 1706 | - echo '</td>'; | |
| 1707 | - } | |
| 1708 | - ?> | |
| 1709 | - </tr> | |
| 1710 | - </tbody> | |
| 1711 | - <?php endif;?> | |
| 1712 | - <?php if ($settings['table_footer']):?> | |
| 1713 | - <tfoot class="easyel-table-footer"> | |
| 1714 | - <tr class="easyel-single-plane-footer"> | |
| 1715 | - <?php | |
| 1716 | - foreach ( $settings['table_footer'] as $index => $footeritem ) { | |
| 1717 | - | |
| 1718 | - $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_footer', $index ); | |
| 1719 | - $this->add_inline_editing_attributes( $repeater_setting_key ); | |
| 1720 | - | |
| 1721 | - $colspan = ( $footeritem['colspan'] === 'yes' && $footeritem['advance'] === 'yes' ) | |
| 1722 | - ? 'colspan="' . esc_attr( $footeritem['colspannumber'] ) . '"' | |
| 1723 | - : ''; | |
| 1724 | - | |
| 1725 | - echo '<th class="footer-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $footeritem['_id'] ) . '" ' | |
| 1726 | - . esc_attr( $colspan ) . ' ' | |
| 1727 | - // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1728 | - . $this->get_render_attribute_string( $repeater_setting_key ) | |
| 1729 | - . '>' | |
| 1730 | - . wp_kses_post( $footeritem['text'] ); | |
| 1731 | - | |
| 1732 | - if ( isset( $footeritem['table_foot_tooltip'] ) && $footeritem['table_foot_tooltip'] === 'yes' ) { | |
| 1733 | - echo '<span class="easyel-tooltip" ' | |
| 1734 | - . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1735 | - . 'data-bs-toggle="tooltip" ' | |
| 1736 | - . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1737 | - . 'title="' . esc_attr( $footeritem['table_foot_tooltip_description'] ) . '">'; | |
| 1738 | - | |
| 1739 | - \Elementor\Icons_Manager::render_icon( | |
| 1740 | - $footeritem['table_foot_tooltip_icon'], | |
| 1741 | - [ 'aria-hidden' => 'true' ] | |
| 1742 | - ); | |
| 1743 | - | |
| 1744 | - echo '</span>'; | |
| 1745 | - } | |
| 1746 | - | |
| 1747 | - echo '</th>'; | |
| 1748 | - } | |
| 1749 | - ?> | |
| 1750 | - </tr> | |
| 1751 | - </tfoot> | |
| 1752 | - <?php endif;?> | |
| 1753 | - </table> | |
| 1754 | - | |
| 1755 | - <?php | |
| 1756 | - } | |
| 1757 | -} | |
| 1 | +<?php | |
| 2 | +use \Elementor\Controls_Manager; | |
| 3 | +use \Elementor\Repeater; | |
| 4 | +use \Elementor\Group_Control_Border; | |
| 5 | +use \Elementor\Group_Control_Typography; | |
| 6 | + | |
| 7 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 8 | + exit; | |
| 9 | +} | |
| 10 | +/** | |
| 11 | + * Elementor Table Widget. | |
| 12 | + * | |
| 13 | + * @since 1.0.0 | |
| 14 | + */ | |
| 15 | +if( !class_exists("Easyel_Table_Elementor_Widget") ) { | |
| 16 | + class Easyel_Table_Elementor_Widget extends \Elementor\Widget_Base { | |
| 17 | + | |
| 18 | + public function get_style_depends() { | |
| 19 | + $handle = 'eel-table-style'; | |
| 20 | + $css_path = plugin_dir_path( __FILE__ ) . 'css/table.min.css'; | |
| 21 | + if ( ! wp_style_is( $handle, 'registered' ) && file_exists( $css_path ) ) { | |
| 22 | + wp_register_style( $handle, plugins_url( 'css/table.min.css', __FILE__ ), [], defined( 'WP_DEBUG' ) && WP_DEBUG ? filemtime( $css_path ) : EASYELEMENTS_VER ); | |
| 23 | + } | |
| 24 | + return [ $handle ]; | |
| 25 | + } | |
| 26 | + | |
| 27 | + public function get_script_depends() { | |
| 28 | + $handle = 'eel-table-script'; | |
| 29 | + $js_path = plugin_dir_path( __FILE__ ) . 'js/table.js'; | |
| 30 | + | |
| 31 | + if ( ! wp_script_is( $handle, 'registered' ) && file_exists( $js_path ) ) { | |
| 32 | + wp_register_script( $handle, plugins_url( 'js/table.js', __FILE__ ), [ 'jquery' ], filemtime( $js_path ), true ); | |
| 33 | + } | |
| 34 | + | |
| 35 | + return [ $handle ]; | |
| 36 | + } | |
| 37 | + | |
| 38 | + public function get_name() { | |
| 39 | + return 'eel-table'; | |
| 40 | + } | |
| 41 | + | |
| 42 | + /** | |
| 43 | + * Get widget title. | |
| 44 | + * | |
| 45 | + * Retrieve oEmbed widget title. | |
| 46 | + * | |
| 47 | + * @since 1.0.0 | |
| 48 | + * @access public | |
| 49 | + * | |
| 50 | + * @return string Widget title. | |
| 51 | + */ | |
| 52 | + public function get_title() { | |
| 53 | + return esc_html__( 'Table', 'easy-elements' ); | |
| 54 | + } | |
| 55 | + | |
| 56 | + /** | |
| 57 | + * Get widget icon. | |
| 58 | + * | |
| 59 | + * Retrieve oEmbed widget icon. | |
| 60 | + * | |
| 61 | + * @since 1.0.0 | |
| 62 | + * @access public | |
| 63 | + * | |
| 64 | + * @return string Widget icon. | |
| 65 | + */ | |
| 66 | + public function get_icon() { | |
| 67 | + return 'easyicon easyelIcon-clients-logo-grid'; | |
| 68 | + } | |
| 69 | + | |
| 70 | + /** | |
| 71 | + * Get widget categories. | |
| 72 | + * | |
| 73 | + * Retrieve the list of categories the oEmbed widget belongs to. | |
| 74 | + * | |
| 75 | + * @since 1.0.0 | |
| 76 | + * @access public | |
| 77 | + * | |
| 78 | + * @return array Widget categories. | |
| 79 | + */ | |
| 80 | + public function get_categories() { | |
| 81 | + return [ 'easyelements_category' ]; | |
| 82 | + } | |
| 83 | + | |
| 84 | + /** | |
| 85 | + * Register oEmbed widget controls. | |
| 86 | + * | |
| 87 | + * Adds different input fields to allow the user to change and customize the widget settings. | |
| 88 | + * | |
| 89 | + * @since 1.0.0 | |
| 90 | + * @access protected | |
| 91 | + */ | |
| 92 | + | |
| 93 | + public function get_keywords() { | |
| 94 | + return [ 'table', 'simple', 'data', 'click', 'text' ]; | |
| 95 | + } | |
| 96 | + | |
| 97 | + protected function register_controls() { | |
| 98 | + | |
| 99 | + $this->start_controls_section( | |
| 100 | + 'content_table_header', | |
| 101 | + [ | |
| 102 | + 'label' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 103 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 104 | + ] | |
| 105 | + ); | |
| 106 | + | |
| 107 | + $this->add_control( | |
| 108 | + 'table_header', | |
| 109 | + [ | |
| 110 | + 'label' => esc_html__( 'Table Header Cell', 'easy-elements' ), | |
| 111 | + 'type' => Controls_Manager::REPEATER, | |
| 112 | + 'prevent_empty' => false, | |
| 113 | + 'fields' => [ | |
| 114 | + [ | |
| 115 | + 'name' => 'text', | |
| 116 | + 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 117 | + 'type' => Controls_Manager::TEXT, | |
| 118 | + 'label_block' => true, | |
| 119 | + 'placeholder' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 120 | + 'default' => esc_html__( 'Table Header', 'easy-elements' ), | |
| 121 | + 'dynamic' => [ | |
| 122 | + 'active' => true, | |
| 123 | + ] | |
| 124 | + ], | |
| 125 | + [ | |
| 126 | + 'name' => 'header_icon', | |
| 127 | + 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 128 | + 'type' => Controls_Manager::SWITCHER, | |
| 129 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 130 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 131 | + ], | |
| 132 | + [ | |
| 133 | + 'name' => 'table_head_icon', | |
| 134 | + 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 135 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 136 | + 'default' => [ | |
| 137 | + 'value' => 'far fa-user-circle', | |
| 138 | + 'library' => 'fa-solid', | |
| 139 | + ], | |
| 140 | + 'condition' => [ | |
| 141 | + 'header_icon' => 'yes', | |
| 142 | + ], | |
| 143 | + ], | |
| 144 | + [ | |
| 145 | + 'name' => 'advance', | |
| 146 | + 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 147 | + 'type' => Controls_Manager::SWITCHER, | |
| 148 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 149 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 150 | + ], | |
| 151 | + [ | |
| 152 | + 'name' => 'colspan', | |
| 153 | + 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 154 | + 'type' => Controls_Manager::SWITCHER, | |
| 155 | + 'condition' => [ | |
| 156 | + 'advance' => 'yes', | |
| 157 | + ], | |
| 158 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 159 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 160 | + ], | |
| 161 | + [ | |
| 162 | + 'name' => 'colspannumber', | |
| 163 | + 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 164 | + 'type' => Controls_Manager::TEXT, | |
| 165 | + 'condition' => [ | |
| 166 | + 'advance' => 'yes', | |
| 167 | + 'colspan' => 'yes', | |
| 168 | + ], | |
| 169 | + 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 170 | + 'default' => esc_html__( '1', 'easy-elements' ), | |
| 171 | + ], | |
| 172 | + [ | |
| 173 | + 'name' => 'customwidth', | |
| 174 | + 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 175 | + 'type' => Controls_Manager::SWITCHER, | |
| 176 | + 'condition' => [ | |
| 177 | + 'advance' => 'yes', | |
| 178 | + ], | |
| 179 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 180 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 181 | + ], | |
| 182 | + [ | |
| 183 | + 'name' => 'width', | |
| 184 | + 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 185 | + 'type' => Controls_Manager::SLIDER, | |
| 186 | + 'condition' => [ | |
| 187 | + 'advance' => 'yes', | |
| 188 | + 'customwidth' => 'yes', | |
| 189 | + ], | |
| 190 | + 'range' => [ | |
| 191 | + '%' => [ | |
| 192 | + 'min' => 0, | |
| 193 | + 'max' => 100, | |
| 194 | + ], | |
| 195 | + 'px' => [ | |
| 196 | + 'min' => 1, | |
| 197 | + 'max' => 1000, | |
| 198 | + ], | |
| 199 | + ], | |
| 200 | + 'default' => [ | |
| 201 | + 'size' => 30, | |
| 202 | + 'unit' => '%', | |
| 203 | + ], | |
| 204 | + 'size_units' => [ '%', 'px' ], | |
| 205 | + 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 206 | + ] | |
| 207 | + ], | |
| 208 | + [ | |
| 209 | + 'name' => 'align', | |
| 210 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 211 | + 'type' => Controls_Manager::CHOOSE, | |
| 212 | + 'condition' => [ | |
| 213 | + 'advance' => 'yes', | |
| 214 | + ], | |
| 215 | + 'options' => [ | |
| 216 | + 'left' => [ | |
| 217 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 218 | + 'icon' => 'eicon-text-align-left', | |
| 219 | + ], | |
| 220 | + 'center' => [ | |
| 221 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 222 | + 'icon' => 'eicon-text-align-center', | |
| 223 | + ], | |
| 224 | + 'right' => [ | |
| 225 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 226 | + 'icon' => 'eicon-text-align-right', | |
| 227 | + ], | |
| 228 | + 'justify' => [ | |
| 229 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 230 | + 'icon' => 'eicon-text-align-justify', | |
| 231 | + ], | |
| 232 | + ], | |
| 233 | + 'default' => '', | |
| 234 | + 'selectors' => [ | |
| 235 | + '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 236 | + ] | |
| 237 | + ], | |
| 238 | + [ | |
| 239 | + 'name' => 'vertical_align', | |
| 240 | + 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ), | |
| 241 | + 'type' => Controls_Manager::CHOOSE, | |
| 242 | + 'condition' => [ | |
| 243 | + 'advance' => 'yes', | |
| 244 | + ], | |
| 245 | + 'options' => [ | |
| 246 | + 'top' => [ | |
| 247 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 248 | + 'icon' => 'fa fa-arrow-up', | |
| 249 | + ], | |
| 250 | + 'middle' => [ | |
| 251 | + 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 252 | + 'icon' => 'fa fa-arrows-v', | |
| 253 | + ], | |
| 254 | + 'bottom' => [ | |
| 255 | + 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 256 | + 'icon' => 'fa fa-arrow-down', | |
| 257 | + ], | |
| 258 | + ], | |
| 259 | + 'default' => 'top', | |
| 260 | + 'toggle' => true, | |
| 261 | + 'selectors' => [ | |
| 262 | + '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', | |
| 263 | + ] | |
| 264 | + ], | |
| 265 | + | |
| 266 | + [ | |
| 267 | + 'name' => 'decoration', | |
| 268 | + 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 269 | + 'type' => Controls_Manager::SELECT, | |
| 270 | + 'condition' => [ | |
| 271 | + 'advance' => 'yes', | |
| 272 | + ], | |
| 273 | + 'options' => [ | |
| 274 | + '' => esc_html__( 'Default', 'easy-elements' ), | |
| 275 | + 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 276 | + 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 277 | + 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 278 | + 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 279 | + ], | |
| 280 | + 'default' => '', | |
| 281 | + 'selectors' => [ | |
| 282 | + '{{WRAPPER}} table.easyel-table .easyel-table-header {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};', | |
| 283 | + ], | |
| 284 | + ], | |
| 285 | + [ | |
| 286 | + 'name' => 'table_head_tooltip', | |
| 287 | + 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 288 | + 'type' => Controls_Manager::SWITCHER, | |
| 289 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 290 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 291 | + ], | |
| 292 | + [ | |
| 293 | + 'name' => 'table_head_tooltip_icon', | |
| 294 | + 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 295 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 296 | + 'default' => [ | |
| 297 | + 'value' => 'fas fa-question-circle', | |
| 298 | + 'library' => 'fa-solid', | |
| 299 | + ], | |
| 300 | + 'condition' => [ | |
| 301 | + 'table_head_tooltip' => 'yes', | |
| 302 | + ], | |
| 303 | + ], | |
| 304 | + [ | |
| 305 | + 'name' => 'table_head_tooltip_description', | |
| 306 | + 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 307 | + 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 308 | + 'rows' => 10, | |
| 309 | + 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 310 | + 'condition' => [ | |
| 311 | + 'table_head_tooltip' => 'yes', | |
| 312 | + ], | |
| 313 | + ], | |
| 314 | + ], | |
| 315 | + 'default' => [ | |
| 316 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 317 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 318 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 319 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 320 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 321 | + [ 'text' => esc_html__( 'Table Header', 'easy-elements' ) ], | |
| 322 | + ], | |
| 323 | + 'title_field' => '{{{ text }}}', | |
| 324 | + ] | |
| 325 | + ); | |
| 326 | + | |
| 327 | + $this->end_controls_section(); | |
| 328 | + | |
| 329 | + $this->start_controls_section( | |
| 330 | + 'content_table_body', | |
| 331 | + [ | |
| 332 | + 'label' => esc_html__( 'Table Body', 'easy-elements' ), | |
| 333 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 334 | + ] | |
| 335 | + ); | |
| 336 | + | |
| 337 | + $repeater = new Repeater(); | |
| 338 | + | |
| 339 | + | |
| 340 | + $repeater->add_control( | |
| 341 | + 'row', [ | |
| 342 | + 'label' => esc_html__( 'New Row', 'easy-elements' ), | |
| 343 | + 'type' => Controls_Manager::SWITCHER, | |
| 344 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 345 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 346 | + ] | |
| 347 | + ); | |
| 348 | + | |
| 349 | + $repeater->add_control( | |
| 350 | + 'table_body_choose_img_icon', | |
| 351 | + [ | |
| 352 | + 'label' => esc_html__( 'Select Type', 'easy-elements' ), | |
| 353 | + 'type' => \Elementor\Controls_Manager::SELECT, | |
| 354 | + 'default' => 'icon', | |
| 355 | + 'options' => [ | |
| 356 | + 'icon' => esc_html__( 'Icon', 'easy-elements' ), | |
| 357 | + 'image' => esc_html__( 'Image', 'easy-elements' ), | |
| 358 | + ], | |
| 359 | + ] | |
| 360 | + ); | |
| 361 | + | |
| 362 | + $repeater->add_control( | |
| 363 | + 'table_icon', | |
| 364 | + [ | |
| 365 | + 'label' => esc_html__( 'Icon', 'easy-elements' ), | |
| 366 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 367 | + 'condition' => [ | |
| 368 | + 'table_body_choose_img_icon' => ['icon'] | |
| 369 | + ] | |
| 370 | + ] | |
| 371 | + ); | |
| 372 | + | |
| 373 | + $repeater->add_control( | |
| 374 | + 'table_image', | |
| 375 | + [ | |
| 376 | + 'label' => esc_html__( 'Image', 'easy-elements' ), | |
| 377 | + 'type' => \Elementor\Controls_Manager::MEDIA, | |
| 378 | + 'default' => [ | |
| 379 | + 'url' => \Elementor\Utils::get_placeholder_image_src(), | |
| 380 | + ], | |
| 381 | + 'condition' => [ | |
| 382 | + 'table_body_choose_img_icon' => ['image'] | |
| 383 | + ] | |
| 384 | + ] | |
| 385 | + ); | |
| 386 | + | |
| 387 | + $repeater->add_control( | |
| 388 | + 'text', [ | |
| 389 | + 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 390 | + 'type' => Controls_Manager::WYSIWYG, | |
| 391 | + 'label_block' => true, | |
| 392 | + 'placeholder' => esc_html__( 'Table Data', 'easy-elements' ), | |
| 393 | + 'default' => esc_html__( 'Table Data', 'easy-elements' ), | |
| 394 | + 'dynamic' => [ | |
| 395 | + 'active' => true, | |
| 396 | + ] | |
| 397 | + ] | |
| 398 | + ); | |
| 399 | + | |
| 400 | + $repeater->add_control( | |
| 401 | + 'advance', [ | |
| 402 | + 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 403 | + 'type' => Controls_Manager::SWITCHER, | |
| 404 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 405 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 406 | + ] | |
| 407 | + ); | |
| 408 | + | |
| 409 | + $repeater->add_control( | |
| 410 | + 'colspan', [ | |
| 411 | + 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 412 | + 'type' => Controls_Manager::SWITCHER, | |
| 413 | + 'condition' => [ | |
| 414 | + 'advance' => 'yes', | |
| 415 | + ], | |
| 416 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 417 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 418 | + ] | |
| 419 | + ); | |
| 420 | + | |
| 421 | + $repeater->add_control( | |
| 422 | + 'colspannumber', [ | |
| 423 | + 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 424 | + 'type' => Controls_Manager::TEXT, | |
| 425 | + 'condition' => [ | |
| 426 | + 'advance' => 'yes', | |
| 427 | + 'colspan' => 'yes', | |
| 428 | + ], | |
| 429 | + 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 430 | + 'default' => esc_html__( '1', 'easy-elements' ), | |
| 431 | + ] | |
| 432 | + ); | |
| 433 | + | |
| 434 | + $repeater->add_control( | |
| 435 | + 'rowspan', [ | |
| 436 | + 'label' => esc_html__( 'rowSpan', 'easy-elements' ), | |
| 437 | + 'type' => Controls_Manager::SWITCHER, | |
| 438 | + 'condition' => [ | |
| 439 | + 'advance' => 'yes', | |
| 440 | + ], | |
| 441 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 442 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 443 | + ] | |
| 444 | + ); | |
| 445 | + | |
| 446 | + $repeater->add_control( | |
| 447 | + 'rowspannumber', [ | |
| 448 | + 'label' => esc_html__( 'rowSpan Number', 'easy-elements' ), | |
| 449 | + 'type' => Controls_Manager::TEXT, | |
| 450 | + 'condition' => [ | |
| 451 | + 'advance' => 'yes', | |
| 452 | + 'rowspan' => 'yes', | |
| 453 | + ], | |
| 454 | + 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 455 | + 'default' => esc_html__( '1', 'easy-elements' ), | |
| 456 | + ] | |
| 457 | + ); | |
| 458 | + | |
| 459 | + $repeater->add_control( | |
| 460 | + 'table_body_data_flex', | |
| 461 | + [ | |
| 462 | + 'label' => esc_html__( 'Data Flex', 'easy-elements' ), | |
| 463 | + 'type' => Controls_Manager::SWITCHER, | |
| 464 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 465 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 466 | + 'condition' => [ | |
| 467 | + 'advance' => 'yes', | |
| 468 | + ] | |
| 469 | + ] | |
| 470 | + ); | |
| 471 | + | |
| 472 | + $repeater->add_control( | |
| 473 | + 'data-flex-align', [ | |
| 474 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 475 | + 'type' => Controls_Manager::CHOOSE, | |
| 476 | + 'condition' => [ | |
| 477 | + 'advance' => 'yes', | |
| 478 | + 'table_body_data_flex' => 'yes', | |
| 479 | + ], | |
| 480 | + 'options' => [ | |
| 481 | + 'start' => [ | |
| 482 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 483 | + 'icon' => 'eicon-text-align-left', | |
| 484 | + ], | |
| 485 | + 'center' => [ | |
| 486 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 487 | + 'icon' => 'eicon-text-align-center', | |
| 488 | + ], | |
| 489 | + 'end' => [ | |
| 490 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 491 | + 'icon' => 'eicon-text-align-right', | |
| 492 | + ], | |
| 493 | + 'space-between' => [ | |
| 494 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 495 | + 'icon' => 'eicon-text-align-justify', | |
| 496 | + ], | |
| 497 | + ], | |
| 498 | + 'selectors' => [ | |
| 499 | + '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'justify-content: {{VALUE}};', | |
| 500 | + ], | |
| 501 | + ] | |
| 502 | + ); | |
| 503 | + | |
| 504 | + $repeater->add_responsive_control( | |
| 505 | + 'flex-data-mid-gap', | |
| 506 | + [ | |
| 507 | + 'label' => esc_html__( 'Middle Gap', 'easy-elements' ), | |
| 508 | + 'type' => Controls_Manager::SLIDER, | |
| 509 | + 'size_units' => [ '%', 'px' ], | |
| 510 | + 'condition' => [ | |
| 511 | + 'advance' => 'yes', | |
| 512 | + 'table_body_data_flex' => 'yes', | |
| 513 | + ], | |
| 514 | + 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body .data-flex' => 'gap: {{SIZE}}{{UNIT}};', | |
| 515 | + ] | |
| 516 | + ], | |
| 517 | + ); | |
| 518 | + | |
| 519 | + $repeater->add_control( | |
| 520 | + 'align', [ | |
| 521 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 522 | + 'type' => Controls_Manager::CHOOSE, | |
| 523 | + 'condition' => [ | |
| 524 | + 'advance' => 'yes', | |
| 525 | + 'table_body_data_flex!' => 'yes', | |
| 526 | + ], | |
| 527 | + 'options' => [ | |
| 528 | + 'left' => [ | |
| 529 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 530 | + 'icon' => 'eicon-text-align-left', | |
| 531 | + ], | |
| 532 | + 'center' => [ | |
| 533 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 534 | + 'icon' => 'eicon-text-align-center', | |
| 535 | + ], | |
| 536 | + 'right' => [ | |
| 537 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 538 | + 'icon' => 'eicon-text-align-right', | |
| 539 | + ], | |
| 540 | + 'justify' => [ | |
| 541 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 542 | + 'icon' => 'eicon-text-align-justify', | |
| 543 | + ], | |
| 544 | + ], | |
| 545 | + 'default' => '', | |
| 546 | + 'selectors' => [ | |
| 547 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 548 | + ], | |
| 549 | + ] | |
| 550 | + ); | |
| 551 | + | |
| 552 | + $repeater->add_control( | |
| 553 | + 'vertical_align', [ | |
| 554 | + 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ), | |
| 555 | + 'type' => Controls_Manager::CHOOSE, | |
| 556 | + 'condition' => [ | |
| 557 | + 'advance' => 'yes', | |
| 558 | + ], | |
| 559 | + 'options' => [ | |
| 560 | + 'top' => [ | |
| 561 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 562 | + 'icon' => 'eicon-v-align-top', | |
| 563 | + ], | |
| 564 | + 'middle' => [ | |
| 565 | + 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 566 | + 'icon' => 'eicon-v-align-middle', | |
| 567 | + ], | |
| 568 | + 'bottom' => [ | |
| 569 | + 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 570 | + 'icon' => 'eicon-v-align-bottom', | |
| 571 | + ], | |
| 572 | + ], | |
| 573 | + 'default' => '', | |
| 574 | + 'selectors' => [ | |
| 575 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'vertical-align: {{VALUE}};', | |
| 576 | + ], | |
| 577 | + ] | |
| 578 | + ); | |
| 579 | + $repeater->add_control( | |
| 580 | + 'advanced_item_bg_color', | |
| 581 | + [ | |
| 582 | + 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 583 | + 'type' => Controls_Manager::COLOR, | |
| 584 | + 'selectors' => [ | |
| 585 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'background-color: {{VALUE}};', | |
| 586 | + ] | |
| 587 | + ] | |
| 588 | + ); | |
| 589 | + $repeater->add_control( | |
| 590 | + 'advanced_item_text_color', | |
| 591 | + [ | |
| 592 | + 'label' => esc_html__( 'Color', 'easy-elements' ), | |
| 593 | + 'type' => Controls_Manager::COLOR, | |
| 594 | + 'selectors' => [ | |
| 595 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'color: {{VALUE}};', | |
| 596 | + ] | |
| 597 | + ] | |
| 598 | + ); | |
| 599 | + $repeater->add_control( | |
| 600 | + 'advanced_item_icon_color', | |
| 601 | + [ | |
| 602 | + 'label' => esc_html__( 'Icon Color', 'easy-elements' ), | |
| 603 | + 'type' => Controls_Manager::COLOR, | |
| 604 | + 'selectors' => [ | |
| 605 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} i' => 'color: {{VALUE}};', | |
| 606 | + '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}} svg' => 'fill: {{VALUE}};', | |
| 607 | + ] | |
| 608 | + ] | |
| 609 | + ); | |
| 610 | + $repeater->add_control( | |
| 611 | + 'tb_cswidthS', | |
| 612 | + [ | |
| 613 | + 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 614 | + 'type' => Controls_Manager::SELECT, | |
| 615 | + 'type' => Controls_Manager::SWITCHER, | |
| 616 | + 'condition' => [ | |
| 617 | + 'advance' => 'yes', | |
| 618 | + ], | |
| 619 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 620 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 621 | + ] | |
| 622 | + ); | |
| 623 | + $repeater->add_responsive_control( | |
| 624 | + 'tb_cswidth', | |
| 625 | + [ | |
| 626 | + 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 627 | + 'type' => Controls_Manager::SLIDER, | |
| 628 | + 'size_units' => [ '%', 'px' ], | |
| 629 | + 'condition' => [ | |
| 630 | + 'advance' => 'yes', | |
| 631 | + 'tb_cswidthS' => 'yes', | |
| 632 | + ], | |
| 633 | + 'range' => [ | |
| 634 | + '%' => [ | |
| 635 | + 'min' => 0, | |
| 636 | + 'max' => 100, | |
| 637 | + ], | |
| 638 | + 'px' => [ | |
| 639 | + 'min' => 1, | |
| 640 | + 'max' => 1000, | |
| 641 | + ], | |
| 642 | + ], | |
| 643 | + | |
| 644 | + 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-body {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 645 | + ] | |
| 646 | + ], | |
| 647 | + ); | |
| 648 | + | |
| 649 | + $repeater->add_control( | |
| 650 | + 'decoration', | |
| 651 | + [ | |
| 652 | + 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 653 | + 'type' => Controls_Manager::SELECT, | |
| 654 | + 'condition' => [ | |
| 655 | + 'advance' => 'yes', | |
| 656 | + ], | |
| 657 | + 'options' => [ | |
| 658 | + '' => esc_html__( 'Default', 'easy-elements' ), | |
| 659 | + 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 660 | + 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 661 | + 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 662 | + 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 663 | + ], | |
| 664 | + 'default' => '', | |
| 665 | + 'selectors' => [ | |
| 666 | + '{{WRAPPER}} table.easyel-table {{CURRENT_ITEM}}' => 'text-decoration:{{VALUE}};', | |
| 667 | + ], | |
| 668 | + ] | |
| 669 | + ); | |
| 670 | + $repeater->add_control( | |
| 671 | + 'table_body_tooltip', | |
| 672 | + [ | |
| 673 | + 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 674 | + 'type' => Controls_Manager::SWITCHER, | |
| 675 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 676 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 677 | + ] | |
| 678 | + ); | |
| 679 | + $repeater->add_control( | |
| 680 | + 'table_body_tooltip_icon', | |
| 681 | + [ | |
| 682 | + 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 683 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 684 | + 'default' => [ | |
| 685 | + 'value' => 'fas fa-question-circle', | |
| 686 | + 'library' => 'fa-solid', | |
| 687 | + ], | |
| 688 | + 'condition' => [ | |
| 689 | + 'table_body_tooltip' => 'yes', | |
| 690 | + ], | |
| 691 | + ] | |
| 692 | + ); | |
| 693 | + $repeater->add_control( | |
| 694 | + 'table_body_tooltip_description', | |
| 695 | + [ | |
| 696 | + 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 697 | + 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 698 | + 'rows' => 10, | |
| 699 | + 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 700 | + 'condition' => [ | |
| 701 | + 'table_body_tooltip' => 'yes', | |
| 702 | + ], | |
| 703 | + ] | |
| 704 | + ); | |
| 705 | + | |
| 706 | + $this->add_control( | |
| 707 | + 'table_body', | |
| 708 | + [ | |
| 709 | + 'label' => esc_html__( 'Table Body Cell', 'easy-elements' ), | |
| 710 | + 'type' => Controls_Manager::REPEATER, | |
| 711 | + 'fields' => $repeater->get_controls(), | |
| 712 | + | |
| 713 | + 'default' => [ | |
| 714 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 715 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 716 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 717 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 718 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 719 | + [ 'text' => esc_html__( 'Table Data', 'easy-elements' ) ], | |
| 720 | + ], | |
| 721 | + | |
| 722 | + 'title_field' => '{{{ text }}}', | |
| 723 | + ] | |
| 724 | + ); | |
| 725 | + | |
| 726 | + | |
| 727 | + $this->end_controls_section(); | |
| 728 | + | |
| 729 | + $this->start_controls_section( | |
| 730 | + 'content_table_footer', | |
| 731 | + [ | |
| 732 | + 'label' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 733 | + 'tab' => Controls_Manager::TAB_CONTENT, | |
| 734 | + ] | |
| 735 | + ); | |
| 736 | + $this->add_control( | |
| 737 | + 'table_footer', | |
| 738 | + [ | |
| 739 | + 'label' => esc_html__( 'Table footer Cell', 'easy-elements' ), | |
| 740 | + 'type' => Controls_Manager::REPEATER, | |
| 741 | + 'prevent_empty' => false, | |
| 742 | + 'default' => [ | |
| 743 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 744 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 745 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 746 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 747 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 748 | + [ 'text' => esc_html__( 'Table footer', 'easy-elements' ) ], | |
| 749 | + ], | |
| 750 | + | |
| 751 | + 'fields' => [ | |
| 752 | + [ | |
| 753 | + 'name' => 'text', | |
| 754 | + 'label' => esc_html__( 'Text', 'easy-elements' ), | |
| 755 | + 'type' => Controls_Manager::TEXT, | |
| 756 | + 'label_block' => true, | |
| 757 | + 'placeholder' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 758 | + 'default' => esc_html__( 'Table footer', 'easy-elements' ), | |
| 759 | + 'dynamic' => [ | |
| 760 | + 'active' => true, | |
| 761 | + ] | |
| 762 | + ], | |
| 763 | + [ | |
| 764 | + 'name' => 'advance', | |
| 765 | + 'label' => esc_html__( 'Advance Settings', 'easy-elements' ), | |
| 766 | + 'type' => Controls_Manager::SWITCHER, | |
| 767 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 768 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 769 | + ], | |
| 770 | + [ | |
| 771 | + 'name' => 'colspan', | |
| 772 | + 'label' => esc_html__( 'colSpan', 'easy-elements' ), | |
| 773 | + 'type' => Controls_Manager::SWITCHER, | |
| 774 | + 'condition' => [ | |
| 775 | + 'advance' => 'yes', | |
| 776 | + ], | |
| 777 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 778 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 779 | + ], | |
| 780 | + [ | |
| 781 | + 'name' => 'colspannumber', | |
| 782 | + 'label' => esc_html__( 'colSpan Number', 'easy-elements' ), | |
| 783 | + 'type' => Controls_Manager::TEXT, | |
| 784 | + 'condition' => [ | |
| 785 | + 'advance' => 'yes', | |
| 786 | + 'colspan' => 'yes', | |
| 787 | + ], | |
| 788 | + 'placeholder' => esc_html__( '1', 'easy-elements' ), | |
| 789 | + 'default' => esc_html__( '1', 'easy-elements' ), | |
| 790 | + ], | |
| 791 | + [ | |
| 792 | + 'name' => 'customwidth', | |
| 793 | + 'label' => esc_html__( 'Custom Width', 'easy-elements' ), | |
| 794 | + 'type' => Controls_Manager::SWITCHER, | |
| 795 | + 'condition' => [ | |
| 796 | + 'advance' => 'yes', | |
| 797 | + ], | |
| 798 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 799 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 800 | + ], | |
| 801 | + [ | |
| 802 | + 'name' => 'width', | |
| 803 | + 'label' => esc_html__( 'Width', 'easy-elements' ), | |
| 804 | + 'type' => Controls_Manager::SLIDER, | |
| 805 | + 'condition' => [ | |
| 806 | + 'advance' => 'yes', | |
| 807 | + 'customwidth' => 'yes', | |
| 808 | + ], | |
| 809 | + 'range' => [ | |
| 810 | + '%' => [ | |
| 811 | + 'min' => 0, | |
| 812 | + 'max' => 100, | |
| 813 | + ], | |
| 814 | + 'px' => [ | |
| 815 | + 'min' => 1, | |
| 816 | + 'max' => 1000, | |
| 817 | + ], | |
| 818 | + ], | |
| 819 | + 'default' => [ | |
| 820 | + 'size' => 30, | |
| 821 | + 'unit' => '%', | |
| 822 | + ], | |
| 823 | + 'size_units' => [ '%', 'px' ], | |
| 824 | + 'selectors' => [ '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'width: {{SIZE}}{{UNIT}};', | |
| 825 | + ] | |
| 826 | + ], | |
| 827 | + [ | |
| 828 | + 'name' => 'align', | |
| 829 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 830 | + 'type' => Controls_Manager::CHOOSE, | |
| 831 | + 'condition' => [ | |
| 832 | + 'advance' => 'yes', | |
| 833 | + ], | |
| 834 | + 'options' => [ | |
| 835 | + 'left' => [ | |
| 836 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 837 | + 'icon' => 'eicon-text-align-left', | |
| 838 | + ], | |
| 839 | + 'center' => [ | |
| 840 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 841 | + 'icon' => 'eicon-text-align-center', | |
| 842 | + ], | |
| 843 | + 'right' => [ | |
| 844 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 845 | + 'icon' => 'eicon-text-align-right', | |
| 846 | + ], | |
| 847 | + 'justify' => [ | |
| 848 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 849 | + 'icon' => 'eicon-text-align-justify', | |
| 850 | + ], | |
| 851 | + ], | |
| 852 | + 'default' => '', | |
| 853 | + 'selectors' => [ | |
| 854 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 855 | + ] | |
| 856 | + ], | |
| 857 | + [ | |
| 858 | + 'name' => 'vertical_align', | |
| 859 | + 'label' => esc_html__( 'Vertical Alignment', 'easy-elements' ), | |
| 860 | + 'type' => Controls_Manager::CHOOSE, | |
| 861 | + 'condition' => [ | |
| 862 | + 'advance' => 'yes', | |
| 863 | + ], | |
| 864 | + 'options' => [ | |
| 865 | + 'top' => [ | |
| 866 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 867 | + 'icon' => 'eicon-v-align-up', | |
| 868 | + ], | |
| 869 | + 'middle' => [ | |
| 870 | + 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 871 | + 'icon' => 'eicon-v-align-middle', | |
| 872 | + ], | |
| 873 | + 'bottom' => [ | |
| 874 | + 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 875 | + 'icon' => 'eicon-v-align-bottom', | |
| 876 | + ], | |
| 877 | + ], | |
| 878 | + 'default' => '', | |
| 879 | + 'selectors' => [ | |
| 880 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-align: {{VALUE}};', | |
| 881 | + ] | |
| 882 | + ], | |
| 883 | + | |
| 884 | + [ | |
| 885 | + 'name' => 'decoration', | |
| 886 | + 'label' => esc_html__( 'Decoration', 'easy-elements' ), | |
| 887 | + 'type' => Controls_Manager::SELECT, | |
| 888 | + 'condition' => [ | |
| 889 | + 'advance' => 'yes', | |
| 890 | + ], | |
| 891 | + 'options' => [ | |
| 892 | + '' => esc_html__( 'Default', 'easy-elements' ), | |
| 893 | + 'underline' => esc_html__( 'Underline', 'easy-elements' ), | |
| 894 | + 'overline' => esc_html__( 'Overline', 'easy-elements' ), | |
| 895 | + 'line-through' => esc_html__( 'Line Through', 'easy-elements' ), | |
| 896 | + 'none' => esc_html__( 'None', 'easy-elements' ), | |
| 897 | + ], | |
| 898 | + 'default' => '', | |
| 899 | + 'selectors' => [ | |
| 900 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer {{CURRENT_ITEM}}' => 'text-decoration: {{VALUE}};', | |
| 901 | + ], | |
| 902 | + ], | |
| 903 | + [ | |
| 904 | + 'name' => 'table_foot_tooltip', | |
| 905 | + 'label' => esc_html__( 'Tooltip Settings', 'easy-elements' ), | |
| 906 | + 'type' => Controls_Manager::SWITCHER, | |
| 907 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 908 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 909 | + ], | |
| 910 | + [ | |
| 911 | + 'name' => 'table_foot_tooltip_icon', | |
| 912 | + 'label' => esc_html__( 'Tooltip Icon', 'easy-elements' ), | |
| 913 | + 'type' => \Elementor\Controls_Manager::ICONS, | |
| 914 | + 'default' => [ | |
| 915 | + 'value' => 'fas fa-question-circle', | |
| 916 | + 'library' => 'fa-solid', | |
| 917 | + ], | |
| 918 | + 'condition' => [ | |
| 919 | + 'table_foot_tooltip' => 'yes', | |
| 920 | + ], | |
| 921 | + ], | |
| 922 | + [ | |
| 923 | + 'name' => 'table_foot_tooltip_description', | |
| 924 | + 'label' => esc_html__('Tooltip Description', 'easy-elements' ), | |
| 925 | + 'type' => \Elementor\Controls_Manager::TEXTAREA, | |
| 926 | + 'rows' => 10, | |
| 927 | + 'placeholder' => esc_html__( 'Type your tooltip description here', 'easy-elements' ), | |
| 928 | + 'condition' => [ | |
| 929 | + 'table_foot_tooltip' => 'yes', | |
| 930 | + ], | |
| 931 | + ], | |
| 932 | + ], | |
| 933 | + 'title_field' => '{{{ text }}}', | |
| 934 | + ] | |
| 935 | + ); | |
| 936 | + $this->end_controls_section(); | |
| 937 | + | |
| 938 | + $this->start_controls_section( | |
| 939 | + 'section_style', | |
| 940 | + [ | |
| 941 | + 'label' => esc_html__( 'General Style', 'easy-elements' ), | |
| 942 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 943 | + ] | |
| 944 | + ); | |
| 945 | + | |
| 946 | + $this->add_control( | |
| 947 | + 'vertical_align_table', [ | |
| 948 | + 'label' => esc_html__( 'Vetical Alignment', 'easy-elements' ), | |
| 949 | + 'type' => Controls_Manager::CHOOSE, | |
| 950 | + 'options' => [ | |
| 951 | + 'top' => [ | |
| 952 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 953 | + 'icon' => 'eicon-v-align-top', | |
| 954 | + ], | |
| 955 | + 'middle' => [ | |
| 956 | + 'title' => esc_html__( 'Middle', 'easy-elements' ), | |
| 957 | + 'icon' => 'eicon-v-align-middle', | |
| 958 | + ], | |
| 959 | + 'bottom' => [ | |
| 960 | + 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 961 | + 'icon' => 'eicon-v-align-bottom', | |
| 962 | + ], | |
| 963 | + ], | |
| 964 | + 'default' => '', | |
| 965 | + 'selectors' => [ | |
| 966 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'vertical-align: {{VALUE}};', | |
| 967 | + '{{WRAPPER}} table.easyel-table .easyel-table-body th' => 'vertical-align: {{VALUE}};', | |
| 968 | + ], | |
| 969 | + ] | |
| 970 | + ); | |
| 971 | + $this->add_responsive_control( | |
| 972 | + 'table_margin', | |
| 973 | + [ | |
| 974 | + 'label' => esc_html__( 'Table Margin', 'easy-elements' ), | |
| 975 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 976 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 977 | + 'selectors' => [ | |
| 978 | + '{{WRAPPER}} table.easyel-table' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 979 | + ], | |
| 980 | + ] | |
| 981 | + ); | |
| 982 | + $this->add_responsive_control( | |
| 983 | + 'table_padding', | |
| 984 | + [ | |
| 985 | + 'label' => esc_html__( 'Table Padding', 'easy-elements' ), | |
| 986 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 987 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 988 | + 'selectors' => [ | |
| 989 | + '{{WRAPPER}} table.easyel-table thead th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 990 | + '{{WRAPPER}} table.easyel-table tbody td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 991 | + ], | |
| 992 | + ] | |
| 993 | + ); | |
| 994 | + | |
| 995 | + $this->add_group_control( | |
| 996 | + Group_Control_Border::get_type(), | |
| 997 | + [ | |
| 998 | + 'name' => 'table_border', | |
| 999 | + 'label' => esc_html__( 'Border', 'easy-elements' ), | |
| 1000 | + 'selector' => '{{WRAPPER}} table.easyel-table tbody', | |
| 1001 | + ] | |
| 1002 | + ); | |
| 1003 | + $this->add_responsive_control( | |
| 1004 | + 'table_radius', | |
| 1005 | + [ | |
| 1006 | + 'label' => esc_html__( 'Table Border Radius', 'easy-elements' ), | |
| 1007 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1008 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1009 | + 'selectors' => [ | |
| 1010 | + '{{WRAPPER}} table.easyel-table' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1011 | + ], | |
| 1012 | + ] | |
| 1013 | + ); | |
| 1014 | + $this->end_controls_section(); | |
| 1015 | + | |
| 1016 | + $this->start_controls_section( | |
| 1017 | + 'table_header_style', | |
| 1018 | + [ | |
| 1019 | + 'label' => esc_html__( 'Table Header Style', 'easy-elements' ), | |
| 1020 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1021 | + ] | |
| 1022 | + ); | |
| 1023 | + | |
| 1024 | + $this->add_responsive_control( | |
| 1025 | + 'header_align', | |
| 1026 | + [ | |
| 1027 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1028 | + 'type' => Controls_Manager::CHOOSE, | |
| 1029 | + 'options' => [ | |
| 1030 | + 'left' => [ | |
| 1031 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1032 | + 'icon' => 'eicon-text-align-left', | |
| 1033 | + ], | |
| 1034 | + 'center' => [ | |
| 1035 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1036 | + 'icon' => 'eicon-text-align-center', | |
| 1037 | + ], | |
| 1038 | + 'right' => [ | |
| 1039 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1040 | + 'icon' => 'eicon-text-align-right', | |
| 1041 | + ], | |
| 1042 | + 'justify' => [ | |
| 1043 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1044 | + 'icon' => 'eicon-text-align-justify', | |
| 1045 | + ], | |
| 1046 | + ], | |
| 1047 | + 'selectors' => [ | |
| 1048 | + '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'text-align: {{VALUE}};', | |
| 1049 | + ], | |
| 1050 | + ] | |
| 1051 | + ); | |
| 1052 | + | |
| 1053 | + $this->add_control( | |
| 1054 | + 'header_text_color', | |
| 1055 | + [ | |
| 1056 | + 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1057 | + 'type' => Controls_Manager::COLOR, | |
| 1058 | + 'selectors' => [ | |
| 1059 | + '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'color: {{VALUE}};', | |
| 1060 | + ] | |
| 1061 | + ] | |
| 1062 | + ); | |
| 1063 | + | |
| 1064 | + $this->add_group_control( | |
| 1065 | + Group_Control_Typography::get_type(), | |
| 1066 | + [ | |
| 1067 | + 'name' => 'header_typography', | |
| 1068 | + 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-header', | |
| 1069 | + | |
| 1070 | + ] | |
| 1071 | + ); | |
| 1072 | + | |
| 1073 | + $this->add_control( | |
| 1074 | + 'header_bg_color', | |
| 1075 | + [ | |
| 1076 | + 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1077 | + 'type' => Controls_Manager::COLOR, | |
| 1078 | + 'selectors' => [ | |
| 1079 | + '{{WRAPPER}} table.easyel-table .easyel-table-header' => 'background-color: {{VALUE}};', | |
| 1080 | + ] | |
| 1081 | + ] | |
| 1082 | + ); | |
| 1083 | + $this->add_group_control( | |
| 1084 | + \Elementor\Group_Control_Border::get_type(), | |
| 1085 | + [ | |
| 1086 | + 'name' => 'body_head_border', | |
| 1087 | + 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-header th', | |
| 1088 | + ] | |
| 1089 | + ); | |
| 1090 | + $this->add_responsive_control( | |
| 1091 | + 'table_thead_radius', | |
| 1092 | + [ | |
| 1093 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1094 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1095 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1096 | + 'selectors' => [ | |
| 1097 | + '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1098 | + ], | |
| 1099 | + ] | |
| 1100 | + ); | |
| 1101 | + $this->add_responsive_control( | |
| 1102 | + 'table_thead_padding', | |
| 1103 | + [ | |
| 1104 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1105 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1106 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1107 | + 'selectors' => [ | |
| 1108 | + '{{WRAPPER}} table.easyel-table .easyel-table-header th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1109 | + ], | |
| 1110 | + ] | |
| 1111 | + ); | |
| 1112 | + | |
| 1113 | + // header icon settings | |
| 1114 | + $this->add_control( | |
| 1115 | + 'header_icon_styles', | |
| 1116 | + [ | |
| 1117 | + 'label' => esc_html__( 'Icon Style', 'easy-elements' ), | |
| 1118 | + 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1119 | + 'separator' => 'before', | |
| 1120 | + ] | |
| 1121 | + ); | |
| 1122 | + | |
| 1123 | + $this->add_control( | |
| 1124 | + 'header_icon_color', | |
| 1125 | + [ | |
| 1126 | + 'label' => esc_html__( 'Color', 'easy-elements' ), | |
| 1127 | + 'type' => Controls_Manager::COLOR, | |
| 1128 | + 'selectors' => [ | |
| 1129 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'color: {{VALUE}} !important;', | |
| 1130 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon svg path' => 'fill: {{VALUE}} !important;', | |
| 1131 | + ], | |
| 1132 | + ] | |
| 1133 | + ); | |
| 1134 | + | |
| 1135 | + $this->add_responsive_control( | |
| 1136 | + 'header_icon_size', | |
| 1137 | + [ | |
| 1138 | + 'label' => esc_html__( 'Size', 'easy-elements' ), | |
| 1139 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1140 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1141 | + 'selectors' => [ | |
| 1142 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon i' => 'font-size: {{SIZE}}{{UNIT}} !important;', | |
| 1143 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', | |
| 1144 | + ], | |
| 1145 | + ] | |
| 1146 | + ); | |
| 1147 | + | |
| 1148 | + $this->add_responsive_control( | |
| 1149 | + 'header_icon_y_position', | |
| 1150 | + [ | |
| 1151 | + 'label' => esc_html__( 'Pisition ( Vertical )', 'easy-elements' ), | |
| 1152 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1153 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1154 | + 'selectors' => [ | |
| 1155 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'top: {{SIZE}}{{UNIT}} !important;', | |
| 1156 | + ], | |
| 1157 | + ] | |
| 1158 | + ); | |
| 1159 | + | |
| 1160 | + $this->add_responsive_control( | |
| 1161 | + 'header_icon_margin', | |
| 1162 | + [ | |
| 1163 | + 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1164 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1165 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1166 | + 'selectors' => [ | |
| 1167 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1168 | + '{{WRAPPER}} table.easyel-table .easyel-header-icon' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1169 | + ], | |
| 1170 | + ] | |
| 1171 | + ); | |
| 1172 | + $this->end_controls_section(); | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + $this->start_controls_section( | |
| 1176 | + 'table_body_style', | |
| 1177 | + [ | |
| 1178 | + 'label' => esc_html__( 'Table Body Style', 'easy-elements' ), | |
| 1179 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1180 | + ] | |
| 1181 | + ); | |
| 1182 | + | |
| 1183 | + $this->add_responsive_control( | |
| 1184 | + 'body_align', | |
| 1185 | + [ | |
| 1186 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1187 | + 'type' => Controls_Manager::CHOOSE, | |
| 1188 | + 'options' => [ | |
| 1189 | + 'left' => [ | |
| 1190 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1191 | + 'icon' => 'eicon-text-align-left', | |
| 1192 | + ], | |
| 1193 | + 'center' => [ | |
| 1194 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1195 | + 'icon' => 'eicon-text-align-center', | |
| 1196 | + ], | |
| 1197 | + 'right' => [ | |
| 1198 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1199 | + 'icon' => 'eicon-text-align-right', | |
| 1200 | + ], | |
| 1201 | + 'justify' => [ | |
| 1202 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1203 | + 'icon' => 'eicon-text-align-justify', | |
| 1204 | + ], | |
| 1205 | + ], | |
| 1206 | + 'selectors' => [ | |
| 1207 | + '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'text-align: {{VALUE}};', | |
| 1208 | + ], | |
| 1209 | + ] | |
| 1210 | + ); | |
| 1211 | + | |
| 1212 | + $this->add_control( | |
| 1213 | + 'body_text_color', | |
| 1214 | + [ | |
| 1215 | + 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1216 | + 'type' => Controls_Manager::COLOR, | |
| 1217 | + 'selectors' => [ | |
| 1218 | + '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'color: {{VALUE}};', | |
| 1219 | + ] | |
| 1220 | + ] | |
| 1221 | + ); | |
| 1222 | + | |
| 1223 | + | |
| 1224 | + $this->add_group_control( | |
| 1225 | + Group_Control_Typography::get_type(), | |
| 1226 | + [ | |
| 1227 | + 'name' => 'body_typography', | |
| 1228 | + 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-body', | |
| 1229 | + | |
| 1230 | + ] | |
| 1231 | + ); | |
| 1232 | + | |
| 1233 | + $this->add_control( | |
| 1234 | + 'body_bg_color', | |
| 1235 | + [ | |
| 1236 | + 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1237 | + 'type' => Controls_Manager::COLOR, | |
| 1238 | + 'selectors' => [ | |
| 1239 | + '{{WRAPPER}} table.easyel-table .easyel-table-body' => 'background-color: {{VALUE}};', | |
| 1240 | + ] | |
| 1241 | + ] | |
| 1242 | + ); | |
| 1243 | + | |
| 1244 | + $this->add_control( | |
| 1245 | + 'striped_bg', | |
| 1246 | + [ | |
| 1247 | + 'label' => esc_html__( 'Striped Background', 'easy-elements' ), | |
| 1248 | + 'type' => Controls_Manager::SWITCHER, | |
| 1249 | + 'label_off' => esc_html__( 'No', 'easy-elements' ), | |
| 1250 | + 'label_on' => esc_html__( 'Yes', 'easy-elements' ), | |
| 1251 | + ] | |
| 1252 | + ); | |
| 1253 | + $this->add_control( | |
| 1254 | + 'striped_bg_color', | |
| 1255 | + [ | |
| 1256 | + 'label' => esc_html__( 'Secondary Background Color', 'easy-elements' ), | |
| 1257 | + 'type' => Controls_Manager::COLOR, | |
| 1258 | + 'condition' => [ | |
| 1259 | + 'striped_bg' => 'yes', | |
| 1260 | + ], | |
| 1261 | + 'selectors' => [ | |
| 1262 | + '{{WRAPPER}} table.easyel-table .easyel-table-body tr:nth-of-type(2n)' => 'background-color: {{VALUE}};', | |
| 1263 | + ] | |
| 1264 | + ] | |
| 1265 | + ); | |
| 1266 | + $this->add_control( | |
| 1267 | + 'body_icon_color', | |
| 1268 | + [ | |
| 1269 | + 'label' => esc_html__( 'Icon Color', 'easy-elements' ), | |
| 1270 | + 'type' => Controls_Manager::COLOR, | |
| 1271 | + 'selectors' => [ | |
| 1272 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'color: {{VALUE}};', | |
| 1273 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td svg path' => 'fill: {{VALUE}};', | |
| 1274 | + ] | |
| 1275 | + ] | |
| 1276 | + ); | |
| 1277 | + $this->add_control( | |
| 1278 | + 'body_icon_size', | |
| 1279 | + [ | |
| 1280 | + 'label' => esc_html__( 'Icon Size', 'easy-elements' ), | |
| 1281 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1282 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1283 | + 'range' => [ | |
| 1284 | + 'px' => [ | |
| 1285 | + 'min' => 0, | |
| 1286 | + 'max' => 1000, | |
| 1287 | + ], | |
| 1288 | + ], | |
| 1289 | + 'default' => [ | |
| 1290 | + 'unit' => 'px', | |
| 1291 | + 'size' => 16, | |
| 1292 | + ], | |
| 1293 | + 'selectors' => [ | |
| 1294 | + '{{WRAPPER}} .table.easyel-table .easyel-table-body td i' => 'font-size: {{SIZE}}{{UNIT}};', | |
| 1295 | + '{{WRAPPER}} .table.easyel-table .easyel-table-body td svg' => 'width: {{SIZE}}{{UNIT}}; height: {{SIZE}}{{UNIT}};', | |
| 1296 | + ], | |
| 1297 | + ] | |
| 1298 | + ); | |
| 1299 | + $this->add_responsive_control( | |
| 1300 | + 'body_icon_gap', | |
| 1301 | + [ | |
| 1302 | + 'label' => esc_html__( 'Icon Margin', 'easy-elements' ), | |
| 1303 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1304 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1305 | + 'selectors' => [ | |
| 1306 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td i' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1307 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td svg' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1308 | + ], | |
| 1309 | + ] | |
| 1310 | + ); | |
| 1311 | + $this->add_responsive_control( | |
| 1312 | + 'table_tbody_radius', | |
| 1313 | + [ | |
| 1314 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1315 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1316 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1317 | + 'selectors' => [ | |
| 1318 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1319 | + ], | |
| 1320 | + ] | |
| 1321 | + ); | |
| 1322 | + $this->add_responsive_control( | |
| 1323 | + 'table_tbody_padding', | |
| 1324 | + [ | |
| 1325 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1326 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1327 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1328 | + 'selectors' => [ | |
| 1329 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1330 | + ], | |
| 1331 | + ] | |
| 1332 | + ); | |
| 1333 | + $this->add_responsive_control( | |
| 1334 | + 'table_tbody_margin', | |
| 1335 | + [ | |
| 1336 | + 'label' => esc_html__( 'Margin', 'easy-elements' ), | |
| 1337 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1338 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1339 | + 'selectors' => [ | |
| 1340 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1341 | + '{{WRAPPER}} table.easyel-table .easyel-table-body td p' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1342 | + ], | |
| 1343 | + ] | |
| 1344 | + ); | |
| 1345 | + $this->add_group_control( | |
| 1346 | + \Elementor\Group_Control_Border::get_type(), | |
| 1347 | + [ | |
| 1348 | + 'name' => 'body_border', | |
| 1349 | + 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-body td', | |
| 1350 | + ] | |
| 1351 | + ); | |
| 1352 | + $this->add_control( | |
| 1353 | + 'tooltip_heading', | |
| 1354 | + [ | |
| 1355 | + 'label' => esc_html__( 'Tooltip Options', 'easy-elements' ), | |
| 1356 | + 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1357 | + 'separator' => 'before', | |
| 1358 | + ] | |
| 1359 | + ); | |
| 1360 | + $this->add_control( | |
| 1361 | + 'tooltip_icon_color', | |
| 1362 | + [ | |
| 1363 | + 'label' => esc_html__( 'Tooltip Icon Color', 'easy-elements' ), | |
| 1364 | + 'type' => Controls_Manager::COLOR, | |
| 1365 | + 'selectors' => [ | |
| 1366 | + '{{WRAPPER}} table.easyel-table .easyel-tooltip i' => 'color: {{VALUE}} !important;', | |
| 1367 | + '{{WRAPPER}} table.easyel-table .easyel-tooltip svg path' => 'fill: {{VALUE}} !important;', | |
| 1368 | + ] | |
| 1369 | + ] | |
| 1370 | + ); | |
| 1371 | + $this->add_control( | |
| 1372 | + 'tooltip_icon_size', | |
| 1373 | + [ | |
| 1374 | + 'label' => esc_html__( 'Tooltip Icon Size', 'easy-elements' ), | |
| 1375 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1376 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1377 | + 'range' => [ | |
| 1378 | + 'px' => [ | |
| 1379 | + 'min' => 0, | |
| 1380 | + 'max' => 1000, | |
| 1381 | + ], | |
| 1382 | + ], | |
| 1383 | + 'default' => [ | |
| 1384 | + 'unit' => 'px', | |
| 1385 | + 'size' => 16, | |
| 1386 | + ], | |
| 1387 | + 'selectors' => [ | |
| 1388 | + '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'font-size: {{SIZE}}{{UNIT}} !important;', | |
| 1389 | + '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'width: {{SIZE}}{{UNIT}} !important; height: {{SIZE}}{{UNIT}} !important;', | |
| 1390 | + ], | |
| 1391 | + ] | |
| 1392 | + ); | |
| 1393 | + $this->add_responsive_control( | |
| 1394 | + 'tooltip_icon_margin', | |
| 1395 | + [ | |
| 1396 | + 'label' => esc_html__( 'Tooltip Icon Margin', 'easy-elements' ), | |
| 1397 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1398 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1399 | + 'selectors' => [ | |
| 1400 | + '{{WRAPPER}} .table.easyel-table .easyel-tooltip i' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1401 | + '{{WRAPPER}} .table.easyel-table .easyel-tooltip svg' => 'margin: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1402 | + ], | |
| 1403 | + ] | |
| 1404 | + ); | |
| 1405 | + $this->add_responsive_control( | |
| 1406 | + 'tooltip_align', | |
| 1407 | + [ | |
| 1408 | + 'label' => esc_html__( 'Tooltip Align', 'easy-elements' ), | |
| 1409 | + 'type' => Controls_Manager::CHOOSE, | |
| 1410 | + 'options' => [ | |
| 1411 | + 'left' => [ | |
| 1412 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1413 | + 'icon' => 'eicon-h-align-left', | |
| 1414 | + ], | |
| 1415 | + 'top' => [ | |
| 1416 | + 'title' => esc_html__( 'Top', 'easy-elements' ), | |
| 1417 | + 'icon' => 'eicon-v-align-top', | |
| 1418 | + ], | |
| 1419 | + 'right' => [ | |
| 1420 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1421 | + 'icon' => 'eicon-h-align-right', | |
| 1422 | + ], | |
| 1423 | + 'bottom' => [ | |
| 1424 | + 'title' => esc_html__( 'Bottom', 'easy-elements' ), | |
| 1425 | + 'icon' => 'eicon-v-align-bottom', | |
| 1426 | + ], | |
| 1427 | + ], | |
| 1428 | + 'default' => 'left', | |
| 1429 | + 'toggle' => true, | |
| 1430 | + ] | |
| 1431 | + ); | |
| 1432 | + | |
| 1433 | + // image style | |
| 1434 | + $this->add_control( | |
| 1435 | + 'table_img_heading', | |
| 1436 | + [ | |
| 1437 | + 'label' => esc_html__( 'Image Options', 'easy-elements' ), | |
| 1438 | + 'type' => \Elementor\Controls_Manager::HEADING, | |
| 1439 | + 'separator' => 'before', | |
| 1440 | + ] | |
| 1441 | + ); | |
| 1442 | + | |
| 1443 | + $this->add_control( | |
| 1444 | + 'table_img_size', | |
| 1445 | + [ | |
| 1446 | + 'label' => esc_html__( 'Size', 'easy-elements' ), | |
| 1447 | + 'type' => \Elementor\Controls_Manager::SLIDER, | |
| 1448 | + 'size_units' => [ 'px', '%', 'em', 'rem', 'custom' ], | |
| 1449 | + 'selectors' => [ | |
| 1450 | + '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'max-width: {{SIZE}}{{UNIT}} !important;height: {{SIZE}}{{UNIT}} !important;', | |
| 1451 | + ], | |
| 1452 | + ] | |
| 1453 | + ); | |
| 1454 | + | |
| 1455 | + $this->add_responsive_control( | |
| 1456 | + 'table_img_radius', | |
| 1457 | + [ | |
| 1458 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1459 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1460 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1461 | + 'selectors' => [ | |
| 1462 | + '{{WRAPPER}} .easyel-table-body .easyel-table-image' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1463 | + ], | |
| 1464 | + ] | |
| 1465 | + ); | |
| 1466 | + | |
| 1467 | + $this->end_controls_section(); | |
| 1468 | + | |
| 1469 | + $this->start_controls_section( | |
| 1470 | + 'table_footer_style', | |
| 1471 | + [ | |
| 1472 | + 'label' => esc_html__( 'Table footer Style', 'easy-elements' ), | |
| 1473 | + 'tab' => Controls_Manager::TAB_STYLE, | |
| 1474 | + ] | |
| 1475 | + ); | |
| 1476 | + | |
| 1477 | + $this->add_responsive_control( | |
| 1478 | + 'footer_align', | |
| 1479 | + [ | |
| 1480 | + 'label' => esc_html__( 'Alignment', 'easy-elements' ), | |
| 1481 | + 'type' => Controls_Manager::CHOOSE, | |
| 1482 | + 'options' => [ | |
| 1483 | + 'left' => [ | |
| 1484 | + 'title' => esc_html__( 'Left', 'easy-elements' ), | |
| 1485 | + 'icon' => 'eicon-text-align-left', | |
| 1486 | + ], | |
| 1487 | + 'center' => [ | |
| 1488 | + 'title' => esc_html__( 'Center', 'easy-elements' ), | |
| 1489 | + 'icon' => 'eicon-text-align-center', | |
| 1490 | + ], | |
| 1491 | + 'right' => [ | |
| 1492 | + 'title' => esc_html__( 'Right', 'easy-elements' ), | |
| 1493 | + 'icon' => 'eicon-text-align-right', | |
| 1494 | + ], | |
| 1495 | + 'justify' => [ | |
| 1496 | + 'title' => esc_html__( 'Justified', 'easy-elements' ), | |
| 1497 | + 'icon' => 'eicon-text-align-justify', | |
| 1498 | + ], | |
| 1499 | + ], | |
| 1500 | + 'selectors' => [ | |
| 1501 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'text-align: {{VALUE}};', | |
| 1502 | + ], | |
| 1503 | + ] | |
| 1504 | + ); | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + $this->add_control( | |
| 1508 | + 'footer_text_color', | |
| 1509 | + [ | |
| 1510 | + 'label' => esc_html__( 'Text Color', 'easy-elements' ), | |
| 1511 | + 'type' => Controls_Manager::COLOR, | |
| 1512 | + 'selectors' => [ | |
| 1513 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'color: {{VALUE}};', | |
| 1514 | + ] | |
| 1515 | + ] | |
| 1516 | + ); | |
| 1517 | + | |
| 1518 | + $this->add_group_control( | |
| 1519 | + Group_Control_Typography::get_type(), | |
| 1520 | + [ | |
| 1521 | + 'name' => 'footer_typography', | |
| 1522 | + 'selector' => '{{WRAPPER}} table.easyel-table .easyel-table-footer', | |
| 1523 | + | |
| 1524 | + ] | |
| 1525 | + ); | |
| 1526 | + | |
| 1527 | + $this->add_control( | |
| 1528 | + 'footer_bg_color', | |
| 1529 | + [ | |
| 1530 | + 'label' => esc_html__( 'Background Color', 'easy-elements' ), | |
| 1531 | + 'type' => Controls_Manager::COLOR, | |
| 1532 | + 'selectors' => [ | |
| 1533 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer' => 'background-color: {{VALUE}};', | |
| 1534 | + ] | |
| 1535 | + ] | |
| 1536 | + ); | |
| 1537 | + $this->add_responsive_control( | |
| 1538 | + 'table_tfoot_radius', | |
| 1539 | + [ | |
| 1540 | + 'label' => esc_html__( 'Border Radius', 'easy-elements' ), | |
| 1541 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1542 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1543 | + 'selectors' => [ | |
| 1544 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'border-radius: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1545 | + ], | |
| 1546 | + ] | |
| 1547 | + ); | |
| 1548 | + $this->add_responsive_control( | |
| 1549 | + 'table_tfoot_padding', | |
| 1550 | + [ | |
| 1551 | + 'label' => esc_html__( 'Padding', 'easy-elements' ), | |
| 1552 | + 'type' => Controls_Manager::DIMENSIONS, | |
| 1553 | + 'size_units' => [ 'px', '%', 'em' ], | |
| 1554 | + 'selectors' => [ | |
| 1555 | + '{{WRAPPER}} table.easyel-table .easyel-table-footer th' => 'padding: {{TOP}}{{UNIT}} {{RIGHT}}{{UNIT}} {{BOTTOM}}{{UNIT}} {{LEFT}}{{UNIT}};', | |
| 1556 | + ], | |
| 1557 | + ] | |
| 1558 | + ); | |
| 1559 | + $this->add_group_control( | |
| 1560 | + \Elementor\Group_Control_Border::get_type(), | |
| 1561 | + [ | |
| 1562 | + 'name' => 'body_foot_border', | |
| 1563 | + 'selector' => '{{WRAPPER}} .table.easyel-table .easyel-table-footer th', | |
| 1564 | + ] | |
| 1565 | + ); | |
| 1566 | + | |
| 1567 | + $this->end_controls_section(); | |
| 1568 | + | |
| 1569 | + } | |
| 1570 | + /** | |
| 1571 | + * Render oEmbed widget output on the frontend. | |
| 1572 | + * | |
| 1573 | + * Written in PHP and used to generate the final HTML. | |
| 1574 | + * | |
| 1575 | + * @since 1.0.0 | |
| 1576 | + * @access protected | |
| 1577 | + */ | |
| 1578 | + protected function render() { | |
| 1579 | + $settings = $this->get_settings_for_display(); | |
| 1580 | + $unique = wp_rand(10,6554120); | |
| 1581 | + $tooltip_align = $settings['tooltip_align']; | |
| 1582 | + ?> | |
| 1583 | + <!-- Tooltip element --> | |
| 1584 | + <table class="easyel-table table single-plan" id="table-<?php echo esc_attr($unique);?>"> | |
| 1585 | + <?php if ($settings['table_header']):?> | |
| 1586 | + <thead class="easyel-table-header"> | |
| 1587 | + <tr class="single-plan__header"> | |
| 1588 | + <?php | |
| 1589 | + foreach ( $settings['table_header'] as $index => $headeritem ) { | |
| 1590 | + | |
| 1591 | + $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_header', $index ); | |
| 1592 | + $this->add_inline_editing_attributes( $repeater_setting_key ); | |
| 1593 | + | |
| 1594 | + $colspan = ( isset( $headeritem['colspan'], $headeritem['advance'] ) && $headeritem['colspan'] === 'yes' && $headeritem['advance'] === 'yes' ) ? 'colspan="' . esc_attr( $headeritem['colspannumber'] ) . '"' : ''; | |
| 1595 | + | |
| 1596 | + echo '<th class="header-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $headeritem['_id'] ) . '" ' | |
| 1597 | + . esc_attr( $colspan ) . ' ' | |
| 1598 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1599 | + . $this->get_render_attribute_string( $repeater_setting_key ) . '>'; | |
| 1600 | + | |
| 1601 | + // Header Icon | |
| 1602 | + if ( isset( $headeritem['header_icon'] ) && $headeritem['header_icon'] === 'yes' && ! empty( $headeritem['table_head_icon']['value'] ) ) { | |
| 1603 | + echo '<span class="easyel-header-icon">'; | |
| 1604 | + | |
| 1605 | + // Render icon safely | |
| 1606 | + \Elementor\Icons_Manager::render_icon( | |
| 1607 | + $headeritem['table_head_icon'], | |
| 1608 | + [ 'aria-hidden' => 'true' ] | |
| 1609 | + ); | |
| 1610 | + | |
| 1611 | + echo '</span>'; | |
| 1612 | + } | |
| 1613 | + | |
| 1614 | + echo wp_kses_post( $headeritem['text'] ); | |
| 1615 | + | |
| 1616 | + if ( isset( $headeritem['table_head_tooltip'] ) && $headeritem['table_head_tooltip'] === 'yes' ) { | |
| 1617 | + echo '<span class="easyel-tooltip" ' | |
| 1618 | + . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1619 | + . 'data-bs-toggle="tooltip" ' | |
| 1620 | + . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1621 | + . 'title="' . esc_attr( $headeritem['table_head_tooltip_description'] ) . '">'; | |
| 1622 | + | |
| 1623 | + \Elementor\Icons_Manager::render_icon( | |
| 1624 | + $headeritem['table_head_tooltip_icon'], | |
| 1625 | + [ 'aria-hidden' => 'true' ] | |
| 1626 | + ); | |
| 1627 | + | |
| 1628 | + echo '</span>'; | |
| 1629 | + } | |
| 1630 | + | |
| 1631 | + echo '</th>'; | |
| 1632 | + } | |
| 1633 | + ?> | |
| 1634 | + </tr> | |
| 1635 | + </thead> | |
| 1636 | + <?php endif;?> | |
| 1637 | + <?php if ($settings['table_body']):?> | |
| 1638 | + <tbody class="easyel-table-body"> | |
| 1639 | + <tr class="single-plan__content"> | |
| 1640 | + <?php | |
| 1641 | + foreach ( $settings['table_body'] as $index => $item ) { | |
| 1642 | + | |
| 1643 | + // Flex data condition | |
| 1644 | + $flex_data = ( !empty( $item['table_body_data_flex'] ) && $item['table_body_data_flex'] === 'yes' ) ? 'data-flex' : ''; | |
| 1645 | + | |
| 1646 | + $table_icon = ! empty( $item['table_icon'] ) ? $item['table_icon'] : ''; | |
| 1647 | + | |
| 1648 | + | |
| 1649 | + $table_body_key = $this->get_repeater_setting_key( 'text', 'table_body', $index ); | |
| 1650 | + | |
| 1651 | + $this->add_render_attribute( $table_body_key, 'class', 'plan-title ' . $flex_data . ' elementor-repeater-item-' . esc_attr( $item['_id'] ) ); | |
| 1652 | + | |
| 1653 | + $this->add_inline_editing_attributes( $table_body_key ); | |
| 1654 | + | |
| 1655 | + if ( isset( $item['row'] ) && $item['row'] === 'yes' ) { | |
| 1656 | + echo '</tr><tr class="single-plan__content">'; | |
| 1657 | + } | |
| 1658 | + | |
| 1659 | + $colspan = ( isset( $item['colspan'], $item['advance'] ) && $item['colspan'] === 'yes' && $item['advance'] === 'yes' ) | |
| 1660 | + ? 'colspan="' . esc_attr( $item['colspannumber'] ) . '"' | |
| 1661 | + : ''; | |
| 1662 | + | |
| 1663 | + $rowspan = ( isset( $item['rowspan'], $item['advance'] ) && $item['rowspan'] === 'yes' && $item['advance'] === 'yes' ) | |
| 1664 | + ? 'rowspan="' . esc_attr( $item['rowspannumber'] ) . '"' | |
| 1665 | + : ''; | |
| 1666 | + | |
| 1667 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1668 | + echo '<td ' . $colspan . ' ' . $rowspan . ' ' . $this->get_render_attribute_string( $table_body_key ) . '>'; | |
| 1669 | + | |
| 1670 | + // table icon | |
| 1671 | + if ( ! empty( $table_icon ) ) { | |
| 1672 | + \Elementor\Icons_Manager::render_icon( $table_icon, [ 'aria-hidden' => 'true' ] ); | |
| 1673 | + } | |
| 1674 | + | |
| 1675 | + // table image | |
| 1676 | + $image_id = ! empty( $item['table_image']['id'] ) ? absint( $item['table_image']['id'] ) : ''; | |
| 1677 | + $image_url = ! empty( $item['table_image']['url'] ) ? esc_url( $item['table_image']['url'] ) : ''; | |
| 1678 | + // Case 1: Attachment ID exists and is an image | |
| 1679 | + if ( $image_id && wp_attachment_is_image( $image_id ) ) { | |
| 1680 | + echo wp_get_attachment_image( | |
| 1681 | + $image_id, | |
| 1682 | + 'thumbnail', | |
| 1683 | + false, | |
| 1684 | + [ | |
| 1685 | + 'class' => 'easyel-table-image', | |
| 1686 | + 'alt' => esc_attr( get_post_meta( $image_id, '_wp_attachment_image_alt', true ) ), | |
| 1687 | + ] | |
| 1688 | + ); | |
| 1689 | + } | |
| 1690 | + | |
| 1691 | + // Case 2: Fallback to URL | |
| 1692 | + elseif ( $image_url ) { | |
| 1693 | + echo '<img src="' . esc_url( $image_url ) . '" class="easyel-table-image" alt="">'; | |
| 1694 | + } | |
| 1695 | + | |
| 1696 | + echo wp_kses_post( $item['text'] ); | |
| 1697 | + | |
| 1698 | + if ( isset( $item['table_body_tooltip'] ) && $item['table_body_tooltip'] === 'yes' ) { | |
| 1699 | + echo '<span class="easyel-tooltip" ' | |
| 1700 | + . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1701 | + . 'data-bs-toggle="tooltip" ' | |
| 1702 | + . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1703 | + . 'title="' . esc_attr( $item['table_body_tooltip_description'] ) . '">'; | |
| 1704 | + | |
| 1705 | + \Elementor\Icons_Manager::render_icon( | |
| 1706 | + $item['table_body_tooltip_icon'], | |
| 1707 | + [ 'aria-hidden' => 'true' ] | |
| 1708 | + ); | |
| 1709 | + echo '</span>'; | |
| 1710 | + } | |
| 1711 | + | |
| 1712 | + echo '</td>'; | |
| 1713 | + } | |
| 1714 | + ?> | |
| 1715 | + </tr> | |
| 1716 | + </tbody> | |
| 1717 | + <?php endif;?> | |
| 1718 | + <?php if ($settings['table_footer']):?> | |
| 1719 | + <tfoot class="easyel-table-footer"> | |
| 1720 | + <tr class="easyel-single-plane-footer"> | |
| 1721 | + <?php | |
| 1722 | + foreach ( $settings['table_footer'] as $index => $footeritem ) { | |
| 1723 | + | |
| 1724 | + $repeater_setting_key = $this->get_repeater_setting_key( 'text', 'table_footer', $index ); | |
| 1725 | + $this->add_inline_editing_attributes( $repeater_setting_key ); | |
| 1726 | + | |
| 1727 | + $colspan = ( $footeritem['colspan'] === 'yes' && $footeritem['advance'] === 'yes' ) | |
| 1728 | + ? 'colspan="' . esc_attr( $footeritem['colspannumber'] ) . '"' | |
| 1729 | + : ''; | |
| 1730 | + | |
| 1731 | + echo '<th class="footer-title elementor-inline-editing elementor-repeater-item-' . esc_attr( $footeritem['_id'] ) . '" ' | |
| 1732 | + . esc_attr( $colspan ) . ' ' | |
| 1733 | + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped | |
| 1734 | + . $this->get_render_attribute_string( $repeater_setting_key ) | |
| 1735 | + . '>' | |
| 1736 | + . wp_kses_post( $footeritem['text'] ); | |
| 1737 | + | |
| 1738 | + if ( isset( $footeritem['table_foot_tooltip'] ) && $footeritem['table_foot_tooltip'] === 'yes' ) { | |
| 1739 | + echo '<span class="easyel-tooltip" ' | |
| 1740 | + . 'data-bs-custom-class="tooltip-table-title" ' | |
| 1741 | + . 'data-bs-toggle="tooltip" ' | |
| 1742 | + . 'data-bs-placement="' . esc_attr( $tooltip_align ) . '" ' | |
| 1743 | + . 'title="' . esc_attr( $footeritem['table_foot_tooltip_description'] ) . '">'; | |
| 1744 | + | |
| 1745 | + \Elementor\Icons_Manager::render_icon( | |
| 1746 | + $footeritem['table_foot_tooltip_icon'], | |
| 1747 | + [ 'aria-hidden' => 'true' ] | |
| 1748 | + ); | |
| 1749 | + | |
| 1750 | + echo '</span>'; | |
| 1751 | + } | |
| 1752 | + | |
| 1753 | + echo '</th>'; | |
| 1754 | + } | |
| 1755 | + ?> | |
| 1756 | + </tr> | |
| 1757 | + </tfoot> | |
| 1758 | + <?php endif;?> | |
| 1759 | + </table> | |
| 1760 | + | |
| 1761 | + <?php | |
| 1762 | + } | |
| 1763 | + } | |
| 1764 | +} | |