@coorpacademy/components 10.1.12-alpha.0 → 10.1.15

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.
Files changed (145) hide show
  1. package/es/atom/input-checkbox/index.js +9 -3
  2. package/es/atom/input-checkbox/index.js.map +1 -1
  3. package/es/atom/input-checkbox/style.css +15 -0
  4. package/es/atom/tag/test/fixtures.js +4 -2
  5. package/es/atom/tag/test/fixtures.js.map +1 -1
  6. package/es/molecule/banner/index.js +16 -7
  7. package/es/molecule/banner/index.js.map +1 -1
  8. package/es/molecule/banner/style.css +47 -0
  9. package/es/molecule/banner/test/fixtures/default.js +1 -1
  10. package/es/molecule/banner/test/fixtures/default.js.map +1 -1
  11. package/es/molecule/banner/test/fixtures/error-temporary-banner.js +8 -0
  12. package/es/molecule/banner/test/fixtures/error-temporary-banner.js.map +1 -0
  13. package/es/molecule/banner/test/fixtures/success-banner.js +7 -0
  14. package/es/molecule/banner/test/fixtures/success-banner.js.map +1 -0
  15. package/es/molecule/banner/test/fixtures/success-temporary-banner.js +8 -0
  16. package/es/molecule/banner/test/fixtures/success-temporary-banner.js.map +1 -0
  17. package/es/molecule/banner/test/fixtures/warning-temporary-banner.js +8 -0
  18. package/es/molecule/banner/test/fixtures/warning-temporary-banner.js.map +1 -0
  19. package/es/molecule/brand-form-group/style.css +5 -0
  20. package/es/molecule/brand-tabs/style.css +0 -1
  21. package/es/molecule/bullet-point-menu-button/index.js +1 -5
  22. package/es/molecule/bullet-point-menu-button/index.js.map +1 -1
  23. package/es/molecule/bullet-point-menu-button/style.css +11 -7
  24. package/es/molecule/select-multiple/index.js +99 -16
  25. package/es/molecule/select-multiple/index.js.map +1 -1
  26. package/es/molecule/select-multiple/style.css +293 -11
  27. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js +32 -0
  28. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js.map +1 -0
  29. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js +32 -0
  30. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js.map +1 -0
  31. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js +32 -0
  32. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js.map +1 -0
  33. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme.js +32 -0
  34. package/es/molecule/select-multiple/test/fixtures/checked-cm-theme.js.map +1 -0
  35. package/es/molecule/select-multiple/test/fixtures/setup-theme-error.js +1 -1
  36. package/es/molecule/select-multiple/test/fixtures/setup-theme-error.js.map +1 -1
  37. package/es/organism/accordion/coorp-manager/index.js +3 -3
  38. package/es/organism/accordion/coorp-manager/index.js.map +1 -1
  39. package/es/organism/brand-dashboard/index.js +1 -3
  40. package/es/organism/brand-dashboard/index.js.map +1 -1
  41. package/es/organism/brand-dashboard/style.css +0 -10
  42. package/es/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
  43. package/es/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  44. package/es/organism/list-item/index.js +68 -0
  45. package/es/organism/list-item/index.js.map +1 -0
  46. package/es/organism/list-item/style.css +53 -0
  47. package/es/organism/list-item/test/fixtures/archived.js +39 -0
  48. package/es/organism/list-item/test/fixtures/archived.js.map +1 -0
  49. package/es/organism/list-item/test/fixtures/draft.js +39 -0
  50. package/es/organism/list-item/test/fixtures/draft.js.map +1 -0
  51. package/es/organism/list-item/test/fixtures/published.js +39 -0
  52. package/es/organism/list-item/test/fixtures/published.js.map +1 -0
  53. package/es/organism/list-item/test/fixtures/revised.js +41 -0
  54. package/es/organism/list-item/test/fixtures/revised.js.map +1 -0
  55. package/es/organism/setup-header/style.css +16 -7
  56. package/es/template/back-office/brand-update/index.js +106 -92
  57. package/es/template/back-office/brand-update/index.js.map +1 -1
  58. package/es/template/back-office/brand-update/style.css +22 -66
  59. package/es/template/back-office/brand-update/test/fixtures/default.js +1 -58
  60. package/es/template/back-office/brand-update/test/fixtures/default.js.map +1 -1
  61. package/es/template/back-office/brand-update/test/fixtures/general-settings.js +77 -3
  62. package/es/template/back-office/brand-update/test/fixtures/general-settings.js.map +1 -1
  63. package/es/template/back-office/brand-update/test/fixtures/loader.js +1 -1
  64. package/es/template/back-office/brand-update/test/fixtures/loader.js.map +1 -1
  65. package/es/template/back-office/brand-update/test/fixtures/manageusers-edit.js +1 -1
  66. package/es/template/back-office/brand-update/test/fixtures/manageusers-edit.js.map +1 -1
  67. package/es/template/back-office/brand-update/test/fixtures/manageusers-list.js +1 -1
  68. package/es/template/back-office/brand-update/test/fixtures/manageusers-list.js.map +1 -1
  69. package/es/template/back-office/brand-update/test/fixtures/uploadusers.js +1 -1
  70. package/es/template/back-office/brand-update/test/fixtures/uploadusers.js.map +1 -1
  71. package/lib/atom/input-checkbox/index.js +10 -3
  72. package/lib/atom/input-checkbox/index.js.map +1 -1
  73. package/lib/atom/input-checkbox/style.css +15 -0
  74. package/lib/atom/tag/test/fixtures.js +5 -2
  75. package/lib/atom/tag/test/fixtures.js.map +1 -1
  76. package/lib/molecule/banner/index.js +17 -6
  77. package/lib/molecule/banner/index.js.map +1 -1
  78. package/lib/molecule/banner/style.css +47 -0
  79. package/lib/molecule/banner/test/fixtures/default.js +1 -1
  80. package/lib/molecule/banner/test/fixtures/default.js.map +1 -1
  81. package/lib/molecule/banner/test/fixtures/error-temporary-banner.js +13 -0
  82. package/lib/molecule/banner/test/fixtures/error-temporary-banner.js.map +1 -0
  83. package/lib/molecule/banner/test/fixtures/success-banner.js +12 -0
  84. package/lib/molecule/banner/test/fixtures/success-banner.js.map +1 -0
  85. package/lib/molecule/banner/test/fixtures/success-temporary-banner.js +13 -0
  86. package/lib/molecule/banner/test/fixtures/success-temporary-banner.js.map +1 -0
  87. package/lib/molecule/banner/test/fixtures/warning-temporary-banner.js +13 -0
  88. package/lib/molecule/banner/test/fixtures/warning-temporary-banner.js.map +1 -0
  89. package/lib/molecule/brand-form-group/style.css +5 -0
  90. package/lib/molecule/brand-tabs/style.css +0 -1
  91. package/lib/molecule/bullet-point-menu-button/index.js +1 -5
  92. package/lib/molecule/bullet-point-menu-button/index.js.map +1 -1
  93. package/lib/molecule/bullet-point-menu-button/style.css +11 -7
  94. package/lib/molecule/select-multiple/index.js +101 -15
  95. package/lib/molecule/select-multiple/index.js.map +1 -1
  96. package/lib/molecule/select-multiple/style.css +293 -11
  97. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js +37 -0
  98. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js.map +1 -0
  99. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js +37 -0
  100. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-error.js.map +1 -0
  101. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js +37 -0
  102. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme-multiple.js.map +1 -0
  103. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme.js +37 -0
  104. package/lib/molecule/select-multiple/test/fixtures/checked-cm-theme.js.map +1 -0
  105. package/lib/molecule/select-multiple/test/fixtures/setup-theme-error.js +1 -1
  106. package/lib/molecule/select-multiple/test/fixtures/setup-theme-error.js.map +1 -1
  107. package/lib/organism/accordion/coorp-manager/index.js +2 -4
  108. package/lib/organism/accordion/coorp-manager/index.js.map +1 -1
  109. package/lib/organism/brand-dashboard/index.js +1 -3
  110. package/lib/organism/brand-dashboard/index.js.map +1 -1
  111. package/lib/organism/brand-dashboard/style.css +0 -10
  112. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js +26 -0
  113. package/lib/organism/brand-form/test/fixtures/wizard-playlists.js.map +1 -1
  114. package/lib/organism/list-item/index.js +82 -0
  115. package/lib/organism/list-item/index.js.map +1 -0
  116. package/lib/organism/list-item/style.css +53 -0
  117. package/lib/organism/list-item/test/fixtures/archived.js +44 -0
  118. package/lib/organism/list-item/test/fixtures/archived.js.map +1 -0
  119. package/lib/organism/list-item/test/fixtures/draft.js +44 -0
  120. package/lib/organism/list-item/test/fixtures/draft.js.map +1 -0
  121. package/lib/organism/list-item/test/fixtures/published.js +44 -0
  122. package/lib/organism/list-item/test/fixtures/published.js.map +1 -0
  123. package/lib/organism/list-item/test/fixtures/revised.js +46 -0
  124. package/lib/organism/list-item/test/fixtures/revised.js.map +1 -0
  125. package/lib/organism/setup-header/style.css +16 -7
  126. package/lib/template/back-office/brand-update/index.js +106 -93
  127. package/lib/template/back-office/brand-update/index.js.map +1 -1
  128. package/lib/template/back-office/brand-update/style.css +22 -66
  129. package/lib/template/back-office/brand-update/test/fixtures/default.js +1 -58
  130. package/lib/template/back-office/brand-update/test/fixtures/default.js.map +1 -1
  131. package/lib/template/back-office/brand-update/test/fixtures/general-settings.js +76 -3
  132. package/lib/template/back-office/brand-update/test/fixtures/general-settings.js.map +1 -1
  133. package/lib/template/back-office/brand-update/test/fixtures/loader.js +2 -2
  134. package/lib/template/back-office/brand-update/test/fixtures/loader.js.map +1 -1
  135. package/lib/template/back-office/brand-update/test/fixtures/manageusers-edit.js +2 -2
  136. package/lib/template/back-office/brand-update/test/fixtures/manageusers-edit.js.map +1 -1
  137. package/lib/template/back-office/brand-update/test/fixtures/manageusers-list.js +2 -2
  138. package/lib/template/back-office/brand-update/test/fixtures/manageusers-list.js.map +1 -1
  139. package/lib/template/back-office/brand-update/test/fixtures/uploadusers.js +2 -2
  140. package/lib/template/back-office/brand-update/test/fixtures/uploadusers.js.map +1 -1
  141. package/package.json +2 -2
  142. package/es/template/back-office/brand-update/test/fixtures/manageusers.js +0 -11
  143. package/es/template/back-office/brand-update/test/fixtures/manageusers.js.map +0 -1
  144. package/lib/template/back-office/brand-update/test/fixtures/manageusers.js +0 -25
  145. package/lib/template/back-office/brand-update/test/fixtures/manageusers.js.map +0 -1
