@arquimedes.co/eureka-forms 3.0.49-new-steps → 3.0.50-test

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 (145) hide show
  1. package/dist/@Types/Condition.d.ts +6 -4
  2. package/dist/@Types/ErkValue.d.ts +16 -0
  3. package/dist/@Types/ErkValue.js +1 -0
  4. package/dist/@Types/Form.d.ts +1 -0
  5. package/dist/@Types/FormStep.d.ts +10 -8
  6. package/dist/@Types/FormStep.js +1 -2
  7. package/dist/@Types/User.d.ts +13 -0
  8. package/dist/@Types/User.js +1 -0
  9. package/dist/App/App.js +1 -1
  10. package/dist/App/AppFunctions.js +8 -3
  11. package/dist/App/AppHooks.js +20 -1
  12. package/dist/Form/Form.js +6 -2
  13. package/dist/Form/Form.module.css +48 -39
  14. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +8 -4
  15. package/dist/FormSteps/CBRStepMapper.js +1 -1
  16. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +2 -2
  17. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +1 -1
  18. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +52 -4
  19. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +1 -1
  20. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +1 -1
  21. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +48 -17
  22. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +16 -0
  23. package/dist/FormSteps/Step.js +0 -16
  24. package/dist/FormSteps/StepFunctions.js +6 -23
  25. package/dist/FormSteps/StepFunctions.test.js +3 -57
  26. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +2 -1
  27. package/dist/Icons/@ErkIcon.d.ts +2 -2
  28. package/dist/Icons/@ErkIcon.js +2 -2
  29. package/dist/Icons/EmailIcon.d.ts +3 -0
  30. package/dist/Icons/{EditIcon.js → EmailIcon.js} +3 -3
  31. package/dist/Icons/Entities/SchoolIcon.d.ts +3 -0
  32. package/dist/Icons/Entities/SchoolIcon.js +7 -0
  33. package/dist/Icons/GroupIcon.d.ts +3 -0
  34. package/dist/Icons/GroupIcon.js +7 -0
  35. package/dist/Icons/LockedIcon.d.ts +3 -0
  36. package/dist/Icons/LockedIcon.js +7 -0
  37. package/dist/Login/Login.module.css +135 -0
  38. package/dist/Login/LoginLayout.module.css +68 -0
  39. package/dist/Login/LoginPage.d.ts +10 -0
  40. package/dist/Login/LoginPage.js +101 -0
  41. package/dist/Login/LoginTextField.d.ts +14 -0
  42. package/dist/Login/LoginTextField.js +29 -0
  43. package/dist/Services/ApiSelectorService.d.ts +366 -0
  44. package/dist/Services/ApiSelectorService.js +173 -0
  45. package/dist/Services/ApiSelectorService.test.d.ts +1 -0
  46. package/dist/Services/ApiSelectorService.test.js +87 -0
  47. package/dist/Services/DraftService.js +4 -1
  48. package/dist/Services/IntegrationService.d.ts +21 -0
  49. package/dist/Services/IntegrationService.js +22 -0
  50. package/dist/Services/UserService.d.ts +10 -0
  51. package/dist/Services/UserService.js +21 -0
  52. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +11 -4
  53. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.d.ts +3 -2
  54. package/dist/Shared/ErkDateRangePicker/ErkDateRangePicker.js +10 -4
  55. package/dist/Shared/ErkSelect/ErkSelect.d.ts +2 -2
  56. package/dist/Shared/InputIcon/InputIcon.js +6 -0
  57. package/dist/Shared/Navbar/Navbar.d.ts +2 -1
  58. package/dist/Shared/Navbar/Navbar.js +22 -3
  59. package/dist/Shared/Navbar/Navbar.module.css +22 -8
  60. package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
  61. package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +48 -0
  62. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +10 -3
  63. package/dist/States/GlobalSlice.d.ts +4 -1
  64. package/dist/States/GlobalSlice.js +8 -1
  65. package/dist/constants/ErkIconTypes.d.ts +3 -1
  66. package/dist/constants/ErkIconTypes.js +2 -0
  67. package/dist/constants/ErkValueTypes.d.ts +6 -0
  68. package/dist/constants/ErkValueTypes.js +7 -0
  69. package/dist/constants/FormStepTypes.d.ts +3 -6
  70. package/dist/constants/FormStepTypes.js +1 -4
  71. package/dist/hooks.d.ts +3 -0
  72. package/dist/hooks.js +17 -1
  73. package/package.json +9 -3
  74. package/dist/@Types/AvailabilityFormStep.d.ts +0 -48
  75. package/dist/@Types/AvailabilityFormStep.js +0 -24
  76. package/dist/@Types/BankAccountFormStep.d.ts +0 -67
  77. package/dist/@Types/BankAccountFormStep.js +0 -14
  78. package/dist/@Types/BookingFormStep.d.ts +0 -156
  79. package/dist/@Types/BookingFormStep.js +0 -44
  80. package/dist/@Types/CalendarFormStep.d.ts +0 -192
  81. package/dist/@Types/CalendarFormStep.js +0 -48
  82. package/dist/@Types/CommunicationChannelFormStep.d.ts +0 -51
  83. package/dist/@Types/CommunicationChannelFormStep.js +0 -15
  84. package/dist/@Types/ConsentFormStep.d.ts +0 -36
  85. package/dist/@Types/ConsentFormStep.js +0 -8
  86. package/dist/@Types/EntityFormFormStep.d.ts +0 -66
  87. package/dist/@Types/EntityFormFormStep.js +0 -20
  88. package/dist/@Types/EventFormStep.d.ts +0 -52
  89. package/dist/@Types/EventFormStep.js +0 -13
  90. package/dist/@Types/ExternalReferenceFormStep.d.ts +0 -74
  91. package/dist/@Types/ExternalReferenceFormStep.js +0 -20
  92. package/dist/@Types/LocationFormStep.d.ts +0 -159
  93. package/dist/@Types/LocationFormStep.js +0 -46
  94. package/dist/@Types/NumericFormSteps.d.ts +0 -108
  95. package/dist/@Types/NumericFormSteps.js +0 -20
  96. package/dist/@Types/PredefinedSelectorFormStep.d.ts +0 -51
  97. package/dist/@Types/PredefinedSelectorFormStep.js +0 -39
  98. package/dist/@Types/StepRef.d.ts +0 -135
  99. package/dist/@Types/StepRef.js +0 -49
  100. package/dist/FormSteps/BookingStep/BookingStep.d.ts +0 -17
  101. package/dist/FormSteps/BookingStep/BookingStep.js +0 -14
  102. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.d.ts +0 -3
  103. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.js +0 -362
  104. package/dist/FormSteps/BookingStep/MaterialBookingStep/MaterialBookingStep.module.css +0 -174
  105. package/dist/FormSteps/CalendarStep/CalendarStep.d.ts +0 -7
  106. package/dist/FormSteps/CalendarStep/CalendarStep.js +0 -14
  107. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.d.ts +0 -3
  108. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.js +0 -269
  109. package/dist/FormSteps/CalendarStep/MaterialCalendarStep/MaterialCalendarStep.module.css +0 -531
  110. package/dist/FormSteps/LocationStep/LocationStep.d.ts +0 -10
  111. package/dist/FormSteps/LocationStep/LocationStep.js +0 -14
  112. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.d.ts +0 -3
  113. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.js +0 -47
  114. package/dist/FormSteps/LocationStep/MaterialLocationStep/MaterialLocationStep.module.css +0 -18
  115. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.d.ts +0 -3
  116. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.js +0 -168
  117. package/dist/FormSteps/NumberStep/MaterialNumberStep/MaterialNumberStep.module.css +0 -94
  118. package/dist/FormSteps/NumberStep/NumberStep.d.ts +0 -10
  119. package/dist/FormSteps/NumberStep/NumberStep.js +0 -14
  120. package/dist/Icons/AddIcon.d.ts +0 -3
  121. package/dist/Icons/AddIcon.js +0 -7
  122. package/dist/Icons/EditIcon.d.ts +0 -3
  123. package/dist/Icons/RemoveIcon.d.ts +0 -3
  124. package/dist/Icons/RemoveIcon.js +0 -7
  125. package/dist/Icons/ViewDayIcon.d.ts +0 -3
  126. package/dist/Icons/ViewDayIcon.js +0 -7
  127. package/dist/Icons/ViewWeekIcon.d.ts +0 -3
  128. package/dist/Icons/ViewWeekIcon.js +0 -7
  129. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.d.ts +0 -19
  130. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.js +0 -80
  131. package/dist/Shared/ErkAddressAutocomplete/ErkAddressAutocomplete.module.css +0 -82
  132. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.d.ts +0 -29
  133. package/dist/Shared/ErkAddressAutocomplete/googlePlaces.js +0 -139
  134. package/dist/Shared/ErkLocationField/ErkLocationField.d.ts +0 -23
  135. package/dist/Shared/ErkLocationField/ErkLocationField.js +0 -73
  136. package/dist/Shared/ErkLocationField/ErkLocationField.module.css +0 -29
  137. package/dist/Shared/ErkLocationField/addressFields.d.ts +0 -12
  138. package/dist/Shared/ErkLocationField/addressFields.js +0 -34
  139. package/dist/Shared/ErkLocationField/locationRestrictions.d.ts +0 -6
  140. package/dist/Shared/ErkLocationField/locationRestrictions.js +0 -51
  141. package/dist/Shared/ErkLocationInput/ErkLocationInput.d.ts +0 -15
  142. package/dist/Shared/ErkLocationInput/ErkLocationInput.js +0 -499
  143. package/dist/Shared/ErkLocationInput/ErkLocationInput.module.css +0 -115
  144. package/dist/Shared/ErkNumberField/ErkNumberField.d.ts +0 -42
  145. package/dist/Shared/ErkNumberField/ErkNumberField.js +0 -170
