@clr/angular 16.3.2 → 16.3.3
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/accordion/stepper/models/stepper.model.d.ts +2 -0
- package/accordion/stepper/providers/stepper.service.d.ts +2 -0
- package/clarity.api.md +4 -0
- package/esm2020/accordion/stepper/models/stepper.model.mjs +7 -1
- package/esm2020/accordion/stepper/providers/stepper.service.mjs +9 -1
- package/esm2020/accordion/stepper/stepper-panel.mjs +11 -6
- package/esm2020/forms/combobox/option-items.directive.mjs +12 -6
- package/esm2020/forms/password/password-container.mjs +9 -3
- package/esm2020/popover/signpost/signpost-trigger.mjs +2 -1
- package/esm2020/utils/i18n/common-strings.default.mjs +3 -3
- package/fesm2015/clr-angular.mjs +46 -14
- package/fesm2015/clr-angular.mjs.map +1 -1
- package/fesm2020/clr-angular.mjs +46 -14
- package/fesm2020/clr-angular.mjs.map +1 -1
- package/forms/password/password-container.d.ts +2 -0
- package/package.json +2 -2
package/fesm2020/clr-angular.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Directive, NgModule, Optional, Input, Injectable, Component, ChangeDete
|
|
|
3
3
|
import * as i5 from '@angular/common';
|
|
4
4
|
import { CommonModule, isPlatformBrowser, DOCUMENT, NgForOf, getLocaleDayNames, FormStyle, TranslationWidth, getLocaleMonthNames, getLocaleFirstDayOfWeek, getLocaleDateFormat, FormatWidth } from '@angular/common';
|
|
5
5
|
import { ClarityIcons, angleIcon, exclamationCircleIcon, checkCircleIcon, ellipsisHorizontalIcon, windowCloseIcon, eventIcon, calendarIcon, eyeHideIcon, eyeIcon, ellipsisVerticalIcon, viewColumnsIcon, arrowIcon, timesIcon, stepForward2Icon, angleDoubleIcon, filterGridCircleIcon, filterGridIcon, infoCircleIcon, exclamationTriangleIcon, circleIcon, dotCircleIcon, errorStandardIcon, successStandardIcon } from '@cds/core/icon';
|
|
6
|
-
import { map, tap, startWith, distinctUntilChanged,
|
|
6
|
+
import { map, tap, startWith, distinctUntilChanged, filter, skipUntil, debounceTime, takeUntil, take, first, switchMap } from 'rxjs/operators';
|
|
7
7
|
import * as i3 from 'rxjs';
|
|
8
8
|
import { Subject, BehaviorSubject, Observable, fromEvent, isObservable, of, ReplaySubject, combineLatest, merge } from 'rxjs';
|
|
9
9
|
import { trigger, transition, style, animate, state, keyframes } from '@angular/animations';
|
|
@@ -361,8 +361,8 @@ const commonStringsDefault = {
|
|
|
361
361
|
* Password Input
|
|
362
362
|
* Screen-reader text for the hide/show password field button
|
|
363
363
|
*/
|
|
364
|
-
passwordHide: 'Hide password',
|
|
365
|
-
passwordShow: 'Show password',
|
|
364
|
+
passwordHide: 'Hide password for {LABEL}',
|
|
365
|
+
passwordShow: 'Show password for {LABEL}',
|
|
366
366
|
/**
|
|
367
367
|
* Datagrid footer; sr-only text after the number of selected rows.
|
|
368
368
|
*/
|
|
@@ -960,6 +960,12 @@ class StepperModel extends AccordionModel {
|
|
|
960
960
|
}
|
|
961
961
|
});
|
|
962
962
|
}
|
|
963
|
+
setPanelValid(panelId) {
|
|
964
|
+
this._panels[panelId].status = AccordionStatus.Complete;
|
|
965
|
+
}
|
|
966
|
+
setPanelInvalid(panelId) {
|
|
967
|
+
this._panels[panelId].status = AccordionStatus.Error;
|
|
968
|
+
}
|
|
963
969
|
setPanelsWithErrors(ids) {
|
|
964
970
|
ids.forEach(id => this.setPanelError(id));
|
|
965
971
|
}
|
|
@@ -1043,6 +1049,14 @@ class StepperService extends AccordionService {
|
|
|
1043
1049
|
this.accordion.resetPanels();
|
|
1044
1050
|
this.emitUpdatedPanels();
|
|
1045
1051
|
}
|
|
1052
|
+
setPanelValid(panelId) {
|
|
1053
|
+
this.accordion.setPanelValid(panelId);
|
|
1054
|
+
this.emitUpdatedPanels();
|
|
1055
|
+
}
|
|
1056
|
+
setPanelInvalid(panelId) {
|
|
1057
|
+
this.accordion.setPanelInvalid(panelId);
|
|
1058
|
+
this.emitUpdatedPanels();
|
|
1059
|
+
}
|
|
1046
1060
|
setPanelsWithErrors(ids) {
|
|
1047
1061
|
this.accordion.setPanelsWithErrors(ids);
|
|
1048
1062
|
this.emitUpdatedPanels();
|
|
@@ -1105,11 +1119,16 @@ class ClrStepperPanel extends ClrAccordionPanel {
|
|
|
1105
1119
|
this.panel = this.panel.pipe(tap(panel => this.triggerAllFormControlValidationIfError(panel)));
|
|
1106
1120
|
this.stepperService.disablePanel(this.id, true);
|
|
1107
1121
|
this.listenToFocusChanges();
|
|
1122
|
+
// not all stepper panels are guaranteed to have a form (i.e. empty template-driven)
|
|
1108
1123
|
if (this.formGroup) {
|
|
1109
|
-
//
|
|
1110
|
-
this.
|
|
1111
|
-
|
|
1112
|
-
|
|
1124
|
+
// set panel status on form status change only after the form becomes invalid
|
|
1125
|
+
const invalidStatusTrigger = this.formGroup.statusChanges.pipe(filter(status => status === 'INVALID'));
|
|
1126
|
+
this.subscriptions.push(this.formGroup.statusChanges.pipe(skipUntil(invalidStatusTrigger), distinctUntilChanged()).subscribe(status => {
|
|
1127
|
+
if (status === 'VALID') {
|
|
1128
|
+
this.stepperService.setPanelValid(this.id);
|
|
1129
|
+
}
|
|
1130
|
+
else if (status === 'INVALID') {
|
|
1131
|
+
this.stepperService.setPanelInvalid(this.id);
|
|
1113
1132
|
}
|
|
1114
1133
|
}));
|
|
1115
1134
|
}
|
|
@@ -7166,25 +7185,24 @@ class ClrOptionItems {
|
|
|
7166
7185
|
if (!this._rawItems || this.filter === undefined || this.filter === null) {
|
|
7167
7186
|
return;
|
|
7168
7187
|
}
|
|
7188
|
+
const normalizedFilterValue = normalizeValue(this.filter);
|
|
7169
7189
|
if (this.optionService.showAllOptions) {
|
|
7170
7190
|
this.filteredItems = this._rawItems;
|
|
7171
7191
|
}
|
|
7172
7192
|
else if (this._filterField) {
|
|
7173
7193
|
this.filteredItems = this._rawItems.filter(item => {
|
|
7174
7194
|
const objValue = item[this._filterField];
|
|
7175
|
-
return objValue ? objValue
|
|
7195
|
+
return objValue ? normalizeValue(objValue).includes(normalizedFilterValue) : false;
|
|
7176
7196
|
});
|
|
7177
7197
|
}
|
|
7178
7198
|
else {
|
|
7179
7199
|
// Filter by all item object values
|
|
7180
7200
|
this.filteredItems = this._rawItems.filter(item => {
|
|
7181
7201
|
if (typeof item !== 'object') {
|
|
7182
|
-
return item
|
|
7202
|
+
return normalizeValue(item).includes(normalizedFilterValue);
|
|
7183
7203
|
}
|
|
7184
7204
|
const objValues = Object.values(item).filter(value => {
|
|
7185
|
-
return value !== null && value !== undefined
|
|
7186
|
-
? value.toString().toLowerCase().indexOf(this.filter.toString().toLowerCase()) > -1
|
|
7187
|
-
: false;
|
|
7205
|
+
return value !== null && value !== undefined ? normalizeValue(value).includes(normalizedFilterValue) : false;
|
|
7188
7206
|
});
|
|
7189
7207
|
return objValues.length > 0;
|
|
7190
7208
|
});
|
|
@@ -7209,6 +7227,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
7209
7227
|
type: Input,
|
|
7210
7228
|
args: ['clrOptionItemsField']
|
|
7211
7229
|
}] } });
|
|
7230
|
+
function normalizeValue(value) {
|
|
7231
|
+
return value
|
|
7232
|
+
.toString()
|
|
7233
|
+
.normalize('NFD')
|
|
7234
|
+
.replace(/\p{Diacritic}/gu, '')
|
|
7235
|
+
.toLowerCase();
|
|
7236
|
+
}
|
|
7212
7237
|
|
|
7213
7238
|
/*
|
|
7214
7239
|
* Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
|
|
@@ -10005,6 +10030,12 @@ class ClrPasswordContainer extends ClrAbstractContainer {
|
|
|
10005
10030
|
this.show = !this.show;
|
|
10006
10031
|
this.toggleService.next(this.show);
|
|
10007
10032
|
}
|
|
10033
|
+
showPasswordText(label) {
|
|
10034
|
+
return this.commonStrings.parse(this.commonStrings.keys.passwordShow, { LABEL: label });
|
|
10035
|
+
}
|
|
10036
|
+
hidePasswordText(label) {
|
|
10037
|
+
return this.commonStrings.parse(this.commonStrings.keys.passwordHide, { LABEL: label });
|
|
10038
|
+
}
|
|
10008
10039
|
}
|
|
10009
10040
|
ClrPasswordContainer.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.2", ngImport: i0, type: ClrPasswordContainer, deps: [{ token: IfControlStateService }, { token: LayoutService, optional: true }, { token: ControlClassService }, { token: NgControlService }, { token: FocusService }, { token: TOGGLE_SERVICE }, { token: ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
|
|
10010
10041
|
ClrPasswordContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.2", type: ClrPasswordContainer, selector: "clr-password-container", inputs: { clrToggle: "clrToggle" }, host: { properties: { "class.clr-form-control": "true", "class.clr-form-control-disabled": "control?.disabled", "class.clr-row": "addGrid()" } }, providers: [
|
|
@@ -10030,7 +10061,7 @@ ClrPasswordContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
|
|
|
10030
10061
|
>
|
|
10031
10062
|
<cds-icon status="info" class="clr-password-eye-icon" [attr.shape]="show ? 'eye-hide' : 'eye'"></cds-icon>
|
|
10032
10063
|
<span class="clr-sr-only">
|
|
10033
|
-
{{ show ?
|
|
10064
|
+
{{ show ? hidePasswordText(label?.labelText) : showPasswordText(label?.labelText) }}
|
|
10034
10065
|
</span>
|
|
10035
10066
|
</button>
|
|
10036
10067
|
</div>
|
|
@@ -10074,7 +10105,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
10074
10105
|
>
|
|
10075
10106
|
<cds-icon status="info" class="clr-password-eye-icon" [attr.shape]="show ? 'eye-hide' : 'eye'"></cds-icon>
|
|
10076
10107
|
<span class="clr-sr-only">
|
|
10077
|
-
{{ show ?
|
|
10108
|
+
{{ show ? hidePasswordText(label?.labelText) : showPasswordText(label?.labelText) }}
|
|
10078
10109
|
</span>
|
|
10079
10110
|
</button>
|
|
10080
10111
|
</div>
|
|
@@ -13577,6 +13608,7 @@ class ClrSignpostTrigger {
|
|
|
13577
13608
|
this.signpostIdService = signpostIdService;
|
|
13578
13609
|
this.signpostFocusManager = signpostFocusManager;
|
|
13579
13610
|
this.platformId = platformId;
|
|
13611
|
+
this.ariaExpanded = false;
|
|
13580
13612
|
this.subscriptions = [];
|
|
13581
13613
|
this.document = document;
|
|
13582
13614
|
}
|