@po-ui/ng-components 21.8.0 → 21.9.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/fesm2022/po-ui-ng-components.mjs +4720 -351
- package/fesm2022/po-ui-ng-components.mjs.map +1 -1
- package/lib/components/index.d.ts +1 -0
- package/lib/components/po-button/po-button-base.component.d.ts +10 -0
- package/lib/components/po-calendar/constants/po-calendar-range-presets.constant.d.ts +2 -0
- package/lib/components/po-calendar/index.d.ts +2 -0
- package/lib/components/po-calendar/interfaces/po-calendar-range-preset.interface.d.ts +16 -0
- package/lib/components/po-calendar/po-calendar-base.component.d.ts +54 -0
- package/lib/components/po-calendar/po-calendar-footer/po-calendar-footer.component.d.ts +16 -0
- package/lib/components/po-calendar/po-calendar-preset-list/po-calendar-preset-list.component.d.ts +28 -0
- package/lib/components/po-calendar/po-calendar-wrapper/po-calendar-wrapper.component.d.ts +9 -3
- package/lib/components/po-calendar/po-calendar.component.d.ts +28 -3
- package/lib/components/po-calendar/services/po-calendar.lang.service.d.ts +2 -0
- package/lib/components/po-dynamic/po-dynamic-form/interfaces/po-dynamic-form-field.interface.d.ts +58 -7
- package/lib/components/po-field/index.d.ts +3 -0
- package/lib/components/po-field/po-datepicker-range/po-datepicker-range-base.component.d.ts +54 -0
- package/lib/components/po-field/po-datepicker-range/po-datepicker-range.component.d.ts +18 -0
- package/lib/components/po-field/po-textarea/po-textarea.component.d.ts +2 -1
- package/lib/components/po-field/po-timepicker/enums/po-timepicker-iso-format.enum.d.ts +13 -0
- package/lib/components/po-field/po-timepicker/index.d.ts +3 -0
- package/lib/components/po-field/po-timepicker/po-timepicker-base.component.d.ts +374 -0
- package/lib/components/po-field/po-timepicker/po-timepicker.component.d.ts +206 -0
- package/lib/components/po-field/po-timepicker/po-timepicker.literals.d.ts +46 -0
- package/lib/components/po-field/po-timepicker/po-timepicker.module.d.ts +7 -0
- package/lib/components/po-search/po-search.component.d.ts +0 -1
- package/lib/components/po-timer/enums/po-timer-format.enum.d.ts +13 -0
- package/lib/components/po-timer/index.d.ts +4 -0
- package/lib/components/po-timer/po-timer-base.component.d.ts +255 -0
- package/lib/components/po-timer/po-timer-scroll.helper.d.ts +40 -0
- package/lib/components/po-timer/po-timer.component.d.ts +208 -0
- package/lib/components/po-timer/po-timer.literals.d.ts +22 -0
- package/lib/components/po-timer/po-timer.module.d.ts +6 -0
- package/package.json +4 -4
- package/po-ui-ng-components-21.9.0.tgz +0 -0
- package/schematics/ng-add/index.js +1 -1
- package/schematics/ng-update/v14/index.js +1 -1
- package/schematics/ng-update/v15/index.js +1 -1
- package/schematics/ng-update/v16/index.js +1 -1
- package/schematics/ng-update/v17/index.js +1 -1
- package/schematics/ng-update/v18/index.js +2 -2
- package/schematics/ng-update/v19/index.js +2 -2
- package/schematics/ng-update/v2/index.js +1 -1
- package/schematics/ng-update/v20/index.js +2 -2
- package/schematics/ng-update/v21/index.js +1 -1
- package/schematics/ng-update/v3/index.js +1 -1
- package/schematics/ng-update/v4/index.js +1 -1
- package/schematics/ng-update/v5/index.js +1 -1
- package/schematics/ng-update/v6/index.js +1 -1
- package/types/po-ui-ng-components.d.ts +1533 -164
- package/po-ui-ng-components-21.8.0.tgz +0 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { AbstractControl, ControlValueAccessor, Validator } from '@angular/forms';
|
|
3
|
+
import { PoMask } from '../po-input/po-mask';
|
|
4
|
+
import { PoLanguageService } from '../../../services/po-language/po-language.service';
|
|
5
|
+
import { PoTimepickerModelFormat } from './enums/po-timepicker-iso-format.enum';
|
|
6
|
+
import { PoTimerFormat } from '../../po-timer/enums/po-timer-format.enum';
|
|
7
|
+
import { PoHelperOptions } from '../../po-helper';
|
|
8
|
+
/**
|
|
9
|
+
* @description
|
|
10
|
+
*
|
|
11
|
+
* O `po-timepicker` é um componente para seleção de horário que permite a digitação e/ou seleção via painel flutuante.
|
|
12
|
+
*
|
|
13
|
+
* O formato de exibição do horário pode ser de 24 horas (`HH:mm`) ou 12 horas (`hh:mm AM/PM`),
|
|
14
|
+
* e opcionalmente incluir segundos (`HH:mm:ss`).
|
|
15
|
+
*
|
|
16
|
+
* O valor de saída segue o formato ISO 8601 para horários (`HH:mm` ou `HH:mm:ss`).
|
|
17
|
+
*
|
|
18
|
+
* **Importante:**
|
|
19
|
+
*
|
|
20
|
+
* - Caso o valor digitado seja inválido, o `model` receberá uma string vazia.
|
|
21
|
+
* - Caso o `input` esteja passando um `[(ngModel)]`, mas não tenha um `name`, então irá ocorrer um erro
|
|
22
|
+
* do próprio Angular (`[ngModelOptions]="{standalone: true}"`).
|
|
23
|
+
*
|
|
24
|
+
* > Não esqueça de importar o `FormsModule` em seu módulo, tal como para utilizar o `input default`.
|
|
25
|
+
*
|
|
26
|
+
* #### Tokens customizáveis
|
|
27
|
+
*
|
|
28
|
+
* É possível alterar o estilo do componente usando os seguintes tokens (CSS):
|
|
29
|
+
* Obs: Só é possível realizar alterações ao adicionar a classe `.po-input`
|
|
30
|
+
*
|
|
31
|
+
* > Para maiores informações, acesse o guia [Personalizando o Tema Padrão com Tokens CSS](https://po-ui.io/guides/theme-customization).
|
|
32
|
+
*
|
|
33
|
+
* | Propriedade | Descrição | Valor Padrão |
|
|
34
|
+
* |----------------------------------------|-------------------------------------------------------|--------------------------------------------------|
|
|
35
|
+
* | **Default Values** | | |
|
|
36
|
+
* | `--font-family` | Família tipográfica usada | `var(--font-family-theme)` |
|
|
37
|
+
* | `--font-size` | Tamanho da fonte | `var(--font-size-default)` |
|
|
38
|
+
* | `--text-color-placeholder` | Cor do texto placeholder | `var(--color-neutral-light-30)` |
|
|
39
|
+
* | `--color` | Cor principal do timepicker | `var(--color-neutral-dark-70)` |
|
|
40
|
+
* | `--background` | Cor de background | `var(--color-neutral-light-05)` |
|
|
41
|
+
* | `--padding` | Preenchimento | `0 0.5rem` |
|
|
42
|
+
* | `--text-color` | Cor do texto | `var(--color-neutral-dark-90)` |
|
|
43
|
+
* | `--field-container-title-justify` | Alinhamento horizontal do título (`justify-content`) | `space-between` |
|
|
44
|
+
* | `--field-container-title-flex` | Flex do título (`flex`) | `1 auto` |
|
|
45
|
+
* | **Hover** | | |
|
|
46
|
+
* | `--color-hover` | Cor principal no estado hover | `var(--color-brand-01-dark)` |
|
|
47
|
+
* | `--background-hover` | Cor de background no estado hover | `var(--color-brand-01-lightest)` |
|
|
48
|
+
* | **Focused** | | |
|
|
49
|
+
* | `--color-focused` | Cor principal no estado de focus | `var(--color-action-default)` |
|
|
50
|
+
* | `--outline-color-focused` | Cor do outline do estado de focus | `var(--color-action-focus)` |
|
|
51
|
+
* | **Disabled** | | |
|
|
52
|
+
* | `--color-disabled` | Cor principal no estado disabled | `var(--color-neutral-light-30)` |
|
|
53
|
+
* | `--background-disabled` | Cor de background no estado disabled | `var(--color-neutral-light-20)` |
|
|
54
|
+
* | `--text-color-disabled` | Cor do texto no estado disabled | `var(--color-neutral-dark-70)` |
|
|
55
|
+
*/
|
|
56
|
+
export declare abstract class PoTimepickerBaseComponent implements ControlValueAccessor, OnInit, Validator {
|
|
57
|
+
protected languageService: PoLanguageService;
|
|
58
|
+
protected cd: ChangeDetectorRef;
|
|
59
|
+
additionalHelpEventTrigger: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* @optional
|
|
62
|
+
*
|
|
63
|
+
* @description
|
|
64
|
+
*
|
|
65
|
+
* Aplica foco no elemento ao ser iniciado.
|
|
66
|
+
*
|
|
67
|
+
* @default `false`
|
|
68
|
+
*/
|
|
69
|
+
autoFocus: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* @Input
|
|
72
|
+
*
|
|
73
|
+
* @optional
|
|
74
|
+
*
|
|
75
|
+
* @description
|
|
76
|
+
* Define se o título do campo será exibido de forma compacta.
|
|
77
|
+
*
|
|
78
|
+
* @default `false`
|
|
79
|
+
*/
|
|
80
|
+
compactLabel: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
81
|
+
/** Nome do componente. */
|
|
82
|
+
name: string;
|
|
83
|
+
/**
|
|
84
|
+
* @optional
|
|
85
|
+
*
|
|
86
|
+
* @description
|
|
87
|
+
*
|
|
88
|
+
* Define se a indicação de campo opcional será exibida.
|
|
89
|
+
*
|
|
90
|
+
* @default `false`
|
|
91
|
+
*/
|
|
92
|
+
optional: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Mensagem apresentada quando o horário for inválido ou fora do período.
|
|
95
|
+
*
|
|
96
|
+
* > Por padrão, esta mensagem não é apresentada quando o campo estiver vazio, mesmo que ele seja requerido.
|
|
97
|
+
*/
|
|
98
|
+
errorPattern?: string;
|
|
99
|
+
/**
|
|
100
|
+
* @optional
|
|
101
|
+
*
|
|
102
|
+
* @description
|
|
103
|
+
*
|
|
104
|
+
* Limita a exibição da mensagem de erro a duas linhas e exibe um tooltip com o texto completo.
|
|
105
|
+
*
|
|
106
|
+
* @default `false`
|
|
107
|
+
*/
|
|
108
|
+
errorLimit: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* @optional
|
|
111
|
+
*
|
|
112
|
+
* @description
|
|
113
|
+
*
|
|
114
|
+
* Exibe a mensagem setada na propriedade `p-error-pattern` se o campo estiver vazio e for requerido.
|
|
115
|
+
*
|
|
116
|
+
* @default `false`
|
|
117
|
+
*/
|
|
118
|
+
showErrorMessageRequired: boolean;
|
|
119
|
+
/** Evento disparado ao sair do campo. */
|
|
120
|
+
onblur: EventEmitter<any>;
|
|
121
|
+
/** Evento disparado ao alterar valor do campo. */
|
|
122
|
+
onchange: EventEmitter<any>;
|
|
123
|
+
/** Evento disparado quando uma tecla é pressionada enquanto o foco está no componente. */
|
|
124
|
+
keydown: EventEmitter<KeyboardEvent>;
|
|
125
|
+
/**
|
|
126
|
+
* @Input
|
|
127
|
+
*
|
|
128
|
+
* @optional
|
|
129
|
+
*
|
|
130
|
+
* @description
|
|
131
|
+
*
|
|
132
|
+
* Define as opções do componente de ajuda (po-helper).
|
|
133
|
+
*/
|
|
134
|
+
poHelperComponent: import("@angular/core").InputSignal<string | PoHelperOptions>;
|
|
135
|
+
/**
|
|
136
|
+
* @Input
|
|
137
|
+
*
|
|
138
|
+
* @optional
|
|
139
|
+
*
|
|
140
|
+
* @description
|
|
141
|
+
*
|
|
142
|
+
* Habilita a quebra automática do texto da propriedade `p-label`.
|
|
143
|
+
*
|
|
144
|
+
* @default `false`
|
|
145
|
+
*/
|
|
146
|
+
labelTextWrap: import("@angular/core").InputSignal<boolean>;
|
|
147
|
+
/** Desabilita o campo. */
|
|
148
|
+
disabled?: boolean;
|
|
149
|
+
/** Torna o elemento somente leitura. */
|
|
150
|
+
readonly?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* @optional
|
|
153
|
+
*
|
|
154
|
+
* @description
|
|
155
|
+
*
|
|
156
|
+
* Define que o campo será obrigatório.
|
|
157
|
+
*
|
|
158
|
+
* @default `false`
|
|
159
|
+
*/
|
|
160
|
+
required?: boolean;
|
|
161
|
+
/** Habilita ação para limpar o campo. */
|
|
162
|
+
clean?: boolean;
|
|
163
|
+
protected onChangeModel: any;
|
|
164
|
+
protected validatorChange: any;
|
|
165
|
+
protected onTouchedModel: any;
|
|
166
|
+
protected shortLanguage: string;
|
|
167
|
+
protected isInvalid: boolean;
|
|
168
|
+
protected hasValidatorRequired: boolean;
|
|
169
|
+
protected objMask: PoMask;
|
|
170
|
+
private _format;
|
|
171
|
+
private _modelFormat;
|
|
172
|
+
private _maxTime;
|
|
173
|
+
private _minTime;
|
|
174
|
+
private _minuteInterval;
|
|
175
|
+
private _secondInterval;
|
|
176
|
+
private _showSeconds;
|
|
177
|
+
private _noAutocomplete?;
|
|
178
|
+
private _placeholder?;
|
|
179
|
+
private _loading?;
|
|
180
|
+
private _size?;
|
|
181
|
+
private _initialSize?;
|
|
182
|
+
private _locale?;
|
|
183
|
+
private _timeValue;
|
|
184
|
+
private _validationValue?;
|
|
185
|
+
private _validationMinHour?;
|
|
186
|
+
private _validationMaxHour?;
|
|
187
|
+
private previousValue;
|
|
188
|
+
private pendingChangeValue;
|
|
189
|
+
/**
|
|
190
|
+
* @optional
|
|
191
|
+
*
|
|
192
|
+
* @description
|
|
193
|
+
*
|
|
194
|
+
* Define a propriedade nativa `autocomplete` do campo como `off`.
|
|
195
|
+
*
|
|
196
|
+
* @default `false`
|
|
197
|
+
*/
|
|
198
|
+
set noAutocomplete(value: boolean);
|
|
199
|
+
get noAutocomplete(): boolean;
|
|
200
|
+
/**
|
|
201
|
+
* @optional
|
|
202
|
+
*
|
|
203
|
+
* @description
|
|
204
|
+
*
|
|
205
|
+
* Mensagem que aparecerá enquanto o campo não estiver preenchido.
|
|
206
|
+
*
|
|
207
|
+
* Para personalizar os segmentos, informe o valor no formato `HH:mm` ou `HH:mm:ss`.
|
|
208
|
+
*/
|
|
209
|
+
set placeholder(placeholder: string);
|
|
210
|
+
get placeholder(): string;
|
|
211
|
+
set setDisabled(disabled: string);
|
|
212
|
+
set setReadonly(readonly: string);
|
|
213
|
+
set setRequired(required: string);
|
|
214
|
+
/** Define se a indicação de campo obrigatório será exibida. */
|
|
215
|
+
showRequired: boolean;
|
|
216
|
+
/**
|
|
217
|
+
* @optional
|
|
218
|
+
*
|
|
219
|
+
* @description
|
|
220
|
+
*
|
|
221
|
+
* Define o tamanho do componente:
|
|
222
|
+
* - `small`: altura do input como 32px (disponível apenas para acessibilidade AA).
|
|
223
|
+
* - `medium`: altura do input como 44px.
|
|
224
|
+
*
|
|
225
|
+
* @default `medium`
|
|
226
|
+
*/
|
|
227
|
+
set size(value: string);
|
|
228
|
+
get size(): string;
|
|
229
|
+
set setClean(clean: string);
|
|
230
|
+
/**
|
|
231
|
+
* @optional
|
|
232
|
+
*
|
|
233
|
+
* @description
|
|
234
|
+
*
|
|
235
|
+
* Define o formato de exibição do timer.
|
|
236
|
+
*
|
|
237
|
+
* Valores válidos:
|
|
238
|
+
* - `24`: formato de 24 horas (padrão)
|
|
239
|
+
* - `12`: formato de 12 horas com indicador AM/PM
|
|
240
|
+
*
|
|
241
|
+
* @default `24`
|
|
242
|
+
*/
|
|
243
|
+
set format(value: PoTimerFormat);
|
|
244
|
+
get format(): PoTimerFormat;
|
|
245
|
+
/**
|
|
246
|
+
* @optional
|
|
247
|
+
*
|
|
248
|
+
* @description
|
|
249
|
+
*
|
|
250
|
+
* Define o horário mínimo permitido. Formato: `HH:mm` ou `HH:mm:ss`.
|
|
251
|
+
*/
|
|
252
|
+
set minTime(value: string);
|
|
253
|
+
get minTime(): string;
|
|
254
|
+
/**
|
|
255
|
+
* @optional
|
|
256
|
+
*
|
|
257
|
+
* @description
|
|
258
|
+
*
|
|
259
|
+
* Define o horário máximo permitido. Formato: `HH:mm` ou `HH:mm:ss`.
|
|
260
|
+
*/
|
|
261
|
+
set maxTime(value: string);
|
|
262
|
+
get maxTime(): string;
|
|
263
|
+
/**
|
|
264
|
+
* @optional
|
|
265
|
+
*
|
|
266
|
+
* @description
|
|
267
|
+
*
|
|
268
|
+
* Define o intervalo entre os minutos exibidos no painel.
|
|
269
|
+
*
|
|
270
|
+
* @default `5`
|
|
271
|
+
*/
|
|
272
|
+
set minuteInterval(value: number);
|
|
273
|
+
get minuteInterval(): number;
|
|
274
|
+
/**
|
|
275
|
+
* @optional
|
|
276
|
+
*
|
|
277
|
+
* @description
|
|
278
|
+
*
|
|
279
|
+
* Define o intervalo entre os segundos exibidos no painel.
|
|
280
|
+
*
|
|
281
|
+
* @default `1`
|
|
282
|
+
*/
|
|
283
|
+
set secondInterval(value: number);
|
|
284
|
+
get secondInterval(): number;
|
|
285
|
+
/**
|
|
286
|
+
* @optional
|
|
287
|
+
*
|
|
288
|
+
* @description
|
|
289
|
+
*
|
|
290
|
+
* Exibe a coluna de segundos no painel.
|
|
291
|
+
*
|
|
292
|
+
* @default `false`
|
|
293
|
+
*/
|
|
294
|
+
set showSeconds(value: boolean);
|
|
295
|
+
get showSeconds(): boolean;
|
|
296
|
+
/**
|
|
297
|
+
* @optional
|
|
298
|
+
*
|
|
299
|
+
* @description
|
|
300
|
+
*
|
|
301
|
+
* Padrão de formatação para saída do *model*.
|
|
302
|
+
*
|
|
303
|
+
* > Veja os valores válidos no *enum* `PoTimepickerModelFormat`.
|
|
304
|
+
*/
|
|
305
|
+
set modelFormat(value: PoTimepickerModelFormat);
|
|
306
|
+
get modelFormat(): PoTimepickerModelFormat;
|
|
307
|
+
/**
|
|
308
|
+
* @optional
|
|
309
|
+
*
|
|
310
|
+
* @description
|
|
311
|
+
*
|
|
312
|
+
* Idioma do componente.
|
|
313
|
+
*/
|
|
314
|
+
set locale(value: string);
|
|
315
|
+
get locale(): string;
|
|
316
|
+
/**
|
|
317
|
+
* @optional
|
|
318
|
+
*
|
|
319
|
+
* @description
|
|
320
|
+
* Exibe um ícone de carregamento no lado direito do campo para sinalizar que uma operação está em andamento.
|
|
321
|
+
*
|
|
322
|
+
* @default `false`
|
|
323
|
+
*/
|
|
324
|
+
set loading(value: boolean);
|
|
325
|
+
get loading(): boolean;
|
|
326
|
+
get isDisabled(): boolean;
|
|
327
|
+
/**
|
|
328
|
+
* @optional
|
|
329
|
+
*
|
|
330
|
+
* @description
|
|
331
|
+
*
|
|
332
|
+
* Define que o painel do timer será incluído no body da página.
|
|
333
|
+
*
|
|
334
|
+
* @default `false`
|
|
335
|
+
*/
|
|
336
|
+
appendBox: boolean;
|
|
337
|
+
get is12HourFormat(): boolean;
|
|
338
|
+
constructor(languageService: PoLanguageService, cd: ChangeDetectorRef);
|
|
339
|
+
ngOnInit(): void;
|
|
340
|
+
protected onThemeChange(): void;
|
|
341
|
+
get autocomplete(): "off" | "on";
|
|
342
|
+
get timeValue(): string;
|
|
343
|
+
set timeValue(value: string);
|
|
344
|
+
protected updateMask(): void;
|
|
345
|
+
protected isValidTimeString(value: string, minHour?: number, maxHour?: number): boolean;
|
|
346
|
+
protected isTimeInRange(time: string): boolean;
|
|
347
|
+
protected timeToMinutes(time: string): number;
|
|
348
|
+
protected formatOutput(time: string): string;
|
|
349
|
+
protected setValidationValue(value?: string, minHour?: number, maxHour?: number): void;
|
|
350
|
+
protected clearValidationValue(): void;
|
|
351
|
+
protected hasValidationValue(): boolean;
|
|
352
|
+
protected getValidationValue(controlValue: any): string;
|
|
353
|
+
protected getValidationHourRange(): {
|
|
354
|
+
minHour: number;
|
|
355
|
+
maxHour: number;
|
|
356
|
+
} | undefined;
|
|
357
|
+
protected isGeneratedErrorPattern(errorPattern: string): boolean;
|
|
358
|
+
protected getDefaultInvalidTimeMessage(): string;
|
|
359
|
+
protected getDefaultOutOfRangeTimeMessage(): string;
|
|
360
|
+
protected callOnChange(value: any): void;
|
|
361
|
+
mapSizeToIcon(size: string): string;
|
|
362
|
+
setDisabledState(isDisabled: boolean): void;
|
|
363
|
+
registerOnChange(func: any): void;
|
|
364
|
+
registerOnTouched(func: any): void;
|
|
365
|
+
registerOnValidatorChange(fn: () => void): void;
|
|
366
|
+
validate(c: AbstractControl): {
|
|
367
|
+
[key: string]: any;
|
|
368
|
+
};
|
|
369
|
+
protected validateModel(model: any): void;
|
|
370
|
+
private applySizeBasedOnA11y;
|
|
371
|
+
protected onLocaleChange(): void;
|
|
372
|
+
abstract writeValue(value: any): void;
|
|
373
|
+
abstract refreshValue(value: string): void;
|
|
374
|
+
}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { AfterViewInit, ElementRef, OnChanges, OnDestroy, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { PoButtonComponent } from '../../po-button/po-button.component';
|
|
3
|
+
import { PoTimerComponent } from '../../po-timer/po-timer.component';
|
|
4
|
+
import { PoTimepickerBaseComponent } from './po-timepicker-base.component';
|
|
5
|
+
import { PoHelperComponent } from '../../po-helper';
|
|
6
|
+
type PoTimepickerSegment = 'hour' | 'minute' | 'second';
|
|
7
|
+
/**
|
|
8
|
+
* @docsExtends PoTimepickerBaseComponent
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
*
|
|
12
|
+
* <example name="po-timepicker-basic" title="PO Timepicker Basic">
|
|
13
|
+
* <file name="sample-po-timepicker-basic/sample-po-timepicker-basic.component.html"> </file>
|
|
14
|
+
* <file name="sample-po-timepicker-basic/sample-po-timepicker-basic.component.ts"> </file>
|
|
15
|
+
* </example>
|
|
16
|
+
*
|
|
17
|
+
* <example name="po-timepicker-labs" title="PO Timepicker Labs">
|
|
18
|
+
* <file name="sample-po-timepicker-labs/sample-po-timepicker-labs.component.html"> </file>
|
|
19
|
+
* <file name="sample-po-timepicker-labs/sample-po-timepicker-labs.component.ts"> </file>
|
|
20
|
+
* </example>
|
|
21
|
+
*
|
|
22
|
+
* <example name="po-timepicker-scheduling" title="PO Timepicker - Scheduling">
|
|
23
|
+
* <file name="sample-po-timepicker-scheduling/sample-po-timepicker-scheduling.component.html"> </file>
|
|
24
|
+
* <file name="sample-po-timepicker-scheduling/sample-po-timepicker-scheduling.component.ts"> </file>
|
|
25
|
+
* </example>
|
|
26
|
+
*
|
|
27
|
+
* <example name="po-timepicker-business-hours" title="PO Timepicker - Business Hours">
|
|
28
|
+
* <file name="sample-po-timepicker-business-hours/sample-po-timepicker-business-hours.component.html"> </file>
|
|
29
|
+
* <file name="sample-po-timepicker-business-hours/sample-po-timepicker-business-hours.component.ts"> </file>
|
|
30
|
+
* </example>
|
|
31
|
+
*/
|
|
32
|
+
export declare class PoTimepickerComponent extends PoTimepickerBaseComponent implements AfterViewInit, OnDestroy, OnChanges {
|
|
33
|
+
private readonly controlPosition;
|
|
34
|
+
private readonly renderer;
|
|
35
|
+
dialogPicker: ElementRef;
|
|
36
|
+
iconTimepicker: PoButtonComponent;
|
|
37
|
+
inputEl: ElementRef;
|
|
38
|
+
minuteInputEl: ElementRef;
|
|
39
|
+
secondInputEl: ElementRef;
|
|
40
|
+
timepickerFieldEl: ElementRef;
|
|
41
|
+
iconClean: ElementRef<HTMLElement>;
|
|
42
|
+
helperEl?: PoHelperComponent;
|
|
43
|
+
timerComponent?: PoTimerComponent;
|
|
44
|
+
periodInputEl: ElementRef;
|
|
45
|
+
/** Rótulo do campo. */
|
|
46
|
+
label?: string;
|
|
47
|
+
/** Texto de apoio do campo. */
|
|
48
|
+
help?: string;
|
|
49
|
+
displayAdditionalHelp: boolean;
|
|
50
|
+
el: ElementRef;
|
|
51
|
+
id: string;
|
|
52
|
+
visible: boolean;
|
|
53
|
+
literals: any;
|
|
54
|
+
hourDisplay: string;
|
|
55
|
+
minuteDisplay: string;
|
|
56
|
+
secondDisplay: string;
|
|
57
|
+
periodDisplay: string;
|
|
58
|
+
isSegmentFocused: boolean;
|
|
59
|
+
ariaLiveMessage: string;
|
|
60
|
+
eventListenerFunction: () => void;
|
|
61
|
+
eventResizeListener: () => void;
|
|
62
|
+
get cleanElementRef(): {
|
|
63
|
+
nativeElement: {
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
private clickListener;
|
|
68
|
+
private timeoutChange;
|
|
69
|
+
private valueBeforeChange;
|
|
70
|
+
constructor();
|
|
71
|
+
get hourPlaceholder(): string;
|
|
72
|
+
get minutePlaceholder(): string;
|
|
73
|
+
get secondPlaceholder(): string;
|
|
74
|
+
private get customPlaceholderSegments();
|
|
75
|
+
private getCustomPlaceholderSegment;
|
|
76
|
+
onHostFocusOut(event: FocusEvent): void;
|
|
77
|
+
onKeydown($event?: any): void;
|
|
78
|
+
ngAfterViewInit(): void;
|
|
79
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
80
|
+
ngOnDestroy(): void;
|
|
81
|
+
protected onLocaleChange(): void;
|
|
82
|
+
emitAdditionalHelp(): void;
|
|
83
|
+
/**
|
|
84
|
+
* Função que atribui foco ao componente.
|
|
85
|
+
*
|
|
86
|
+
* Para utilizá-la é necessário ter a instância do componente no DOM, podendo ser utilizado o ViewChild da seguinte forma:
|
|
87
|
+
*
|
|
88
|
+
* ```
|
|
89
|
+
* import { PoTimepickerComponent } from '@po-ui/ng-components';
|
|
90
|
+
*
|
|
91
|
+
* ...
|
|
92
|
+
*
|
|
93
|
+
* @ViewChild(PoTimepickerComponent, { static: true }) timepicker: PoTimepickerComponent;
|
|
94
|
+
*
|
|
95
|
+
* focusTimepicker() {
|
|
96
|
+
* this.timepicker.focus();
|
|
97
|
+
* }
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
focus(): void;
|
|
101
|
+
getAdditionalHelpTooltip(): any;
|
|
102
|
+
togglePicker(focusInput?: boolean): void;
|
|
103
|
+
closeTimer(focusInput?: boolean, skipRefocus?: boolean): void;
|
|
104
|
+
timerSelected(time: string): void;
|
|
105
|
+
wasClickedOnPicker(event: any): void;
|
|
106
|
+
hasInvalidClass(): boolean;
|
|
107
|
+
hasValue(): boolean;
|
|
108
|
+
getErrorPattern(): string;
|
|
109
|
+
clear(): void;
|
|
110
|
+
clearAndFocus(): void;
|
|
111
|
+
eventOnBlur($event: any): void;
|
|
112
|
+
eventOnClick($event: any): void;
|
|
113
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
114
|
+
onKeyPress(event: any): void;
|
|
115
|
+
onSegmentInput(event: Event, segment: PoTimepickerSegment): void;
|
|
116
|
+
onSegmentKeydown(event: KeyboardEvent, segment: PoTimepickerSegment): void;
|
|
117
|
+
private handleSegmentNavigation;
|
|
118
|
+
private handleSegmentArrowKeys;
|
|
119
|
+
private handleSegmentNonNumericBlock;
|
|
120
|
+
onSegmentBlur(event: FocusEvent): void;
|
|
121
|
+
onFieldClick(event: MouseEvent): void;
|
|
122
|
+
onSegmentFocus(): void;
|
|
123
|
+
onPeriodSegmentKeydown(event: KeyboardEvent): void;
|
|
124
|
+
onPeriodSegmentClick(event: MouseEvent): void;
|
|
125
|
+
refreshValue(value: string): void;
|
|
126
|
+
/**
|
|
127
|
+
* Método que exibe `p-helper` ou executa a ação definida em `p-helper{eventOnClick}` ou em `p-additionalHelp`.
|
|
128
|
+
*/
|
|
129
|
+
showAdditionalHelp(): boolean;
|
|
130
|
+
writeValue(value: any): void;
|
|
131
|
+
verifyMobile(): RegExpMatchArray;
|
|
132
|
+
handleCleanKeyboardTab(event: KeyboardEvent): void;
|
|
133
|
+
onTimerKeyDown(event: KeyboardEvent): void;
|
|
134
|
+
onTimerBoundaryTab(payload: {
|
|
135
|
+
direction: 'forward' | 'backward';
|
|
136
|
+
event: KeyboardEvent;
|
|
137
|
+
}): void;
|
|
138
|
+
onTimerFocusOut(event: FocusEvent): void;
|
|
139
|
+
setHelper(label?: string): {
|
|
140
|
+
hideAdditionalHelp: boolean;
|
|
141
|
+
helperSettings?: any;
|
|
142
|
+
};
|
|
143
|
+
/**
|
|
144
|
+
* Atualiza os valores exibidos nos inputs de segmento, convertendo para formato 12h com AM/PM quando necessário.
|
|
145
|
+
* O timeValue interno sempre armazena em formato 24h (ISO), mas a exibição pode ser 12h.
|
|
146
|
+
*/
|
|
147
|
+
private updateInputDisplay;
|
|
148
|
+
/** Atualiza a mensagem aria-live com o valor do horario para anuncio por leitores de tela. */
|
|
149
|
+
private updateAriaLiveMessage;
|
|
150
|
+
/** Constroi a string de horario no formato de exibicao atual (12h ou 24h). */
|
|
151
|
+
private buildDisplayTime;
|
|
152
|
+
/** Normaliza valores `HH:mm` para `HH:mm:00` quando segundos estão habilitados. */
|
|
153
|
+
private normalizeTimeValueForDisplay;
|
|
154
|
+
/** Limpa todos os valores de exibicao dos segmentos e seus respectivos elementos input. */
|
|
155
|
+
private clearSegmentDisplays;
|
|
156
|
+
private getDefaultPeriodDisplay;
|
|
157
|
+
/** Sincroniza os valores dos elementos input nativos com as propriedades de exibicao. */
|
|
158
|
+
private syncSegmentInputElements;
|
|
159
|
+
/** Avanca o foco para o proximo input de segmento. */
|
|
160
|
+
private advanceToNextSegment;
|
|
161
|
+
/** Avanca o foco para o input de segmento anterior. */
|
|
162
|
+
private advanceToPreviousSegment;
|
|
163
|
+
/** Foca o ultimo input de segmento visivel. */
|
|
164
|
+
private focusLastSegment;
|
|
165
|
+
/** Verifica se o segmento informado e o ultimo visivel. */
|
|
166
|
+
private isLastSegment;
|
|
167
|
+
/** Alterna entre AM e PM no display de periodo e atualiza o modelo. */
|
|
168
|
+
private togglePeriod;
|
|
169
|
+
/** Incrementa ou decrementa o valor de um segmento na direcao indicada (+1 ou -1), respeitando limites e intervalos. */
|
|
170
|
+
private incrementSegment;
|
|
171
|
+
private incrementHourSegment;
|
|
172
|
+
private incrementIntervalSegment;
|
|
173
|
+
private normalizeSingleDigitSegment;
|
|
174
|
+
private shouldCommitForInternalFocusTarget;
|
|
175
|
+
/** Combina os valores dos segmentos em uma string de horario e atualiza o modelo. */
|
|
176
|
+
private updateCombinedValue;
|
|
177
|
+
/** Monta a string parcial combinando os segmentos preenchidos e vazios. */
|
|
178
|
+
private buildPartialCombined;
|
|
179
|
+
private areSegmentsComplete;
|
|
180
|
+
private buildDisplayCombined;
|
|
181
|
+
private convertDisplayTo24h;
|
|
182
|
+
/** Completa valores de segmento incompletos e atualiza o modelo no blur. */
|
|
183
|
+
private validateAndUpdateModel;
|
|
184
|
+
private updateTimeFromInput;
|
|
185
|
+
private applyInputValidationError;
|
|
186
|
+
private controlChangeEmitter;
|
|
187
|
+
/**
|
|
188
|
+
* Completa automaticamente os segundos com `:00` ao fechar o timer
|
|
189
|
+
* quando `showSeconds=true` e o usuario preencheu apenas hora e minuto (HH:mm).
|
|
190
|
+
*
|
|
191
|
+
* Esse comportamento emite `callOnChange` e `controlChangeEmitter`, o que
|
|
192
|
+
* significa que formularios reativos observando `valueChanges` receberao
|
|
193
|
+
* uma emissao adicional no momento do fechamento do timer.
|
|
194
|
+
*/
|
|
195
|
+
private completeSecondsOnClose;
|
|
196
|
+
private initializeListeners;
|
|
197
|
+
private isAdditionalHelpEventTriggered;
|
|
198
|
+
private readonly onScroll;
|
|
199
|
+
private removeListeners;
|
|
200
|
+
private setDialogPickerStyleDisplay;
|
|
201
|
+
private setTimerPosition;
|
|
202
|
+
protected adjustTimerPosition(): void;
|
|
203
|
+
private shouldHandleTab;
|
|
204
|
+
private focusTimer;
|
|
205
|
+
}
|
|
206
|
+
export {};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const poTimepickerLiterals: {
|
|
2
|
+
en: {
|
|
3
|
+
field: string;
|
|
4
|
+
open: string;
|
|
5
|
+
clean: string;
|
|
6
|
+
invalidTime: string;
|
|
7
|
+
outOfRangeTime: string;
|
|
8
|
+
hour: string;
|
|
9
|
+
minute: string;
|
|
10
|
+
second: string;
|
|
11
|
+
selectedTime: string;
|
|
12
|
+
};
|
|
13
|
+
es: {
|
|
14
|
+
field: string;
|
|
15
|
+
open: string;
|
|
16
|
+
clean: string;
|
|
17
|
+
invalidTime: string;
|
|
18
|
+
outOfRangeTime: string;
|
|
19
|
+
hour: string;
|
|
20
|
+
minute: string;
|
|
21
|
+
second: string;
|
|
22
|
+
selectedTime: string;
|
|
23
|
+
};
|
|
24
|
+
pt: {
|
|
25
|
+
field: string;
|
|
26
|
+
open: string;
|
|
27
|
+
clean: string;
|
|
28
|
+
invalidTime: string;
|
|
29
|
+
outOfRangeTime: string;
|
|
30
|
+
hour: string;
|
|
31
|
+
minute: string;
|
|
32
|
+
second: string;
|
|
33
|
+
selectedTime: string;
|
|
34
|
+
};
|
|
35
|
+
ru: {
|
|
36
|
+
field: string;
|
|
37
|
+
open: string;
|
|
38
|
+
clean: string;
|
|
39
|
+
invalidTime: string;
|
|
40
|
+
outOfRangeTime: string;
|
|
41
|
+
hour: string;
|
|
42
|
+
minute: string;
|
|
43
|
+
second: string;
|
|
44
|
+
selectedTime: string;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -19,7 +19,6 @@ import { PoSearchBaseComponent } from './po-search-base.component';
|
|
|
19
19
|
* <example name="po-search-labs" title="PO Search Labs">
|
|
20
20
|
* <file name="sample-po-search-labs/sample-po-search-labs.component.html"> </file>
|
|
21
21
|
* <file name="sample-po-search-labs/sample-po-search-labs.component.ts"> </file>
|
|
22
|
-
* <file name="sample-po-search-labs/sample-po-search-labs.service.ts"> </file>
|
|
23
22
|
* </example>
|
|
24
23
|
*
|
|
25
24
|
* <example name="po-search-find-people" title="PO Search Find People">
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @usedBy PoTimerComponent
|
|
3
|
+
*
|
|
4
|
+
* @description
|
|
5
|
+
*
|
|
6
|
+
* Enum para definição do formato de exibição do timer.
|
|
7
|
+
*/
|
|
8
|
+
export declare enum PoTimerFormat {
|
|
9
|
+
/** Formato de 24 horas (0-23). */
|
|
10
|
+
Format24 = "24",
|
|
11
|
+
/** Formato de 12 horas (1-12) com indicador AM/PM. */
|
|
12
|
+
Format12 = "12"
|
|
13
|
+
}
|