@harnessio/forms 0.11.2 → 0.12.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.
@@ -1 +1,3 @@
1
1
  export * from './types';
2
+ export * from './runtime-input';
3
+ export * from './pipeline-input';
@@ -0,0 +1,103 @@
1
+ /**
2
+ * Pipeline input layout types for form generation
3
+ */
4
+ export type InputLayout = Array<InputName | InputGroup>;
5
+ type InputName = string;
6
+ export interface InputGroup {
7
+ items: InputLayout;
8
+ title?: string;
9
+ open?: boolean;
10
+ }
11
+ /**
12
+ * Pipeline input definition
13
+ */
14
+ export interface PipelineInput {
15
+ /**
16
+ * Type defines the input type.
17
+ */
18
+ type: string;
19
+ /**
20
+ * Description defines the input description.
21
+ */
22
+ description?: string;
23
+ /**
24
+ * @go-type: interface{}
25
+ */
26
+ default?: any;
27
+ /**
28
+ * Required indicates the input is required.
29
+ */
30
+ required?: boolean;
31
+ /**
32
+ * Items defines an array type.
33
+ */
34
+ items?: any[];
35
+ /**
36
+ * Enum defines a list of accepted input values.
37
+ */
38
+ enum?: any[];
39
+ /**
40
+ * Pattern defines a regular expression input constraint.
41
+ */
42
+ pattern?: string;
43
+ /**
44
+ * Options defines a list of accepted input values.
45
+ * This is an alias for enum.
46
+ * @github
47
+ */
48
+ options?: any[];
49
+ /**
50
+ * Mask indicates the input should be masked.
51
+ * @deprecated
52
+ */
53
+ mask?: boolean;
54
+ /**
55
+ * Label defines the input label.
56
+ */
57
+ label?: string;
58
+ oneof?: any[];
59
+ }
60
+ export interface PipelineInputDefinition extends PipelineInput {
61
+ ui?: InputUIConfig;
62
+ }
63
+ export interface InputUIConfig {
64
+ /**
65
+ * CEL expression to add dynamic behaviour.
66
+ * This input will be displayed only when this condition is true.
67
+ * All inputs in this template are available to reference here.
68
+ */
69
+ visible?: string;
70
+ /**
71
+ * Component defines the form element that should be used to
72
+ * override the default renderer for the input.
73
+ */
74
+ component?: string;
75
+ /**
76
+ * Autofocus configures the form element autofocus attribute.
77
+ */
78
+ autofocus?: boolean;
79
+ /**
80
+ * Placeholder configures the form element placeholder attribute.
81
+ */
82
+ placeholder?: string;
83
+ /**
84
+ * Tooltip configures the form element alt attribute.
85
+ */
86
+ tooltip?: string;
87
+ /**
88
+ * Info configure additional important about input
89
+ */
90
+ info?: string;
91
+ /**
92
+ * Types of values allowed for this input.
93
+ * Fixed: User must enter value when configuring the pipeline
94
+ * Runtime: User must enter value when running the pipeline
95
+ * Expression: Value will be derived by evaluating this CEL / JEXL expression
96
+ */
97
+ allowedValueTypes?: Array<'fixed' | 'runtime' | 'expression'>;
98
+ /**
99
+ * CEL expression that evaluates to warning message or null
100
+ */
101
+ warning?: string;
102
+ }
103
+ export {};
@@ -0,0 +1,4 @@
1
+ export type InputValueType = 'fixed' | 'runtime' | 'expression';
2
+ export interface RuntimeInputConfig {
3
+ allowedValueTypes?: InputValueType[];
4
+ }
@@ -1,8 +1,4 @@
1
1
  import { Schema } from 'zod';
2
- export type InputValueType = 'fixed' | 'runtime' | 'expression';
3
- export interface RuntimeInputConfig {
4
- allowedValueTypes?: InputValueType[];
5
- }
6
2
  /** @deprecated use AnyFormValue */
7
3
  export type AnyFormikValue = any;
8
4
  export type AnyFormValue = any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@harnessio/forms",
3
- "version": "0.11.2",
3
+ "version": "0.12.0",
4
4
  "description": "Harness Forms Library",
5
5
  "private": false,
6
6
  "type": "module",
@@ -26,7 +26,6 @@
26
26
  },
27
27
  "license": "Apache-2.0",
28
28
  "peerDependencies": {
29
- "@harnessio/ui": "^0.0.328",
30
29
  "@hookform/resolvers": "^3.9.0",
31
30
  "lodash-es": "^4.17.21",
32
31
  "react": "^17.0.2",
@@ -59,6 +58,7 @@
59
58
  "ts-jest": "^29.1.2",
60
59
  "vite": "^6.0.3",
61
60
  "vite-plugin-dts": "^4.3.0",
61
+ "@harnessio/ui": "0.1.3",
62
62
  "vite-plugin-svgr": "^4.3.0"
63
63
  },
64
64
  "lint-staged": {