@targoninc/jess-components 0.0.10 → 0.0.12
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 +9 -8
- package/dist/src/Components.d.ts +1 -1
- package/dist/src/Types.d.ts +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -697,7 +697,7 @@ function getDisabledClass(config) {
|
|
|
697
697
|
}
|
|
698
698
|
function button(config) {
|
|
699
699
|
config.classes ??= [];
|
|
700
|
-
return create("button").applyGenericConfig(config).onclick(config.onclick).classes(getDisabledClass(config)).attributes("tabindex", config.tabindex ?? "0").children(when(config.icon, () => icon(config.icon)), when(config.text, () => text({
|
|
700
|
+
return create("button").applyGenericConfig(config).onclick(config.onclick).classes(getDisabledClass(config)).attributes("tabindex", config.tabindex ?? "0").children(when(config.icon, () => create("div").children(icon(config.icon)).build()), when(config.text, () => text({
|
|
701
701
|
text: config.text
|
|
702
702
|
}))).build();
|
|
703
703
|
}
|
|
@@ -837,13 +837,14 @@ function heading(config) {
|
|
|
837
837
|
}
|
|
838
838
|
function icon(config) {
|
|
839
839
|
const icon2 = config.icon;
|
|
840
|
-
const isMaterial = !config.isUrl;
|
|
841
840
|
const iconClass = config.adaptive ? "adaptive-icon" : "static-icon";
|
|
842
841
|
const pointerClass = config.title ? "_" : "no-pointer";
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
842
|
+
return compute((isImage) => {
|
|
843
|
+
if (!isImage) {
|
|
844
|
+
return create("i").applyGenericConfig(config).classes(iconClass, "material-symbols-outlined", pointerClass).text(icon2).onclick(config.onclick).build();
|
|
845
|
+
}
|
|
846
|
+
return create("img").applyGenericConfig(config).classes(iconClass, pointerClass).attributes("src", icon2).onclick(config.onclick).build();
|
|
847
|
+
}, asSignal(config.isUrl ?? false));
|
|
847
848
|
}
|
|
848
849
|
function searchableSelect(config) {
|
|
849
850
|
const options = config.options ?? signal([]);
|
|
@@ -921,11 +922,11 @@ function searchSelectOption(config) {
|
|
|
921
922
|
config.value.value = config.option.id;
|
|
922
923
|
config.search.value = config.option.name;
|
|
923
924
|
config.optionsVisible.value = false;
|
|
924
|
-
}).children(when(config.option.image, icon({
|
|
925
|
+
}).children(when(config.option.image, create("div").children(icon({
|
|
925
926
|
icon: config.option.image ?? "",
|
|
926
927
|
isUrl: config.option.imageIsUrl,
|
|
927
928
|
adaptive: true
|
|
928
|
-
})), create("span").text(config.option.name).build()).build();
|
|
929
|
+
})).build()), create("span").text(config.option.name).build()).build();
|
|
929
930
|
return element;
|
|
930
931
|
}
|
|
931
932
|
function checkbox(config) {
|
package/dist/src/Components.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare function area(config: ContainerConfig): AnyElement;
|
|
|
10
10
|
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
|
-
export declare function icon(config: IconConfig): AnyElement
|
|
13
|
+
export declare function icon(config: IconConfig): Signal<AnyElement>;
|
|
14
14
|
export declare function searchableSelect(config: SearchableSelectConfig): AnyElement;
|
|
15
15
|
export declare function searchSelectOption(config: SelectOptionConfig): any;
|
|
16
16
|
export declare function checkbox(config: BooleanConfig): AnyElement;
|
package/dist/src/Types.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export interface TextConfig extends BaseComponentConfig {
|
|
|
54
54
|
export interface IconConfig extends BaseComponentConfig {
|
|
55
55
|
icon: StringOrSignal;
|
|
56
56
|
adaptive?: boolean;
|
|
57
|
-
isUrl?: boolean
|
|
57
|
+
isUrl?: TypeOrSignal<boolean>;
|
|
58
58
|
onclick?: Function;
|
|
59
59
|
}
|
|
60
60
|
export interface SelectOption extends BaseComponentConfig {
|