@norges-domstoler/dds-components 10.3.2 → 10.4.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.
- package/dist/cjs/components/FormGenerator/FormGenerator.types.d.ts +58 -28
- package/dist/cjs/components/InputMessage/InputMessage.d.ts +1 -1
- package/dist/cjs/components/Table/collapsible/CollapsibleRow.d.ts +1 -1
- package/dist/cjs/components/Table/collapsible/CollapsibleTable.stories.d.ts +1 -1
- package/dist/cjs/hooks/useFloatPosition.d.ts +2 -0
- package/dist/cjs/index.js +118 -90
- package/dist/components/FileUploader/useFileUploader.js +54 -58
- package/dist/components/FormGenerator/FormGenerator.js +32 -31
- package/dist/components/FormGenerator/FormGenerator.types.d.ts +58 -28
- package/dist/components/FormGenerator/FormGenerator.types.js +33 -0
- package/dist/components/InputMessage/InputMessage.d.ts +1 -1
- package/dist/components/Table/collapsible/CollapsibleRow.d.ts +1 -1
- package/dist/components/Table/collapsible/CollapsibleTable.stories.d.ts +1 -1
- package/dist/components/TextInput/TextInput.styles.js +1 -1
- package/dist/hooks/useFloatPosition.d.ts +2 -0
- package/dist/index.js +1 -0
- package/package.json +5 -3
|
@@ -28,164 +28,194 @@ export type FormGeneratorRow = {
|
|
|
28
28
|
breakpoint?: ScreenSize;
|
|
29
29
|
fields: FormGeneratorField[];
|
|
30
30
|
};
|
|
31
|
+
export declare enum FormGeneratorSupportedFields {
|
|
32
|
+
Button = "Button",
|
|
33
|
+
Card = "Card",
|
|
34
|
+
Checkbox = "Checkbox",
|
|
35
|
+
CheckboxGroup = "CheckboxGroup",
|
|
36
|
+
Datepicker = "Datepicker",
|
|
37
|
+
DescriptionList = "DescriptionList",
|
|
38
|
+
DescriptionListGroup = "DescriptionListGroup",
|
|
39
|
+
DescriptionListDesc = "DescriptionListDesc",
|
|
40
|
+
DescriptionListTerm = "DescriptionListTerm",
|
|
41
|
+
Divider = "Divider",
|
|
42
|
+
GlobalMessage = "GlobalMessage",
|
|
43
|
+
Heading = "Heading",
|
|
44
|
+
InputMessage = "InputMessage",
|
|
45
|
+
Label = "Label",
|
|
46
|
+
Link = "Link",
|
|
47
|
+
List = "List",
|
|
48
|
+
ListItem = "ListItem",
|
|
49
|
+
LocalMessage = "LocalMessage",
|
|
50
|
+
Paragraph = "Paragraph",
|
|
51
|
+
RadioButton = "RadioButton",
|
|
52
|
+
RadioButtonGroup = "RadioButtonGroup",
|
|
53
|
+
Select = "Select",
|
|
54
|
+
Spinner = "Spinner",
|
|
55
|
+
TextInput = "TextInput",
|
|
56
|
+
ToggleButton = "ToggleButton",
|
|
57
|
+
ToggleButtonGroup = "ToggleButtonGroup",
|
|
58
|
+
Typography = "Typography",
|
|
59
|
+
VisuallyHidden = "VisuallyHidden"
|
|
60
|
+
}
|
|
31
61
|
export type FormGeneratorField = FieldWithChildren | FieldWithoutChildren;
|
|
32
62
|
type FieldWithChildren = CheckboxGroupField | DescriptionListField | DescriptionListGroupField | ListField | RadioButtonGroupField | ToggleButtonGroupField;
|
|
33
63
|
type FieldWithoutChildren = ButtonField | CardField | CheckboxField | DatepickerField | DescriptionListTermField | DescriptionListDescField | DividerField | GlobalMessageField | HeadingField | InputMessageField | LabelField | LinkField | ListItemField | LocalMessageField | ParagraphField | RadioButtonField | SelectField | SpinnerField | TextInputField | ToggleButtonField | TypographyField | VisuallyHiddenField;
|
|
34
64
|
type ButtonField = {
|
|
35
|
-
component:
|
|
65
|
+
component: FormGeneratorSupportedFields.Button;
|
|
36
66
|
props: ButtonProps;
|
|
37
67
|
hide?: boolean;
|
|
38
68
|
};
|
|
39
69
|
type CardField = {
|
|
40
|
-
component:
|
|
70
|
+
component: FormGeneratorSupportedFields.Card;
|
|
41
71
|
props: CardProps;
|
|
42
72
|
hide?: boolean;
|
|
43
73
|
innerHTML: JSX.Element | string;
|
|
44
74
|
};
|
|
45
75
|
type CheckboxField = {
|
|
46
|
-
component:
|
|
76
|
+
component: FormGeneratorSupportedFields.Checkbox;
|
|
47
77
|
props: CheckboxProps;
|
|
48
78
|
hide?: boolean;
|
|
49
79
|
};
|
|
50
80
|
type CheckboxGroupField = {
|
|
51
|
-
component:
|
|
81
|
+
component: FormGeneratorSupportedFields.CheckboxGroup;
|
|
52
82
|
props: CheckboxGroupProps;
|
|
53
83
|
hide?: boolean;
|
|
54
84
|
children: CheckboxField[];
|
|
55
85
|
};
|
|
56
86
|
type DatepickerField = {
|
|
57
|
-
component:
|
|
87
|
+
component: FormGeneratorSupportedFields.Datepicker;
|
|
58
88
|
props: DatepickerProps;
|
|
59
89
|
hide?: boolean;
|
|
60
90
|
};
|
|
61
91
|
type DescriptionListField = {
|
|
62
|
-
component:
|
|
92
|
+
component: FormGeneratorSupportedFields.DescriptionList;
|
|
63
93
|
props: DescriptionListProps;
|
|
64
94
|
hide?: boolean;
|
|
65
95
|
children: DescriptionListGroupField[];
|
|
66
96
|
};
|
|
67
97
|
type DescriptionListGroupField = {
|
|
68
|
-
component:
|
|
98
|
+
component: FormGeneratorSupportedFields.DescriptionListGroup;
|
|
69
99
|
props: DescriptionListGroupProps;
|
|
70
100
|
hide?: boolean;
|
|
71
101
|
children: (DescriptionListTermField | DescriptionListDescField)[];
|
|
72
102
|
};
|
|
73
103
|
type DescriptionListTermField = {
|
|
74
|
-
component:
|
|
104
|
+
component: FormGeneratorSupportedFields.DescriptionListTerm;
|
|
75
105
|
props: DescriptionListTermProps;
|
|
76
106
|
hide?: boolean;
|
|
77
107
|
innerHTML: JSX.Element | string;
|
|
78
108
|
};
|
|
79
109
|
type DescriptionListDescField = {
|
|
80
|
-
component:
|
|
110
|
+
component: FormGeneratorSupportedFields.DescriptionListDesc;
|
|
81
111
|
props: DescriptionListDescProps;
|
|
82
112
|
hide?: boolean;
|
|
83
113
|
innerHTML: JSX.Element | string;
|
|
84
114
|
};
|
|
85
115
|
type DividerField = {
|
|
86
|
-
component:
|
|
116
|
+
component: FormGeneratorSupportedFields.Divider;
|
|
87
117
|
props: DividerProps;
|
|
88
118
|
hide?: boolean;
|
|
89
119
|
};
|
|
90
120
|
type GlobalMessageField = {
|
|
91
|
-
component:
|
|
121
|
+
component: FormGeneratorSupportedFields.GlobalMessage;
|
|
92
122
|
props: GlobalMessageProps;
|
|
93
123
|
hide?: boolean;
|
|
94
124
|
innerHTML?: JSX.Element | string;
|
|
95
125
|
};
|
|
96
126
|
type HeadingField = {
|
|
97
|
-
component:
|
|
127
|
+
component: FormGeneratorSupportedFields.Heading;
|
|
98
128
|
props: HeadingProps;
|
|
99
129
|
hide?: boolean;
|
|
100
130
|
innerHTML?: JSX.Element | string;
|
|
101
131
|
};
|
|
102
132
|
type InputMessageField = {
|
|
103
|
-
component:
|
|
133
|
+
component: FormGeneratorSupportedFields.InputMessage;
|
|
104
134
|
props: InputMessageProps;
|
|
105
135
|
hide?: boolean;
|
|
106
136
|
};
|
|
107
137
|
type LabelField = {
|
|
108
|
-
component:
|
|
138
|
+
component: FormGeneratorSupportedFields.Label;
|
|
109
139
|
props: LabelProps;
|
|
110
140
|
hide?: boolean;
|
|
111
141
|
innerHTML?: JSX.Element | string;
|
|
112
142
|
};
|
|
113
143
|
type LinkField = {
|
|
114
|
-
component:
|
|
144
|
+
component: FormGeneratorSupportedFields.Link;
|
|
115
145
|
props: LinkProps;
|
|
116
146
|
hide?: boolean;
|
|
117
147
|
innerHTML?: JSX.Element | string;
|
|
118
148
|
};
|
|
119
149
|
type ListItemField = {
|
|
120
|
-
component:
|
|
150
|
+
component: FormGeneratorSupportedFields.ListItem;
|
|
121
151
|
props?: ListItemProps;
|
|
122
152
|
hide?: boolean;
|
|
123
153
|
innerHTML?: JSX.Element | string;
|
|
124
154
|
};
|
|
125
155
|
type ListField = {
|
|
126
|
-
component:
|
|
156
|
+
component: FormGeneratorSupportedFields.List;
|
|
127
157
|
props?: ListProps;
|
|
128
158
|
hide?: boolean;
|
|
129
159
|
children: ListItemField[];
|
|
130
160
|
};
|
|
131
161
|
type LocalMessageField = {
|
|
132
|
-
component:
|
|
162
|
+
component: FormGeneratorSupportedFields.LocalMessage;
|
|
133
163
|
props: LocalMessageProps;
|
|
134
164
|
hide?: boolean;
|
|
135
165
|
innerHTML?: JSX.Element | string;
|
|
136
166
|
};
|
|
137
167
|
type ParagraphField = {
|
|
138
|
-
component:
|
|
168
|
+
component: FormGeneratorSupportedFields.Paragraph;
|
|
139
169
|
props: ParagraphProps;
|
|
140
170
|
hide?: boolean;
|
|
141
171
|
innerHTML?: JSX.Element | string;
|
|
142
172
|
};
|
|
143
173
|
type RadioButtonField = {
|
|
144
|
-
component:
|
|
174
|
+
component: FormGeneratorSupportedFields.RadioButton;
|
|
145
175
|
props: RadioButtonProps;
|
|
146
176
|
hide?: boolean;
|
|
147
177
|
};
|
|
148
178
|
type RadioButtonGroupField = {
|
|
149
|
-
component:
|
|
179
|
+
component: FormGeneratorSupportedFields.RadioButtonGroup;
|
|
150
180
|
props: RadioButtonGroupProps<string | number>;
|
|
151
181
|
hide?: boolean;
|
|
152
182
|
children: RadioButtonField[];
|
|
153
183
|
};
|
|
154
184
|
type SelectField = {
|
|
155
|
-
component:
|
|
185
|
+
component: FormGeneratorSupportedFields.Select;
|
|
156
186
|
props: SelectProps<SelectOption<unknown>, boolean>;
|
|
157
187
|
name: string;
|
|
158
188
|
hide?: boolean;
|
|
159
189
|
};
|
|
160
190
|
type SpinnerField = {
|
|
161
|
-
component:
|
|
191
|
+
component: FormGeneratorSupportedFields.Spinner;
|
|
162
192
|
props: SpinnerProps;
|
|
163
193
|
hide?: boolean;
|
|
164
194
|
};
|
|
165
195
|
type TextInputField = {
|
|
166
|
-
component:
|
|
196
|
+
component: FormGeneratorSupportedFields.TextInput;
|
|
167
197
|
props: TextInputProps;
|
|
168
198
|
hide?: boolean;
|
|
169
199
|
};
|
|
170
200
|
type ToggleButtonField = {
|
|
171
|
-
component:
|
|
201
|
+
component: FormGeneratorSupportedFields.ToggleButton;
|
|
172
202
|
props: ToggleButtonProps;
|
|
173
203
|
hide?: boolean;
|
|
174
204
|
};
|
|
175
205
|
type ToggleButtonGroupField = {
|
|
176
|
-
component:
|
|
206
|
+
component: FormGeneratorSupportedFields.ToggleButtonGroup;
|
|
177
207
|
props: ToggleButtonGroupProps;
|
|
178
208
|
hide?: boolean;
|
|
179
209
|
children: ToggleButtonField[];
|
|
180
210
|
};
|
|
181
211
|
type TypographyField = {
|
|
182
|
-
component:
|
|
212
|
+
component: FormGeneratorSupportedFields.Typography;
|
|
183
213
|
props: TypographyProps;
|
|
184
214
|
hide?: boolean;
|
|
185
215
|
innerHTML: JSX.Element | string;
|
|
186
216
|
};
|
|
187
217
|
type VisuallyHiddenField = {
|
|
188
|
-
component:
|
|
218
|
+
component: FormGeneratorSupportedFields.VisuallyHidden;
|
|
189
219
|
props: VisuallyHiddenProps;
|
|
190
220
|
hide?: boolean;
|
|
191
221
|
innerHTML: JSX.Element | string;
|
|
@@ -12,5 +12,5 @@ export declare const InputMessage: import("react").ForwardRefExoticComponent<Pic
|
|
|
12
12
|
/** Formålet med meldingen. Påvirker styling. */
|
|
13
13
|
messageType: InputMessageType;
|
|
14
14
|
} & {
|
|
15
|
-
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
|
|
15
|
+
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined; /** Meldingen som vises til brukeren. */
|
|
16
16
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CollapsibleRow: import("react").ForwardRefExoticComponent<{
|
|
2
|
-
type?: import("
|
|
2
|
+
type?: import("..").TableRowType | undefined;
|
|
3
3
|
mode?: import("../Table.types").RowMode | undefined;
|
|
4
4
|
selected?: boolean | undefined;
|
|
5
5
|
hoverable?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ export default _default;
|
|
|
39
39
|
export declare const SingleDefiningColumn: (args: CollapsibleTableProps) => JSX.Element;
|
|
40
40
|
export declare const MultipleDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
41
41
|
export declare const PrioritizedDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const WithDividers: (args: CollapsibleTableProps) => JSX.Element;
|
|
43
43
|
export declare const Compact: (args: CollapsibleTableProps) => JSX.Element;
|
|
44
44
|
export declare const StickyHeader: (args: CollapsibleTableProps) => JSX.Element;
|
|
45
45
|
export declare const WithButtonAndIcons: (args: CollapsibleTableProps) => JSX.Element;
|
|
@@ -26,6 +26,8 @@ export declare const useFloatPosition: (arrowRef: HTMLElement | null, options?:
|
|
|
26
26
|
refs: {
|
|
27
27
|
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
28
28
|
floating: import("react").MutableRefObject<HTMLElement | null>;
|
|
29
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
30
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
29
31
|
};
|
|
30
32
|
styles: {
|
|
31
33
|
floating: {
|
package/dist/cjs/index.js
CHANGED
|
@@ -3802,7 +3802,7 @@ var StyledIcon$3 = styled__default.default(Icon).withConfig({
|
|
|
3802
3802
|
})(["position:absolute;color:", ";", " z-index:1;"], icon$8.color, function (_ref) {
|
|
3803
3803
|
var size = _ref.size,
|
|
3804
3804
|
iconSize = _ref.iconSize;
|
|
3805
|
-
return styled.css(["left:", ";", ""], icon$8.sizes[size].left, iconSize === 'small' ? styled.css(["top:", ";"], "calc(50% - ".concat(iconSizes$4.DdsIconsizeSmallNumberPx / 2, "px)")) : styled.css(["top:", "
|
|
3805
|
+
return styled.css(["left:", ";", ""], icon$8.sizes[size].left, iconSize === 'small' ? styled.css(["top:", ";"], "calc(50% - ".concat(iconSizes$4.DdsIconsizeSmallNumberPx / 2, "px)")) : styled.css(["top:", ";"], "calc(50% - ".concat(iconSizes$4.DdsIconsizeMediumNumberPx / 2, "px)")));
|
|
3806
3806
|
});
|
|
3807
3807
|
var StyledInput$1 = styled__default.default(StatefulInput).withConfig({
|
|
3808
3808
|
displayName: "TextInputstyles__StyledInput",
|
|
@@ -10639,6 +10639,38 @@ var VStack = /*#__PURE__*/React.forwardRef(function (_a, ref) {
|
|
|
10639
10639
|
}, getBaseHTMLProps(id, className, htmlProps, rest)));
|
|
10640
10640
|
});
|
|
10641
10641
|
|
|
10642
|
+
exports.FormGeneratorSupportedFields = void 0;
|
|
10643
|
+
(function (FormGeneratorSupportedFields) {
|
|
10644
|
+
FormGeneratorSupportedFields["Button"] = "Button";
|
|
10645
|
+
FormGeneratorSupportedFields["Card"] = "Card";
|
|
10646
|
+
FormGeneratorSupportedFields["Checkbox"] = "Checkbox";
|
|
10647
|
+
FormGeneratorSupportedFields["CheckboxGroup"] = "CheckboxGroup";
|
|
10648
|
+
FormGeneratorSupportedFields["Datepicker"] = "Datepicker";
|
|
10649
|
+
FormGeneratorSupportedFields["DescriptionList"] = "DescriptionList";
|
|
10650
|
+
FormGeneratorSupportedFields["DescriptionListGroup"] = "DescriptionListGroup";
|
|
10651
|
+
FormGeneratorSupportedFields["DescriptionListDesc"] = "DescriptionListDesc";
|
|
10652
|
+
FormGeneratorSupportedFields["DescriptionListTerm"] = "DescriptionListTerm";
|
|
10653
|
+
FormGeneratorSupportedFields["Divider"] = "Divider";
|
|
10654
|
+
FormGeneratorSupportedFields["GlobalMessage"] = "GlobalMessage";
|
|
10655
|
+
FormGeneratorSupportedFields["Heading"] = "Heading";
|
|
10656
|
+
FormGeneratorSupportedFields["InputMessage"] = "InputMessage";
|
|
10657
|
+
FormGeneratorSupportedFields["Label"] = "Label";
|
|
10658
|
+
FormGeneratorSupportedFields["Link"] = "Link";
|
|
10659
|
+
FormGeneratorSupportedFields["List"] = "List";
|
|
10660
|
+
FormGeneratorSupportedFields["ListItem"] = "ListItem";
|
|
10661
|
+
FormGeneratorSupportedFields["LocalMessage"] = "LocalMessage";
|
|
10662
|
+
FormGeneratorSupportedFields["Paragraph"] = "Paragraph";
|
|
10663
|
+
FormGeneratorSupportedFields["RadioButton"] = "RadioButton";
|
|
10664
|
+
FormGeneratorSupportedFields["RadioButtonGroup"] = "RadioButtonGroup";
|
|
10665
|
+
FormGeneratorSupportedFields["Select"] = "Select";
|
|
10666
|
+
FormGeneratorSupportedFields["Spinner"] = "Spinner";
|
|
10667
|
+
FormGeneratorSupportedFields["TextInput"] = "TextInput";
|
|
10668
|
+
FormGeneratorSupportedFields["ToggleButton"] = "ToggleButton";
|
|
10669
|
+
FormGeneratorSupportedFields["ToggleButtonGroup"] = "ToggleButtonGroup";
|
|
10670
|
+
FormGeneratorSupportedFields["Typography"] = "Typography";
|
|
10671
|
+
FormGeneratorSupportedFields["VisuallyHidden"] = "VisuallyHidden";
|
|
10672
|
+
})(exports.FormGeneratorSupportedFields || (exports.FormGeneratorSupportedFields = {}));
|
|
10673
|
+
|
|
10642
10674
|
var _columnGaps;
|
|
10643
10675
|
var Spacing = ddsDesignTokens.ddsBaseTokens.spacing;
|
|
10644
10676
|
var formGeneratorTokens = {
|
|
@@ -10726,136 +10758,136 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
10726
10758
|
};
|
|
10727
10759
|
var GetComponent = function GetComponent(field, index) {
|
|
10728
10760
|
switch (field.component) {
|
|
10729
|
-
case
|
|
10761
|
+
case exports.FormGeneratorSupportedFields.Button:
|
|
10730
10762
|
return /*#__PURE__*/React.createElement(Button$1, Object.assign({}, field.props, {
|
|
10731
10763
|
key: index
|
|
10732
10764
|
}));
|
|
10733
|
-
case
|
|
10765
|
+
case exports.FormGeneratorSupportedFields.Card:
|
|
10734
10766
|
return /*#__PURE__*/React.createElement(Card, Object.assign({}, field.props, {
|
|
10735
10767
|
key: index
|
|
10736
10768
|
}), field.innerHTML);
|
|
10737
|
-
case
|
|
10769
|
+
case exports.FormGeneratorSupportedFields.Checkbox:
|
|
10738
10770
|
return /*#__PURE__*/React.createElement(Checkbox, Object.assign({}, field.props, {
|
|
10739
10771
|
key: index,
|
|
10740
10772
|
onChange: fieldOnChange
|
|
10741
10773
|
}));
|
|
10742
|
-
case
|
|
10774
|
+
case exports.FormGeneratorSupportedFields.CheckboxGroup:
|
|
10743
10775
|
return /*#__PURE__*/React.createElement(CheckboxGroup, Object.assign({}, field.props, {
|
|
10744
10776
|
key: index
|
|
10745
10777
|
}), field.children.map(function (child, childIndex) {
|
|
10746
10778
|
return !child.hide && GetComponent(child, childIndex);
|
|
10747
10779
|
}));
|
|
10748
|
-
case
|
|
10780
|
+
case exports.FormGeneratorSupportedFields.Datepicker:
|
|
10749
10781
|
return /*#__PURE__*/React.createElement(Datepicker, Object.assign({}, field.props, {
|
|
10750
10782
|
key: index,
|
|
10751
10783
|
onChange: fieldOnChange
|
|
10752
10784
|
}));
|
|
10753
|
-
case
|
|
10785
|
+
case exports.FormGeneratorSupportedFields.DescriptionList:
|
|
10754
10786
|
return /*#__PURE__*/React.createElement(DescriptionList, Object.assign({}, field.props, {
|
|
10755
10787
|
key: index
|
|
10756
10788
|
}), field.children.map(function (child, childIndex) {
|
|
10757
10789
|
return !child.hide && GetComponent(child, childIndex);
|
|
10758
10790
|
}));
|
|
10759
|
-
case
|
|
10791
|
+
case exports.FormGeneratorSupportedFields.DescriptionListGroup:
|
|
10760
10792
|
return /*#__PURE__*/React.createElement(DescriptionListGroup, Object.assign({}, field.props, {
|
|
10761
10793
|
key: index
|
|
10762
10794
|
}), field.children.map(function (child, childIndex) {
|
|
10763
10795
|
return !child.hide && GetComponent(child, childIndex);
|
|
10764
10796
|
}));
|
|
10765
|
-
case
|
|
10797
|
+
case exports.FormGeneratorSupportedFields.DescriptionListDesc:
|
|
10766
10798
|
return /*#__PURE__*/React.createElement(DescriptionListDesc, Object.assign({}, field.props, {
|
|
10767
10799
|
key: index
|
|
10768
10800
|
}), field.innerHTML);
|
|
10769
|
-
case
|
|
10801
|
+
case exports.FormGeneratorSupportedFields.DescriptionListTerm:
|
|
10770
10802
|
return /*#__PURE__*/React.createElement(DescriptionListTerm, Object.assign({}, field.props, {
|
|
10771
10803
|
key: index
|
|
10772
10804
|
}), field.innerHTML);
|
|
10773
|
-
case
|
|
10805
|
+
case exports.FormGeneratorSupportedFields.Divider:
|
|
10774
10806
|
return /*#__PURE__*/React.createElement(Divider, Object.assign({}, field.props, {
|
|
10775
10807
|
key: index
|
|
10776
10808
|
}));
|
|
10777
|
-
case
|
|
10809
|
+
case exports.FormGeneratorSupportedFields.GlobalMessage:
|
|
10778
10810
|
return /*#__PURE__*/React.createElement(GlobalMessage, Object.assign({}, field.props, {
|
|
10779
10811
|
key: index
|
|
10780
10812
|
}), field.innerHTML);
|
|
10781
|
-
case
|
|
10813
|
+
case exports.FormGeneratorSupportedFields.Heading:
|
|
10782
10814
|
return /*#__PURE__*/React.createElement(Heading, Object.assign({}, field.props, {
|
|
10783
10815
|
key: index
|
|
10784
10816
|
}), field.innerHTML);
|
|
10785
|
-
case
|
|
10817
|
+
case exports.FormGeneratorSupportedFields.InputMessage:
|
|
10786
10818
|
return /*#__PURE__*/React.createElement(InputMessage, Object.assign({}, field.props, {
|
|
10787
10819
|
key: index
|
|
10788
10820
|
}));
|
|
10789
|
-
case
|
|
10821
|
+
case exports.FormGeneratorSupportedFields.Label:
|
|
10790
10822
|
return /*#__PURE__*/React.createElement(Label$2, Object.assign({}, field.props, {
|
|
10791
10823
|
key: index
|
|
10792
10824
|
}), field.innerHTML);
|
|
10793
|
-
case
|
|
10825
|
+
case exports.FormGeneratorSupportedFields.Link:
|
|
10794
10826
|
return /*#__PURE__*/React.createElement(Link$3, Object.assign({}, field.props, {
|
|
10795
10827
|
key: index
|
|
10796
10828
|
}), field.innerHTML);
|
|
10797
|
-
case
|
|
10829
|
+
case exports.FormGeneratorSupportedFields.List:
|
|
10798
10830
|
return /*#__PURE__*/React.createElement(List, Object.assign({}, field.props, {
|
|
10799
10831
|
key: index
|
|
10800
10832
|
}), field.children.map(function (child, childIndex) {
|
|
10801
10833
|
return !child.hide && GetComponent(child, childIndex);
|
|
10802
10834
|
}));
|
|
10803
|
-
case
|
|
10835
|
+
case exports.FormGeneratorSupportedFields.ListItem:
|
|
10804
10836
|
return /*#__PURE__*/React.createElement(ListItem, Object.assign({}, field.props, {
|
|
10805
10837
|
key: index
|
|
10806
10838
|
}), field.innerHTML);
|
|
10807
|
-
case
|
|
10839
|
+
case exports.FormGeneratorSupportedFields.LocalMessage:
|
|
10808
10840
|
return /*#__PURE__*/React.createElement(LocalMessage, Object.assign({}, field.props, {
|
|
10809
10841
|
key: index
|
|
10810
10842
|
}), field.innerHTML);
|
|
10811
|
-
case
|
|
10843
|
+
case exports.FormGeneratorSupportedFields.Paragraph:
|
|
10812
10844
|
return /*#__PURE__*/React.createElement(Paragraph, Object.assign({}, field.props, {
|
|
10813
10845
|
key: index
|
|
10814
10846
|
}), field.innerHTML);
|
|
10815
|
-
case
|
|
10847
|
+
case exports.FormGeneratorSupportedFields.RadioButton:
|
|
10816
10848
|
return /*#__PURE__*/React.createElement(RadioButton, Object.assign({}, field.props, {
|
|
10817
10849
|
key: index,
|
|
10818
10850
|
onChange: fieldOnChange
|
|
10819
10851
|
}));
|
|
10820
|
-
case
|
|
10852
|
+
case exports.FormGeneratorSupportedFields.RadioButtonGroup:
|
|
10821
10853
|
field.props.direction = screenSize > exports.ScreenSize.XSmall ? 'row' : 'column';
|
|
10822
10854
|
return /*#__PURE__*/React.createElement(RadioButtonGroup, Object.assign({}, field.props, {
|
|
10823
10855
|
key: index
|
|
10824
10856
|
}), field.children.map(function (child, childIndex) {
|
|
10825
10857
|
return !child.hide && GetComponent(child, childIndex);
|
|
10826
10858
|
}));
|
|
10827
|
-
case
|
|
10859
|
+
case exports.FormGeneratorSupportedFields.Select:
|
|
10828
10860
|
return /*#__PURE__*/React.createElement(Select, Object.assign({}, field.props, {
|
|
10829
10861
|
key: index,
|
|
10830
10862
|
onChange: function onChange(option) {
|
|
10831
10863
|
return selectOnChange(option, field.name);
|
|
10832
10864
|
}
|
|
10833
10865
|
}));
|
|
10834
|
-
case
|
|
10866
|
+
case exports.FormGeneratorSupportedFields.Spinner:
|
|
10835
10867
|
return /*#__PURE__*/React.createElement(Spinner, Object.assign({}, field.props, {
|
|
10836
10868
|
key: index
|
|
10837
10869
|
}));
|
|
10838
|
-
case
|
|
10870
|
+
case exports.FormGeneratorSupportedFields.TextInput:
|
|
10839
10871
|
return /*#__PURE__*/React.createElement(TextInput, Object.assign({}, field.props, {
|
|
10840
10872
|
key: index,
|
|
10841
10873
|
onChange: fieldOnChange
|
|
10842
10874
|
}));
|
|
10843
|
-
case
|
|
10875
|
+
case exports.FormGeneratorSupportedFields.ToggleButton:
|
|
10844
10876
|
return /*#__PURE__*/React.createElement(ToggleButton, Object.assign({}, field.props, {
|
|
10845
10877
|
key: index,
|
|
10846
10878
|
onChange: fieldOnChange
|
|
10847
10879
|
}));
|
|
10848
|
-
case
|
|
10880
|
+
case exports.FormGeneratorSupportedFields.ToggleButtonGroup:
|
|
10849
10881
|
return /*#__PURE__*/React.createElement(ToggleButtonGroup, Object.assign({}, field.props, {
|
|
10850
10882
|
key: index
|
|
10851
10883
|
}), field.children.map(function (child, childIndex) {
|
|
10852
10884
|
return !child.hide && GetComponent(child, childIndex);
|
|
10853
10885
|
}));
|
|
10854
|
-
case
|
|
10886
|
+
case exports.FormGeneratorSupportedFields.Typography:
|
|
10855
10887
|
return /*#__PURE__*/React.createElement(Typography, Object.assign({}, field.props, {
|
|
10856
10888
|
key: index
|
|
10857
10889
|
}), field.innerHTML);
|
|
10858
|
-
case
|
|
10890
|
+
case exports.FormGeneratorSupportedFields.VisuallyHidden:
|
|
10859
10891
|
return /*#__PURE__*/React.createElement(VisuallyHidden, Object.assign({}, field.props, {
|
|
10860
10892
|
key: index
|
|
10861
10893
|
}), field.innerHTML);
|
|
@@ -10884,7 +10916,7 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
10884
10916
|
return !field.hide && GetComponent(field, groupedIndex);
|
|
10885
10917
|
})
|
|
10886
10918
|
}))
|
|
10887
|
-
}));
|
|
10919
|
+
}), index);
|
|
10888
10920
|
} else {
|
|
10889
10921
|
return jsxRuntime.jsx(GridChild, Object.assign({
|
|
10890
10922
|
columnsOccupied: "all"
|
|
@@ -10898,14 +10930,14 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
10898
10930
|
return !field.hide && GetComponent(field, groupedIndex);
|
|
10899
10931
|
})
|
|
10900
10932
|
}))
|
|
10901
|
-
}));
|
|
10933
|
+
}), index);
|
|
10902
10934
|
}
|
|
10903
10935
|
} else {
|
|
10904
10936
|
return !obj.hide && jsxRuntime.jsx(GridChild, Object.assign({
|
|
10905
10937
|
columnsOccupied: "all"
|
|
10906
10938
|
}, {
|
|
10907
10939
|
children: GetComponent(obj, index)
|
|
10908
|
-
}));
|
|
10940
|
+
}), index);
|
|
10909
10941
|
}
|
|
10910
10942
|
})
|
|
10911
10943
|
}));
|
|
@@ -11141,32 +11173,30 @@ var useFileUploader = function useFileUploader(props) {
|
|
|
11141
11173
|
return tslib.__awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
11142
11174
|
var files, fileCount;
|
|
11143
11175
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
11144
|
-
while (1) {
|
|
11145
|
-
|
|
11146
|
-
|
|
11147
|
-
|
|
11148
|
-
|
|
11149
|
-
|
|
11150
|
-
|
|
11151
|
-
|
|
11152
|
-
|
|
11153
|
-
|
|
11154
|
-
|
|
11155
|
-
|
|
11156
|
-
|
|
11157
|
-
|
|
11158
|
-
|
|
11159
|
-
|
|
11160
|
-
|
|
11161
|
-
|
|
11162
|
-
|
|
11163
|
-
|
|
11164
|
-
|
|
11165
|
-
|
|
11166
|
-
|
|
11167
|
-
|
|
11168
|
-
return _context.stop();
|
|
11169
|
-
}
|
|
11176
|
+
while (1) switch (_context.prev = _context.next) {
|
|
11177
|
+
case 0:
|
|
11178
|
+
preventDefaults(evt);
|
|
11179
|
+
if (!isEventWithFiles(evt)) {
|
|
11180
|
+
_context.next = 9;
|
|
11181
|
+
break;
|
|
11182
|
+
}
|
|
11183
|
+
_context.next = 4;
|
|
11184
|
+
return fileSelector.fromEvent(evt);
|
|
11185
|
+
case 4:
|
|
11186
|
+
files = _context.sent;
|
|
11187
|
+
fileCount = files.length;
|
|
11188
|
+
if (!(fileCount === 0)) {
|
|
11189
|
+
_context.next = 8;
|
|
11190
|
+
break;
|
|
11191
|
+
}
|
|
11192
|
+
return _context.abrupt("return");
|
|
11193
|
+
case 8:
|
|
11194
|
+
dispatch({
|
|
11195
|
+
type: 'dragEnter'
|
|
11196
|
+
});
|
|
11197
|
+
case 9:
|
|
11198
|
+
case "end":
|
|
11199
|
+
return _context.stop();
|
|
11170
11200
|
}
|
|
11171
11201
|
}, _callee);
|
|
11172
11202
|
}));
|
|
@@ -11191,38 +11221,36 @@ var useFileUploader = function useFileUploader(props) {
|
|
|
11191
11221
|
return tslib.__awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
11192
11222
|
var existingFileNames, filesFromEvent, newFiles;
|
|
11193
11223
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
11194
|
-
while (1) {
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11199
|
-
|
|
11200
|
-
|
|
11201
|
-
|
|
11202
|
-
|
|
11203
|
-
|
|
11204
|
-
|
|
11205
|
-
|
|
11206
|
-
|
|
11207
|
-
|
|
11208
|
-
|
|
11209
|
-
|
|
11210
|
-
|
|
11211
|
-
|
|
11212
|
-
|
|
11213
|
-
|
|
11214
|
-
|
|
11215
|
-
|
|
11216
|
-
|
|
11217
|
-
|
|
11218
|
-
|
|
11219
|
-
|
|
11220
|
-
|
|
11221
|
-
|
|
11222
|
-
|
|
11223
|
-
|
|
11224
|
-
return _context2.stop();
|
|
11225
|
-
}
|
|
11224
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
11225
|
+
case 0:
|
|
11226
|
+
evt.preventDefault();
|
|
11227
|
+
if (!isEventWithFiles(evt)) {
|
|
11228
|
+
_context2.next = 8;
|
|
11229
|
+
break;
|
|
11230
|
+
}
|
|
11231
|
+
existingFileNames = stateFiles.map(function (f) {
|
|
11232
|
+
return f.file.name;
|
|
11233
|
+
}); // TODO: Fiks cast her.
|
|
11234
|
+
_context2.next = 5;
|
|
11235
|
+
return fileSelector.fromEvent(evt);
|
|
11236
|
+
case 5:
|
|
11237
|
+
filesFromEvent = _context2.sent;
|
|
11238
|
+
newFiles = filesFromEvent.filter(function (f) {
|
|
11239
|
+
return !existingFileNames.includes(f.name);
|
|
11240
|
+
}).map(function (file) {
|
|
11241
|
+
var accepted = isFileAccepted(file, accept);
|
|
11242
|
+
return {
|
|
11243
|
+
file: file,
|
|
11244
|
+
errors: accepted ? [] : [getInvalidFileTypeErrorMessage()]
|
|
11245
|
+
};
|
|
11246
|
+
}).concat(stateFiles);
|
|
11247
|
+
dispatch({
|
|
11248
|
+
type: 'onSetFiles',
|
|
11249
|
+
payload: newFiles
|
|
11250
|
+
});
|
|
11251
|
+
case 8:
|
|
11252
|
+
case "end":
|
|
11253
|
+
return _context2.stop();
|
|
11226
11254
|
}
|
|
11227
11255
|
}, _callee2);
|
|
11228
11256
|
}));
|
|
@@ -63,32 +63,30 @@ var useFileUploader = function useFileUploader(props) {
|
|
|
63
63
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
64
64
|
var files, fileCount;
|
|
65
65
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
66
|
-
while (1) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return _context.stop();
|
|
91
|
-
}
|
|
66
|
+
while (1) switch (_context.prev = _context.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
preventDefaults(evt);
|
|
69
|
+
if (!isEventWithFiles(evt)) {
|
|
70
|
+
_context.next = 9;
|
|
71
|
+
break;
|
|
72
|
+
}
|
|
73
|
+
_context.next = 4;
|
|
74
|
+
return fromEvent(evt);
|
|
75
|
+
case 4:
|
|
76
|
+
files = _context.sent;
|
|
77
|
+
fileCount = files.length;
|
|
78
|
+
if (!(fileCount === 0)) {
|
|
79
|
+
_context.next = 8;
|
|
80
|
+
break;
|
|
81
|
+
}
|
|
82
|
+
return _context.abrupt("return");
|
|
83
|
+
case 8:
|
|
84
|
+
dispatch({
|
|
85
|
+
type: 'dragEnter'
|
|
86
|
+
});
|
|
87
|
+
case 9:
|
|
88
|
+
case "end":
|
|
89
|
+
return _context.stop();
|
|
92
90
|
}
|
|
93
91
|
}, _callee);
|
|
94
92
|
}));
|
|
@@ -113,38 +111,36 @@ var useFileUploader = function useFileUploader(props) {
|
|
|
113
111
|
return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
114
112
|
var existingFileNames, filesFromEvent, newFiles;
|
|
115
113
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
116
|
-
while (1) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
return _context2.stop();
|
|
147
|
-
}
|
|
114
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
115
|
+
case 0:
|
|
116
|
+
evt.preventDefault();
|
|
117
|
+
if (!isEventWithFiles(evt)) {
|
|
118
|
+
_context2.next = 8;
|
|
119
|
+
break;
|
|
120
|
+
}
|
|
121
|
+
existingFileNames = stateFiles.map(function (f) {
|
|
122
|
+
return f.file.name;
|
|
123
|
+
}); // TODO: Fiks cast her.
|
|
124
|
+
_context2.next = 5;
|
|
125
|
+
return fromEvent(evt);
|
|
126
|
+
case 5:
|
|
127
|
+
filesFromEvent = _context2.sent;
|
|
128
|
+
newFiles = filesFromEvent.filter(function (f) {
|
|
129
|
+
return !existingFileNames.includes(f.name);
|
|
130
|
+
}).map(function (file) {
|
|
131
|
+
var accepted = isFileAccepted(file, accept);
|
|
132
|
+
return {
|
|
133
|
+
file: file,
|
|
134
|
+
errors: accepted ? [] : [getInvalidFileTypeErrorMessage()]
|
|
135
|
+
};
|
|
136
|
+
}).concat(stateFiles);
|
|
137
|
+
dispatch({
|
|
138
|
+
type: 'onSetFiles',
|
|
139
|
+
payload: newFiles
|
|
140
|
+
});
|
|
141
|
+
case 8:
|
|
142
|
+
case "end":
|
|
143
|
+
return _context2.stop();
|
|
148
144
|
}
|
|
149
145
|
}, _callee2);
|
|
150
146
|
}));
|
|
@@ -36,6 +36,7 @@ import { getBaseHTMLProps } from '../../types/BaseComponentProps.js';
|
|
|
36
36
|
import { VisuallyHidden } from '../VisuallyHidden/VisuallyHidden.js';
|
|
37
37
|
import { Grid } from '../Grid/Grid.js';
|
|
38
38
|
import { GridChild } from '../Grid/GridChild.js';
|
|
39
|
+
import { FormGeneratorSupportedFields } from './FormGenerator.types.js';
|
|
39
40
|
import { useScreenSize, ScreenSize } from '../../hooks/useScreenSize.js';
|
|
40
41
|
import { ButtonRow, FormGeneratorFlexContainer, SubContainer } from './FormGenerator.styles.js';
|
|
41
42
|
import { formGeneratorTokens } from './FormGenerator.tokens.js';
|
|
@@ -80,136 +81,136 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
80
81
|
};
|
|
81
82
|
var GetComponent = function GetComponent(field, index) {
|
|
82
83
|
switch (field.component) {
|
|
83
|
-
case
|
|
84
|
+
case FormGeneratorSupportedFields.Button:
|
|
84
85
|
return /*#__PURE__*/createElement(Button, Object.assign({}, field.props, {
|
|
85
86
|
key: index
|
|
86
87
|
}));
|
|
87
|
-
case
|
|
88
|
+
case FormGeneratorSupportedFields.Card:
|
|
88
89
|
return /*#__PURE__*/createElement(Card, Object.assign({}, field.props, {
|
|
89
90
|
key: index
|
|
90
91
|
}), field.innerHTML);
|
|
91
|
-
case
|
|
92
|
+
case FormGeneratorSupportedFields.Checkbox:
|
|
92
93
|
return /*#__PURE__*/createElement(Checkbox, Object.assign({}, field.props, {
|
|
93
94
|
key: index,
|
|
94
95
|
onChange: fieldOnChange
|
|
95
96
|
}));
|
|
96
|
-
case
|
|
97
|
+
case FormGeneratorSupportedFields.CheckboxGroup:
|
|
97
98
|
return /*#__PURE__*/createElement(CheckboxGroup, Object.assign({}, field.props, {
|
|
98
99
|
key: index
|
|
99
100
|
}), field.children.map(function (child, childIndex) {
|
|
100
101
|
return !child.hide && GetComponent(child, childIndex);
|
|
101
102
|
}));
|
|
102
|
-
case
|
|
103
|
+
case FormGeneratorSupportedFields.Datepicker:
|
|
103
104
|
return /*#__PURE__*/createElement(Datepicker, Object.assign({}, field.props, {
|
|
104
105
|
key: index,
|
|
105
106
|
onChange: fieldOnChange
|
|
106
107
|
}));
|
|
107
|
-
case
|
|
108
|
+
case FormGeneratorSupportedFields.DescriptionList:
|
|
108
109
|
return /*#__PURE__*/createElement(DescriptionList, Object.assign({}, field.props, {
|
|
109
110
|
key: index
|
|
110
111
|
}), field.children.map(function (child, childIndex) {
|
|
111
112
|
return !child.hide && GetComponent(child, childIndex);
|
|
112
113
|
}));
|
|
113
|
-
case
|
|
114
|
+
case FormGeneratorSupportedFields.DescriptionListGroup:
|
|
114
115
|
return /*#__PURE__*/createElement(DescriptionListGroup, Object.assign({}, field.props, {
|
|
115
116
|
key: index
|
|
116
117
|
}), field.children.map(function (child, childIndex) {
|
|
117
118
|
return !child.hide && GetComponent(child, childIndex);
|
|
118
119
|
}));
|
|
119
|
-
case
|
|
120
|
+
case FormGeneratorSupportedFields.DescriptionListDesc:
|
|
120
121
|
return /*#__PURE__*/createElement(DescriptionListDesc, Object.assign({}, field.props, {
|
|
121
122
|
key: index
|
|
122
123
|
}), field.innerHTML);
|
|
123
|
-
case
|
|
124
|
+
case FormGeneratorSupportedFields.DescriptionListTerm:
|
|
124
125
|
return /*#__PURE__*/createElement(DescriptionListTerm, Object.assign({}, field.props, {
|
|
125
126
|
key: index
|
|
126
127
|
}), field.innerHTML);
|
|
127
|
-
case
|
|
128
|
+
case FormGeneratorSupportedFields.Divider:
|
|
128
129
|
return /*#__PURE__*/createElement(Divider, Object.assign({}, field.props, {
|
|
129
130
|
key: index
|
|
130
131
|
}));
|
|
131
|
-
case
|
|
132
|
+
case FormGeneratorSupportedFields.GlobalMessage:
|
|
132
133
|
return /*#__PURE__*/createElement(GlobalMessage, Object.assign({}, field.props, {
|
|
133
134
|
key: index
|
|
134
135
|
}), field.innerHTML);
|
|
135
|
-
case
|
|
136
|
+
case FormGeneratorSupportedFields.Heading:
|
|
136
137
|
return /*#__PURE__*/createElement(Heading, Object.assign({}, field.props, {
|
|
137
138
|
key: index
|
|
138
139
|
}), field.innerHTML);
|
|
139
|
-
case
|
|
140
|
+
case FormGeneratorSupportedFields.InputMessage:
|
|
140
141
|
return /*#__PURE__*/createElement(InputMessage, Object.assign({}, field.props, {
|
|
141
142
|
key: index
|
|
142
143
|
}));
|
|
143
|
-
case
|
|
144
|
+
case FormGeneratorSupportedFields.Label:
|
|
144
145
|
return /*#__PURE__*/createElement(Label, Object.assign({}, field.props, {
|
|
145
146
|
key: index
|
|
146
147
|
}), field.innerHTML);
|
|
147
|
-
case
|
|
148
|
+
case FormGeneratorSupportedFields.Link:
|
|
148
149
|
return /*#__PURE__*/createElement(Link, Object.assign({}, field.props, {
|
|
149
150
|
key: index
|
|
150
151
|
}), field.innerHTML);
|
|
151
|
-
case
|
|
152
|
+
case FormGeneratorSupportedFields.List:
|
|
152
153
|
return /*#__PURE__*/createElement(List, Object.assign({}, field.props, {
|
|
153
154
|
key: index
|
|
154
155
|
}), field.children.map(function (child, childIndex) {
|
|
155
156
|
return !child.hide && GetComponent(child, childIndex);
|
|
156
157
|
}));
|
|
157
|
-
case
|
|
158
|
+
case FormGeneratorSupportedFields.ListItem:
|
|
158
159
|
return /*#__PURE__*/createElement(ListItem, Object.assign({}, field.props, {
|
|
159
160
|
key: index
|
|
160
161
|
}), field.innerHTML);
|
|
161
|
-
case
|
|
162
|
+
case FormGeneratorSupportedFields.LocalMessage:
|
|
162
163
|
return /*#__PURE__*/createElement(LocalMessage, Object.assign({}, field.props, {
|
|
163
164
|
key: index
|
|
164
165
|
}), field.innerHTML);
|
|
165
|
-
case
|
|
166
|
+
case FormGeneratorSupportedFields.Paragraph:
|
|
166
167
|
return /*#__PURE__*/createElement(Paragraph, Object.assign({}, field.props, {
|
|
167
168
|
key: index
|
|
168
169
|
}), field.innerHTML);
|
|
169
|
-
case
|
|
170
|
+
case FormGeneratorSupportedFields.RadioButton:
|
|
170
171
|
return /*#__PURE__*/createElement(RadioButton, Object.assign({}, field.props, {
|
|
171
172
|
key: index,
|
|
172
173
|
onChange: fieldOnChange
|
|
173
174
|
}));
|
|
174
|
-
case
|
|
175
|
+
case FormGeneratorSupportedFields.RadioButtonGroup:
|
|
175
176
|
field.props.direction = screenSize > ScreenSize.XSmall ? 'row' : 'column';
|
|
176
177
|
return /*#__PURE__*/createElement(RadioButtonGroup, Object.assign({}, field.props, {
|
|
177
178
|
key: index
|
|
178
179
|
}), field.children.map(function (child, childIndex) {
|
|
179
180
|
return !child.hide && GetComponent(child, childIndex);
|
|
180
181
|
}));
|
|
181
|
-
case
|
|
182
|
+
case FormGeneratorSupportedFields.Select:
|
|
182
183
|
return /*#__PURE__*/createElement(Select, Object.assign({}, field.props, {
|
|
183
184
|
key: index,
|
|
184
185
|
onChange: function onChange(option) {
|
|
185
186
|
return selectOnChange(option, field.name);
|
|
186
187
|
}
|
|
187
188
|
}));
|
|
188
|
-
case
|
|
189
|
+
case FormGeneratorSupportedFields.Spinner:
|
|
189
190
|
return /*#__PURE__*/createElement(Spinner, Object.assign({}, field.props, {
|
|
190
191
|
key: index
|
|
191
192
|
}));
|
|
192
|
-
case
|
|
193
|
+
case FormGeneratorSupportedFields.TextInput:
|
|
193
194
|
return /*#__PURE__*/createElement(TextInput, Object.assign({}, field.props, {
|
|
194
195
|
key: index,
|
|
195
196
|
onChange: fieldOnChange
|
|
196
197
|
}));
|
|
197
|
-
case
|
|
198
|
+
case FormGeneratorSupportedFields.ToggleButton:
|
|
198
199
|
return /*#__PURE__*/createElement(ToggleButton, Object.assign({}, field.props, {
|
|
199
200
|
key: index,
|
|
200
201
|
onChange: fieldOnChange
|
|
201
202
|
}));
|
|
202
|
-
case
|
|
203
|
+
case FormGeneratorSupportedFields.ToggleButtonGroup:
|
|
203
204
|
return /*#__PURE__*/createElement(ToggleButtonGroup, Object.assign({}, field.props, {
|
|
204
205
|
key: index
|
|
205
206
|
}), field.children.map(function (child, childIndex) {
|
|
206
207
|
return !child.hide && GetComponent(child, childIndex);
|
|
207
208
|
}));
|
|
208
|
-
case
|
|
209
|
+
case FormGeneratorSupportedFields.Typography:
|
|
209
210
|
return /*#__PURE__*/createElement(Typography, Object.assign({}, field.props, {
|
|
210
211
|
key: index
|
|
211
212
|
}), field.innerHTML);
|
|
212
|
-
case
|
|
213
|
+
case FormGeneratorSupportedFields.VisuallyHidden:
|
|
213
214
|
return /*#__PURE__*/createElement(VisuallyHidden, Object.assign({}, field.props, {
|
|
214
215
|
key: index
|
|
215
216
|
}), field.innerHTML);
|
|
@@ -238,7 +239,7 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
238
239
|
return !field.hide && GetComponent(field, groupedIndex);
|
|
239
240
|
})
|
|
240
241
|
}))
|
|
241
|
-
}));
|
|
242
|
+
}), index);
|
|
242
243
|
} else {
|
|
243
244
|
return jsx(GridChild, Object.assign({
|
|
244
245
|
columnsOccupied: "all"
|
|
@@ -252,14 +253,14 @@ var FormGenerator = function FormGenerator(props) {
|
|
|
252
253
|
return !field.hide && GetComponent(field, groupedIndex);
|
|
253
254
|
})
|
|
254
255
|
}))
|
|
255
|
-
}));
|
|
256
|
+
}), index);
|
|
256
257
|
}
|
|
257
258
|
} else {
|
|
258
259
|
return !obj.hide && jsx(GridChild, Object.assign({
|
|
259
260
|
columnsOccupied: "all"
|
|
260
261
|
}, {
|
|
261
262
|
children: GetComponent(obj, index)
|
|
262
|
-
}));
|
|
263
|
+
}), index);
|
|
263
264
|
}
|
|
264
265
|
})
|
|
265
266
|
}));
|
|
@@ -28,164 +28,194 @@ export type FormGeneratorRow = {
|
|
|
28
28
|
breakpoint?: ScreenSize;
|
|
29
29
|
fields: FormGeneratorField[];
|
|
30
30
|
};
|
|
31
|
+
export declare enum FormGeneratorSupportedFields {
|
|
32
|
+
Button = "Button",
|
|
33
|
+
Card = "Card",
|
|
34
|
+
Checkbox = "Checkbox",
|
|
35
|
+
CheckboxGroup = "CheckboxGroup",
|
|
36
|
+
Datepicker = "Datepicker",
|
|
37
|
+
DescriptionList = "DescriptionList",
|
|
38
|
+
DescriptionListGroup = "DescriptionListGroup",
|
|
39
|
+
DescriptionListDesc = "DescriptionListDesc",
|
|
40
|
+
DescriptionListTerm = "DescriptionListTerm",
|
|
41
|
+
Divider = "Divider",
|
|
42
|
+
GlobalMessage = "GlobalMessage",
|
|
43
|
+
Heading = "Heading",
|
|
44
|
+
InputMessage = "InputMessage",
|
|
45
|
+
Label = "Label",
|
|
46
|
+
Link = "Link",
|
|
47
|
+
List = "List",
|
|
48
|
+
ListItem = "ListItem",
|
|
49
|
+
LocalMessage = "LocalMessage",
|
|
50
|
+
Paragraph = "Paragraph",
|
|
51
|
+
RadioButton = "RadioButton",
|
|
52
|
+
RadioButtonGroup = "RadioButtonGroup",
|
|
53
|
+
Select = "Select",
|
|
54
|
+
Spinner = "Spinner",
|
|
55
|
+
TextInput = "TextInput",
|
|
56
|
+
ToggleButton = "ToggleButton",
|
|
57
|
+
ToggleButtonGroup = "ToggleButtonGroup",
|
|
58
|
+
Typography = "Typography",
|
|
59
|
+
VisuallyHidden = "VisuallyHidden"
|
|
60
|
+
}
|
|
31
61
|
export type FormGeneratorField = FieldWithChildren | FieldWithoutChildren;
|
|
32
62
|
type FieldWithChildren = CheckboxGroupField | DescriptionListField | DescriptionListGroupField | ListField | RadioButtonGroupField | ToggleButtonGroupField;
|
|
33
63
|
type FieldWithoutChildren = ButtonField | CardField | CheckboxField | DatepickerField | DescriptionListTermField | DescriptionListDescField | DividerField | GlobalMessageField | HeadingField | InputMessageField | LabelField | LinkField | ListItemField | LocalMessageField | ParagraphField | RadioButtonField | SelectField | SpinnerField | TextInputField | ToggleButtonField | TypographyField | VisuallyHiddenField;
|
|
34
64
|
type ButtonField = {
|
|
35
|
-
component:
|
|
65
|
+
component: FormGeneratorSupportedFields.Button;
|
|
36
66
|
props: ButtonProps;
|
|
37
67
|
hide?: boolean;
|
|
38
68
|
};
|
|
39
69
|
type CardField = {
|
|
40
|
-
component:
|
|
70
|
+
component: FormGeneratorSupportedFields.Card;
|
|
41
71
|
props: CardProps;
|
|
42
72
|
hide?: boolean;
|
|
43
73
|
innerHTML: JSX.Element | string;
|
|
44
74
|
};
|
|
45
75
|
type CheckboxField = {
|
|
46
|
-
component:
|
|
76
|
+
component: FormGeneratorSupportedFields.Checkbox;
|
|
47
77
|
props: CheckboxProps;
|
|
48
78
|
hide?: boolean;
|
|
49
79
|
};
|
|
50
80
|
type CheckboxGroupField = {
|
|
51
|
-
component:
|
|
81
|
+
component: FormGeneratorSupportedFields.CheckboxGroup;
|
|
52
82
|
props: CheckboxGroupProps;
|
|
53
83
|
hide?: boolean;
|
|
54
84
|
children: CheckboxField[];
|
|
55
85
|
};
|
|
56
86
|
type DatepickerField = {
|
|
57
|
-
component:
|
|
87
|
+
component: FormGeneratorSupportedFields.Datepicker;
|
|
58
88
|
props: DatepickerProps;
|
|
59
89
|
hide?: boolean;
|
|
60
90
|
};
|
|
61
91
|
type DescriptionListField = {
|
|
62
|
-
component:
|
|
92
|
+
component: FormGeneratorSupportedFields.DescriptionList;
|
|
63
93
|
props: DescriptionListProps;
|
|
64
94
|
hide?: boolean;
|
|
65
95
|
children: DescriptionListGroupField[];
|
|
66
96
|
};
|
|
67
97
|
type DescriptionListGroupField = {
|
|
68
|
-
component:
|
|
98
|
+
component: FormGeneratorSupportedFields.DescriptionListGroup;
|
|
69
99
|
props: DescriptionListGroupProps;
|
|
70
100
|
hide?: boolean;
|
|
71
101
|
children: (DescriptionListTermField | DescriptionListDescField)[];
|
|
72
102
|
};
|
|
73
103
|
type DescriptionListTermField = {
|
|
74
|
-
component:
|
|
104
|
+
component: FormGeneratorSupportedFields.DescriptionListTerm;
|
|
75
105
|
props: DescriptionListTermProps;
|
|
76
106
|
hide?: boolean;
|
|
77
107
|
innerHTML: JSX.Element | string;
|
|
78
108
|
};
|
|
79
109
|
type DescriptionListDescField = {
|
|
80
|
-
component:
|
|
110
|
+
component: FormGeneratorSupportedFields.DescriptionListDesc;
|
|
81
111
|
props: DescriptionListDescProps;
|
|
82
112
|
hide?: boolean;
|
|
83
113
|
innerHTML: JSX.Element | string;
|
|
84
114
|
};
|
|
85
115
|
type DividerField = {
|
|
86
|
-
component:
|
|
116
|
+
component: FormGeneratorSupportedFields.Divider;
|
|
87
117
|
props: DividerProps;
|
|
88
118
|
hide?: boolean;
|
|
89
119
|
};
|
|
90
120
|
type GlobalMessageField = {
|
|
91
|
-
component:
|
|
121
|
+
component: FormGeneratorSupportedFields.GlobalMessage;
|
|
92
122
|
props: GlobalMessageProps;
|
|
93
123
|
hide?: boolean;
|
|
94
124
|
innerHTML?: JSX.Element | string;
|
|
95
125
|
};
|
|
96
126
|
type HeadingField = {
|
|
97
|
-
component:
|
|
127
|
+
component: FormGeneratorSupportedFields.Heading;
|
|
98
128
|
props: HeadingProps;
|
|
99
129
|
hide?: boolean;
|
|
100
130
|
innerHTML?: JSX.Element | string;
|
|
101
131
|
};
|
|
102
132
|
type InputMessageField = {
|
|
103
|
-
component:
|
|
133
|
+
component: FormGeneratorSupportedFields.InputMessage;
|
|
104
134
|
props: InputMessageProps;
|
|
105
135
|
hide?: boolean;
|
|
106
136
|
};
|
|
107
137
|
type LabelField = {
|
|
108
|
-
component:
|
|
138
|
+
component: FormGeneratorSupportedFields.Label;
|
|
109
139
|
props: LabelProps;
|
|
110
140
|
hide?: boolean;
|
|
111
141
|
innerHTML?: JSX.Element | string;
|
|
112
142
|
};
|
|
113
143
|
type LinkField = {
|
|
114
|
-
component:
|
|
144
|
+
component: FormGeneratorSupportedFields.Link;
|
|
115
145
|
props: LinkProps;
|
|
116
146
|
hide?: boolean;
|
|
117
147
|
innerHTML?: JSX.Element | string;
|
|
118
148
|
};
|
|
119
149
|
type ListItemField = {
|
|
120
|
-
component:
|
|
150
|
+
component: FormGeneratorSupportedFields.ListItem;
|
|
121
151
|
props?: ListItemProps;
|
|
122
152
|
hide?: boolean;
|
|
123
153
|
innerHTML?: JSX.Element | string;
|
|
124
154
|
};
|
|
125
155
|
type ListField = {
|
|
126
|
-
component:
|
|
156
|
+
component: FormGeneratorSupportedFields.List;
|
|
127
157
|
props?: ListProps;
|
|
128
158
|
hide?: boolean;
|
|
129
159
|
children: ListItemField[];
|
|
130
160
|
};
|
|
131
161
|
type LocalMessageField = {
|
|
132
|
-
component:
|
|
162
|
+
component: FormGeneratorSupportedFields.LocalMessage;
|
|
133
163
|
props: LocalMessageProps;
|
|
134
164
|
hide?: boolean;
|
|
135
165
|
innerHTML?: JSX.Element | string;
|
|
136
166
|
};
|
|
137
167
|
type ParagraphField = {
|
|
138
|
-
component:
|
|
168
|
+
component: FormGeneratorSupportedFields.Paragraph;
|
|
139
169
|
props: ParagraphProps;
|
|
140
170
|
hide?: boolean;
|
|
141
171
|
innerHTML?: JSX.Element | string;
|
|
142
172
|
};
|
|
143
173
|
type RadioButtonField = {
|
|
144
|
-
component:
|
|
174
|
+
component: FormGeneratorSupportedFields.RadioButton;
|
|
145
175
|
props: RadioButtonProps;
|
|
146
176
|
hide?: boolean;
|
|
147
177
|
};
|
|
148
178
|
type RadioButtonGroupField = {
|
|
149
|
-
component:
|
|
179
|
+
component: FormGeneratorSupportedFields.RadioButtonGroup;
|
|
150
180
|
props: RadioButtonGroupProps<string | number>;
|
|
151
181
|
hide?: boolean;
|
|
152
182
|
children: RadioButtonField[];
|
|
153
183
|
};
|
|
154
184
|
type SelectField = {
|
|
155
|
-
component:
|
|
185
|
+
component: FormGeneratorSupportedFields.Select;
|
|
156
186
|
props: SelectProps<SelectOption<unknown>, boolean>;
|
|
157
187
|
name: string;
|
|
158
188
|
hide?: boolean;
|
|
159
189
|
};
|
|
160
190
|
type SpinnerField = {
|
|
161
|
-
component:
|
|
191
|
+
component: FormGeneratorSupportedFields.Spinner;
|
|
162
192
|
props: SpinnerProps;
|
|
163
193
|
hide?: boolean;
|
|
164
194
|
};
|
|
165
195
|
type TextInputField = {
|
|
166
|
-
component:
|
|
196
|
+
component: FormGeneratorSupportedFields.TextInput;
|
|
167
197
|
props: TextInputProps;
|
|
168
198
|
hide?: boolean;
|
|
169
199
|
};
|
|
170
200
|
type ToggleButtonField = {
|
|
171
|
-
component:
|
|
201
|
+
component: FormGeneratorSupportedFields.ToggleButton;
|
|
172
202
|
props: ToggleButtonProps;
|
|
173
203
|
hide?: boolean;
|
|
174
204
|
};
|
|
175
205
|
type ToggleButtonGroupField = {
|
|
176
|
-
component:
|
|
206
|
+
component: FormGeneratorSupportedFields.ToggleButtonGroup;
|
|
177
207
|
props: ToggleButtonGroupProps;
|
|
178
208
|
hide?: boolean;
|
|
179
209
|
children: ToggleButtonField[];
|
|
180
210
|
};
|
|
181
211
|
type TypographyField = {
|
|
182
|
-
component:
|
|
212
|
+
component: FormGeneratorSupportedFields.Typography;
|
|
183
213
|
props: TypographyProps;
|
|
184
214
|
hide?: boolean;
|
|
185
215
|
innerHTML: JSX.Element | string;
|
|
186
216
|
};
|
|
187
217
|
type VisuallyHiddenField = {
|
|
188
|
-
component:
|
|
218
|
+
component: FormGeneratorSupportedFields.VisuallyHidden;
|
|
189
219
|
props: VisuallyHiddenProps;
|
|
190
220
|
hide?: boolean;
|
|
191
221
|
innerHTML: JSX.Element | string;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var FormGeneratorSupportedFields;
|
|
2
|
+
(function (FormGeneratorSupportedFields) {
|
|
3
|
+
FormGeneratorSupportedFields["Button"] = "Button";
|
|
4
|
+
FormGeneratorSupportedFields["Card"] = "Card";
|
|
5
|
+
FormGeneratorSupportedFields["Checkbox"] = "Checkbox";
|
|
6
|
+
FormGeneratorSupportedFields["CheckboxGroup"] = "CheckboxGroup";
|
|
7
|
+
FormGeneratorSupportedFields["Datepicker"] = "Datepicker";
|
|
8
|
+
FormGeneratorSupportedFields["DescriptionList"] = "DescriptionList";
|
|
9
|
+
FormGeneratorSupportedFields["DescriptionListGroup"] = "DescriptionListGroup";
|
|
10
|
+
FormGeneratorSupportedFields["DescriptionListDesc"] = "DescriptionListDesc";
|
|
11
|
+
FormGeneratorSupportedFields["DescriptionListTerm"] = "DescriptionListTerm";
|
|
12
|
+
FormGeneratorSupportedFields["Divider"] = "Divider";
|
|
13
|
+
FormGeneratorSupportedFields["GlobalMessage"] = "GlobalMessage";
|
|
14
|
+
FormGeneratorSupportedFields["Heading"] = "Heading";
|
|
15
|
+
FormGeneratorSupportedFields["InputMessage"] = "InputMessage";
|
|
16
|
+
FormGeneratorSupportedFields["Label"] = "Label";
|
|
17
|
+
FormGeneratorSupportedFields["Link"] = "Link";
|
|
18
|
+
FormGeneratorSupportedFields["List"] = "List";
|
|
19
|
+
FormGeneratorSupportedFields["ListItem"] = "ListItem";
|
|
20
|
+
FormGeneratorSupportedFields["LocalMessage"] = "LocalMessage";
|
|
21
|
+
FormGeneratorSupportedFields["Paragraph"] = "Paragraph";
|
|
22
|
+
FormGeneratorSupportedFields["RadioButton"] = "RadioButton";
|
|
23
|
+
FormGeneratorSupportedFields["RadioButtonGroup"] = "RadioButtonGroup";
|
|
24
|
+
FormGeneratorSupportedFields["Select"] = "Select";
|
|
25
|
+
FormGeneratorSupportedFields["Spinner"] = "Spinner";
|
|
26
|
+
FormGeneratorSupportedFields["TextInput"] = "TextInput";
|
|
27
|
+
FormGeneratorSupportedFields["ToggleButton"] = "ToggleButton";
|
|
28
|
+
FormGeneratorSupportedFields["ToggleButtonGroup"] = "ToggleButtonGroup";
|
|
29
|
+
FormGeneratorSupportedFields["Typography"] = "Typography";
|
|
30
|
+
FormGeneratorSupportedFields["VisuallyHidden"] = "VisuallyHidden";
|
|
31
|
+
})(FormGeneratorSupportedFields || (FormGeneratorSupportedFields = {}));
|
|
32
|
+
|
|
33
|
+
export { FormGeneratorSupportedFields };
|
|
@@ -12,5 +12,5 @@ export declare const InputMessage: import("react").ForwardRefExoticComponent<Pic
|
|
|
12
12
|
/** Formålet med meldingen. Påvirker styling. */
|
|
13
13
|
messageType: InputMessageType;
|
|
14
14
|
} & {
|
|
15
|
-
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined;
|
|
15
|
+
htmlProps?: import("react").HTMLAttributes<HTMLDivElement> | undefined; /** Meldingen som vises til brukeren. */
|
|
16
16
|
} & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export declare const CollapsibleRow: import("react").ForwardRefExoticComponent<{
|
|
2
|
-
type?: import("
|
|
2
|
+
type?: import("..").TableRowType | undefined;
|
|
3
3
|
mode?: import("../Table.types").RowMode | undefined;
|
|
4
4
|
selected?: boolean | undefined;
|
|
5
5
|
hoverable?: boolean | undefined;
|
|
@@ -39,7 +39,7 @@ export default _default;
|
|
|
39
39
|
export declare const SingleDefiningColumn: (args: CollapsibleTableProps) => JSX.Element;
|
|
40
40
|
export declare const MultipleDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
41
41
|
export declare const PrioritizedDefiningColumns: (args: CollapsibleTableProps) => JSX.Element;
|
|
42
|
-
export declare const
|
|
42
|
+
export declare const WithDividers: (args: CollapsibleTableProps) => JSX.Element;
|
|
43
43
|
export declare const Compact: (args: CollapsibleTableProps) => JSX.Element;
|
|
44
44
|
export declare const StickyHeader: (args: CollapsibleTableProps) => JSX.Element;
|
|
45
45
|
export declare const WithButtonAndIcons: (args: CollapsibleTableProps) => JSX.Element;
|
|
@@ -25,7 +25,7 @@ var StyledIcon = styled(Icon).withConfig({
|
|
|
25
25
|
})(["position:absolute;color:", ";", " z-index:1;"], icon.color, function (_ref) {
|
|
26
26
|
var size = _ref.size,
|
|
27
27
|
iconSize = _ref.iconSize;
|
|
28
|
-
return css(["left:", ";", ""], icon.sizes[size].left, iconSize === 'small' ? css(["top:", ";"], "calc(50% - ".concat(iconSizes.DdsIconsizeSmallNumberPx / 2, "px)")) : css(["top:", "
|
|
28
|
+
return css(["left:", ";", ""], icon.sizes[size].left, iconSize === 'small' ? css(["top:", ";"], "calc(50% - ".concat(iconSizes.DdsIconsizeSmallNumberPx / 2, "px)")) : css(["top:", ";"], "calc(50% - ".concat(iconSizes.DdsIconsizeMediumNumberPx / 2, "px)")));
|
|
29
29
|
});
|
|
30
30
|
var StyledInput = styled(StatefulInput).withConfig({
|
|
31
31
|
displayName: "TextInputstyles__StyledInput",
|
|
@@ -26,6 +26,8 @@ export declare const useFloatPosition: (arrowRef: HTMLElement | null, options?:
|
|
|
26
26
|
refs: {
|
|
27
27
|
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
28
28
|
floating: import("react").MutableRefObject<HTMLElement | null>;
|
|
29
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
30
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
29
31
|
};
|
|
30
32
|
styles: {
|
|
31
33
|
floating: {
|
package/dist/index.js
CHANGED
|
@@ -215,4 +215,5 @@ export { StyledTextArea, TextArea } from './components/TextArea/TextArea.js';
|
|
|
215
215
|
export { SplitButton } from './components/SplitButton/SplitButton.js';
|
|
216
216
|
export { HStack, VStack } from './components/Stack/Stack.js';
|
|
217
217
|
export { FormGenerator } from './components/FormGenerator/FormGenerator.js';
|
|
218
|
+
export { FormGeneratorSupportedFields } from './components/FormGenerator/FormGenerator.types.js';
|
|
218
219
|
export { FileUploader } from './components/FileUploader/FileUploader.js';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@norges-domstoler/dds-components",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.4.0",
|
|
4
4
|
"description": "React components used in Elsa - domstolenes designsystem",
|
|
5
5
|
"author": "Elsa team",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
"test": "jest",
|
|
24
24
|
"test:watch": "jest --watch",
|
|
25
25
|
"build": "rollup -c",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
26
|
+
"dev": "concurrently 'npm:dev:*'",
|
|
27
|
+
"dev:rollup": "rollup -c -w",
|
|
28
|
+
"dev:storybook": "start-storybook -p 6006",
|
|
28
29
|
"build-storybook": "build-storybook -o docs",
|
|
29
30
|
"lint": "eslint --ext=jsx,ts,tsx src",
|
|
30
31
|
"prettier": "prettier --write .",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"@babel/preset-env": "^7.20.2",
|
|
52
53
|
"@babel/preset-react": "^7.18.6",
|
|
53
54
|
"@mdx-js/react": "^2.2.1",
|
|
55
|
+
"@norges-domstoler/dds-design-tokens": "^3.0.1",
|
|
54
56
|
"@rollup/plugin-babel": "^6.0.3",
|
|
55
57
|
"@rollup/plugin-commonjs": "^24.0.0",
|
|
56
58
|
"@rollup/plugin-image": "^3.0.1",
|