Skip to content

Commit

Permalink
feat(react-formio): use @tanstack/react-table
Browse files Browse the repository at this point in the history
  • Loading branch information
Romakita committed Feb 27, 2025
1 parent 3827361 commit a02a412
Show file tree
Hide file tree
Showing 60 changed files with 94,637 additions and 1,440 deletions.
14 changes: 12 additions & 2 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import "./styles/index.css";

import { withThemeByClassName } from "@storybook/addon-themes";
import { INITIAL_VIEWPORTS } from "@storybook/addon-viewport";
import { Formio, Templates } from "@tsed/react-formio";
import tailwind from "@tsed/tailwind-formio";
Expand All @@ -8,7 +9,7 @@ import tailwind from "@tsed/tailwind-formio";
Formio.use(tailwind);
Templates.framework = "tailwind";

/** @type { import('@storybook/react').Preview } */
/** @type { import("@storybook/react").Preview } */
const preview = {
parameters: {
docs: {
Expand All @@ -18,7 +19,16 @@ const preview = {
viewport: {
viewports: INITIAL_VIEWPORTS
},
tags: ["autodocs"]
tags: ["autodocs"],
decorators: [
withThemeByClassName({
themes: {
light: "",
dark: "dark"
},
defaultTheme: "light"
})
]
};

export default preview;
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"@storybook/addon-interactions": "^8.4.7",
"@storybook/addon-links": "^8.4.7",
"@storybook/addon-mdx-gfm": "^8.4.7",
"@storybook/addon-themes": "^8.4.7",
"@storybook/addon-viewport": "^8.4.7",
"@storybook/blocks": "^8.4.7",
"@storybook/react": "^8.4.7",
Expand Down Expand Up @@ -126,6 +127,7 @@
"storybook": "^8.4.7",
"storybook-addon-mock": "5.0.0",
"typescript": "5.7.2",
"uuid": "^11.0.5",
"vite": "5.4.11",
"vite-plugin-dts": "4.4.0",
"vite-plugin-svgr": "^2.4.0",
Expand Down
2 changes: 2 additions & 0 deletions packages/react-formio/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"peerDependencies": {
"@formio/choices.js": ">=9.0.1",
"@tanstack/react-table": ">=8.20.6",
"formiojs": ">=4.0.0",
"lodash": ">=4.17.20",
"moment": ">=2.30.1",
Expand All @@ -43,6 +44,7 @@
"tooltip.js": ">=1.3.3"
},
"devDependencies": {
"@tanstack/react-table": ">=8.20.6",
"@tsed/tailwind-formio": "workspace:*",
"@tsed/typescript": "workspace:*",
"microbundle": "0.13.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/react-formio/src/interfaces/Operation.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import React from "react";

import type { OperationButtonProps } from "../molecules/table";
import type { OperationButtonProps } from "../molecules/table/components/DefaultOperationButton.js";

export type PermissionsResolver<Data = any> = (data: Data, ctx: any) => void;
export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;
// export type OnClickOperation<Data = any> = (data: Data, operation: Operation) => void;

export interface Operation<Data = any> {
/**
Expand Down
28 changes: 28 additions & 0 deletions packages/react-formio/src/molecules/__fixtures__/build.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import { writeFile } from "node:fs/promises";

import { v4 } from "uuid";

import products from "./products.json" with { type: "json" };

const result = products.map((product) => {
return {
_id: v4(),
owner: null,
roles: [],
data: {
id: product.id,
label: product.title,
description: product.description_title,
image: product.media.immersive_image,
price: product.price?.initial_price?.per_trip,
currency: product.price?.currency
},
access: [],
externalIds: [],
created: new Date().toISOString(),
modified: new Date().toISOString(),
form: "5e972ae7a1a692917cf54f9e"
};
});

await writeFile("./form-submissions.json", JSON.stringify(result, null, 2), { encoding: "utf-8" });
Loading

0 comments on commit a02a412

Please sign in to comment.