@keenthemes/ktui 1.0.22 → 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 +18 -8
- package/dist/ktui.min.js +1 -1
- package/dist/ktui.min.js.map +1 -1
- package/dist/styles.css +159 -1
- package/examples/select/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/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/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/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
|
@@ -12492,8 +12492,10 @@ var KTSelect = /** @class */ (function (_super) {
|
|
|
12492
12492
|
// Options are selected.
|
|
12493
12493
|
if (tagsEnabled) {
|
|
12494
12494
|
// Tags are enabled AND options are selected: tags module has rendered them.
|
|
12495
|
-
//
|
|
12496
|
-
|
|
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
|
|
12497
12499
|
}
|
|
12498
12500
|
else {
|
|
12499
12501
|
// Tags are not enabled AND options are selected: render normal text display.
|
|
@@ -12562,6 +12564,10 @@ var KTSelect = /** @class */ (function (_super) {
|
|
|
12562
12564
|
KTSelect.prototype.clearSelection = function () {
|
|
12563
12565
|
// Clear the current selection
|
|
12564
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
|
+
});
|
|
12565
12571
|
this.updateSelectedOptionDisplay();
|
|
12566
12572
|
this._updateSelectedOptionClass();
|
|
12567
12573
|
// Update select all button state
|
|
@@ -15219,12 +15225,16 @@ var KTSelectTags = /** @class */ (function () {
|
|
|
15219
15225
|
var wrapper = this._valueDisplayElement.parentElement;
|
|
15220
15226
|
if (!wrapper)
|
|
15221
15227
|
return;
|
|
15222
|
-
//
|
|
15223
|
-
Array.from(wrapper.querySelectorAll('[data-kt-select-tag]')).forEach(function (tag) { return tag.remove(); });
|
|
15224
|
-
// If no options selected, do nothing (let display show placeholder)
|
|
15228
|
+
// If no options selected, ensure placeholder is shown
|
|
15225
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);
|
|
15226
15234
|
return;
|
|
15227
15235
|
}
|
|
15236
|
+
// Clear all existing content before adding tags
|
|
15237
|
+
this._valueDisplayElement.innerHTML = '';
|
|
15228
15238
|
// Insert each tag before the display element
|
|
15229
15239
|
selectedOptions.forEach(function (optionValue) {
|
|
15230
15240
|
// Find the original option element (in dropdown or select)
|
|
@@ -15258,8 +15268,8 @@ var KTSelectTags = /** @class */ (function () {
|
|
|
15258
15268
|
_this._removeTag(optionValue);
|
|
15259
15269
|
});
|
|
15260
15270
|
}
|
|
15261
|
-
// Insert tag
|
|
15262
|
-
|
|
15271
|
+
// Insert tag inside the display element
|
|
15272
|
+
_this._valueDisplayElement.appendChild(tag);
|
|
15263
15273
|
});
|
|
15264
15274
|
};
|
|
15265
15275
|
/**
|
|
@@ -16900,7 +16910,7 @@ exports.defaultTemplates = {
|
|
|
16900
16910
|
tag: function (option, config) {
|
|
16901
16911
|
var _a;
|
|
16902
16912
|
var template = getTemplateStrings(config).tag;
|
|
16903
|
-
var preparedContent = option.
|
|
16913
|
+
var preparedContent = option.textContent || option.innerText || option.value || ''; // Default content is the option's text
|
|
16904
16914
|
if (config.tagTemplate) {
|
|
16905
16915
|
var tagTemplateString_1 = config.tagTemplate;
|
|
16906
16916
|
var optionValue = option.getAttribute('data-value') || option.value;
|