@@ -1,3 +1,5 @@
1
+ import _isEmpty from "lodash/fp/isEmpty";
2
+ import _keys from "lodash/fp/keys";
1
3
  import _set from "lodash/fp/set";
2
4
  import _get from "lodash/fp/get";
3
5
  import _filter from "lodash/fp/filter";
@@ -10,15 +12,17 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
10
12
  import React, { useState, useEffect, useRef, useCallback } from 'react';
11
13
  import PropTypes from 'prop-types';
12
14
  import classnames from 'classnames';
13
- import { NovaCompositionNavigationArrowDown as ArrowDown } from '@coorpacademy/nova-icons';
15
+ import { NovaCompositionNavigationArrowDown as ArrowDown, NovaSolidStatusClose as ErrorIcon, NovaCompositionCoorpacademyInformationIcon as InfoIcon } from '@coorpacademy/nova-icons';
14
16
  import TitledCheckbox from '../titled-checkbox';
15
17
  import Provider from '../../atom/provider';
18
+ import Checkbox from '../../atom/input-checkbox';
16
19
  import getClassState from '../../util/get-class-state';
17
20
  import style from './style.css';
18
21
  const themeStyle = {
19
22
  setup: style.setup,
20
23
  cockpit: style.cockpit,
21
- sidebar: style.sidebar
24
+ sidebar: style.sidebar,
25
+ coorpmanager: style.coorpmanager
22
26
  };
