@cahyo-dimas/freeday 3.23.0 → 3.25.0

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.
Files changed (44) hide show
  1. package/CHANGELOG.md +98 -0
  2. package/COMPONENTS.md +39 -0
  3. package/README.id.md +1 -1
  4. package/README.md +1 -1
  5. package/adapters/blazor/FdyAutocomplete.razor +1 -1
  6. package/adapters/blazor/FdyAutocomplete.razor.cs +34 -1
  7. package/adapters/blazor/FdyCascade.razor.cs +15 -1
  8. package/adapters/blazor/FdyCfl.razor.cs +44 -8
  9. package/adapters/blazor/FdyDateRange.razor +1 -1
  10. package/adapters/blazor/FdyDateRange.razor.cs +25 -1
  11. package/adapters/blazor/FdyDatepicker.razor.cs +15 -1
  12. package/adapters/blazor/FdyMonthpicker.razor.cs +15 -1
  13. package/adapters/blazor/FdyTable.razor.cs +23 -1
  14. package/adapters/blazor/FdyTimepicker.razor.cs +15 -1
  15. package/adapters/blazor/freeday-blazor.js +16 -2
  16. package/adapters/core/load-state.d.ts +17 -0
  17. package/adapters/core/load-state.js +37 -0
  18. package/adapters/react/components/FdyCfl.tsx +20 -5
  19. package/adapters/react/components/FdyDatepicker.tsx +10 -1
  20. package/adapters/react/components/FdyDrawer.tsx +8 -0
  21. package/adapters/react/components/FdyModal.tsx +11 -0
  22. package/adapters/react/components/FdyTable.tsx +28 -5
  23. package/adapters/react/index.d.ts +18 -0
  24. package/adapters/react/index.js +1 -0
  25. package/adapters/react/useLoad.js +53 -0
  26. package/adapters/vue/components/FdyCfl.vue +20 -6
  27. package/adapters/vue/components/FdyDatepicker.vue +10 -1
  28. package/adapters/vue/components/FdyDrawer.vue +10 -0
  29. package/adapters/vue/components/FdyModal.vue +12 -0
  30. package/adapters/vue/index.d.ts +18 -0
  31. package/adapters/vue/index.js +1 -0
  32. package/adapters/vue/useLoad.js +47 -0
  33. package/dist/freeday-autocomplete.js +43 -11
  34. package/dist/freeday-cascade.js +24 -8
  35. package/dist/freeday-datepicker.js +61 -1
  36. package/dist/freeday-form.js +3 -0
  37. package/dist/freeday-stepper.js +14 -5
  38. package/dist/freeday-table.js +5 -1
  39. package/dist/freeday-timepicker.js +12 -1
  40. package/dist/freeday-upload.js +17 -7
  41. package/dist/freeday.js +179 -34
  42. package/docs/getting-started.md +1 -1
  43. package/docs/screen-states.md +3 -0
  44. package/package.json +2 -2
package/dist/freeday.js CHANGED
@@ -230,7 +230,9 @@
230
230
  /* Freeday, autocomplete enhancer (optional, zero-dependency).
231
231
  * Editable combobox (WAI-ARIA APG): a text input filters a role="listbox" of role="option"
232
232
  * items as you type; select fills the input. Auto-inits [data-fdy-autocomplete]. Options are
233
- * static markup filtered client-side, in an app, fetch/filter server-side and re-render options.
233
+ * markup filtered client-side and read from the list each time they are used, so an app that
234
+ * re-renders them (after a server-side search) is heard without re-initialising. A host that
235
+ * renders once uses FreedayAutocomplete.setOptions(root, labels).
234
236
  *
235
237
  * Markup: <div data-fdy-autocomplete class="fdy-autocomplete">
236
238
  * <input class="fdy-input" role="combobox" aria-expanded="false" aria-autocomplete="list"
@@ -254,19 +256,24 @@
254
256
  root._fdyInvalid = !!input && input.getAttribute('aria-invalid') === 'true';
255
257
  var listbox = root.querySelector('[role="listbox"]');
256
258
  if (!input || !listbox) return;
257
- var options = Array.prototype.slice.call(listbox.querySelectorAll('[role="option"]'));
258
259
  var emptyEl = listbox.querySelector('.fdy-autocomplete__empty');
259
260
  var active = -1;
260
261
 
261
- options.forEach(function (o) {
262
- if (!o.id) { seq += 1; o.id = 'fdy-ac-opt-' + seq; }
263
- o.dataset.label = o.textContent.trim();
264
- });
262
+ /* Read from the list every time, not captured once at init: options rendered later were never
263
+ seen, and the ready flag refused the re-init that would have found them (#123). */
264
+ function allOptions() {
265
+ return Array.prototype.slice.call(listbox.querySelectorAll('[role="option"]')).map(function (o) {
266
+ if (!o.id) { seq += 1; o.id = 'fdy-ac-opt-' + seq; }
267
+ o.dataset.label = o.textContent.trim();
268
+ return o;
269
+ });
270
+ }
271
+ allOptions();
265
272
  listbox.hidden = true;
