@elite.framework/ng.ui.core 1.0.59 → 1.0.61
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/elite.framework-ng.ui.core-datepicker.mjs +180 -158
- package/fesm2022/elite.framework-ng.ui.core-datepicker.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-generic-crud-table.mjs +168 -124
- package/fesm2022/elite.framework-ng.ui.core-generic-crud-table.mjs.map +1 -1
- package/fesm2022/elite.framework-ng.ui.core-generic-dialog.mjs +292 -0
- package/fesm2022/elite.framework-ng.ui.core-generic-dialog.mjs.map +1 -0
- package/fesm2022/elite.framework-ng.ui.core-generic-selector.mjs +100 -16
- package/fesm2022/elite.framework-ng.ui.core-generic-selector.mjs.map +1 -1
- package/generic-crud-table/index.d.ts +48 -16
- package/generic-dialog/README.md +3 -0
- package/generic-dialog/index.d.ts +92 -0
- package/generic-selector/index.d.ts +15 -2
- package/package.json +28 -24
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { NgModule, Component } from '@angular/core';
|
|
2
|
+
import { NgModule, ViewChild, Component } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i1$1 from '@ngx-formly/core';
|
|
6
|
-
import { FieldType, FormlyModule } from '@ngx-formly/core';
|
|
6
|
+
import { FieldType, FormlyAttributes, FormlyModule } from '@ngx-formly/core';
|
|
7
7
|
import * as i1 from '@angular/forms';
|
|
8
8
|
import { FormControl, FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
9
9
|
import * as i3 from 'primeng/datepicker';
|
|
@@ -12,10 +12,14 @@ import * as i4 from 'primeng/button';
|
|
|
12
12
|
import { ButtonModule } from 'primeng/button';
|
|
13
13
|
import * as i5 from 'primeng/inputtext';
|
|
14
14
|
import { InputTextModule } from 'primeng/inputtext';
|
|
15
|
-
import * as i6 from 'primeng/dialog';
|
|
16
15
|
import { DialogModule } from 'primeng/dialog';
|
|
17
|
-
import * as
|
|
16
|
+
import * as i8 from '@ngx-translate/core';
|
|
18
17
|
import { TranslateModule } from '@ngx-translate/core';
|
|
18
|
+
import * as i6 from 'primeng/inputgroup';
|
|
19
|
+
import { InputGroupModule } from 'primeng/inputgroup';
|
|
20
|
+
import * as i7 from 'primeng/inputgroupaddon';
|
|
21
|
+
import { InputGroupAddonModule } from 'primeng/inputgroupaddon';
|
|
22
|
+
import { SelectModule } from 'primeng/select';
|
|
19
23
|
import { FormlyFormFieldModule } from '@elite.framework/ng.ui.core/form-field';
|
|
20
24
|
|
|
21
25
|
class DatepickerModule {
|
|
@@ -31,6 +35,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
31
35
|
}] });
|
|
32
36
|
|
|
33
37
|
class FormlyFieldDatepicker extends FieldType {
|
|
38
|
+
datepickerComp;
|
|
34
39
|
dialogVisible = false;
|
|
35
40
|
get mode() {
|
|
36
41
|
return this.props['mode'] || 'date';
|
|
@@ -127,9 +132,11 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
127
132
|
if (minutes > 59)
|
|
128
133
|
minutes = 59;
|
|
129
134
|
this.timeControl.setValue(`${hours.toString().padStart(2, '0')}:${minutes.toString().padStart(2, '0')}`);
|
|
135
|
+
this.updateModel();
|
|
130
136
|
}
|
|
131
137
|
toggleAmPm() {
|
|
132
138
|
this.ampmControl.setValue(this.ampmControl.value === 'AM' ? 'PM' : 'AM');
|
|
139
|
+
this.updateModel();
|
|
133
140
|
}
|
|
134
141
|
updateModel() {
|
|
135
142
|
const dateVal = this.dateControl.value;
|
|
@@ -162,87 +169,91 @@ class FormlyFieldDatepicker extends FieldType {
|
|
|
162
169
|
}
|
|
163
170
|
}
|
|
164
171
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: FormlyFieldDatepicker, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
165
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "
|
|
166
|
-
<div class="w-full">
|
|
167
|
-
<span class="p-inputgroup">
|
|
168
|
-
<p-datepicker
|
|
169
|
-
*ngIf="mode === 'date'"
|
|
170
|
-
[(ngModel)]="dateControl.value"
|
|
171
|
-
[formControl]="dateControl"
|
|
172
|
-
dateFormat="yy-mm-dd"
|
|
173
|
-
[showIcon]="true"
|
|
174
|
-
inputId="buttondisplay"
|
|
175
|
-
[showOnFocus]="false"
|
|
176
|
-
appendTo="body"
|
|
177
|
-
class="flex-1 min-w-0"
|
|
178
|
-
(onSelect)="onDateChange()"
|
|
179
|
-
></p-datepicker>
|
|
180
|
-
<input
|
|
181
|
-
*ngIf="mode !== 'date'"
|
|
182
|
-
pInputText
|
|
183
|
-
readonly
|
|
184
|
-
[value]="displayValue"
|
|
185
|
-
class="flex-1 cursor-pointer bg-white border rounded-l-lg px-3 py-2"
|
|
186
|
-
/>
|
|
187
|
-
<button
|
|
188
|
-
*ngIf="mode !== 'date'"
|
|
189
|
-
style="padding: initial;"
|
|
190
|
-
pButton
|
|
191
|
-
type="button"
|
|
192
|
-
pRipple
|
|
193
|
-
icon="pi pi-calendar"
|
|
194
|
-
class="rounded-r-lg"
|
|
195
|
-
(click)="openDialog()"
|
|
196
|
-
></button>
|
|
197
|
-
</span>
|
|
198
|
-
</div>
|
|
172
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.8", type: FormlyFieldDatepicker, isStandalone: true, selector: "formly-field-primeng-datepicker", viewQueries: [{ propertyName: "datepickerComp", first: true, predicate: ["datepickerComp"], descendants: true }], usesInheritance: true, ngImport: i0, template: `
|
|
199
173
|
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
174
|
+
<p-inputGroup class="w-full">
|
|
175
|
+
<!-- [inputStyle]="{'border-left':'0'}" -->
|
|
176
|
+
@if (mode !== 'time') {
|
|
177
|
+
<p-datepicker
|
|
178
|
+
#datepickerComp
|
|
179
|
+
[(ngModel)]="dateControl.value"
|
|
180
|
+
[formControl]="dateControl"
|
|
181
|
+
dateFormat="yy-mm-dd"
|
|
182
|
+
placeholder="YYYY-MM-DD"
|
|
183
|
+
[showIcon]="false"
|
|
184
|
+
inputId="buttondisplay"
|
|
185
|
+
[showOnFocus]="true"
|
|
186
|
+
appendTo="body"
|
|
187
|
+
class="w-full rounded-none"
|
|
188
|
+
inputStyleClass="rtl:border-r-0 ltr:border-l-0"
|
|
189
|
+
dropdownMode="current"
|
|
190
|
+
[formlyAttributes]="field"
|
|
191
|
+
[disabled]="!!props.disabled"
|
|
192
|
+
(onSelect)="onDateChange()"
|
|
193
|
+
></p-datepicker>
|
|
194
|
+
}
|
|
215
195
|
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
196
|
+
@if (mode !== 'date') {
|
|
197
|
+
<input
|
|
198
|
+
pInputText
|
|
199
|
+
type="text"
|
|
200
|
+
placeholder="00:00"
|
|
201
|
+
maxlength="5"
|
|
202
|
+
[formControl]="timeControl"
|
|
203
|
+
(input)="onTimeInput($event)"
|
|
204
|
+
(blur)="onTimeChange()"
|
|
205
|
+
class="w-20"
|
|
206
|
+
[ngStyle]="{
|
|
207
|
+
'border-radius': mode == 'time' ? '':'0px',
|
|
208
|
+
'width': '53px !important',
|
|
209
|
+
'padding-left': mode == 'time' ? '':'2px',
|
|
210
|
+
'padding-right': mode == 'time' ? '':'2px',
|
|
211
|
+
'border-left':mode == 'time' ? '': '0px',
|
|
212
|
+
'border-right': mode == 'time' ? '': '0px'
|
|
213
|
+
}"
|
|
214
|
+
[classList]="mode == 'time' ? 'p-autocomplete-input p-component p-inputtext' : ''"
|
|
215
|
+
/>
|
|
228
216
|
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
217
|
+
<p-inputGroupAddon [style]="{'padding': 'initial'}">
|
|
218
|
+
<select
|
|
219
|
+
(change)="toggleAmPm()"
|
|
220
|
+
[disabled]="!!props.disabled"
|
|
221
|
+
style=" padding-top: 0.4rem;
|
|
222
|
+
padding-bottom: 0.5rem; padding-left: 0.5rem;
|
|
223
|
+
padding-right: 0.5rem;
|
|
224
|
+
background: var(--p-button-secondary-background);
|
|
225
|
+
"
|
|
226
|
+
class=" pr-8 bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed appearance-none"
|
|
227
|
+
>
|
|
228
|
+
<option value="AM" [selected]="ampmControl.value === 'AM'">{{'AM' | translate}}</option>
|
|
229
|
+
<option value="PM" [selected]="ampmControl.value === 'PM'">{{'PM' | translate}}</option>
|
|
230
|
+
</select>
|
|
231
|
+
</p-inputGroupAddon>
|
|
232
|
+
}
|
|
233
|
+
@if (mode == 'time') {
|
|
234
|
+
<p-inputGroupAddon>
|
|
235
|
+
<p-button
|
|
236
|
+
tabindex="-1"
|
|
237
|
+
[disabled]="!!props.disabled"
|
|
238
|
+
icon="pi pi-clock"
|
|
239
|
+
severity="primary"
|
|
240
|
+
/>
|
|
241
|
+
</p-inputGroupAddon>
|
|
242
|
+
}
|
|
243
|
+
@if (mode !== 'time') {
|
|
244
|
+
<p-inputGroupAddon>
|
|
245
|
+
<p-button
|
|
246
|
+
tabindex="-1"
|
|
247
|
+
[disabled]="!!props.disabled"
|
|
248
|
+
icon="pi pi-calendar"
|
|
249
|
+
(click)="datepickerComp.toggle()"
|
|
250
|
+
severity="primary"
|
|
251
|
+
/>
|
|
252
|
+
</p-inputGroupAddon>
|
|
253
|
+
}
|
|
254
|
+
</p-inputGroup>
|
|
239
255
|
|
|
240
|
-
|
|
241
|
-
<button pButton type="button" [label]="'CANCEL' | translate" class="p-button-text" (click)="dialogVisible = false"></button>
|
|
242
|
-
<button pButton type="button" [label]="'SAVE' | translate" (click)="saveDialog()"></button>
|
|
243
|
-
</ng-template>
|
|
244
|
-
</p-dialog>
|
|
245
|
-
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i3.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i4.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DialogModule }, { kind: "component", type: i6.Dialog, selector: "p-dialog", inputs: ["header", "draggable", "resizable", "contentStyle", "contentStyleClass", "modal", "closeOnEscape", "dismissableMask", "rtl", "closable", "breakpoints", "styleClass", "maskStyleClass", "maskStyle", "showHeader", "blockScroll", "autoZIndex", "baseZIndex", "minX", "minY", "focusOnShow", "maximizable", "keepInViewport", "focusTrap", "transitionOptions", "closeIcon", "closeAriaLabel", "closeTabindex", "minimizeIcon", "maximizeIcon", "closeButtonProps", "maximizeButtonProps", "visible", "style", "position", "role", "appendTo", "content", "contentTemplate", "footerTemplate", "closeIconTemplate", "maximizeIconTemplate", "minimizeIconTemplate", "headlessTemplate"], outputs: ["onShow", "onHide", "visibleChange", "onResizeInit", "onResizeEnd", "onDragEnd", "onMaximize"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i7.TranslatePipe, name: "translate" }] });
|
|
256
|
+
`, isInline: true, dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgSelectOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.ɵNgSelectMultipleOption, selector: "option", inputs: ["ngValue", "value"] }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i2.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: DatePickerModule }, { kind: "component", type: i3.DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "component", type: i4.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "buttonProps", "autofocus", "fluid"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: InputTextModule }, { kind: "directive", type: i5.InputText, selector: "[pInputText]", inputs: ["pSize", "variant", "fluid", "invalid"] }, { kind: "ngmodule", type: DialogModule }, { kind: "ngmodule", type: TranslateModule }, { kind: "ngmodule", type: InputGroupModule }, { kind: "component", type: i6.InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "ngmodule", type: InputGroupAddonModule }, { kind: "component", type: i7.InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: FormlyAttributes, selector: "[formlyAttributes]", inputs: ["formlyAttributes", "id"] }, { kind: "ngmodule", type: SelectModule }, { kind: "pipe", type: i8.TranslatePipe, name: "translate" }] });
|
|
246
257
|
}
|
|
247
258
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImport: i0, type: FormlyFieldDatepicker, decorators: [{
|
|
248
259
|
type: Component,
|
|
@@ -257,91 +268,102 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.8", ngImpor
|
|
|
257
268
|
ButtonModule,
|
|
258
269
|
InputTextModule,
|
|
259
270
|
DialogModule,
|
|
260
|
-
TranslateModule
|
|
271
|
+
TranslateModule,
|
|
272
|
+
InputGroupModule,
|
|
273
|
+
InputGroupAddonModule,
|
|
274
|
+
FormlyAttributes,
|
|
275
|
+
SelectModule
|
|
261
276
|
],
|
|
262
277
|
template: `
|
|
263
|
-
<div class="w-full">
|
|
264
|
-
<span class="p-inputgroup">
|
|
265
|
-
<p-datepicker
|
|
266
|
-
*ngIf="mode === 'date'"
|
|
267
|
-
[(ngModel)]="dateControl.value"
|
|
268
|
-
[formControl]="dateControl"
|
|
269
|
-
dateFormat="yy-mm-dd"
|
|
270
|
-
[showIcon]="true"
|
|
271
|
-
inputId="buttondisplay"
|
|
272
|
-
[showOnFocus]="false"
|
|
273
|
-
appendTo="body"
|
|
274
|
-
class="flex-1 min-w-0"
|
|
275
|
-
(onSelect)="onDateChange()"
|
|
276
|
-
></p-datepicker>
|
|
277
|
-
<input
|
|
278
|
-
*ngIf="mode !== 'date'"
|
|
279
|
-
pInputText
|
|
280
|
-
readonly
|
|
281
|
-
[value]="displayValue"
|
|
282
|
-
class="flex-1 cursor-pointer bg-white border rounded-l-lg px-3 py-2"
|
|
283
|
-
/>
|
|
284
|
-
<button
|
|
285
|
-
*ngIf="mode !== 'date'"
|
|
286
|
-
style="padding: initial;"
|
|
287
|
-
pButton
|
|
288
|
-
type="button"
|
|
289
|
-
pRipple
|
|
290
|
-
icon="pi pi-calendar"
|
|
291
|
-
class="rounded-r-lg"
|
|
292
|
-
(click)="openDialog()"
|
|
293
|
-
></button>
|
|
294
|
-
</span>
|
|
295
|
-
</div>
|
|
296
278
|
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
279
|
+
<p-inputGroup class="w-full">
|
|
280
|
+
<!-- [inputStyle]="{'border-left':'0'}" -->
|
|
281
|
+
@if (mode !== 'time') {
|
|
282
|
+
<p-datepicker
|
|
283
|
+
#datepickerComp
|
|
284
|
+
[(ngModel)]="dateControl.value"
|
|
285
|
+
[formControl]="dateControl"
|
|
286
|
+
dateFormat="yy-mm-dd"
|
|
287
|
+
placeholder="YYYY-MM-DD"
|
|
288
|
+
[showIcon]="false"
|
|
289
|
+
inputId="buttondisplay"
|
|
290
|
+
[showOnFocus]="true"
|
|
291
|
+
appendTo="body"
|
|
292
|
+
class="w-full rounded-none"
|
|
293
|
+
inputStyleClass="rtl:border-r-0 ltr:border-l-0"
|
|
294
|
+
dropdownMode="current"
|
|
295
|
+
[formlyAttributes]="field"
|
|
296
|
+
[disabled]="!!props.disabled"
|
|
297
|
+
(onSelect)="onDateChange()"
|
|
298
|
+
></p-datepicker>
|
|
299
|
+
}
|
|
312
300
|
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
301
|
+
@if (mode !== 'date') {
|
|
302
|
+
<input
|
|
303
|
+
pInputText
|
|
304
|
+
type="text"
|
|
305
|
+
placeholder="00:00"
|
|
306
|
+
maxlength="5"
|
|
307
|
+
[formControl]="timeControl"
|
|
308
|
+
(input)="onTimeInput($event)"
|
|
309
|
+
(blur)="onTimeChange()"
|
|
310
|
+
class="w-20"
|
|
311
|
+
[ngStyle]="{
|
|
312
|
+
'border-radius': mode == 'time' ? '':'0px',
|
|
313
|
+
'width': '53px !important',
|
|
314
|
+
'padding-left': mode == 'time' ? '':'2px',
|
|
315
|
+
'padding-right': mode == 'time' ? '':'2px',
|
|
316
|
+
'border-left':mode == 'time' ? '': '0px',
|
|
317
|
+
'border-right': mode == 'time' ? '': '0px'
|
|
318
|
+
}"
|
|
319
|
+
[classList]="mode == 'time' ? 'p-autocomplete-input p-component p-inputtext' : ''"
|
|
320
|
+
/>
|
|
325
321
|
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
322
|
+
<p-inputGroupAddon [style]="{'padding': 'initial'}">
|
|
323
|
+
<select
|
|
324
|
+
(change)="toggleAmPm()"
|
|
325
|
+
[disabled]="!!props.disabled"
|
|
326
|
+
style=" padding-top: 0.4rem;
|
|
327
|
+
padding-bottom: 0.5rem; padding-left: 0.5rem;
|
|
328
|
+
padding-right: 0.5rem;
|
|
329
|
+
background: var(--p-button-secondary-background);
|
|
330
|
+
"
|
|
331
|
+
class=" pr-8 bg-white text-gray-700 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent disabled:opacity-50 disabled:cursor-not-allowed appearance-none"
|
|
332
|
+
>
|
|
333
|
+
<option value="AM" [selected]="ampmControl.value === 'AM'">{{'AM' | translate}}</option>
|
|
334
|
+
<option value="PM" [selected]="ampmControl.value === 'PM'">{{'PM' | translate}}</option>
|
|
335
|
+
</select>
|
|
336
|
+
</p-inputGroupAddon>
|
|
337
|
+
}
|
|
338
|
+
@if (mode == 'time') {
|
|
339
|
+
<p-inputGroupAddon>
|
|
340
|
+
<p-button
|
|
341
|
+
tabindex="-1"
|
|
342
|
+
[disabled]="!!props.disabled"
|
|
343
|
+
icon="pi pi-clock"
|
|
344
|
+
severity="primary"
|
|
345
|
+
/>
|
|
346
|
+
</p-inputGroupAddon>
|
|
347
|
+
}
|
|
348
|
+
@if (mode !== 'time') {
|
|
349
|
+
<p-inputGroupAddon>
|
|
350
|
+
<p-button
|
|
351
|
+
tabindex="-1"
|
|
352
|
+
[disabled]="!!props.disabled"
|
|
353
|
+
icon="pi pi-calendar"
|
|
354
|
+
(click)="datepickerComp.toggle()"
|
|
355
|
+
severity="primary"
|
|
356
|
+
/>
|
|
357
|
+
</p-inputGroupAddon>
|
|
358
|
+
}
|
|
359
|
+
</p-inputGroup>
|
|
336
360
|
|
|
337
|
-
<ng-template #footer>
|
|
338
|
-
<button pButton type="button" [label]="'CANCEL' | translate" class="p-button-text" (click)="dialogVisible = false"></button>
|
|
339
|
-
<button pButton type="button" [label]="'SAVE' | translate" (click)="saveDialog()"></button>
|
|
340
|
-
</ng-template>
|
|
341
|
-
</p-dialog>
|
|
342
361
|
`,
|
|
343
362
|
}]
|
|
344
|
-
}]
|
|
363
|
+
}], propDecorators: { datepickerComp: [{
|
|
364
|
+
type: ViewChild,
|
|
365
|
+
args: ['datepickerComp']
|
|
366
|
+
}] } });
|
|
345
367
|
|
|
346
368
|
function withFormlyFieldDatepicker() {
|
|
347
369
|
return {
|