@ng-forge/dynamic-forms-bootstrap 1.3.0-next.2 → 1.3.0-next.4
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/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-42hynKVO.mjs +56 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-42hynKVO.mjs.map +1 -0
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs +64 -37
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs +92 -34
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-button.mjs +94 -49
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-button.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs +97 -23
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs +169 -40
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-input.mjs +180 -88
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-input.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.mjs +143 -66
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-radio.mjs +326 -61
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-radio.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-select.mjs +123 -33
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-select.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-slider.mjs +161 -30
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-slider.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-textarea.mjs +97 -23
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-textarea.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs +97 -23
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-lazy-toggle.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-shared.mjs +100 -41
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-shared.mjs.map +1 -1
- package/fesm2022/ng-forge-dynamic-forms-bootstrap.mjs +238 -251
- package/fesm2022/ng-forge-dynamic-forms-bootstrap.mjs.map +1 -1
- package/package.json +2 -2
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-addon-button.d.ts +18 -18
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-addon-icon.d.ts +24 -17
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-button.d.ts +94 -88
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-checkbox.d.ts +24 -18
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-datepicker.d.ts +49 -28
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-input.d.ts +51 -37
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-multi-checkbox.d.ts +34 -23
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-radio.d.ts +30 -19
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-select.d.ts +36 -24
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-slider.d.ts +56 -35
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-textarea.d.ts +24 -18
- package/types/ng-forge-dynamic-forms-bootstrap-lazy-toggle.d.ts +23 -17
- package/types/ng-forge-dynamic-forms-bootstrap-shared.d.ts +78 -71
- package/types/ng-forge-dynamic-forms-bootstrap.d.ts +225 -250
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs +0 -25
- package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs.map +0 -1
|
@@ -1,314 +1,292 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ButtonField, CheckboxField, DatepickerField, DatepickerProps, InputField, InputProps, MultiCheckboxField, RadioField, SelectField, SelectProps, SliderField, TextareaField, TextareaProps, ToggleField,
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
import { BsButtonFieldComponent as BsButtonFieldComponent$1 } from
|
|
6
|
-
import { BsCheckboxFieldComponent as BsCheckboxFieldComponent$1 } from
|
|
7
|
-
import { BsDatepickerFieldComponent as BsDatepickerFieldComponent$1 } from
|
|
8
|
-
import { BsInputFieldComponent as BsInputFieldComponent$1 } from
|
|
9
|
-
import { BsMultiCheckboxFieldComponent as BsMultiCheckboxFieldComponent$1 } from
|
|
10
|
-
import { BsRadioFieldComponent as BsRadioFieldComponent$1 } from
|
|
11
|
-
import { BsSelectFieldComponent as BsSelectFieldComponent$1 } from
|
|
12
|
-
import { BsSliderFieldComponent as BsSliderFieldComponent$1 } from
|
|
13
|
-
import { BsTextareaFieldComponent as BsTextareaFieldComponent$1 } from
|
|
14
|
-
import { BsToggleFieldComponent as BsToggleFieldComponent$1 } from
|
|
15
|
-
import { BsIconAddonComponent as BsIconAddonComponent$1 } from
|
|
16
|
-
import { BsButtonAddonComponent as BsButtonAddonComponent$1 } from
|
|
17
|
-
import { Provider } from '@angular/core';
|
|
18
|
-
|
|
1
|
+
import { AppendArrayItemEvent, ArrayAllowedChildren, DynamicText, FormConfig, FormEvent, FormSubmitEvent, InferFormValue, InsertArrayItemEvent, NarrowFields, NextPageEvent, PopArrayItemEvent, PrependArrayItemEvent, PreviousPageEvent, RegisteredFieldTypes, RemoveAtIndexEvent, ShiftArrayItemEvent, TemplateAddon, TextAddon } from "@ng-forge/dynamic-forms";
|
|
2
|
+
import { ButtonField, CheckboxField, DatepickerField, DatepickerProps, FieldTypeDefinition, InputField, InputProps, MultiCheckboxField, RadioField, SelectField, SelectProps, SliderField, TextareaField, TextareaProps, ToggleField, WrapperTypeDefinition } from "@ng-forge/dynamic-forms/integration";
|
|
3
|
+
import { Provider } from "@angular/core";
|
|
4
|
+
import { BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE, BootstrapConfig, BootstrapConfig as BootstrapConfig$1, BsAddon, BsButtonAddon, BsButtonAddon as BsButtonAddon$1, BsIconAddon, BsIconAddon as BsIconAddon$1 } from "@ng-forge/dynamic-forms-bootstrap/shared";
|
|
5
|
+
import { BsButtonFieldComponent as BsButtonFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/button";
|
|
6
|
+
import { BsCheckboxFieldComponent as BsCheckboxFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/checkbox";
|
|
7
|
+
import { BsDatepickerFieldComponent as BsDatepickerFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/datepicker";
|
|
8
|
+
import { BsInputFieldComponent as BsInputFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/input";
|
|
9
|
+
import { BsMultiCheckboxFieldComponent as BsMultiCheckboxFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/multi-checkbox";
|
|
10
|
+
import { BsRadioFieldComponent as BsRadioFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/radio";
|
|
11
|
+
import { BsSelectFieldComponent as BsSelectFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/select";
|
|
12
|
+
import { BsSliderFieldComponent as BsSliderFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/slider";
|
|
13
|
+
import { BsTextareaFieldComponent as BsTextareaFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/textarea";
|
|
14
|
+
import { BsToggleFieldComponent as BsToggleFieldComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/toggle";
|
|
15
|
+
import { BsIconAddonComponent as BsIconAddonComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/addon-icon";
|
|
16
|
+
import { BsButtonAddonComponent as BsButtonAddonComponent$1 } from "@ng-forge/dynamic-forms-bootstrap/lazy/addon-button";
|
|
19
17
|
interface BsButtonProps {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
18
|
+
variant?: 'primary' | 'secondary' | 'success' | 'danger' | 'warning' | 'info' | 'light' | 'dark' | 'link';
|
|
19
|
+
outline?: boolean;
|
|
20
|
+
size?: 'sm' | 'lg';
|
|
21
|
+
block?: boolean;
|
|
22
|
+
active?: boolean;
|
|
23
|
+
type?: 'button' | 'submit' | 'reset';
|
|
26
24
|
}
|
|
27
25
|
type BsButtonField<TEvent extends FormEvent> = ButtonField<BsButtonProps, TEvent>;
|
|
28
26
|
/** Specific button field types with preconfigured events */
|
|
29
27
|
/** Submit button field - automatically disabled when form is invalid */
|
|
30
28
|
type BsSubmitButtonField = Omit<BsButtonField<FormSubmitEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
31
|
-
|
|
29
|
+
type: 'submit';
|
|
32
30
|
};
|
|
33
31
|
/** Next page button field - with preconfigured NextPageEvent */
|
|
34
32
|
type BsNextButtonField = Omit<BsButtonField<NextPageEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
35
|
-
|
|
33
|
+
type: 'next';
|
|
36
34
|
};
|
|
37
35
|
/** Previous page button field - with preconfigured PreviousPageEvent */
|
|
38
36
|
type BsPreviousButtonField = Omit<BsButtonField<PreviousPageEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
39
|
-
|
|
37
|
+
type: 'previous';
|
|
40
38
|
};
|
|
41
39
|
/** Add array item button field - dispatches AppendArrayItemEvent */
|
|
42
40
|
type BsAddArrayItemButtonField = Omit<BsButtonField<AppendArrayItemEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
type: 'add-array-item' | 'addArrayItem';
|
|
42
|
+
/**
|
|
43
|
+
* The key of the array field to add items to.
|
|
44
|
+
* Required when the button is placed outside the array.
|
|
45
|
+
* When inside an array, this is automatically determined from context.
|
|
46
|
+
*/
|
|
47
|
+
arrayKey?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Template for the new array item. REQUIRED.
|
|
50
|
+
* - Single field (ArrayAllowedChildren): Creates a primitive item (field's value is extracted directly)
|
|
51
|
+
* - Array of fields (ArrayAllowedChildren[]): Creates an object item (fields merged into object)
|
|
52
|
+
*/
|
|
53
|
+
template: ArrayAllowedChildren | readonly ArrayAllowedChildren[];
|
|
56
54
|
};
|
|
57
55
|
/** Prepend array item button field - dispatches PrependArrayItemEvent (adds at beginning) */
|
|
58
56
|
type BsPrependArrayItemButtonField = Omit<BsButtonField<PrependArrayItemEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
57
|
+
type: 'prepend-array-item' | 'prependArrayItem';
|
|
58
|
+
/**
|
|
59
|
+
* The key of the array field to prepend items to.
|
|
60
|
+
* Required when the button is placed outside the array.
|
|
61
|
+
* When inside an array, this is automatically determined from context.
|
|
62
|
+
*/
|
|
63
|
+
arrayKey?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Template for the new array item. REQUIRED.
|
|
66
|
+
* - Single field (ArrayAllowedChildren): Creates a primitive item (field's value is extracted directly)
|
|
67
|
+
* - Array of fields (ArrayAllowedChildren[]): Creates an object item (fields merged into object)
|
|
68
|
+
*/
|
|
69
|
+
template: ArrayAllowedChildren | readonly ArrayAllowedChildren[];
|
|
72
70
|
};
|
|
73
71
|
/** Insert array item button field - dispatches InsertArrayItemEvent (adds at specific index) */
|
|
74
72
|
type BsInsertArrayItemButtonField = Omit<BsButtonField<InsertArrayItemEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
73
|
+
type: 'insert-array-item' | 'insertArrayItem';
|
|
74
|
+
/**
|
|
75
|
+
* The key of the array field to insert items into.
|
|
76
|
+
* Required when the button is placed outside the array.
|
|
77
|
+
* When inside an array, this is automatically determined from context.
|
|
78
|
+
*/
|
|
79
|
+
arrayKey?: string;
|
|
80
|
+
/** The index at which to insert the new item. */
|
|
81
|
+
index: number;
|
|
82
|
+
/**
|
|
83
|
+
* Template for the new array item. REQUIRED.
|
|
84
|
+
* - Single field (ArrayAllowedChildren): Creates a primitive item (field's value is extracted directly)
|
|
85
|
+
* - Array of fields (ArrayAllowedChildren[]): Creates an object item (fields merged into object)
|
|
86
|
+
*/
|
|
87
|
+
template: ArrayAllowedChildren | readonly ArrayAllowedChildren[];
|
|
90
88
|
};
|
|
91
89
|
/** Remove array item button field - dispatches RemoveAtIndexEvent or PopArrayItemEvent */
|
|
92
90
|
type BsRemoveArrayItemButtonField = Omit<BsButtonField<RemoveAtIndexEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
91
|
+
type: 'remove-array-item' | 'removeArrayItem';
|
|
92
|
+
/**
|
|
93
|
+
* The key of the array field to remove items from.
|
|
94
|
+
* Required when the button is placed outside the array.
|
|
95
|
+
* When inside an array, this is automatically determined from context.
|
|
96
|
+
*/
|
|
97
|
+
arrayKey?: string;
|
|
100
98
|
};
|
|
101
99
|
/** Pop array item button field - dispatches PopArrayItemEvent (removes last item) */
|
|
102
100
|
type BsPopArrayItemButtonField = Omit<BsButtonField<PopArrayItemEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
type: 'pop-array-item' | 'popArrayItem';
|
|
102
|
+
/**
|
|
103
|
+
* The key of the array field to remove the last item from.
|
|
104
|
+
* REQUIRED - must specify which array to pop from.
|
|
105
|
+
*/
|
|
106
|
+
arrayKey: string;
|
|
109
107
|
};
|
|
110
108
|
/** Shift array item button field - dispatches ShiftArrayItemEvent (removes first item) */
|
|
111
109
|
type BsShiftArrayItemButtonField = Omit<BsButtonField<ShiftArrayItemEvent>, 'event' | 'type' | 'eventArgs'> & {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
110
|
+
type: 'shift-array-item' | 'shiftArrayItem';
|
|
111
|
+
/**
|
|
112
|
+
* The key of the array field to remove the first item from.
|
|
113
|
+
* REQUIRED - must specify which array to shift from.
|
|
114
|
+
*/
|
|
115
|
+
arrayKey: string;
|
|
118
116
|
};
|
|
119
|
-
|
|
120
117
|
interface BsCheckboxProps {
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
118
|
+
switch?: boolean;
|
|
119
|
+
inline?: boolean;
|
|
120
|
+
reverse?: boolean;
|
|
121
|
+
indeterminate?: boolean;
|
|
122
|
+
hint?: DynamicText;
|
|
126
123
|
}
|
|
127
124
|
type BsCheckboxField = CheckboxField<BsCheckboxProps>;
|
|
128
|
-
|
|
129
125
|
interface BsDatepickerProps extends DatepickerProps {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
126
|
+
useNgBootstrap?: boolean;
|
|
127
|
+
size?: 'sm' | 'lg';
|
|
128
|
+
floatingLabel?: boolean;
|
|
129
|
+
hint?: DynamicText;
|
|
130
|
+
validFeedback?: DynamicText;
|
|
131
|
+
invalidFeedback?: DynamicText;
|
|
132
|
+
displayMonths?: number;
|
|
133
|
+
navigation?: 'select' | 'arrows' | 'none';
|
|
134
|
+
outsideDays?: 'visible' | 'collapsed' | 'hidden';
|
|
135
|
+
showWeekNumbers?: boolean;
|
|
140
136
|
}
|
|
141
137
|
type BsDatepickerField = DatepickerField<BsDatepickerProps>;
|
|
142
|
-
|
|
143
138
|
interface BsInputProps extends InputProps {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
139
|
+
size?: 'sm' | 'lg';
|
|
140
|
+
floatingLabel?: boolean;
|
|
141
|
+
hint?: DynamicText;
|
|
142
|
+
validFeedback?: DynamicText;
|
|
143
|
+
invalidFeedback?: DynamicText;
|
|
144
|
+
plaintext?: boolean;
|
|
150
145
|
}
|
|
151
146
|
/**
|
|
152
147
|
* Module-augmentable seam for adding custom addon types to `bs-input` at
|
|
153
148
|
* the type level. Pair with `withCustomAddon(...)` for the runtime side:
|
|
154
149
|
*/
|
|
155
|
-
interface BsAddonExtensions {
|
|
156
|
-
}
|
|
150
|
+
interface BsAddonExtensions {}
|
|
157
151
|
type BsAddonExtension = BsAddonExtensions[keyof BsAddonExtensions];
|
|
158
152
|
/** Addon types accepted by `bs-input`. */
|
|
159
|
-
type BsInputAddon = BsIconAddon | BsButtonAddon | TextAddon | TemplateAddon | BsAddonExtension;
|
|
153
|
+
type BsInputAddon = BsIconAddon$1 | BsButtonAddon$1 | TextAddon | TemplateAddon | BsAddonExtension;
|
|
160
154
|
type BsInputField = InputField<BsInputProps> & {
|
|
161
|
-
|
|
155
|
+
addons?: ReadonlyArray<BsInputAddon>;
|
|
162
156
|
};
|
|
163
|
-
|
|
164
157
|
interface BsMultiCheckboxProps {
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
158
|
+
switch?: boolean;
|
|
159
|
+
inline?: boolean;
|
|
160
|
+
reverse?: boolean;
|
|
161
|
+
hint?: DynamicText;
|
|
169
162
|
}
|
|
170
163
|
type BsMultiCheckboxField<T> = MultiCheckboxField<T, BsMultiCheckboxProps>;
|
|
171
|
-
|
|
172
164
|
interface BsRadioProps {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
165
|
+
inline?: boolean;
|
|
166
|
+
reverse?: boolean;
|
|
167
|
+
buttonGroup?: boolean;
|
|
168
|
+
buttonSize?: 'sm' | 'lg';
|
|
169
|
+
hint?: DynamicText;
|
|
178
170
|
}
|
|
179
171
|
type BsRadioField<T> = RadioField<T, BsRadioProps>;
|
|
180
|
-
|
|
181
172
|
/**
|
|
182
173
|
* Bootstrap select uses native HTML <select> which only supports string values.
|
|
183
174
|
* The compareWith function signature uses string to match this constraint.
|
|
184
175
|
*/
|
|
185
176
|
interface BsSelectProps extends SelectProps {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
177
|
+
multiple?: boolean;
|
|
178
|
+
size?: 'sm' | 'lg';
|
|
179
|
+
htmlSize?: number;
|
|
180
|
+
floatingLabel?: boolean;
|
|
181
|
+
hint?: DynamicText;
|
|
182
|
+
validFeedback?: DynamicText;
|
|
183
|
+
invalidFeedback?: DynamicText;
|
|
184
|
+
compareWith?: (o1: string, o2: string) => boolean;
|
|
194
185
|
}
|
|
195
186
|
type BsSelectField<T> = SelectField<T, BsSelectProps>;
|
|
196
|
-
|
|
187
|
+
/** Bootstrap select only supports string values due to native HTML select limitations */
|
|
197
188
|
interface BsSliderProps {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
189
|
+
showValue?: boolean;
|
|
190
|
+
valuePrefix?: string;
|
|
191
|
+
valueSuffix?: string;
|
|
192
|
+
hint?: DynamicText;
|
|
193
|
+
/**
|
|
194
|
+
* Adapter-level override for the slider minimum.
|
|
195
|
+
* Field-level `minValue` (or the validator `min`) takes precedence.
|
|
196
|
+
*/
|
|
197
|
+
min?: number;
|
|
198
|
+
/**
|
|
199
|
+
* Adapter-level override for the slider maximum.
|
|
200
|
+
* Field-level `maxValue` (or the validator `max`) takes precedence.
|
|
201
|
+
*/
|
|
202
|
+
max?: number;
|
|
203
|
+
/**
|
|
204
|
+
* Adapter-level override for the slider step increment.
|
|
205
|
+
* Field-level `step` on `SliderField` takes precedence.
|
|
206
|
+
*/
|
|
207
|
+
step?: number;
|
|
217
208
|
}
|
|
218
209
|
type BsSliderField = SliderField<BsSliderProps>;
|
|
219
|
-
|
|
220
210
|
interface BsTextareaProps extends TextareaProps {
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
211
|
+
size?: 'sm' | 'lg';
|
|
212
|
+
floatingLabel?: boolean;
|
|
213
|
+
hint?: DynamicText;
|
|
214
|
+
validFeedback?: DynamicText;
|
|
215
|
+
invalidFeedback?: DynamicText;
|
|
226
216
|
}
|
|
227
217
|
type BsTextareaField = TextareaField<BsTextareaProps>;
|
|
228
|
-
|
|
229
218
|
interface BsToggleProps {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
219
|
+
size?: 'sm' | 'lg';
|
|
220
|
+
reverse?: boolean;
|
|
221
|
+
inline?: boolean;
|
|
222
|
+
hint?: DynamicText;
|
|
234
223
|
}
|
|
235
224
|
type BsToggleField = ToggleField<BsToggleProps>;
|
|
236
|
-
|
|
237
|
-
declare const BOOTSTRAP_FIELD_TYPES: FieldTypeDefinition[];
|
|
238
|
-
|
|
225
|
+
export declare const BOOTSTRAP_FIELD_TYPES: FieldTypeDefinition[];
|
|
239
226
|
/**
|
|
240
227
|
* Bootstrap field type constants
|
|
241
228
|
* Based on available field components in the /fields folder
|
|
242
229
|
*/
|
|
243
|
-
declare const BsField: {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
230
|
+
export declare const BsField: {
|
|
231
|
+
readonly Input: "input";
|
|
232
|
+
readonly Select: "select";
|
|
233
|
+
readonly Checkbox: "checkbox";
|
|
234
|
+
readonly Button: "button";
|
|
235
|
+
readonly Submit: "submit";
|
|
236
|
+
readonly Next: "next";
|
|
237
|
+
readonly Previous: "previous";
|
|
238
|
+
readonly AddArrayItem: "add-array-item";
|
|
239
|
+
readonly PrependArrayItem: "prepend-array-item";
|
|
240
|
+
readonly InsertArrayItem: "insert-array-item";
|
|
241
|
+
readonly RemoveArrayItem: "remove-array-item";
|
|
242
|
+
readonly PopArrayItem: "pop-array-item";
|
|
243
|
+
readonly ShiftArrayItem: "shift-array-item";
|
|
244
|
+
readonly Textarea: "textarea";
|
|
245
|
+
readonly Radio: "radio";
|
|
246
|
+
readonly MultiCheckbox: "multi-checkbox";
|
|
247
|
+
readonly Datepicker: "datepicker";
|
|
248
|
+
readonly Slider: "slider";
|
|
249
|
+
readonly Toggle: "toggle";
|
|
263
250
|
};
|
|
264
251
|
type BsFieldType = (typeof BsField)[keyof typeof BsField];
|
|
265
|
-
|
|
266
252
|
/** Bootstrap-specific props that can be set at form level and cascade to all fields. */
|
|
267
|
-
type BsFormProps = BootstrapConfig;
|
|
253
|
+
type BsFormProps = BootstrapConfig$1;
|
|
268
254
|
/** Bootstrap-specific FormConfig with type-safe defaultProps. */
|
|
269
255
|
type BsFormConfig<TFields extends NarrowFields | RegisteredFieldTypes[] = RegisteredFieldTypes[], TValue = InferFormValue<TFields extends readonly RegisteredFieldTypes[] ? TFields : RegisteredFieldTypes[]>> = FormConfig<TFields, TValue, BsFormProps>;
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Module augmentation for @ng-forge/dynamic-form
|
|
273
|
-
* This file augments the FieldRegistryLeaves interface to include
|
|
274
|
-
* all Bootstrap field types provided by this library.
|
|
275
|
-
*/
|
|
276
|
-
|
|
277
256
|
declare module '@ng-forge/dynamic-forms' {
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
257
|
+
interface FieldRegistryLeaves {
|
|
258
|
+
input: BsInputField;
|
|
259
|
+
select: BsSelectField<unknown>;
|
|
260
|
+
checkbox: BsCheckboxField;
|
|
261
|
+
button: BsButtonField<FormEvent>;
|
|
262
|
+
submit: BsSubmitButtonField;
|
|
263
|
+
next: BsNextButtonField;
|
|
264
|
+
previous: BsPreviousButtonField;
|
|
265
|
+
addArrayItem: BsAddArrayItemButtonField;
|
|
266
|
+
'add-array-item': BsAddArrayItemButtonField;
|
|
267
|
+
prependArrayItem: BsPrependArrayItemButtonField;
|
|
268
|
+
'prepend-array-item': BsPrependArrayItemButtonField;
|
|
269
|
+
insertArrayItem: BsInsertArrayItemButtonField;
|
|
270
|
+
'insert-array-item': BsInsertArrayItemButtonField;
|
|
271
|
+
removeArrayItem: BsRemoveArrayItemButtonField;
|
|
272
|
+
'remove-array-item': BsRemoveArrayItemButtonField;
|
|
273
|
+
popArrayItem: BsPopArrayItemButtonField;
|
|
274
|
+
'pop-array-item': BsPopArrayItemButtonField;
|
|
275
|
+
shiftArrayItem: BsShiftArrayItemButtonField;
|
|
276
|
+
'shift-array-item': BsShiftArrayItemButtonField;
|
|
277
|
+
textarea: BsTextareaField;
|
|
278
|
+
radio: BsRadioField<unknown>;
|
|
279
|
+
'multi-checkbox': BsMultiCheckboxField<unknown>;
|
|
280
|
+
datepicker: BsDatepickerField;
|
|
281
|
+
slider: BsSliderField;
|
|
282
|
+
toggle: BsToggleField;
|
|
283
|
+
}
|
|
305
284
|
}
|
|
306
|
-
|
|
307
285
|
/** Field type definitions for Bootstrap components. */
|
|
308
286
|
type BootstrapFieldTypes = FieldTypeDefinition[];
|
|
309
287
|
type BootstrapConfigFeature = {
|
|
310
|
-
|
|
311
|
-
|
|
288
|
+
ɵkind: 'bootstrap-config';
|
|
289
|
+
ɵproviders: Provider[];
|
|
312
290
|
};
|
|
313
291
|
/**
|
|
314
292
|
* Default `withBootstrapFields()` shape — field defs + the auto-included
|
|
@@ -325,45 +303,42 @@ type BootstrapFieldsWithConfig = [...BootstrapFieldTypes, BootstrapAddonsFeature
|
|
|
325
303
|
* @returns Tuple of field type definitions, the addons feature, and
|
|
326
304
|
* optionally a config feature.
|
|
327
305
|
*/
|
|
328
|
-
declare function withBootstrapFields(): BootstrapFieldsWithAddons;
|
|
329
|
-
declare function withBootstrapFields(config: BootstrapConfig): BootstrapFieldsWithConfig;
|
|
330
|
-
declare function withBootstrapFields(config: BootstrapConfig | undefined): BootstrapFieldsWithAddons | BootstrapFieldsWithConfig;
|
|
306
|
+
export declare function withBootstrapFields(): BootstrapFieldsWithAddons;
|
|
307
|
+
export declare function withBootstrapFields(config: BootstrapConfig$1): BootstrapFieldsWithConfig;
|
|
308
|
+
export declare function withBootstrapFields(config: BootstrapConfig$1 | undefined): BootstrapFieldsWithAddons | BootstrapFieldsWithConfig;
|
|
331
309
|
/**
|
|
332
310
|
* Feature type discriminant for the Bootstrap addons feature. Matches core's
|
|
333
311
|
* `'addons'` type so providers flow through the standard addon-type pipeline
|
|
334
312
|
* in `provideDynamicForm`.
|
|
335
313
|
*/
|
|
336
314
|
type BootstrapAddonsFeature = {
|
|
337
|
-
|
|
338
|
-
|
|
315
|
+
ɵkind: 'addons';
|
|
316
|
+
ɵproviders: Provider[];
|
|
339
317
|
};
|
|
340
318
|
/** Register Bootstrap-shipped addon types (`bs-icon`, `bs-button`) standalone. */
|
|
341
|
-
declare function withBootstrapAddons(): BootstrapAddonsFeature;
|
|
342
|
-
|
|
319
|
+
export declare function withBootstrapAddons(): BootstrapAddonsFeature;
|
|
343
320
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/button`. Import it from there to use the class as a value. */
|
|
344
|
-
type BsButtonFieldComponent<TEvent extends FormEvent> = BsButtonFieldComponent$1<TEvent>;
|
|
321
|
+
export type BsButtonFieldComponent<TEvent extends FormEvent> = BsButtonFieldComponent$1<TEvent>;
|
|
345
322
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/checkbox`. Import it from there to use the class as a value. */
|
|
346
|
-
type BsCheckboxFieldComponent = BsCheckboxFieldComponent$1;
|
|
323
|
+
export type BsCheckboxFieldComponent = BsCheckboxFieldComponent$1;
|
|
347
324
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/datepicker`. Import it from there to use the class as a value. */
|
|
348
|
-
type BsDatepickerFieldComponent = BsDatepickerFieldComponent$1;
|
|
325
|
+
export type BsDatepickerFieldComponent = BsDatepickerFieldComponent$1;
|
|
349
326
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/input`. Import it from there to use the class as a value. */
|
|
350
|
-
type BsInputFieldComponent = BsInputFieldComponent$1;
|
|
327
|
+
export type BsInputFieldComponent = BsInputFieldComponent$1;
|
|
351
328
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/multi-checkbox`. Import it from there to use the class as a value. */
|
|
352
|
-
type BsMultiCheckboxFieldComponent = BsMultiCheckboxFieldComponent$1;
|
|
329
|
+
export type BsMultiCheckboxFieldComponent = BsMultiCheckboxFieldComponent$1;
|
|
353
330
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/radio`. Import it from there to use the class as a value. */
|
|
354
|
-
type BsRadioFieldComponent = BsRadioFieldComponent$1;
|
|
331
|
+
export type BsRadioFieldComponent = BsRadioFieldComponent$1;
|
|
355
332
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/select`. Import it from there to use the class as a value. */
|
|
356
|
-
type BsSelectFieldComponent = BsSelectFieldComponent$1;
|
|
333
|
+
export type BsSelectFieldComponent = BsSelectFieldComponent$1;
|
|
357
334
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/slider`. Import it from there to use the class as a value. */
|
|
358
|
-
type BsSliderFieldComponent = BsSliderFieldComponent$1;
|
|
335
|
+
export type BsSliderFieldComponent = BsSliderFieldComponent$1;
|
|
359
336
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/textarea`. Import it from there to use the class as a value. */
|
|
360
|
-
type BsTextareaFieldComponent = BsTextareaFieldComponent$1;
|
|
337
|
+
export type BsTextareaFieldComponent = BsTextareaFieldComponent$1;
|
|
361
338
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/toggle`. Import it from there to use the class as a value. */
|
|
362
|
-
type BsToggleFieldComponent = BsToggleFieldComponent$1;
|
|
339
|
+
export type BsToggleFieldComponent = BsToggleFieldComponent$1;
|
|
363
340
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/addon-icon`. Import it from there to use the class as a value. */
|
|
364
|
-
type BsIconAddonComponent = BsIconAddonComponent$1;
|
|
341
|
+
export type BsIconAddonComponent = BsIconAddonComponent$1;
|
|
365
342
|
/** Class type of the component in `@ng-forge/dynamic-forms-bootstrap/lazy/addon-button`. Import it from there to use the class as a value. */
|
|
366
|
-
type BsButtonAddonComponent = BsButtonAddonComponent$1;
|
|
367
|
-
|
|
368
|
-
export { BOOTSTRAP_FIELD_TYPES, BsField, withBootstrapAddons, withBootstrapFields };
|
|
369
|
-
export type { BsAddArrayItemButtonField, BsAddonExtensions, BsButtonAddonComponent, BsButtonField, BsButtonFieldComponent, BsButtonProps, BsCheckboxField, BsCheckboxFieldComponent, BsCheckboxProps, BsDatepickerField, BsDatepickerFieldComponent, BsDatepickerProps, BsFieldType, BsFormConfig, BsFormProps, BsIconAddonComponent, BsInputAddon, BsInputField, BsInputFieldComponent, BsInputProps, BsInsertArrayItemButtonField, BsMultiCheckboxField, BsMultiCheckboxFieldComponent, BsMultiCheckboxProps, BsNextButtonField, BsPopArrayItemButtonField, BsPrependArrayItemButtonField, BsPreviousButtonField, BsRadioField, BsRadioFieldComponent, BsRadioProps, BsRemoveArrayItemButtonField, BsSelectField, BsSelectFieldComponent, BsSelectProps, BsShiftArrayItemButtonField, BsSliderField, BsSliderFieldComponent, BsSliderProps, BsSubmitButtonField, BsTextareaField, BsTextareaFieldComponent, BsTextareaProps, BsToggleField, BsToggleFieldComponent, BsToggleProps };
|
|
343
|
+
export type BsButtonAddonComponent = BsButtonAddonComponent$1;
|
|
344
|
+
export { BOOTSTRAP_CONFIG, BS_INPUT_TYPE_OVERRIDE, type BootstrapConfig, type BsAddArrayItemButtonField, type BsAddon, type BsAddonExtensions, type BsButtonAddon, type BsButtonField, type BsButtonProps, type BsCheckboxField, type BsCheckboxProps, type BsDatepickerField, type BsDatepickerProps, type BsFieldType, type BsFormConfig, type BsFormProps, type BsIconAddon, type BsInputAddon, type BsInputField, type BsInputProps, type BsInsertArrayItemButtonField, type BsMultiCheckboxField, type BsMultiCheckboxProps, type BsNextButtonField, type BsPopArrayItemButtonField, type BsPrependArrayItemButtonField, type BsPreviousButtonField, type BsRadioField, type BsRadioProps, type BsRemoveArrayItemButtonField, type BsSelectField, type BsSelectProps, type BsShiftArrayItemButtonField, type BsSliderField, type BsSliderProps, type BsSubmitButtonField, type BsTextareaField, type BsTextareaProps, type BsToggleField, type BsToggleProps };
|
package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';
|
|
4
|
-
|
|
5
|
-
class BsFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {
|
|
6
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsFieldErrorsWrapperComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
7
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.5", type: BsFieldErrorsWrapperComponent, isStandalone: true, selector: "df-bs-field-errors", providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)], usesInheritance: true, ngImport: i0, template: `
|
|
8
|
-
<ng-container #fieldComponent></ng-container>
|
|
9
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
10
|
-
<div class="invalid-feedback d-block" role="alert" [id]="ngf.errorId()">{{ error.message }}</div>
|
|
11
|
-
}
|
|
12
|
-
`, isInline: true, styles: [".invalid-feedback{color:var(--df-error-color, var(--bs-form-invalid-color, var(--bs-danger, #dc3545)));font-size:var(--df-error-font-size, .875em)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
13
|
-
}
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.5", ngImport: i0, type: BsFieldErrorsWrapperComponent, decorators: [{
|
|
15
|
-
type: Component,
|
|
16
|
-
args: [{ selector: 'df-bs-field-errors', template: `
|
|
17
|
-
<ng-container #fieldComponent></ng-container>
|
|
18
|
-
@if (ngf.errorsToDisplay()[0]; as error) {
|
|
19
|
-
<div class="invalid-feedback d-block" role="alert" [id]="ngf.errorId()">{{ error.message }}</div>
|
|
20
|
-
}
|
|
21
|
-
`, changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)], styles: [".invalid-feedback{color:var(--df-error-color, var(--bs-form-invalid-color, var(--bs-danger, #dc3545)));font-size:var(--df-error-font-size, .875em)}\n"] }]
|
|
22
|
-
}] });
|
|
23
|
-
|
|
24
|
-
export { BsFieldErrorsWrapperComponent, BsFieldErrorsWrapperComponent as default };
|
|
25
|
-
//# sourceMappingURL=ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs.map
|
package/fesm2022/ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ng-forge-dynamic-forms-bootstrap-bs-field-errors-wrapper.component-D4qTxFSp.mjs","mappings":";;;;AAoBc;;;;;;;AALX;;;;AANS","names":[],"ignoreList":[],"sources":["../../../../packages/dynamic-forms-bootstrap/src/lib/wrappers/field-errors/bs-field-errors-wrapper.component.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FieldErrorsWrapperBase, provideFieldErrorDisplay } from '@ng-forge/dynamic-forms/integration';\n\n/**\n * Bootstrap rendering of a validation message for the wrapped field.\n * `d-block` is required — Bootstrap only reveals `.invalid-feedback` next to a\n * sibling `.is-invalid` control, which a container has none of.\n */\n@Component({\n selector: 'df-bs-field-errors',\n template: `\n <ng-container #fieldComponent></ng-container>\n @if (ngf.errorsToDisplay()[0]; as error) {\n <div class=\"invalid-feedback d-block\" role=\"alert\" [id]=\"ngf.errorId()\">{{ error.message }}</div>\n }\n `,\n styleUrl: './bs-field-errors-wrapper.component.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [provideFieldErrorDisplay(() => BsFieldErrorsWrapperComponent)],\n})\nexport default class BsFieldErrorsWrapperComponent extends FieldErrorsWrapperBase {}\n\nexport { BsFieldErrorsWrapperComponent };\n"]}
|