@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.
- package/LICENSE +674 -0
- package/README.md +27 -0
- package/dist/app/kalion-js.es.js +5832 -0
- package/dist/app/kalion-js.es.js.map +1 -0
- package/dist/app/slimselect.css +62 -0
- package/dist/app/styles-old.css +2032 -0
- package/dist/app/styles.css +42 -0
- package/dist/app/sweetalert.css +1338 -0
- package/dist/app/tabulator.css +3861 -0
- package/dist/app/tailwind-config.css +61 -0
- package/dist/app/types/core/_types/index.d.ts +185 -0
- package/dist/app/types/core/application/LayoutListenersUseCase.d.ts +4 -0
- package/dist/app/types/core/application/index.d.ts +1 -0
- package/dist/app/types/core/domain/exceptions/CannotOpenModalException.d.ts +3 -0
- package/dist/app/types/core/domain/exceptions/CannotOpenModalWarning.d.ts +3 -0
- package/dist/app/types/core/domain/exceptions/InvalidValueException.d.ts +3 -0
- package/dist/app/types/core/domain/index.d.ts +8 -0
- package/dist/app/types/core/domain/objects/value-objects/EnumVo.d.ts +14 -0
- package/dist/app/types/core/domain/objects/value-objects/IntVo.d.ts +12 -0
- package/dist/app/types/core/domain/objects/value-objects/StringVo.d.ts +14 -0
- package/dist/app/types/core/domain/services/DomService.d.ts +7 -0
- package/dist/app/types/core/domain/services/Test.d.ts +4 -0
- package/dist/app/types/core/domain/services/ThemeSwitcher.d.ts +17 -0
- package/dist/app/types/core/infrastructure/index.d.ts +17 -0
- package/dist/app/types/core/infrastructure/utilities/components/Component.d.ts +4 -0
- package/dist/app/types/core/infrastructure/utilities/components/html/Btn.d.ts +6 -0
- package/dist/app/types/core/infrastructure/utilities/components/html/Icon.d.ts +5 -0
- package/dist/app/types/core/infrastructure/utilities/general/Constants.d.ts +10 -0
- package/dist/app/types/core/infrastructure/utilities/general/Cookie.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Html.d.ts +4 -0
- package/dist/app/types/core/infrastructure/utilities/general/Instantiable.d.ts +5 -0
- package/dist/app/types/core/infrastructure/utilities/general/LDate.d.ts +30 -0
- package/dist/app/types/core/infrastructure/utilities/general/LStorage.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Mutation.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/general/Notify.d.ts +19 -0
- package/dist/app/types/core/infrastructure/utilities/general/Ttable.d.ts +73 -0
- package/dist/app/types/core/infrastructure/utilities/general/global.d.ts +38 -0
- package/dist/app/types/core/infrastructure/utilities/modals/SModal.d.ts +111 -0
- package/dist/app/types/core/infrastructure/utilities/routing/Route.d.ts +8 -0
- package/dist/app/types/core/infrastructure/utilities/routing/Url.d.ts +11 -0
- package/dist/app/types/core/infrastructure/utilities/tests/TestConstants.d.ts +8 -0
- package/dist/app/types/core/infrastructure/utilities/translation/Translator.d.ts +13 -0
- package/dist/app/types/core/infrastructure/utilities/translation/TranslatorS.d.ts +0 -0
- package/dist/app/types/core/infrastructure/utilities/translation/lang/en.json.d.ts +48 -0
- package/dist/app/types/core/infrastructure/utilities/translation/lang/es.json.d.ts +48 -0
- package/dist/app/types/core/infrastructure/utilities/websockets/EchoService.d.ts +6 -0
- package/dist/app/types/core/infrastructure/utilities/websockets/Websocket.d.ts +23 -0
- package/dist/app/types/index.d.ts +5 -0
- package/dist/app/types/providers/UtilitiesServiceProvider.d.ts +12 -0
- package/dist/cli/index.js +64 -0
- package/dist/cli/stubs/.prettierrc +12 -0
- package/dist/cli/stubs/resources/css/app.css +12 -0
- package/dist/cli/stubs/resources/js/app/bootstrap.ts +21 -0
- package/dist/cli/stubs/resources/js/app/constants.ts +28 -0
- package/dist/cli/stubs/resources/js/app/lang/en.json +4 -0
- package/dist/cli/stubs/resources/js/app/lang/es.json +4 -0
- package/dist/cli/stubs/resources/js/app/routes.ts +6 -0
- package/dist/cli/stubs/resources/js/app/translations.ts +14 -0
- package/dist/cli/stubs/resources/js/app.ts +7 -0
- package/dist/cli/stubs/resources/js/src/shared/application/HomeUseCase.ts +8 -0
- package/dist/cli/stubs/resources/js/src/shared/infrastructure/DefaultController.ts +7 -0
- package/dist/cli/stubs/tsconfig.json +25 -0
- package/dist/cli/stubs/vite.config.ts +15 -0
- package/dist/plugins/tailwind/index.cjs +44 -0
- package/dist/plugins/tailwind/index.d.ts +5 -0
- package/dist/plugins/tailwind/tailwind.config.js +15 -0
- package/dist/plugins/vite/index.d.ts +2 -0
- package/dist/plugins/vite/index.js +75 -0
- package/package.json +86 -0
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
@plugin 'flowbite/plugin';
|
|
2
|
+
|
|
3
|
+
@theme {
|
|
4
|
+
--font-sans: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
|
|
5
|
+
'Segoe UI Symbol', 'Noto Color Emoji';
|
|
6
|
+
|
|
7
|
+
--breakpoint-xs: 28rem;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/* Variantes personalizadas */
|
|
11
|
+
@custom-variant dark (&:where(.dark, .dark *));
|
|
12
|
+
@custom-variant sc (&:is(.sc *));
|
|
13
|
+
|
|
14
|
+
/*
|
|
15
|
+
The default border color has changed to `currentColor` in Tailwind CSS v4,
|
|
16
|
+
so we've added these compatibility styles to make sure everything still
|
|
17
|
+
looks the same as it did with Tailwind CSS v3.
|
|
18
|
+
|
|
19
|
+
If we ever want to remove these styles, we need to add an explicit border
|
|
20
|
+
color utility to any element that depends on these defaults.
|
|
21
|
+
*/
|
|
22
|
+
@layer base {
|
|
23
|
+
*,
|
|
24
|
+
::after,
|
|
25
|
+
::before,
|
|
26
|
+
::backdrop,
|
|
27
|
+
::file-selector-button {
|
|
28
|
+
border-color: var(--color-gray-200, currentColor);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
/*
|
|
34
|
+
Otros estilos:
|
|
35
|
+
|
|
36
|
+
Se pueden usar estas capas para crear clases propias:
|
|
37
|
+
@layer base {...}
|
|
38
|
+
@layer components {...}
|
|
39
|
+
@layer utilities {...}
|
|
40
|
+
|
|
41
|
+
Se puede usar el "@apply text-gray-900 bg-red-500;" para utilizar las clases de tailwind
|
|
42
|
+
|
|
43
|
+
Y también se pueden crear utilidades (que se pueden usar con variantes)
|
|
44
|
+
@utility content-auto {...}
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
@layer utilities {
|
|
48
|
+
.kal\:shadow-xl {
|
|
49
|
+
box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.2);
|
|
50
|
+
}
|
|
51
|
+
.dark\:kal\:shadow-black-xl:where(.dark, .dark *) {
|
|
52
|
+
box-shadow: 0 0 4px 1px rgba(0, 0, 0);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.kal\:shadow-2xl {
|
|
56
|
+
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.3);
|
|
57
|
+
}
|
|
58
|
+
.dark\:kal\:shadow-black-2xl:where(.dark, .dark *) {
|
|
59
|
+
box-shadow: 0 0 4px 1px rgba(0, 0, 0);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { EventCallBackMethods } from 'tabulator-tables';
|
|
2
|
+
import { default as Echo } from 'laravel-echo';
|
|
3
|
+
import { Translation } from '../infrastructure';
|
|
4
|
+
declare global {
|
|
5
|
+
interface Window {
|
|
6
|
+
Pusher: any;
|
|
7
|
+
Echo: Echo<'reverb'>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export type EnvVariables = {
|
|
11
|
+
readonly VITE_CONF_MINIFY?: string;
|
|
12
|
+
readonly VITE_CONF_SOURCEMAP?: string;
|
|
13
|
+
readonly VITE_CONF_USE_APPCODE_IN_SOURCE_PATH?: string;
|
|
14
|
+
readonly VITE_BROADCASTING_ENABLED?: string;
|
|
15
|
+
readonly VITE_REVERB_APP_KEY?: string;
|
|
16
|
+
readonly VITE_REVERB_HOST?: string;
|
|
17
|
+
readonly VITE_REVERB_PORT?: string;
|
|
18
|
+
readonly VITE_REVERB_SCHEME?: string;
|
|
19
|
+
readonly VITE_APP_ENV?: string;
|
|
20
|
+
readonly VITE_APP_NAME?: string;
|
|
21
|
+
readonly VITE_APP_CODE?: string;
|
|
22
|
+
readonly VITE_TS_STORAGE_VERSION?: string;
|
|
23
|
+
readonly VITE_TS_USE_BOOSTRAP_CLASSES?: string;
|
|
24
|
+
};
|
|
25
|
+
export interface DefaultConstants {
|
|
26
|
+
token: string | null;
|
|
27
|
+
lang: string;
|
|
28
|
+
langDouble: string;
|
|
29
|
+
defaultZoneName: string;
|
|
30
|
+
appIcon: string;
|
|
31
|
+
routeName_websockets_checkService: string;
|
|
32
|
+
routeName_queues_checkService: string;
|
|
33
|
+
readonly VITE_BROADCASTING_ENABLED: boolean;
|
|
34
|
+
readonly VITE_REVERB_APP_KEY: string | null;
|
|
35
|
+
readonly VITE_REVERB_HOST: string;
|
|
36
|
+
readonly VITE_REVERB_PORT: number;
|
|
37
|
+
readonly VITE_REVERB_SCHEME: string;
|
|
38
|
+
readonly VITE_APP_ENV: string;
|
|
39
|
+
readonly VITE_APP_NAME: string;
|
|
40
|
+
readonly VITE_APP_CODE: string;
|
|
41
|
+
readonly VITE_TS_STORAGE_VERSION: string;
|
|
42
|
+
readonly VITE_TS_USE_BOOSTRAP_CLASSES: boolean;
|
|
43
|
+
}
|
|
44
|
+
export interface DefaultTranslations extends Translation {
|
|
45
|
+
save: string;
|
|
46
|
+
cancel: string;
|
|
47
|
+
delete: string;
|
|
48
|
+
move_to: string;
|
|
49
|
+
close: string;
|
|
50
|
+
detail: string;
|
|
51
|
+
copy: string;
|
|
52
|
+
search_placeholder: string;
|
|
53
|
+
select_placeholder: string;
|
|
54
|
+
select_value_placeholder: string;
|
|
55
|
+
copied_text: string;
|
|
56
|
+
confirm_delete_record_NAME: string;
|
|
57
|
+
confirm_delete_FIELD_NAME: string;
|
|
58
|
+
record_RECORD_doesnt_exist_in_the_TABLE_table: string;
|
|
59
|
+
min_MIN_characters_on_search: string;
|
|
60
|
+
add_FIELD: string;
|
|
61
|
+
see_FIELD: string;
|
|
62
|
+
edit_FIELD_NAME: string;
|
|
63
|
+
the_page: string;
|
|
64
|
+
cannot_save_an_error: string;
|
|
65
|
+
incorrect_blade_format: string;
|
|
66
|
+
to_empty: string;
|
|
67
|
+
launch: string;
|
|
68
|
+
correct: string;
|
|
69
|
+
ok: string;
|
|
70
|
+
reload_page: string;
|
|
71
|
+
contact_pi_team: string;
|
|
72
|
+
unforeseen_error: string;
|
|
73
|
+
loading: string;
|
|
74
|
+
loading_dots: string;
|
|
75
|
+
search: string;
|
|
76
|
+
searching_dots: string;
|
|
77
|
+
no_results: string;
|
|
78
|
+
filter: string;
|
|
79
|
+
date: string;
|
|
80
|
+
download_completed: string;
|
|
81
|
+
fetch_error_message: string;
|
|
82
|
+
some_class_does_not_meet_the_INTERFACE_interface_contract: string;
|
|
83
|
+
it_has_been_called_a_JS_component_that_does_not_match_the_current_page: string;
|
|
84
|
+
need_NUMBER_characters: string;
|
|
85
|
+
a_loader_was_expected_on_the_page: string;
|
|
86
|
+
check_if_the_loader_was_in_a_div: string;
|
|
87
|
+
you_do_not_have_permissions_to_edit: string;
|
|
88
|
+
}
|
|
89
|
+
export interface FetchParams {
|
|
90
|
+
url: string;
|
|
91
|
+
type?: string;
|
|
92
|
+
ajaxParams?: {};
|
|
93
|
+
responseIsText?: boolean;
|
|
94
|
+
showLog?: boolean;
|
|
95
|
+
}
|
|
96
|
+
export interface FetchParamsSimple {
|
|
97
|
+
url: string;
|
|
98
|
+
type: string;
|
|
99
|
+
}
|
|
100
|
+
export interface CatchParams {
|
|
101
|
+
error: any;
|
|
102
|
+
title?: string;
|
|
103
|
+
text?: string;
|
|
104
|
+
html?: string;
|
|
105
|
+
reloadOnClose?: boolean;
|
|
106
|
+
footer?: string;
|
|
107
|
+
from?: string;
|
|
108
|
+
}
|
|
109
|
+
export interface FetchResponse {
|
|
110
|
+
success: boolean;
|
|
111
|
+
message: string;
|
|
112
|
+
data?: Record<string, any> | string;
|
|
113
|
+
detail?: string;
|
|
114
|
+
}
|
|
115
|
+
export interface ResponseEventFetch {
|
|
116
|
+
response: FetchResponse;
|
|
117
|
+
}
|
|
118
|
+
export interface FetchBroadcastingResponse extends FetchResponse {
|
|
119
|
+
data: {
|
|
120
|
+
broadcasting: FetchResponse;
|
|
121
|
+
[p: string]: any;
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
export type Nullish = null | undefined;
|
|
125
|
+
export type StrOrNullish = string | Nullish;
|
|
126
|
+
export type StrIntOrNullish = number | StrOrNullish;
|
|
127
|
+
export type FetchResponseOrBroadcasting = FetchResponse | FetchBroadcastingResponse;
|
|
128
|
+
export type AvailableValidations = 'optional' | 'required' | `min:${number}` | `max:${number}` | 'color' | 'array' | 'number' | 'boolean' | `required_if:${'1' | '0'}`;
|
|
129
|
+
export type ValidationRules = {
|
|
130
|
+
[P: string]: AvailableValidations[] | string | number | boolean | null | undefined;
|
|
131
|
+
};
|
|
132
|
+
export type ValidationResponse = {
|
|
133
|
+
success: boolean;
|
|
134
|
+
messages: string[];
|
|
135
|
+
validated: Record<string, any>;
|
|
136
|
+
};
|
|
137
|
+
export type ValidationInternalData = {
|
|
138
|
+
success: boolean[];
|
|
139
|
+
messages: string[];
|
|
140
|
+
validated: Record<string, any>;
|
|
141
|
+
};
|
|
142
|
+
export type SyncOrAsync<T> = T | Promise<T> | {
|
|
143
|
+
toPromise: () => T;
|
|
144
|
+
};
|
|
145
|
+
export type NullHTMLButtonElement = HTMLButtonElement | null;
|
|
146
|
+
export type TableSettingEvents = Partial<EventCallBackMethods>;
|
|
147
|
+
export type TranslationReplacements = Record<string, StrOrNullish>;
|
|
148
|
+
export declare enum Theme {
|
|
149
|
+
dark = "dark",
|
|
150
|
+
light = "light",
|
|
151
|
+
system = "system"
|
|
152
|
+
}
|
|
153
|
+
export type ThemeButtons = Record<Theme, HTMLElement | null>;
|
|
154
|
+
export type UserPreferences = {
|
|
155
|
+
version: string;
|
|
156
|
+
theme: Theme;
|
|
157
|
+
sidebar_collapsed: boolean;
|
|
158
|
+
sidebar_state_per_page: boolean;
|
|
159
|
+
};
|
|
160
|
+
export type ViewData<T> = {
|
|
161
|
+
success: boolean;
|
|
162
|
+
message: string;
|
|
163
|
+
data: T;
|
|
164
|
+
};
|
|
165
|
+
export type Sizes = '2xs' | 'xs' | 'sm' | 'base' | 'lg' | 'lx';
|
|
166
|
+
export type Colors = 'blue' | 'dark' | 'green' | 'red' | 'emerald' | 'light' | 'yellow' | 'gray';
|
|
167
|
+
export type ConfigBtn = {
|
|
168
|
+
id?: string;
|
|
169
|
+
size: Sizes;
|
|
170
|
+
color: Colors;
|
|
171
|
+
slot?: string;
|
|
172
|
+
extraClasses?: string;
|
|
173
|
+
extraAttributes?: string;
|
|
174
|
+
isLink?: boolean;
|
|
175
|
+
linkUrl?: string;
|
|
176
|
+
linkBlank?: boolean;
|
|
177
|
+
};
|
|
178
|
+
export type ConfigIcon = {
|
|
179
|
+
outline?: boolean;
|
|
180
|
+
strokeWidth?: string;
|
|
181
|
+
size?: string;
|
|
182
|
+
};
|
|
183
|
+
export type ComponentType = 'btn' | 'icon';
|
|
184
|
+
export type IconType = 'info' | 'save' | 'cancel' | 'delete' | 'new' | 'reload' | 'move' | 'edit';
|
|
185
|
+
export type ComponentName = `btn` | `icon.${IconType}`;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LayoutListenersUseCase';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * from './exceptions/CannotOpenModalException';
|
|
2
|
+
export * from './exceptions/CannotOpenModalWarning';
|
|
3
|
+
export * from './exceptions/InvalidValueException';
|
|
4
|
+
export * from './objects/value-objects/StringVo';
|
|
5
|
+
export * from './objects/value-objects/IntVo';
|
|
6
|
+
export * from './objects/value-objects/EnumVo';
|
|
7
|
+
export * from './services/Test';
|
|
8
|
+
export * from './services/DomService';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrOrNullish } from '../../../_types';
|
|
2
|
+
export type EnumVoParams = {
|
|
3
|
+
allowNull?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare abstract class EnumVo {
|
|
6
|
+
#private;
|
|
7
|
+
protected _value: StrOrNullish;
|
|
8
|
+
protected _allowNull: boolean;
|
|
9
|
+
protected _permittedValues: string[];
|
|
10
|
+
constructor(value: StrOrNullish, params?: EnumVoParams);
|
|
11
|
+
abstract setPermittedValues(): void;
|
|
12
|
+
value(): StrOrNullish;
|
|
13
|
+
static from<T extends EnumVo>(this: new (value: StrOrNullish, params?: EnumVoParams) => T, value: StrOrNullish, params?: EnumVoParams): T;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { StrIntOrNullish } from '../../../_types';
|
|
2
|
+
export type IntVoParams = {
|
|
3
|
+
allowNull?: boolean;
|
|
4
|
+
};
|
|
5
|
+
export declare class IntVo {
|
|
6
|
+
#private;
|
|
7
|
+
protected _value: StrIntOrNullish;
|
|
8
|
+
protected _allowNull: boolean;
|
|
9
|
+
constructor(value: StrIntOrNullish, params?: IntVoParams);
|
|
10
|
+
value(): StrIntOrNullish;
|
|
11
|
+
static from(value: StrIntOrNullish, params?: IntVoParams): IntVo;
|
|
12
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { StrOrNullish } from '../../../_types';
|
|
2
|
+
export type StringVoParams = {
|
|
3
|
+
allowNull?: boolean;
|
|
4
|
+
errorMessage?: string | null;
|
|
5
|
+
};
|
|
6
|
+
export declare class StringVo {
|
|
7
|
+
#private;
|
|
8
|
+
protected _value: StrOrNullish;
|
|
9
|
+
protected _allowNull: boolean;
|
|
10
|
+
protected _errorMessage: string | null;
|
|
11
|
+
constructor(value: StrOrNullish, params?: StringVoParams);
|
|
12
|
+
value(): StrOrNullish;
|
|
13
|
+
static from(value: StrOrNullish, params?: StringVoParams): StringVo;
|
|
14
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Instantiable } from '../../infrastructure';
|
|
2
|
+
import { Theme, ThemeButtons } from '../../_types';
|
|
3
|
+
export declare class ThemeSwitcher extends Instantiable {
|
|
4
|
+
private $document;
|
|
5
|
+
private mediaQuery;
|
|
6
|
+
buttons: ThemeButtons;
|
|
7
|
+
constructor();
|
|
8
|
+
getTheme(): Theme;
|
|
9
|
+
init(): void;
|
|
10
|
+
setToDark(e?: Theme): void;
|
|
11
|
+
setToLight(e?: Theme): void;
|
|
12
|
+
updateTheme(theme: Theme): void;
|
|
13
|
+
saveAndUpdate(theme: Theme): void;
|
|
14
|
+
toDarkMode(): void;
|
|
15
|
+
toLightMode(): void;
|
|
16
|
+
toSystemMode(): void;
|
|
17
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './utilities/general/Constants';
|
|
2
|
+
export * from './utilities/general/Cookie';
|
|
3
|
+
export * from './utilities/general/global';
|
|
4
|
+
export * from './utilities/general/Html';
|
|
5
|
+
export * from './utilities/general/Instantiable';
|
|
6
|
+
export * from './utilities/general/LDate';
|
|
7
|
+
export * from './utilities/general/LStorage';
|
|
8
|
+
export * from './utilities/general/Mutation';
|
|
9
|
+
export * from './utilities/general/Notify';
|
|
10
|
+
export * from './utilities/general/Ttable';
|
|
11
|
+
export * from './utilities/modals/SModal';
|
|
12
|
+
export * from './utilities/routing/Route';
|
|
13
|
+
export * from './utilities/routing/Url';
|
|
14
|
+
export * from './utilities/tests/TestConstants';
|
|
15
|
+
export * from './utilities/translation/Translator';
|
|
16
|
+
export * from './utilities/websockets/EchoService';
|
|
17
|
+
export * from './utilities/websockets/Websocket';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ConfigBtn } from '../../../../_types';
|
|
2
|
+
export declare class Btn {
|
|
3
|
+
private static getHtml;
|
|
4
|
+
static tailwind({ id, size, color, slot, extraClasses, extraAttributes, isLink, linkUrl, linkBlank }: ConfigBtn): string;
|
|
5
|
+
static bootstrap({ id, size, color, slot, extraClasses, extraAttributes, isLink, linkUrl, linkBlank }: ConfigBtn): string;
|
|
6
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DefaultConstants } from '../../../_types';
|
|
2
|
+
export declare class Constants<T extends DefaultConstants> {
|
|
3
|
+
private static instance;
|
|
4
|
+
constants: T;
|
|
5
|
+
private constructor();
|
|
6
|
+
static getInstance<U extends DefaultConstants>(): Constants<U>;
|
|
7
|
+
get<K extends keyof T>(key: K): T[K];
|
|
8
|
+
extend(newConfig: Partial<T>): void;
|
|
9
|
+
getConstants(): T;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { UserPreferences } from '../../../_types';
|
|
2
|
+
export declare class Cookie {
|
|
3
|
+
private cookiePreferencesName;
|
|
4
|
+
static new(): Cookie;
|
|
5
|
+
get(name: string): string | null;
|
|
6
|
+
set(name: string, value: string, days: number): void;
|
|
7
|
+
delete(name: string): void;
|
|
8
|
+
preferences(): UserPreferences | null;
|
|
9
|
+
setPreferences(preferences: UserPreferences): void;
|
|
10
|
+
setPreference<K extends keyof UserPreferences>(key: K, value: UserPreferences[K]): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { DateTime } from 'luxon';
|
|
2
|
+
import { DateTimeUnit } from 'luxon/src/datetime';
|
|
3
|
+
import { DurationObjectUnits } from 'luxon/src/duration';
|
|
4
|
+
type ReceivedDate = string | DateTime;
|
|
5
|
+
type ReceivedNullableDate = string | DateTime | null | undefined;
|
|
6
|
+
export declare class LDate {
|
|
7
|
+
#private;
|
|
8
|
+
static formats: {
|
|
9
|
+
date_startYear: string;
|
|
10
|
+
date_startDay: string;
|
|
11
|
+
date_startYear_slash: string;
|
|
12
|
+
date_startDay_slash: string;
|
|
13
|
+
date_startMonthWithoutDay_slash: string;
|
|
14
|
+
datetime_startYear: string;
|
|
15
|
+
datetime_startYear_oneWord: string;
|
|
16
|
+
time: string;
|
|
17
|
+
timeWithoutHours: string;
|
|
18
|
+
timestamp_seconds: string;
|
|
19
|
+
};
|
|
20
|
+
static now(): DateTime<true>;
|
|
21
|
+
static local(): DateTime<true>;
|
|
22
|
+
static parse(date: string): DateTime<true> | DateTime<false>;
|
|
23
|
+
static format(date: ReceivedDate, format: string): string;
|
|
24
|
+
static toSeconds(date: ReceivedDate): string;
|
|
25
|
+
static hasSame(d1: ReceivedNullableDate, d2: ReceivedNullableDate, unit: DateTimeUnit): boolean;
|
|
26
|
+
static diffNow(date: ReceivedNullableDate, unit?: keyof DurationObjectUnits): number | null | undefined;
|
|
27
|
+
static diff(d1: ReceivedNullableDate, d2: ReceivedNullableDate, unit?: keyof DurationObjectUnits): number | null | undefined;
|
|
28
|
+
static getTimeId(): string;
|
|
29
|
+
}
|
|
30
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare class LStorage {
|
|
2
|
+
static readonly VERSION: string;
|
|
3
|
+
static readonly VERSION_KEY = "config-version";
|
|
4
|
+
static setItem(key: string, value: string): void;
|
|
5
|
+
static getItem(key: string): string | null;
|
|
6
|
+
static removeItem(key: string): void;
|
|
7
|
+
static exist(key: string): boolean;
|
|
8
|
+
static checkAndUpdateVersion(): void;
|
|
9
|
+
static isFirstConnectionInDay(): boolean;
|
|
10
|
+
static setNowAsLastConnection(): void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
type MutationParams = {
|
|
2
|
+
elementId: string;
|
|
3
|
+
class: string;
|
|
4
|
+
whenHave: () => void;
|
|
5
|
+
whenHavent: () => void;
|
|
6
|
+
};
|
|
7
|
+
export declare class Mutation {
|
|
8
|
+
static observeClass(params: MutationParams): void;
|
|
9
|
+
static observe(targetNode: HTMLElement, options: MutationObserverInit, mutationCallback: () => {}): void;
|
|
10
|
+
}
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
type LaunchParams = {
|
|
2
|
+
title: string;
|
|
3
|
+
body?: string;
|
|
4
|
+
openUrl?: string;
|
|
5
|
+
when: 'hidden' | 'unfocused' | 'all';
|
|
6
|
+
};
|
|
7
|
+
export declare class Notify {
|
|
8
|
+
#private;
|
|
9
|
+
static STORAGE: {
|
|
10
|
+
getAll(): string | null;
|
|
11
|
+
check(key: string): boolean;
|
|
12
|
+
saveNotified(key: string): void;
|
|
13
|
+
deleteNotified(): void;
|
|
14
|
+
};
|
|
15
|
+
constructor(title: string, body?: string, openUrl?: string);
|
|
16
|
+
static checkAndRequestPermission(): void;
|
|
17
|
+
static launch({ title, body, openUrl, when }: LaunchParams): void;
|
|
18
|
+
}
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { CellComponent, JSONRecord, LabelValue, ListEditorParams, Options, RowComponent, TabulatorFull as Tabulator } from 'tabulator-tables';
|
|
2
|
+
import { FetchParamsSimple, NullHTMLButtonElement, TableSettingEvents, ValidationRules } from '../../../_types';
|
|
3
|
+
export declare class Ttable {
|
|
4
|
+
readonly tableId: string | HTMLElement;
|
|
5
|
+
table: Tabulator;
|
|
6
|
+
isEditable: boolean;
|
|
7
|
+
readonly orderFieldName: string;
|
|
8
|
+
constructor(tableId: string | HTMLElement, options: Options, settingEvents: TableSettingEvents, orderFieldName?: string);
|
|
9
|
+
isEditableCell(cell: CellComponent): boolean;
|
|
10
|
+
addClassEditableOnEditableCells(row: RowComponent): void;
|
|
11
|
+
static formatListValuesToLabelValueStructure(values: JSONRecord): LabelValue[];
|
|
12
|
+
/**
|
|
13
|
+
* -----------------------------------------------------------------------------------------------------------------
|
|
14
|
+
* ----- VARIABLES Y FUNCIONES GENERICAS Y COFNIGURACIONES PREDETERMINADAS------------------------------------------
|
|
15
|
+
*/
|
|
16
|
+
static defaultSettings: Options;
|
|
17
|
+
static buttons: {
|
|
18
|
+
linkBtnInfo: (title: string, url: string, blank: boolean) => string;
|
|
19
|
+
linkBtnEdit: (title: string, url: string) => string;
|
|
20
|
+
linkTextEdit: (title: string, url: string) => string;
|
|
21
|
+
btnInfo: (title: string) => string;
|
|
22
|
+
btnSave: (title: string, showText?: boolean) => string;
|
|
23
|
+
btnCancel: (title: string, showText?: boolean) => string;
|
|
24
|
+
btnDelete: (title: string, showText?: boolean) => string;
|
|
25
|
+
btnNew: (title: string, id?: string) => string;
|
|
26
|
+
btnReload: (title: string) => string;
|
|
27
|
+
btnMove: (title: string) => string;
|
|
28
|
+
};
|
|
29
|
+
static formatterParams_lookupBoolean: {
|
|
30
|
+
undefined: string;
|
|
31
|
+
null: string;
|
|
32
|
+
0: string;
|
|
33
|
+
1: string;
|
|
34
|
+
};
|
|
35
|
+
static formatterParams_lookupSimple(values: JSONRecord): JSONRecord;
|
|
36
|
+
static defaultListEditorParams: ListEditorParams;
|
|
37
|
+
static editorParams_listBoolean: ListEditorParams;
|
|
38
|
+
static editorParams_list(values: JSONRecord, { searchable }?: {
|
|
39
|
+
searchable: boolean;
|
|
40
|
+
}): ListEditorParams;
|
|
41
|
+
static editorParams_listFix(values: JSONRecord): ListEditorParams;
|
|
42
|
+
static editorParams_listBig(values: JSONRecord): ListEditorParams;
|
|
43
|
+
static headerFilterParams_listBoolean: {
|
|
44
|
+
values: {
|
|
45
|
+
0: string;
|
|
46
|
+
1: string;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
static headerFilterParams_listSimple(values: JSONRecord | any[]): ListEditorParams;
|
|
50
|
+
static headerFilterParams_listBig(values: JSONRecord): ListEditorParams;
|
|
51
|
+
/**
|
|
52
|
+
* -----------------------------------------------------------------------------------------------------------------
|
|
53
|
+
* ----- OTRAS FUNCIONES -------------------------------------------------------------------------------------------
|
|
54
|
+
*/
|
|
55
|
+
defaultListenerBtnEdit(btnEdit: NullHTMLButtonElement, btnCancelEdit: NullHTMLButtonElement): void;
|
|
56
|
+
defaultListenerBtnCancel(btnEdit: NullHTMLButtonElement, btnCancelEdit: NullHTMLButtonElement): void;
|
|
57
|
+
defaultListenerBtnAddRow(data?: {}): void;
|
|
58
|
+
saveDataOnRowMovedEvent(row: RowComponent, { url, type }: FetchParamsSimple): Promise<void>;
|
|
59
|
+
changeColorsOnRowMovedEvent(row: RowComponent): Promise<{
|
|
60
|
+
isEdited: boolean;
|
|
61
|
+
}>;
|
|
62
|
+
saveOrderOfAllData({ url, type }: FetchParamsSimple): Promise<void>;
|
|
63
|
+
static defaultActionSave(cell: CellComponent, url: string, rules: ValidationRules, preventReplaceData?: boolean): Promise<boolean>;
|
|
64
|
+
static defaultActionDelete(cell: CellComponent, url: string, { title, html, preventReplaceData, }: {
|
|
65
|
+
title?: string;
|
|
66
|
+
html?: string;
|
|
67
|
+
preventReplaceData?: boolean;
|
|
68
|
+
}): Promise<boolean>;
|
|
69
|
+
static defaultActionCancel(cell: CellComponent): void;
|
|
70
|
+
defaultFormatterCellActions(cell: CellComponent): string;
|
|
71
|
+
static customFormatterLookup(cell: CellComponent, formatterParams: Record<any, any>): string;
|
|
72
|
+
static getObjectWithThisValue(__this: any): {};
|
|
73
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { CatchParams, FetchParams, FetchResponse, ValidationResponse, ValidationRules } from '../../../_types';
|
|
2
|
+
type Value = string | string[];
|
|
3
|
+
type Key = string | string[] | null;
|
|
4
|
+
export declare class g {
|
|
5
|
+
static errorModalIsShowed: boolean;
|
|
6
|
+
static isNotNull(variable: any): boolean;
|
|
7
|
+
static isUndefined(variable: any): boolean;
|
|
8
|
+
static escapeHtml(html: string): string;
|
|
9
|
+
static handleGlobalError(error?: Error): boolean;
|
|
10
|
+
static newFetch<T = FetchResponse>({ url, type, ajaxParams, responseIsText, showLog, }: FetchParams): Promise<T>;
|
|
11
|
+
static catchCode({ error, title, text, html, reloadOnClose, footer, from, }: CatchParams): void;
|
|
12
|
+
static sleep(ms: number): Promise<unknown>;
|
|
13
|
+
static strIsEmpty(str: any): boolean;
|
|
14
|
+
static isEmpty(value: any): boolean;
|
|
15
|
+
static deleteArrayItemsWhere(array: any[], filterFunc: (e: any) => boolean, nameField: string): any[];
|
|
16
|
+
static valueFailsRequiredValidation(value: any): boolean;
|
|
17
|
+
static validate(data: Record<string, any>, rules: ValidationRules): ValidationResponse;
|
|
18
|
+
static strIncludesAny(str: string, values: string[]): boolean;
|
|
19
|
+
static eventClosest(event: Event, selectors: string): HTMLElement | null;
|
|
20
|
+
static showPageLoader(): void;
|
|
21
|
+
static removePageLoader(): void;
|
|
22
|
+
static reloadPage(): void;
|
|
23
|
+
static startTooltips(): void;
|
|
24
|
+
static addSpinner(selectors: string | HTMLElement | NodeListOf<HTMLElement> | null, size?: 'sm' | 'md'): void;
|
|
25
|
+
static removeSpinner(selectors: string | HTMLElement | NodeListOf<HTMLElement> | null): void;
|
|
26
|
+
static consoleInfo(message?: any): void;
|
|
27
|
+
static isTruthy(value: any): boolean;
|
|
28
|
+
static isFalsy(value: any): boolean;
|
|
29
|
+
static isNullish(value: any): boolean;
|
|
30
|
+
static dataGet(target: any, key: Key, defaultValue?: any): any;
|
|
31
|
+
static explodePluckParameters(value: Value, key: Key): [Value, Key];
|
|
32
|
+
static pluck(array: Record<any, any>[], value: Key): any[];
|
|
33
|
+
static pluck(array: Record<any, any>[], value: Key, key: Key): Record<any, any>;
|
|
34
|
+
static slugify(text: string, separator?: string): string;
|
|
35
|
+
static getHiddenClass(): "d-none" | "hidden";
|
|
36
|
+
static mergeTailwindClasses(defaultCls: string, extraCls: string): string;
|
|
37
|
+
}
|
|
38
|
+
export {};
|