@rjsf/mantine 6.6.1 → 6.7.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 (144) hide show
  1. package/LICENSE.md +201 -0
  2. package/dist/index.cjs +356 -302
  3. package/dist/index.cjs.map +4 -4
  4. package/dist/mantine.esm.js +218 -226
  5. package/dist/mantine.esm.js.map +4 -4
  6. package/dist/mantine.umd.js +175 -127
  7. package/lib/Form/index.d.ts +3 -3
  8. package/lib/Form/index.js.map +1 -1
  9. package/lib/Theme/index.d.ts +2 -2
  10. package/lib/templates/ArrayFieldItemTemplate.d.ts +2 -2
  11. package/lib/templates/ArrayFieldItemTemplate.js +1 -1
  12. package/lib/templates/ArrayFieldItemTemplate.js.map +1 -1
  13. package/lib/templates/ArrayFieldTemplate.d.ts +2 -2
  14. package/lib/templates/ArrayFieldTemplate.js +1 -1
  15. package/lib/templates/ArrayFieldTemplate.js.map +1 -1
  16. package/lib/templates/ArrayFieldTitleTemplate.d.ts +2 -2
  17. package/lib/templates/ArrayFieldTitleTemplate.js +1 -1
  18. package/lib/templates/ArrayFieldTitleTemplate.js.map +1 -1
  19. package/lib/templates/BaseInputTemplate.d.ts +2 -2
  20. package/lib/templates/BaseInputTemplate.js +9 -7
  21. package/lib/templates/BaseInputTemplate.js.map +1 -1
  22. package/lib/templates/ButtonTemplates/AddButton.d.ts +2 -2
  23. package/lib/templates/ButtonTemplates/AddButton.js.map +1 -1
  24. package/lib/templates/ButtonTemplates/IconButton.d.ts +15 -8
  25. package/lib/templates/ButtonTemplates/IconButton.js +14 -6
  26. package/lib/templates/ButtonTemplates/IconButton.js.map +1 -1
  27. package/lib/templates/ButtonTemplates/SubmitButton.d.ts +2 -2
  28. package/lib/templates/ButtonTemplates/SubmitButton.js.map +1 -1
  29. package/lib/templates/ButtonTemplates/index.d.ts +1 -1
  30. package/lib/templates/CyclicSchemaExpandTemplate.d.ts +6 -0
  31. package/lib/templates/CyclicSchemaExpandTemplate.js +15 -0
  32. package/lib/templates/CyclicSchemaExpandTemplate.js.map +1 -0
  33. package/lib/templates/DescriptionField.d.ts +2 -2
  34. package/lib/templates/ErrorList.d.ts +2 -2
  35. package/lib/templates/ErrorList.js.map +1 -1
  36. package/lib/templates/FieldErrorTemplate.d.ts +2 -2
  37. package/lib/templates/FieldErrorTemplate.js +1 -1
  38. package/lib/templates/FieldErrorTemplate.js.map +1 -1
  39. package/lib/templates/FieldHelpTemplate.d.ts +2 -2
  40. package/lib/templates/FieldHelpTemplate.js.map +1 -1
  41. package/lib/templates/FieldTemplate.d.ts +2 -2
  42. package/lib/templates/FieldTemplate.js +1 -1
  43. package/lib/templates/FieldTemplate.js.map +1 -1
  44. package/lib/templates/GridTemplate.d.ts +2 -2
  45. package/lib/templates/MultiSchemaFieldTemplate.d.ts +2 -2
  46. package/lib/templates/ObjectFieldTemplate.d.ts +2 -2
  47. package/lib/templates/ObjectFieldTemplate.js +1 -1
  48. package/lib/templates/ObjectFieldTemplate.js.map +1 -1
  49. package/lib/templates/OptionalDataControlsTemplate.d.ts +2 -2
  50. package/lib/templates/OptionalDataControlsTemplate.js +1 -1
  51. package/lib/templates/OptionalDataControlsTemplate.js.map +1 -1
  52. package/lib/templates/TitleField.d.ts +2 -2
  53. package/lib/templates/WrapIfAdditionalTemplate.d.ts +2 -2
  54. package/lib/templates/WrapIfAdditionalTemplate.js +1 -1
  55. package/lib/templates/WrapIfAdditionalTemplate.js.map +1 -1
  56. package/lib/templates/icons.d.ts +7 -7
  57. package/lib/templates/index.d.ts +1 -1
  58. package/lib/templates/index.js +2 -0
  59. package/lib/templates/index.js.map +1 -1
  60. package/lib/tsconfig.tsbuildinfo +1 -1
  61. package/lib/utils.d.ts +1 -1
  62. package/lib/utils.js.map +1 -1
  63. package/lib/widgets/CheckboxWidget.d.ts +2 -2
  64. package/lib/widgets/CheckboxWidget.js +1 -1
  65. package/lib/widgets/CheckboxWidget.js.map +1 -1
  66. package/lib/widgets/CheckboxesWidget.d.ts +2 -2
  67. package/lib/widgets/CheckboxesWidget.js +1 -1
  68. package/lib/widgets/CheckboxesWidget.js.map +1 -1
  69. package/lib/widgets/ColorWidget.d.ts +2 -2
  70. package/lib/widgets/ColorWidget.js +3 -3
  71. package/lib/widgets/ColorWidget.js.map +1 -1
  72. package/lib/widgets/DateTime/AltDateTimeWidget.d.ts +2 -2
  73. package/lib/widgets/DateTime/AltDateWidget.d.ts +2 -2
  74. package/lib/widgets/DateTime/AltDateWidget.js +1 -1
  75. package/lib/widgets/DateTime/AltDateWidget.js.map +1 -1
  76. package/lib/widgets/DateTime/DateTimeInput.d.ts +2 -2
  77. package/lib/widgets/DateTime/DateTimeInput.js +1 -1
  78. package/lib/widgets/DateTime/DateTimeInput.js.map +1 -1
  79. package/lib/widgets/DateTime/DateTimeWidget.d.ts +2 -2
  80. package/lib/widgets/DateTime/DateWidget.d.ts +2 -2
  81. package/lib/widgets/DateTime/TimeWidget.d.ts +2 -2
  82. package/lib/widgets/DateTime/TimeWidget.js +3 -3
  83. package/lib/widgets/DateTime/TimeWidget.js.map +1 -1
  84. package/lib/widgets/FileWidget.d.ts +2 -2
  85. package/lib/widgets/FileWidget.js +2 -1
  86. package/lib/widgets/FileWidget.js.map +1 -1
  87. package/lib/widgets/PasswordWidget.d.ts +2 -2
  88. package/lib/widgets/PasswordWidget.js +4 -4
  89. package/lib/widgets/PasswordWidget.js.map +1 -1
  90. package/lib/widgets/RadioWidget.d.ts +2 -2
  91. package/lib/widgets/RadioWidget.js +3 -3
  92. package/lib/widgets/RadioWidget.js.map +1 -1
  93. package/lib/widgets/RangeWidget.d.ts +2 -2
  94. package/lib/widgets/RangeWidget.js +1 -1
  95. package/lib/widgets/RangeWidget.js.map +1 -1
  96. package/lib/widgets/SelectWidget.d.ts +2 -2
  97. package/lib/widgets/SelectWidget.js +8 -7
  98. package/lib/widgets/SelectWidget.js.map +1 -1
  99. package/lib/widgets/TextareaWidget.d.ts +2 -2
  100. package/lib/widgets/TextareaWidget.js +3 -3
  101. package/lib/widgets/TextareaWidget.js.map +1 -1
  102. package/lib/widgets/index.d.ts +1 -1
  103. package/package.json +27 -24
  104. package/src/Form/index.ts +4 -3
  105. package/src/Theme/index.ts +2 -2
  106. package/src/templates/ArrayFieldItemTemplate.tsx +2 -8
  107. package/src/templates/ArrayFieldTemplate.tsx +2 -9
  108. package/src/templates/ArrayFieldTitleTemplate.tsx +2 -8
  109. package/src/templates/BaseInputTemplate.tsx +10 -17
  110. package/src/templates/ButtonTemplates/AddButton.tsx +2 -1
  111. package/src/templates/ButtonTemplates/IconButton.tsx +19 -10
  112. package/src/templates/ButtonTemplates/SubmitButton.tsx +2 -1
  113. package/src/templates/ButtonTemplates/index.ts +1 -1
  114. package/src/templates/CyclicSchemaExpandTemplate.tsx +34 -0
  115. package/src/templates/DescriptionField.tsx +1 -1
  116. package/src/templates/ErrorList.tsx +3 -1
  117. package/src/templates/FieldErrorTemplate.tsx +4 -2
  118. package/src/templates/FieldHelpTemplate.tsx +2 -1
  119. package/src/templates/FieldTemplate.tsx +2 -8
  120. package/src/templates/GridTemplate.tsx +1 -1
  121. package/src/templates/MultiSchemaFieldTemplate.tsx +1 -1
  122. package/src/templates/ObjectFieldTemplate.tsx +4 -8
  123. package/src/templates/OptionalDataControlsTemplate.tsx +3 -2
  124. package/src/templates/TitleField.tsx +1 -1
  125. package/src/templates/WrapIfAdditionalTemplate.tsx +2 -10
  126. package/src/templates/icons.tsx +1 -1
  127. package/src/templates/index.ts +3 -1
  128. package/src/utils.ts +2 -2
  129. package/src/widgets/CheckboxWidget.tsx +4 -11
  130. package/src/widgets/CheckboxesWidget.tsx +5 -7
  131. package/src/widgets/ColorWidget.tsx +6 -11
  132. package/src/widgets/DateTime/AltDateTimeWidget.tsx +1 -1
  133. package/src/widgets/DateTime/AltDateWidget.tsx +4 -12
  134. package/src/widgets/DateTime/DateTimeInput.tsx +2 -8
  135. package/src/widgets/DateTime/DateTimeWidget.tsx +1 -1
  136. package/src/widgets/DateTime/DateWidget.tsx +1 -1
  137. package/src/widgets/DateTime/TimeWidget.tsx +6 -11
  138. package/src/widgets/FileWidget.tsx +4 -9
  139. package/src/widgets/PasswordWidget.tsx +7 -12
  140. package/src/widgets/RadioWidget.tsx +7 -9
  141. package/src/widgets/RangeWidget.tsx +3 -9
  142. package/src/widgets/SelectWidget.tsx +25 -18
  143. package/src/widgets/TextareaWidget.tsx +6 -11
  144. package/src/widgets/index.ts +1 -1
