@emeraldemperaur/vector-sigma 1.4.48 → 1.4.50

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.
@@ -40,3 +40,4 @@ export * from './utils/voltron';
40
40
  export * from './utils/uuidparser';
41
41
  export * from './utils/currencyconfig';
42
42
  export * from './utils/minerva';
43
+ export * from './hooks/useVectorSigma';
@@ -24,18 +24,35 @@ export interface VectorSigmaRenderProps<T extends Record<string, any> = Record<s
24
24
  /**
25
25
  * * Optional Radix UI Theme configuration.
26
26
  * Enables developer theming extensibility to align xForm appearance with an extant application design system.
27
- *
28
- * https://www.radix-ui.com/themes/docs/components/theme
27
+ * * https://www.radix-ui.com/themes/docs/components/theme
29
28
  * @example
30
29
  * theme={{ appearance: 'dark', accentColor: 'ruby', radius: 'large' }}
31
30
  */
32
31
  theme?: Omit<ThemeProps, 'children'>;
32
+ /**
33
+ * * Optional toggle to disable the default xForm bottom submit button.
34
+ * Allows developers to implement custom Submit, Save or Validate buttons outside xForm component.
35
+ * @example
36
+ * buttonOverride={true}
37
+ */
38
+ buttonOverride?: boolean;
39
+ }
40
+ export interface VectorSigmaActions<T> {
41
+ submitForm: () => Promise<void | undefined>;
42
+ resetForm: (nextState?: Partial<import('formik').FormikState<T>>) => void;
43
+ setValues: (values: React.SetStateAction<T>, shouldValidate?: boolean) => Promise<void | import('formik').FormikErrors<T>>;
44
+ setFieldValue: (field: string, value: any, shouldValidate?: boolean) => Promise<void | import('formik').FormikErrors<T>>;
45
+ setFieldError: (field: string, message: string | undefined) => void;
46
+ setFieldTouched: (field: string, isTouched?: boolean, shouldValidate?: boolean) => Promise<void | import('formik').FormikErrors<T>>;
47
+ validateForm: (values?: any) => Promise<import('formik').FormikErrors<T>>;
48
+ setSubmitting: (isSubmitting: boolean) => void;
33
49
  }
34
50
  export declare class VectorSigma<T extends Record<string, any> = Record<string, any>> {
35
51
  isValid: boolean;
36
52
  formObject: XFormType;
37
53
  values: Partial<T>;
38
54
  errors: Record<string, any>;
55
+ actions: VectorSigmaActions<T> | null;
39
56
  statusCode: 0 | 1 | 2;
40
57
  timeCreated: number;
41
58
  timeInProgress: number | null;
@@ -58,6 +75,7 @@ export declare class VectorSigma<T extends Record<string, any> = Record<string,
58
75
  private buildFormikConfig;
59
76
  /**
60
77
  * Traverses xForm schema object and injects Formik values into their respective input queryResponse attributes by `inputAlias`.
78
+ * For select-based inputs, it hydrates the queryResponse with the full matching inputOption object(s).
61
79
  */
62
80
  private hydrateQueryResponses;
63
81
  /**
@@ -149,17 +167,17 @@ export declare class VectorSigma<T extends Record<string, any> = Record<string,
149
167
  * * Transforms the initialized xForm JSON/JS object, normalizing attribute fields and returning a `<Teletraan1/>` component.
150
168
  * @param options VectorSigmaRenderProps -- `VectorSigma` and `Teletraan1` props for VΣ render matrix.
151
169
  * @example .transform({
152
- displayMode: 'codex',
153
- readOnlyMode: false,
154
- brandColor: '#800020',
155
- onSubmit: async (values, actions, instance) => { // <-- onSubmit callback function passed into VectorSigma props
170
+ displayMode: 'codex',
171
+ readOnlyMode: false,
172
+ brandColor: '#800020',
173
+ onSubmit: async (values, actions, instance) => { // <-- onSubmit callback function passed into VectorSigma props
156
174
  // Use Case: Send extant xForm object to API
157
175
  await axios.post('/api/submit', instance.getxForm());
158
176
  // Use Case: Submit and clear form after success
159
177
  actions.submitForm();
160
178
  actions.resetForm();
161
179
  },
162
- onFinish: () => handleFormFinish() // <-- onFinish callback function passed into Teletraan1 (Codex only) props
180
+ onFinish: () => handleFormFinish() // <-- onFinish callback function passed into Teletraan1 (Codex only) props
163
181
  })})
164
182
  */
165
183
  transform(options?: VectorSigmaRenderProps<T>): React.ReactElement;
@@ -169,17 +187,17 @@ export declare class VectorSigma<T extends Record<string, any> = Record<string,
169
187
  * * `render()` is the final method in the Vector Sigma builder pattern chain.
170
188
  * @param options VectorSigmaRenderProps -- `VectorSigma` and `Teletraan1` props for VΣ render matrix.
171
189
  * @example .render({
172
- displayMode: 'dual',
173
- brandColor: '#800020',
174
- readOnlyMode: false,
175
- onSubmit: async (values, actions, instance) => { // <-- onSubmit callback function passed into VectorSigma props
190
+ displayMode: 'dual',
191
+ brandColor: '#800020',
192
+ readOnlyMode: false,
193
+ onSubmit: async (values, actions, instance) => { // <-- onSubmit callback function passed into VectorSigma props
176
194
  // Use Case: Send hydrated xForm object to API
177
195
  await axios.post('/api/submit', instance.getxForm());
178
196
  // Use Case: Submit and clear form after success
179
197
  actions.submitForm();
180
198
  actions.resetForm();
181
199
  },
182
- onFinish: () => handleFormFinish() // <-- onFinish callback function passed into Teletraan1 (Codex) props
200
+ onFinish: () => handleFormFinish() // <-- onFinish callback function passed into Teletraan1 (Codex) props
183
201
  })})
