@coorpacademy/components 11.40.14 → 11.40.16
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/button/style.css +2 -2
- package/es/atom/button-menu/utils.d.ts +1 -1
- package/es/atom/checkbox-with-title/index.d.ts +25 -1
- package/es/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/es/atom/checkbox-with-title/index.js +19 -2
- package/es/atom/checkbox-with-title/index.js.map +1 -1
- package/es/atom/chip/index.d.ts.map +1 -1
- package/es/atom/chip/index.js +4 -4
- package/es/atom/chip/index.js.map +1 -1
- package/es/atom/content-badge/style.css +2 -2
- package/es/atom/input-html/index.d.ts.map +1 -1
- package/es/atom/input-html/index.js +2 -1
- package/es/atom/input-html/index.js.map +1 -1
- package/es/atom/input-switch/index.d.ts +24 -1
- package/es/atom/input-switch/index.d.ts.map +1 -1
- package/es/atom/input-switch/index.js +18 -4
- package/es/atom/input-switch/index.js.map +1 -1
- package/es/atom/input-switch/style.css +3 -0
- package/es/atom/range/index.d.ts +35 -3
- package/es/atom/range/index.d.ts.map +1 -1
- package/es/atom/range/index.js +95 -20
- package/es/atom/range/index.js.map +1 -1
- package/es/atom/range/style.css +40 -2
- package/es/atom/resource-miniature/style.css +3 -3
- package/es/atom/status-item/index.native.js +1 -1
- package/es/atom/status-item/index.native.js.map +1 -1
- package/es/molecule/base-modal/index.d.ts.map +1 -1
- package/es/molecule/base-modal/index.js +11 -5
- package/es/molecule/base-modal/index.js.map +1 -1
- package/es/molecule/card/favorite.d.ts.map +1 -1
- package/es/molecule/card/favorite.js +15 -16
- package/es/molecule/card/favorite.js.map +1 -1
- package/es/molecule/card/notification.css +0 -6
- package/es/molecule/card/notification.d.ts.map +1 -1
- package/es/molecule/card/notification.js +12 -14
- package/es/molecule/card/notification.js.map +1 -1
- package/es/molecule/cm-popin/types.d.ts +2 -0
- package/es/molecule/cm-popin/types.d.ts.map +1 -1
- package/es/molecule/coorpmanager-base-banner/style.css +1 -1
- package/es/molecule/dashboard/cards-list/index.d.ts +9 -0
- package/es/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/es/molecule/dashboard/cards-list/index.js +5 -1
- package/es/molecule/dashboard/cards-list/index.js.map +1 -1
- package/es/molecule/dashboard/cards-list/style.css +1 -1
- package/es/molecule/draggable-list/index.d.ts +1 -0
- package/es/molecule/go1-banner/style.css +3 -3
- package/es/molecule/learning-priority-modal/index.js +1 -1
- package/es/molecule/learning-priority-modal/index.js.map +1 -1
- package/es/molecule/modal/style.css +3 -3
- package/es/molecule/multi-filter-panel/index.d.ts +42 -0
- package/es/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/index.js +28 -15
- package/es/molecule/multi-filter-panel/index.js.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.d.ts +32 -5
- package/es/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/es/molecule/multi-filter-panel/prop-types.js +4 -0
- package/es/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/es/molecule/questions/question-range/index.d.ts +6 -1
- package/es/molecule/quick-filters/index.js +3 -1
- package/es/molecule/quick-filters/index.js.map +1 -1
- package/es/molecule/quick-filters/style.css +7 -2
- package/es/molecule/tabs/index.d.ts +39 -0
- package/es/molecule/tabs/index.d.ts.map +1 -0
- package/es/molecule/tabs/index.js +69 -0
- package/es/molecule/tabs/index.js.map +1 -0
- package/es/molecule/tabs/style.css +28 -0
- package/es/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/es/organism/brand-analytics/style.css +1 -1
- package/es/organism/brand-learning-priorities/index.d.ts +1 -0
- package/es/organism/content-skill-modal/index.d.ts +23 -0
- package/es/organism/content-skill-modal/index.d.ts.map +1 -1
- package/es/organism/content-skill-modal/types.d.ts +23 -0
- package/es/organism/content-skill-modal/types.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.d.ts +22 -0
- package/es/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/es/organism/filter-checkbox-and-search/index.js +21 -4
- package/es/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/es/organism/filter-checkbox-and-search/props-types.d.ts +3 -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-chip/index.d.ts +21 -0
- package/es/organism/filter-chip/index.d.ts.map +1 -1
- package/es/organism/filter-chip/index.js +14 -2
- package/es/organism/filter-chip/index.js.map +1 -1
- package/es/organism/filter-range/index.d.ts +28 -0
- package/es/organism/filter-range/index.d.ts.map +1 -0
- package/es/organism/filter-range/index.js +101 -0
- package/es/organism/filter-range/index.js.map +1 -0
- package/es/organism/filter-range/prop-types.d.ts +40 -0
- package/es/organism/filter-range/prop-types.d.ts.map +1 -0
- package/es/organism/filter-range/prop-types.js +20 -0
- package/es/organism/filter-range/prop-types.js.map +1 -0
- package/es/organism/filter-range/style.css +15 -0
- package/es/organism/filter-switch/index.d.ts +22 -0
- package/es/organism/filter-switch/index.d.ts.map +1 -1
- package/es/organism/filter-switch/index.js +18 -3
- package/es/organism/filter-switch/index.js.map +1 -1
- package/es/organism/filter-switch/prop-types.d.ts +2 -0
- package/es/organism/filter-switch/prop-types.d.ts.map +1 -1
- package/es/organism/filter-switch/prop-types.js +2 -1
- package/es/organism/filter-switch/prop-types.js.map +1 -1
- package/es/organism/list-item/index.d.ts +1 -0
- package/es/organism/list-items/index.d.ts +2 -0
- package/es/organism/list-items/style.css +1 -1
- package/es/organism/mooc-footer/style.css +2 -2
- 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/sidebar/style.css +3 -3
- package/es/organism/title-and-input/index.d.ts +1 -0
- package/es/organism/title-and-input/index.d.ts.map +1 -1
- package/es/organism/title-and-input/types.d.ts +1 -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/activity/stars-summary.css +2 -2
- 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 +11 -0
- package/es/template/app-player/popin-end/summary.d.ts +9 -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 +28 -0
- package/es/template/back-office/brand-update/utils.d.ts +1 -1
- package/es/template/common/dashboard/index.d.ts +4 -0
- package/es/template/common/search-page/index.d.ts +106 -21
- package/es/template/common/search-page/index.d.ts.map +1 -1
- package/es/template/common/search-page/index.js +76 -21
- package/es/template/common/search-page/index.js.map +1 -1
- package/es/template/common/search-page/style.css +52 -4
- package/es/template/external-course/index.d.ts +2 -0
- package/es/template/my-learning/index.d.ts +9 -0
- package/es/template/teams-dashboard/index.d.ts +9 -0
- package/es/util/external-content.js +2 -2
- package/es/util/external-content.js.map +1 -1
- package/es/variables/colors.css +6 -6
- package/es/variables/colors.d.ts +5 -4
- package/es/variables/colors.d.ts.map +1 -1
- package/es/variables/colors.js +5 -4
- package/es/variables/colors.js.map +1 -1
- package/lib/atom/button/style.css +2 -2
- package/lib/atom/button-menu/utils.d.ts +1 -1
- package/lib/atom/checkbox-with-title/index.d.ts +25 -1
- package/lib/atom/checkbox-with-title/index.d.ts.map +1 -1
- package/lib/atom/checkbox-with-title/index.js +19 -2
- package/lib/atom/checkbox-with-title/index.js.map +1 -1
- package/lib/atom/chip/index.d.ts.map +1 -1
- package/lib/atom/chip/index.js +4 -4
- package/lib/atom/chip/index.js.map +1 -1
- package/lib/atom/content-badge/style.css +2 -2
- package/lib/atom/input-html/index.d.ts.map +1 -1
- package/lib/atom/input-html/index.js +2 -1
- package/lib/atom/input-html/index.js.map +1 -1
- package/lib/atom/input-switch/index.d.ts +24 -1
- package/lib/atom/input-switch/index.d.ts.map +1 -1
- package/lib/atom/input-switch/index.js +18 -4
- package/lib/atom/input-switch/index.js.map +1 -1
- package/lib/atom/input-switch/style.css +3 -0
- package/lib/atom/range/index.d.ts +35 -3
- package/lib/atom/range/index.d.ts.map +1 -1
- package/lib/atom/range/index.js +95 -20
- package/lib/atom/range/index.js.map +1 -1
- package/lib/atom/range/style.css +40 -2
- package/lib/atom/resource-miniature/style.css +3 -3
- package/lib/atom/status-item/index.native.js +1 -1
- package/lib/atom/status-item/index.native.js.map +1 -1
- package/lib/molecule/base-modal/index.d.ts.map +1 -1
- package/lib/molecule/base-modal/index.js +11 -5
- package/lib/molecule/base-modal/index.js.map +1 -1
- package/lib/molecule/card/favorite.d.ts.map +1 -1
- package/lib/molecule/card/favorite.js +15 -16
- package/lib/molecule/card/favorite.js.map +1 -1
- package/lib/molecule/card/notification.css +0 -6
- package/lib/molecule/card/notification.d.ts.map +1 -1
- package/lib/molecule/card/notification.js +12 -14
- package/lib/molecule/card/notification.js.map +1 -1
- package/lib/molecule/cm-popin/types.d.ts +2 -0
- package/lib/molecule/cm-popin/types.d.ts.map +1 -1
- package/lib/molecule/coorpmanager-base-banner/style.css +1 -1
- package/lib/molecule/dashboard/cards-list/index.d.ts +9 -0
- package/lib/molecule/dashboard/cards-list/index.d.ts.map +1 -1
- package/lib/molecule/dashboard/cards-list/index.js +5 -1
- package/lib/molecule/dashboard/cards-list/index.js.map +1 -1
- package/lib/molecule/dashboard/cards-list/style.css +1 -1
- package/lib/molecule/draggable-list/index.d.ts +1 -0
- package/lib/molecule/go1-banner/style.css +3 -3
- package/lib/molecule/learning-priority-modal/index.js +1 -1
- package/lib/molecule/learning-priority-modal/index.js.map +1 -1
- package/lib/molecule/modal/style.css +3 -3
- package/lib/molecule/multi-filter-panel/index.d.ts +42 -0
- package/lib/molecule/multi-filter-panel/index.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/index.js +28 -15
- package/lib/molecule/multi-filter-panel/index.js.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.d.ts +32 -5
- package/lib/molecule/multi-filter-panel/prop-types.d.ts.map +1 -1
- package/lib/molecule/multi-filter-panel/prop-types.js +4 -0
- package/lib/molecule/multi-filter-panel/prop-types.js.map +1 -1
- package/lib/molecule/questions/question-range/index.d.ts +6 -1
- package/lib/molecule/quick-filters/index.js +3 -1
- package/lib/molecule/quick-filters/index.js.map +1 -1
- package/lib/molecule/quick-filters/style.css +7 -2
- package/lib/molecule/tabs/index.d.ts +39 -0
- package/lib/molecule/tabs/index.d.ts.map +1 -0
- package/lib/molecule/tabs/index.js +74 -0
- package/lib/molecule/tabs/index.js.map +1 -0
- package/lib/molecule/tabs/style.css +28 -0
- package/lib/molecule/title-and-checkbox-wrapper/index.d.ts +1 -0
- package/lib/organism/brand-analytics/style.css +1 -1
- package/lib/organism/brand-learning-priorities/index.d.ts +1 -0
- package/lib/organism/content-skill-modal/index.d.ts +23 -0
- package/lib/organism/content-skill-modal/index.d.ts.map +1 -1
- package/lib/organism/content-skill-modal/types.d.ts +23 -0
- package/lib/organism/content-skill-modal/types.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.d.ts +22 -0
- package/lib/organism/filter-checkbox-and-search/index.d.ts.map +1 -1
- package/lib/organism/filter-checkbox-and-search/index.js +21 -4
- package/lib/organism/filter-checkbox-and-search/index.js.map +1 -1
- package/lib/organism/filter-checkbox-and-search/props-types.d.ts +3 -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-chip/index.d.ts +21 -0
- package/lib/organism/filter-chip/index.d.ts.map +1 -1
- package/lib/organism/filter-chip/index.js +14 -2
- package/lib/organism/filter-chip/index.js.map +1 -1
- package/lib/organism/filter-range/index.d.ts +28 -0
- package/lib/organism/filter-range/index.d.ts.map +1 -0
- package/lib/organism/filter-range/index.js +108 -0
- package/lib/organism/filter-range/index.js.map +1 -0
- package/lib/organism/filter-range/prop-types.d.ts +40 -0
- package/lib/organism/filter-range/prop-types.d.ts.map +1 -0
- package/lib/organism/filter-range/prop-types.js +25 -0
- package/lib/organism/filter-range/prop-types.js.map +1 -0
- package/lib/organism/filter-range/style.css +15 -0
- package/lib/organism/filter-switch/index.d.ts +22 -0
- package/lib/organism/filter-switch/index.d.ts.map +1 -1
- package/lib/organism/filter-switch/index.js +18 -3
- package/lib/organism/filter-switch/index.js.map +1 -1
- package/lib/organism/filter-switch/prop-types.d.ts +2 -0
- package/lib/organism/filter-switch/prop-types.d.ts.map +1 -1
- package/lib/organism/filter-switch/prop-types.js +2 -1
- package/lib/organism/filter-switch/prop-types.js.map +1 -1
- package/lib/organism/list-item/index.d.ts +1 -0
- package/lib/organism/list-items/index.d.ts +2 -0
- package/lib/organism/list-items/style.css +1 -1
- package/lib/organism/mooc-footer/style.css +2 -2
- 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/sidebar/style.css +3 -3
- package/lib/organism/title-and-input/index.d.ts +1 -0
- package/lib/organism/title-and-input/index.d.ts.map +1 -1
- package/lib/organism/title-and-input/types.d.ts +1 -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/activity/stars-summary.css +2 -2
- 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 +11 -0
- package/lib/template/app-player/popin-end/summary.d.ts +9 -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 +28 -0
- package/lib/template/back-office/brand-update/utils.d.ts +1 -1
- package/lib/template/common/dashboard/index.d.ts +4 -0
- package/lib/template/common/search-page/index.d.ts +106 -21
- package/lib/template/common/search-page/index.d.ts.map +1 -1
- package/lib/template/common/search-page/index.js +75 -20
- package/lib/template/common/search-page/index.js.map +1 -1
- package/lib/template/common/search-page/style.css +52 -4
- package/lib/template/external-course/index.d.ts +2 -0
- package/lib/template/my-learning/index.d.ts +9 -0
- package/lib/template/teams-dashboard/index.d.ts +9 -0
- package/lib/util/external-content.js +2 -2
- package/lib/util/external-content.js.map +1 -1
- package/lib/variables/colors.css +6 -6
- package/lib/variables/colors.d.ts +5 -4
- package/lib/variables/colors.d.ts.map +1 -1
- package/lib/variables/colors.js +5 -4
- package/lib/variables/colors.js.map +1 -1
- package/locales/cs/global.json +1 -1
- package/locales/de/global.json +1 -1
- package/locales/et/global.json +1 -1
- package/locales/fi/global.json +1 -1
- package/locales/fr/global.json +1 -1
- package/locales/hu/global.json +1 -1
- package/locales/hy/global.json +1 -1
- package/locales/ja/global.json +1 -1
- package/locales/ko/global.json +1 -1
- package/locales/lt/global.json +1 -1
- package/locales/pl/global.json +1 -1
- package/locales/ro/global.json +1 -1
- package/locales/ru/global.json +1 -1
- package/locales/sk/global.json +1 -1
- package/locales/sv/global.json +1 -1
- package/locales/uk/global.json +1 -1
- package/locales/vi/global.json +1 -1
- package/locales/zh/global.json +1 -1
- package/locales/zh_TW/global.json +1 -1
- package/package.json +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@value colors: "../../variables/colors.css";
|
|
2
|
-
@value
|
|
2
|
+
@value lightMediumGrey from colors;
|
|
3
3
|
@value brand from colors;
|
|
4
4
|
@value white from colors;
|
|
5
5
|
@value lightDark from colors;
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
border-radius: 4px;
|
|
120
120
|
border: solid 1px light;
|
|
121
121
|
background-color: white;
|
|
122
|
-
border-left: 4px solid
|
|
122
|
+
border-left: 4px solid lightMediumGrey;
|
|
123
123
|
color: black;
|
|
124
124
|
text-decoration: none;
|
|
125
125
|
display: flex;
|
|
@@ -173,7 +173,7 @@
|
|
|
173
173
|
border-radius: 50%;
|
|
174
174
|
width: 40px;
|
|
175
175
|
height: 40px;
|
|
176
|
-
background-color:
|
|
176
|
+
background-color: lightMediumGrey;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
.choice:hover .choiceLeftIconWrapper {
|
|
@@ -37,6 +37,7 @@ declare const MultiFilterPanel: {
|
|
|
37
37
|
count: import("prop-types").Requireable<number>;
|
|
38
38
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
39
39
|
}> | null | undefined)[]>;
|
|
40
|
+
emptySearchResult: import("prop-types").Requireable<string>;
|
|
40
41
|
searchOptions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
41
42
|
value: import("prop-types").Requireable<string>;
|
|
42
43
|
placeholder: import("prop-types").Validator<string>;
|
|
@@ -63,12 +64,53 @@ declare const MultiFilterPanel: {
|
|
|
63
64
|
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
64
65
|
theme: import("prop-types").Validator<string>;
|
|
65
66
|
ariaLabel: import("prop-types").Validator<string>;
|
|
67
|
+
id: import("prop-types").Requireable<string>;
|
|
66
68
|
}> | null | undefined)[]>;
|
|
67
69
|
}>>;
|
|
70
|
+
}> | import("prop-types").InferProps<{
|
|
71
|
+
type: import("prop-types").Requireable<string>;
|
|
72
|
+
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
73
|
+
title: import("prop-types").Validator<string>;
|
|
74
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
75
|
+
onClear: import("prop-types").Validator<(...args: any[]) => any>;
|
|
76
|
+
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
77
|
+
label: import("prop-types").Validator<string>;
|
|
78
|
+
min: import("prop-types").Validator<number>;
|
|
79
|
+
max: import("prop-types").Validator<number>;
|
|
80
|
+
step: import("prop-types").Requireable<number>;
|
|
81
|
+
value: import("prop-types").Requireable<(number | null | undefined)[]>;
|
|
82
|
+
minLabel: import("prop-types").Requireable<string>;
|
|
83
|
+
maxLabel: import("prop-types").Requireable<string>;
|
|
84
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
85
|
+
theme: import("prop-types").Requireable<string>;
|
|
86
|
+
selected: import("prop-types").Requireable<boolean>;
|
|
87
|
+
}>>;
|
|
88
|
+
}>>;
|
|
68
89
|
}> | null | undefined> | null | undefined)[]>;
|
|
69
90
|
};
|
|
70
91
|
contextTypes: {
|
|
71
92
|
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
93
|
+
skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
94
|
+
common: import("prop-types").Requireable<{
|
|
95
|
+
[x: string]: any;
|
|
96
|
+
}>;
|
|
97
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
98
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
99
|
+
logo: import("prop-types").Requireable<any>;
|
|
100
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
101
|
+
login: import("prop-types").Requireable<any>;
|
|
102
|
+
}>>;
|
|
103
|
+
icons: import("prop-types").Requireable<{
|
|
104
|
+
[x: string]: any;
|
|
105
|
+
}>;
|
|
106
|
+
mod: import("prop-types").Requireable<{
|
|
107
|
+
[x: string]: any;
|
|
108
|
+
}>;
|
|
109
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
110
|
+
texts: import("prop-types").Requireable<{
|
|
111
|
+
[x: string]: any;
|
|
112
|
+
}>;
|
|
113
|
+
}>>;
|
|
72
114
|
};
|
|
73
115
|
};
|
|
74
116
|
export default MultiFilterPanel;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAWjE,OAAkB,EAAC,qBAAqB,EAAqB,MAAM,cAAc,CAAC;AAuDlF,QAAA,MAAM,gBAAgB;YAAW,qBAAqB,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6DhF,CAAC;AASF,eAAe,gBAAgB,CAAC"}
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
exports.__esModule = true;
|
|
4
4
|
exports.default = void 0;
|
|
5
|
+
var _noop2 = _interopRequireDefault(require("lodash/fp/noop"));
|
|
6
|
+
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
5
7
|
var _toString2 = _interopRequireDefault(require("lodash/fp/toString"));
|
|
6
8
|
var _flatMap2 = _interopRequireDefault(require("lodash/fp/flatMap"));
|
|
7
9
|
var _filter2 = _interopRequireDefault(require("lodash/fp/filter"));
|
|
@@ -9,6 +11,7 @@ var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
|
9
11
|
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
10
12
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
11
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
|
+
var _cssColorFunction = require("css-color-function");
|
|
12
15
|
var _filterChip = _interopRequireDefault(require("../../organism/filter-chip"));
|
|
13
16
|
var _filterCheckboxAndSearch = _interopRequireDefault(require("../../organism/filter-checkbox-and-search"));
|
|
14
17
|
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
@@ -18,6 +21,7 @@ var _provider = _interopRequireWildcard(require("../../atom/provider"));
|
|
|
18
21
|
var _chip = _interopRequireDefault(require("../../atom/chip"));
|
|
19
22
|
var _colors = require("../../variables/colors");
|
|
20
23
|
var _filterSwitch = _interopRequireDefault(require("../../organism/filter-switch"));
|
|
24
|
+
var _filterRange = _interopRequireDefault(require("../../organism/filter-range"));
|
|
21
25
|
var _style = _interopRequireDefault(require("./style.css"));
|
|
22
26
|
var _propTypes = _interopRequireDefault(require("./prop-types"));
|
|
23
27
|
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); }
|
|
@@ -27,10 +31,6 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
|
|
|
27
31
|
const uncappedMap = _map2.default.convert({
|
|
28
32
|
cap: false
|
|
29
33
|
});
|
|
30
|
-
const CLEAR_ALL_BUTTON_STYLE = {
|
|
31
|
-
fontWeight: 'normal',
|
|
32
|
-
padding: 0
|
|
33
|
-
};
|
|
34
34
|
const FilterSeparator = /*#__PURE__*/_react.default.createElement("div", {
|
|
35
35
|
className: _style.default.filterSeparator
|
|
36
36
|
});
|
|
@@ -46,8 +46,8 @@ const buildFilters = filterOptions => {
|
|
|
46
46
|
return /*#__PURE__*/_react.default.createElement(_filterCheckboxAndSearch.default, options);
|
|
47
47
|
case 'switch':
|
|
48
48
|
return /*#__PURE__*/_react.default.createElement(_filterSwitch.default, options);
|
|
49
|
-
|
|
50
|
-
return
|
|
49
|
+
case 'range':
|
|
50
|
+
return /*#__PURE__*/_react.default.createElement(_filterRange.default, options);
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
53
|
const buildAllSelectedFilterChips = (selectedFilters, onRemoveSelectedFilter) => {
|
|
@@ -59,7 +59,7 @@ const buildAllSelectedFilterChips = (selectedFilters, onRemoveSelectedFilter) =>
|
|
|
59
59
|
label
|
|
60
60
|
} = filterItem;
|
|
61
61
|
function handleClick() {
|
|
62
|
-
return onRemoveSelectedFilter(
|
|
62
|
+
return onRemoveSelectedFilter(filterItem);
|
|
63
63
|
}
|
|
64
64
|
return /*#__PURE__*/_react.default.createElement(_chip.default, {
|
|
65
65
|
key: label,
|
|
@@ -76,11 +76,15 @@ const buildAllSelectedFilterChips = (selectedFilters, onRemoveSelectedFilter) =>
|
|
|
76
76
|
}));
|
|
77
77
|
};
|
|
78
78
|
const MultiFilterPanel = (props, context) => {
|
|
79
|
+
const {
|
|
80
|
+
skin
|
|
81
|
+
} = context;
|
|
82
|
+
const primaryColor = (0, _getOr2.default)(_colors.COLORS.cm_primary_blue, 'common.primary', skin);
|
|
79
83
|
const {
|
|
80
84
|
title,
|
|
81
85
|
onClearAll,
|
|
82
86
|
options,
|
|
83
|
-
onRemoveSelectedFilter =
|
|
87
|
+
onRemoveSelectedFilter = _noop2.default
|
|
84
88
|
} = props;
|
|
85
89
|
const translate = (0, _provider.GetTranslateFromContext)(context);
|
|
86
90
|
const allSelectedFilters = (0, _pipe2.default)((0, _map2.default)('options'), (0, _flatMap2.default)('options'), (0, _filter2.default)(filterOptions => filterOptions.selected || filterOptions.value === true))(options);
|
|
@@ -93,31 +97,40 @@ const MultiFilterPanel = (props, context) => {
|
|
|
93
97
|
}, options);
|
|
94
98
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", {
|
|
95
99
|
className: _style.default.header
|
|
96
|
-
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
100
|
+
}, hasSelectedFilters ? /*#__PURE__*/_react.default.createElement("div", {
|
|
97
101
|
className: _style.default.titleContainer
|
|
98
102
|
}, /*#__PURE__*/_react.default.createElement(_title.default, {
|
|
99
103
|
title: title,
|
|
100
104
|
type: "form-group",
|
|
101
105
|
titleSize: "standard-light-weight"
|
|
102
|
-
}),
|
|
106
|
+
}), /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
103
107
|
label: (0, _toString2.default)((0, _size2.default)(allSelectedFilters)),
|
|
104
108
|
type: "info",
|
|
105
|
-
size: "S"
|
|
106
|
-
|
|
109
|
+
size: "S",
|
|
110
|
+
customStyle: {
|
|
111
|
+
color: primaryColor,
|
|
112
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primaryColor} lightness(92%))`)
|
|
113
|
+
}
|
|
114
|
+
})) : null, hasSelectedFilters ? /*#__PURE__*/_react.default.createElement("div", {
|
|
107
115
|
className: _style.default.buttonContainer
|
|
108
116
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
109
|
-
customStyle:
|
|
117
|
+
customStyle: {
|
|
118
|
+
fontWeight: 'normal',
|
|
119
|
+
padding: 0,
|
|
120
|
+
color: primaryColor
|
|
121
|
+
},
|
|
110
122
|
label: translate('clear_all'),
|
|
111
123
|
type: "text",
|
|
112
124
|
"data-name": "filters-all-clear-button",
|
|
113
125
|
"aria-label": "filters all clear button",
|
|
114
126
|
onClick: onClearAll,
|
|
115
127
|
hoverColor: _colors.COLORS.primary_600
|
|
116
|
-
})) : null),
|
|
128
|
+
})) : null), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement("div", null, buildAllSelectedFilterChips(allSelectedFilters, onRemoveSelectedFilter)), FilterSeparator) : null, filters);
|
|
117
129
|
};
|
|
118
130
|
MultiFilterPanel.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
119
131
|
MultiFilterPanel.contextTypes = {
|
|
120
|
-
translate: _provider.default.childContextTypes.translate
|
|
132
|
+
translate: _provider.default.childContextTypes.translate,
|
|
133
|
+
skin: _provider.default.childContextTypes.skin
|
|
121
134
|
};
|
|
122
135
|
var _default = exports.default = MultiFilterPanel;
|
|
123
136
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_filterChip","_filterCheckboxAndSearch","_title","_tag","_buttonLink","_provider","_interopRequireWildcard","_chip","_colors","_filterSwitch","_style","_propTypes","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","uncappedMap","_map2","convert","cap","CLEAR_ALL_BUTTON_STYLE","fontWeight","padding","FilterSeparator","createElement","className","style","filterSeparator","buildFilters","filterOptions","type","options","buildAllSelectedFilterChips","selectedFilters","onRemoveSelectedFilter","selectedFiltersContainer","map","filterItem","label","handleClick","key","onClick","text","textColor","COLORS","neutral_500","backgroundColor","cm_grey_150","customIcon","customStyle","height","MultiFilterPanel","props","context","title","onClearAll","translate","GetTranslateFromContext","allSelectedFilters","_pipe2","_flatMap2","_filter2","selected","value","hasSelectedFilters","_size2","filters","isLastItem","Fragment","header","titleContainer","titleSize","_toString2","size","buttonContainer","hoverColor","primary_600","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"sourcesContent":["import React from 'react';\nimport {map, size, pipe, filter, flatMap, toString} from 'lodash/fp';\nimport FilterChip from '../../organism/filter-chip';\nimport FilterCheckboxAndSearch from '../../organism/filter-checkbox-and-search';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport Chip from '../../atom/chip';\nimport {COLORS} from '../../variables/colors';\nimport FilterSwitch from '../../organism/filter-switch';\nimport {FilterCheckboxAndSearchOptions} from '../../organism/filter-checkbox-and-search/props-types';\nimport {FilterChipOptionsProps} from '../../organism/filter-chip/prop-types';\nimport {FilterSwitchOptionsProps} from '../../organism/filter-switch/prop-types';\nimport style from './style.css';\nimport propTypes, {MultiFilterPanelProps, FilterOptionsProps} from './prop-types';\n\ntype SelectedFilter =\n | FilterChipOptionsProps\n | FilterSwitchOptionsProps\n | FilterCheckboxAndSearchOptions;\n\n// @ts-expect-error convert is not recognized by the types\nconst uncappedMap = map.convert({cap: false});\n\nconst CLEAR_ALL_BUTTON_STYLE = {fontWeight: 'normal', padding: 0};\nconst FilterSeparator = <div className={style.filterSeparator} />;\n\nconst buildFilters = (filterOptions: FilterOptionsProps) => {\n const {type, options} = filterOptions;\n switch (type) {\n case 'chip':\n return <FilterChip {...options} />;\n case 'checkbox':\n return <FilterCheckboxAndSearch {...options} />;\n case 'switch':\n return <FilterSwitch {...options} />;\n default:\n return null;\n }\n};\n\nconst buildAllSelectedFilterChips = (\n selectedFilters: SelectedFilter[],\n onRemoveSelectedFilter: (label: string) => void\n) => {\n return (\n <div className={style.selectedFiltersContainer} data-testid=\"selected-filters-container\">\n {selectedFilters.map((filterItem: SelectedFilter) => {\n const {label} = filterItem;\n\n function handleClick() {\n return onRemoveSelectedFilter(label);\n }\n\n return (\n <Chip\n key={label}\n onClick={handleClick}\n text={label}\n textColor={COLORS.neutral_500}\n backgroundColor={COLORS.cm_grey_150}\n customIcon={'xmark'}\n customStyle={{height: '28px', padding: '4px 8px'}}\n />\n );\n })}\n </div>\n );\n};\n\nconst MultiFilterPanel = (props: MultiFilterPanelProps, context: WebContextValues) => {\n const {title, onClearAll, options, onRemoveSelectedFilter = false} = props;\n const translate = GetTranslateFromContext(context);\n const allSelectedFilters: SelectedFilter[] = pipe(\n map('options'),\n flatMap('options'),\n filter(filterOptions => filterOptions.selected || filterOptions.value === true)\n )(options);\n const hasSelectedFilters = size(allSelectedFilters) > 0;\n const filters = uncappedMap((filterOptions: FilterOptionsProps, i: number) => {\n const isLastItem = i + 1 === size(options);\n\n return (\n <div key={i}>\n {buildFilters(filterOptions)}\n {isLastItem ? null : FilterSeparator}\n </div>\n );\n }, options);\n return (\n <>\n <div className={style.header}>\n <div className={style.titleContainer}>\n <Title title={title} type=\"form-group\" titleSize=\"standard-light-weight\" />\n {hasSelectedFilters ? (\n <Tag label={toString(size(allSelectedFilters))} type=\"info\" size=\"S\" />\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <div className={style.buttonContainer}>\n <ButtonLink\n customStyle={CLEAR_ALL_BUTTON_STYLE}\n label={translate('clear_all')}\n type=\"text\"\n data-name=\"filters-all-clear-button\"\n aria-label=\"filters all clear button\"\n onClick={onClearAll}\n hoverColor={COLORS.primary_600}\n />\n </div>\n ) : null}\n </div>\n {onRemoveSelectedFilter && hasSelectedFilters ? (\n <>\n <div>{buildAllSelectedFilterChips(allSelectedFilters, onRemoveSelectedFilter)}</div>\n {FilterSeparator}\n </>\n ) : null}\n {filters}\n </>\n );\n};\n\nMultiFilterPanel.propTypes = propTypes;\n\nMultiFilterPanel.contextTypes = {\n translate: Provider.childContextTypes.translate\n};\n\nexport default MultiFilterPanel;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,wBAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,IAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,WAAA,GAAAN,sBAAA,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AAW,CAAE;IAC9B1B,IAAI,EAAC,MAAM;IACX,aAAU,0BAA0B;IACpC,cAAW,0BAA0B;IACrCW,OAAO,EAAEc,UAAW;IACpBoB,UAAU,EAAE/B,cAAM,CAACgC;EAAY,CAChC,CACE,CAAC,GACJ,IACD,CAAC,EACL1C,sBAAsB,IAAI8B,kBAAkB,gBAC3CnF,MAAA,CAAAqB,OAAA,CAAAsB,aAAA,CAAA3C,MAAA,CAAAqB,OAAA,CAAAkE,QAAA,qBACEvF,MAAA,CAAAqB,OAAA,CAAAsB,aAAA,cAAMQ,2BAA2B,CAAC0B,kBAAkB,EAAExB,sBAAsB,CAAO,CAAC,EACnFX,eACD,CAAC,GACD,IAAI,EACP2C,OACD,CAAC;AAEP,CAAC;AAEDf,gBAAgB,CAAC0B,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,kBAAS;AAEtC1B,gBAAgB,CAAC8B,YAAY,GAAG;EAC9BzB,SAAS,EAAE0B,iBAAQ,CAACC,iBAAiB,CAAC3B;AACxC,CAAC;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAEaiD,gBAAgB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_cssColorFunction","_filterChip","_filterCheckboxAndSearch","_title","_tag","_buttonLink","_provider","_interopRequireWildcard","_chip","_colors","_filterSwitch","_filterRange","_style","_propTypes","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","uncappedMap","_map2","convert","cap","FilterSeparator","createElement","className","style","filterSeparator","buildFilters","filterOptions","type","options","buildAllSelectedFilterChips","selectedFilters","onRemoveSelectedFilter","selectedFiltersContainer","map","filterItem","label","handleClick","key","onClick","text","textColor","COLORS","neutral_500","backgroundColor","cm_grey_150","customIcon","customStyle","height","padding","MultiFilterPanel","props","context","skin","primaryColor","_getOr2","cm_primary_blue","title","onClearAll","_noop2","translate","GetTranslateFromContext","allSelectedFilters","_pipe2","_flatMap2","_filter2","selected","value","hasSelectedFilters","_size2","filters","isLastItem","Fragment","header","titleContainer","titleSize","_toString2","size","color","buttonContainer","fontWeight","hoverColor","primary_600","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default","exports"],"sources":["../../../src/molecule/multi-filter-panel/index.tsx"],"sourcesContent":["import React from 'react';\nimport {map, size, pipe, filter, flatMap, toString, getOr, noop} from 'lodash/fp';\nimport {convert} from 'css-color-function';\nimport FilterChip from '../../organism/filter-chip';\nimport FilterCheckboxAndSearch from '../../organism/filter-checkbox-and-search';\nimport Title from '../../atom/title';\nimport Tag from '../../atom/tag';\nimport ButtonLink from '../../atom/button-link';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Provider, {GetTranslateFromContext} from '../../atom/provider';\nimport Chip from '../../atom/chip';\nimport {COLORS} from '../../variables/colors';\nimport FilterSwitch from '../../organism/filter-switch';\nimport FilterRange from '../../organism/filter-range';\nimport {FilterCheckboxAndSearchOptions} from '../../organism/filter-checkbox-and-search/props-types';\nimport {FilterChipOptionsProps} from '../../organism/filter-chip/prop-types';\nimport {FilterSwitchOptionsProps} from '../../organism/filter-switch/prop-types';\nimport {FilterRangeOptionsProps} from '../../organism/filter-range/prop-types';\nimport style from './style.css';\nimport propTypes, {MultiFilterPanelProps, FilterOptionsProps} from './prop-types';\n\ntype SelectedFilter =\n | FilterChipOptionsProps\n | FilterSwitchOptionsProps\n | FilterCheckboxAndSearchOptions\n | FilterRangeOptionsProps;\n\n// @ts-expect-error convert is not recognized by the types\nconst uncappedMap = map.convert({cap: false});\n\nconst FilterSeparator = <div className={style.filterSeparator} />;\n\nconst buildFilters = (filterOptions: FilterOptionsProps) => {\n const {type, options} = filterOptions;\n switch (type) {\n case 'chip':\n return <FilterChip {...options} />;\n case 'checkbox':\n return <FilterCheckboxAndSearch {...options} />;\n case 'switch':\n return <FilterSwitch {...options} />;\n case 'range':\n return <FilterRange {...options} />;\n }\n};\n\nconst buildAllSelectedFilterChips = (\n selectedFilters: SelectedFilter[],\n onRemoveSelectedFilter: (filterItem: SelectedFilter) => void\n) => {\n return (\n <div className={style.selectedFiltersContainer} data-testid=\"selected-filters-container\">\n {selectedFilters.map((filterItem: SelectedFilter) => {\n const {label} = filterItem;\n function handleClick() {\n return onRemoveSelectedFilter(filterItem);\n }\n\n return (\n <Chip\n key={label}\n onClick={handleClick}\n text={label}\n textColor={COLORS.neutral_500}\n backgroundColor={COLORS.cm_grey_150}\n customIcon={'xmark'}\n customStyle={{height: '28px', padding: '4px 8px'}}\n />\n );\n })}\n </div>\n );\n};\n\nconst MultiFilterPanel = (props: MultiFilterPanelProps, context: WebContextValues) => {\n const {skin} = context;\n const primaryColor = getOr(COLORS.cm_primary_blue, 'common.primary', skin);\n const {title, onClearAll, options, onRemoveSelectedFilter = noop} = props;\n const translate = GetTranslateFromContext(context);\n const allSelectedFilters: SelectedFilter[] = pipe(\n map('options'),\n flatMap('options'),\n filter(filterOptions => filterOptions.selected || filterOptions.value === true)\n )(options);\n const hasSelectedFilters = size(allSelectedFilters) > 0;\n const filters = uncappedMap((filterOptions: FilterOptionsProps, i: number) => {\n const isLastItem = i + 1 === size(options);\n\n return (\n <div key={i}>\n {buildFilters(filterOptions)}\n {isLastItem ? null : FilterSeparator}\n </div>\n );\n }, options);\n return (\n <>\n <div className={style.header}>\n {hasSelectedFilters ? (\n <div className={style.titleContainer}>\n <Title title={title} type=\"form-group\" titleSize=\"standard-light-weight\" />\n <Tag\n label={toString(size(allSelectedFilters))}\n type=\"info\"\n size=\"S\"\n customStyle={{\n color: primaryColor,\n backgroundColor: convert(`color(${primaryColor} lightness(92%))`)\n }}\n />\n </div>\n ) : null}\n {hasSelectedFilters ? (\n <div className={style.buttonContainer}>\n <ButtonLink\n customStyle={{fontWeight: 'normal', padding: 0, color: primaryColor}}\n label={translate('clear_all')}\n type=\"text\"\n data-name=\"filters-all-clear-button\"\n aria-label=\"filters all clear button\"\n onClick={onClearAll}\n hoverColor={COLORS.primary_600}\n />\n </div>\n ) : null}\n </div>\n {hasSelectedFilters ? (\n <>\n <div>{buildAllSelectedFilterChips(allSelectedFilters, onRemoveSelectedFilter)}</div>\n {FilterSeparator}\n </>\n ) : null}\n {filters}\n </>\n );\n};\n\nMultiFilterPanel.propTypes = propTypes;\n\nMultiFilterPanel.contextTypes = {\n translate: Provider.childContextTypes.translate,\n skin: Provider.childContextTypes.skin\n};\n\nexport default MultiFilterPanel;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,wBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,MAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,IAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,WAAA,GAAAP,sBAAA,CAAAC,OAAA;AAEA,IAAAO,SAAA,GAAAC,uBAAA,CAAAR,OAAA;AACA,IAAAS,KAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,OAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,YAAA,GAAAb,sBAAA,CAAAC,OAAA;AAKA,IAAAa,MAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,UAAA,GAAAf,sBAAA,CAAAC,OAAA;AAAkF,SAAAe,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,SAAAR,wBAAAQ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAA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E,CAAC,GACJ,IACD,CAAC,EACLd,kBAAkB,gBACjBxF,MAAA,CAAAuB,OAAA,CAAAmB,aAAA,CAAA1C,MAAA,CAAAuB,OAAA,CAAAqE,QAAA,qBACE5F,MAAA,CAAAuB,OAAA,CAAAmB,aAAA,cAAMQ,2BAA2B,CAACgC,kBAAkB,EAAE9B,sBAAsB,CAAO,CAAC,EACnFX,eACD,CAAC,GACD,IAAI,EACPiD,OACD,CAAC;AAEP,CAAC;AAEDpB,gBAAgB,CAACiC,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,kBAAS;AAEtCjC,gBAAgB,CAACqC,YAAY,GAAG;EAC9B3B,SAAS,EAAE4B,iBAAQ,CAACC,iBAAiB,CAAC7B,SAAS;EAC/CP,IAAI,EAAEmC,iBAAQ,CAACC,iBAAiB,CAACpC;AACnC,CAAC;AAAC,IAAAqC,QAAA,GAAAC,OAAA,CAAAxF,OAAA,GAEa+C,gBAAgB","ignoreList":[]}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import PropTypes from 'prop-types';
|
|
2
|
-
import { FilterChipProps } from '../../organism/filter-chip/prop-types';
|
|
3
|
-
import { FilterCheckboxAndSearchProps } from '../../organism/filter-checkbox-and-search/props-types';
|
|
4
|
-
import { FilterSwitchProps } from '../../organism/filter-switch/prop-types';
|
|
2
|
+
import { FilterChipOptionsProps, FilterChipProps } from '../../organism/filter-chip/prop-types';
|
|
3
|
+
import { FilterCheckboxAndSearchOptions, FilterCheckboxAndSearchProps } from '../../organism/filter-checkbox-and-search/props-types';
|
|
4
|
+
import { FilterSwitchOptionsProps, FilterSwitchProps } from '../../organism/filter-switch/prop-types';
|
|
5
|
+
import { FilterRangeProps, FilterRangeOptionsProps } from '../../organism/filter-range/prop-types';
|
|
5
6
|
declare const propTypes: {
|
|
6
7
|
title: PropTypes.Requireable<string>;
|
|
7
8
|
onClearAll: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -36,6 +37,7 @@ declare const propTypes: {
|
|
|
36
37
|
count: PropTypes.Requireable<number>;
|
|
37
38
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
38
39
|
}> | null | undefined)[]>;
|
|
40
|
+
emptySearchResult: PropTypes.Requireable<string>;
|
|
39
41
|
searchOptions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
40
42
|
value: PropTypes.Requireable<string>;
|
|
41
43
|
placeholder: PropTypes.Validator<string>;
|
|
@@ -62,8 +64,28 @@ declare const propTypes: {
|
|
|
62
64
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
63
65
|
theme: PropTypes.Validator<string>;
|
|
64
66
|
ariaLabel: PropTypes.Validator<string>;
|
|
67
|
+
id: PropTypes.Requireable<string>;
|
|
65
68
|
}> | null | undefined)[]>;
|
|
66
69
|
}>>;
|
|
70
|
+
}> | PropTypes.InferProps<{
|
|
71
|
+
type: PropTypes.Requireable<string>;
|
|
72
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
73
|
+
title: PropTypes.Validator<string>;
|
|
74
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
75
|
+
onClear: PropTypes.Validator<(...args: any[]) => any>;
|
|
76
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
77
|
+
label: PropTypes.Validator<string>;
|
|
78
|
+
min: PropTypes.Validator<number>;
|
|
79
|
+
max: PropTypes.Validator<number>;
|
|
80
|
+
step: PropTypes.Requireable<number>;
|
|
81
|
+
value: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
82
|
+
minLabel: PropTypes.Requireable<string>;
|
|
83
|
+
maxLabel: PropTypes.Requireable<string>;
|
|
84
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
85
|
+
theme: PropTypes.Requireable<string>;
|
|
86
|
+
selected: PropTypes.Requireable<boolean>;
|
|
87
|
+
}>>;
|
|
88
|
+
}>>;
|
|
67
89
|
}> | null | undefined> | null | undefined)[]>;
|
|
68
90
|
};
|
|
69
91
|
export declare type OptionsChipProps = {
|
|
@@ -78,10 +100,15 @@ export declare type OptionsSwitchProps = {
|
|
|
78
100
|
type: 'switch';
|
|
79
101
|
options: FilterSwitchProps;
|
|
80
102
|
};
|
|
81
|
-
export declare type
|
|
103
|
+
export declare type OptionsRangeProps = {
|
|
104
|
+
type: 'range';
|
|
105
|
+
options: FilterRangeProps;
|
|
106
|
+
};
|
|
107
|
+
export declare type FilterOptionsProps = OptionsChipProps | OptionsCheckboxProps | OptionsSwitchProps | OptionsRangeProps;
|
|
108
|
+
export declare type SelectedFilter = FilterChipOptionsProps | FilterSwitchOptionsProps | FilterCheckboxAndSearchOptions | FilterRangeOptionsProps;
|
|
82
109
|
export declare type MultiFilterPanelProps = {
|
|
83
110
|
title: string;
|
|
84
|
-
onRemoveSelectedFilter?: (
|
|
111
|
+
onRemoveSelectedFilter?: (filterItem: SelectedFilter) => void;
|
|
85
112
|
onClearAll: () => void;
|
|
86
113
|
options: FilterOptionsProps[];
|
|
87
114
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAA4B,
|
|
1
|
+
{"version":3,"file":"prop-types.d.ts","sourceRoot":"","sources":["../../../src/molecule/multi-filter-panel/prop-types.ts"],"names":[],"mappings":"AAAA,OAAO,SAAS,MAAM,YAAY,CAAC;AACnC,OAA4B,EAC1B,sBAAsB,EACtB,eAAe,EAChB,MAAM,uCAAuC,CAAC;AAC/C,OAAyC,EACvC,8BAA8B,EAC9B,4BAA4B,EAC7B,MAAM,uDAAuD,CAAC;AAC/D,OAA8B,EAC5B,wBAAwB,EACxB,iBAAiB,EAClB,MAAM,yCAAyC,CAAC;AACjD,OAA6B,EAC3B,gBAAgB,EAChB,uBAAuB,EACxB,MAAM,wCAAwC,CAAC;AAEhD,QAAA,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwBd,CAAC;AAEF,oBAAY,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,eAAe,CAAC;CAC1B,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,IAAI,EAAE,UAAU,CAAC;IACjB,OAAO,EAAE,4BAA4B,CAAC;CACvC,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,QAAQ,CAAC;IACf,OAAO,EAAE,iBAAiB,CAAC;CAC5B,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,gBAAgB,CAAC;CAC3B,CAAC;AAEF,oBAAY,kBAAkB,GAC1B,gBAAgB,GAChB,oBAAoB,GACpB,kBAAkB,GAClB,iBAAiB,CAAC;AAEtB,oBAAY,cAAc,GACtB,sBAAsB,GACtB,wBAAwB,GACxB,8BAA8B,GAC9B,uBAAuB,CAAC;AAE5B,oBAAY,qBAAqB,GAAG;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,CAAC,EAAE,CAAC,UAAU,EAAE,cAAc,KAAK,IAAI,CAAC;IAC9D,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,OAAO,EAAE,kBAAkB,EAAE,CAAC;CAC/B,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -6,6 +6,7 @@ var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
|
6
6
|
var _propTypes2 = _interopRequireDefault(require("../../organism/filter-chip/prop-types"));
|
|
7
7
|
var _propsTypes = _interopRequireDefault(require("../../organism/filter-checkbox-and-search/props-types"));
|
|
8
8
|
var _propTypes3 = _interopRequireDefault(require("../../organism/filter-switch/prop-types"));
|
|
9
|
+
var _propTypes4 = _interopRequireDefault(require("../../organism/filter-range/prop-types"));
|
|
9
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
11
|
const propTypes = {
|
|
11
12
|
title: _propTypes.default.string,
|
|
@@ -20,6 +21,9 @@ const propTypes = {
|
|
|
20
21
|
}), _propTypes.default.shape({
|
|
21
22
|
type: _propTypes.default.oneOf(['switch']),
|
|
22
23
|
options: _propTypes.default.shape(_propTypes3.default)
|
|
24
|
+
}), _propTypes.default.shape({
|
|
25
|
+
type: _propTypes.default.oneOf(['range']),
|
|
26
|
+
options: _propTypes.default.shape(_propTypes4.default)
|
|
23
27
|
})]))
|
|
24
28
|
};
|
|
25
29
|
var _default = exports.default = propTypes;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"prop-types.js","names":["_propTypes","_interopRequireDefault","require","_propTypes2","_propsTypes","_propTypes3","e","__esModule","default","propTypes","title","PropTypes","string","onClearAll","func","onRemoveSelectedFilter","options","arrayOf","oneOfType","shape","type","oneOf","filterChipProptypes","filterCheckboxAndSearchProptypes","filterSwitchProptypes","_default","exports"],"sources":["../../../src/molecule/multi-filter-panel/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport filterChipProptypes, {FilterChipProps} from '../../organism/filter-chip/prop-types';\nimport filterCheckboxAndSearchProptypes, {\n FilterCheckboxAndSearchProps\n} from '../../organism/filter-checkbox-and-search/props-types';\nimport filterSwitchProptypes, {FilterSwitchProps} from '../../organism/filter-switch/prop-types';\n\nconst propTypes = {\n title: PropTypes.string,\n onClearAll: PropTypes.func,\n onRemoveSelectedFilter: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.oneOf(['chip']),\n options: PropTypes.shape(filterChipProptypes)\n }),\n PropTypes.shape({\n type: PropTypes.oneOf(['checkbox']),\n options: PropTypes.shape(filterCheckboxAndSearchProptypes)\n }),\n PropTypes.shape({\n type: PropTypes.oneOf(['switch']),\n options: PropTypes.shape(filterSwitchProptypes)\n })\n ])\n )\n};\n\nexport type OptionsChipProps = {\n type: 'chip';\n options: FilterChipProps;\n};\n\nexport type OptionsCheckboxProps = {\n type: 'checkbox';\n options: FilterCheckboxAndSearchProps;\n};\n\nexport type OptionsSwitchProps = {\n type: 'switch';\n options: FilterSwitchProps;\n};\n\nexport type
|
|
1
|
+
{"version":3,"file":"prop-types.js","names":["_propTypes","_interopRequireDefault","require","_propTypes2","_propsTypes","_propTypes3","_propTypes4","e","__esModule","default","propTypes","title","PropTypes","string","onClearAll","func","onRemoveSelectedFilter","options","arrayOf","oneOfType","shape","type","oneOf","filterChipProptypes","filterCheckboxAndSearchProptypes","filterSwitchProptypes","filterRangeProptypes","_default","exports"],"sources":["../../../src/molecule/multi-filter-panel/prop-types.ts"],"sourcesContent":["import PropTypes from 'prop-types';\nimport filterChipProptypes, {\n FilterChipOptionsProps,\n FilterChipProps\n} from '../../organism/filter-chip/prop-types';\nimport filterCheckboxAndSearchProptypes, {\n FilterCheckboxAndSearchOptions,\n FilterCheckboxAndSearchProps\n} from '../../organism/filter-checkbox-and-search/props-types';\nimport filterSwitchProptypes, {\n FilterSwitchOptionsProps,\n FilterSwitchProps\n} from '../../organism/filter-switch/prop-types';\nimport filterRangeProptypes, {\n FilterRangeProps,\n FilterRangeOptionsProps\n} from '../../organism/filter-range/prop-types';\n\nconst propTypes = {\n title: PropTypes.string,\n onClearAll: PropTypes.func,\n onRemoveSelectedFilter: PropTypes.func,\n options: PropTypes.arrayOf(\n PropTypes.oneOfType([\n PropTypes.shape({\n type: PropTypes.oneOf(['chip']),\n options: PropTypes.shape(filterChipProptypes)\n }),\n PropTypes.shape({\n type: PropTypes.oneOf(['checkbox']),\n options: PropTypes.shape(filterCheckboxAndSearchProptypes)\n }),\n PropTypes.shape({\n type: PropTypes.oneOf(['switch']),\n options: PropTypes.shape(filterSwitchProptypes)\n }),\n PropTypes.shape({\n type: PropTypes.oneOf(['range']),\n options: PropTypes.shape(filterRangeProptypes)\n })\n ])\n )\n};\n\nexport type OptionsChipProps = {\n type: 'chip';\n options: FilterChipProps;\n};\n\nexport type OptionsCheckboxProps = {\n type: 'checkbox';\n options: FilterCheckboxAndSearchProps;\n};\n\nexport type OptionsSwitchProps = {\n type: 'switch';\n options: FilterSwitchProps;\n};\n\nexport type OptionsRangeProps = {\n type: 'range';\n options: FilterRangeProps;\n};\n\nexport type FilterOptionsProps =\n | OptionsChipProps\n | OptionsCheckboxProps\n | OptionsSwitchProps\n | OptionsRangeProps;\n\nexport type SelectedFilter =\n | FilterChipOptionsProps\n | FilterSwitchOptionsProps\n | FilterCheckboxAndSearchOptions\n | FilterRangeOptionsProps;\n\nexport type MultiFilterPanelProps = {\n title: string;\n onRemoveSelectedFilter?: (filterItem: SelectedFilter) => void;\n onClearAll: () => void;\n options: FilterOptionsProps[];\n};\n\nexport default propTypes;\n"],"mappings":";;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AAIA,IAAAE,WAAA,GAAAH,sBAAA,CAAAC,OAAA;AAIA,IAAAG,WAAA,GAAAJ,sBAAA,CAAAC,OAAA;AAIA,IAAAI,WAAA,GAAAL,sBAAA,CAAAC,OAAA;AAGgD,SAAAD,uBAAAM,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhD,MAAMG,SAAS,GAAG;EAChBC,KAAK,EAAEC,kBAAS,CAACC,MAAM;EACvBC,UAAU,EAAEF,kBAAS,CAACG,IAAI;EAC1BC,sBAAsB,EAAEJ,kBAAS,CAACG,IAAI;EACtCE,OAAO,EAAEL,kBAAS,CAACM,OAAO,CACxBN,kBAAS,CAACO,SAAS,CAAC,CAClBP,kBAAS,CAACQ,KAAK,CAAC;IACdC,IAAI,EAAET,kBAAS,CAACU,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;IAC/BL,OAAO,EAAEL,kBAAS,CAACQ,KAAK,CAACG,mBAAmB;EAC9C,CAAC,CAAC,EACFX,kBAAS,CAACQ,KAAK,CAAC;IACdC,IAAI,EAAET,kBAAS,CAACU,KAAK,CAAC,CAAC,UAAU,CAAC,CAAC;IACnCL,OAAO,EAAEL,kBAAS,CAACQ,KAAK,CAACI,mBAAgC;EAC3D,CAAC,CAAC,EACFZ,kBAAS,CAACQ,KAAK,CAAC;IACdC,IAAI,EAAET,kBAAS,CAACU,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC;IACjCL,OAAO,EAAEL,kBAAS,CAACQ,KAAK,CAACK,mBAAqB;EAChD,CAAC,CAAC,EACFb,kBAAS,CAACQ,KAAK,CAAC;IACdC,IAAI,EAAET,kBAAS,CAACU,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC;IAChCL,OAAO,EAAEL,kBAAS,CAACQ,KAAK,CAACM,mBAAoB;EAC/C,CAAC,CAAC,CACH,CACH;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAnB,OAAA,GAyCaC,SAAS","ignoreList":[]}
|
|
@@ -32,6 +32,12 @@ declare namespace QuestionRange {
|
|
|
32
32
|
onChange: PropTypes.Requireable<(...args: any[]) => any>;
|
|
33
33
|
onChangeEnd: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
34
|
multi: PropTypes.Requireable<boolean>;
|
|
35
|
+
theme: PropTypes.Requireable<string>;
|
|
36
|
+
min: PropTypes.Requireable<number>;
|
|
37
|
+
max: PropTypes.Requireable<number>;
|
|
38
|
+
step: PropTypes.Requireable<number>;
|
|
39
|
+
minValueLabel: PropTypes.Requireable<string>;
|
|
40
|
+
maxValueLabel: PropTypes.Requireable<string>;
|
|
35
41
|
HammerForTestingMin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
36
42
|
on: PropTypes.Requireable<(...args: any[]) => any>;
|
|
37
43
|
destroy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -42,7 +48,6 @@ declare namespace QuestionRange {
|
|
|
42
48
|
destroy: PropTypes.Requireable<(...args: any[]) => any>;
|
|
43
49
|
stop: PropTypes.Requireable<(...args: any[]) => any>;
|
|
44
50
|
}>>;
|
|
45
|
-
value: PropTypes.Requireable<NonNullable<number | (number | null | undefined)[] | null | undefined>>;
|
|
46
51
|
};
|
|
47
52
|
}
|
|
48
53
|
import PropTypes from "prop-types";
|
|
@@ -183,7 +183,9 @@ const QuickFilters = ({
|
|
|
183
183
|
wrapperSize: 20
|
|
184
184
|
},
|
|
185
185
|
"aria-label": ariaLabel
|
|
186
|
-
}), /*#__PURE__*/_react.default.createElement("span",
|
|
186
|
+
}), /*#__PURE__*/_react.default.createElement("span", {
|
|
187
|
+
className: _style.default.filterLabel
|
|
188
|
+
}, label), /*#__PURE__*/_react.default.createElement("div", {
|
|
187
189
|
className: _style.default.bar,
|
|
188
190
|
style: {
|
|
189
191
|
background: primarySkinColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_icon","_colors","_buttonLink","_provider","_style","_types","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","SCROLL_RIGHT_SIZE","SCROLL_LEFT_SIZE","handleScroll","direction","listRef","current","scrollBy","left","behavior","exports","getFilterButton","filterButtonProps","primarySkinColor","tag","rest","createElement","className","style","filterButtonWrapper","borderColor","label","filterButton","icon","position","faIcon","name","size","color","COLORS","cm_grey_700","neutral_500","customStyle","backgroundColor","undefined","borderRadius","QuickFilters","primaryOption","filterOptions","filterOptionsAriaLabel","context","skin","GetSkinFromContext","_get2","defaultLabel","defaultIconName","defaultSelected","defaultAriaLabel","onDefaultClick","filtersListRef","React","useRef","rightBtnRef","leftBtnRef","handleScrollRight","useCallback","handleScrollLeft","useEffect","list","rightButton","leftButton","update","rightArrowWidth","offsetWidth","showingRightButton","scrollLeft","clientWidth","scrollWidth","showingLeftButton","visibility","opacity","addEventListener","window","removeEventListener","filtersMainContainer","leftArrowButton","ref","onClick","height","filtersList","classNames","defaultOption","filterSelected","iconName","faSize","wrapperSize","filterLabel","bar","background","filterSeparator","filtersContainer","map","filterOption","idx","selected","value","ariaLabel","key","borderBottomColor","rightArrowButton","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default"],"sources":["../../../src/molecule/quick-filters/index.tsx"],"sourcesContent":["import React, {useCallback, useRef, useEffect} from 'react';\nimport classNames from 'classnames';\nimport {get} from 'lodash/fp';\nimport FaIcon from '../../atom/icon';\nimport {COLORS} from '../../variables/colors';\nimport ButtonLink from '../../atom/button-link';\nimport {ButtonLinkProps} from '../../atom/button-link/types';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport {QuickFiltersProps, propTypes} from './types';\n\nconst SCROLL_RIGHT_SIZE = 400;\nconst SCROLL_LEFT_SIZE = -400;\nexport const handleScroll = (direction: number, listRef: React.RefObject<HTMLDivElement>) => {\n if (listRef.current) {\n listRef.current.scrollBy({\n left: direction,\n behavior: 'smooth'\n });\n }\n};\n\nconst getFilterButton = (\n filterButtonProps: ButtonLinkProps | undefined,\n primarySkinColor: string\n) => {\n if (!filterButtonProps) return null;\n const {tag, ...rest} = filterButtonProps;\n return (\n <div\n className={style.filterButtonWrapper}\n style={{borderColor: tag?.label ? primarySkinColor : 'transparent'}}\n >\n <div className={style.filterButton}>\n <ButtonLink\n {...rest}\n icon={{\n position: 'left',\n faIcon: {\n name: 'sliders',\n size: 14,\n color: tag ? COLORS.cm_grey_700 : COLORS.neutral_500\n }\n }}\n tag={\n tag\n ? {\n label: tag.label,\n customStyle: {backgroundColor: primarySkinColor, color: '#FFFFFF'}\n }\n : undefined\n }\n className={style.filterButton}\n data-testid=\"open-filters-modal-button\"\n customStyle={{borderRadius: '12px'}}\n />\n </div>\n </div>\n );\n};\n\nconst QuickFilters = (\n {primaryOption, filterOptions, filterButton, filterOptionsAriaLabel}: QuickFiltersProps,\n context: WebContextValues\n) => {\n const skin = GetSkinFromContext(context);\n const primarySkinColor = get('common.primary', skin);\n const {defaultLabel, defaultIconName, defaultSelected, defaultAriaLabel, onDefaultClick} =\n primaryOption;\n const filtersListRef = React.useRef<HTMLDivElement>(null);\n const rightBtnRef = useRef<HTMLDivElement>(null);\n const leftBtnRef = useRef<HTMLDivElement>(null);\n\n const handleScrollRight = useCallback(() => {\n handleScroll(SCROLL_RIGHT_SIZE, filtersListRef);\n }, [filtersListRef]);\n const handleScrollLeft = useCallback(() => {\n handleScroll(SCROLL_LEFT_SIZE, filtersListRef);\n }, [filtersListRef]);\n useEffect(() => {\n const list = filtersListRef.current;\n const rightButton = rightBtnRef.current;\n const leftButton = leftBtnRef.current;\n /* istanbul ignore next */ // not testable without complex mocking useRef\n if (!list || !leftButton || !rightButton) return;\n\n const update = () => {\n const rightArrowWidth = rightButton.offsetWidth;\n const showingRightButton =\n list.scrollLeft + list.clientWidth < list.scrollWidth - rightArrowWidth;\n const showingLeftButton = list.scrollLeft > 0;\n rightButton.style.visibility = showingRightButton ? 'visible' : 'hidden';\n rightButton.style.opacity = showingRightButton ? '1' : '0';\n leftButton.style.visibility = showingLeftButton ? 'visible' : 'hidden';\n leftButton.style.opacity = showingLeftButton ? '1' : '0';\n };\n\n list.addEventListener('scroll', update);\n window.addEventListener('resize', update);\n update();\n return () => {\n list.removeEventListener('scroll', update);\n window.removeEventListener('resize', update);\n };\n }, [filterOptions]);\n\n return (\n <div className={style.filtersMainContainer} data-name=\"search\">\n <div className={style.leftArrowButton} ref={leftBtnRef} style={{visibility: 'hidden'}}>\n <ButtonLink\n icon={{position: 'left', faIcon: {name: 'arrow-left', size: 15}}}\n onClick={handleScrollLeft}\n className={style.leftArrowButton}\n customStyle={{height: '36px'}}\n data-testid=\"scroll-left-button\"\n />\n </div>\n <div\n className={style.filtersList}\n ref={filtersListRef}\n data-testid=\"filters-options-list\"\n aria-label={filterOptionsAriaLabel}\n >\n <div\n data-testid=\"all-option\"\n className={classNames(style.defaultOption, defaultSelected && style.filterSelected)}\n onClick={onDefaultClick}\n >\n <FaIcon\n iconName={defaultIconName}\n size={{faSize: 20, wrapperSize: 20}}\n aria-label={defaultAriaLabel}\n />\n <span className={style.filterLabel}>{defaultLabel}</span>\n <div className={style.bar} style={{background: primarySkinColor}} />\n </div>\n <div className={style.filterSeparator} />\n <div className={style.filtersContainer}>\n {filterOptions.map((filterOption, idx) => {\n const {iconName, label, selected, value, onClick, ariaLabel} = filterOption;\n return (\n <div\n key={idx}\n className={classNames(style.filterOption, selected && style.filterSelected)}\n data-testid={`filter-${value}-${idx}`}\n style={{borderBottomColor: primarySkinColor}}\n onClick={onClick}\n >\n <FaIcon\n iconName={iconName}\n size={{faSize: 20, wrapperSize: 20}}\n aria-label={ariaLabel}\n />\n <span>{label}</span>\n <div className={style.bar} style={{background: primarySkinColor}} />\n </div>\n );\n })}\n <div className={style.rightArrowButton} ref={rightBtnRef} style={{visibility: 'hidden'}}>\n <ButtonLink\n icon={{\n position: 'left',\n faIcon: {\n name: 'arrow-right',\n size: 15\n }\n }}\n className={style.rightArrowButton}\n onClick={handleScrollRight}\n customStyle={{height: '36px'}}\n data-testid=\"scroll-right-button\"\n />\n </div>\n </div>\n </div>\n {getFilterButton(filterButton, primarySkinColor)}\n </div>\n );\n};\n\nQuickFilters.propTypes = propTypes;\nQuickFilters.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nexport default QuickFilters;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,SAAA,GAAAP,uBAAA,C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EC,WAAW,EAAE;MAAE,CAAE;MACpC,cAAYW;IAAU,CACvB,CAAC,eACFpI,MAAA,CAAAiB,OAAA,CAAAmC,aAAA,eAAOK,KAAY,CAAC,eACpBzD,MAAA,CAAAiB,OAAA,CAAAmC,aAAA;MAAKC,SAAS,EAAEC,cAAK,CAACqE,GAAI;MAACrE,KAAK,EAAE;QAACsE,UAAU,EAAE3E;MAAgB;IAAE,CAAE,CAChE,CAAC;EAEV,CAAC,CAAC,eACFjD,MAAA,CAAAiB,OAAA,CAAAmC,aAAA;IAAKC,SAAS,EAAEC,cAAK,CAACiF,gBAAiB;IAACvB,GAAG,EAAExB,WAAY;IAAClC,KAAK,EAAE;MAACmD,UAAU,EAAE;IAAQ;EAAE,gBACtFzG,MAAA,CAAAiB,OAAA,CAAAmC,aAAA,CAAC7C,WAAA,CAAAU,OAAU;IACT0C,IAAI,EAAE;MACJC,QAAQ,EAAE,MAAM;MAChBC,MAAM,EAAE;QACNC,IAAI,EAAE,aAAa;QACnBC,IAAI,EAAE;MACR;IACF,CAAE;IACFV,SAAS,EAAEC,cAAK,CAACiF,gBAAiB;IAClCtB,OAAO,EAAEvB,iBAAkB;IAC3BtB,WAAW,EAAE;MAAC8C,MAAM,EAAE;IAAM,CAAE;IAC9B,eAAY;EAAqB,CAClC,CACE,CACF,CACF,CAAC,EACLnE,eAAe,CAACW,YAAY,EAAET,gBAAgB,CAC5C,CAAC;AAEV,CAAC;AAEDuB,YAAY,CAACgE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,gBAAS;AAClChE,YAAY,CAACoE,YAAY,GAAG;EAC1B/D,IAAI,EAAEgE,iBAAQ,CAACC,iBAAiB,CAACjE;AACnC,CAAC;AAAC,IAAAkE,QAAA,GAAAjG,OAAA,CAAA7B,OAAA,GACauD,YAAY","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_classnames","_interopRequireDefault","_icon","_colors","_buttonLink","_provider","_style","_types","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","_extends","assign","bind","arguments","length","apply","SCROLL_RIGHT_SIZE","SCROLL_LEFT_SIZE","handleScroll","direction","listRef","current","scrollBy","left","behavior","exports","getFilterButton","filterButtonProps","primarySkinColor","tag","rest","createElement","className","style","filterButtonWrapper","borderColor","label","filterButton","icon","position","faIcon","name","size","color","COLORS","cm_grey_700","neutral_500","customStyle","backgroundColor","undefined","borderRadius","QuickFilters","primaryOption","filterOptions","filterOptionsAriaLabel","context","skin","GetSkinFromContext","_get2","defaultLabel","defaultIconName","defaultSelected","defaultAriaLabel","onDefaultClick","filtersListRef","React","useRef","rightBtnRef","leftBtnRef","handleScrollRight","useCallback","handleScrollLeft","useEffect","list","rightButton","leftButton","update","rightArrowWidth","offsetWidth","showingRightButton","scrollLeft","clientWidth","scrollWidth","showingLeftButton","visibility","opacity","addEventListener","window","removeEventListener","filtersMainContainer","leftArrowButton","ref","onClick","height","filtersList","classNames","defaultOption","filterSelected","iconName","faSize","wrapperSize","filterLabel","bar","background","filterSeparator","filtersContainer","map","filterOption","idx","selected","value","ariaLabel","key","borderBottomColor","rightArrowButton","propTypes","process","env","NODE_ENV","contextTypes","Provider","childContextTypes","_default"],"sources":["../../../src/molecule/quick-filters/index.tsx"],"sourcesContent":["import React, {useCallback, useRef, useEffect} from 'react';\nimport classNames from 'classnames';\nimport {get} from 'lodash/fp';\nimport FaIcon from '../../atom/icon';\nimport {COLORS} from '../../variables/colors';\nimport ButtonLink from '../../atom/button-link';\nimport {ButtonLinkProps} from '../../atom/button-link/types';\nimport {WebContextValues} from '../../atom/provider/web-context';\nimport Provider, {GetSkinFromContext} from '../../atom/provider';\nimport style from './style.css';\nimport {QuickFiltersProps, propTypes} from './types';\n\nconst SCROLL_RIGHT_SIZE = 400;\nconst SCROLL_LEFT_SIZE = -400;\nexport const handleScroll = (direction: number, listRef: React.RefObject<HTMLDivElement>) => {\n if (listRef.current) {\n listRef.current.scrollBy({\n left: direction,\n behavior: 'smooth'\n });\n }\n};\n\nconst getFilterButton = (\n filterButtonProps: ButtonLinkProps | undefined,\n primarySkinColor: string\n) => {\n if (!filterButtonProps) return null;\n const {tag, ...rest} = filterButtonProps;\n return (\n <div\n className={style.filterButtonWrapper}\n style={{borderColor: tag?.label ? primarySkinColor : 'transparent'}}\n >\n <div className={style.filterButton}>\n <ButtonLink\n {...rest}\n icon={{\n position: 'left',\n faIcon: {\n name: 'sliders',\n size: 14,\n color: tag ? COLORS.cm_grey_700 : COLORS.neutral_500\n }\n }}\n tag={\n tag\n ? {\n label: tag.label,\n customStyle: {backgroundColor: primarySkinColor, color: '#FFFFFF'}\n }\n : undefined\n }\n className={style.filterButton}\n data-testid=\"open-filters-modal-button\"\n customStyle={{borderRadius: '12px'}}\n />\n </div>\n </div>\n );\n};\n\nconst QuickFilters = (\n {primaryOption, filterOptions, filterButton, filterOptionsAriaLabel}: QuickFiltersProps,\n context: WebContextValues\n) => {\n const skin = GetSkinFromContext(context);\n const primarySkinColor = get('common.primary', skin);\n const {defaultLabel, defaultIconName, defaultSelected, defaultAriaLabel, onDefaultClick} =\n primaryOption;\n const filtersListRef = React.useRef<HTMLDivElement>(null);\n const rightBtnRef = useRef<HTMLDivElement>(null);\n const leftBtnRef = useRef<HTMLDivElement>(null);\n\n const handleScrollRight = useCallback(() => {\n handleScroll(SCROLL_RIGHT_SIZE, filtersListRef);\n }, [filtersListRef]);\n const handleScrollLeft = useCallback(() => {\n handleScroll(SCROLL_LEFT_SIZE, filtersListRef);\n }, [filtersListRef]);\n useEffect(() => {\n const list = filtersListRef.current;\n const rightButton = rightBtnRef.current;\n const leftButton = leftBtnRef.current;\n /* istanbul ignore next */ // not testable without complex mocking useRef\n if (!list || !leftButton || !rightButton) return;\n\n const update = () => {\n const rightArrowWidth = rightButton.offsetWidth;\n const showingRightButton =\n list.scrollLeft + list.clientWidth < list.scrollWidth - rightArrowWidth;\n const showingLeftButton = list.scrollLeft > 0;\n rightButton.style.visibility = showingRightButton ? 'visible' : 'hidden';\n rightButton.style.opacity = showingRightButton ? '1' : '0';\n leftButton.style.visibility = showingLeftButton ? 'visible' : 'hidden';\n leftButton.style.opacity = showingLeftButton ? '1' : '0';\n };\n\n list.addEventListener('scroll', update);\n window.addEventListener('resize', update);\n update();\n return () => {\n list.removeEventListener('scroll', update);\n window.removeEventListener('resize', update);\n };\n }, [filterOptions]);\n\n return (\n <div className={style.filtersMainContainer} data-name=\"search\">\n <div className={style.leftArrowButton} ref={leftBtnRef} style={{visibility: 'hidden'}}>\n <ButtonLink\n icon={{position: 'left', faIcon: {name: 'arrow-left', size: 15}}}\n onClick={handleScrollLeft}\n className={style.leftArrowButton}\n customStyle={{height: '36px'}}\n data-testid=\"scroll-left-button\"\n />\n </div>\n <div\n className={style.filtersList}\n ref={filtersListRef}\n data-testid=\"filters-options-list\"\n aria-label={filterOptionsAriaLabel}\n >\n <div\n data-testid=\"all-option\"\n className={classNames(style.defaultOption, defaultSelected && style.filterSelected)}\n onClick={onDefaultClick}\n >\n <FaIcon\n iconName={defaultIconName}\n size={{faSize: 20, wrapperSize: 20}}\n aria-label={defaultAriaLabel}\n />\n <span className={style.filterLabel}>{defaultLabel}</span>\n <div className={style.bar} style={{background: primarySkinColor}} />\n </div>\n <div className={style.filterSeparator} />\n <div className={style.filtersContainer}>\n {filterOptions.map((filterOption, idx) => {\n const {iconName, label, selected, value, onClick, ariaLabel} = filterOption;\n return (\n <div\n key={idx}\n className={classNames(style.filterOption, selected && style.filterSelected)}\n data-testid={`filter-${value}-${idx}`}\n style={{borderBottomColor: primarySkinColor}}\n onClick={onClick}\n >\n <FaIcon\n iconName={iconName}\n size={{faSize: 20, wrapperSize: 20}}\n aria-label={ariaLabel}\n />\n <span className={style.filterLabel}>{label}</span>\n <div className={style.bar} style={{background: primarySkinColor}} />\n </div>\n );\n })}\n <div className={style.rightArrowButton} ref={rightBtnRef} style={{visibility: 'hidden'}}>\n <ButtonLink\n icon={{\n position: 'left',\n faIcon: {\n name: 'arrow-right',\n size: 15\n }\n }}\n className={style.rightArrowButton}\n onClick={handleScrollRight}\n customStyle={{height: '36px'}}\n data-testid=\"scroll-right-button\"\n />\n </div>\n </div>\n </div>\n {getFilterButton(filterButton, primarySkinColor)}\n </div>\n );\n};\n\nQuickFilters.propTypes = propTypes;\nQuickFilters.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\nexport default QuickFilters;\n"],"mappings":";;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,KAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAH,sBAAA,CAAAF,OAAA;AAGA,IAAAM,SAAA,GAAAP,uBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAL,sBAAA,CAAAF,OAAA;AACA,IAAAQ,MAAA,GAAAR,OAAA;AAAqD,SAAAS,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,SAAAX,wBAAAW,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAK,OAAA,EAAAL,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAA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AAE,aAAa;QACnBC,IAAI,EAAE;MACR;IACF,CAAE;IACFV,SAAS,EAAEC,cAAK,CAACiF,gBAAiB;IAClCtB,OAAO,EAAEvB,iBAAkB;IAC3BtB,WAAW,EAAE;MAAC8C,MAAM,EAAE;IAAM,CAAE;IAC9B,eAAY;EAAqB,CAClC,CACE,CACF,CACF,CAAC,EACLnE,eAAe,CAACW,YAAY,EAAET,gBAAgB,CAC5C,CAAC;AAEV,CAAC;AAEDuB,YAAY,CAACgE,SAAS,GAAAC,OAAA,CAAAC,GAAA,CAAAC,QAAA,oBAAGH,gBAAS;AAClChE,YAAY,CAACoE,YAAY,GAAG;EAC1B/D,IAAI,EAAEgE,iBAAQ,CAACC,iBAAiB,CAACjE;AACnC,CAAC;AAAC,IAAAkE,QAAA,GAAAjG,OAAA,CAAA7B,OAAA,GACauD,YAAY","ignoreList":[]}
|
|
@@ -113,6 +113,8 @@
|
|
|
113
113
|
|
|
114
114
|
.filterLabel {
|
|
115
115
|
min-width: 70px;
|
|
116
|
+
user-select: none;
|
|
117
|
+
text-align: center;
|
|
116
118
|
}
|
|
117
119
|
|
|
118
120
|
.filterSeparator {
|
|
@@ -190,10 +192,13 @@
|
|
|
190
192
|
}
|
|
191
193
|
|
|
192
194
|
@media mobile {
|
|
193
|
-
.leftArrowButton, .rightArrowButton
|
|
195
|
+
.leftArrowButton, .rightArrowButton {
|
|
194
196
|
display: none!important;
|
|
195
197
|
}
|
|
196
|
-
|
|
198
|
+
.filtersMainContainer {
|
|
199
|
+
margin: 0px;
|
|
200
|
+
padding: 20px 0px 0px 0px;
|
|
201
|
+
}
|
|
197
202
|
.filtersList{
|
|
198
203
|
margin-right: 0;
|
|
199
204
|
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export default Tabs;
|
|
2
|
+
declare function Tabs(props: any, context: any): JSX.Element;
|
|
3
|
+
declare namespace Tabs {
|
|
4
|
+
namespace contextTypes {
|
|
5
|
+
const skin: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
common: PropTypes.Requireable<{
|
|
7
|
+
[x: string]: any;
|
|
8
|
+
}>;
|
|
9
|
+
images: PropTypes.Requireable<PropTypes.InferProps<{
|
|
10
|
+
'logo-mobile': PropTypes.Requireable<any>;
|
|
11
|
+
logo: PropTypes.Requireable<any>;
|
|
12
|
+
'logo-email': PropTypes.Requireable<any>;
|
|
13
|
+
login: PropTypes.Requireable<any>;
|
|
14
|
+
}>>;
|
|
15
|
+
icons: PropTypes.Requireable<{
|
|
16
|
+
[x: string]: any;
|
|
17
|
+
}>;
|
|
18
|
+
mod: PropTypes.Requireable<{
|
|
19
|
+
[x: string]: any;
|
|
20
|
+
}>;
|
|
21
|
+
courses: PropTypes.Requireable<any[]>;
|
|
22
|
+
texts: PropTypes.Requireable<{
|
|
23
|
+
[x: string]: any;
|
|
24
|
+
}>;
|
|
25
|
+
}>>;
|
|
26
|
+
const translate: PropTypes.Requireable<(...args: any[]) => any>;
|
|
27
|
+
}
|
|
28
|
+
namespace propTypes {
|
|
29
|
+
const items: PropTypes.Requireable<(PropTypes.InferProps<{
|
|
30
|
+
title: PropTypes.Requireable<string>;
|
|
31
|
+
count: PropTypes.Requireable<number>;
|
|
32
|
+
'aria-label': PropTypes.Requireable<string>;
|
|
33
|
+
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
34
|
+
isActive: PropTypes.Requireable<boolean>;
|
|
35
|
+
}> | null | undefined)[]>;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
import PropTypes from "prop-types";
|
|
39
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/molecule/tabs/index.js"],"names":[],"mappings":";AAeA,6DAkDC"}
|