cps-ui-kit 0.2.0 → 0.4.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/README.md +6 -5
- package/esm2020/lib/components/cps-autocomplete/cps-autocomplete.component.mjs +509 -0
- package/esm2020/lib/components/cps-button/cps-button.component.mjs +3 -3
- package/esm2020/lib/components/cps-checkbox/cps-checkbox.component.mjs +3 -3
- package/esm2020/lib/components/cps-chip/cps-chip.component.mjs +3 -3
- package/esm2020/lib/components/cps-icon/cps-icon.component.mjs +3 -4
- package/esm2020/lib/components/cps-input/cps-input.component.mjs +7 -4
- package/esm2020/lib/components/cps-radio/cps-radio.component.mjs +3 -3
- package/esm2020/lib/components/cps-select/cps-select.component.mjs +106 -7
- package/esm2020/lib/components/cps-tag/cps-tag.component.mjs +3 -3
- package/esm2020/lib/directives/click-outside.directive.mjs +1 -1
- package/esm2020/lib/pipes/combine-labels.pipe.mjs +1 -1
- package/esm2020/lib/pipes/label-by-value.pipe.mjs +1 -1
- package/esm2020/public-api.mjs +3 -1
- package/fesm2015/cps-ui-kit.mjs +634 -23
- package/fesm2015/cps-ui-kit.mjs.map +1 -1
- package/fesm2020/cps-ui-kit.mjs +619 -23
- package/fesm2020/cps-ui-kit.mjs.map +1 -1
- package/lib/components/cps-autocomplete/cps-autocomplete.component.d.ts +81 -0
- package/lib/components/cps-input/cps-input.component.d.ts +2 -1
- package/lib/components/cps-select/cps-select.component.d.ts +15 -2
- package/package.json +6 -6
- package/public-api.d.ts +2 -0
- package/styles/_variables.scss +1 -1
- package/styles/styles.scss +2 -2
- package/assets/icons/absa-logo.svg +0 -12
|
@@ -18,6 +18,7 @@ export declare class CpsInputComponent implements ControlValueAccessor, OnInit,
|
|
|
18
18
|
prefixIconSize: iconSizeType;
|
|
19
19
|
prefixText: string;
|
|
20
20
|
hideDetails: boolean;
|
|
21
|
+
persistentClear: boolean;
|
|
21
22
|
set value(value: string);
|
|
22
23
|
get value(): string;
|
|
23
24
|
valueChanged: EventEmitter<string>;
|
|
@@ -46,5 +47,5 @@ export declare class CpsInputComponent implements ControlValueAccessor, OnInit,
|
|
|
46
47
|
onBlur(): void;
|
|
47
48
|
focus(): void;
|
|
48
49
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsInputComponent, [{ optional: true; self: true; }, null, null]>;
|
|
49
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CpsInputComponent, "cps-input", never, { "label": "label"; "placeholder": "placeholder"; "hint": "hint"; "disabled": "disabled"; "width": "width"; "type": "type"; "loading": "loading"; "clearable": "clearable"; "prefixIcon": "prefixIcon"; "prefixIconSize": "prefixIconSize"; "prefixText": "prefixText"; "hideDetails": "hideDetails"; "value": "value"; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
50
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CpsInputComponent, "cps-input", never, { "label": "label"; "placeholder": "placeholder"; "hint": "hint"; "disabled": "disabled"; "width": "width"; "type": "type"; "loading": "loading"; "clearable": "clearable"; "prefixIcon": "prefixIcon"; "prefixIconSize": "prefixIconSize"; "prefixText": "prefixText"; "hideDetails": "hideDetails"; "persistentClear": "persistentClear"; "value": "value"; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
50
51
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ElementRef, EventEmitter, OnChanges, OnDestroy, OnInit, SimpleChanges } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
3
|
+
import { iconSizeType } from '../cps-icon/cps-icon.component';
|
|
3
4
|
import * as i0 from "@angular/core";
|
|
4
5
|
export declare class CpsSelectComponent implements ControlValueAccessor, OnInit, OnDestroy, OnChanges {
|
|
5
6
|
private _control;
|
|
@@ -20,6 +21,9 @@ export declare class CpsSelectComponent implements ControlValueAccessor, OnInit,
|
|
|
20
21
|
optionValue: string;
|
|
21
22
|
optionInfo: string;
|
|
22
23
|
hideDetails: boolean;
|
|
24
|
+
persistentClear: boolean;
|
|
25
|
+
prefixIcon: string;
|
|
26
|
+
prefixIconSize: iconSizeType;
|
|
23
27
|
_value: any;
|
|
24
28
|
set value(value: any);
|
|
25
29
|
get value(): any;
|
|
@@ -29,13 +33,22 @@ export declare class CpsSelectComponent implements ControlValueAccessor, OnInit,
|
|
|
29
33
|
error: string;
|
|
30
34
|
cvtWidth: string;
|
|
31
35
|
isOpened: boolean;
|
|
36
|
+
optionHighlightedIndex: number;
|
|
32
37
|
constructor(_control: NgControl);
|
|
33
38
|
ngOnChanges(changes: SimpleChanges): void;
|
|
34
39
|
ngOnInit(): void;
|
|
35
40
|
ngOnDestroy(): void;
|
|
36
|
-
|
|
41
|
+
private _toggleOptions;
|
|
37
42
|
select(option: any, byValue: boolean): void;
|
|
38
43
|
onOptionClick(option: any, dd: HTMLElement): void;
|
|
44
|
+
private _clickOption;
|
|
45
|
+
private _getHTMLOptions;
|
|
46
|
+
private _dehighlightOption;
|
|
47
|
+
private _highlightOption;
|
|
48
|
+
private _navigateOptionsByArrows;
|
|
49
|
+
onClickOutside(dd: HTMLElement): void;
|
|
50
|
+
onBoxClick(dd: HTMLElement): void;
|
|
51
|
+
onKeyDown(event: any, dd: HTMLElement): void;
|
|
39
52
|
toggleAll(): void;
|
|
40
53
|
private _checkErrors;
|
|
41
54
|
onChange: (event: any) => void;
|
|
@@ -50,5 +63,5 @@ export declare class CpsSelectComponent implements ControlValueAccessor, OnInit,
|
|
|
50
63
|
onBlur(): void;
|
|
51
64
|
focus(): void;
|
|
52
65
|
static ɵfac: i0.ɵɵFactoryDeclaration<CpsSelectComponent, [{ optional: true; self: true; }]>;
|
|
53
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<CpsSelectComponent, "cps-select", never, { "label": "label"; "placeholder": "placeholder"; "hint": "hint"; "returnObject": "returnObject"; "multiple": "multiple"; "disabled": "disabled"; "width": "width"; "selectAll": "selectAll"; "chips": "chips"; "closableChips": "closableChips"; "clearable": "clearable"; "openOnClear": "openOnClear"; "options": "options"; "optionLabel": "optionLabel"; "optionValue": "optionValue"; "optionInfo": "optionInfo"; "hideDetails": "hideDetails"; "_value": "value"; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
66
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<CpsSelectComponent, "cps-select", never, { "label": "label"; "placeholder": "placeholder"; "hint": "hint"; "returnObject": "returnObject"; "multiple": "multiple"; "disabled": "disabled"; "width": "width"; "selectAll": "selectAll"; "chips": "chips"; "closableChips": "closableChips"; "clearable": "clearable"; "openOnClear": "openOnClear"; "options": "options"; "optionLabel": "optionLabel"; "optionValue": "optionValue"; "optionInfo": "optionInfo"; "hideDetails": "hideDetails"; "persistentClear": "persistentClear"; "prefixIcon": "prefixIcon"; "prefixIconSize": "prefixIconSize"; "_value": "value"; }, { "valueChanged": "valueChanged"; }, never, never, true, never>;
|
|
54
67
|
}
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cps-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"peerDependencies": {
|
|
5
|
-
"@angular/common": "
|
|
6
|
-
"@angular/core": "
|
|
7
|
-
"@angular/forms": "
|
|
8
|
-
"rxjs": "
|
|
9
|
-
"zone.js": "
|
|
5
|
+
"@angular/common": "15 - 16",
|
|
6
|
+
"@angular/core": "15 - 16",
|
|
7
|
+
"@angular/forms": "15 - 16",
|
|
8
|
+
"rxjs": "^7.8.0",
|
|
9
|
+
"zone.js": "^0.12.0"
|
|
10
10
|
},
|
|
11
11
|
"repository": {
|
|
12
12
|
"type": "git",
|
package/public-api.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
export * from './lib/components/cps-icon/cps-icon.component';
|
|
2
2
|
export * from './lib/components/cps-input/cps-input.component';
|
|
3
3
|
export * from './lib/components/cps-select/cps-select.component';
|
|
4
|
+
export * from './lib/components/cps-autocomplete/cps-autocomplete.component';
|
|
4
5
|
export * from './lib/components/cps-button/cps-button.component';
|
|
5
6
|
export * from './lib/components/cps-checkbox/cps-checkbox.component';
|
|
6
7
|
export * from './lib/components/cps-radio/cps-radio.component';
|
|
7
8
|
export * from './lib/components/cps-tag/cps-tag.component';
|
|
8
9
|
export * from './lib/components/cps-chip/cps-chip.component';
|
|
10
|
+
export * from './lib/utils/colors-utils';
|
package/styles/_variables.scss
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@import
|
|
1
|
+
@import '_colors.scss';
|
package/styles/styles.scss
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
@import
|
|
2
|
-
@import
|
|
1
|
+
@import 'bootstrap-grid';
|
|
2
|
+
@import '_variables.scss';
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="utf-8"?>
|
|
2
|
-
<svg xmlns="http://www.w3.org/2000/svg">
|
|
3
|
-
<symbol id="absa-logo" viewBox="0 0 42 42">
|
|
4
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.0361 12.1212C36.6908 4.96109 29.4248 0 21 0C12.5752 0 5.30918 4.96109 1.96386 12.1212L4.34332 13.231C7.27054 6.96597 13.6283 2.62496 21 2.62496C28.3717 2.62496 34.7295 6.96597 37.6567 13.231L40.0361 12.1212ZM3.72926 14.7109L1.26201 13.8125C0.445519 16.0544 0 18.4747 0 20.9991C0 23.5233 0.445519 25.9436 1.26201 28.1855L3.72926 27.2872C3.01482 25.3255 2.62496 23.2078 2.62496 20.9991C2.62496 18.7903 3.01482 16.6726 3.72926 14.7109ZM1.96387 29.8789C5.30919 37.039 12.5752 42 21 42C29.4248 42 36.6908 37.039 40.0361 29.8789L37.6567 28.769C34.7295 35.0342 28.3717 39.3751 21 39.3751C13.6283 39.3751 7.27055 35.0342 4.34333 28.769L1.96387 29.8789ZM38.2715 14.7109C38.9857 16.6726 39.3757 18.7903 39.3757 20.9991C39.3757 23.2078 38.9857 25.3255 38.2715 27.2872L40.7386 28.1855C41.5551 25.9436 42.0007 23.5233 42.0007 20.9991C42.0007 18.4747 41.5551 16.0544 40.7386 13.8125L38.2715 14.7109ZM17.3251 16.8015C16.8012 16.8015 16.2378 16.8944 15.75 16.9988V12.6016L13.5547 12.8402V24.6447C14.4615 24.9311 15.6387 25.2016 16.8001 25.2016C19.4409 25.2016 21 24.3106 21 21.0015C21 17.6925 19.4409 16.8015 17.3251 16.8015ZM16.9752 23.3243C16.5774 23.3243 16.2273 23.2765 15.75 23.1652V18.8407C16.1451 18.7498 16.5365 18.6788 16.9752 18.6788C18.1683 18.6788 18.7409 19.2197 18.7409 21.0015C18.7409 22.7834 18.1683 23.3243 16.9752 23.3243ZM24.2876 19.4886C24.2876 19.9977 24.8761 20.0136 25.8149 20.0295C27.5012 20.0614 28.917 20.3636 28.917 22.5273C28.917 24.2454 28.0421 25.2 25.2262 25.2C24.0649 25.2 23.2694 25.0409 22.4262 24.7386L22.2513 22.925C22.9036 23.1318 23.7944 23.3227 25.0512 23.3227C26.1806 23.3227 26.7056 23.1796 26.7056 22.5113C26.7056 21.7849 26.1586 21.7783 25.1056 21.7657L24.9398 21.7636C23.1421 21.7318 22.0762 21.2864 22.0762 19.5522C22.0762 17.7545 23.0943 16.8 25.7353 16.8C26.3558 16.8 27.2943 16.9114 28.1375 17.1659L28.3125 18.9795C27.6603 18.8204 26.6262 18.6772 25.8943 18.6772C24.6853 18.6772 24.2876 18.8204 24.2876 19.4886ZM8.51124 16.8C7.81125 16.8 6.87261 16.9114 6.02945 17.1658L5.85452 18.9795C6.55452 18.8204 7.58853 18.6772 8.2726 18.6772C9.41802 18.6772 9.87938 18.7727 9.87938 19.6954V19.95L8.35215 20.0295C6.66583 20.1249 5.25 20.4113 5.25 22.5273C5.25 24.2454 6.12492 25.2 8.76581 25.2C9.99078 25.2 11.168 24.9295 12.0748 24.6432V19.5522C12.0748 17.7545 11.0726 16.8 8.51124 16.8ZM9.87902 23.2573L9.87871 23.2574C9.59241 23.3051 9.21074 23.3686 8.81314 23.3686C7.85867 23.3686 7.46094 23.0664 7.46094 22.4141C7.46094 21.73 7.84265 21.6186 8.63822 21.5709L9.87902 21.4914V23.2573ZM30.7046 17.1658C31.5479 16.9114 32.4864 16.8 33.1865 16.8C35.7478 16.8 36.75 17.7545 36.75 19.5522V24.6432C35.8431 24.9295 34.666 25.2 33.4411 25.2C30.8001 25.2 29.9252 24.2454 29.9252 22.5273C29.9252 20.3636 31.341 20.1249 33.0273 20.0295L34.5546 19.95V19.6954C34.5546 18.7727 34.0933 18.6772 32.9479 18.6772C32.2637 18.6772 31.2297 18.8204 30.5298 18.9795L30.7046 17.1658ZM34.5541 23.2573L34.5542 23.2573V21.4914L33.3135 21.5709C32.5179 21.6186 32.1361 21.73 32.1361 22.4141C32.1361 23.0664 32.5338 23.3686 33.4884 23.3686C33.8861 23.3686 34.2679 23.305 34.5541 23.2573Z" fill="currentColor"/>
|
|
5
|
-
<mask id="mask0_2733_60082" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="42" height="42">
|
|
6
|
-
<path fill-rule="evenodd" clip-rule="evenodd" d="M40.0361 12.1212C36.6908 4.96109 29.4248 0 21 0C12.5752 0 5.30918 4.96109 1.96386 12.1212L4.34332 13.231C7.27054 6.96597 13.6283 2.62496 21 2.62496C28.3717 2.62496 34.7295 6.96597 37.6567 13.231L40.0361 12.1212ZM3.72926 14.7109L1.26201 13.8125C0.445519 16.0544 0 18.4747 0 20.9991C0 23.5233 0.445519 25.9436 1.26201 28.1855L3.72926 27.2872C3.01482 25.3255 2.62496 23.2078 2.62496 20.9991C2.62496 18.7903 3.01482 16.6726 3.72926 14.7109ZM1.96387 29.8789C5.30919 37.039 12.5752 42 21 42C29.4248 42 36.6908 37.039 40.0361 29.8789L37.6567 28.769C34.7295 35.0342 28.3717 39.3751 21 39.3751C13.6283 39.3751 7.27055 35.0342 4.34333 28.769L1.96387 29.8789ZM38.2715 14.7109C38.9857 16.6726 39.3757 18.7903 39.3757 20.9991C39.3757 23.2078 38.9857 25.3255 38.2715 27.2872L40.7386 28.1855C41.5551 25.9436 42.0007 23.5233 42.0007 20.9991C42.0007 18.4747 41.5551 16.0544 40.7386 13.8125L38.2715 14.7109ZM17.3251 16.8015C16.8012 16.8015 16.2378 16.8944 15.75 16.9988V12.6016L13.5547 12.8402V24.6447C14.4615 24.9311 15.6387 25.2016 16.8001 25.2016C19.4409 25.2016 21 24.3106 21 21.0015C21 17.6925 19.4409 16.8015 17.3251 16.8015ZM16.9752 23.3243C16.5774 23.3243 16.2273 23.2765 15.75 23.1652V18.8407C16.1451 18.7498 16.5365 18.6788 16.9752 18.6788C18.1683 18.6788 18.7409 19.2197 18.7409 21.0015C18.7409 22.7834 18.1683 23.3243 16.9752 23.3243ZM24.2876 19.4886C24.2876 19.9977 24.8761 20.0136 25.8149 20.0295C27.5012 20.0614 28.917 20.3636 28.917 22.5273C28.917 24.2454 28.0421 25.2 25.2262 25.2C24.0649 25.2 23.2694 25.0409 22.4262 24.7386L22.2513 22.925C22.9036 23.1318 23.7944 23.3227 25.0512 23.3227C26.1806 23.3227 26.7056 23.1796 26.7056 22.5113C26.7056 21.7849 26.1586 21.7783 25.1056 21.7657L24.9398 21.7636C23.1421 21.7318 22.0762 21.2864 22.0762 19.5522C22.0762 17.7545 23.0943 16.8 25.7353 16.8C26.3558 16.8 27.2943 16.9114 28.1375 17.1659L28.3125 18.9795C27.6603 18.8204 26.6262 18.6772 25.8943 18.6772C24.6853 18.6772 24.2876 18.8204 24.2876 19.4886ZM8.51124 16.8C7.81125 16.8 6.87261 16.9114 6.02945 17.1658L5.85452 18.9795C6.55452 18.8204 7.58853 18.6772 8.2726 18.6772C9.41802 18.6772 9.87938 18.7727 9.87938 19.6954V19.95L8.35215 20.0295C6.66583 20.1249 5.25 20.4113 5.25 22.5273C5.25 24.2454 6.12492 25.2 8.76581 25.2C9.99078 25.2 11.168 24.9295 12.0748 24.6432V19.5522C12.0748 17.7545 11.0726 16.8 8.51124 16.8ZM9.87902 23.2573L9.87871 23.2574C9.59241 23.3051 9.21074 23.3686 8.81314 23.3686C7.85867 23.3686 7.46094 23.0664 7.46094 22.4141C7.46094 21.73 7.84265 21.6186 8.63822 21.5709L9.87902 21.4914V23.2573ZM30.7046 17.1658C31.5479 16.9114 32.4864 16.8 33.1865 16.8C35.7478 16.8 36.75 17.7545 36.75 19.5522V24.6432C35.8431 24.9295 34.666 25.2 33.4411 25.2C30.8001 25.2 29.9252 24.2454 29.9252 22.5273C29.9252 20.3636 31.341 20.1249 33.0273 20.0295L34.5546 19.95V19.6954C34.5546 18.7727 34.0933 18.6772 32.9479 18.6772C32.2637 18.6772 31.2297 18.8204 30.5298 18.9795L30.7046 17.1658ZM34.5541 23.2573L34.5542 23.2573V21.4914L33.3135 21.5709C32.5179 21.6186 32.1361 21.73 32.1361 22.4141C32.1361 23.0664 32.5338 23.3686 33.4884 23.3686C33.8861 23.3686 34.2679 23.305 34.5541 23.2573Z" fill="white"/>
|
|
7
|
-
</mask>
|
|
8
|
-
<g mask="url(#mask0_2733_60082)">
|
|
9
|
-
</g>
|
|
10
|
-
|
|
11
|
-
</symbol>
|
|
12
|
-
</svg>
|