Skip to content

Update to master #1174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
39a99ac
feat(carbon): add string variant of timepicker
rvsia Oct 11, 2021
de36488
Merge pull request #1137 from rvsia/carbonStringTimePicker
Hyperkid123 Oct 13, 2021
834aaac
Release of new version: 3.13.0 <no> [skip ci]
semantic-release-bot Oct 13, 2021
673332a
feat(pf4): use FormFieldGroup in FieldArray
rvsia Oct 13, 2021
2c0015f
Add buttonLabels to pf4 field array doc
rvsia Oct 13, 2021
56ad02f
Update link to PF4 documentation
rvsia Oct 13, 2021
b83f112
Merge pull request #1146 from rvsia/updatePF4fieldArray
Hyperkid123 Oct 13, 2021
94e3b8e
Merge pull request #1147 from rvsia/updatePF4Link
Hyperkid123 Oct 13, 2021
3151ceb
Release of new version: 3.14.0 <no> [skip ci]
semantic-release-bot Oct 13, 2021
1f431a3
fix(pf4): Update PF4 to latest
rvsia Oct 13, 2021
8598057
feat(common): allow to flat options
rvsia Oct 13, 2021
676467e
feat(pf4): add group and divider to select options
rvsia Oct 13, 2021
04e124a
fix(common): change useFlatOptions to optionsTransformer
rvsia Oct 14, 2021
288e1d5
Add test for pf4 select with categories
rvsia Oct 14, 2021
061fa02
Add documentation for PF4 select groups
rvsia Oct 14, 2021
abbcc85
fix(common): pass originalOptions when using a transformer
rvsia Oct 14, 2021
d8a2d9d
fix(pf4): add nested filtering for select
rvsia Oct 14, 2021
46ad839
Add test for nested PF4 options with searchable
rvsia Oct 14, 2021
9f4ce7b
Update types for common select
rvsia Oct 14, 2021
6bd0e4c
Merge pull request #1148 from rvsia/pf4SelectCategories
rvsia Oct 14, 2021
897adb1
Release of new version: 3.15.0 <no> [skip ci]
semantic-release-bot Oct 14, 2021
8107659
fix(pf4): Field-Array no longer shows delete all when minItems has a …
steverhoades Oct 14, 2021
afb4d83
Merge pull request #1149 from steverhoades/remove-delete-all-when-min…
rvsia Oct 14, 2021
f18bb2b
Release of new version: 3.15.1 <no> [skip ci]
semantic-release-bot Oct 14, 2021
ae78ad7
fix(carbon): fix time picker minute range
GilbertCherrie Oct 15, 2021
23784c0
Merge pull request #1150 from GilbertCherrie/fix_time_picker_bug
rvsia Oct 18, 2021
d115cf5
Release of new version: 3.15.2 <no> [skip ci]
semantic-release-bot Oct 18, 2021
8d94d03
Update firebase and node to 12+
rvsia Oct 20, 2021
4400a78
Update node in circle ci
rvsia Oct 20, 2021
bd3142b
Merge pull request #1153 from rvsia/updateNodeTo12+
Hyperkid123 Oct 20, 2021
b5d6889
Update to Node16
rvsia Oct 20, 2021
00b381b
Merge pull request #1154 from rvsia/updatetoNode16
rvsia Oct 20, 2021
cbc734b
fix(carbon): update carbon to latest
rvsia Oct 20, 2021
d444669
Go back to node 14 until firebase is fully supporting sdk10
rvsia Oct 20, 2021
da1c5a4
Update yarn lock
rvsia Oct 20, 2021
8db7bf8
fix(carbon): exclude next components
rvsia Oct 20, 2021
6b4fb1a
Change circle ci back to node 14
rvsia Oct 20, 2021
03df194
Merge pull request #1156 from rvsia/updateRepo
rvsia Oct 20, 2021
f698d5a
Release of new version: 3.15.3 <no> [skip ci]
semantic-release-bot Oct 20, 2021
8ec8424
fix(carbon): add missing peer dependencies
Hyperkid123 Oct 26, 2021
da957b9
fix(blueprintn): add missing peer dependencies
Hyperkid123 Oct 26, 2021
ea80d58
fix(pf4): add missing peer dependencies
Hyperkid123 Oct 26, 2021
516c6dc
Merge pull request #1159 from data-driven-forms/update-carbon-peer-deps
rvsia Oct 26, 2021
a8018e0
Release of new version: 3.15.4 <no> [skip ci]
semantic-release-bot Oct 26, 2021
7b53431
fix(carbon): fix initial value for date timepicker
rvsia Oct 26, 2021
06edb2d
Merge pull request #1160 from rvsia/fixInitialValueCarbonDate
Hyperkid123 Oct 26, 2021
0148cc0
Release of new version: 3.15.5 <no> [skip ci]
semantic-release-bot Oct 26, 2021
e9c411e
Add migration guide for MUI5
rvsia Oct 27, 2021
c1380d2
Merge pull request #1163 from rvsia/addMigrationGuideMUI5
Hyperkid123 Nov 1, 2021
59a83fe
Generate defauly exports names based on the default export.
Hyperkid123 Nov 3, 2021
72d52a9
fix(renderer): fix invalid type declarations
Hyperkid123 Nov 3, 2021
190a118
Handle empty file in typings generator.
Hyperkid123 Nov 3, 2021
da99bc7
fix(mui): validation error invalid type declaration
Hyperkid123 Nov 3, 2021
a69ea1e
fix(antd): validation error invalid type declaration
Hyperkid123 Nov 3, 2021
872ed53
Merge pull request #1166 from data-driven-forms/add-missing-renderer-…
rvsia Nov 3, 2021
acc516d
Release of new version: 3.15.6 <no> [skip ci]
semantic-release-bot Nov 3, 2021
21dcd47
Update color theme
rvsia Nov 3, 2021
189a268
Merge pull request #1167 from rvsia/updateThemeColor
Hyperkid123 Nov 3, 2021
13966fa
fix(pf4): use options from field hook
rvsia Nov 5, 2021
7ce49d5
Merge pull request #1170 from rvsia/resolvePropsFIx
rvsia Nov 5, 2021
82b9673
Release of new version: 3.15.7 <no> [skip ci]
semantic-release-bot Nov 5, 2021
2a088f8
Merge branch 'master' into rebeaseMasterMUI5
rvsia Dec 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ant-component-mapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/ant-component-mapper",
"version": "3.15.3",
"version": "3.15.7",
"description": "Ant Design React component mapper for Data Driven Forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta } from "@data-driven-forms/react-form-renderer";