266
273
  input.setAttribute('aria-expanded', 'false');
267
274
 
268
- function visible() { return options.filter(function (o) { return !o.hidden; }); }
269
- function clearHighlight() { options.forEach(function (o) { o.classList.remove('is-highlighted'); }); }
275
+ function visible() { return allOptions().filter(function (o) { return !o.hidden; }); }
276
+ function clearHighlight() { allOptions().forEach(function (o) { o.classList.remove('is-highlighted'); }); }
270
277
 
271
278
  var _pop = null;
272
279
  function popCtl() { if (_pop === null && window.FreedayPopover) _pop = window.FreedayPopover.attach(listbox, input); return _pop; }
@@ -305,6 +312,7 @@
305
312
  a saved record) is not a query, and filtering by it opened a one-item list that looked broken
306
313
  (#115). Reset on close, so the arrow keys reopen it whole as well. */
307
314
  function showAll() {
315
+ var options = allOptions();
308
316
  options.forEach(function (o) { o.hidden = false; });
309
317
  if (emptyEl) emptyEl.hidden = options.length !== 0;
310
318
  }
@@ -312,7 +320,7 @@
312
320
  function applyFilter() {
313
321
  var q = input.value.trim().toLowerCase();
314
322
  var shown = 0;
315
- options.forEach(function (o) {
323
+ allOptions().forEach(function (o) {
316
324
  var match = !q || o.dataset.label.toLowerCase().indexOf(q) !== -1;
317
325
  o.hidden = !match;
318
326
  if (match) shown++;
@@ -326,7 +334,7 @@
326
334
 
327
335
  function choose(opt) {
328
336
  input.value = opt.dataset.label;
329
- options.forEach(function (o) { o.setAttribute('aria-selected', o === opt ? 'true' : 'false'); });
337
+ allOptions().forEach(function (o) { o.setAttribute('aria-selected', o === opt ? 'true' : 'false'); });
330
338
  close();
331
339
  root.dispatchEvent(new CustomEvent('fdy-autocomplete-select', { bubbles: true, detail: { value: opt.dataset.label, option: opt } }));
332
340
  }
@@ -366,6 +374,27 @@
366
374
  var opt = e.target.closest('[role="option"]');
367
375
  if (opt && !opt.hidden) choose(opt);
368
376
  });
377
+
378
+ /* For a host that renders its markup once (Blazor): the list and the text are pushed in, silently.
379
+ New options are filtered by what is typed if the list is open, and shown whole otherwise. */
380
+ root._fdyAc = {
381
+ setOptions: function (labels) {
382
+ allOptions().forEach(function (o) { o.remove(); });
383
+ (labels || []).forEach(function (label) {
384
+ var li = document.createElement('li');
385
+ li.className = 'fdy-autocomplete__option';
386
+ li.setAttribute('role', 'option');
387
+ li.textContent = label;
388
+ listbox.insertBefore(li, emptyEl);
389
+ });
390
+ allOptions();
391
+ if (listbox.hidden) showAll(); else applyFilter();
392
+ },
393
+ setValue: function (text) {
394
+ input.value = text || '';
395
+ allOptions().forEach(function (o) { o.setAttribute('aria-selected', o.dataset.label === input.value ? 'true' : 'false'); });
396
+ }
397
+ };
369
398
  }
370
399
 
371
400
  function initAll(context) {
@@ -398,7 +427,10 @@
398
427
  if (state.required != null) input.required = !!state.required;
399
428
  }
400
429
 
401
- window.FreedayAutocomplete = { init: initAutocomplete, initAll: initAll, setState: setState };
430
+ function setValue(root, text) { if (root && root._fdyAc) root._fdyAc.setValue(text); }
431
+ function setOptions(root, labels) { if (root && root._fdyAc) root._fdyAc.setOptions(labels); }
432
+
433
+ window.FreedayAutocomplete = { init: initAutocomplete, initAll: initAll, setState: setState, setValue: setValue, setOptions: setOptions };
402
434
  })();
403
435
 
404
436
  /* Freeday, breakpoint provider (optional, zero-dependency).
@@ -1083,14 +1115,18 @@
1083
1115
  if (li) activate(opts.indexOf(li));
1084
1116
  });
1085
1117
 
1086
- // Initial display: pre-selected leaf shows its full path, else placeholder.
1087
- var initTrail = selectedValue ? pathTo(root, selectedValue, []) : null;
1088
- if (initTrail) {
1089
- valueSpan.textContent = initTrail.map(function (n) { return n.label; }).join(sep);
1090
- } else {
1091
- valueSpan.textContent = placeholder;
1092
- valueSpan.classList.add('fdy-cascade__value--placeholder');
1118
+ // The selected leaf shows its full path, else the placeholder. At init and on setValue alike.
1119
+ function showValue() {
1120
+ var trail = selectedValue ? pathTo(root, selectedValue, []) : null;
1121
+ if (trail) {
1122
+ valueSpan.textContent = trail.map(function (n) { return n.label; }).join(sep);
1123
+ valueSpan.classList.remove('fdy-cascade__value--placeholder');
1124
+ } else {
1125
+ valueSpan.textContent = placeholder;
1126
+ valueSpan.classList.add('fdy-cascade__value--placeholder');
1127
+ }
1093
1128
  }
1129
+ showValue();
1094
1130
 
1095
1131
  applyState();
1096
1132
  applyInvalid();
@@ -1099,7 +1135,15 @@
1099
1135
  wrap: wrap,
1100
1136
  setState: setState,
1101
1137
  getValue: function () { return selectedValue; },
1102
- clear: function () { selectedValue = ''; valueSpan.textContent = placeholder; valueSpan.classList.add('fdy-cascade__value--placeholder'); }
1138
+ clear: function () { selectedValue = ''; valueSpan.textContent = placeholder; valueSpan.classList.add('fdy-cascade__value--placeholder'); },
1139
+ /* The host's own value, pushed in silently: no fdy-cascade-change, so a binding that set it
1140
+ does not hear it back. A render-once host (Blazor) has no other way to change it. */
1141
+ setValue: function (next) {
1142
+ selectedValue = next || '';
1143
+ wrap.setAttribute('data-value', selectedValue);
1144
+ showValue();
1145
+ if (!panel.hidden) render();
1146
+ }
1103
1147
  };
