Files
x-editable-bs5/demo/index.html
Micha 1ae5282bc7 v25.0.6: Fix bootstrap-datepicker and select2 integration for Bootstrap 5
Major improvements and fixes:

## Bootstrap-datepicker Integration
- Fix DPGlobal undefined error in date input
- Remove conflicting bdatepicker alias that was causing noConflict errors
- Add graceful error handling for missing bootstrap-datepicker dependency
- Implement proper initialization sequence for DPGlobal API
- Position datepicker above input with improved UX styling

## Select2 Integration & Compatibility
- Fix select2 integration with Select2 v4.1.0-rc.0
- Resolve issue where select2:select event fired but value didn't update
- Add event handler to manually update select2 value on selection
- Fix webpack build inconsistency between demo and standalone builds
- Remove redundant npm dependencies from demo (bootstrap-datepicker, select2)
- Implement proper Select2 v4 API usage for value setting

## Build System Improvements
- Fix webpack configuration to properly handle CSS imports
- Remove CSS file copying for npm dependencies, use webpack imports instead
- Ensure consistent input type registration across all build targets
- Clean up build output and remove debugging code

## Demo & Testing
- Update demo to use webpack source build for consistency
- Add comprehensive error handling and user feedback
- Clean up all debugging console output
- Improve demo page descriptions and usability

## Technical Fixes
- Fix 'Unknown type: select2' error in demo build
- Resolve value change detection preventing save operations
- Implement savenochange option for better UX
- Remove deprecated jQuery UI conflicts and aliases
- Update to modern webpack and build practices
2025-07-29 13:36:06 +02:00

84 lines
2.7 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./dist/bootstrap5-editable/css/bootstrap-editable.css">
<!-- <script src="./dist/bootstrap5-editable/js/bootstrap-editable.js"></script>-->
<!-- <script src="./dist/jquery.js"></script>-->
<script src="./dist/app.js" type="module"></script>
<title>Bootstrap 5.3.3 Test</title>
</head>
<body>
<div class="container">
<h1 class="text-primary">jQuery 3.7.1 & Bootstrap 5.3.3 Test</h1>
</div>
<form id="test-form" action="demo/demo.php" method="post">
<div class="container mb-3">
<h3>Test X-Editable Yes/No Switch - AJAX Source</h3>
<p>Click on the text below to toggle Yes/No:</p>
<a
href="#"
id="yes-no-switch"
class="editable editable-click"
data-pk="101"
>
Yes
</a>
</div>
<div class="container mb-3">
<h3>Test X-Editable Static Source - JSON Source</h3>
<p>Click on the text below (uses static array, not AJAX):</p>
<a
href="#"
id="yes-no-switch-json"
class="editable editable-click"
data-type="select"
data-pk="102"
data-title="Select Yes/No"
>
Yes
</a>
</div>
<div class="container mb-3">
<h3>Test X-Editable Datepicker</h3>
<p>Click to select a date:</p>
<a
href="#"
id="datepicker"
class="editable editable-click"
data-type="date"
data-pk="103"
data-title="Select Date"
>
Click to select date
</a>
</div>
<div class="container mb-3">
<h3>Test X-Editable Select2 (refactored to work with select2 4.1.0-RC)</h3>
<p>Click to select from a larger list with search functionality:</p>
<a
href="#"
id="select2-test"
class="editable editable-click"
data-type="select2"
data-pk="104"
data-title="Select Country"
>
United States
</a>
</div>
</form>
</body>
</html>