@kupola/kupola 1.2.0 → 1.3.1
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/LICENSE +21 -0
- package/README.md +330 -286
- package/adapters/axios.d.ts +34 -0
- package/adapters/axios.js +122 -0
- package/adapters/navios-http.d.ts +110 -0
- package/adapters/navios-http.js +151 -0
- package/dist/css/accessibility.css +119 -0
- package/dist/css/animations.css +224 -0
- package/dist/css/brand-themes.css +300 -0
- package/dist/css/colors_and_type.css +441 -0
- package/dist/css/components-ext.css +4165 -0
- package/dist/css/components.css +1483 -0
- package/dist/css/responsive.css +697 -0
- package/dist/css/scaffold.css +145 -0
- package/dist/css/states.css +316 -0
- package/dist/css/theme-dark.css +296 -0
- package/dist/css/theme-light.css +296 -0
- package/dist/css/utilities.css +171 -0
- package/dist/kupola.cjs.js +219 -161
- package/dist/kupola.cjs.js.map +1 -1
- package/dist/kupola.esm.js +6643 -5709
- package/dist/kupola.esm.js.map +1 -1
- package/dist/kupola.umd.js +219 -161
- package/dist/kupola.umd.js.map +1 -1
- package/dist/plugins/vite-plugin-kupola.js +120 -0
- package/dist/types/kupola.d.ts +421 -323
- package/js/calendar.js +334 -25
- package/js/carousel.js +182 -48
- package/js/collapse.js +148 -34
- package/js/color-picker.js +416 -108
- package/js/component.js +8 -19
- package/js/countdown.js +9 -8
- package/js/data-bind.js +73 -16
- package/js/datepicker.js +488 -110
- package/js/depends.js +710 -0
- package/js/dialog.js +4 -2
- package/js/drawer.js +172 -8
- package/js/dropdown.js +272 -17
- package/js/dynamic-tags.js +156 -40
- package/js/fileupload.js +9 -8
- package/js/form.js +280 -254
- package/js/global-events.js +281 -188
- package/js/heatmap.js +10 -7
- package/js/i18n.js +18 -10
- package/js/icons.js +141 -161
- package/js/image-preview.js +146 -2
- package/js/initializer.js +113 -71
- package/js/kupola-core.js +123 -45
- package/js/kupola-lifecycle.js +13 -11
- package/js/message.js +8 -1
- package/js/modal.js +207 -59
- package/js/notification.js +8 -1
- package/js/numberinput.js +9 -8
- package/js/pagination.js +263 -0
- package/js/registry.js +29 -12
- package/js/select.js +482 -27
- package/js/slide-captcha.js +11 -2
- package/js/slider.js +442 -25
- package/js/statcard.js +9 -7
- package/js/table.js +1210 -0
- package/js/tag.js +268 -14
- package/js/theme.js +14 -43
- package/js/timepicker.js +335 -66
- package/js/tooltip.js +317 -86
- package/js/utils.js +6 -2
- package/js/validation.js +6 -2
- package/js/virtual-list.js +11 -7
- package/js/web-components.js +288 -0
- package/package.json +77 -67
- package/plugins/vite-plugin-kupola.js +120 -0
- package/types/kupola.d.ts +421 -323
- package/CHANGELOG.md +0 -130
- package/INTEGRATION.md +0 -440
- package/PROJECT_SUMMARY.md +0 -312
- package/SKILL.md +0 -572
- package/dist/utils/utils/Kupola.cs +0 -77
- package/dist/utils/utils/Kupola.java +0 -104
- package/dist/utils/utils/kupola.go +0 -120
- package/dist/utils/utils/kupola.js +0 -63
- package/dist/utils/utils/kupola.py +0 -1392
- package/dist/utils/utils/kupola.rb +0 -69
- package/js/composition-api.js +0 -458
- package/js/error-handler.js +0 -181
- package/js/http.js +0 -419
- package/js/kupola-devtools.js +0 -598
- package/js/performance.js +0 -250
- package/js/router.js +0 -396
- package/js/security.js +0 -189
- package/js/test-utils.js +0 -251
- package/templates/base.html +0 -30
- package/templates/base_dashboard.html +0 -99
- package/utils/Kupola.cs +0 -77
- package/utils/Kupola.java +0 -104
- package/utils/kupola.go +0 -120
- package/utils/kupola.js +0 -63
- package/utils/kupola.py +0 -1392
- package/utils/kupola.rb +0 -69
package/js/data-bind.js
CHANGED
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Kupola Data Bind — Reactive data binding, event bus, and state management.
|
|
3
|
+
* Provides KupolaDataBind (Proxy-based binding), KupolaEventBus, KupolaStore, and ref().
|
|
4
|
+
* @module kupola/data-bind
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Basic HTML sanitizer — removes <script>, <iframe>, <object>, <embed>, and on* event attributes.
|
|
9
|
+
* @param {string} html
|
|
10
|
+
* @returns {string}
|
|
11
|
+
*/
|
|
12
|
+
function sanitizeHtml(html) {
|
|
13
|
+
if (!html) return '';
|
|
14
|
+
const str = String(html);
|
|
15
|
+
return str
|
|
16
|
+
.replace(/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi, '')
|
|
17
|
+
.replace(/<iframe\b[^<]*(?:(?!<\/iframe>)<[^<]*)*<\/iframe>/gi, '')
|
|
18
|
+
.replace(/<object\b[^<]*(?:(?!<\/object>)<[^<]*)*<\/object>/gi, '')
|
|
19
|
+
.replace(/<embed\b[^>]*\/?>/gi, '')
|
|
20
|
+
.replace(/\bon\w+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s>]+)/gi, '');
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
class TrieNode {
|
|
2
24
|
constructor() {
|
|
3
25
|
this.children = {};
|
|
@@ -399,8 +421,9 @@ class KupolaDataBind {
|
|
|
399
421
|
}
|
|
400
422
|
break;
|
|
401
423
|
case 'html':
|
|
402
|
-
|
|
403
|
-
|
|
424
|
+
const sanitized = sanitizeHtml(value);
|
|
425
|
+
if (element.innerHTML !== sanitized) {
|
|
426
|
+
element.innerHTML = sanitized;
|
|
404
427
|
}
|
|
405
428
|
break;
|
|
406
429
|
case 'value':
|
|
@@ -1258,29 +1281,63 @@ class KupolaEventBus {
|
|
|
1258
1281
|
}
|
|
1259
1282
|
}
|
|
1260
1283
|
|
|
1284
|
+
// ============================================================
|
|
1285
|
+
// Lightweight ref() — standalone reactive primitive
|
|
1286
|
+
// ============================================================
|
|
1287
|
+
|
|
1288
|
+
function ref(initialValue = null) {
|
|
1289
|
+
const refObj = {
|
|
1290
|
+
_value: initialValue,
|
|
1291
|
+
_subscribers: new Set()
|
|
1292
|
+
};
|
|
1293
|
+
|
|
1294
|
+
Object.defineProperty(refObj, 'value', {
|
|
1295
|
+
configurable: true,
|
|
1296
|
+
enumerable: true,
|
|
1297
|
+
get() { return refObj._value; },
|
|
1298
|
+
set(newValue) {
|
|
1299
|
+
if (newValue !== refObj._value) {
|
|
1300
|
+
refObj._value = newValue;
|
|
1301
|
+
refObj._subscribers.forEach(sub => sub(newValue));
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
1304
|
+
});
|
|
1305
|
+
|
|
1306
|
+
return refObj;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
/** @type {KupolaDataBind} Global data binding instance */
|
|
1261
1310
|
const kupolaData = new KupolaDataBind();
|
|
1311
|
+
/** @type {KupolaEventBus} Global event bus instance */
|
|
1262
1312
|
const kupolaEvents = new KupolaEventBus();
|
|
1313
|
+
/** @type {KupolaStoreManager} Global store manager instance */
|
|
1263
1314
|
const kupolaStoreManager = new KupolaStoreManager();
|
|
1264
1315
|
|
|
1316
|
+
/** Create a named reactive store with state, getters, mutations, and actions. */
|
|
1265
1317
|
function createStore(name, options) {
|
|
1266
1318
|
return kupolaStoreManager.createStore(name, options);
|
|
1267
1319
|
}
|
|
1268
1320
|
|
|
1321
|
+
/** Get a previously created store by name. */
|
|
1269
1322
|
function getStore(name) {
|
|
1270
1323
|
return kupolaStoreManager.getStore(name);
|
|
1271
1324
|
}
|
|
1272
1325
|
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
}
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
window
|
|
1280
|
-
window.
|
|
1281
|
-
window.
|
|
1282
|
-
window.
|
|
1283
|
-
window.
|
|
1284
|
-
window.
|
|
1285
|
-
window.
|
|
1286
|
-
window.
|
|
1326
|
+
export { TrieNode, PathTrie, REACTIVE_SYMBOLS };
|
|
1327
|
+
export { KupolaDataBind, KupolaEventBus, KupolaStore, KupolaStoreManager };
|
|
1328
|
+
export { kupolaData, kupolaEvents, kupolaStoreManager };
|
|
1329
|
+
export { createStore, getStore };
|
|
1330
|
+
export { ref };
|
|
1331
|
+
|
|
1332
|
+
if (typeof window !== 'undefined') {
|
|
1333
|
+
window.KupolaDataBind = KupolaDataBind;
|
|
1334
|
+
window.KupolaEventBus = KupolaEventBus;
|
|
1335
|
+
window.KupolaStore = KupolaStore;
|
|
1336
|
+
window.KupolaStoreManager = KupolaStoreManager;
|
|
1337
|
+
window.kupolaData = kupolaData;
|
|
1338
|
+
window.kupolaEvents = kupolaEvents;
|
|
1339
|
+
window.kupolaStoreManager = kupolaStoreManager;
|
|
1340
|
+
window.createStore = createStore;
|
|
1341
|
+
window.getStore = getStore;
|
|
1342
|
+
window.kupolaRef = ref;
|
|
1343
|
+
}
|