1104
1148
  wrap._fdyCascade = api;
1105
1149
  return api;
@@ -1125,6 +1169,10 @@
1125
1169
  setState: function (root, state) {
1126
1170
  var api = root && root._fdyCascade ? root._fdyCascade : null;
1127
1171
  if (api && api.setState) api.setState(state);
1172
+ },
1173
+ setValue: function (root, value) {
1174
+ var api = root && root._fdyCascade ? root._fdyCascade : null;
1175
+ if (api) api.setValue(value);
1128
1176
  }
1129
1177
  };
1130
1178
  })();
@@ -2430,13 +2478,24 @@
2430
2478
  return b;
2431
2479
  }
2432
2480
 
2481
+ /* Every arrow rebuilds the panel, and with it the arrow that was pressed, so focus fell to <body>
2482
+ and the next key press (another arrow, Escape) went nowhere. The arrow in the same place takes
2483
+ focus back, unless the handler already moved it somewhere in the panel on purpose. */
2433
2484
  function navButton(glyph, aria, onClick) {
2434
2485
  var b = document.createElement('button');
2435
2486
  b.type = 'button';
2436
2487
  b.className = 'fdy-cal__nav';
2437
2488
  b.textContent = glyph;
2438
2489
  b.setAttribute('aria-label', aria);
2439
- b.addEventListener('click', onClick);
2490
+ var side = glyph === '‹' ? 'prev' : 'next';
2491
+ b.setAttribute('data-fdy-nav', side);
2492
+ b.addEventListener('click', function () {
2493
+ onClick();
2494
+ if (!panel.contains(document.activeElement)) {
2495
+ var again = panel.querySelector('.fdy-cal__nav[data-fdy-nav="' + side + '"]');
2496
+ if (again) again.focus();
2497
+ }
2498
+ });
2440
2499
  return b;
2441
2500
  }
