@wirekyt/svelte 0.0.4 → 0.0.5
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.
|
@@ -12,9 +12,15 @@
|
|
|
12
12
|
import { Wire } from "../factory";
|
|
13
13
|
import { useAngleSliderContext } from "./use-context";
|
|
14
14
|
|
|
15
|
-
let { ref = $bindable(null), ...props }: AngleSliderValueTextProps = $props();
|
|
15
|
+
let { ref = $bindable(null), children, ...props }: AngleSliderValueTextProps = $props();
|
|
16
16
|
const angleSlider = useAngleSliderContext();
|
|
17
17
|
const mergedProps = $derived(mergeProps(angleSlider().getValueTextProps(), props));
|
|
18
18
|
</script>
|
|
19
19
|
|
|
20
|
-
<Wire as="span" bind:ref {...mergedProps}
|
|
20
|
+
<Wire as="span" bind:ref {...mergedProps}>
|
|
21
|
+
{#if children}
|
|
22
|
+
{@render children()}
|
|
23
|
+
{:else}
|
|
24
|
+
{angleSlider().valueAsDegree}
|
|
25
|
+
{/if}
|
|
26
|
+
</Wire>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const datePickerAnatomy: import("@wirekyt/dom/anatomy").AnatomyInstance<"label" | "input" | "table" | "view" | "root" | "content" | "trigger" | "control" | "valueText" | "nextTrigger" | "prevTrigger" | "positioner" | "clearTrigger" | "
|
|
1
|
+
export declare const datePickerAnatomy: import("@wirekyt/dom/anatomy").AnatomyInstance<"label" | "input" | "table" | "view" | "root" | "content" | "trigger" | "control" | "valueText" | "nextTrigger" | "prevTrigger" | "positioner" | "clearTrigger" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
throw new Error("Field.Item must be used within Field.Root");
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
const controlId = `${parent.ids.root}
|
|
29
|
-
const labelId = `${controlId}
|
|
28
|
+
const controlId = `${parent.ids.root}:item:${value}`;
|
|
29
|
+
const labelId = `${controlId}:label`;
|
|
30
30
|
|
|
31
31
|
const getControlProps = () =>
|
|
32
32
|
({
|
|
@@ -24,11 +24,11 @@ export const useField = (inProps = {}) => {
|
|
|
24
24
|
const setRootRef = (el) => {
|
|
25
25
|
rootRef = el;
|
|
26
26
|
};
|
|
27
|
-
const rootId = $derived(ids?.root ?? `field
|
|
28
|
-
const controlId = $derived(ids?.control ?? `field
|
|
29
|
-
const errorTextId = $derived(ids?.errorText ?? `field
|
|
30
|
-
const helperTextId = $derived(ids?.helperText ?? `field
|
|
31
|
-
const labelId = $derived(ids?.label ?? `field
|
|
27
|
+
const rootId = $derived(ids?.root ?? `field:${id}`);
|
|
28
|
+
const controlId = $derived(ids?.control ?? `field:${id}:control`);
|
|
29
|
+
const errorTextId = $derived(ids?.errorText ?? `field:${id}:error-text`);
|
|
30
|
+
const helperTextId = $derived(ids?.helperText ?? `field:${id}:helper-text`);
|
|
31
|
+
const labelId = $derived(ids?.label ?? `field:${id}:label`);
|
|
32
32
|
const checkTextElements = () => {
|
|
33
33
|
if (!rootRef)
|
|
34
34
|
return;
|
|
@@ -54,7 +54,7 @@ export const useField = (inProps = {}) => {
|
|
|
54
54
|
"data-invalid": dataAttr(invalid),
|
|
55
55
|
"data-readonly": dataAttr(readOnly),
|
|
56
56
|
});
|
|
57
|
-
const targetControlId = $derived(props.target ? `field
|
|
57
|
+
const targetControlId = $derived(props.target ? `field:${id}:item:${props.target}` : undefined);
|
|
58
58
|
const getLabelProps = () => ({
|
|
59
59
|
...parts.label.attrs,
|
|
60
60
|
id: labelId,
|
|
@@ -20,9 +20,9 @@ export const useFieldset = (inProps = {}) => {
|
|
|
20
20
|
const setRootRef = (el) => {
|
|
21
21
|
rootRef = el;
|
|
22
22
|
};
|
|
23
|
-
const legendId = $derived(`fieldset
|
|
24
|
-
const errorTextId = $derived(`fieldset
|
|
25
|
-
const helperTextId = $derived(`fieldset
|
|
23
|
+
const legendId = $derived(`fieldset:${id}:legend`);
|
|
24
|
+
const errorTextId = $derived(`fieldset:${id}:error-text`);
|
|
25
|
+
const helperTextId = $derived(`fieldset:${id}:helper-text`);
|
|
26
26
|
const checkTextElements = () => {
|
|
27
27
|
if (!rootRef)
|
|
28
28
|
return;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wirekyt/svelte",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Svelte adapter for Wirekyt",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -327,7 +327,7 @@
|
|
|
327
327
|
"dependencies": {
|
|
328
328
|
"@internationalized/date": "^3.12.3",
|
|
329
329
|
"@internationalized/number": "^3.6.7",
|
|
330
|
-
"@wirekyt/dom": "0.0.
|
|
330
|
+
"@wirekyt/dom": "0.0.5"
|
|
331
331
|
},
|
|
332
332
|
"peerDependencies": {
|
|
333
333
|
"svelte": ">=5.0.0"
|