({
7 | tableName: "Widget",
8 | });
9 | return (
10 | <>
11 |
12 | The data property on the formBuilder object contains the form data. The
13 | data property is updated as the user interacts with the form.
14 |
15 |
16 |
17 |
Widget Form
18 |
19 |
20 |
21 |
22 |
23 |
The widget name will be: {formBuilder.data?.Name}
24 |
25 |
26 |
27 | >
28 | );
29 | };
30 |
31 | export default FormBuilderData;
32 |
--------------------------------------------------------------------------------
/core/xams/Xams.Core/Attributes/ServiceLogicAttribute.cs:
--------------------------------------------------------------------------------
1 | namespace Xams.Core.Attributes
2 | {
3 | [Flags]
4 | public enum DataOperation
5 | {
6 | Create = 1,
7 | Read = 2,
8 | Update = 4,
9 | Delete = 8,
10 | Action = 16,
11 | }
12 |
13 | [Flags]
14 | public enum LogicStage
15 | {
16 | PreValidation = 1,
17 | PreOperation = 2,
18 | PostOperation = 4,
19 | }
20 |
21 | public class ServiceLogicAttribute : Attribute
22 | {
23 | public string TableName { get; set; }
24 | public DataOperation DataOperation { get; set; }
25 | public LogicStage LogicStage { get; set; }
26 | public int Order { get; set; }
27 |
28 |
29 | public ServiceLogicAttribute(string tableName, DataOperation dataOperation, LogicStage logicStage, int order = 0)
30 | {
31 | this.TableName = tableName;
32 | this.DataOperation = dataOperation;
33 | this.LogicStage = logicStage;
34 | this.Order = order;
35 | }
36 | }
37 | }
--------------------------------------------------------------------------------
/core/xams-workspace/ixeta-xams/src/admin/components/TypescriptTypes.tsx:
--------------------------------------------------------------------------------
1 | import { Textarea } from "@mantine/core";
2 | import React, { useEffect, useState } from "react";
3 | import useAuthRequest from "../../hooks/useAuthRequest";
4 |
5 | const TypescriptTypes = () => {
6 | const authRequest = useAuthRequest();
7 | const [value, setValue] = useState("");
8 |
9 | const getTypes = async () => {
10 | const resp = await authRequest.action("ADMIN_GetTypes");
11 | if (resp.succeeded) {
12 | setValue(resp.data as string);
13 | }
14 | };
15 |
16 | useEffect(() => {
17 | getTypes();
18 | }, []);
19 |
20 | return (
21 |
39 | );
40 | };
41 |
42 | export default TypescriptTypes;
43 |
--------------------------------------------------------------------------------
/core/xams-workspace/examples-app/src/examples/DataTableCUD.tsx:
--------------------------------------------------------------------------------
1 | import { DataTable } from "@ixeta/xams";
2 | import React from "react";
3 |
4 | const DataTableCUD = () => {
5 | return (
6 | <>
7 |
8 | The canCreate, canDelete, and canUpdate props can be used disable the
9 | ability to create, delete, and update records in the DataTable
10 | component.
11 |
12 |
13 | By default, all three are set to true. In this example, we set all three
14 | to false to disable the ability to create, delete, and update records.
15 |
16 |
17 | Security is not enforced on the server side, so it is important to
18 | implement proper security measures on the server side to prevent
19 | unauthorized access to the data.
20 |
21 |
22 |
28 |
29 | >
30 | );
31 | };
32 |
33 | export default DataTableCUD;
34 |
--------------------------------------------------------------------------------
/core/xams/Xams.Core/Entities/AuditHistoryDetail.cs:
--------------------------------------------------------------------------------
1 | using System.ComponentModel.DataAnnotations;
2 | using System.ComponentModel.DataAnnotations.Schema;
3 | using Xams.Core.Attributes;
4 |
5 | namespace Xams.Core.Entities;
6 |
7 | [Table(nameof(AuditHistoryDetail))]
8 | public class AuditHistoryDetail
9 | {
10 | public Guid AuditHistoryDetailId { get; set; }
11 | [UIName]
12 | [UIDisplayName("Field Name")]
13 | [MaxLength(250)]
14 | public string? FieldName { get; set; }
15 | public Guid AuditHistoryId { get; set; }
16 | public AuditHistory? AuditHistory { get; set; }
17 | [UIDisplayName("Table Name")]
18 | [MaxLength(250)]
19 | public string? TableName { get; set; }
20 | [UIDisplayName("Field Type")]
21 | [MaxLength(30)]
22 | public string? FieldType { get; set; }
23 | public Guid? OldValueId { get; set; }
24 | [UIDisplayName("Old Value")]
25 | [MaxLength(8000)]
26 | public string? OldValue { get; set; }
27 | public Guid? NewValueId { get; set; }
28 | [UIDisplayName("New Value")]
29 | [MaxLength(8000)]
30 | public string? NewValue { get; set; }
31 | }
--------------------------------------------------------------------------------
/xams-mcp-server/docs/xams-docs-v1/src/components/icons/TagIcon.tsx:
--------------------------------------------------------------------------------
1 | export function TagIcon(props: React.ComponentPropsWithoutRef<'svg'>) {
2 | return (
3 |
18 | )
19 | }
20 |
--------------------------------------------------------------------------------
/core/xams-workspace/examples-app/src/components/Highlighter.tsx:
--------------------------------------------------------------------------------
1 | import { Highlight, themes } from "prism-react-renderer";
2 | import React from "react";
3 |
4 | interface HighlighterProps {
5 | codeBlock: string;
6 | language: "csharp" | "jsx" | "tsx" | "javascript" | "typescript";
7 | }
8 |
9 | const Highlighter = (props: HighlighterProps) => {
10 | return (
11 |
16 | {({ className, style, tokens, getLineProps, getTokenProps }) => (
17 |
18 |
19 | {tokens.map((line, i) => (
20 |
21 | {line.map((token, key) => (
22 |
23 | ))}
24 |
25 | ))}
26 |
27 |
28 | )}
29 |
30 | );
31 | };
32 |
33 | export default Highlighter;
34 |
--------------------------------------------------------------------------------
/core/xams-workspace/examples-app/src/examples/DataTableTitleCode.tsx:
--------------------------------------------------------------------------------
1 | import Highlighter from "@/components/Highlighter";
2 | import React from "react";
3 |
4 | const csharp = `[Table("Widget")]
5 | public class Widget
6 | {
7 | public Guid WidgetId { get; set; }
8 | public string Name { get; set; }
9 | public decimal Price { get; set; }
10 | }`;
11 |
12 | const tsx = `import { DataTable } from "@ixeta/xams";
13 | import React from "react";
14 |
15 | const DataTableTitle = () => {
16 | return (
17 | <>
18 | The DataTable title can be customized by setting the title prop.
19 |
20 |
21 |
22 | >
23 | );
24 | };
25 |
26 | export default DataTableTitle;
27 | `;
28 |
29 | const DataTableTitleCode = () => {
30 | return (
31 |
32 | c#
33 |
34 | React
35 |
36 |
37 | );
38 | };
39 |
40 | export default DataTableTitleCode;
41 |
--------------------------------------------------------------------------------
/core/xams/Xams.Core/Contexts/StartupContext.cs:
--------------------------------------------------------------------------------
1 | using Xams.Core.Base;
2 | using Xams.Core.Interfaces;
3 | using Xams.Core.Pipeline;
4 | using Xams.Core.Startup;
5 |
6 | namespace Xams.Core.Contexts;
7 |
8 | public class StartupContext : BaseServiceContext
9 | {
10 | public IServiceProvider ServiceProvider { get; }
11 | public new IDataService DataService => base.DataService;
12 |
13 | public StartupContext(IServiceProvider serviceProvider, IDataService dataService)
14 | : base(CreatePipelineContext(dataService))
15 | {
16 | ServiceProvider = serviceProvider;
17 | }
18 |
19 | private static PipelineContext CreatePipelineContext(IDataService dataService)
20 | {
21 | var pipelineContext = new PipelineContext
22 | {
23 | UserId = SystemRecords.SystemUserId,
24 | DataService = dataService,
25 | DataRepository = dataService.GetDataRepository(),
26 | MetadataRepository = dataService.GetMetadataRepository(),
27 | SecurityRepository = dataService.GetSecurityRepository()
28 | };
29 |
30 | return pipelineContext;
31 | }
32 | }
--------------------------------------------------------------------------------
/core/xams-workspace/examples-app/src/examples/DTFormMaxWidthCode.tsx:
--------------------------------------------------------------------------------
1 | import Highlighter from "@/components/Highlighter";
2 | import React from "react";
3 |
4 | const csharp = `[Table("Widget")]
5 | public class Widget
6 | {
7 | public Guid WidgetId { get; set; }
8 | public string Name { get; set; }
9 | public decimal Price { get; set; }
10 | }`;
11 |
12 | const tsx = `import { DataTable } from "@ixeta/xams";
13 | import React from "react";
14 |
15 | const DTFormMinWidth = () => {
16 | return (
17 | <>
18 |
19 | The formMinWidth prop can be used to set the minimum width of the form.
20 |
21 |
22 |
23 |
24 | >
25 | );
26 | };
27 |
28 | export default DTFormMinWidth;
29 | `;
30 |
31 | const DTFormMaxWidthCode = () => {
32 | return (
33 |
34 | c#
35 |
36 | React
37 |
38 |
39 | );
40 | };
41 |
42 | export default DTFormMaxWidthCode;
43 |
--------------------------------------------------------------------------------
/core/xams-workspace/headless-auth-react/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import external from "rollup-plugin-peer-deps-external";
5 | import postcss from "rollup-plugin-postcss";
6 | import terser from "@rollup/plugin-terser";
7 |
8 | // import packageJson from "./package.json" assert { type: "json" };
9 | // import { dir } from "console";
10 | // const packageJson = require("./package.json");
11 |
12 | export default {
13 | input: "src/index.ts",
14 | output: [
15 | // {
16 | // // dir: "./dist/cjs/",
17 | // file: "dist/cjs/index.js",
18 | // format: "cjs",
19 | // sourcemap: true,
20 | // name: "react-lib",
21 | // },
22 | {
23 | dir: "./dist/",
24 | format: "esm",
25 | sourcemap: true,
26 | },
27 | ],
28 | plugins: [
29 | external(),
30 | resolve(),
31 | commonjs(),
32 | typescript({ tsconfig: "./tsconfig.json" }),
33 | postcss(),
34 | terser(),
35 | ],
36 | external: ["react", "react-dom"], // Exclude peer dependencies
37 | };
38 |
--------------------------------------------------------------------------------
/core/xams-workspace/ixeta-xams-firebase/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import external from "rollup-plugin-peer-deps-external";
5 | import postcss from "rollup-plugin-postcss";
6 | import terser from "@rollup/plugin-terser";
7 |
8 | // import packageJson from "./package.json" assert { type: "json" };
9 | // import { dir } from "console";
10 | // const packageJson = require("./package.json");
11 |
12 | export default {
13 | input: "src/index.ts",
14 | output: [
15 | // {
16 | // // dir: "./dist/cjs/",
17 | // file: "dist/cjs/index.js",
18 | // format: "cjs",
19 | // sourcemap: true,
20 | // name: "react-lib",
21 | // },
22 | {
23 | dir: "./dist/",
24 | format: "esm",
25 | sourcemap: true,
26 | },
27 | ],
28 | plugins: [
29 | external(),
30 | resolve(),
31 | commonjs(),
32 | typescript({ tsconfig: "./tsconfig.json" }),
33 | postcss(),
34 | terser(),
35 | ],
36 | external: ["react", "react-dom"], // Exclude peer dependencies
37 | };
38 |
--------------------------------------------------------------------------------
/core/xams-workspace/ixeta-xams-lite/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import external from "rollup-plugin-peer-deps-external";
5 | import postcss from "rollup-plugin-postcss";
6 | import terser from "@rollup/plugin-terser";
7 |
8 | // import packageJson from "./package.json" assert { type: "json" };
9 | // import { dir } from "console";
10 | // const packageJson = require("./package.json");
11 |
12 | export default {
13 | input: "src/index.ts",
14 | output: [
15 | // {
16 | // // dir: "./dist/cjs/",
17 | // file: "dist/cjs/index.js",
18 | // format: "cjs",
19 | // sourcemap: true,
20 | // name: "react-lib",
21 | // },
22 | {
23 | dir: "./dist/",
24 | format: "esm",
25 | sourcemap: true,
26 | },
27 | ],
28 | plugins: [
29 | external(),
30 | resolve(),
31 | commonjs(),
32 | typescript({ tsconfig: "./tsconfig.json" }),
33 | postcss(),
34 | terser(),
35 | ],
36 | external: ["react", "react-dom"], // Exclude peer dependencies
37 | };
38 |
--------------------------------------------------------------------------------
/core/xams-workspace/headless-auth-react-firebase/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import external from "rollup-plugin-peer-deps-external";
5 | import postcss from "rollup-plugin-postcss";
6 | import terser from "@rollup/plugin-terser";
7 |
8 | // import packageJson from "./package.json" assert { type: "json" };
9 | // import { dir } from "console";
10 | // const packageJson = require("./package.json");
11 |
12 | export default {
13 | input: "src/index.ts",
14 | output: [
15 | // {
16 | // // dir: "./dist/cjs/",
17 | // file: "dist/cjs/index.js",
18 | // format: "cjs",
19 | // sourcemap: true,
20 | // name: "react-lib",
21 | // },
22 | {
23 | dir: "./dist/",
24 | format: "esm",
25 | sourcemap: true,
26 | },
27 | ],
28 | plugins: [
29 | external(),
30 | resolve(),
31 | commonjs(),
32 | typescript({ tsconfig: "./tsconfig.json" }),
33 | postcss(),
34 | terser(),
35 | ],
36 | external: ["react", "react-dom"], // Exclude peer dependencies
37 | };
38 |
--------------------------------------------------------------------------------
/core/xams-workspace/headless-auth-react-supabase/rollup.config.js:
--------------------------------------------------------------------------------
1 | import resolve from "@rollup/plugin-node-resolve";
2 | import commonjs from "@rollup/plugin-commonjs";
3 | import typescript from "@rollup/plugin-typescript";
4 | import external from "rollup-plugin-peer-deps-external";
5 | import postcss from "rollup-plugin-postcss";
6 | import terser from "@rollup/plugin-terser";
7 |
8 | // import packageJson from "./package.json" assert { type: "json" };
9 | // import { dir } from "console";
10 | // const packageJson = require("./package.json");
11 |
12 | export default {
13 | input: "src/index.ts",
14 | output: [
15 | // {
16 | // // dir: "./dist/cjs/",
17 | // file: "dist/cjs/index.js",
18 | // format: "cjs",
19 | // sourcemap: true,
20 | // name: "react-lib",
21 | // },
22 | {
23 | dir: "./dist/",
24 | format: "esm",
25 | sourcemap: true,
26 | },
27 | ],
28 | plugins: [
29 | external(),
30 | resolve(),
31 | commonjs(),
32 | typescript({ tsconfig: "./tsconfig.json" }),
33 | postcss(),
34 | terser(),
35 | ],
36 | external: ["react", "react-dom"], // Exclude peer dependencies
37 | };
38 |
--------------------------------------------------------------------------------
/core/xams-workspace/examples-app/src/examples/DTFormCustom.tsx:
--------------------------------------------------------------------------------
1 | import { DataTable, Field, SaveButton } from "@ixeta/xams";
2 | import { Button } from "@mantine/core";
3 | import React from "react";
4 |
5 | const DTFormCustom = () => {
6 | return (
7 | <>
8 |
9 | The customForm prop can be used to customize the form that opens when
10 | clicking the Add button or on a row.
11 |
12 |
13 |
{
16 | return (
17 |
18 |
19 |
20 | The name of this widget will be: {formBuilder.data?.Name}
21 |
22 |
23 |
24 |
25 |
26 |
27 | );
28 | }}
29 | />
30 |
31 | >
32 | );
33 | };
34 |
35 | export default DTFormCustom;
36 |
--------------------------------------------------------------------------------