@@ -1,7 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useCallback } from 'react';
3
3
  import { Textarea } from '@mantine/core';
4
- import { labelValue, ariaDescribedByIds, } from '@rjsf/utils';
4
+ import { labelValue, ariaDescribedByIds } from '@rjsf/utils';
5
5
  import { cleanupOptions } from '../utils.js';
6
6
  /** The `TextareaWidget` is a widget for rendering input fields as textarea.
7
7
  *
@@ -16,12 +16,12 @@ export default function TextareaWidget(props) {
16
16
  }, [onChange, emptyValue]);
17
17
  const handleBlur = useCallback(({ target }) => {
18
18
  if (onBlur) {
19
- onBlur(id, target && target.value);
19
+ onBlur(id, target === null || target === void 0 ? void 0 : target.value);
20
20
  }
21
21
  }, [onBlur, id]);
22
22
  const handleFocus = useCallback(({ target }) => {
23
23
  if (onFocus) {
24
- onFocus(id, target && target.value);
24
+ onFocus(id, target === null || target === void 0 ? void 0 : target.value);
25
25
  }
26
26
  }, [onFocus, id]);
27
27
  return (_jsx(Textarea, { id: id, name: htmlName || name, value: value || '', placeholder: placeholder || undefined, required: required, disabled: disabled || readonly, autoFocus: autofocus, label: labelValue(label || undefined, hideLabel, false), onChange: handleChange, onBlur: handleBlur, onFocus: handleFocus, error: rawErrors && rawErrors.length > 0 ? rawErrors.join('\n') : undefined, "aria-describedby": ariaDescribedByIds(id), ...themeProps }));
@@ -1 +1 @@
1
- {"version":3,"file":"TextareaWidget.js","sourceRoot":"","sources":["../../src/widgets/TextareaWidget.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAyC,WAA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Q,EAC9B,SAAS,EAAE,SAAS,EACpB,KAAK,EAAE,UAAU,CAAC,KAAK,IAAI,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,EACvD,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,UAAU,EAClB,OAAO,EAAE,WAAW,EACpB,KAAK,EAAE,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,sBACzD,kBAAkB,CAAC,EAAE,CAAC,KACpC,UAAU,GACd,CACH,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FormContextType, RegistryWidgetsType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
  export declare function generateWidgets<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(): RegistryWidgetsType<T, S, F>;
3
3
  declare const _default: RegistryWidgetsType<any, RJSFSchema, any>;
4
4
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rjsf/mantine",
3
- "version": "6.6.1",
3
+ "version": "6.7.0",
4
4
  "main": "dist/index.js",
5
5
  "module": "lib/index.js",
6
6
  "typings": "lib/index.d.ts",
@@ -42,19 +42,6 @@
42
42
  "engines": {
43
43
  "node": ">=20"
44
44
  },
45
- "scripts": {
46
- "build:ts": "tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json",
47
- "build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.cjs --sourcemap --packages=external --format=cjs",
48
- "build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/mantine.esm.js --sourcemap --packages=external --format=esm",
49
- "build:umd": "rollup dist/mantine.esm.js --format=umd --file=dist/mantine.umd.js --name=@rjsf/mantine",
50
- "build": "npm run build:ts && npm run build:cjs && npm run build:esm && npm run build:umd",
51
- "cs-check": "oxfmt --check \"{src,test}/**/*.{ts,tsx}\"",
52
- "cs-format": "oxfmt \"{src,test}/**/*.{ts,tsx}\"",
53
- "lint": "oxlint src test",
54
- "precommit": "lint-staged",
55
- "test": "vitest run",
56
- "test:update": "vitest run --update-snapshots"
57
- },
58
45
  "lint-staged": {
59
46
  "{src,test}/**/*.{ts,tsx}": [
60
47
  "oxlint --fix",
@@ -65,9 +52,9 @@
65
52
  "@mantine/core": ">=8",
66
53
  "@mantine/dates": ">=8",
67
54
  "@mantine/hooks": ">=8",
68
- "@rjsf/core": "^6.6.x",
69
- "@rjsf/utils": "^6.6.x",
70
- "react": ">=18"
55
+ "react": ">=18",
56
+ "@rjsf/core": "^6.7.0",
57
+ "@rjsf/utils": "^6.7.0"
71
58
  },
72
59
  "devDependencies": {
73
60
  "@mantine/core": "^8.3.18",
@@ -75,11 +62,14 @@
75
62
  "@mantine/hooks": "^8.3.18",
76
63
  "@restart/hooks": "^0.6.2",
77
64
  "@restart/ui": "^1.9.4",
78
- "@rjsf/core": "6.6.1",
79
- "@rjsf/snapshot-tests": "6.6.1",
80
- "@rjsf/utils": "6.6.1",
81
- "@rjsf/validator-ajv8": "6.6.1",
82
- "uncontrollable": "^9.0.0"
65
+ "uncontrollable": "^9.0.0",
66
+ "@rjsf/utils": "^6.7.0",
67
+ "@rjsf/validator-ajv8": "^6.7.0",
68
+ "@rjsf/core": "^6.7.0",
69
+ "@rjsf/snapshot-tests": "^6.7.0"
70
+ },
71
+ "dependencies": {
72
+ "dayjs": "^1.11.21"
83
73
  },
84
74
  "publishConfig": {
85
75
  "access": "public"
@@ -106,5 +96,18 @@
106
96
  "type": "git",
107
97
  "url": "git+https://github.com/rjsf-team/react-jsonschema-form.git"
108
98
  },
109
- "license": "Apache-2.0"
110
- }
99
+ "license": "Apache-2.0",
100
+ "scripts": {
101
+ "build:ts": "tsc -b tsconfig.build.json && tsc-alias -p tsconfig.build.json",
102
+ "build:cjs": "esbuild ./src/index.ts --bundle --outfile=dist/index.cjs --sourcemap --packages=external --format=cjs",
103
+ "build:esm": "esbuild ./src/index.ts --bundle --outfile=dist/mantine.esm.js --sourcemap --packages=external --format=esm",
104
+ "build:umd": "rollup dist/mantine.esm.js --format=umd --file=dist/mantine.umd.js --name=@rjsf/mantine",
105
+ "build": "pnpm run build:ts && pnpm run build:cjs && pnpm run build:esm && pnpm run build:umd",
106
+ "cs-check": "oxfmt --check \"{src,test}/**/*.{ts,tsx}\"",
107
+ "cs-format": "oxfmt \"{src,test}/**/*.{ts,tsx}\"",
108
+ "lint": "oxlint src test",
109
+ "precommit": "lint-staged",
110
+ "test": "vitest run",
111
+ "test:update": "vitest run --update"
112
+ }
113
+ }
package/src/Form/index.ts CHANGED
@@ -1,6 +1,7 @@
1
- import { ComponentType } from 'react';
2
- import { FormProps, withTheme } from '@rjsf/core';
3
- import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { ComponentType } from 'react';
2
+ import type { FormProps } from '@rjsf/core';
3
+ import { withTheme } from '@rjsf/core';
4
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
4
5
 
