@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
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
exports.__esModule = true;
|
|
4
|
+
exports.default = void 0;
|
|
5
|
+
var _react = _interopRequireDefault(require("react"));
|
|
6
|
+
var _cssColorFunction = require("css-color-function");
|
|
7
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
8
|
+
var _getOr = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
|
+
var _provider = _interopRequireDefault(require("../../atom/provider"));
|
|
10
|
+
var _colors = require("../../variables/colors");
|
|
11
|
+
var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
12
|
+
var _style = _interopRequireDefault(require("./style.css"));
|
|
13
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
14
|
+
const handleTabClick = tab => e => {
|
|
15
|
+
if (tab && typeof tab.onClick === 'function') tab.onClick(e);
|
|
16
|
+
};
|
|
17
|
+
const handleTabKeyDown = tab => e => {
|
|
18
|
+
if (e.key === 'Enter') handleTabClick(tab)(e);
|
|
19
|
+
};
|
|
20
|
+
const Tabs = (props, context) => {
|
|
21
|
+
const {
|
|
22
|
+
items = []
|
|
23
|
+
} = props;
|
|
24
|
+
const {
|
|
25
|
+
skin
|
|
26
|
+
} = context;
|
|
27
|
+
const primaryColor = (0, _getOr.default)('#00B0FF', 'common.primary', skin);
|
|
28
|
+
const createTab = (index, tab) => {
|
|
29
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
30
|
+
key: index,
|
|
31
|
+
className: _style.default.tab,
|
|
32
|
+
role: "tab",
|
|
33
|
+
tabIndex: 0,
|
|
34
|
+
"aria-selected": tab.isActive,
|
|
35
|
+
"aria-label": tab['aria-label'] || tab.title,
|
|
36
|
+
onClick: handleTabClick(tab),
|
|
37
|
+
onKeyDown: handleTabKeyDown(tab),
|
|
38
|
+
style: {
|
|
39
|
+
'--hover-bg': (0, _cssColorFunction.convert)(`color(${tab.isActive ? primaryColor : _colors.COLORS.cm_grey_500} a(0.15))`),
|
|
40
|
+
'--bg': tab.isActive ? (0, _cssColorFunction.convert)(`color(${primaryColor} a(0.07))`) : 'transparent',
|
|
41
|
+
color: tab.isActive ? primaryColor : _colors.COLORS.cm_grey_500
|
|
42
|
+
}
|
|
43
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, tab.title), typeof tab.count === 'number' ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
44
|
+
label: tab.count.toString(),
|
|
45
|
+
type: "default",
|
|
46
|
+
size: "S",
|
|
47
|
+
customStyle: {
|
|
48
|
+
backgroundColor: tab.isActive ? (0, _cssColorFunction.convert)(`color(${primaryColor} a(0.25))`) : _colors.COLORS.cm_grey_200,
|
|
49
|
+
color: tab.isActive ? primaryColor : _colors.COLORS.cm_grey_500
|
|
50
|
+
}
|
|
51
|
+
}) : null);
|
|
52
|
+
};
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
54
|
+
className: _style.default.tabs,
|
|
55
|
+
role: "tablist"
|
|
56
|
+
}, items && items.map((tab, index) => {
|
|
57
|
+
return createTab(index, tab);
|
|
58
|
+
}));
|
|
59
|
+
};
|
|
60
|
+
Tabs.contextTypes = {
|
|
61
|
+
skin: _provider.default.childContextTypes.skin,
|
|
62
|
+
translate: _provider.default.childContextTypes.translate
|
|
63
|
+
};
|
|
64
|
+
Tabs.propTypes = process.env.NODE_ENV !== "production" ? {
|
|
65
|
+
items: _propTypes.default.arrayOf(_propTypes.default.shape({
|
|
66
|
+
title: _propTypes.default.string,
|
|
67
|
+
count: _propTypes.default.number,
|
|
68
|
+
'aria-label': _propTypes.default.string,
|
|
69
|
+
onClick: _propTypes.default.func,
|
|
70
|
+
isActive: _propTypes.default.bool
|
|
71
|
+
}))
|
|
72
|
+
} : {};
|
|
73
|
+
var _default = exports.default = Tabs;
|
|
74
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireDefault","require","_cssColorFunction","_propTypes","_getOr","_provider","_colors","_tag","_style","e","__esModule","default","handleTabClick","tab","onClick","handleTabKeyDown","key","Tabs","props","context","items","skin","primaryColor","getOr","createTab","index","createElement","className","style","role","tabIndex","isActive","title","onKeyDown","convert","COLORS","cm_grey_500","color","count","label","toString","type","size","customStyle","backgroundColor","cm_grey_200","tabs","map","contextTypes","Provider","childContextTypes","translate","propTypes","process","env","NODE_ENV","PropTypes","arrayOf","shape","string","number","func","bool","_default","exports"],"sources":["../../../src/molecule/tabs/index.js"],"sourcesContent":["import React from 'react';\nimport {convert} from 'css-color-function';\nimport PropTypes from 'prop-types';\nimport getOr from 'lodash/fp/getOr';\nimport Provider from '../../atom/provider';\nimport {COLORS} from '../../variables/colors';\nimport Tag from '../../atom/tag';\nimport style from './style.css';\n\nconst handleTabClick = tab => e => {\n if (tab && typeof tab.onClick === 'function') tab.onClick(e);\n};\nconst handleTabKeyDown = tab => e => {\n if (e.key === 'Enter') handleTabClick(tab)(e);\n};\nconst Tabs = (props, context) => {\n const {items = []} = props;\n const {skin} = context;\n const primaryColor = getOr('#00B0FF', 'common.primary', skin);\n\n const createTab = (index, tab) => {\n return (\n <div\n key={index}\n className={style.tab}\n role=\"tab\"\n tabIndex={0}\n aria-selected={tab.isActive}\n aria-label={tab['aria-label'] || tab.title}\n onClick={handleTabClick(tab)}\n onKeyDown={handleTabKeyDown(tab)}\n style={{\n '--hover-bg': convert(\n `color(${tab.isActive ? primaryColor : COLORS.cm_grey_500} a(0.15))`\n ),\n '--bg': tab.isActive ? convert(`color(${primaryColor} a(0.07))`) : 'transparent',\n color: tab.isActive ? primaryColor : COLORS.cm_grey_500\n }}\n >\n <span>{tab.title}</span>\n {typeof tab.count === 'number' ? (\n <Tag\n label={tab.count.toString()}\n type=\"default\"\n size=\"S\"\n customStyle={{\n backgroundColor: tab.isActive\n ? convert(`color(${primaryColor} a(0.25))`)\n : COLORS.cm_grey_200,\n color: tab.isActive ? primaryColor : COLORS.cm_grey_500\n }}\n />\n ) : null}\n </div>\n );\n };\n\n return (\n <div className={style.tabs} role=\"tablist\">\n {items &&\n items.map((tab, index) => {\n return createTab(index, tab);\n })}\n </div>\n );\n};\n\nTabs.contextTypes = {\n skin: Provider.childContextTypes.skin,\n translate: Provider.childContextTypes.translate\n};\n\nTabs.propTypes = {\n items: PropTypes.arrayOf(\n PropTypes.shape({\n title: PropTypes.string,\n count: PropTypes.number,\n 'aria-label': PropTypes.string,\n onClick: PropTypes.func,\n isActive: PropTypes.bool\n })\n )\n};\n\nexport default Tabs;\n"],"mappings":";;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,UAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,MAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,SAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,IAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,MAAA,GAAAR,sBAAA,CAAAC,OAAA;AAAgC,SAAAD,uBAAAS,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAEhC,MAAMG,cAAc,GAAGC,GAAG,IAAIJ,CAAC,IAAI;EACjC,IAAII,GAAG,IAAI,OAAOA,GAAG,CAACC,OAAO,KAAK,UAAU,EAAED,GAAG,CAACC,OAAO,CAACL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E0C,kBAAS,CAACK,IAAI;IACvB9B,QAAQ,EAAEyB,kBAAS,CAACM;EACtB,CAAC,CACH;AACF,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAArD,OAAA,GAEaM,IAAI","ignoreList":[]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
|
|
2
|
+
.tabs{
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: row;
|
|
5
|
+
flex-grow: 2;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.tab{
|
|
9
|
+
font-family: 'Gilroy';
|
|
10
|
+
font-weight: 600;
|
|
11
|
+
font-size: 16px;
|
|
12
|
+
line-height: 20px;
|
|
13
|
+
letter-spacing: 0px;
|
|
14
|
+
cursor: pointer;
|
|
15
|
+
padding: 8px 16px;
|
|
16
|
+
border-radius: 5px;
|
|
17
|
+
min-width: 160px;
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: row;
|
|
20
|
+
gap: 8px;
|
|
21
|
+
margin: 0px 8px 0px 0px;
|
|
22
|
+
background-color: var(--bg);
|
|
23
|
+
transition: background-color 0.15s ease-in-out, color 0.15s ease-in-out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.tab:hover {
|
|
27
|
+
background-color: var(--hover-bg);
|
|
28
|
+
}
|
|
@@ -3,6 +3,7 @@ declare function TitleAndCheckBoxWrapper(props: any): JSX.Element;
|
|
|
3
3
|
declare namespace TitleAndCheckBoxWrapper {
|
|
4
4
|
namespace propTypes {
|
|
5
5
|
const checkboxWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
6
|
+
value: PropTypes.Requireable<string>;
|
|
6
7
|
title: PropTypes.Requireable<string>;
|
|
7
8
|
name: PropTypes.Requireable<string>;
|
|
8
9
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -132,6 +132,7 @@ declare namespace BrandLearningPriorities {
|
|
|
132
132
|
}>>;
|
|
133
133
|
image: PropTypes.Requireable<string>;
|
|
134
134
|
checkbox: PropTypes.Requireable<PropTypes.InferProps<{
|
|
135
|
+
value: PropTypes.Requireable<string>;
|
|
135
136
|
title: PropTypes.Requireable<string>;
|
|
136
137
|
name: PropTypes.Requireable<string>;
|
|
137
138
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -145,6 +145,7 @@ declare const ContentSkillModal: {
|
|
|
145
145
|
}>>;
|
|
146
146
|
image: import("prop-types").Requireable<string>;
|
|
147
147
|
checkbox: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
148
|
+
value: import("prop-types").Requireable<string>;
|
|
148
149
|
title: import("prop-types").Requireable<string>;
|
|
149
150
|
name: import("prop-types").Requireable<string>;
|
|
150
151
|
checked: import("prop-types").Requireable<boolean>;
|
|
@@ -533,6 +534,7 @@ declare const ContentSkillModal: {
|
|
|
533
534
|
searchIconAriaLabel: import("prop-types").Requireable<string>;
|
|
534
535
|
}>>;
|
|
535
536
|
checkboxWithTitle: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
537
|
+
value: import("prop-types").Requireable<string>;
|
|
536
538
|
title: import("prop-types").Requireable<string>;
|
|
537
539
|
name: import("prop-types").Requireable<string>;
|
|
538
540
|
checked: import("prop-types").Requireable<boolean>;
|
|
@@ -719,6 +721,7 @@ declare const ContentSkillModal: {
|
|
|
719
721
|
count: import("prop-types").Requireable<number>;
|
|
720
722
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
721
723
|
}> | null | undefined)[]>;
|
|
724
|
+
emptySearchResult: import("prop-types").Requireable<string>;
|
|
722
725
|
searchOptions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
723
726
|
value: import("prop-types").Requireable<string>;
|
|
724
727
|
placeholder: import("prop-types").Validator<string>;
|
|
@@ -745,8 +748,28 @@ declare const ContentSkillModal: {
|
|
|
745
748
|
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
746
749
|
theme: import("prop-types").Validator<string>;
|
|
747
750
|
ariaLabel: import("prop-types").Validator<string>;
|
|
751
|
+
id: import("prop-types").Requireable<string>;
|
|
748
752
|
}> | null | undefined)[]>;
|
|
749
753
|
}>>;
|
|
754
|
+
}> | import("prop-types").InferProps<{
|
|
755
|
+
type: import("prop-types").Requireable<string>;
|
|
756
|
+
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
757
|
+
title: import("prop-types").Validator<string>;
|
|
758
|
+
titleAriaLabel: import("prop-types").Requireable<string>;
|
|
759
|
+
onClear: import("prop-types").Validator<(...args: any[]) => any>;
|
|
760
|
+
options: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
761
|
+
label: import("prop-types").Validator<string>;
|
|
762
|
+
min: import("prop-types").Validator<number>;
|
|
763
|
+
max: import("prop-types").Validator<number>;
|
|
764
|
+
step: import("prop-types").Requireable<number>;
|
|
765
|
+
value: import("prop-types").Requireable<(number | null | undefined)[]>;
|
|
766
|
+
minLabel: import("prop-types").Requireable<string>;
|
|
767
|
+
maxLabel: import("prop-types").Requireable<string>;
|
|
768
|
+
onChange: import("prop-types").Validator<(...args: any[]) => any>;
|
|
769
|
+
theme: import("prop-types").Requireable<string>;
|
|
770
|
+
selected: import("prop-types").Requireable<boolean>;
|
|
771
|
+
}>>;
|
|
772
|
+
}>>;
|
|
750
773
|
}> | null | undefined> | null | undefined)[]>;
|
|
751
774
|
}>>>;
|
|
752
775
|
modal: import("prop-types").Validator<NonNullable<import("prop-types").InferProps<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,CAAC;AAOlD,OAAkB,EAAC,sBAAsB,EAAC,MAAM,SAAS,CAAC;AAE1D,QAAA,MAAM,iBAAiB;YAAW,sBAAsB
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/content-skill-modal/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA6B,MAAM,OAAO,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
|
+
value: PropTypes.Requireable<string>;
|
|
145
146
|
title: PropTypes.Requireable<string>;
|
|
146
147
|
name: PropTypes.Requireable<string>;
|
|
147
148
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -530,6 +531,7 @@ declare const ContentSkillModalPropTypes: {
|
|
|
530
531
|
searchIconAriaLabel: PropTypes.Requireable<string>;
|
|
531
532
|
}>>;
|
|
532
533
|
checkboxWithTitle: PropTypes.Requireable<PropTypes.InferProps<{
|
|
534
|
+
value: PropTypes.Requireable<string>;
|
|
533
535
|
title: PropTypes.Requireable<string>;
|
|
534
536
|
name: PropTypes.Requireable<string>;
|
|
535
537
|
checked: PropTypes.Requireable<boolean>;
|
|
@@ -716,6 +718,7 @@ declare const ContentSkillModalPropTypes: {
|
|
|
716
718
|
count: PropTypes.Requireable<number>;
|
|
717
719
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
718
720
|
}> | null | undefined)[]>;
|
|
721
|
+
emptySearchResult: PropTypes.Requireable<string>;
|
|
719
722
|
searchOptions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
720
723
|
value: PropTypes.Requireable<string>;
|
|
721
724
|
placeholder: PropTypes.Validator<string>;
|
|
@@ -742,8 +745,28 @@ declare const ContentSkillModalPropTypes: {
|
|
|
742
745
|
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
743
746
|
theme: PropTypes.Validator<string>;
|
|
744
747
|
ariaLabel: PropTypes.Validator<string>;
|
|
748
|
+
id: PropTypes.Requireable<string>;
|
|
745
749
|
}> | null | undefined)[]>;
|
|
746
750
|
}>>;
|
|
751
|
+
}> | PropTypes.InferProps<{
|
|
752
|
+
type: PropTypes.Requireable<string>;
|
|
753
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
754
|
+
title: PropTypes.Validator<string>;
|
|
755
|
+
titleAriaLabel: PropTypes.Requireable<string>;
|
|
756
|
+
onClear: PropTypes.Validator<(...args: any[]) => any>;
|
|
757
|
+
options: PropTypes.Requireable<PropTypes.InferProps<{
|
|
758
|
+
label: PropTypes.Validator<string>;
|
|
759
|
+
min: PropTypes.Validator<number>;
|
|
760
|
+
max: PropTypes.Validator<number>;
|
|
761
|
+
step: PropTypes.Requireable<number>;
|
|
762
|
+
value: PropTypes.Requireable<(number | null | undefined)[]>;
|
|
763
|
+
minLabel: PropTypes.Requireable<string>;
|
|
764
|
+
maxLabel: PropTypes.Requireable<string>;
|
|
765
|
+
onChange: PropTypes.Validator<(...args: any[]) => any>;
|
|
766
|
+
theme: PropTypes.Requireable<string>;
|
|
767
|
+
selected: PropTypes.Requireable<boolean>;
|
|
768
|
+
}>>;
|
|
769
|
+
}>>;
|
|
747
770
|
}> | null | undefined> | null | undefined)[]>;
|
|
748
771
|
}>>>;
|
|
749
772
|
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"}
|
|
@@ -15,6 +15,7 @@ declare const FilterCheckboxAndSearch: {
|
|
|
15
15
|
count: import("prop-types").Requireable<number>;
|
|
16
16
|
onClick: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
17
17
|
}> | null | undefined)[]>;
|
|
18
|
+
emptySearchResult: import("prop-types").Requireable<string>;
|
|
18
19
|
searchOptions: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
19
20
|
value: import("prop-types").Requireable<string>;
|
|
20
21
|
placeholder: import("prop-types").Validator<string>;
|
|
@@ -31,6 +32,27 @@ declare const FilterCheckboxAndSearch: {
|
|
|
31
32
|
};
|
|
32
33
|
contextTypes: {
|
|
33
34
|
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
35
|
+
skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
36
|
+
common: import("prop-types").Requireable<{
|
|
37
|
+
[x: string]: any;
|
|
38
|
+
}>;
|
|
39
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
40
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
41
|
+
logo: import("prop-types").Requireable<any>;
|
|
42
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
43
|
+
login: import("prop-types").Requireable<any>;
|
|
44
|
+
}>>;
|
|
45
|
+
icons: import("prop-types").Requireable<{
|
|
46
|
+
[x: string]: any;
|
|
47
|
+
}>;
|
|
48
|
+
mod: import("prop-types").Requireable<{
|
|
49
|
+
[x: string]: any;
|
|
50
|
+
}>;
|
|
51
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
52
|
+
texts: import("prop-types").Requireable<{
|
|
53
|
+
[x: string]: any;
|
|
54
|
+
}>;
|
|
55
|
+
}>>;
|
|
34
56
|
};
|
|
35
57
|
};
|
|
36
58
|
export default FilterCheckboxAndSearch;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-checkbox-and-search/index.tsx"],"names":[],"mappings":";AAOA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAKjE,OAAkB,EAAC,4BAA4B,EAAC,MAAM,eAAe,CAAC;AAiBtE,QAAA,MAAM,uBAAuB;YACpB,4BAA4B,WAC1B,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkH1B,CAAC;AASF,eAAe,uBAAuB,CAAC"}
|
|
@@ -6,8 +6,10 @@ var _toString2 = _interopRequireDefault(require("lodash/fp/toString"));
|
|
|
6
6
|
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
7
7
|
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
8
8
|
var _isEmpty2 = _interopRequireDefault(require("lodash/fp/isEmpty"));
|
|
9
|
+
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
10
|
var _filter2 = _interopRequireDefault(require("lodash/fp/filter"));
|
|
10
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _cssColorFunction = require("css-color-function");
|
|
11
13
|
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
12
14
|
var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
13
15
|
var _buttonLink = _interopRequireDefault(require("../../atom/button-link"));
|
|
@@ -39,11 +41,17 @@ const CHECKBOX_TITLE_STYLE = {
|
|
|
39
41
|
const INITIAL_VISIBLE_OPTIONS = 5;
|
|
40
42
|
const FilterCheckboxAndSearch = (props, context) => {
|
|
41
43
|
const {
|
|
44
|
+
skin
|
|
45
|
+
} = context;
|
|
46
|
+
const primaryColor = (0, _getOr2.default)(_colors.COLORS.cm_primary_blue, 'common.primary', skin);
|
|
47
|
+
const {
|
|
48
|
+
id,
|
|
42
49
|
title,
|
|
43
50
|
titleAriaLabel,
|
|
44
51
|
searchOptions,
|
|
45
52
|
onClear,
|
|
46
|
-
options
|
|
53
|
+
options,
|
|
54
|
+
emptySearchResult
|
|
47
55
|
} = props;
|
|
48
56
|
const translate = (0, _provider.GetTranslateFromContext)(context);
|
|
49
57
|
const [showMore, setShowMore] = (0, _react.useState)(false);
|
|
@@ -58,6 +66,7 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
58
66
|
return showMore ? options : options.slice(0, INITIAL_VISIBLE_OPTIONS);
|
|
59
67
|
}, [options, showMore]);
|
|
60
68
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
69
|
+
"data-name": id,
|
|
61
70
|
"data-testid": "filter-checkbox-and-search-container",
|
|
62
71
|
className: _style.default.container
|
|
63
72
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -72,7 +81,11 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
72
81
|
}), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
73
82
|
label: (0, _toString2.default)(selectedFiltersCount),
|
|
74
83
|
type: "info",
|
|
75
|
-
size: "S"
|
|
84
|
+
size: "S",
|
|
85
|
+
customStyle: {
|
|
86
|
+
color: primaryColor,
|
|
87
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primaryColor} lightness(92%))`)
|
|
88
|
+
}
|
|
76
89
|
}) : null), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement("div", {
|
|
77
90
|
className: _style.default.clearButtonContainer
|
|
78
91
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
@@ -90,7 +103,7 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
90
103
|
}, (0, _isEmpty2.default)(visibleOptions) ? /*#__PURE__*/_react.default.createElement("p", {
|
|
91
104
|
className: _style.default.emptySearchResult,
|
|
92
105
|
"data-testid": "filter-checkbox-and-search-empty-message"
|
|
93
|
-
},
|
|
106
|
+
}, emptySearchResult) : visibleOptions.map(({
|
|
94
107
|
value,
|
|
95
108
|
label,
|
|
96
109
|
selected,
|
|
@@ -102,14 +115,17 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
102
115
|
"data-testid": `filter-checkbox-and-search-option-row-${index}`
|
|
103
116
|
}, /*#__PURE__*/_react.default.createElement(_checkboxWithTitle.default, {
|
|
104
117
|
key: value,
|
|
118
|
+
value: value,
|
|
105
119
|
title: label,
|
|
106
120
|
onChange: onClick,
|
|
107
121
|
name: label,
|
|
108
122
|
checked: selected,
|
|
109
123
|
customStyle: CHECKBOX_TITLE_STYLE
|
|
110
124
|
}), /*#__PURE__*/_react.default.createElement("p", {
|
|
125
|
+
"data-name": 'counter',
|
|
111
126
|
className: _style.default.optionCount
|
|
112
127
|
}, count)))), (0, _size2.default)(options) > INITIAL_VISIBLE_OPTIONS ? /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
128
|
+
"data-name": 'show-more-button',
|
|
113
129
|
label: showMore ? translate('Show less') : translate('Show more'),
|
|
114
130
|
type: "text",
|
|
115
131
|
icon: {
|
|
@@ -127,7 +143,8 @@ const FilterCheckboxAndSearch = (props, context) => {
|
|
|
127
143
|
};
|
|
128
144
|
FilterCheckboxAndSearch.propTypes = process.env.NODE_ENV !== "production" ? _propsTypes.default : {};
|
|
129
145
|
FilterCheckboxAndSearch.contextTypes = {
|
|
130
|
-
translate: _provider.default.childContextTypes.translate
|
|
146
|
+
translate: _provider.default.childContextTypes.translate,
|
|
147
|
+
skin: _provider.default.childContextTypes.skin
|
|
131
148
|
};
|
|
132
149
|
var _default = exports.default = FilterCheckboxAndSearch;
|
|
133
150
|
//# sourceMappingURL=index.js.map
|
|
@@ -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","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,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,GAAAN,sBAAA,CAAAF,OAAA;AACA,IAAAS,MAAA,GAAAP,sBAAA,CAAAF,OAAA;AACA,IAAAU,WAAA,GAAAR,sBAAA,CAAAF,OAAA;AAAsE,SAAAW,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,SAAAb,wBAAAa,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,SA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C;AAAC,IAAA2D,QAAA,GAAAC,OAAA,CAAA3F,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_react","_interopRequireWildcard","require","_cssColorFunction","_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","skin","primaryColor","_getOr2","COLORS","cm_primary_blue","id","title","titleAriaLabel","searchOptions","onClear","options","emptySearchResult","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","customStyle","color","backgroundColor","convert","clearButtonContainer","onClick","hoverColor","cm_grey_700","search","optionsContainer","_isEmpty2","map","value","count","index","key","optionRow","onChange","name","checked","optionCount","icon","position","faIcon","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, getOr, isEmpty, pipe, size, toString} from 'lodash/fp';\nimport {convert} from 'css-color-function';\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 {skin} = context;\n const primaryColor = getOr(COLORS.cm_primary_blue, 'common.primary', skin);\n const {id, title, titleAriaLabel, searchOptions, onClear, options, emptySearchResult} = 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\n data-name={id}\n data-testid=\"filter-checkbox-and-search-container\"\n className={style.container}\n >\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\n label={toString(selectedFiltersCount)}\n type=\"info\"\n size=\"S\"\n customStyle={{\n color: primaryColor,\n backgroundColor: convert(`color(${primaryColor} lightness(92%))`)\n }}\n />\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 {emptySearchResult}\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 value={value}\n title={label}\n onChange={onClick}\n name={label}\n checked={selected}\n customStyle={CHECKBOX_TITLE_STYLE}\n />\n <p data-name={'counter'} className={style.optionCount}>\n {count}\n </p>\n </div>\n ))\n )}\n </div>\n {size(options) > INITIAL_VISIBLE_OPTIONS ? (\n <ButtonLink\n data-name={'show-more-button'}\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 skin: Provider.childContextTypes.skin\n};\n\nexport default FilterCheckboxAndSearch;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,IAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,SAAA,GAAAP,uBAAA,CAA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AAlG,OAAA,GAEauB,uBAAuB","ignoreList":[]}
|
|
@@ -11,6 +11,7 @@ declare const propTypes: {
|
|
|
11
11
|
count: PropTypes.Requireable<number>;
|
|
12
12
|
onClick: PropTypes.Requireable<(...args: any[]) => any>;
|
|
13
13
|
}> | null | undefined)[]>;
|
|
14
|
+
emptySearchResult: PropTypes.Requireable<string>;
|
|
14
15
|
searchOptions: PropTypes.Requireable<PropTypes.InferProps<{
|
|
15
16
|
value: PropTypes.Requireable<string>;
|
|
16
17
|
placeholder: PropTypes.Validator<string>;
|
|
@@ -44,10 +45,12 @@ declare type SearchType = {
|
|
|
44
45
|
dataTestId?: string;
|
|
45
46
|
};
|
|
46
47
|
export declare type FilterCheckboxAndSearchProps = {
|
|
48
|
+
id?: string;
|
|
47
49
|
title: string;
|
|
48
50
|
titleAriaLabel?: string;
|
|
49
51
|
onClear: () => void;
|
|
50
52
|
searchOptions: SearchType;
|
|
53
|
+
emptySearchResult?: string;
|
|
51
54
|
options: FilterCheckboxAndSearchOptions[];
|
|
52
55
|
};
|
|
53
56
|
export default propTypes;
|
|
@@ -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;;;;;;;;;;;;;;;;;;;;;;;;;;CAgBd,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,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,aAAa,EAAE,UAAU,CAAC;IAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,OAAO,EAAE,8BAA8B,EAAE,CAAC;CAC3C,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -17,6 +17,7 @@ const propTypes = {
|
|
|
17
17
|
count: _propTypes.default.number,
|
|
18
18
|
onClick: _propTypes.default.func
|
|
19
19
|
})),
|
|
20
|
+
emptySearchResult: _propTypes.default.string,
|
|
20
21
|
searchOptions: _propTypes.default.shape(_inputSearch.default.propTypes)
|
|
21
22
|
};
|
|
22
23
|
var _default = exports.default = propTypes;
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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","emptySearchResult","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 emptySearchResult: PropTypes.string,\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 id?: string;\n title: string;\n titleAriaLabel?: string;\n onClear: () => void;\n searchOptions: SearchType;\n emptySearchResult?: string;\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,iBAAiB,EAAEhB,kBAAS,CAACC,MAAM;EACnCgB,aAAa,EAAEjB,kBAAS,CAACO,KAAK,CAACW,oBAAM,CAACpB,SAAS;AACjD,CAAC;AAAC,IAAAqB,QAAA,GAAAC,OAAA,CAAAvB,OAAA,GAgCaC,SAAS","ignoreList":[]}
|
|
@@ -19,6 +19,27 @@ declare const FilterChip: {
|
|
|
19
19
|
};
|
|
20
20
|
contextTypes: {
|
|
21
21
|
translate: import("prop-types").Requireable<(...args: any[]) => any>;
|
|
22
|
+
skin: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
23
|
+
common: import("prop-types").Requireable<{
|
|
24
|
+
[x: string]: any;
|
|
25
|
+
}>;
|
|
26
|
+
images: import("prop-types").Requireable<import("prop-types").InferProps<{
|
|
27
|
+
'logo-mobile': import("prop-types").Requireable<any>;
|
|
28
|
+
logo: import("prop-types").Requireable<any>;
|
|
29
|
+
'logo-email': import("prop-types").Requireable<any>;
|
|
30
|
+
login: import("prop-types").Requireable<any>;
|
|
31
|
+
}>>;
|
|
32
|
+
icons: import("prop-types").Requireable<{
|
|
33
|
+
[x: string]: any;
|
|
34
|
+
}>;
|
|
35
|
+
mod: import("prop-types").Requireable<{
|
|
36
|
+
[x: string]: any;
|
|
37
|
+
}>;
|
|
38
|
+
courses: import("prop-types").Requireable<any[]>;
|
|
39
|
+
texts: import("prop-types").Requireable<{
|
|
40
|
+
[x: string]: any;
|
|
41
|
+
}>;
|
|
42
|
+
}>>;
|
|
22
43
|
};
|
|
23
44
|
};
|
|
24
45
|
export default FilterChip;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/index.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/organism/filter-chip/index.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAC,gBAAgB,EAAC,MAAM,iCAAiC,CAAC;AAEjE,OAAkB,EAAC,eAAe,EAAC,MAAM,cAAc,CAAC;AAGxD,QAAA,MAAM,UAAU;YAAW,eAAe,WAAW,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA2DpE,CAAC;AASF,eAAe,UAAU,CAAC"}
|
|
@@ -6,8 +6,10 @@ var _toString2 = _interopRequireDefault(require("lodash/fp/toString"));
|
|
|
6
6
|
var _size2 = _interopRequireDefault(require("lodash/fp/size"));
|
|
7
7
|
var _pipe2 = _interopRequireDefault(require("lodash/fp/pipe"));
|
|
8
8
|
var _map2 = _interopRequireDefault(require("lodash/fp/map"));
|
|
9
|
+
var _getOr2 = _interopRequireDefault(require("lodash/fp/getOr"));
|
|
9
10
|
var _filter2 = _interopRequireDefault(require("lodash/fp/filter"));
|
|
10
11
|
var _react = _interopRequireDefault(require("react"));
|
|
12
|
+
var _cssColorFunction = require("css-color-function");
|
|
11
13
|
var _chip = _interopRequireDefault(require("../../atom/chip"));
|
|
12
14
|
var _title = _interopRequireDefault(require("../../atom/title"));
|
|
13
15
|
var _tag = _interopRequireDefault(require("../../atom/tag"));
|
|
@@ -20,6 +22,10 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
|
|
|
20
22
|
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; }
|
|
21
23
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
22
24
|
const FilterChip = (props, context) => {
|
|
25
|
+
const {
|
|
26
|
+
skin
|
|
27
|
+
} = context;
|
|
28
|
+
const primaryColor = (0, _getOr2.default)(_colors.COLORS.cm_grey_700, 'common.primary', skin);
|
|
23
29
|
const {
|
|
24
30
|
options,
|
|
25
31
|
titleAriaLabel,
|
|
@@ -41,7 +47,11 @@ const FilterChip = (props, context) => {
|
|
|
41
47
|
}), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement(_tag.default, {
|
|
42
48
|
label: (0, _toString2.default)(selectedFiltersCount),
|
|
43
49
|
type: "info",
|
|
44
|
-
size: "S"
|
|
50
|
+
size: "S",
|
|
51
|
+
customStyle: {
|
|
52
|
+
color: primaryColor,
|
|
53
|
+
backgroundColor: (0, _cssColorFunction.convert)(`color(${primaryColor} lightness(92%))`)
|
|
54
|
+
}
|
|
45
55
|
}) : null), hasSelectedFilters ? /*#__PURE__*/_react.default.createElement("div", {
|
|
46
56
|
className: _style.default.buttonContainer
|
|
47
57
|
}, /*#__PURE__*/_react.default.createElement(_buttonLink.default, {
|
|
@@ -74,6 +84,7 @@ const FilterChip = (props, context) => {
|
|
|
74
84
|
text: label,
|
|
75
85
|
textColor: textColor,
|
|
76
86
|
key: label,
|
|
87
|
+
backgroundColor: "skin",
|
|
77
88
|
selected: selected,
|
|
78
89
|
onClick: handleClick,
|
|
79
90
|
customIcon: customIcon
|
|
@@ -82,7 +93,8 @@ const FilterChip = (props, context) => {
|
|
|
82
93
|
};
|
|
83
94
|
FilterChip.propTypes = process.env.NODE_ENV !== "production" ? _propTypes.default : {};
|
|
84
95
|
FilterChip.contextTypes = {
|
|
85
|
-
translate: _provider.default.childContextTypes.translate
|
|
96
|
+
translate: _provider.default.childContextTypes.translate,
|
|
97
|
+
skin: _provider.default.childContextTypes.skin
|
|
86
98
|
};
|
|
87
99
|
var _default = exports.default = FilterChip;
|
|
88
100
|
//# sourceMappingURL=index.js.map
|