@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/fesm2015/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';
|
|
@@ -363,8 +363,8 @@ const commonStringsDefault = {
|
|
|
363
363
|
* Password Input
|
|
364
364
|
* Screen-reader text for the hide/show password field button
|
|
365
365
|
*/
|
|
366
|
-
passwordHide: 'Hide password',
|
|
367
|
-
passwordShow: 'Show password',
|
|
366
|
+
passwordHide: 'Hide password for {LABEL}',
|
|
367
|
+
passwordShow: 'Show password for {LABEL}',
|
|
368
368
|
/**
|
|
369
369
|
* Datagrid footer; sr-only text after the number of selected rows.
|
|
370
370
|
*/
|
|
@@ -964,6 +964,12 @@ class StepperModel extends AccordionModel {
|
|
|
964
964
|
}
|
|
965
965
|
});
|
|
966
966
|
}
|
|
967
|
+
setPanelValid(panelId) {
|
|
968
|
+
this._panels[panelId].status = AccordionStatus.Complete;
|
|
969
|
+
}
|
|
970
|
+
setPanelInvalid(panelId) {
|
|
971
|
+
this._panels[panelId].status = AccordionStatus.Error;
|
|
972
|
+
}
|
|
967
973
|
setPanelsWithErrors(ids) {
|
|
968
974
|
ids.forEach(id => this.setPanelError(id));
|
|
969
975
|
}
|
|
@@ -1047,6 +1053,14 @@ class StepperService extends AccordionService {
|
|
|
1047
1053
|
this.accordion.resetPanels();
|
|
1048
1054
|
this.emitUpdatedPanels();
|
|
1049
1055
|
}
|
|
1056
|
+
setPanelValid(panelId) {
|
|
1057
|
+
this.accordion.setPanelValid(panelId);
|
|
1058
|
+
this.emitUpdatedPanels();
|
|
1059
|
+
}
|
|
1060
|
+
setPanelInvalid(panelId) {
|
|
1061
|
+
this.accordion.setPanelInvalid(panelId);
|
|
1062
|
+
this.emitUpdatedPanels();
|
|
1063
|
+
}
|
|
1050
1064
|
setPanelsWithErrors(ids) {
|
|
1051
1065
|
this.accordion.setPanelsWithErrors(ids);
|
|
1052
1066
|
this.emitUpdatedPanels();
|
|
@@ -1109,11 +1123,16 @@ class ClrStepperPanel extends ClrAccordionPanel {
|
|
|
1109
1123
|
this.panel = this.panel.pipe(tap(panel => this.triggerAllFormControlValidationIfError(panel)));
|
|
1110
1124
|
this.stepperService.disablePanel(this.id, true);
|
|
1111
1125
|
this.listenToFocusChanges();
|
|
1126
|
+
// not all stepper panels are guaranteed to have a form (i.e. empty template-driven)
|
|
1112
1127
|
if (this.formGroup) {
|
|
1113
|
-
//
|
|
1114
|
-
this.
|
|
1115
|
-
|
|
1116
|
-
|
|
1128
|
+
// set panel status on form status change only after the form becomes invalid
|
|
1129
|
+
const invalidStatusTrigger = this.formGroup.statusChanges.pipe(filter(status => status === 'INVALID'));
|
|
1130
|
+
this.subscriptions.push(this.formGroup.statusChanges.pipe(skipUntil(invalidStatusTrigger), distinctUntilChanged()).subscribe(status => {
|
|
1131
|
+
if (status === 'VALID') {
|
|
1132
|
+
this.stepperService.setPanelValid(this.id);
|
|
1133
|
+
}
|
|
1134
|
+
else if (status === 'INVALID') {
|
|
1135
|
+
this.stepperService.setPanelInvalid(this.id);
|
|
1117
1136
|
}
|
|
1118
1137
|
}));
|
|
1119
1138
|
}
|
|
@@ -7211,25 +7230,24 @@ class ClrOptionItems {
|
|
|
7211
7230
|
if (!this._rawItems || this.filter === undefined || this.filter === null) {
|
|
7212
7231
|
return;
|
|
7213
7232
|
}
|
|
7233
|
+
const normalizedFilterValue = normalizeValue(this.filter);
|
|
7214
7234
|
if (this.optionService.showAllOptions) {
|
|
7215
7235
|
this.filteredItems = this._rawItems;
|
|
7216
7236
|
}
|
|
7217
7237
|
else if (this._filterField) {
|
|
7218
7238
|
this.filteredItems = this._rawItems.filter(item => {
|
|
7219
7239
|
const objValue = item[this._filterField];
|
|
7220
|
-
return objValue ? objValue
|
|
7240
|
+
return objValue ? normalizeValue(objValue).includes(normalizedFilterValue) : false;
|
|
7221
7241
|
});
|
|
7222
7242
|
}
|
|
7223
7243
|
else {
|
|
7224
7244
|
// Filter by all item object values
|
|
7225
7245
|
this.filteredItems = this._rawItems.filter(item => {
|
|
7226
7246
|
if (typeof item !== 'object') {
|
|
7227
|
-
return item
|
|
7247
|
+
return normalizeValue(item).includes(normalizedFilterValue);
|
|
7228
7248
|
}
|
|
7229
7249
|
const objValues = Object.values(item).filter(value => {
|
|
7230
|
-
return value !== null && value !== undefined
|
|
7231
|
-
? value.toString().toLowerCase().indexOf(this.filter.toString().toLowerCase()) > -1
|
|
7232
|
-
: false;
|
|
7250
|
+
return value !== null && value !== undefined ? normalizeValue(value).includes(normalizedFilterValue) : false;
|
|
7233
7251
|
});
|
|
7234
7252
|
return objValues.length > 0;
|
|
7235
7253
|
});
|
|
@@ -7254,6 +7272,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
7254
7272
|
type: Input,
|
|
7255
7273
|
args: ['clrOptionItemsField']
|
|
7256
7274
|
}] } });
|
|
7275
|
+
function normalizeValue(value) {
|
|
7276
|
+
return value
|
|
7277
|
+
.toString()
|
|
7278
|
+
.normalize('NFD')
|
|
7279
|
+
.replace(/\p{Diacritic}/gu, '')
|
|
7280
|
+
.toLowerCase();
|
|
7281
|
+
}
|
|
7257
7282
|
|
|
7258
7283
|
/*
|
|
7259
7284
|
* Copyright (c) 2016-2023 VMware, Inc. All Rights Reserved.
|
|
@@ -10071,6 +10096,12 @@ class ClrPasswordContainer extends ClrAbstractContainer {
|
|
|
10071
10096
|
this.show = !this.show;
|
|
10072
10097
|
this.toggleService.next(this.show);
|
|
10073
10098
|
}
|
|
10099
|
+
showPasswordText(label) {
|
|
10100
|
+
return this.commonStrings.parse(this.commonStrings.keys.passwordShow, { LABEL: label });
|
|
10101
|
+
}
|
|
10102
|
+
hidePasswordText(label) {
|
|
10103
|
+
return this.commonStrings.parse(this.commonStrings.keys.passwordHide, { LABEL: label });
|
|
10104
|
+
}
|
|
10074
10105
|
}
|
|
10075
10106
|
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 });
|
|
10076
10107
|
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: [
|
|
@@ -10096,7 +10127,7 @@ ClrPasswordContainer.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", v
|
|
|
10096
10127
|
>
|
|
10097
10128
|
<cds-icon status="info" class="clr-password-eye-icon" [attr.shape]="show ? 'eye-hide' : 'eye'"></cds-icon>
|
|
10098
10129
|
<span class="clr-sr-only">
|
|
10099
|
-
{{ show ?
|
|
10130
|
+
{{ show ? hidePasswordText(label?.labelText) : showPasswordText(label?.labelText) }}
|
|
10100
10131
|
</span>
|
|
10101
10132
|
</button>
|
|
10102
10133
|
</div>
|
|
@@ -10140,7 +10171,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.2", ngImpor
|
|
|
10140
10171
|
>
|
|
10141
10172
|
<cds-icon status="info" class="clr-password-eye-icon" [attr.shape]="show ? 'eye-hide' : 'eye'"></cds-icon>
|
|
10142
10173
|
<span class="clr-sr-only">
|
|
10143
|
-
{{ show ?
|
|
10174
|
+
{{ show ? hidePasswordText(label?.labelText) : showPasswordText(label?.labelText) }}
|
|
10144
10175
|
</span>
|
|
10145
10176
|
</button>
|
|
10146
10177
|
</div>
|
|
@@ -13674,6 +13705,7 @@ class ClrSignpostTrigger {
|
|
|
13674
13705
|
this.signpostIdService = signpostIdService;
|
|
13675
13706
|
this.signpostFocusManager = signpostFocusManager;
|
|
13676
13707
|
this.platformId = platformId;
|
|
13708
|
+
this.ariaExpanded = false;
|
|
13677
13709
|
this.subscriptions = [];
|
|
13678
13710
|
this.document = document;
|
|
13679
13711
|
}
|