@openg2p/registry-widgets 0.1.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 (103) hide show
  1. package/LICENSE +373 -0
  2. package/README.md +294 -0
  3. package/dist/components/FilePreviewModal.d.ts +9 -0
  4. package/dist/components/FilePreviewModal.d.ts.map +1 -0
  5. package/dist/components/PanelRenderer.d.ts +18 -0
  6. package/dist/components/PanelRenderer.d.ts.map +1 -0
  7. package/dist/components/SectionRenderer.d.ts +29 -0
  8. package/dist/components/SectionRenderer.d.ts.map +1 -0
  9. package/dist/components/SectionsContainer.d.ts +26 -0
  10. package/dist/components/SectionsContainer.d.ts.map +1 -0
  11. package/dist/components/WidgetProvider.d.ts +17 -0
  12. package/dist/components/WidgetProvider.d.ts.map +1 -0
  13. package/dist/components/WidgetRenderer.d.ts +9 -0
  14. package/dist/components/WidgetRenderer.d.ts.map +1 -0
  15. package/dist/hooks/useBaseWidget.d.ts +30 -0
  16. package/dist/hooks/useBaseWidget.d.ts.map +1 -0
  17. package/dist/hooks/useWidgetTranslation.d.ts +16 -0
  18. package/dist/hooks/useWidgetTranslation.d.ts.map +1 -0
  19. package/dist/i18n/config.d.ts +21 -0
  20. package/dist/i18n/config.d.ts.map +1 -0
  21. package/dist/index.css +4 -0
  22. package/dist/index.css.map +1 -0
  23. package/dist/index.d.ts +1306 -0
  24. package/dist/index.d.ts.map +1 -0
  25. package/dist/index.esm.js +5930 -0
  26. package/dist/index.esm.js.map +1 -0
  27. package/dist/index.js +6000 -0
  28. package/dist/index.js.map +1 -0
  29. package/dist/registry/WidgetRegistry.d.ts +40 -0
  30. package/dist/registry/WidgetRegistry.d.ts.map +1 -0
  31. package/dist/registry/defaultWidgets.d.ts +6 -0
  32. package/dist/registry/defaultWidgets.d.ts.map +1 -0
  33. package/dist/store/index.d.ts +11 -0
  34. package/dist/store/index.d.ts.map +1 -0
  35. package/dist/store/widgetSlice.d.ts +20 -0
  36. package/dist/store/widgetSlice.d.ts.map +1 -0
  37. package/dist/types/index.d.ts +293 -0
  38. package/dist/types/index.d.ts.map +1 -0
  39. package/dist/utils/conditions.d.ts +20 -0
  40. package/dist/utils/conditions.d.ts.map +1 -0
  41. package/dist/utils/dataSource.d.ts +27 -0
  42. package/dist/utils/dataSource.d.ts.map +1 -0
  43. package/dist/utils/dateInput.d.ts +32 -0
  44. package/dist/utils/dateInput.d.ts.map +1 -0
  45. package/dist/utils/datetimeInput.d.ts +37 -0
  46. package/dist/utils/datetimeInput.d.ts.map +1 -0
  47. package/dist/utils/filePreview.d.ts +8 -0
  48. package/dist/utils/filePreview.d.ts.map +1 -0
  49. package/dist/utils/fileSerialization.d.ts +40 -0
  50. package/dist/utils/fileSerialization.d.ts.map +1 -0
  51. package/dist/utils/formatting.d.ts +18 -0
  52. package/dist/utils/formatting.d.ts.map +1 -0
  53. package/dist/utils/numberInput.d.ts +31 -0
  54. package/dist/utils/numberInput.d.ts.map +1 -0
  55. package/dist/utils/pathUtils.d.ts +23 -0
  56. package/dist/utils/pathUtils.d.ts.map +1 -0
  57. package/dist/utils/schemaTranslation.d.ts +23 -0
  58. package/dist/utils/schemaTranslation.d.ts.map +1 -0
  59. package/dist/utils/textInput.d.ts +21 -0
  60. package/dist/utils/textInput.d.ts.map +1 -0
  61. package/dist/utils/validation.d.ts +11 -0
  62. package/dist/utils/validation.d.ts.map +1 -0
  63. package/dist/utils/validationPatterns.d.ts +17 -0
  64. package/dist/utils/validationPatterns.d.ts.map +1 -0
  65. package/dist/widgets/ArrayWidget.d.ts +29 -0
  66. package/dist/widgets/ArrayWidget.d.ts.map +1 -0
  67. package/dist/widgets/BooleanWidget.d.ts +35 -0
  68. package/dist/widgets/BooleanWidget.d.ts.map +1 -0
  69. package/dist/widgets/CheckboxWidget.d.ts +56 -0
  70. package/dist/widgets/CheckboxWidget.d.ts.map +1 -0
  71. package/dist/widgets/CurrencyInputWidget.d.ts +24 -0
  72. package/dist/widgets/CurrencyInputWidget.d.ts.map +1 -0
  73. package/dist/widgets/DateInputWidget.d.ts +42 -0
  74. package/dist/widgets/DateInputWidget.d.ts.map +1 -0
  75. package/dist/widgets/DateTimeInputWidget.d.ts +42 -0
  76. package/dist/widgets/DateTimeInputWidget.d.ts.map +1 -0
  77. package/dist/widgets/DisplayWidget.d.ts +11 -0
  78. package/dist/widgets/DisplayWidget.d.ts.map +1 -0
  79. package/dist/widgets/FileInputWidget.d.ts +24 -0
  80. package/dist/widgets/FileInputWidget.d.ts.map +1 -0
  81. package/dist/widgets/IterableAccordionWidget.d.ts +30 -0
  82. package/dist/widgets/IterableAccordionWidget.d.ts.map +1 -0
  83. package/dist/widgets/NumberInputWidget.d.ts +47 -0
  84. package/dist/widgets/NumberInputWidget.d.ts.map +1 -0
  85. package/dist/widgets/PhoneInputWidget.d.ts +22 -0
  86. package/dist/widgets/PhoneInputWidget.d.ts.map +1 -0
  87. package/dist/widgets/ProfileWidget.d.ts +50 -0
  88. package/dist/widgets/ProfileWidget.d.ts.map +1 -0
  89. package/dist/widgets/RadioWidget.d.ts +44 -0
  90. package/dist/widgets/RadioWidget.d.ts.map +1 -0
  91. package/dist/widgets/SelectWidget.d.ts +23 -0
  92. package/dist/widgets/SelectWidget.d.ts.map +1 -0
  93. package/dist/widgets/SimpleTableWidget.d.ts +32 -0
  94. package/dist/widgets/SimpleTableWidget.d.ts.map +1 -0
  95. package/dist/widgets/TableWidget.d.ts +46 -0
  96. package/dist/widgets/TableWidget.d.ts.map +1 -0
  97. package/dist/widgets/TextAreaWidget.d.ts +40 -0
  98. package/dist/widgets/TextAreaWidget.d.ts.map +1 -0
  99. package/dist/widgets/TextInputWidget.d.ts +48 -0
  100. package/dist/widgets/TextInputWidget.d.ts.map +1 -0
  101. package/dist/widgets/index.d.ts +19 -0
  102. package/dist/widgets/index.d.ts.map +1 -0
  103. package/package.json +67 -0