23
27
  export const useChoices = options => {
24
28
  const choicesRef = useRef(options);
@@ -36,17 +40,49 @@ export const useChoices = options => {
36
40
  return [getChoices, setChoices];
37
41
  };
38
42
 
43
+ const CMMultipleView = ({
44
+ multiple,
45
+ choice,
46
+ onChange
47
+ }) => {
48
+ const handleChange = useCallback(checked => {
49
+ if (!multiple) {
50
+ return onChange(choice);
51
+ }
52
+
53
+ return onChange(_extends(_extends({}, choice), {}, {
54
+ selected: checked
55
+ }));
56
+ }, [onChange, choice, multiple]);
57
+ return multiple ? /*#__PURE__*/React.createElement("div", {
58
+ className: style.item
59
+ }, /*#__PURE__*/React.createElement(Checkbox, {
60
+ titleStyle: "inherit",
61
+ checked: choice.selected,
62
+ onChange: handleChange,
63
+ noLabelMargins: true,
64
+ title: choice.name
65
+ })) : /*#__PURE__*/React.createElement("span", {
66
+ className: style.item,
67
+ onClick: handleChange,
68
+ title: choice.name
69
+ }, choice.name);
70
+ };
71
+
39
72
  const SelectMultiple = ({
40
73
  title,
41
74
  options,
42
75
  theme,
43
76
  placeholder,
44
77
  description,
78
+ hint,
45
79
  multiple,
46
80
  onChange,
81
+ onError,
47
82
  modified = false,
48
83
  required = false,
49
- error = false
84
+ error = '',
85
+ disabled = false
50
86
  }, {
51
87
  skin
52
88
  }) => {
@@ -59,10 +95,11 @@ const SelectMultiple = ({
59
95
  const black = _get('common.black', skin);
60
96
 
61
97
  const handleOnClick = useCallback(e => {
98
+ if (disabled) return;
62
99
  e.preventDefault();
63
100
  e.stopPropagation();
64
101
  updateIsOpened(prev => !prev);
65
- }, []);
102
+ }, [disabled]);
66
103
  const closeHandle = useCallback(e => {
67
104
  if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {
68
105
  updateIsOpened(false);
@@ -86,6 +123,7 @@ const SelectMultiple = ({
86
123
  document.removeEventListener('touchstart', closeHandle);
87
124
  };
88
125
  }, [closeHandle]);
126
+ const isCMTheme = theme === 'coorpmanager';
89
127
 
90
128
  const lines = _map.convert({
91
129
  cap: false
@@ -93,7 +131,13 @@ const SelectMultiple = ({
93
131
  return /*#__PURE__*/React.createElement("li", {
94
132
  key: i,
95
133
  className: style.choice
96
- }, /*#__PURE__*/React.createElement(TitledCheckbox, {
134
+ }, isCMTheme ? /*#__PURE__*/React.createElement(CMMultipleView, {
135
+ multiple: multiple,
136
+ choice: _extends(_extends({}, choice), {}, {
137
+ i
138
+ }),
139
+ onChange: handleChange
140
+ }) : /*#__PURE__*/React.createElement(TitledCheckbox, {
97
141
  onToggle: handleChange,
98
142
  choice: _extends(_extends({}, choice), {}, {
99
143
  i
@@ -108,47 +152,86 @@ const SelectMultiple = ({
108
152
 
109
153
  const _title = title && `${title}${required ? ' *' : ''}`;
110
154
 
111
- const titleView = title ? /*#__PURE__*/React.createElement("span", {
112
- className: style.title
113
- }, _title, " ") : null;
114
155
  const isActive = isOpened === true;
156
+ const titleView = title ? /*#__PURE__*/React.createElement("span", {
157
+ className: classnames(style.title, isCMTheme && selection && style.titleWithSelection, isCMTheme && _isEmpty(selection) && style.noValue, isActive && style.active)
158
+ }, _title, isCMTheme ? /*#__PURE__*/React.createElement("div", {
159
+ className: style.infoIconWrapper
160
+ }, /*#__PURE__*/React.createElement(InfoIcon, {
161
+ className: style.infoIcon
162
+ }), /*#__PURE__*/React.createElement("div", {
163
+ className: style.descriptionLabel
164
+ }, description)) : null) : null;
165
+ const hintView = isCMTheme && !isActive ? /*#__PURE__*/React.createElement("div", {
166
+ className: style.hint // eslint-disable-next-line react/no-danger
167
+ ,
168
+ dangerouslySetInnerHTML: {
169
+ __html: error || hint
170
+ }
171
+ }) : null;
115
172
  const mainClass = theme ? themeStyle[theme] : style.default;
173
+ const showPlaceholder = isCMTheme && isActive;
116
174
  const behaviourClassName = getClassState(style.default, style.modified, style.error, modified, error);
175
+ const errorIconView = error ? /*#__PURE__*/React.createElement(ErrorIcon, {
176
+ onClick: onError,
177
+ className: style.errorIcon
178
+ }) : null;
117
179
  return /*#__PURE__*/React.createElement("div", {
118
- className: classnames(mainClass, behaviourClassName),
180
+ className: classnames(mainClass, behaviourClassName, disabled && style.disabled),
119
181
  ref: nodeRef
120
- }, /*#__PURE__*/React.createElement("label", null, titleView, /*#__PURE__*/React.createElement("div", {
182
+ }, /*#__PURE__*/React.createElement("label", null, !isCMTheme && titleView, /*#__PURE__*/React.createElement("div", {
121
183
  className: style.select,
122
184
  title: selection || placeholder,
123
185
  onClick: handleOnClick
124
- }, selection || placeholder, /*#__PURE__*/React.createElement(ArrowDown, {
186
+ }, isCMTheme && titleView, /*#__PURE__*/React.createElement("span", {
187
+ className: classnames(style.selection, isCMTheme && _isEmpty(selection) && style.noselection)
188
+ }, selection || !isCMTheme || showPlaceholder && placeholder || null), isCMTheme ? /*#__PURE__*/React.createElement("div", {
189
+ className: style.iconsWrapper
190
+ }, /*#__PURE__*/React.createElement("div", {
191
+ className: style.flex
192
+ }, errorIconView), /*#__PURE__*/React.createElement("div", {
193
+ className: classnames(style.flex, isActive && style.clicked)
194
+ }, /*#__PURE__*/React.createElement(ArrowDown, {
195
+ color: black,
196
+ className: classnames(style.arrow, {
197
+ [style.down]: isActive
198
+ })
199
+ }))) : /*#__PURE__*/React.createElement(ArrowDown, {
125
200
  color: black,
126
201
  className: classnames(style.arrow, {
127
202
  [style.down]: isActive
128
203
  })
129
204
  })), /*#__PURE__*/React.createElement("div", {
130
- className: isActive ? style.activeChoices : style.choices
205
+ className: classnames(style.choices, isActive && style.activeChoices)
131
206
  }, /*#__PURE__*/React.createElement("ul", {
132
207
  className: style.list
133
- }, lines))), /*#__PURE__*/React.createElement("div", {
208
+ }, lines))), !isCMTheme ? /*#__PURE__*/React.createElement("div", {
134
209
  className: style.description
135
- }, description));
210
+ }, description) : null, hintView);
136
211
  };
137
212
 
138
213
  SelectMultiple.contextTypes = {
139
214
  skin: Provider.childContextTypes.skin
140
215
  };
216
+ CMMultipleView.propTypes = process.env.NODE_ENV !== "production" ? {
217
+ multiple: PropTypes.bool,
218
+ choice: TitledCheckbox.propTypes.choice,
219
+ onChange: PropTypes.func
220
+ } : {};
141
221
  SelectMultiple.propTypes = process.env.NODE_ENV !== "production" ? {
142
222
  title: PropTypes.string,
143
223
  placeholder: PropTypes.string,
144
224
  description: PropTypes.string,
225
+ hint: PropTypes.string,
145
226
  options: PropTypes.arrayOf(TitledCheckbox.propTypes.choice),
146
227
  onChange: PropTypes.func,
228
+ onError: PropTypes.func,
147
229
  multiple: PropTypes.bool,
148
- theme: PropTypes.string,
149
230
  modified: PropTypes.bool,
231
+ disabled: PropTypes.bool,
150
232
  required: PropTypes.bool,
151
- error: PropTypes.bool
233
+ error: PropTypes.string,
234
+ theme: PropTypes.oneOf(_keys(themeStyle))
152
235
  } : {};
153
236
  export default SelectMultiple;
154
237
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/molecule/select-multiple/index.js"],"names":["React","useState","useEffect","useRef","useCallback","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","TitledCheckbox","Provider","getClassState","style","themeStyle","setup","cockpit","sidebar","useChoices","options","choicesRef","getChoices","current","setChoices","choice","choices","i","selected","filter","c","SelectMultiple","title","theme","placeholder","description","multiple","onChange","modified","required","error","skin","isOpened","updateIsOpened","nodeRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","handleChange","document","addEventListener","removeEventListener","lines","convert","cap","selection","_title","titleView","isActive","mainClass","default","behaviourClassName","select","arrow","down","activeChoices","list","contextTypes","childContextTypes","propTypes","string","arrayOf","func","bool"],"mappings":";;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,MAApC,EAA4CC,WAA5C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SAAQC,kCAAkC,IAAIC,SAA9C,QAA8D,0BAA9D;AACA,OAAOC,cAAP,MAA2B,oBAA3B;AACA,OAAOC,QAAP,MAAqB,qBAArB;AACA,OAAOC,aAAP,MAA0B,4BAA1B;AACA,OAAOC,KAAP,MAAkB,aAAlB;AAEA,MAAMC,UAAU,GAAG;AACjBC,EAAAA,KAAK,EAAEF,KAAK,CAACE,KADI;AAEjBC,EAAAA,OAAO,EAAEH,KAAK,CAACG,OAFE;AAGjBC,EAAAA,OAAO,EAAEJ,KAAK,CAACI;AAHE,CAAnB;AAMA,OAAO,MAAMC,UAAU,GAAGC,OAAO,IAAI;AACnC,QAAMC,UAAU,GAAGhB,MAAM,CAACe,OAAD,CAAzB;;AAEA,QAAME,UAAU,GAAG,MAAM;AACvB,WAAOD,UAAU,CAACE,OAAlB;AACD,GAFD;;AAIA,QAAMC,UAAU,GAAGC,MAAM,IAAI;AAC3B,UAAMC,OAAO,GAAG,KAAK,IAAGD,MAAM,CAACE,CAAE,YAAjB,EAA8B,CAACF,MAAM,CAACG,QAAtC,EAAgDN,UAAU,EAA1D,CAAhB;;AAEAD,IAAAA,UAAU,CAACE,OAAX,GAAqBG,OAAO,CAACG,MAAR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AoCA,WAApC,CAXF,CADF;AAeD,CAlGD;;AAoGAJ,cAAc,CAAC2C,YAAf,GAA8B;AAC5BjC,EAAAA,IAAI,EAAE7B,QAAQ,CAAC+D,iBAAT,CAA2BlC;AADL,CAA9B;AAIAV,cAAc,CAAC6C,SAAf,2CAA2B;AACzB5C,EAAAA,KAAK,EAAEzB,SAAS,CAACsE,MADQ;AAEzB3C,EAAAA,WAAW,EAAE3B,SAAS,CAACsE,MAFE;AAGzB1C,EAAAA,WAAW,EAAE5B,SAAS,CAACsE,MAHE;AAIzBzD,EAAAA,OAAO,EAAEb,SAAS,CAACuE,OAAV,CAAkBnE,cAAc,CAACiE,SAAf,CAAyBnD,MAA3C,CAJgB;AAKzBY,EAAAA,QAAQ,EAAE9B,SAAS,CAACwE,IALK;AAMzB3C,EAAAA,QAAQ,EAAE7B,SAAS,CAACyE,IANK;AAOzB/C,EAAAA,KAAK,EAAE1B,SAAS,CAACsE,MAPQ;AAQzBvC,EAAAA,QAAQ,EAAE/B,SAAS,CAACyE,IARK;AASzBzC,EAAAA,QAAQ,EAAEhC,SAAS,CAACyE,IATK;AAUzBxC,EAAAA,KAAK,EAAEjC,SAAS,CAACyE;AAVQ,CAA3B;AAaA,eAAejD,cAAf","sourcesContent":["import React, {useState, useEffect, useRef, useCallback} from 'react';\nimport PropTypes from 'prop-types';\nimport classnames from 'classnames';\nimport {map, pipe, join, filter, get, set} from 'lodash/fp';\nimport {NovaCompositionNavigationArrowDown as ArrowDown} from '@coorpacademy/nova-icons';\nimport TitledCheckbox from '../titled-checkbox';\nimport Provider from '../../atom/provider';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n cockpit: style.cockpit,\n sidebar: style.sidebar\n};\n\nexport const useChoices = options => {\n const choicesRef = useRef(options);\n\n const getChoices = () => {\n return choicesRef.current;\n };\n\n const setChoices = choice => {\n const choices = set(`[${choice.i}].selected`, !choice.selected, getChoices());\n\n choicesRef.current = choices.filter(c => c.selected);\n };\n\n return [getChoices, setChoices];\n};\n\nconst SelectMultiple = (\n {\n title,\n options,\n theme,\n placeholder,\n description,\n multiple,\n onChange,\n modified = false,\n required = false,\n error = false\n },\n {skin}\n) => {\n const [isOpened, updateIsOpened] = useState(false);\n const [getChoices, setChoices] = useChoices(options);\n const nodeRef = useRef(null);\n\n const defaultColor = get('common.primary', skin);\n const black = get('common.black', skin);\n\n const handleOnClick = useCallback(e => {\n e.preventDefault();\n e.stopPropagation();\n\n updateIsOpened(prev => !prev);\n }, []);\n\n const closeHandle = useCallback(e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n updateIsOpened(false);\n }\n }, []);\n\n const handleChange = useCallback(\n choice => {\n // if multiple prop is turned on\n // we return all selected choices\n if (multiple) {\n setChoices(choice);\n\n return onChange(getChoices());\n }\n\n return onChange(choice);\n },\n [setChoices, multiple, onChange]\n );\n\n useEffect(() => {\n document.addEventListener('click', closeHandle);\n document.addEventListener('touchstart', closeHandle);\n\n return () => {\n document.removeEventListener('click', closeHandle);\n document.removeEventListener('touchstart', closeHandle);\n };\n }, [closeHandle]);\n\n const lines = map.convert({cap: false})((choice, i) => {\n return (\n <li key={i} className={style.choice}>\n <TitledCheckbox onToggle={handleChange} choice={{...choice, i}} background={defaultColor} />\n </li>\n );\n }, options);\n\n const selection = pipe(filter({selected: true}), map('name'), join(', '))(options);\n\n const _title = title && `${title}${required ? ' *' : ''}`;\n\n const titleView = title ? <span className={style.title}>{_title} </span> : null;\n const isActive = isOpened === true;\n const mainClass = theme ? themeStyle[theme] : style.default;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n\n return (\n <div className={classnames(mainClass, behaviourClassName)} ref={nodeRef}>\n <label>\n {titleView}\n <div className={style.select} title={selection || placeholder} onClick={handleOnClick}>\n {selection || placeholder}\n <ArrowDown color={black} className={classnames(style.arrow, {[style.down]: isActive})} />\n </div>\n <div className={isActive ? style.activeChoices : style.choices}>\n <ul className={style.list}>{lines}</ul>\n </div>\n </label>\n <div className={style.description}>{description}</div>\n </div>\n );\n};\n\nSelectMultiple.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nSelectMultiple.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n description: PropTypes.string,\n options: PropTypes.arrayOf(TitledCheckbox.propTypes.choice),\n onChange: PropTypes.func,\n multiple: PropTypes.bool,\n theme: PropTypes.string,\n modified: PropTypes.bool,\n required: PropTypes.bool,\n error: PropTypes.bool\n};\n\nexport default SelectMultiple;\n"],"file":"index.js"}
1
+ {"version":3,"sources":["../../../src/molecule/select-multiple/index.js"],"names":["React","useState","useEffect","useRef","useCallback","PropTypes","classnames","NovaCompositionNavigationArrowDown","ArrowDown","NovaSolidStatusClose","ErrorIcon","NovaCompositionCoorpacademyInformationIcon","InfoIcon","TitledCheckbox","Provider","Checkbox","getClassState","style","themeStyle","setup","cockpit","sidebar","coorpmanager","useChoices","options","choicesRef","getChoices","current","setChoices","choice","choices","i","selected","filter","c","CMMultipleView","multiple","onChange","handleChange","checked","item","name","SelectMultiple","title","theme","placeholder","description","hint","onError","modified","required","error","disabled","skin","isOpened","updateIsOpened","nodeRef","defaultColor","black","handleOnClick","e","preventDefault","stopPropagation","prev","closeHandle","contains","target","document","addEventListener","removeEventListener","isCMTheme","lines","convert","cap","selection","_title","isActive","titleView","titleWithSelection","noValue","active","infoIconWrapper","infoIcon","descriptionLabel","hintView","__html","mainClass","default","showPlaceholder","behaviourClassName","errorIconView","errorIcon","select","noselection","iconsWrapper","flex","clicked","arrow","down","activeChoices","list","contextTypes","childContextTypes","propTypes","bool","func","string","arrayOf","oneOf"],"mappings":";;;;;;;;;;;AAAA,OAAOA,KAAP,IAAeC,QAAf,EAAyBC,SAAzB,EAAoCC,MAApC,EAA4CC,WAA5C,QAA8D,OAA9D;AACA,OAAOC,SAAP,MAAsB,YAAtB;AACA,OAAOC,UAAP,MAAuB,YAAvB;AAEA,SACEC,kCAAk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nimport classnames from 'classnames';\nimport {map, pipe, join, filter, get, set, keys, isEmpty} from 'lodash/fp';\nimport {\n NovaCompositionNavigationArrowDown as ArrowDown,\n NovaSolidStatusClose as ErrorIcon,\n NovaCompositionCoorpacademyInformationIcon as InfoIcon\n} from '@coorpacademy/nova-icons';\nimport TitledCheckbox from '../titled-checkbox';\nimport Provider from '../../atom/provider';\nimport Checkbox from '../../atom/input-checkbox';\nimport getClassState from '../../util/get-class-state';\nimport style from './style.css';\n\nconst themeStyle = {\n setup: style.setup,\n cockpit: style.cockpit,\n sidebar: style.sidebar,\n coorpmanager: style.coorpmanager\n};\n\nexport const useChoices = options => {\n const choicesRef = useRef(options);\n\n const getChoices = () => {\n return choicesRef.current;\n };\n\n const setChoices = choice => {\n const choices = set(`[${choice.i}].selected`, !choice.selected, getChoices());\n\n choicesRef.current = choices.filter(c => c.selected);\n };\n\n return [getChoices, setChoices];\n};\n\nconst CMMultipleView = ({multiple, choice, onChange}) => {\n const handleChange = useCallback(\n checked => {\n if (!multiple) {\n return onChange(choice);\n }\n return onChange({...choice, selected: checked});\n },\n [onChange, choice, multiple]\n );\n\n return multiple ? (\n <div className={style.item}>\n <Checkbox\n titleStyle=\"inherit\"\n checked={choice.selected}\n onChange={handleChange}\n noLabelMargins\n title={choice.name}\n />\n </div>\n ) : (\n <span className={style.item} onClick={handleChange} title={choice.name}>\n {choice.name}\n </span>\n );\n};\n\nconst SelectMultiple = (\n {\n title,\n options,\n theme,\n placeholder,\n description,\n hint,\n multiple,\n onChange,\n onError,\n modified = false,\n required = false,\n error = '',\n disabled = false\n },\n {skin}\n) => {\n const [isOpened, updateIsOpened] = useState(false);\n const [getChoices, setChoices] = useChoices(options);\n const nodeRef = useRef(null);\n\n const defaultColor = get('common.primary', skin);\n const black = get('common.black', skin);\n\n const handleOnClick = useCallback(\n e => {\n if (disabled) return;\n\n e.preventDefault();\n e.stopPropagation();\n\n updateIsOpened(prev => !prev);\n },\n [disabled]\n );\n\n const closeHandle = useCallback(e => {\n if (nodeRef && nodeRef.current && !nodeRef.current.contains(e.target)) {\n updateIsOpened(false);\n }\n }, []);\n\n const handleChange = useCallback(\n choice => {\n // if multiple prop is turned on\n // we return all selected choices\n if (multiple) {\n setChoices(choice);\n\n return onChange(getChoices());\n }\n\n return onChange(choice);\n },\n [setChoices, multiple, onChange]\n );\n\n useEffect(() => {\n document.addEventListener('click', closeHandle);\n document.addEventListener('touchstart', closeHandle);\n\n return () => {\n document.removeEventListener('click', closeHandle);\n document.removeEventListener('touchstart', closeHandle);\n };\n }, [closeHandle]);\n\n const isCMTheme = theme === 'coorpmanager';\n\n const lines = map.convert({cap: false})((choice, i) => {\n return (\n <li key={i} className={style.choice}>\n {isCMTheme ? (\n <CMMultipleView multiple={multiple} choice={{...choice, i}} onChange={handleChange} />\n ) : (\n <TitledCheckbox\n onToggle={handleChange}\n choice={{...choice, i}}\n background={defaultColor}\n />\n )}\n </li>\n );\n }, options);\n\n const selection = pipe(filter({selected: true}), map('name'), join(', '))(options);\n\n const _title = title && `${title}${required ? ' *' : ''}`;\n\n const isActive = isOpened === true;\n\n const titleView = title ? (\n <span\n className={classnames(\n style.title,\n isCMTheme && selection && style.titleWithSelection,\n isCMTheme && isEmpty(selection) && style.noValue,\n isActive && style.active\n )}\n >\n {_title}\n {isCMTheme ? (\n <div className={style.infoIconWrapper}>\n <InfoIcon className={style.infoIcon} />\n <div className={style.descriptionLabel}>{description}</div>\n </div>\n ) : null}\n </span>\n ) : null;\n\n const hintView =\n isCMTheme && !isActive ? (\n <div\n className={style.hint}\n // eslint-disable-next-line react/no-danger\n dangerouslySetInnerHTML={{__html: error || hint}}\n />\n ) : null;\n\n const mainClass = theme ? themeStyle[theme] : style.default;\n const showPlaceholder = isCMTheme && isActive;\n const behaviourClassName = getClassState(\n style.default,\n style.modified,\n style.error,\n modified,\n error\n );\n\n const errorIconView = error ? <ErrorIcon onClick={onError} className={style.errorIcon} /> : null;\n\n return (\n <div\n className={classnames(mainClass, behaviourClassName, disabled && style.disabled)}\n ref={nodeRef}\n >\n <label>\n {!isCMTheme && titleView}\n <div className={style.select} title={selection || placeholder} onClick={handleOnClick}>\n {isCMTheme && titleView}\n <span\n className={classnames(\n style.selection,\n isCMTheme && isEmpty(selection) && style.noselection\n )}\n >\n {selection || !isCMTheme || (showPlaceholder && placeholder) || null}\n </span>\n {isCMTheme ? (\n <div className={style.iconsWrapper}>\n <div className={style.flex}>{errorIconView}</div>\n <div className={classnames(style.flex, isActive && style.clicked)}>\n <ArrowDown\n color={black}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n </div>\n </div>\n ) : (\n <ArrowDown\n color={black}\n className={classnames(style.arrow, {[style.down]: isActive})}\n />\n )}\n </div>\n <div className={classnames(style.choices, isActive && style.activeChoices)}>\n <ul className={style.list}>{lines}</ul>\n </div>\n </label>\n {!isCMTheme ? <div className={style.description}>{description}</div> : null}\n {hintView}\n </div>\n );\n};\n\nSelectMultiple.contextTypes = {\n skin: Provider.childContextTypes.skin\n};\n\nCMMultipleView.propTypes = {\n multiple: PropTypes.bool,\n choice: TitledCheckbox.propTypes.choice,\n onChange: PropTypes.func\n};\n\nSelectMultiple.propTypes = {\n title: PropTypes.string,\n placeholder: PropTypes.string,\n description: PropTypes.string,\n hint: PropTypes.string,\n options: PropTypes.arrayOf(TitledCheckbox.propTypes.choice),\n onChange: PropTypes.func,\n onError: PropTypes.func,\n multiple: PropTypes.bool,\n modified: PropTypes.bool,\n disabled: PropTypes.bool,\n required: PropTypes.bool,\n error: PropTypes.string,\n theme: PropTypes.oneOf(keys(themeStyle))\n};\n\nexport default SelectMultiple;\n"],"file":"index.js"}
@@ -6,6 +6,12 @@
6
6
  @value lightGrey from colors;
7
7
  @value negative from colors;
8
8
  @value xtraLightGrey from colors;
9
+ @value cm_grey_400 from colors;
10
+ @value cm_grey_700 from colors;
11
+ @value cm_grey_200 from colors;
12
+ @value cm_grey_150 from colors;
13
+ @value cm_grey_100 from colors;
14
+ @value cm_negative_100 from colors;
9
15
  @value medium from colors;
10
16
  @value defaultText from "../../variables/fonts.css";
11
17
 
@@ -57,24 +63,29 @@
57
63
  }
58
64
 
59
65
  .choices {
60
- display: none;
61
- }
62
-
63
- .activeChoices {
64
66
  display: block;
67
+ visibility: hidden;
65
68
  width: 100%;
66
- height: auto;
67
69
  padding: 0 15px;
68
70
  box-sizing: border-box;
69
71
  background: white;
70
72
  position: absolute;
71
73
  z-index: 4;
72
- top: 100%;
74
+ top: 48px;
73
75
  left: 0;
74
76
  border: 1px solid light;
75
77
  user-select: none;
76
- max-height: 200px;
77
78
  overflow: scroll;
79
+ max-height: 0;
80
+ transition: all 0.25s linear;
81
+ opacity: 1;
82
+ }
83
+
84
+ .activeChoices {
85
+ visibility: visible;
86
+ height: auto;
87
+ max-height: 200px;
88
+ opacity: 1;
78
89
  }
79
90
 
80
91
  .choice {
@@ -83,12 +94,14 @@
83
94
  padding: 0;
84
95
  }
85
96
 
86
- .choice div {
97
+ .choice .item {
98
+ font-size: 14px;
99
+ user-select: none;
87
100
  text-overflow: ellipsis;
88
101
  white-space: nowrap;
89
102
  overflow: hidden;
90
- font-size: 13px;
91
- user-select: none;
103
+ width: 100%;
104
+ display: block;
92
105
  }
93
106
 
94
107
  .arrow {
@@ -110,6 +123,7 @@
110
123
  margin: 0;
111
124
  padding: 0;
112
125
  }
126
+
113
127
  .description {
114
128
  font-family: 'Open Sans';
115
129
  font-weight: 500;
@@ -118,12 +132,14 @@
118
132
  font-style: italic;
119
133
  margin: auto 0;
120
134
  }
135
+
121
136
  /*
122
137
  setup sidebar
123
138
  */
124
139
  .sidebar {
125
140
  width: 150px;
126
141
  }
142
+
127
143
  /*
128
144
  setup theme
129
145
  */
@@ -171,6 +187,7 @@
171
187
  display: inline-flex;
172
188
  align-items: center;
173
189
  }
190
+
174
191
  /*
175
192
  cockpit theme
176
193
  */
@@ -201,4 +218,269 @@
201
218
  .cockpit .activeChoices {
202
219
  width: 170px;
203
220
  border-top: none;
204
- }
221
+ }
222
+
223
+ /* COORPMANAGER THEME */
224
+
225
+ .coorpmanager .select {
226
+ display: flex;
227
+ flex-direction: column;
228
+ justify-content: center;
229
+ border-radius: 8px;
230
+ width: 100%;
231
+ font-size: 14px;
232
+ color: black;
233
+ height: 44px;
234
+ padding: 11px 85px 11px 16px;
235
+ background-color: cm_grey_100;
236
+ }
237
+
238
+ .coorpmanager .select .title {
239
+ display: flex;
240
+ flex-direction: row;
241
+ flex-grow: 0;
242
+ font-family: Gilroy;
243
+ font-weight: bold;
244
+ font-stretch: normal;
245
+ font-style: normal;
246
+ letter-spacing: normal;
247
+ text-align: left;
248
+ font-size: 14px;
249
+ z-index: 1;
250
+ color: cm_grey_700;
251
+ transition: all 0.25s ease;
252
+ pointer-events: none;
253
+ flex-wrap: nowrap;
254
+ position: absolute;
255
+ top: 7px;
256
+ left: 16px;
257
+ }
258
+
259
+ .coorpmanager .select:hover {
260
+ background-color: cm_grey_150;
261
+ }
262
+
263
+ .coorpmanager .select .selection {
264
+ font-size: 14px;
265
+ font-weight: 500;
266
+ transition: all 0.25s ease;
267
+ line-height: 20px;
268
+ margin: 10px 0 -10px 0;
269
+ text-overflow: ellipsis;
270
+ white-space: nowrap;
271
+ overflow: hidden;
272
+ width: 100%;
273
+ }
274
+
275
+ .coorpmanager .select .selection.noselection {
276
+ color: cm_grey_400;
277
+ font-weight: 500;
278
+ }
279
+
280
+ .coorpmanager .select .title.noValue.active,
281
+ .coorpmanager .select .title.titleWithSelection {
282
+ font-size: 10px;
283
+ width: max-content;
284
+ height: 8px;
285
+ line-height: 12px;
286
+ color: cm_grey_400;
287
+ }
288
+
289
+ .coorpmanager .select .title.noValue.active,
290
+ .coorpmanager .select .title.titleWithSelection {
291
+ width: max-content;
292
+ height: 8px;
293
+ line-height: 12px;
294
+ color: cm_grey_400;
295
+ }
296
+
297
+ .coorpmanager .arrow:hover {
298
+ background-color: cm_grey_200;
299
+ }
300
+
301
+ .coorpmanager .activeChoices {
302
+ margin-top: 2px;
303
+ background-color: light;
304
+ border-radius: 8px;
305
+ }
306
+
307
+ .choice {
308
+ color: black;
309
+ }
310
+
311
+ .coorpmanager .infoIconWrapper {
312
+ overflow: visible;
313
+ height: 12px;
314
+ margin: 0 4px;
315
+ cursor: pointer;
316
+ pointer-events: fill;
317
+ position: relative;
318
+ }
319
+
320
+ .coorpmanager .infoIcon {
321
+ cursor: pointer;
322
+ width: 8px;
323
+ margin: 4px 4px 0 4px;
324
+ height: 8px;
325
+ line-height: 16px;
326
+ color: cm_grey_400;
327
+ transition: all 0.25s linear;
328
+ }
329
+
330
+ .coorpmanager .select .title.noValue .infoIcon {
331
+ color: cm_grey_700;
332
+ }
333
+
334
+ .coorpmanager .select .title.noValue.active .infoIcon,
335
+ .coorpmanager .select .title.titleWithSelection .infoIcon {
336
+ color: cm_grey_400;
337
+ margin: 0 4px 0 4px;
338
+ }
339
+
340
+ .coorpmanager .infoIconWrapper:hover .descriptionLabel {
341
+ visibility: visible;
342
+ opacity: 1;
343
+ }
344
+
345
+ .coorpmanager .descriptionLabel {
346
+ margin: 0 1px 18px 0;
347
+ padding: 8px 16px;
348
+ border-radius: 7px;
349
+ background-color: cm_grey_700;
350
+ flex-grow: 0;
351
+ font-family: Gilroy;
352
+ font-size: 14px;
353
+ font-weight: 500;
354
+ font-stretch: normal;
355
+ font-style: normal;
356
+ line-height: 1.43;
357
+ letter-spacing: normal;
358
+ text-align: center;
359
+ color: white;
360
+ max-width: 200px;
361
+ position: absolute;
362
+ left: -19px;
363
+ z-index: 3;
364
+ bottom: 5px;
365
+ width: max-content;
366
+ visibility: hidden;
367
+ opacity: 0s;
368
+ }
369
+
370
+ .coorpmanager .descriptionLabel::after {
371
+ content: '';
372
+ border-left: 6px solid transparent;
373
+ border-right: 6px solid transparent;
374
+ border-top: 6px solid cm_grey_700;
375
+ position: absolute;
376
+ bottom: -6px;
377
+ left: 21px;
378
+ }
379
+
380
+ .coorpmanager .title.noValue .descriptionLabel::after {
381
+ left: 21px;
382
+ }
383
+
384
+ .coorpmanager:focus-within .title.noValue .descriptionLabel::after {
385
+ left: 21px;
386
+ }
387
+
388
+ .coorpmanager .iconsWrapper {
389
+ position: absolute;
390
+ display: flex;
391
+ justify-content: space-around;
392
+ align-items: center;
393
+ width: 88px;
394
+ height: 44px;
395
+ right: 0;
396
+ }
397
+
398
+ .coorpmanager .flex {
399
+ width: 44px;
400
+ height: 44px;
401
+ display: flex;
402
+ justify-content: center;
403
+ align-items: center;
404
+ }
405
+
406
+ .coorpmanager .flex:nth-child(2) {
407
+ padding: 0 16px;
408
+ margin-left: 16px;
409
+ }
410
+
411
+ .coorpmanager .flex .arrow {
412
+ position: relative;
413
+ right: 0;
414
+ margin-top: 0;
415
+ top: 0%;
416
+ pointer-events: none;
417
+ width: 12px;
418
+ height: 12px;
419
+ transition: transform 0.25s;
420
+ cursor: pointer;
421
+ }
422
+
423
+ .coorpmanager .flex.clicked {
424
+ background-color: cm_grey_200;
425
+ }
426
+
427
+ .coorpmanager .arrow.down {
428
+ cursor: pointer;
429
+ transform: rotate(180deg);
430
+ }
431
+
432
+ .coorpmanager .errorIcon {
433
+ background-color: cm_negative_100;
434
+ color: white;
435
+ padding: 4px;
436
+ border-radius: 50%;
437
+ width: 10px;
438
+ height: 10px;
439
+ cursor: pointer;
440
+ }
441
+
442
+ .coorpmanager .hint {
443
+ flex-grow: 0;
444
+ opacity: 0.5;
445
+ font-family: Gilroy;
446
+ font-size: 10px;
447
+ font-weight: 500;
448
+ font-stretch: normal;
449
+ font-style: normal;
450
+ line-height: 1.2;
451
+ letter-spacing: normal;
452
+ text-align: left;
453
+ padding-top: 8px;
454
+ transition: transform 0.25s;
455
+ color: cm_grey_700;
456
+ }
457
+
458
+ .coorpmanager.error .hint {
459
+ color: cm_negative_100;
460
+ }
461
+
462
+ .coorpmanager.disabled .select {
463
+ background-color: cm_grey_100;
464
+ }
465
+
466
+ .coorpmanager.disabled .select .selection {
467
+ color: cm_grey_100;
468
+ }
469
+
470
+ .coorpmanager.disabled .select .title {
471
+ color: cm_grey_700;
472
+ }
473
+
474
+ .coorpmanager.disabled .select .title.noValue,
475
+ .coorpmanager.disabled .select .selection {
476
+ color: cm_grey_700;
477
+ opacity: 0.5;
478
+ }
479
+
480
+ .coorpmanager.disabled .select .title.titleWithSelection {
481
+ color: cm_grey_400;
482
+ }
483
+
484
+ .coorpmanager.disabled .arrow {
485
+ opacity: 0.5;
486
+ }
@@ -0,0 +1,32 @@
1
+ export default {
2
+ props: {
3
+ theme: 'coorpmanager',
4
+ placeholder: 'Select language(s)',
5
+ title: 'Input Name',
6
+ description: 'You should select a language',
7
+ multiple: false,
8
+ disabled: true,
9
+ error: '',
10
+ hint: 'Hint',
11
+ options: [{
12
+ name: '🇬🇧 English',
13
+ value: 'en',
14
+ selected: true
15
+ }, {
16
+ name: '🇩🇪 German',
17
+ value: 'de',
18
+ selected: false
19
+ }, {
20
+ name: '🇹🇭 Thai',
21
+ value: 'th',
22
+ selected: false
23
+ }, {
24
+ name: '🇪🇸 Spanish',
25
+ value: 'es',
26
+ selected: false
27
+ }],
28
+ onChange: value => console.log('onChange', value),
29
+ onError: () => true
30
+ }
31
+ };
32
+ //# sourceMappingURL=checked-cm-theme-disabled.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/molecule/select-multiple/test/fixtures/checked-cm-theme-disabled.js"],"names":["props","theme","placeholder","title","description","multiple","disabled","error","hint","options","name","value","selected","onChange","console","log","onError"],"mappings":"AAAA,eAAe;AACbA,EAAAA,KAAK,EAAE;AACLC,IAAAA,KAAK,EAAE,cADF;AAELC,IAAAA,WAAW,EAAE,oBAFR;AAGLC,IAAAA,KAAK,EAAE,YAHF;AAILC,IAAAA,WAAW,EAAE,8BAJR;AAKLC,IAAAA,QAAQ,EAAE,KALL;AAMLC,IAAAA,QAAQ,EAAE,IANL;AAOLC,IAAAA,KAAK,EAAE,EAPF;AAQLC,IAAAA,IAAI,EAAE,MARD;AASLC,IAAAA,OAAO,EAAE,CACP;AACEC,MAAAA,IAAI,EAAE,cADR;AAEEC,MAAAA,KAAK,EAAE,IAFT;AAGEC,MAAAA,QAAQ,EAAE;AAHZ,KADO,EAMP;AACEF,MAAAA,IAAI,EAAE,aADR;AAEEC,MAAAA,KAAK,EAAE,IAFT;AAGEC,MAAAA,QAAQ,EAAE;AAHZ,KANO,EAWP;AACEF,MAAAA,IAAI,EAAE,WADR;AAEEC,MAAAA,KAAK,EAAE,IAFT;AAGEC,MAAAA,QAAQ,EAAE;AAHZ,KAXO,EAgBP;AACEF,MAAAA,IAAI,EAAE,cADR;AAEEC,MAAAA,KAAK,EAAE,IAFT;AAGEC,MAAAA,QAAQ,EAAE;AAHZ,KAhBO,CATJ;AA+BLC,IAAAA,QAAQ,EAAEF,KAAK,IAAIG,OAAO,CAACC,GAAR,CAAY,UAAZ,EAAwBJ,KAAxB,CA/Bd;AAgCLK,IAAAA,OAAO,EAAE,MAAM;AAhCV;AADM,CAAf","sourcesContent":["export default {\n props: {\n theme: 'coorpmanager',\n placeholder: 'Select language(s)',\n title: 'Input Name',\n description: 'You should select a language',\n multiple: false,\n disabled: true,\n error: '',\n hint: 'Hint',\n options: [\n {\n name: '🇬🇧 English',\n value: 'en',\n selected: true\n },\n {\n name: '🇩🇪 German',\n value: 'de',\n selected: false\n },\n {\n name: '🇹🇭 Thai',\n value: 'th',\n selected: false\n },\n {\n name: '🇪🇸 Spanish',\n value: 'es',\n selected: false\n }\n ],\n onChange: value => console.log('onChange', value),\n onError: () => true\n }\n};\n"],"file":"checked-cm-theme-disabled.js"}