bits-ui 0.21.9 → 0.21.10

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.
@@ -4,12 +4,18 @@ import { createDispatcher } from "../../../internal/events.js";
4
4
  export let asChild = false;
5
5
  export let placeholder = void 0;
6
6
  export let el = void 0;
7
+ export let id = void 0;
7
8
  const {
8
9
  elements: { input },
10
+ ids,
9
11
  getAttrs
10
12
  } = getCtx();
11
13
  const dispatch = createDispatcher();
12
14
  const attrs = getAttrs("input");
15
+ $:
16
+ if (id) {
17
+ ids.trigger.set(id);
18
+ }
13
19
  $:
14
20
  builder = $input;
15
21
  $:
@@ -138,7 +138,7 @@ $:
138
138
  ids.dateField.description.set(descriptionId);
139
139
  }
140
140
  $:
141
- value !== void 0 && localValue.set(value);
141
+ value !== $localValue && localValue.set(value);
142
142
  $:
143
143
  placeholder !== void 0 && localPlaceholder.set(placeholder);
144
144
  $:
@@ -31,7 +31,7 @@ const {
31
31
  placeholder: localPlaceholder,
32
32
  isInvalid: localIsInvalid,
33
33
  startValue: localStartValue,
34
- endValue
34
+ endValue: localEndValue
35
35
  },
36
36
  updateOption,
37
37
  ids
@@ -180,7 +180,14 @@ $:
180
180
  $:
181
181
  startValue = $localStartValue;
182
182
  $:
183
- value !== void 0 && localValue.set(value);
183
+ if (value !== $localValue) {
184
+ const nextValue = { start: value?.start, end: value?.end };
185
+ if (nextValue.start !== $localStartValue)
186
+ localStartValue.set(nextValue.start);
187
+ if (nextValue.end !== $localEndValue)
188
+ localEndValue.set(nextValue.end);
189
+ localValue.set(nextValue);
190
+ }
184
191
  $:
185
192
  placeholder !== void 0 && localPlaceholder.set(placeholder);
186
193
  $:
@@ -225,5 +232,5 @@ $:
225
232
  ids={$idValues}
226
233
  isInvalid={$localIsInvalid}
227
234
  startValue={$localStartValue}
228
- endValue={$endValue}
235
+ endValue={$localEndValue}
229
236
  />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bits-ui",
3
- "version": "0.21.9",
3
+ "version": "0.21.10",
4
4
  "license": "MIT",
5
5
  "repository": "github:huntabyte/bits-ui",
6
6
  "funding": "https://github.com/sponsors/huntabyte",