@@ -0,0 +1,23 @@
1
+ import { BaseWidgetConfig } from '../types';
2
+ /**
3
+ * Select/Dropdown widget with data source support
4
+ *
5
+ * Usage in schema:
6
+ * {
7
+ * "widget": "select",
8
+ * "widget-type": "input",
9
+ * "widget-label": "Country",
10
+ * "widget-id": "country",
11
+ * "widget-data-path": "address.country",
12
+ * "widget-data-source": {
13
+ * "type": "static" | "api" | "schema",
14
+ * ...
15
+ * }
16
+ * }
17
+ */
18
+ interface SelectWidgetProps {
19
+ config: BaseWidgetConfig;
20
+ }
21
+ export declare const SelectWidget: ({ config }: SelectWidgetProps) => import("react/jsx-runtime").JSX.Element;
22
+ export {};
23
+ //# sourceMappingURL=SelectWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SelectWidget.d.ts","sourceRoot":"","sources":["../../src/widgets/SelectWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C;;;;;;;;;;;;;;;GAeG;AACH,UAAU,iBAAiB;IACzB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,YAAY,GAAI,YAAY,iBAAiB,4CA4DzD,CAAC"}
@@ -0,0 +1,32 @@
1
+ import { BaseWidgetConfig } from '../types';
2
+ /**
3
+ * Simple table widget for structured data
4
+ *
5
+ * Usage in schema:
6
+ * {
7
+ * "widget": "simple-table",
8
+ * "widget-type": "table",
9
+ * "widget-label": "Education History",
10
+ * "widget-id": "educationHistory",
11
+ * "widget-data-path": "education.history",
12
+ * "widget-data-columns": [
13
+ * {
14
+ * "column-key": "degree",
15
+ * "widget-label": "Degree",
16
+ * "widget": "text",
17
+ * "widget-data-path": "degree"
18
+ * }
19
+ * ],
20
+ * "widget-data-operations": {
21
+ * "add": true,
22
+ * "remove": true,
23
+ * "edit": true
24
+ * }
25
+ * }
26
+ */
27
+ interface SimpleTableWidgetProps {
28
+ config: BaseWidgetConfig;
29
+ }
30
+ export declare const SimpleTableWidget: ({ config }: SimpleTableWidgetProps) => import("react/jsx-runtime").JSX.Element;
31
+ export {};
32
+ //# sourceMappingURL=SimpleTableWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SimpleTableWidget.d.ts","sourceRoot":"","sources":["../../src/widgets/SimpleTableWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,UAAU,sBAAsB;IAC9B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,iBAAiB,GAAI,YAAY,sBAAsB,4CAwJnE,CAAC"}
@@ -0,0 +1,46 @@
1
+ import { BaseWidgetConfig } from '../types';
2
+ /**
3
+ * Table widget with record-level inline editing
4
+ *
5
+ * Usage in schema:
6
+ * {
7
+ * "widget": "table",
8
+ * "widget-type": "table",
9
+ * "widget-label": "Education History",
10
+ * "widget-id": "educationHistory",
11
+ * "widget-data-path": "education.history",
12
+ * "widget-data-columns": [
13
+ * {
14
+ * "column-key": "degree",
15
+ * "widget-label": "Degree",
16
+ * "widget": "text",
17
+ * "widget-type": "input",
18
+ * "widget-data-path": "degree",
19
+ * "widget-data-format": {...}
20
+ * },
21
+ * {
22
+ * "column-key": "year",
23
+ * "widget-label": "Year",
24
+ * "widget": "number",
25
+ * "widget-type": "input",
26
+ * "widget-data-path": "year"
27
+ * }
28
+ * ],
29
+ * "widget-data-operations": {
30
+ * "add": true,
31
+ * "remove": true,
32
+ * "edit": true
33
+ * },
34
+ * "widget-data-api": {
35
+ * "add": { "url": "/api/records", "method": "POST" },
36
+ * "edit": { "url": "/api/records/{id}", "method": "PUT" },
37
+ * "delete": { "url": "/api/records/{id}", "method": "DELETE" }
38
+ * }
39
+ * }
40
+ */
41
+ interface TableWidgetProps {
42
+ config: BaseWidgetConfig;
43
+ }
44
+ export declare const TableWidget: ({ config }: TableWidgetProps) => import("react/jsx-runtime").JSX.Element;
45
+ export {};
46
+ //# sourceMappingURL=TableWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableWidget.d.ts","sourceRoot":"","sources":["../../src/widgets/TableWidget.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AA2H5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,UAAU,gBAAgB;IACxB,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAeD,eAAO,MAAM,WAAW,GAAI,YAAY,gBAAgB,4CAksBvD,CAAC"}
@@ -0,0 +1,40 @@
1
+ import { BaseWidgetConfig } from '../types';
2
+ /**
3
+ * TextArea widget for multi-line text input
4
+ * Supports 2 rows by default with configurable rows
5
+ *
6
+ * Features:
7
+ * - Multi-line text input
8
+ * - Character type filtering (any, alphabetic, alphanumeric, numeric, etc.)
9
+ * - Case control (none, lowercase, uppercase, capitalize)
10
+ * - Length constraints with live character counter
11
+ * - Regular expression validation with custom messages
12
+ * - Placeholder text with i18n support
13
+ *
14
+ * Usage in schema:
15
+ * {
16
+ * "widget": "textarea",
17
+ * "widget-type": "input",
18
+ * "widget-label": "Description",
19
+ * "widget-id": "description",
20
+ * "widget-data-path": "person.description",
21
+ * "widget-data-format": {
22
+ * "characterType": "any",
23
+ * "caseControl": "none",
24
+ * "showCharCounter": true,
25
+ * "rows": 2
26
+ * },
27
+ * "widget-data-validation": {
28
+ * "minLength": 10,
29
+ * "maxLength": 500
30
+ * },
31
+ * "widget-required": true,
32
+ * "widget-data-placeholder": "Enter description"
33
+ * }
34
+ */
35
+ interface TextAreaWidgetProps {
36
+ config: BaseWidgetConfig;
37
+ }
38
+ export declare const TextAreaWidget: ({ config }: TextAreaWidgetProps) => import("react/jsx-runtime").JSX.Element;
39
+ export {};
40
+ //# sourceMappingURL=TextAreaWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextAreaWidget.d.ts","sourceRoot":"","sources":["../../src/widgets/TextAreaWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,UAAU,mBAAmB;IAC3B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,cAAc,GAAI,YAAY,mBAAmB,4CA4J7D,CAAC"}
@@ -0,0 +1,48 @@
1
+ import { BaseWidgetConfig } from '../types';
2
+ /**
3
+ * Generic text input widget with advanced features
4
+ * Supports all text-based inputs via configuration (text, email, password, number, tel, url, etc.)
5
+ *
6
+ * Features:
7
+ * - Allowed character types (any, alphabetic, alphanumeric, numeric, numeric-decimal, custom)
8
+ * - Case control (none, lowercase, uppercase, capitalize)
9
+ * - Length constraints with live character counter
10
+ * - Regular expression validation with custom messages
11
+ * - Input masking (static and dynamic)
12
+ * - Placeholder text with i18n support
13
+ *
14
+ * Usage in schema:
15
+ * {
16
+ * "widget": "text",
17
+ * "widget-type": "input",
18
+ * "widget-label": "Field Label",
19
+ * "widget-id": "fieldId",
20
+ * "widget-data-path": "person.name",
21
+ * "widget-data-format": {
22
+ * "inputType": "email",
23
+ * "characterType": "alphanumeric",
24
+ * "caseControl": "lowercase",
25
+ * "mask": {
26
+ * "pattern": "XXX-XXX-XXXX",
27
+ * "type": "static"
28
+ * },
29
+ * "showCharCounter": true
30
+ * },
31
+ * "widget-data-validation": {
32
+ * "validationType": "email", // Predefined type: "email", "phone", or "url"
33
+ * // OR use custom pattern:
34
+ * // "pattern": "^[a-z0-9]+$",
35
+ * // "patternMessage": "Only lowercase alphanumeric characters allowed",
36
+ * "minLength": 5,
37
+ * "maxLength": 20
38
+ * },
39
+ * "widget-required": true,
40
+ * "widget-data-placeholder": "Enter your value"
41
+ * }
42
+ */
43
+ interface TextInputWidgetProps {
44
+ config: BaseWidgetConfig;
45
+ }
46
+ export declare const TextInputWidget: ({ config }: TextInputWidgetProps) => import("react/jsx-runtime").JSX.Element;
47
+ export {};
48
+ //# sourceMappingURL=TextInputWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TextInputWidget.d.ts","sourceRoot":"","sources":["../../src/widgets/TextInputWidget.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AACH,UAAU,oBAAoB;IAC5B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,eAAO,MAAM,eAAe,GAAI,YAAY,oBAAoB,4CAsP/D,CAAC"}
@@ -0,0 +1,19 @@
1
+ export { TextInputWidget } from './TextInputWidget';
2
+ export { NumberInputWidget } from './NumberInputWidget';
3
+ export { BooleanWidget } from './BooleanWidget';
4
+ export { DateInputWidget } from './DateInputWidget';
5
+ export { DateTimeInputWidget } from './DateTimeInputWidget';
6
+ export { SelectWidget } from './SelectWidget';
7
+ export { RadioWidget } from './RadioWidget';
8
+ export { CheckboxWidget } from './CheckboxWidget';
9
+ export { FileInputWidget } from './FileInputWidget';
10
+ export { SimpleTableWidget } from './SimpleTableWidget';
11
+ export { ArrayWidget } from './ArrayWidget';
12
+ export { IterableAccordionWidget } from './IterableAccordionWidget';
13
+ export { PhoneInputWidget } from './PhoneInputWidget';
14
+ export { CurrencyInputWidget } from './CurrencyInputWidget';
15
+ export { DisplayWidget } from './DisplayWidget';
16
+ export { TableWidget } from './TableWidget';
17
+ export { ProfileWidget } from './ProfileWidget';
18
+ export { TextAreaWidget } from './TextAreaWidget';
19
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/widgets/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
package/package.json ADDED
@@ -0,0 +1,67 @@
1
+ {
2
+ "name": "@openg2p/registry-widgets",
3
+ "version": "0.1.0",
4
+ "type": "module",
5
+ "description": "Complete React widget library with generic form widgets, data binding, validation, and conditional logic",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.esm.js",
8
+ "types": "dist/index.d.ts",
9
+ "files": [
10
+ "dist",
11
+ "README.md"
12
+ ],
13
+ "scripts": {
14
+ "build": "rollup -c",
15
+ "dev": "rollup -c -w",
16
+ "type-check": "tsc --noEmit",
17
+ "lint": "eslint src --ext .ts,.tsx",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "keywords": [
21
+ "react",
22
+ "widget",
23
+ "form",
24
+ "component",
25
+ "typescript",
26
+ "redux",
27
+ "zod",
28
+ "validation",
29
+ "data-binding"
30
+ ],
31
+ "author": "",
32
+ "license": "MPL-2.0",
33
+ "peerDependencies": {
34
+ "@reduxjs/toolkit": "^2.0.0",
35
+ "i18next": "^23.0.0",
36
+ "react": ">=19.2.1",
37
+ "react-dom": ">=19.2.1",
38
+ "react-i18next": "^14.0.0",
39
+ "react-redux": "^9.0.0",
40
+ "zod": "^3.22.0"
41
+ },
42
+ "devDependencies": {
43
+ "@eslint/js": "^9.0.0",
44
+ "@rollup/plugin-commonjs": "^29.0.0",
45
+ "@rollup/plugin-image": "^3.0.3",
46
+ "@rollup/plugin-json": "^6.1.0",
47
+ "@rollup/plugin-node-resolve": "^16.0.0",
48
+ "@rollup/plugin-typescript": "^12.0.0",
49
+ "@types/react": "^19.0.0",
50
+ "@types/react-dom": "^19.0.0",
51
+ "eslint": "^9.0.0",
52
+ "i18next": "^23.16.8",
53
+ "react-i18next": "^14.1.3",
54
+ "rollup": "^4.6.1",
55
+ "rollup-plugin-dts": "^6.1.0",
56
+ "tslib": "^2.6.2",
57
+ "typescript": "^5.3.3",
58
+ "typescript-eslint": "^8.0.0"
59
+ },
60
+ "overrides": {
61
+ "glob": "^10.0.0",
62
+ "inflight": "npm:@jsdevtools/inflight@^1.0.6"
63
+ },
64
+ "publishConfig": {
65
+ "access": "public"
66
+ }
67
+ }