@irontec/ivoz-ui 1.4.1 → 1.4.3
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.
- package/hygen/templates/entity/new/Entity.ejs.t +4 -4
- package/hygen/templates/entity/new/EntityProperties.ejs.t +2 -2
- package/hygen/templates/entity/new/ForeignKeyGetter.ejs.t +2 -2
- package/hygen/templates/entity/new/ForeignKeyResolver.ejs.t +2 -2
- package/hygen/templates/entity/new/Form.ejs.t +3 -3
- package/hygen/templates/entity/new/SelectOptions.ejs.t +3 -3
- package/package.json +1 -1
- package/services/form/Field/TextField/TextField.js +15 -1
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
to: src/entities/<%= Name %>/<%= Name %>.tsx
|
|
3
3
|
---
|
|
4
4
|
import AccountTreeIcon from '@mui/icons-material/AccountTree';
|
|
5
|
-
import EntityInterface from '@irontec
|
|
6
|
-
import _ from '@irontec
|
|
7
|
-
import defaultEntityBehavior from '@irontec
|
|
8
|
-
import { EntityValue } from '@irontec
|
|
5
|
+
import EntityInterface from '@irontec/ivoz-ui/entities/EntityInterface';
|
|
6
|
+
import _ from '@irontec/ivoz-ui/services/translations/translate';
|
|
7
|
+
import defaultEntityBehavior from '@irontec/ivoz-ui/entities/DefaultEntityBehavior';
|
|
8
|
+
import { EntityValue } from '@irontec/ivoz-ui';
|
|
9
9
|
import { <%= Name %>Properties, <%= Name %>PropertyList } from './<%= Name %>Properties';
|
|
10
10
|
|
|
11
11
|
const properties: <%= Name %>Properties = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: src/entities/<%= Name %>/<%= Name %>Properties.ts
|
|
3
3
|
---
|
|
4
|
-
import { PropertySpec } from '@irontec
|
|
5
|
-
import { EntityValue, EntityValues } from '@irontec
|
|
4
|
+
import { PropertySpec } from '@irontec/ivoz-ui/services/api/ParsedApiSpecInterface';
|
|
5
|
+
import { EntityValue, EntityValues } from '@irontec/ivoz-ui/services/entity/EntityService';
|
|
6
6
|
|
|
7
7
|
export type <%= Name %>PropertyList<T> = {
|
|
8
8
|
<%- h.formattedEntityProperties(h.url(), Name)%>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: src/entities/<%= Name %>/ForeignKeyGetter.tsx
|
|
3
3
|
---
|
|
4
|
-
import { ForeignKeyGetterType } from '@irontec
|
|
5
|
-
import { autoSelectOptions } from '@irontec
|
|
4
|
+
import { ForeignKeyGetterType } from '@irontec/ivoz-ui/entities/EntityInterface';
|
|
5
|
+
import { autoSelectOptions } from '@irontec/ivoz-ui/entities/DefaultEntityBehavior';
|
|
6
6
|
import { <%= Name %>PropertyList } from './<%= Name %>Properties';
|
|
7
7
|
|
|
8
8
|
/** TODO remove this file unless you need to change default behaviour **/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: src/entities/<%= Name %>/ForeignKeyResolver.tsx
|
|
3
3
|
---
|
|
4
|
-
import { autoForeignKeyResolver } from '@irontec
|
|
5
|
-
import { foreignKeyResolverType } from '@irontec
|
|
4
|
+
import { autoForeignKeyResolver } from '@irontec/ivoz-ui/entities/DefaultEntityBehavior';
|
|
5
|
+
import { foreignKeyResolverType } from '@irontec/ivoz-ui/entities/EntityInterface';
|
|
6
6
|
import { <%= Name %>PropertiesList } from './<%= Name %>Properties';
|
|
7
7
|
|
|
8
8
|
/** TODO remove this file unless you need to change default behaviour **/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: src/entities/<%= Name %>/Form.tsx
|
|
3
3
|
---
|
|
4
|
-
import { EntityFormProps, FieldsetGroups } from '@irontec
|
|
5
|
-
import _ from '@irontec
|
|
6
|
-
import { Form as DefaultEntityForm } from '@irontec
|
|
4
|
+
import { EntityFormProps, FieldsetGroups } from '@irontec/ivoz-ui/entities/DefaultEntityBehavior';
|
|
5
|
+
import _ from '@irontec/ivoz-ui/services/translations/translate';
|
|
6
|
+
import { Form as DefaultEntityForm } from '@irontec/ivoz-ui/entities/DefaultEntityBehavior/Form';
|
|
7
7
|
|
|
8
8
|
const Form = (props: EntityFormProps): JSX.Element => {
|
|
9
9
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
---
|
|
2
2
|
to: src/entities/<%= Name %>/SelectOptions.ts
|
|
3
3
|
---
|
|
4
|
-
import defaultEntityBehavior from '@irontec
|
|
5
|
-
import { SelectOptionsType } from '@irontec
|
|
4
|
+
import defaultEntityBehavior from '@irontec/ivoz-ui/entities/DefaultEntityBehavior';
|
|
5
|
+
import { SelectOptionsType } from '@irontec/ivoz-ui/entities/EntityInterface';
|
|
6
6
|
import { <%= Name %>PropertiesList } from './<%= Name %>Properties';
|
|
7
|
-
import { DropdownChoices } from '@irontec
|
|
7
|
+
import { DropdownChoices } from '@irontec/ivoz-ui';
|
|
8
8
|
import store from 'store';
|
|
9
9
|
|
|
10
10
|
const <%= Name %>SelectOptions: SelectOptionsType = ({ callback, cancelToken }): Promise<unknown> => {
|
package/package.json
CHANGED
|
@@ -12,6 +12,10 @@ export const TextField = (props) => {
|
|
|
12
12
|
}
|
|
13
13
|
const labelId = `${name}-label`;
|
|
14
14
|
const maxRows = multiline ? 6 : undefined;
|
|
15
|
+
const fixDateTime = (value) => {
|
|
16
|
+
const haveMissingSeconds = value.length === 16;
|
|
17
|
+
return haveMissingSeconds ? value.concat(':00') : value;
|
|
18
|
+
};
|
|
15
19
|
const passThroughProps = {};
|
|
16
20
|
if (onKeyDown) {
|
|
17
21
|
passThroughProps.onKeyDown = onKeyDown;
|
|
@@ -19,5 +23,15 @@ export const TextField = (props) => {
|
|
|
19
23
|
if (onClick) {
|
|
20
24
|
passThroughProps.onClick = onClick;
|
|
21
25
|
}
|
|
22
|
-
|
|
26
|
+
passThroughProps.onChange = (event) => {
|
|
27
|
+
const { target } = event;
|
|
28
|
+
if (type === 'datetime-local') {
|
|
29
|
+
const fixedDate = fixDateTime(target.value);
|
|
30
|
+
event.target = Object.assign(Object.assign({}, target), { value: fixedDate });
|
|
31
|
+
}
|
|
32
|
+
if (onChange) {
|
|
33
|
+
onChange(event);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
return (_jsxs(FormControl, Object.assign({ variant: 'standard', fullWidth: true, error: error, className: className }, { children: [label && (_jsxs("label", Object.assign({ htmlFor: name, id: labelId }, { children: [label, required && '*', helperText && (_jsx(StyledHelpTextTooltip, Object.assign({ title: helperText, placement: 'top', arrow: true, className: 'help-tooltip' }, { children: _jsx(HelpOutlineIcon, {}) })))] }))), _jsx(OutlinedInput, Object.assign({}, passThroughProps, { ref: InputProps === null || InputProps === void 0 ? void 0 : InputProps.ref, name: name, type: type, size: size, multiline: multiline, maxRows: maxRows, placeholder: placeholder, defaultValue: defaultValue, value: value, disabled: disabled, onBlur: onBlur, error: error, className: 'input-field', margin: margin, inputProps: inputProps, startAdornment: InputProps === null || InputProps === void 0 ? void 0 : InputProps.startAdornment, endAdornment: InputProps === null || InputProps === void 0 ? void 0 : InputProps.endAdornment, inputRef: inputRef })), error && errorMsg && (_jsx(FormHelperText, Object.assign({ className: 'helper-error' }, { children: errorMsg })))] })));
|
|
23
37
|
};
|