gm-printer-label 3.3.6 → 3.4.1-beta.1

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 (73) hide show
  1. package/lib/main.js +27 -0
  2. package/lib/package.json +96 -0
  3. package/package.json +10 -14
  4. package/.eslintrc.js +0 -12
  5. package/.github/workflows/release.yml +0 -46
  6. package/.prettierrc.js +0 -5
  7. package/.stylelintrc +0 -3
  8. package/babel.config.js +0 -7
  9. package/i18n.config.js +0 -9
  10. package/locales/en.json +0 -42
  11. package/locales/index.js +0 -32
  12. package/locales/th.json +0 -42
  13. package/locales/zh-HK.json +0 -43
  14. package/locales/zh.json +0 -1
  15. package/postcss.config.js +0 -9
  16. package/src/common/config.js +0 -82
  17. package/src/common/editor_compoents/component.js +0 -481
  18. package/src/common/editor_compoents/config_text.js +0 -47
  19. package/src/common/editor_compoents/context_menu.js +0 -129
  20. package/src/common/editor_compoents/edit.js +0 -106
  21. package/src/common/editor_compoents/edit_add_filed.js +0 -54
  22. package/src/common/editor_compoents/edit_modify_filed.js +0 -199
  23. package/src/common/editor_compoents/edit_select.js +0 -212
  24. package/src/common/editor_compoents/edit_title.js +0 -110
  25. package/src/common/editor_compoents/index.js +0 -10
  26. package/src/common/editor_compoents/store.js +0 -381
  27. package/src/common/editor_compoents/style.less +0 -425
  28. package/src/common/editor_compoents/with_shadow_dom_hoc.js +0 -30
  29. package/src/common/editor_compoents/with_store_hoc.js +0 -92
  30. package/src/components/css/animation.less +0 -95
  31. package/src/components/css/button.less +0 -49
  32. package/src/components/css/distance.less +0 -324
  33. package/src/components/css/text.less +0 -74
  34. package/src/components/css/variables.less +0 -12
  35. package/src/components/dialog/index.js +0 -72
  36. package/src/components/dialog/style.less +0 -64
  37. package/src/components/dropdown/drop_down.js +0 -67
  38. package/src/components/dropdown/drop_down_item.js +0 -37
  39. package/src/components/dropdown/drop_down_items.js +0 -22
  40. package/src/components/dropdown/index.js +0 -9
  41. package/src/components/dropdown/style.less +0 -51
  42. package/src/components/flex/index.js +0 -103
  43. package/src/components/flex/style.less +0 -101
  44. package/src/components/index.js +0 -15
  45. package/src/components/index.less +0 -10
  46. package/src/components/input_number/index.js +0 -158
  47. package/src/components/input_number/style.less +0 -10
  48. package/src/components/select/index.js +0 -7
  49. package/src/components/select/option.js +0 -32
  50. package/src/components/select/select.js +0 -122
  51. package/src/components/select/style.less +0 -79
  52. package/src/components/tip/index.js +0 -48
  53. package/src/components/tip/style.less +0 -22
  54. package/src/editor_label/edit_store.js +0 -3
  55. package/src/editor_label/editor.js +0 -5
  56. package/src/editor_label/editor_with_shadow_dom.js +0 -4
  57. package/src/editor_label/index.js +0 -1
  58. package/src/editor_presorting/edit_store.js +0 -3
  59. package/src/editor_presorting/editor_with_shadow_dom.js +0 -6
  60. package/src/editor_presorting/index.js +0 -1
  61. package/src/index.js +0 -7
  62. package/src/printer/barcode.js +0 -38
  63. package/src/printer/batch_printer.js +0 -43
  64. package/src/printer/block.js +0 -544
  65. package/src/printer/components/table_type.js +0 -46
  66. package/src/printer/index.js +0 -111
  67. package/src/printer/normalize.css +0 -341
  68. package/src/printer/page.js +0 -26
  69. package/src/printer/printer.js +0 -71
  70. package/src/printer/qrcode.js +0 -17
  71. package/src/printer/style.less +0 -28
  72. package/src/util.js +0 -87
  73. package/webpack.config.js +0 -53
