odj-svelte-ui 0.5.2 → 0.5.4
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.
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
import { browser } from "$app/environment";
|
|
3
3
|
import { type SelectProps as Props, select as selectCls } from ".";
|
|
4
4
|
|
|
5
|
-
let { children, items, value = $bindable(), underline, size = "md", class: className, placeholder = "Choose option...", placeholderValue = undefined, ...restProps }: Props<T> = $props();
|
|
5
|
+
let { children, items, value = $bindable(), underline, size = "md", class: className, placeholder = "Choose option...", placeholderValue = undefined, enableCustomSelect = false, ...restProps }: Props<T> = $props();
|
|
6
6
|
|
|
7
|
-
const customSelect = $derived(browser ? CSS.supports("appearance: base-select") :
|
|
7
|
+
const customSelect = $derived(browser ? enableCustomSelect && CSS.supports("appearance: base-select") : enableCustomSelect);
|
|
8
8
|
const selectStyle = $derived(selectCls({ underline, size, customSelect, className }));
|
|
9
9
|
</script>
|
|
10
10
|
|
|
11
11
|
<select class={selectStyle} class:custom-select={customSelect} bind:value {...restProps}>
|
|
12
12
|
{#if customSelect}
|
|
13
13
|
<!-- svelte-ignore node_invalid_placement_ssr -->
|
|
14
|
-
<button class="flex w-full items-center gap-2 justify-between min-w-0" aria-label="Select Picker">
|
|
14
|
+
<button class="flex w-full items-center gap-2.5 justify-between min-w-0" aria-label="Select Picker">
|
|
15
15
|
<selectedcontent class="truncate"></selectedcontent>
|
|
16
16
|
<span class="picker transition-rotate duration-400 shrink-0">
|
|
17
17
|
<svg class="text-light-surface-800 size-3 dark:text-white" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
|
|
@@ -8,11 +8,13 @@ type SelectOptionType<T> = {
|
|
|
8
8
|
};
|
|
9
9
|
interface SelectProps<T> extends Omit<HTMLSelectAttributes, "size"> {
|
|
10
10
|
children?: Snippet;
|
|
11
|
+
class: string;
|
|
11
12
|
items?: SelectOptionType<T>[];
|
|
12
13
|
underline?: boolean;
|
|
13
14
|
size?: SelectSize;
|
|
14
15
|
placeholder?: string;
|
|
15
16
|
placeholderValue?: any;
|
|
17
|
+
enableCustomSelect?: boolean;
|
|
16
18
|
}
|
|
17
19
|
interface MultiSelectProps<T> extends MultiSelectParameters {
|
|
18
20
|
outerDivClass?: string;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "odj-svelte-ui",
|
|
3
3
|
"author": "orbitadajogatina",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.4",
|
|
5
5
|
"description": "This is a fork from Flowbite Svelte 5 with Runes. I just made some changes that fits better my taste.",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "dist/index.js",
|