@kalel1500/kalion-js 0.7.0-beta.2

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.
Files changed (69) hide show
  1. package/LICENSE +674 -0
  2. package/README.md +27 -0
  3. package/dist/app/kalion-js.es.js +5832 -0
  4. package/dist/app/kalion-js.es.js.map +1 -0
  5. package/dist/app/slimselect.css +62 -0
  6. package/dist/app/styles-old.css +2032 -0
  7. package/dist/app/styles.css +42 -0
  8. package/dist/app/sweetalert.css +1338 -0
  9. package/dist/app/tabulator.css +3861 -0
  10. package/dist/app/tailwind-config.css +61 -0
  11. package/dist/app/types/core/_types/index.d.ts +185 -0
  12. package/dist/app/types/core/application/LayoutListenersUseCase.d.ts +4 -0
  13. package/dist/app/types/core/application/index.d.ts +1 -0
  14. package/dist/app/types/core/domain/exceptions/CannotOpenModalException.d.ts +3 -0
  15. package/dist/app/types/core/domain/exceptions/CannotOpenModalWarning.d.ts +3 -0
  16. package/dist/app/types/core/domain/exceptions/InvalidValueException.d.ts +3 -0
  17. package/dist/app/types/core/domain/index.d.ts +8 -0
  18. package/dist/app/types/core/domain/objects/value-objects/EnumVo.d.ts +14 -0
  19. package/dist/app/types/core/domain/objects/value-objects/IntVo.d.ts +12 -0
  20. package/dist/app/types/core/domain/objects/value-objects/StringVo.d.ts +14 -0
  21. package/dist/app/types/core/domain/services/DomService.d.ts +7 -0
  22. package/dist/app/types/core/domain/services/Test.d.ts +4 -0
  23. package/dist/app/types/core/domain/services/ThemeSwitcher.d.ts +17 -0
  24. package/dist/app/types/core/infrastructure/index.d.ts +17 -0
  25. package/dist/app/types/core/infrastructure/utilities/components/Component.d.ts +4 -0
  26. package/dist/app/types/core/infrastructure/utilities/components/html/Btn.d.ts +6 -0
  27. package/dist/app/types/core/infrastructure/utilities/components/html/Icon.d.ts +5 -0
  28. package/dist/app/types/core/infrastructure/utilities/general/Constants.d.ts +10 -0
  29. package/dist/app/types/core/infrastructure/utilities/general/Cookie.d.ts +11 -0
  30. package/dist/app/types/core/infrastructure/utilities/general/Html.d.ts +4 -0
  31. package/dist/app/types/core/infrastructure/utilities/general/Instantiable.d.ts +5 -0
  32. package/dist/app/types/core/infrastructure/utilities/general/LDate.d.ts +30 -0
  33. package/dist/app/types/core/infrastructure/utilities/general/LStorage.d.ts +11 -0
  34. package/dist/app/types/core/infrastructure/utilities/general/Mutation.d.ts +11 -0
  35. package/dist/app/types/core/infrastructure/utilities/general/Notify.d.ts +19 -0
  36. package/dist/app/types/core/infrastructure/utilities/general/Ttable.d.ts +73 -0
  37. package/dist/app/types/core/infrastructure/utilities/general/global.d.ts +38 -0
  38. package/dist/app/types/core/infrastructure/utilities/modals/SModal.d.ts +111 -0
  39. package/dist/app/types/core/infrastructure/utilities/routing/Route.d.ts +8 -0
  40. package/dist/app/types/core/infrastructure/utilities/routing/Url.d.ts +11 -0
  41. package/dist/app/types/core/infrastructure/utilities/tests/TestConstants.d.ts +8 -0
  42. package/dist/app/types/core/infrastructure/utilities/translation/Translator.d.ts +13 -0
  43. package/dist/app/types/core/infrastructure/utilities/translation/TranslatorS.d.ts +0 -0
  44. package/dist/app/types/core/infrastructure/utilities/translation/lang/en.json.d.ts +48 -0
  45. package/dist/app/types/core/infrastructure/utilities/translation/lang/es.json.d.ts +48 -0
  46. package/dist/app/types/core/infrastructure/utilities/websockets/EchoService.d.ts +6 -0
  47. package/dist/app/types/core/infrastructure/utilities/websockets/Websocket.d.ts +23 -0
  48. package/dist/app/types/index.d.ts +5 -0
  49. package/dist/app/types/providers/UtilitiesServiceProvider.d.ts +12 -0
  50. package/dist/cli/index.js +64 -0
  51. package/dist/cli/stubs/.prettierrc +12 -0
  52. package/dist/cli/stubs/resources/css/app.css +12 -0
  53. package/dist/cli/stubs/resources/js/app/bootstrap.ts +21 -0
  54. package/dist/cli/stubs/resources/js/app/constants.ts +28 -0
  55. package/dist/cli/stubs/resources/js/app/lang/en.json +4 -0
  56. package/dist/cli/stubs/resources/js/app/lang/es.json +4 -0
  57. package/dist/cli/stubs/resources/js/app/routes.ts +6 -0
  58. package/dist/cli/stubs/resources/js/app/translations.ts +14 -0
  59. package/dist/cli/stubs/resources/js/app.ts +7 -0
  60. package/dist/cli/stubs/resources/js/src/shared/application/HomeUseCase.ts +8 -0
  61. package/dist/cli/stubs/resources/js/src/shared/infrastructure/DefaultController.ts +7 -0
  62. package/dist/cli/stubs/tsconfig.json +25 -0
  63. package/dist/cli/stubs/vite.config.ts +15 -0
  64. package/dist/plugins/tailwind/index.cjs +44 -0
  65. package/dist/plugins/tailwind/index.d.ts +5 -0
  66. package/dist/plugins/tailwind/tailwind.config.js +15 -0
  67. package/dist/plugins/vite/index.d.ts +2 -0
  68. package/dist/plugins/vite/index.js +75 -0
  69. package/package.json +86 -0
