gm-printer 10.28.4-beta.4 → 10.28.4

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/build/index.html DELETED
@@ -1 +0,0 @@
1
- <!doctype html><html><head></head><body><div id="appContainer"></div><script src="/demo.js"></script><script src="/demo.js"></script></body></html>
@@ -1,76 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import _ from 'lodash'
4
- import classNames from 'classnames'
5
- import './style.less'
6
- class Radio extends React.Component {
7
- render() {
8
- const {
9
- value,
10
- checked,
11
- onChange,
12
- onClick,
13
- children,
14
- inline,
15
- block,
16
- name,
17
- disabled,
18
- className,
19
- ...rest
20
- } = this.props
21
-
22
- const inner = (
23
- <label
24
- {...rest}
25
- className={classNames(
26
- 'gm-radio',
27
- {
28
- 'gm-radio-inline': inline,
29
- 'gm-radio-block': block,
30
- disabled
31
- },
32
- className
33
- )}
34
- >
35
- <input
36
- type='radio'
37
- className='gm-radio-input'
38
- name={name}
39
- value={value}
40
- checked={checked || false}
41
- onChange={onChange}
42
- onClick={onClick}
43
- disabled={disabled}
44
- />
45
- <span className='gm-radio-span' />
46
- {children}
47
- </label>
48
- )
49
-
50
- if (!inline) {
51
- return <div>{inner}</div>
52
- }
53
- return inner
54
- }
55
- }
56
-
57
- Radio.propTypes = {
58
- checked: PropTypes.bool,
59
- onChange: PropTypes.func,
60
- value: PropTypes.any,
61
- children: PropTypes.any,
62
- disabled: PropTypes.bool,
63
- inline: PropTypes.bool,
64
- block: PropTypes.bool,
65
- name: PropTypes.string,
66
- onClick: PropTypes.func,
67
- className: PropTypes.string,
68
- style: PropTypes.object
69
- }
70
-
71
- Radio.defaultProps = {
72
- onChange: _.noop,
73
- onClick: _.noop
74
- }
75
-
76
- export default Radio
@@ -1,52 +0,0 @@
1
- import React from 'react'
2
- import PropTypes from 'prop-types'
3
- import classNames from 'classnames'
4
- import _ from 'lodash'
5
- import './style.less'
6
-
7
- class RadioGroup extends React.Component {
8
- render() {
9
- const {
10
- onChange,
11
- value,
12
- inline,
13
- className,
14
- children,
15
- name,
16
- ...rest
17
- } = this.props
18
-
19
- return (
20
- <div {...rest} className={classNames('gm-radio-group', className)}>
21
- {_.map(React.Children.toArray(children), (child, i) => {
22
- return React.cloneElement(child, {
23
- key: i,
24
- index: i,
25
- checked: child.props.value === value,
26
- inline,
27
- onChange: () => {
28
- onChange(child.props.value)
29
- },
30
- name
31
- })
32
- })}
33
- </div>
34
- )
35
- }
36
- }
37
-
38
- RadioGroup.propTypes = {
39
- name: PropTypes.string.isRequired,
40
- value: PropTypes.any,
41
- onChange: PropTypes.func,
42
- inline: PropTypes.bool,
43
- children: PropTypes.any,
44
- className: PropTypes.string,
45
- style: PropTypes.object
46
- }
47
-
48
- RadioGroup.defaultProps = {
49
- onChange: _.noop
50
- }
51
-
52
- export default RadioGroup
@@ -1,4 +0,0 @@
1
- import RadioGroup from './RadioGroup'
2
- import Radio from './Radio'
3
-
4
- export { RadioGroup, Radio }
@@ -1,63 +0,0 @@
1
- //cover bootstrap.style for radio
2
- .gm-radio {
3
- cursor: pointer;
4
- margin: 0;
5
-
6
- &.gm-radio-block {
7
- display: block;
8
- }
9
-
10
- &.gm-radio-inline {
11
- display: inline-block;
12
- padding-right: 10px;
13
- }
14
-
15
- .gm-radio-input {
16
- display: none;
17
- }
18
-
19
- &.disabled {
20
- cursor: not-allowed;
21
-
22
- .gm-radio-input + .gm-radio-span {
23
- cursor: not-allowed;
24
- border: 1px solid #d4d8d8;
25
- background: #eee;
26
- }
27
-
28
- .gm-radio-input:checked + .gm-radio-span {
29
- border: 1px solid #d4d8d8;
30
-
31
- &::after {
32
- border: 3px solid #d4d8d8;
33
- }
34
- }
35
- }
36
-
37
- .gm-radio-input + .gm-radio-span {
38
- margin-right: 5px;
39
- top: 2px;
40
- -webkit-appearance: none;
41
- border: 1px solid #d4d8d8;
42
- border-radius: 7px;
43
- display: inline-block;
44
- position: relative;
45
- width: 14px;
46
- height: 14px;
47
- }
48
-
49
- .gm-radio-input:checked + .gm-radio-span {
50
- border: 1px solid #56a3f2;
51
-
52
- &::after {
53
- content: '';
54
- position: absolute;
55
- width: 0;
56
- height: 0;
57
- top: 2px;
58
- left: 2px;
59
- border-radius: 4px;
60
- border: 4px solid #56a3f2;
61
- }
62
- }
63
- }