184
202
  */
185
203
  render(options?: VectorSigmaRenderProps<T>): React.ReactElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emeraldemperaur/vector-sigma",
3
- "version": "1.4.48",
3
+ "version": "1.4.50",
4
4
  "description": "Dynamic Form Orchestrator: NPM Package",
5
5
  "repository": {
6
6
  "type": "git",
@@ -11,6 +11,7 @@
11
11
  "type": "module",
12
12
  "main": "lib/index.cjs",
13
13
  "module": "lib/index.esm.js",
14
+ "unpkg": "lib/index.umd.js",
14
15
  "browser": "lib/index.esm.js",
15
16
  "types": "lib/types/index.d.ts",
16
17
  "exports": {
@@ -47,32 +48,24 @@
47
48
  "@types/react": "^19.2.10",
48
49
  "@types/react-dom": "^19.2.3",
49
50
  "@types/react-datepicker": "^6.2.0",
50
- "formik": "^2.4.9",
51
51
  "identity-obj-proxy": "^3.0.0",
52
52
  "jest": "^30.2.0",
53
53
  "jest-environment-jsdom": "^30.2.0",
54
54
  "jest-junit": "^16.0.0",
55
- "react": "^19.2.4",
56
- "react-dom": "^19.2.4",
57
55
  "rollup": "^4.58.1",
58
56
  "rollup-plugin-delete": "^3.0.2",
59
57
  "rollup-plugin-postcss": "^4.0.2",
60
58
  "rollup-plugin-preserve-directives": "^0.4.0",
61
59
  "rollup-plugin-typescript2": "^0.36.0",
62
60
  "rollup-plugin-visualizer": "^6.0.5",
63
- "sass-embedded": "^1.97.3",
64
61
  "ts-jest": "^29.4.6",
65
62
  "tslib": "^2.8.1",
66
- "typescript": "^5.9.3",
67
- "yup": "^1.7.1",
68
- "zod": "^4.3.6"
63
+ "typescript": "^5.9.3"
69
64
  },
70
65
  "peerDependencies": {
71
- "formik": "^2.4.9",
72
66
  "react": ">=18.0.0",
73
67
  "react-dom": ">=18.0.0",
74
- "sass-embedded": "^1.97.3",
75
- "yup": "^1.7.1"
68
+ "sass-embedded": "^1.97.3"
76
69
  },
77
70
  "dependencies": {
78
71
  "@radix-ui/react-accordion": "^1.2.12",
@@ -81,10 +74,13 @@
81
74
  "card-validator": "^10.0.4",
82
75
  "country-flag-icons": "^1.6.12",
83
76
  "date-fns": "^4.1.0",
77
+ "formik": "^2.4.9",
84
78
  "react-datepicker": "^9.1.0",
85
79
  "react-day-picker": "^9.13.1",
86
80
  "react-imask": "^7.6.1",
87
- "react-phone-number-input": "^3.4.14"
81
+ "react-phone-number-input": "^3.4.14",
82
+ "yup": "^1.7.1",
83
+ "zod": "^4.3.6"
88
84
  },
89
85
  "overrides": {
90
86
  "minimatch": "^10.2.3"