lkt-vue-kernel 1.0.0
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 +23 -0
- package/dist/index.d.ts +188 -0
- package/dist/index.js +108 -0
- package/package.json +35 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 LKT VUE
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# LKT TS Interfaces
|
|
2
|
+
|
|
3
|
+
In this package are located the interfaces used by lkt-web-tech project.
|
|
4
|
+
|
|
5
|
+
## LktObject
|
|
6
|
+
|
|
7
|
+
This interface polyfills the traditional Javascript object to Typescript.
|
|
8
|
+
|
|
9
|
+
### Usage
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
import {LktObject} from "lkt-ts-interfaces";
|
|
13
|
+
|
|
14
|
+
const myObject: LktObject = {};
|
|
15
|
+
|
|
16
|
+
// With this interface, you can add props dynamically:
|
|
17
|
+
const props = ['lorem', 'ipsum'];
|
|
18
|
+
props.forEach(prop => {myObject[prop] = prop});
|
|
19
|
+
|
|
20
|
+
// Or like this:
|
|
21
|
+
myObject.may = '...the force be with you!'
|
|
22
|
+
```
|
|
23
|
+
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
interface LktObject {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
declare enum FieldType {
|
|
6
|
+
Text = "text",
|
|
7
|
+
Email = "email",
|
|
8
|
+
Tel = "tel",
|
|
9
|
+
Password = "password",
|
|
10
|
+
Search = "search",
|
|
11
|
+
Number = "number",
|
|
12
|
+
Color = "color",
|
|
13
|
+
Range = "range",
|
|
14
|
+
Textarea = "textarea",
|
|
15
|
+
Html = "html",
|
|
16
|
+
Date = "date",
|
|
17
|
+
File = "file",
|
|
18
|
+
Image = "image",
|
|
19
|
+
Select = "select",
|
|
20
|
+
Check = "check",
|
|
21
|
+
Switch = "switch",
|
|
22
|
+
Calc = "calc",
|
|
23
|
+
Card = "card",
|
|
24
|
+
Elements = "elements"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type ValidOptionValue = string | number | undefined;
|
|
28
|
+
|
|
29
|
+
interface OptionConfig {
|
|
30
|
+
value: ValidOptionValue;
|
|
31
|
+
label: string;
|
|
32
|
+
data?: LktObject;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
group?: string;
|
|
35
|
+
icon?: string;
|
|
36
|
+
modal?: string | Function;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
declare class LktItem implements LktObject {
|
|
40
|
+
lktDateProps: string[];
|
|
41
|
+
lktStrictItem: boolean;
|
|
42
|
+
feed(data?: LktObject): void;
|
|
43
|
+
assignProp(key: string, value: any): void;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
declare class Option extends LktItem implements OptionConfig {
|
|
47
|
+
value: ValidOptionValue;
|
|
48
|
+
label: string;
|
|
49
|
+
data?: LktObject;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
group?: string;
|
|
52
|
+
icon?: string;
|
|
53
|
+
modal?: string | Function;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
type ValidFieldValue = string | number | boolean | LktObject | Option[];
|
|
57
|
+
|
|
58
|
+
interface FieldConfig {
|
|
59
|
+
modelValue: ValidFieldValue;
|
|
60
|
+
type?: FieldType;
|
|
61
|
+
valid?: boolean;
|
|
62
|
+
placeholder?: string;
|
|
63
|
+
searchPlaceholder?: string;
|
|
64
|
+
label?: string;
|
|
65
|
+
labelIcon?: string;
|
|
66
|
+
labelIconAtEnd?: boolean;
|
|
67
|
+
name?: string;
|
|
68
|
+
autocomplete?: boolean;
|
|
69
|
+
disabled?: boolean | Function;
|
|
70
|
+
readonly?: boolean;
|
|
71
|
+
readMode?: boolean;
|
|
72
|
+
allowReadModeSwitch?: boolean;
|
|
73
|
+
tabindex?: number;
|
|
74
|
+
mandatory?: boolean;
|
|
75
|
+
showPassword?: boolean;
|
|
76
|
+
canClear?: boolean;
|
|
77
|
+
canUndo?: boolean;
|
|
78
|
+
canI18n?: boolean;
|
|
79
|
+
canStep?: boolean;
|
|
80
|
+
canTag?: boolean;
|
|
81
|
+
mandatoryMessage?: string;
|
|
82
|
+
infoMessage?: string;
|
|
83
|
+
errorMessage?: string;
|
|
84
|
+
min?: number | string | undefined;
|
|
85
|
+
max?: number | string | undefined;
|
|
86
|
+
step?: number | string;
|
|
87
|
+
enableAutoNumberFix?: boolean;
|
|
88
|
+
emptyValueSlot?: string;
|
|
89
|
+
optionSlot?: string;
|
|
90
|
+
valueSlot?: string;
|
|
91
|
+
editSlot?: string;
|
|
92
|
+
slotData?: LktObject;
|
|
93
|
+
resource?: string;
|
|
94
|
+
resourceData?: LktObject;
|
|
95
|
+
validationResource?: string;
|
|
96
|
+
validationResourceData?: LktObject;
|
|
97
|
+
autoValidation?: boolean;
|
|
98
|
+
autoValidationType?: 'focus' | 'blur' | 'always';
|
|
99
|
+
validationStack?: string;
|
|
100
|
+
minNumbers?: number | string | undefined;
|
|
101
|
+
maxNumbers?: number | string | undefined;
|
|
102
|
+
minChars?: number | string | undefined;
|
|
103
|
+
maxChars?: number | string | undefined;
|
|
104
|
+
minUpperChars?: number | string | undefined;
|
|
105
|
+
maxUpperChars?: number | string | undefined;
|
|
106
|
+
minLowerChars?: number | string | undefined;
|
|
107
|
+
maxLowerChars?: number | string | undefined;
|
|
108
|
+
minSpecialChars?: number | string | undefined;
|
|
109
|
+
maxSpecialChars?: number | string | undefined;
|
|
110
|
+
checkEqualTo?: number | string | undefined;
|
|
111
|
+
featuredButton?: string;
|
|
112
|
+
infoButtonEllipsis?: boolean;
|
|
113
|
+
fileName?: string;
|
|
114
|
+
customButtonText?: string;
|
|
115
|
+
customButtonClass?: string;
|
|
116
|
+
options?: string | Option[];
|
|
117
|
+
multiple?: boolean;
|
|
118
|
+
multipleDisplay?: LktObject;
|
|
119
|
+
multipleDisplayEdition?: LktObject;
|
|
120
|
+
searchable?: boolean;
|
|
121
|
+
autoloadOptionsResource?: boolean | 'feed';
|
|
122
|
+
optionsDownload?: string | Function;
|
|
123
|
+
optionsModal?: string | Function;
|
|
124
|
+
optionsModalData?: LktObject | Function;
|
|
125
|
+
optionsIcon?: string | Function;
|
|
126
|
+
optionsLabelFormatter?: Function;
|
|
127
|
+
optionsResource?: string;
|
|
128
|
+
optionsResourceData?: LktObject;
|
|
129
|
+
icon?: string | Function;
|
|
130
|
+
download?: string | Function;
|
|
131
|
+
modal?: string | Function;
|
|
132
|
+
modalKey?: string | number | Function;
|
|
133
|
+
modalData?: LktObject;
|
|
134
|
+
prop?: LktObject;
|
|
135
|
+
itemType?: string;
|
|
136
|
+
optionValueType?: string;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
declare enum TooltipLocationY {
|
|
140
|
+
Top = "top",
|
|
141
|
+
Bottom = "bottom",
|
|
142
|
+
Center = "center",
|
|
143
|
+
ReferrerCenter = "referrer-center"
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
declare enum TooltipLocationX {
|
|
147
|
+
Left = "left",
|
|
148
|
+
Right = "right",
|
|
149
|
+
Center = "center",
|
|
150
|
+
LeftCorner = "left-corner",
|
|
151
|
+
RightCorner = "right-corner"
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
declare enum TooltipPositionEngine {
|
|
155
|
+
Fixed = "fixed",
|
|
156
|
+
Absolute = "absolute"
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
interface TooltipConfig {
|
|
160
|
+
modelValue?: boolean;
|
|
161
|
+
alwaysOpen?: boolean;
|
|
162
|
+
class?: string;
|
|
163
|
+
text?: string;
|
|
164
|
+
icon?: string;
|
|
165
|
+
iconAtEnd?: boolean;
|
|
166
|
+
engine?: TooltipPositionEngine;
|
|
167
|
+
referrerMargin?: number | string;
|
|
168
|
+
windowMargin?: number | string;
|
|
169
|
+
referrerWidth?: boolean;
|
|
170
|
+
referrer: HTMLElement;
|
|
171
|
+
locationY?: TooltipLocationY;
|
|
172
|
+
locationX?: TooltipLocationX;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
declare class LktStrictItem extends LktItem {
|
|
176
|
+
lktStrictItem: boolean;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
declare const enum ButtonType {
|
|
180
|
+
Button = "button",
|
|
181
|
+
Submit = "submit",
|
|
182
|
+
Reset = "reset",
|
|
183
|
+
Content = "content",
|
|
184
|
+
Switch = "switch",
|
|
185
|
+
HiddenSwitch = "hidden-switch"
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
export { ButtonType, type FieldConfig, FieldType, LktItem, type LktObject, LktStrictItem, Option, type OptionConfig, type TooltipConfig, TooltipLocationX, TooltipLocationY, TooltipPositionEngine, type ValidFieldValue, type ValidOptionValue };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// src/instances/LktItem.ts
|
|
2
|
+
var skipDataProps = [
|
|
3
|
+
"lktDateProps",
|
|
4
|
+
"lktStrictItem"
|
|
5
|
+
];
|
|
6
|
+
var LktItem = class {
|
|
7
|
+
lktDateProps = [];
|
|
8
|
+
lktStrictItem = false;
|
|
9
|
+
feed(data = {}) {
|
|
10
|
+
for (const [key, value] of Object.entries(data)) this.assignProp(key, value);
|
|
11
|
+
}
|
|
12
|
+
assignProp(key, value) {
|
|
13
|
+
if (skipDataProps.includes(key)) return;
|
|
14
|
+
if (this.lktStrictItem && !this.hasOwnProperty(key)) return;
|
|
15
|
+
if (this.lktDateProps.includes(key)) {
|
|
16
|
+
this[key] = new Date(value);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
this[key] = value;
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
// src/instances/LktStrictItem.ts
|
|
24
|
+
var LktStrictItem = class extends LktItem {
|
|
25
|
+
lktStrictItem = true;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// src/instances/Option.ts
|
|
29
|
+
var Option = class extends LktItem {
|
|
30
|
+
value = void 0;
|
|
31
|
+
label = "";
|
|
32
|
+
data = {};
|
|
33
|
+
disabled = false;
|
|
34
|
+
group = "";
|
|
35
|
+
icon = "";
|
|
36
|
+
modal = "";
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/enums/ButtonType.ts
|
|
40
|
+
var ButtonType = /* @__PURE__ */ ((ButtonType2) => {
|
|
41
|
+
ButtonType2["Button"] = "button";
|
|
42
|
+
ButtonType2["Submit"] = "submit";
|
|
43
|
+
ButtonType2["Reset"] = "reset";
|
|
44
|
+
ButtonType2["Content"] = "content";
|
|
45
|
+
ButtonType2["Switch"] = "switch";
|
|
46
|
+
ButtonType2["HiddenSwitch"] = "hidden-switch";
|
|
47
|
+
return ButtonType2;
|
|
48
|
+
})(ButtonType || {});
|
|
49
|
+
|
|
50
|
+
// src/enums/FieldType.ts
|
|
51
|
+
var FieldType = /* @__PURE__ */ ((FieldType2) => {
|
|
52
|
+
FieldType2["Text"] = "text";
|
|
53
|
+
FieldType2["Email"] = "email";
|
|
54
|
+
FieldType2["Tel"] = "tel";
|
|
55
|
+
FieldType2["Password"] = "password";
|
|
56
|
+
FieldType2["Search"] = "search";
|
|
57
|
+
FieldType2["Number"] = "number";
|
|
58
|
+
FieldType2["Color"] = "color";
|
|
59
|
+
FieldType2["Range"] = "range";
|
|
60
|
+
FieldType2["Textarea"] = "textarea";
|
|
61
|
+
FieldType2["Html"] = "html";
|
|
62
|
+
FieldType2["Date"] = "date";
|
|
63
|
+
FieldType2["File"] = "file";
|
|
64
|
+
FieldType2["Image"] = "image";
|
|
65
|
+
FieldType2["Select"] = "select";
|
|
66
|
+
FieldType2["Check"] = "check";
|
|
67
|
+
FieldType2["Switch"] = "switch";
|
|
68
|
+
FieldType2["Calc"] = "calc";
|
|
69
|
+
FieldType2["Card"] = "card";
|
|
70
|
+
FieldType2["Elements"] = "elements";
|
|
71
|
+
return FieldType2;
|
|
72
|
+
})(FieldType || {});
|
|
73
|
+
|
|
74
|
+
// src/enums/TooltipLocationY.ts
|
|
75
|
+
var TooltipLocationY = /* @__PURE__ */ ((TooltipLocationY2) => {
|
|
76
|
+
TooltipLocationY2["Top"] = "top";
|
|
77
|
+
TooltipLocationY2["Bottom"] = "bottom";
|
|
78
|
+
TooltipLocationY2["Center"] = "center";
|
|
79
|
+
TooltipLocationY2["ReferrerCenter"] = "referrer-center";
|
|
80
|
+
return TooltipLocationY2;
|
|
81
|
+
})(TooltipLocationY || {});
|
|
82
|
+
|
|
83
|
+
// src/enums/TooltipLocationX.ts
|
|
84
|
+
var TooltipLocationX = /* @__PURE__ */ ((TooltipLocationX2) => {
|
|
85
|
+
TooltipLocationX2["Left"] = "left";
|
|
86
|
+
TooltipLocationX2["Right"] = "right";
|
|
87
|
+
TooltipLocationX2["Center"] = "center";
|
|
88
|
+
TooltipLocationX2["LeftCorner"] = "left-corner";
|
|
89
|
+
TooltipLocationX2["RightCorner"] = "right-corner";
|
|
90
|
+
return TooltipLocationX2;
|
|
91
|
+
})(TooltipLocationX || {});
|
|
92
|
+
|
|
93
|
+
// src/enums/TooltipPositionEngine.ts
|
|
94
|
+
var TooltipPositionEngine = /* @__PURE__ */ ((TooltipPositionEngine2) => {
|
|
95
|
+
TooltipPositionEngine2["Fixed"] = "fixed";
|
|
96
|
+
TooltipPositionEngine2["Absolute"] = "absolute";
|
|
97
|
+
return TooltipPositionEngine2;
|
|
98
|
+
})(TooltipPositionEngine || {});
|
|
99
|
+
export {
|
|
100
|
+
ButtonType,
|
|
101
|
+
FieldType,
|
|
102
|
+
LktItem,
|
|
103
|
+
LktStrictItem,
|
|
104
|
+
Option,
|
|
105
|
+
TooltipLocationX,
|
|
106
|
+
TooltipLocationY,
|
|
107
|
+
TooltipPositionEngine
|
|
108
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "lkt-vue-kernel",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "LKT Vue Kernel",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lkt",
|
|
7
|
+
"lkt-web-tech",
|
|
8
|
+
"ts",
|
|
9
|
+
"typescript",
|
|
10
|
+
"js",
|
|
11
|
+
"javascript"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"module": "./dist/index.js",
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"files": ["dist"],
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": "./dist/index.js"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"license": "MIT",
|
|
23
|
+
"sideEffects": false,
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "tsup src/index.ts --format esm --dts"
|
|
26
|
+
},
|
|
27
|
+
"author": "Antonio Ibáñez",
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"tsup": "^8.3.6",
|
|
30
|
+
"typescript": "^5.7.3"
|
|
31
|
+
},
|
|
32
|
+
"engines": {
|
|
33
|
+
"node": ">=18"
|
|
34
|
+
}
|
|
35
|
+
}
|