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
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "gm-printer-label",
3
+ "version": "3.3.5",
4
+ "description": "",
5
+ "main": "main.js",
6
+ "scripts": {
7
+ "precommit": "lint-staged",
8
+ "start": "webpack-dev-server",
9
+ "build": "webpack --progress --colors --config ./webpack.config.prod.js",
10
+ "publish-latest": "npm publish --force-publish --registry https://registry.npmjs.org/",
11
+ "publish-beta": "npm publish --force-publish --dist-tag beta --preid beta --registry https://registry.npmjs.org/",
12
+ "publish-alpha": "npm publish --force-publish --dist-tag alpha --preid alpha --registry https://registry.npmjs.org/",
13
+ "release": "bumpp"
14
+ },
15
+ "lint-staged": {
16
+ "./src/**/*.js": [
17
+ "eslint --cache --fix",
18
+ "git add"
19
+ ]
20
+ },
21
+ "files": [
22
+ "lib"
23
+ ],
24
+ "repository": {
25
+ "type": "git",
26
+ "url": "git+https://github.com/gmfe/gm-printer-label.git"
27
+ },
28
+ "author": "",
29
+ "license": "ISC",
30
+ "bugs": {
31
+ "url": "https://github.com/gmfe/gm-printer-label/issues"
32
+ },
33
+ "homepage": "https://github.com/gmfe/gm-printer-label#readme",
34
+ "dependencies": {
35
+ "bumpp": "^9.1.0",
36
+ "clipboard": "^2.0.1",
37
+ "gm-svg": "^0.3.10",
38
+ "gm-util": "^5.10.4",
39
+ "mobx": "^4.3.0",
40
+ "mobx-react": "^6.1.1",
41
+ "precss": "^4.0.0",
42
+ "qrcode.react": "^0.9.2"
43
+ },
44
+ "devDependencies": {
45
+ "@babel/cli": "^7.6.0",
46
+ "@babel/core": "^7.5.5",
47
+ "@babel/preset-env": "^7.5.4",
48
+ "@babel/runtime": "^7.5.5",
49
+ "@babel/runtime-corejs3": "^7.12.1",
50
+ "@svgr/webpack": "^4.3.3",
51
+ "autoprefixer": "^8.5.1",
52
+ "babel-eslint": "^10.0.2",
53
+ "babel-loader": "^8.3.0",
54
+ "babel-preset-gmfe": "^2.0.0",
55
+ "big.js": "^5.1.2",
56
+ "classnames": "^2.2.5",
57
+ "clipboard": "^2.0.6",
58
+ "css-loader": "^0.28.11",
59
+ "eslint": "^5.0.1",
60
+ "eslint-config-standard": "^11.0.0",
61
+ "eslint-config-standard-jsx": "^5.0.0",
62
+ "eslint-plugin-import": "^2.13.0",
63
+ "eslint-plugin-node": "^6.0.1",
64
+ "eslint-plugin-promise": "^3.8.0",
65
+ "eslint-plugin-react": "^7.10.0",
66
+ "eslint-plugin-standard": "^3.1.0",
67
+ "file-loader": "^1.1.11",
68
+ "gm-svg": "^0.3.23",
69
+ "gm-util": "^5.12.3",
70
+ "gm_static_storage": "^1.2.0",
71
+ "husky": "^0.14.3",
72
+ "jsbarcode": "^3.11.0",
73
+ "less": "^3.0.4",
74
+ "less-loader": "^4.1.0",
75
+ "lint-staged": "^7.2.2",
76
+ "lodash": "^4.17.10",
77
+ "mobx": "^4.3.0",
78
+ "mobx-react": "^6.1.1",
79
+ "moment": "^2.22.2",
80
+ "normalize.css": "^8.0.0",
81
+ "postcss-loader": "^2.1.5",
82
+ "precss": "^3.1.2",
83
+ "prop-types": "^15.6.1",
84
+ "query-string": "^6.2.0",
85
+ "raw-loader": "^4.0.2",
86
+ "react": "^16.8.5",
87
+ "react-dom": "^16.8.5",
88
+ "react-hot-loader": "^3.1.3",
89
+ "style-loader": "^0.21.0",
90
+ "stylelint-config-standard": "^18.2.0",
91
+ "url-loader": "^1.0.1",
92
+ "webpack": "^4.47.0",
93
+ "webpack-cli": "^3.3.12",
94
+ "webpack-dev-server": "^3.1.4"
95
+ }
96
+ }
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "gm-printer-label",
3
- "version": "3.3.6",
3
+ "version": "3.4.1-beta.1",
4
4
  "description": "",