@@ -1,48 +0,0 @@
1
- import React from 'react'
2
- import ReactDOM from 'react-dom'
3
- import PropTypes from 'prop-types'
4
- import { SvgInfoCircle } from 'gm-svg'
5
- import Flex from '../flex'
6
- import _ from 'lodash'
7
-
8
- const tips = []
9
-
10
- const Tip = (props) => {
11
- const { list } = props
12
-
13
- return <React.Fragment>
14
- {_.map(list, (item, index) => {
15
- return (
16
- <div key={index} className='gm-animated gm-animated-fade-in-right-100'>
17
- <Flex alignCenter className='gm-tip'>
18
- <SvgInfoCircle className='gm-svg-info'/>
19
- <div style={{ paddingLeft: '10px' }}>
20
- <div>{item}</div>
21
- </div>
22
- </Flex>
23
- </div>
24
- )
25
- })}
26
- </React.Fragment>
27
- }
28
-
29
- function getTipDOM (id) {
30
- return window.shadowRoot.getElementById(id)
31
- }
32
-
33
- Tip.warning = (message = '') => {
34
- tips.push(message)
35
-
36
- setTimeout(() => {
37
- tips.shift()
38
- ReactDOM.render(<Tip list={tips}/>, getTipDOM('gm-printer-tip'))
39
- }, 3000)
40
-
41
- ReactDOM.render(<Tip list={tips}/>, getTipDOM('gm-printer-tip'))
42
- }
43
-
44
- Tip.propTypes = {
45
- list: PropTypes.array.isRequired
46
- }
47
-
48
- export default Tip
@@ -1,22 +0,0 @@
1
- .gm-tip {
2
- min-width: 250px;
3
- height: 50px;
4
- box-shadow: 0 1px 6px rgba(0, 0, 0, 0.2) !important;
5
- cursor: pointer;
6
- margin-bottom: 18px;
7
- background-color: #fff;
8
- border: 1px solid transparent;
9
- border-radius: 0;
10
- padding-left: 20px;
11
-
12
- .gm-svg-info {
13
- color: #31708f;
14
- font-size: 20px;
15
- }
16
- }
17
-
18
- @media print {
19
- .gm-tip {
20
- display: none;
21
- }
22
- }
@@ -1,3 +0,0 @@
1
- import EditStore from '../common/editor_compoents/store'
2
-
3
- export default new EditStore()
@@ -1,5 +0,0 @@
1
- import Edit from '../common/editor_compoents/edit'
2
- import editStore from './edit_store'
3
- import withStore from '../common/editor_compoents/with_store_hoc'
4
-
5
- export default withStore(editStore)(Edit)
@@ -1,4 +0,0 @@
1
- import EditWithStore from './editor'
2
- import withShadowDom from '../common/editor_compoents/with_shadow_dom_hoc'
3
-
4
- export default withShadowDom(EditWithStore)
@@ -1 +0,0 @@
1
- export { default as PrinterEditShadow } from './editor_with_shadow_dom'
@@ -1,3 +0,0 @@
1
- import EditStore from '../common/editor_compoents/store'
2
-
3
- export default new EditStore()
@@ -1,6 +0,0 @@
1
- import withShadowDom from '../common/editor_compoents/with_shadow_dom_hoc'
2
- import Edit from '../common/editor_compoents/edit'
3
- import editStore from './edit_store'
4
- import withStore from '../common/editor_compoents/with_store_hoc'
5
-
6
- export default withShadowDom(withStore(editStore)(Edit))
@@ -1 +0,0 @@
1
- export { default as LabelEditorPreSort } from './editor_with_shadow_dom'
package/src/index.js DELETED
@@ -1,7 +0,0 @@
1
- export { DiyTimeType, pageTypeMap } from './common/config'
2
-
3
- export * from './printer'
4
- export { setLocale } from '../locales'
5
-
6
- export * from './editor_label'
7
- export * from './editor_presorting'
@@ -1,38 +0,0 @@
1
- import React from 'react'
2
- import jsBarcode from 'jsbarcode'
3
- import PropTypes from 'prop-types'
4
-
5
- class BarCode extends React.Component {
6
- barcode = React.createRef()
7
-
8
- componentDidMount () {
9
- const { value, ...rest } = this.props
10
- if (!value) return
11
- /** jsBarCode的具体options前往:
12
- * https://blog.csdn.net/shencailing/article/details/122101956
13
- */
14
- jsBarcode(this.barcode.current, value, {
15
- ...rest
16
- })
17
- }
18
-
19
- render () {
20
- // 可设置条形码的宽高
21
- const { dataName, value, height = '', svgWidth } = this.props
22
- if (!value) return null
23
- return <svg
24
- data-name={dataName}
25
- ref={this.barcode}
26
- style={{
27
- width: svgWidth, height: height + 'px'
28
- }}
29
- />
30
- }
31
- }
32
-
33
- BarCode.propTypes = {
34
- value: PropTypes.string,
35
- dataName: PropTypes.string
36
- }
37
-
38
- export default BarCode
@@ -1,43 +0,0 @@
1
- import React from 'react'
2
- import Printer from './printer'
3
- import _ from 'lodash'
4
- import PropTypes from 'prop-types'
5
-
6
- class BatchPrinter extends React.Component {
7
- constructor (props) {
8
- super(props)
9
- this.ready = 0
10
- }
11
-
12
- handleReady = () => {
13
- this.ready++
14
- if (this.ready === this.props.list.length) {
15
- this.props.onReady()
16
- }
17
- }
18
-
19
- render () {
20
- const { list, isStation } = this.props
21
- return _.map(list, ({ config, data }, i) => (
22
- <Printer
23
- key={i}
24
- data={data}
25
- config={config}
26
- onReady={this.handleReady}
27
- isStation={isStation}
28
- />
29
- ))
30
- }
31
- }
32
-
33
- BatchPrinter.propTypes = {
34
- list: PropTypes.array.isRequired,
35
- onReady: PropTypes.func,
36
- isStation: PropTypes.bool
37
- }
38
-
39
- BatchPrinter.defaultProps = {
40
- onReady: _.noop
41
- }
42
-
43
- export default BatchPrinter