export type validationError = (meta: Meta<any>, validateOnMount?: boolean) => boolean | any | undefined
export function validationError(meta: Meta<any>, validateOnMount?: boolean): boolean | any | undefined

export default validationError;
6 changes: 4 additions & 2 deletions packages/blueprint-component-mapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/blueprint-component-mapper",
"version": "3.15.3",
"version": "3.15.7",
"description": "BlueprintJS React component mapper for Data Driven Forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -36,7 +36,9 @@
"peerDependencies": {
"@blueprintjs/core": "^3.26.1",
"@blueprintjs/datetime": "^3.17.0",
"@blueprintjs/select": "^3.12.3"
"@blueprintjs/select": "^3.12.3",
"react": "^16.13.1 || ^17.0.2",
"react-dom": "^16.13.1 || ^17.0.2"
},
"dependencies": {
"@data-driven-forms/common": "*",
Expand Down
7 changes: 5 additions & 2 deletions packages/carbon-component-mapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/carbon-component-mapper",
"version": "3.15.3",
"version": "3.15.7",
"description": "Carbon React component mapper for Data Driven Forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -35,7 +35,10 @@
"carbon-components-react": "^7.46.0",
"carbon-icons": "^7.0.7"
},
"peerDependencies": {},
"peerDependencies": {
"react": "^16.13.1 || ^17.0.2",
"react-dom": "^16.13.1 || ^17.0.2"
},
"dependencies": {
"@data-driven-forms/common": "*",
"clsx": "^1.1.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ describe('TimePicker<String>', () => {
onSubmit.mockReset();

await act(async () => {
wrapper.find('select#time-picker-12h').simulate('change', { target: { value: 'UTC' } });
wrapper.find('select#time-picker-timezones').simulate('change', { target: { value: 'UTC' } });
});
wrapper.update();

Expand All @@ -203,7 +203,7 @@ describe('TimePicker<String>', () => {
wrapper.update();

expect(wrapper.find('input').props().value).toEqual('00:35');
expect(onSubmit).toHaveBeenLastCalledWith({ 'time-picker': '00:35 UTC EST' });
expect(onSubmit).toHaveBeenLastCalledWith({ 'time-picker': '00:35 AM UTC' });
});

it('handles initial value', async () => {
Expand Down
45 changes: 42 additions & 3 deletions packages/carbon-component-mapper/src/tests/time-picker.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ describe('TimePicker', () => {
onSubmit.mockReset();

await act(async () => {
wrapper.find('select#time-picker-12h').simulate('change', { target: { value: 'UTC' } });
wrapper.find('select#time-picker-timezones').simulate('change', { target: { value: 'UTC' } });
});
wrapper.update();

Expand All @@ -203,8 +203,47 @@ describe('TimePicker', () => {
});
wrapper.update();

expect(wrapper.find('input').props().value).toEqual('10:35');
expect(onSubmit.mock.calls[0][0]['time-picker'].getHours()).toEqual(10);
expect(wrapper.find('input').props().value).toEqual('05:35');
expect(onSubmit.mock.calls[0][0]['time-picker'].getHours()).toEqual(5);
expect(onSubmit.mock.calls[0][0]['time-picker'].getMinutes()).toEqual(35);
});

it('handles initial value', async () => {
schema = {
fields: [
{
component: componentTypes.TIME_PICKER,
name: 'time-picker',
initialValue: new Date('December 17, 1995 16:00:00'),
twelveHoursFormat: true,
},
],
};

await act(async () => {
wrapper = mount(<FormRenderer schema={schema} {...initialProps} />);
});
wrapper.update();

expect(wrapper.find('input').props().value).toEqual('04:00');
expect(wrapper.find('select').props().defaultValue).toEqual('PM');

await act(async () => {
wrapper.find('input').simulate('change', { target: { value: '03:00' } });
});
wrapper.update();

await act(async () => {
wrapper.find('input').simulate('blur');
});
wrapper.update();

await act(async () => {
wrapper.find('form').simulate('submit');
});
wrapper.update();

expect(onSubmit.mock.calls[0][0]['time-picker'].getHours()).toEqual(15);
expect(onSubmit.mock.calls[0][0]['time-picker'].getMinutes()).toEqual(0);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ interface InternalTimePickerBaseProps extends CarbonTimePickerProps, AnyObject {
warnText?: ReactNode;
selectFormat: (value: 'AM' | 'PM') => void;
selectTimezone: (value: string) => void;
format?: 'AM' | 'PM';
defaultTimezone?: string;
}

export type TimePickerBaseProps = InternalTimePickerBaseProps & FormGroupProps;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const TimePickerBase = ({
warnText,
selectFormat,
selectTimezone,
format,
timezone,
...rest
}) => (
<div {...WrapperProps}>
Expand All @@ -34,13 +36,23 @@ const TimePickerBase = ({
{...rest}
>
{twelveHoursFormat && (
<TimePickerSelect labelText="Period" id={`${rest.id || input.name}-12h`} onChange={({ target: { value } }) => selectFormat(value)}>
<TimePickerSelect
defaultValue={format}
labelText="Period"
id={`${rest.id || input.name}-12h`}
onChange={({ target: { value } }) => selectFormat(value)}
>
<SelectItem value="AM" text="AM" />
<SelectItem value="PM" text="PM" />
</TimePickerSelect>
)}
{timezones && (
<TimePickerSelect labelText="Timezone" id={`${rest.id || input.name}-timezones`} onChange={({ target: { value } }) => selectTimezone(value)}>
<TimePickerSelect
defaultValue={timezone}
labelText="Timezone"
id={`${rest.id || input.name}-timezones`}
onChange={({ target: { value } }) => selectTimezone(value)}
>
{timezones.map(({ showAs, ...tz }) => (
<SelectItem key={tz.value} text={tz.label} {...tz} />
))}
Expand Down Expand Up @@ -78,6 +90,8 @@ TimePickerBase.propTypes = {
warnText: PropTypes.node,
selectFormat: PropTypes.func.isRequired,
selectTimezone: PropTypes.func.isRequired,
format: PropTypes.oneOf(['AM', 'PM']),
timezone: PropTypes.string,
};

export default TimePickerBase;
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Timezone extends SelectItemProps {
interface InternalTimePickerProps extends CarbonTimePickerProps {
twelveHoursFormat?: boolean;
timezones?: Timezone[];
defaultTimezone?: string;
}

export type TimePickerDateProps = InternalTimePickerProps & FormGroupProps & UseFieldApiComponentConfig;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ import prepareProps from '../prepare-props';
import TimePickerBase from '../time-picker-base';

const TimePickerDate = (props) => {
const { input, meta, twelveHoursFormat, timezones, validateOnMount, helperText, WrapperProps, ...rest } = useFieldApi(prepareProps(props));
const { input, meta, twelveHoursFormat, timezones, validateOnMount, helperText, WrapperProps, defaultTimezone, ...rest } = useFieldApi(
prepareProps(props)
);

const [timezone, selectTimezone] = useState(timezones ? timezones[0]?.value : '');
const [format, selectFormat] = useState('AM');
const [timezone, selectTimezone] = useState(defaultTimezone || timezones ? timezones[0]?.value : '');
const [format, selectFormat] = useState(() => (input.value?.getHours?.() >= 12 ? 'PM' : 'AM'));
const isMounted = useRef(false);

const invalid = (meta.touched || validateOnMount) && (meta.error || meta.submitError);
Expand Down Expand Up @@ -75,6 +77,8 @@ const TimePickerDate = (props) => {
warnText={warnText}
selectFormat={selectFormat}
selectTimezone={selectTimezone}
format={format}
timezone={timezone}
{...rest}
/>
);
Expand All @@ -96,6 +100,7 @@ TimePickerDate.propTypes = {
})
),
WrapperProps: PropTypes.object,
defaultTimezone: PropTypes.string,
};

export default TimePickerDate;
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const TimePickerString = (props) => {
warnText={warnText}
selectFormat={selectFormat}
selectTimezone={selectTimezone}
format={format}
timezone={timezone}
{...rest}
/>
);
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/common",
"version": "3.15.3",
"version": "3.15.7",
"description": "Common components, helpers and other pieces of code for Data Driven Forms",
"license": "Apache-2.0",
"main": "index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/mui-component-mapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/mui-component-mapper",
"version": "3.15.6",
"version": "3.15.7",
"description": "Component mapper for Material ui component mapper form data-driven-forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Meta } from "@data-driven-forms/react-form-renderer";

export type validationError = (meta: Meta<any>, validateOnMount?: boolean) => boolean | any | undefined;
export function validationError(meta: Meta<any>, validateOnMount?: boolean): boolean | any | undefined;

export default validationError;
2 changes: 1 addition & 1 deletion packages/parsers/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/parsers",
"version": "3.15.3",
"version": "3.15.7",
"description": "Parsers for Data Driven Forms.",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
6 changes: 4 additions & 2 deletions packages/pf4-component-mapper/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/pf4-component-mapper",
"version": "3.15.3",
"version": "3.15.7",
"description": "Patternfly 4 React component mapper for Data Driven Forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down Expand Up @@ -36,7 +36,9 @@
"peerDependencies": {
"@data-driven-forms/react-form-renderer": ">=3.2.1",
"@patternfly/react-core": "^4.157.3",
"@patternfly/react-icons": "^4.11.7"
"@patternfly/react-icons": "^4.11.7",
"react": "^16.13.1 || ^17.0.2",
"react-dom": "^16.13.1 || ^17.0.2"
},
"dependencies": {
"@data-driven-forms/common": "*",
Expand Down
4 changes: 2 additions & 2 deletions packages/pf4-component-mapper/src/radio/radio.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ RadioOption.propTypes = {
radioGroupValue: PropTypes.any,
};

const Radio = ({ name, options, type, ...props }) => {
const Radio = ({ name, type, ...props }) => {
/**
* You cannot assign type radio to PF4 radio buttons input. It will break and will not set input value, only checked property
* It has to be reqular input and we have change the radio value manully to the option value
*/
const { label, isRequired, helperText, meta, validateOnMount, description, hideLabel, input, isReadOnly, isDisabled, id, FormGroupProps } =
const { label, isRequired, helperText, meta, validateOnMount, description, hideLabel, input, isReadOnly, isDisabled, id, FormGroupProps, options } =
useFieldApi({
name,
...props,
Expand Down
2 changes: 1 addition & 1 deletion packages/react-form-renderer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/react-form-renderer",
"version": "3.15.3",
"version": "3.15.7",
"description": "React Form Renderer. Data Driven Forms converts JSON form definitions into fully functional React forms.",
"main": "index.js",
"module": "esm/index.js",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export type ComponentType = 'text-field'|'field-array'|'checkbox'|'sub-form'|'radio'|'tabs'|'tab-item'|'date-picker'|'time-picker'|'wizard'|'switch'|'textarea'|'select'|'plain-text'|'button'|'input-addon-group'|'input-addon-button-group'|'dual-list-select'|'slider';

interface componentTypes {
interface IcomponentTypes {
TEXT_FIELD: 'text-field';
FIELD_ARRAY: 'field-array';
CHECKBOX: 'checkbox';
Expand All @@ -22,6 +22,6 @@ interface componentTypes {
SLIDER: 'slider';
}

declare const componentTypes: componentTypes;
declare const componentTypes: IcomponentTypes;

export default componentTypes;
4 changes: 2 additions & 2 deletions packages/react-form-renderer/src/data-types/data-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
export type DataType = 'integer'|'float'|'number'|'boolean'|'string';

interface dataTypes {
interface IdataTypes {
INTEGER: 'integer';
FLOAT: 'float';
NUMBER: 'number';
BOOLEAN: 'boolean';
STRING: 'string';
}

declare const dataTypes: dataTypes;
declare const dataTypes: IdataTypes;

export default dataTypes;
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
interface validatorTypes {
interface IvalidatorTypes {
REQUIRED: 'required';
MIN_LENGTH: 'min-length';
MAX_LENGTH: 'max-length';
Expand All @@ -10,6 +10,6 @@ interface validatorTypes {
URL: 'url';
}

declare const validatorTypes: validatorTypes;
declare const validatorTypes: IvalidatorTypes;

export default validatorTypes;
2 changes: 1 addition & 1 deletion packages/react-renderer-demo/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@data-driven-forms/react-renderer-demo",
"version": "3.15.3",
"version": "3.15.7",
"main": "firebaseFunctions.js",
"description": "Documentation page for Data Driven Forms.",
"homepage": "https://data-driven-forms.org/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This component also accepts all other original props, please see [here](https://

|Props|Description|default|
|-----|-----------|-------|
|defaultTimezone|string - a value of default timezone, use only in Date varian|undefined|
|useStringFormat|boolean - save value as string|false|
|twelveHoursFormat|boolean - if true an AM/PM selector is shown|false|
|timezones|array of timezones - if not empty, an timezone selector is shown|undefined|
Expand Down
3 changes: 1 addition & 2 deletions packages/react-renderer-demo/src/pages/_document.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import Document, { Head, Main, NextScript } from 'next/document';
import { ServerStyleSheets } from '@mui/styles';
import theme from '../theme';

class MyDocument extends Document {
render() {
Expand All @@ -15,7 +14,7 @@ class MyDocument extends Document {
<link rel="apple-touch-icon" href="/192x192.png"></link>
<meta name="viewport" content="minimum-scale=1, initial-scale=1, width=device-width, shrink-to-fit=no" />
{/* PWA primary color */}
<meta name="theme-color" content={theme.palette.primary.main} />
<meta name="theme-color" content="#430f8f" />
<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" />
<link rel="preload" as="style" href="https://fonts.googleapis.com/css?family=Montserrat:700&display=swap" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" />
Expand Down
Loading