@kalel1500/kalion-js 0.10.1-beta.0 → 0.11.0-beta.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/dist/app/kalion-js.es.js +36 -38
- package/dist/app/kalion-js.es.js.map +1 -1
- package/dist/app/types/core/_types/index.d.ts +13 -1
- package/dist/app/types/core/domain/index.d.ts +1 -0
- package/dist/app/types/core/domain/objects/value-objects/EnumVo.d.ts +6 -13
- package/dist/app/types/core/domain/objects/value-objects/SidebarState.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/modals/SModal.d.ts +1 -3
- package/dist/cli/stubs/resources/js/config/constants.ts +17 -12
- package/package.json +1 -1
package/dist/app/kalion-js.es.js
CHANGED
|
@@ -9,7 +9,7 @@ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read fr
|
|
|
9
9
|
var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
10
10
|
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value);
|
|
11
11
|
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
|
|
12
|
-
var _connectionFailed, _isStarted, _LDate_static, isDatetime_fn, _title, _body, _openUrl, _Notify_instances, createNotification_fn, _SModal_static, checkAndExecuteShow_fn, checkAndExecuteUpdate_fn, inputModalBasic_fn, _ROUTES, _Url_static, updateUrl_fn, _StringVo_instances, ensureIsValidValue_fn, _IntVo_instances, ensureIsValidValue_fn2
|
|
12
|
+
var _connectionFailed, _isStarted, _LDate_static, isDatetime_fn, _title, _body, _openUrl, _Notify_instances, createNotification_fn, _SModal_static, checkAndExecuteShow_fn, checkAndExecuteUpdate_fn, inputModalBasic_fn, _ROUTES, _Url_static, updateUrl_fn, _StringVo_instances, ensureIsValidValue_fn, _IntVo_instances, ensureIsValidValue_fn2;
|
|
13
13
|
import Echo from "laravel-echo";
|
|
14
14
|
import Pusher from "pusher-js";
|
|
15
15
|
import { route } from "ziggy-js";
|
|
@@ -50,6 +50,10 @@ const _Constants = class _Constants {
|
|
|
50
50
|
VITE_REVERB_HOST: "localhost",
|
|
51
51
|
VITE_REVERB_PORT: 8080,
|
|
52
52
|
VITE_REVERB_SCHEME: "http",
|
|
53
|
+
VITE_KALION_COOKIE_KEY_USER_PREF_VERSION: "version",
|
|
54
|
+
VITE_KALION_COOKIE_KEY_USER_PREF_THEME: "theme",
|
|
55
|
+
VITE_KALION_COOKIE_KEY_USER_PREF_SIDEBAR_STATE: "sidebar_state",
|
|
56
|
+
VITE_KALION_COOKIE_KEY_USER_PREF_SIDEBAR_STATE_PER_PAGE: "sidebar_state_per_page",
|
|
53
57
|
VITE_APP_ENV: "local",
|
|
54
58
|
VITE_APP_NAME: "Laravel",
|
|
55
59
|
VITE_APP_CODE: "laravel",
|
|
@@ -446,9 +450,8 @@ class Cookie {
|
|
|
446
450
|
return cookie ? decodeURIComponent(cookie.split("=")[1]) : null;
|
|
447
451
|
}
|
|
448
452
|
set(name, value, days) {
|
|
449
|
-
const expires =
|
|
450
|
-
|
|
451
|
-
document.cookie = `${name}=${encodeURIComponent(value)}; expires=${expires.toUTCString()}; path=/`;
|
|
453
|
+
const expires = new Date(Date.now() + days * 24 * 60 * 60 * 1e3).toUTCString();
|
|
454
|
+
document.cookie = `${name}=${encodeURIComponent(value)}; expires=${expires}; path=/`;
|
|
452
455
|
}
|
|
453
456
|
delete(name) {
|
|
454
457
|
document.cookie = `${name}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/`;
|
|
@@ -458,9 +461,7 @@ class Cookie {
|
|
|
458
461
|
return cookieValue ? JSON.parse(cookieValue) : null;
|
|
459
462
|
}
|
|
460
463
|
setPreferences(preferences) {
|
|
461
|
-
|
|
462
|
-
const expires = new Date(Date.now() + 30 * 24 * 60 * 60 * 1e3).toUTCString();
|
|
463
|
-
document.cookie = `${this.cookiePreferencesName}=${serializedPreferences}; path=/; expires=${expires}`;
|
|
464
|
+
this.set(this.cookiePreferencesName, JSON.stringify(preferences), 30);
|
|
464
465
|
}
|
|
465
466
|
setPreference(key, value) {
|
|
466
467
|
const preferences = this.preferences();
|
|
@@ -5692,42 +5693,37 @@ ensureIsValidValue_fn2 = function() {
|
|
|
5692
5693
|
}
|
|
5693
5694
|
};
|
|
5694
5695
|
class EnumVo {
|
|
5695
|
-
constructor(value
|
|
5696
|
-
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5700
|
-
|
|
5701
|
-
|
|
5702
|
-
this.
|
|
5703
|
-
|
|
5704
|
-
|
|
5705
|
-
|
|
5706
|
-
return this._value;
|
|
5696
|
+
constructor(value) {
|
|
5697
|
+
__publicField(this, "value");
|
|
5698
|
+
this.value = value;
|
|
5699
|
+
this.ensureIsValidValue();
|
|
5700
|
+
}
|
|
5701
|
+
ensureIsValidValue() {
|
|
5702
|
+
const ctor = this.constructor;
|
|
5703
|
+
if (!ctor._permittedValues.includes(this.value)) {
|
|
5704
|
+
const message = `<EnumVo> ha recibido un valor no permitido. Valores permitidos [${ctor._permittedValues.join(",")}]`;
|
|
5705
|
+
throw new InvalidValueException(message);
|
|
5706
|
+
}
|
|
5707
5707
|
}
|
|
5708
|
-
static from(value
|
|
5709
|
-
return new this(value
|
|
5708
|
+
static from(value) {
|
|
5709
|
+
return new this(value);
|
|
5710
5710
|
}
|
|
5711
5711
|
}
|
|
5712
|
-
|
|
5713
|
-
|
|
5714
|
-
|
|
5715
|
-
if (!this._allowNull) {
|
|
5716
|
-
const message = "<EnumVo> no permite un valor vacio";
|
|
5717
|
-
throw new InvalidValueException(message);
|
|
5718
|
-
} else {
|
|
5719
|
-
return;
|
|
5720
|
-
}
|
|
5712
|
+
const _SidebarState = class _SidebarState extends EnumVo {
|
|
5713
|
+
isCollapsed() {
|
|
5714
|
+
return this.value === _SidebarState.collapsed;
|
|
5721
5715
|
}
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
throw new InvalidValueException(message);
|
|
5716
|
+
isExpanded() {
|
|
5717
|
+
return this.value === _SidebarState.expanded;
|
|
5725
5718
|
}
|
|
5726
|
-
|
|
5727
|
-
|
|
5728
|
-
throw new InvalidValueException(message);
|
|
5719
|
+
static fromBoolean(isCollapsed) {
|
|
5720
|
+
return _SidebarState.from(isCollapsed ? _SidebarState.collapsed : _SidebarState.expanded);
|
|
5729
5721
|
}
|
|
5730
5722
|
};
|
|
5723
|
+
__publicField(_SidebarState, "expanded", "expanded");
|
|
5724
|
+
__publicField(_SidebarState, "collapsed", "collapsed");
|
|
5725
|
+
__publicField(_SidebarState, "_permittedValues", [_SidebarState.expanded, _SidebarState.collapsed]);
|
|
5726
|
+
let SidebarState = _SidebarState;
|
|
5731
5727
|
class Test {
|
|
5732
5728
|
static printConstant() {
|
|
5733
5729
|
console.log(__const("lang"));
|
|
@@ -5765,8 +5761,9 @@ class DomService extends Instantiable {
|
|
|
5765
5761
|
const sidebarToggleBtn = document.getElementById("sidebar-toggle");
|
|
5766
5762
|
sidebarToggleBtn == null ? void 0 : sidebarToggleBtn.addEventListener("click", () => {
|
|
5767
5763
|
const isCollapsed = !this.$document.classList.contains("sc");
|
|
5764
|
+
const state = SidebarState.fromBoolean(isCollapsed);
|
|
5768
5765
|
this.$document.classList.toggle("sc", isCollapsed);
|
|
5769
|
-
Cookie.new().setPreference("
|
|
5766
|
+
Cookie.new().setPreference(__const("VITE_KALION_COOKIE_KEY_USER_PREF_SIDEBAR_STATE"), state.value);
|
|
5770
5767
|
});
|
|
5771
5768
|
}
|
|
5772
5769
|
startSidebarArrowsObserve() {
|
|
@@ -5846,7 +5843,7 @@ class ThemeSwitcher extends Instantiable {
|
|
|
5846
5843
|
}
|
|
5847
5844
|
saveAndUpdate(theme) {
|
|
5848
5845
|
localStorage.setItem("theme", theme);
|
|
5849
|
-
Cookie.new().setPreference("
|
|
5846
|
+
Cookie.new().setPreference(__const("VITE_KALION_COOKIE_KEY_USER_PREF_THEME"), theme);
|
|
5850
5847
|
this.updateTheme(theme);
|
|
5851
5848
|
}
|
|
5852
5849
|
toDarkMode() {
|
|
@@ -5923,6 +5920,7 @@ export {
|
|
|
5923
5920
|
Reverb,
|
|
5924
5921
|
Route,
|
|
5925
5922
|
SModal,
|
|
5923
|
+
SidebarState,
|
|
5926
5924
|
StorageProcessKeys,
|
|
5927
5925
|
StringVo,
|
|
5928
5926
|
Test,
|