2442
2501
 
@@ -2930,6 +2989,19 @@
2930
2989
  }
2931
2990
 
2932
2991
  trigger.addEventListener('click', function () { panel.hidden ? open() : close(true); });
2992
+ /* Escape from anywhere in the panel. The grids handle it first and say so with preventDefault;
2993
+ this answers for the arrows and the title, where it used to do nothing. */
2994
+ panel.addEventListener('keydown', function (e) {
2995
+ if (e.key !== 'Escape' || e.defaultPrevented) return;
2996
+ e.preventDefault();
2997
+ close(true);
2998
+ });
2999
+ /* Focus leaving the field closes it, as the Vue and React pickers always have. A null target is
3000
+ a rebuilt panel taking the focused element with it, which is not focus leaving. */
3001
+ wrap.addEventListener('focusout', function (e) {
3002
+ var next = e.relatedTarget;
3003
+ if (next && !wrap.contains(next)) close(false);
3004
+ });
2933
3005
 
2934
3006
  updateDisplay();
2935
3007
 
@@ -2944,6 +3016,22 @@
2944
3016
  return selected ? (monthOnly ? toISOMonth(selected) : toISO(selected)) : '';
2945
3017
  },
2946
3018
  clear: function () { selected = null; selectedEnd = null; updateDisplay(); if (!panel.hidden) render(); },
3019
+ /* The host's own value, pushed in silently: no change event, so a binding that set it does
3020
+ not hear it back. A render-once host (Blazor) has no other way to change the shown date.
3021
+ The single-field range takes "start/end", the form its data-value already has. */
3022
+ setValue: function (next) {
3023
+ if (rangeMode) {
3024
+ var iv = parseInterval(next);
3025
+ selected = iv.start;
3026
+ selectedEnd = iv.end;
3027
+ } else {
3028
+ selected = parseVal(next);
3029
+ }
3030
+ anchor = null;
3031
+ preview = null;
3032
+ updateDisplay();
3033
+ if (!panel.hidden) render();
3034
+ },
2947
3035
  setMin: function (iso) { minDate = parseVal(iso); if (!panel.hidden) render(); },
2948
3036
  setMax: function (iso) { maxDate = parseVal(iso); if (!panel.hidden) render(); },
2949
3037
  setRange: function (fromIso, toIso) {
@@ -2990,6 +3078,15 @@
2990
3078
  if ((f === '') !== (t === '')) return;
2991
3079
  root.dispatchEvent(new CustomEvent('fdy-daterange-settled', { bubbles: true, detail: { from: f, to: t } }));
2992
3080
  }
