@ornery/ui-grid-react 0.1.7 → 0.1.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/src/index.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  export { UiGrid } from './UiGrid';
2
2
  export type { UiGridProps } from './UiGrid';
3
- export { mountUiGrid } from './mountUiGrid';
3
+ export { mountUiGrid, updateUiGrid, styledCell } from './mountUiGrid';
4
4
  export {
5
5
  mountUiGridCustomElement,
6
6
  type MountUiGridCustomElementOptions,
@@ -7,4 +7,22 @@ export function mountUiGrid(container: Element | DocumentFragment, props: UiGrid
7
7
  const root = createRoot(container);
8
8
  root.render(React.createElement(UiGrid, props));
9
9
  return root;
10
+ }
11
+
12
+ /** Re-render an already-mounted UiGrid root with new props (for live data updates). */
13
+ export function updateUiGrid(root: Root, props: UiGridProps): void {
14
+ root.render(React.createElement(UiGrid, props));
15
+ }
16
+
17
+ /** Create a styled <span> React node — usable from non-TSX contexts (e.g. Angular). */
18
+ export function styledCell(
19
+ text: string,
20
+ color: string,
21
+ extraStyle?: React.CSSProperties,
22
+ ): React.ReactNode {
23
+ return React.createElement(
24
+ 'span',
25
+ { style: { color, fontVariantNumeric: 'tabular-nums', ...extraStyle } },
26
+ text,
27
+ );
10
28
  }