@elderbyte/ngx-starter 15.5.2 → 15.6.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/_index.scss +3 -3
- package/esm2020/lib/components/chips/elder-chip-label.directive.mjs +78 -28
- package/fesm2015/elderbyte-ngx-starter.mjs +78 -27
- package/fesm2015/elderbyte-ngx-starter.mjs.map +1 -1
- package/fesm2020/elderbyte-ngx-starter.mjs +77 -27
- package/fesm2020/elderbyte-ngx-starter.mjs.map +1 -1
- package/lib/components/chips/elder-chip-label.directive.d.ts +24 -7
- package/package.json +1 -1
- package/src/lib/components/chips/_elder-chip-theme.scss +124 -0
- package/theming/_elder-flex-layout.scss +3 -3
- package/theming/_elder-chip-theme.scss +0 -147
|
@@ -21163,7 +21163,10 @@ class ElderChipLabelDirective {
|
|
|
21163
21163
|
* *
|
|
21164
21164
|
**************************************************************************/
|
|
21165
21165
|
this.baseClass = 'elder-chip-label';
|
|
21166
|
-
this.
|
|
21166
|
+
this._appearance = 'md3';
|
|
21167
|
+
}
|
|
21168
|
+
ngOnInit() {
|
|
21169
|
+
this.refreshClasses();
|
|
21167
21170
|
}
|
|
21168
21171
|
/***************************************************************************
|
|
21169
21172
|
* *
|
|
@@ -21171,44 +21174,89 @@ class ElderChipLabelDirective {
|
|
|
21171
21174
|
* *
|
|
21172
21175
|
**************************************************************************/
|
|
21173
21176
|
get classes() {
|
|
21174
|
-
return this.
|
|
21177
|
+
return this.cssClasses;
|
|
21178
|
+
}
|
|
21179
|
+
/***************************************************************************
|
|
21180
|
+
* *
|
|
21181
|
+
* Properties *
|
|
21182
|
+
* *
|
|
21183
|
+
**************************************************************************/
|
|
21184
|
+
set appearance(appearance) {
|
|
21185
|
+
this._appearance = appearance;
|
|
21186
|
+
this.refreshClasses();
|
|
21187
|
+
}
|
|
21188
|
+
set themeColor(themeColor) {
|
|
21189
|
+
this._themeColor = themeColor;
|
|
21190
|
+
this.refreshClasses();
|
|
21191
|
+
}
|
|
21192
|
+
set stateColor(stateColor) {
|
|
21193
|
+
this._stateColor = stateColor;
|
|
21194
|
+
this.refreshClasses();
|
|
21195
|
+
}
|
|
21196
|
+
set levelColor(levelColor) {
|
|
21197
|
+
this._levelColor = levelColor;
|
|
21198
|
+
this.refreshClasses();
|
|
21175
21199
|
}
|
|
21176
21200
|
/***************************************************************************
|
|
21177
21201
|
* *
|
|
21178
21202
|
* Private methods *
|
|
21179
21203
|
* *
|
|
21180
21204
|
**************************************************************************/
|
|
21205
|
+
refreshClasses() {
|
|
21206
|
+
this.cssClasses = this.buildClassesString();
|
|
21207
|
+
}
|
|
21181
21208
|
buildClassesString() {
|
|
21182
|
-
|
|
21183
|
-
|
|
21184
|
-
|
|
21209
|
+
return this.buildClasses()
|
|
21210
|
+
.filter(cls => !!cls)
|
|
21211
|
+
.join(' ');
|
|
21212
|
+
}
|
|
21213
|
+
buildClasses() {
|
|
21214
|
+
const appearance = this._appearance ?? 'legacy';
|
|
21215
|
+
switch (appearance) {
|
|
21216
|
+
case 'md3':
|
|
21217
|
+
return [this.baseClass, 'md3', this.resolveColorClass() ?? 'none'];
|
|
21218
|
+
case 'legacy':
|
|
21219
|
+
return [this.baseClass, 'legacy', this.resolveColorClass()];
|
|
21220
|
+
}
|
|
21221
|
+
}
|
|
21222
|
+
resolveColorClass() {
|
|
21223
|
+
let colorClass;
|
|
21224
|
+
if (this._themeColor) {
|
|
21225
|
+
colorClass = this.getThemeColorClass(this._themeColor);
|
|
21185
21226
|
}
|
|
21186
|
-
if (this.
|
|
21187
|
-
|
|
21227
|
+
else if (this._stateColor) {
|
|
21228
|
+
colorClass = this.getStateColorClass(this._stateColor);
|
|
21188
21229
|
}
|
|
21189
|
-
if (this.
|
|
21190
|
-
|
|
21230
|
+
else if (this._levelColor) {
|
|
21231
|
+
colorClass = this.getLevelColorClass(this._levelColor);
|
|
21191
21232
|
}
|
|
21192
|
-
|
|
21233
|
+
else {
|
|
21234
|
+
return undefined;
|
|
21235
|
+
}
|
|
21236
|
+
return colorClass;
|
|
21193
21237
|
}
|
|
21194
|
-
|
|
21195
|
-
if (
|
|
21196
|
-
switch (
|
|
21197
|
-
case '
|
|
21198
|
-
return '
|
|
21199
|
-
case '
|
|
21200
|
-
return '
|
|
21238
|
+
getLevelColorClass(state) {
|
|
21239
|
+
if (state) {
|
|
21240
|
+
switch (state) {
|
|
21241
|
+
case 'low':
|
|
21242
|
+
return 'level-low';
|
|
21243
|
+
case 'medium':
|
|
21244
|
+
return 'level-medium';
|
|
21245
|
+
case 'high':
|
|
21246
|
+
return 'level-high';
|
|
21247
|
+
case 'critical':
|
|
21248
|
+
return 'level-critical';
|
|
21249
|
+
default:
|
|
21250
|
+
return 'state-other'; // TODO
|
|
21201
21251
|
}
|
|
21202
21252
|
}
|
|
21203
21253
|
else {
|
|
21204
|
-
return
|
|
21254
|
+
return undefined;
|
|
21205
21255
|
}
|
|
21206
21256
|
}
|
|
21207
21257
|
getStateColorClass(state) {
|
|
21208
21258
|
if (state) {
|
|
21209
21259
|
switch (state) {
|
|
21210
|
-
case 'none':
|
|
21211
|
-
return 'state-none';
|
|
21212
21260
|
case 'open':
|
|
21213
21261
|
return 'state-open';
|
|
21214
21262
|
case 'inProgress':
|
|
@@ -21224,7 +21272,7 @@ class ElderChipLabelDirective {
|
|
|
21224
21272
|
}
|
|
21225
21273
|
}
|
|
21226
21274
|
else {
|
|
21227
|
-
return
|
|
21275
|
+
return undefined;
|
|
21228
21276
|
}
|
|
21229
21277
|
}
|
|
21230
21278
|
getThemeColorClass(color) {
|
|
@@ -21244,7 +21292,7 @@ class ElderChipLabelDirective {
|
|
|
21244
21292
|
}
|
|
21245
21293
|
}
|
|
21246
21294
|
ElderChipLabelDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: ElderChipLabelDirective, deps: [{ token: i6.MatChip, host: true, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
21247
|
-
ElderChipLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: ElderChipLabelDirective, selector: "[elderChipLabel]", inputs: { themeColor: ["color", "themeColor"], stateColor: "stateColor",
|
|
21295
|
+
ElderChipLabelDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.1.2", type: ElderChipLabelDirective, selector: "[elderChipLabel]", inputs: { appearance: "appearance", themeColor: ["color", "themeColor"], stateColor: "stateColor", levelColor: "levelColor" }, host: { properties: { "class": "this.classes" } }, ngImport: i0 });
|
|
21248
21296
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImport: i0, type: ElderChipLabelDirective, decorators: [{
|
|
21249
21297
|
type: Directive,
|
|
21250
21298
|
args: [{
|
|
@@ -21254,16 +21302,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.1.2", ngImpor
|
|
|
21254
21302
|
type: Optional
|
|
21255
21303
|
}, {
|
|
21256
21304
|
type: Host
|
|
21257
|
-
}] }]; }, propDecorators: {
|
|
21305
|
+
}] }]; }, propDecorators: { classes: [{
|
|
21306
|
+
type: HostBinding,
|
|
21307
|
+
args: ['class']
|
|
21308
|
+
}], appearance: [{
|
|
21309
|
+
type: Input
|
|
21310
|
+
}], themeColor: [{
|
|
21258
21311
|
type: Input,
|
|
21259
21312
|
args: ['color']
|
|
21260
21313
|
}], stateColor: [{
|
|
21261
21314
|
type: Input
|
|
21262
|
-
}],
|
|
21315
|
+
}], levelColor: [{
|
|
21263
21316
|
type: Input
|
|
21264
|
-
}], classes: [{
|
|
21265
|
-
type: HostBinding,
|
|
21266
|
-
args: ['class']
|
|
21267
21317
|
}] } });
|
|
21268
21318
|
|
|
21269
21319
|
class ElderChipsModule {
|