@nestio/pam 2.0.5-beta.3 → 2.0.6-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/examples/components/Select.jsx +12 -26
- package/examples/index.html +0 -5
- package/lib/components/MultiSelect.js +3 -3
- package/lib/components/MultiSelectOption.js +3 -22
- package/lib/components/OptionListSet.js +3 -11
- package/lib/components/SelectCore.js +26 -84
- package/lib/components/SelectOption.js +11 -43
- package/lib/components/SingleSelect.js +0 -2
- package/lib/components/TagBoxMenuSelect.js +0 -2
- package/lib/components/styles/MultiSelectOption.scss +0 -4
- package/lib/components/styles/SelectOption.scss +0 -12
- package/lib/components/styles/_variables.scss +0 -1
- package/lib/components/styles/icons/05a4d7fb.eot +0 -0
- package/lib/components/styles/icons/05a4d7fb.otf +0 -0
- package/lib/components/styles/icons/05a4d7fb.ttf +0 -0
- package/lib/components/styles/icons/05a4d7fb.woff +0 -0
- package/lib/components/styles/icons/icons.css +57 -1
- package/package.json +1 -1
- package/src/components/MultiSelect.jsx +2 -2
- package/src/components/MultiSelectOption.jsx +3 -21
- package/src/components/OptionListSet.jsx +2 -9
- package/src/components/SelectCore.jsx +11 -62
- package/src/components/SelectOption.jsx +8 -26
- package/src/components/SingleSelect.jsx +0 -2
- package/src/components/TagBoxMenuSelect.jsx +0 -2
- package/src/components/__tests__/MultiSelect.spec.js +2 -0
- package/src/components/__tests__/MultiSelectOption.spec.js +2 -36
- package/src/components/__tests__/OptionListSet.spec.js +1 -24
- package/src/components/__tests__/SelectCore.spec.js +0 -103
- package/src/components/__tests__/SelectOption.spec.js +2 -33
- package/src/components/__tests__/SingleSelectOption.spec.js +1 -2
- package/src/components/styles/MultiSelectOption.scss +0 -4
- package/src/components/styles/SelectOption.scss +0 -12
- package/src/components/styles/_variables.scss +0 -1
- package/src/components/styles/icons/05a4d7fb.eot +0 -0
- package/src/components/styles/icons/05a4d7fb.otf +0 -0
- package/src/components/styles/icons/05a4d7fb.ttf +0 -0
- package/src/components/styles/icons/05a4d7fb.woff +0 -0
- package/src/components/styles/icons/icons.css +57 -1
- package/lib/components/Collapse.js +0 -50
- package/lib/constants.js +0 -7
- package/src/components/Collapse.jsx +0 -30
- package/src/components/__tests__/Collapse.spec.js +0 -26
- package/src/constants.js +0 -2
|
@@ -18,19 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
22
21
|
.highlighted {
|
|
23
22
|
background-color: $select-hover-background-color;
|
|
24
23
|
color: $select-hover-text-color;
|
|
25
24
|
}
|
|
26
|
-
|
|
27
|
-
.collapse {
|
|
28
|
-
vertical-align: top;
|
|
29
|
-
padding-right: 8px;
|
|
30
|
-
width: 16px;
|
|
31
|
-
display: inline-block;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.option .collapse-icon {
|
|
35
|
-
font-size: 10px;
|
|
36
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -1 +1,57 @@
|
|
|
1
|
-
@font-face
|
|
1
|
+
@font-face {
|
|
2
|
+
font-family: 'Pam';
|
|
3
|
+
src: url('./05a4d7fb.eot');
|
|
4
|
+
src: url('./05a4d7fb.eot?#iefix') format('embedded-opentype'),
|
|
5
|
+
url('./05a4d7fb.woff') format('woff'),
|
|
6
|
+
url('./05a4d7fb.ttf') format('truetype'),
|
|
7
|
+
url('./05a4d7fb.otf') format('opentype');
|
|
8
|
+
font-weight: normal;
|
|
9
|
+
font-style: normal;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pamicon {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
font: normal normal normal 14px/1 'Pam';
|
|
15
|
+
font-size: inherit;
|
|
16
|
+
text-rendering: auto;
|
|
17
|
+
-webkit-font-smoothing: antialiased;
|
|
18
|
+
-moz-osx-font-smoothing: grayscale;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pamicon-lg {
|
|
22
|
+
font-size: 1.33333333em;
|
|
23
|
+
line-height: 0.75em;
|
|
24
|
+
vertical-align: -15%;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pamicon-2x {
|
|
28
|
+
font-size: 2em;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pamicon-3x {
|
|
32
|
+
font-size: 3em;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pamicon-4x {
|
|
36
|
+
font-size: 4em;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pamicon-5x {
|
|
40
|
+
font-size: 5em;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pamicon-checkbox-checked:before {
|
|
44
|
+
content: '\f000';
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pamicon-checkbox-unchecked:before {
|
|
48
|
+
content: '\f001';
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pamicon-triangle-down:before {
|
|
52
|
+
content: '\f002';
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pamicon-checkbox-intermediate:before {
|
|
56
|
+
content: '\f003';
|
|
57
|
+
}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.default = Collapse;
|
|
7
|
-
|
|
8
|
-
var _classnames = require('classnames');
|
|
9
|
-
|
|
10
|
-
var _classnames2 = _interopRequireDefault(_classnames);
|
|
11
|
-
|
|
12
|
-
var _propTypes = require('prop-types');
|
|
13
|
-
|
|
14
|
-
var _propTypes2 = _interopRequireDefault(_propTypes);
|
|
15
|
-
|
|
16
|
-
var _react = require('react');
|
|
17
|
-
|
|
18
|
-
var _react2 = _interopRequireDefault(_react);
|
|
19
|
-
|
|
20
|
-
var _constants = require('../constants');
|
|
21
|
-
|
|
22
|
-
var _icons = require('./styles/icons/icons.css');
|
|
23
|
-
|
|
24
|
-
var _icons2 = _interopRequireDefault(_icons);
|
|
25
|
-
|
|
26
|
-
var _SelectOption = require('./styles/SelectOption.scss');
|
|
27
|
-
|
|
28
|
-
var _SelectOption2 = _interopRequireDefault(_SelectOption);
|
|
29
|
-
|
|
30
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
31
|
-
|
|
32
|
-
function Collapse(_ref) {
|
|
33
|
-
var onClick = _ref.onClick,
|
|
34
|
-
collapsibleState = _ref.collapsibleState;
|
|
35
|
-
|
|
36
|
-
return _react2.default.createElement(
|
|
37
|
-
'span',
|
|
38
|
-
{
|
|
39
|
-
onClick: onClick,
|
|
40
|
-
className: _SelectOption2.default['collapse'],
|
|
41
|
-
role: 'button'
|
|
42
|
-
},
|
|
43
|
-
_react2.default.createElement('i', { className: (0, _classnames2.default)(_icons2.default.pamicon, collapsibleState == _constants.OPTION_COLLAPSED ? _icons2.default['pamicon-triangle-up'] : _icons2.default['pamicon-triangle-down'], _SelectOption2.default['collapse-icon']) })
|
|
44
|
-
);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
Collapse.propTypes = {
|
|
48
|
-
onClick: _propTypes2.default.func,
|
|
49
|
-
collapsibleState: _propTypes2.default.string
|
|
50
|
-
};
|
package/lib/constants.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import cn from 'classnames';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
|
|
5
|
-
import { OPTION_COLLAPSED } from '../constants';
|
|
6
|
-
import icons from './styles/icons/icons.css';
|
|
7
|
-
import styles from './styles/SelectOption.scss';
|
|
8
|
-
|
|
9
|
-
export default function Collapse ({onClick, collapsibleState}) {
|
|
10
|
-
return (
|
|
11
|
-
<span
|
|
12
|
-
onClick={onClick}
|
|
13
|
-
className={styles['collapse']}
|
|
14
|
-
role="button"
|
|
15
|
-
>
|
|
16
|
-
<i className={
|
|
17
|
-
cn(
|
|
18
|
-
icons.pamicon,
|
|
19
|
-
collapsibleState == OPTION_COLLAPSED ? icons['pamicon-triangle-up'] : icons['pamicon-triangle-down'],
|
|
20
|
-
styles['collapse-icon']
|
|
21
|
-
)
|
|
22
|
-
} />
|
|
23
|
-
</span>
|
|
24
|
-
);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
Collapse.propTypes = {
|
|
28
|
-
onClick: PropTypes.func,
|
|
29
|
-
collapsibleState: PropTypes.string
|
|
30
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { shallow } from 'enzyme';
|
|
3
|
-
|
|
4
|
-
import { whereClassName } from 'test/utils/enzyme-utils';
|
|
5
|
-
|
|
6
|
-
import Collapse from '../Collapse';
|
|
7
|
-
import icons from '../styles/icons/icons.css';
|
|
8
|
-
|
|
9
|
-
import { OPTION_NOT_COLLAPSED, OPTION_COLLAPSED } from '../../constants';
|
|
10
|
-
|
|
11
|
-
it('passes onClick handler', function(){
|
|
12
|
-
const onClick = jest.fn();
|
|
13
|
-
const wrapper = shallow(<Collapse collapsibleState={OPTION_NOT_COLLAPSED} onClick={onClick} />);
|
|
14
|
-
wrapper.find('[role="button"]').simulate('click');
|
|
15
|
-
expect(onClick).toHaveBeenCalled();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it('renders correct class based on collapsibleState', function(){
|
|
19
|
-
const onClick = jest.fn();
|
|
20
|
-
const wrapper = shallow(<Collapse collapsibleState={OPTION_NOT_COLLAPSED} onClick={onClick} />);
|
|
21
|
-
expect(wrapper.findWhere(whereClassName(icons['pamicon-triangle-up'])).length).toEqual(0);
|
|
22
|
-
expect(wrapper.findWhere(whereClassName(icons['pamicon-triangle-down'])).length).toEqual(1);
|
|
23
|
-
wrapper.setProps({collapsibleState: OPTION_COLLAPSED});
|
|
24
|
-
expect(wrapper.findWhere(whereClassName(icons['pamicon-triangle-up'])).length).toEqual(1);
|
|
25
|
-
expect(wrapper.findWhere(whereClassName(icons['pamicon-triangle-down'])).length).toEqual(0);
|
|
26
|
-
});
|
package/src/constants.js
DELETED