@coorpacademy/components 11.40.4 → 11.40.5
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/es/atom/chip/index.d.ts +4 -0
- package/es/atom/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +12 -6
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +2 -1
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +4 -1
- package/es/atom/radio-with-title/index.d.ts +1 -0
- package/es/atom/radio-with-title/index.d.ts.map +1 -1
- package/es/atom/radio-with-title/types.d.ts +1 -0
- package/es/atom/radio-with-title/types.d.ts.map +1 -1
- package/es/atom/title/index.d.ts +1 -0
- package/es/atom/title/index.d.ts.map +1 -1
- package/es/atom/title/index.js +5 -2
- package/es/atom/title/index.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts +1 -0
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +6 -2
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/base-modal/style.css +5 -0
- package/es/molecule/cm-popin/types.d.ts +2 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/icon-picker-modal/index.d.ts +1 -2
- package/es/molecule/icon-picker-modal/index.d.ts.map +1 -1
- package/es/molecule/icon-picker-modal/index.js +16 -43
- package/es/molecule/icon-picker-modal/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/index.d.ts +19 -0
- package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +39 -10
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts +26 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.js +5 -0
- package/es/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/es/molecule/multi-filter-panel/style.css +8 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/es/molecule/title-radio-wrapper/types.d.ts +1 -0
- package/es/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/es/organism/content-skill-modal/index.d.ts +20 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +20 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.js +5 -2
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/es/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/es/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/style.css +2 -0
- package/es/organism/filter-chip/index.d.ts +3 -0
- package/es/organism/filter-chip/index.d.ts.map +1 -1
- package/es/organism/filter-chip/index.js +12 -4
- package/es/organism/filter-chip/index.js.map +1 -1
- package/es/organism/filter-chip/prop-types.d.ts +14 -7
- package/es/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/es/organism/filter-chip/prop-types.js +3 -0
- package/es/organism/filter-chip/prop-types.js.map +1 -1
- package/es/organism/filter-switch/index.d.ts +23 -0
- package/es/organism/filter-switch/index.d.ts.map +1 -0
- package/es/organism/filter-switch/index.js +76 -0
- package/es/organism/filter-switch/index.js.map +1 -0
- package/es/organism/filter-switch/prop-types.d.ts +28 -0
- package/es/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/es/organism/filter-switch/prop-types.js +15 -0
- package/es/organism/filter-switch/prop-types.js.map +1 -0
- package/es/organism/filter-switch/style.css +46 -0
- package/es/organism/list-items/index.d.ts +1 -0
- package/es/organism/rewards-form/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts +1 -0
- package/es/organism/select-opponents/index.d.ts.map +1 -1
- package/es/organism/select-opponents/types.d.ts +1 -0
- package/es/organism/select-opponents/types.d.ts.map +1 -1
- package/es/organism/title-and-input/index.d.ts +2 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +2 -0
- package/es/organism/title-and-input/types.d.ts.map +1 -1
- package/es/organism/wizard-contents/index.d.ts +1 -0
- package/es/template/app-player/loading/index.d.ts +2 -0
- package/es/template/app-player/player/index.d.ts +4 -0
- package/es/template/app-player/player/slides/index.d.ts +2 -0
- package/es/template/app-player/player/slides/index.d.ts.map +1 -1
- package/es/template/app-player/popin-correction/index.d.ts +2 -0
- package/es/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/es/template/app-player/popin-end/index.d.ts +2 -0
- package/es/template/app-review/index.d.ts +2 -0
- package/es/template/app-review/index.d.ts.map +1 -1
- package/es/template/app-review/player/prop-types.d.ts +2 -0
- package/es/template/app-review/player/prop-types.d.ts.map +1 -1
- package/es/template/app-review/prop-types.d.ts +2 -0
- package/es/template/app-review/prop-types.d.ts.map +1 -1
- package/es/template/back-office/brand-update/index.d.ts +107 -0
- package/es/template/common/dashboard/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +2 -0
- package/es/template/external-course/index.d.ts +2 -0
- package/lib/atom/chip/index.d.ts +4 -0
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +12 -6
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +2 -1
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +4 -1
- package/lib/atom/radio-with-title/index.d.ts +1 -0
- package/lib/atom/radio-with-title/index.d.ts.map +1 -1
- package/lib/atom/radio-with-title/types.d.ts +1 -0
- package/lib/atom/radio-with-title/types.d.ts.map +1 -1
- package/lib/atom/title/index.d.ts +1 -0
- package/lib/atom/title/index.d.ts.map +1 -1
- package/lib/atom/title/index.js +5 -2
- package/lib/atom/title/index.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts +1 -0
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +6 -2
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/base-modal/style.css +5 -0
- package/lib/molecule/cm-popin/types.d.ts +2 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/icon-picker-modal/index.d.ts +1 -2
- package/lib/molecule/icon-picker-modal/index.d.ts.map +1 -1
- package/lib/molecule/icon-picker-modal/index.js +16 -43
- package/lib/molecule/icon-picker-modal/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/index.d.ts +19 -0
- package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js +39 -9
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts +26 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.js +5 -0
- package/lib/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/lib/molecule/multi-filter-panel/style.css +8 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/index.d.ts.map +1 -1
- package/lib/molecule/title-radio-wrapper/types.d.ts +1 -0
- package/lib/molecule/title-radio-wrapper/types.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/index.d.ts +20 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +20 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +1 -0
- package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.js +5 -2
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts +2 -0
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.js +1 -0
- package/lib/organism/filter-checkbox-and-search/props-types.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/style.css +2 -0
- package/lib/organism/filter-chip/index.d.ts +3 -0
- package/lib/organism/filter-chip/index.d.ts.map +1 -1
- package/lib/organism/filter-chip/index.js +12 -4
- package/lib/organism/filter-chip/index.js.map +1 -1
- package/lib/organism/filter-chip/prop-types.d.ts +14 -7
- package/lib/organism/filter-chip/prop-types.d.ts.map +1 -1
- package/lib/organism/filter-chip/prop-types.js +3 -0
- package/lib/organism/filter-chip/prop-types.js.map +1 -1
- package/lib/organism/filter-switch/index.d.ts +23 -0
- package/lib/organism/filter-switch/index.d.ts.map +1 -0
- package/lib/organism/filter-switch/index.js +83 -0
- package/lib/organism/filter-switch/index.js.map +1 -0
- package/lib/organism/filter-switch/prop-types.d.ts +28 -0
- package/lib/organism/filter-switch/prop-types.d.ts.map +1 -0
- package/lib/organism/filter-switch/prop-types.js +20 -0
- package/lib/organism/filter-switch/prop-types.js.map +1 -0
- package/lib/organism/filter-switch/style.css +46 -0
- package/lib/organism/list-items/index.d.ts +1 -0
- package/lib/organism/rewards-form/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts +1 -0
- package/lib/organism/select-opponents/index.d.ts.map +1 -1
- package/lib/organism/select-opponents/types.d.ts +1 -0
- package/lib/organism/select-opponents/types.d.ts.map +1 -1
- package/lib/organism/title-and-input/index.d.ts +2 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +2 -0
- package/lib/organism/title-and-input/types.d.ts.map +1 -1
- package/lib/organism/wizard-contents/index.d.ts +1 -0
- package/lib/template/app-player/loading/index.d.ts +2 -0
- package/lib/template/app-player/player/index.d.ts +4 -0
- package/lib/template/app-player/player/slides/index.d.ts +2 -0
- package/lib/template/app-player/player/slides/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-correction/index.d.ts +2 -0
- package/lib/template/app-player/popin-correction/index.d.ts.map +1 -1
- package/lib/template/app-player/popin-end/index.d.ts +2 -0
- package/lib/template/app-review/index.d.ts +2 -0
- package/lib/template/app-review/index.d.ts.map +1 -1
- package/lib/template/app-review/player/prop-types.d.ts +2 -0
- package/lib/template/app-review/player/prop-types.d.ts.map +1 -1
- package/lib/template/app-review/prop-types.d.ts +2 -0
- package/lib/template/app-review/prop-types.d.ts.map +1 -1
- package/lib/template/back-office/brand-update/index.d.ts +107 -0
- package/lib/template/common/dashboard/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +2 -0
- package/lib/template/external-course/index.d.ts +2 -0
- package/package.json +2 -2
|
@@ -417,6 +417,7 @@ declare const ContentSkillModalPropTypes: {
|
|
|
417
417
|
title: PropTypes.Requireable<NonNullable<string | PropTypes.InferProps<{
|
|
418
418
|
title: PropTypes.Requireable<string>;
|
|
419
419
|
subtitle: PropTypes.Requireable<string>;
|
|
420
|
+
ariaLabel: PropTypes.Requireable<string>;
|
|
420
421
|
type: PropTypes.Requireable<string>;
|
|
421
422
|
'data-name': PropTypes.Requireable<string>;
|
|
422
423
|
titleSize: PropTypes.Requireable<string>;
|
|
@@ -637,16 +638,20 @@ declare const ContentSkillModalPropTypes: {
|
|
|
637
638
|
filters: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
638
639
|
title: PropTypes.Requireable<string>;
|
|
639
640
|
onClearAll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
641
|
+
onRemoveSelectedFilter: PropTypes.Requireable<(...args: any[]) => any>;
|
|
640
642
|
options: PropTypes.Requireable<(NonNullable<PropTypes.InferProps<{
|
|
641
643
|
type: PropTypes.Requireable<string>;
|
|
642
644
|
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
643
645
|
title: PropTypes.Requireable<string>;
|
|
646
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
644
647
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
645
648
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
646
649
|
label: PropTypes.Requireable<string>;
|
|
647
650
|
type: PropTypes.Requireable<string>;
|
|
651
|
+
textColor: PropTypes.Requireable<string>;
|
|
648
652
|
selected: PropTypes.Requireable<boolean>;
|
|
649
653
|
icon: PropTypes.Requireable<string>;
|
|
654
|
+
customIcon: PropTypes.Requireable<string>;
|
|
650
655
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
651
656
|
}> | null | undefined)[]>;
|
|
652
657
|
}>>;
|
|
@@ -654,6 +659,7 @@ declare const ContentSkillModalPropTypes: {
|
|
|
654
659
|
type: PropTypes.Requireable<string>;
|
|
655
660
|
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
656
661
|
title: PropTypes.Requireable<string>;
|
|
662
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
657
663
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
658
664
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
659
665
|
label: PropTypes.Requireable<string>;
|
|
@@ -677,6 +683,20 @@ declare const ContentSkillModalPropTypes: {
|
|
|
677
683
|
searchIconAriaLabel: PropTypes.Requireable<string>;
|
|
678
684
|
}>>;
|
|
679
685
|
}>>;
|
|
686
|
+
}> | PropTypes.InferProps<{
|
|
687
|
+
type: PropTypes.Requireable<string>;
|
|
688
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
689
|
+
title: PropTypes.Validator<string>;
|
|
690
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
691
|
+
onClear: PropTypes.Validator<(...args: any[]) => any>;
|
|
692
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
693
|
+
label: PropTypes.Validator<string>;
|
|
694
|
+
value: PropTypes.Validator<boolean>;
|
|
695
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
696
|
+
theme: PropTypes.Validator<string>;
|
|
697
|
+
ariaLabel: PropTypes.Validator<string>;
|
|
698
|
+
}> | null | undefined)[]>;
|
|
699
|
+
}>>;
|
|
680
700
|
}> | null | undefined> | null | undefined)[]>;
|
|
681
701
|
}>>>;
|
|
682
702
|
modal: PropTypes.Validator<NonNullable<PropTypes.InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAkC,EAChC,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AAStD,QAAA,MAAM,0BAA0B
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/types.ts"],"names":[],"mappings":";AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAAO,SAAS,MAAM,eAAe,CAAC;AACtC,OAAkC,EAChC,qBAAqB,EACtB,MAAM,8CAA8C,CAAC;AAStD,QAAA,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAI/B,CAAC;AAEF,eAAe,0BAA0B,CAAC;AAE1C,aAAK,UAAU,GAAG;IAChB,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,WAAW,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;IACpD,OAAO,EAAE,qBAAqB,CAAC;IAC/B,KAAK,EAAE,UAAU,CAAC;CACnB,CAAC"}
|
|
@@ -5,6 +5,7 @@ declare const FilterCheckboxAndSearch: {
|
|
|
5
5
|
(props: FilterCheckboxAndSearchProps, context: WebContextValues): JSX.Element;
|
|
6
6
|
propTypes: {
|
|
7
7
|
title: import("prop-types").Requireable<string>;
|
|
8
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
8
9
|
onClear: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
9
10
|
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
10
11
|
label: import("prop-types").Requireable<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAiBtE,QAAA,MAAM,uBAAuB;YACpB,4BAA4B,WAC1B,gBAAgB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAiBtE,QAAA,MAAM,uBAAuB;YACpB,4BAA4B,WAC1B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgG1B,CAAC;AAQF,eAAe,uBAAuB,CAAC"}
|
|
@@ -40,6 +40,7 @@ const INITIAL_VISIBLE_OPTIONS = 5;
|
|
|
40
40
|
const FilterCheckboxAndSearch = (props, context) => {
|
|
41
41
|
const {
|
|
42
42
|
title,
|
|
43
|
+
titleAriaLabel,
|
|
43
44
|
searchOptions,
|
|
44
45
|
onClear,
|
|
45
46
|
options
|
|
@@ -66,7 +67,8 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
66
67
|
className: _style.default.titleAndTagWrapper,
|
|
67
68
|
"data-testid": "filter-checkbox-and-searh-title-and-tag-wrapper"
|
|
68
69
|
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
69
|
-
title: title
|
|
70
|
+
title: title,
|
|
71
|
+
ariaLabel: titleAriaLabel
|
|
70
72
|
}), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
71
73
|
label: (0, _toString2.default)(selectedFiltersCount),
|
|
72
74
|
type: "info",
|
|
@@ -78,7 +80,8 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
78
80
|
type: "text",
|
|
79
81
|
"data-testid": "filter-checkbox-and-search-clear-button",
|
|
80
82
|
onClick: onClear,
|
|
81
|
-
customStyle: CLEAR_BUTTON_STYLE
|
|
83
|
+
customStyle: CLEAR_BUTTON_STYLE,
|
|
84
|
+
hoverColor: _colors.COLORS.cm_grey_700
|
|
82
85
|
})) : null), searchOptions ? /*#__PURE__*/_react.default.createElement("div", {
|
|
83
86
|
className: _style.default.search
|
|
84
87
|
}, /*#__PURE__*/_react.default.createElement(_inputSearch.default, searchOptions)) : null, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_title","_interopRequireDefault","_tag","_buttonLink","_provider","_checkboxWithTitle","_colors","_inputSearch","_style","_propsTypes","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CLEAR_BUTTON_STYLE","fontWeight","padding","SHOW_BUTTON_STYLE","fontSize","fontFamily","CHECKBOX_TITLE_STYLE","marginRight","INITIAL_VISIBLE_OPTIONS","FilterCheckboxAndSearch","props","context","title","searchOptions","onClear","options","translate","GetTranslateFromContext","showMore","setShowMore","useState","selectedFiltersCount","_pipe2","_filter2","selected","_size2","hasSelectedFilters","handleShowMore","useCallback","visibleOptions","useMemo","slice","createElement","className","style","container","header","titleAndTagWrapper","label","_toString2","type","size","clearButtonContainer","onClick","customStyle","search","optionsContainer","_isEmpty2","emptySearchResult","map","value","count","index","key","optionRow","onChange","name","checked","optionCount","icon","position","faIcon","color","COLORS","cm_grey_500","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {filter, isEmpty, pipe, size, toString} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport CheckboxWithTitle from '../../atom/checkbox-with-title';\nimport {COLORS} from '../../variables/colors';\nimport Search from '../../atom/input-search';\nimport style from './style.css';\nimport propTypes, {FilterCheckboxAndSearchProps} from './props-types';\n\nconst CLEAR_BUTTON_STYLE = {fontWeight: 'normal', padding: 0};\nconst SHOW_BUTTON_STYLE = {\n fontSize: '14px',\n fontWeight: '600',\n fontFamily: 'Gilroy',\n padding: '0'\n};\nconst CHECKBOX_TITLE_STYLE = {\n marginRight: '16px',\n fontSize: '14px',\n fontFamily: 'Gilroy',\n fontWeight: 'normal'\n};\nconst INITIAL_VISIBLE_OPTIONS = 5;\n\nconst FilterCheckboxAndSearch = (\n props: FilterCheckboxAndSearchProps,\n context: WebContextValues\n) => {\n const {title, searchOptions, onClear, options} = props;\n const translate = GetTranslateFromContext(context);\n const [showMore, setShowMore] = useState(false);\n const selectedFiltersCount = pipe(filter({selected: true}), size)(options);\n const hasSelectedFilters = selectedFiltersCount > 0;\n\n const handleShowMore = useCallback(() => {\n setShowMore(!showMore);\n }, [showMore]);\n\n const visibleOptions = useMemo(() => {\n return showMore ? options : options.slice(0, INITIAL_VISIBLE_OPTIONS);\n }, [options, showMore]);\n\n return (\n <div data-testid=\"filter-checkbox-and-search-container\" className={style.container}>\n <div className={style.header} data-testid=\"filter-checkbox-and-search-header\">\n <div\n className={style.titleAndTagWrapper}\n data-testid=\"filter-checkbox-and-searh-title-and-tag-wrapper\"\n >\n <Title title={title} />\n {hasSelectedFilters ? (\n <Tag label={toString(selectedFiltersCount)} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.clearButtonContainer}>\n <ButtonLink\n label={translate('clear')}\n type=\"text\"\n data-testid=\"filter-checkbox-and-search-clear-button\"\n onClick={onClear}\n customStyle={CLEAR_BUTTON_STYLE}\n />\n </div>\n ) : null}\n </div>\n {searchOptions ? (\n <div className={style.search}>\n <Search {...searchOptions} />\n </div>\n ) : null}\n <div\n data-testid=\"filter-checkbox-and-search-options-container\"\n className={style.optionsContainer}\n >\n {isEmpty(visibleOptions) ? (\n <p\n className={style.emptySearchResult}\n data-testid=\"filter-checkbox-and-search-empty-message\"\n >\n No results... Try adjusting your search.\n </p>\n ) : (\n visibleOptions.map(({value, label, selected, count, onClick}, index) => (\n <div\n key={value}\n className={style.optionRow}\n data-testid={`filter-checkbox-and-search-option-row-${index}`}\n >\n <CheckboxWithTitle\n key={value}\n title={label}\n onChange={onClick}\n name={label}\n checked={selected}\n customStyle={CHECKBOX_TITLE_STYLE}\n />\n <p className={style.optionCount}>{count}</p>\n </div>\n ))\n )}\n </div>\n {size(options) > INITIAL_VISIBLE_OPTIONS ? (\n <ButtonLink\n label={showMore ? translate('Show less') : translate('Show more')}\n type=\"text\"\n icon={{\n position: 'right',\n faIcon: {\n name: showMore ? 'chevron-up' : 'chevron-down',\n size: 16,\n color: COLORS.cm_grey_500\n }\n }}\n customStyle={SHOW_BUTTON_STYLE}\n onClick={handleShowMore}\n data-testid=\"filter-checkbox-and-search-show-button\"\n />\n ) : null}\n </div>\n );\n};\n\nFilterCheckboxAndSearch.propTypes = propTypes;\n\nFilterCheckboxAndSearch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default FilterCheckboxAndSearch;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,IAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AACA,IAAAK,SAAA,GAAAN,uBAAA,CAAAC,OAAA;AAEA,IAAAM,kBAAA,GAAAJ,sBAAA,CAAAF,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,YAAA,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,CAAC,WAAW,CAAE;IAClEwB,IAAI,EAAC,MAAM;IACXmB,IAAI,EAAE;MACJC,QAAQ,EAAE,OAAO;MACjBC,MAAM,EAAE;QACNL,IAAI,EAAEtC,QAAQ,GAAG,YAAY,GAAG,cAAc;QAC9CuB,IAAI,EAAE,EAAE;QACRqB,KAAK,EAAEC,cAAM,CAACC;MAChB;IACF,CAAE;IACFpB,WAAW,EAAEzC,iBAAkB;IAC/BwC,OAAO,EAAEhB,cAAe;IACxB,eAAY;EAAwC,CACrD,CAAC,GACA,IACD,CAAC;AAEV,CAAC;AAEDlB,uBAAuB,CAACwD,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,mBAAS;AAE7CxD,uBAAuB,CAAC4D,YAAY,GAAG;EACrCrD,SAAS,EAAEsD,iBAAQ,CAACC,iBAAiB,CAACvD;AACxC,CAAC;AAAC,IAAAwD,QAAA,GAAAC,OAAA,CAAAvF,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_title","_interopRequireDefault","_tag","_buttonLink","_provider","_checkboxWithTitle","_colors","_inputSearch","_style","_propsTypes","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","CLEAR_BUTTON_STYLE","fontWeight","padding","SHOW_BUTTON_STYLE","fontSize","fontFamily","CHECKBOX_TITLE_STYLE","marginRight","INITIAL_VISIBLE_OPTIONS","FilterCheckboxAndSearch","props","context","title","titleAriaLabel","searchOptions","onClear","options","translate","GetTranslateFromContext","showMore","setShowMore","useState","selectedFiltersCount","_pipe2","_filter2","selected","_size2","hasSelectedFilters","handleShowMore","useCallback","visibleOptions","useMemo","slice","createElement","className","style","container","header","titleAndTagWrapper","ariaLabel","label","_toString2","type","size","clearButtonContainer","onClick","customStyle","hoverColor","COLORS","cm_grey_700","search","optionsContainer","_isEmpty2","emptySearchResult","map","value","count","index","key","optionRow","onChange","name","checked","optionCount","icon","position","faIcon","color","cm_grey_500","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"sourcesContent":["import React, {useCallback, useMemo, useState} from 'react';\nimport {filter, isEmpty, pipe, size, toString} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport CheckboxWithTitle from '../../atom/checkbox-with-title';\nimport {COLORS} from '../../variables/colors';\nimport Search from '../../atom/input-search';\nimport style from './style.css';\nimport propTypes, {FilterCheckboxAndSearchProps} from './props-types';\n\nconst CLEAR_BUTTON_STYLE = {fontWeight: 'normal', padding: 0};\nconst SHOW_BUTTON_STYLE = {\n fontSize: '14px',\n fontWeight: '600',\n fontFamily: 'Gilroy',\n padding: '0'\n};\nconst CHECKBOX_TITLE_STYLE = {\n marginRight: '16px',\n fontSize: '14px',\n fontFamily: 'Gilroy',\n fontWeight: 'normal'\n};\nconst INITIAL_VISIBLE_OPTIONS = 5;\n\nconst FilterCheckboxAndSearch = (\n props: FilterCheckboxAndSearchProps,\n context: WebContextValues\n) => {\n const {title, titleAriaLabel, searchOptions, onClear, options} = props;\n const translate = GetTranslateFromContext(context);\n const [showMore, setShowMore] = useState(false);\n const selectedFiltersCount = pipe(filter({selected: true}), size)(options);\n const hasSelectedFilters = selectedFiltersCount > 0;\n\n const handleShowMore = useCallback(() => {\n setShowMore(!showMore);\n }, [showMore]);\n\n const visibleOptions = useMemo(() => {\n return showMore ? options : options.slice(0, INITIAL_VISIBLE_OPTIONS);\n }, [options, showMore]);\n\n return (\n <div data-testid=\"filter-checkbox-and-search-container\" className={style.container}>\n <div className={style.header} data-testid=\"filter-checkbox-and-search-header\">\n <div\n className={style.titleAndTagWrapper}\n data-testid=\"filter-checkbox-and-searh-title-and-tag-wrapper\"\n >\n <Title title={title} ariaLabel={titleAriaLabel} />\n {hasSelectedFilters ? (\n <Tag label={toString(selectedFiltersCount)} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.clearButtonContainer}>\n <ButtonLink\n label={translate('clear')}\n type=\"text\"\n data-testid=\"filter-checkbox-and-search-clear-button\"\n onClick={onClear}\n customStyle={CLEAR_BUTTON_STYLE}\n hoverColor={COLORS.cm_grey_700}\n />\n </div>\n ) : null}\n </div>\n {searchOptions ? (\n <div className={style.search}>\n <Search {...searchOptions} />\n </div>\n ) : null}\n <div\n data-testid=\"filter-checkbox-and-search-options-container\"\n className={style.optionsContainer}\n >\n {isEmpty(visibleOptions) ? (\n <p\n className={style.emptySearchResult}\n data-testid=\"filter-checkbox-and-search-empty-message\"\n >\n No results... Try adjusting your search.\n </p>\n ) : (\n visibleOptions.map(({value, label, selected, count, onClick}, index) => (\n <div\n key={value}\n className={style.optionRow}\n data-testid={`filter-checkbox-and-search-option-row-${index}`}\n >\n <CheckboxWithTitle\n key={value}\n title={label}\n onChange={onClick}\n name={label}\n checked={selected}\n customStyle={CHECKBOX_TITLE_STYLE}\n />\n <p className={style.optionCount}>{count}</p>\n </div>\n ))\n )}\n </div>\n {size(options) > INITIAL_VISIBLE_OPTIONS ? (\n <ButtonLink\n label={showMore ? translate('Show less') : translate('Show more')}\n type=\"text\"\n icon={{\n position: 'right',\n faIcon: {\n name: showMore ? 'chevron-up' : 'chevron-down',\n size: 16,\n color: COLORS.cm_grey_500\n }\n }}\n customStyle={SHOW_BUTTON_STYLE}\n onClick={handleShowMore}\n data-testid=\"filter-checkbox-and-search-show-button\"\n />\n ) : null}\n </div>\n );\n};\n\nFilterCheckboxAndSearch.propTypes = propTypes;\n\nFilterCheckboxAndSearch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default FilterCheckboxAndSearch;\n"],"mappings":";;;;;;;;;AAAA,IA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I,EAAErB,KAAM;IACZsB,OAAO,EAAErC,QAAS;IAClBqB,WAAW,EAAExC;EAAqB,CACnC,CAAC,eACFvC,MAAA,CAAAmB,OAAA,CAAA+C,aAAA;IAAGC,SAAS,EAAEC,cAAK,CAAC4B;EAAY,GAAEP,KAAS,CACxC,CACN,CAEA,CAAC,EACL,IAAA9B,MAAA,CAAAxC,OAAA,EAAK8B,OAAO,CAAC,GAAGR,uBAAuB,gBACtCzC,MAAA,CAAAmB,OAAA,CAAA+C,aAAA,CAAC5D,WAAA,CAAAa,OAAU;IACTsD,KAAK,EAAErB,QAAQ,GAAGF,SAAS,CAAC,WAAW,CAAC,GAAGA,SAAS,CAAC,WAAW,CAAE;IAClEyB,IAAI,EAAC,MAAM;IACXsB,IAAI,EAAE;MACJC,QAAQ,EAAE,OAAO;MACjBC,MAAM,EAAE;QACNL,IAAI,EAAE1C,QAAQ,GAAG,YAAY,GAAG,cAAc;QAC9CwB,IAAI,EAAE,EAAE;QACRwB,KAAK,EAAEnB,cAAM,CAACoB;MAChB;IACF,CAAE;IACFtB,WAAW,EAAE3C,iBAAkB;IAC/B0C,OAAO,EAAEjB,cAAe;IACxB,eAAY;EAAwC,CACrD,CAAC,GACA,IACD,CAAC;AAEV,CAAC;AAEDnB,uBAAuB,CAAC4D,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,mBAAS;AAE7C5D,uBAAuB,CAACgE,YAAY,GAAG;EACrCxD,SAAS,EAAEyD,iBAAQ,CAACC,iBAAiB,CAAC1D;AACxC,CAAC;AAAC,IAAA2D,QAAA,GAAAC,OAAA,CAAA3F,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
declare const propTypes: {
|
|
3
3
|
title: PropTypes.Requireable<string>;
|
|
4
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
4
5
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
5
6
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
6
7
|
label: PropTypes.Requireable<string>;
|
|
@@ -44,6 +45,7 @@ declare type SearchType = {
|
|
|
44
45
|
};
|
|
45
46
|
export declare type FilterCheckboxAndSearchProps = {
|
|
46
47
|
title: string;
|
|
48
|
+
titleAriaLabel?: string;
|
|
47
49
|
onClear: () => void;
|
|
48
50
|
searchOptions: SearchType;
|
|
49
51
|
options: FilterCheckboxAndSearchOptions[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-types.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/props-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"props-types.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/props-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAGnC,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;CAed,CAAC;AAEF,oBAAY,8BAA8B,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,OAAO,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,CAAC;AAEF,aAAK,UAAU,GAAG;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,4BAA4B,GAAG;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,UAAU,CAAC;IAC1B,OAAO,EAAE,8BAA8B,EAAE,CAAC;CAC3C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -7,6 +7,7 @@ var _inputSearch = _interopRequireDefault(require("../../atom/input-search"));
|
|
|
7
7
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
8
8
|
const propTypes = {
|
|
9
9
|
title: _propTypes.default.string,
|
|
10
|
+
titleAriaLabel: _propTypes.default.string,
|
|
10
11
|
onClear: _propTypes.default.func,
|
|
11
12
|
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
12
13
|
label: _propTypes.default.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props-types.js","names":["_propTypes","_interopRequireDefault","require","_inputSearch","e","__esModule","default","propTypes","title","PropTypes","string","onClear","func","options","arrayOf","shape","label","value","selected","bool","ref","count","number","onClick","searchOptions","Search","_default","exports"],"sources":["../../../src/organism/filter-checkbox-and-search/props-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Search from '../../atom/input-search';\n\nconst propTypes = {\n title: PropTypes.string,\n onClear: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n selected: PropTypes.bool,\n ref: PropTypes.string,\n count: PropTypes.number,\n onClick: PropTypes.func\n })\n ),\n searchOptions: PropTypes.shape(Search.propTypes)\n};\n\nexport type FilterCheckboxAndSearchOptions = {\n label: string;\n value: string;\n selected: boolean;\n ref: string;\n count: number;\n onClick: () => void;\n};\n\ntype SearchType = {\n value?: string;\n placeholder: string;\n onChange?: () => void;\n onClear?: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n theme?: 'default' | 'coorpmanager';\n dataTestId?: string;\n};\n\nexport type FilterCheckboxAndSearchProps = {\n title: string;\n onClear: () => void;\n searchOptions: SearchType;\n options: FilterCheckboxAndSearchOptions[];\n};\n\nexport default propTypes;\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7C,MAAMG,SAAS,GAAG;EAChBC,KAAK,EAAEC,kBAAS,CAACC,MAAM;EACvBC,
|
|
1
|
+
{"version":3,"file":"props-types.js","names":["_propTypes","_interopRequireDefault","require","_inputSearch","e","__esModule","default","propTypes","title","PropTypes","string","titleAriaLabel","onClear","func","options","arrayOf","shape","label","value","selected","bool","ref","count","number","onClick","searchOptions","Search","_default","exports"],"sources":["../../../src/organism/filter-checkbox-and-search/props-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport Search from '../../atom/input-search';\n\nconst propTypes = {\n title: PropTypes.string,\n titleAriaLabel: PropTypes.string,\n onClear: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n value: PropTypes.string,\n selected: PropTypes.bool,\n ref: PropTypes.string,\n count: PropTypes.number,\n onClick: PropTypes.func\n })\n ),\n searchOptions: PropTypes.shape(Search.propTypes)\n};\n\nexport type FilterCheckboxAndSearchOptions = {\n label: string;\n value: string;\n selected: boolean;\n ref: string;\n count: number;\n onClick: () => void;\n};\n\ntype SearchType = {\n value?: string;\n placeholder: string;\n onChange?: () => void;\n onClear?: () => void;\n onFocus?: () => void;\n onBlur?: () => void;\n theme?: 'default' | 'coorpmanager';\n dataTestId?: string;\n};\n\nexport type FilterCheckboxAndSearchProps = {\n title: string;\n titleAriaLabel?: string;\n onClear: () => void;\n searchOptions: SearchType;\n options: FilterCheckboxAndSearchOptions[];\n};\n\nexport default propTypes;\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,YAAA,GAAAF,sBAAA,CAAAC,OAAA;AAA6C,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE7C,MAAMG,SAAS,GAAG;EAChBC,KAAK,EAAEC,kBAAS,CAACC,MAAM;EACvBC,cAAc,EAAEF,kBAAS,CAACC,MAAM;EAChCE,OAAO,EAAEH,kBAAS,CAACI,IAAI;EACvBC,OAAO,EAAEL,kBAAS,CAACM,OAAO,CACxBN,kBAAS,CAACO,KAAK,CAAC;IACdC,KAAK,EAAER,kBAAS,CAACC,MAAM;IACvBQ,KAAK,EAAET,kBAAS,CAACC,MAAM;IACvBS,QAAQ,EAAEV,kBAAS,CAACW,IAAI;IACxBC,GAAG,EAAEZ,kBAAS,CAACC,MAAM;IACrBY,KAAK,EAAEb,kBAAS,CAACc,MAAM;IACvBC,OAAO,EAAEf,kBAAS,CAACI;EACrB,CAAC,CACH,CAAC;EACDY,aAAa,EAAEhB,kBAAS,CAACO,KAAK,CAACU,oBAAM,CAACnB,SAAS;AACjD,CAAC;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAtB,OAAA,GA8BaC,SAAS","ignoreList":[]}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
@value cm_grey_500 from colors;
|
|
3
3
|
@value cm_grey_100 from colors;
|
|
4
4
|
@value cm_grey_400 from colors;
|
|
5
|
+
@value cm_grey_700 from colors;
|
|
5
6
|
|
|
6
7
|
.container {
|
|
7
8
|
display: flex;
|
|
@@ -46,6 +47,7 @@
|
|
|
46
47
|
justify-content: space-between;
|
|
47
48
|
align-items: center;
|
|
48
49
|
height: 20px;
|
|
50
|
+
cursor: pointer;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
53
|
.optionCount {
|
|
@@ -5,12 +5,15 @@ declare const FilterChip: {
|
|
|
5
5
|
(props: FilterChipProps, context: WebContextValues): JSX.Element;
|
|
6
6
|
propTypes: {
|
|
7
7
|
title: import("prop-types").Requireable<string>;
|
|
8
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
8
9
|
onClear: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
9
10
|
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
10
11
|
label: import("prop-types").Requireable<string>;
|
|
11
12
|
type: import("prop-types").Requireable<string>;
|
|
13
|
+
textColor: import("prop-types").Requireable<string>;
|
|
12
14
|
selected: import("prop-types").Requireable<boolean>;
|
|
13
15
|
icon: import("prop-types").Requireable<string>;
|
|
16
|
+
customIcon: import("prop-types").Requireable<string>;
|
|
14
17
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
15
18
|
}> | null | undefined)[]>;
|
|
16
19
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAkB,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAGxD,QAAA,MAAM,UAAU;YAAW,eAAe,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;CAiDpE,CAAC;AAQF,eAAe,UAAU,CAAC"}
|
|
@@ -13,6 +13,7 @@ var _title = _interopRequireDefault(require("../../atom/title"));
|
|
|
13
13
|
var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
14
14
|
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
15
15
|
var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
16
|
+
var _colors = require("../../variables/colors");
|
|
16
17
|
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
17
18
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
18
19
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
@@ -21,6 +22,7 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
21
22
|
const FilterChip = (props, context) => {
|
|
22
23
|
const {
|
|
23
24
|
options,
|
|
25
|
+
titleAriaLabel,
|
|
24
26
|
title,
|
|
25
27
|
onClear
|
|
26
28
|
} = props;
|
|
@@ -34,7 +36,8 @@ const FilterChip = (props, context) => {
|
|
|
34
36
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
35
37
|
className: _style.default.titleContainer
|
|
36
38
|
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
37
|
-
title: title
|
|
39
|
+
title: title,
|
|
40
|
+
ariaLabel: titleAriaLabel
|
|
38
41
|
}), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
39
42
|
label: (0, _toString2.default)(selectedFiltersCount),
|
|
40
43
|
type: "info",
|
|
@@ -50,15 +53,18 @@ const FilterChip = (props, context) => {
|
|
|
50
53
|
type: "text",
|
|
51
54
|
"data-name": "filter-chip-clear-button",
|
|
52
55
|
"aria-label": "filter chip clear button",
|
|
53
|
-
onClick: onClear
|
|
56
|
+
onClick: onClear,
|
|
57
|
+
hoverColor: _colors.COLORS.cm_grey_700
|
|
54
58
|
})) : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
55
59
|
className: _style.default.optionsContainer
|
|
56
60
|
}, (0, _map2.default)(({
|
|
57
61
|
icon,
|
|
58
62
|
label,
|
|
59
63
|
onClick,
|
|
64
|
+
textColor,
|
|
60
65
|
type,
|
|
61
|
-
selected
|
|
66
|
+
selected,
|
|
67
|
+
customIcon
|
|
62
68
|
}) => {
|
|
63
69
|
function handleClick() {
|
|
64
70
|
onClick(type);
|
|
@@ -66,9 +72,11 @@ const FilterChip = (props, context) => {
|
|
|
66
72
|
return /*#__PURE__*/_react.default.createElement(_chip.default, {
|
|
67
73
|
leftIcon: icon,
|
|
68
74
|
text: label,
|
|
75
|
+
textColor: textColor,
|
|
69
76
|
key: label,
|
|
70
77
|
selected: selected,
|
|
71
|
-
onClick: handleClick
|
|
78
|
+
onClick: handleClick,
|
|
79
|
+
customIcon: customIcon
|
|
72
80
|
});
|
|
73
81
|
}, options)));
|
|
74
82
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_chip","_title","_tag","_buttonLink","_provider","_interopRequireWildcard","_propTypes","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FilterChip","props","context","options","title","onClear","selectedFiltersCount","_pipe2","_filter2","selected","_size2","hasSelectedFilters","translate","GetTranslateFromContext","createElement","Fragment","className","style","header","titleContainer","label","_toString2","type","size","buttonContainer","customStyle","fontWeight","padding","onClick","optionsContainer","_map2","icon","handleClick","leftIcon","text","key","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/organism/filter-chip/index.tsx"],"sourcesContent":["import React from 'react';\nimport {filter, map, pipe, size, toString} from 'lodash/fp';\nimport Chip from '../../atom/chip';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport propTypes, {FilterChipProps} from './prop-types';\nimport style from './style.css';\n\nconst FilterChip = (props: FilterChipProps, context: WebContextValues) => {\n const {options, title, onClear} = props;\n const selectedFiltersCount = pipe(filter({selected: true}), size)(options);\n const hasSelectedFilters = selectedFiltersCount > 0;\n const translate = GetTranslateFromContext(context);\n return (\n <>\n <div className={style.header}>\n <div className={style.titleContainer}>\n <Title title={title} />\n {hasSelectedFilters ? (\n <Tag label={toString(selectedFiltersCount)} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.buttonContainer}>\n <ButtonLink\n customStyle={{fontWeight: 'normal', padding: 0}}\n label={translate('clear')}\n type=\"text\"\n data-name=\"filter-chip-clear-button\"\n aria-label=\"filter chip clear button\"\n onClick={onClear}\n />\n </div>\n ) : null}\n </div>\n <div className={style.optionsContainer}>\n {map(({icon, label, onClick, type, selected}) => {\n function handleClick() {\n onClick(type);\n }\n\n return (\n <Chip\n leftIcon={icon}\n text={label}\n key={label}\n selected={selected}\n onClick={handleClick}\n />\n );\n }, options)}\n </div>\n </>\n );\n};\n\nFilterChip.propTypes = propTypes;\n\nFilterChip.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default FilterChip;\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,KAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,MAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAC,uBAAA,CAAAN,OAAA;AAEA,IAAAO,UAAA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_chip","_title","_tag","_buttonLink","_provider","_interopRequireWildcard","_colors","_propTypes","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FilterChip","props","context","options","titleAriaLabel","title","onClear","selectedFiltersCount","_pipe2","_filter2","selected","_size2","hasSelectedFilters","translate","GetTranslateFromContext","createElement","Fragment","className","style","header","titleContainer","ariaLabel","label","_toString2","type","size","buttonContainer","customStyle","fontWeight","padding","onClick","hoverColor","COLORS","cm_grey_700","optionsContainer","_map2","icon","textColor","customIcon","handleClick","leftIcon","text","key","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/organism/filter-chip/index.tsx"],"sourcesContent":["import React from 'react';\nimport {filter, map, pipe, size, toString} from 'lodash/fp';\nimport Chip from '../../atom/chip';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport {COLORS} from '../../variables/colors';\nimport propTypes, {FilterChipProps} from './prop-types';\nimport style from './style.css';\n\nconst FilterChip = (props: FilterChipProps, context: WebContextValues) => {\n const {options, titleAriaLabel, title, onClear} = props;\n const selectedFiltersCount = pipe(filter({selected: true}), size)(options);\n const hasSelectedFilters = selectedFiltersCount > 0;\n const translate = GetTranslateFromContext(context);\n return (\n <>\n <div className={style.header}>\n <div className={style.titleContainer}>\n <Title title={title} ariaLabel={titleAriaLabel} />\n {hasSelectedFilters ? (\n <Tag label={toString(selectedFiltersCount)} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.buttonContainer}>\n <ButtonLink\n customStyle={{fontWeight: 'normal', padding: 0}}\n label={translate('clear')}\n type=\"text\"\n data-name=\"filter-chip-clear-button\"\n aria-label=\"filter chip clear button\"\n onClick={onClear}\n hoverColor={COLORS.cm_grey_700}\n />\n </div>\n ) : null}\n </div>\n <div className={style.optionsContainer}>\n {map(({icon, label, onClick, textColor, type, selected, customIcon}) => {\n function handleClick() {\n onClick(type);\n }\n\n return (\n <Chip\n leftIcon={icon}\n text={label}\n textColor={textColor}\n key={label}\n selected={selected}\n onClick={handleClick}\n customIcon={customIcon}\n />\n );\n }, options)}\n </div>\n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ACrBK,GAAG,EAAEpB,KAAM;MACXZ,QAAQ,EAAEA,QAAS;MACnBoB,OAAO,EAAES,WAAY;MACrBD,UAAU,EAAEA;IAAW,CACxB,CAAC;EAEN,CAAC,EAAEnC,OAAO,CACP,CACL,CAAC;AAEP,CAAC;AAEDH,UAAU,CAAC2C,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,kBAAS;AAEhC3C,UAAU,CAAC+C,YAAY,GAAG;EACxBlC,SAAS,EAAEmC,iBAAQ,CAACC,iBAAiB,CAACpC;AACxC,CAAC;AAAC,IAAAqC,QAAA,GAAAC,OAAA,CAAAjE,OAAA,GAEac,UAAU","ignoreList":[]}
|
|
@@ -1,25 +1,32 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
2
|
declare const propTypes: {
|
|
3
3
|
title: PropTypes.Requireable<string>;
|
|
4
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
4
5
|
onClear: PropTypes.Requireable<(...args: any[]) => any>;
|
|
5
6
|
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
6
7
|
label: PropTypes.Requireable<string>;
|
|
7
8
|
type: PropTypes.Requireable<string>;
|
|
9
|
+
textColor: PropTypes.Requireable<string>;
|
|
8
10
|
selected: PropTypes.Requireable<boolean>;
|
|
9
11
|
icon: PropTypes.Requireable<string>;
|
|
12
|
+
customIcon: PropTypes.Requireable<string>;
|
|
10
13
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
11
14
|
}> | null | undefined)[]>;
|
|
12
15
|
};
|
|
16
|
+
export declare type FilterChipOptionsProps = {
|
|
17
|
+
label: string;
|
|
18
|
+
type: string;
|
|
19
|
+
selected: boolean;
|
|
20
|
+
icon?: string;
|
|
21
|
+
textColor?: string;
|
|
22
|
+
customIcon?: string;
|
|
23
|
+
onClick: (type: string) => void;
|
|
24
|
+
};
|
|
13
25
|
export declare type FilterChipProps = {
|
|
14
26
|
title: string;
|
|
27
|
+
titleAriaLabel?: string;
|
|
15
28
|
onClear: () => void;
|
|
16
|
-
options:
|
|
17
|
-
label: string;
|
|
18
|
-
type: string;
|
|
19
|
-
selected: boolean;
|
|
20
|
-
icon: string;
|
|
21
|
-
onClick: (type: string) => void;
|
|
22
|
-
}[];
|
|
29
|
+
options: FilterChipOptionsProps[];
|
|
23
30
|
};
|
|
24
31
|
export default propTypes;
|
|
25
32
|
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;;;;;;CAed,CAAC;AAEF,oBAAY,sBAAsB,GAAG;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACjC,CAAC;AAEF,oBAAY,eAAe,GAAG;IAC5B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,sBAAsB,EAAE,CAAC;CACnC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -6,12 +6,15 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
6
6
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
7
7
|
const propTypes = {
|
|
8
8
|
title: _propTypes.default.string,
|
|
9
|
+
titleAriaLabel: _propTypes.default.string,
|
|
9
10
|
onClear: _propTypes.default.func,
|
|
10
11
|
options: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
11
12
|
label: _propTypes.default.string,
|
|
12
13
|
type: _propTypes.default.string,
|
|
14
|
+
textColor: _propTypes.default.string,
|
|
13
15
|
selected: _propTypes.default.bool,
|
|
14
16
|
icon: _propTypes.default.string,
|
|
17
|
+
customIcon: _propTypes.default.string,
|
|
15
18
|
onClick: _propTypes.default.func
|
|
16
19
|
}))
|
|
17
20
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["_propTypes","_interopRequireDefault","require","e","__esModule","default","propTypes","title","PropTypes","string","onClear","func","options","arrayOf","shape","label","type","selected","bool","icon","onClick","_default","exports"],"sources":["../../../src/organism/filter-chip/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n title: PropTypes.string,\n onClear: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.string,\n selected: PropTypes.bool,\n icon: PropTypes.string,\n onClick: PropTypes.func\n })\n )\n};\n\nexport type
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["_propTypes","_interopRequireDefault","require","e","__esModule","default","propTypes","title","PropTypes","string","titleAriaLabel","onClear","func","options","arrayOf","shape","label","type","textColor","selected","bool","icon","customIcon","onClick","_default","exports"],"sources":["../../../src/organism/filter-chip/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\n\nconst propTypes = {\n title: PropTypes.string,\n titleAriaLabel: PropTypes.string,\n onClear: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.shape({\n label: PropTypes.string,\n type: PropTypes.string,\n textColor: PropTypes.string,\n selected: PropTypes.bool,\n icon: PropTypes.string,\n customIcon: PropTypes.string,\n onClick: PropTypes.func\n })\n )\n};\n\nexport type FilterChipOptionsProps = {\n label: string;\n type: string;\n selected: boolean;\n icon?: string;\n textColor?: string;\n customIcon?: string;\n onClick: (type: string) => void;\n};\n\nexport type FilterChipProps = {\n title: string;\n titleAriaLabel?: string;\n onClear: () => void;\n options: FilterChipOptionsProps[];\n};\n\nexport default propTypes;\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAAmC,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEnC,MAAMG,SAAS,GAAG;EAChBC,KAAK,EAAEC,kBAAS,CAACC,MAAM;EACvBC,cAAc,EAAEF,kBAAS,CAACC,MAAM;EAChCE,OAAO,EAAEH,kBAAS,CAACI,IAAI;EACvBC,OAAO,EAAEL,kBAAS,CAACM,OAAO,CACxBN,kBAAS,CAACO,KAAK,CAAC;IACdC,KAAK,EAAER,kBAAS,CAACC,MAAM;IACvBQ,IAAI,EAAET,kBAAS,CAACC,MAAM;IACtBS,SAAS,EAAEV,kBAAS,CAACC,MAAM;IAC3BU,QAAQ,EAAEX,kBAAS,CAACY,IAAI;IACxBC,IAAI,EAAEb,kBAAS,CAACC,MAAM;IACtBa,UAAU,EAAEd,kBAAS,CAACC,MAAM;IAC5Bc,OAAO,EAAEf,kBAAS,CAACI;EACrB,CAAC,CACH;AACF,CAAC;AAAC,IAAAY,QAAA,GAAAC,OAAA,CAAApB,OAAA,GAmBaC,SAAS","ignoreList":[]}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { WebContextValues } from '../../atom/provider/web-context';
|
|
3
|
+
import { FilterSwitchProps } from './prop-types';
|
|
4
|
+
declare const FilterSwitch: {
|
|
5
|
+
(props: FilterSwitchProps, context: WebContextValues): JSX.Element;
|
|
6
|
+
propTypes: {
|
|
7
|
+
title: import("prop-types").Validator<string>;
|
|
8
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
9
|
+
onClear: import("prop-types").Validator<(...args: any[]) => any>;
|
|
10
|
+
options: import("prop-types").Requireable<(import("prop-types").InferProps<{
|
|
11
|
+
label: import("prop-types").Validator<string>;
|
|
12
|
+
value: import("prop-types").Validator<boolean>;
|
|
13
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
14
|
+
theme: import("prop-types").Validator<string>;
|
|
15
|
+
ariaLabel: import("prop-types").Validator<string>;
|
|
16
|
+
}> | null | undefined)[]>;
|
|
17
|
+
};
|
|
18
|
+
contextTypes: {
|
|
19
|
+
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
export default FilterSwitch;
|
|
23
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-switch/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAkB,EAAC,iBAAiB,EAAC,MAAM,cAAc,CAAC;AAG1D,QAAA,MAAM,YAAY;YAAW,iBAAiB,WAAW,gBAAgB;;;;;;;;;;;;;;;;CA+CxE,CAAC;AAQF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _toString2 = _interopRequireDefault(require("lodash/fp/toString"));
|
|
6
|
+
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
7
|
+
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
8
|
+
var _filter2 = _interopRequireDefault(require("lodash/fp/filter"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
11
|
+
var _inputSwitch = _interopRequireDefault(require("../../atom/input-switch"));
|
|
12
|
+
var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
13
|
+
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
14
|
+
var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
15
|
+
var _colors = require("../../variables/colors");
|
|
16
|
+
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
17
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
18
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
19
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
20
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
21
|
+
const FilterSwitch = (props, context) => {
|
|
22
|
+
const {
|
|
23
|
+
title,
|
|
24
|
+
titleAriaLabel,
|
|
25
|
+
onClear,
|
|
26
|
+
options
|
|
27
|
+
} = props;
|
|
28
|
+
const selectedFiltersCount = (0, _pipe2.default)((0, _filter2.default)({
|
|
29
|
+
value: true
|
|
30
|
+
}), _size2.default)(options);
|
|
31
|
+
const hasSelectedFilters = selectedFiltersCount > 0;
|
|
32
|
+
const translate = (0, _provider.GetTranslateFromContext)(context);
|
|
33
|
+
return /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement("div", {
|
|
34
|
+
className: _style.default.header
|
|
35
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
36
|
+
className: _style.default.titleContainer
|
|
37
|
+
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
38
|
+
title: title,
|
|
39
|
+
ariaLabel: titleAriaLabel
|
|
40
|
+
}), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
41
|
+
label: (0, _toString2.default)(selectedFiltersCount),
|
|
42
|
+
type: "info",
|
|
43
|
+
size: "S"
|
|
44
|
+
}) : null), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement("div", {
|
|
45
|
+
className: _style.default.buttonContainer
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
47
|
+
customStyle: {
|
|
48
|
+
fontWeight: 'normal',
|
|
49
|
+
padding: 0
|
|
50
|
+
},
|
|
51
|
+
label: translate('clear'),
|
|
52
|
+
type: "text",
|
|
53
|
+
"data-name": "filter-chip-clear-button",
|
|
54
|
+
"aria-label": "filter chip clear button",
|
|
55
|
+
onClick: onClear,
|
|
56
|
+
hoverColor: _colors.COLORS.cm_grey_700
|
|
57
|
+
})) : null), /*#__PURE__*/_react.default.createElement("div", {
|
|
58
|
+
className: _style.default.optionsContainer
|
|
59
|
+
}, options.map(optionItem => {
|
|
60
|
+
const {
|
|
61
|
+
label,
|
|
62
|
+
value,
|
|
63
|
+
onChange,
|
|
64
|
+
ariaLabel
|
|
65
|
+
} = optionItem;
|
|
66
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
67
|
+
key: label,
|
|
68
|
+
className: _style.default.switchOption
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement(_inputSwitch.default, {
|
|
70
|
+
title: label,
|
|
71
|
+
value: value,
|
|
72
|
+
theme: 'newMooc',
|
|
73
|
+
onChange: onChange,
|
|
74
|
+
"aria-label": ariaLabel
|
|
75
|
+
}));
|
|
76
|
+
})));
|
|
77
|
+
};
|
|
78
|
+
FilterSwitch.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
79
|
+
FilterSwitch.contextTypes = {
|
|
80
|
+
translate: _provider.default.childContextTypes.translate
|
|
81
|
+
};
|
|
82
|
+
var _default = exports.default = FilterSwitch;
|
|
83
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_title","_inputSwitch","_tag","_buttonLink","_provider","_interopRequireWildcard","_colors","_propTypes","_style","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","FilterSwitch","props","context","title","titleAriaLabel","onClear","options","selectedFiltersCount","_pipe2","_filter2","value","_size2","hasSelectedFilters","translate","GetTranslateFromContext","createElement","className","style","header","titleContainer","ariaLabel","label","_toString2","type","size","buttonContainer","customStyle","fontWeight","padding","onClick","hoverColor","COLORS","cm_grey_700","optionsContainer","map","optionItem","onChange","key","switchOption","theme","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/organism/filter-switch/index.tsx"],"sourcesContent":["import React from 'react';\nimport {filter, pipe, size, toString} from 'lodash/fp';\nimport Title from '../../atom/title';\nimport InputSwitch from '../../atom/input-switch';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport {COLORS} from '../../variables/colors';\nimport propTypes, {FilterSwitchProps} from './prop-types';\nimport style from './style.css';\n\nconst FilterSwitch = (props: FilterSwitchProps, context: WebContextValues) => {\n const {title, titleAriaLabel, onClear, options} = props;\n const selectedFiltersCount = pipe(filter({value: true}), size)(options);\n const hasSelectedFilters = selectedFiltersCount > 0;\n const translate = GetTranslateFromContext(context);\n\n return (\n <div>\n <div className={style.header}>\n <div className={style.titleContainer}>\n <Title title={title} ariaLabel={titleAriaLabel} />\n {hasSelectedFilters ? (\n <Tag label={toString(selectedFiltersCount)} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.buttonContainer}>\n <ButtonLink\n customStyle={{fontWeight: 'normal', padding: 0}}\n label={translate('clear')}\n type=\"text\"\n data-name=\"filter-chip-clear-button\"\n aria-label=\"filter chip clear button\"\n onClick={onClear}\n hoverColor={COLORS.cm_grey_700}\n />\n </div>\n ) : null}\n </div>\n <div className={style.optionsContainer}>\n {options.map(optionItem => {\n const {label, value, onChange, ariaLabel} = optionItem;\n return (\n <div key={label} className={style.switchOption}>\n <InputSwitch\n title={label}\n value={value}\n theme={'newMooc'}\n onChange={onChange}\n aria-label={ariaLabel}\n />\n </div>\n );\n })}\n </div>\n </div>\n );\n};\n\nFilterSwitch.propTypes = propTypes;\n\nFilterSwitch.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default FilterSwitch;\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,IAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,SAAA,GAAAC,uBAAA,CAAAN,OAAA;AAEA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,MAAA,GAAAV,sBAAA,CAAAC,OAAA;AAAgC,SAAAU,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAE,CAAA,SAAAA,CAA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AA6B,aAAA;IAAKC,SAAS,EAAEC,cAAK,CAACgB;EAAiB,GACpC3B,OAAO,CAAC4B,GAAG,CAACC,UAAU,IAAI;IACzB,MAAM;MAACd,KAAK;MAAEX,KAAK;MAAE0B,QAAQ;MAAEhB;IAAS,CAAC,GAAGe,UAAU;IACtD,oBACEnE,MAAA,CAAAkB,OAAA,CAAA6B,aAAA;MAAKsB,GAAG,EAAEhB,KAAM;MAACL,SAAS,EAAEC,cAAK,CAACqB;IAAa,gBAC7CtE,MAAA,CAAAkB,OAAA,CAAA6B,aAAA,CAAC3C,YAAA,CAAAc,OAAW;MACViB,KAAK,EAAEkB,KAAM;MACbX,KAAK,EAAEA,KAAM;MACb6B,KAAK,EAAE,SAAU;MACjBH,QAAQ,EAAEA,QAAS;MACnB,cAAYhB;IAAU,CACvB,CACE,CAAC;EAEV,CAAC,CACE,CACF,CAAC;AAEV,CAAC;AAEDpB,YAAY,CAACwC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,kBAAS;AAElCxC,YAAY,CAAC4C,YAAY,GAAG;EAC1B/B,SAAS,EAAEgC,iBAAQ,CAACC,iBAAiB,CAACjC;AACxC,CAAC;AAAC,IAAAkC,QAAA,GAAAC,OAAA,CAAA9D,OAAA,GAEac,YAAY","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import PropTypes from 'prop-types';
|
|
2
|
+
declare const propTypes: {
|
|
3
|
+
title: PropTypes.Validator<string>;
|
|
4
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
5
|
+
onClear: PropTypes.Validator<(...args: any[]) => any>;
|
|
6
|
+
options: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
7
|
+
label: PropTypes.Validator<string>;
|
|
8
|
+
value: PropTypes.Validator<boolean>;
|
|
9
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
10
|
+
theme: PropTypes.Validator<string>;
|
|
11
|
+
ariaLabel: PropTypes.Validator<string>;
|
|
12
|
+
}> | null | undefined)[]>;
|
|
13
|
+
};
|
|
14
|
+
export declare type FilterSwitchOptionsProps = {
|
|
15
|
+
label: string;
|
|
16
|
+
value: boolean;
|
|
17
|
+
onChange: (value: string) => void;
|
|
18
|
+
theme: string;
|
|
19
|
+
ariaLabel: string;
|
|
20
|
+
};
|
|
21
|
+
export declare type FilterSwitchProps = {
|
|
22
|
+
title: string;
|
|
23
|
+
titleAriaLabel?: string;
|
|
24
|
+
onClear: () => void;
|
|
25
|
+
options: FilterSwitchOptionsProps[];
|
|
26
|
+
};
|
|
27
|
+
export default propTypes;
|
|
28
|
+
//# sourceMappingURL=prop-types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-switch/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AAEnC,QAAA,MAAM,SAAS;;;;;;;;;;;CAad,CAAC;AAEF,oBAAY,wBAAwB,GAAG;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,OAAO,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,OAAO,EAAE,wBAAwB,EAAE,CAAC;CACrC,CAAC;AAEF,eAAe,SAAS,CAAC"}
|