3081
+ /* Both ends from the host at once, then the same linking a pick gets: the end's minimum and the
3082
+ band shading. Silent, like each picker's own setValue. */
3083
+ root._fdyDr = {
3084
+ setRange: function (f, t) {
3085
+ fromApi.setValue(f || '');
3086
+ toApi.setValue(t || '');
3087
+ sync();
3088
+ }
3089
+ };
2993
3090
  fromEl.addEventListener('fdy-datepicker-change', function () {
2994
3091
  var f = fromApi.getValue(), t = toApi.getValue();
2995
3092
  if (f && t && t < f) clearEnd(toEl, toApi);
@@ -3028,6 +3125,17 @@
3028
3125
  setState: function (root, state) {
3029
3126
  var api = root && root._fdyDp ? root._fdyDp : null;
3030
3127
  if (api && api.setState) api.setState(state);
3128
+ },
3129
+ /* A picker's value from the host, silently: `YYYY-MM-DD`, `YYYY-MM` in month mode, or
3130
+ "start/end" on a single-field range. */
3131
+ setValue: function (root, value) {
3132
+ var api = root && root._fdyDp ? root._fdyDp : null;
3133
+ if (api) api.setValue(value);
3134
+ },
3135
+ /* Both ends of a two-picker range (the `data-fdy-daterange` root), relinked as after a pick. */
3136
+ setRange: function (root, from, to) {
3137
+ var dr = root && root._fdyDr ? root._fdyDr : null;
3138
+ if (dr) dr.setRange(from, to);
3031
3139
  }
3032
3140
  };
3033
3141
  })();
@@ -3459,6 +3567,9 @@
3459
3567
  kitRoots(form).forEach(function (root) { paint(kitAria(root), ''); });
3460
3568
  }
3461
3569
  };
3570
+ /* The form's own <button type="reset"> empties the fields; the messages about them went with it
3571
+ only through api.reset(), so a reset form kept its red text and still counted as submitted. */
3572
+ form.addEventListener('reset', function () { api.reset(); });
3462
3573
  form._fdyForm = api;
3463
3574
  return api;
3464
3575
  }
@@ -4652,10 +4763,10 @@
4652
4763
  var marker = s.querySelector('.fdy-step__marker');
4653
4764
  if (marker) marker.innerHTML = i < active ? CHECK : (marker.dataset.num || String(i + 1));
4654
4765
  var btn = s.querySelector('.fdy-step__btn');
4655
- if (btn) btn.disabled = i > maxReached;
4766
+ if (btn) btn.disabled = i > maxReached || deciding;
4656
4767
  });
4657
4768
  panels.forEach(function (p, i) { p.hidden = i !== active; });
4658
- if (prevBtn) prevBtn.disabled = active === 0;
4769
+ if (prevBtn) prevBtn.disabled = deciding || active === 0;
4659
4770
  if (nextBtn) nextBtn.textContent = active === steps.length - 1 ? textOf(root, 'done') : (nextLabel || textOf(root, 'next'));
4660
4771
  root.dispatchEvent(new CustomEvent('fdy-step-change', { bubbles: true, detail: { index: active } }));
4661
4772
  }
@@ -4678,12 +4789,19 @@
4678
4789
  * opinion about form libraries and this is the line that keeps it that way. */
4679
4790
  var deciding = false;
4680
4791
 
4792
+ /* While a guard decides, nothing moves: Next, Back and the step headers alike. Only Next and Back
4793
+ used to check, so a header click went through mid-decision, and the decision then landed on a
4794
+ step it was never asked about. */
4681
4795
  function lock(on) {
4682
4796
  deciding = on;
4683
4797
  var list = root.querySelector('.fdy-stepper');
4684
4798
  if (list) { if (on) list.setAttribute('aria-busy', 'true'); else list.removeAttribute('aria-busy'); }
4685
4799
  if (prevBtn) prevBtn.disabled = on || active === 0;
4686
4800
  if (nextBtn) nextBtn.disabled = on;
4801
+ steps.forEach(function (s, i) {
4802
+ var btn = s.querySelector('.fdy-step__btn');
4803
+ if (btn) btn.disabled = on || i > maxReached;
4804
+ });
4687
4805
  }
4688
4806
 
4689
4807
  function request(to, onAllowed) {
@@ -4708,16 +4826,18 @@
4708
4826
  );
4709
4827
  }
4710
4828
 
