@progress/kendo-angular-spreadsheet 21.4.1-develop.1 → 22.0.0-develop.1
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/progress-kendo-angular-spreadsheet.mjs +183 -183
- package/package.json +22 -30
- package/schematics/ngAdd/index.js +2 -2
- package/tools/shared/spreadsheet-command-base.d.ts +1 -1
- package/tools/shared/spreadsheet-dropdown-tools-base.d.ts +1 -1
- package/tools/shared/spreadsheet-dropdownlist.base.d.ts +1 -1
- package/esm2022/action-bar/formula-input.directive.mjs +0 -183
- package/esm2022/action-bar/list.component.mjs +0 -91
- package/esm2022/action-bar/namebox.component.mjs +0 -134
- package/esm2022/common/calendar-editor.component.mjs +0 -48
- package/esm2022/common/error-handling.service.mjs +0 -99
- package/esm2022/common/list-editor.component.mjs +0 -146
- package/esm2022/common/main-menu.directive.mjs +0 -30
- package/esm2022/common/sheet-changes.mjs +0 -5
- package/esm2022/common/spreadsheet.service.mjs +0 -49
- package/esm2022/directives.mjs +0 -94
- package/esm2022/filter-menu/filter-menu-item-content-template.directive.mjs +0 -26
- package/esm2022/filter-menu/filter-menu-item.component.mjs +0 -271
- package/esm2022/index.mjs +0 -14
- package/esm2022/localization/custom-messages.component.mjs +0 -52
- package/esm2022/localization/localized-messages.directive.mjs +0 -35
- package/esm2022/localization/messages.mjs +0 -884
- package/esm2022/localization/spreadsheet-localization.service.mjs +0 -31
- package/esm2022/models/cell-editor-action-args.mjs +0 -5
- package/esm2022/models/cell-editor-options.mjs +0 -5
- package/esm2022/models/events.mjs +0 -5
- package/esm2022/models/filter-menu-item.mjs +0 -5
- package/esm2022/models/index.mjs +0 -11
- package/esm2022/models/main-menu-item.mjs +0 -5
- package/esm2022/models/range-filter-value.mjs +0 -5
- package/esm2022/models/sheet-info.mjs +0 -5
- package/esm2022/package-metadata.mjs +0 -16
- package/esm2022/progress-kendo-angular-spreadsheet.mjs +0 -8
- package/esm2022/sheets-bar/action-dialog.component.mjs +0 -78
- package/esm2022/sheets-bar/sheets-bar.component.mjs +0 -433
- package/esm2022/sheets-bar/utils.mjs +0 -49
- package/esm2022/spreadsheet.component.mjs +0 -2408
- package/esm2022/spreadsheet.module.mjs +0 -72
- package/esm2022/tools/align/align-tool.directive.mjs +0 -62
- package/esm2022/tools/align/horizontal-align-tool.directive.mjs +0 -62
- package/esm2022/tools/align/vertical-align-tool.directive.mjs +0 -62
- package/esm2022/tools/colorpicker/spreadsheet-backcolor.component.mjs +0 -142
- package/esm2022/tools/colorpicker/spreadsheet-forecolor.component.mjs +0 -142
- package/esm2022/tools/data-validation-dialog.component.mjs +0 -481
- package/esm2022/tools/data-validation-tool.directive.mjs +0 -156
- package/esm2022/tools/decrease-decimal-tool.directive.mjs +0 -41
- package/esm2022/tools/filter-sort/filter-tool.directive.mjs +0 -89
- package/esm2022/tools/filter-sort/sort-tool.directive.mjs +0 -62
- package/esm2022/tools/font-family/font-family-dropdownlist.component.mjs +0 -59
- package/esm2022/tools/font-family/spreadsheet-fontfamily-tool.component.mjs +0 -114
- package/esm2022/tools/font-size/decrease-font-tool.directive.mjs +0 -52
- package/esm2022/tools/font-size/font-size-dropdownlist.component.mjs +0 -46
- package/esm2022/tools/font-size/increase-font-tool.directive.mjs +0 -52
- package/esm2022/tools/font-size/spreadsheet-fontsize-tool.component.mjs +0 -114
- package/esm2022/tools/format-tool.directive.mjs +0 -65
- package/esm2022/tools/gridlines-tool.directive.mjs +0 -47
- package/esm2022/tools/history/redo-tool.mjs +0 -37
- package/esm2022/tools/history/undo-tool.mjs +0 -37
- package/esm2022/tools/increase-decimal-tool.directive.mjs +0 -41
- package/esm2022/tools/index.mjs +0 -30
- package/esm2022/tools/insert/insert-link-dialog.component.mjs +0 -53
- package/esm2022/tools/insert/insert-link-tool.directive.mjs +0 -97
- package/esm2022/tools/load-file.component.mjs +0 -226
- package/esm2022/tools/save-file-tool.directive.mjs +0 -58
- package/esm2022/tools/shared/command-icons.mjs +0 -121
- package/esm2022/tools/shared/commands.mjs +0 -5
- package/esm2022/tools/shared/constants.mjs +0 -77
- package/esm2022/tools/shared/dialog-content.component.mjs +0 -130
- package/esm2022/tools/shared/spreadsheet-command-base.mjs +0 -73
- package/esm2022/tools/shared/spreadsheet-command-button.mjs +0 -31
- package/esm2022/tools/shared/spreadsheet-dropdown-tools-base.mjs +0 -194
- package/esm2022/tools/shared/spreadsheet-dropdownlist.base.mjs +0 -54
- package/esm2022/tools/tables/add-column-left-button.directive.mjs +0 -37
- package/esm2022/tools/tables/add-column-right-button.directive.mjs +0 -37
- package/esm2022/tools/tables/add-row-above-button.directive.mjs +0 -37
- package/esm2022/tools/tables/add-row-below-button.directive.mjs +0 -37
- package/esm2022/tools/tables/delete-column-button.directive.mjs +0 -35
- package/esm2022/tools/tables/delete-row-button.directive.mjs +0 -35
- package/esm2022/tools/tables/index.mjs +0 -11
- package/esm2022/tools/tables/merge-tool.directive.mjs +0 -72
- package/esm2022/tools/text-wrap-tool.directive.mjs +0 -48
- package/esm2022/tools/tools.service.mjs +0 -61
- package/esm2022/tools/typographical-emphasis/bold-tool.directive.mjs +0 -37
- package/esm2022/tools/typographical-emphasis/italic-tool.directive.mjs +0 -37
- package/esm2022/tools/typographical-emphasis/underline-tool.directive.mjs +0 -37
- package/esm2022/tools/utils.mjs +0 -35
- package/esm2022/utils.mjs +0 -32
|
@@ -1,481 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Component, EventEmitter, NgZone, Output } from '@angular/core';
|
|
6
|
-
import { FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
7
|
-
import { DropDownListComponent } from '@progress/kendo-angular-dropdowns';
|
|
8
|
-
import { CheckBoxComponent, RadioButtonComponent, TextBoxComponent } from '@progress/kendo-angular-inputs';
|
|
9
|
-
import { LocalizationService } from '@progress/kendo-angular-l10n';
|
|
10
|
-
import { rangeValidator } from './utils';
|
|
11
|
-
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
12
|
-
import { isPresent } from '@progress/kendo-angular-common';
|
|
13
|
-
import { LabelComponent } from '@progress/kendo-angular-label';
|
|
14
|
-
import { DialogActionsComponent, DialogContentBase, DialogRef } from '@progress/kendo-angular-dialog';
|
|
15
|
-
import { ButtonComponent } from '@progress/kendo-angular-buttons';
|
|
16
|
-
import * as i0 from "@angular/core";
|
|
17
|
-
import * as i1 from "@progress/kendo-angular-l10n";
|
|
18
|
-
import * as i2 from "../common/spreadsheet.service";
|
|
19
|
-
import * as i3 from "@progress/kendo-angular-dialog";
|
|
20
|
-
import * as i4 from "@angular/forms";
|
|
21
|
-
const COMPARER_VALUE_NUMBER = {
|
|
22
|
-
greaterThan: 'validationMinValue',
|
|
23
|
-
lessThan: 'validationMaxValue',
|
|
24
|
-
greaterThanOrEqualTo: 'validationMinValue',
|
|
25
|
-
lessThanOrEqualTo: 'validationMaxValue'
|
|
26
|
-
};
|
|
27
|
-
const COMPARER_VALUE_DATE = {
|
|
28
|
-
greaterThan: 'validationStartValue',
|
|
29
|
-
lessThan: 'validationEndValue'
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* @hidden
|
|
33
|
-
*/
|
|
34
|
-
export class DataValidationDialogComponent extends DialogContentBase {
|
|
35
|
-
localization;
|
|
36
|
-
spreadsheetService;
|
|
37
|
-
zone;
|
|
38
|
-
cellRange;
|
|
39
|
-
criteriaList;
|
|
40
|
-
ignoreBlank = true;
|
|
41
|
-
showButton = true;
|
|
42
|
-
showHint;
|
|
43
|
-
from = null;
|
|
44
|
-
to = null;
|
|
45
|
-
validationFormGroup;
|
|
46
|
-
hintTitle = 'Validation Error';
|
|
47
|
-
hintMessage = 'The value that you entered violates the validation rules set on the cell.';
|
|
48
|
-
_comparer;
|
|
49
|
-
_criteria;
|
|
50
|
-
_onInvalidData;
|
|
51
|
-
onInvalidDataSub;
|
|
52
|
-
allComparers = [];
|
|
53
|
-
textComparers = [];
|
|
54
|
-
dialogAction = new EventEmitter();
|
|
55
|
-
constructor(localization, spreadsheetService, zone, dialog) {
|
|
56
|
-
super(dialog);
|
|
57
|
-
this.localization = localization;
|
|
58
|
-
this.spreadsheetService = spreadsheetService;
|
|
59
|
-
this.zone = zone;
|
|
60
|
-
}
|
|
61
|
-
ngOnInit() {
|
|
62
|
-
if (this.criteria.type === 'any') {
|
|
63
|
-
this.validationFormGroup = new FormGroup({
|
|
64
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)])
|
|
65
|
-
});
|
|
66
|
-
}
|
|
67
|
-
else if (this.comparer?.type === 'between' || this.comparer?.type === 'notBetween') {
|
|
68
|
-
this.validationFormGroup = new FormGroup({
|
|
69
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)]),
|
|
70
|
-
min: new FormControl(this.from, [Validators.required]),
|
|
71
|
-
max: new FormControl(this.to, [Validators.required]),
|
|
72
|
-
onInvalidData: new FormControl(this.onInvalidData)
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
this.validationFormGroup = new FormGroup({
|
|
77
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)]),
|
|
78
|
-
min: new FormControl(this.from, [Validators.required]),
|
|
79
|
-
onInvalidData: new FormControl(this.onInvalidData)
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
this.addInvalidDataSub();
|
|
83
|
-
this.criteriaList = [
|
|
84
|
-
{ type: 'any', name: this.getLocalizationMessage('anyValueValidationCriteria') },
|
|
85
|
-
{ type: 'number', name: this.getLocalizationMessage('numberValidationCriteria') },
|
|
86
|
-
{ type: 'text', name: this.getLocalizationMessage('textValidationCriteria') },
|
|
87
|
-
{ type: 'date', name: this.getLocalizationMessage('dateValidationCriteria') },
|
|
88
|
-
{ type: 'custom', name: this.getLocalizationMessage('customFormulaValidationCriteria') },
|
|
89
|
-
{ type: 'list', name: this.getLocalizationMessage('listValidationCriteria') }
|
|
90
|
-
];
|
|
91
|
-
this.allComparers = [
|
|
92
|
-
{ type: 'greaterThan', name: this.getLocalizationMessage('greaterThanValidationComparer') },
|
|
93
|
-
{ type: 'lessThan', name: this.getLocalizationMessage('lessThanValidationComparer') },
|
|
94
|
-
{ type: 'between', name: this.getLocalizationMessage('betweenValidationComparer') },
|
|
95
|
-
{ type: 'notBetween', name: this.getLocalizationMessage('notBetweenValidationComparer') },
|
|
96
|
-
{ type: 'equalTo', name: this.getLocalizationMessage('equalToValidationComparer') },
|
|
97
|
-
{ type: 'notEqualTo', name: this.getLocalizationMessage('notEqualToValidationComparer') },
|
|
98
|
-
{ type: 'greaterThanOrEqualTo', name: this.getLocalizationMessage('greaterThanOrEqualToValidationComparer') },
|
|
99
|
-
{ type: 'lessThanOrEqualTo', name: this.getLocalizationMessage('lessThanOrEqualToValidationComparer') }
|
|
100
|
-
];
|
|
101
|
-
this.textComparers = [
|
|
102
|
-
{ type: 'equalTo', name: this.getLocalizationMessage('equalToValidationComparer') },
|
|
103
|
-
{ type: 'notEqualTo', name: this.getLocalizationMessage('notEqualToValidationComparer') }
|
|
104
|
-
];
|
|
105
|
-
}
|
|
106
|
-
ngOnDestroy() {
|
|
107
|
-
this.onInvalidDataSub?.unsubscribe();
|
|
108
|
-
this.onInvalidDataSub = null;
|
|
109
|
-
}
|
|
110
|
-
getLocalizationMessage(key) {
|
|
111
|
-
return this.localization.get(key);
|
|
112
|
-
}
|
|
113
|
-
onRangeChange(value, input) {
|
|
114
|
-
let range;
|
|
115
|
-
try {
|
|
116
|
-
range = this.spreadsheetService.spreadsheet.activeSheet().range(value);
|
|
117
|
-
}
|
|
118
|
-
catch (_e) { /** noop */ }
|
|
119
|
-
if (isPresent(range)) {
|
|
120
|
-
range.select();
|
|
121
|
-
this.cellRange = value;
|
|
122
|
-
}
|
|
123
|
-
this.zone.runOutsideAngular(() => {
|
|
124
|
-
setTimeout(() => {
|
|
125
|
-
input.focus();
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
onSelectionChange(item, field) {
|
|
130
|
-
if (field === 'criteria') {
|
|
131
|
-
this.from = this.to = null;
|
|
132
|
-
this.comparer = null;
|
|
133
|
-
this.showButton = this.ignoreBlank = true;
|
|
134
|
-
if (item.type === 'any') {
|
|
135
|
-
this.validationFormGroup = new FormGroup({
|
|
136
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)])
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
else {
|
|
140
|
-
this.validationFormGroup = new FormGroup({
|
|
141
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)]),
|
|
142
|
-
min: new FormControl(this.from, [Validators.required]),
|
|
143
|
-
onInvalidData: new FormControl(this.onInvalidData)
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
this.showButton = this.ignoreBlank = true;
|
|
149
|
-
switch (item.type) {
|
|
150
|
-
case 'between':
|
|
151
|
-
case 'notBetween':
|
|
152
|
-
this.validationFormGroup = new FormGroup({
|
|
153
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)]),
|
|
154
|
-
min: new FormControl(this.from, [Validators.required]),
|
|
155
|
-
max: new FormControl(this.to, [Validators.required]),
|
|
156
|
-
onInvalidData: new FormControl(this.onInvalidData)
|
|
157
|
-
});
|
|
158
|
-
break;
|
|
159
|
-
default:
|
|
160
|
-
this.validationFormGroup = new FormGroup({
|
|
161
|
-
range: new FormControl(this.cellRange, [Validators.required, rangeValidator(this)]),
|
|
162
|
-
min: new FormControl(this.from, [Validators.required]),
|
|
163
|
-
onInvalidData: new FormControl(this.onInvalidData)
|
|
164
|
-
});
|
|
165
|
-
break;
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
this.addInvalidDataSub();
|
|
169
|
-
this[field] = item;
|
|
170
|
-
}
|
|
171
|
-
get criteria() {
|
|
172
|
-
return this._criteria || { type: 'any', name: 'Any value' };
|
|
173
|
-
}
|
|
174
|
-
set criteria(value) {
|
|
175
|
-
this._criteria = value;
|
|
176
|
-
}
|
|
177
|
-
get comparer() {
|
|
178
|
-
return this._comparer || this.comparerList[0];
|
|
179
|
-
}
|
|
180
|
-
set comparer(value) {
|
|
181
|
-
this._comparer = value;
|
|
182
|
-
}
|
|
183
|
-
get onInvalidData() {
|
|
184
|
-
return this._onInvalidData || 'reject';
|
|
185
|
-
}
|
|
186
|
-
set onInvalidData(value) {
|
|
187
|
-
this._onInvalidData = value;
|
|
188
|
-
}
|
|
189
|
-
get comparerList() {
|
|
190
|
-
return this.criteria.type === 'text' ? this.textComparers : this.allComparers;
|
|
191
|
-
}
|
|
192
|
-
get singleValue() {
|
|
193
|
-
return !this.comparer.name.includes('between');
|
|
194
|
-
}
|
|
195
|
-
get showComparer() {
|
|
196
|
-
return this.criteria.type === 'number' || this.criteria.type === 'text' || this.criteria.type === 'date';
|
|
197
|
-
}
|
|
198
|
-
setData(args) {
|
|
199
|
-
for (const key in args) {
|
|
200
|
-
this[key] = args[key];
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
getValueLabel() {
|
|
204
|
-
const valueLabel = this.localization.get('validationValue');
|
|
205
|
-
if (this.criteria.type === 'custom' || this.criteria.type === 'list') {
|
|
206
|
-
return valueLabel;
|
|
207
|
-
}
|
|
208
|
-
const labelKey = this.criteria.type === 'date' ? COMPARER_VALUE_DATE[this.comparer.type] : COMPARER_VALUE_NUMBER[this.comparer.type];
|
|
209
|
-
return this.localization.get(labelKey) || valueLabel;
|
|
210
|
-
}
|
|
211
|
-
getShowButtonLabel() {
|
|
212
|
-
const labelKey = this.criteria.type === 'list' ? 'validationShowListButtonCheckbox' : 'validationShowDateButtonCheckbox';
|
|
213
|
-
return this.getLocalizationMessage(labelKey);
|
|
214
|
-
}
|
|
215
|
-
get validationPresent() {
|
|
216
|
-
const currentSheet = this.spreadsheetService.spreadsheet.activeSheet();
|
|
217
|
-
return !!currentSheet.range(currentSheet.activeCell()).validation();
|
|
218
|
-
}
|
|
219
|
-
addInvalidDataSub() {
|
|
220
|
-
this.onInvalidDataSub?.unsubscribe();
|
|
221
|
-
if (this.validationFormGroup.get('onInvalidData')) {
|
|
222
|
-
this.onInvalidDataSub = this.validationFormGroup.get('onInvalidData').valueChanges.subscribe((value) => {
|
|
223
|
-
this.onInvalidData = value;
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataValidationDialogComponent, deps: [{ token: i1.LocalizationService }, { token: i2.SpreadsheetService }, { token: i0.NgZone }, { token: i3.DialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
228
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.14", type: DataValidationDialogComponent, isStandalone: true, selector: "ng-component", outputs: { dialogAction: "dialogAction" }, usesInheritance: true, ngImport: i0, template: `
|
|
229
|
-
<form class="k-form k-form-md" [formGroup]="validationFormGroup">
|
|
230
|
-
<div class="k-form-field">
|
|
231
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationCellRange')" [for]="rangeInput"></kendo-label>
|
|
232
|
-
<div class="k-form-field-wrap">
|
|
233
|
-
<kendo-textbox #rangeInput
|
|
234
|
-
[clearButton]="true"
|
|
235
|
-
[value]="cellRange"
|
|
236
|
-
(valueChange)="onRangeChange($event, rangeInput)"
|
|
237
|
-
formControlName="range">
|
|
238
|
-
</kendo-textbox>
|
|
239
|
-
</div>
|
|
240
|
-
</div>
|
|
241
|
-
<div class="k-form-field">
|
|
242
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationCriteria')" [for]="criteriaInput"></kendo-label>
|
|
243
|
-
<div class="k-form-field-wrap">
|
|
244
|
-
<kendo-dropdownlist #criteriaInput
|
|
245
|
-
[data]="criteriaList"
|
|
246
|
-
[value]="criteria"
|
|
247
|
-
(selectionChange)="onSelectionChange($event, 'criteria')"
|
|
248
|
-
textField="name"
|
|
249
|
-
valueField="type">
|
|
250
|
-
</kendo-dropdownlist>
|
|
251
|
-
</div>
|
|
252
|
-
</div>
|
|
253
|
-
@if (criteria.type !== 'any') {
|
|
254
|
-
@if (showComparer) {
|
|
255
|
-
<div class="k-form-field">
|
|
256
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationComparer')" [for]="comparerInput"></kendo-label>
|
|
257
|
-
<div class="k-form-field-wrap">
|
|
258
|
-
<kendo-dropdownlist #comparerInput
|
|
259
|
-
[data]="comparerList"
|
|
260
|
-
[value]="comparer"
|
|
261
|
-
(selectionChange)="onSelectionChange($event, 'comparer')"
|
|
262
|
-
textField="name"
|
|
263
|
-
valueField="type">
|
|
264
|
-
</kendo-dropdownlist>
|
|
265
|
-
</div>
|
|
266
|
-
</div>
|
|
267
|
-
}
|
|
268
|
-
@if (singleValue) {
|
|
269
|
-
<div class="k-form-field">
|
|
270
|
-
<kendo-label class="k-label k-form-label" [text]="getValueLabel()" [for]="minInput"></kendo-label>
|
|
271
|
-
<div class="k-form-field-wrap">
|
|
272
|
-
<kendo-textbox #minInput [(value)]="from" formControlName="min"></kendo-textbox>
|
|
273
|
-
</div>
|
|
274
|
-
</div>
|
|
275
|
-
} @else {
|
|
276
|
-
<div class="k-form-field">
|
|
277
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage(criteria.type === 'date' ? 'validationStartValue' : 'validationMinValue')" [for]="betweenMinInput"></kendo-label>
|
|
278
|
-
<div class="k-form-field-wrap">
|
|
279
|
-
<kendo-textbox #betweenMinInput [(value)]="from" formControlName="min"></kendo-textbox>
|
|
280
|
-
</div>
|
|
281
|
-
</div>
|
|
282
|
-
<div class="k-form-field">
|
|
283
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage(criteria.type === 'date' ? 'validationEndValue' : 'validationMaxValue')" [for]="betweenMaxInput"></kendo-label>
|
|
284
|
-
<div class="k-form-field-wrap">
|
|
285
|
-
<kendo-textbox #betweenMaxInput [(value)]="to" formControlName="max"></kendo-textbox>
|
|
286
|
-
</div>
|
|
287
|
-
</div>
|
|
288
|
-
}
|
|
289
|
-
@if (criteria.type === 'list') {
|
|
290
|
-
<div class="k-form-field">
|
|
291
|
-
<div class="k-form-field-wrap">
|
|
292
|
-
<kendo-checkbox #showBtnCheckBox [(checkedState)]="showButton"></kendo-checkbox>
|
|
293
|
-
<kendo-label class="k-checkbox-label" [for]="showBtnCheckBox" [text]="getLocalizationMessage('validationShowListButtonCheckbox')"></kendo-label>
|
|
294
|
-
</div>
|
|
295
|
-
</div>
|
|
296
|
-
}
|
|
297
|
-
<div class="k-form-field">
|
|
298
|
-
<div class="k-form-field-wrap">
|
|
299
|
-
<kendo-checkbox #ignoreBlankCheckBox [(checkedState)]="ignoreBlank"></kendo-checkbox>
|
|
300
|
-
<kendo-label class="k-checkbox-label" [for]="ignoreBlankCheckBox" [text]="getLocalizationMessage('validationIgnoreBlankCheckbox')"></kendo-label>
|
|
301
|
-
</div>
|
|
302
|
-
</div>
|
|
303
|
-
<div class="k-form-field">
|
|
304
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationOnInvalidData')"></kendo-label>
|
|
305
|
-
<div class="k-form-field-wrap">
|
|
306
|
-
<ul class="k-radio-list k-list-vertical">
|
|
307
|
-
<li class="k-radio-list-item">
|
|
308
|
-
<kendo-radiobutton #rejectRadioBtn formControlName="onInvalidData" value="reject"></kendo-radiobutton>
|
|
309
|
-
<kendo-label class="k-radio-label" [for]="rejectRadioBtn" [text]="getLocalizationMessage('validationRejectInput')"></kendo-label>
|
|
310
|
-
</li>
|
|
311
|
-
<li class="k-radio-list-item">
|
|
312
|
-
<kendo-radiobutton #warningRadioBtn formControlName="onInvalidData" value="warning"></kendo-radiobutton>
|
|
313
|
-
<kendo-label class="k-radio-label" [for]="warningRadioBtn" [text]="getLocalizationMessage('validationShowWarning')"></kendo-label>
|
|
314
|
-
</li>
|
|
315
|
-
</ul>
|
|
316
|
-
</div>
|
|
317
|
-
</div>
|
|
318
|
-
<div class="k-form-field">
|
|
319
|
-
<div class="k-form-field-wrap">
|
|
320
|
-
<kendo-checkbox #showHintCheckBox [(checkedState)]="showHint"></kendo-checkbox>
|
|
321
|
-
<kendo-label class="k-checkbox-label" [for]="showHintCheckBox" [text]="getLocalizationMessage('validationShowHint')"></kendo-label>
|
|
322
|
-
</div>
|
|
323
|
-
</div>
|
|
324
|
-
<div class="k-form-field">
|
|
325
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationHintTitle')" [for]="hintTitleInput"></kendo-label>
|
|
326
|
-
<div class="k-form-field-wrap">
|
|
327
|
-
<kendo-textbox #hintTitleInput [(value)]="hintTitle"></kendo-textbox>
|
|
328
|
-
</div>
|
|
329
|
-
</div>
|
|
330
|
-
<div class="k-form-field">
|
|
331
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationHintMessage')" [for]="hintMessageInput"></kendo-label>
|
|
332
|
-
<div class="k-form-field-wrap">
|
|
333
|
-
<kendo-textbox #hintMessageInput [(value)]="hintMessage"></kendo-textbox>
|
|
334
|
-
</div>
|
|
335
|
-
</div>
|
|
336
|
-
}
|
|
337
|
-
</form>
|
|
338
|
-
<kendo-dialog-actions layout="start" #dialogActions>
|
|
339
|
-
<button kendoButton themeColor="primary" [disabled]="validationFormGroup?.invalid" (click)="dialogAction.emit(getLocalizationMessage('dialogApply'))">
|
|
340
|
-
{{getLocalizationMessage('dialogApply')}}
|
|
341
|
-
</button>
|
|
342
|
-
<button kendoButton (click)="dialogAction.emit(getLocalizationMessage('dialogCancel'))">{{getLocalizationMessage('dialogCancel')}}</button>
|
|
343
|
-
@if (validationPresent) {
|
|
344
|
-
<button kendoButton themeColor="error" fillMode="flat" (click)="dialogAction.emit(getLocalizationMessage('dialogRemove'))">
|
|
345
|
-
{{getLocalizationMessage('dialogRemove')}}
|
|
346
|
-
</button>
|
|
347
|
-
}
|
|
348
|
-
</kendo-dialog-actions>
|
|
349
|
-
`, isInline: true, dependencies: [{ kind: "component", type: TextBoxComponent, selector: "kendo-textbox", inputs: ["focusableId", "title", "type", "disabled", "readonly", "tabindex", "value", "selectOnFocus", "showSuccessIcon", "showErrorIcon", "clearButton", "successIcon", "successSvgIcon", "errorIcon", "errorSvgIcon", "clearButtonIcon", "clearButtonSvgIcon", "size", "rounded", "fillMode", "tabIndex", "placeholder", "maxlength", "inputAttributes"], outputs: ["valueChange", "inputFocus", "inputBlur", "focus", "blur"], exportAs: ["kendoTextBox"] }, { kind: "component", type: DropDownListComponent, selector: "kendo-dropdownlist", inputs: ["customIconClass", "showStickyHeader", "icon", "svgIcon", "loading", "data", "value", "textField", "valueField", "adaptiveMode", "adaptiveTitle", "adaptiveSubtitle", "popupSettings", "listHeight", "defaultItem", "disabled", "itemDisabled", "readonly", "filterable", "virtual", "ignoreCase", "delay", "valuePrimitive", "tabindex", "tabIndex", "size", "rounded", "fillMode", "leftRightArrowsNavigation", "id"], outputs: ["valueChange", "filterChange", "selectionChange", "open", "opened", "close", "closed", "focus", "blur"], exportAs: ["kendoDropDownList"] }, { kind: "component", type: CheckBoxComponent, selector: "kendo-checkbox", inputs: ["checkedState", "rounded"], outputs: ["checkedStateChange"], exportAs: ["kendoCheckBox"] }, { kind: "component", type: RadioButtonComponent, selector: "kendo-radiobutton", inputs: ["checked"], outputs: ["checkedChange"], exportAs: ["kendoRadioButton"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i4.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i4.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i4.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: LabelComponent, selector: "kendo-label", inputs: ["text", "for", "optional", "labelCssStyle", "labelCssClass"], exportAs: ["kendoLabel"] }, { kind: "component", type: DialogActionsComponent, selector: "kendo-dialog-actions", inputs: ["actions", "layout"], outputs: ["action"] }, { kind: "component", type: ButtonComponent, selector: "button[kendoButton]", inputs: ["arrowIcon", "toggleable", "togglable", "selected", "tabIndex", "imageUrl", "iconClass", "icon", "disabled", "size", "rounded", "fillMode", "themeColor", "svgIcon", "primary", "look"], outputs: ["selectedChange", "click"], exportAs: ["kendoButton"] }] });
|
|
350
|
-
}
|
|
351
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: DataValidationDialogComponent, decorators: [{
|
|
352
|
-
type: Component,
|
|
353
|
-
args: [{
|
|
354
|
-
template: `
|
|
355
|
-
<form class="k-form k-form-md" [formGroup]="validationFormGroup">
|
|
356
|
-
<div class="k-form-field">
|
|
357
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationCellRange')" [for]="rangeInput"></kendo-label>
|
|
358
|
-
<div class="k-form-field-wrap">
|
|
359
|
-
<kendo-textbox #rangeInput
|
|
360
|
-
[clearButton]="true"
|
|
361
|
-
[value]="cellRange"
|
|
362
|
-
(valueChange)="onRangeChange($event, rangeInput)"
|
|
363
|
-
formControlName="range">
|
|
364
|
-
</kendo-textbox>
|
|
365
|
-
</div>
|
|
366
|
-
</div>
|
|
367
|
-
<div class="k-form-field">
|
|
368
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationCriteria')" [for]="criteriaInput"></kendo-label>
|
|
369
|
-
<div class="k-form-field-wrap">
|
|
370
|
-
<kendo-dropdownlist #criteriaInput
|
|
371
|
-
[data]="criteriaList"
|
|
372
|
-
[value]="criteria"
|
|
373
|
-
(selectionChange)="onSelectionChange($event, 'criteria')"
|
|
374
|
-
textField="name"
|
|
375
|
-
valueField="type">
|
|
376
|
-
</kendo-dropdownlist>
|
|
377
|
-
</div>
|
|
378
|
-
</div>
|
|
379
|
-
@if (criteria.type !== 'any') {
|
|
380
|
-
@if (showComparer) {
|
|
381
|
-
<div class="k-form-field">
|
|
382
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationComparer')" [for]="comparerInput"></kendo-label>
|
|
383
|
-
<div class="k-form-field-wrap">
|
|
384
|
-
<kendo-dropdownlist #comparerInput
|
|
385
|
-
[data]="comparerList"
|
|
386
|
-
[value]="comparer"
|
|
387
|
-
(selectionChange)="onSelectionChange($event, 'comparer')"
|
|
388
|
-
textField="name"
|
|
389
|
-
valueField="type">
|
|
390
|
-
</kendo-dropdownlist>
|
|
391
|
-
</div>
|
|
392
|
-
</div>
|
|
393
|
-
}
|
|
394
|
-
@if (singleValue) {
|
|
395
|
-
<div class="k-form-field">
|
|
396
|
-
<kendo-label class="k-label k-form-label" [text]="getValueLabel()" [for]="minInput"></kendo-label>
|
|
397
|
-
<div class="k-form-field-wrap">
|
|
398
|
-
<kendo-textbox #minInput [(value)]="from" formControlName="min"></kendo-textbox>
|
|
399
|
-
</div>
|
|
400
|
-
</div>
|
|
401
|
-
} @else {
|
|
402
|
-
<div class="k-form-field">
|
|
403
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage(criteria.type === 'date' ? 'validationStartValue' : 'validationMinValue')" [for]="betweenMinInput"></kendo-label>
|
|
404
|
-
<div class="k-form-field-wrap">
|
|
405
|
-
<kendo-textbox #betweenMinInput [(value)]="from" formControlName="min"></kendo-textbox>
|
|
406
|
-
</div>
|
|
407
|
-
</div>
|
|
408
|
-
<div class="k-form-field">
|
|
409
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage(criteria.type === 'date' ? 'validationEndValue' : 'validationMaxValue')" [for]="betweenMaxInput"></kendo-label>
|
|
410
|
-
<div class="k-form-field-wrap">
|
|
411
|
-
<kendo-textbox #betweenMaxInput [(value)]="to" formControlName="max"></kendo-textbox>
|
|
412
|
-
</div>
|
|
413
|
-
</div>
|
|
414
|
-
}
|
|
415
|
-
@if (criteria.type === 'list') {
|
|
416
|
-
<div class="k-form-field">
|
|
417
|
-
<div class="k-form-field-wrap">
|
|
418
|
-
<kendo-checkbox #showBtnCheckBox [(checkedState)]="showButton"></kendo-checkbox>
|
|
419
|
-
<kendo-label class="k-checkbox-label" [for]="showBtnCheckBox" [text]="getLocalizationMessage('validationShowListButtonCheckbox')"></kendo-label>
|
|
420
|
-
</div>
|
|
421
|
-
</div>
|
|
422
|
-
}
|
|
423
|
-
<div class="k-form-field">
|
|
424
|
-
<div class="k-form-field-wrap">
|
|
425
|
-
<kendo-checkbox #ignoreBlankCheckBox [(checkedState)]="ignoreBlank"></kendo-checkbox>
|
|
426
|
-
<kendo-label class="k-checkbox-label" [for]="ignoreBlankCheckBox" [text]="getLocalizationMessage('validationIgnoreBlankCheckbox')"></kendo-label>
|
|
427
|
-
</div>
|
|
428
|
-
</div>
|
|
429
|
-
<div class="k-form-field">
|
|
430
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationOnInvalidData')"></kendo-label>
|
|
431
|
-
<div class="k-form-field-wrap">
|
|
432
|
-
<ul class="k-radio-list k-list-vertical">
|
|
433
|
-
<li class="k-radio-list-item">
|
|
434
|
-
<kendo-radiobutton #rejectRadioBtn formControlName="onInvalidData" value="reject"></kendo-radiobutton>
|
|
435
|
-
<kendo-label class="k-radio-label" [for]="rejectRadioBtn" [text]="getLocalizationMessage('validationRejectInput')"></kendo-label>
|
|
436
|
-
</li>
|
|
437
|
-
<li class="k-radio-list-item">
|
|
438
|
-
<kendo-radiobutton #warningRadioBtn formControlName="onInvalidData" value="warning"></kendo-radiobutton>
|
|
439
|
-
<kendo-label class="k-radio-label" [for]="warningRadioBtn" [text]="getLocalizationMessage('validationShowWarning')"></kendo-label>
|
|
440
|
-
</li>
|
|
441
|
-
</ul>
|
|
442
|
-
</div>
|
|
443
|
-
</div>
|
|
444
|
-
<div class="k-form-field">
|
|
445
|
-
<div class="k-form-field-wrap">
|
|
446
|
-
<kendo-checkbox #showHintCheckBox [(checkedState)]="showHint"></kendo-checkbox>
|
|
447
|
-
<kendo-label class="k-checkbox-label" [for]="showHintCheckBox" [text]="getLocalizationMessage('validationShowHint')"></kendo-label>
|
|
448
|
-
</div>
|
|
449
|
-
</div>
|
|
450
|
-
<div class="k-form-field">
|
|
451
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationHintTitle')" [for]="hintTitleInput"></kendo-label>
|
|
452
|
-
<div class="k-form-field-wrap">
|
|
453
|
-
<kendo-textbox #hintTitleInput [(value)]="hintTitle"></kendo-textbox>
|
|
454
|
-
</div>
|
|
455
|
-
</div>
|
|
456
|
-
<div class="k-form-field">
|
|
457
|
-
<kendo-label class="k-form-label" [text]="getLocalizationMessage('validationHintMessage')" [for]="hintMessageInput"></kendo-label>
|
|
458
|
-
<div class="k-form-field-wrap">
|
|
459
|
-
<kendo-textbox #hintMessageInput [(value)]="hintMessage"></kendo-textbox>
|
|
460
|
-
</div>
|
|
461
|
-
</div>
|
|
462
|
-
}
|
|
463
|
-
</form>
|
|
464
|
-
<kendo-dialog-actions layout="start" #dialogActions>
|
|
465
|
-
<button kendoButton themeColor="primary" [disabled]="validationFormGroup?.invalid" (click)="dialogAction.emit(getLocalizationMessage('dialogApply'))">
|
|
466
|
-
{{getLocalizationMessage('dialogApply')}}
|
|
467
|
-
</button>
|
|
468
|
-
<button kendoButton (click)="dialogAction.emit(getLocalizationMessage('dialogCancel'))">{{getLocalizationMessage('dialogCancel')}}</button>
|
|
469
|
-
@if (validationPresent) {
|
|
470
|
-
<button kendoButton themeColor="error" fillMode="flat" (click)="dialogAction.emit(getLocalizationMessage('dialogRemove'))">
|
|
471
|
-
{{getLocalizationMessage('dialogRemove')}}
|
|
472
|
-
</button>
|
|
473
|
-
}
|
|
474
|
-
</kendo-dialog-actions>
|
|
475
|
-
`,
|
|
476
|
-
standalone: true,
|
|
477
|
-
imports: [TextBoxComponent, DropDownListComponent, CheckBoxComponent, RadioButtonComponent, ReactiveFormsModule, LabelComponent, DialogActionsComponent, ButtonComponent]
|
|
478
|
-
}]
|
|
479
|
-
}], ctorParameters: () => [{ type: i1.LocalizationService }, { type: i2.SpreadsheetService }, { type: i0.NgZone }, { type: i3.DialogRef }], propDecorators: { dialogAction: [{
|
|
480
|
-
type: Output
|
|
481
|
-
}] } });
|
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
/**-----------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
3
|
-
* Licensed under commercial license. See LICENSE.md in the project root for more information
|
|
4
|
-
*-------------------------------------------------------------------------------------------*/
|
|
5
|
-
import { Directive, Renderer2 } from '@angular/core';
|
|
6
|
-
import { take } from 'rxjs/operators';
|
|
7
|
-
import { ToolBarButtonComponent } from '@progress/kendo-angular-toolbar';
|
|
8
|
-
import { DialogService } from '@progress/kendo-angular-dialog';
|
|
9
|
-
import { SpreadsheetLocalizationService } from '../localization/spreadsheet-localization.service';
|
|
10
|
-
import { SpreadsheetService } from '../common/spreadsheet.service';
|
|
11
|
-
import { SpreadsheetToolsService } from './tools.service';
|
|
12
|
-
import { SpreadsheetCommandButton } from './shared/spreadsheet-command-button';
|
|
13
|
-
import { DataValidationDialogComponent } from './data-validation-dialog.component';
|
|
14
|
-
import * as i0 from "@angular/core";
|
|
15
|
-
import * as i1 from "@progress/kendo-angular-toolbar";
|
|
16
|
-
import * as i2 from "../localization/spreadsheet-localization.service";
|
|
17
|
-
import * as i3 from "../common/spreadsheet.service";
|
|
18
|
-
import * as i4 from "./tools.service";
|
|
19
|
-
import * as i5 from "@progress/kendo-angular-dialog";
|
|
20
|
-
const COMPARERS_LIST = [
|
|
21
|
-
{ type: 'greaterThan', name: 'greater than' },
|
|
22
|
-
{ type: 'lessThan', name: 'less than' },
|
|
23
|
-
{ type: 'between', name: 'between' },
|
|
24
|
-
{ type: 'notBetween', name: 'not between' },
|
|
25
|
-
{ type: 'equalTo', name: 'equal to' },
|
|
26
|
-
{ type: 'notEqualTo', name: 'not equal to' },
|
|
27
|
-
{ type: 'greaterThanOrEqualTo', name: 'greater than or equal to' },
|
|
28
|
-
{ type: 'lessThanOrEqualTo', name: 'less than or equal to' }
|
|
29
|
-
];
|
|
30
|
-
const CRITERIA_LIST = [
|
|
31
|
-
{ type: 'any', name: 'Any value' },
|
|
32
|
-
{ type: 'number', name: 'Number' },
|
|
33
|
-
{ type: 'text', name: 'Text' },
|
|
34
|
-
{ type: 'date', name: 'Date' },
|
|
35
|
-
{ type: 'custom', name: 'Custom Formula' },
|
|
36
|
-
{ type: 'list', name: 'List' }
|
|
37
|
-
];
|
|
38
|
-
/**
|
|
39
|
-
* @hidden
|
|
40
|
-
*/
|
|
41
|
-
export class SpreadsheetDataValidationDirective extends SpreadsheetCommandButton {
|
|
42
|
-
dialogService;
|
|
43
|
-
renderer;
|
|
44
|
-
constructor(button, localization, spreadsheetService, toolsService, dialogService, renderer) {
|
|
45
|
-
super('dataValidation', button, localization, spreadsheetService, toolsService, {
|
|
46
|
-
command: 'EditValidationCommand', options: { value: '' }
|
|
47
|
-
});
|
|
48
|
-
this.dialogService = dialogService;
|
|
49
|
-
this.renderer = renderer;
|
|
50
|
-
button.showText = 'always';
|
|
51
|
-
}
|
|
52
|
-
get currentRange() {
|
|
53
|
-
return this.spreadsheetService.spreadsheet.options.nameBoxRef.current.value();
|
|
54
|
-
}
|
|
55
|
-
ngAfterViewInit() {
|
|
56
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-haspopup', 'dialog');
|
|
57
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-expanded', 'false');
|
|
58
|
-
}
|
|
59
|
-
clickHandler() {
|
|
60
|
-
this.openDialog();
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* @hidden
|
|
64
|
-
*/
|
|
65
|
-
openDialog() {
|
|
66
|
-
const currentSheet = this.spreadsheetService.spreadsheet.activeSheet();
|
|
67
|
-
const currentRangeValidation = currentSheet.range(currentSheet.activeCell()).validation();
|
|
68
|
-
const dialogSettings = {
|
|
69
|
-
appendTo: this.spreadsheetService.dialogContainer,
|
|
70
|
-
title: this.localization.get(this.command),
|
|
71
|
-
content: DataValidationDialogComponent,
|
|
72
|
-
minWidth: 400,
|
|
73
|
-
maxHeight: '90%',
|
|
74
|
-
};
|
|
75
|
-
const dialog = this.dialogService.open(dialogSettings);
|
|
76
|
-
const dialogContent = dialog.content.instance;
|
|
77
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-expanded', 'true');
|
|
78
|
-
let contentData;
|
|
79
|
-
if (currentRangeValidation) {
|
|
80
|
-
contentData = {
|
|
81
|
-
cellRange: this.currentRange,
|
|
82
|
-
to: currentRangeValidation.to,
|
|
83
|
-
from: currentRangeValidation.from,
|
|
84
|
-
criteria: { type: currentRangeValidation.dataType, name: CRITERIA_LIST.find(i => i.type === currentRangeValidation.dataType).name },
|
|
85
|
-
comparer: currentRangeValidation.dataType === 'custom' || currentRangeValidation.dataType === 'list' ? null : { type: currentRangeValidation.comparerType, name: COMPARERS_LIST.find(i => i.type === currentRangeValidation.comparerType).name },
|
|
86
|
-
ignoreBlank: currentRangeValidation.allowNulls,
|
|
87
|
-
showButton: currentRangeValidation.showButton,
|
|
88
|
-
onInvalidData: currentRangeValidation.type
|
|
89
|
-
};
|
|
90
|
-
if (currentRangeValidation.messageTemplate || currentRangeValidation.titleTemplate) {
|
|
91
|
-
contentData = Object.assign(contentData, {
|
|
92
|
-
hintMessage: currentRangeValidation.messageTemplate,
|
|
93
|
-
hintTitle: currentRangeValidation.titleTemplate,
|
|
94
|
-
showHint: true
|
|
95
|
-
});
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
else {
|
|
99
|
-
contentData = { cellRange: this.currentRange };
|
|
100
|
-
}
|
|
101
|
-
dialogContent.setData(contentData);
|
|
102
|
-
dialogContent.dialogAction.pipe(take(1)).subscribe((actionType) => {
|
|
103
|
-
if (actionType === this.localization.get('dialogCancel')) {
|
|
104
|
-
dialog.close();
|
|
105
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-expanded', 'false');
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
let options = {
|
|
109
|
-
type: dialogContent.onInvalidData,
|
|
110
|
-
dataType: dialogContent.criteria.type,
|
|
111
|
-
comparerType: dialogContent.comparer.type,
|
|
112
|
-
from: dialogContent.from,
|
|
113
|
-
to: dialogContent.to,
|
|
114
|
-
allowNulls: dialogContent.ignoreBlank,
|
|
115
|
-
showButton: dialogContent.showButton,
|
|
116
|
-
messageTemplate: dialogContent.showHint ? dialogContent.hintMessage : null,
|
|
117
|
-
titleTemplate: dialogContent.showHint ? dialogContent.hintTitle : null
|
|
118
|
-
};
|
|
119
|
-
if (dialogContent.criteria.type === 'list' || dialogContent.criteria.type === 'text') {
|
|
120
|
-
const isWrappedInQuotes = options.from.startsWith('"') && options.from.endsWith('"');
|
|
121
|
-
let isRangeValue = true;
|
|
122
|
-
try {
|
|
123
|
-
isRangeValue = Boolean(this.spreadsheetService.spreadsheet.activeSheet().range(dialogContent.from));
|
|
124
|
-
}
|
|
125
|
-
catch (_e) {
|
|
126
|
-
isRangeValue = false;
|
|
127
|
-
}
|
|
128
|
-
if (!isWrappedInQuotes && !isRangeValue) {
|
|
129
|
-
options = Object.assign(options, { from: `"${options.from}"` });
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
if (actionType === this.localization.get('dialogRemove') || dialogContent.criteria.type === 'any') {
|
|
133
|
-
options = null;
|
|
134
|
-
}
|
|
135
|
-
this.spreadsheetService.spreadsheet.executeCommand({
|
|
136
|
-
command: 'EditValidationCommand',
|
|
137
|
-
options: { value: options }
|
|
138
|
-
});
|
|
139
|
-
dialog.close();
|
|
140
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-expanded', 'false');
|
|
141
|
-
}
|
|
142
|
-
});
|
|
143
|
-
dialog.dialog.instance.close.pipe(take(1)).subscribe(() => {
|
|
144
|
-
this.renderer.setAttribute(this.button.toolbarButtonElement.nativeElement, 'aria-expanded', 'false');
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpreadsheetDataValidationDirective, deps: [{ token: i1.ToolBarButtonComponent }, { token: i2.SpreadsheetLocalizationService }, { token: i3.SpreadsheetService }, { token: i4.SpreadsheetToolsService }, { token: i5.DialogService }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive });
|
|
148
|
-
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.2.14", type: SpreadsheetDataValidationDirective, isStandalone: true, selector: "kendo-toolbar-button[kendoSpreadsheetDataValidation]", usesInheritance: true, ngImport: i0 });
|
|
149
|
-
}
|
|
150
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.14", ngImport: i0, type: SpreadsheetDataValidationDirective, decorators: [{
|
|
151
|
-
type: Directive,
|
|
152
|
-
args: [{
|
|
153
|
-
selector: 'kendo-toolbar-button[kendoSpreadsheetDataValidation]',
|
|
154
|
-
standalone: true
|
|
155
|
-
}]
|
|
156
|
-
}], ctorParameters: () => [{ type: i1.ToolBarButtonComponent }, { type: i2.SpreadsheetLocalizationService }, { type: i3.SpreadsheetService }, { type: i4.SpreadsheetToolsService }, { type: i5.DialogService }, { type: i0.Renderer2 }] });
|