5
- "main": "src/index.js",
5
+ "main": "lib/main.js",
6
6
  "scripts": {
7
7
  "precommit": "lint-staged",
8
8
  "start": "webpack-dev-server",
9
+ "build": "webpack --progress --colors --config ./webpack.config.prod.js",
9
10
  "publish-latest": "npm publish --force-publish --registry https://registry.npmjs.org/",
10
11
  "publish-beta": "npm publish --force-publish --dist-tag beta --preid beta --registry https://registry.npmjs.org/",
11
12
  "publish-alpha": "npm publish --force-publish --dist-tag alpha --preid alpha --registry https://registry.npmjs.org/",
@@ -17,6 +18,9 @@
17
18
  "git add"
18
19
  ]
19
20
  },
21
+ "files": [
22
+ "lib"
23
+ ],
20
24
  "repository": {
21
25
  "type": "git",
22
26
  "url": "git+https://github.com/gmfe/gm-printer-label.git"
@@ -27,15 +31,6 @@
27
31
  "url": "https://github.com/gmfe/gm-printer-label/issues"
28
32
  },
29
33
  "homepage": "https://github.com/gmfe/gm-printer-label#readme",
30
- "peerDependencies": {
31
- "big.js": "^5.1.2",
32
- "classnames": "^2.2.5",
33
- "lodash": "^4.17.10",
34
- "moment": "^2.22.2",
35
- "qrcode.react": "^0.9.2",
36
- "react": "^16.8.5",
37
- "react-dom": "^16.8.5"
38
- },
39
34
  "dependencies": {
40
35
  "bumpp": "^9.1.0",
41
36
  "clipboard": "^2.0.1",
@@ -52,9 +47,10 @@
52
47
  "@babel/preset-env": "^7.5.4",
53
48
  "@babel/runtime": "^7.5.5",
54
49
  "@babel/runtime-corejs3": "^7.12.1",
50
+ "@svgr/webpack": "^4.3.3",
55
51
  "autoprefixer": "^8.5.1",
56
52
  "babel-eslint": "^10.0.2",
57
- "babel-loader": "^8.0.6",
53
+ "babel-loader": "^8.3.0",
58
54
  "babel-preset-gmfe": "^2.0.0",
59
55
  "big.js": "^5.1.2",
60
56
  "classnames": "^2.2.5",
@@ -93,8 +89,8 @@
93
89
  "style-loader": "^0.21.0",
94
90
  "stylelint-config-standard": "^18.2.0",
95
91
  "url-loader": "^1.0.1",
96
- "webpack": "^4.10.1",
97
- "webpack-cli": "^3.3.0",
92
+ "webpack": "^4.47.0",
93
+ "webpack-cli": "^3.3.12",
98
94
  "webpack-dev-server": "^3.1.4"
99
95
  }
100
96
  }
