Skip to content

Commit 63edea2

Browse files
committed
AUI 0.2.44
1 parent 3414ab7 commit 63edea2

9 files changed

Lines changed: 139 additions & 97 deletions

File tree

vendor/ayecode/wp-ayecode-ui/ayecode-ui-loader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*/
1616
add_action('after_setup_theme', function () {
1717
global $ayecode_ui_version,$ayecode_ui_file_key;
18-
$this_version = "0.2.43";
18+
$this_version = "0.2.44";
1919
if(empty($ayecode_ui_version) || version_compare($this_version , $ayecode_ui_version, '>')){
2020
$ayecode_ui_version = $this_version ;
2121
$ayecode_ui_file_key = wp_hash( __FILE__ );

vendor/ayecode/wp-ayecode-ui/change-log.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
= 0.2.44 - 2026-03-05 =
2+
* BS5 conversion breaks inline padding and margin styles - FIXED
3+
* Checks for the tooltip & popover functions before using to prevent errors - FIXED
4+
* Conditional fields resets hidden input field values - FIXED
5+
16
= 0.2.43 - 2026-01-22 =
27
* Dropdown does not show the option selected if the field value is 0 - FIXED
38

vendor/ayecode/wp-ayecode-ui/example-plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Plugin Name: AyeCode UI
44
Plugin URI: https://ayecode.io/
55
Description: This is an example plugin to test AyeCode UI Quickly.
6-
Version: 0.2.43
6+
Version: 0.2.44
77
Author: AyeCode Ltd
88
Author URI: https://userswp.io
99
License: GPL-2.0+

vendor/ayecode/wp-ayecode-ui/includes/ayecode-ui-settings.php

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class AyeCode_UI_Settings {
3535
*
3636
* @var string
3737
*/
38-
public $version = '0.2.43';
38+
public $version = '0.2.44';
3939

4040
/**
4141
* Class textdomain.
@@ -2655,7 +2655,7 @@ function aui_cf_field_init_rules($) {
26552655
if (!$('[data-has-rule]').length) {
26562656
return;
26572657
}
2658-
$('input.select2-search__field').attr('data-ignore-rule','');
2658+
$('input.select2-search__field,.aui-cf-ignore-rule').attr('data-ignore-rule','');
26592659
$('[data-rule-key]').on('change keypress keyup gdclear', 'input, textarea', function() {
26602660
if (!$(this).hasClass('select2-search__field')) {
26612661
aui_cf_field_apply_rules($(this));
@@ -2884,7 +2884,7 @@ function aui_cf_field_apply_rules($el) {
28842884
* Get the field element.
28852885
*/
28862886
function aui_cf_field_get_element($el) {
2887-
var el = $el.find('input:not("[data-ignore-rule]"),textarea,select'), type = aui_cf_field_get_type($el);
2887+
var el = $el.find('input,textarea,select').not('[data-ignore-rule]'), type = aui_cf_field_get_type($el);
28882888
if (type && window._aui_cf_field_elements && typeof window._aui_cf_field_elements == 'object' && typeof window._aui_cf_field_elements[type] != 'undefined') {
28892889
el = window._aui_cf_field_elements[type];
28902890
}
@@ -2906,19 +2906,19 @@ function aui_cf_field_get_value($el) {
29062906

29072907
if ($el.is(':checkbox')) {
29082908
current_value = '';
2909-
if ($el.parents('[data-rule-key]').find('input:checked').length > 1) {
2910-
$el.parents('[data-rule-key]').find('input:checked').each(function() {
2909+
if ($el.parents('[data-rule-key]').find('input:checked').not('[data-ignore-rule]').length > 1) {
2910+
$el.parents('[data-rule-key]').find('input:checked').not('[data-ignore-rule]').each(function() {
29112911
current_value = current_value + jQuery(this).val() + ' ';
29122912
});
29132913
} else {
2914-
if ($el.parents('[data-rule-key]').find('input:checked').length >= 1) {
2915-
current_value = $el.parents('[data-rule-key]').find('input:checked').val();
2914+
if ($el.parents('[data-rule-key]').find('input:checked').not('[data-ignore-rule]').length >= 1) {
2915+
current_value = $el.parents('[data-rule-key]').find('input:checked').not('[data-ignore-rule]').val();
29162916
}
29172917
}
29182918
}
29192919

29202920
if ($el.is(':radio')) {
2921-
current_value = $el.parents('[data-rule-key]').find('input[type=radio]:checked').val();
2921+
current_value = $el.parents('[data-rule-key]').find('input[type=radio]:checked').not('[data-ignore-rule]').val();
29222922
}
29232923

29242924
return current_value;
@@ -2936,7 +2936,7 @@ function aui_cf_field_get_default_value($el) {
29362936
case 'date':
29372937
case 'textarea':
29382938
case 'select':
2939-
value = $el.find('input:text,input[type="number"],textarea,select').val();
2939+
value = $el.find('input:text,input[type="number"],textarea,select').not('[data-ignore-rule]').val();
29402940
break;
29412941
case 'phone':
29422942
case 'email':
@@ -2945,27 +2945,27 @@ function aui_cf_field_get_default_value($el) {
29452945
case 'hidden':
29462946
case 'password':
29472947
case 'file':
2948-
value = $el.find('input[type="' + type + '"]').val();
2948+
value = $el.find('input[type="' + type + '"]').not('[data-ignore-rule]').val();
29492949
break;
29502950
case 'multiselect':
2951-
value = $el.find('select').val();
2951+
value = $el.find('select').not('[data-ignore-rule]').val();
29522952
break;
29532953
case 'radio':
2954-
if ($el.find('input[type="radio"]:checked').length >= 1) {
2955-
value = $el.find('input[type="radio"]:checked').val();
2954+
if ($el.find('input[type="radio"]:checked').not('[data-ignore-rule]').length >= 1) {
2955+
value = $el.find('input[type="radio"]:checked').not('[data-ignore-rule]').val();
29562956
}
29572957
break;
29582958
case 'checkbox':
2959-
if ($el.find('input[type="checkbox"]:checked').length >= 1) {
2960-
if ($el.find('input[type="checkbox"]:checked').length > 1) {
2959+
if ($el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').length >= 1) {
2960+
if ($el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').length > 1) {
29612961
var values = [];
29622962
values.push(value);
2963-
$el.find('input[type="checkbox"]:checked').each(function() {
2963+
$el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').each(function() {
29642964
values.push(jQuery(this).val());
29652965
});
29662966
value = values;
29672967
} else {
2968-
value = $el.find('input[type="checkbox"]:checked').val();
2968+
value = $el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').val();
29692969
}
29702970
}
29712971
break;
@@ -2998,7 +2998,7 @@ function aui_cf_field_reset_default_value($el, bHide, setVal) {
29982998
case 'number':
29992999
case 'date':
30003000
case 'textarea':
3001-
$el.find('input:text,input[type="number"],textarea').val(setVal);
3001+
$el.find('input:text,input[type="number"],textarea').not('[data-ignore-rule]').val(setVal);
30023002
break;
30033003
case 'phone':
30043004
case 'email':
@@ -3007,45 +3007,47 @@ function aui_cf_field_reset_default_value($el, bHide, setVal) {
30073007
case 'hidden':
30083008
case 'password':
30093009
case 'file':
3010-
$el.find('input[type="' + type + '"]').val(setVal);
3010+
$el.find('input[type="' + type + '"]:not("[data-ignore-rule]")').val(setVal);
30113011
break;
30123012
case 'select':
3013-
$el.find('select').find('option').prop('selected', false);
3014-
$el.find('select').val(setVal);
3015-
$el.find('select').trigger('change');
3013+
var $elSelect = $el.find('select').not('[data-ignore-rule]');
3014+
$elSelect.find('option').prop('selected', false);
3015+
$elSelect.val(setVal);
3016+
$elSelect.trigger('change');
30163017
break;
30173018
case 'multiselect':
3018-
$el.find('select').find('option').prop('selected', false);
3019-
if ((typeof setVal === 'object' || typeof setVal === 'array') && !setVal.length && $el.find('select option:first').text() == '') {
3020-
$el.find('select option:first').remove(); // Clear first option to show placeholder.
3019+
var $elSelect = $el.find('select').not('[data-ignore-rule]');
3020+
$elSelect.find('option').prop('selected', false);
3021+
if ((typeof setVal === 'object' || typeof setVal === 'array') && !setVal.length && $elSelect.find('option:first').text() == '') {
3022+
$elSelect.find('option:first').remove(); // Clear first option to show placeholder.
30213023
}
30223024
if (typeof setVal === 'string') {
3023-
$el.find('select').val(setVal);
3025+
$elSelect.val(setVal);
30243026
} else {
30253027
jQuery.each(setVal, function(i, v) {
3026-
$el.find('select').find('option[value="' + v + '"]').prop('selected', true);
3028+
$elSelect.find('option[value="' + v + '"]').prop('selected', true);
30273029
});
30283030
}
3029-
$el.find('select').trigger('change');
3031+
$elSelect.trigger('change');
30303032
break;
30313033
case 'checkbox':
3032-
if ($el.find('input[type="checkbox"]:checked').length >= 1) {
3033-
$el.find('input[type="checkbox"]:checked').prop('checked', false).removeAttr('checked');
3034+
if ($el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').length >= 1) {
3035+
$el.find('input[type="checkbox"]:checked').not('[data-ignore-rule]').prop('checked', false).removeAttr('checked');
30343036
}
30353037
if (Array.isArray(setVal)) {
30363038
jQuery.each(setVal, function(i, v) {
3037-
$el.find('input[type="checkbox"][value="' + v + '"]').prop('checked', true);
3039+
$el.find('input[type="checkbox"][value="' + v + '"]').not('[data-ignore-rule]').prop('checked', true);
30383040
});
30393041
} else {
3040-
$el.find('input[type="checkbox"][value="' + setVal + '"]').prop('checked', true);
3042+
$el.find('input[type="checkbox"][value="' + setVal + '"]').not('[data-ignore-rule]').prop('checked', true);
30413043
}
30423044
break;
30433045
case 'radio':
30443046
setTimeout(function() {
3045-
if ($el.find('input[type="radio"]:checked').length >= 1) {
3046-
$el.find('input[type="radio"]:checked').prop('checked', false).removeAttr('checked');
3047+
if ($el.find('input[type="radio"]:checked').not('[data-ignore-rule]').length >= 1) {
3048+
$el.find('input[type="radio"]:checked').not('[data-ignore-rule]').prop('checked', false).removeAttr('checked');
30473049
}
3048-
$el.find('input[type="radio"][value="' + setVal + '"]').prop('checked', true);
3050+
$el.find('input[type="radio"][value="' + setVal + '"]').not('[data-ignore-rule]').prop('checked', true);
30493051
}, 100);
30503052
break;
30513053
default:

vendor/ayecode/wp-ayecode-ui/includes/inc/bs-conversion.php

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -34,66 +34,83 @@ function aui_bs_convert_sd_output( $output, $instance = '', $args = '', $sd = ''
3434
'.mr-' => '.me-',
3535
'.pl-' => '.ps-',
3636
'.pr-' => '.pe-',
37-
' form-row' => ' row',
37+
' form-row' => ' row',
3838
' embed-responsive-item' => '',
39-
' embed-responsive' => ' ratio',
40-
'-1by1' => '-1x1',
41-
'-4by3' => '-4x3',
42-
'-16by9' => '-16x9',
43-
'-21by9' => '-21x9',
44-
'geodir-lightbox-image' => 'aui-lightbox-image',
39+
' embed-responsive' => ' ratio',
40+
'-1by1' => '-1x1',
41+
'-4by3' => '-4x3',
42+
'-16by9' => '-16x9',
43+
'-21by9' => '-21x9',
44+
'geodir-lightbox-image' => 'aui-lightbox-image',
4545
'geodir-lightbox-iframe' => 'aui-lightbox-iframe',
46-
' badge-' => ' text-bg-',
47-
'form-group' => 'mb-3',
48-
'custom-select' => 'form-select',
49-
'float-left' => 'float-start',
46+
' badge-' => ' text-bg-',
47+
'form-group' => 'mb-3',
48+
'custom-select' => 'form-select',
49+
'float-left' => 'float-start',
5050
'float-right' => 'float-end',
51-
'text-left' => 'text-start',
52-
'text-sm-left' => 'text-sm-start',
53-
'text-md-left' => 'text-md-start',
54-
'text-lg-left' => 'text-lg-start',
51+
'text-left' => 'text-start',
52+
'text-sm-left' => 'text-sm-start',
53+
'text-md-left' => 'text-md-start',
54+
'text-lg-left' => 'text-lg-start',
5555
'text-right' => 'text-end',
56-
'text-sm-right' => 'text-sm-end',
57-
'text-md-right' => 'text-md-end',
58-
'text-lg-right' => 'text-lg-end',
59-
'border-right' => 'border-end',
60-
'border-left' => 'border-start',
56+
'text-sm-right' => 'text-sm-end',
57+
'text-md-right' => 'text-md-end',
58+
'text-lg-right' => 'text-lg-end',
59+
'border-right' => 'border-end',
60+
'border-left' => 'border-start',
6161
'font-weight-' => 'fw-',
6262
'btn-block' => 'w-100',
6363
'rounded-left' => 'rounded-start',
64-
'rounded-right' => 'rounded-end',
65-
'font-italic' => 'fst-italic',
64+
'rounded-right' => 'rounded-end',
65+
'font-italic' => 'fst-italic',
6666
'"sr-only visually-hidden' => '"visually-hidden',
6767
"'sr-only visually-hidden" => "'visually-hidden",
6868
' sr-only visually-hidden' => ' visually-hidden',
6969
'"sr-only' => '"visually-hidden',
7070
"'sr-only" => "'visually-hidden",
7171
' sr-only' => ' visually-hidden',
72-
'"fa-fw' => '"fa-fw fa-width-fixed', // FA7 compatibility
73-
"'fa-fw" => "'fa-fw fa-width-fixed",
74-
' fa-fw' => ' fa-fw fa-width-fixed',
72+
'"fa-fw' => '"fa-fw fa-width-fixed', // FA7 compatibility
73+
"'fa-fw" => "'fa-fw fa-width-fixed",
74+
' fa-fw' => ' fa-fw fa-width-fixed',
7575
'fa-width-fixed fa-width-fixed' => 'fa-width-fixed',
7676

77-
// 'custom-control custom-checkbox' => 'form-check',
7877
// data
79-
' data-toggle=' => ' data-bs-toggle=',
80-
'data-ride=' => 'data-bs-ride=',
78+
' data-toggle=' => ' data-bs-toggle=',
79+
'data-ride=' => 'data-bs-ride=',
8180
'data-controlnav=' => 'data-bs-controlnav=',
82-
'data-slide=' => 'data-bs-slide=',
83-
'data-slide-to=' => 'data-bs-slide-to=',
84-
'data-target=' => 'data-bs-target=',
81+
'data-slide=' => 'data-bs-slide=',
82+
'data-slide-to=' => 'data-bs-slide-to=',
83+
'data-target=' => 'data-bs-target=',
8584
'data-dismiss="modal"' => 'data-bs-dismiss="modal"',
86-
'class="close"' => 'class="btn-close"',
85+
'class="close"' => 'class="btn-close"',
8786
'<span aria-hidden="true">&times;</span>' => '',
8887
);
88+
8989
$output = str_replace(
9090
array_keys( $convert ),
9191
array_values( $convert ),
9292
$output
9393
);
94+
95+
$revert = array(
96+
'margin-start' => 'margin-left',
97+
'margin-end' => 'margin-right',
98+
'padding-start' => 'padding-left',
99+
'padding-end' => 'padding-right',
100+
'border-start' => 'border-left',
101+
'border-end' => 'border-right',
102+
'float-start' => 'float-left',
103+
'float-end' => 'float-right',
104+
'text-start' => 'text-left',
105+
'text-end' => 'text-right'
106+
);
107+
108+
// Revert the inline style attributes.
109+
$output = preg_replace_callback( '/(<style.*?>.*?<\/style>|style=["\'].*?["\'])/is', function ( $matches ) use ( $revert ) {
110+
return str_replace( array_keys( $revert ), array_values( $revert ), $matches[0] );
111+
}, $output );
94112
}
95113

96114
return $output;
97115
}
98-
99-
add_filter( 'wp_super_duper_widget_output', 'aui_bs_convert_sd_output', 10, 4 ); //$output, $instance, $args, $this
116+
add_filter( 'wp_super_duper_widget_output', 'aui_bs_convert_sd_output', 10, 4 );

vendor/ayecode/wp-ayecode-ui/includes/inc/bs4-js.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -223,14 +223,23 @@ function aui_time_ago(selector) {
223223
* Initiate tooltips on the page.
224224
*/
225225
function aui_init_tooltips(){
226-
jQuery('[data-toggle="tooltip"]').tooltip();
227-
jQuery('[data-toggle="popover"]').popover();
228-
jQuery('[data-toggle="popover-html"]').popover({
229-
html: true
230-
});
226+
if (typeof jQuery.fn.tooltip === 'function') {
227+
jQuery('[data-toggle="tooltip"]').tooltip();
228+
} else {
229+
console.log('jQuery.fn.tooltip not found');
230+
}
231+
232+
if (typeof jQuery.fn.popover === 'function') {
233+
jQuery('[data-toggle="popover"]').popover();
234+
jQuery('[data-toggle="popover-html"]').popover({
235+
html: true
236+
});
237+
} else {
238+
console.log('jQuery.fn.popover not found');
239+
}
231240

232-
// fix popover container compatibility
233-
jQuery('[data-toggle="popover"],[data-toggle="popover-html"]').on('inserted.bs.popover', function () {
241+
// Fix popover container compatibility.
242+
jQuery('[data-toggle="popover"],[data-toggle="popover-html"]').on('inserted.bs.popover', function() {
234243
jQuery('body > .popover').wrapAll("<div class='bsui' />");
235244
});
236245
}

vendor/ayecode/wp-ayecode-ui/includes/inc/bs5-js.php

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -240,15 +240,24 @@ function aui_time_ago(selector) {
240240
* Initiate tooltips on the page.
241241
*/
242242
function aui_init_tooltips(){
243-
jQuery('[data-bs-toggle="tooltip"]').tooltip();
244-
jQuery('[data-bs-toggle="popover"]').popover();
245-
jQuery('[data-bs-toggle="popover-html"]').popover({
246-
html: true,
247-
sanitize: false
248-
});
243+
if (typeof jQuery.fn.tooltip === 'function') {
244+
jQuery('[data-bs-toggle="tooltip"]').tooltip();
245+
} else {
246+
console.log('jQuery.fn.tooltip not found');
247+
}
248+
249+
if (typeof jQuery.fn.popover === 'function') {
250+
jQuery('[data-bs-toggle="popover"]').popover();
251+
jQuery('[data-bs-toggle="popover-html"]').popover({
252+
html: true,
253+
sanitize: false
254+
});
255+
} else {
256+
console.log('jQuery.fn.popover not found');
257+
}
249258

250259
// fix popover container compatibility
251-
jQuery('[data-bs-toggle="popover"],[data-bs-toggle="popover-html"]').on('inserted.bs.popover', function () {
260+
jQuery('[data-bs-toggle="popover"],[data-bs-toggle="popover-html"]').on('inserted.bs.popover', function() {
252261
jQuery('body > .popover').wrapAll("<div class='bsui' />");
253262
});
254263
}

0 commit comments

Comments
 (0)