@keenthemes/ktui 1.0.11 → 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/dist/ktui.js +1283 -1096
- 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/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/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 +15 -2
- package/src/components/component.ts +4 -0
- package/src/components/datatable/datatable.ts +24 -16
- package/src/components/input/input.css +3 -1
- package/src/components/link/link.css +2 -2
- 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/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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/toast/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,540 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* KTUI - Free & Open-Source Tailwind UI Components by Keenthemes
|
|
3
|
+
* Copyright 2025 by Keenthemes Inc
|
|
4
|
+
*/
|
|
5
|
+
var __extends = (this && this.__extends) || (function () {
|
|
6
|
+
var extendStatics = function (d, b) {
|
|
7
|
+
extendStatics = Object.setPrototypeOf ||
|
|
8
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
9
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
10
|
+
return extendStatics(d, b);
|
|
11
|
+
};
|
|
12
|
+
return function (d, b) {
|
|
13
|
+
if (typeof b !== "function" && b !== null)
|
|
14
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
15
|
+
extendStatics(d, b);
|
|
16
|
+
function __() { this.constructor = d; }
|
|
17
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
var __assign = (this && this.__assign) || function () {
|
|
21
|
+
__assign = Object.assign || function(t) {
|
|
22
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
23
|
+
s = arguments[i];
|
|
24
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
25
|
+
t[p] = s[p];
|
|
26
|
+
}
|
|
27
|
+
return t;
|
|
28
|
+
};
|
|
29
|
+
return __assign.apply(this, arguments);
|
|
30
|
+
};
|
|
31
|
+
import KTComponent from '../component';
|
|
32
|
+
import KTData from '../../helpers/data';
|
|
33
|
+
var DEFAULT_CONFIG = {
|
|
34
|
+
position: 'top-end',
|
|
35
|
+
duration: 4000,
|
|
36
|
+
className: '',
|
|
37
|
+
maxToasts: 5,
|
|
38
|
+
offset: 15,
|
|
39
|
+
gap: 10,
|
|
40
|
+
};
|
|
41
|
+
var DEFAULT_TOAST_OPTIONS = {
|
|
42
|
+
appearance: 'solid',
|
|
43
|
+
progress: false,
|
|
44
|
+
size: 'md',
|
|
45
|
+
action: false,
|
|
46
|
+
cancel: false,
|
|
47
|
+
dismiss: true,
|
|
48
|
+
};
|
|
49
|
+
var KTToast = /** @class */ (function (_super) {
|
|
50
|
+
__extends(KTToast, _super);
|
|
51
|
+
/**
|
|
52
|
+
* Creates a new KTToast instance for a specific element (not commonly used; most use static API).
|
|
53
|
+
* @param element The target HTML element.
|
|
54
|
+
* @param config Optional toast config for this instance.
|
|
55
|
+
*/
|
|
56
|
+
function KTToast(element, config) {
|
|
57
|
+
var _this = _super.call(this) || this;
|
|
58
|
+
_this._name = 'toast';
|
|
59
|
+
_this._defaultConfig = DEFAULT_CONFIG;
|
|
60
|
+
_this._config = DEFAULT_CONFIG;
|
|
61
|
+
_this._defaultToastOptions = DEFAULT_TOAST_OPTIONS;
|
|
62
|
+
if (KTData.has(element, _this._name))
|
|
63
|
+
return _this;
|
|
64
|
+
_this._init(element);
|
|
65
|
+
_this._buildConfig(config);
|
|
66
|
+
KTData.set(element, _this._name, _this);
|
|
67
|
+
return _this;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Generates the HTML content for a toast based on the provided options.
|
|
71
|
+
* @param options Toast options (message, icon, actions, etc).
|
|
72
|
+
* @returns The toast's HTML markup as a string.
|
|
73
|
+
*/
|
|
74
|
+
KTToast.getContent = function (options) {
|
|
75
|
+
var classNames = __assign(__assign({}, (this.globalConfig.classNames || {})), ((options === null || options === void 0 ? void 0 : options.classNames) || {}));
|
|
76
|
+
if (options === null || options === void 0 ? void 0 : options.content) {
|
|
77
|
+
if (typeof options.content === 'string') {
|
|
78
|
+
return options.content;
|
|
79
|
+
}
|
|
80
|
+
else if (typeof options.content === 'function') {
|
|
81
|
+
var node = options.content();
|
|
82
|
+
if (node instanceof HTMLElement) {
|
|
83
|
+
return node.outerHTML;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (options.content instanceof HTMLElement) {
|
|
87
|
+
return options.content.outerHTML;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
var template = '';
|
|
91
|
+
if (options === null || options === void 0 ? void 0 : options.icon) {
|
|
92
|
+
template +=
|
|
93
|
+
'<div class="kt-alert-icon ' +
|
|
94
|
+
(classNames.icon || '') +
|
|
95
|
+
'">' +
|
|
96
|
+
options.icon +
|
|
97
|
+
'</div>';
|
|
98
|
+
}
|
|
99
|
+
if (options === null || options === void 0 ? void 0 : options.message) {
|
|
100
|
+
template +=
|
|
101
|
+
'<div class="kt-alert-title ' +
|
|
102
|
+
(classNames.message || '') +
|
|
103
|
+
'">' +
|
|
104
|
+
options.message +
|
|
105
|
+
'</div>';
|
|
106
|
+
}
|
|
107
|
+
if ((options === null || options === void 0 ? void 0 : options.action) !== false ||
|
|
108
|
+
(options === null || options === void 0 ? void 0 : options.dismiss) !== false ||
|
|
109
|
+
(options === null || options === void 0 ? void 0 : options.cancel) !== false) {
|
|
110
|
+
template +=
|
|
111
|
+
'<div class="kt-alert-toolbar ' + (classNames.toolbar || '') + '">';
|
|
112
|
+
template +=
|
|
113
|
+
'<div class="kt-alert-actions ' + (classNames.actions || '') + '">';
|
|
114
|
+
if ((options === null || options === void 0 ? void 0 : options.action) && typeof options.action === 'object') {
|
|
115
|
+
template +=
|
|
116
|
+
'<button data-kt-toast-action="true" class="' +
|
|
117
|
+
(options.action.className || '') +
|
|
118
|
+
'">' +
|
|
119
|
+
options.action.label +
|
|
120
|
+
'</button>';
|
|
121
|
+
}
|
|
122
|
+
if ((options === null || options === void 0 ? void 0 : options.cancel) && typeof options.cancel === 'object') {
|
|
123
|
+
template +=
|
|
124
|
+
'<button data-kt-toast-cancel="true" class="' +
|
|
125
|
+
(options.cancel.className || '') +
|
|
126
|
+
'">' +
|
|
127
|
+
options.cancel.label +
|
|
128
|
+
'</button>';
|
|
129
|
+
}
|
|
130
|
+
if ((options === null || options === void 0 ? void 0 : options.dismiss) !== false) {
|
|
131
|
+
template +=
|
|
132
|
+
'<button data-kt-toast-dismiss="true" class="kt-alert-close"><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>';
|
|
133
|
+
}
|
|
134
|
+
template += '</div>';
|
|
135
|
+
template += '</div>';
|
|
136
|
+
}
|
|
137
|
+
template += '</div>';
|
|
138
|
+
return template;
|
|
139
|
+
};
|
|
140
|
+
/**
|
|
141
|
+
* Update all toasts in the container with smooth animation.
|
|
142
|
+
*
|
|
143
|
+
* @param container The toast container element.
|
|
144
|
+
* @param offset Optional offset from the edge.
|
|
145
|
+
*/
|
|
146
|
+
KTToast.update = function (container, offset) {
|
|
147
|
+
var _this = this;
|
|
148
|
+
var _a;
|
|
149
|
+
if (!container)
|
|
150
|
+
return;
|
|
151
|
+
offset =
|
|
152
|
+
typeof offset === 'number' ? offset : ((_a = this.globalConfig.offset) !== null && _a !== void 0 ? _a : 15);
|
|
153
|
+
requestAnimationFrame(function () {
|
|
154
|
+
var _a;
|
|
155
|
+
var gap = (_a = _this.globalConfig.gap) !== null && _a !== void 0 ? _a : 8;
|
|
156
|
+
// Group toasts by alignment (top/bottom)
|
|
157
|
+
var positionGroups = {
|
|
158
|
+
top: [],
|
|
159
|
+
bottom: [],
|
|
160
|
+
};
|
|
161
|
+
var toasts = Array.from(container.children);
|
|
162
|
+
toasts.forEach(function (toast) {
|
|
163
|
+
if (toast.classList.contains('kt-toast-top-end') ||
|
|
164
|
+
toast.classList.contains('kt-toast-top-center') ||
|
|
165
|
+
toast.classList.contains('kt-toast-top-start')) {
|
|
166
|
+
positionGroups.top.push(toast);
|
|
167
|
+
}
|
|
168
|
+
else {
|
|
169
|
+
positionGroups.bottom.push(toast);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
// Stack top toasts from the top down
|
|
173
|
+
var currentOffset = offset;
|
|
174
|
+
positionGroups.top.forEach(function (toast) {
|
|
175
|
+
toast.style.top = "".concat(currentOffset, "px");
|
|
176
|
+
toast.style.bottom = '';
|
|
177
|
+
toast.style.transition =
|
|
178
|
+
'top 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s cubic-bezier(.4,0,.2,1)';
|
|
179
|
+
currentOffset += toast.offsetHeight + gap;
|
|
180
|
+
if (toast.classList.contains('kt-toast-top-start')) {
|
|
181
|
+
toast.style.insetInlineStart = "".concat(offset, "px");
|
|
182
|
+
}
|
|
183
|
+
if (toast.classList.contains('kt-toast-top-end')) {
|
|
184
|
+
toast.style.insetInlineEnd = "".concat(offset, "px");
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
// Stack bottom toasts from the bottom up
|
|
188
|
+
currentOffset = offset;
|
|
189
|
+
for (var i = positionGroups.bottom.length - 1; i >= 0; i--) {
|
|
190
|
+
var toast = positionGroups.bottom[i];
|
|
191
|
+
toast.style.bottom = "".concat(currentOffset, "px");
|
|
192
|
+
toast.style.top = '';
|
|
193
|
+
toast.style.transition =
|
|
194
|
+
'bottom 0.28s cubic-bezier(.4,0,.2,1), opacity 0.28s cubic-bezier(.4,0,.2,1)';
|
|
195
|
+
currentOffset += toast.offsetHeight + gap;
|
|
196
|
+
if (toast.classList.contains('kt-toast-bottom-start')) {
|
|
197
|
+
toast.style.insetInlineStart = "".concat(offset, "px");
|
|
198
|
+
}
|
|
199
|
+
if (toast.classList.contains('kt-toast-bottom-end')) {
|
|
200
|
+
toast.style.insetInlineEnd = "".concat(offset, "px");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
};
|
|
205
|
+
/**
|
|
206
|
+
* Set global toast configuration options.
|
|
207
|
+
* @param options Partial toast config to merge with global config.
|
|
208
|
+
*/
|
|
209
|
+
KTToast.config = function (options) {
|
|
210
|
+
this.globalConfig = __assign(__assign({}, this.globalConfig), options);
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Show a toast notification.
|
|
214
|
+
* @param inputOptions Toast options (message, duration, variant, etc).
|
|
215
|
+
* @returns Toast instance with dismiss method, or undefined if invalid input.
|
|
216
|
+
*/
|
|
217
|
+
KTToast.show = function (inputOptions) {
|
|
218
|
+
var _a, _b, _c, _d;
|
|
219
|
+
var options = __assign(__assign({}, DEFAULT_TOAST_OPTIONS), inputOptions);
|
|
220
|
+
if (!options || (!options.message && !options.content)) {
|
|
221
|
+
return undefined;
|
|
222
|
+
}
|
|
223
|
+
// Always resolve the id once and use it everywhere
|
|
224
|
+
var id = "kt-toast-".concat(Date.now(), "-").concat(Math.random().toString(36).slice(2, 8));
|
|
225
|
+
var position = options.position || this.globalConfig.position || 'top-end';
|
|
226
|
+
var classNames = __assign(__assign({}, (this.globalConfig.classNames || {})), (options.classNames || {}));
|
|
227
|
+
var container = this.containerMap.get(position);
|
|
228
|
+
if (!container) {
|
|
229
|
+
container = document.createElement('div');
|
|
230
|
+
var classNames_1 = __assign(__assign({}, (this.globalConfig.classNames || {})), (options.classNames || {}));
|
|
231
|
+
// Fallback to default hardcoded classes if not provided in options or globalConfig
|
|
232
|
+
container.className =
|
|
233
|
+
classNames_1.container || "kt-toast-container ".concat(position);
|
|
234
|
+
document.body.appendChild(container);
|
|
235
|
+
this.containerMap.set(position, container);
|
|
236
|
+
}
|
|
237
|
+
// Enforce maxToasts
|
|
238
|
+
if (container.children.length >=
|
|
239
|
+
(this.globalConfig.maxToasts || DEFAULT_CONFIG.maxToasts)) {
|
|
240
|
+
var firstToast_1 = container.firstElementChild;
|
|
241
|
+
if (firstToast_1) {
|
|
242
|
+
firstToast_1.classList.add('kt-toast-closing');
|
|
243
|
+
firstToast_1.addEventListener('animationend', function () {
|
|
244
|
+
firstToast_1.remove();
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
// Create toast element
|
|
249
|
+
var variantMap = {
|
|
250
|
+
info: 'kt-alert-info',
|
|
251
|
+
success: 'kt-alert-success',
|
|
252
|
+
error: 'kt-alert-error',
|
|
253
|
+
warning: 'kt-alert-warning',
|
|
254
|
+
primary: 'kt-alert-primary',
|
|
255
|
+
secondary: 'kt-alert-secondary',
|
|
256
|
+
destructive: 'kt-alert-destructive',
|
|
257
|
+
mono: 'kt-alert-mono',
|
|
258
|
+
};
|
|
259
|
+
var appearanceMap = {
|
|
260
|
+
solid: 'kt-alert-solid',
|
|
261
|
+
outline: 'kt-alert-outline',
|
|
262
|
+
light: 'kt-alert-light',
|
|
263
|
+
};
|
|
264
|
+
var sizeMap = {
|
|
265
|
+
sm: 'kt-alert-sm',
|
|
266
|
+
md: 'kt-alert-md',
|
|
267
|
+
lg: 'kt-alert-lg',
|
|
268
|
+
};
|
|
269
|
+
var toast = document.createElement('div');
|
|
270
|
+
toast.className = "kt-toast kt-alert ".concat(variantMap[options.variant] || '', " ").concat(appearanceMap[options.appearance] || '', " ").concat(sizeMap[options.size] || '', " ").concat(options.className || '', " ").concat(classNames.toast || '');
|
|
271
|
+
// ARIA support
|
|
272
|
+
toast.setAttribute('role', options.role || 'status');
|
|
273
|
+
toast.setAttribute('aria-live', 'polite');
|
|
274
|
+
toast.setAttribute('aria-atomic', 'true');
|
|
275
|
+
toast.setAttribute('tabindex', '0');
|
|
276
|
+
// Always resolve the id once and use it everywhere
|
|
277
|
+
// Always resolve id ONCE at the top, use everywhere
|
|
278
|
+
// (Move this up to replace the previous const id = ... assignment)
|
|
279
|
+
// Populate content via getContent
|
|
280
|
+
var contentHtml = KTToast.getContent(options);
|
|
281
|
+
toast.innerHTML = contentHtml;
|
|
282
|
+
// Assign event handlers to buttons by data attribute
|
|
283
|
+
var actionBtn = toast.querySelector('[data-kt-toast-action]');
|
|
284
|
+
if (actionBtn &&
|
|
285
|
+
options.action &&
|
|
286
|
+
typeof options.action === 'object' &&
|
|
287
|
+
options.action.onClick) {
|
|
288
|
+
actionBtn.addEventListener('click', function (e) {
|
|
289
|
+
e.stopPropagation();
|
|
290
|
+
if (typeof options.action === 'object' && options.action.onClick) {
|
|
291
|
+
options.action.onClick(id);
|
|
292
|
+
KTToast.close(id);
|
|
293
|
+
}
|
|
294
|
+
});
|
|
295
|
+
}
|
|
296
|
+
var cancelBtn = toast.querySelector('[data-kt-toast-cancel]');
|
|
297
|
+
if (cancelBtn && options.cancel && typeof options.cancel === 'object') {
|
|
298
|
+
cancelBtn.addEventListener('click', function (e) {
|
|
299
|
+
e.stopPropagation();
|
|
300
|
+
if (typeof options.cancel === 'object' && options.cancel.onClick) {
|
|
301
|
+
options.cancel.onClick(id);
|
|
302
|
+
KTToast.close(id);
|
|
303
|
+
}
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
// Dismiss button handler
|
|
307
|
+
var dismissBtn = toast.querySelector('[data-kt-toast-dismiss]');
|
|
308
|
+
if (dismissBtn && options.dismiss !== false) {
|
|
309
|
+
dismissBtn.addEventListener('click', function (e) {
|
|
310
|
+
e.stopPropagation();
|
|
311
|
+
KTToast.close(id);
|
|
312
|
+
});
|
|
313
|
+
}
|
|
314
|
+
// If modal-like, set aria-modal
|
|
315
|
+
if (options.important)
|
|
316
|
+
toast.setAttribute('aria-modal', 'true');
|
|
317
|
+
toast.style.pointerEvents = 'auto';
|
|
318
|
+
// Progress line
|
|
319
|
+
var duration = options.important
|
|
320
|
+
? null
|
|
321
|
+
: ((_b = (_a = options.duration) !== null && _a !== void 0 ? _a : this.globalConfig.duration) !== null && _b !== void 0 ? _b : DEFAULT_CONFIG.duration);
|
|
322
|
+
if (duration && options.progress) {
|
|
323
|
+
var progress = document.createElement('div');
|
|
324
|
+
progress.className = 'kt-toast-progress ' + (classNames.progress || '');
|
|
325
|
+
progress.style.animationDuration = duration + 'ms';
|
|
326
|
+
progress.setAttribute('data-kt-toast-progress', 'true');
|
|
327
|
+
toast.appendChild(progress);
|
|
328
|
+
}
|
|
329
|
+
// Assign direction class to the toast itself, not the container
|
|
330
|
+
var directionClassMap = {
|
|
331
|
+
'top-end': 'kt-toast-top-end',
|
|
332
|
+
'top-center': 'kt-toast-top-center',
|
|
333
|
+
'top-start': 'kt-toast-top-start',
|
|
334
|
+
'bottom-end': 'kt-toast-bottom-end',
|
|
335
|
+
'bottom-center': 'kt-toast-bottom-center',
|
|
336
|
+
'bottom-start': 'kt-toast-bottom-start',
|
|
337
|
+
};
|
|
338
|
+
Object.values(directionClassMap).forEach(function (cls) {
|
|
339
|
+
return toast.classList.remove(cls);
|
|
340
|
+
});
|
|
341
|
+
var dirClass = directionClassMap[position] || 'kt-toast-top-end';
|
|
342
|
+
toast.classList.add(dirClass);
|
|
343
|
+
// Enforce maxToasts: remove oldest if needed
|
|
344
|
+
var maxToasts = (_d = (_c = options.maxToasts) !== null && _c !== void 0 ? _c : this.globalConfig.maxToasts) !== null && _d !== void 0 ? _d : DEFAULT_CONFIG.maxToasts;
|
|
345
|
+
var currentToasts = Array.from(container.children);
|
|
346
|
+
if (currentToasts.length >= maxToasts && currentToasts.length > 0) {
|
|
347
|
+
var oldestToast = currentToasts[currentToasts.length - 1];
|
|
348
|
+
var oldestId = oldestToast.getAttribute('data-kt-toast-id');
|
|
349
|
+
if (oldestId) {
|
|
350
|
+
KTToast.close(oldestId);
|
|
351
|
+
}
|
|
352
|
+
else {
|
|
353
|
+
oldestToast.remove();
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
// Insert toast at the top
|
|
357
|
+
container.insertBefore(toast, container.firstChild);
|
|
358
|
+
KTToast.update(container);
|
|
359
|
+
// Play beep if requested
|
|
360
|
+
if (options.beep) {
|
|
361
|
+
try {
|
|
362
|
+
// Use Web Audio API for a short beep
|
|
363
|
+
var ctx_1 = new (window.AudioContext ||
|
|
364
|
+
window.webkitAudioContext)();
|
|
365
|
+
var o_1 = ctx_1.createOscillator();
|
|
366
|
+
var g = ctx_1.createGain();
|
|
367
|
+
o_1.type = 'sine';
|
|
368
|
+
o_1.frequency.value = 880;
|
|
369
|
+
g.gain.value = 0.09;
|
|
370
|
+
o_1.connect(g);
|
|
371
|
+
g.connect(ctx_1.destination);
|
|
372
|
+
o_1.start();
|
|
373
|
+
setTimeout(function () {
|
|
374
|
+
o_1.stop();
|
|
375
|
+
ctx_1.close();
|
|
376
|
+
}, 120);
|
|
377
|
+
}
|
|
378
|
+
catch (e) {
|
|
379
|
+
/* ignore */
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
KTToast._fireEventOnElement(toast, 'show', { id: id });
|
|
383
|
+
KTToast._dispatchEventOnElement(toast, 'show', { id: id });
|
|
384
|
+
var instance = { id: id, element: toast, timeoutId: 0 };
|
|
385
|
+
KTToast.toasts.set(id, instance);
|
|
386
|
+
// Auto-dismiss
|
|
387
|
+
var timeoutId = undefined;
|
|
388
|
+
var remaining = duration;
|
|
389
|
+
var startTime;
|
|
390
|
+
var paused = false;
|
|
391
|
+
var progressEl = null;
|
|
392
|
+
if (duration) {
|
|
393
|
+
var startTimer_1 = function (ms) {
|
|
394
|
+
startTime = Date.now();
|
|
395
|
+
timeoutId = window.setTimeout(function () {
|
|
396
|
+
var _a;
|
|
397
|
+
(_a = options.onAutoClose) === null || _a === void 0 ? void 0 : _a.call(options, id);
|
|
398
|
+
KTToast.close(id);
|
|
399
|
+
}, ms);
|
|
400
|
+
instance.timeoutId = timeoutId;
|
|
401
|
+
};
|
|
402
|
+
startTimer_1(duration);
|
|
403
|
+
if (options.pauseOnHover) {
|
|
404
|
+
progressEl = toast.querySelector('[data-kt-toast-progress]');
|
|
405
|
+
var progressPausedAt_1 = 0;
|
|
406
|
+
var pause = function () {
|
|
407
|
+
if (!paused && timeoutId) {
|
|
408
|
+
paused = true;
|
|
409
|
+
window.clearTimeout(timeoutId);
|
|
410
|
+
if (startTime) {
|
|
411
|
+
remaining -= Date.now() - startTime;
|
|
412
|
+
}
|
|
413
|
+
// Pause progress bar
|
|
414
|
+
if (progressEl) {
|
|
415
|
+
var computedStyle = window.getComputedStyle(progressEl);
|
|
416
|
+
var matrix = computedStyle.transform;
|
|
417
|
+
var scaleX = 1;
|
|
418
|
+
if (matrix && matrix !== 'none') {
|
|
419
|
+
var values = matrix.match(/matrix\(([^)]+)\)/);
|
|
420
|
+
if (values && values[1]) {
|
|
421
|
+
scaleX = parseFloat(values[1].split(',')[0]);
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
progressPausedAt_1 = scaleX;
|
|
425
|
+
progressEl.style.animation = 'none';
|
|
426
|
+
progressEl.style.transition = 'none';
|
|
427
|
+
progressEl.style.transform = "scaleX(".concat(scaleX, ")");
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
};
|
|
431
|
+
var resume = function () {
|
|
432
|
+
if (paused && remaining > 0) {
|
|
433
|
+
paused = false;
|
|
434
|
+
startTimer_1(remaining);
|
|
435
|
+
// Resume progress bar
|
|
436
|
+
if (progressEl) {
|
|
437
|
+
progressEl.style.transition = 'transform 0ms';
|
|
438
|
+
progressEl.style.transform = "scaleX(".concat(progressPausedAt_1, ")");
|
|
439
|
+
progressEl.offsetHeight; // force reflow
|
|
440
|
+
progressEl.style.transition = "transform ".concat(remaining, "ms linear");
|
|
441
|
+
progressEl.style.transform = 'scaleX(0)';
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
};
|
|
445
|
+
toast.addEventListener('mouseenter', pause);
|
|
446
|
+
toast.addEventListener('mouseleave', resume);
|
|
447
|
+
}
|
|
448
|
+
}
|
|
449
|
+
KTToast._fireEventOnElement(toast, 'shown', { id: id });
|
|
450
|
+
KTToast._dispatchEventOnElement(toast, 'shown', { id: id });
|
|
451
|
+
return __assign(__assign({}, instance), { dismiss: function () { return KTToast.close(id); } });
|
|
452
|
+
};
|
|
453
|
+
/**
|
|
454
|
+
* Close and remove all active toasts.
|
|
455
|
+
*/
|
|
456
|
+
KTToast.clearAll = function () {
|
|
457
|
+
for (var _i = 0, _a = Array.from(this.toasts.keys()); _i < _a.length; _i++) {
|
|
458
|
+
var id = _a[_i];
|
|
459
|
+
console.log('clearAll:', id);
|
|
460
|
+
this.close(id);
|
|
461
|
+
}
|
|
462
|
+
};
|
|
463
|
+
/**
|
|
464
|
+
* Close a toast by ID or instance.
|
|
465
|
+
* @param idOrInstance Toast ID string or KTToastInstance.
|
|
466
|
+
*/
|
|
467
|
+
KTToast.close = function (idOrInstance) {
|
|
468
|
+
var inst;
|
|
469
|
+
var id;
|
|
470
|
+
if (!idOrInstance)
|
|
471
|
+
return;
|
|
472
|
+
if (typeof idOrInstance === 'string') {
|
|
473
|
+
id = idOrInstance;
|
|
474
|
+
inst = this.toasts.get(id);
|
|
475
|
+
}
|
|
476
|
+
else if (typeof idOrInstance === 'object' && idOrInstance.id) {
|
|
477
|
+
id = idOrInstance.id;
|
|
478
|
+
inst = idOrInstance;
|
|
479
|
+
}
|
|
480
|
+
if (!inst || !id)
|
|
481
|
+
return;
|
|
482
|
+
if (inst._closing)
|
|
483
|
+
return; // Prevent double-close
|
|
484
|
+
inst._closing = true;
|
|
485
|
+
clearTimeout(inst.timeoutId);
|
|
486
|
+
KTToast._fireEventOnElement(inst.element, 'hide', { id: id });
|
|
487
|
+
KTToast._dispatchEventOnElement(inst.element, 'hide', { id: id });
|
|
488
|
+
// Remove progress bar instantly if present
|
|
489
|
+
var progressEl = inst.element.querySelector('[data-kt-toast-progress]');
|
|
490
|
+
if (progressEl)
|
|
491
|
+
progressEl.remove();
|
|
492
|
+
inst.element.style.animation = 'kt-toast-out 0.25s forwards';
|
|
493
|
+
setTimeout(function () {
|
|
494
|
+
var _a;
|
|
495
|
+
var parent = inst === null || inst === void 0 ? void 0 : inst.element.parentElement;
|
|
496
|
+
inst === null || inst === void 0 ? void 0 : inst.element.remove();
|
|
497
|
+
KTToast.toasts.delete(id);
|
|
498
|
+
// Try to call onDismiss if available in the toast instance (if stored)
|
|
499
|
+
if (typeof ((_a = inst.options) === null || _a === void 0 ? void 0 : _a.onDismiss) === 'function') {
|
|
500
|
+
inst.options.onDismiss(id);
|
|
501
|
+
}
|
|
502
|
+
KTToast._fireEventOnElement(inst.element, 'hidden', { id: id });
|
|
503
|
+
KTToast._dispatchEventOnElement(inst.element, 'hidden', { id: id });
|
|
504
|
+
// update toasts asynchronously after DOM update
|
|
505
|
+
setTimeout(function () {
|
|
506
|
+
KTToast.update(parent);
|
|
507
|
+
}, 0);
|
|
508
|
+
}, 250);
|
|
509
|
+
};
|
|
510
|
+
/**
|
|
511
|
+
* Dispatches a custom 'kt.toast.{eventType}' event on the given element.
|
|
512
|
+
* @param element The toast element.
|
|
513
|
+
* @param eventType The event type (e.g. 'show', 'hide').
|
|
514
|
+
* @param payload Optional event detail payload.
|
|
515
|
+
*/
|
|
516
|
+
KTToast._fireEventOnElement = function (element, eventType, payload) {
|
|
517
|
+
var event = new CustomEvent("kt.toast.".concat(eventType), { detail: payload });
|
|
518
|
+
element.dispatchEvent(event);
|
|
519
|
+
};
|
|
520
|
+
/**
|
|
521
|
+
* Dispatches a custom event (not namespaced) on the given element.
|
|
522
|
+
* @param element The toast element.
|
|
523
|
+
* @param eventType The event type.
|
|
524
|
+
* @param payload Optional event detail payload.
|
|
525
|
+
*/
|
|
526
|
+
KTToast._dispatchEventOnElement = function (element, eventType, payload) {
|
|
527
|
+
var event = new CustomEvent(eventType, { detail: payload });
|
|
528
|
+
element.dispatchEvent(event);
|
|
529
|
+
};
|
|
530
|
+
/**
|
|
531
|
+
* Initialize toast system (placeholder for future use).
|
|
532
|
+
*/
|
|
533
|
+
KTToast.init = function () { };
|
|
534
|
+
KTToast.containerMap = new Map();
|
|
535
|
+
KTToast.toasts = new Map();
|
|
536
|
+
KTToast.globalConfig = __assign({}, DEFAULT_CONFIG);
|
|
537
|
+
return KTToast;
|
|
538
|
+
}(KTComponent));
|
|
539
|
+
export { KTToast };
|
|
540
|
+
//# sourceMappingURL=toast.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toast.js","sourceRoot":"","sources":["../../../../src/components/toast/toast.ts"],"names":[],"mappings":"AAAA;;;GAGG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,OAAO,WAAW,MAAM,cAAc,CAA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OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YACxB,CAAC,EAAE,CAAC,CAAC,CAAC;QACP,CAAC,EAAE,GAAG,CAAC,CAAC;IACT,CAAC;IAED;;;;;OAKG;IACY,2BAAmB,GAAlC,UACC,OAAoB,EACpB,SAAiB,EACjB,OAAgB;QAEhB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,mBAAY,SAAS,CAAE,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAC5E,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;;;;OAKG;IACY,+BAAuB,GAAtC,UACC,OAAoB,EACpB,SAAiB,EACjB,OAAgB;QAEhB,IAAM,KAAK,GAAG,IAAI,WAAW,CAAC,SAAS,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAC9D,OAAO,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9B,CAAC;IAED;;OAEG;IACW,YAAI,GAAlB,cAA4B,CAAC;IApjBd,oBAAY,GAAsC,IAAI,GAAG,EAAE,AAA/C,CAAgD;IAC5D,cAAM,GAAiC,IAAI,GAAG,EAAE,AAA1C,CAA2C;IACjD,oBAAY,gBAAuB,cAAc,CAArC,CAAwC;IAmjBpE,cAAC;CAAA,AA1jBD,CAA6B,WAAW,GA0jBvC;SA1jBY,OAAO"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/toast/types.ts"],"names":[],"mappings":"AAAA;;;GAGG"}
|
package/lib/esm/helpers/dom.js
CHANGED
|
@@ -285,6 +285,30 @@ var KTDom = {
|
|
|
285
285
|
}
|
|
286
286
|
return attributes;
|
|
287
287
|
},
|
|
288
|
+
getDataAttributesByJson: function (element, prefix) {
|
|
289
|
+
if (!element) {
|
|
290
|
+
return {};
|
|
291
|
+
}
|
|
292
|
+
var rawValue = element.dataset[prefix];
|
|
293
|
+
if (!rawValue) {
|
|
294
|
+
return {};
|
|
295
|
+
}
|
|
296
|
+
var parsedValue = KTUtils.parseDataAttribute(rawValue);
|
|
297
|
+
if (typeof parsedValue === 'string') {
|
|
298
|
+
try {
|
|
299
|
+
return JSON.parse(parsedValue);
|
|
300
|
+
}
|
|
301
|
+
catch (e) {
|
|
302
|
+
console.error("Invalid JSON format for '".concat(prefix, "': ").concat(e instanceof Error ? e.message : e, " ").concat(rawValue));
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
// If it's already an object, return as is
|
|
306
|
+
if (typeof parsedValue === 'object' && parsedValue !== null) {
|
|
307
|
+
return parsedValue;
|
|
308
|
+
}
|
|
309
|
+
// For other types (number, boolean, null), return an empty object
|
|
310
|
+
return {};
|
|
311
|
+
},
|
|
288
312
|
ready: function (callback) {
|
|
289
313
|
if (document.readyState === 'loading') {
|
|
290
314
|
document.addEventListener('DOMContentLoaded', function () {
|