@keenthemes/ktui 1.0.11 → 1.0.13
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 +1687 -1517
- package/dist/ktui.min.js +1 -1
- package/dist/ktui.min.js.map +1 -1
- package/dist/styles.css +5822 -0
- package/examples/select/avatar.html +47 -0
- package/examples/select/basic-usage.html +39 -0
- package/examples/select/combobox-icons_.html +59 -0
- package/examples/select/combobox_.html +46 -0
- package/examples/select/country.html +43 -0
- package/examples/select/description.html +53 -0
- package/examples/select/disable-option.html +37 -0
- package/examples/select/disable-select.html +35 -0
- package/examples/select/icon-multiple.html +50 -0
- package/examples/select/icon.html +48 -0
- package/examples/select/max-selection.html +38 -0
- package/examples/select/modal.html +72 -0
- package/examples/select/multiple.html +40 -0
- package/examples/select/placeholder.html +40 -0
- package/examples/select/remote-data_.html +32 -0
- package/examples/select/search.html +57 -0
- package/examples/select/sizes.html +94 -0
- package/examples/select/tags-icons_.html +58 -0
- package/examples/select/tags-selected_.html +59 -0
- package/examples/select/tags_.html +58 -0
- package/examples/select/template-customization.html +62 -0
- package/examples/toast/example.html +427 -0
- package/lib/cjs/components/datatable/datatable.js +23 -7
- package/lib/cjs/components/datatable/datatable.js.map +1 -1
- package/lib/cjs/components/select/combobox.js +94 -141
- package/lib/cjs/components/select/combobox.js.map +1 -1
- package/lib/cjs/components/select/config.js +4 -18
- package/lib/cjs/components/select/config.js.map +1 -1
- package/lib/cjs/components/select/dropdown.js +35 -138
- package/lib/cjs/components/select/dropdown.js.map +1 -1
- package/lib/cjs/components/select/index.js +2 -1
- package/lib/cjs/components/select/index.js.map +1 -1
- package/lib/cjs/components/select/option.js +56 -6
- package/lib/cjs/components/select/option.js.map +1 -1
- package/lib/cjs/components/select/remote.js +1 -37
- package/lib/cjs/components/select/remote.js.map +1 -1
- package/lib/cjs/components/select/search.js +147 -128
- package/lib/cjs/components/select/search.js.map +1 -1
- package/lib/cjs/components/select/select.js +332 -391
- package/lib/cjs/components/select/select.js.map +1 -1
- package/lib/cjs/components/select/tags.js +38 -56
- package/lib/cjs/components/select/tags.js.map +1 -1
- package/lib/cjs/components/select/templates.js +168 -200
- package/lib/cjs/components/select/templates.js.map +1 -1
- package/lib/cjs/components/select/types.js +0 -12
- package/lib/cjs/components/select/types.js.map +1 -1
- package/lib/cjs/components/select/utils.js +187 -339
- package/lib/cjs/components/select/utils.js.map +1 -1
- package/lib/cjs/components/toast/index.js +10 -0
- package/lib/cjs/components/toast/index.js.map +1 -0
- package/lib/cjs/components/toast/toast.js +543 -0
- package/lib/cjs/components/toast/toast.js.map +1 -0
- package/lib/cjs/components/toast/types.js +7 -0
- package/lib/cjs/components/toast/types.js.map +1 -0
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/datatable/datatable.js +23 -7
- package/lib/esm/components/datatable/datatable.js.map +1 -1
- package/lib/esm/components/select/combobox.js +95 -142
- package/lib/esm/components/select/combobox.js.map +1 -1
- package/lib/esm/components/select/config.js +3 -17
- package/lib/esm/components/select/config.js.map +1 -1
- package/lib/esm/components/select/dropdown.js +35 -138
- package/lib/esm/components/select/dropdown.js.map +1 -1
- package/lib/esm/components/select/index.js +1 -1
- package/lib/esm/components/select/index.js.map +1 -1
- package/lib/esm/components/select/option.js +56 -6
- package/lib/esm/components/select/option.js.map +1 -1
- package/lib/esm/components/select/remote.js +1 -37
- package/lib/esm/components/select/remote.js.map +1 -1
- package/lib/esm/components/select/search.js +148 -129
- package/lib/esm/components/select/search.js.map +1 -1
- package/lib/esm/components/select/select.js +333 -392
- package/lib/esm/components/select/select.js.map +1 -1
- package/lib/esm/components/select/tags.js +38 -56
- package/lib/esm/components/select/tags.js.map +1 -1
- package/lib/esm/components/select/templates.js +167 -199
- package/lib/esm/components/select/templates.js.map +1 -1
- package/lib/esm/components/select/types.js +1 -11
- package/lib/esm/components/select/types.js.map +1 -1
- package/lib/esm/components/select/utils.js +184 -336
- package/lib/esm/components/select/utils.js.map +1 -1
- package/lib/esm/components/toast/index.js +6 -0
- package/lib/esm/components/toast/index.js.map +1 -0
- package/lib/esm/components/toast/toast.js +540 -0
- package/lib/esm/components/toast/toast.js.map +1 -0
- package/lib/esm/components/toast/types.js +6 -0
- package/lib/esm/components/toast/types.js.map +1 -0
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/package.json +14 -9
- package/src/components/alert/alert.css +15 -2
- package/src/components/datatable/datatable.ts +25 -17
- package/src/components/input/input.css +3 -1
- package/src/components/link/link.css +2 -2
- package/src/components/scrollable/scrollable.css +9 -5
- package/src/components/select/combobox.ts +96 -192
- package/src/components/select/config.ts +35 -36
- package/src/components/select/dropdown.ts +43 -155
- package/src/components/select/index.ts +1 -1
- package/src/components/select/option.ts +50 -10
- package/src/components/select/remote.ts +2 -42
- package/src/components/select/search.ts +159 -158
- package/src/components/select/select.css +137 -18
- package/src/components/select/select.ts +354 -506
- package/src/components/select/tags.ts +37 -60
- package/src/components/select/templates.ts +254 -328
- package/src/components/select/types.ts +0 -10
- package/src/components/select/utils.ts +190 -416
- package/src/components/textarea/textarea.css +2 -1
- package/src/components/toast/index.ts +7 -0
- package/src/components/toast/toast.css +60 -0
- package/src/components/toast/toast.ts +605 -0
- package/src/components/toast/types.ts +169 -0
- package/src/index.ts +4 -0
- package/styles/main.css +3 -0
- package/styles/vars.css +138 -0
- package/styles.css +1 -0
- package/webpack.config.js +6 -1
|
@@ -13,31 +13,26 @@ var __assign = (this && this.__assign) || function () {
|
|
|
13
13
|
};
|
|
14
14
|
return __assign.apply(this, arguments);
|
|
15
15
|
};
|
|
16
|
-
import {
|
|
16
|
+
import { renderTemplateString } from './utils';
|
|
17
17
|
/**
|
|
18
18
|
* Default HTML string templates for KTSelect. All UI structure is defined here.
|
|
19
19
|
* Users can override any template by providing a matching key in the config.templates object.
|
|
20
20
|
*/
|
|
21
|
-
var
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
optionGroup: "<li role=\"group\" aria-label=\"{{label}}\" class=\"py-1\"><div class=\"px-3 py-1 text-xs font-semibold text-gray-500 uppercase\">{{label}}</div><ul>{{optionsHtml}}</ul></li>",
|
|
37
|
-
search: "<div class=\"px-3 py-2 border-b border-gray-200\"><input type=\"text\" data-kt-select-search placeholder=\"{{searchPlaceholder}}\" class=\"w-full border-none focus:outline-none text-sm\" role=\"searchbox\" aria-label=\"{{searchPlaceholder}}\"/></div>",
|
|
38
|
-
noResults: "<li class=\"px-3 py-2 text-gray-500\" role=\"status\">{{searchNotFoundText}}</li>",
|
|
39
|
-
loading: "<li class=\"px-3 py-2 text-gray-500 italic\" role=\"status\" aria-live=\"polite\">{{loadingMessage}}</li>",
|
|
40
|
-
tag: "<div data-kt-select-tag class=\"inline-flex items-center bg-blue-50 border border-blue-100 rounded px-2 py-1 text-sm mr-1 mb-1\"><span>{{title}}</span><span data-kt-select-remove-button data-value=\"{{id}}\" class=\"ml-1 text-blue-400 hover:text-blue-600 cursor-pointer\" role=\"button\" aria-label=\"Remove {{safeTitle}}\" tabindex=\"0\"><svg xmlns=\"http://www.w3.org/2000/svg\" width=\"12\" height=\"12\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line><line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line></svg></span></div>",
|
|
21
|
+
export var coreTemplateStrings = {
|
|
22
|
+
dropdown: "<div data-kt-select-dropdown class=\"kt-select-dropdown hidden {{class}}\" style=\"z-index: {{zindex}};\"></div>",
|
|
23
|
+
options: "<ul role=\"listbox\" aria-label=\"{{label}}\" class=\"kt-select-options {{class}}\" data-kt-select-options=\"true\"></ul>",
|
|
24
|
+
error: "<li class=\"kt-select-error\" role=\"alert\"></li>",
|
|
25
|
+
wrapper: "<div data-kt-select-wrapper class=\"kt-select-wrapper {{class}}\"></div>",
|
|
26
|
+
combobox: "\n\t\t<div data-kt-select-combobox data-kt-select-display class=\"kt-select-combobox {{class}}\">\n\t\t\t<div data-kt-select-combobox-values=\"true\" class=\"kt-select-combobox-values\"></div>\n\t\t\t<input class=\"kt-input kt-select-combobox-input\" data-kt-select-search=\"true\" type=\"text\" placeholder=\"{{placeholder}}\" role=\"searchbox\" aria-label=\"{{label}}\" {{disabled}} />\n\t\t\t<button type=\"button\" data-kt-select-clear-button=\"true\" class=\"kt-select-combobox-clear-btn\" aria-label=\"Clear selection\">\n\t\t\t\t<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\">\n\t\t\t\t\t<line x1=\"18\" y1=\"6\" x2=\"6\" y2=\"18\"></line>\n\t\t\t\t\t<line x1=\"6\" y1=\"6\" x2=\"18\" y2=\"18\"></line>\n\t\t\t\t</svg>\n\t\t\t</button>\n\t\t</div>\n\t",
|
|
27
|
+
placeholder: "<div data-kt-select-placeholder class=\"kt-select-placeholder {{class}}\"></div>",
|
|
28
|
+
display: "\n\t\t<div data-kt-select-display class=\"kt-select-display {{class}}\" tabindex=\"{{tabindex}}\" role=\"button\" data-selected=\"0\" aria-haspopup=\"listbox\" aria-expanded=\"false\" aria-label=\"{{label}}\" {{disabled}}>\n\t\t\t<div class=\"kt-select-option-text\" data-kt-text-container=\"true\">{{text}}</div>\n\t\t</div>\n\t",
|
|
29
|
+
option: "\n\t\t<li data-kt-select-option data-value=\"{{value}}\" data-text=\"{{text}}\" class=\"kt-select-option {{class}}\" role=\"option\" {{selected}} {{disabled}}>\n\t\t\t<div class=\"kt-select-option-text\" data-kt-text-container=\"true\">{{text}}</div><svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" class=\"size-3.5 ms-auto hidden text-primary kt-select-option-selected:block\"><path d=\"M20 6 9 17l-5-5\"/></svg>\n\t\t</li>\n\t",
|
|
30
|
+
search: "<div data-kt-select-search class=\"kt-select-search {{class}}\"><input type=\"text\" data-kt-select-search=\"true\" placeholder=\"{{searchPlaceholder}}\" class=\"kt-input kt-input-ghost\" role=\"searchbox\" aria-label=\"{{searchPlaceholder}}\"/></div>",
|
|
31
|
+
empty: "<li data-kt-select-empty class=\"kt-select-no-result {{class}}\" role=\"status\"></li>",
|
|
32
|
+
loading: "<li class=\"kt-select-loading {{class}}\" role=\"status\" aria-live=\"polite\"></li>",
|
|
33
|
+
tag: "<div data-kt-select-tag=\"true\" class=\"kt-select-tag {{class}}\"></div>",
|
|
34
|
+
loadMore: "<li class=\"kt-select-load-more {{class}}\" data-kt-select-load-more=\"true\"></li>",
|
|
35
|
+
tagRemoveButton: "<button type=\"button\" data-kt-select-remove-button class=\"kt-select-tag-remove\" aria-label=\"Remove tag\" tabindex=\"0\"><svg width=\"12\" height=\"12\" viewBox=\"0 0 12 12\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"><line x1=\"3\" y1=\"3\" x2=\"9\" y2=\"9\"/><line x1=\"9\" y1=\"3\" x2=\"3\" y2=\"9\"/></svg></button>",
|
|
41
36
|
};
|
|
42
37
|
/**
|
|
43
38
|
* Default templates for KTSelect component
|
|
@@ -67,265 +62,238 @@ export function getTemplateStrings(config) {
|
|
|
67
62
|
? config.templates
|
|
68
63
|
: undefined;
|
|
69
64
|
if (templates) {
|
|
70
|
-
return __assign(__assign(__assign({},
|
|
65
|
+
return __assign(__assign(__assign({}, coreTemplateStrings), userTemplateStrings), templates);
|
|
71
66
|
}
|
|
72
|
-
return __assign(__assign({},
|
|
67
|
+
return __assign(__assign({}, coreTemplateStrings), userTemplateStrings);
|
|
73
68
|
}
|
|
74
69
|
/**
|
|
75
70
|
* Default templates for KTSelect component
|
|
76
71
|
*/
|
|
77
72
|
export var defaultTemplates = {
|
|
78
|
-
/**
|
|
79
|
-
* Renders a highlighted text
|
|
80
|
-
*/
|
|
81
|
-
highlight: function (config, text) {
|
|
82
|
-
var template = getTemplateStrings(config).highlight;
|
|
83
|
-
var html = template.replace('{{text}}', text);
|
|
84
|
-
return stringToElement(html);
|
|
85
|
-
},
|
|
86
73
|
/**
|
|
87
74
|
* Renders the dropdown content
|
|
88
75
|
*/
|
|
89
|
-
|
|
90
|
-
var
|
|
76
|
+
dropdown: function (config) {
|
|
77
|
+
var _a;
|
|
78
|
+
var template = getTemplateStrings(config).dropdown;
|
|
79
|
+
// If a custom dropdownTemplate is provided, it's responsible for its own content.
|
|
80
|
+
// Otherwise, the base template is used, and content is appended later.
|
|
81
|
+
if (config.dropdownTemplate) {
|
|
82
|
+
var renderedCustomTemplate = renderTemplateString(config.dropdownTemplate, {
|
|
83
|
+
zindex: config.zindex ? String(config.zindex) : '',
|
|
84
|
+
// content: config.content || '', // No longer pass content to custom template directly here
|
|
85
|
+
class: config.dropdownClass || '',
|
|
86
|
+
});
|
|
87
|
+
// The custom template IS the dropdown element
|
|
88
|
+
var customDropdownEl = stringToElement(renderedCustomTemplate);
|
|
89
|
+
if (config.zindex)
|
|
90
|
+
customDropdownEl.style.zIndex = String(config.zindex);
|
|
91
|
+
if (config.dropdownClass)
|
|
92
|
+
(_a = customDropdownEl.classList).add.apply(_a, config.dropdownClass.split(' '));
|
|
93
|
+
return customDropdownEl;
|
|
94
|
+
}
|
|
91
95
|
var html = template
|
|
92
96
|
.replace('{{zindex}}', config.zindex ? String(config.zindex) : '')
|
|
93
|
-
.replace('{{content}}',
|
|
97
|
+
// .replace('{{content}}', '') // Content is no longer part of the base template string
|
|
98
|
+
.replace('{{class}}', config.dropdownClass || '');
|
|
94
99
|
return stringToElement(html);
|
|
95
100
|
},
|
|
96
101
|
/**
|
|
97
102
|
* Renders the options container for the dropdown
|
|
98
103
|
*/
|
|
99
|
-
|
|
100
|
-
var template = getTemplateStrings(config).
|
|
104
|
+
options: function (config) {
|
|
105
|
+
var template = getTemplateStrings(config).options;
|
|
101
106
|
var html = template
|
|
102
107
|
.replace('{{label}}', config.label || 'Options')
|
|
103
108
|
.replace('{{height}}', config.height ? String(config.height) : '250')
|
|
104
|
-
.replace('{{options}}',
|
|
105
|
-
|
|
106
|
-
},
|
|
107
|
-
/**
|
|
108
|
-
* Renders an empty option in the dropdown
|
|
109
|
-
*/
|
|
110
|
-
emptyOption: function (config) {
|
|
111
|
-
var template = getTemplateStrings(config).emptyOption;
|
|
112
|
-
var html = template.replace('{{placeholder}}', config.placeholder || 'Select...');
|
|
113
|
-
return stringToElement(html);
|
|
114
|
-
},
|
|
115
|
-
/**
|
|
116
|
-
* Renders an error option in the dropdown
|
|
117
|
-
*/
|
|
118
|
-
errorOption: function (config) {
|
|
119
|
-
var template = getTemplateStrings(config).errorOption;
|
|
120
|
-
var html = template.replace('{{errorMessage}}', config.errorMessage || 'An error occurred');
|
|
109
|
+
// .replace('{{options}}', '') // Options are now appended dynamically
|
|
110
|
+
.replace('{{class}}', config.optionsClass || '');
|
|
121
111
|
return stringToElement(html);
|
|
122
112
|
},
|
|
123
113
|
/**
|
|
124
114
|
* Renders the load more button for pagination
|
|
125
115
|
*/
|
|
126
116
|
loadMore: function (config) {
|
|
127
|
-
var html = getTemplateStrings(config)
|
|
128
|
-
|
|
117
|
+
var html = getTemplateStrings(config)
|
|
118
|
+
.loadMore // .replace('{{loadMoreText}}', config.loadMoreText || 'Load more...') // Content is no longer in template string
|
|
119
|
+
.replace('{{class}}', config.loadMoreClass || '');
|
|
120
|
+
var element = stringToElement(html);
|
|
121
|
+
element.textContent = config.loadMoreText || 'Load more...';
|
|
122
|
+
return element;
|
|
129
123
|
},
|
|
130
124
|
/**
|
|
131
125
|
* Renders an error message in the dropdown
|
|
132
126
|
*/
|
|
133
127
|
error: function (config) {
|
|
128
|
+
// Changed return type to HTMLElement
|
|
134
129
|
var template = getTemplateStrings(config).error;
|
|
135
|
-
|
|
130
|
+
var html = template
|
|
131
|
+
// .replace('{{errorMessage}}', config.errorMessage || 'An error occurred') // Content is no longer in template string
|
|
132
|
+
.replace('{{class}}', config.errorClass || '');
|
|
133
|
+
var element = stringToElement(html);
|
|
134
|
+
element.textContent = config.errorMessage || 'An error occurred';
|
|
135
|
+
return element;
|
|
136
136
|
},
|
|
137
137
|
/**
|
|
138
138
|
* Renders the main container for the select component
|
|
139
139
|
*/
|
|
140
|
-
|
|
141
|
-
var html = getTemplateStrings(config).
|
|
142
|
-
|
|
140
|
+
wrapper: function (config) {
|
|
141
|
+
var html = getTemplateStrings(config).wrapper.replace('{{class}}', config.wrapperClass || '');
|
|
142
|
+
var element = stringToElement(html);
|
|
143
|
+
element.setAttribute('data-kt-select-combobox', config.combobox ? 'true' : 'false');
|
|
144
|
+
element.setAttribute('data-kt-select-tags', config.tags ? 'true' : 'false');
|
|
145
|
+
return element;
|
|
143
146
|
},
|
|
144
147
|
/**
|
|
145
148
|
* Renders the display element (trigger) for the select
|
|
146
149
|
*/
|
|
147
150
|
display: function (config) {
|
|
148
|
-
var isCombobox = config.mode === SelectMode.COMBOBOX;
|
|
149
|
-
if (isCombobox) {
|
|
150
|
-
var html_1 = getTemplateStrings(config)
|
|
151
|
-
.displayCombobox.replace(/{{placeholder}}/g, config.placeholder || 'Select...')
|
|
152
|
-
.replace(/{{label}}/g, config.label || config.placeholder || 'Select...')
|
|
153
|
-
.replace('{{disabled}}', config.disabled ? 'disabled' : '');
|
|
154
|
-
return stringToElement(html_1);
|
|
155
|
-
}
|
|
156
151
|
var html = getTemplateStrings(config)
|
|
157
152
|
.display.replace('{{tabindex}}', config.disabled ? '-1' : '0')
|
|
158
153
|
.replace('{{label}}', config.label || config.placeholder || 'Select...')
|
|
159
154
|
.replace('{{disabled}}', config.disabled ? 'aria-disabled="true"' : '')
|
|
160
|
-
.replace('{{placeholder}}', config.placeholder || 'Select...')
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
dropdown: function (config, optionsHtml) {
|
|
167
|
-
var isCombobox = config.mode === SelectMode.COMBOBOX;
|
|
168
|
-
var hasSearch = config.enableSearch && !isCombobox;
|
|
169
|
-
var template = getTemplateStrings(config).dropdown;
|
|
170
|
-
var searchHtml = '';
|
|
171
|
-
if (hasSearch) {
|
|
172
|
-
var searchElement = defaultTemplates.search(config);
|
|
173
|
-
searchHtml = searchElement.outerHTML;
|
|
155
|
+
.replace('{{placeholder}}', config.placeholder || 'Select...')
|
|
156
|
+
.replace('{{class}}', config.displayClass || '');
|
|
157
|
+
var element = stringToElement(html);
|
|
158
|
+
// Add data-multiple attribute if in multiple select mode
|
|
159
|
+
if (config.multiple) {
|
|
160
|
+
element.setAttribute('data-multiple', 'true');
|
|
174
161
|
}
|
|
175
|
-
|
|
176
|
-
.replace('{{search}}', searchHtml)
|
|
177
|
-
.replace('{{options}}', optionsHtml)
|
|
178
|
-
.replace('{{label}}', config.label || 'Options')
|
|
179
|
-
.replace('{{height}}', config.height ? String(config.height) : '250');
|
|
180
|
-
return stringToElement(html);
|
|
162
|
+
return element;
|
|
181
163
|
},
|
|
182
164
|
/**
|
|
183
165
|
* Renders a single option
|
|
184
166
|
*/
|
|
185
167
|
option: function (option, config) {
|
|
168
|
+
var _a, _b;
|
|
186
169
|
var isHtmlOption = option instanceof HTMLOptionElement;
|
|
187
|
-
var
|
|
188
|
-
var text = isHtmlOption ? option.text : option.title;
|
|
189
|
-
var disabled = isHtmlOption
|
|
190
|
-
? option.disabled
|
|
191
|
-
: option.disabled === true;
|
|
192
|
-
var selected = isHtmlOption
|
|
193
|
-
? option.selected
|
|
194
|
-
: !!option.selected;
|
|
195
|
-
// Prefer data-kt-select-option (JSON) if present
|
|
196
|
-
var description;
|
|
197
|
-
var icon;
|
|
170
|
+
var optionData;
|
|
198
171
|
if (isHtmlOption) {
|
|
199
|
-
|
|
200
|
-
if
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
icon = optionData === null || optionData === void 0 ? void 0 : optionData.icon;
|
|
205
|
-
}
|
|
206
|
-
catch (e) {
|
|
207
|
-
// fallback to legacy attributes if JSON is invalid
|
|
208
|
-
description =
|
|
209
|
-
option.getAttribute('data-kt-select-option-description') ||
|
|
210
|
-
undefined;
|
|
211
|
-
icon = option.getAttribute('data-kt-select-option-icon') || undefined;
|
|
212
|
-
}
|
|
213
|
-
}
|
|
214
|
-
else {
|
|
215
|
-
description =
|
|
216
|
-
option.getAttribute('data-kt-select-option-description') || undefined;
|
|
217
|
-
icon = option.getAttribute('data-kt-select-option-icon') || undefined;
|
|
218
|
-
}
|
|
172
|
+
// If it's a plain HTMLOptionElement, construct data similarly to how KTSelectOption would
|
|
173
|
+
// This branch might be less common if KTSelectOption instances are always used for rendering.
|
|
174
|
+
var el = option;
|
|
175
|
+
var textContent = el.textContent || '';
|
|
176
|
+
optionData = __assign({ value: el.value, text: textContent, selected: el.selected, disabled: el.disabled, content: textContent }, (((_a = config.optionsConfig) === null || _a === void 0 ? void 0 : _a[el.value]) || {}));
|
|
219
177
|
}
|
|
220
178
|
else {
|
|
221
|
-
|
|
222
|
-
|
|
179
|
+
// If it's a KTSelectOption class instance (from './option')
|
|
180
|
+
// which should have the getOptionDataForTemplate method.
|
|
181
|
+
optionData = option.getOptionDataForTemplate();
|
|
223
182
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
.
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
.
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
var
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return stringToElement(html);
|
|
253
|
-
},
|
|
254
|
-
/**
|
|
255
|
-
* Renders an option group with header
|
|
256
|
-
*/
|
|
257
|
-
optionGroup: function (label, optionsHtml, config) {
|
|
258
|
-
var html = getTemplateStrings(config)
|
|
259
|
-
.optionGroup.replace(/{{label}}/g, label)
|
|
260
|
-
.replace('{{optionsHtml}}', optionsHtml);
|
|
261
|
-
return stringToElement(html);
|
|
183
|
+
var content = optionData.text; // Default content to option's text
|
|
184
|
+
if (config.optionTemplate) {
|
|
185
|
+
// Use the user-provided template string, rendering with the full optionData.
|
|
186
|
+
// renderTemplateString will replace {{key}} with values from optionData.
|
|
187
|
+
content = renderTemplateString(config.optionTemplate, optionData);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
content = optionData.text || optionData.content; // Prefer explicit text, fallback to content
|
|
191
|
+
}
|
|
192
|
+
// Use the core option template string as the base structure.
|
|
193
|
+
var baseTemplate = getTemplateStrings(config).option;
|
|
194
|
+
var optionClasses = [config.optionClass || ''];
|
|
195
|
+
if (optionData.disabled) {
|
|
196
|
+
optionClasses.push('disabled');
|
|
197
|
+
}
|
|
198
|
+
// Populate the base template for the <li> attributes.
|
|
199
|
+
// The actual display content (text or custom HTML) will be set on the inner span later.
|
|
200
|
+
var html = renderTemplateString(baseTemplate, __assign(__assign({}, optionData), { class: optionClasses.join(' ').trim() || '', selected: optionData.selected
|
|
201
|
+
? 'aria-selected="true"'
|
|
202
|
+
: 'aria-selected="false"', disabled: optionData.disabled ? 'aria-disabled="true"' : '', content: content }));
|
|
203
|
+
var element = stringToElement(html);
|
|
204
|
+
// If a custom option template is provided, replace the element's innerHTML with the content.
|
|
205
|
+
if (config.optionTemplate) {
|
|
206
|
+
element.innerHTML = content;
|
|
207
|
+
}
|
|
208
|
+
// Ensure data-text attribute is set to the original, clean text for searching/filtering
|
|
209
|
+
element.setAttribute('data-text', ((_b = optionData === null || optionData === void 0 ? void 0 : optionData.text) === null || _b === void 0 ? void 0 : _b.trim()) || '');
|
|
210
|
+
return element;
|
|
262
211
|
},
|
|
263
212
|
/**
|
|
264
213
|
* Renders the search input
|
|
265
214
|
*/
|
|
266
215
|
search: function (config) {
|
|
267
|
-
var html = getTemplateStrings(config)
|
|
216
|
+
var html = getTemplateStrings(config)
|
|
217
|
+
.search.replace('{{searchPlaceholder}}', config.searchPlaceholder || 'Search...')
|
|
218
|
+
.replace('{{class}}', config.searchClass || '');
|
|
268
219
|
return stringToElement(html);
|
|
269
220
|
},
|
|
270
221
|
/**
|
|
271
222
|
* Renders the no results message
|
|
272
223
|
*/
|
|
273
|
-
|
|
274
|
-
var html = getTemplateStrings(config).
|
|
275
|
-
|
|
224
|
+
empty: function (config) {
|
|
225
|
+
var html = getTemplateStrings(config).empty.replace('{{class}}', config.emptyClass || '');
|
|
226
|
+
var element = stringToElement(html);
|
|
227
|
+
element.textContent = config.searchNotFoundText || 'No results found';
|
|
228
|
+
return element;
|
|
276
229
|
},
|
|
277
230
|
/**
|
|
278
231
|
* Renders the loading state
|
|
279
232
|
*/
|
|
280
233
|
loading: function (config, loadingMessage) {
|
|
281
|
-
var html = getTemplateStrings(config).loading.replace('{{
|
|
282
|
-
|
|
234
|
+
var html = getTemplateStrings(config).loading.replace('{{class}}', config.loadingClass || '');
|
|
235
|
+
var element = stringToElement(html);
|
|
236
|
+
element.textContent = loadingMessage || 'Loading options...';
|
|
237
|
+
return element;
|
|
283
238
|
},
|
|
284
239
|
/**
|
|
285
240
|
* Renders a tag for multi-select
|
|
286
241
|
*/
|
|
287
242
|
tag: function (option, config) {
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
243
|
+
var _a;
|
|
244
|
+
var template = getTemplateStrings(config).tag;
|
|
245
|
+
var preparedContent = option.title; // Default content is the option's title
|
|
246
|
+
if (config.tagTemplate) {
|
|
247
|
+
var tagTemplateString_1 = config.tagTemplate;
|
|
248
|
+
var optionValue = option.getAttribute('data-value') || option.value;
|
|
249
|
+
// Replace all {{varname}} in option.innerHTML with values from _config.optionsConfig
|
|
250
|
+
Object.entries(((_a = config.optionsConfig) === null || _a === void 0 ? void 0 : _a[optionValue]) || {}).forEach(function (_a) {
|
|
251
|
+
var key = _a[0], val = _a[1];
|
|
252
|
+
if (typeof val === 'string' ||
|
|
253
|
+
typeof val === 'number' ||
|
|
254
|
+
typeof val === 'boolean') {
|
|
255
|
+
tagTemplateString_1 = tagTemplateString_1.replace(new RegExp("{{".concat(key, "}}"), 'g'), String(val));
|
|
256
|
+
}
|
|
299
257
|
});
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
258
|
+
// Render the custom tag template with option data
|
|
259
|
+
preparedContent = renderTemplateString(tagTemplateString_1, {
|
|
260
|
+
title: option.title,
|
|
261
|
+
id: option.id,
|
|
262
|
+
class: config.tagClass || '', // This class is for content, not the main tag div
|
|
263
|
+
// content: option.innerHTML, // Avoid direct innerHTML from option due to potential XSS
|
|
264
|
+
text: option.innerText || option.textContent || '',
|
|
265
|
+
value: optionValue,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
// Append the remove button HTML string to the prepared content
|
|
269
|
+
preparedContent += getTemplateStrings(config).tagRemoveButton;
|
|
270
|
+
var html = template
|
|
271
|
+
// .replace('{{title}}', option.title) // Title is part of preparedContent if using custom template
|
|
272
|
+
// .replace('{{id}}', option.id) // ID is part of preparedContent if using custom template
|
|
273
|
+
.replace('{{class}}', config.tagClass || ''); // Class for the main tag div
|
|
274
|
+
var element = stringToElement(html);
|
|
275
|
+
element.innerHTML = preparedContent; // Set the fully prepared content (text/HTML + remove button)
|
|
276
|
+
return element;
|
|
308
277
|
},
|
|
309
278
|
/**
|
|
310
|
-
*
|
|
279
|
+
* Renders the placeholder for the select
|
|
311
280
|
*/
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
return "".concat(count, " ").concat(count === 1 ? 'item' : 'items', " selected");
|
|
324
|
-
}
|
|
325
|
-
return selectedOptions.map(function (option) { return option.title; }).join(', ');
|
|
281
|
+
placeholder: function (config) {
|
|
282
|
+
var html = getTemplateStrings(config).placeholder.replace('{{class}}', config.placeholderClass || '');
|
|
283
|
+
var content = config.placeholder || 'Select...';
|
|
284
|
+
if (config.placeholderTemplate) {
|
|
285
|
+
content = renderTemplateString(config.placeholderTemplate, {
|
|
286
|
+
placeholder: config.placeholder || 'Select...',
|
|
287
|
+
class: config.placeholderClass || '',
|
|
288
|
+
});
|
|
289
|
+
var element = stringToElement(html);
|
|
290
|
+
element.innerHTML = content; // For templates, content can be HTML
|
|
291
|
+
return element;
|
|
326
292
|
}
|
|
327
293
|
else {
|
|
328
|
-
|
|
294
|
+
var element = stringToElement(html);
|
|
295
|
+
element.textContent = content; // For simple text, use textContent
|
|
296
|
+
return element;
|
|
329
297
|
}
|
|
330
298
|
},
|
|
331
299
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../../src/components/select/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;AAGH,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"templates.js","sourceRoot":"","sources":["../../../../src/components/select/templates.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;AAGH,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE/C;;;GAGG;AACH,MAAM,CAAC,IAAM,mBAAmB,GAAG;IAClC,QAAQ,EAAE,kHAA8G;IACxH,OAAO,EAAE,2HAAmH;IAC5H,KAAK,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CAAC,IAAI,CAAC,CAAC;YACtC,OAAO,CAAC,SAAS,GAAG,OAAO,CAAC,CAAC,qCAAqC;YAClE,OAAO,OAAO,CAAC;QAChB,CAAC;aAAM,CAAC;YACP,IAAM,OAAO,GAAG,eAAe,CAAC,IAAI,CAAC,CAAC;YACtC,OAAO,CAAC,WAAW,GAAG,OAAO,CAAC,CAAC,mCAAmC;YAClE,OAAO,OAAO,CAAC;QAChB,CAAC;IACF,CAAC;CACD,CAAC"}
|
|
@@ -2,15 +2,5 @@
|
|
|
2
2
|
* KTUI - Free & Open-Source Tailwind UI Components by Keenthemes
|
|
3
3
|
* Copyright 2025 by Keenthemes Inc
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
* Common type interfaces for the KTSelect component
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* Select mode options
|
|
10
|
-
*/
|
|
11
|
-
export var SelectMode;
|
|
12
|
-
(function (SelectMode) {
|
|
13
|
-
SelectMode["TAGS"] = "tags";
|
|
14
|
-
SelectMode["COMBOBOX"] = "combobox";
|
|
15
|
-
})(SelectMode || (SelectMode = {}));
|
|
5
|
+
export {};
|
|
16
6
|
//# sourceMappingURL=types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/select/types.ts"],"names":[],"mappings":"AAAA;;;GAGG
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/select/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|