@ngx-formly/ionic 10.0.1 → 11.1.0-rc.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.
- package/README.md +109 -177
- package/fesm2022/ngx-formly-ionic-checkbox.mjs +192 -70
- package/fesm2022/ngx-formly-ionic-checkbox.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-datetime.mjs +349 -119
- package/fesm2022/ngx-formly-ionic-datetime.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-form-field.mjs +259 -81
- package/fesm2022/ngx-formly-ionic-form-field.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-input.mjs +233 -92
- package/fesm2022/ngx-formly-ionic-input.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-radio.mjs +262 -72
- package/fesm2022/ngx-formly-ionic-radio.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-select.mjs +247 -90
- package/fesm2022/ngx-formly-ionic-select.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-slider.mjs +198 -64
- package/fesm2022/ngx-formly-ionic-slider.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-textarea.mjs +194 -67
- package/fesm2022/ngx-formly-ionic-textarea.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic-toggle.mjs +189 -66
- package/fesm2022/ngx-formly-ionic-toggle.mjs.map +1 -1
- package/fesm2022/ngx-formly-ionic.mjs +96 -69
- package/fesm2022/ngx-formly-ionic.mjs.map +1 -1
- package/package.json +3 -3
- package/types/ngx-formly-ionic-checkbox.d.ts +22 -27
- package/types/ngx-formly-ionic-datetime.d.ts +43 -47
- package/types/ngx-formly-ionic-form-field.d.ts +30 -31
- package/types/ngx-formly-ionic-input.d.ts +21 -27
- package/types/ngx-formly-ionic-radio.d.ts +21 -26
- package/types/ngx-formly-ionic-select.d.ts +34 -38
- package/types/ngx-formly-ionic-slider.d.ts +20 -26
- package/types/ngx-formly-ionic-textarea.d.ts +21 -27
- package/types/ngx-formly-ionic-toggle.d.ts +21 -26
- package/types/ngx-formly-ionic.d.ts +17 -21
|
@@ -1,75 +1,98 @@
|
|
|
1
|
-
import * as i0 from
|
|
2
|
-
import {
|
|
3
|
-
import * as i2 from
|
|
4
|
-
import { IonDatetime,
|
|
5
|
-
import * as i1
|
|
6
|
-
import { FieldType, FormlyModule } from
|
|
7
|
-
import * as i1 from
|
|
8
|
-
import { ReactiveFormsModule } from
|
|
9
|
-
import * as i3 from
|
|
10
|
-
import { FormlyFormFieldModule } from
|
|
11
|
-
import * as i4 from
|
|
12
|
-
import { CommonModule } from
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { ChangeDetectionStrategy, Component, NgModule, ViewChild, ViewEncapsulation } from "@angular/core";
|
|
3
|
+
import * as i2 from "@ionic/angular";
|
|
4
|
+
import { IonButton, IonButtons, IonDatetime, IonItem, IonLabel, IonModal } from "@ionic/angular";
|
|
5
|
+
import * as i1 from "@ngx-formly/core";
|
|
6
|
+
import { FieldType, FormlyModule } from "@ngx-formly/core";
|
|
7
|
+
import * as i1$1 from "@angular/forms";
|
|
8
|
+
import { ReactiveFormsModule } from "@angular/forms";
|
|
9
|
+
import * as i3 from "@ngx-formly/ionic/form-field";
|
|
10
|
+
import { FormlyFormFieldModule } from "@ngx-formly/ionic/form-field";
|
|
11
|
+
import * as i4 from "@angular/common";
|
|
12
|
+
import { CommonModule } from "@angular/common";
|
|
13
|
+
var FormlyFieldDatetime = class FormlyFieldDatetime extends FieldType {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.isOpen = false;
|
|
17
|
+
this.defaultOptions = { props: { presentation: "month-year" } };
|
|
18
|
+
}
|
|
19
|
+
displayFormat() {
|
|
20
|
+
if (this.props.displayFormat) return this.props.displayFormat;
|
|
21
|
+
switch (this.props.presentation) {
|
|
22
|
+
case "date-time":
|
|
23
|
+
case "time-date": return "short";
|
|
24
|
+
case "time": return "shortTime";
|
|
25
|
+
case "month": return "MMMM";
|
|
26
|
+
case "month-year": return "MMMM, y";
|
|
27
|
+
case "year": return "y";
|
|
28
|
+
case "date": return "mediumDate";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
confirm() {
|
|
32
|
+
this.datetime?.confirm();
|
|
33
|
+
this.close();
|
|
34
|
+
}
|
|
35
|
+
reset() {
|
|
36
|
+
this.datetime?.reset();
|
|
37
|
+
this.close();
|
|
38
|
+
}
|
|
39
|
+
close() {
|
|
40
|
+
this.isOpen = false;
|
|
41
|
+
this.formControl.markAsTouched();
|
|
42
|
+
}
|
|
43
|
+
onLabelInteraction(event) {
|
|
44
|
+
if (event.target.closest("a[href]")) event.stopPropagation();
|
|
45
|
+
}
|
|
46
|
+
static {
|
|
47
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
48
|
+
minVersion: "12.0.0",
|
|
49
|
+
version: "22.2.2",
|
|
50
|
+
ngImport: i0,
|
|
51
|
+
type: FormlyFieldDatetime,
|
|
52
|
+
deps: null,
|
|
53
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
static {
|
|
57
|
+
this.ɵcmp = i0.ɵɵngDeclareComponent({
|
|
58
|
+
minVersion: "17.0.0",
|
|
59
|
+
version: "22.2.2",
|
|
60
|
+
type: FormlyFieldDatetime,
|
|
61
|
+
isStandalone: false,
|
|
62
|
+
selector: "formly-field-ion-datetime",
|
|
63
|
+
viewQueries: [{
|
|
64
|
+
propertyName: "datetime",
|
|
65
|
+
first: true,
|
|
66
|
+
predicate: IonDatetime,
|
|
67
|
+
descendants: true
|
|
68
|
+
}],
|
|
69
|
+
usesInheritance: true,
|
|
70
|
+
ngImport: i0,
|
|
71
|
+
template: `
|
|
58
72
|
<ion-item
|
|
59
73
|
[button]="true"
|
|
60
74
|
[detail]="false"
|
|
61
75
|
[disabled]="formControl.disabled"
|
|
62
|
-
[attr.aria-label]="props.label"
|
|
76
|
+
[attr.aria-label]="props.allowHtml ? null : props.label"
|
|
77
|
+
[attr.aria-labelledby]="props.allowHtml ? id + '-label' : null"
|
|
63
78
|
aria-haspopup="dialog"
|
|
64
79
|
[attr.aria-expanded]="isOpen"
|
|
65
80
|
(click)="isOpen = true"
|
|
66
81
|
>
|
|
67
82
|
<ion-label>
|
|
68
|
-
@if (
|
|
83
|
+
@if (props.allowHtml) {
|
|
84
|
+
<span
|
|
85
|
+
[id]="id + '-label'"
|
|
86
|
+
[hidden]="props.hideLabel"
|
|
87
|
+
[innerHTML]="props.label"
|
|
88
|
+
(click)="onLabelInteraction($event)"
|
|
89
|
+
(keydown)="onLabelInteraction($event)"
|
|
90
|
+
></span>
|
|
91
|
+
} @else if (!props.hideLabel) {
|
|
69
92
|
{{ props.label }}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
93
|
+
}
|
|
94
|
+
@if (!props.hideLabel && props.required && !props.hideRequiredMarker) {
|
|
95
|
+
<span aria-hidden="true">*</span>
|
|
73
96
|
}
|
|
74
97
|
<p>{{ formControl.value ? (formControl.value | date: displayFormat()) : props.placeholder }}</p>
|
|
75
98
|
</ion-label>
|
|
@@ -102,26 +125,184 @@ class FormlyFieldDatetime extends FieldType {
|
|
|
102
125
|
</ion-datetime>
|
|
103
126
|
</ng-template>
|
|
104
127
|
</ion-modal>
|
|
105
|
-
`,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
128
|
+
`,
|
|
129
|
+
isInline: true,
|
|
130
|
+
styles: [".ion-datetime-modal{--width: 310px;--border-radius: 8px}.ion-datetime-modal.ion-datetime-modal-time-date{--height: 440px}.ion-datetime-modal.ion-datetime-modal-date{--height: 390px}.ion-datetime-modal.ion-datetime-modal-time{--height: 260px}formly-field-ion-datetime{display:inherit}formly-field-ion-datetime ion-item{flex:1}\n"],
|
|
131
|
+
dependencies: [
|
|
132
|
+
{
|
|
133
|
+
kind: "directive",
|
|
134
|
+
type: i1$1.NgControlStatus,
|
|
135
|
+
selector: "[formControlName],[ngModel],[formControl]"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
kind: "directive",
|
|
139
|
+
type: i1$1.FormControlDirective,
|
|
140
|
+
selector: "[formControl]",
|
|
141
|
+
inputs: [
|
|
142
|
+
"formControl",
|
|
143
|
+
"disabled",
|
|
144
|
+
"ngModel"
|
|
145
|
+
],
|
|
146
|
+
outputs: ["ngModelChange"],
|
|
147
|
+
exportAs: ["ngForm"]
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
kind: "component",
|
|
151
|
+
type: i2.IonItem,
|
|
152
|
+
selector: "ion-item",
|
|
153
|
+
inputs: [
|
|
154
|
+
"button",
|
|
155
|
+
"color",
|
|
156
|
+
"detail",
|
|
157
|
+
"detailIcon",
|
|
158
|
+
"disabled",
|
|
159
|
+
"download",
|
|
160
|
+
"href",
|
|
161
|
+
"lines",
|
|
162
|
+
"mode",
|
|
163
|
+
"rel",
|
|
164
|
+
"routerAnimation",
|
|
165
|
+
"routerDirection",
|
|
166
|
+
"target",
|
|
167
|
+
"type"
|
|
168
|
+
]
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
kind: "component",
|
|
172
|
+
type: i2.IonLabel,
|
|
173
|
+
selector: "ion-label",
|
|
174
|
+
inputs: [
|
|
175
|
+
"color",
|
|
176
|
+
"mode",
|
|
177
|
+
"position"
|
|
178
|
+
]
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
kind: "component",
|
|
182
|
+
type: i2.IonModal,
|
|
183
|
+
selector: "ion-modal"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
kind: "component",
|
|
187
|
+
type: i2.IonDatetime,
|
|
188
|
+
selector: "ion-datetime",
|
|
189
|
+
inputs: [
|
|
190
|
+
"cancelText",
|
|
191
|
+
"clearText",
|
|
192
|
+
"color",
|
|
193
|
+
"dayValues",
|
|
194
|
+
"disabled",
|
|
195
|
+
"doneText",
|
|
196
|
+
"firstDayOfWeek",
|
|
197
|
+
"formatOptions",
|
|
198
|
+
"highlightedDates",
|
|
199
|
+
"hourCycle",
|
|
200
|
+
"hourValues",
|
|
201
|
+
"isDateEnabled",
|
|
202
|
+
"locale",
|
|
203
|
+
"max",
|
|
204
|
+
"min",
|
|
205
|
+
"minuteValues",
|
|
206
|
+
"mode",
|
|
207
|
+
"monthValues",
|
|
208
|
+
"multiple",
|
|
209
|
+
"name",
|
|
210
|
+
"preferWheel",
|
|
211
|
+
"presentation",
|
|
212
|
+
"readonly",
|
|
213
|
+
"showAdjacentDays",
|
|
214
|
+
"showClearButton",
|
|
215
|
+
"showDefaultButtons",
|
|
216
|
+
"showDefaultTimeLabel",
|
|
217
|
+
"showDefaultTitle",
|
|
218
|
+
"size",
|
|
219
|
+
"titleSelectedDatesFormatter",
|
|
220
|
+
"value",
|
|
221
|
+
"yearValues"
|
|
222
|
+
]
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
kind: "component",
|
|
226
|
+
type: i2.IonButtons,
|
|
227
|
+
selector: "ion-buttons",
|
|
228
|
+
inputs: ["collapse"]
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
kind: "component",
|
|
232
|
+
type: i2.IonButton,
|
|
233
|
+
selector: "ion-button",
|
|
234
|
+
inputs: [
|
|
235
|
+
"buttonType",
|
|
236
|
+
"color",
|
|
237
|
+
"disabled",
|
|
238
|
+
"download",
|
|
239
|
+
"expand",
|
|
240
|
+
"fill",
|
|
241
|
+
"form",
|
|
242
|
+
"href",
|
|
243
|
+
"mode",
|
|
244
|
+
"rel",
|
|
245
|
+
"routerAnimation",
|
|
246
|
+
"routerDirection",
|
|
247
|
+
"shape",
|
|
248
|
+
"size",
|
|
249
|
+
"strong",
|
|
250
|
+
"target",
|
|
251
|
+
"type"
|
|
252
|
+
],
|
|
253
|
+
outputs: ["ionFocus", "ionBlur"]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
kind: "directive",
|
|
257
|
+
type: i3.ɵIonFormlyAttributes,
|
|
258
|
+
selector: "[ionFormlyAttributes]",
|
|
259
|
+
inputs: ["ionFormlyAttributes"]
|
|
260
|
+
},
|
|
261
|
+
{
|
|
262
|
+
kind: "pipe",
|
|
263
|
+
type: i4.DatePipe,
|
|
264
|
+
name: "date"
|
|
265
|
+
}
|
|
266
|
+
],
|
|
267
|
+
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
268
|
+
encapsulation: i0.ViewEncapsulation.None
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
273
|
+
minVersion: "12.0.0",
|
|
274
|
+
version: "22.2.2",
|
|
275
|
+
ngImport: i0,
|
|
276
|
+
type: FormlyFieldDatetime,
|
|
277
|
+
decorators: [{
|
|
278
|
+
type: Component,
|
|
279
|
+
args: [{
|
|
280
|
+
selector: "formly-field-ion-datetime",
|
|
281
|
+
template: `
|
|
110
282
|
<ion-item
|
|
111
283
|
[button]="true"
|
|
112
284
|
[detail]="false"
|
|
113
285
|
[disabled]="formControl.disabled"
|
|
114
|
-
[attr.aria-label]="props.label"
|
|
286
|
+
[attr.aria-label]="props.allowHtml ? null : props.label"
|
|
287
|
+
[attr.aria-labelledby]="props.allowHtml ? id + '-label' : null"
|
|
115
288
|
aria-haspopup="dialog"
|
|
116
289
|
[attr.aria-expanded]="isOpen"
|
|
117
290
|
(click)="isOpen = true"
|
|
118
291
|
>
|
|
119
292
|
<ion-label>
|
|
120
|
-
@if (
|
|
293
|
+
@if (props.allowHtml) {
|
|
294
|
+
<span
|
|
295
|
+
[id]="id + '-label'"
|
|
296
|
+
[hidden]="props.hideLabel"
|
|
297
|
+
[innerHTML]="props.label"
|
|
298
|
+
(click)="onLabelInteraction($event)"
|
|
299
|
+
(keydown)="onLabelInteraction($event)"
|
|
300
|
+
></span>
|
|
301
|
+
} @else if (!props.hideLabel) {
|
|
121
302
|
{{ props.label }}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
303
|
+
}
|
|
304
|
+
@if (!props.hideLabel && props.required && !props.hideRequiredMarker) {
|
|
305
|
+
<span aria-hidden="true">*</span>
|
|
125
306
|
}
|
|
126
307
|
<p>{{ formControl.value ? (formControl.value | date: displayFormat()) : props.placeholder }}</p>
|
|
127
308
|
</ion-label>
|
|
@@ -154,53 +335,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
154
335
|
</ion-datetime>
|
|
155
336
|
</ng-template>
|
|
156
337
|
</ion-modal>
|
|
157
|
-
`,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
338
|
+
`,
|
|
339
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
340
|
+
encapsulation: ViewEncapsulation.None,
|
|
341
|
+
standalone: false,
|
|
342
|
+
styles: [".ion-datetime-modal{--width: 310px;--border-radius: 8px}.ion-datetime-modal.ion-datetime-modal-time-date{--height: 440px}.ion-datetime-modal.ion-datetime-modal-date{--height: 390px}.ion-datetime-modal.ion-datetime-modal-time{--height: 260px}formly-field-ion-datetime{display:inherit}formly-field-ion-datetime ion-item{flex:1}\n"]
|
|
343
|
+
}]
|
|
344
|
+
}],
|
|
345
|
+
propDecorators: { datetime: [{
|
|
346
|
+
type: ViewChild,
|
|
347
|
+
args: [IonDatetime]
|
|
348
|
+
}] }
|
|
349
|
+
});
|
|
163
350
|
function withFormlyFieldDatetime() {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
wrappers: ['form-field'],
|
|
170
|
-
},
|
|
171
|
-
],
|
|
172
|
-
};
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
class FormlyDatetimeModule {
|
|
176
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyDatetimeModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
177
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.2.25", ngImport: i0, type: FormlyDatetimeModule, declarations: [FormlyFieldDatetime], imports: [CommonModule,
|
|
178
|
-
ReactiveFormsModule,
|
|
179
|
-
IonicModule,
|
|
180
|
-
FormlyFormFieldModule, i1$1.FormlyModule] }); }
|
|
181
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: FormlyDatetimeModule, imports: [CommonModule,
|
|
182
|
-
ReactiveFormsModule,
|
|
183
|
-
IonicModule,
|
|
184
|
-
FormlyFormFieldModule,
|
|
185
|
-
FormlyModule.forChild(withFormlyFieldDatetime())] }); }
|
|
351
|
+
return { types: [{
|
|
352
|
+
name: "datetime",
|
|
353
|
+
component: FormlyFieldDatetime,
|
|
354
|
+
wrappers: ["form-field"]
|
|
355
|
+
}] };
|
|
186
356
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
357
|
+
var FormlyDatetimeModule = class FormlyDatetimeModule {
|
|
358
|
+
static {
|
|
359
|
+
this.ɵfac = i0.ɵɵngDeclareFactory({
|
|
360
|
+
minVersion: "12.0.0",
|
|
361
|
+
version: "22.2.2",
|
|
362
|
+
ngImport: i0,
|
|
363
|
+
type: FormlyDatetimeModule,
|
|
364
|
+
deps: [],
|
|
365
|
+
target: i0.ɵɵFactoryTarget.NgModule
|
|
366
|
+
});
|
|
367
|
+
}
|
|
368
|
+
static {
|
|
369
|
+
this.ɵmod = i0.ɵɵngDeclareNgModule({
|
|
370
|
+
minVersion: "14.0.0",
|
|
371
|
+
version: "22.2.2",
|
|
372
|
+
ngImport: i0,
|
|
373
|
+
type: FormlyDatetimeModule,
|
|
374
|
+
declarations: [FormlyFieldDatetime],
|
|
375
|
+
imports: [
|
|
376
|
+
CommonModule,
|
|
377
|
+
ReactiveFormsModule,
|
|
378
|
+
IonItem,
|
|
379
|
+
IonLabel,
|
|
380
|
+
IonModal,
|
|
381
|
+
IonDatetime,
|
|
382
|
+
IonButtons,
|
|
383
|
+
IonButton,
|
|
384
|
+
FormlyFormFieldModule,
|
|
385
|
+
i1.FormlyModule
|
|
386
|
+
]
|
|
387
|
+
});
|
|
388
|
+
}
|
|
389
|
+
static {
|
|
390
|
+
this.ɵinj = i0.ɵɵngDeclareInjector({
|
|
391
|
+
minVersion: "12.0.0",
|
|
392
|
+
version: "22.2.2",
|
|
393
|
+
ngImport: i0,
|
|
394
|
+
type: FormlyDatetimeModule,
|
|
395
|
+
imports: [
|
|
396
|
+
CommonModule,
|
|
397
|
+
ReactiveFormsModule,
|
|
398
|
+
IonItem,
|
|
399
|
+
IonLabel,
|
|
400
|
+
IonModal,
|
|
401
|
+
IonDatetime,
|
|
402
|
+
IonButtons,
|
|
403
|
+
IonButton,
|
|
404
|
+
FormlyFormFieldModule,
|
|
405
|
+
FormlyModule.forChild(withFormlyFieldDatetime())
|
|
406
|
+
]
|
|
407
|
+
});
|
|
408
|
+
}
|
|
409
|
+
};
|
|
410
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
411
|
+
minVersion: "12.0.0",
|
|
412
|
+
version: "22.2.2",
|
|
413
|
+
ngImport: i0,
|
|
414
|
+
type: FormlyDatetimeModule,
|
|
415
|
+
decorators: [{
|
|
416
|
+
type: NgModule,
|
|
417
|
+
args: [{
|
|
418
|
+
declarations: [FormlyFieldDatetime],
|
|
419
|
+
imports: [
|
|
420
|
+
CommonModule,
|
|
421
|
+
ReactiveFormsModule,
|
|
422
|
+
IonItem,
|
|
423
|
+
IonLabel,
|
|
424
|
+
IonModal,
|
|
425
|
+
IonDatetime,
|
|
426
|
+
IonButtons,
|
|
427
|
+
IonButton,
|
|
428
|
+
FormlyFormFieldModule,
|
|
429
|
+
FormlyModule.forChild(withFormlyFieldDatetime())
|
|
430
|
+
]
|
|
431
|
+
}]
|
|
432
|
+
}]
|
|
433
|
+
});
|
|
205
434
|
export { FormlyDatetimeModule, withFormlyFieldDatetime };
|
|
206
|
-
|
|
435
|
+
|
|
436
|
+
//# sourceMappingURL=ngx-formly-ionic-datetime.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-formly-ionic-datetime.mjs","sources":["../../../../src/ui/ionic/datetime/src/datetime.type.ts","../../../../src/ui/ionic/datetime/src/datetime.config.ts","../../../../src/ui/ionic/datetime/src/datetime.module.ts"
|
|
1
|
+
{"version":3,"file":"ngx-formly-ionic-datetime.mjs","names":[],"sources":["../../../../src/ui/ionic/datetime/src/datetime.type.ts","../../../../src/ui/ionic/datetime/src/datetime.config.ts","../../../../src/ui/ionic/datetime/src/datetime.module.ts"],"sourcesContent":["import { Component, ChangeDetectionStrategy, ViewChild, ViewEncapsulation, Type } from '@angular/core';\nimport { IonDatetime } from '@ionic/angular';\nimport { FieldType, FieldTypeConfig, FormlyFieldConfig } from '@ngx-formly/core';\nimport { FormlyFieldProps } from '@ngx-formly/ionic/form-field';\n\ninterface DatetimeProps extends FormlyFieldProps {\n presentation?: 'date' | 'date-time' | 'month' | 'month-year' | 'time' | 'time-date' | 'year';\n locale?: any;\n cancelText?: string;\n doneText?: string;\n dayValues?: number | number[] | string | undefined;\n hourValues?: number | number[] | string | undefined;\n minuteValues?: number | number[] | string | undefined;\n monthValues?: number | number[] | string | undefined;\n yearValues?: number | number[] | string | undefined;\n minDate?: string | undefined;\n maxDate?: string | undefined;\n displayFormat?: string;\n}\n\nexport interface FormlyDatetimeFieldConfig extends FormlyFieldConfig<DatetimeProps> {\n type: 'datetime' | Type<FormlyFieldDatetime>;\n}\n\n@Component({\n selector: 'formly-field-ion-datetime',\n template: `\n <ion-item\n [button]=\"true\"\n [detail]=\"false\"\n [disabled]=\"formControl.disabled\"\n [attr.aria-label]=\"props.allowHtml ? null : props.label\"\n [attr.aria-labelledby]=\"props.allowHtml ? id + '-label' : null\"\n aria-haspopup=\"dialog\"\n [attr.aria-expanded]=\"isOpen\"\n (click)=\"isOpen = true\"\n >\n <ion-label>\n @if (props.allowHtml) {\n <span\n [id]=\"id + '-label'\"\n [hidden]=\"props.hideLabel\"\n [innerHTML]=\"props.label\"\n (click)=\"onLabelInteraction($event)\"\n (keydown)=\"onLabelInteraction($event)\"\n ></span>\n } @else if (!props.hideLabel) {\n {{ props.label }}\n }\n @if (!props.hideLabel && props.required && !props.hideRequiredMarker) {\n <span aria-hidden=\"true\">*</span>\n }\n <p>{{ formControl.value ? (formControl.value | date: displayFormat()) : props.placeholder }}</p>\n </ion-label>\n </ion-item>\n <ion-modal\n [isOpen]=\"isOpen\"\n (didDismiss)=\"close()\"\n [cssClass]=\"'ion-datetime-modal ion-datetime-modal-' + props.presentation\"\n >\n <ng-template>\n <ion-datetime\n [locale]=\"props.locale\"\n [presentation]=\"props.presentation\"\n [cancelText]=\"props.cancelText\"\n [dayValues]=\"props.dayValues\"\n [doneText]=\"props.doneText\"\n [hourValues]=\"props.hourValues\"\n [minuteValues]=\"props.minuteValues\"\n [monthValues]=\"props.monthValues\"\n [yearValues]=\"props.yearValues\"\n [min]=\"props.minDate ? props.minDate : props.min\"\n [max]=\"props.maxDate ? props.maxDate : props.max\"\n [formControl]=\"formControl\"\n [ionFormlyAttributes]=\"field\"\n >\n <ion-buttons slot=\"buttons\">\n <ion-button (click)=\"reset()\">{{ props.cancelText || 'Cancel' }}</ion-button>\n <ion-button (click)=\"confirm()\">{{ props.doneText || 'Done' }}</ion-button>\n </ion-buttons>\n </ion-datetime>\n </ng-template>\n </ion-modal>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n styleUrls: ['./dattime.type.scss'],\n encapsulation: ViewEncapsulation.None,\n standalone: false,\n})\nexport class FormlyFieldDatetime extends FieldType<FieldTypeConfig<DatetimeProps>> {\n @ViewChild(IonDatetime) datetime!: IonDatetime;\n isOpen = false;\n\n override defaultOptions = {\n props: {\n presentation: 'month-year' as const,\n },\n };\n\n displayFormat() {\n if (this.props.displayFormat) {\n return this.props.displayFormat;\n }\n\n switch (this.props.presentation) {\n case 'date-time':\n case 'time-date':\n return 'short';\n case 'time':\n return 'shortTime';\n case 'month':\n return 'MMMM';\n case 'month-year':\n return 'MMMM, y';\n case 'year':\n return 'y';\n case 'date':\n return 'mediumDate';\n }\n }\n\n confirm() {\n this.datetime?.confirm();\n this.close();\n }\n\n reset() {\n this.datetime?.reset();\n this.close();\n }\n\n close() {\n this.isOpen = false;\n this.formControl.markAsTouched();\n }\n\n protected onLabelInteraction(event: Event) {\n if ((event.target as HTMLElement).closest('a[href]')) {\n event.stopPropagation();\n }\n }\n}\n","import { ConfigOption } from '@ngx-formly/core';\nimport { FormlyFieldDatetime } from './datetime.type';\n\nexport function withFormlyFieldDatetime(): ConfigOption {\n return {\n types: [\n {\n name: 'datetime',\n component: FormlyFieldDatetime,\n wrappers: ['form-field'],\n },\n ],\n };\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { FormlyModule } from '@ngx-formly/core';\nimport { ReactiveFormsModule } from '@angular/forms';\nimport { IonItem, IonLabel, IonModal, IonDatetime, IonButtons, IonButton } from '@ionic/angular';\nimport { FormlyFormFieldModule } from '@ngx-formly/ionic/form-field';\n\nimport { FormlyFieldDatetime } from './datetime.type';\nimport { withFormlyFieldDatetime } from './datetime.config';\n\n@NgModule({\n declarations: [FormlyFieldDatetime],\n imports: [\n CommonModule,\n ReactiveFormsModule,\n IonItem,\n IonLabel,\n IonModal,\n IonDatetime,\n IonButtons,\n IonButton,\n FormlyFormFieldModule,\n FormlyModule.forChild(withFormlyFieldDatetime()),\n ],\n})\nexport class FormlyDatetimeModule {}\n"],"mappings":";;;;;;;;;;;;AAyFA,IAAa,sBAAb,MAAa,4BAA4B,UAAyC;CAjElF,cAAA;;EAmEE,KAAA,SAAS;EAEA,KAAA,iBAAiB,EACxB,OAAO,EACL,cAAc,aACf,EACF;CA4CF;CA1CC,gBAAa;EACX,IAAI,KAAK,MAAM,eACb,OAAO,KAAK,MAAM;EAGpB,QAAQ,KAAK,MAAM,cAAnB;GACE,KAAK;GACL,KAAK,aACH,OAAO;GACT,KAAK,QACH,OAAO;GACT,KAAK,SACH,OAAO;GACT,KAAK,cACH,OAAO;GACT,KAAK,QACH,OAAO;GACT,KAAK,QACH,OAAO;EACX;CACF;CAEA,UAAO;EACL,KAAK,UAAU,QAAO;EACtB,KAAK,MAAK;CACZ;CAEA,QAAK;EACH,KAAK,UAAU,MAAK;EACpB,KAAK,MAAK;CACZ;CAEA,QAAK;EACH,KAAK,SAAS;EACd,KAAK,YAAY,cAAa;CAChC;CAEU,mBAAmB,OAAY;EACvC,IAAK,MAAM,OAAuB,QAAQ,SAAS,GACjD,MAAM,gBAAe;CAEzB;CAnDW;EAAA,KAAA,OAAA,GAAA,mBAAA;GAAA,YAAA;GAAA,SAAA;GAAA,UAAA;GAAA,MAAA;GAAm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