5
6
  import { generateTheme } from '../Theme';
6
7
 
@@ -1,5 +1,5 @@
1
- import { ThemeProps } from '@rjsf/core';
2
- import { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { ThemeProps } from '@rjsf/core';
2
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
3
 
4
4
  import { generateTemplates } from '../templates';
5
5
  import { generateWidgets } from '../widgets';
@@ -1,12 +1,6 @@
1
1
  import { Box, Flex, Group } from '@mantine/core';
2
- import {
3
- ArrayFieldItemTemplateProps,
4
- FormContextType,
5
- getTemplate,
6
- getUiOptions,
7
- RJSFSchema,
8
- StrictRJSFSchema,
9
- } from '@rjsf/utils';
2
+ import type { ArrayFieldItemTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { getTemplate, getUiOptions } from '@rjsf/utils';
10
4
 
11
5
  /** The `ArrayFieldItemTemplate` component is the template used to render an items of an array.
12
6
  *
@@ -1,13 +1,6 @@
1
1
  import { Fieldset, Box, Group } from '@mantine/core';
2
- import {
3
- getTemplate,
4
- getUiOptions,
5
- ArrayFieldTemplateProps,
6
- buttonId,
7
- FormContextType,
8
- RJSFSchema,
9
- StrictRJSFSchema,
10
- } from '@rjsf/utils';
2
+ import type { ArrayFieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { getTemplate, getUiOptions, buttonId } from '@rjsf/utils';
11
4
 
12
5
  /** The `ArrayFieldTemplate` component is the template used to render all items in an array.
13
6
  *
@@ -1,12 +1,6 @@
1
1
  import { Grid, Title } from '@mantine/core';
2
- import {
3
- getUiOptions,
4
- titleId,
5
- ArrayFieldTitleProps,
6
- FormContextType,
7
- RJSFSchema,
8
- StrictRJSFSchema,
9
- } from '@rjsf/utils';
2
+ import type { ArrayFieldTitleProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { getUiOptions, titleId } from '@rjsf/utils';
10
4
 
11
5
  /** The `ArrayFieldTitleTemplate` component renders a `TitleFieldTemplate` with an `id` derived from
12
6
  * the `fieldPathId`.
@@ -1,16 +1,9 @@
1
- import { ChangeEvent, FocusEvent, MouseEvent, useCallback } from 'react';
1
+ import type { ChangeEvent, FocusEvent, MouseEvent } from 'react';
2
+ import { useCallback } from 'react';
2
3
  import { TextInput, NumberInput } from '@mantine/core';
3
4
  import { SchemaExamples } from '@rjsf/core';
4
- import {
5
- ariaDescribedByIds,
6
- BaseInputTemplateProps,
7
- examplesId,
8
- getInputProps,
9
- labelValue,
10
- FormContextType,
11
- RJSFSchema,
12
- StrictRJSFSchema,
13
- } from '@rjsf/utils';
5
+ import type { BaseInputTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
6
+ import { ariaDescribedByIds, examplesId, getInputProps, labelValue } from '@rjsf/utils';
14
7
 
15
8
  import { cleanupOptions } from '../utils';
16
9
 
@@ -53,27 +46,27 @@ export default function BaseInputTemplate<
53
46
  const description = hideLabel ? undefined : options.description || schema.description;
54
47
  const themeProps = cleanupOptions(options);
55
48
 
56
- const handleNumberChange = useCallback((value: number | string) => onChange(value), [onChange]);
49
+ const handleNumberChange = useCallback((newValue: number | string) => onChange(newValue), [onChange]);
57
50
 
58
51
  const handleChange = useCallback(
59
52
  (e: ChangeEvent<HTMLInputElement>) => {
60
- const handler = onChangeOverride ? onChangeOverride : onChange;
61
- const value = e.target.value === '' ? options.emptyValue : e.target.value;
62
- handler(value);
53
+ const handler = onChangeOverride || onChange;
54
+ const newValue = e.target.value === '' ? options.emptyValue : e.target.value;
55
+ handler(newValue);
63
56
  },
64
57
  [onChange, onChangeOverride, options],
65
58
  );
66
59
 
67
60
  const handleBlur = useCallback(
68
61
  (e: FocusEvent<HTMLInputElement>) => {
69
- onBlur(id, e.target && e.target.value);
62
+ onBlur(id, e.target?.value);
70
63
  },
71
64
  [onBlur, id],
72
65
  );
73
66
 
74
67
  const handleFocus = useCallback(
75
68
  (e: FocusEvent<HTMLInputElement>) => {
76
- onFocus(id, e.target && e.target.value);
69
+ onFocus(id, e.target?.value);
77
70
  },
78
71
  [onFocus, id],
79
72
  );
@@ -1,4 +1,5 @@
1
- import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
1
+ import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import { TranslatableString } from '@rjsf/utils';
2
3
 
3
4
  import { Plus } from '../icons';
4
5
  import IconButton from './IconButton';
@@ -1,6 +1,9 @@
1
- import { MouseEventHandler } from 'react';
2
- import { ActionIcon, ActionIconProps } from '@mantine/core';
3
- import { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
1
+ import type { MouseEventHandler } from 'react';
2
+ import { memo } from 'react';
3
+ import type { ActionIconProps } from '@mantine/core';
4
+ import { ActionIcon } from '@mantine/core';
5
+ import type { FormContextType, IconButtonProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
6
+ import { TranslatableString } from '@rjsf/utils';
4
7
 
5
8
  import { Copy, ChevronDown, ChevronUp, X } from '../icons';
6
9
 
@@ -10,7 +13,7 @@ export type MantineIconButtonProps<
10
13
  F extends FormContextType = any,
11
14
  > = IconButtonProps<T, S, F> & Omit<ActionIconProps, 'onClick'>;
12
15
 
13
- export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
16
+ function IconButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
14
17
  props: MantineIconButtonProps<T, S, F>,
15
18
  ) {
16
19
  const { icon, iconType = 'sm', color, onClick, uiSchema, registry, ...otherProps } = props;
@@ -25,8 +28,10 @@ export default function IconButton<T = any, S extends StrictRJSFSchema = RJSFSch
25
28
  </ActionIcon>
26
29
  );
27
30
  }
31
+ const IconButton = memo(IconButtonFn) as typeof IconButtonFn;
32
+ export default IconButton;
28
33
 
29
- export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
34
+ function CopyButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
30
35
  props: MantineIconButtonProps<T, S, F>,
31
36
  ) {
32
37
  const {
@@ -36,8 +41,9 @@ export function CopyButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F e
36
41
  <IconButton title={translateString(TranslatableString.CopyButton)} variant='subtle' {...props} icon={<Copy />} />
37
42
  );
38
43
  }
44
+ export const CopyButton = memo(CopyButtonFn) as typeof CopyButtonFn;
39
45
 
40
- export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
46
+ function MoveDownButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
41
47
  props: MantineIconButtonProps<T, S, F>,
42
48
  ) {
43
49
  const {
@@ -52,8 +58,9 @@ export function MoveDownButton<T = any, S extends StrictRJSFSchema = RJSFSchema,
52
58
  />
53
59
  );
54
60
  }
61
+ export const MoveDownButton = memo(MoveDownButtonFn) as typeof MoveDownButtonFn;
55
62
 
56
- export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
63
+ function MoveUpButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
57
64
  props: MantineIconButtonProps<T, S, F>,
58
65
  ) {
59
66
  const {
@@ -68,8 +75,9 @@ export function MoveUpButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
68
75
  />
69
76
  );
70
77
  }
78
+ export const MoveUpButton = memo(MoveUpButtonFn) as typeof MoveUpButtonFn;
71
79
 
72
- export function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
80
+ function RemoveButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
73
81
  props: MantineIconButtonProps<T, S, F>,
74
82
  ) {
75
83
  const {
@@ -85,15 +93,16 @@ export function RemoveButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F
85
93
  />
86
94
  );
87
95
  }
96
+ export const RemoveButton = memo(RemoveButtonFn) as typeof RemoveButtonFn;
88
97
 
89
- export function ClearButton<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
98
+ function ClearButtonFn<T = any, S extends StrictRJSFSchema = RJSFSchema, F extends FormContextType = any>(
90
99
  props: MantineIconButtonProps<T, S, F>,
91
100
  ) {
92
101
  const {
93
102
  registry: { translateString },
94
103
  } = props;
95
-
96
104
  return (
97
105
  <IconButton title={translateString(TranslatableString.ClearButton)} variant='subtle' {...props} icon={<X />} />
98
106
  );
99
107
  }
108
+ export const ClearButton = memo(ClearButtonFn) as typeof ClearButtonFn;
@@ -1,5 +1,6 @@
1
1
  import { Button } from '@mantine/core';
2
- import { getSubmitButtonOptions, FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
2
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, SubmitButtonProps } from '@rjsf/utils';
3
+ import { getSubmitButtonOptions } from '@rjsf/utils';
3
4
 
4
5
  /** The `SubmitButton` renders a button that represent the `Submit` action on a form
5
6
  */
@@ -1,4 +1,4 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
2
2
 
3
3
  import AddButton from './AddButton';
4
4
  import { CopyButton, MoveDownButton, MoveUpButton, RemoveButton, ClearButton } from './IconButton';
@@ -0,0 +1,34 @@
1
+ import { Alert, Button, Group } from '@mantine/core';
2
+ import type { CyclicSchemaExpandProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { ID_KEY, TranslatableString } from '@rjsf/utils';
4
+
5
+ import { ExclamationCircle } from './icons';
6
+
7
+ /** The `CyclicSchemaExpandTemplate` is the template to use to render the cyclic schema expand message and controls
8
+ *
9
+ * @param props - The `CyclicSchemaExpandProps` for this component
10
+ */
11
+ export default function CyclicSchemaExpandTemplate<
12
+ T = any,
13
+ S extends StrictRJSFSchema = RJSFSchema,
14
+ F extends FormContextType = any,
15
+ >(props: CyclicSchemaExpandProps<T, S, F>) {
16
+ const { name, fieldPathId, registry, onExpand } = props;
17
+ const { translateString } = registry;
18
+ const buttonId = `${fieldPathId[ID_KEY]}-button`;
19
+ return (
20
+ <Alert
21
+ color='yellow'
22
+ variant='transparent'
23
+ title={translateString(TranslatableString.CycleDetected, [name])}
24
+ icon={<ExclamationCircle />}
25
+ mt='md'
26
+ >
27
+ <Group>
28
+ <Button id={buttonId} size='xs' variant='outline' color='yellow' onClick={() => onExpand(fieldPathId[ID_KEY])}>
29
+ {translateString(TranslatableString.ExpandButton)}
30
+ </Button>
31
+ </Group>
32
+ </Alert>
33
+ );
34
+ }
@@ -1,6 +1,6 @@
1
1
  import { Text } from '@mantine/core';
2
2
  import { RichDescription } from '@rjsf/core';
3
- import { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import type { DescriptionFieldProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
4
4
 
5
5
  /** The `DescriptionField` is the template to use to render the description of a field
6
6
  *
@@ -1,5 +1,6 @@
1
1
  import { Alert, Title, List } from '@mantine/core';
2
- import { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema, TranslatableString } from '@rjsf/utils';
2
+ import type { ErrorListProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { TranslatableString } from '@rjsf/utils';
3
4
 
4
5
  import { ExclamationCircle } from './icons';
5
6
 
@@ -26,6 +27,7 @@ export default function ErrorList<T = any, S extends StrictRJSFSchema = RJSFSche
26
27
  >
27
28
  <List>
28
29
  {errors.map((error, index) => (
30
+ // oxlint-disable-next-line react/no-array-index-key
29
31
  <List.Item key={`error-${index}`} c='red'>
30
32
  {error.stack}
31
33
  </List.Item>
@@ -1,5 +1,6 @@
1
1
  import { Box, List } from '@mantine/core';
2
- import { errorId, FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import type { FieldErrorProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { errorId } from '@rjsf/utils';
3
4
 
4
5
  /** The `FieldErrorTemplate` component renders the errors local to the particular field
5
6
  *
@@ -10,7 +11,7 @@ export default function FieldErrorTemplate<
10
11
  S extends StrictRJSFSchema = RJSFSchema,
11
12
  F extends FormContextType = any,
12
13
  >({ errors, fieldPathId }: FieldErrorProps<T, S, F>) {
13
- if (!errors || !errors.length) {
14
+ if (!errors?.length) {
14
15
  return null;
15
16
  }
16
17
  // In mantine, errors are handled directly in each component, so there is no need to render a separate error template.
@@ -19,6 +20,7 @@ export default function FieldErrorTemplate<
19
20
  <Box id={id} c='red' display='none'>
20
21
  <List>
21
22
  {errors.map((error, index) => (
23
+ // oxlint-disable-next-line react/no-array-index-key
22
24
  <List.Item key={`field-error-${index}`}>{error}</List.Item>
23
25
  ))}
24
26
  </List>
@@ -1,6 +1,7 @@
1
1
  import { Text } from '@mantine/core';
2
2
  import { RichHelp } from '@rjsf/core';
3
- import { helpId, FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import type { FieldHelpProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
4
+ import { helpId } from '@rjsf/utils';
4
5
 
5
6
  /** The `FieldHelpTemplate` component renders any help desired for a field
6
7
  *
@@ -1,12 +1,6 @@
1
1
  import { Box } from '@mantine/core';
2
- import {
3
- FieldTemplateProps,
4
- FormContextType,
5
- RJSFSchema,
6
- StrictRJSFSchema,
7
- getTemplate,
8
- getUiOptions,
9
- } from '@rjsf/utils';
2
+ import type { FieldTemplateProps, FormContextType, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
+ import { getTemplate, getUiOptions } from '@rjsf/utils';
10
4
 
11
5
  /** The `FieldTemplate` component is the template used by `SchemaField` to render any field. It renders the field
12
6
  * content, (label, description, children, errors and help) inside a `WrapIfAdditional` component.
@@ -1,5 +1,5 @@
1
1
  import { Container, Grid } from '@mantine/core';
2
- import { GridTemplateProps } from '@rjsf/utils';
2
+ import type { GridTemplateProps } from '@rjsf/utils';
3
3
 
4
4
  /** Renders a `GridTemplate` for mantine, which is expecting the column sizing information coming in via the
5
5
  * extra props provided by the caller, which are spread directly on the `Grid`/`Grid.Col`.
@@ -1,5 +1,5 @@
1
1
  import { Stack } from '@mantine/core';
2
- import { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import type { FormContextType, MultiSchemaFieldTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
3
 
4
4
  export default function MultiSchemaFieldTemplate<
5
5
  T = any,
@@ -1,17 +1,13 @@
1
- import { Box, Container, Group, MantineSpacing, SimpleGrid } from '@mantine/core';
2
- import {
3
- buttonId,
4
- canExpand,
5
- descriptionId,
1
+ import type { MantineSpacing } from '@mantine/core';
2
+ import { Box, Container, Group, SimpleGrid } from '@mantine/core';
3
+ import type {
6
4
  FormContextType,
7
- getTemplate,
8
- getUiOptions,
9
5
  ObjectFieldTemplatePropertyType,
10
6
  ObjectFieldTemplateProps,
11
7
  RJSFSchema,
12
8
  StrictRJSFSchema,
13
- titleId,
14
9
  } from '@rjsf/utils';
10
+ import { buttonId, canExpand, descriptionId, getTemplate, getUiOptions, titleId } from '@rjsf/utils';
15
11
 
16
12
  /** The `ObjectFieldTemplate` is the template to use to render all the inner properties of an object along with the
17
13
  * title and description if available. If the object is expandable, then an `AddButton` is also rendered after all
@@ -1,4 +1,4 @@
1
- import { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
1
+ import type { FormContextType, OptionalDataControlsTemplateProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
2
 
3
3
  import AddButton from './ButtonTemplates/AddButton';
4
4
  import { RemoveButton } from './ButtonTemplates/IconButton';
@@ -28,7 +28,8 @@ export default function OptionalDataControlsTemplate<
28
28
  title={label}
29
29
  />
30
30
  );
31
- } else if (onRemoveClick) {
31
+ }
32
+ if (onRemoveClick) {
32
33
  return (
33
34
  <RemoveButton
34
35
  id={id}
@@ -1,5 +1,5 @@
1
1
  import { Grid, Title } from '@mantine/core';
2
- import { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
2
+ import type { FormContextType, TitleFieldProps, RJSFSchema, StrictRJSFSchema } from '@rjsf/utils';
3
3
 
4
4
  /** The `TitleField` is the template to use to render the title of a field
5
5
  *
@@ -1,14 +1,6 @@
1
1
  import { Flex, Grid, TextInput } from '@mantine/core';
2
- import {
3
- ADDITIONAL_PROPERTY_FLAG,
4
- UI_OPTIONS_KEY,
5
- buttonId,
6
- FormContextType,
7
- RJSFSchema,
8
- StrictRJSFSchema,
9
- TranslatableString,
10
- WrapIfAdditionalTemplateProps,
11
- } from '@rjsf/utils';
2
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, WrapIfAdditionalTemplateProps } from '@rjsf/utils';
3
+ import { ADDITIONAL_PROPERTY_FLAG, UI_OPTIONS_KEY, buttonId, TranslatableString } from '@rjsf/utils';
12
4
 
13
5
  /** The `WrapIfAdditional` component is used by the `FieldTemplate` to rename, or remove properties that are
14
6
  * part of an `additionalProperties` part of a schema.
@@ -1,4 +1,4 @@
1
- import { ComponentPropsWithoutRef } from 'react';
1
+ import type { ComponentPropsWithoutRef } from 'react';
2
2
 
3
3
  interface IconProps extends ComponentPropsWithoutRef<'svg'> {
4
4
  size?: number | string;
@@ -1,10 +1,11 @@
1
- import { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
1
+ import type { FormContextType, RJSFSchema, StrictRJSFSchema, TemplatesType } from '@rjsf/utils';
2
2
 
3
3
  import ArrayFieldItemTemplate from './ArrayFieldItemTemplate';
4
4
  import ArrayFieldTemplate from './ArrayFieldTemplate';
5
5
  import ArrayFieldTitleTemplate from './ArrayFieldTitleTemplate';
6
6
  import BaseInputTemplate from './BaseInputTemplate';
7
7
  import ButtonTemplates from './ButtonTemplates';
8
+ import CyclicSchemaExpandTemplate from './CyclicSchemaExpandTemplate';
8
9
  import DescriptionField from './DescriptionField';
9
10
  import ErrorList from './ErrorList';
10
11
  import FieldErrorTemplate from './FieldErrorTemplate';
@@ -27,6 +28,7 @@ export function generateTemplates<
27
28
  ArrayFieldTemplate,
28
29
  ArrayFieldTitleTemplate,
29
30
  BaseInputTemplate,
31
+ CyclicSchemaExpandTemplate,
30
32
  ButtonTemplates: ButtonTemplates<T, S, F>(),
31
33
  DescriptionFieldTemplate: DescriptionField,
32
34
  ErrorListTemplate: ErrorList,
package/src/utils.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { UIOptionsType } from '@rjsf/utils';
1
+ import type { UIOptionsType } from '@rjsf/utils';
2
2
 
3
- const uiOptionsKeys: Array<keyof UIOptionsType> = [
3
+ const uiOptionsKeys: (keyof UIOptionsType)[] = [
4
4
  'emptyValue',
5
5
  'classNames',
6
6
  'title',
@@ -1,15 +1,8 @@
1
- import { ReactElement, ChangeEvent, FocusEvent, useCallback } from 'react';
1
+ import type { ReactElement, ChangeEvent, FocusEvent } from 'react';
2
+ import { useCallback } from 'react';
2
3
  import { Checkbox } from '@mantine/core';
3
- import {
4
- descriptionId,
5
- getTemplate,
6
- StrictRJSFSchema,
7
- RJSFSchema,
8
- FormContextType,
9
- WidgetProps,
10
- labelValue,
11
- ariaDescribedByIds,
12
- } from '@rjsf/utils';
4
+ import type { StrictRJSFSchema, RJSFSchema, FormContextType, WidgetProps } from '@rjsf/utils';
5
+ import { descriptionId, getTemplate, labelValue, ariaDescribedByIds } from '@rjsf/utils';
13
6
 
14
7
  /** The `CheckBoxWidget` is a widget for rendering boolean properties.
15
8
  * It is typically used to represent a boolean.