@record-evolution/widget-form 1.0.10 → 1.0.11

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.
@@ -654,7 +654,7 @@ var Yt = Object.defineProperty, te = Object.getOwnPropertyDescriptor, y = (e, t,
654
654
  };
655
655
  let _ = class extends D {
656
656
  constructor() {
657
- super(...arguments), this.dialogOpen = !1, this.version = "1.0.10";
657
+ super(...arguments), this.dialogOpen = !1, this.version = "1.0.11";
658
658
  }
659
659
  update(e) {
660
660
  e.has("theme") && this.registerTheme(this.theme), super.update(e);
@@ -1024,7 +1024,7 @@ y([
1024
1024
  Xt("md-dialog")
1025
1025
  ], _.prototype, "dialog", 2);
1026
1026
  _ = y([
1027
- Jt("widget-form-1.0.10")
1027
+ Jt("widget-form-1.0.11")
1028
1028
  ], _);
1029
1029
  export {
1030
1030
  _ as WidgetForm
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "REWidget widget-form",
4
4
  "license": "MIT",
5
5
  "author": "widget-form",
6
- "version": "1.0.10",
6
+ "version": "1.0.11",
7
7
  "engines": {
8
8
  "node": ">=24.9.0",
9
9
  "npm": ">=10.0.2"
@@ -5,52 +5,64 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
+ /**
9
+ * The main heading displayed at the top of the form. Use to describe the form's purpose (e.g., 'Add New Device', 'Submit Feedback', 'Configuration Settings').
10
+ */
8
11
  export type Title = string;
12
+ /**
13
+ * Secondary text displayed below the title. Use for instructions, context, or additional information about the form.
14
+ */
9
15
  export type Subtitle = string;
10
16
  /**
11
- * If checked, a button will be shown to open the form. If unchecked, the form will be shown directly.
17
+ * When enabled, shows a button that opens the form in a modal dialog when clicked. When disabled, the form fields are displayed directly in the widget area. Use button mode for space-constrained layouts or optional data entry.
12
18
  */
13
19
  export type FormOpenButton = boolean;
20
+ /**
21
+ * The text label displayed next to this form field. Should clearly describe what data the user should enter.
22
+ */
14
23
  export type Label = string;
24
+ /**
25
+ * The input control type: 'dropdown' for selection from predefined options, 'textfield' for single-line text, 'numberfield' for numeric values, 'checkbox' for boolean yes/no, 'textarea' for multi-line text, 'datetime' for date and time selection.
26
+ */
15
27
  export type FieldType = "dropdown" | "textfield" | "numberfield" | "checkbox" | "textarea" | "datetime";
16
28
  /**
17
- * If false, this field will be hidden in the form but still saved on submit.
29
+ * When enabled, this field is hidden from users but its value (typically a default or data-bound value) is still submitted with the form. Useful for including metadata, timestamps, or user IDs automatically.
18
30
  */
19
31
  export type HiddenField = boolean;
20
32
  /**
21
- * This field must be filled out before the form can be submitted. Ignored when a default value is provided.
33
+ * When enabled, users must fill out this field before the form can be submitted. The form will show a validation error if left empty. Ignored when a default value is provided.
22
34
  */
23
35
  export type Required = boolean;
24
36
  /**
25
- * This text will be shown as a description at the field.
37
+ * Helper text displayed below the field to guide users on what to enter. Use for format hints, examples, or clarifying instructions.
26
38
  */
27
39
  export type HintText = string;
28
40
  /**
29
- * This value will be used if the user does not provide a value.
41
+ * Pre-filled value for this field when the form loads. Used if the user doesn't modify the field. Can be a static value or bound to a data source.
30
42
  */
31
43
  export type DefaultValue = string;
32
44
  /**
33
- * Minimum value for number fields.
45
+ * The minimum allowed numeric value for numberfield types. Values below this will fail validation.
34
46
  */
35
47
  export type MinimumValue = number;
36
48
  /**
37
- * Maximum value for number fields.
49
+ * The maximum allowed numeric value for numberfield types. Values above this will fail validation.
38
50
  */
39
51
  export type MaximumValue = number;
40
52
  /**
41
- * Regular expression for validating text fields.
53
+ * A regular expression pattern to validate text input (e.g., '^[A-Z]{2}[0-9]{4}$' for format like 'AB1234'). Leave empty to accept any text.
42
54
  */
43
55
  export type ValidationRegex = string;
44
56
  /**
45
- * Label shown in the dropdown.
57
+ * The text shown to users in the dropdown list.
46
58
  */
47
59
  export type DisplayLabel = string;
48
60
  /**
49
- * Value stored in the database.
61
+ * The actual value stored in the database when this option is selected. May differ from the display label.
50
62
  */
51
63
  export type Value = string;
52
64
  /**
53
- * List of values for the dropdown field.
65
+ * The list of selectable options for dropdown field types. Each option has a display label and a stored value.
54
66
  */
55
67
  export type DropdownValues = {
56
68
  displayLabel?: DisplayLabel;
@@ -58,7 +70,7 @@ export type DropdownValues = {
58
70
  [k: string]: unknown;
59
71
  }[];
60
72
  /**
61
- * Add fields and define how they should be stored.
73
+ * Array of input fields that make up the form. Each field defines its type, validation rules, and target database column for storage. Fields are rendered in the order specified.
62
74
  */
63
75
  export type FormFields = {
64
76
  label?: Label;
@@ -75,6 +87,9 @@ export type FormFields = {
75
87
  [k: string]: unknown;
76
88
  }[];
77
89
 
90
+ /**
91
+ * A form widget for collecting user input and storing it in database tables. Use this widget to create data entry interfaces for manual input, configuration settings, user feedback, or any scenario requiring structured data collection. Supports various field types including text, numbers, dropdowns, checkboxes, textareas, and datetime pickers. Each field maps to a database column, enabling direct data persistence. Can display as a button-triggered modal or inline form.
92
+ */
78
93
  export interface InputData {
79
94
  title?: Title;
80
95
  subTitle?: Subtitle;
@@ -83,7 +98,7 @@ export interface InputData {
83
98
  [k: string]: unknown;
84
99
  }
85
100
  /**
86
- * The column in the target table where this field's data will be stored. This will be combined with all other fields in this form connected with the same target table.
101
+ * The database table and column where this field's value will be stored on form submission. Select from available tables and columns. All fields targeting the same table will be combined into a single row insert.
87
102
  */
88
103
  export interface TargetColumn {
89
104
  [k: string]: unknown;
@@ -1,29 +1,32 @@
1
1
  {
2
2
  "title": "InputData",
3
+ "description": "A form widget for collecting user input and storing it in database tables. Use this widget to create data entry interfaces for manual input, configuration settings, user feedback, or any scenario requiring structured data collection. Supports various field types including text, numbers, dropdowns, checkboxes, textareas, and datetime pickers. Each field maps to a database column, enabling direct data persistence. Can display as a button-triggered modal or inline form.",
3
4
  "type": "object",
4
5
  "properties": {
5
6
  "title": {
6
7
  "title": "Title",
8
+ "description": "The main heading displayed at the top of the form. Use to describe the form's purpose (e.g., 'Add New Device', 'Submit Feedback', 'Configuration Settings').",
7
9
  "order": 1,
8
10
  "dataDrivenDisabled": true,
9
11
  "type": "string"
10
12
  },
11
13
  "subTitle": {
12
14
  "title": "Subtitle",
15
+ "description": "Secondary text displayed below the title. Use for instructions, context, or additional information about the form.",
13
16
  "order": 2,
14
17
  "dataDrivenDisabled": true,
15
18
  "type": "string"
16
19
  },
17
20
  "formButton": {
18
21
  "title": "Form Open Button",
19
- "description": "If checked, a button will be shown to open the form. If unchecked, the form will be shown directly.",
22
+ "description": "When enabled, shows a button that opens the form in a modal dialog when clicked. When disabled, the form fields are displayed directly in the widget area. Use button mode for space-constrained layouts or optional data entry.",
20
23
  "dataDrivenDisabled": true,
21
24
  "type": "boolean",
22
25
  "order": 3
23
26
  },
24
27
  "formFields": {
25
28
  "title": "Form Fields",
26
- "description": "Add fields and define how they should be stored.",
29
+ "description": "Array of input fields that make up the form. Each field defines its type, validation rules, and target database column for storage. Fields are rendered in the order specified.",
27
30
  "type": "array",
28
31
  "order": 4,
29
32
  "dataDrivenDisabled": true,
@@ -32,6 +35,7 @@
32
35
  "properties": {
33
36
  "label": {
34
37
  "title": "Label",
38
+ "description": "The text label displayed next to this form field. Should clearly describe what data the user should enter.",
35
39
  "type": "string",
36
40
  "dataDrivenDisabled": true,
37
41
  "required": true,
@@ -39,6 +43,7 @@
39
43
  },
40
44
  "type": {
41
45
  "title": "Field Type",
46
+ "description": "The input control type: 'dropdown' for selection from predefined options, 'textfield' for single-line text, 'numberfield' for numeric values, 'checkbox' for boolean yes/no, 'textarea' for multi-line text, 'datetime' for date and time selection.",
42
47
  "enum": ["dropdown", "textfield", "numberfield", "checkbox", "textarea", "datetime"],
43
48
  "type": "string",
44
49
  "dataDrivenDisabled": true,
@@ -48,35 +53,35 @@
48
53
  "hiddenField": {
49
54
  "title": "Hidden Field",
50
55
  "type": "boolean",
51
- "description": "If false, this field will be hidden in the form but still saved on submit.",
56
+ "description": "When enabled, this field is hidden from users but its value (typically a default or data-bound value) is still submitted with the form. Useful for including metadata, timestamps, or user IDs automatically.",
52
57
  "dataDrivenDisabled": true,
53
58
  "order": 3
54
59
  },
55
60
  "required": {
56
61
  "title": "Required",
57
62
  "type": "boolean",
58
- "description": "This field must be filled out before the form can be submitted. Ignored when a default value is provided.",
63
+ "description": "When enabled, users must fill out this field before the form can be submitted. The form will show a validation error if left empty. Ignored when a default value is provided.",
59
64
  "dataDrivenDisabled": true,
60
65
  "order": 4
61
66
  },
62
67
  "description": {
63
68
  "title": "Hint Text",
64
69
  "type": "string",
65
- "description": "This text will be shown as a description at the field.",
70
+ "description": "Helper text displayed below the field to guide users on what to enter. Use for format hints, examples, or clarifying instructions.",
66
71
  "dataDrivenDisabled": true,
67
72
  "order": 5
68
73
  },
69
74
  "targetColumn": {
70
75
  "title": "Target Column",
71
76
  "type": "targetColumn",
72
- "description": "The column in the target table where this field's data will be stored. This will be combined with all other fields in this form connected with the same target table.",
77
+ "description": "The database table and column where this field's value will be stored on form submission. Select from available tables and columns. All fields targeting the same table will be combined into a single row insert.",
73
78
  "dataDrivenDisabled": true,
74
79
  "required": true,
75
80
  "order": 6
76
81
  },
77
82
  "defaultValue": {
78
83
  "title": "Default Value",
79
- "description": "This value will be used if the user does not provide a value.",
84
+ "description": "Pre-filled value for this field when the form loads. Used if the user doesn't modify the field. Can be a static value or bound to a data source.",
80
85
  "type": "string",
81
86
  "order": 7,
82
87
  "dataDrivenDisabled": true
@@ -84,7 +89,7 @@
84
89
  "min": {
85
90
  "title": "Minimum Value",
86
91
  "type": "number",
87
- "description": "Minimum value for number fields.",
92
+ "description": "The minimum allowed numeric value for numberfield types. Values below this will fail validation.",
88
93
  "dataDrivenDisabled": true,
89
94
  "condition": {
90
95
  "relativePath": "../type",
@@ -95,7 +100,7 @@
95
100
  "max": {
96
101
  "title": "Maximum Value",
97
102
  "type": "number",
98
- "description": "Maximum value for number fields.",
103
+ "description": "The maximum allowed numeric value for numberfield types. Values above this will fail validation.",
99
104
  "dataDrivenDisabled": true,
100
105
  "condition": {
101
106
  "relativePath": "../type",
@@ -106,7 +111,7 @@
106
111
  "validation": {
107
112
  "title": "Validation Regex",
108
113
  "type": "string",
109
- "description": "Regular expression for validating text fields.",
114
+ "description": "A regular expression pattern to validate text input (e.g., '^[A-Z]{2}[0-9]{4}$' for format like 'AB1234'). Leave empty to accept any text.",
110
115
  "dataDrivenDisabled": true,
111
116
  "condition": {
112
117
  "relativePath": "../type",
@@ -117,7 +122,7 @@
117
122
  "values": {
118
123
  "title": "Dropdown Values",
119
124
  "type": "array",
120
- "description": "List of values for the dropdown field.",
125
+ "description": "The list of selectable options for dropdown field types. Each option has a display label and a stored value.",
121
126
  "condition": {
122
127
  "relativePath": "../type",
123
128
  "showIfValueIn": ["dropdown"]
@@ -128,14 +133,14 @@
128
133
  "displayLabel": {
129
134
  "title": "Display Label",
130
135
  "type": "string",
131
- "description": "Label shown in the dropdown.",
136
+ "description": "The text shown to users in the dropdown list.",
132
137
  "required": true,
133
138
  "order": 1
134
139
  },
135
140
  "value": {
136
141
  "title": "Value",
137
142
  "type": "string",
138
- "description": "Value stored in the database.",
143
+ "description": "The actual value stored in the database when this option is selected. May differ from the display label.",
139
144
  "required": true,
140
145
  "order": 2
141
146
  }