4711
- if (prevBtn) prevBtn.addEventListener('click', function () { go(active - 1); });
4829
+ if (prevBtn) prevBtn.addEventListener('click', function () { if (!deciding) go(active - 1); });
4712
4830
  if (nextBtn) nextBtn.addEventListener('click', function () {
4713
- if (active < steps.length - 1) request(active + 1, function () { go(active + 1); });
4831
+ /* The target is fixed when asked: the guard approves THIS move, whatever happens meanwhile. */
4832
+ var to = active + 1;
4833
+ if (active < steps.length - 1) request(to, function () { go(to); });
4714
4834
  else request(active + 1, function () { root.dispatchEvent(new CustomEvent('fdy-step-finish', { bubbles: true })); });
4715
4835
  });
4716
4836
  steps.forEach(function (s, i) {
4717
4837
  var btn = s.querySelector('.fdy-step__btn');
4718
4838
  if (!btn) return;
4719
4839
  btn.addEventListener('click', function () {
4720
- if (i > maxReached) return;
4840
+ if (deciding || i > maxReached) return;
4721
4841
  // Going BACK is always allowed — nothing is being committed. Jumping forward to a step
4722
4842
  // already reached still leaves the current one behind, so it asks the guard like Next does.
4723
4843
  if (i <= active) go(i);
@@ -5325,8 +5445,12 @@
5325
5445
  closePopover();
5326
5446
  }
5327
5447
  });
5448
+ /* preventDefault says the key was used. Without it a dialog's close watcher acted on the same
5449
+ Escape, and a filter open in a table inside a modal closed the modal with it. */
5328
5450
  document.addEventListener('keydown', function (e) {
5329
- if (e.key === 'Escape' && openPopover) closePopover(true);
5451
+ if (e.key !== 'Escape' || !openPopover) return;
5452
+ e.preventDefault();
5453
+ closePopover(true);
5330
5454
  });
5331
5455
 
5332
5456
  buildColumnFilters();
@@ -5862,7 +5986,14 @@
5862
5986
  wrap: wrap,
5863
5987
  getValue: function () { return value; },
5864
5988
  setState: setState,
5865
- clear: function () { value = ''; for (var i = 0; i < opts.length; i++) opts[i].setAttribute('aria-selected', 'false'); updateDisplay(); }
5989
+ clear: function () { value = ''; for (var i = 0; i < opts.length; i++) opts[i].setAttribute('aria-selected', 'false'); updateDisplay(); },
5990
+ /* The host's own value, pushed in silently: no fdy-time-select, so a binding that set it does
5991
+ not hear it back. A render-once host (Blazor) has no other way to change the shown time. */
5992
+ setValue: function (next) {
5993
+ value = norm(next);
5994
+ for (var i = 0; i < opts.length; i++) opts[i].setAttribute('aria-selected', opts[i].getAttribute('data-value') === value ? 'true' : 'false');
5995
+ updateDisplay();
5996
+ }
5866
5997
  };
5867
5998
  wrap._fdyTp = api;
5868
5999
  return api;
@@ -5888,6 +6019,10 @@
5888
6019
  setState: function (root, state) {
5889
6020
  var api = root && root._fdyTp ? root._fdyTp : null;
5890
6021
  if (api && api.setState) api.setState(state);
6022
+ },
6023
+ setValue: function (root, value) {
6024
+ var api = root && root._fdyTp ? root._fdyTp : null;
6025
+ if (api) api.setValue(value);
5891
6026
  }
5892
6027
  };
5893
6028
  })();
@@ -6434,6 +6569,13 @@
6434
6569
  /* Back to a measured bar. While the indeterminate modifier is on it owns the bar's width, so an
6435
6570
  explicit one has to be restored when it comes off: .fdy-progress__bar is a plain block div, and
6436
6571
  with no width at all it fills the track, a full bar, which is the opposite of what 0% means. */
6572
+ function showUploading() {
6573
+ el.classList.remove('fdy-file--error', 'fdy-file--success');
6574
+ icon.innerHTML = FILE_ICON;
6575
+ sub.textContent = fmtSize(file.size) + ' · ' + textOf(zone, 'uploading');
6576
+ ensureProgress();
6577
+ determinate();
6578
+ }
6437
6579
  function determinate() {
6438
6580
  progressEl.classList.remove('fdy-progress--indeterminate');
6439
6581
  if (!bar.style.width) bar.style.width = '0%';
@@ -6451,13 +6593,12 @@
6451
6593
  dropProgress();
6452
6594
  },
