@targoninc/jess-components 0.0.21 → 0.0.23
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/index.js +59 -2
- package/package.json +3 -2
package/dist/index.js
CHANGED
|
@@ -1,4 +1,54 @@
|
|
|
1
1
|
// @bun
|
|
2
|
+
// node_modules/uuid/dist/esm/stringify.js
|
|
3
|
+
var byteToHex = [];
|
|
4
|
+
for (let i = 0;i < 256; ++i) {
|
|
5
|
+
byteToHex.push((i + 256).toString(16).slice(1));
|
|
6
|
+
}
|
|
7
|
+
function unsafeStringify(arr, offset = 0) {
|
|
8
|
+
return (byteToHex[arr[offset + 0]] + byteToHex[arr[offset + 1]] + byteToHex[arr[offset + 2]] + byteToHex[arr[offset + 3]] + "-" + byteToHex[arr[offset + 4]] + byteToHex[arr[offset + 5]] + "-" + byteToHex[arr[offset + 6]] + byteToHex[arr[offset + 7]] + "-" + byteToHex[arr[offset + 8]] + byteToHex[arr[offset + 9]] + "-" + byteToHex[arr[offset + 10]] + byteToHex[arr[offset + 11]] + byteToHex[arr[offset + 12]] + byteToHex[arr[offset + 13]] + byteToHex[arr[offset + 14]] + byteToHex[arr[offset + 15]]).toLowerCase();
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
// node_modules/uuid/dist/esm/rng.js
|
|
12
|
+
import { randomFillSync } from "crypto";
|
|
13
|
+
var rnds8Pool = new Uint8Array(256);
|
|
14
|
+
var poolPtr = rnds8Pool.length;
|
|
15
|
+
function rng() {
|
|
16
|
+
if (poolPtr > rnds8Pool.length - 16) {
|
|
17
|
+
randomFillSync(rnds8Pool);
|
|
18
|
+
poolPtr = 0;
|
|
19
|
+
}
|
|
20
|
+
return rnds8Pool.slice(poolPtr, poolPtr += 16);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
// node_modules/uuid/dist/esm/native.js
|
|
24
|
+
import { randomUUID } from "crypto";
|
|
25
|
+
var native_default = { randomUUID };
|
|
26
|
+
|
|
27
|
+
// node_modules/uuid/dist/esm/v4.js
|
|
28
|
+
function v4(options, buf, offset) {
|
|
29
|
+
if (native_default.randomUUID && !buf && !options) {
|
|
30
|
+
return native_default.randomUUID();
|
|
31
|
+
}
|
|
32
|
+
options = options || {};
|
|
33
|
+
const rnds = options.random ?? options.rng?.() ?? rng();
|
|
34
|
+
if (rnds.length < 16) {
|
|
35
|
+
throw new Error("Random bytes length must be >= 16");
|
|
36
|
+
}
|
|
37
|
+
rnds[6] = rnds[6] & 15 | 64;
|
|
38
|
+
rnds[8] = rnds[8] & 63 | 128;
|
|
39
|
+
if (buf) {
|
|
40
|
+
offset = offset || 0;
|
|
41
|
+
if (offset < 0 || offset + 16 > buf.length) {
|
|
42
|
+
throw new RangeError(`UUID byte range ${offset}:${offset + 15} is out of buffer bounds`);
|
|
43
|
+
}
|
|
44
|
+
for (let i = 0;i < 16; ++i) {
|
|
45
|
+
buf[offset + i] = rnds[i];
|
|
46
|
+
}
|
|
47
|
+
return buf;
|
|
48
|
+
}
|
|
49
|
+
return unsafeStringify(rnds);
|
|
50
|
+
}
|
|
51
|
+
var v4_default = v4;
|
|
2
52
|
// node_modules/@targoninc/jess/dist/index.js
|
|
3
53
|
class Signal {
|
|
4
54
|
_callbacks = [];
|
|
@@ -861,8 +911,15 @@ function icon(config) {
|
|
|
861
911
|
}
|
|
862
912
|
function select(config) {
|
|
863
913
|
const options = config.options ?? signal([]);
|
|
864
|
-
const value = config.value ?? signal(null);
|
|
865
|
-
|
|
914
|
+
const value$ = config.value ?? signal(null);
|
|
915
|
+
const selectId = v4_default();
|
|
916
|
+
function setSelected(value) {
|
|
917
|
+
const opts = document.querySelectorAll(`select#${selectId} option`);
|
|
918
|
+
opts.forEach((opt) => opt.selected = opt.value === value);
|
|
919
|
+
}
|
|
920
|
+
value$.subscribe(setSelected);
|
|
921
|
+
setSelected(value$.value);
|
|
922
|
+
return create("div").applyGenericConfig(config).classes("jessc-select", "flex-v", "relative").children(when(config.label, create("label").classes("jess").text(config.label).build()), signalMap(options, create("select").classes("jessc-select-inner").id(selectId).onchange((e) => config.onchange ? config.onchange(e.target.value) : undefined).value(value$), (option) => create("option").value(option.id).text(option.name).build())).build();
|
|
866
923
|
}
|
|
867
924
|
function searchableSelect(config) {
|
|
868
925
|
const options = config.options ?? signal([]);
|
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.23",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"files": [
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
"prepublishOnly": "bun run build"
|
|
18
18
|
},
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@targoninc/jess": "^0.0.19"
|
|
20
|
+
"@targoninc/jess": "^0.0.19",
|
|
21
|
+
"uuid": "^11.1.0"
|
|
21
22
|
},
|
|
22
23
|
"devDependencies": {
|
|
23
24
|
"@types/bun": "latest",
|