gm-printer 10.13.8-alpha.2 → 10.13.8

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 (37) hide show
  1. package/.eslintcache +1 -1
  2. package/build/demo.js +54 -0
  3. package/package.json +1 -1
  4. package/src/common/component.js +1 -1
  5. package/src/common/editor_edit_field.js +17 -1
  6. package/src/common/editor_select.js +4 -5
  7. package/src/common/editor_special_field.js +1 -1
  8. package/src/common/editor_store.js +0 -7
  9. package/src/common/editor_title.js +2 -3
  10. package/src/common/get_editor_css.js +1 -1
  11. package/src/common/hoc_with_shadow_dom.js +5 -5
  12. package/src/common/hoc_with_store.js +25 -64
  13. package/src/components/tooltip/index.js +1 -1
  14. package/src/config.js +0 -2
  15. package/src/editor/context_menu.js +2 -12
  16. package/src/editor/editor.js +1 -1
  17. package/src/editor_account/context_menu.js +3 -7
  18. package/src/editor_account/editor.js +1 -1
  19. package/src/editor_account_statement/editor.js +1 -1
  20. package/src/editor_purchase/context_menu.js +0 -5
  21. package/src/editor_purchase/editor.js +1 -1
  22. package/src/editor_purchase/editor_special_table.js +1 -8
  23. package/src/editor_salemenus/context_menu.js +1 -5
  24. package/src/editor_salemenus/editor.js +1 -1
  25. package/src/editor_settle/context_menu.js +9 -20
  26. package/src/editor_settle/editor.js +1 -1
  27. package/src/editor_statement/context_menu.js +2 -6
  28. package/src/editor_statement/editor.js +1 -1
  29. package/src/editor_stockin/context_menu.js +3 -7
  30. package/src/editor_stockin/editor.js +1 -1
  31. package/src/editor_stockout/context_menu.js +1 -5
  32. package/src/editor_stockout/editor.js +1 -1
  33. package/src/index.js +1 -2
  34. package/src/printer/barcode.js +0 -6
  35. package/src/printer/get_css.js +1 -1
  36. package/src/util.js +6 -5
  37. package/yarn-error.log +0 -9663
@@ -3,7 +3,6 @@ import React from 'react'
3
3
  import CommonContextMenu from '../common/common_context_menu'
4
4
  import { inject, observer } from 'mobx-react'
5
5
  import { Printer } from '../printer'
6
- import PropTypes from 'prop-types'
7
6
 
8
7
  const blockTypeList = [
9
8
  { value: '', text: i18next.t('插入文本') },
@@ -74,8 +73,5 @@ class ContextMenu extends React.Component {
74
73
  )
75
74
  }
76
75
  }
77
- ContextMenu.propTypes = {
78
- editStore: PropTypes.object,
79
- mockData: PropTypes.object
80
- }
76
+
81
77
  export default ContextMenu
@@ -69,7 +69,7 @@ Editor.propTypes = {
69
69
  addFields: PropTypes.object.isRequired
70
70
  }
71
71
 
72
- Editor.defaultProps = {
72
+ Editor.deaultProps = {
73
73
  onSave: _.noop
74
74
  }
75
75
 
package/src/index.js CHANGED
@@ -18,7 +18,7 @@ import {
18
18
  getCSS,
19
19
  getPrintContainerHTML
20
20
  } from './printer'
21
- import { MULTI_SUFFIX, MULTI_SUFFIX3 } from './config'
21
+ import { MULTI_SUFFIX } from './config'
22
22
 
23
23
  export * from './util'
24
24
  export { setLocale } from '../locales'
@@ -40,6 +40,5 @@ export {
40
40
  doBatchPrint,
41
41
  getCSS,
42
42
  MULTI_SUFFIX,
43
- MULTI_SUFFIX3,
44
43
  getPrintContainerHTML
45
44
  }
@@ -1,6 +1,5 @@
1
1
  import React from 'react'
2
2
  import jsBarcode from 'jsbarcode'
3
- import PropTypes from 'prop-types'
4
3
 
5
4
  class BarCode extends React.Component {
6
5
  barcode = React.createRef()
@@ -18,9 +17,4 @@ class BarCode extends React.Component {
18
17
  }
19
18
  }
20
19
 
21
- BarCode.propTypes = {
22
- value: PropTypes.string,
23
- dataName: PropTypes.string
24
- }
25
-
26
20
  export default BarCode
@@ -3,7 +3,7 @@ import normalizeCSS from 'css-loader!./normalize.csss'
3
3
  // eslint-disable-next-line
4
4
  import printerCSS from 'css-loader!postcss-loader!less-loader!./style.lesss'
5
5
 
6
- function getCSS() {
6
+ function getCSS () {
7
7
  return normalizeCSS.toString() + printerCSS.toString()
8
8
  }
9
9
 
package/src/util.js CHANGED
@@ -15,12 +15,13 @@ function getHeight(el) {
15
15
 
16
16
  function getWidth(el) {
17
17
  const styles = window.getComputedStyle(el)
18
- const width = Math.ceil(el.offsetWidth)
19
- const borderLeftWidth = parseFloat(styles.borderLeftWidth)
20
- const borderRightWidth = parseFloat(styles.borderRightWidth)
18
+ // clientWidth 仅包含 padding + content, 不用涉及border计算
19
+ const width = el.clientWidth
20
+ // const borderLeftWidth = parseFloat(styles.borderLeftWidth)
21
+ // const borderRightWidth = parseFloat(styles.borderRightWidth)
21
22
  const paddingLeft = parseFloat(styles.paddingLeft)
22
23
  const paddingRight = parseFloat(styles.paddingRight)
23
- return width - borderLeftWidth - borderRightWidth - paddingLeft - paddingRight
24
+ return width - paddingLeft - paddingRight
24
25
  }
25
26
 
26
27
  function pxAdd(origin = '0px', add) {
@@ -162,7 +163,7 @@ const coverDigit2Uppercase = n => {
162
163
  )
163
164
  }
164
165
 
165
- // 是不是多栏table
166
+ // 是不是双栏table
166
167
  const isMultiTable = dataKey => dataKey.includes('multi')
167
168
 
168
169
  // 获取table有多少栏,最少是双栏