@maif/react-forms 1.1.4 → 1.2.2

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/lib/index.css CHANGED
@@ -312,13 +312,11 @@
312
312
  .mrf-content_switch_button_on::before {
313
313
  content: "";
314
314
  cursor: pointer;
315
- width: 20px;
316
- height: 20px;
315
+ width: 21px;
316
+ height: 21px;
317
317
  background-color: var(--form-bg-color, #fff);
318
318
  border-radius: 20px;
319
- border: 1px solid var(--success-hover-color, #1e7e34);
320
319
  box-shadow: 1px 0px 5px 0px rgba(0, 0, 0, 0.3);
321
- margin-top: -1px;
322
320
  }
323
321
 
324
322
  .mrf-content_switch_button_off {
@@ -337,11 +335,9 @@
337
335
  background-color: var(--form-bg-color, #fff);
338
336
  border-radius: 20px;
339
337
  cursor: pointer;
340
- width: 20px;
341
- height: 20px;
342
- border: 1px solid var(--error-hover-color, #bd2130);
338
+ width: 21px;
339
+ height: 21px;
343
340
  box-shadow: 1px 0px 5px 0px rgba(0, 0, 0, 0.3);
344
- margin-top: -1px;
345
341
  }
346
342
 
347
343
  .mrf-content_switch_button_null {
@@ -360,11 +356,7 @@
360
356
  background-color: var(--form-bg-color, #fff);
361
357
  border-radius: 20px;
362
358
  cursor: pointer;
363
- width: 20px;
364
- height: 20px;
365
- margin-top: -1px;
366
- margin-left: -1px;
367
- border: 1px solid var(--neutral-hover-color, #5c636a);
359
+ width: 21px;
360
+ height: 21px;
368
361
  box-shadow: 1px 0px 5px 0px rgba(0, 0, 0, 0.3);
369
- margin-top: -1px;
370
362
  }
package/lib/index.d.ts CHANGED
@@ -31,8 +31,10 @@ declare const format: {
31
31
  readonly form: "form";
32
32
  readonly buttonsSelect: "buttons";
33
33
  readonly singleLineCode: "singleLineCode";
34
+ readonly datetime: "datetime-local";
35
+ readonly time: "time";
34
36
  };
35
- declare let formatValues: ("markdown" | "email" | "array" | "select" | "code" | "textarea" | "password" | "hidden" | "form" | "buttons" | "singleLineCode")[];
37
+ declare let formatValues: ("markdown" | "email" | "array" | "select" | "code" | "textarea" | "password" | "hidden" | "form" | "buttons" | "singleLineCode" | "datetime-local" | "time")[];
36
38
  declare type Format = typeof formatValues[number];
37
39
 
38
40
  declare type Constraint = (resolver: any, key: string, dependencies: any[]) => AnySchema;
@@ -118,8 +120,10 @@ interface PropType {
118
120
  onChange?: (v: boolean) => void;
119
121
  value?: boolean;
120
122
  readOnly?: boolean;
123
+ className?: string;
124
+ errorDisplayed?: boolean;
121
125
  }
122
- declare const BooleanInput: React.ForwardRefExoticComponent<PropType & React.RefAttributes<HTMLInputElement>>;
126
+ declare const BooleanInput: ({ onChange, value, readOnly, className, errorDisplayed }: PropType) => JSX.Element;
123
127
 
124
128
  declare const Collapse: (props: {
125
129
  initCollapsed?: boolean;
@@ -184,7 +188,7 @@ declare const ObjectInput: (props: {
184
188
 
185
189
  declare type LanguageMode = "javascript" | "css" | "json" | "html" | "markdown";
186
190
 
187
- declare function CodeInput({ onChange, value, mode, tabSize, readOnly, showLinesNumber, highlightLine, themeStyle, setRef }: {
191
+ declare function CodeInput({ onChange, value, mode, tabSize, readOnly, showLinesNumber, highlightLine, themeStyle, className, setRef }: {
188
192
  onChange?: (v: string) => void;
189
193
  value?: string;
190
194
  mode?: LanguageMode;
@@ -200,6 +204,7 @@ declare function CodeInput({ onChange, value, mode, tabSize, readOnly, showLines
200
204
  minWidth: string;
201
205
  maxWidth: string;
202
206
  };
207
+ className?: string;
203
208
  setRef?: (editor: any) => void;
204
209
  }): JSX.Element;
205
210
 
@@ -248,13 +253,14 @@ interface Option {
248
253
  interface Schema {
249
254
  [key: string]: SchemaEntry;
250
255
  }
251
- declare type SchemaRenderType = ({ rawValues, value, onChange, error, setValue, parent }: {
256
+ declare type SchemaRenderType = ({ rawValues, value, onChange, error, setValue, getValue, informations }: {
252
257
  rawValues?: any;
253
258
  value?: any;
254
259
  onChange?: (param: object) => void;
255
260
  error?: boolean;
256
- parent?: string;
257
- setValue?: (data: any) => void;
261
+ getValue: (entry: string) => any;
262
+ informations?: Informations;
263
+ setValue?: (key: string, data: any) => void;
258
264
  }) => JSX.Element;
259
265
  interface ConditionnalSchemaElement {
260
266
  default?: boolean;
@@ -280,21 +286,26 @@ interface SchemaEntry {
280
286
  onCreateOption?: (option: string) => any;
281
287
  isMulti?: boolean;
282
288
  defaultKeyValue?: object;
283
- visible?: boolean | {
284
- ref: string;
285
- test: (b: any, idx?: number) => boolean;
286
- };
289
+ visible?: boolean | ((prop: {
290
+ rawValues: {
291
+ [x: string]: any;
292
+ };
293
+ value: any;
294
+ informations?: Informations;
295
+ }) => boolean);
287
296
  disabled?: boolean | ((prop: {
288
297
  rawValues: {
289
298
  [x: string]: any;
290
299
  };
291
300
  value: any;
301
+ informations?: Informations;
292
302
  }) => boolean);
293
303
  label?: React.ReactNode | ((prop: {
294
304
  rawValues: {
295
305
  [x: string]: any;
296
306
  };
297
307
  value: any;
308
+ informations?: Informations;
298
309
  }) => React.ReactNode);
299
310
  placeholder?: string;
300
311
  defaultValue?: any;
@@ -352,7 +363,9 @@ declare const Form: React.ForwardRefExoticComponent<{
352
363
  flow: Array<string | FlowObject>;
353
364
  value?: object | undefined;
354
365
  inputWrapper?: ((props: object) => JSX.Element) | undefined;
355
- onSubmit: (obj: object) => void;
366
+ onSubmit: (obj: {
367
+ [x: string]: any;
368
+ }) => void;
356
369
  onError?: (() => void) | undefined;
357
370
  footer?: ((props: {
358
371
  reset: () => void;
@@ -364,4 +377,4 @@ declare const Form: React.ForwardRefExoticComponent<{
364
377
  nostyle: boolean;
365
378
  } & React.RefAttributes<unknown>>;
366
379
 
367
- export { BooleanInput, CodeInput, Collapse, ConditionnalSchema, Flow, Form, Format, MarkdownInput, ObjectInput, Schema, SchemaEntry, SelectInput, SelectOption, SingleLineCode, Type, constraints_d as constraints, format, type, validate };
380
+ export { BooleanInput, CodeInput, Collapse, ConditionnalSchema, Flow, Form, Format, Informations, MarkdownInput, ObjectInput, Schema, SchemaEntry, SchemaRenderType, SelectInput, SelectOption, SingleLineCode, Type, constraints_d as constraints, format, type, validate };