@@ -1,170 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { NumberField as BaseNumberField } from '@base-ui/react/number-field';
4
- import { FormControl, FormHelperText, InputAdornment, InputLabel, OutlinedInput, styled, useTheme, } from '@mui/material';
5
- import { alpha } from '@mui/material/styles';
6
- import AddIcon from '../../Icons/AddIcon';
7
- import RemoveIcon from '../../Icons/RemoveIcon';
8
- // ---------------------------------------------------------------------------
9
- // Styled FormControl shell — same conventions as ErkTextField / ErkSelect
10
- // ---------------------------------------------------------------------------
11
- const StyledFormControl = styled(FormControl)(({ theme, size }) => ({
12
- '& .Erk-MuiOutlinedInput-root': {
13
- borderRadius: 10,
14
- backgroundColor: theme.palette.stepBackgroundColor.default,
15
- minHeight: size === 'small' ? 31 : size === 'medium' ? 40 : undefined,
16
- '&.Mui-focused .Erk-MuiOutlinedInput-notchedOutline': {
17
- borderColor: theme.palette.primary.main,
18
- borderWidth: 2,
19
- },
20
- // ErkNF-readOnly is set manually via className — Mui-readOnly is unreliable here
21
- '&:hover:not(.ErkNF-readOnly) .Erk-MuiOutlinedInput-notchedOutline': {
22
- borderColor: theme.palette.primary.main,
23
- },
24
- '&.ErkNF-readOnly.Mui-focused .Erk-MuiOutlinedInput-notchedOutline': {
25
- borderColor: theme.palette.outline.main,
26
- borderWidth: 1,
27
- },
28
- '&.ErkNF-readOnly': {
29
- cursor: 'default',
30
- '& input': { cursor: 'default' },
31
- },
32
- '& .Erk-MuiOutlinedInput-notchedOutline': {
33
- borderRadius: 10,
34
- borderColor: theme.palette.outline.main,
35
- '& legend': { fontSize: '0.75rem' },
36
- },
37
- },
38
- '& .Erk-MuiOutlinedInput-root.Mui-error .Erk-MuiOutlinedInput-notchedOutline': {
39
- borderColor: theme.palette.error.main,
40
- },
41
- '& .Erk-MuiOutlinedInput-root.Mui-error.Mui-focused .Erk-MuiOutlinedInput-notchedOutline': {
42
- borderWidth: 2,
43
- },
44
- '& .Erk-MuiFormLabel-root': {
45
- color: alpha(theme.palette.text.primary, 0.54),
46
- },
47
- '& label.Mui-focused': { color: theme.palette.primary.main },
48
- '& label.Mui-error': { color: theme.palette.error.main },
49
- '& .Erk-MuiFormLabel-root:not(.Erk-MuiInputLabel-shrink)': {
50
- fontSize: '1rem',
51
- transform: `translate(12px, ${size === 'small' ? 5 : 9}px) scale(1)`,
52
- },
53
- '& .Erk-MuiFormHelperText-root': {
54
- color: theme.palette.helperText.primary,
55
- minHeight: 20,
56
- overflow: 'hidden',
57
- textOverflow: 'ellipsis',
58
- },
59
- '& .Erk-MuiFormHelperText-root.Mui-error': { color: theme.palette.error.main },
60
- '& input': {
61
- fontSize: '1rem',
62
- padding: '6px 12px',
63
- lineHeight: size === 'small' ? '1.188em' : '1.75em',
64
- height: size === 'small' ? '1.188em' : '1.75em',
65
- color: theme.palette.text.primary,
66
- MozAppearance: 'textfield',
67
- '&::-webkit-outer-spin-button, &::-webkit-inner-spin-button': {
68
- WebkitAppearance: 'none',
69
- margin: 0,
70
- },
71
- },
72
- }));
73
- // ---------------------------------------------------------------------------
74
- // SSR label-shrink hint — muiName='Input' lets FormControl know an input
75
- // exists so it can compute the initial shrink state before hydration.
76
- // ---------------------------------------------------------------------------
77
- // eslint-disable-next-line @typescript-eslint/no-unused-vars
78
- function SSRInitialFilled(_props) {
79
- return null;
80
- }
81
- SSRInitialFilled.muiName = 'Input';
82
- function SpinnerBtn({ children, style, ...rest }) {
83
- const theme = useTheme();
84
- const [hovered, setHovered] = React.useState(false);
85
- const [active, setActive] = React.useState(false);
86
- return (_jsx("button", { type: "button", tabIndex: -1, ...rest, onMouseEnter: (e) => {
87
- setHovered(true);
88
- rest.onMouseEnter?.(e);
89
- }, onMouseLeave: (e) => {
90
- setHovered(false);
91
- setActive(false);
92
- rest.onMouseLeave?.(e);
93
- }, onMouseDown: (e) => {
94
- setActive(true);
95
- rest.onMouseDown?.(e);
96
- }, onMouseUp: (e) => {
97
- setActive(false);
98
- rest.onMouseUp?.(e);
99
- }, style: {
100
- display: 'inline-flex',
101
- alignItems: 'center',
102
- justifyContent: 'center',
103
- width: 22,
104
- height: 22,
105
- minWidth: 22,
106
- padding: 0,
107
- border: 'none',
108
- borderRadius: 4,
109
- background: active
110
- ? alpha(theme.palette.primary.main, 0.16)
111
- : hovered
112
- ? alpha(theme.palette.primary.main, 0.08)
113
- : 'transparent',
114
- cursor: rest.disabled ? 'default' : 'pointer',
115
- color: hovered && !rest.disabled ? theme.palette.primary.main : alpha(theme.palette.text.primary, 0.6),
116
- flexShrink: 0,
117
- transition: 'color 0.15s, background-color 0.15s',
118
- opacity: rest.disabled ? 0.35 : 1,
119
- pointerEvents: rest.disabled ? 'none' : undefined,
120
- ...style,
121
- }, children: children }));
122
- }
123
- // ---------------------------------------------------------------------------
124
- // Implementation
125
- // ---------------------------------------------------------------------------
126
- function CustomErkNumberField({ value, onChange, label, min, max, step = 1, decimals, required, error, errorBorder, helperText, disabled, readOnly, placeholder, size = 'small', fullWidth = true, suffix, spinner = true, inputRef, }) {
127
- const theme = useTheme();
128
- const id = React.useId();
129
- // Rounds to max decimals on spinner click / arrow key / wheel scrub.
130
- // Typing restriction is handled separately inside slotProps.input.onChange.
131
- const handleValueChange = (num) => {
132
- if (num === null || decimals === undefined) {
133
- onChange?.(num);
134
- return;
135
- }
136
- const factor = Math.pow(10, decimals);
137
- onChange?.(Math.round(num * factor) / factor);
138
- };
139
- return (_jsxs(BaseNumberField.Root, { value: value ?? null, onValueChange: handleValueChange, min: min, max: max, step: step, format: decimals !== undefined ? { minimumFractionDigits: 0, maximumFractionDigits: decimals } : undefined, disabled: disabled, readOnly: readOnly, ref: inputRef, render: (rootProps, rootState) => (_jsx(StyledFormControl, { ref: rootProps.ref, size: size, disabled: rootState.disabled, required: required, error: error && !!errorBorder, variant: "outlined", fullWidth: fullWidth, children: rootProps.children })), children: [_jsx(SSRInitialFilled, { value: value ?? undefined }), label && (_jsx(InputLabel, { htmlFor: id, size: size === 'small' ? 'small' : undefined, disabled: disabled, children: label })), _jsx(BaseNumberField.Input, { id: id, render: (inputProps, inputState) => {
140
- return (_jsx(OutlinedInput, { label: label, className: readOnly ? 'ErkNF-readOnly' : undefined, inputRef: inputProps.ref, value: inputState.inputValue, onBlur: inputProps.onBlur, onChange: inputProps.onChange, onKeyUp: inputProps.onKeyUp, onKeyDown: inputProps.onKeyDown, onFocus: inputProps.onFocus, placeholder: placeholder, slotProps: {
141
- input: {
142
- ...inputProps, // Base UI handlers + ref + aria attrs
143
- },
144
- }, endAdornment: suffix || spinner ? (_jsxs(InputAdornment, { position: "end", sx: { gap: '2px', mr: '2px', alignItems: 'center' }, children: [suffix && (_jsx("span", { style: {
145
- fontSize: 13,
146
- fontWeight: 600,
147
- color: theme.palette.primary.main,
148
- userSelect: 'none',
149
- whiteSpace: 'nowrap',
150
- marginRight: spinner ? 2 : 4,
151
- }, children: suffix })), spinner && (_jsxs(_Fragment, { children: [_jsx(BaseNumberField.Decrement, { render: (decProps) => {
152
- const { disabled: baseDisabled, ...restDec } = decProps;
153
- return (_jsx(SpinnerBtn, { ...restDec, disabled: !!readOnly || !!baseDisabled, children: _jsx(RemoveIcon, { size: 14 }) }));
154
- } }), _jsx(BaseNumberField.Increment, { render: (incProps) => {
155
- const { disabled: baseDisabled, ...restInc } = incProps;
156
- return (_jsx(SpinnerBtn, { ...restInc, disabled: !!readOnly || !!baseDisabled, children: _jsx(AddIcon, { size: 14 }) }));
157
- } })] }))] })) : undefined, sx: { pr: suffix || spinner ? 0 : undefined } }));
158
- } }), helperText && _jsx(FormHelperText, { error: error && !!errorBorder, children: helperText })] }));
159
- }
160
- /**
161
- * Pure number input built on Base UI NumberField + MUI styling.
162
- * No form-step system dependency.
163
- * Class wrapper for react-hook-form ref compatibility.
164
- */
165
- class ErkNumberField extends React.Component {
166
- render() {
167
- return _jsx(CustomErkNumberField, { ...this.props });
168
- }
169
- }
170
- export default ErkNumberField;