@targoninc/jess-components 0.0.36 → 0.0.39
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/dist/index.d.ts +33 -0
- package/dist/index.js +37 -11
- package/package.json +2 -2
- /package/dist/{index.d.ts → src/index.d.ts} +0 -0
- /package/dist/src/{Components.d.ts → src/Components.d.ts} +0 -0
- /package/dist/src/{Debounce.d.ts → src/Debounce.d.ts} +0 -0
- /package/dist/src/{Types.d.ts → src/Types.d.ts} +0 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export function toggle(config: any): any;
|
|
2
|
+
export function textarea(config: any): any;
|
|
3
|
+
export function text(config: any): any;
|
|
4
|
+
export function select(config: any): any;
|
|
5
|
+
export function searchableSelect(config: any): any;
|
|
6
|
+
export function searchSelectOption(config: any): any;
|
|
7
|
+
export function input(config: any): any;
|
|
8
|
+
export function icon(config: any): Signal;
|
|
9
|
+
export function heading(config: any): any;
|
|
10
|
+
export function eyeButton(toggleState: any, onClick: any): any;
|
|
11
|
+
export function errorList(errors: any): any;
|
|
12
|
+
export function error(error2: any): any;
|
|
13
|
+
export function container(config: any): any;
|
|
14
|
+
export function checkbox(config: any): any;
|
|
15
|
+
export function button(config: any): any;
|
|
16
|
+
export function area(config: any): any;
|
|
17
|
+
declare class Signal {
|
|
18
|
+
constructor(initialValue: any);
|
|
19
|
+
_callbacks: any[];
|
|
20
|
+
_keyCallbacks: Map<any, any>;
|
|
21
|
+
_value: any;
|
|
22
|
+
_values: {};
|
|
23
|
+
type: string;
|
|
24
|
+
boolValues(assignments?: {}): {};
|
|
25
|
+
unsubscribeAll(): void;
|
|
26
|
+
subscribe(callback: any, key: any): void;
|
|
27
|
+
unsubscribe(callback: any): void;
|
|
28
|
+
unsubscribeKey(key: any): void;
|
|
29
|
+
set value(value: any);
|
|
30
|
+
get value(): any;
|
|
31
|
+
toString(): any;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ function v4(options, buf, offset) {
|
|
|
49
49
|
return unsafeStringify(rnds);
|
|
50
50
|
}
|
|
51
51
|
var v4_default = v4;
|
|
52
|
-
// node_modules/@targoninc/jess/
|
|
52
|
+
// node_modules/@targoninc/jess/src/jess/signals.js
|
|
53
53
|
class Signal {
|
|
54
54
|
_callbacks = [];
|
|
55
55
|
_keyCallbacks = new Map;
|
|
@@ -110,6 +110,9 @@ class Signal {
|
|
|
110
110
|
callback(value, changed);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
|
+
toString() {
|
|
114
|
+
return this._value.toString();
|
|
115
|
+
}
|
|
113
116
|
}
|
|
114
117
|
function signal(initialValue) {
|
|
115
118
|
return new Signal(initialValue);
|
|
@@ -136,6 +139,8 @@ function asSignal(obj) {
|
|
|
136
139
|
}
|
|
137
140
|
return obj;
|
|
138
141
|
}
|
|
142
|
+
|
|
143
|
+
// node_modules/@targoninc/jess/src/jess/templating.js
|
|
139
144
|
function create(tag) {
|
|
140
145
|
return new DomNode(tag);
|
|
141
146
|
}
|
|
@@ -171,7 +176,9 @@ function signalMap(arrayState, wrapper, callback, renderSequentially = false) {
|
|
|
171
176
|
if (!newValue) {
|
|
172
177
|
return;
|
|
173
178
|
}
|
|
174
|
-
const tmp = [
|
|
179
|
+
const tmp = [
|
|
180
|
+
...newValue
|
|
181
|
+
].filter((t) => t !== undefined && t !== null);
|
|
175
182
|
const children = [];
|
|
176
183
|
if (renderSequentially) {
|
|
177
184
|
wrapper.overwriteChildren();
|
|
@@ -190,15 +197,33 @@ function signalMap(arrayState, wrapper, callback, renderSequentially = false) {
|
|
|
190
197
|
return wrapper.build();
|
|
191
198
|
}
|
|
192
199
|
function stack(message, debugInfo = {}) {
|
|
193
|
-
console.warn(message, {
|
|
200
|
+
console.warn(message, {
|
|
201
|
+
debugInfo
|
|
202
|
+
}, new Error().stack);
|
|
194
203
|
}
|
|
195
204
|
function isValidElement(element) {
|
|
196
|
-
const validTypes = [
|
|
205
|
+
const validTypes = [
|
|
206
|
+
HTMLElement,
|
|
207
|
+
SVGElement
|
|
208
|
+
];
|
|
197
209
|
return validTypes.some((type) => element instanceof type);
|
|
198
210
|
}
|
|
199
211
|
class DomNode {
|
|
200
212
|
_node;
|
|
201
|
-
svgTags = [
|
|
213
|
+
svgTags = [
|
|
214
|
+
"svg",
|
|
215
|
+
"g",
|
|
216
|
+
"circle",
|
|
217
|
+
"ellipse",
|
|
218
|
+
"line",
|
|
219
|
+
"path",
|
|
220
|
+
"polygon",
|
|
221
|
+
"polyline",
|
|
222
|
+
"rect",
|
|
223
|
+
"text",
|
|
224
|
+
"textPath",
|
|
225
|
+
"tspan"
|
|
226
|
+
];
|
|
202
227
|
constructor(tag) {
|
|
203
228
|
if (this.svgTags.includes(tag)) {
|
|
204
229
|
this._node = document.createElementNS("http://www.w3.org/2000/svg", tag);
|
|
@@ -720,8 +745,8 @@ class DomNode {
|
|
|
720
745
|
return this;
|
|
721
746
|
}
|
|
722
747
|
}
|
|
723
|
-
|
|
724
|
-
(
|
|
748
|
+
// node_modules/@targoninc/jess/src/jess/InputType.js
|
|
749
|
+
var InputType = /* @__PURE__ */ function(InputType2) {
|
|
725
750
|
InputType2["button"] = "button";
|
|
726
751
|
InputType2["checkbox"] = "checkbox";
|
|
727
752
|
InputType2["color"] = "color";
|
|
@@ -744,8 +769,8 @@ var InputType;
|
|
|
744
769
|
InputType2["time"] = "time";
|
|
745
770
|
InputType2["url"] = "url";
|
|
746
771
|
InputType2["week"] = "week";
|
|
747
|
-
|
|
748
|
-
|
|
772
|
+
return InputType2;
|
|
773
|
+
}({});
|
|
749
774
|
// src/src/Debounce.ts
|
|
750
775
|
var debounceMap = {};
|
|
751
776
|
function debounce(identifier, func, delay = 0) {
|
|
@@ -774,8 +799,9 @@ function getDisabledClass(config) {
|
|
|
774
799
|
}
|
|
775
800
|
function button(config) {
|
|
776
801
|
config.classes ??= [];
|
|
777
|
-
return create("button").applyGenericConfig(config).onclick(config.onclick).classes(getDisabledClass(config)).attributes("tabindex", config.tabindex ?? "0").children(when(config.icon, () => create("div").classes("jess", "flex", "align-children").children(icon(config.icon)).build()), when(config.text, () => text({
|
|
778
|
-
text: config.text
|
|
802
|
+
return create("button").applyGenericConfig(config).onclick(config.onclick).classes(getDisabledClass(config)).attributes("tabindex", config.tabindex ?? "0").children(when(config.icon, () => create("div").classes("jess", "flex", "align-children").styles("pointer-events", "none").children(icon(config.icon)).build()), when(config.text, () => text({
|
|
803
|
+
text: config.text,
|
|
804
|
+
styles: ["pointer-events", "none"]
|
|
779
805
|
}))).build();
|
|
780
806
|
}
|
|
781
807
|
function input(config) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@targoninc/jess-components",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.39",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"prepublishOnly": "bun run build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@targoninc/jess": "
|
|
20
|
+
"@targoninc/jess": "npm:@jsr/targoninc__jess",
|
|
21
21
|
"uuid": "^11.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|