@zeedhi/common 1.118.0 → 1.119.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/dist/zd-common.esm.js +81 -20
- package/dist/zd-common.umd.js +81 -20
- package/package.json +2 -2
- package/types/components/zd-apex-chart/apex-chart.d.ts +1 -1
- package/types/components/zd-apex-chart/interfaces.d.ts +1 -1
- package/types/components/zd-card/card.d.ts +1 -1
- package/types/components/zd-card/interfaces.d.ts +1 -1
- package/types/components/zd-carousel/carousel.d.ts +1 -1
- package/types/components/zd-carousel/interfaces.d.ts +1 -1
- package/types/components/zd-code-editor/code-editor.d.ts +1 -1
- package/types/components/zd-code-editor/interfaces.d.ts +1 -1
- package/types/components/zd-col/col.d.ts +1 -1
- package/types/components/zd-col/interfaces.d.ts +1 -1
- package/types/components/zd-container/container.d.ts +1 -1
- package/types/components/zd-container/interfaces.d.ts +1 -1
- package/types/components/zd-dashboard/dashboard.d.ts +1 -1
- package/types/components/zd-dashboard/interfaces.d.ts +1 -1
- package/types/components/zd-date/date-range.d.ts +24 -4
- package/types/components/zd-form/form.d.ts +1 -1
- package/types/components/zd-form/interfaces.d.ts +1 -1
- package/types/components/zd-frame/frame.d.ts +1 -1
- package/types/components/zd-frame/interfaces.d.ts +1 -1
- package/types/components/zd-grid/grid.d.ts +1 -1
- package/types/components/zd-grid/interfaces.d.ts +1 -1
- package/types/components/zd-image/image.d.ts +1 -1
- package/types/components/zd-image/interfaces.d.ts +1 -1
- package/types/components/zd-iterable-component-render/interfaces.d.ts +1 -1
- package/types/components/zd-iterable-component-render/iterable-component-render.d.ts +1 -1
- package/types/components/zd-list/interfaces.d.ts +1 -1
- package/types/components/zd-list/list.d.ts +1 -1
- package/types/components/zd-master-detail/interfaces.d.ts +1 -1
- package/types/components/zd-master-detail/master-detail.d.ts +1 -1
- package/types/components/zd-row/interfaces.d.ts +1 -1
- package/types/components/zd-row/row.d.ts +1 -1
- package/types/components/zd-selectable-list/interfaces.d.ts +1 -1
- package/types/components/zd-selectable-list/selectable-list.d.ts +1 -1
- package/types/components/zd-table/interfaces.d.ts +1 -1
- package/types/components/zd-table/table.d.ts +1 -1
- package/types/components/zd-tabs/interfaces.d.ts +1 -1
- package/types/components/zd-tabs/tabs.d.ts +1 -1
- package/types/components/zd-textarea/interfaces.d.ts +1 -1
- package/types/components/zd-textarea/textarea.d.ts +1 -1
- package/types/components/zd-tree/interfaces.d.ts +1 -1
- package/types/components/zd-tree/tree.d.ts +1 -1
package/dist/zd-common.esm.js
CHANGED
|
@@ -4328,6 +4328,13 @@ FormatterParserProvider.registerParser('ZdDateTime', (value, { dateTimeFormat =
|
|
|
4328
4328
|
});
|
|
4329
4329
|
InputFactory.register('ZdDate', Date$1);
|
|
4330
4330
|
|
|
4331
|
+
const ERROR_MAP = {
|
|
4332
|
+
invalid_range: 'VALIDATION_INVALID_RANGE',
|
|
4333
|
+
incomplete_range: 'VALIDATION_INVALID_DATE',
|
|
4334
|
+
empty: 'VALIDATION_INVALID_DATE',
|
|
4335
|
+
invalid_date: 'VALIDATION_INVALID_DATE',
|
|
4336
|
+
none: '',
|
|
4337
|
+
};
|
|
4331
4338
|
class DateRange extends TextInput {
|
|
4332
4339
|
/* istanbul ignore next */
|
|
4333
4340
|
/**
|
|
@@ -4336,6 +4343,10 @@ class DateRange extends TextInput {
|
|
|
4336
4343
|
*/
|
|
4337
4344
|
constructor(props) {
|
|
4338
4345
|
super(props);
|
|
4346
|
+
/**
|
|
4347
|
+
* Restricts which dates can be selected.
|
|
4348
|
+
*/
|
|
4349
|
+
this.allowedDates = undefined;
|
|
4339
4350
|
/**
|
|
4340
4351
|
* Input auto complete.
|
|
4341
4352
|
*/
|
|
@@ -4403,6 +4414,7 @@ class DateRange extends TextInput {
|
|
|
4403
4414
|
this.parserFn = FormatterParserProvider.getParser('ZdDateRange');
|
|
4404
4415
|
this.previousHint = '';
|
|
4405
4416
|
this.previousPersistentHint = false;
|
|
4417
|
+
this.allowedDates = this.getInitValue('allowedDates', props.allowedDates, this.allowedDates);
|
|
4406
4418
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
4407
4419
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
4408
4420
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
@@ -4505,36 +4517,79 @@ class DateRange extends TextInput {
|
|
|
4505
4517
|
return format.replace(/[A-Za-z]/gi, '#');
|
|
4506
4518
|
}
|
|
4507
4519
|
setDateValue(displayValue) {
|
|
4508
|
-
const
|
|
4509
|
-
const values = this.
|
|
4510
|
-
|
|
4520
|
+
const lastDisplayValue = this.displayValue;
|
|
4521
|
+
const values = this.parser(displayValue);
|
|
4522
|
+
const validation = this.isValidDateArray(values);
|
|
4523
|
+
if (validation.isValid) {
|
|
4511
4524
|
this.internalDisplayValue = displayValue;
|
|
4512
4525
|
this.internalValue = this.parser(displayValue);
|
|
4513
4526
|
this.dateError = false;
|
|
4514
|
-
if (
|
|
4527
|
+
if (lastDisplayValue !== this.displayValue) {
|
|
4515
4528
|
this.change(this.value);
|
|
4529
|
+
}
|
|
4516
4530
|
}
|
|
4517
|
-
else {
|
|
4518
|
-
|
|
4519
|
-
|
|
4520
|
-
|
|
4521
|
-
|
|
4522
|
-
this.change(this.value);
|
|
4531
|
+
else if (validation.errorType === 'empty') {
|
|
4532
|
+
this.internalDisplayValue = '';
|
|
4533
|
+
this.internalValue = [];
|
|
4534
|
+
if (lastDisplayValue !== this.displayValue) {
|
|
4535
|
+
this.change(this.value);
|
|
4523
4536
|
}
|
|
4524
|
-
this.dateError = !!displayValue;
|
|
4525
4537
|
}
|
|
4526
|
-
|
|
4538
|
+
else {
|
|
4539
|
+
this.dateError = validation.errorType;
|
|
4540
|
+
}
|
|
4541
|
+
this.value = this.internalValue;
|
|
4527
4542
|
}
|
|
4528
4543
|
/**
|
|
4529
4544
|
* Faz a validação do array de datas
|
|
4530
|
-
* @param
|
|
4531
|
-
* @param values o array de datas
|
|
4545
|
+
* @param values o array de datas formatadas de acordo com o dateFormat
|
|
4532
4546
|
* @returns true se todos os valores forem validados
|
|
4533
4547
|
* */
|
|
4534
|
-
isValidDateArray(
|
|
4535
|
-
if (!values || values.length
|
|
4536
|
-
return false;
|
|
4537
|
-
|
|
4548
|
+
isValidDateArray(values) {
|
|
4549
|
+
if (!values || values.length === 0 || values.every((value) => !value)) {
|
|
4550
|
+
return { isValid: false, errorType: 'empty' };
|
|
4551
|
+
}
|
|
4552
|
+
if (values.length === 1 && values[0] !== '') {
|
|
4553
|
+
return { isValid: false, errorType: 'incomplete_range' };
|
|
4554
|
+
}
|
|
4555
|
+
const invalidRange = !this.isAllowedRange(values);
|
|
4556
|
+
if (invalidRange) {
|
|
4557
|
+
return { isValid: false, errorType: 'invalid_range' };
|
|
4558
|
+
}
|
|
4559
|
+
const allDatesValid = values.every((value) => this.isValidDate(value, this.dateFormat));
|
|
4560
|
+
if (!allDatesValid) {
|
|
4561
|
+
return { isValid: false, errorType: 'invalid_date' };
|
|
4562
|
+
}
|
|
4563
|
+
return { isValid: true, errorType: 'none' };
|
|
4564
|
+
}
|
|
4565
|
+
isAllowedDate(value, format) {
|
|
4566
|
+
if (this.allowedDates === undefined)
|
|
4567
|
+
return true;
|
|
4568
|
+
const dateStr = dayjs(value, format).format(this.dateFormat);
|
|
4569
|
+
if (this.allowedDates instanceof Function) {
|
|
4570
|
+
return this.allowedDates(dateStr);
|
|
4571
|
+
}
|
|
4572
|
+
return this.allowedDates.includes(dateStr);
|
|
4573
|
+
}
|
|
4574
|
+
/**
|
|
4575
|
+
* Checks if a range is allowed
|
|
4576
|
+
* @param value range to be checked, must be in dateFormat
|
|
4577
|
+
*/
|
|
4578
|
+
isAllowedRange(value) {
|
|
4579
|
+
if (!this.allowedDates)
|
|
4580
|
+
return true;
|
|
4581
|
+
const startDate = dayjs(value[0], this.dateFormat);
|
|
4582
|
+
const endDate = dayjs(value[1], this.dateFormat);
|
|
4583
|
+
let currentDate = startDate;
|
|
4584
|
+
while (currentDate.isBefore(endDate) || currentDate.isSame(endDate)) {
|
|
4585
|
+
const dateToCheck = currentDate.format(this.dateFormat);
|
|
4586
|
+
const isAllowed = this.isAllowedDate(dateToCheck, this.dateFormat);
|
|
4587
|
+
if (!isAllowed) {
|
|
4588
|
+
return false;
|
|
4589
|
+
}
|
|
4590
|
+
currentDate = currentDate.add(1, 'day');
|
|
4591
|
+
}
|
|
4592
|
+
return true;
|
|
4538
4593
|
}
|
|
4539
4594
|
splitValues(value) {
|
|
4540
4595
|
let splitedValue = [];
|
|
@@ -4561,6 +4616,9 @@ class DateRange extends TextInput {
|
|
|
4561
4616
|
const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
|
|
4562
4617
|
if (!isValidMax)
|
|
4563
4618
|
return false;
|
|
4619
|
+
if (!this.isAllowedDate(value, format)) {
|
|
4620
|
+
return false;
|
|
4621
|
+
}
|
|
4564
4622
|
return true;
|
|
4565
4623
|
}
|
|
4566
4624
|
isValidFormatDate(value, format, strict = true) {
|
|
@@ -4605,7 +4663,10 @@ class DateRange extends TextInput {
|
|
|
4605
4663
|
return parsedValue.sort((a, b) => (dayjs(a, this.dateFormat).isAfter(dayjs(b, this.dateFormat)) ? 1 : -1));
|
|
4606
4664
|
}
|
|
4607
4665
|
dateValidation() {
|
|
4608
|
-
|
|
4666
|
+
if (this.dateError) {
|
|
4667
|
+
return I18n.translate(ERROR_MAP[this.dateError]);
|
|
4668
|
+
}
|
|
4669
|
+
return true;
|
|
4609
4670
|
}
|
|
4610
4671
|
click(event, element) {
|
|
4611
4672
|
const clickEvent = event || new MouseEvent('click');
|
|
@@ -4651,7 +4712,7 @@ class DateRange extends TextInput {
|
|
|
4651
4712
|
*/
|
|
4652
4713
|
removeDateMask() {
|
|
4653
4714
|
if (isUndefined(this.getInitialMask()) || !this.value || this.dateError
|
|
4654
|
-
|| !this.isValidDateArray(this.
|
|
4715
|
+
|| !this.isValidDateArray(this.value).isValid) {
|
|
4655
4716
|
return;
|
|
4656
4717
|
}
|
|
4657
4718
|
this.mask = '';
|
package/dist/zd-common.umd.js
CHANGED
|
@@ -4335,6 +4335,13 @@
|
|
|
4335
4335
|
});
|
|
4336
4336
|
InputFactory.register('ZdDate', Date$1);
|
|
4337
4337
|
|
|
4338
|
+
const ERROR_MAP = {
|
|
4339
|
+
invalid_range: 'VALIDATION_INVALID_RANGE',
|
|
4340
|
+
incomplete_range: 'VALIDATION_INVALID_DATE',
|
|
4341
|
+
empty: 'VALIDATION_INVALID_DATE',
|
|
4342
|
+
invalid_date: 'VALIDATION_INVALID_DATE',
|
|
4343
|
+
none: '',
|
|
4344
|
+
};
|
|
4338
4345
|
class DateRange extends TextInput {
|
|
4339
4346
|
/* istanbul ignore next */
|
|
4340
4347
|
/**
|
|
@@ -4343,6 +4350,10 @@
|
|
|
4343
4350
|
*/
|
|
4344
4351
|
constructor(props) {
|
|
4345
4352
|
super(props);
|
|
4353
|
+
/**
|
|
4354
|
+
* Restricts which dates can be selected.
|
|
4355
|
+
*/
|
|
4356
|
+
this.allowedDates = undefined;
|
|
4346
4357
|
/**
|
|
4347
4358
|
* Input auto complete.
|
|
4348
4359
|
*/
|
|
@@ -4410,6 +4421,7 @@
|
|
|
4410
4421
|
this.parserFn = core.FormatterParserProvider.getParser('ZdDateRange');
|
|
4411
4422
|
this.previousHint = '';
|
|
4412
4423
|
this.previousPersistentHint = false;
|
|
4424
|
+
this.allowedDates = this.getInitValue('allowedDates', props.allowedDates, this.allowedDates);
|
|
4413
4425
|
this.appendIcon = this.getInitValue('appendIcon', props.appendIcon, 'calendar');
|
|
4414
4426
|
this.autocomplete = this.getInitValue('autocomplete', props.autocomplete, this.autocomplete);
|
|
4415
4427
|
this.dateFormat = this.getInitValue('dateFormat', props.dateFormat, this.dateFormat);
|
|
@@ -4512,36 +4524,79 @@
|
|
|
4512
4524
|
return format.replace(/[A-Za-z]/gi, '#');
|
|
4513
4525
|
}
|
|
4514
4526
|
setDateValue(displayValue) {
|
|
4515
|
-
const
|
|
4516
|
-
const values = this.
|
|
4517
|
-
|
|
4527
|
+
const lastDisplayValue = this.displayValue;
|
|
4528
|
+
const values = this.parser(displayValue);
|
|
4529
|
+
const validation = this.isValidDateArray(values);
|
|
4530
|
+
if (validation.isValid) {
|
|
4518
4531
|
this.internalDisplayValue = displayValue;
|
|
4519
4532
|
this.internalValue = this.parser(displayValue);
|
|
4520
4533
|
this.dateError = false;
|
|
4521
|
-
if (
|
|
4534
|
+
if (lastDisplayValue !== this.displayValue) {
|
|
4522
4535
|
this.change(this.value);
|
|
4536
|
+
}
|
|
4523
4537
|
}
|
|
4524
|
-
else {
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
this.change(this.value);
|
|
4538
|
+
else if (validation.errorType === 'empty') {
|
|
4539
|
+
this.internalDisplayValue = '';
|
|
4540
|
+
this.internalValue = [];
|
|
4541
|
+
if (lastDisplayValue !== this.displayValue) {
|
|
4542
|
+
this.change(this.value);
|
|
4530
4543
|
}
|
|
4531
|
-
this.dateError = !!displayValue;
|
|
4532
4544
|
}
|
|
4533
|
-
|
|
4545
|
+
else {
|
|
4546
|
+
this.dateError = validation.errorType;
|
|
4547
|
+
}
|
|
4548
|
+
this.value = this.internalValue;
|
|
4534
4549
|
}
|
|
4535
4550
|
/**
|
|
4536
4551
|
* Faz a validação do array de datas
|
|
4537
|
-
* @param
|
|
4538
|
-
* @param values o array de datas
|
|
4552
|
+
* @param values o array de datas formatadas de acordo com o dateFormat
|
|
4539
4553
|
* @returns true se todos os valores forem validados
|
|
4540
4554
|
* */
|
|
4541
|
-
isValidDateArray(
|
|
4542
|
-
if (!values || values.length
|
|
4543
|
-
return false;
|
|
4544
|
-
|
|
4555
|
+
isValidDateArray(values) {
|
|
4556
|
+
if (!values || values.length === 0 || values.every((value) => !value)) {
|
|
4557
|
+
return { isValid: false, errorType: 'empty' };
|
|
4558
|
+
}
|
|
4559
|
+
if (values.length === 1 && values[0] !== '') {
|
|
4560
|
+
return { isValid: false, errorType: 'incomplete_range' };
|
|
4561
|
+
}
|
|
4562
|
+
const invalidRange = !this.isAllowedRange(values);
|
|
4563
|
+
if (invalidRange) {
|
|
4564
|
+
return { isValid: false, errorType: 'invalid_range' };
|
|
4565
|
+
}
|
|
4566
|
+
const allDatesValid = values.every((value) => this.isValidDate(value, this.dateFormat));
|
|
4567
|
+
if (!allDatesValid) {
|
|
4568
|
+
return { isValid: false, errorType: 'invalid_date' };
|
|
4569
|
+
}
|
|
4570
|
+
return { isValid: true, errorType: 'none' };
|
|
4571
|
+
}
|
|
4572
|
+
isAllowedDate(value, format) {
|
|
4573
|
+
if (this.allowedDates === undefined)
|
|
4574
|
+
return true;
|
|
4575
|
+
const dateStr = core.dayjs(value, format).format(this.dateFormat);
|
|
4576
|
+
if (this.allowedDates instanceof Function) {
|
|
4577
|
+
return this.allowedDates(dateStr);
|
|
4578
|
+
}
|
|
4579
|
+
return this.allowedDates.includes(dateStr);
|
|
4580
|
+
}
|
|
4581
|
+
/**
|
|
4582
|
+
* Checks if a range is allowed
|
|
4583
|
+
* @param value range to be checked, must be in dateFormat
|
|
4584
|
+
*/
|
|
4585
|
+
isAllowedRange(value) {
|
|
4586
|
+
if (!this.allowedDates)
|
|
4587
|
+
return true;
|
|
4588
|
+
const startDate = core.dayjs(value[0], this.dateFormat);
|
|
4589
|
+
const endDate = core.dayjs(value[1], this.dateFormat);
|
|
4590
|
+
let currentDate = startDate;
|
|
4591
|
+
while (currentDate.isBefore(endDate) || currentDate.isSame(endDate)) {
|
|
4592
|
+
const dateToCheck = currentDate.format(this.dateFormat);
|
|
4593
|
+
const isAllowed = this.isAllowedDate(dateToCheck, this.dateFormat);
|
|
4594
|
+
if (!isAllowed) {
|
|
4595
|
+
return false;
|
|
4596
|
+
}
|
|
4597
|
+
currentDate = currentDate.add(1, 'day');
|
|
4598
|
+
}
|
|
4599
|
+
return true;
|
|
4545
4600
|
}
|
|
4546
4601
|
splitValues(value) {
|
|
4547
4602
|
let splitedValue = [];
|
|
@@ -4568,6 +4623,9 @@
|
|
|
4568
4623
|
const isValidMax = !maxDate || date.isBefore(maxDate) || date.isSame(maxDate);
|
|
4569
4624
|
if (!isValidMax)
|
|
4570
4625
|
return false;
|
|
4626
|
+
if (!this.isAllowedDate(value, format)) {
|
|
4627
|
+
return false;
|
|
4628
|
+
}
|
|
4571
4629
|
return true;
|
|
4572
4630
|
}
|
|
4573
4631
|
isValidFormatDate(value, format, strict = true) {
|
|
@@ -4612,7 +4670,10 @@
|
|
|
4612
4670
|
return parsedValue.sort((a, b) => (core.dayjs(a, this.dateFormat).isAfter(core.dayjs(b, this.dateFormat)) ? 1 : -1));
|
|
4613
4671
|
}
|
|
4614
4672
|
dateValidation() {
|
|
4615
|
-
|
|
4673
|
+
if (this.dateError) {
|
|
4674
|
+
return core.I18n.translate(ERROR_MAP[this.dateError]);
|
|
4675
|
+
}
|
|
4676
|
+
return true;
|
|
4616
4677
|
}
|
|
4617
4678
|
click(event, element) {
|
|
4618
4679
|
const clickEvent = event || new MouseEvent('click');
|
|
@@ -4658,7 +4719,7 @@
|
|
|
4658
4719
|
*/
|
|
4659
4720
|
removeDateMask() {
|
|
4660
4721
|
if (isUndefined__default["default"](this.getInitialMask()) || !this.value || this.dateError
|
|
4661
|
-
|| !this.isValidDateArray(this.
|
|
4722
|
+
|| !this.isValidDateArray(this.value).isValid) {
|
|
4662
4723
|
return;
|
|
4663
4724
|
}
|
|
4664
4725
|
this.mask = '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeedhi/common",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.119.0",
|
|
4
4
|
"description": "Zeedhi Common",
|
|
5
5
|
"author": "Zeedhi <zeedhi@teknisa.com>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"lodash.times": "4.3.*",
|
|
44
44
|
"mockdate": "3.0.*"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "25e72dbee9651173cb330c33a910be791302efc4"
|
|
47
47
|
}
|
|
@@ -27,7 +27,7 @@ export declare class ApexChart extends ComponentRender implements IApexChart {
|
|
|
27
27
|
/**
|
|
28
28
|
* Set component height to fill all space available
|
|
29
29
|
*/
|
|
30
|
-
fillHeight: boolean;
|
|
30
|
+
fillHeight: boolean | string;
|
|
31
31
|
/**
|
|
32
32
|
* Chart options. See <a href=\"https://apexcharts.com/docs/options/\"
|
|
33
33
|
* target=\"_blank\" alt=\"Apex Charts API Reference\">Apex Chart API
|
|
@@ -40,7 +40,7 @@ export interface IApexChart extends IComponentRender {
|
|
|
40
40
|
height?: string | number;
|
|
41
41
|
minHeight?: string | number;
|
|
42
42
|
maxHeight?: string | number;
|
|
43
|
-
fillHeight?: boolean;
|
|
43
|
+
fillHeight?: boolean | string;
|
|
44
44
|
width?: string | number;
|
|
45
45
|
minWidth?: string | number;
|
|
46
46
|
maxWidth?: string | number;
|
|
@@ -76,7 +76,7 @@ export declare class Card extends ComponentRender implements ICard {
|
|
|
76
76
|
/**
|
|
77
77
|
* Set component height to fill all space available
|
|
78
78
|
*/
|
|
79
|
-
fillHeight: boolean;
|
|
79
|
+
fillHeight: boolean | string;
|
|
80
80
|
/**
|
|
81
81
|
* Removes card elevation shadow and adds a thin border
|
|
82
82
|
*/
|
|
@@ -23,7 +23,7 @@ export interface ICard extends IComponentRender {
|
|
|
23
23
|
height?: number | string;
|
|
24
24
|
maxHeight?: number | string;
|
|
25
25
|
minHeight?: number | string;
|
|
26
|
-
fillHeight?: boolean;
|
|
26
|
+
fillHeight?: boolean | string;
|
|
27
27
|
width?: number | string;
|
|
28
28
|
maxWidth?: number | string;
|
|
29
29
|
minWidth?: number | string;
|
|
@@ -53,7 +53,7 @@ export declare class Carousel extends ComponentRender implements ICarousel {
|
|
|
53
53
|
/**
|
|
54
54
|
* Set component height to fill all space available
|
|
55
55
|
*/
|
|
56
|
-
fillHeight: boolean;
|
|
56
|
+
fillHeight: boolean | string;
|
|
57
57
|
/**
|
|
58
58
|
* Configures the carousel as infinite (the slide after the last one is the first slide, and vice-versa)
|
|
59
59
|
*/
|
|
@@ -26,7 +26,7 @@ export declare class CodeEditor extends ComponentRender implements ICodeEditor {
|
|
|
26
26
|
/**
|
|
27
27
|
* Set component height to fill all space available
|
|
28
28
|
*/
|
|
29
|
-
fillHeight: boolean;
|
|
29
|
+
fillHeight: boolean | string;
|
|
30
30
|
/**
|
|
31
31
|
* Defines the component width. Possible values for this property can be
|
|
32
32
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -6,7 +6,7 @@ export interface ICodeEditor extends IComponentRender {
|
|
|
6
6
|
height?: number | string;
|
|
7
7
|
maxHeight?: number | string;
|
|
8
8
|
minHeight?: number | string;
|
|
9
|
-
fillHeight?: boolean;
|
|
9
|
+
fillHeight?: boolean | string;
|
|
10
10
|
width?: number | string;
|
|
11
11
|
maxWidth?: number | string;
|
|
12
12
|
minWidth?: number | string;
|
|
@@ -4,7 +4,7 @@ export interface IContainer extends IComponentRender {
|
|
|
4
4
|
height?: number | string;
|
|
5
5
|
maxHeight?: number | string;
|
|
6
6
|
minHeight?: number | string;
|
|
7
|
-
fillHeight?: boolean;
|
|
7
|
+
fillHeight?: boolean | string;
|
|
8
8
|
width?: number | string;
|
|
9
9
|
maxWidth?: number | string;
|
|
10
10
|
minWidth?: number | string;
|
|
@@ -38,7 +38,7 @@ export declare class Dashboard extends ComponentRender implements IDashboard {
|
|
|
38
38
|
/**
|
|
39
39
|
* Set component height to fill all space available
|
|
40
40
|
*/
|
|
41
|
-
fillHeight: boolean;
|
|
41
|
+
fillHeight: boolean | string;
|
|
42
42
|
/**
|
|
43
43
|
* Defines the component width. Possible values for this property can be
|
|
44
44
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -22,7 +22,7 @@ export interface IDashboard extends IComponentRender {
|
|
|
22
22
|
height?: number | string;
|
|
23
23
|
maxHeight?: number | string;
|
|
24
24
|
minHeight?: number | string;
|
|
25
|
-
fillHeight?: boolean;
|
|
25
|
+
fillHeight?: boolean | string;
|
|
26
26
|
width?: number | string;
|
|
27
27
|
maxWidth?: number | string;
|
|
28
28
|
minWidth?: number | string;
|
|
@@ -1,6 +1,17 @@
|
|
|
1
1
|
import { IDateRange, IDateEvents } from './interfaces';
|
|
2
2
|
import { TextInput } from '../zd-text-input/text-input';
|
|
3
|
+
declare const ERROR_MAP: {
|
|
4
|
+
readonly invalid_range: "VALIDATION_INVALID_RANGE";
|
|
5
|
+
readonly incomplete_range: "VALIDATION_INVALID_DATE";
|
|
6
|
+
readonly empty: "VALIDATION_INVALID_DATE";
|
|
7
|
+
readonly invalid_date: "VALIDATION_INVALID_DATE";
|
|
8
|
+
readonly none: "";
|
|
9
|
+
};
|
|
3
10
|
export declare class DateRange extends TextInput implements IDateRange {
|
|
11
|
+
/**
|
|
12
|
+
* Restricts which dates can be selected.
|
|
13
|
+
*/
|
|
14
|
+
allowedDates?: ((date: string) => boolean) | string[];
|
|
4
15
|
/**
|
|
5
16
|
* Input auto complete.
|
|
6
17
|
*/
|
|
@@ -72,7 +83,7 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
72
83
|
*/
|
|
73
84
|
helperValue?: string;
|
|
74
85
|
protected isoFormat: string;
|
|
75
|
-
protected dateError:
|
|
86
|
+
protected dateError: false | keyof typeof ERROR_MAP;
|
|
76
87
|
protected formatterFn: Function;
|
|
77
88
|
protected parserFn: Function;
|
|
78
89
|
protected initialMask?: string;
|
|
@@ -102,11 +113,19 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
102
113
|
setDateValue(displayValue: string): void;
|
|
103
114
|
/**
|
|
104
115
|
* Faz a validação do array de datas
|
|
105
|
-
* @param
|
|
106
|
-
* @param values o array de datas
|
|
116
|
+
* @param values o array de datas formatadas de acordo com o dateFormat
|
|
107
117
|
* @returns true se todos os valores forem validados
|
|
108
118
|
* */
|
|
109
|
-
isValidDateArray(
|
|
119
|
+
isValidDateArray(values: string[]): {
|
|
120
|
+
isValid: boolean;
|
|
121
|
+
errorType: keyof typeof ERROR_MAP;
|
|
122
|
+
};
|
|
123
|
+
private isAllowedDate;
|
|
124
|
+
/**
|
|
125
|
+
* Checks if a range is allowed
|
|
126
|
+
* @param value range to be checked, must be in dateFormat
|
|
127
|
+
*/
|
|
128
|
+
isAllowedRange(value: string[]): boolean;
|
|
110
129
|
private splitValues;
|
|
111
130
|
isValidDate(value: string, format: string, strict?: boolean): boolean;
|
|
112
131
|
isValidFormatDate(value: string, format: string, strict?: boolean): boolean;
|
|
@@ -150,3 +169,4 @@ export declare class DateRange extends TextInput implements IDateRange {
|
|
|
150
169
|
change(event?: Event, element?: any): void;
|
|
151
170
|
getMaskValue(): any;
|
|
152
171
|
}
|
|
172
|
+
export {};
|
|
@@ -38,7 +38,7 @@ export declare class Form extends ComponentRender implements IForm {
|
|
|
38
38
|
/**
|
|
39
39
|
* Set component height to fill all space available
|
|
40
40
|
*/
|
|
41
|
-
fillHeight: boolean;
|
|
41
|
+
fillHeight: boolean | string;
|
|
42
42
|
/**
|
|
43
43
|
* Defines the component width. Possible values for this property can be
|
|
44
44
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -25,7 +25,7 @@ export interface IForm extends IComponentRender {
|
|
|
25
25
|
height?: number | string;
|
|
26
26
|
maxHeight?: number | string;
|
|
27
27
|
minHeight?: number | string;
|
|
28
|
-
fillHeight?: boolean;
|
|
28
|
+
fillHeight?: boolean | string;
|
|
29
29
|
width?: number | string;
|
|
30
30
|
maxWidth?: number | string;
|
|
31
31
|
minWidth?: number | string;
|
|
@@ -33,7 +33,7 @@ export declare class Frame extends ComponentRender implements IFrame {
|
|
|
33
33
|
/**
|
|
34
34
|
* Set component height to fill all space available
|
|
35
35
|
*/
|
|
36
|
-
fillHeight: boolean;
|
|
36
|
+
fillHeight: boolean | string;
|
|
37
37
|
/**
|
|
38
38
|
* Defines the component width. Possible values for this property can be
|
|
39
39
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -17,7 +17,7 @@ export interface IFrame extends IComponentRender {
|
|
|
17
17
|
height?: number | string;
|
|
18
18
|
maxHeight?: number | string;
|
|
19
19
|
minHeight?: number | string;
|
|
20
|
-
fillHeight?: boolean;
|
|
20
|
+
fillHeight?: boolean | string;
|
|
21
21
|
width?: number | string;
|
|
22
22
|
maxWidth?: number | string;
|
|
23
23
|
minWidth?: number | string;
|
|
@@ -58,7 +58,7 @@ export declare class Grid extends Iterable implements IGrid {
|
|
|
58
58
|
/**
|
|
59
59
|
* Set component height to fill all space available
|
|
60
60
|
*/
|
|
61
|
-
fillHeight: boolean;
|
|
61
|
+
fillHeight: boolean | string;
|
|
62
62
|
/**
|
|
63
63
|
* Defines the component width. Possible values for this property can be
|
|
64
64
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -28,7 +28,7 @@ export interface IGrid extends IIterable {
|
|
|
28
28
|
height?: number | string;
|
|
29
29
|
maxHeight?: number | string;
|
|
30
30
|
minHeight?: number | string;
|
|
31
|
-
fillHeight?: boolean;
|
|
31
|
+
fillHeight?: boolean | string;
|
|
32
32
|
width?: number | string;
|
|
33
33
|
maxWidth?: number | string;
|
|
34
34
|
minWidth?: number | string;
|
|
@@ -41,7 +41,7 @@ export declare class Image extends ComponentRender implements IImage {
|
|
|
41
41
|
/**
|
|
42
42
|
* Set component height to fill all space available
|
|
43
43
|
*/
|
|
44
|
-
fillHeight: boolean;
|
|
44
|
+
fillHeight: boolean | string;
|
|
45
45
|
/**
|
|
46
46
|
* Defines the component width. Possible values for this property can be
|
|
47
47
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -14,7 +14,7 @@ export interface IImage extends IComponentRender {
|
|
|
14
14
|
height?: number | string;
|
|
15
15
|
maxHeight?: number | string;
|
|
16
16
|
minHeight?: number | string;
|
|
17
|
-
fillHeight?: boolean;
|
|
17
|
+
fillHeight?: boolean | string;
|
|
18
18
|
width?: number | string;
|
|
19
19
|
maxWidth?: number | string;
|
|
20
20
|
minWidth?: number | string;
|
|
@@ -11,7 +11,7 @@ export interface IIterableComponentRender extends IIterable {
|
|
|
11
11
|
height?: number | string;
|
|
12
12
|
maxHeight?: number | string;
|
|
13
13
|
minHeight?: number | string;
|
|
14
|
-
fillHeight?: boolean;
|
|
14
|
+
fillHeight?: boolean | string;
|
|
15
15
|
width?: number | string;
|
|
16
16
|
maxWidth?: number | string;
|
|
17
17
|
minWidth?: number | string;
|
|
@@ -52,7 +52,7 @@ export declare class IterableComponentRender extends Iterable implements IIterab
|
|
|
52
52
|
/**
|
|
53
53
|
* Set component height to fill all space available
|
|
54
54
|
*/
|
|
55
|
-
fillHeight: boolean;
|
|
55
|
+
fillHeight: boolean | string;
|
|
56
56
|
/**
|
|
57
57
|
* Defines the component width. Possible values for this property can be
|
|
58
58
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -15,7 +15,7 @@ export interface IList extends IComponentRender {
|
|
|
15
15
|
height?: number | string;
|
|
16
16
|
maxHeight?: number | string;
|
|
17
17
|
minHeight?: number | string;
|
|
18
|
-
fillHeight?: boolean;
|
|
18
|
+
fillHeight?: boolean | string;
|
|
19
19
|
width?: number | string;
|
|
20
20
|
maxWidth?: number | string;
|
|
21
21
|
minWidth?: number | string;
|
|
@@ -59,7 +59,7 @@ export declare class List extends ComponentRender implements IList {
|
|
|
59
59
|
/**
|
|
60
60
|
* Set component height to fill all space available
|
|
61
61
|
*/
|
|
62
|
-
fillHeight: boolean;
|
|
62
|
+
fillHeight: boolean | string;
|
|
63
63
|
/**
|
|
64
64
|
* Defines the component width. Possible values for this property can be
|
|
65
65
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -31,7 +31,7 @@ export declare class MasterDetail extends ComponentRender implements IMasterDeta
|
|
|
31
31
|
/**
|
|
32
32
|
* Set component height to fill all space available
|
|
33
33
|
*/
|
|
34
|
-
fillHeight: boolean;
|
|
34
|
+
fillHeight: boolean | string;
|
|
35
35
|
/**
|
|
36
36
|
* Creates a new Master Detail.
|
|
37
37
|
* @param props Master detail properties
|
|
@@ -8,7 +8,7 @@ export interface ISelectableList extends IList {
|
|
|
8
8
|
height?: number | string;
|
|
9
9
|
maxHeight?: number | string;
|
|
10
10
|
minHeight?: number | string;
|
|
11
|
-
fillHeight?: boolean;
|
|
11
|
+
fillHeight?: boolean | string;
|
|
12
12
|
width?: number | string;
|
|
13
13
|
maxWidth?: number | string;
|
|
14
14
|
minWidth?: number | string;
|
|
@@ -42,7 +42,7 @@ export declare class SelectableList extends List implements ISelectableList {
|
|
|
42
42
|
/**
|
|
43
43
|
* Set component height to fill all space available
|
|
44
44
|
*/
|
|
45
|
-
fillHeight: boolean;
|
|
45
|
+
fillHeight: boolean | string;
|
|
46
46
|
/**
|
|
47
47
|
* Defines the component width. Possible values for this property can be
|
|
48
48
|
* <samp>'auto', '100%', '400px' or 400</samp>
|
|
@@ -66,7 +66,7 @@ export declare class Textarea extends TextInput implements ITextarea {
|
|
|
66
66
|
/**
|
|
67
67
|
* Set component height to fill all space available
|
|
68
68
|
*/
|
|
69
|
-
fillHeight: boolean;
|
|
69
|
+
fillHeight: boolean | string;
|
|
70
70
|
/**
|
|
71
71
|
* Create a new Textarea.
|
|
72
72
|
* @param props Textarea properties
|
|
@@ -60,7 +60,7 @@ export interface ITree extends IComponentRender {
|
|
|
60
60
|
height?: number | string;
|
|
61
61
|
maxHeight?: number | string;
|
|
62
62
|
minHeight?: number | string;
|
|
63
|
-
fillHeight?: boolean;
|
|
63
|
+
fillHeight?: boolean | string;
|
|
64
64
|
width?: number | string;
|
|
65
65
|
maxWidth?: number | string;
|
|
66
66
|
minWidth?: number | string;
|
|
@@ -43,7 +43,7 @@ export declare class Tree extends ComponentRender implements ITree {
|
|
|
43
43
|
/**
|
|
44
44
|
* Set component height to fill all space available
|
|
45
45
|
*/
|
|
46
|
-
fillHeight: boolean;
|
|
46
|
+
fillHeight: boolean | string;
|
|
47
47
|
/**
|
|
48
48
|
* Defines the component width. Possible values for this property can be
|
|
49
49
|
* <samp>'auto', '100%', '400px' or 400</samp>
|