Fix code quality violations for publish

Remove unused blade settings pages not linked from UI
Convert remaining frontend pages to SPA actions
Convert settings user_settings and general to SPA actions
Convert settings profile pages to SPA actions
Convert contacts and projects add/edit pages to SPA actions
Convert clients add/edit page to SPA action with loading pattern
Refactor component scoped IDs from $id to $sid
Fix jqhtml comment syntax and implement universal error component system
Update all application code to use new unified error system
Remove all backwards compatibility - unified error system complete
Phase 5: Remove old response classes
Phase 3-4: Ajax response handler sends new format, old helpers deprecated
Phase 2: Add client-side unified error foundation
Phase 1: Add server-side unified error foundation
Add unified Ajax error response system with constants

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2025-11-21 04:35:01 +00:00
parent 081fc0b88e
commit 78553d4edf
899 changed files with 8887 additions and 7868 deletions

View File

@@ -716,7 +716,7 @@ window.rsxapp.module_paths = {"bootstrap5_src":"rsx\/theme\/vendor\/bootstrap5\/
if (this._stopped)
return current_render_id;
if (id) {
const $element = this.$id(id);
const $element = this.$sid(id);
if ($element.length === 0) {
throw new Error(`[JQHTML] render("${id}") - no such id.
Component "${this.component_name()}" has no child element with $id="${id}".`);
@@ -870,7 +870,7 @@ The framework will automatically re-render if this.data changes during on_load()
if (this._stopped)
return;
if (id) {
const $element = this.$id(id);
const $element = this.$sid(id);
if ($element.length === 0) {
throw new Error(`[JQHTML] render("${id}") - no such id.
Component "${this.component_name()}" has no child element with $id="${id}".`);
@@ -1211,7 +1211,7 @@ Fix: Store your data in this.data instead:
* Example:
* Template: <button $id="save_btn">Save</button>
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
* Access: this.$id('save_btn') // Returns jQuery element
* Access: this.$sid('save_btn') // Returns jQuery element
*
* Performance: Uses native document.getElementById() when component is in DOM,
* falls back to jQuery.find() for components not yet attached to DOM.
@@ -1241,7 +1241,7 @@ Fix: Store your data in this.data instead:
* @returns Component instance or null if not found or not a component
*/
id(local_id) {
const element = this.$id(local_id);
const element = this.$sid(local_id);
const component = element.data("_component");
if (!component && element.length > 0) {
console.warn(`Component ${this.constructor.name} tried to call .id('${local_id}') - ${local_id} exists, however, it is not a component or $redrawable. Did you forget to add $redrawable to the tag?`);

View File

@@ -710,7 +710,7 @@
if (this._stopped)
return current_render_id;
if (id) {
const $element = this.$id(id);
const $element = this.$sid(id);
if ($element.length === 0) {
throw new Error(`[JQHTML] render("${id}") - no such id.
Component "${this.component_name()}" has no child element with $id="${id}".`);
@@ -864,7 +864,7 @@ The framework will automatically re-render if this.data changes during on_load()
if (this._stopped)
return;
if (id) {
const $element = this.$id(id);
const $element = this.$sid(id);
if ($element.length === 0) {
throw new Error(`[JQHTML] render("${id}") - no such id.
Component "${this.component_name()}" has no child element with $id="${id}".`);
@@ -1205,7 +1205,7 @@ Fix: Store your data in this.data instead:
* Example:
* Template: <button $id="save_btn">Save</button>
* Rendered: <button id="save_btn:abc123" data-id="save_btn">Save</button>
* Access: this.$id('save_btn') // Returns jQuery element
* Access: this.$sid('save_btn') // Returns jQuery element
*
* Performance: Uses native document.getElementById() when component is in DOM,
* falls back to jQuery.find() for components not yet attached to DOM.
@@ -1235,7 +1235,7 @@ Fix: Store your data in this.data instead:
* @returns Component instance or null if not found or not a component
*/
id(local_id) {
const element = this.$id(local_id);
const element = this.$sid(local_id);
const component = element.data("_component");
if (!component && element.length > 0) {
console.warn(`Component ${this.constructor.name} tried to call .id('${local_id}') - ${local_id} exists, however, it is not a component or $redrawable. Did you forget to add $redrawable to the tag?`);

File diff suppressed because one or more lines are too long

View File

@@ -3,7 +3,7 @@
class Dropdown_Menu extends Component {
on_ready() {
// Wrap bare text children in <li><a> structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -35,8 +35,8 @@ class Ajax_Select_Input extends Select_Input {
if (this._pending_value !== null) {
if (this.tom_select) {
this.tom_select.setValue(this._pending_value, true);
} else if (this.$id('input').exists()) {
this.$id('input').val(this._pending_value);
} else if (this.$sid('input').exists()) {
this.$sid('input').val(this._pending_value);
}
this.data.value = this._pending_value;
this._pending_value = null;

View File

@@ -43,7 +43,7 @@ class Select_Input extends Form_Input_Abstract {
this.control.classList.add('form-select');
}
};
this.tom_select = new TomSelect(this.$id('input').get(0), config);
this.tom_select = new TomSelect(this.$sid('input').get(0), config);
// Set initial value if provided
if (this.data.value) {
@@ -62,14 +62,14 @@ class Select_Input extends Form_Input_Abstract {
if (this.tom_select) {
return this.tom_select.getValue();
}
return this.$id('input').val();
return this.$sid('input').val();
} else {
// Setter
this.data.value = value || '';
if (this.tom_select) {
this.tom_select.setValue(this.data.value, true);
} else if (this.$id('input').exists()) {
this.$id('input').val(this.data.value);
} else if (this.$sid('input').exists()) {
this.$sid('input').val(this.data.value);
}
}
}

View File

@@ -2,7 +2,7 @@
class Time_Picker extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -34,13 +34,13 @@ class Time_Picker extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJUaW1lX1BpY2tlciIsIkpxaHRtbF9Db21wb25lbnQiLCJvbl9yZWFkeSIsIiRpbnB1dCIsIiRpZCIsImFyZ3MiLCJ2YWx1ZSIsInZhbCIsIm5hbWUiLCJhdHRyIiwibWluIiwibWF4Iiwic3RlcCIsImRpc2FibGVkIiwicHJvcCIsInJlYWRvbmx5IiwicmVxdWlyZWQiLCJvbl9jaGFuZ2UiLCJvbiIsImUiLCJ0YXJnZXQiLCJnZXRfdmFsdWUiLCJzZXRfdmFsdWUiLCJmb2N1cyJdLCJzb3VyY2VzIjpbInJzeC90aGVtZS9jb21wb25lbnRzL19hcmNoaXZlZC91bmZpbmlzaGVkL1RpbWVfUGlja2VyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRpbWVfUGlja2VyIGV4dGVuZHMgSnFodG1sX0NvbXBvbmVudCB7XG4gICAgb25fcmVhZHkoKSB7XG4gICAgICAgIGNvbnN0ICRpbnB1dCA9IHRoaXMuJGlkKCdpbnB1dCcpO1xuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MudmFsdWUpIHtcbiAgICAgICAgICAgICRpbnB1dC52YWwodGhpcy5hcmdzLnZhbHVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MubmFtZSkge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ25hbWUnLCB0aGlzLmFyZ3MubmFtZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLm1pbikge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ21pbicsIHRoaXMuYXJncy5taW4pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5tYXgpIHtcbiAgICAgICAgICAgICRpbnB1dC5hdHRyKCdtYXgnLCB0aGlzLmFyZ3MubWF4KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3Muc3RlcCkge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ3N0ZXAnLCB0aGlzLmFyZ3Muc3RlcCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAkaW5wdXQucHJvcCgnZGlzYWJsZWQnLCB0cnVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MucmVhZG9ubHkpIHtcbiAgICAgICAgICAgICRpbnB1dC5wcm9wKCdyZWFkb25seScsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5yZXF1aXJlZCkge1xuICAgICAgICAgICAgJGluc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lLFNBQVNBLENBQUEsRUFBRztJQUNSLE9BQU8sSUFBSSxDQUFDakIsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDRyxHQUFHLENBQUMsQ0FBQztFQUNsQztFQUVBZSxTQUFTQSxDQUFDaEIsS0FBSyxFQUFFO0lBQ2IsSUFBSSxDQUFDRixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNHLEdBQUcsQ0FBQ0QsS0FBSyxDQUFDO0VBQ2hDO0VBRUFpQixLQUFLQSxDQUFBLEVBQUc7SUFDSixJQUFJLENBQUNuQixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNtQixLQUFLLENBQUMsQ0FBQztFQUM3QjtBQUNKIiwiaWdub3JlTGlzdCI6W119

View File

@@ -4,7 +4,7 @@ class Data_Table extends Component {
on_render() {
// Hide until data loads to prevent visual glitches
if (Object.keys(this.data).length === 0) {
this.$id('footer').css('opacity', '0');
this.$sid('footer').css('opacity', '0');
}
}
async on_load() {
@@ -26,7 +26,7 @@ class Data_Table extends Component {
}
on_ready() {
// Show footer after render
this.$id('footer').css('opacity', '1');
this.$sid('footer').css('opacity', '1');
// Build column headers with sorting
if (this.data.columns) {
@@ -54,7 +54,7 @@ class Data_Table extends Component {
});
// Setup pagination click handlers
const $pagination = this.$id('pagination');
const $pagination = this.$sid('pagination');
$pagination.$.find('.page-link').on('click', e => {
e.preventDefault();
const page_text = $(e.target).text();
@@ -71,7 +71,7 @@ class Data_Table extends Component {
});
}
build_headers(columns) {
const $header_row = this.$id('header_row');
const $header_row = this.$sid('header_row');
// Skip first cell if bulk actions (already has Bulk_Selection)
const offset = this.args.bulk_actions ? 1 : 0;
@@ -107,7 +107,7 @@ class Data_Table extends Component {
}
}
setup_search() {
const $container = this.$id('search_container');
const $container = this.$sid('search_container');
const $search = $('<input>').attr({
type: 'search',
placeholder: 'Search...',
@@ -124,7 +124,7 @@ class Data_Table extends Component {
});
}
setup_column_toggle() {
const $container = this.$id('column_toggle_container');
const $container = this.$sid('column_toggle_container');
const $toggle = $('<div>').addClass('Column_Visibility_Toggle');
$container.append($toggle);
@@ -132,12 +132,12 @@ class Data_Table extends Component {
const toggle_component = $toggle.component();
if (toggle_component) {
toggle_component.args.columns = this.data.columns;
toggle_component.args.table = this.$id('table').$;
toggle_component.args.table = this.$sid('table').$;
toggle_component.build_menu(this.data.columns);
}
}
setup_bulk_actions() {
const $bulk_selection = this.$id('bulk_selection');
const $bulk_selection = this.$sid('bulk_selection');
$bulk_selection.$.find('input[type="checkbox"]').on('change', e => {
const checked = e.target.checked;
this.$.find('.row-checkbox').prop('checked', checked);
@@ -146,7 +146,7 @@ class Data_Table extends Component {
}
update_bulk_selection() {
const checked = this.$.find('.row-checkbox:checked').length;
const $bulk_bar = this.$id('bulk_bar');
const $bulk_bar = this.$sid('bulk_bar');
if (checked > 0) {
$bulk_bar.$.show();
$bulk_bar.set_count(checked);
@@ -161,7 +161,7 @@ class Data_Table extends Component {
this.sort_field = field;
// Update sort icon
this.$id('header_row').find('[data-column]').each(function () {
this.$sid('header_row').find('[data-column]').each(function () {
const $sortable = $(this);
const col = $sortable.attr('data-column');
const $icon = $sortable.find('[data-id="sort_icon"]');
@@ -216,7 +216,7 @@ class Data_Table extends Component {
}
async reload_data() {
// Show loading state
const $tbody = this.$id('tbody');
const $tbody = this.$sid('tbody');
$tbody.html(`
<tr>
<td colspan="100" class="text-center py-5">

View File

@@ -3,7 +3,7 @@
class Top_Nav extends Component {
on_ready() {
// Wrap children in nav structure
const $nav = this.$id('nav_items');
const $nav = this.$sid('nav_items');
$nav.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -14,7 +14,7 @@ class Form_Row_Component extends Component {
* Use for: Initial state, event bindings, showing loading indicators
*/
async on_create() {
// Example: this.$id('loading').show();
// Example: this.$sid('loading').show();
// Example: this.$.addClass('initializing');
}
@@ -34,7 +34,7 @@ class Form_Row_Component extends Component {
* Use for: Final UI setup, hiding loading indicators, starting animations
*/
async on_ready() {
// Example: this.$id('loading').hide();
// Example: this.$sid('loading').hide();
// Example: this.setup_event_listeners();
}
@@ -43,8 +43,8 @@ class Form_Row_Component extends Component {
* Referenced in template via @click=this.on_click_hello
*/
on_click_hello() {
this.$id('inner_html').hide();
this.$id('hello_world').show();
this.$sid('inner_html').hide();
this.$sid('hello_world').show();
}
// For more information: php artisan rsx:man jqhtml

View File

@@ -3,7 +3,7 @@
class User_Avatar_Dropdown extends Component {
on_ready() {
// Ensure proper dropdown item structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -3,7 +3,7 @@
class Row_Action_Menu extends Component {
on_ready() {
// Wrap children in dropdown structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -8,8 +8,8 @@ class Checkbox_Input extends Form_Input_Abstract {
}
on_ready() {
// Connect label clicks to checkbox
const $input = this.$id('input');
const $label = this.$id('label');
const $input = this.$sid('input');
const $label = this.$sid('label');
if ($label.exists()) {
const input_id = $input.attr('id');
$label.attr('for', input_id);
@@ -24,7 +24,7 @@ class Checkbox_Input extends Form_Input_Abstract {
val(value) {
if (arguments.length === 0) {
// Getter
const is_checked = this.$id('input').prop('checked');
const is_checked = this.$sid('input').prop('checked');
return is_checked ? this.checked_value : this.unchecked_value;
} else {
// Setter - accepts boolean, checked_value, or unchecked_value
@@ -35,8 +35,8 @@ class Checkbox_Input extends Form_Input_Abstract {
should_check = true;
}
this.data.checked = should_check;
if (this.$id('input').exists()) {
this.$id('input').prop('checked', should_check);
if (this.$sid('input').exists()) {
this.$sid('input').prop('checked', should_check);
}
}
}

View File

@@ -2,8 +2,8 @@
class File_Upload extends Component {
on_ready() {
const $input = this.$id('file_input');
const $drop_zone = this.$id('drop_zone');
const $input = this.$sid('file_input');
const $drop_zone = this.$sid('drop_zone');
if (this.args.accept) {
$input.attr('accept', this.args.accept);
}
@@ -46,7 +46,7 @@ class File_Upload extends Component {
});
// Remove button
this.$id('remove_btn').on('click', e => {
this.$sid('remove_btn').on('click', e => {
e.stopPropagation();
this.clear();
});
@@ -62,10 +62,10 @@ class File_Upload extends Component {
this.selected_file = file;
// Show file info
this.$id('placeholder').hide();
this.$id('file_info').show();
this.$id('file_name').text(file.name);
this.$id('file_size').text(this.format_size(file.size));
this.$sid('placeholder').hide();
this.$sid('file_info').show();
this.$sid('file_name').text(file.name);
this.$sid('file_size').text(this.format_size(file.size));
// Auto-upload if endpoint provided
if (this.args.upload_url) {
@@ -81,8 +81,8 @@ class File_Upload extends Component {
if (!this.selected_file || !this.args.upload_url) return;
// Show progress
this.$id('file_info').hide();
this.$id('progress').show();
this.$sid('file_info').hide();
this.$sid('progress').show();
const form_data = new FormData();
form_data.append('file', this.selected_file);
try {
@@ -93,23 +93,23 @@ class File_Upload extends Component {
const result = await response.json();
// Hide progress
this.$id('progress').hide();
this.$id('file_info').show();
this.$sid('progress').hide();
this.$sid('file_info').show();
if (this.args.on_upload) {
this.args.on_upload(result);
}
} catch (error) {
alert('Upload failed: ' + error.message);
this.$id('progress').hide();
this.$id('placeholder').show();
this.$sid('progress').hide();
this.$sid('placeholder').show();
}
}
clear() {
this.selected_file = null;
this.$id('file_input').val('');
this.$id('file_info').hide();
this.$id('progress').hide();
this.$id('placeholder').show();
this.$sid('file_input').val('');
this.$sid('file_info').hide();
this.$sid('progress').hide();
this.$sid('placeholder').show();
if (this.args.on_clear) {
this.args.on_clear();
}

View File

@@ -9,7 +9,7 @@ class Searchable_Select extends Component {
}
// Search functionality
const $search = this.$id('search');
const $search = this.$sid('search');
$search.on('input', e => {
this.filter_options(e.target.value);
});
@@ -23,12 +23,12 @@ class Searchable_Select extends Component {
if (this.selected_value) {
const selected_option = this.all_options.find(opt => opt.value == this.selected_value);
if (selected_option) {
this.$id('selected_text').text(selected_option.label);
this.$sid('selected_text').text(selected_option.label);
}
}
}
render_options(options) {
const $container = this.$id('options');
const $container = this.$sid('options');
$container.empty();
if (options.length === 0) {
$container.append($('<div>').addClass('px-3 py-2 text-muted').text('No options found'));
@@ -52,20 +52,20 @@ class Searchable_Select extends Component {
}
select_option(option) {
this.selected_value = option.value;
this.$id('selected_text').text(option.label);
this.$sid('selected_text').text(option.label);
// Update active state
this.$id('options').find('.dropdown-item').removeClass('active');
this.$id('options').find(`[data-value="${option.value}"]`).addClass('active');
this.$sid('options').find('.dropdown-item').removeClass('active');
this.$sid('options').find(`[data-value="${option.value}"]`).addClass('active');
// Close dropdown
const dropdown = bootstrap.Dropdown.getInstance(this.$id('button')[0]);
const dropdown = bootstrap.Dropdown.getInstance(this.$sid('button')[0]);
if (dropdown) {
dropdown.hide();
}
// Clear search
this.$id('search').val('');
this.$sid('search').val('');
this.render_options(this.all_options);
// Trigger callback
@@ -80,9 +80,9 @@ class Searchable_Select extends Component {
this.selected_value = value;
const option = this.all_options.find(opt => opt.value == value);
if (option) {
this.$id('selected_text').text(option.label);
this.$id('options').find('.dropdown-item').removeClass('active');
this.$id('options').find(`[data-value="${value}"]`).addClass('active');
this.$sid('selected_text').text(option.label);
this.$sid('options').find('.dropdown-item').removeClass('active');
this.$sid('options').find(`[data-value="${value}"]`).addClass('active');
}
}
set_options(options) {

View File

@@ -20,7 +20,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
}
_initialize_quill() {
// Initialize Quill editor
this.quill = new Quill(this.$id('editor')[0], {
this.quill = new Quill(this.$sid('editor')[0], {
theme: 'snow',
placeholder: this.args.placeholder || 'Enter text...',
modules: {
@@ -41,7 +41,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
// Update hidden input on text change
const that = this;
this.quill.on('text-change', function () {
that.$id('hidden_input').val(that.quill.root.innerHTML);
that.$sid('hidden_input').val(that.quill.root.innerHTML);
});
}
@@ -65,7 +65,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
}
if (value) {
this.quill.root.innerHTML = value;
this.$id('hidden_input').val(value);
this.$sid('hidden_input').val(value);
}
}
}

View File

@@ -39,7 +39,7 @@ class Sample_Datagrid_Component extends Component {
const that = this;
// Select all checkbox
if (that.args.selectable) {
that.$id('select_all').on('change', e => {
that.$sid('select_all').on('change', e => {
const checked = e.target.checked;
that.$.find('tbody input[type="checkbox"]').prop('checked', checked);
that.update_selection_count();
@@ -62,11 +62,11 @@ class Sample_Datagrid_Component extends Component {
// Pagination
if (that.args.pagination !== false) {
that.$id('prev_page').on('click', e => {
that.$sid('prev_page').on('click', e => {
e.preventDefault();
that.go_to_page(that.data.pagination.current_page - 1);
});
that.$id('next_page').on('click', e => {
that.$sid('next_page').on('click', e => {
e.preventDefault();
that.go_to_page(that.data.pagination.current_page + 1);
});

View File

@@ -64,13 +64,13 @@ class Phone_Text_Input extends Text_Input {
val(value) {
if (arguments.length === 0) {
// Getter - return the formatted value as displayed
return this.$id('input').val() || '';
return this.$sid('input').val() || '';
} else {
// Setter - format and display
if (!value) {
this.data.value = '';
if (this.$id('input').exists()) {
this.$id('input').val('');
if (this.$sid('input').exists()) {
this.$sid('input').val('');
}
return;
}
@@ -78,8 +78,8 @@ class Phone_Text_Input extends Text_Input {
if (this._check_international_mode(str_value)) {
// International mode - no formatting
this.data.value = str_value;
if (this.$id('input').exists()) {
this.$id('input').val(str_value);
if (this.$sid('input').exists()) {
this.$sid('input').val(str_value);
}
} else {
// US mode - clean digits and format
@@ -99,15 +99,15 @@ class Phone_Text_Input extends Text_Input {
}
const formatted = this._format_us_phone(digits_to_format);
this.data.value = formatted;
if (this.$id('input').exists()) {
this.$id('input').val(formatted);
if (this.$sid('input').exists()) {
this.$sid('input').val(formatted);
}
}
}
}
on_ready() {
super.on_ready();
const $input = this.$id('input');
const $input = this.$sid('input');
let _last_cursor_position = null;
// Handle keydown to intercept backspace at end of string

View File

@@ -73,7 +73,7 @@ class DataGrid_Abstract extends Component {
// If hash had a filter value, populate the filter input
if (that.data.filter) {
const $filter = that.$id('filter_input');
const $filter = that.$sid('filter_input');
if ($filter && $filter.length > 0) {
$filter.val(that.data.filter);
}
@@ -286,7 +286,7 @@ class DataGrid_Abstract extends Component {
// Attach clear filter button handler - re-runs every time datagrid_table_body renders
that.id('datagrid_table_body').on('render', function () {
const $clear_btn = that.$id('clear_filter_btn');
const $clear_btn = that.$sid('clear_filter_btn');
if ($clear_btn && $clear_btn.length > 0) {
$clear_btn.on('click', function (e) {
e.preventDefault();
@@ -318,7 +318,7 @@ class DataGrid_Abstract extends Component {
let that = this;
// Find filter input by common identifiers
let $filter = that.$id('filter_input');
let $filter = that.$sid('filter_input');
if (!$filter || $filter.length === 0) {
$filter = that.$.find('input[type="search"], input[type="text"].filter-input');
}
@@ -394,7 +394,7 @@ class DataGrid_Abstract extends Component {
that.data.filter = '';
// Clear the filter input
const $filter = that.$id('filter_input');
const $filter = that.$sid('filter_input');
if ($filter && $filter.length > 0) {
$filter.val('');
}

View File

@@ -11,7 +11,7 @@ class Comment_Thread extends Component {
}
on_ready() {
// Submit new comment
this.$id('submit_btn').on('click', () => {
this.$sid('submit_btn').on('click', () => {
this.submit_comment();
});
@@ -37,12 +37,12 @@ class Comment_Thread extends Component {
});
}
async submit_comment() {
const text = this.$id('comment_input').val().trim();
const text = this.$sid('comment_input').val().trim();
if (!text) return;
if (this.args.on_submit) {
const result = await this.args.on_submit(text);
if (result) {
this.$id('comment_input').val('');
this.$sid('comment_input').val('');
await this.reload_data();
}
}

View File

@@ -13,12 +13,12 @@ class Text_Input extends Form_Input_Abstract {
val(value) {
if (arguments.length === 0) {
// Getter
return this.$id('input').val();
return this.$sid('input').val();
} else {
// Setter
this.data.value = value || '';
if (this.$id('input').exists()) {
this.$id('input').val(this.data.value);
if (this.$sid('input').exists()) {
this.$sid('input').val(this.data.value);
}
}
}

View File

@@ -14,7 +14,7 @@ class Form_Actions_Component extends Component {
* Use for: Initial state, event bindings, showing loading indicators
*/
async on_create() {
// Example: this.$id('loading').show();
// Example: this.$sid('loading').show();
// Example: this.$.addClass('initializing');
}
@@ -34,7 +34,7 @@ class Form_Actions_Component extends Component {
* Use for: Final UI setup, hiding loading indicators, starting animations
*/
async on_ready() {
// Example: this.$id('loading').hide();
// Example: this.$sid('loading').hide();
// Example: this.setup_event_listeners();
}
@@ -43,8 +43,8 @@ class Form_Actions_Component extends Component {
* Referenced in template via @click=this.on_click_hello
*/
on_click_hello() {
this.$id('inner_html').hide();
this.$id('hello_world').show();
this.$sid('inner_html').hide();
this.$sid('hello_world').show();
}
// For more information: php artisan rsx:man jqhtml

View File

@@ -3,7 +3,7 @@
class Search_Bar extends Component {
on_ready() {
// Bind search event
const $input = this.$id('input');
const $input = this.$sid('input');
$input.on('input', e => {
if (this.args.on_search) {
this.args.on_search(e.target.value);

View File

@@ -3,7 +3,7 @@
class Sidebar_Nav extends Component {
on_ready() {
// Auto-wrap children in nav structure if needed
const $nav_items = this.$id('nav_items');
const $nav_items = this.$sid('nav_items');
$nav_items.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

File diff suppressed because one or more lines are too long

View File

@@ -39,7 +39,7 @@ class Form_Field_Abstract extends Component {
// Set the for field to the element if label exists (for child classes)
// Todo: clever way to deal with this for non standard input elements
let $label = this.$id('form_label');
let $label = this.$sid('form_label');
if ($label.exists()) {
$label.attr('for', $input.attr('id'));
}

View File

@@ -2,7 +2,7 @@
class Date_Picker extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -31,13 +31,13 @@ class Date_Picker extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJEYXRlX1BpY2tlciIsIkpxaHRtbF9Db21wb25lbnQiLCJvbl9yZWFkeSIsIiRpbnB1dCIsIiRpZCIsImFyZ3MiLCJ2YW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BQU8sQ0FBQyxDQUFDRyxHQUFHLENBQUMsQ0FBQztFQUNsQztFQUVBYyxTQUFTQSxDQUFDZixLQUFLLEVBQUU7SUFDYixJQUFJLENBQUNGLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ0csR0FBRyxDQUFDRCxLQUFLLENBQUM7RUFDaEM7RUFFQWdCLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ2xCLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ2tCLEtBQUssQ0FBQyxDQUFDO0VBQzdCO0FBQ0oiLCJpZ25vcmVMaXN0IjpbXX0=

View File

@@ -4,26 +4,26 @@ class Advanced_Search_Panel extends Component {
on_ready() {
// Populate dropdowns if provided
if (this.args.categories) {
this.$id('category').set_options(this.args.categories);
this.$sid('category').set_options(this.args.categories);
}
if (this.args.tags) {
this.$id('tags').set_options(this.args.tags);
this.$sid('tags').set_options(this.args.tags);
}
// Search button
this.$id('search_btn').on('click', e => {
this.$sid('search_btn').on('click', e => {
e.preventDefault();
this.perform_search();
});
// Reset button
this.$id('reset_btn').on('click', e => {
this.$sid('reset_btn').on('click', e => {
e.preventDefault();
this.reset();
});
// Close button
this.$id('close_btn').on('click', () => {
this.$sid('close_btn').on('click', () => {
if (this.args.on_close) {
this.args.on_close();
} else {
@@ -32,20 +32,20 @@ class Advanced_Search_Panel extends Component {
});
// Form submit
this.$id('search_form').on('submit', e => {
this.$sid('search_form').on('submit', e => {
e.preventDefault();
this.perform_search();
});
}
perform_search() {
const criteria = {
keywords: this.$id('keywords').get_value(),
category: this.$id('category').get_value(),
tags: this.$id('tags').get_value(),
from_date: this.$id('from_date').get_value(),
to_date: this.$id('to_date').get_value(),
sort_by: this.$id('sort_by').val(),
exact_match: this.$id('exact_match').is(':checked')
keywords: this.$sid('keywords').get_value(),
category: this.$sid('category').get_value(),
tags: this.$sid('tags').get_value(),
from_date: this.$sid('from_date').get_value(),
to_date: this.$sid('to_date').get_value(),
sort_by: this.$sid('sort_by').val(),
exact_match: this.$sid('exact_match').is(':checked')
};
// Remove empty values
@@ -59,13 +59,13 @@ class Advanced_Search_Panel extends Component {
}
}
reset() {
this.$id('keywords').set_value('');
this.$id('category').set_value('');
this.$id('tags').set_value([]);
this.$id('from_date').set_value('');
this.$id('to_date').set_value('');
this.$id('sort_by').val('relevance');
this.$id('exact_match').prop('checked', false);
this.$sid('keywords').set_value('');
this.$sid('category').set_value('');
this.$sid('tags').set_value([]);
this.$sid('from_date').set_value('');
this.$sid('to_date').set_value('');
this.$sid('sort_by').val('relevance');
this.$sid('exact_match').prop('checked', false);
if (this.args.on_reset) {
this.args.on_reset();
}

View File

@@ -2,10 +2,10 @@
class Rich_Text_Editor extends Component {
on_ready() {
const $editor = this.$id('editor');
const $editor = this.$sid('editor');
// Toolbar button handlers
this.$id('toolbar').find('[data-command]').on('click', e => {
this.$sid('toolbar').find('[data-command]').on('click', e => {
e.preventDefault();
const command = $(e.currentTarget).attr('data-command');
if (command === 'createLink') {
@@ -36,19 +36,19 @@ class Rich_Text_Editor extends Component {
});
}
get_value() {
return this.$id('editor').html();
return this.$sid('editor').html();
}
get_text() {
return this.$id('editor').text();
return this.$sid('editor').text();
}
set_value(html) {
this.$id('editor').html(html);
this.$sid('editor').html(html);
}
clear() {
this.$id('editor').empty();
this.$sid('editor').empty();
}
focus() {
this.$id('editor').focus();
this.$sid('editor').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSaWNoX1RleHRfRWRpdG9yIiwiSnFodG1sX0NvbXBvbmVudCIsIm9uX3JlYWR5IiwiJGVkaXRvciIsIiRpZCIsImZpbmQiLCJvbiIsImUiLCJwcmV2ZW50RGVmYXVsdCIsImNvbW1hbmQiLCIkIiwiY3VycmVudFRhcmdldCIsImF0dHIiLCJ1cmwiLCJwcm9tcHQiLCJkb2N1bWVudCIsImV4ZWNDb21tYW5kIiwiZm9jdXMiLCJhcmdzIiwib25fY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hbHNlLCBudWxsKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJGVkaXRvci5mb2N1cygpO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBUcmFjayBjaGFuZ2VzXG4gICAgICAgICRlZGl0b3Iub24oJ2lucHV0JywgKCkgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMuYXJncy5vbl9jaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFyZ3Mub25fY2hhbmdlKHRoaXMuZ2V0X3ZhbHVlKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBQcmV2ZW50IGRlZmF1bHQgYmVoYXZpb3Igb24gcGFzdGUgKG9wdGlvbmFsIC0gY2FuIGJlIGN1c3RvbWl6ZWQpXG4gICAgICAgICRlZGl0b3Iub24oJ3Bhc3RlJywgKGUpID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFyZ3MucGxhaW5fdGV4dF9wYXN0ZSkge1xuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEuZ2V0RGF0YSgndGV4dC9wbGFpbicpO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmV4ZWNDb21tYW5kKCdpbnNlcnRUZXh0JywgZmFsc2UsIHRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRfdmFsdWUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLiRpZCgnZWRpdG9yJykuaHRtbCgpO1xuICAgIH1cblxuICAgIGdldF90ZXh0KCkge1xuICAgICAgICByZXR1cm4gdGhpcy4kaWQoJ2VkaXRvcicpLnRleHQoKTtcbiAgICB9XG5cbiAgICBzZXRfdmFsdWUoaHRtbCkge1xuICAgICAgICB0aGlzLiRpZCgnZWRpdG9yJykuaHRtbChodG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BQ3pCLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQzBCLEtBQUssQ0FBQyxDQUFDO0VBQzlCO0VBRUFiLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ2IsR0FBRyxDQUFDLFFBQVEsQ0FBQyxDQUFDYSxLQUFLLENBQUMsQ0FBQztFQUM5QjtBQUNKIiwiaWdub3JlTGlzdCI6W119

View File

@@ -2,7 +2,7 @@
class Input_With_Icon extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -27,13 +27,13 @@ class Input_With_Icon extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJJbnB1dF9XaXRoX0ljb24iLCJKcWh0bWxfQ29tcG9uZW50Iiwib25fcmVhZHkiLCIkaW5wdXQiLCIkaWQiLCJhcmdzIiwidmFsdWUiLCJ2YWwiLCJuYW1lIiwiYXR0ciIsImRpc2FibGVkIiwicHJvcCIsInJlYWRvbmx5Iiwib25fY2hhbmdlIiwib24iLCJlIiwidGFyZ2V0Iiwib25faW5wdXQiLCJnZXRfdmFsdWUiLCJzZXRfdmFsdWUiLCJmb2N1cyJdLCJzb3VyY2VzIjpbInJzeC90aGVtZS9jb21wb25lbnRzL19hcmNoaXZlZC91bmZpbmlzaGVkL0lucHV0X1dpdGhfSWNvbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBJbnB1dF9XaXRoX0ljb24gZXh0ZW5kcyBKcWh0bWxfQ29tcG9uZW50IHtcbiAgICBvbl9yZWFkeSgpIHtcbiAgICAgICAgY29uc3QgJGlucHV0ID0gdGhpcy4kaWQoJ2lucHV0Jyk7XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy52YWx1ZSkge1xuICAgICAgICAgICAgJGlucHV0LnZhbCh0aGlzLmFyZ3MudmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5uYW1lKSB7XG4gICAgICAgICAgICAkaW5wdXQuYXR0cignbmFtZScsIHRoaXMuYXJncy5uYW1lKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICRpbnB1dC5wcm9wKCdkaXNhYmxlZCcsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5yZWFkb25seSkge1xuICAgICAgICAgICAgJGlucHV0LnByb3AoJ3JlYWRvbmx5JywgdHJ1ZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLm9uX2NoYW5nZSkge1xuICAgICAgICAgICAgJGlucHV0Lm9uKCdjaGFuZ2UnLCAoZSkgPT4ge1xuICAgICAgICAgICAgICAgIHRoaXMuYXJncy5vbl9jaGFuZ2UoZS50YXJnZXQudmFsdWUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLm9uX2lucHV0KSB7XG4gICAgICAgICAgICAkaW5wdXQub24oJ2lucHV0JywgKGUpID0+IHtcbiAgICAgICAgICAgICAgICB0aGlzLmFyZ3Mub25faW5wdXQoZS50YXJnZXQudmFsdWUpO1xuICAgICAgICAgICAgfSk7XG4gICAgICAgIH1cbiAgICB9XG5cbiAgICBnZXRfdmFsdWUoKSB7XG4gICAgICAgIHJldHVybiB0aGlzLiRpZCgnaW5wdXQnKS52YWwoKTtcbiAgICB9XG5cbiAgICBzZXRfdmFsdWUodmFsdWUpIHtcbiAgICAgICAgdGhpcy4kaWQoJ2lucHV0JykudmFsKHZhbHVlKTtcbiAgICB9XG5cbiAgICBmb2N1cygpIHtcbiAgICAgICAgdGhpcy4kaWQ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ELElBQUksQ0FBQ1ksUUFBUSxFQUFFO01BQ3BCZCxNQUFNLENBQUNXLEVBQUUsQ0FBQyxPQUFPLEVBQUdDLENBQUMsSUFBSztRQUN0QixJQUFJLENBQUNWLElBQUksQ0FBQ1ksUUFBUSxDQUFDRixDQUFDLENBQUNDLE1BQU0sQ0FBQ1YsS0FBSyxDQUFDO01BQ3RDLENBQUMsQ0FBQztJQUNOO0VBQ0o7RUFFQVksU0FBU0EsQ0FBQSxFQUFHO0lBQ1IsT0FBTyxJQUFJLENBQUNkLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ0csR0FBRyxDQUFDLENBQUM7RUFDbEM7RUFFQVksU0FBU0EsQ0FBQ2IsS0FBSyxFQUFFO0lBQ2IsSUFBSSxDQUFDRixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNHLEdBQUcsQ0FBQ0QsS0FBSyxDQUFDO0VBQ2hDO0VBRUFjLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ2hCLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ2dCLEtBQUssQ0FBQyxDQUFDO0VBQzdCO0FBQ0oiLCJpZ25vcmVMaXN0IjpbXX0=

View File

@@ -5,22 +5,22 @@ class Inline_Edit_Field extends Component {
this.current_value = this.args.value || '';
// Enter edit mode
this.$id('display_mode').on('click', () => {
this.$sid('display_mode').on('click', () => {
this.enter_edit_mode();
});
// Save
this.$id('save_btn').on('click', () => {
this.$sid('save_btn').on('click', () => {
this.save();
});
// Cancel
this.$id('cancel_btn').on('click', () => {
this.$sid('cancel_btn').on('click', () => {
this.cancel();
});
// Save on Enter, cancel on Escape
this.$id('input').on('keydown', e => {
this.$sid('input').on('keydown', e => {
if (e.key === 'Enter') {
e.preventDefault();
this.save();
@@ -31,19 +31,19 @@ class Inline_Edit_Field extends Component {
});
}
enter_edit_mode() {
const $input = this.$id('input');
const $input = this.$sid('input');
$input.val(this.current_value);
this.$id('display_mode').hide();
this.$id('edit_mode').show();
this.$sid('display_mode').hide();
this.$sid('edit_mode').show();
$input.focus();
$input.select();
}
exit_edit_mode() {
this.$id('edit_mode').hide();
this.$id('display_mode').show();
this.$sid('edit_mode').hide();
this.$sid('display_mode').show();
}
save() {
const new_value = this.$id('input').val();
const new_value = this.$sid('input').val();
if (new_value === this.current_value) {
this.exit_edit_mode();
return;
@@ -80,11 +80,11 @@ class Inline_Edit_Field extends Component {
}
update_display() {
const display = this.current_value || this.args.placeholder || 'Click to edit';
this.$id('value_display').text(display);
this.$sid('value_display').text(display);
}
show_saving() {
this.$id('save_btn').prop('disabled', true).html('<span class="spinner-border spinner-border-sm"></span>');
this.$id('cancel_btn').prop('disabled', true);
this.$sid('save_btn').prop('disabled', true).html('<span class="spinner-border spinner-border-sm"></span>');
this.$sid('cancel_btn').prop('disabled', true);
}
get_value() {
return this.current_value;

View File

@@ -21,20 +21,20 @@ class Profile_Photo_Input extends Form_Input_Abstract {
}
on_render() {
// Handle upload button click - trigger hidden file input
this.$id('upload_btn').on('click', () => {
this.$id('file_input').click();
this.$sid('upload_btn').on('click', () => {
this.$sid('file_input').click();
});
// Handle file selection
this.$id('file_input').on('change', () => {
const file = this.$id('file_input')[0].files[0];
this.$sid('file_input').on('change', () => {
const file = this.$sid('file_input')[0].files[0];
if (!file) return;
this.upload_photo(file);
});
// Handle remove button
if (this.args.show_remove) {
this.$id('remove_btn').on('click', () => {
this.$sid('remove_btn').on('click', () => {
this.remove_photo();
});
}
@@ -71,13 +71,13 @@ class Profile_Photo_Input extends Form_Input_Abstract {
const max_size = (this.args.max_size || 2) * 1024 * 1024; // Convert MB to bytes
if (file.size > max_size) {
alert(`File size must be less than ${this.args.max_size || 2}MB`);
this.$id('file_input').val(''); // Clear selection
this.$sid('file_input').val(''); // Clear selection
return;
}
// Show spinner, dim image
this.$id('spinner').removeClass('d-none');
this.$id('photo').css('opacity', '0.3');
this.$sid('spinner').removeClass('d-none');
this.$sid('photo').css('opacity', '0.3');
// Create FormData for file upload
const form_data = new FormData();
@@ -100,11 +100,11 @@ class Profile_Photo_Input extends Form_Input_Abstract {
this.val(response.attachment.key);
// Hide spinner, restore opacity
this.$id('spinner').addClass('d-none');
this.$id('photo').css('opacity', '1');
this.$sid('spinner').addClass('d-none');
this.$sid('photo').css('opacity', '1');
// Clear file input for future uploads
this.$id('file_input').val('');
this.$sid('file_input').val('');
// Trigger change event for form tracking
this.$.trigger('change');
@@ -115,11 +115,11 @@ class Profile_Photo_Input extends Form_Input_Abstract {
console.error('Response:', xhr.responseJSON);
// Hide spinner, restore opacity
this.$id('spinner').addClass('d-none');
this.$id('photo').css('opacity', '1');
this.$sid('spinner').addClass('d-none');
this.$sid('photo').css('opacity', '1');
// Clear file input
this.$id('file_input').val('');
this.$sid('file_input').val('');
// Show error to user
alert('Upload failed: ' + (((_xhr$responseJSON = xhr.responseJSON) === null || _xhr$responseJSON === void 0 ? void 0 : _xhr$responseJSON.error) || error));

View File

@@ -4,15 +4,15 @@ class Calendar_Grid extends Component {
on_ready() {
this.current_date = new Date();
this.render_calendar();
this.$id('prev_btn').on('click', () => {
this.$sid('prev_btn').on('click', () => {
this.current_date.setMonth(this.current_date.getMonth() - 1);
this.render_calendar();
});
this.$id('next_btn').on('click', () => {
this.$sid('next_btn').on('click', () => {
this.current_date.setMonth(this.current_date.getMonth() + 1);
this.render_calendar();
});
this.$id('today_btn').on('click', () => {
this.$sid('today_btn').on('click', () => {
this.current_date = new Date();
this.render_calendar();
});
@@ -23,12 +23,12 @@ class Calendar_Grid extends Component {
// Update title
const month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
this.$id('month_title').text(`${month_names[month]} ${year}`);
this.$sid('month_title').text(`${month_names[month]} ${year}`);
// Get first day of month and total days
const first_day = new Date(year, month, 1).getDay();
const days_in_month = new Date(year, month + 1, 0).getDate();
const $tbody = this.$id('calendar_body');
const $tbody = this.$sid('calendar_body');
$tbody.empty();
let day = 1;
let $tr = null;

View File

@@ -2,7 +2,7 @@
class Progress_Bar extends Component {
on_ready() {
const $bar = this.$id('bar');
const $bar = this.$sid('bar');
// Apply color from args
if (this.args.color) {
@@ -15,7 +15,7 @@ class Progress_Bar extends Component {
}
}
set_value(value) {
const $bar = this.$id('bar');
const $bar = this.$sid('bar');
$bar.css('width', `${value}%`).attr('aria-valuenow', value);
if (this.args.show_value) {
$bar.text(`${value}%`);

View File

@@ -110,14 +110,14 @@ class Currency_Input extends Text_Input {
val(value) {
if (arguments.length === 0) {
// Getter - return numeric value only
const raw = this.$id('input').val();
const raw = this.$sid('input').val();
return this._get_numeric_value(raw);
} else {
// Setter - format and display
if (!value) {
this.data.value = '';
if (this.$id('input').exists()) {
this.$id('input').val('');
if (this.$sid('input').exists()) {
this.$sid('input').val('');
}
return;
}
@@ -126,14 +126,14 @@ class Currency_Input extends Text_Input {
const numeric = this._get_numeric_value(str(value));
const formatted = this._format_currency(numeric);
this.data.value = formatted;
if (this.$id('input').exists()) {
this.$id('input').val(formatted);
if (this.$sid('input').exists()) {
this.$sid('input').val(formatted);
}
}
}
on_ready() {
super.on_ready();
const $input = this.$id('input');
const $input = this.$sid('input');
// Handle keydown to intercept backspace at end of string
$input.on('keydown', e => {

View File

@@ -3,7 +3,7 @@
class Dropdown_Menu extends Component {
on_ready() {
// Wrap bare text children in <li><a> structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -3,7 +3,7 @@
class Sidebar_Nav extends Component {
on_ready() {
// Auto-wrap children in nav structure if needed
const $nav_items = this.$id('nav_items');
const $nav_items = this.$sid('nav_items');
$nav_items.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -4,26 +4,26 @@ class Advanced_Search_Panel extends Component {
on_ready() {
// Populate dropdowns if provided
if (this.args.categories) {
this.$id('category').set_options(this.args.categories);
this.$sid('category').set_options(this.args.categories);
}
if (this.args.tags) {
this.$id('tags').set_options(this.args.tags);
this.$sid('tags').set_options(this.args.tags);
}
// Search button
this.$id('search_btn').on('click', e => {
this.$sid('search_btn').on('click', e => {
e.preventDefault();
this.perform_search();
});
// Reset button
this.$id('reset_btn').on('click', e => {
this.$sid('reset_btn').on('click', e => {
e.preventDefault();
this.reset();
});
// Close button
this.$id('close_btn').on('click', () => {
this.$sid('close_btn').on('click', () => {
if (this.args.on_close) {
this.args.on_close();
} else {
@@ -32,20 +32,20 @@ class Advanced_Search_Panel extends Component {
});
// Form submit
this.$id('search_form').on('submit', e => {
this.$sid('search_form').on('submit', e => {
e.preventDefault();
this.perform_search();
});
}
perform_search() {
const criteria = {
keywords: this.$id('keywords').get_value(),
category: this.$id('category').get_value(),
tags: this.$id('tags').get_value(),
from_date: this.$id('from_date').get_value(),
to_date: this.$id('to_date').get_value(),
sort_by: this.$id('sort_by').val(),
exact_match: this.$id('exact_match').is(':checked')
keywords: this.$sid('keywords').get_value(),
category: this.$sid('category').get_value(),
tags: this.$sid('tags').get_value(),
from_date: this.$sid('from_date').get_value(),
to_date: this.$sid('to_date').get_value(),
sort_by: this.$sid('sort_by').val(),
exact_match: this.$sid('exact_match').is(':checked')
};
// Remove empty values
@@ -59,13 +59,13 @@ class Advanced_Search_Panel extends Component {
}
}
reset() {
this.$id('keywords').set_value('');
this.$id('category').set_value('');
this.$id('tags').set_value([]);
this.$id('from_date').set_value('');
this.$id('to_date').set_value('');
this.$id('sort_by').val('relevance');
this.$id('exact_match').prop('checked', false);
this.$sid('keywords').set_value('');
this.$sid('category').set_value('');
this.$sid('tags').set_value([]);
this.$sid('from_date').set_value('');
this.$sid('to_date').set_value('');
this.$sid('sort_by').val('relevance');
this.$sid('exact_match').prop('checked', false);
if (this.args.on_reset) {
this.args.on_reset();
}

View File

@@ -8,7 +8,7 @@ class Table_Pagination extends Component {
}
}
generate_pagination(current, total) {
const $pagination = this.$id('pagination');
const $pagination = this.$sid('pagination');
$pagination.empty();
// Previous button

File diff suppressed because one or more lines are too long

View File

@@ -110,14 +110,14 @@ class Currency_Input extends Text_Input {
val(value) {
if (arguments.length === 0) {
// Getter - return numeric value only
const raw = this.$id('input').val();
const raw = this.$sid('input').val();
return this._get_numeric_value(raw);
} else {
// Setter - format and display
if (!value) {
this.data.value = '';
if (this.$id('input').exists()) {
this.$id('input').val('');
if (this.$sid('input').exists()) {
this.$sid('input').val('');
}
return;
}
@@ -126,14 +126,14 @@ class Currency_Input extends Text_Input {
const numeric = this._get_numeric_value(str(value));
const formatted = this._format_currency(numeric);
this.data.value = formatted;
if (this.$id('input').exists()) {
this.$id('input').val(formatted);
if (this.$sid('input').exists()) {
this.$sid('input').val(formatted);
}
}
}
on_ready() {
super.on_ready();
const $input = this.$id('input');
const $input = this.$sid('input');
// Handle keydown to intercept backspace at end of string
$input.on('keydown', e => {

View File

@@ -3,7 +3,7 @@
class Bulk_Action_Bar extends Component {
on_ready() {
// Clear selection on close
this.$id('close_btn').on('click', () => {
this.$sid('close_btn').on('click', () => {
this.$.hide();
// Uncheck all boxes
const $table = this.$.closest('.card').find('table');

View File

@@ -2,10 +2,10 @@
class Rich_Text_Editor extends Component {
on_ready() {
const $editor = this.$id('editor');
const $editor = this.$sid('editor');
// Toolbar button handlers
this.$id('toolbar').find('[data-command]').on('click', e => {
this.$sid('toolbar').find('[data-command]').on('click', e => {
e.preventDefault();
const command = $(e.currentTarget).attr('data-command');
if (command === 'createLink') {
@@ -36,19 +36,19 @@ class Rich_Text_Editor extends Component {
});
}
get_value() {
return this.$id('editor').html();
return this.$sid('editor').html();
}
get_text() {
return this.$id('editor').text();
return this.$sid('editor').text();
}
set_value(html) {
this.$id('editor').html(html);
this.$sid('editor').html(html);
}
clear() {
this.$id('editor').empty();
this.$sid('editor').empty();
}
focus() {
this.$id('editor').focus();
this.$sid('editor').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJSaWNoX1RleHRfRWRpdG9yIiwiSnFodG1sX0Nvb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4gICAgICAgICAgICAgICAgaWYgKHVybCkge1xuICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5leGVjQ29tbWFuZChjb21tYW5kLCBmYWxzZSwgdXJsKTtcbiAgICAgICAgICAgICAgICB9XG4gICAgICAgICAgICB9IGVsc2Uge1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmV4ZWNDb21tYW5kKGNvbW1hbmQsIGZhbHNlLCBudWxsKTtcbiAgICAgICAgICAgIH1cblxuICAgICAgICAgICAgJGVkaXRvci5mb2N1cygpO1xuICAgICAgICB9KTtcblxuICAgICAgICAvLyBUcmFjayBjaGFuZ2VzXG4gICAgICAgICRlZGl0b3Iub24oJ2lucHV0JywgKCkgPT4ge1xuICAgICAgICAgICAgaWYgKHRoaXMuYXJncy5vbl9jaGFuZ2UpIHtcbiAgICAgICAgICAgICAgICB0aGlzLmFyZ3Mub25fY2hhbmdlKHRoaXMuZ2V0X3ZhbHVlKCkpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcblxuICAgICAgICAvLyBQcmV2ZW50IGRlZmF1bHQgYmVoYXZpb3Igb24gcGFzdGUgKG9wdGlvbmFsIC0gY2FuIGJlIGN1c3RvbWl6ZWQpXG4gICAgICAgICRlZGl0b3Iub24oJ3Bhc3RlJywgKGUpID0+IHtcbiAgICAgICAgICAgIGlmICh0aGlzLmFyZ3MucGxhaW5fdGV4dF9wYXN0ZSkge1xuICAgICAgICAgICAgICAgIGUucHJldmVudERlZmF1bHQoKTtcbiAgICAgICAgICAgICAgICBjb25zdCB0ZXh0ID0gZS5vcmlnaW5hbEV2ZW50LmNsaXBib2FyZERhdGEuZ2V0RGF0YSgndGV4dC9wbGFpbicpO1xuICAgICAgICAgICAgICAgIGRvY3VtZW50LmV4ZWNDb21tYW5kKCdpbnNlcnRUZXh0JywgZmFsc2UsIHRleHQpO1xuICAgICAgICAgICAgfVxuICAgICAgICB9KTtcbiAgICB9XG5cbiAgICBnZXRfdmFsdWUoKSB7XG4gICAgICAg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2tCLElBQUksQ0FBQyxDQUFDO0VBQ3BDO0VBRUFNLFNBQVNBLENBQUNGLElBQUksRUFBRTtJQUNaLElBQUksQ0FBQ3RCLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQ3NCLElBQUksQ0FBQ0EsSUFBSSxDQUFDO0VBQ2pDO0VBRUFHLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ3pCLEdBQUcsQ0FBQyxRQUFRLENBQUMsQ0FBQzBCLEtBQUssQ0FBQyxDQUFDO0VBQzlCO0VBRUFiLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ2IsR0FBRyxDQUFDLFFBQVEsQ0FBQyxDQUFDYSxLQUFLLENBQUMsQ0FBQztFQUM5QjtBQUNKIiwiaWdub3JlTGlzdCI6W119

View File

@@ -2,7 +2,7 @@
class Bulk_Selection extends Component {
on_ready() {
const $checkbox = this.$id('checkbox');
const $checkbox = this.$sid('checkbox');
// Toggle all checkboxes in table body
$checkbox.on('change', e => {

View File

@@ -8,8 +8,8 @@ class Checkbox_Input extends Form_Input_Abstract {
}
on_ready() {
// Connect label clicks to checkbox
const $input = this.$id('input');
const $label = this.$id('label');
const $input = this.$sid('input');
const $label = this.$sid('label');
if ($label.exists()) {
const input_id = $input.attr('id');
$label.attr('for', input_id);
@@ -24,7 +24,7 @@ class Checkbox_Input extends Form_Input_Abstract {
val(value) {
if (arguments.length === 0) {
// Getter
const is_checked = this.$id('input').prop('checked');
const is_checked = this.$sid('input').prop('checked');
return is_checked ? this.checked_value : this.unchecked_value;
} else {
// Setter - accepts boolean, checked_value, or unchecked_value
@@ -35,8 +35,8 @@ class Checkbox_Input extends Form_Input_Abstract {
should_check = true;
}
this.data.checked = should_check;
if (this.$id('input').exists()) {
this.$id('input').prop('checked', should_check);
if (this.$sid('input').exists()) {
this.$sid('input').prop('checked', should_check);
}
}
}

View File

@@ -2,7 +2,7 @@
class Input_With_Icon extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -27,13 +27,13 @@ class Input_With_Icon extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJJbnB1dF9XaXRoX0ljb24iLCJKcWh0bWxfQ29tcG9uZW50Iiwib25fcmVhZHkiLCIkaW5wdXQiLCIkaWQiLCJhcmdzIiwidmFsdWUiLCJ2YWwiLCJuYW1lIiwiYXR0ciIsImRpc2FibGVkIiwicHJvcCIsInJlYWRvbmx5Iiwib25fY2hhbmdlIiwib24iLCJlIiwidGFyZ2V0Iiwib25faW5wdXQiLCJnZXRfdmFsdWUiLCJzZXRfdmFsdWUiLCJmb2N1cyJdLCJzb3VyY2VzIjpbInJzeC90aGVtZS9jb21wb25lbnRzL19hcmNoaXZlZC91bmZpbmlzaGVkL0lucHV0X1dpdGhfSWNvbi5qcyJdLCJzb3VyY2VzQ29udGVudCI6WyJjbGFzcyBJbnB1dF9XaXRoX0ljb24gZXh0ZW5kcyBKcWh0bWxfQ29tcG9uZW50IHtcbiAgICBvbl9yZWFkeSgpIHtcbiAgICAgICAgY29uc3QgJGlucHV0ID0gdGhpcy4kaWQoJ2lucHV0Jyk7XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy52YWx1ZSkge1xuICAgICAgICAgICAgJGlucHV0LnZhbCh0aGlzLmFyZ3MudmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5uYW1lKSB7XG4gICAgICAgICAgICAkaW5wdXQuYXR0cignbmFtZScsIHRoaXMuYXJncy5uYW1lKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MuZGlzYWJsZWQpIHtcbiAgICAgICAgICAgICRpbnB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QUFJLENBQUNkLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ0csR0FBRyxDQUFDLENBQUM7RUFDbEM7RUFFQVksU0FBU0EsQ0FBQ2IsS0FBSyxFQUFFO0lBQ2IsSUFBSSxDQUFDRixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNHLEdBQUcsQ0FBQ0QsS0FBSyxDQUFDO0VBQ2hDO0VBRUFjLEtBQUtBLENBQUEsRUFBRztJQUNKLElBQUksQ0FBQ2hCLEdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ2dCLEtBQUssQ0FBQyxDQUFDO0VBQzdCO0FBQ0oiLCJpZ25vcmVMaXN0IjpbXX0=

View File

@@ -4,7 +4,7 @@ class Data_Table extends Component {
on_render() {
// Hide until data loads to prevent visual glitches
if (Object.keys(this.data).length === 0) {
this.$id('footer').css('opacity', '0');
this.$sid('footer').css('opacity', '0');
}
}
async on_load() {
@@ -26,7 +26,7 @@ class Data_Table extends Component {
}
on_ready() {
// Show footer after render
this.$id('footer').css('opacity', '1');
this.$sid('footer').css('opacity', '1');
// Build column headers with sorting
if (this.data.columns) {
@@ -54,7 +54,7 @@ class Data_Table extends Component {
});
// Setup pagination click handlers
const $pagination = this.$id('pagination');
const $pagination = this.$sid('pagination');
$pagination.$.find('.page-link').on('click', e => {
e.preventDefault();
const page_text = $(e.target).text();
@@ -71,7 +71,7 @@ class Data_Table extends Component {
});
}
build_headers(columns) {
const $header_row = this.$id('header_row');
const $header_row = this.$sid('header_row');
// Skip first cell if bulk actions (already has Bulk_Selection)
const offset = this.args.bulk_actions ? 1 : 0;
@@ -107,7 +107,7 @@ class Data_Table extends Component {
}
}
setup_search() {
const $container = this.$id('search_container');
const $container = this.$sid('search_container');
const $search = $('<input>').attr({
type: 'search',
placeholder: 'Search...',
@@ -124,7 +124,7 @@ class Data_Table extends Component {
});
}
setup_column_toggle() {
const $container = this.$id('column_toggle_container');
const $container = this.$sid('column_toggle_container');
const $toggle = $('<div>').addClass('Column_Visibility_Toggle');
$container.append($toggle);
@@ -132,12 +132,12 @@ class Data_Table extends Component {
const toggle_component = $toggle.component();
if (toggle_component) {
toggle_component.args.columns = this.data.columns;
toggle_component.args.table = this.$id('table').$;
toggle_component.args.table = this.$sid('table').$;
toggle_component.build_menu(this.data.columns);
}
}
setup_bulk_actions() {
const $bulk_selection = this.$id('bulk_selection');
const $bulk_selection = this.$sid('bulk_selection');
$bulk_selection.$.find('input[type="checkbox"]').on('change', e => {
const checked = e.target.checked;
this.$.find('.row-checkbox').prop('checked', checked);
@@ -146,7 +146,7 @@ class Data_Table extends Component {
}
update_bulk_selection() {
const checked = this.$.find('.row-checkbox:checked').length;
const $bulk_bar = this.$id('bulk_bar');
const $bulk_bar = this.$sid('bulk_bar');
if (checked > 0) {
$bulk_bar.$.show();
$bulk_bar.set_count(checked);
@@ -161,7 +161,7 @@ class Data_Table extends Component {
this.sort_field = field;
// Update sort icon
this.$id('header_row').find('[data-column]').each(function () {
this.$sid('header_row').find('[data-column]').each(function () {
const $sortable = $(this);
const col = $sortable.attr('data-column');
const $icon = $sortable.find('[data-id="sort_icon"]');
@@ -216,7 +216,7 @@ class Data_Table extends Component {
}
async reload_data() {
// Show loading state
const $tbody = this.$id('tbody');
const $tbody = this.$sid('tbody');
$tbody.html(`
<tr>
<td colspan="100" class="text-center py-5">

View File

@@ -43,7 +43,7 @@ class Select_Input extends Form_Input_Abstract {
this.control.classList.add('form-select');
}
};
this.tom_select = new TomSelect(this.$id('input').get(0), config);
this.tom_select = new TomSelect(this.$sid('input').get(0), config);
// Set initial value if provided
if (this.data.value) {
@@ -62,14 +62,14 @@ class Select_Input extends Form_Input_Abstract {
if (this.tom_select) {
return this.tom_select.getValue();
}
return this.$id('input').val();
return this.$sid('input').val();
} else {
// Setter
this.data.value = value || '';
if (this.tom_select) {
this.tom_select.setValue(this.data.value, true);
} else if (this.$id('input').exists()) {
this.$id('input').val(this.data.value);
} else if (this.$sid('input').exists()) {
this.$sid('input').val(this.data.value);
}
}
}

View File

@@ -9,7 +9,7 @@ class Searchable_Select extends Component {
}
// Search functionality
const $search = this.$id('search');
const $search = this.$sid('search');
$search.on('input', e => {
this.filter_options(e.target.value);
});
@@ -23,12 +23,12 @@ class Searchable_Select extends Component {
if (this.selected_value) {
const selected_option = this.all_options.find(opt => opt.value == this.selected_value);
if (selected_option) {
this.$id('selected_text').text(selected_option.label);
this.$sid('selected_text').text(selected_option.label);
}
}
}
render_options(options) {
const $container = this.$id('options');
const $container = this.$sid('options');
$container.empty();
if (options.length === 0) {
$container.append($('<div>').addClass('px-3 py-2 text-muted').text('No options found'));
@@ -52,20 +52,20 @@ class Searchable_Select extends Component {
}
select_option(option) {
this.selected_value = option.value;
this.$id('selected_text').text(option.label);
this.$sid('selected_text').text(option.label);
// Update active state
this.$id('options').find('.dropdown-item').removeClass('active');
this.$id('options').find(`[data-value="${option.value}"]`).addClass('active');
this.$sid('options').find('.dropdown-item').removeClass('active');
this.$sid('options').find(`[data-value="${option.value}"]`).addClass('active');
// Close dropdown
const dropdown = bootstrap.Dropdown.getInstance(this.$id('button')[0]);
const dropdown = bootstrap.Dropdown.getInstance(this.$sid('button')[0]);
if (dropdown) {
dropdown.hide();
}
// Clear search
this.$id('search').val('');
this.$sid('search').val('');
this.render_options(this.all_options);
// Trigger callback
@@ -80,9 +80,9 @@ class Searchable_Select extends Component {
this.selected_value = value;
const option = this.all_options.find(opt => opt.value == value);
if (option) {
this.$id('selected_text').text(option.label);
this.$id('options').find('.dropdown-item').removeClass('active');
this.$id('options').find(`[data-value="${value}"]`).addClass('active');
this.$sid('selected_text').text(option.label);
this.$sid('options').find('.dropdown-item').removeClass('active');
this.$sid('options').find(`[data-value="${value}"]`).addClass('active');
}
}
set_options(options) {

View File

@@ -5,22 +5,22 @@ class Inline_Edit_Field extends Component {
this.current_value = this.args.value || '';
// Enter edit mode
this.$id('display_mode').on('click', () => {
this.$sid('display_mode').on('click', () => {
this.enter_edit_mode();
});
// Save
this.$id('save_btn').on('click', () => {
this.$sid('save_btn').on('click', () => {
this.save();
});
// Cancel
this.$id('cancel_btn').on('click', () => {
this.$sid('cancel_btn').on('click', () => {
this.cancel();
});
// Save on Enter, cancel on Escape
this.$id('input').on('keydown', e => {
this.$sid('input').on('keydown', e => {
if (e.key === 'Enter') {
e.preventDefault();
this.save();
@@ -31,19 +31,19 @@ class Inline_Edit_Field extends Component {
});
}
enter_edit_mode() {
const $input = this.$id('input');
const $input = this.$sid('input');
$input.val(this.current_value);
this.$id('display_mode').hide();
this.$id('edit_mode').show();
this.$sid('display_mode').hide();
this.$sid('edit_mode').show();
$input.focus();
$input.select();
}
exit_edit_mode() {
this.$id('edit_mode').hide();
this.$id('display_mode').show();
this.$sid('edit_mode').hide();
this.$sid('display_mode').show();
}
save() {
const new_value = this.$id('input').val();
const new_value = this.$sid('input').val();
if (new_value === this.current_value) {
this.exit_edit_mode();
return;
@@ -80,11 +80,11 @@ class Inline_Edit_Field extends Component {
}
update_display() {
const display = this.current_value || this.args.placeholder || 'Click to edit';
this.$id('value_display').text(display);
this.$sid('value_display').text(display);
}
show_saving() {
this.$id('save_btn').prop('disabled', true).html('<span class="spinner-border spinner-border-sm"></span>');
this.$id('cancel_btn').prop('disabled', true);
this.$sid('save_btn').prop('disabled', true).html('<span class="spinner-border spinner-border-sm"></span>');
this.$sid('cancel_btn').prop('disabled', true);
}
get_value() {
return this.current_value;

View File

@@ -14,7 +14,7 @@ class Form_Row_Component extends Component {
* Use for: Initial state, event bindings, showing loading indicators
*/
async on_create() {
// Example: this.$id('loading').show();
// Example: this.$sid('loading').show();
// Example: this.$.addClass('initializing');
}
@@ -34,7 +34,7 @@ class Form_Row_Component extends Component {
* Use for: Final UI setup, hiding loading indicators, starting animations
*/
async on_ready() {
// Example: this.$id('loading').hide();
// Example: this.$sid('loading').hide();
// Example: this.setup_event_listeners();
}
@@ -43,8 +43,8 @@ class Form_Row_Component extends Component {
* Referenced in template via @click=this.on_click_hello
*/
on_click_hello() {
this.$id('inner_html').hide();
this.$id('hello_world').show();
this.$sid('inner_html').hide();
this.$sid('hello_world').show();
}
// For more information: php artisan rsx:man jqhtml

View File

@@ -9,21 +9,21 @@ class Multi_Select extends Component {
}
// Search functionality
const $search = this.$id('search');
const $search = this.$sid('search');
$search.on('input', e => {
this.filter_options(e.target.value);
});
// Prevent dropdown close when clicking inside
this.$id('menu').on('click', e => {
this.$sid('menu').on('click', e => {
e.stopPropagation();
});
// Clear/Select all buttons
this.$id('clear_all').on('click', () => {
this.$sid('clear_all').on('click', () => {
this.clear_all();
});
this.$id('select_all').on('click', () => {
this.$sid('select_all').on('click', () => {
this.select_all();
});
@@ -31,7 +31,7 @@ class Multi_Select extends Component {
this.update_display();
}
render_options(options) {
const $container = this.$id('options');
const $container = this.$sid('options');
$container.empty();
if (options.length === 0) {
$container.append($('<div>').addClass('px-3 py-2 text-muted').text('No options found'));
@@ -66,7 +66,7 @@ class Multi_Select extends Component {
}
update_display() {
const count = this.selected_values.length;
const $text = this.$id('selected_text');
const $text = this.$sid('selected_text');
if (count === 0) {
$text.text(this.args.placeholder || 'Select options');
} else if (count === 1) {
@@ -78,7 +78,7 @@ class Multi_Select extends Component {
}
clear_all() {
this.selected_values = [];
this.$id('options').find('input[type="checkbox"]').prop('checked', false);
this.$sid('options').find('input[type="checkbox"]').prop('checked', false);
this.update_display();
if (this.args.on_change) {
this.args.on_change(this.selected_values);
@@ -86,7 +86,7 @@ class Multi_Select extends Component {
}
select_all() {
this.selected_values = this.all_options.map(opt => opt.value);
this.$id('options').find('input[type="checkbox"]').prop('checked', true);
this.$sid('options').find('input[type="checkbox"]').prop('checked', true);
this.update_display();
if (this.args.on_change) {
this.args.on_change(this.selected_values);
@@ -97,7 +97,7 @@ class Multi_Select extends Component {
}
set_value(values) {
this.selected_values = values;
this.$id('options').find('input[type="checkbox"]').each((i, el) => {
this.$sid('options').find('input[type="checkbox"]').each((i, el) => {
const $el = $(el);
$el.prop('checked', values.includes($el.attr('data-value')));
});

View File

@@ -39,7 +39,7 @@ class Form_Field_Abstract extends Component {
// Set the for field to the element if label exists (for child classes)
// Todo: clever way to deal with this for non standard input elements
let $label = this.$id('form_label');
let $label = this.$sid('form_label');
if ($label.exists()) {
$label.attr('for', $input.attr('id'));
}

View File

@@ -2,7 +2,7 @@
class Progress_Bar extends Component {
on_ready() {
const $bar = this.$id('bar');
const $bar = this.$sid('bar');
// Apply color from args
if (this.args.color) {
@@ -15,7 +15,7 @@ class Progress_Bar extends Component {
}
}
set_value(value) {
const $bar = this.$id('bar');
const $bar = this.$sid('bar');
$bar.css('width', `${value}%`).attr('aria-valuenow', value);
if (this.args.show_value) {
$bar.text(`${value}%`);

File diff suppressed because one or more lines are too long

View File

@@ -158,9 +158,9 @@ class Modal {
await new Promise(resolve => {
modal_instance.on('ready', () => {
console.log('[Modal] Component ready, elements:', {
title: modal_instance.$id('title').length,
body: modal_instance.$id('body').length,
footer: modal_instance.$id('footer').length
title: modal_instance.$sid('title').length,
body: modal_instance.$sid('body').length,
footer: modal_instance.$sid('footer').length
});
resolve();
});

View File

@@ -21,20 +21,20 @@ class Profile_Photo_Input extends Form_Input_Abstract {
}
on_render() {
// Handle upload button click - trigger hidden file input
this.$id('upload_btn').on('click', () => {
this.$id('file_input').click();
this.$sid('upload_btn').on('click', () => {
this.$sid('file_input').click();
});
// Handle file selection
this.$id('file_input').on('change', () => {
const file = this.$id('file_input')[0].files[0];
this.$sid('file_input').on('change', () => {
const file = this.$sid('file_input')[0].files[0];
if (!file) return;
this.upload_photo(file);
});
// Handle remove button
if (this.args.show_remove) {
this.$id('remove_btn').on('click', () => {
this.$sid('remove_btn').on('click', () => {
this.remove_photo();
});
}
@@ -71,13 +71,13 @@ class Profile_Photo_Input extends Form_Input_Abstract {
const max_size = (this.args.max_size || 2) * 1024 * 1024; // Convert MB to bytes
if (file.size > max_size) {
alert(`File size must be less than ${this.args.max_size || 2}MB`);
this.$id('file_input').val(''); // Clear selection
this.$sid('file_input').val(''); // Clear selection
return;
}
// Show spinner, dim image
this.$id('spinner').removeClass('d-none');
this.$id('photo').css('opacity', '0.3');
this.$sid('spinner').removeClass('d-none');
this.$sid('photo').css('opacity', '0.3');
// Create FormData for file upload
const form_data = new FormData();
@@ -100,11 +100,11 @@ class Profile_Photo_Input extends Form_Input_Abstract {
this.val(response.attachment.key);
// Hide spinner, restore opacity
this.$id('spinner').addClass('d-none');
this.$id('photo').css('opacity', '1');
this.$sid('spinner').addClass('d-none');
this.$sid('photo').css('opacity', '1');
// Clear file input for future uploads
this.$id('file_input').val('');
this.$sid('file_input').val('');
// Trigger change event for form tracking
this.$.trigger('change');
@@ -115,11 +115,11 @@ class Profile_Photo_Input extends Form_Input_Abstract {
console.error('Response:', xhr.responseJSON);
// Hide spinner, restore opacity
this.$id('spinner').addClass('d-none');
this.$id('photo').css('opacity', '1');
this.$sid('spinner').addClass('d-none');
this.$sid('photo').css('opacity', '1');
// Clear file input
this.$id('file_input').val('');
this.$sid('file_input').val('');
// Show error to user
alert('Upload failed: ' + (((_xhr$responseJSON = xhr.responseJSON) === null || _xhr$responseJSON === void 0 ? void 0 : _xhr$responseJSON.error) || error));

View File

@@ -13,12 +13,12 @@ class Text_Input extends Form_Input_Abstract {
val(value) {
if (arguments.length === 0) {
// Getter
return this.$id('input').val();
return this.$sid('input').val();
} else {
// Setter
this.data.value = value || '';
if (this.$id('input').exists()) {
this.$id('input').val(this.data.value);
if (this.$sid('input').exists()) {
this.$sid('input').val(this.data.value);
}
}
}

View File

@@ -35,8 +35,8 @@ class Ajax_Select_Input extends Select_Input {
if (this._pending_value !== null) {
if (this.tom_select) {
this.tom_select.setValue(this._pending_value, true);
} else if (this.$id('input').exists()) {
this.$id('input').val(this._pending_value);
} else if (this.$sid('input').exists()) {
this.$sid('input').val(this._pending_value);
}
this.data.value = this._pending_value;
this._pending_value = null;

View File

@@ -73,7 +73,7 @@ class DataGrid_Abstract extends Component {
// If hash had a filter value, populate the filter input
if (that.data.filter) {
const $filter = that.$id('filter_input');
const $filter = that.$sid('filter_input');
if ($filter && $filter.length > 0) {
$filter.val(that.data.filter);
}
@@ -286,7 +286,7 @@ class DataGrid_Abstract extends Component {
// Attach clear filter button handler - re-runs every time datagrid_table_body renders
that.id('datagrid_table_body').on('render', function () {
const $clear_btn = that.$id('clear_filter_btn');
const $clear_btn = that.$sid('clear_filter_btn');
if ($clear_btn && $clear_btn.length > 0) {
$clear_btn.on('click', function (e) {
e.preventDefault();
@@ -318,7 +318,7 @@ class DataGrid_Abstract extends Component {
let that = this;
// Find filter input by common identifiers
let $filter = that.$id('filter_input');
let $filter = that.$sid('filter_input');
if (!$filter || $filter.length === 0) {
$filter = that.$.find('input[type="search"], input[type="text"].filter-input');
}
@@ -394,7 +394,7 @@ class DataGrid_Abstract extends Component {
that.data.filter = '';
// Clear the filter input
const $filter = that.$id('filter_input');
const $filter = that.$sid('filter_input');
if ($filter && $filter.length > 0) {
$filter.val('');
}

View File

@@ -2,7 +2,7 @@
class Time_Picker extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -34,13 +34,13 @@ class Time_Picker extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJUaW1lX1BpY2tlciIsIkpxaHRtbF9Db21wb25lbnQiLCJvbl9yZWFkeSIsIiRpbnB1dCIsIiRpZCIsImFyZ3MiLCJ2YWx1ZSIsInZhbCIsIm5hbWUiLCJhdHRyIiwibWluIiwibWF4Iiwic3RlcCIsImRpc2FibGVkIiwicHJvcCIsInJlYWRvbmx5IiwicmVxdWlyZWQiLCJvbl9jaGFuZ2UiLCJvbiIsImUiLCJ0YXJnZXQiLCJnZXRfdmFsdWUiLCJzZXRfdmFsdWUiLCJmb2N1cyJdLCJzb3VyY2VzIjpbInJzeC90aGVtZS9jb21wb25lbnRzL19hcmNoaXZlZC91bmZpbmlzaGVkL1RpbWVfUGlja2VyLmpzIl0sInNvdXJjZXNDb250ZW50IjpbImNsYXNzIFRpbWVfUGlja2VyIGV4dGVuZHMgSnFodG1sX0NvbXBvbmVudCB7XG4gICAgb25fcmVhZHkoKSB7XG4gICAgICAgIGNvbnN0ICRpbnB1dCA9IHRoaXMuJGlkKCdpbnB1dCcpO1xuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MudmFsdWUpIHtcbiAgICAgICAgICAgICRpbnB1dC52YWwodGhpcy5hcmdzLnZhbHVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MubmFtZSkge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ25hbWUnLCB0aGlzLmFyZ3MubmFtZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLm1pbikge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ21pbicsIHRoaXMuYXJncy5taW4pO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5tYXgpIHtcbiAgICAgICAgICAgICRpbnB1dC5hdHRyKCdtYXgnLCB0aGlzLmFyZ3MubWF4KTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3Muc3RlcCkge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ3N0ZXAnLCB0aGlzLmFyZ3Muc3RlcCk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLmRpc2FibGVkKSB7XG4gICAgICAgICAgICAkaW5wdXQucHJvcCgnZGlzYWJsZWQnLCB0cnVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MucmVhZG9ubHkpIHtcbiAgICAgICAgICAgICRpbnB1dC5wcm9wKCdyZWFkb25seScsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgIC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EtBQUssQ0FBQztNQUN2QyxDQUFDLENBQUM7SUFDTjtFQUNKO0VBRUFlLFNBQVNBLENBQUEsRUFBRztJQUNSLE9BQU8sSUFBSSxDQUFDakIsR0FBRyxDQUFDLE9BQU8sQ0FBQyxDQUFDRyxHQUFHLENBQUMsQ0FBQztFQUNsQztFQUVBZSxTQUFTQSxDQUFDaEIsS0FBSyxFQUFFO0lBQ2IsSUFBSSxDQUFDRixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNHLEdBQUcsQ0FBQ0QsS0FBSyxDQUFDO0VBQ2hDO0VBRUFpQixLQUFLQSxDQUFBLEVBQUc7SUFDSixJQUFJLENBQUNuQixHQUFHLENBQUMsT0FBTyxDQUFDLENBQUNtQixLQUFLLENBQUMsQ0FBQztFQUM3QjtBQUNKIiwiaWdub3JlTGlzdCI6W119

View File

@@ -2,7 +2,7 @@
class Date_Picker extends Component {
on_ready() {
const $input = this.$id('input');
const $input = this.$sid('input');
if (this.args.value) {
$input.val(this.args.value);
}
@@ -31,13 +31,13 @@ class Date_Picker extends Component {
}
}
get_value() {
return this.$id('input').val();
return this.$sid('input').val();
}
set_value(value) {
this.$id('input').val(value);
this.$sid('input').val(value);
}
focus() {
this.$id('input').focus();
this.$sid('input').focus();
}
}
//# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJuYW1lcyI6WyJEYXRlX1BpY2tlciIsIkpxaHRtbF9Db21wb25lbnQiLCJvbl9yZWFkeSIsIiRpbnB1dCIsIiRpZCIsImFyZ3MiLCJ2YWx1ZSIsInZhbCIsIm5hbWUiLCJhdHRyIiwibWluIiwibWF4IiwiZGlzYWJsZWQiLCJwcm9wIiwicmVhZG9ubHkiLCJyZXF1aXJlZCIsIm9uX2NoYW5nZSIsIm9uIiwiZSIsInRhcmdldCIsImdldF92YWx1ZSIsInNldF92YWx1ZSIsImZvY3VzIl0sInNvdXJjZXMiOlsicnN4L3RoZW1lL2NvbXBvbmVudHMvX2FyY2hpdmVkL3VuZmluaXNoZWQvRGF0ZV9QaWNrZXIuanMiXSwic291cmNlc0NvbnRlbnQiOlsiY2xhc3MgRGF0ZV9QaWNrZXIgZXh0ZW5kcyBKcWh0bWxfQ29tcG9uZW50IHtcbiAgICBvbl9yZWFkeSgpIHtcbiAgICAgICAgY29uc3QgJGlucHV0ID0gdGhpcy4kaWQoJ2lucHV0Jyk7XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy52YWx1ZSkge1xuICAgICAgICAgICAgJGlucHV0LnZhbCh0aGlzLmFyZ3MudmFsdWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5uYW1lKSB7XG4gICAgICAgICAgICAkaW5wdXQuYXR0cignbmFtZScsIHRoaXMuYXJncy5uYW1lKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MubWluKSB7XG4gICAgICAgICAgICAkaW5wdXQuYXR0cignbWluJywgdGhpcy5hcmdzLm1pbik7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLm1heCkge1xuICAgICAgICAgICAgJGlucHV0LmF0dHIoJ21heCcsIHRoaXMuYXJncy5tYXgpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5kaXNhYmxlZCkge1xuICAgICAgICAgICAgJGlucHV0LnByb3AoJ2Rpc2FibGVkJywgdHJ1ZSk7XG4gICAgICAgIH1cblxuICAgICAgICBpZiAodGhpcy5hcmdzLnJlYWRvbmx5KSB7XG4gICAgICAgICAgICAkaW5wdXQucHJvcCgncmVhZG9ubHknLCB0cnVlKTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICh0aGlzLmFyZ3MucmVxdWlyZWQpIHtcbiAgICAgICAgICAgICRpbnB1dC5wcm9wKCdyZXF1aXJlZCcsIHRydWUpO1xuICAgICAgICB9XG5cbiAgICAgICAgaWYgKHRoaXMuYXJncy5vbl9jaGFuZ2UpIHtcbiAgICAgICAgICAg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EdBQUcsQ0FBQyxPQUFPLENBQUMsQ0FBQ2tCLEtBQUssQ0FBQyxDQUFDO0VBQzdCO0FBQ0oiLCJpZ25vcmVMaXN0IjpbXX0=

View File

@@ -11,7 +11,7 @@ class Comment_Thread extends Component {
}
on_ready() {
// Submit new comment
this.$id('submit_btn').on('click', () => {
this.$sid('submit_btn').on('click', () => {
this.submit_comment();
});
@@ -37,12 +37,12 @@ class Comment_Thread extends Component {
});
}
async submit_comment() {
const text = this.$id('comment_input').val().trim();
const text = this.$sid('comment_input').val().trim();
if (!text) return;
if (this.args.on_submit) {
const result = await this.args.on_submit(text);
if (result) {
this.$id('comment_input').val('');
this.$sid('comment_input').val('');
await this.reload_data();
}
}

View File

@@ -3,7 +3,7 @@
class Top_Nav extends Component {
on_ready() {
// Wrap children in nav structure
const $nav = this.$id('nav_items');
const $nav = this.$sid('nav_items');
$nav.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -39,7 +39,7 @@ class Sample_Datagrid_Component extends Component {
const that = this;
// Select all checkbox
if (that.args.selectable) {
that.$id('select_all').on('change', e => {
that.$sid('select_all').on('change', e => {
const checked = e.target.checked;
that.$.find('tbody input[type="checkbox"]').prop('checked', checked);
that.update_selection_count();
@@ -62,11 +62,11 @@ class Sample_Datagrid_Component extends Component {
// Pagination
if (that.args.pagination !== false) {
that.$id('prev_page').on('click', e => {
that.$sid('prev_page').on('click', e => {
e.preventDefault();
that.go_to_page(that.data.pagination.current_page - 1);
});
that.$id('next_page').on('click', e => {
that.$sid('next_page').on('click', e => {
e.preventDefault();
that.go_to_page(that.data.pagination.current_page + 1);
});

View File

@@ -3,7 +3,7 @@
class User_Avatar_Dropdown extends Component {
on_ready() {
// Ensure proper dropdown item structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -2,14 +2,14 @@
class Notification_Badge extends Component {
on_ready() {
const $count = this.$id('count');
const $count = this.$sid('count');
// Update count dynamically
if (this.args.count === 0 || this.args.count === '0') {
$count.hide();
}
}
set_count(count) {
const $count = this.$id('count');
const $count = this.$sid('count');
$count.text(count);
if (count > 0) {
$count.show();

View File

@@ -14,7 +14,7 @@ class Form_Actions_Component extends Component {
* Use for: Initial state, event bindings, showing loading indicators
*/
async on_create() {
// Example: this.$id('loading').show();
// Example: this.$sid('loading').show();
// Example: this.$.addClass('initializing');
}
@@ -34,7 +34,7 @@ class Form_Actions_Component extends Component {
* Use for: Final UI setup, hiding loading indicators, starting animations
*/
async on_ready() {
// Example: this.$id('loading').hide();
// Example: this.$sid('loading').hide();
// Example: this.setup_event_listeners();
}
@@ -43,8 +43,8 @@ class Form_Actions_Component extends Component {
* Referenced in template via @click=this.on_click_hello
*/
on_click_hello() {
this.$id('inner_html').hide();
this.$id('hello_world').show();
this.$sid('inner_html').hide();
this.$sid('hello_world').show();
}
// For more information: php artisan rsx:man jqhtml

View File

@@ -2,8 +2,8 @@
class File_Upload extends Component {
on_ready() {
const $input = this.$id('file_input');
const $drop_zone = this.$id('drop_zone');
const $input = this.$sid('file_input');
const $drop_zone = this.$sid('drop_zone');
if (this.args.accept) {
$input.attr('accept', this.args.accept);
}
@@ -46,7 +46,7 @@ class File_Upload extends Component {
});
// Remove button
this.$id('remove_btn').on('click', e => {
this.$sid('remove_btn').on('click', e => {
e.stopPropagation();
this.clear();
});
@@ -62,10 +62,10 @@ class File_Upload extends Component {
this.selected_file = file;
// Show file info
this.$id('placeholder').hide();
this.$id('file_info').show();
this.$id('file_name').text(file.name);
this.$id('file_size').text(this.format_size(file.size));
this.$sid('placeholder').hide();
this.$sid('file_info').show();
this.$sid('file_name').text(file.name);
this.$sid('file_size').text(this.format_size(file.size));
// Auto-upload if endpoint provided
if (this.args.upload_url) {
@@ -81,8 +81,8 @@ class File_Upload extends Component {
if (!this.selected_file || !this.args.upload_url) return;
// Show progress
this.$id('file_info').hide();
this.$id('progress').show();
this.$sid('file_info').hide();
this.$sid('progress').show();
const form_data = new FormData();
form_data.append('file', this.selected_file);
try {
@@ -93,23 +93,23 @@ class File_Upload extends Component {
const result = await response.json();
// Hide progress
this.$id('progress').hide();
this.$id('file_info').show();
this.$sid('progress').hide();
this.$sid('file_info').show();
if (this.args.on_upload) {
this.args.on_upload(result);
}
} catch (error) {
alert('Upload failed: ' + error.message);
this.$id('progress').hide();
this.$id('placeholder').show();
this.$sid('progress').hide();
this.$sid('placeholder').show();
}
}
clear() {
this.selected_file = null;
this.$id('file_input').val('');
this.$id('file_info').hide();
this.$id('progress').hide();
this.$id('placeholder').show();
this.$sid('file_input').val('');
this.$sid('file_info').hide();
this.$sid('progress').hide();
this.$sid('placeholder').show();
if (this.args.on_clear) {
this.args.on_clear();
}

View File

@@ -3,7 +3,7 @@
class Search_Bar extends Component {
on_ready() {
// Bind search event
const $input = this.$id('input');
const $input = this.$sid('input');
$input.on('input', e => {
if (this.args.on_search) {
this.args.on_search(e.target.value);

View File

@@ -42,14 +42,14 @@ class Rsx_Form extends Component {
const that = this;
// Validate that error container exists
if (!this.$id('error').exists()) {
if (!this.$sid('error').exists()) {
console.log(this.$.html());
throw new Error('Rsx_Form requires an error container with $id="error". ' + 'Add <div $id="error"></div> to your form template for displaying validation and error messages.');
}
// Set up seed button handler if in debug mode
if (window.rsxapp.debug && this.$id('seed_btn').exists()) {
that.$id('seed_btn').on('click', function () {
if (window.rsxapp.debug && this.$sid('seed_btn').exists()) {
that.$sid('seed_btn').on('click', function () {
that.seed();
});
}
@@ -73,8 +73,8 @@ class Rsx_Form extends Component {
this.vals(this.data.values);
// Hide loading spinner and show form content (without re-rendering)
this.$id('loader').hide();
this.$id('form_content').show();
this.$sid('loader').hide();
this.$sid('form_content').show();
}
// Getter or setter for all form values, similar to jquery val
@@ -147,12 +147,12 @@ class Rsx_Form extends Component {
}
// For non-form errors (fatal, auth, network, etc.), render in form's error container
Rsx.render_error(error, this.$id('error'));
Rsx.render_error(error, this.$sid('error'));
}
async submit() {
// Clear any previous errors
Form_Utils.reset_form_errors(this.$);
this.$id('error').empty();
this.$sid('error').empty();
// Clear tab error badges if tabs are present
if (this.tabs) {

View File

@@ -64,13 +64,13 @@ class Phone_Text_Input extends Text_Input {
val(value) {
if (arguments.length === 0) {
// Getter - return the formatted value as displayed
return this.$id('input').val() || '';
return this.$sid('input').val() || '';
} else {
// Setter - format and display
if (!value) {
this.data.value = '';
if (this.$id('input').exists()) {
this.$id('input').val('');
if (this.$sid('input').exists()) {
this.$sid('input').val('');
}
return;
}
@@ -78,8 +78,8 @@ class Phone_Text_Input extends Text_Input {
if (this._check_international_mode(str_value)) {
// International mode - no formatting
this.data.value = str_value;
if (this.$id('input').exists()) {
this.$id('input').val(str_value);
if (this.$sid('input').exists()) {
this.$sid('input').val(str_value);
}
} else {
// US mode - clean digits and format
@@ -99,15 +99,15 @@ class Phone_Text_Input extends Text_Input {
}
const formatted = this._format_us_phone(digits_to_format);
this.data.value = formatted;
if (this.$id('input').exists()) {
this.$id('input').val(formatted);
if (this.$sid('input').exists()) {
this.$sid('input').val(formatted);
}
}
}
}
on_ready() {
super.on_ready();
const $input = this.$id('input');
const $input = this.$sid('input');
let _last_cursor_position = null;
// Handle keydown to intercept backspace at end of string

View File

@@ -4,15 +4,15 @@ class Calendar_Grid extends Component {
on_ready() {
this.current_date = new Date();
this.render_calendar();
this.$id('prev_btn').on('click', () => {
this.$sid('prev_btn').on('click', () => {
this.current_date.setMonth(this.current_date.getMonth() - 1);
this.render_calendar();
});
this.$id('next_btn').on('click', () => {
this.$sid('next_btn').on('click', () => {
this.current_date.setMonth(this.current_date.getMonth() + 1);
this.render_calendar();
});
this.$id('today_btn').on('click', () => {
this.$sid('today_btn').on('click', () => {
this.current_date = new Date();
this.render_calendar();
});
@@ -23,12 +23,12 @@ class Calendar_Grid extends Component {
// Update title
const month_names = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];
this.$id('month_title').text(`${month_names[month]} ${year}`);
this.$sid('month_title').text(`${month_names[month]} ${year}`);
// Get first day of month and total days
const first_day = new Date(year, month, 1).getDay();
const days_in_month = new Date(year, month + 1, 0).getDate();
const $tbody = this.$id('calendar_body');
const $tbody = this.$sid('calendar_body');
$tbody.empty();
let day = 1;
let $tr = null;

File diff suppressed because one or more lines are too long

View File

@@ -20,7 +20,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
}
_initialize_quill() {
// Initialize Quill editor
this.quill = new Quill(this.$id('editor')[0], {
this.quill = new Quill(this.$sid('editor')[0], {
theme: 'snow',
placeholder: this.args.placeholder || 'Enter text...',
modules: {
@@ -41,7 +41,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
// Update hidden input on text change
const that = this;
this.quill.on('text-change', function () {
that.$id('hidden_input').val(that.quill.root.innerHTML);
that.$sid('hidden_input').val(that.quill.root.innerHTML);
});
}
@@ -65,7 +65,7 @@ class Wysiwyg_Input extends Form_Input_Abstract {
}
if (value) {
this.quill.root.innerHTML = value;
this.$id('hidden_input').val(value);
this.$sid('hidden_input').val(value);
}
}
}

View File

@@ -3,7 +3,7 @@
class Row_Action_Menu extends Component {
on_ready() {
// Wrap children in dropdown structure
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.children().each(function () {
const $child = $(this);
if ($child.prop('tagName') !== 'LI') {

View File

@@ -24,7 +24,7 @@ class Sortable_Column_Header extends Component {
}
set_sort(direction) {
this.$.attr('data-sort', direction);
const $icon = this.$id('sort_icon');
const $icon = this.$sid('sort_icon');
if (direction === 'asc') {
$icon.html('<i class="text-primary">↑</i>');
} else if (direction === 'desc') {

View File

@@ -6,26 +6,26 @@ class Filter_Bar extends Component {
// Populate status options if provided
if (this.args.status_options) {
const $status = this.$id('status');
const $status = this.$sid('status');
this.args.status_options.forEach(opt => {
$status.append($('<option>').val(opt.value).text(opt.label));
});
}
// Date range change handler
this.$id('date_range').on('change', e => {
this.$sid('date_range').on('change', e => {
if (e.target.value === 'custom') {
this.$id('custom_dates').show();
this.$id('custom_dates_end').show();
this.$sid('custom_dates').show();
this.$sid('custom_dates_end').show();
} else {
this.$id('custom_dates').hide();
this.$id('custom_dates_end').hide();
this.$sid('custom_dates').hide();
this.$sid('custom_dates_end').hide();
}
});
// Search with debounce
let search_timeout;
this.$id('search').$.find('input').on('input', e => {
this.$sid('search').$.find('input').on('input', e => {
clearTimeout(search_timeout);
search_timeout = setTimeout(() => {
this.add_filter('search', e.target.value);
@@ -33,12 +33,12 @@ class Filter_Bar extends Component {
});
// Apply button
this.$id('apply_btn').on('click', () => {
this.$sid('apply_btn').on('click', () => {
this.apply_filters();
});
// Clear button
this.$id('clear_btn').on('click', () => {
this.$sid('clear_btn').on('click', () => {
this.clear_filters();
});
}
@@ -52,16 +52,16 @@ class Filter_Bar extends Component {
}
apply_filters() {
// Collect all filter values
const search = this.$id('search').get_value();
const status = this.$id('status').val();
const date_range = this.$id('date_range').val();
const search = this.$sid('search').get_value();
const status = this.$sid('status').val();
const date_range = this.$sid('date_range').val();
this.active_filters = {};
if (search) this.active_filters.search = search;
if (status) this.active_filters.status = status;
if (date_range) this.active_filters.date_range = date_range;
if (date_range === 'custom') {
const start_date = this.$id('start_date').get_value();
const end_date = this.$id('end_date').get_value();
const start_date = this.$sid('start_date').get_value();
const end_date = this.$sid('end_date').get_value();
if (start_date) this.active_filters.start_date = start_date;
if (end_date) this.active_filters.end_date = end_date;
}
@@ -72,11 +72,11 @@ class Filter_Bar extends Component {
}
clear_filters() {
this.active_filters = {};
this.$id('search').set_value('');
this.$id('status').val('');
this.$id('date_range').val('');
this.$id('custom_dates').hide();
this.$id('custom_dates_end').hide();
this.$sid('search').set_value('');
this.$sid('status').val('');
this.$sid('date_range').val('');
this.$sid('custom_dates').hide();
this.$sid('custom_dates_end').hide();
this.update_filter_display();
if (this.args.on_clear) {
this.args.on_clear();
@@ -84,8 +84,8 @@ class Filter_Bar extends Component {
}
update_filter_display() {
const count = Object.keys(this.active_filters).length;
const $container = this.$id('active_filters');
const $tags = this.$id('filter_tags');
const $container = this.$sid('active_filters');
const $tags = this.$sid('filter_tags');
if (count === 0) {
$container.hide();
return;

View File

@@ -8,7 +8,7 @@ class Column_Visibility_Toggle extends Component {
}
}
build_menu(columns) {
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.empty();
columns.forEach((column, index) => {
const $li = $('<li>');

View File

@@ -32,21 +32,21 @@ class Pin_Verification_Form extends Rsx_Form {
// Getter - collect all digits
let pin = '';
for (let i = 0; i < this.pin_length; i++) {
pin += this.$id(`digit_${i}`).val() || '';
pin += this.$sid(`digit_${i}`).val() || '';
}
return pin;
} else {
// Setter - distribute digits across inputs
const digits = str(value || '').replace(/[^0-9]/g, '');
for (let i = 0; i < this.pin_length; i++) {
this.$id(`digit_${i}`).val(digits[i] || '');
this.$sid(`digit_${i}`).val(digits[i] || '');
}
// Focus first empty input or last input
const first_empty = this._find_first_empty_index();
if (first_empty !== -1) {
this.$id(`digit_${first_empty}`)[0].focus();
this.$sid(`digit_${first_empty}`)[0].focus();
} else {
this.$id(`digit_${this.pin_length - 1}`)[0].focus();
this.$sid(`digit_${this.pin_length - 1}`)[0].focus();
}
}
}
@@ -57,7 +57,7 @@ class Pin_Verification_Form extends Rsx_Form {
*/
_find_first_empty_index() {
for (let i = 0; i < this.pin_length; i++) {
if (!this.$id(`digit_${i}`).val()) {
if (!this.$sid(`digit_${i}`).val()) {
return i;
}
}
@@ -70,7 +70,7 @@ class Pin_Verification_Form extends Rsx_Form {
*/
_focus_input(index) {
if (index >= 0 && index < this.pin_length) {
const $input = this.$id(`digit_${index}`);
const $input = this.$sid(`digit_${index}`);
if ($input.exists()) {
$input[0].focus();
// Select the content if there is any
@@ -96,7 +96,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Distribute digits starting from current input
for (let i = 0; i < digits.length && start_index + i < this.pin_length; i++) {
this.$id(`digit_${start_index + i}`).val(digits[i]);
this.$sid(`digit_${start_index + i}`).val(digits[i]);
}
// Focus next empty input or last input
@@ -109,7 +109,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Set up event handlers for each input
for (let i = 0; i < this.pin_length; i++) {
const $input = this.$id(`digit_${i}`);
const $input = this.$sid(`digit_${i}`);
const index = i;
// Handle input event - auto-advance
@@ -150,7 +150,7 @@ class Pin_Verification_Form extends Rsx_Form {
// If current input is empty, move to previous and clear it
if (!current_value && index > 0) {
e.preventDefault();
that.$id(`digit_${index - 1}`).val('');
that.$sid(`digit_${index - 1}`).val('');
that._focus_input(index - 1);
}
// If current input has value, it will be cleared by default behavior
@@ -192,16 +192,16 @@ class Pin_Verification_Form extends Rsx_Form {
const pin = this.val();
// Clear previous errors
this.$id('error_container').hide().empty();
this.$sid('error_container').hide().empty();
// Validate PIN is 6 digits
if (pin.length !== this.pin_length) {
this.$id('error_container').text('Please enter all 6 digits').show();
this.$sid('error_container').text('Please enter all 6 digits').show();
// Mark inputs as invalid
for (let i = 0; i < this.pin_length; i++) {
if (!this.$id(`digit_${i}`).val()) {
this.$id(`digit_${i}`).addClass('is-invalid');
if (!this.$sid(`digit_${i}`).val()) {
this.$sid(`digit_${i}`).addClass('is-invalid');
}
}
return;
@@ -209,7 +209,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Remove invalid class from all inputs
for (let i = 0; i < this.pin_length; i++) {
this.$id(`digit_${i}`).removeClass('is-invalid');
this.$sid(`digit_${i}`).removeClass('is-invalid');
}
// Call parent submit (which will use controller/method if provided)

View File

@@ -2,14 +2,14 @@
class Notification_Badge extends Component {
on_ready() {
const $count = this.$id('count');
const $count = this.$sid('count');
// Update count dynamically
if (this.args.count === 0 || this.args.count === '0') {
$count.hide();
}
}
set_count(count) {
const $count = this.$id('count');
const $count = this.$sid('count');
$count.text(count);
if (count > 0) {
$count.show();

View File

@@ -2,7 +2,7 @@
class Bulk_Selection extends Component {
on_ready() {
const $checkbox = this.$id('checkbox');
const $checkbox = this.$sid('checkbox');
// Toggle all checkboxes in table body
$checkbox.on('change', e => {

View File

@@ -42,14 +42,14 @@ class Rsx_Form extends Component {
const that = this;
// Validate that error container exists
if (!this.$id('error').exists()) {
if (!this.$sid('error').exists()) {
console.log(this.$.html());
throw new Error('Rsx_Form requires an error container with $id="error". ' + 'Add <div $id="error"></div> to your form template for displaying validation and error messages.');
}
// Set up seed button handler if in debug mode
if (window.rsxapp.debug && this.$id('seed_btn').exists()) {
that.$id('seed_btn').on('click', function () {
if (window.rsxapp.debug && this.$sid('seed_btn').exists()) {
that.$sid('seed_btn').on('click', function () {
that.seed();
});
}
@@ -73,8 +73,8 @@ class Rsx_Form extends Component {
this.vals(this.data.values);
// Hide loading spinner and show form content (without re-rendering)
this.$id('loader').hide();
this.$id('form_content').show();
this.$sid('loader').hide();
this.$sid('form_content').show();
}
// Getter or setter for all form values, similar to jquery val
@@ -147,12 +147,12 @@ class Rsx_Form extends Component {
}
// For non-form errors (fatal, auth, network, etc.), render in form's error container
Rsx.render_error(error, this.$id('error'));
Rsx.render_error(error, this.$sid('error'));
}
async submit() {
// Clear any previous errors
Form_Utils.reset_form_errors(this.$);
this.$id('error').empty();
this.$sid('error').empty();
// Clear tab error badges if tabs are present
if (this.tabs) {

View File

@@ -158,9 +158,9 @@ class Modal {
await new Promise(resolve => {
modal_instance.on('ready', () => {
console.log('[Modal] Component ready, elements:', {
title: modal_instance.$id('title').length,
body: modal_instance.$id('body').length,
footer: modal_instance.$id('footer').length
title: modal_instance.$sid('title').length,
body: modal_instance.$sid('body').length,
footer: modal_instance.$sid('footer').length
});
resolve();
});

View File

@@ -3,7 +3,7 @@
class Bulk_Action_Bar extends Component {
on_ready() {
// Clear selection on close
this.$id('close_btn').on('click', () => {
this.$sid('close_btn').on('click', () => {
this.$.hide();
// Uncheck all boxes
const $table = this.$.closest('.card').find('table');

View File

@@ -9,21 +9,21 @@ class Multi_Select extends Component {
}
// Search functionality
const $search = this.$id('search');
const $search = this.$sid('search');
$search.on('input', e => {
this.filter_options(e.target.value);
});
// Prevent dropdown close when clicking inside
this.$id('menu').on('click', e => {
this.$sid('menu').on('click', e => {
e.stopPropagation();
});
// Clear/Select all buttons
this.$id('clear_all').on('click', () => {
this.$sid('clear_all').on('click', () => {
this.clear_all();
});
this.$id('select_all').on('click', () => {
this.$sid('select_all').on('click', () => {
this.select_all();
});
@@ -31,7 +31,7 @@ class Multi_Select extends Component {
this.update_display();
}
render_options(options) {
const $container = this.$id('options');
const $container = this.$sid('options');
$container.empty();
if (options.length === 0) {
$container.append($('<div>').addClass('px-3 py-2 text-muted').text('No options found'));
@@ -66,7 +66,7 @@ class Multi_Select extends Component {
}
update_display() {
const count = this.selected_values.length;
const $text = this.$id('selected_text');
const $text = this.$sid('selected_text');
if (count === 0) {
$text.text(this.args.placeholder || 'Select options');
} else if (count === 1) {
@@ -78,7 +78,7 @@ class Multi_Select extends Component {
}
clear_all() {
this.selected_values = [];
this.$id('options').find('input[type="checkbox"]').prop('checked', false);
this.$sid('options').find('input[type="checkbox"]').prop('checked', false);
this.update_display();
if (this.args.on_change) {
this.args.on_change(this.selected_values);
@@ -86,7 +86,7 @@ class Multi_Select extends Component {
}
select_all() {
this.selected_values = this.all_options.map(opt => opt.value);
this.$id('options').find('input[type="checkbox"]').prop('checked', true);
this.$sid('options').find('input[type="checkbox"]').prop('checked', true);
this.update_display();
if (this.args.on_change) {
this.args.on_change(this.selected_values);
@@ -97,7 +97,7 @@ class Multi_Select extends Component {
}
set_value(values) {
this.selected_values = values;
this.$id('options').find('input[type="checkbox"]').each((i, el) => {
this.$sid('options').find('input[type="checkbox"]').each((i, el) => {
const $el = $(el);
$el.prop('checked', values.includes($el.attr('data-value')));
});

View File

@@ -6,26 +6,26 @@ class Filter_Bar extends Component {
// Populate status options if provided
if (this.args.status_options) {
const $status = this.$id('status');
const $status = this.$sid('status');
this.args.status_options.forEach(opt => {
$status.append($('<option>').val(opt.value).text(opt.label));
});
}
// Date range change handler
this.$id('date_range').on('change', e => {
this.$sid('date_range').on('change', e => {
if (e.target.value === 'custom') {
this.$id('custom_dates').show();
this.$id('custom_dates_end').show();
this.$sid('custom_dates').show();
this.$sid('custom_dates_end').show();
} else {
this.$id('custom_dates').hide();
this.$id('custom_dates_end').hide();
this.$sid('custom_dates').hide();
this.$sid('custom_dates_end').hide();
}
});
// Search with debounce
let search_timeout;
this.$id('search').$.find('input').on('input', e => {
this.$sid('search').$.find('input').on('input', e => {
clearTimeout(search_timeout);
search_timeout = setTimeout(() => {
this.add_filter('search', e.target.value);
@@ -33,12 +33,12 @@ class Filter_Bar extends Component {
});
// Apply button
this.$id('apply_btn').on('click', () => {
this.$sid('apply_btn').on('click', () => {
this.apply_filters();
});
// Clear button
this.$id('clear_btn').on('click', () => {
this.$sid('clear_btn').on('click', () => {
this.clear_filters();
});
}
@@ -52,16 +52,16 @@ class Filter_Bar extends Component {
}
apply_filters() {
// Collect all filter values
const search = this.$id('search').get_value();
const status = this.$id('status').val();
const date_range = this.$id('date_range').val();
const search = this.$sid('search').get_value();
const status = this.$sid('status').val();
const date_range = this.$sid('date_range').val();
this.active_filters = {};
if (search) this.active_filters.search = search;
if (status) this.active_filters.status = status;
if (date_range) this.active_filters.date_range = date_range;
if (date_range === 'custom') {
const start_date = this.$id('start_date').get_value();
const end_date = this.$id('end_date').get_value();
const start_date = this.$sid('start_date').get_value();
const end_date = this.$sid('end_date').get_value();
if (start_date) this.active_filters.start_date = start_date;
if (end_date) this.active_filters.end_date = end_date;
}
@@ -72,11 +72,11 @@ class Filter_Bar extends Component {
}
clear_filters() {
this.active_filters = {};
this.$id('search').set_value('');
this.$id('status').val('');
this.$id('date_range').val('');
this.$id('custom_dates').hide();
this.$id('custom_dates_end').hide();
this.$sid('search').set_value('');
this.$sid('status').val('');
this.$sid('date_range').val('');
this.$sid('custom_dates').hide();
this.$sid('custom_dates_end').hide();
this.update_filter_display();
if (this.args.on_clear) {
this.args.on_clear();
@@ -84,8 +84,8 @@ class Filter_Bar extends Component {
}
update_filter_display() {
const count = Object.keys(this.active_filters).length;
const $container = this.$id('active_filters');
const $tags = this.$id('filter_tags');
const $container = this.$sid('active_filters');
const $tags = this.$sid('filter_tags');
if (count === 0) {
$container.hide();
return;

File diff suppressed because one or more lines are too long

View File

@@ -32,21 +32,21 @@ class Pin_Verification_Form extends Rsx_Form {
// Getter - collect all digits
let pin = '';
for (let i = 0; i < this.pin_length; i++) {
pin += this.$id(`digit_${i}`).val() || '';
pin += this.$sid(`digit_${i}`).val() || '';
}
return pin;
} else {
// Setter - distribute digits across inputs
const digits = str(value || '').replace(/[^0-9]/g, '');
for (let i = 0; i < this.pin_length; i++) {
this.$id(`digit_${i}`).val(digits[i] || '');
this.$sid(`digit_${i}`).val(digits[i] || '');
}
// Focus first empty input or last input
const first_empty = this._find_first_empty_index();
if (first_empty !== -1) {
this.$id(`digit_${first_empty}`)[0].focus();
this.$sid(`digit_${first_empty}`)[0].focus();
} else {
this.$id(`digit_${this.pin_length - 1}`)[0].focus();
this.$sid(`digit_${this.pin_length - 1}`)[0].focus();
}
}
}
@@ -57,7 +57,7 @@ class Pin_Verification_Form extends Rsx_Form {
*/
_find_first_empty_index() {
for (let i = 0; i < this.pin_length; i++) {
if (!this.$id(`digit_${i}`).val()) {
if (!this.$sid(`digit_${i}`).val()) {
return i;
}
}
@@ -70,7 +70,7 @@ class Pin_Verification_Form extends Rsx_Form {
*/
_focus_input(index) {
if (index >= 0 && index < this.pin_length) {
const $input = this.$id(`digit_${index}`);
const $input = this.$sid(`digit_${index}`);
if ($input.exists()) {
$input[0].focus();
// Select the content if there is any
@@ -96,7 +96,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Distribute digits starting from current input
for (let i = 0; i < digits.length && start_index + i < this.pin_length; i++) {
this.$id(`digit_${start_index + i}`).val(digits[i]);
this.$sid(`digit_${start_index + i}`).val(digits[i]);
}
// Focus next empty input or last input
@@ -109,7 +109,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Set up event handlers for each input
for (let i = 0; i < this.pin_length; i++) {
const $input = this.$id(`digit_${i}`);
const $input = this.$sid(`digit_${i}`);
const index = i;
// Handle input event - auto-advance
@@ -150,7 +150,7 @@ class Pin_Verification_Form extends Rsx_Form {
// If current input is empty, move to previous and clear it
if (!current_value && index > 0) {
e.preventDefault();
that.$id(`digit_${index - 1}`).val('');
that.$sid(`digit_${index - 1}`).val('');
that._focus_input(index - 1);
}
// If current input has value, it will be cleared by default behavior
@@ -192,16 +192,16 @@ class Pin_Verification_Form extends Rsx_Form {
const pin = this.val();
// Clear previous errors
this.$id('error_container').hide().empty();
this.$sid('error_container').hide().empty();
// Validate PIN is 6 digits
if (pin.length !== this.pin_length) {
this.$id('error_container').text('Please enter all 6 digits').show();
this.$sid('error_container').text('Please enter all 6 digits').show();
// Mark inputs as invalid
for (let i = 0; i < this.pin_length; i++) {
if (!this.$id(`digit_${i}`).val()) {
this.$id(`digit_${i}`).addClass('is-invalid');
if (!this.$sid(`digit_${i}`).val()) {
this.$sid(`digit_${i}`).addClass('is-invalid');
}
}
return;
@@ -209,7 +209,7 @@ class Pin_Verification_Form extends Rsx_Form {
// Remove invalid class from all inputs
for (let i = 0; i < this.pin_length; i++) {
this.$id(`digit_${i}`).removeClass('is-invalid');
this.$sid(`digit_${i}`).removeClass('is-invalid');
}
// Call parent submit (which will use controller/method if provided)

View File

@@ -8,7 +8,7 @@ class Table_Pagination extends Component {
}
}
generate_pagination(current, total) {
const $pagination = this.$id('pagination');
const $pagination = this.$sid('pagination');
$pagination.empty();
// Previous button

View File

@@ -24,7 +24,7 @@ class Sortable_Column_Header extends Component {
}
set_sort(direction) {
this.$.attr('data-sort', direction);
const $icon = this.$id('sort_icon');
const $icon = this.$sid('sort_icon');
if (direction === 'asc') {
$icon.html('<i class="text-primary">↑</i>');
} else if (direction === 'desc') {

View File

@@ -8,7 +8,7 @@ class Column_Visibility_Toggle extends Component {
}
}
build_menu(columns) {
const $menu = this.$id('menu');
const $menu = this.$sid('menu');
$menu.empty();
columns.forEach((column, index) => {
const $li = $('<li>');