@keenthemes/ktui 1.0.10 → 1.0.12
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/README.md +2 -2
- package/dist/ktui.js +1283 -1100
- package/dist/ktui.min.js +1 -1
- package/dist/ktui.min.js.map +1 -1
- package/examples/select/basic-usage.html +43 -0
- package/examples/select/combobox-icons.html +58 -0
- package/examples/select/combobox.html +46 -0
- package/examples/select/description.html +69 -0
- package/examples/select/disable-option.html +43 -0
- package/examples/select/disable-select.html +34 -0
- package/examples/select/icon-description.html +56 -0
- package/examples/select/icon-multiple.html +58 -0
- package/examples/select/icon.html +58 -0
- package/examples/select/max-selection.html +39 -0
- package/examples/select/modal.html +70 -0
- package/examples/select/multiple.html +42 -0
- package/examples/select/placeholder.html +43 -0
- package/examples/select/remote-data.html +32 -0
- package/examples/select/search.html +49 -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 +65 -0
- package/examples/select/test.html +94 -0
- package/examples/toast/example.html +427 -0
- package/lib/cjs/components/component.js +1 -1
- package/lib/cjs/components/component.js.map +1 -1
- package/lib/cjs/components/datatable/datatable.js +22 -6
- package/lib/cjs/components/datatable/datatable.js.map +1 -1
- package/lib/cjs/components/modal/modal.js +0 -4
- package/lib/cjs/components/modal/modal.js.map +1 -1
- package/lib/cjs/components/select/combobox.js +38 -120
- package/lib/cjs/components/select/combobox.js.map +1 -1
- package/lib/cjs/components/select/config.js +4 -16
- package/lib/cjs/components/select/config.js.map +1 -1
- package/lib/cjs/components/select/dropdown.js +10 -49
- 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 +21 -4
- 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 +11 -41
- package/lib/cjs/components/select/search.js.map +1 -1
- package/lib/cjs/components/select/select.js +213 -326
- package/lib/cjs/components/select/select.js.map +1 -1
- package/lib/cjs/components/select/tags.js +39 -31
- package/lib/cjs/components/select/tags.js.map +1 -1
- package/lib/cjs/components/select/templates.js +120 -179
- 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 +204 -257
- 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/helpers/dom.js +24 -0
- package/lib/cjs/helpers/dom.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/esm/components/component.js +1 -1
- package/lib/esm/components/component.js.map +1 -1
- package/lib/esm/components/datatable/datatable.js +22 -6
- package/lib/esm/components/datatable/datatable.js.map +1 -1
- package/lib/esm/components/modal/modal.js +0 -4
- package/lib/esm/components/modal/modal.js.map +1 -1
- package/lib/esm/components/select/combobox.js +39 -121
- package/lib/esm/components/select/combobox.js.map +1 -1
- package/lib/esm/components/select/config.js +3 -15
- package/lib/esm/components/select/config.js.map +1 -1
- package/lib/esm/components/select/dropdown.js +10 -49
- 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 +21 -4
- 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 +12 -42
- package/lib/esm/components/select/search.js.map +1 -1
- package/lib/esm/components/select/select.js +214 -327
- package/lib/esm/components/select/select.js.map +1 -1
- package/lib/esm/components/select/tags.js +39 -31
- package/lib/esm/components/select/tags.js.map +1 -1
- package/lib/esm/components/select/templates.js +119 -178
- 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 +201 -255
- 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/helpers/dom.js +24 -0
- package/lib/esm/helpers/dom.js.map +1 -1
- package/lib/esm/index.js +3 -0
- package/lib/esm/index.js.map +1 -1
- package/package.json +8 -6
- package/src/components/alert/alert.css +20 -2
- package/src/components/badge/badge.css +5 -0
- package/src/components/component.ts +4 -0
- package/src/components/datatable/datatable.ts +24 -16
- package/src/components/drawer/drawer.css +1 -1
- package/src/components/input/input.css +3 -1
- package/src/components/link/link.css +2 -2
- package/src/components/modal/modal.css +18 -2
- package/src/components/modal/modal.ts +0 -5
- package/src/components/select/combobox.ts +42 -149
- package/src/components/select/config.ts +38 -33
- package/src/components/select/dropdown.ts +8 -55
- package/src/components/select/index.ts +1 -1
- package/src/components/select/option.ts +28 -7
- package/src/components/select/remote.ts +2 -42
- package/src/components/select/search.ts +14 -54
- package/src/components/select/select.css +49 -0
- package/src/components/select/select.ts +231 -437
- package/src/components/select/tags.ts +40 -37
- package/src/components/select/templates.ts +166 -303
- package/src/components/select/types.ts +0 -10
- package/src/components/select/utils.ts +214 -304
- package/src/components/table/table.css +1 -1
- 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/helpers/dom.ts +30 -0
- package/src/index.ts +4 -0
- package/styles/main.css +3 -0
- package/styles/vars.css +138 -0
- package/styles.css +1 -0
|
@@ -13,31 +13,27 @@ 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
|
-
|
|
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}};\">{{content}}</div>",
|
|
23
|
+
options: "<ul role=\"listbox\" aria-label=\"{{label}}\" class=\"kt-select-options {{class}}\" data-kt-select-options=\"true\">{{content}}</ul>",
|
|
24
|
+
error: "<li class=\"kt-select-error\" role=\"alert\">{{content}}</li>",
|
|
25
|
+
highlight: "<span data-kt-select-highlight class=\"kt-select-highlight highlighted {{class}}\">{{text}}</span>",
|
|
26
|
+
wrapper: "<div data-kt-select-wrapper class=\"kt-select-wrapper {{class}}\"></div>",
|
|
27
|
+
combobox: "\n\t\t<div data-kt-select-combobox data-kt-select-display class=\"kt-select-combobox {{class}}\">\n\t\t\t<input class=\"kt-input kt-select-combobox-input\" data-kt-select-search=\"true\" data-kt-select-value=\"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",
|
|
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 data-kt-select-value=\"true\" class=\"kt-select-label\">{{content}}</div>\n\t\t</div>\n\t",
|
|
29
|
+
placeholder: "<div data-kt-select-placeholder class=\"kt-select-placeholder {{class}}\">{{content}}</div>",
|
|
30
|
+
option: "<li data-kt-select-option data-value=\"{{value}}\" data-text=\"{{text}}\" class=\"kt-select-option {{class}}\" role=\"option\" {{selected}} {{disabled}}>{{content}}</li>",
|
|
31
|
+
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-select-search-input\" role=\"searchbox\" aria-label=\"{{searchPlaceholder}}\"/></div>",
|
|
32
|
+
empty: "<li data-kt-select-empty class=\"kt-select-no-result {{class}}\" role=\"status\">{{content}}</li>",
|
|
33
|
+
loading: "<li class=\"kt-select-loading {{class}}\" role=\"status\" aria-live=\"polite\">{{content}}</li>",
|
|
34
|
+
tag: "<div data-kt-select-tag=\"true\" class=\"kt-select-tag {{class}}\">\n\t\t\t{{content}}\n\t\t</div>",
|
|
35
|
+
loadMore: "<li class=\"kt-select-load-more {{class}}\" data-kt-select-load-more=\"true\">{{content}}</li>",
|
|
36
|
+
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
37
|
};
|
|
42
38
|
/**
|
|
43
39
|
* Default templates for KTSelect component
|
|
@@ -67,9 +63,9 @@ export function getTemplateStrings(config) {
|
|
|
67
63
|
? config.templates
|
|
68
64
|
: undefined;
|
|
69
65
|
if (templates) {
|
|
70
|
-
return __assign(__assign(__assign({},
|
|
66
|
+
return __assign(__assign(__assign({}, coreTemplateStrings), userTemplateStrings), templates);
|
|
71
67
|
}
|
|
72
|
-
return __assign(__assign({},
|
|
68
|
+
return __assign(__assign({}, coreTemplateStrings), userTemplateStrings);
|
|
73
69
|
}
|
|
74
70
|
/**
|
|
75
71
|
* Default templates for KTSelect component
|
|
@@ -80,44 +76,38 @@ export var defaultTemplates = {
|
|
|
80
76
|
*/
|
|
81
77
|
highlight: function (config, text) {
|
|
82
78
|
var template = getTemplateStrings(config).highlight;
|
|
83
|
-
var html = template.replace('{{text}}', text);
|
|
79
|
+
var html = template.replace('{{text}}', text).replace('{{class}}', config.highlightClass || '');
|
|
84
80
|
return stringToElement(html);
|
|
85
81
|
},
|
|
86
82
|
/**
|
|
87
83
|
* Renders the dropdown content
|
|
88
84
|
*/
|
|
89
|
-
|
|
90
|
-
var template = getTemplateStrings(config).
|
|
85
|
+
dropdown: function (config) {
|
|
86
|
+
var template = getTemplateStrings(config).dropdown;
|
|
87
|
+
var content = config.content || '';
|
|
88
|
+
if (config.dropdownTemplate) {
|
|
89
|
+
content = renderTemplateString(config.dropdownTemplate, {
|
|
90
|
+
zindex: config.zindex ? String(config.zindex) : '',
|
|
91
|
+
content: config.content || '',
|
|
92
|
+
class: config.dropdownClass || '',
|
|
93
|
+
});
|
|
94
|
+
}
|
|
91
95
|
var html = template
|
|
92
96
|
.replace('{{zindex}}', config.zindex ? String(config.zindex) : '')
|
|
93
|
-
.replace('{{content}}',
|
|
97
|
+
.replace('{{content}}', content)
|
|
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}}', config.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}}', config.options || '')
|
|
110
|
+
.replace('{{class}}', config.optionsClass || '');
|
|
121
111
|
return stringToElement(html);
|
|
122
112
|
},
|
|
123
113
|
/**
|
|
@@ -132,51 +122,41 @@ export var defaultTemplates = {
|
|
|
132
122
|
*/
|
|
133
123
|
error: function (config) {
|
|
134
124
|
var template = getTemplateStrings(config).error;
|
|
135
|
-
return template
|
|
125
|
+
return template
|
|
126
|
+
.replace('{{errorMessage}}', config.errorMessage || 'An error occurred')
|
|
127
|
+
.replace('{{class}}', config.errorClass || '');
|
|
136
128
|
},
|
|
137
129
|
/**
|
|
138
130
|
* Renders the main container for the select component
|
|
139
131
|
*/
|
|
140
|
-
|
|
141
|
-
var html = getTemplateStrings(config).
|
|
142
|
-
|
|
132
|
+
wrapper: function (config) {
|
|
133
|
+
var html = getTemplateStrings(config).wrapper
|
|
134
|
+
.replace('{{class}}', config.wrapperClass || '');
|
|
135
|
+
var element = stringToElement(html);
|
|
136
|
+
element.setAttribute('data-kt-select-combobox', config.combobox ? 'true' : 'false');
|
|
137
|
+
element.setAttribute('data-kt-select-tags', config.tags ? 'true' : 'false');
|
|
138
|
+
return element;
|
|
143
139
|
},
|
|
144
140
|
/**
|
|
145
141
|
* Renders the display element (trigger) for the select
|
|
146
142
|
*/
|
|
147
143
|
display: function (config) {
|
|
148
|
-
|
|
149
|
-
if (isCombobox) {
|
|
144
|
+
if (config.combobox) {
|
|
150
145
|
var html_1 = getTemplateStrings(config)
|
|
151
|
-
.
|
|
146
|
+
.combobox.replace(/{{placeholder}}/g, config.placeholder || 'Select...')
|
|
152
147
|
.replace(/{{label}}/g, config.label || config.placeholder || 'Select...')
|
|
153
|
-
.replace('{{disabled}}', config.disabled ? 'disabled' : '')
|
|
148
|
+
.replace('{{disabled}}', config.disabled ? 'disabled' : '')
|
|
149
|
+
.replace('{{class}}', config.displayClass || '');
|
|
154
150
|
return stringToElement(html_1);
|
|
155
151
|
}
|
|
156
|
-
var
|
|
157
|
-
|
|
152
|
+
var content = config.label || config.placeholder || 'Select...';
|
|
153
|
+
var html = getTemplateStrings(config).display
|
|
154
|
+
.replace('{{tabindex}}', config.disabled ? '-1' : '0')
|
|
158
155
|
.replace('{{label}}', config.label || config.placeholder || 'Select...')
|
|
159
156
|
.replace('{{disabled}}', config.disabled ? 'aria-disabled="true"' : '')
|
|
160
|
-
.replace('{{placeholder}}', config.placeholder || 'Select...')
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* Renders the dropdown content container
|
|
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;
|
|
174
|
-
}
|
|
175
|
-
var html = template
|
|
176
|
-
.replace('{{search}}', searchHtml)
|
|
177
|
-
.replace('{{options}}', optionsHtml)
|
|
178
|
-
.replace('{{label}}', config.label || 'Options')
|
|
179
|
-
.replace('{{height}}', config.height ? String(config.height) : '250');
|
|
157
|
+
.replace('{{placeholder}}', config.placeholder || 'Select...')
|
|
158
|
+
.replace('{{class}}', config.displayClass || '')
|
|
159
|
+
.replace('{{content}}', content);
|
|
180
160
|
return stringToElement(html);
|
|
181
161
|
},
|
|
182
162
|
/**
|
|
@@ -192,141 +172,102 @@ export var defaultTemplates = {
|
|
|
192
172
|
var selected = isHtmlOption
|
|
193
173
|
? option.selected
|
|
194
174
|
: !!option.selected;
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
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
|
-
}
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
description = option.description;
|
|
222
|
-
icon = option.icon;
|
|
175
|
+
var content = text;
|
|
176
|
+
if (config.optionTemplate) {
|
|
177
|
+
// Use the user template to render the content, but only for {{content}}
|
|
178
|
+
content = renderTemplateString(config.optionTemplate, {
|
|
179
|
+
value: value,
|
|
180
|
+
text: text,
|
|
181
|
+
class: config.optionClass || '',
|
|
182
|
+
selected: selected ? 'aria-selected="true"' : 'aria-selected="false"',
|
|
183
|
+
disabled: disabled ? 'aria-disabled="true"' : '',
|
|
184
|
+
content: text,
|
|
185
|
+
});
|
|
223
186
|
}
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
var html = getTemplateStrings(config)
|
|
228
|
-
.option.replace('{{value}}', value)
|
|
229
|
-
.replace('{{selectedClass}}', selectedClass)
|
|
230
|
-
.replace('{{disabledClass}}', disabledClass)
|
|
187
|
+
var html = getTemplateStrings(config).option
|
|
188
|
+
.replace('{{value}}', value)
|
|
189
|
+
.replace('{{text}}', text)
|
|
231
190
|
.replace('{{selected}}', selected ? 'aria-selected="true"' : 'aria-selected="false"')
|
|
232
191
|
.replace('{{disabled}}', disabled ? 'aria-disabled="true"' : '')
|
|
233
|
-
.replace(
|
|
234
|
-
.replace('{{
|
|
235
|
-
.replace(/{{description}}/g, description
|
|
236
|
-
? defaultTemplates.description(description, config).outerHTML
|
|
237
|
-
: '');
|
|
238
|
-
return stringToElement(html);
|
|
239
|
-
},
|
|
240
|
-
/**
|
|
241
|
-
* Renders an icon
|
|
242
|
-
*/
|
|
243
|
-
icon: function (icon, config) {
|
|
244
|
-
var html = getTemplateStrings(config).icon.replace('{{icon}}', icon);
|
|
245
|
-
return stringToElement(html);
|
|
246
|
-
},
|
|
247
|
-
/**
|
|
248
|
-
* Renders a description
|
|
249
|
-
*/
|
|
250
|
-
description: function (description, config) {
|
|
251
|
-
var html = getTemplateStrings(config).description.replace('{{description}}', description);
|
|
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);
|
|
192
|
+
.replace('{{content}}', content)
|
|
193
|
+
.replace('{{class}}', config.optionClass || '');
|
|
261
194
|
return stringToElement(html);
|
|
262
195
|
},
|
|
263
196
|
/**
|
|
264
197
|
* Renders the search input
|
|
265
198
|
*/
|
|
266
199
|
search: function (config) {
|
|
267
|
-
var html = getTemplateStrings(config)
|
|
200
|
+
var html = getTemplateStrings(config)
|
|
201
|
+
.search.replace('{{searchPlaceholder}}', config.searchPlaceholder || 'Search...')
|
|
202
|
+
.replace('{{class}}', config.searchClass || '');
|
|
268
203
|
return stringToElement(html);
|
|
269
204
|
},
|
|
270
205
|
/**
|
|
271
206
|
* Renders the no results message
|
|
272
207
|
*/
|
|
273
|
-
|
|
274
|
-
var html = getTemplateStrings(config)
|
|
208
|
+
empty: function (config) {
|
|
209
|
+
var html = getTemplateStrings(config)
|
|
210
|
+
.empty.replace('{{searchNotFoundText}}', config.searchNotFoundText || 'No results found')
|
|
211
|
+
.replace('{{class}}', config.emptyClass || '');
|
|
275
212
|
return stringToElement(html);
|
|
276
213
|
},
|
|
277
214
|
/**
|
|
278
215
|
* Renders the loading state
|
|
279
216
|
*/
|
|
280
217
|
loading: function (config, loadingMessage) {
|
|
281
|
-
var html = getTemplateStrings(config)
|
|
218
|
+
var html = getTemplateStrings(config)
|
|
219
|
+
.loading.replace('{{loadingMessage}}', loadingMessage || 'Loading options...')
|
|
220
|
+
.replace('{{class}}', config.loadingClass || '');
|
|
282
221
|
return stringToElement(html);
|
|
283
222
|
},
|
|
284
223
|
/**
|
|
285
224
|
* Renders a tag for multi-select
|
|
286
225
|
*/
|
|
287
226
|
tag: function (option, config) {
|
|
288
|
-
|
|
289
|
-
var
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
227
|
+
var template = getTemplateStrings(config).tag;
|
|
228
|
+
var content = option.title;
|
|
229
|
+
if (config.tagTemplate) {
|
|
230
|
+
var tagTemplate_1 = config.tagTemplate;
|
|
231
|
+
var text = option.getAttribute('data-text');
|
|
232
|
+
var value = option.getAttribute('data-value');
|
|
233
|
+
// Replace all {{varname}} in option.innerHTML with values from _config
|
|
234
|
+
Object.entries(config.optionsConfig[value] || {}).forEach(function (_a) {
|
|
235
|
+
var key = _a[0], value = _a[1];
|
|
236
|
+
if (typeof value === 'string' || typeof value === 'number' || typeof value === 'boolean') {
|
|
237
|
+
tagTemplate_1 = tagTemplate_1.replace(new RegExp("{{".concat(key, "}}"), 'g'), String(value));
|
|
238
|
+
}
|
|
299
239
|
});
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
240
|
+
content = renderTemplateString(tagTemplate_1, {
|
|
241
|
+
title: option.title,
|
|
242
|
+
id: option.id,
|
|
243
|
+
class: config.tagClass || '',
|
|
244
|
+
content: option.innerHTML,
|
|
245
|
+
text: option.innerText,
|
|
246
|
+
});
|
|
247
|
+
}
|
|
248
|
+
content += getTemplateStrings(config).tagRemoveButton;
|
|
249
|
+
var html = template
|
|
250
|
+
.replace('{{title}}', option.title)
|
|
305
251
|
.replace('{{id}}', option.id)
|
|
306
|
-
.replace('{{
|
|
252
|
+
.replace('{{content}}', content)
|
|
253
|
+
.replace('{{class}}', config.tagClass || '');
|
|
307
254
|
return stringToElement(html);
|
|
308
255
|
},
|
|
309
256
|
/**
|
|
310
|
-
*
|
|
257
|
+
* Renders the placeholder for the select
|
|
311
258
|
*/
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
if (config.
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
}
|
|
321
|
-
if (config.showSelectedCount) {
|
|
322
|
-
var count = selectedOptions.length;
|
|
323
|
-
return "".concat(count, " ").concat(count === 1 ? 'item' : 'items', " selected");
|
|
324
|
-
}
|
|
325
|
-
return selectedOptions.map(function (option) { return option.title; }).join(', ');
|
|
326
|
-
}
|
|
327
|
-
else {
|
|
328
|
-
return selectedOptions[0].title;
|
|
259
|
+
placeholder: function (config) {
|
|
260
|
+
var html = getTemplateStrings(config)
|
|
261
|
+
.placeholder.replace('{{class}}', config.placeholderClass || '');
|
|
262
|
+
var content = config.placeholder || 'Select...';
|
|
263
|
+
if (config.placeholderTemplate) {
|
|
264
|
+
content = renderTemplateString(config.placeholderTemplate, {
|
|
265
|
+
placeholder: config.placeholder || 'Select...',
|
|
266
|
+
class: config.placeholderClass || '',
|
|
267
|
+
});
|
|
329
268
|
}
|
|
269
|
+
html = html.replace('{{content}}', content);
|
|
270
|
+
return stringToElement(html);
|
|
330
271
|
},
|
|
331
272
|
};
|
|
332
273
|
//# sourceMappingURL=templates.js.map
|
|
@@ -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,6HAAyH;IACnI,OAAO,EAAE,sIAA8H;IACvI,KAAK,EAAE,+DAA2D;IAClE,SAAS,EAAE,oGAAkG;IAC7G,OAAO,EAAE,0EAAwE;IACjF,QAAQ,EAAE,+0BAUT;IACD,OAAO,EAAE,sUAIR;IACD,WAAW,EAAE,6FAA2F;IACxG,MAAM,EAAE,2KAAmK;IAC3K,MAAM,EAAE,qQAAuP;IAC/P,KAAK,EAAE,mGAA+F;IACtG,OAAO,EAAE,iGAA2F;IACpG,GAAG,EAAE,oGAEG;IACR,QAAQ,EAAE,gGAA4F;IACtG,eAAe,EAAE,mVAA+S;CAChU,CAAC;AAsDF;;GAEG;AACH,SAAS,eAAe,CAAC,IAAY;IACpC,IAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC;IACpD,QAAQ,CAAC,SAAS,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACjC,OAAO,QAAQ,CAAC,OA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I,IAAI,GAAG,kBAAkB,CAAC,MAAM,CAAC;aACnC,WAAW,CAAC,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC;QAElE,IAAI,OAAO,GAAG,MAAM,CAAC,WAAW,IAAI,WAAW,CAAC;QAEhD,IAAI,MAAM,CAAC,mBAAmB,EAAE,CAAC;YAChC,OAAO,GAAG,oBAAoB,CAAC,MAAM,CAAC,mBAAmB,EAAE;gBAC1D,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,WAAW;gBAC9C,KAAK,EAAE,MAAM,CAAC,gBAAgB,IAAI,EAAE;aACpC,CAAC,CAAC;QACJ,CAAC;QAED,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QAC5C,OAAO,eAAe,CAAC,IAAI,CAAC,CAAC;IAC9B,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"}
|