@axdspub/axiom-ui-forms 0.3.3 → 0.3.4
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/library/axiom-ui-forms.d.ts +32 -15
- package/library/esm/_virtual/index10.js +2 -2
- package/library/esm/_virtual/index11.js +2 -2
- package/library/esm/_virtual/index12.js +2 -2
- package/library/esm/_virtual/index4.js +2 -2
- package/library/esm/_virtual/index5.js +2 -2
- package/library/esm/_virtual/index9.js +2 -2
- package/library/esm/node_modules/@axdspub/axiom-maps/library/index.js +1 -1
- package/library/esm/node_modules/@axdspub/axiom-maps/library/openlayers/index.esm.js +1 -1
- package/library/esm/node_modules/@axdspub/axiom-maps/node_modules/@axdspub/axiom-ui-utilities/library/index.js +15219 -0
- package/library/esm/node_modules/@axdspub/axiom-maps/node_modules/@axdspub/axiom-ui-utilities/library/index.js.map +1 -0
- package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js +122 -90
- package/library/esm/node_modules/@axdspub/axiom-ui-utilities/library/index.js.map +1 -1
- package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js +23 -1
- package/library/esm/node_modules/@radix-ui/react-icons/dist/react-icons.esm.js.map +1 -1
- package/library/esm/node_modules/ajv/dist/compile/codegen/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/compile/validate/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/applicator/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/core/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/format/index.js +1 -1
- package/library/esm/node_modules/ajv/dist/vocabularies/validation/index.js +1 -1
- package/library/esm/node_modules/lodash-es/_SetCache.js +28 -0
- package/library/esm/node_modules/lodash-es/_SetCache.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_arrayLikeKeys.js +8 -1
- package/library/esm/node_modules/lodash-es/_arrayLikeKeys.js.map +1 -1
- package/library/esm/node_modules/lodash-es/_arraySome.js +24 -0
- package/library/esm/node_modules/lodash-es/_arraySome.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_baseIsEqual.js +29 -0
- package/library/esm/node_modules/lodash-es/_baseIsEqual.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_baseIsEqualDeep.js +84 -0
- package/library/esm/node_modules/lodash-es/_baseIsEqualDeep.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_baseKeys.js +31 -0
- package/library/esm/node_modules/lodash-es/_baseKeys.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_baseTrim.js +20 -0
- package/library/esm/node_modules/lodash-es/_baseTrim.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_cacheHas.js +14 -0
- package/library/esm/node_modules/lodash-es/_cacheHas.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_equalArrays.js +85 -0
- package/library/esm/node_modules/lodash-es/_equalArrays.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_equalByTag.js +113 -0
- package/library/esm/node_modules/lodash-es/_equalByTag.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_equalObjects.js +91 -0
- package/library/esm/node_modules/lodash-es/_equalObjects.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_getAllKeys.js +17 -0
- package/library/esm/node_modules/lodash-es/_getAllKeys.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_mapToArray.js +19 -0
- package/library/esm/node_modules/lodash-es/_mapToArray.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_nativeKeys.js +7 -0
- package/library/esm/node_modules/lodash-es/_nativeKeys.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_setCacheAdd.js +20 -0
- package/library/esm/node_modules/lodash-es/_setCacheAdd.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_setCacheHas.js +15 -0
- package/library/esm/node_modules/lodash-es/_setCacheHas.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_setToArray.js +19 -0
- package/library/esm/node_modules/lodash-es/_setToArray.js.map +1 -0
- package/library/esm/node_modules/lodash-es/_trimmedEndIndex.js +20 -0
- package/library/esm/node_modules/lodash-es/_trimmedEndIndex.js.map +1 -0
- package/library/esm/node_modules/lodash-es/debounce.js +192 -0
- package/library/esm/node_modules/lodash-es/debounce.js.map +1 -0
- package/library/esm/node_modules/lodash-es/isEqual.js +36 -0
- package/library/esm/node_modules/lodash-es/isEqual.js.map +1 -0
- package/library/esm/node_modules/lodash-es/keys.js +38 -0
- package/library/esm/node_modules/lodash-es/keys.js.map +1 -0
- package/library/esm/node_modules/lodash-es/keysIn.js +1 -1
- package/library/esm/node_modules/lodash-es/keysIn.js.map +1 -1
- package/library/esm/node_modules/lodash-es/now.js +24 -0
- package/library/esm/node_modules/lodash-es/now.js.map +1 -0
- package/library/esm/node_modules/lodash-es/toNumber.js +65 -0
- package/library/esm/node_modules/lodash-es/toNumber.js.map +1 -0
- package/library/esm/src/Form/Components/FieldCreator.js +25 -14
- package/library/esm/src/Form/Components/FieldCreator.js.map +1 -1
- package/library/esm/src/Form/Components/FieldLabel.js +27 -13
- package/library/esm/src/Form/Components/FieldLabel.js.map +1 -1
- package/library/esm/src/Form/Components/InlineMarkdown.js +4 -0
- package/library/esm/src/Form/Components/InlineMarkdown.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Boolean.js +4 -5
- package/library/esm/src/Form/Components/Inputs/Boolean.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Date.js +3 -4
- package/library/esm/src/Form/Components/Inputs/Date.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/DateTime.js +3 -4
- package/library/esm/src/Form/Components/Inputs/DateTime.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/GeoJSON.js +5 -4
- package/library/esm/src/Form/Components/Inputs/GeoJSON.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Geometry.js +20 -11
- package/library/esm/src/Form/Components/Inputs/Geometry.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/JSON.js +6 -5
- package/library/esm/src/Form/Components/Inputs/JSON.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/LongString.js +5 -5
- package/library/esm/src/Form/Components/Inputs/LongString.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Number.js +48 -33
- package/library/esm/src/Form/Components/Inputs/Number.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Object.js +16 -6
- package/library/esm/src/Form/Components/Inputs/Object.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/RadioGroup.js +2 -3
- package/library/esm/src/Form/Components/Inputs/RadioGroup.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/SingleSelect.js +2 -3
- package/library/esm/src/Form/Components/Inputs/SingleSelect.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/String.js +5 -11
- package/library/esm/src/Form/Components/Inputs/String.js.map +1 -1
- package/library/esm/src/Form/Components/Inputs/Time.js +2 -3
- package/library/esm/src/Form/Components/Inputs/Time.js.map +1 -1
- package/library/esm/src/Form/Creator/FormCreator.js +2 -2
- package/library/esm/src/Form/Creator/FormCreator.js.map +1 -1
- package/library/esm/src/Form/Creator/FormSection.js +1 -1
- package/library/esm/src/Form/Creator/FormSection.js.map +1 -1
- package/library/esm/src/Form/Creator/Page.js +7 -2
- package/library/esm/src/Form/Creator/Page.js.map +1 -1
- package/library/esm/src/Form/Creator/Wizard.js +3 -3
- package/library/esm/src/Form/Creator/Wizard.js.map +1 -1
- package/library/esm/src/utils/helpers.js +11 -0
- package/library/esm/src/utils/helpers.js.map +1 -0
- package/library/esm/src/utils/manipulators.js +4 -1
- package/library/esm/src/utils/manipulators.js.map +1 -1
- package/library/esm/src/utils/schemaToFormHelpers.js +2 -2
- package/library/esm/src/utils/schemaToFormHelpers.js.map +1 -1
- package/library/esm/src/utils/validators.js +82 -15
- package/library/esm/src/utils/validators.js.map +1 -1
- package/package.json +3 -3
@@ -21,9 +21,19 @@ type IValueType = undefined | null | ValueOf<IValueTypes>;
|
|
21
21
|
type IFormField = ITextField | IConstantField | INumberField | ILongTextField | IJSONField | ISelectField | IRadioField | ICheckboxField | IDateField | ITimeField | IDateTimeField | IBooleanField | IObjectField | IObjectListField | IOneOfField | IGeoJSONField | IGeometryField | IFormFieldSection | ICustomField;
|
22
22
|
type IFormFieldType = 'text' | 'long_text' | 'number' | 'json' | 'select' | 'radio' | 'checkbox' | 'date' | 'time' | 'datetime' | 'boolean' | 'object' | 'objectList' | 'oneOf' | 'geojson' | 'geometry' | `custom:${string}`;
|
23
23
|
type ISectionFormFieldType = 'section' | 'page';
|
24
|
-
|
25
|
-
|
24
|
+
type IFieldConditionResult = 'exclude' | 'include' | 'disable' | 'enable';
|
25
|
+
interface IFieldConditionsSet {
|
26
|
+
logic?: 'and' | 'or';
|
27
|
+
conditions: Array<Omit<IFieldCondition, 'result'>>;
|
28
|
+
result?: IFieldConditionResult;
|
29
|
+
}
|
30
|
+
type IFieldConditionOperator = '=' | 'eq' | '>' | 'gt' | '>=' | 'gte' | '<' | 'lt' | '<=' | 'lte' | '!=' | '!eq';
|
31
|
+
interface IFieldCondition {
|
32
|
+
dependsOn?: string | string[];
|
33
|
+
field?: string | string[];
|
26
34
|
value: string | number | boolean;
|
35
|
+
operator?: IFieldConditionOperator;
|
36
|
+
result?: IFieldConditionResult;
|
27
37
|
}
|
28
38
|
type IFieldConstraints = Record<string, unknown>;
|
29
39
|
interface IFormFieldRoot {
|
@@ -39,7 +49,8 @@ interface IFormFieldRoot {
|
|
39
49
|
level?: number;
|
40
50
|
index?: number;
|
41
51
|
defaultValue?: IValueType | IValueType[];
|
42
|
-
conditions?:
|
52
|
+
conditions?: IFieldCondition;
|
53
|
+
conditionsSet?: IFieldConditionsSet;
|
43
54
|
constraints?: IFieldConstraints;
|
44
55
|
settings?: Record<string, unknown>;
|
45
56
|
}
|
@@ -263,6 +274,7 @@ interface IFieldInputProps {
|
|
263
274
|
onChange: IValueChangeFn;
|
264
275
|
value?: IValueType;
|
265
276
|
className?: string;
|
277
|
+
disabled?: boolean;
|
266
278
|
}
|
267
279
|
|
268
280
|
/**
|
@@ -387,8 +399,12 @@ type IFormSectionStatus = Record<string, {
|
|
387
399
|
valid: boolean;
|
388
400
|
}>;
|
389
401
|
|
390
|
-
|
391
|
-
|
402
|
+
interface ICheckConditionResult {
|
403
|
+
pass: boolean;
|
404
|
+
result: IFieldConditionResult;
|
405
|
+
}
|
406
|
+
declare const checkCondition: (field: IFormField, formValues: IFormValues) => ICheckConditionResult;
|
407
|
+
declare const calculateSectionStatus: (sections: IFormSection[], formValues: IFormValues) => IFormSectionStatus;
|
392
408
|
|
393
409
|
declare const validators_calculateSectionStatus: typeof calculateSectionStatus;
|
394
410
|
declare const validators_checkCondition: typeof checkCondition;
|
@@ -439,28 +455,29 @@ interface IFieldCreator {
|
|
439
455
|
className?: string;
|
440
456
|
defaultClassName?: string;
|
441
457
|
value?: IValueType | IValueType[];
|
458
|
+
disabled?: boolean;
|
442
459
|
}
|
443
|
-
declare const FieldCreator: ({ field, value, onChange, className, defaultClassName }: IFieldCreator) => ReactElement | null;
|
460
|
+
declare const FieldCreator: ({ field, value, onChange, className, disabled, defaultClassName }: IFieldCreator) => ReactElement | null;
|
444
461
|
|
445
|
-
declare const BooleanInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
462
|
+
declare const BooleanInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
446
463
|
|
447
464
|
declare const JSONInputLoader: (props: IFieldInputProps) => ReactElement;
|
448
465
|
|
449
|
-
declare const NumberInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
466
|
+
declare const NumberInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
450
467
|
|
451
|
-
declare const StringInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
468
|
+
declare const StringInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
452
469
|
|
453
|
-
declare const LongStringInput: ({ field, onChange, value, className }: IFieldInputProps) => ReactElement;
|
470
|
+
declare const LongStringInput: ({ field, onChange, value, className, disabled }: IFieldInputProps) => ReactElement;
|
454
471
|
|
455
|
-
declare const SingleSelectInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
472
|
+
declare const SingleSelectInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
456
473
|
|
457
474
|
declare const GeoJSONInputLoader: (props: IFieldInputProps) => ReactElement;
|
458
475
|
|
459
|
-
declare const DateTimeInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
476
|
+
declare const DateTimeInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
460
477
|
|
461
|
-
declare const DateInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
478
|
+
declare const DateInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
462
479
|
|
463
|
-
declare const TimeInput: ({ field, onChange, value }: IFieldInputProps) => ReactElement;
|
480
|
+
declare const TimeInput: ({ field, onChange, value, disabled }: IFieldInputProps) => ReactElement;
|
464
481
|
|
465
482
|
declare const index_BooleanInput: typeof BooleanInput;
|
466
483
|
declare const index_DateInput: typeof DateInput;
|
@@ -471,4 +488,4 @@ declare namespace index {
|
|
471
488
|
export { index_BooleanInput as BooleanInput, index_DateInput as DateInput, index_DateTimeInput as DateTimeInput, GeoJSONInputLoader as GeoJSONInput, JSONInputLoader as JSONInput, LongStringInput as LongTextInput, index_NumberInput as NumberInput, SingleSelectInput as SelectInput, StringInput as TextInput, index_TimeInput as TimeInput };
|
472
489
|
}
|
473
490
|
|
474
|
-
export { FieldCreator, FormCreator, type IBooleanField, type ICheckboxField, type ICompositeValueType, type IConstantField, type IFieldInputProps, type IForm, type IFormField, type IFormFieldOverride, type IFormFieldPage, type IFormFieldProps, type IFormFieldSection, type IFormFieldType, type IFormInputComponent, type IFormOverride, type IFormSection, type IFormSectionOverride, type IFormSettings, type IFormValueState, type IFormValues, type IFormWithPages, type IGeoJSONField, type IGeometryField, type IJSONField, type INumberField, type IObjectField, type IObjectFormFieldOverride, type IObjectListField, type IOneOfField, type IPage, type IRadioField, type ISectionFormFieldType, type ISelectField, type IValidContainerField, type IValueChangeFn, type IValueType, type IWizardStep, index as Inputs, getters, manipulators, schemaToFormHelpers as schemToFormHelpers, schemaToFormHelpers as schemaToFormUtils, validators };
|
491
|
+
export { FieldCreator, FormCreator, type IBooleanField, type ICheckboxField, type ICompositeValueType, type IConstantField, type IFieldCondition, type IFieldConditionOperator, type IFieldConditionResult, type IFieldConditionsSet, type IFieldInputProps, type IForm, type IFormField, type IFormFieldOverride, type IFormFieldPage, type IFormFieldProps, type IFormFieldSection, type IFormFieldType, type IFormInputComponent, type IFormOverride, type IFormSection, type IFormSectionOverride, type IFormSettings, type IFormValueState, type IFormValues, type IFormWithPages, type IGeoJSONField, type IGeometryField, type IJSONField, type INumberField, type IObjectField, type IObjectFormFieldOverride, type IObjectListField, type IOneOfField, type IPage, type IRadioField, type ISectionFormFieldType, type ISelectField, type ITextField, type IValidContainerField, type IValueChangeFn, type IValueType, type IWizardStep, index as Inputs, getters, manipulators, schemaToFormHelpers as schemToFormHelpers, schemaToFormHelpers as schemaToFormUtils, validators };
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import { EventWithData, EventManager } from '
|
1
|
+
import { EventWithData, EventManager } from '../node_modules/@axdspub/axiom-ui-utilities/library/index.js';
|
2
2
|
import { createContext } from 'react';
|
3
3
|
|
4
4
|
/******************************************************************************
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import global from '../../../../../_virtual/_polyfill-node.global.js';
|
2
2
|
import browser$1 from '../../../../../_virtual/_polyfill-node.process.js';
|
3
|
-
import { utils as index$1, EventManager, EventWithData } from '
|
3
|
+
import { utils as index$1, EventManager, EventWithData } from '../../node_modules/@axdspub/axiom-ui-utilities/library/index.js';
|
4
4
|
import React__default, { useRef, useState, useEffect, createContext } from 'react';
|
5
5
|
import omit from '../../../../lodash-es/omit.js';
|
6
6
|
import pick from '../../../../lodash-es/pick.js';
|