@keenthemes/ktui 1.0.21 → 1.0.23
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/dist/ktui.js +23 -12
- package/dist/ktui.min.js +1 -1
- package/dist/ktui.min.js.map +1 -1
- package/dist/styles.css +181 -1
- package/examples/datatable/sorting-test.html +398 -0
- package/examples/select/modal.html +3 -1
- package/examples/select/{remote-data_.html → remote-data.html} +13 -12
- package/examples/select/tags-enhanced.html +86 -0
- package/examples/select/{tags-icons_.html → tags-icons.html} +1 -2
- package/examples/select/template-customization.html +0 -1
- package/lib/cjs/components/datatable/datatable.js +4 -0
- package/lib/cjs/components/datatable/datatable.js.map +1 -1
- package/lib/cjs/components/select/dropdown.js +1 -4
- package/lib/cjs/components/select/dropdown.js.map +1 -1
- package/lib/cjs/components/select/select.js +8 -2
- package/lib/cjs/components/select/select.js.map +1 -1
- package/lib/cjs/components/select/tags.js +9 -5
- package/lib/cjs/components/select/tags.js.map +1 -1
- package/lib/cjs/components/select/templates.js +1 -1
- package/lib/cjs/components/select/templates.js.map +1 -1
- package/lib/esm/components/datatable/datatable.js +4 -0
- package/lib/esm/components/datatable/datatable.js.map +1 -1
- package/lib/esm/components/select/dropdown.js +1 -4
- package/lib/esm/components/select/dropdown.js.map +1 -1
- package/lib/esm/components/select/select.js +8 -2
- package/lib/esm/components/select/select.js.map +1 -1
- package/lib/esm/components/select/tags.js +9 -5
- package/lib/esm/components/select/tags.js.map +1 -1
- package/lib/esm/components/select/templates.js +1 -1
- package/lib/esm/components/select/templates.js.map +1 -1
- package/package.json +1 -1
- package/src/components/datatable/datatable.ts +5 -0
- package/src/components/select/dropdown.ts +1 -3
- package/src/components/select/select.css +44 -0
- package/src/components/select/select.ts +10 -2
- package/src/components/select/tags.ts +10 -8
- package/src/components/select/templates.ts +1 -1
- package/examples/select/combobox-icons_.html +0 -59
- package/examples/select/combobox_.html +0 -46
- package/examples/select/tags-selected_.html +0 -59
- package/examples/select/tags_.html +0 -58
- package/examples/select/test-optimizations.html +0 -227
- package/examples/select/test-remote-search.html +0 -151
package/dist/ktui.js
CHANGED
|
@@ -8126,6 +8126,10 @@ var KTDataTable = /** @class */ (function (_super) {
|
|
|
8126
8126
|
this._element.classList.add('datatable-initialized');
|
|
8127
8127
|
// Initialize checkbox logic
|
|
8128
8128
|
this._checkbox.init();
|
|
8129
|
+
// Re-initialize sort handler to restore click listeners after table redraw
|
|
8130
|
+
if (this._sortHandler) {
|
|
8131
|
+
this._sortHandler.initSort();
|
|
8132
|
+
}
|
|
8129
8133
|
this._attachSearchEvent();
|
|
8130
8134
|
if (typeof index_1.default !== 'undefined') {
|
|
8131
8135
|
index_1.default.init();
|
|
@@ -9849,16 +9853,13 @@ var KTSelectDropdown = /** @class */ (function (_super) {
|
|
|
9849
9853
|
};
|
|
9850
9854
|
KTSelectDropdown.prototype._resolveDropdownContainer = function () {
|
|
9851
9855
|
var containerSelector = this._config.dropdownContainer;
|
|
9852
|
-
if (containerSelector
|
|
9856
|
+
if (containerSelector) {
|
|
9853
9857
|
var containerElement = document.querySelector(containerSelector);
|
|
9854
9858
|
if (!containerElement && this._config.debug) {
|
|
9855
9859
|
console.warn("KTSelectDropdown: dropdownContainer selector \"".concat(containerSelector, "\" not found. Dropdown will remain in its default position."));
|
|
9856
9860
|
}
|
|
9857
9861
|
return containerElement;
|
|
9858
9862
|
}
|
|
9859
|
-
else if (containerSelector === 'body') {
|
|
9860
|
-
return document.body;
|
|
9861
|
-
}
|
|
9862
9863
|
return null;
|
|
9863
9864
|
};
|
|
9864
9865
|
return KTSelectDropdown;
|
|
@@ -12491,8 +12492,10 @@ var KTSelect = /** @class */ (function (_super) {
|
|
|
12491
12492
|
// Options are selected.
|
|
12492
12493
|
if (tagsEnabled) {
|
|
12493
12494
|
// Tags are enabled AND options are selected: tags module has rendered them.
|
|
12494
|
-
//
|
|
12495
|
-
|
|
12495
|
+
// Completely clear all content to avoid redundancy with tags
|
|
12496
|
+
// Don't touch the innerHTML here as tags module manages it
|
|
12497
|
+
// Just ensure no text content is generated
|
|
12498
|
+
return; // Exit early to prevent any text generation
|
|
12496
12499
|
}
|
|
12497
12500
|
else {
|
|
12498
12501
|
// Tags are not enabled AND options are selected: render normal text display.
|
|
@@ -12561,6 +12564,10 @@ var KTSelect = /** @class */ (function (_super) {
|
|
|
12561
12564
|
KTSelect.prototype.clearSelection = function () {
|
|
12562
12565
|
// Clear the current selection
|
|
12563
12566
|
this._state.setSelectedOptions([]);
|
|
12567
|
+
// Clear all native select options
|
|
12568
|
+
Array.from(this._element.querySelectorAll('option')).forEach(function (opt) {
|
|
12569
|
+
opt.selected = false;
|
|
12570
|
+
});
|
|
12564
12571
|
this.updateSelectedOptionDisplay();
|
|
12565
12572
|
this._updateSelectedOptionClass();
|
|
12566
12573
|
// Update select all button state
|
|
@@ -15218,12 +15225,16 @@ var KTSelectTags = /** @class */ (function () {
|
|
|
15218
15225
|
var wrapper = this._valueDisplayElement.parentElement;
|
|
15219
15226
|
if (!wrapper)
|
|
15220
15227
|
return;
|
|
15221
|
-
//
|
|
15222
|
-
Array.from(wrapper.querySelectorAll('[data-kt-select-tag]')).forEach(function (tag) { return tag.remove(); });
|
|
15223
|
-
// If no options selected, do nothing (let display show placeholder)
|
|
15228
|
+
// If no options selected, ensure placeholder is shown
|
|
15224
15229
|
if (selectedOptions.length === 0) {
|
|
15230
|
+
// Clear any existing content and show placeholder
|
|
15231
|
+
this._valueDisplayElement.innerHTML = '';
|
|
15232
|
+
var placeholderEl = templates_1.defaultTemplates.placeholder(this._config);
|
|
15233
|
+
this._valueDisplayElement.appendChild(placeholderEl);
|
|
15225
15234
|
return;
|
|
15226
15235
|
}
|
|
15236
|
+
// Clear all existing content before adding tags
|
|
15237
|
+
this._valueDisplayElement.innerHTML = '';
|
|
15227
15238
|
// Insert each tag before the display element
|
|
15228
15239
|
selectedOptions.forEach(function (optionValue) {
|
|
15229
15240
|
// Find the original option element (in dropdown or select)
|
|
@@ -15257,8 +15268,8 @@ var KTSelectTags = /** @class */ (function () {
|
|
|
15257
15268
|
_this._removeTag(optionValue);
|
|
15258
15269
|
});
|
|
15259
15270
|
}
|
|
15260
|
-
// Insert tag
|
|
15261
|
-
|
|
15271
|
+
// Insert tag inside the display element
|
|
15272
|
+
_this._valueDisplayElement.appendChild(tag);
|
|
15262
15273
|
});
|
|
15263
15274
|
};
|
|
15264
15275
|
/**
|
|
@@ -16899,7 +16910,7 @@ exports.defaultTemplates = {
|
|
|
16899
16910
|
tag: function (option, config) {
|
|
16900
16911
|
var _a;
|
|
16901
16912
|
var template = getTemplateStrings(config).tag;
|
|
16902
|
-
var preparedContent = option.
|
|
16913
|
+
var preparedContent = option.textContent || option.innerText || option.value || ''; // Default content is the option's text
|
|
16903
16914
|
if (config.tagTemplate) {
|
|
16904
16915
|
var tagTemplateString_1 = config.tagTemplate;
|
|
16905
16916
|
var optionValue = option.getAttribute('data-value') || option.value;
|