@civicactions/cmsds-open-data-components 4.1.2-alpha.6 → 4.1.2-alpha.8

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.
package/dist/main.js CHANGED
@@ -2988,6 +2988,16 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
2988
2988
  const data = resource.values;
2989
2989
  const [sorting, setSorting] = (0, $hgUW1$useState)([]);
2990
2990
  const dataTableWrapperElement = (0, $hgUW1$useRef)(null);
2991
+ const [loadingAnnouncement, setLoadingAnnouncement] = (0, $hgUW1$useState)("");
2992
+ (0, $hgUW1$useEffect)(()=>{
2993
+ if (loading) setLoadingAnnouncement("Dataset loading");
2994
+ else if (loadingAnnouncement) {
2995
+ const timer = setTimeout(()=>setLoadingAnnouncement(""), 1500);
2996
+ return ()=>clearTimeout(timer);
2997
+ }
2998
+ }, [
2999
+ loading
3000
+ ]);
2991
3001
  const columnHelper = (0, $hgUW1$createColumnHelper)();
2992
3002
  const table_columns = columns.map((col)=>{
2993
3003
  if (col.cell) return columnHelper.accessor(col.accessor, {
@@ -3244,13 +3254,17 @@ const $d98f94c79ddf4e0e$var$DataTable = ({ columns: columns, sortTransform: sort
3244
3254
  }),
3245
3255
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3246
3256
  "aria-live": "polite",
3257
+ "aria-atomic": "true",
3258
+ "data-testid": "loading-announcement",
3247
3259
  className: "ds-u-visibility--screen-reader",
3248
- children: loading ? "Dataset loading" : ""
3260
+ children: loadingAnnouncement
3249
3261
  }),
3250
3262
  /*#__PURE__*/ (0, $hgUW1$jsx)("div", {
3251
3263
  "aria-live": "assertive",
3264
+ "aria-atomic": "true",
3265
+ "data-testid": "no-results-announcement",
3252
3266
  className: "ds-u-visibility--screen-reader",
3253
- children: !loading && table.getRowModel().rows.length === 0 ? "No results found for the current filters" : ""
3267
+ children: !loading && table.getRowModel().rows.length === 0 ? "Warning: No results found for the current filters" : ""
3254
3268
  })
3255
3269
  ]
3256
3270
  });