6453
6595
  uploading: function () {
6454
- el.classList.remove('fdy-file--error', 'fdy-file--success');
6455
- icon.innerHTML = FILE_ICON;
6456
- sub.textContent = fmtSize(file.size) + ' · ' + textOf(zone, 'uploading');
6457
- ensureProgress();
6458
- determinate();
6596
+ showUploading();
6459
6597
  },
6460
6598
  setProgress: function (pct) {
6599
+ /* A percentage means the file is uploading again, whatever the row said before. A retry that
6600
+ reported progress straight after done() or fail() painted "Uploaded" over a moving bar. */
6601
+ if (el.classList.contains('fdy-file--success') || el.classList.contains('fdy-file--error')) showUploading();
6461
6602
  ensureProgress();
6462
6603
  determinate();
6463
6604
  var v = Math.max(0, Math.min(100, pct));
@@ -6538,9 +6679,13 @@
6538
6679
  ['dragenter', 'dragover'].forEach(function (ev) {
6539
6680
  zone.addEventListener(ev, function (e) { e.preventDefault(); zone.classList.add('is-dragover'); });
6540
6681
  });
6541
- ['dragleave', 'dragend'].forEach(function (ev) {
6542
- zone.addEventListener(ev, function (e) { if (e.target === zone) zone.classList.remove('is-dragover'); });
6682
+ /* Off when the pointer has left the ZONE, read from where it went: dragleave fires on whichever
6683
+ child it was over, so `e.target === zone` missed a drag that left through the icon, and the
6684
+ highlight stayed. A null relatedTarget is the window, or a drag cancelled with Escape. */
6685
+ zone.addEventListener('dragleave', function (e) {
6686
+ if (!e.relatedTarget || !zone.contains(e.relatedTarget)) zone.classList.remove('is-dragover');
6543
6687
  });
6688
+ zone.addEventListener('dragend', function () { zone.classList.remove('is-dragover'); });
6544
6689
  zone.addEventListener('drop', function (e) {
6545
6690
  e.preventDefault();
6546
6691
  zone.classList.remove('is-dragover');
@@ -198,7 +198,7 @@ live docs also have a copy button per component.
198
198
  ```bash
199
199
  npm i @cahyo-dimas/freeday
200
200
  ```
201
- Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.23.0"` (public npm package). `dist/` is
201
+ Lands in `package.json` as `"@cahyo-dimas/freeday": "^3.25.0"` (public npm package). `dist/` is
202
202
  committed and published → no build step; `npm ci` runs without auth.
203
203
 
204
204
  ### 2. Import the CSS + enhancers **once** in your entry (`src/main.ts`)
@@ -75,6 +75,9 @@ Notes:
75
75
  These replace one data area (a table, a list, a card), not the page. Put the `.fdy-state` inside
76
76
  the card or section it replaces, so the page header and its actions stay usable.
77
77
 
78
+ In Vue and React, `useLoad` holds which of these a data area is in, as one value; see `.fdy-state`
79
+ in COMPONENTS.md.
80
+
78
81
  ### 10. Ideal
79
82
 
80
83
  The data as designed. Design it last, after the four below, because those decide whether the
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cahyo-dimas/freeday",
3
- "version": "3.23.0",
3
+ "version": "3.25.0",
4
4
  "description": "Freeday: token-driven, framework-agnostic UI KIT (design source-of-truth).",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -97,7 +97,7 @@
97
97
  "scripts": {
98
98
  "build": "node tokens/build.mjs",
99
99
  "test": "node --test",
100
- "test:browser": "node --test --test-concurrency=3 browser/color-mix.mjs browser/vanilla.mjs browser/adapter.mjs browser/layout.mjs browser/theme.mjs browser/axis-nesting.mjs browser/palette-os-dark.mjs browser/primary-fill.mjs browser/state.mjs browser/root-init.mjs browser/upload-states.mjs browser/number.mjs browser/card-stretch.mjs browser/stretch-warn.mjs browser/hidden-attr.mjs browser/form-grid-rows.mjs browser/theme-pref.mjs browser/text-override.mjs browser/control-heights.mjs browser/field-width.mjs browser/cfl-multi.mjs browser/cfl-dialog-only.mjs browser/crowding.mjs browser/over-dialog.mjs browser/chart-scale.mjs browser/overlay-stack.mjs browser/chart-a11y.mjs browser/app-shell.mjs browser/bottom-nav.mjs browser/actionbar.mjs browser/picker-states.mjs browser/tabs-strip.mjs browser/tabs-vertical.mjs browser/menu-align.mjs browser/cfl-narrow.mjs browser/form-reveal.mjs browser/confirm-search-copy.mjs browser/daterange-settled.mjs browser/daterange-single.mjs browser/child-hydration.mjs browser/tabs-picker.mjs browser/display-parts.mjs browser/table-empty.mjs browser/table-footer-text.mjs browser/month-mode.mjs browser/monthpicker.mjs browser/page-columns.mjs browser/table-hover.mjs browser/typed-popover.mjs browser/filter-parity.mjs browser/filter-wrap.mjs browser/filter-stack.mjs browser/timepicker.mjs browser/form-kit-required.mjs browser/form-required-rest.mjs browser/autocomplete-open.mjs browser/picker-in-modal.mjs browser/harness-contract.mjs browser/app-owned.mjs browser/sortable.mjs browser/modal-phone.mjs browser/empty-ref.mjs browser/stack-standalone.mjs",
100
+ "test:browser": "node --test --test-concurrency=3 browser/color-mix.mjs browser/vanilla.mjs browser/adapter.mjs browser/layout.mjs browser/theme.mjs browser/axis-nesting.mjs browser/palette-os-dark.mjs browser/primary-fill.mjs browser/state.mjs browser/root-init.mjs browser/upload-states.mjs browser/number.mjs browser/card-stretch.mjs browser/stretch-warn.mjs browser/hidden-attr.mjs browser/form-grid-rows.mjs browser/theme-pref.mjs browser/text-override.mjs browser/control-heights.mjs browser/field-width.mjs browser/cfl-multi.mjs browser/cfl-dialog-only.mjs browser/crowding.mjs browser/over-dialog.mjs browser/chart-scale.mjs browser/overlay-stack.mjs browser/chart-a11y.mjs browser/app-shell.mjs browser/bottom-nav.mjs browser/actionbar.mjs browser/picker-states.mjs browser/tabs-strip.mjs browser/tabs-vertical.mjs browser/menu-align.mjs browser/cfl-narrow.mjs browser/form-reveal.mjs browser/confirm-search-copy.mjs browser/daterange-settled.mjs browser/daterange-single.mjs browser/child-hydration.mjs browser/tabs-picker.mjs browser/cfl-async.mjs browser/table-process.mjs browser/modal-locked.mjs browser/datepicker-escape.mjs browser/raw-escape-reset.mjs browser/use-load.mjs browser/upload-leftovers.mjs browser/stepper-pending.mjs browser/set-value.mjs browser/display-parts.mjs browser/table-empty.mjs browser/table-footer-text.mjs browser/month-mode.mjs browser/monthpicker.mjs browser/page-columns.mjs browser/table-hover.mjs browser/typed-popover.mjs browser/filter-parity.mjs browser/filter-wrap.mjs browser/filter-stack.mjs browser/timepicker.mjs browser/form-kit-required.mjs browser/form-required-rest.mjs browser/autocomplete-open.mjs browser/picker-in-modal.mjs browser/harness-contract.mjs browser/app-owned.mjs browser/sortable.mjs browser/modal-phone.mjs browser/empty-ref.mjs browser/stack-standalone.mjs",
101
101
  "prepack": "node tokens/build.mjs",
102
102
  "version": "node tokens/build.mjs && git add dist",
103
103
  "typecheck:react": "tsc -p adapters/react/tsconfig.json --noEmit",