@fusion.dev/helix-headless 0.15.0 → 0.15.1

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.
@@ -167,17 +167,25 @@ let HelixHeadlessTimeInput = class HelixHeadlessTimeInput extends MixinControlle
167
167
  if (!control) {
168
168
  return;
169
169
  }
170
- const value = this.value;
170
+ const held = this.held;
171
+ const floor = toMinutes(this.min) ?? 0;
172
+ const ceiling = toMinutes(this.max) ?? 1439;
171
173
  let message = '';
172
- if (value !== '' && !isTime(value)) {
173
- message = 'Enter a time as HH:mm.';
174
+ if (held.length > 0 && !held.every(isTime)) {
175
+ message =
176
+ this.mode === undefined
177
+ ? 'Enter a time as HH:mm.'
178
+ : 'Enter times as HH:mm, separated by commas.';
174
179
  }
175
- else if (value !== '' && toMinutes(value) < (toMinutes(this.min) ?? 0)) {
180
+ else if (held.some((one) => (toMinutes(one) ?? 0) < floor)) {
176
181
  message = `Choose a time at or after ${writeTime(this.min, this.locale)}.`;
177
182
  }
178
- else if (value !== '' && toMinutes(value) > (toMinutes(this.max) ?? 1439)) {
183
+ else if (held.some((one) => (toMinutes(one) ?? 0) > ceiling)) {
179
184
  message = `Choose a time at or before ${writeTime(this.max, this.locale)}.`;
180
185
  }
186
+ else if (this.mode === 'range' && held.length > 2) {
187
+ message = 'A range is two times.';
188
+ }
181
189
  if (message === '') {
182
190
  this.internals.setValidity(control.validity, control.validationMessage, control);
183
191
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fusion.dev/helix-headless",
3
3
  "description": "Headless component tier. Structure, accessibility, state, and form participation. No styling.",
4
- "version": "0.15.0",
4
+ "version": "0.15.1",
5
5
  "license": "MIT",
6
6
  "author": "Ross Sheppard <ross.sheppard@fusion.dev>",
7
7
  "repository": {
@@ -45,14 +45,14 @@
45
45
  },
46
46
  "bugs": "https://github.com/project-fusion/fusion/issues",
47
47
  "dependencies": {
48
- "@fusion.dev/helix-core": "0.15.0",
49
- "@fusion.dev/helix-icons": "0.15.0",
48
+ "@fusion.dev/helix-core": "0.15.1",
49
+ "@fusion.dev/helix-icons": "0.15.1",
50
50
  "uqr": "^0.1.3"
51
51
  },
52
52
  "devDependencies": {
53
53
  "@custom-elements-manifest/analyzer": "^0.11.0",
54
- "@fusion.dev/helix-cem": "0.15.0",
55
- "@fusion.dev/helix-testing": "0.15.0",
54
+ "@fusion.dev/helix-cem": "0.15.1",
55
+ "@fusion.dev/helix-testing": "0.15.1",
56
56
  "@fusion.dev/scripts": "0.0.0-dev",
57
57
  "@happy-dom/global-registrator": "^20.0.0",
58
58
  "@lit-labs/ssr": "^3.3.0",