@@ -0,0 +1,111 @@
1
+ import { default as Swal } from 'sweetalert2/dist/sweetalert2.js';
2
+ import { SweetAlertCustomClass, SweetAlertIcon, SweetAlertInput, SweetAlertPosition } from 'sweetalert2';
3
+ import { SyncOrAsync } from '../../../_types';
4
+ type ValueOrThunk<T> = T | (() => T);
5
+ interface BasicModalOptions {
6
+ icon?: SweetAlertIcon;
7
+ title?: string;
8
+ text?: string;
9
+ html?: string;
10
+ width?: number | string;
11
+ showConfirmButton?: boolean;
12
+ confirmButtonText?: string;
13
+ confirmButtonColor?: string;
14
+ showCancelButton?: boolean;
15
+ cancelButtonText?: string;
16
+ cancelButtonColor?: string;
17
+ showCloseButton?: boolean;
18
+ allowOutsideClick?: ValueOrThunk<boolean> | false;
19
+ showLoaderOnConfirm?: boolean;
20
+ timer?: number;
21
+ position?: SweetAlertPosition;
22
+ willOpen?(popup: HTMLElement): void;
23
+ didClose?(): void;
24
+ didOpen?(popup: HTMLElement): void;
25
+ didRender?(popup: HTMLElement): void;
26
+ preConfirm?(inputValue: any): SyncOrAsync<any>;
27
+ footer?: string;
28
+ customClass?: SweetAlertCustomClass;
29
+ }
30
+ interface UpdateModalOptions extends BasicModalOptions {
31
+ hideLoading?: boolean;
32
+ }
33
+ interface AjaxModalOptions extends BasicModalOptions {
34
+ ajaxUrl: string;
35
+ ajaxType?: string;
36
+ ajaxParams?: {};
37
+ footerOnFail?: string;
38
+ }
39
+ interface InputModalOptions extends BasicModalOptions {
40
+ input?: Exclude<SweetAlertInput, 'file'>;
41
+ inputValue?: string;
42
+ inputPlaceholder?: string;
43
+ inputOptions?: SyncOrAsync<ReadonlyMap<string, string> | Record<string, any>>;
44
+ inputId?: string;
45
+ getValidationMessage?(value: string): string | null;
46
+ preConfirm_url: string;
47
+ preConfirm_type?: string;
48
+ preConfirm_params?: {
49
+ [key: string]: string;
50
+ };
51
+ preConfirm_inputParamName?: string;
52
+ preConfirm_permitConfirm?: boolean;
53
+ preConfirm_ajaxOkCode?(): void;
54
+ }
55
+ interface BladeModalOptions extends BasicModalOptions {
56
+ ajaxUrl: string;
57
+ showConfirmButton?: boolean;
58
+ confirmButtonText?: string;
59
+ jsActionsInModal?(p: {}): void;
60
+ funcParam?: {};
61
+ }
62
+ interface ToastOptions {
63
+ icon?: SweetAlertIcon;
64
+ title?: string;
65
+ position?: SweetAlertPosition;
66
+ timer?: number;
67
+ }
68
+ interface ToastBothOptions {
69
+ success: boolean;
70
+ icon?: SweetAlertIcon;
71
+ iconOk?: SweetAlertIcon;
72
+ iconNok?: SweetAlertIcon;
73
+ title?: string;
74
+ titleOk?: string;
75
+ titleNok?: string;
76
+ timer?: number;
77
+ timerOk?: number;
78
+ timerNok?: number;
79
+ position?: SweetAlertPosition;
80
+ }
81
+ export declare class SModal {
82
+ #private;
83
+ static colorBlue: string;
84
+ static colorRed: string;
85
+ static colorGray: string;
86
+ static isPendigLoading: boolean;
87
+ static mustAbortIfIsAlreadyOpen({ isUpdate, ignorePendingLoading }: {
88
+ isUpdate?: boolean | undefined;
89
+ ignorePendingLoading?: boolean | undefined;
90
+ }): void;
91
+ static Toast: typeof Swal;
92
+ static toastInfo({ icon, title, position, timer, }: ToastOptions): Promise<any>;
93
+ static toastSuccess({ icon, title, position, timer, }: ToastOptions): Promise<any>;
94
+ static toastError({ icon, title, position, timer, }: ToastOptions): Promise<any>;
95
+ static toastBottom({ icon, title, position, timer, }: ToastOptions): Promise<any>;
96
+ static toastBoth({ success, icon, iconOk, iconNok, title, titleOk, titleNok, timer, timerOk, timerNok, position, }: ToastBothOptions): Promise<any>;
97
+ static basic(params: BasicModalOptions): Promise<any>;
98
+ static successModal({ icon, title, html, width, confirmButtonText, allowOutsideClick, }: BasicModalOptions): Promise<any>;
99
+ static errorModal({ icon, title, html, width, confirmButtonText, allowOutsideClick, footer, }: BasicModalOptions, ignorePendingLoading?: boolean): Promise<any>;
100
+ static confirmModal({ title, html, width, confirmButtonText, cancelButtonText, }: BasicModalOptions): Promise<any>;
101
+ static loadingModal({ title, width, willOpen, }: BasicModalOptions): Promise<any>;
102
+ static loadingModalAndDoAction({ title, ajaxUrl, ajaxType, ajaxParams, allowOutsideClick, footerOnFail, }: AjaxModalOptions): Promise<any>;
103
+ static updateModal(params: UpdateModalOptions): void;
104
+ static updateSuccessModal({ icon, title, html, hideLoading, footer, allowOutsideClick, }: UpdateModalOptions): void;
105
+ static updateErrorModal({ icon, title, html, hideLoading, footer, allowOutsideClick, }: UpdateModalOptions): void;
106
+ static confirmModalAfterAjaxCheck({ title, html, confirmButtonText, confirmButtonColor, cancelButtonText, ajaxUrl, ajaxType, ajaxParams, footerOnFail, }: AjaxModalOptions): Promise<any>;
107
+ static inputModal(params: InputModalOptions): Promise<any>;
108
+ static inputModalFixed(params: InputModalOptions): Promise<any>;
109
+ static bladeModal({ ajaxUrl, showConfirmButton, confirmButtonText, jsActionsInModal, funcParam, width, didClose, }: BladeModalOptions): Promise<any>;
110
+ }
111
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare class Route {
2
+ #private;
3
+ static page(uri: string, callback: [any, string], makeDataRequest?: boolean): void;
4
+ static component(callback: [any, string], uris: string[]): void;
5
+ static all(callback: [any, string], except: string[]): void;
6
+ static dispatch(): void;
7
+ static existsRoutesDefinition(): boolean;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { Filter } from 'tabulator-tables';
2
+ type QueryParams = Record<string, unknown>;
3
+ export declare class Url {
4
+ #private;
5
+ static getCurrentUrl(): string;
6
+ static addParamsToUrl(objectQueryParams: QueryParams, onStart?: boolean): void;
7
+ static removeParamsUrl(paramsToDelete: string[]): void;
8
+ static getEncodedFilters(): string | null;
9
+ static getDecodedFilters(): Filter[] | null;
10
+ }
11
+ export {};
@@ -0,0 +1,8 @@
1
+ export declare class TestConstants {
2
+ private property_value;
3
+ private constructor_value;
4
+ constructor();
5
+ printPropertyValue(): void;
6
+ printConstructorValue(): void;
7
+ printMethodValue(): void;
8
+ }
@@ -0,0 +1,13 @@
1
+ import { DefaultTranslations, TranslationReplacements } from '../../../_types';
2
+ export interface Translation {
3
+ [key: string]: string;
4
+ }
5
+ export declare class Translator<T extends DefaultTranslations> {
6
+ private static instance;
7
+ private locale;
8
+ private translations;
9
+ private externalTranslations;
10
+ static getInstance<U extends DefaultTranslations>(): Translator<U>;
11
+ registerTranslations(locale: string, translations: Partial<T>): void;
12
+ get<K extends keyof T>(key: K, replacements?: TranslationReplacements): string;
13
+ }
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ "save": "Save",
3
+ "cancel": "Cancel",
4
+ "delete": "Delete",
5
+ "move_to": "Move to",
6
+ "close": "Close",
7
+ "detail": "Detail",
8
+ "copy": "Copy",
9
+ "search_placeholder": "search...",
10
+ "select_placeholder": "select",
11
+ "select_value_placeholder": "--Select value--",
12
+ "copied_text": "Copied text",
13
+ "confirm_delete_record_NAME": "Are you sure you want to delete the \":name\" record?",
14
+ "confirm_delete_FIELD_NAME": "Are you sure you want to delete the \":name\" :field?",
15
+ "record_RECORD_doesnt_exist_in_the_TABLE_table": "The record \":record\" does not exist in the :table table",
16
+ "min_MIN_characters_on_search": "Search must be at least :min characters",
17
+ "add_FIELD": "Add :field",
18
+ "see_FIELD": "See :field",
19
+ "edit_FIELD_NAME": "Edit :field \":name\"",
20
+ "the_page": "the page",
21
+ "cannot_save_an_error": "You can't save a mistake",
22
+ "incorrect_blade_format": "Incorrect blade format",
23
+ "to_empty": "To empty",
24
+ "launch": "Launch",
25
+ "correct": "It's right",
26
+ "ok": "Ok",
27
+ "reload_page": "Reload Page",
28
+ "contact_pi_team": "Contact the PI Tools team",
29
+ "unforeseen_error": "Unforeseen error",
30
+ "loading": "Loading",
31
+ "loading_dots": "Loading...",
32
+ "search": "Search",
33
+ "searching_dots": "Searching...",
34
+ "no_results": "No results",
35
+ "filter": "Filter",
36
+ "date": "Date",
37
+ "download_completed": "Download completed",
38
+ "fetch_error_message": "There was a problem with the FETCH request^:",
39
+ "some_class_does_not_meet_the_INTERFACE_interface_contract": "Some class does not meet the :interface interface contract",
40
+ "it_has_been_called_a_JS_component_that_does_not_match_the_current_page": "It has been called a JS component that does not match the current page",
41
+ "need_NUMBER_characters": "Need :number characters",
42
+ "a_loader_was_expected_on_the_page": "A loader was expected on the page",
43
+ "check_if_the_loader_was_in_a_div": "Check if the loader was in a div. In that case the div ID is required.",
44
+ "you_do_not_have_permissions_to_edit": "You do not have permissions to edit"
45
+ }
46
+ ;
47
+
48
+ export default _default;
@@ -0,0 +1,48 @@
1
+ declare const _default: {
2
+ "save": "Guardar",
3
+ "cancel": "Cancelar",
4
+ "delete": "Eliminar",
5
+ "move_to": "Mover a",
6
+ "close": "Cerrar",
7
+ "detail": "Detalle",
8
+ "copy": "Copiar",
9
+ "search_placeholder": "buscar...",
10
+ "select_placeholder": "seleccionar",
11
+ "select_value_placeholder": "--Selecciona valor--",
12
+ "copied_text": "Texto copiado",
13
+ "confirm_delete_record_NAME": "¿Seguro que quieres eliminar el registro \":name\"?",
14
+ "confirm_delete_FIELD_NAME": "¿Seguro que quieres eliminar :field \":name\"?",
15
+ "record_RECORD_doesnt_exist_in_the_TABLE_table": "El registro \":record\" no existe en la tabla :table",
16
+ "min_MIN_characters_on_search": "La búsqueda debe tener al menos :min caracteres",
17
+ "add_FIELD": "Añadir :field",
18
+ "see_FIELD": "Ver :field",
19
+ "edit_FIELD_NAME": "Editar :field \":name\"",
20
+ "the_page": "la página",
21
+ "cannot_save_an_error": "No puedes guardar un error",
22
+ "incorrect_blade_format": "Formato blade incorrecto",
23
+ "to_empty": "Vaciar",
24
+ "launch": "Lanzar",
25
+ "correct": "Correcto",
26
+ "ok": "De acuerdo",
27
+ "reload_page": "Recargar página",
28
+ "contact_pi_team": "Contacta con el equipo de Herramientas PI",
29
+ "unforeseen_error": "Error imprevisto",
30
+ "loading": "Cargando",
31
+ "loading_dots": "Cargando...",
32
+ "search": "Buscar",
33
+ "searching_dots": "Buscando...",
34
+ "no_results": "Sin resultados",
35
+ "filter": "Filtrar",
36
+ "date": "Fecha",
37
+ "download_completed": "Descarga completada",
38
+ "fetch_error_message": "Hubo un problema con la petición Fetch^:",
39
+ "some_class_does_not_meet_the_INTERFACE_interface_contract": "Alguna Clase no cumple con el contrato de la interfaz :interface",
40
+ "it_has_been_called_a_JS_component_that_does_not_match_the_current_page": "Se ha llamado un componente JS que no coincide con la pagina actual",
41
+ "need_NUMBER_characters": "Necesarios :number caracteres",
42
+ "a_loader_was_expected_on_the_page": "Se esperaba un loader en la página",
43
+ "check_if_the_loader_was_in_a_div": "Comprueba si el loader estaba en un div. En ese caso se requiere el id del div.",
44
+ "you_do_not_have_permissions_to_edit": "No tienes permisos para editar"
45
+ }
46
+ ;
47
+
48
+ export default _default;
@@ -0,0 +1,6 @@
1
+ export declare class EchoService {
2
+ #private;
3
+ static start(): void;
4
+ static isFailed(): boolean;
5
+ static checkAndUpdateConnectedStatus(): void;
6
+ }
@@ -0,0 +1,23 @@
1
+ import { FetchBroadcastingResponse, FetchResponse } from '../../../_types';
2
+ export declare class Websocket {
3
+ #private;
4
+ static STORAGE: {
5
+ check(): boolean;
6
+ setAsFailed(): void;
7
+ setAsWorked(): void;
8
+ };
9
+ static divMessageWebsockets: HTMLDivElement | null;
10
+ static divMessageQueues: HTMLDivElement | null;
11
+ constructor();
12
+ static checkWebsocketsService(): Promise<void>;
13
+ static toggleErrorQueues(res: FetchResponse): void;
14
+ startListenChannel(channelName: string, events: {
15
+ event: string;
16
+ callback: Function;
17
+ }[]): void;
18
+ static checkBroadcastingFetch({ result, onError, showAlert }: {
19
+ result: FetchBroadcastingResponse | FetchResponse;
20
+ onError?: (res: FetchBroadcastingResponse) => void;
21
+ showAlert?: boolean;
22
+ }): void;
23
+ }
@@ -0,0 +1,5 @@
1
+ export * from './core/_types';
2
+ export * from './core/infrastructure';
3
+ export * from './core/domain';
4
+ export * from './core/application';
5
+ export * from './providers/UtilitiesServiceProvider';
@@ -0,0 +1,12 @@
1
+ type Features = keyof typeof UtilitiesServiceProvider.actions;
2
+ export declare class UtilitiesServiceProvider {
3
+ static actions: {
4
+ startStorageDay: () => void;
5
+ enableTooltips: () => void;
6
+ registerGlobalError: () => void;
7
+ enableNotifications: () => void;
8
+ startLayoutListeners: () => void;
9
+ };
10
+ static features(actions: Features[]): void;
11
+ }
12
+ export {};
@@ -0,0 +1,64 @@
1
+ #!/usr/bin/env node
2
+ import fs from "fs";
3
+ import path from "path";
4
+ import { fileURLToPath } from "url";
5
+ const ensureDirectoryExistence = (filePath) => {
6
+ const dirname = path.dirname(filePath);
7
+ if (!fs.existsSync(dirname)) {
8
+ fs.mkdirSync(dirname, { recursive: true });
9
+ }
10
+ };
11
+ const removeFileWithOtherExtensions = (filePath, extensionsToRemove) => {
12
+ const dir = path.dirname(filePath);
13
+ const baseName = path.basename(filePath, path.extname(filePath));
14
+ extensionsToRemove.forEach((extension) => {
15
+ const fileToDelete = path.join(dir, `${baseName}${extension}`);
16
+ if (fs.existsSync(fileToDelete)) {
17
+ fs.unlinkSync(fileToDelete);
18
+ console.log(`Archivo eliminado: ${fileToDelete}`);
19
+ }
20
+ });
21
+ };
22
+ const createFile = (filePath, contentPath = "") => {
23
+ const extensionsToRemove = [".js", ".jsx", ".ts", ".tsx"];
24
+ removeFileWithOtherExtensions(filePath, extensionsToRemove.filter((ext) => ext !== path.extname(filePath)));
25
+ const isBinary = path.extname(filePath) === ".ico";
26
+ const content = fs.readFileSync(contentPath, isBinary ? null : "utf8");
27
+ fs.writeFileSync(filePath, content, isBinary ? null : "utf8");
28
+ console.log(`Archivo creado: ${filePath}`);
29
+ };
30
+ const __filename = fileURLToPath(import.meta.url);
31
+ const __dirname = path.dirname(__filename);
32
+ const contentDirectory = path.join(__dirname, "stubs");
33
+ let projectRoot = process.cwd();
34
+ if (projectRoot.includes("node_modules")) {
35
+ projectRoot = path.resolve(projectRoot, "../../");
36
+ }
37
+ const filesToCreate = [
38
+ "resources/css/app.css",
39
+ "resources/js/app.ts",
40
+ "resources/js/app/bootstrap.ts",
41
+ "resources/js/app/constants.ts",
42
+ "resources/js/app/routes.ts",
43
+ "resources/js/app/translations.ts",
44
+ "resources/js/app/lang/es.json",
45
+ "resources/js/app/lang/en.json",
46
+ "resources/js/src/shared/application/HomeUseCase.ts",
47
+ "resources/js/src/shared/infrastructure/DefaultController.ts",
48
+ ".prettierrc",
49
+ "tsconfig.json",
50
+ "vite.config.ts"
51
+ ];
52
+ const filesToRemove = [
53
+ "resources/js/bootstrap.js"
54
+ ];
55
+ filesToRemove.forEach((file) => {
56
+ const filePath = path.join(projectRoot, file);
57
+ removeFileWithOtherExtensions(filePath, [".js", ".jsx", ".ts", ".tsx"]);
58
+ });
59
+ filesToCreate.forEach((file) => {
60
+ const filePath = path.join(projectRoot, file);
61
+ const contentPath = path.join(contentDirectory, file);
62
+ ensureDirectoryExistence(filePath);
63
+ createFile(filePath, contentPath);
64
+ });
@@ -0,0 +1,12 @@
1
+ {
2
+ "printWidth": 1000,
3
+ "plugins": ["prettier-plugin-blade", "prettier-plugin-tailwindcss"],
4
+ "overrides": [
5
+ {
6
+ "files": "*.blade.php",
7
+ "options": {
8
+ "parser": "blade"
9
+ }
10
+ }
11
+ ]
12
+ }
@@ -0,0 +1,12 @@
1
+ /*----- Tailwind css -----*/
2
+ @import 'tailwindcss';
3
+
4
+ /*----- Stiles from package @kalel1500/kalion-js css -----*/
5
+ @import '@kalel1500/kalion-js/dist/app/tabulator.css';
6
+ @import '@kalel1500/kalion-js/dist/app/sweetalert.css';
7
+ @import '@kalel1500/kalion-js/dist/app/slimselect.css';
8
+ @import '@kalel1500/kalion-js/dist/app/styles.css';
9
+
10
+ /*----- Tailwindcss config from package @kalel1500/kalion-js css -----*/
11
+ @import '@kalel1500/kalion-js/dist/app/tailwind-config.css';
12
+ @config '../../node_modules/@kalel1500/kalion-js/dist/plugins/tailwind/tailwind.config.js';
@@ -0,0 +1,21 @@
1
+ import 'flowbite';
2
+ import './constants';
3
+ import './translations';
4
+ import { EnvVariables, Route, UtilitiesServiceProvider } from '@kalel1500/kalion-js';
5
+ import { defineRoutes } from './routes';
6
+
7
+ // Declare .env variables
8
+ declare global {
9
+ interface ImportMeta {
10
+ readonly env: EnvVariables & {
11
+ VITE_OTHER?: string
12
+ };
13
+ }
14
+ }
15
+
16
+ // Definir que acciones ejecutar del paquete
17
+ UtilitiesServiceProvider.features(['registerGlobalError', 'enableNotifications', 'startLayoutListeners']);
18
+
19
+ // Definimos y ejecutamos las rutas de JS
20
+ defineRoutes();
21
+ Route.dispatch();
@@ -0,0 +1,28 @@
1
+ import { Constants, DefaultConstants } from '@kalel1500/kalion-js';
2
+
3
+ interface AppConstants extends DefaultConstants {
4
+ anotherSetting: string;
5
+ }
6
+
7
+ const constants = Constants.getInstance<AppConstants>();
8
+ constants.extend({
9
+ appIcon: new URL('/resources/images/favicon.ico', import.meta.url).href,
10
+
11
+ VITE_BROADCASTING_ENABLED: import.meta.env.VITE_BROADCASTING_ENABLED === 'true',
12
+
13
+ VITE_REVERB_APP_KEY: import.meta.env.VITE_REVERB_APP_KEY,
14
+ VITE_REVERB_HOST: import.meta.env.VITE_REVERB_HOST,
15
+ VITE_REVERB_PORT: import.meta.env.VITE_REVERB_PORT === undefined ? undefined : parseInt(import.meta.env.VITE_REVERB_PORT),
16
+ VITE_REVERB_SCHEME: import.meta.env.VITE_REVERB_SCHEME,
17
+
18
+ VITE_APP_ENV: import.meta.env.VITE_APP_ENV,
19
+ VITE_APP_NAME: import.meta.env.VITE_APP_NAME,
20
+ VITE_APP_CODE: import.meta.env.VITE_APP_CODE,
21
+
22
+ VITE_TS_STORAGE_VERSION: import.meta.env.VITE_TS_STORAGE_VERSION,
23
+ VITE_TS_USE_BOOSTRAP_CLASSES: import.meta.env.VITE_TS_USE_BOOSTRAP_CLASSES === 'true',
24
+
25
+ anotherSetting: 'newCustomValue',
26
+ });
27
+
28
+ export const _const = <T extends keyof AppConstants>(key: T): AppConstants[T] => constants.get(key);
@@ -0,0 +1,4 @@
1
+ {
2
+ "test_message": "Test message",
3
+ "test_message_VARIABLE": "Test message with :variable"
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "test_message": "Mensaje de prueba",
3
+ "test_message_VARIABLE": "Mensaje de prueba con :variable"
4
+ }
@@ -0,0 +1,6 @@
1
+ import { Route } from '@kalel1500/kalion-js';
2
+ import DefaultController from '../src/shared/infrastructure/DefaultController';
3
+
4
+ export function defineRoutes(): void {
5
+ Route.page('home', [DefaultController, 'home']);
6
+ }
@@ -0,0 +1,14 @@
1
+ import es from './lang/es.json';
2
+ import en from './lang/en.json';
3
+ import { DefaultTranslations, TranslationReplacements, Translator } from '@kalel1500/kalion-js';
4
+
5
+ export interface AppTranslations extends DefaultTranslations {
6
+ 'test_message': string;
7
+ 'test_message_VARIABLE': string;
8
+ }
9
+
10
+ const translator = Translator.getInstance<AppTranslations>();
11
+ translator.registerTranslations('es', es);
12
+ translator.registerTranslations('en', en);
13
+
14
+ export const __ = (key: keyof AppTranslations, replacements?: TranslationReplacements) => translator.get(key, replacements);
@@ -0,0 +1,7 @@
1
+ // Importamos e iniciamos los paquetes necesarios en la aplicación
2
+ import './app/bootstrap';
3
+
4
+ // @ts-ignore
5
+ import.meta.glob([
6
+ '../images/**',
7
+ ]);
@@ -0,0 +1,8 @@
1
+ import { Instantiable } from "@kalel1500/kalion-js";
2
+
3
+ export default class HomeUseCase extends Instantiable
4
+ {
5
+ __invoke() {
6
+ console.log('inicio');
7
+ }
8
+ }
@@ -0,0 +1,7 @@
1
+ import HomeUseCase from '../application/HomeUseCase';
2
+
3
+ export default class DefaultController {
4
+ home() {
5
+ HomeUseCase.new().__invoke();
6
+ }
7
+ }
@@ -0,0 +1,25 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Language and Environment */
4
+ "target": "ES2022", /* <- es2016 || Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
5
+
6
+ /* Modules */
7
+ "module": "ESNext", /* <- commonjs || Specify what module code is generated. */
8
+ "moduleResolution": "bundler", /* <- node10 (commented) || Specify how TypeScript looks up a file from a given module specifier. */
9
+ "resolveJsonModule": true, /* Enable importing .json files. */
10
+
11
+ /* Emit */
12
+ "noEmit": true, /* Disable emitting files from a compilation. */
13
+
14
+ /* Interop Constraints */
15
+ "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
16
+ "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
17
+
18
+ /* Type Checking */
19
+ "strict": true, /* Enable all strict type-checking options. */
20
+
21
+ /* Completeness */
22
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
23
+ },
24
+ "exclude": ["vendor"]
25
+ }
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vite';
2
+ import laravel from 'laravel-vite-plugin';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+ import { kalionJs } from '@kalel1500/kalion-js/dist/plugins/vite';
5
+
6
+ export default defineConfig({
7
+ plugins: [
8
+ laravel({
9
+ input: ['resources/css/app.css', 'resources/js/app.ts'],
10
+ refresh: false,
11
+ }),
12
+ tailwindcss(),
13
+ kalionJs()
14
+ ]
15
+ });
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const plugin = require("tailwindcss/plugin");
4
+ const flowbitPlugin = require("flowbite/plugin");
5
+ const laravelContent = [
6
+ "./vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php",
7
+ "./storage/framework/views/*.php",
8
+ "./resources/**/*.blade.php",
9
+ "./resources/**/*.js",
10
+ "./resources/**/*.vue",
11
+ "./resources/**/*.ts",
12
+ "./vendor/kalel1500/kalion/resources/**/*.js",
13
+ "./vendor/kalel1500/kalion/resources/**/*.blade.php",
14
+ "./node_modules/flowbite/**/*.js",
15
+ "./node_modules/@kalel1500/kalion-js/**/*.js"
16
+ ];
17
+ const laravelPlugin = plugin.withOptions(function(options = {}) {
18
+ return function({ addVariant }) {
19
+ addVariant("sc", "&:is(.sc *)");
20
+ };
21
+ }, function(options) {
22
+ return {
23
+ theme: {
24
+ extend: {
25
+ screens: {
26
+ "vsm": "440px"
27
+ },
28
+ boxShadow: {
29
+ "h-1xl": "0 0 4px 1px rgba(0, 0, 0, 0.2)",
30
+ "hb-1xl": "0 0 4px 1px rgba(0, 0, 0)",
31
+ "h-2xl": "0 0 5px 2px rgba(0, 0, 0, 0.3)",
32
+ "hb-2xl": "0 0 5px 2px rgba(0, 0, 0)"
33
+ }
34
+ }
35
+ }
36
+ };
37
+ });
38
+ const laravelDefaultPlugins = [
39
+ flowbitPlugin,
40
+ laravelPlugin
41
+ ];
42
+ exports.laravelContent = laravelContent;
43
+ exports.laravelDefaultPlugins = laravelDefaultPlugins;
44
+ exports.laravelPlugin = laravelPlugin;
@@ -0,0 +1,5 @@
1
+ import { default as plugin } from 'tailwindcss/plugin';
2
+ declare const laravelContent: string[];
3
+ declare const laravelPlugin: ReturnType<typeof plugin.withOptions>;
4
+ declare const laravelDefaultPlugins: any[];
5
+ export { laravelContent, laravelPlugin, laravelDefaultPlugins, };
@@ -0,0 +1,15 @@
1
+ export default {
2
+ content: [
3
+ '../../../../../../vendor/laravel/framework/src/Illuminate/Pagination/resources/views/*.blade.php',
4
+ '../../../../../../storage/framework/views/*.php',
5
+ '../../../../../../resources/**/*.blade.php',
6
+ '../../../../../../resources/**/*.js',
7
+ '../../../../../../resources/**/*.vue',
8
+ '../../../../../../resources/**/*.ts',
9
+
10
+ '../../../../../../vendor/kalel1500/kalion/resources/**/*.ts',
11
+ '../../../../../../vendor/kalel1500/kalion/resources/**/*.blade.php',
12
+ '../../../../../../node_modules/flowbite/**/*.js',
13
+ '../../../../../../node_modules/@kalel1500/kalion-js/**/*.js',
14
+ ],
15
+ }
@@ -0,0 +1,2 @@
1
+ import { Plugin } from 'vite';
2
+ export declare function kalionJs(): Plugin;