package/.eslintrc.js DELETED
@@ -1,12 +0,0 @@
1
- module.exports = {
2
- 'parser': 'babel-eslint',
3
- 'extends': [
4
- 'standard',
5
- 'standard-jsx'
6
- ],
7
- 'rules': {
8
- 'react/jsx-tag-spacing': ['error', {'beforeSelfClosing': 'never'}],
9
- 'no-template-curly-in-string': ['warn'],
10
- 'camelcase': 0
11
- }
12
- }
@@ -1,46 +0,0 @@
1
- name: Release
2
-
3
- permissions:
4
- contents: write
5
-
6
- on:
7
- push:
8
- tags:
9
- - 'v*'
10
-
11
- jobs:
12
- release:
13
- runs-on: ubuntu-latest
14
- steps:
15
- - uses: actions/checkout@v3
16
- with:
17
- fetch-depth: 0
18
-
19
- - name: Set node
20
- uses: actions/setup-node@v3
21
- with:
22
- node-version: 16.x
23
- registry-url: 'https://registry.npmjs.org'
24
-
25
- - name: ChangeLog
26
- run: npx changelogithub
27
- env:
28
- GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
29
-
30
- - name: Setup
31
- run: npm i -g @antfu/ni
32
-
33
- - name: Install
34
- run: nci
35
-
36
- - name: Release
37
- run: |
38
- if [[ ${{ github.ref }} == *refs/tags/*-beta* ]]; then
39
- npm publish --tag beta
40
- elif [[ ${{ github.ref }} == *refs/tags/*-alpha* ]]; then
41
- npm publish --tag alpha
42
- else
43
- npm publish
44
- fi
45
- env:
46
- NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/.prettierrc.js DELETED
@@ -1,5 +0,0 @@
1
- module.exports = {
2
- semi: false,
3
- singleQuote: true,
4
- jsxSingleQuote: true,
5
- };
package/.stylelintrc DELETED
@@ -1,3 +0,0 @@
1
- {
2
- "extends": "stylelint-config-standard"
3
- }
package/babel.config.js DELETED
@@ -1,7 +0,0 @@
1
- module.exports = api => {
2
- api.cache(true)
3
- return {
4
- ignore: [/@babel[/\\]runtime/], // 忽略 @babel/runtime
5
- presets: ['gmfe']
6
- }
7
- }
package/i18n.config.js DELETED
@@ -1,9 +0,0 @@
1
- let config = {
2
- resourceDir: 'resource',
3
- outputDir: 'out',
4
- // 下面是双语替换排除的路径
5
- exclude: ['demo/*.js'],
6
- callStatement: 'i18next.t',
7
- importStatementStr: "import i18next from '../../locales';\n"
8
- }
9
- module.exports = config
package/locales/en.json DELETED
@@ -1,42 +0,0 @@
1
- {
2
- "实线": "",
3
- "虚线": "",
4
- "圆点": "",
5
- "文本": "",
6
- "线条": "",
7
- "二维码": "",
8
- "条形码": "",
9
- "取消": "",
10
- "确定": "",
11
- "上": "",
12
- "左": "",
13
- "下": "",
14
- "右": "",
15
- "宽": "",
16
- "粗细": "",
17
- "高": "",
18
- "请将以下配置代码发给观麦技术": "",
19
- "复制": "",
20
- "移除": "",
21
- "添加字段": "",
22
- "编辑字段": "",
23
- "旋转": "",
24
- "说明:请勿修改{}中的内容,避免出现数据异常": "",
25
- "载入模板:": "",
26
- "请选择": "",
27
- "模板名称": "",
28
- "标签尺寸": "",
29
- "插入": "",
30
- "另存为": "",
31
- "基本信息": "",
32
- "测试打印": "",
33
- "重置": "",
34
- "保存": "",
35
- "模板预览": "",
36
- "说明:单击选中内容,双击编辑,可拖动以摆放位置,可方向键细调位置,可点击右键删除": "",
37
- "请编辑": "",
38
- "{{商品溯源码}}": "",
39
- "{{商品码}}": "",
40
- "出错啦,未识别类型,此信息不应该出现": "",
41
- "页码": ""
42
- }
package/locales/index.js DELETED
@@ -1,32 +0,0 @@
1
- import lng1 from './zh.json'
2
- import lng2 from './zh-HK.json'
3
- import lng3 from './en.json'
4
- import lng4 from './th.json'
5
- const moduleMap = {
6
- 'zh': lng1,
7
- 'zh-HK': lng2,
8
- 'en': lng3,
9
- 'th': lng4
10
- }
11
- let _language = 'zh'
12
-
13
- const setLocale = lng => {
14
- _language = lng
15
- }
16
-
17
- const getLocale = key => {
18
- const languageMap = moduleMap[_language] || moduleMap['zh']
19
- let result = languageMap[key]
20
-
21
- if (!result) {
22
- result = key.split('__').pop()
23
- }
24
-
25
- return result
26
- }
27
- // 兼容旧的
28
- const i18next = {
29
- t: getLocale
30
- }
31
- export { getLocale, setLocale }
32
- export default i18next
package/locales/th.json DELETED
@@ -1,42 +0,0 @@
1
- {
2
- "实线": "",
3
- "虚线": "",
4
- "圆点": "",
5
- "文本": "",
6
- "线条": "",
7
- "二维码": "",
8
- "条形码": "",
9
- "取消": "",
10
- "确定": "",
11
- "上": "",
12
- "左": "",
13
- "下": "",
14
- "右": "",
15
- "宽": "",
16
- "粗细": "",
17
- "高": "",
18
- "请将以下配置代码发给观麦技术": "",
19
- "复制": "",
20
- "移除": "",
21
- "添加字段": "",
22
- "编辑字段": "",
23
- "旋转": "",
24
- "说明:请勿修改{}中的内容,避免出现数据异常": "",
25
- "载入模板:": "",
26
- "请选择": "",
27
- "模板名称": "",
28
- "标签尺寸": "",
29
- "插入": "",
30
- "另存为": "",
31
- "基本信息": "",
32
- "测试打印": "",
33
- "重置": "",
34
- "保存": "",
35
- "模板预览": "",
36
- "说明:单击选中内容,双击编辑,可拖动以摆放位置,可方向键细调位置,可点击右键删除": "",
37
- "请编辑": "",
38
- "{{商品溯源码}}": "",
39
- "{{商品码}}": "",
40
- "出错啦,未识别类型,此信息不应该出现": "",
41
- "页码": ""
42
- }
@@ -1,43 +0,0 @@
1
- {
2
- "实线": "實線",
3
- "虚线": "虛線",
4
- "圆点": "圓點",
5
- "文本": "文本",
6
- "线条": "線條",
7
- "二维码": "二維碼",
8
- "条形码": "條形碼",
9
- "取消": "取消",
10
- "确定": "確定",
11
- "上": "上",
12
- "左": "左",
13
- "下": "下",
14
- "右": "右",
15
- "宽": "寬",
16
- "粗细": "粗細",
17
- "高": "高",
18
- "请将以下配置代码发给观麦技术": "請將以下配置代碼發給觀麥技術",
19
- "复制": "複製",
20
- "移除": "移除",
21
- "添加字段": "添加字段",
22
- "编辑字段": "編輯字段",
23
- "旋转": "旋轉",
24
- "说明:请勿修改{}中的内容,避免出现数据异常": "説明:請勿修改{}中的內容,避免出現數據異常",
25
- "载入模板:": "載入模板:",
26
- "请选择": "請選擇",
27
- "模板名称": "模板名稱",
28
- "标签尺寸": "標籤尺寸",
29
- "插入": "插入",
30
- "另存为": "另存為",
31
- "基本信息": "基本信息",
32
- "测试打印": "測試打印",
33
- "重置": "重置",
34
- "保存": "保存",
35
- "模板预览": "模板預覽",
36
- "说明:单击选中内容,双击编辑,可拖动以摆放位置,可方向键细调位置,可点击右键删除": "説明:單擊選中內容,雙擊編輯,可拖動以擺放位置,可方向鍵細調位置,可點擊右鍵刪除",
37
- "请编辑": "請編輯",
38
- "{{商品溯源码}}": "{{商品溯源碼}}",
39
- "{{订单溯源码}}": "{{訂單溯源碼}}",
40
- "{{商品码}}": "{{商品碼}}",
41
- "出错啦,未识别类型,此信息不应该出现": "出錯啦,未識別類型,此信息不應該出現",
42
- "页码": "頁碼"
43
- }
package/locales/zh.json DELETED
@@ -1 +0,0 @@
1
- {}
package/postcss.config.js DELETED
@@ -1,9 +0,0 @@
1
- const autoprefixer = require('autoprefixer')
2
- const precss = require('precss')
3
-
4
- module.exports = {
5
- plugins: [
6
- autoprefixer({browsers: ['iOS >= 8', 'Android >= 4.1']}),
7
- precss
8
- ]
9
- }
@@ -1,82 +0,0 @@
1
- import i18next from '../../locales'
2
-
3
- const pageTypeMap = {
4
- '100X150': {
5
- width: '100mm',
6
- height: '150mm'
7
- },
8
- '100X100': {
9
- width: '100mm',
10
- height: '100mm'
11
- },
12
- '100X80': {
13
- width: '100mm',
14
- height: '80mm'
15
- },
16
- '80X100': {
17
- width: '80mm',
18
- height: '100mm'
19
- },
20
- '75X75': {
21
- width: '75mm',
22
- height: '75mm'
23
- },
24
- '70X50': {
25
- width: '70mm',
26
- height: '50mm'
27
- },
28
- '60X40': {
29
- width: '60mm',
30
- height: '40mm'
31
- },
32
- '40X30': {
33
- width: '40mm',
34
- height: '28mm'
35
- }
36
- }
37
-
38
- const borderStyleList = [
39
- { value: 'solid', text: i18next.t('实线') },
40
- { value: 'dashed', text: i18next.t('虚线') },
41
- { value: 'dotted', text: i18next.t('圆点') }
42
- ]
43
-
44
- const DiyTimeType = [
45
- {
46
- type: '',
47
- text: '格式“2022-01-01 19:00:00”,输入“单据日期:{{单据日期}}”;',
48
- format: 'YYYY-MM-DD HH:mm:ss'
49
- },
50
- {
51
- type: '时分',
52
- text: '格式“2022-01-01 19:00”,输入“单据日期:{{单据日期_时分}}”;',
53
- format: 'YYYY-MM-DD HH:mm'
54
- },
55
- {
56
- type: '日期',
57
- text: '格式“2022-01-01”,输入“单据日期:{{单据日期_日期}}”;',
58
- format: 'YYYY-MM-DD'
59
- },
60
- {
61
- type: '无年份',
62
- text: '格式“01-01 19:00:00”,输入“单据日期:{{单据日期_无年份}}”;',
63
- format: 'MM-DD HH:mm:ss'
64
- },
65
- {
66
- type: '日期_无年份',
67
- text: '格式“01-01”,输入“单据日期:{{单据日期_日期_无年份}}";',
68
- format: 'MM-DD'
69
- },
70
- {
71
- type: '时间',
72
- text: '格式“19:00:00",输入“单据日期:{{单据日期_时间}}";',
73
- format: 'HH:mm:ss'
74
- },
75
- {
76
- type: '日期_星期',
77
- text: '格式“2022-01-01 星期六”,输入“单据日期:{{单据日期_日期_星期}}”;',
78
- format: 'YYYY-MM-DD dddd'
79
- }
80
- ]
81
-
82
- export { DiyTimeType, borderStyleList, pageTypeMap }