@targoninc/jess-components 0.0.17 → 0.0.19
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 +10 -4
- package/dist/src/Components.d.ts +2 -1
- package/dist/src/Types.d.ts +1 -0
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -208,9 +208,9 @@ class DomNode {
|
|
|
208
208
|
const value = arguments[i + 1];
|
|
209
209
|
if (value && isSignal(value)) {
|
|
210
210
|
this._node.setAttribute(key, value.value);
|
|
211
|
-
value.
|
|
211
|
+
value.subscribe((newValue) => {
|
|
212
212
|
this._node.setAttribute(key, newValue);
|
|
213
|
-
};
|
|
213
|
+
});
|
|
214
214
|
} else {
|
|
215
215
|
this._node.setAttribute(key, value);
|
|
216
216
|
}
|
|
@@ -565,9 +565,9 @@ class DomNode {
|
|
|
565
565
|
}
|
|
566
566
|
if (value && isSignal(value)) {
|
|
567
567
|
this._node.style[key] = value.value;
|
|
568
|
-
value.
|
|
568
|
+
value.subscribe((newValue) => {
|
|
569
569
|
this._node.style[key] = newValue;
|
|
570
|
-
};
|
|
570
|
+
});
|
|
571
571
|
} else {
|
|
572
572
|
this._node.style[key] = value;
|
|
573
573
|
}
|
|
@@ -859,6 +859,11 @@ function icon(config) {
|
|
|
859
859
|
return create("img").applyGenericConfig(config).classes(iconClass, pointerClass).attributes("src", icon2).onclick(config.onclick).build();
|
|
860
860
|
}, asSignal(config.isUrl ?? false));
|
|
861
861
|
}
|
|
862
|
+
function select(config) {
|
|
863
|
+
const options = config.options ?? signal([]);
|
|
864
|
+
const value = config.value ?? signal(null);
|
|
865
|
+
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").value(value), (option) => create("option").value(option.id).text(option.name).build())).build();
|
|
866
|
+
}
|
|
862
867
|
function searchableSelect(config) {
|
|
863
868
|
const options = config.options ?? signal([]);
|
|
864
869
|
const value = config.value ?? signal(null);
|
|
@@ -1011,6 +1016,7 @@ export {
|
|
|
1011
1016
|
toggle,
|
|
1012
1017
|
textarea,
|
|
1013
1018
|
text,
|
|
1019
|
+
select,
|
|
1014
1020
|
searchableSelect,
|
|
1015
1021
|
searchSelectOption,
|
|
1016
1022
|
input,
|
package/dist/src/Components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BooleanConfig, ButtonConfig, ContainerConfig, HeadingConfig, IconConfig, InputConfig, SearchableSelectConfig, SelectOptionConfig, TextareaConfig, TextConfig } from "./Types.ts";
|
|
1
|
+
import type { BooleanConfig, ButtonConfig, ContainerConfig, HeadingConfig, IconConfig, InputConfig, SearchableSelectConfig, SelectConfig, SelectOptionConfig, TextareaConfig, TextConfig } from "./Types.ts";
|
|
2
2
|
import { type AnyElement, Signal, type StringOrSignal } from "@targoninc/jess";
|
|
3
3
|
export declare function button(config: ButtonConfig): AnyElement;
|
|
4
4
|
export declare function input<T>(config: InputConfig<T>): AnyElement;
|
|
@@ -11,6 +11,7 @@ export declare function container(config: ContainerConfig): AnyElement;
|
|
|
11
11
|
export declare function text(config: TextConfig): AnyElement;
|
|
12
12
|
export declare function heading(config: HeadingConfig): AnyElement;
|
|
13
13
|
export declare function icon(config: IconConfig): Signal<AnyElement>;
|
|
14
|
+
export declare function select(config: SelectConfig): AnyElement;
|
|
14
15
|
export declare function searchableSelect(config: SearchableSelectConfig): AnyElement;
|
|
15
16
|
export declare function searchSelectOption(config: SelectOptionConfig): any;
|
|
16
17
|
export declare function checkbox(config: BooleanConfig): AnyElement;
|
package/dist/src/Types.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export interface SearchableSelectConfig<T = string> extends ChangeableConfig<T>
|
|
|
74
74
|
options: Signal<SelectOption[]>;
|
|
75
75
|
value: Signal<T>;
|
|
76
76
|
}
|
|
77
|
+
export type SelectConfig = SearchableSelectConfig;
|
|
77
78
|
export interface HeadingConfig extends BaseComponentConfig {
|
|
78
79
|
level?: IntRange<1, 6>;
|
|
79
80
|
text: StringOrSignal;
|
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.19",
|
|
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": "^0.0.
|
|
20
|
+
"@targoninc/jess": "^0.0.19"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@types/bun": "latest",
|