@targoninc/jess-components 0.0.18 → 0.0.20
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 +6 -0
- package/dist/src/Components.d.ts +2 -1
- package/dist/src/Types.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -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").onchange(config.onchange).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;
|