@keenthemes/ktui 1.0.28 → 1.0.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +11 -1
- package/CONTRIBUTING.md +0 -101
- package/examples/datatable/checkbox-events-test.html +0 -400
- package/examples/datatable/credentials-test.html +0 -423
- package/examples/datatable/remote-checkbox-test.html +0 -365
- package/examples/datatable/sorting-test.html +0 -258
- package/examples/image-input/file-upload-example.html +0 -189
- package/examples/modal/persistent.html +0 -205
- package/examples/modal/remote-select-dropdown.html +0 -166
- package/examples/modal/select-dropdown-container.html +0 -129
- package/examples/select/avatar.html +0 -47
- package/examples/select/basic-usage.html +0 -39
- package/examples/select/country.html +0 -43
- package/examples/select/dark-mode.html +0 -93
- package/examples/select/description.html +0 -53
- package/examples/select/disable-option.html +0 -37
- package/examples/select/disable-select.html +0 -35
- package/examples/select/dropdowncontainer.html +0 -111
- package/examples/select/dynamic-methods.html +0 -273
- package/examples/select/formdata-remote.html +0 -161
- package/examples/select/global-config.html +0 -81
- package/examples/select/icon-multiple.html +0 -50
- package/examples/select/icon.html +0 -48
- package/examples/select/max-selection.html +0 -38
- package/examples/select/modal-container.html +0 -128
- package/examples/select/modal-positioning-test.html +0 -338
- package/examples/select/modal.html +0 -80
- package/examples/select/multiple.html +0 -40
- package/examples/select/native-selected.html +0 -64
- package/examples/select/placeholder.html +0 -40
- package/examples/select/remote-data-preselected.html +0 -283
- package/examples/select/remote-data.html +0 -38
- package/examples/select/search.html +0 -57
- package/examples/select/sizes.html +0 -94
- package/examples/select/tags-enhanced.html +0 -86
- package/examples/select/tags-icons.html +0 -57
- package/examples/select/template-customization.html +0 -61
- package/examples/sticky/README.md +0 -158
- package/examples/sticky/debug-sticky.html +0 -144
- package/examples/sticky/test-runner.html +0 -175
- package/examples/sticky/test-sticky-logic.js +0 -369
- package/examples/sticky/test-sticky-positioning.html +0 -386
- package/examples/toast/example.html +0 -479
- package/prettier.config.js +0 -9
- package/tsconfig.json +0 -17
- package/webpack.config.js +0 -118
|
@@ -1,189 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>KTUI Image Input - File Upload Example</title>
|
|
7
|
-
<link rel="stylesheet" href="../../dist/styles.css">
|
|
8
|
-
<style>
|
|
9
|
-
body { padding: 2rem; font-family: Arial, sans-serif; }
|
|
10
|
-
.example-section { margin: 2rem 0; padding: 1rem; border: 1px solid #ddd; }
|
|
11
|
-
.test-result { margin: 0.5rem 0; padding: 0.5rem; background: #f5f5f5; }
|
|
12
|
-
.success { background: #d4edda; color: #155724; }
|
|
13
|
-
.error { background: #f8d7da; color: #721c24; }
|
|
14
|
-
.info { background: #d1ecf1; color: #0c5460; }
|
|
15
|
-
.code-block { background: #f8f9fa; padding: 1rem; border-radius: 4px; margin: 1rem 0; }
|
|
16
|
-
</style>
|
|
17
|
-
</head>
|
|
18
|
-
<body>
|
|
19
|
-
<h1>KTUI Image Input - File Upload Example</h1>
|
|
20
|
-
<p>This example demonstrates how to use the KTUI Image Input component with proper file upload functionality.</p>
|
|
21
|
-
|
|
22
|
-
<div class="example-section">
|
|
23
|
-
<h2>Image Input Component</h2>
|
|
24
|
-
<div class="kt-image-input size-16" data-kt-image-input="true">
|
|
25
|
-
<input accept=".png, .jpg, .jpeg" name="avatar" type="file">
|
|
26
|
-
<input name="avatar_remove" type="hidden"/>
|
|
27
|
-
<button class="kt-image-input-remove" data-kt-image-input-remove="true" type="button">
|
|
28
|
-
<i class="ki-filled ki-cross"></i>
|
|
29
|
-
</button>
|
|
30
|
-
<div class="kt-image-input-placeholder" data-kt-image-input-placeholder="true">
|
|
31
|
-
<div class="kt-image-input-preview" data-kt-image-input-preview="true"></div>
|
|
32
|
-
</div>
|
|
33
|
-
</div>
|
|
34
|
-
</div>
|
|
35
|
-
|
|
36
|
-
<div class="example-section">
|
|
37
|
-
<h2>Testing Controls</h2>
|
|
38
|
-
<button onclick="testFileAccess()">Test File Access</button>
|
|
39
|
-
<button onclick="testPublicMethods()">Test Public Methods</button>
|
|
40
|
-
<button onclick="testFormSubmission()">Test Form Submission</button>
|
|
41
|
-
<button onclick="clearResults()">Clear Results</button>
|
|
42
|
-
</div>
|
|
43
|
-
|
|
44
|
-
<div class="example-section">
|
|
45
|
-
<h2>Test Results</h2>
|
|
46
|
-
<div id="test-results"></div>
|
|
47
|
-
</div>
|
|
48
|
-
|
|
49
|
-
<div class="example-section">
|
|
50
|
-
<h2>Form Submission Example</h2>
|
|
51
|
-
<p>This form demonstrates how to properly handle file uploads with KTUI Image Input:</p>
|
|
52
|
-
<form id="test-form" onsubmit="handleFormSubmit(event)">
|
|
53
|
-
<div class="kt-image-input size-16" data-kt-image-input="true">
|
|
54
|
-
<input accept=".png, .jpg, .jpeg" name="test_image" type="file">
|
|
55
|
-
<input name="test_image_remove" type="hidden"/>
|
|
56
|
-
<button class="kt-image-input-remove" data-kt-image-input-remove="true" type="button">
|
|
57
|
-
<i class="ki-filled ki-cross"></i>
|
|
58
|
-
</button>
|
|
59
|
-
<div class="kt-image-input-placeholder" data-kt-image-input-placeholder="true">
|
|
60
|
-
<div class="kt-image-input-preview" data-kt-image-input-preview="true"></div>
|
|
61
|
-
</div>
|
|
62
|
-
</div>
|
|
63
|
-
<button type="submit">Submit Form</button>
|
|
64
|
-
</form>
|
|
65
|
-
</div>
|
|
66
|
-
|
|
67
|
-
<div class="example-section">
|
|
68
|
-
<h2>Usage Code Example</h2>
|
|
69
|
-
<div class="code-block">
|
|
70
|
-
<h3>HTML Structure</h3>
|
|
71
|
-
<pre><code><div class="kt-image-input size-16" data-kt-image-input="true">
|
|
72
|
-
<input accept=".png, .jpg, .jpeg" name="avatar" type="file">
|
|
73
|
-
<input name="avatar_remove" type="hidden"/>
|
|
74
|
-
<button class="kt-image-input-remove" data-kt-image-input-remove="true" type="button">
|
|
75
|
-
<i class="ki-filled ki-cross"></i>
|
|
76
|
-
</button>
|
|
77
|
-
<div class="kt-image-input-placeholder" data-kt-image-input-placeholder="true">
|
|
78
|
-
<div class="kt-image-input-preview" data-kt-image-input-preview="true"></div>
|
|
79
|
-
</div>
|
|
80
|
-
</div></code></pre>
|
|
81
|
-
|
|
82
|
-
<h3>JavaScript - File Upload</h3>
|
|
83
|
-
<pre><code>// Get the KTUI Image Input instance
|
|
84
|
-
const imageInput = KTImageInput.getInstance(element);
|
|
85
|
-
|
|
86
|
-
// Access the selected file for form submission
|
|
87
|
-
const selectedFile = imageInput.getSelectedFile();
|
|
88
|
-
if (selectedFile) {
|
|
89
|
-
const formData = new FormData();
|
|
90
|
-
formData.append('image', selectedFile);
|
|
91
|
-
// Submit formData to server
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
// Check component state
|
|
95
|
-
if (imageInput.isEmpty()) {
|
|
96
|
-
console.log('No file selected');
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
if (imageInput.isChanged()) {
|
|
100
|
-
console.log('File has been selected');
|
|
101
|
-
}</code></pre>
|
|
102
|
-
</div>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<script src="../../dist/ktui.min.js"></script>
|
|
106
|
-
<script>
|
|
107
|
-
let imageInputInstance = null;
|
|
108
|
-
|
|
109
|
-
// Initialize when DOM is ready
|
|
110
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
111
|
-
const element = document.querySelector('[data-kt-image-input]');
|
|
112
|
-
if (element) {
|
|
113
|
-
imageInputInstance = KTImageInput.getInstance(element);
|
|
114
|
-
addResult('Component initialized successfully', 'success');
|
|
115
|
-
}
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
function addResult(message, type = 'info') {
|
|
119
|
-
const results = document.getElementById('test-results');
|
|
120
|
-
const div = document.createElement('div');
|
|
121
|
-
div.className = `test-result ${type}`;
|
|
122
|
-
div.textContent = `${new Date().toLocaleTimeString()}: ${message}`;
|
|
123
|
-
results.appendChild(div);
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
function testFileAccess() {
|
|
127
|
-
if (!imageInputInstance) {
|
|
128
|
-
addResult('Image input instance not found', 'error');
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const file = imageInputInstance.getSelectedFile();
|
|
133
|
-
if (file) {
|
|
134
|
-
addResult(`File access successful: ${file.name} (${file.size} bytes)`, 'success');
|
|
135
|
-
} else {
|
|
136
|
-
addResult('No file selected', 'info');
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
function testPublicMethods() {
|
|
141
|
-
if (!imageInputInstance) {
|
|
142
|
-
addResult('Image input instance not found', 'error');
|
|
143
|
-
return;
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
const isEmpty = imageInputInstance.isEmpty();
|
|
147
|
-
const isChanged = imageInputInstance.isChanged();
|
|
148
|
-
|
|
149
|
-
addResult(`isEmpty(): ${isEmpty}`, isEmpty ? 'info' : 'success');
|
|
150
|
-
addResult(`isChanged(): ${isChanged}`, isChanged ? 'success' : 'info');
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
function testFormSubmission() {
|
|
154
|
-
const form = document.getElementById('test-form');
|
|
155
|
-
const fileInput = form.querySelector('input[type="file"]');
|
|
156
|
-
const formData = new FormData(form);
|
|
157
|
-
|
|
158
|
-
addResult('Form data created', 'info');
|
|
159
|
-
|
|
160
|
-
if (fileInput.files.length > 0) {
|
|
161
|
-
addResult(`File in form: ${fileInput.files[0].name}`, 'success');
|
|
162
|
-
} else {
|
|
163
|
-
addResult('No file in form data (expected - input is cleared for UI)', 'info');
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// Test with KTUI instance
|
|
167
|
-
const formImageInput = KTImageInput.getInstance(form.querySelector('[data-kt-image-input]'));
|
|
168
|
-
if (formImageInput) {
|
|
169
|
-
const selectedFile = formImageInput.getSelectedFile();
|
|
170
|
-
if (selectedFile) {
|
|
171
|
-
addResult(`KTUI file access: ${selectedFile.name}`, 'success');
|
|
172
|
-
} else {
|
|
173
|
-
addResult('No file in KTUI instance', 'error');
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
function handleFormSubmit(event) {
|
|
179
|
-
event.preventDefault();
|
|
180
|
-
addResult('Form submission intercepted for testing', 'info');
|
|
181
|
-
testFormSubmission();
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function clearResults() {
|
|
185
|
-
document.getElementById('test-results').innerHTML = '';
|
|
186
|
-
}
|
|
187
|
-
</script>
|
|
188
|
-
</body>
|
|
189
|
-
</html>
|
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Modal Persistent Property Test</title>
|
|
7
|
-
<script src="https://cdn.tailwindcss.com"></script>
|
|
8
|
-
<link rel="stylesheet" href="../../dist/styles.css">
|
|
9
|
-
<style>
|
|
10
|
-
.test-case {
|
|
11
|
-
margin: 1rem 0;
|
|
12
|
-
padding: 1.5rem;
|
|
13
|
-
border: 1px solid #e5e7eb;
|
|
14
|
-
border-radius: 0.5rem;
|
|
15
|
-
background: #fafafa;
|
|
16
|
-
}
|
|
17
|
-
.expected {
|
|
18
|
-
color: #374151;
|
|
19
|
-
font-weight: 500;
|
|
20
|
-
}
|
|
21
|
-
</style>
|
|
22
|
-
</head>
|
|
23
|
-
<body class="p-8 bg-white min-h-screen flex items-start justify-center">
|
|
24
|
-
<div class="w-full max-w-3xl">
|
|
25
|
-
<h1 class="text-3xl font-bold mb-2 text-gray-900">Modal Persistent Property Test</h1>
|
|
26
|
-
<p class="text-gray-600 mb-8">Testing the interaction between <code class="bg-gray-100 px-2 py-1 rounded text-sm">persistent</code> and <code class="bg-gray-100 px-2 py-1 rounded text-sm">backdropStatic</code> properties.</p>
|
|
27
|
-
|
|
28
|
-
<div class="mb-8 p-4 border border-gray-200 rounded bg-gray-50">
|
|
29
|
-
<h2 class="text-lg font-semibold mb-3 text-gray-900">Test Instructions</h2>
|
|
30
|
-
<ol class="list-decimal list-inside space-y-2 text-gray-700">
|
|
31
|
-
<li>Click each "Open Modal" button below</li>
|
|
32
|
-
<li>Try clicking on the modal backdrop (gray area around the modal content)</li>
|
|
33
|
-
<li>Try clicking on the invisible area below the modal content</li>
|
|
34
|
-
<li>Verify the behavior matches the expected result</li>
|
|
35
|
-
</ol>
|
|
36
|
-
</div>
|
|
37
|
-
|
|
38
|
-
<!-- Test Case 1: persistent=false, backdropStatic=false -->
|
|
39
|
-
<div class="test-case">
|
|
40
|
-
<h3 class="text-base font-semibold mb-3 text-gray-900">Test Case 1</h3>
|
|
41
|
-
<p class="mb-2 text-sm text-gray-700">
|
|
42
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">persistent: false</code>,
|
|
43
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">backdropStatic: false</code>
|
|
44
|
-
</p>
|
|
45
|
-
<p class="expected mb-4 text-sm">✓ Expected: Modal SHOULD close when clicking on backdrop or invisible area</p>
|
|
46
|
-
<button
|
|
47
|
-
data-kt-modal-toggle="#modal-test-1"
|
|
48
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm font-medium">
|
|
49
|
-
Open Modal
|
|
50
|
-
</button>
|
|
51
|
-
</div>
|
|
52
|
-
|
|
53
|
-
<!-- Test Case 2: persistent=true, backdropStatic=false -->
|
|
54
|
-
<div class="test-case">
|
|
55
|
-
<h3 class="text-base font-semibold mb-3 text-gray-900">Test Case 2 <span class="text-xs font-normal text-gray-500">(Bug Fix Verification)</span></h3>
|
|
56
|
-
<p class="mb-2 text-sm text-gray-700">
|
|
57
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">persistent: true</code>,
|
|
58
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">backdropStatic: false</code>
|
|
59
|
-
</p>
|
|
60
|
-
<p class="expected mb-4 text-sm">✓ Expected: Modal should NOT close when clicking on backdrop or invisible area</p>
|
|
61
|
-
<button
|
|
62
|
-
data-kt-modal-toggle="#modal-test-2"
|
|
63
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm font-medium">
|
|
64
|
-
Open Modal
|
|
65
|
-
</button>
|
|
66
|
-
</div>
|
|
67
|
-
|
|
68
|
-
<!-- Test Case 3: persistent=false, backdropStatic=true -->
|
|
69
|
-
<div class="test-case">
|
|
70
|
-
<h3 class="text-base font-semibold mb-3 text-gray-900">Test Case 3</h3>
|
|
71
|
-
<p class="mb-2 text-sm text-gray-700">
|
|
72
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">persistent: false</code>,
|
|
73
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">backdropStatic: true</code>
|
|
74
|
-
</p>
|
|
75
|
-
<p class="expected mb-4 text-sm">✓ Expected: Modal should NOT close when clicking on backdrop (backdropStatic takes precedence)</p>
|
|
76
|
-
<button
|
|
77
|
-
data-kt-modal-toggle="#modal-test-3"
|
|
78
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm font-medium">
|
|
79
|
-
Open Modal
|
|
80
|
-
</button>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
83
|
-
<!-- Test Case 4: persistent=true, backdropStatic=true -->
|
|
84
|
-
<div class="test-case">
|
|
85
|
-
<h3 class="text-base font-semibold mb-3 text-gray-900">Test Case 4</h3>
|
|
86
|
-
<p class="mb-2 text-sm text-gray-700">
|
|
87
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">persistent: true</code>,
|
|
88
|
-
<code class="bg-white px-2 py-1 rounded border border-gray-200">backdropStatic: true</code>
|
|
89
|
-
</p>
|
|
90
|
-
<p class="expected mb-4 text-sm">✓ Expected: Modal should NOT close when clicking on backdrop or invisible area</p>
|
|
91
|
-
<button
|
|
92
|
-
data-kt-modal-toggle="#modal-test-4"
|
|
93
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm font-medium">
|
|
94
|
-
Open Modal
|
|
95
|
-
</button>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<!-- Modal 1: persistent=false, backdropStatic=false -->
|
|
100
|
-
<div
|
|
101
|
-
id="modal-test-1"
|
|
102
|
-
class="hidden fixed inset-0 z-50 flex items-center justify-center"
|
|
103
|
-
data-kt-modal="true"
|
|
104
|
-
data-kt-modal-persistent="false"
|
|
105
|
-
data-kt-modal-backdrop-static="false">
|
|
106
|
-
<div class="bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4 border border-gray-200">
|
|
107
|
-
<h2 class="text-lg font-semibold mb-4 text-gray-900">Test Case 1</h2>
|
|
108
|
-
<p class="mb-3 text-sm text-gray-700">
|
|
109
|
-
This modal has <code class="bg-gray-100 px-1 text-xs">persistent: false</code> and
|
|
110
|
-
<code class="bg-gray-100 px-1 text-xs">backdropStatic: false</code>.
|
|
111
|
-
</p>
|
|
112
|
-
<p class="mb-4 text-sm text-gray-600">
|
|
113
|
-
Click on the gray area around this modal or below it. The modal should close.
|
|
114
|
-
</p>
|
|
115
|
-
<button
|
|
116
|
-
data-kt-modal-dismiss="true"
|
|
117
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm">
|
|
118
|
-
Close
|
|
119
|
-
</button>
|
|
120
|
-
</div>
|
|
121
|
-
</div>
|
|
122
|
-
|
|
123
|
-
<!-- Modal 2: persistent=true, backdropStatic=false -->
|
|
124
|
-
<div
|
|
125
|
-
id="modal-test-2"
|
|
126
|
-
class="hidden fixed inset-0 z-50 flex items-center justify-center"
|
|
127
|
-
data-kt-modal="true"
|
|
128
|
-
data-kt-modal-persistent="true"
|
|
129
|
-
data-kt-modal-backdrop-static="false">
|
|
130
|
-
<div class="bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4 border border-gray-200">
|
|
131
|
-
<h2 class="text-lg font-semibold mb-4 text-gray-900">Test Case 2 <span class="text-xs font-normal text-gray-500">(Bug Fix)</span></h2>
|
|
132
|
-
<p class="mb-3 text-sm text-gray-700">
|
|
133
|
-
This modal has <code class="bg-gray-100 px-1 text-xs">persistent: true</code> and
|
|
134
|
-
<code class="bg-gray-100 px-1 text-xs">backdropStatic: false</code>.
|
|
135
|
-
</p>
|
|
136
|
-
<p class="mb-4 text-sm text-gray-600 border-l-2 border-gray-400 pl-3">
|
|
137
|
-
Click on the gray area around this modal or below it. The modal should NOT close.
|
|
138
|
-
</p>
|
|
139
|
-
<button
|
|
140
|
-
data-kt-modal-dismiss="true"
|
|
141
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm">
|
|
142
|
-
Close
|
|
143
|
-
</button>
|
|
144
|
-
</div>
|
|
145
|
-
</div>
|
|
146
|
-
|
|
147
|
-
<!-- Modal 3: persistent=false, backdropStatic=true -->
|
|
148
|
-
<div
|
|
149
|
-
id="modal-test-3"
|
|
150
|
-
class="hidden fixed inset-0 z-50 flex items-center justify-center"
|
|
151
|
-
data-kt-modal="true"
|
|
152
|
-
data-kt-modal-persistent="false"
|
|
153
|
-
data-kt-modal-backdrop-static="true">
|
|
154
|
-
<div class="bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4 border border-gray-200">
|
|
155
|
-
<h2 class="text-lg font-semibold mb-4 text-gray-900">Test Case 3</h2>
|
|
156
|
-
<p class="mb-3 text-sm text-gray-700">
|
|
157
|
-
This modal has <code class="bg-gray-100 px-1 text-xs">persistent: false</code> and
|
|
158
|
-
<code class="bg-gray-100 px-1 text-xs">backdropStatic: true</code>.
|
|
159
|
-
</p>
|
|
160
|
-
<p class="mb-4 text-sm text-gray-600">
|
|
161
|
-
Click on the gray area around this modal or below it. The modal should NOT close (backdropStatic prevents it).
|
|
162
|
-
</p>
|
|
163
|
-
<button
|
|
164
|
-
data-kt-modal-dismiss="true"
|
|
165
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm">
|
|
166
|
-
Close
|
|
167
|
-
</button>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
<!-- Modal 4: persistent=true, backdropStatic=true -->
|
|
172
|
-
<div
|
|
173
|
-
id="modal-test-4"
|
|
174
|
-
class="hidden fixed inset-0 z-50 flex items-center justify-center"
|
|
175
|
-
data-kt-modal="true"
|
|
176
|
-
data-kt-modal-persistent="true"
|
|
177
|
-
data-kt-modal-backdrop-static="true">
|
|
178
|
-
<div class="bg-white rounded-lg shadow-xl p-6 max-w-md w-full mx-4 border border-gray-200">
|
|
179
|
-
<h2 class="text-lg font-semibold mb-4 text-gray-900">Test Case 4</h2>
|
|
180
|
-
<p class="mb-3 text-sm text-gray-700">
|
|
181
|
-
This modal has <code class="bg-gray-100 px-1 text-xs">persistent: true</code> and
|
|
182
|
-
<code class="bg-gray-100 px-1 text-xs">backdropStatic: true</code>.
|
|
183
|
-
</p>
|
|
184
|
-
<p class="mb-4 text-sm text-gray-600">
|
|
185
|
-
Click on the gray area around this modal or below it. The modal should NOT close (both properties prevent it).
|
|
186
|
-
</p>
|
|
187
|
-
<button
|
|
188
|
-
data-kt-modal-dismiss="true"
|
|
189
|
-
class="px-4 py-2 bg-gray-900 text-white rounded hover:bg-gray-700 text-sm">
|
|
190
|
-
Close
|
|
191
|
-
</button>
|
|
192
|
-
</div>
|
|
193
|
-
</div>
|
|
194
|
-
|
|
195
|
-
<script src="../../dist/ktui.js"></script>
|
|
196
|
-
<script>
|
|
197
|
-
// Initialize modals
|
|
198
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
199
|
-
KTModal.init();
|
|
200
|
-
console.log('Modal test page loaded. All modals initialized.');
|
|
201
|
-
});
|
|
202
|
-
</script>
|
|
203
|
-
</body>
|
|
204
|
-
</html>
|
|
205
|
-
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
|
|
4
|
-
<head>
|
|
5
|
-
<meta charset="UTF-8">
|
|
6
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
7
|
-
<title>Issue #63: Remote Select Dropdown in Centered Modal</title>
|
|
8
|
-
<link rel="stylesheet" href="../../dist/styles.css">
|
|
9
|
-
</head>
|
|
10
|
-
|
|
11
|
-
<body class="bg-gray-50 min-h-screen">
|
|
12
|
-
<!-- Test Case 1: Remote Select in Centered Modal (Issue #63) -->
|
|
13
|
-
<div class="bg-white rounded-lg shadow p-8 w-full max-w-sm mt-10 mx-auto mb-6">
|
|
14
|
-
<button class="px-3 py-1.5 bg-gray-900 text-white rounded text-sm hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-400" data-kt-modal-toggle="#remoteSelectModal">
|
|
15
|
-
Open Remote Select Modal (Issue #63)
|
|
16
|
-
</button>
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<!-- Test Case 2: Remote Select with dropdownContainer -->
|
|
20
|
-
<div class="bg-white rounded-lg shadow p-8 w-full max-w-sm mx-auto mb-6">
|
|
21
|
-
<button class="px-3 py-1.5 bg-gray-900 text-white rounded text-sm hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-400" data-kt-modal-toggle="#remoteSelectWithContainer">
|
|
22
|
-
Open Remote Select with Container
|
|
23
|
-
</button>
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
<!-- Test Case 3: Regular Select (Control) -->
|
|
27
|
-
<div class="bg-white rounded-lg shadow p-8 w-full max-w-sm mx-auto mb-6">
|
|
28
|
-
<button class="px-3 py-1.5 bg-gray-900 text-white rounded text-sm hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-gray-400" data-kt-modal-toggle="#regularSelectModal">
|
|
29
|
-
Open Regular Select Modal
|
|
30
|
-
</button>
|
|
31
|
-
</div>
|
|
32
|
-
|
|
33
|
-
<!-- Modal 1: Remote Select in Centered Modal (Issue #63) -->
|
|
34
|
-
<div class="kt-modal kt-modal-center" data-kt-modal="true" id="remoteSelectModal">
|
|
35
|
-
<div class="kt-modal-content max-w-md">
|
|
36
|
-
<div class="kt-modal-header">
|
|
37
|
-
<h3 class="kt-modal-title">Remote Select in Centered Modal</h3>
|
|
38
|
-
<button
|
|
39
|
-
type="button"
|
|
40
|
-
class="kt-modal-close"
|
|
41
|
-
aria-label="Close modal"
|
|
42
|
-
data-kt-modal-dismiss="#remoteSelectModal"
|
|
43
|
-
>
|
|
44
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
45
|
-
<path d="M18 6 6 18"/>
|
|
46
|
-
<path d="m6 6 12 12"/>
|
|
47
|
-
</svg>
|
|
48
|
-
</button>
|
|
49
|
-
</div>
|
|
50
|
-
<div class="kt-modal-body space-y-6">
|
|
51
|
-
<div>
|
|
52
|
-
<label class="block mb-2 font-medium text-gray-700">Remote Select (Issue #63 Test)</label>
|
|
53
|
-
<select
|
|
54
|
-
class="kt-select"
|
|
55
|
-
data-kt-select="true"
|
|
56
|
-
data-kt-select-remote="true"
|
|
57
|
-
data-kt-select-data-url="https://jsonplaceholder.typicode.com/users"
|
|
58
|
-
data-kt-select-data-field-value="id"
|
|
59
|
-
data-kt-select-data-field-text="name"
|
|
60
|
-
data-kt-select-enable-search="true"
|
|
61
|
-
data-kt-select-search-param="q"
|
|
62
|
-
data-kt-select-search-min-length="2"
|
|
63
|
-
data-kt-select-search-debounce="300"
|
|
64
|
-
data-kt-select-placeholder="Search and select a user..."
|
|
65
|
-
></select>
|
|
66
|
-
</div>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<!-- Modal 2: Remote Select with dropdownContainer -->
|
|
72
|
-
<div class="kt-modal kt-modal-center" data-kt-modal="true" id="remoteSelectWithContainer">
|
|
73
|
-
<div class="kt-modal-content max-w-md">
|
|
74
|
-
<div class="kt-modal-header">
|
|
75
|
-
<h3 class="kt-modal-title">Remote Select with dropdownContainer</h3>
|
|
76
|
-
<button
|
|
77
|
-
type="button"
|
|
78
|
-
class="kt-modal-close"
|
|
79
|
-
aria-label="Close modal"
|
|
80
|
-
data-kt-modal-dismiss="#remoteSelectWithContainer"
|
|
81
|
-
>
|
|
82
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
83
|
-
<path d="M18 6 6 18"/>
|
|
84
|
-
<path d="m6 6 12 12"/>
|
|
85
|
-
</svg>
|
|
86
|
-
</button>
|
|
87
|
-
</div>
|
|
88
|
-
<div class="kt-modal-body space-y-6">
|
|
89
|
-
<div>
|
|
90
|
-
<label class="block mb-2 font-medium text-gray-700">Remote Select with dropdownContainer</label>
|
|
91
|
-
<select
|
|
92
|
-
class="kt-select"
|
|
93
|
-
data-kt-select="true"
|
|
94
|
-
data-kt-select-remote="true"
|
|
95
|
-
data-kt-select-data-url="https://jsonplaceholder.typicode.com/users"
|
|
96
|
-
data-kt-select-data-field-value="id"
|
|
97
|
-
data-kt-select-data-field-text="name"
|
|
98
|
-
data-kt-select-enable-search="true"
|
|
99
|
-
data-kt-select-search-param="q"
|
|
100
|
-
data-kt-select-search-min-length="2"
|
|
101
|
-
data-kt-select-search-debounce="300"
|
|
102
|
-
data-kt-select-placeholder="Search and select a user..."
|
|
103
|
-
data-kt-select-config='{
|
|
104
|
-
"dropdownContainer": "#remoteSelectWithContainer"
|
|
105
|
-
}'
|
|
106
|
-
></select>
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
112
|
-
<!-- Modal 3: Regular Select (Control) -->
|
|
113
|
-
<div class="kt-modal kt-modal-center" data-kt-modal="true" id="regularSelectModal">
|
|
114
|
-
<div class="kt-modal-content max-w-md">
|
|
115
|
-
<div class="kt-modal-header">
|
|
116
|
-
<h3 class="kt-modal-title">Regular Select (Control)</h3>
|
|
117
|
-
<button
|
|
118
|
-
type="button"
|
|
119
|
-
class="kt-modal-close"
|
|
120
|
-
aria-label="Close modal"
|
|
121
|
-
data-kt-modal-dismiss="#regularSelectModal"
|
|
122
|
-
>
|
|
123
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
|
124
|
-
<path d="M18 6 6 18"/>
|
|
125
|
-
<path d="m6 6 12 12"/>
|
|
126
|
-
</svg>
|
|
127
|
-
</button>
|
|
128
|
-
</div>
|
|
129
|
-
<div class="kt-modal-body space-y-6">
|
|
130
|
-
<div>
|
|
131
|
-
<label class="block mb-2 font-medium text-gray-700">Regular Select (Control)</label>
|
|
132
|
-
<select
|
|
133
|
-
class="kt-select"
|
|
134
|
-
data-kt-select="true"
|
|
135
|
-
data-kt-select-placeholder="Select an option..."
|
|
136
|
-
>
|
|
137
|
-
<option value="">Select an option...</option>
|
|
138
|
-
<option value="1">Option 1</option>
|
|
139
|
-
<option value="2">Option 2</option>
|
|
140
|
-
<option value="3">Option 3</option>
|
|
141
|
-
<option value="4">Option 4</option>
|
|
142
|
-
<option value="5">Option 5</option>
|
|
143
|
-
<option value="6">Option 6</option>
|
|
144
|
-
<option value="7">Option 7</option>
|
|
145
|
-
<option value="8">Option 8</option>
|
|
146
|
-
</select>
|
|
147
|
-
</div>
|
|
148
|
-
</div>
|
|
149
|
-
</div>
|
|
150
|
-
</div>
|
|
151
|
-
|
|
152
|
-
<script src="../../dist/ktui.js"></script>
|
|
153
|
-
<script>
|
|
154
|
-
document.addEventListener('DOMContentLoaded', function() {
|
|
155
|
-
if (window.KTModal) {
|
|
156
|
-
KTModal.init();
|
|
157
|
-
}
|
|
158
|
-
if (window.KTSelect) {
|
|
159
|
-
KTSelect.init();
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
</script>
|
|
163
|
-
</body>
|
|
164
|
-
|
|
165
|
-
</html>
|
|
166
|
-
|