valtech-components 2.0.263 → 2.0.265

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.
@@ -14,6 +14,16 @@ export declare class TextInputComponent implements OnInit {
14
14
  ENABLED: "ENABLED";
15
15
  DISABLED: "DISABLED";
16
16
  WORKING: "WORKING";
17
+ /**
18
+ * val-text-input
19
+ *
20
+ * A text input field integrated with Angular forms.
21
+ *
22
+ * @example
23
+ * <val-text-input [props]="{ control: myControl, placeholder: 'Enter text', ... }"></val-text-input>
24
+ *
25
+ * @input props: InputMetadata - Configuration for the input (form control, placeholder, label, etc.)
26
+ */
17
27
  ERROR: "ERROR";
18
28
  };
19
29
  constructor();
@@ -99,8 +99,10 @@ export type InputMetadata = {
99
99
  errors: {
100
100
  [key: string]: string;
101
101
  };
102
- /** Current value */
102
+ /** Initial value for the field */
103
103
  value?: string;
104
+ /** Default value configuration - string for custom defaults, true for auto defaults */
105
+ withDefault?: string | boolean;
104
106
  /** Field state */
105
107
  state: ComponentState;
106
108
  };
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Utilities for handling default values in form inputs based on InputMetadata configuration.
3
+ */
4
+ import { InputMetadata } from '../../components/types';
5
+ /**
6
+ * Resolves the initial value for a form input based on its configuration.
7
+ *
8
+ * @param input - The input metadata configuration
9
+ * @returns The resolved initial value
10
+ *
11
+ * @example
12
+ * // Custom default value
13
+ * const customValue = resolveInputDefaultValue({ withDefault: '2025-06-24', type: InputType.DATE });
14
+ *
15
+ * // Auto default value
16
+ * const autoValue = resolveInputDefaultValue({ withDefault: true, type: InputType.NUMBER });
17
+ *
18
+ * // Explicit value (takes precedence)
19
+ * const explicitValue = resolveInputDefaultValue({ value: 'explicit', withDefault: true, type: InputType.TEXT });
20
+ */
21
+ export declare function resolveInputDefaultValue(input: InputMetadata): any;
22
+ /**
23
+ * Applies the resolved default value to a FormControl.
24
+ *
25
+ * @param input - The input metadata configuration
26
+ * @example
27
+ * const input = { control: myFormControl, type: InputType.DATE, withDefault: true };
28
+ * applyDefaultValueToControl(input);
29
+ */
30
+ export declare function applyDefaultValueToControl(input: InputMetadata): void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valtech-components",
3
- "version": "2.0.263",
3
+ "version": "2.0.265",
4
4
  "peerDependencies": {
5
5
  "@angular/common": "^18.0.0",
6
6
  "@angular/core": "^18.0.0",
@@ -159,14 +159,14 @@ ion-modal .date-picker-custom {
159
159
  }
160
160
 
161
161
  ion-modal {
162
- --border-radius: pxToRem($border-radius-large) !important;
162
+ --border-radius: 1.5rem 1.5rem 0 0 !important;
163
163
 
164
164
  &.ion-datetime-button-overlay {
165
- --border-radius: pxToRem($border-radius-large) !important;
165
+ --border-radius: 1.5rem !important;
166
166
  }
167
167
 
168
168
  @media only screen and (min-width: 768px) and (min-height: 600px) {
169
- --border-radius: pxToRem($border-radius-large) !important;
169
+ --border-radius: 1.5rem !important;
170
170
  }
171
171
  }
172
172