PluginProbe
Booking Calendar / 11.9
Booking Calendar v11.9
11.9 11.8.4 11.8.3 11.8.2 11.8.1 11.8 11.7 11.6.1 11.6 11.5 11.4.3 11.4.2 11.4.1 11.4 11.3 11.2.1 11.2 11.1 11.0 10.15.7 10.15.6 10.1.3 10.10 10.10.1 10.10.2 All 205 releases
booking / includes / page-form-builder / field-packs / section / section-wptpl.php

section-wptpl.php in Booking Calendar 11.9, at includes/page-form-builder/field-packs/section/section-wptpl.php

780 lines 46.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * WPBC BFB Pack: Section (WP-template–driven) — with reusable “Style” Inspector (per-column)
4 *
5 * - Adds a shared Inspector "Style" panel to control per-column flex layout (direction/wrap/justify/align/gap).
6 * - Values are stored in section props as JSON string (key: col_styles) for reliable serialization.
7 * - Preview applies styles via CSS custom properties on each column (safe, extendable, themable).
8 *
9 * File: ../includes/page-form-builder/field-packs/section/section-wptpl.php
10 *
11 * @package Booking Calendar
12 * @author wpdevelop
13 * @since 11.0.0
14 * @modified 2025-09-16 11:24
15 * @version 1.1.0
16 */
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21
22 /**
23 * Register the "section" pack with schema extended by col_styles (JSON string).
24 *
25 * @param array $packs Accumulated packs from other modules.
26 *
27 * @return array
28 */
29 function wpbc_bfb_register_field_packs__section_wptpl( $packs ) {
30
31 $packs['section'] = array(
32 'kind' => 'section',
33 'type' => 'section',
34 'label' => __( 'Section', 'booking' ),
35 'icon' => 'wpbc_icn_view_quilt',
36 'usage_key' => 'section',
37
38 // Schema: add 'col_styles' as JSON string (per-column style map).
39 'schema' => array(
40 'props' => array(
41 'columns' => array(
42 'type' => 'number',
43 'default' => 1,
44 'min' => 1,
45 'max' => 4,
46 'step' => 1,
47 ),
48 'cssclass' => array(
49 'type' => 'string',
50 'default' => '',
51 ),
52 'html_id' => array(
53 'type' => 'string',
54 'default' => '',
55 ),
56 'id' => array(
57 'type' => 'string',
58 'default' => '',
59 ),
60 'label' => array(
61 'type' => 'string',
62 'default' => __( 'Section', 'booking' ),
63 ),
64
65 // NEW: Per-column flex style settings (JSON string; see JS for structure).
66 'col_styles' => array(
67 'type' => 'string',
68 'default' => '',
69 ),
70 ),
71 ),
72
73 'templates_printer' => 'wpbc_bfb_section_wptpl_print_templates',
74 );
75
76 return $packs;
77 }
78 add_filter( 'wpbc_bfb_register_field_packs', 'wpbc_bfb_register_field_packs__section_wptpl' );
79
80
81 /**
82 * Enqueue the section pack JS (renderer + style inspector slot).
83 *
84 * @param string $page Current admin page slug.
85 */
86 function wpbc_bfb_enqueue__section_wptpl_js( $page ) {
87 if ( WPBC_BFB_BUILDER_PAGE_SLUG !== $page ) {
88 return;
89 }
90 wp_enqueue_script( 'wpbc-bfb_section_wptpl', wpbc_plugin_url( '/includes/page-form-builder/field-packs/section/_out/section-wptpl.js' ),
91 array( 'wp-util', 'wpbc-bfb' ), WP_BK_VERSION_NUM, true );
92 wp_enqueue_script( 'wpbc-bfb_section_column_styles', wpbc_plugin_url( '/includes/page-form-builder/field-packs/section/_out/ui-column-styles.js' ),
93 array( 'wpbc-bfb_section_wptpl' ), WP_BK_VERSION_NUM, true );
94 wp_enqueue_script( 'wpbc-bfb_section_inspector_patch', wpbc_plugin_url( '/includes/page-form-builder/field-packs/section/_out/bfb-inspector-patches.js' ),
95 array( 'wpbc-bfb_section_wptpl' ), WP_BK_VERSION_NUM, true );
96 }
97 add_action( 'wpbc_enqueue_js_field_pack', 'wpbc_bfb_enqueue__section_wptpl_js', 10, 1 );
98
99
100 /**
101 * wp.template() blocks.
102 * - Adds new Inspector "Style" group with a reusable slot 'column_styles' (rendered by JS).
103 *
104 * @param string $page Current admin page slug.
105 */
106 function wpbc_bfb_section_wptpl_print_templates( $page ) {
107 if ( WPBC_BFB_BUILDER_PAGE_SLUG !== $page ) {
108 return;
109 } ?>
110 <script type="text/html" id="tmpl-wpbc-bfb-section">
111 <div class="wpbc_bfb__noaction wpbc_bfb__no-drag-zone" inert="">
112 <# var cols = parseInt( data.columns || 1, 10 ); if ( ! Number.isFinite(cols) || cols < 1 ) { cols = 1; } if ( cols > 4 ) { cols = 4; } #>
113
114 <# if ( data.label ) { #>
115 <div class="wpbc_bfb__section__title">{{ data.label }}</div>
116 <# } #>
117
118 <div class="wpbc_bfb__section__summary">
119 <span class="wpbc_bfb__badge">{{ cols }} <?php echo esc_html__( 'columns', 'booking' ); ?></span>
120 <# if ( data.cssclass ) { #><span class="wpbc_bfb__badge wpbc_bfb__badge--muted">{{ data.cssclass }}</span><# } #>
121 </div>
122
123 <div class="wpbc_bfb__section__cols" aria-label="<?php echo esc_attr__( 'Section columns preview', 'booking' ); ?>">
124 <# for ( var i = 0; i < cols; i++ ) { #>
125 <div class="wpbc_bfb__section__col"><span class="ghost"><?php echo esc_html__( 'Drop fields here', 'booking' ); ?></span></div>
126 <# } #>
127 </div>
128 </div>
129 </script>
130
131 <script type="text/html" id="tmpl-wpbc-bfb-inspector-section">
132 <# var uid = (Math.random().toString(36).slice(2,8));
133 var sel = (window.wpbc_bfb_api && typeof window.wpbc_bfb_api.get_selection_el === 'function') ? window.wpbc_bfb_api.get_selection_el() : null;
134 var d = sel && sel.dataset ? sel.dataset : {};
135 var initCols = 1;
136 try {
137 var row = sel ? sel.querySelector(':scope > .wpbc_bfb__row') : null;
138 initCols = row ? row.querySelectorAll(':scope > .wpbc_bfb__column').length : 1;
139 if ( ! Number.isFinite(initCols) || initCols < 1 ) initCols = 1;
140 if ( initCols > 4 ) initCols = 4;
141 } catch(e){ initCols = 1; }
142 var labelV = (d && d.label) ? d.label : '<?php echo esc_js( __( 'Section', 'booking' ) ); ?>';
143 var cssclassV = (d && d.cssclass) ? d.cssclass : '';
144 var htmlIdV = (d && d.html_id) ? d.html_id : '';
145 var internalV = (d && d.id) ? d.id : '';
146 #>
147
148 <div class="wpbc_bfb__inspector__head">
149 <div class="header_container">
150 <div class="header_title_content">
151 <h3 class="title"><?php echo esc_html__( 'Section', 'booking' ); ?></h3>
152 <div class="desc"><?php echo esc_html__( 'Layout container with columns.', 'booking' ); ?></div>
153 </div>
154 <div class="actions wpbc_ajx_toolbar wpbc_no_borders">
155 <div class="ui_container ui_container_small">
156 <div class="ui_group">
157 <div class="ui_element">
158 <button type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button" data-action="deselect" aria-label="<?php echo esc_attr__( 'Deselect', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_rotate_270 wpbc_icn_near_me_disabled"></i></button>
159 <button type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button" data-action="scrollto" aria-label="<?php echo esc_attr__( 'Scroll to section', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_ads_click filter_center_focus"></i></button>
160 </div>
161 <div class="ui_element">
162 <button type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button" data-action="move-up" aria-label="<?php echo esc_attr__( 'Move up', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_arrow_upward"></i></button>
163 <button type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button" data-action="move-down" aria-label="<?php echo esc_attr__( 'Move down', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_arrow_downward"></i></button>
164 </div>
165 <div class="ui_element">
166 <button data-action="duplicate" aria-label="<?php echo esc_attr__( 'Duplicate', 'booking' ); ?>" type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button"><i class="menu_icon icon-1x wpbc_icn_content_copy"></i></button>
167 <button data-action="delete" aria-label="<?php echo esc_attr__( 'Delete', 'booking' ); ?>" type="button" class="button button-secondary wpbc_ui_control wpbc_ui_button wpbc_ui_button_danger button-link-delete"><span class="in-button-text"><?php echo esc_html__( 'Delete', 'booking' ); ?></span>&nbsp;&nbsp;<i class="menu_icon icon-1x wpbc_icn_delete_outline"></i></button>
168 </div>
169 </div>
170 </div>
171 </div>
172 </div>
173 </div>
174
175 <div class="wpbc_bfb__inspector__body">
176
177 <section class="wpbc_bfb__inspector__group wpbc_ui__collapsible_group is-open" data-group="layout">
178 <button type="button" class="group__header" role="button" aria-expanded="true" aria-controls="wpbc_collapsible_panel_{{ uid }}_layout">
179 <h3><?php echo esc_html__( 'Layout', 'booking' ); ?></h3>
180 <i class="wpbc_ui_el__vert_menu_root_section_icon menu_icon icon-1x wpbc-bi-chevron-right"></i>
181 </button>
182 <div class="group__fields" id="wpbc_collapsible_panel_{{ uid }}_layout" aria-hidden="false">
183 <div class="inspector__row">
184 <label class="inspector__label" for="wpbc_ins_columns_{{ uid }}"><?php echo esc_html__( 'Columns Number', 'booking' ); ?></label>
185 <div class="inspector__control">
186 <div class="wpbc_len_group wpbc_inline_inputs" data-len-group="columns-number">
187 <input type="range" class="inspector__input" data-len-range min="1" max="4" step="1" value="{{ initCols }}" >
188 <input data-len-value id="wpbc_ins_columns_{{ uid }}" type="number" class="inspector__input inspector__w_30" data-inspector-key="columns" min="1" max="4" step="1" value="{{ initCols }}" >
189 </div>
190 </div>
191 </div>
192
193 <div class="inspector__row inspector__row--layout-chips">
194 <label class="inspector__label"><?php echo esc_html__( 'Layout', 'booking' ); ?></label>
195 <div class="inspector__control">
196 <div class="wpbc_bfb__layout_chips" data-bfb-slot="layout_chips" id="wpbc_bfb__layout_chips_host"></div>
197 </div>
198 </div>
199 </div>
200 <div id="wpbc_collapsible_panel_{{ uid }}_style" aria-hidden="true" class="group__content">
201 <div class="wpbc_bfb__column_styles_host" data-bfb-slot="column_styles"></div><!-- Slot host: rendered by JS shared component UI.wpbc_bfb_column_styles -->
202 </div>
203 </section>
204
205 <section class="wpbc_bfb__inspector__group wpbc_ui__collapsible_group" data-group="appearance">
206 <button type="button" class="group__header" role="button" aria-expanded="false" aria-controls="wpbc_collapsible_panel_{{ uid }}_appearance">
207 <h3><?php echo esc_html__( 'Advanced', 'booking' ); ?></h3>
208 <i class="wpbc_ui_el__vert_menu_root_section_icon menu_icon icon-1x wpbc-bi-chevron-right"></i>
209 </button>
210 <div class="group__fields" id="wpbc_collapsible_panel_{{ uid }}_appearance" aria-hidden="true">
211 <div class="inspector__row">
212 <label class="inspector__label" for="wpbc_ins_cssclass_{{ uid }}"><?php echo esc_html__( 'CSS class', 'booking' ); ?></label>
213 <div class="inspector__control"><input id="wpbc_ins_cssclass_{{ uid }}" type="text" class="inspector__input" data-inspector-key="cssclass" value="{{ cssclassV }}"></div>
214 </div>
215 <div class="inspector__row">
216 <label class="inspector__label" for="wpbc_ins_htmlid_{{ uid }}"><?php echo esc_html__( 'HTML ID', 'booking' ); ?></label>
217 <div class="inspector__control"><input id="wpbc_ins_htmlid_{{ uid }}" type="text" class="inspector__input" data-inspector-key="html_id" value="{{ htmlIdV }}"></div>
218 </div>
219 </div>
220 </section>
221 <?php /* ?>
222 <section class="wpbc_bfb__inspector__group wpbc_ui__collapsible_group" data-group="attributes">
223 <button type="button" class="group__header" role="button" aria-expanded="false" aria-controls="wpbc_collapsible_panel_{{ uid }}_attributes">
224 <h3><?php echo esc_html__( 'Attributes', 'booking' ); ?></h3>
225 <i class="wpbc_ui_el__vert_menu_root_section_icon menu_icon icon-1x wpbc-bi-chevron-right"></i>
226 </button>
227 <div class="group__fields" id="wpbc_collapsible_panel_{{ uid }}_attributes" aria-hidden="true">
228 <div class="inspector__row">
229 <label class="inspector__label" for="wpbc_ins_internalid_{{ uid }}"><?php echo esc_html__( 'Internal ID', 'booking' ); ?></label>
230 <div class="inspector__control"><input id="wpbc_ins_internalid_{{ uid }}" type="text" class="inspector__input" data-inspector-key="id" value="{{ internalV }}"></div>
231 </div>
232 <div class="inspector__row">
233 <label class="inspector__label" for="wpbc_ins_label_{{ uid }}"><?php echo esc_html__( 'Label', 'booking' ); ?></label>
234 <div class="inspector__control"><input id="wpbc_ins_label_{{ uid }}" type="text" class="inspector__input" data-inspector-key="label" value="{{ labelV }}"></div>
235 </div>
236 </div>
237 </section>
238 <?php */ ?>
239 </div>
240 </script>
241 <?php
242 // Reuse it Anywhere , where already have:.
243 // <div class="wpbc_bfb__column_styles_host" data-bfb-slot="column_styles"></div>
244 // and inspector glue calls:
245 // UI.wpbc_bfb_column_styles.render_for_section(builder, section_el, host)
246 ?>
247 <script type="text/html" id="tmpl-wpbc-bfb-column-styles">
248 <# var cols = data.cols || 1;
249 var styles = data.styles || [];
250 var active = !! data.active;
251 #>
252 <div class="wpbc_ui_tabs_root" data-wpbc-tabs="column-styles" data-wpbc-tab-active="1" >
253 <!-- Header Tabs -->
254 <div class=" wpbc_ui_el__horis_top_bar__wrapper" data-wpbc-tablist role="tablist">
255 <div class="wpbc_ui_el__horis_top_bar__content">
256 <h2 class="wpbc_ui_el__horis_nav_label" ><?php echo esc_html__( 'Column', 'booking' ); ?>:</h2>
257 <# for ( var i = 0; i < cols; i++ ) { var is_first = ( i === 0 ); var k = String( i + 1 ); #>
258 <div class="wpbc_ui_el__horis_nav_item wpbc_ui_el__horis_nav_item__{{ k }}">
259 <a href="javascript:void(0);"
260 class="wpbc_ui_el__horis_nav_item__a wpbc_ui_el__horis_nav_item__single"
261 data-wpbc-tab-key="{{ k }}"
262 id="wpbc_tab_col_{{ k }}"
263 title="<?php echo esc_attr__( 'Column', 'booking' ); ?> {{ k }}"
264 <# if ( is_first ) { #> aria-selected="true" <# } #>
265 role="tab"
266 tabindex="<# if ( is_first ) { #>0<# } else { #>-1<# } #>"
267 aria-controls="wpbc_tab_panel_col_{{ k }}">
268 <span class="wpbc_ui_el__horis_nav_title">{{ k }}</span>
269 </a>
270 </div>
271 <# } #>
272 </div>
273 </div>
274 <!-- Tabs Content -->
275 <# for ( var i = 0; i < cols; i++ ) {
276 var k = String(i + 1);
277 var s = styles[i] || {};
278 var is_first = (i === 0);
279
280 // Radio group names per column:
281 var __name_layout_combo = 'bfb_col_' + k + '_layout_combo';
282
283 var __name_dir = 'bfb_col_' + k + '_dir';
284 var __name_wrap = 'bfb_col_' + k + '_wrap';
285 var __name_jc = 'bfb_col_' + k + '_jc';
286 var __name_ai = 'bfb_col_' + k + '_ai';
287 var __name_aself = 'bfb_col_' + k + '_aself';
288
289 // use merged defaults already in s.*
290 var val_dir = String(s.dir);
291 var val_wrap = String(s.wrap);
292 var val_jc = String(s.jc);
293 var val_ai = String(s.ai);
294 var val_aself = String(s.aself);
295
296 // labels depend on actual value (no fallback needed)
297 var __isRow = (val_dir.indexOf('row') === 0);
298 var __main_label = __isRow ? '<?php echo esc_js( __( 'Horizontally', 'booking' ) ); ?>'
299 : '<?php echo esc_js( __( 'Vertically', 'booking' ) ); ?>';
300 var __cross_label = __isRow ? '<?php echo esc_js( __( 'Vertically', 'booking' ) ); ?>'
301 : '<?php echo esc_js( __( 'Horizontally', 'booking' ) ); ?>';
302 #>
303 <div class="wpbc_tab__panel group__fields"
304 data-wpbc-tab-panel="{{ k }}"
305 id="wpbc_tab_panel_col_{{ k }}"
306 role="tabpanel"
307 aria-labelledby="wpbc_tab_col_{{ k }}"
308 <# if ( ! is_first ) { #> hidden <# } #>
309 >
310 <div class="inspector__row"><h2><?php echo esc_js( __( 'Arrange Items', 'booking' ) ); ?></h2></div>
311 <!-- Combo Direction (dir + wrap in one control) -->
312 <div class="inspector__row">
313 <label class="inspector__label inspector__w_40"><?php echo esc_html__( 'Direction', 'booking' ); ?></label>
314 <div class="inspector__control inspector__w_55">
315 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="<?php echo esc_attr__( 'Layout', 'booking' ); ?>">
316 <input type="radio" class="inspector__input wpbc_sr_only"
317 name="{{ __name_layout_combo }}"
318 data-style-key="layout_combo"
319 data-col-idx="{{ i }}"
320 id="bfb_col_{{ k }}_layout_row_nowrap"
321 value="row|nowrap"
322 <# if ( ( val_dir === 'row' ) && ( val_wrap === 'nowrap' ) ) { #>checked<# } #>
323 >
324 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_layout_row_nowrap" title="<?php echo esc_attr__( 'Row', 'booking' ); ?>">
325 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_south wpbc_icn_rotate_270"></i></span>
326 <span class="sr-only"><?php echo esc_html__( 'Row', 'booking' ); ?> + <?php echo esc_html__( 'No Wrap', 'booking' ); ?></span>
327 </label>
328 <input type="radio" class="inspector__input wpbc_sr_only"
329 name="{{ __name_layout_combo }}"
330 data-style-key="layout_combo"
331 data-col-idx="{{ i }}"
332 id="bfb_col_{{ k }}_layout_column_nowrap"
333 value="column|nowrap"
334 <# if ( ( val_dir === 'column' ) && ( val_wrap === 'nowrap' ) ) { #>checked<# } #>
335 >
336 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_layout_column_nowrap" title="<?php echo esc_attr__( 'Column', 'booking' ); ?>">
337 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_south"></i></span>
338 <span class="sr-only"><?php echo esc_html__( 'Column', 'booking' ); ?> + <?php echo esc_html__( 'No Wrap', 'booking' ); ?></span>
339 </label>
340 <input type="radio" class="inspector__input wpbc_sr_only"
341 name="{{ __name_layout_combo }}"
342 data-style-key="layout_combo"
343 data-col-idx="{{ i }}"
344 id="bfb_col_{{ k }}_layout_row_wrap"
345 value="row|wrap"
346 <# if ( ( val_dir === 'row' ) && ( val_wrap === 'wrap' ) ) { #>checked<# } #>
347 >
348 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_layout_row_wrap" title="<?php echo esc_attr__( 'Row', 'booking' ) . ' | ' . esc_attr__( 'Wrap', 'booking' ); ?>">
349 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_u_turn_right wpbc_icn_rotate_90"></i></span>
350 <span class="sr-only"><?php echo esc_html__( 'Row', 'booking' ); ?> | <?php echo esc_html__( 'Wrap', 'booking' ); ?></span>
351 </label>
352 </div>
353 </div>
354 </div>
355
356 <?php /* ?>
357
358 <!-- Direction -->
359 <div class="inspector__row">
360 <label class="inspector__label inspector__w_40"><?php echo esc_html__( 'Direction', 'booking' ); ?></label>
361 <div class="inspector__control inspector__w_50">
362 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="<?php echo esc_attr__( 'Direction', 'booking' ); ?>">
363 <input type="radio" class="inspector__input wpbc_sr_only" name="{{ __name_dir }}" data-style-key="dir" data-col-idx="{{ i }}"
364 id="bfb_col_{{ k }}_dir_row"
365 value="row"
366 <# if (val_dir === 'row') { #>checked<# } #> >
367 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_dir_row" title="<?php echo esc_attr__( 'Row – horizontal', 'booking' ); ?>">
368 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_south wpbc_icn_rotate_270"></i></span><span class="sr-only"><?php echo esc_html__( 'Row', 'booking' ); ?></span>
369 </label>
370
371 <input type="radio" class="inspector__input wpbc_sr_only" name="{{ __name_dir }}" data-style-key="dir" data-col-idx="{{ i }}"
372 id="bfb_col_{{ k }}_dir_column"
373 value="column"
374 <# if (val_dir === 'column') { #>checked<# } #> >
375 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_dir_column" title="<?php echo esc_attr__( 'Column – vertical', 'booking' ); ?>">
376 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_south"></i></span><span class="sr-only"><?php echo esc_html__( 'Column', 'booking' ); ?></span>
377 </label>
378 </div>
379 </div>
380 </div>
381
382 <!-- Wrap -->
383 <div class="inspector__row">
384 <label class="inspector__label inspector__w_40"><?php echo esc_html__( 'Wrap', 'booking' ); ?></label>
385 <div class="inspector__control inspector__w_50">
386 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="<?php echo esc_attr__( 'Wrap', 'booking' ); ?>">
387 <input class="inspector__input wpbc_sr_only"
388 type="radio"
389 id="bfb_col_{{ k }}_wrap_nowrap"
390 name="{{ __name_wrap }}"
391 data-style-key="wrap"
392 data-col-idx="{{ i }}"
393 value="nowrap"
394 <# if (val_wrap === 'nowrap') { #>checked<# } #> >
395 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_wrap_nowrap" title="<?php echo esc_attr__( 'No Wrap', 'booking' ); ?>">
396 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_straight wpbc_icn_rotate_90"></i></span><span class="sr-only"><?php echo esc_html__( 'No Wrap', 'booking' ); ?></span>
397 </label>
398
399 <input class="inspector__input wpbc_sr_only"
400 type="radio"
401 id="bfb_col_{{ k }}_wrap_wrap"
402 name="{{ __name_wrap }}"
403 data-style-key="wrap"
404 data-col-idx="{{ i }}"
405 value="wrap"
406 <# if (val_wrap === 'wrap') { #>checked<# } #> >
407 <label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_wrap_wrap" title="<?php echo esc_attr__( 'Wrap', 'booking' ); ?>">
408 <span aria-hidden="true"><i class="menu_icon icon-1x wpbc_icn_u_turn_right wpbc_icn_rotate_90"></i></span><span class="sr-only"><?php echo esc_html__( 'Wrap', 'booking' ); ?></span>
409 </label>
410 </div>
411 </div>
412 </div>
413 <?php /**/ ?>
414 <!-- Main axis (Justify Content) -->
415 <div class="inspector__row">
416 <label class="inspector__label inspector__w_40">{{ __main_label }}</label>
417 <div class="inspector__control inspector__w_55">
418 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="{{ __main_label }}">
419 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_fstart" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="flex-start" <# if (val_jc === 'flex-start') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_fstart" title="<?php echo esc_attr__( 'Start', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-start"></i></label>
420 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_center" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="center" <# if (val_jc === 'center') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_center" title="<?php echo esc_attr__( 'Center', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-center"></i></label>
421 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_fend" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="flex-end" <# if (val_jc === 'flex-end') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_fend" title="<?php echo esc_attr__( 'End', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-end"></i></label>
422 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_between" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="space-between" <# if (val_jc === 'space-between') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_between" title="<?php echo esc_attr__( 'Space Between', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_expand wpbc_icn_rotate_90"></i></label>
423 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_around" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="space-around" <# if (val_jc === 'space-around') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_around" title="<?php echo esc_attr__( 'Space Around', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-distribute-vertical wpbc_icn_rotate_90"></i></label>
424 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_jc_evenly" name="{{ __name_jc }}" data-style-key="jc" data-col-idx="{{ i }}" value="space-evenly" <# if (val_jc === 'space-evenly') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_jc_evenly" title="<?php echo esc_attr__( 'Space Evenly', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc_icn_horizontal_distribute "></i></label>
425 </div>
426 </div>
427 </div>
428
429 <!-- Cross axis (Align Items) -->
430 <div class="inspector__row">
431 <label class="inspector__label inspector__w_40">{{ __cross_label }}</label>
432 <div class="inspector__control inspector__w_55">
433 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="{{ __cross_label }}">
434 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_ai_fstart" name="{{ __name_ai }}" data-style-key="ai" data-col-idx="{{ i }}" value="flex-start" <# if ( val_ai === 'flex-start') { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_ai_fstart" title="<?php echo esc_attr__( 'Start', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-top"></i></label>
435 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_ai_center" name="{{ __name_ai }}" data-style-key="ai" data-col-idx="{{ i }}" value="center" <# if ( val_ai ==='center' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_ai_center" title="<?php echo esc_attr__( 'Center', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-middle"></i></label>
436 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_ai_fend" name="{{ __name_ai }}" data-style-key="ai" data-col-idx="{{ i }}" value="flex-end" <# if ( val_ai ==='flex-end' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_ai_fend" title="<?php echo esc_attr__( 'End', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-bottom"></i></label>
437 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_ai_stretch" name="{{ __name_ai }}" data-style-key="ai" data-col-idx="{{ i }}" value="stretch" <# if ( val_ai ==='stretch' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_ai_stretch" title="<?php echo esc_attr__( 'Stretch', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-arrows-expand"></i></label>
438 </div>
439 </div>
440 </div>
441
442 <# /* --------------------------------------------------------------------------------------------------------------
443 * Item Spacing (GAP) - Parses current s.gap into numeric value (__gnum) and unit (__gunit).
444 * ----------------------------------------------------------------------------------------------------------- */
445 var __gap = String(s.gap || '0px');
446 var __gm = __gap.match( /^(\d+(?:\.\d+)?)(px|rem|em|%)?$/ );
447 var __gnum = __gm ? __gm[1] : '0';
448 var __gunit = ( __gm && __gm[2] ) ? __gm[2] : 'px';
449 #>
450 <div class="inspector__row">
451 <label class="inspector__label inspector__w_40"><?php echo esc_html__( 'Item Spacing', 'booking' ); ?></label>
452 <div class="wpbc_len_group inspector__w_55" data-len-group="gap">
453 <div class="wpbc_inline_inputs">
454 <input
455 type="number" min="0" step="any" class="inspector__input"
456 data-style-key="gap" data-style-part="value" data-len-value
457 data-col-idx="{{ i }}" value="{{ __gnum }}"
458 >
459 <select class="inspector__input"
460 data-style-key="gap" data-style-part="unit" data-len-unit
461 data-col-idx="{{ i }}"
462 >
463 <option value="px" <# if ( __gunit === 'px' ) { #>selected<# } #>>px</option>
464 <option value="rem" <# if ( __gunit === 'rem' ) { #>selected<# } #>>rem</option>
465 <option value="em" <# if ( __gunit === 'em' ) { #>selected<# } #>>em</option>
466 <option value="%" <# if ( __gunit === '%' ) { #>selected<# } #>>%</option>
467 </select>
468 </div>
469 <input type="range" class="inspector__input"
470 data-style-key="gap" data-style-part="value" data-len-range
471 data-col-idx="{{ i }}"
472 min="0" max="128" step="1" value="{{ __gnum }}"
473 >
474 </div>
475 </div>
476
477 <div class="inspector__row"><h2><?php echo esc_js( __( 'Column Position', 'booking' ) ); ?></h2></div>
478 <!-- Self align (column itself) -->
479 <div class="inspector__row">
480 <label class="inspector__label inspector__w_40"><?php echo esc_html__( 'In Row', 'booking' ); ?></label>
481 <div class="inspector__control inspector__w_55">
482 <div class="wpbc_bfb__choices" role="radiogroup" aria-label="<?php echo esc_attr__( 'Column Align', 'booking' ); ?>">
483 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_aself_fstart" name="{{ __name_aself }}" data-style-key="aself" data-col-idx="{{ i }}" value="flex-start" <# if ( val_aself ==='flex-start' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_aself_fstart" title="<?php echo esc_attr__( 'Start', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-top "></i></label>
484 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_aself_center" name="{{ __name_aself }}" data-style-key="aself" data-col-idx="{{ i }}" value="center" <# if ( val_aself ==='center' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_aself_center" title="<?php echo esc_attr__( 'Center', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-middle "></i></label>
485 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_aself_fend" name="{{ __name_aself }}" data-style-key="aself" data-col-idx="{{ i }}" value="flex-end" <# if ( val_aself ==='flex-end' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_aself_fend" title="<?php echo esc_attr__( 'End', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-align-bottom "></i></label>
486 <input class="inspector__input wpbc_sr_only" type="radio" id="bfb_col_{{ k }}_aself_stretch" name="{{ __name_aself }}" data-style-key="aself" data-col-idx="{{ i }}" value="stretch" <# if ( val_aself ==='stretch' ) { #>checked<# } #> ><label class="wpbc_bfb__chip" for="bfb_col_{{ k }}_aself_stretch" title="<?php echo esc_attr__( 'Stretch', 'booking' ); ?>"><i class="menu_icon icon-1x wpbc-bi-arrows-expand "></i></label>
487 </div>
488 </div>
489 </div>
490
491 <#
492 var __box_spacing_groups = [
493 { key: 'padding', label: '<?php echo esc_js( __( 'Column Padding', 'booking' ) ); ?>' },
494 { key: 'margin', label: '<?php echo esc_js( __( 'Column Margin', 'booking' ) ); ?>' }
495 ];
496 var __box_spacing_sides = [
497 { key: 'top', label: '<?php echo esc_js( __( 'Top', 'booking' ) ); ?>' },
498 { key: 'right', label: '<?php echo esc_js( __( 'Right', 'booking' ) ); ?>' },
499 { key: 'bottom', label: '<?php echo esc_js( __( 'Bottom', 'booking' ) ); ?>' },
500 { key: 'left', label: '<?php echo esc_js( __( 'Left', 'booking' ) ); ?>' }
501 ];
502
503 for ( var __box_group_index = 0; __box_group_index < __box_spacing_groups.length; __box_group_index++ ) {
504 var __box_group = __box_spacing_groups[ __box_group_index ];
505 var __box_state_key = k + '_' + __box_group.key;
506 var __box_active_side = ( data.control_tabs && data.control_tabs[ __box_state_key ] ) || 'top';
507 #>
508 <div class="wpbc_bfb__column_control_group" data-column-control-tabs="{{ __box_group.key }}" data-column-control-tab-active="{{ __box_active_side }}" data-col-idx="{{ i }}">
509 <div class="wpbc_bfb__column_control_heading_row">
510 <h3 class="wpbc_bfb__column_control_heading">{{ __box_group.label }}</h3>
511 <button
512 type="button"
513 class="wpbc_bfb__column_help tooltip_left wpbc-bi-question-circle"
514 title="<?php echo esc_attr__( 'Set padding inside the column or margin outside the column independently for each side.', 'booking' ); ?>"
515 aria-label="<?php echo esc_attr__( 'Column spacing help', 'booking' ); ?>"
516 ></button>
517 </div>
518 <div class="wpbc_bfb__column_control_tablist" role="tablist" aria-label="{{ __box_group.label }}">
519 <# for ( var __box_tab_index = 0; __box_tab_index < __box_spacing_sides.length; __box_tab_index++ ) {
520 var __box_tab_side = __box_spacing_sides[ __box_tab_index ];
521 var __box_tab_style_key = __box_group.key + '_' + __box_tab_side.key;
522 var __box_tab_default = ( 'margin' === __box_group.key && ( 'top' === __box_tab_side.key || 'bottom' === __box_tab_side.key ) ) ? '0.7em' : '0px';
523 var __box_tab_value = String( s[ __box_tab_style_key ] || __box_tab_default );
524 var __box_tab_changed = __box_tab_default !== __box_tab_value;
525 var __box_tab_active = __box_active_side === __box_tab_side.key;
526 #>
527 <button type="button"
528 id="bfb_col_{{ k }}_{{ __box_group.key }}_tab_{{ __box_tab_side.key }}"
529 class="wpbc_bfb__column_control_tab <# if ( __box_tab_changed ) { #>is-changed<# } #>"
530 data-column-control-tab-key="{{ __box_tab_side.key }}"
531 data-column-control-tab-style-keys="{{ __box_tab_style_key }}"
532 data-col-idx="{{ i }}"
533 role="tab"
534 aria-selected="<# if ( __box_tab_active ) { #>true<# } else { #>false<# } #>"
535 aria-controls="bfb_col_{{ k }}_{{ __box_group.key }}_panel_{{ __box_tab_side.key }}"
536 tabindex="<# if ( __box_tab_active ) { #>0<# } else { #>-1<# } #>"
537 >
538 <span>{{ __box_tab_side.label }}</span>
539 <span class="wpbc_bfb__column_control_tab_marker" data-column-control-tab-marker aria-hidden="true" <# if ( ! __box_tab_changed ) { #>hidden<# } #>></span>
540 <span class="wpbc_sr_only" data-column-control-tab-changed-text <# if ( ! __box_tab_changed ) { #>hidden<# } #>><?php echo esc_html__( 'Changed', 'booking' ); ?></span>
541 </button>
542 <# } #>
543 </div>
544 <# for ( var __box_panel_index = 0; __box_panel_index < __box_spacing_sides.length; __box_panel_index++ ) {
545 var __box_side = __box_spacing_sides[ __box_panel_index ];
546 var __box_control_key = __box_group.key + '_' + __box_side.key;
547 var __box_control_label = __box_group.label + ' ' + __box_side.label;
548 var __box_control_default = ( 'margin' === __box_group.key && ( 'top' === __box_side.key || 'bottom' === __box_side.key ) ) ? '0.7em' : '0px';
549 var __box_value = String( s[ __box_control_key ] || __box_control_default );
550 var __box_match = __box_value.match( /^(\d+(?:\.\d+)?)(px|rem|em|%)?$/ );
551 var __box_number = __box_match ? __box_match[1] : '0';
552 var __box_unit = ( __box_match && __box_match[2] ) ? __box_match[2] : 'px';
553 var __box_panel_active = __box_active_side === __box_side.key;
554 #>
555 <div class="wpbc_bfb__column_control_panel"
556 id="bfb_col_{{ k }}_{{ __box_group.key }}_panel_{{ __box_side.key }}"
557 data-column-control-tab-panel="{{ __box_side.key }}"
558 role="tabpanel"
559 aria-labelledby="bfb_col_{{ k }}_{{ __box_group.key }}_tab_{{ __box_side.key }}"
560 <# if ( ! __box_panel_active ) { #>hidden<# } #>
561 >
562 <div class="wpbc_len_group" data-len-group="{{ __box_control_key }}">
563 <div class="wpbc_inline_inputs">
564 <input
565 id="bfb_col_{{ k }}_{{ __box_control_key }}"
566 type="number" min="0" step="any" class="inspector__input"
567 data-style-key="{{ __box_control_key }}" data-style-part="value" data-len-value
568 data-col-idx="{{ i }}" value="{{ __box_number }}"
569 aria-label="{{ __box_control_label }}"
570 >
571 <select class="inspector__input"
572 data-style-key="{{ __box_control_key }}" data-style-part="unit" data-len-unit
573 data-col-idx="{{ i }}" aria-label="{{ __box_control_label }}"
574 >
575 <option value="px" <# if ( __box_unit === 'px' ) { #>selected<# } #>>px</option>
576 <option value="rem" <# if ( __box_unit === 'rem' ) { #>selected<# } #>>rem</option>
577 <option value="em" <# if ( __box_unit === 'em' ) { #>selected<# } #>>em</option>
578 <option value="%" <# if ( __box_unit === '%' ) { #>selected<# } #>>%</option>
579 </select>
580 </div>
581 <input type="range" class="inspector__input"
582 data-style-key="{{ __box_control_key }}" data-style-part="value" data-len-range
583 data-col-idx="{{ i }}" aria-label="{{ __box_control_label }}"
584 min="0" max="128" step="1" value="{{ __box_number }}"
585 >
586 </div>
587 <button
588 type="button"
589 class="wpbc_bfb__column_reset_link"
590 data-action="colstyles-reset-keys"
591 data-style-keys="{{ __box_control_key }}"
592 data-col-idx="{{ i }}"
593 >
594 <?php echo esc_html__( 'Reset', 'booking' ); ?>
595 </button>
596 </div>
597 <# } #>
598 </div>
599 <# } #>
600 <div class="inspector__row wpbc_bfb__column_control_section_heading">
601 <h2><?php echo esc_js( __( 'Column Size & Overflow', 'booking' ) ); ?></h2>
602 <button
603 type="button"
604 class="wpbc_bfb__column_help tooltip_left wpbc-bi-question-circle"
605 title="<?php echo esc_attr__( 'Leave a maximum empty for no limit. Width Overflow controls horizontal excess; Height Overflow controls vertical excess. Auto adds a thin scrollbar when needed, while Hidden clips excess content. Visible does not add a scrollbar on that axis. If the other axis uses Auto or Hidden, mixed-axis excess is clipped because browsers cannot combine visible overflow with a perpendicular scroll container.', 'booking' ); ?>"
606 aria-label="<?php echo esc_attr__( 'Column size and overflow help', 'booking' ); ?>"
607 ></button>
608 </div>
609 <#
610 var __maximum_controls = [
611 {
612 tab_key: 'width',
613 tab_label: '<?php echo esc_js( __( 'Width', 'booking' ) ); ?>',
614 key: 'max_width',
615 label: '<?php echo esc_js( __( 'Maximum Width', 'booking' ) ); ?>',
616 overflow_key: 'overflow_x',
617 overflow_label: '<?php echo esc_js( __( 'Width Overflow', 'booking' ) ); ?>'
618 },
619 {
620 tab_key: 'height',
621 tab_label: '<?php echo esc_js( __( 'Height', 'booking' ) ); ?>',
622 key: 'max_height',
623 label: '<?php echo esc_js( __( 'Maximum Height', 'booking' ) ); ?>',
624 overflow_key: 'overflow_y',
625 overflow_label: '<?php echo esc_js( __( 'Height Overflow', 'booking' ) ); ?>'
626 }
627 ];
628 var __size_state_key = k + '_size';
629 var __size_active_tab = ( data.control_tabs && data.control_tabs[ __size_state_key ] ) || 'width';
630 #>
631 <div class="wpbc_bfb__column_control_group" data-column-control-tabs="size" data-column-control-tab-active="{{ __size_active_tab }}" data-col-idx="{{ i }}">
632 <div class="wpbc_bfb__column_control_tablist" role="tablist" aria-label="<?php echo esc_attr__( 'Column Size & Overflow', 'booking' ); ?>">
633 <# for ( var __maximum_tab_index = 0; __maximum_tab_index < __maximum_controls.length; __maximum_tab_index++ ) {
634 var __maximum_tab_control = __maximum_controls[ __maximum_tab_index ];
635 var __maximum_tab_changed = String( s[ __maximum_tab_control.key ] || 'none' ) !== 'none' || String( s[ __maximum_tab_control.overflow_key ] || 'visible' ) !== 'visible';
636 var __maximum_tab_active = __size_active_tab === __maximum_tab_control.tab_key;
637 #>
638 <button type="button"
639 id="bfb_col_{{ k }}_size_tab_{{ __maximum_tab_control.tab_key }}"
640 class="wpbc_bfb__column_control_tab <# if ( __maximum_tab_changed ) { #>is-changed<# } #>"
641 data-column-control-tab-key="{{ __maximum_tab_control.tab_key }}"
642 data-column-control-tab-style-keys="{{ __maximum_tab_control.key }} {{ __maximum_tab_control.overflow_key }}"
643 data-col-idx="{{ i }}"
644 role="tab"
645 aria-selected="<# if ( __maximum_tab_active ) { #>true<# } else { #>false<# } #>"
646 aria-controls="bfb_col_{{ k }}_size_panel_{{ __maximum_tab_control.tab_key }}"
647 tabindex="<# if ( __maximum_tab_active ) { #>0<# } else { #>-1<# } #>"
648 >
649 <span>{{ __maximum_tab_control.tab_label }}</span>
650 <span class="wpbc_bfb__column_control_tab_marker" data-column-control-tab-marker aria-hidden="true" <# if ( ! __maximum_tab_changed ) { #>hidden<# } #>></span>
651 <span class="wpbc_sr_only" data-column-control-tab-changed-text <# if ( ! __maximum_tab_changed ) { #>hidden<# } #>><?php echo esc_html__( 'Changed', 'booking' ); ?></span>
652 </button>
653 <# } #>
654 </div>
655 <#
656 for ( var __maximum_index = 0; __maximum_index < __maximum_controls.length; __maximum_index++ ) {
657 var __maximum_control = __maximum_controls[ __maximum_index ];
658 var __maximum_value = String( s[ __maximum_control.key ] || 'none' );
659 var __maximum_match = __maximum_value.match( /^(\d+(?:\.\d+)?)(px|rem|em|%|vh|vw)?$/ );
660 var __maximum_number = __maximum_match ? __maximum_match[1] : '';
661 var __maximum_unit = ( __maximum_match && __maximum_match[2] ) ? __maximum_match[2] : 'px';
662 var __maximum_panel_active = __size_active_tab === __maximum_control.tab_key;
663 #>
664 <div class="wpbc_bfb__column_control_panel"
665 id="bfb_col_{{ k }}_size_panel_{{ __maximum_control.tab_key }}"
666 data-column-control-tab-panel="{{ __maximum_control.tab_key }}"
667 role="tabpanel"
668 aria-labelledby="bfb_col_{{ k }}_size_tab_{{ __maximum_control.tab_key }}"
669 <# if ( ! __maximum_panel_active ) { #>hidden<# } #>
670 >
671 <div class="inspector__row">
672 <label class="inspector__label inspector__w_100" for="bfb_col_{{ k }}_{{ __maximum_control.key }}">{{ __maximum_control.label }}</label>
673 <div class="wpbc_len_group inspector__w_100" data-len-group="{{ __maximum_control.key }}" data-len-allow-empty>
674 <div class="wpbc_inline_inputs">
675 <input
676 id="bfb_col_{{ k }}_{{ __maximum_control.key }}"
677 type="number" min="0" step="any" class="inspector__input"
678 data-style-key="{{ __maximum_control.key }}" data-style-part="value" data-len-value
679 data-col-idx="{{ i }}" value="{{ __maximum_number }}"
680 placeholder="<?php echo esc_attr__( 'No limit', 'booking' ); ?>"
681 aria-label="{{ __maximum_control.label }}"
682 >
683 <select class="inspector__input"
684 data-style-key="{{ __maximum_control.key }}" data-style-part="unit" data-len-unit
685 data-col-idx="{{ i }}" aria-label="{{ __maximum_control.label }}"
686 >
687 <option value="px" <# if ( __maximum_unit === 'px' ) { #>selected<# } #>>px</option>
688 <option value="rem" <# if ( __maximum_unit === 'rem' ) { #>selected<# } #>>rem</option>
689 <option value="em" <# if ( __maximum_unit === 'em' ) { #>selected<# } #>>em</option>
690 <option value="%" <# if ( __maximum_unit === '%' ) { #>selected<# } #>>%</option>
691 <option value="vh" <# if ( __maximum_unit === 'vh' ) { #>selected<# } #>>vh</option>
692 <option value="vw" <# if ( __maximum_unit === 'vw' ) { #>selected<# } #>>vw</option>
693 </select>
694 </div>
695 <input type="range" class="inspector__input"
696 data-style-key="{{ __maximum_control.key }}" data-style-part="value" data-len-range
697 data-col-idx="{{ i }}" aria-label="{{ __maximum_control.label }}"
698 min="0" max="1600" step="1" value="{{ __maximum_number || '0' }}"
699 >
700 </div>
701 </div>
702 <div class="inspector__row">
703 <label class="inspector__label inspector__w_40" for="bfb_col_{{ k }}_{{ __maximum_control.overflow_key }}">{{ __maximum_control.overflow_label }}</label>
704 <select
705 id="bfb_col_{{ k }}_{{ __maximum_control.overflow_key }}"
706 class="inspector__input inspector__w_55"
707 data-style-key="{{ __maximum_control.overflow_key }}"
708 data-col-idx="{{ i }}"
709 >
710 <option value="visible" <# if ( s[ __maximum_control.overflow_key ] === 'visible' ) { #>selected<# } #>><?php echo esc_html__( 'Visible (default)', 'booking' ); ?></option>
711 <option value="auto" <# if ( s[ __maximum_control.overflow_key ] === 'auto' ) { #>selected<# } #>><?php echo esc_html__( 'Auto', 'booking' ); ?></option>
712 <option value="hidden" <# if ( s[ __maximum_control.overflow_key ] === 'hidden' ) { #>selected<# } #>><?php echo esc_html__( 'Hidden', 'booking' ); ?></option>
713 </select>
714 </div>
715 <div class="wpbc_bfb__column_panel_reset">
716 <button
717 type="button"
718 class="wpbc_bfb__column_reset_link"
719 data-action="colstyles-reset-keys"
720 data-style-keys="{{ __maximum_control.key }} {{ __maximum_control.overflow_key }}"
721 data-col-idx="{{ i }}"
722 >
723 <?php echo esc_html__( 'Reset', 'booking' ); ?>
724 </button>
725 </div>
726 </div>
727 <# } #>
728 </div>
729 </div>
730 <# } #>
731
732 <# if ( active ) { #>
733 <div class="wpbc_tab__panel group__fields">
734 <div class="inspector__row wpbc_bfb__column_reset_all">
735 <div class="inspector__control">
736 <button type="button" class="button button-secondary wpbc_ui_button" data-action="colstyles-reset">
737 <?php echo esc_html__( 'Reset All Column Styles', 'booking' ); ?>
738 </button>
739 </div>
740 </div>
741 </div>
742 <# } #>
743 </div>
744 </script>
745 <?php
746 }
747
748 /**
749 * Palette presets (unchanged).
750 *
751 * @param string $group Palette group slug.
752 * @param string $position Position in palette.
753 */
754 function wpbc_bfb_palette_register_items__section_wptpl( $group, $position ) {
755 if ( 'layout' !== $group || 'top' !== $position ) {
756 return;
757 }
758 for ( $cols = 1; $cols <= 4; $cols ++ ) {
759 $id = 'section-' . $cols . 'col';
760 /* translators: 1: column number. */
761 $label_text = sprintf( _n( '%d Column', '%d Columns', $cols, 'booking' ), $cols );
762 ?>
763 <li class="wpbc_bfb__field"
764 data-id="<?php echo esc_attr( $id ); ?>"
765 data-type="section"
766 data-usage_key="section"
767 data-columns="<?php echo esc_attr( $cols ); ?>"
768 data-label="<?php echo esc_attr( $label_text ); ?>">
769 <?php if ( 1 === $cols ) { ?><i class="menu_icon icon-1x wpbc-bi-square"></i><?php } ?>
770 <?php if ( 2 === $cols ) { ?><i class="menu_icon icon-1x wpbc-bi-layout-split"></i><?php } ?>
771 <?php if ( 3 === $cols ) { ?><i class="menu_icon icon-1x wpbc-bi-layout-three-columns"></i><?php } ?>
772 <?php if ( 4 === $cols ) { ?><i class="menu_icon icon-1x wpbc_icn_calendar_view_week"></i><?php } ?>
773 <span class="wpbc_bfb__field-label"><?php echo esc_html( $label_text ); ?></span>
774 <span class="wpbc_bfb__field-type">section</span>
775 </li>
776 <?php
777 }
778 }
779 add_action( 'wpbc_bfb_palette_register_items', 'wpbc_bfb_palette_register_items__section_wptpl', 10, 2 );
780