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.
- package/.eslintcache +1 -1
- package/build/demo.js +54 -0
- package/package.json +1 -1
- package/src/common/component.js +1 -1
- package/src/common/editor_edit_field.js +17 -1
- package/src/common/editor_select.js +4 -5
- package/src/common/editor_special_field.js +1 -1
- package/src/common/editor_store.js +0 -7
- package/src/common/editor_title.js +2 -3
- package/src/common/get_editor_css.js +1 -1
- package/src/common/hoc_with_shadow_dom.js +5 -5
- package/src/common/hoc_with_store.js +25 -64
- package/src/components/tooltip/index.js +1 -1
- package/src/config.js +0 -2
- package/src/editor/context_menu.js +2 -12
- package/src/editor/editor.js +1 -1
- package/src/editor_account/context_menu.js +3 -7
- package/src/editor_account/editor.js +1 -1
- package/src/editor_account_statement/editor.js +1 -1
- package/src/editor_purchase/context_menu.js +0 -5
- package/src/editor_purchase/editor.js +1 -1
- package/src/editor_purchase/editor_special_table.js +1 -8
- package/src/editor_salemenus/context_menu.js +1 -5
- package/src/editor_salemenus/editor.js +1 -1
- package/src/editor_settle/context_menu.js +9 -20
- package/src/editor_settle/editor.js +1 -1
- package/src/editor_statement/context_menu.js +2 -6
- package/src/editor_statement/editor.js +1 -1
- package/src/editor_stockin/context_menu.js +3 -7
- package/src/editor_stockin/editor.js +1 -1
- package/src/editor_stockout/context_menu.js +1 -5
- package/src/editor_stockout/editor.js +1 -1
- package/src/index.js +1 -2
- package/src/printer/barcode.js +0 -6
- package/src/printer/get_css.js +1 -1
- package/src/util.js +6 -5
- 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
|
-
|
|
78
|
-
editStore: PropTypes.object,
|
|
79
|
-
mockData: PropTypes.object
|
|
80
|
-
}
|
|
76
|
+
|
|
81
77
|
export default ContextMenu
|
package/src/index.js
CHANGED
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
getCSS,
|
|
19
19
|
getPrintContainerHTML
|
|
20
20
|
} from './printer'
|
|
21
|
-
import { MULTI_SUFFIX
|
|
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
|
}
|
package/src/printer/barcode.js
CHANGED
|
@@ -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
|
package/src/printer/get_css.js
CHANGED
|
@@ -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
|
-
|
|
19
|
-
const
|
|
20
|
-
const
|
|
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 -
|
|
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
|
-
//
|
|
166
|
+
// 是不是双栏table
|
|
166
167
|
const isMultiTable = dataKey => dataKey.includes('multi')
|
|
167
168
|
|
|
168
169
|
// 获取table有多少栏,最少是双栏
|