@pisell/materials 6.0.17 → 6.0.19

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 (41) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +6 -6
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +21 -21
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +21 -21
  11. package/es/components/dataSourceComponents/fields/Input/WithMode.d.ts +0 -1
  12. package/es/components/dataSourceComponents/fields/Input/WithMode.js +48 -508
  13. package/es/components/pisellQRScanner/index.d.ts +37 -0
  14. package/es/components/pisellQRScanner/index.js +1153 -0
  15. package/es/components/pisellQRScanner/index.less +71 -0
  16. package/es/index.d.ts +2 -0
  17. package/es/index.js +1 -0
  18. package/es/locales/en-US.d.ts +13 -0
  19. package/es/locales/en-US.js +14 -3
  20. package/es/locales/zh-CN.d.ts +9 -0
  21. package/es/locales/zh-CN.js +11 -1
  22. package/es/locales/zh-TW.d.ts +9 -0
  23. package/es/locales/zh-TW.js +11 -1
  24. package/lib/components/dataSourceComponents/fields/Input/WithMode.d.ts +0 -1
  25. package/lib/components/dataSourceComponents/fields/Input/WithMode.js +44 -323
  26. package/lib/components/pisellQRScanner/index.d.ts +37 -0
  27. package/lib/components/pisellQRScanner/index.js +706 -0
  28. package/lib/components/pisellQRScanner/index.less +71 -0
  29. package/lib/index.d.ts +2 -0
  30. package/lib/index.js +3 -0
  31. package/lib/locales/en-US.d.ts +13 -0
  32. package/lib/locales/en-US.js +19 -1
  33. package/lib/locales/zh-CN.d.ts +9 -0
  34. package/lib/locales/zh-CN.js +11 -1
  35. package/lib/locales/zh-TW.d.ts +9 -0
  36. package/lib/locales/zh-TW.js +11 -1
  37. package/lowcode/pisell-qrscanner/meta.ts +86 -0
  38. package/lowcode/pisell-qrscanner/snippets.ts +25 -0
  39. package/package.json +3 -3
  40. package/es/components/dataSourceComponents/fields/Input/WithMode.less +0 -96
  41. package/lib/components/dataSourceComponents/fields/Input/WithMode.less +0 -96
@@ -0,0 +1,71 @@
1
+ /* 全屏扫码容器 */
2
+ .pisell-qr-scanner-fullscreen {
3
+ position: fixed;
4
+ top: 0;
5
+ left: 0;
6
+ width: 100vw;
7
+ height: 100vh;
8
+ background-color: #000;
9
+ z-index: 9999;
10
+ overflow: hidden;
11
+ display: flex;
12
+ justify-content: center;
13
+ align-items: center;
14
+ }
15
+
16
+ /* 视频容器 */
17
+ .scan-container {
18
+ position: relative;
19
+ width: 100%;
20
+ height: 100%;
21
+ overflow: hidden;
22
+ }
23
+
24
+ /* 视频元素 */
25
+ .scan-video {
26
+ width: 100%;
27
+ height: 100%;
28
+ object-fit: cover;
29
+ display: block;
30
+ }
31
+
32
+ /* 关闭按钮 */
33
+ .scan-close-left {
34
+ position: fixed;
35
+ top: 20px;
36
+ left: 20px;
37
+ z-index: 10000;
38
+ font-size: 24px;
39
+ color: #fff;
40
+ cursor: pointer;
41
+ background-color: rgba(255, 255, 255, 0.15);
42
+ width: 44px;
43
+ height: 44px;
44
+ display: flex;
45
+ align-items: center;
46
+ justify-content: center;
47
+ border-radius: 50%;
48
+ }
49
+
50
+ /* 上传按钮 */
51
+ .scan-upload {
52
+ position: fixed;
53
+ right: 30px;
54
+ bottom: 60px;
55
+ width: 88px;
56
+ height: 88px;
57
+ display: flex;
58
+ align-items: center;
59
+ justify-content: center;
60
+ z-index: 10000;
61
+ font-size: 48px;
62
+ color: #fff;
63
+ background-color: rgba(255, 255, 255, 0.15);
64
+ border-radius: 50%;
65
+ cursor: pointer;
66
+ }
67
+
68
+ /* 隐藏的文件输入框 */
69
+ .scan-file-input {
70
+ display: none;
71
+ }
package/lib/index.d.ts CHANGED
@@ -76,6 +76,8 @@ export { default as PisellLoading } from './components/pisellLoading';
76
76
  export { default as PisellMenu } from './components/pisellMenu';
77
77
  export type { PisellMenuProps } from './components/pisellMenu/types';
78
78
  export { default as PisellModal } from './components/pisellModal';
79
+ export { default as PisellQRScanner } from './components/pisellQRScanner';
80
+ export type { PisellQRScannerProps } from './components/pisellQRScanner';
79
81
  export { default as PisellRow } from './components/pisellRow';
80
82
  export { default as PisellScan } from './components/pisellScan';
81
83
  export { default as PisellStatisticList } from './components/pisellStatisticList';
package/lib/index.js CHANGED
@@ -129,6 +129,7 @@ __export(src_exports, {
129
129
  PisellNavigationMenu: () => import_pisellNavigationMenu.default,
130
130
  PisellNumberKeyboard: () => import_Number.default,
131
131
  PisellPriceKeyboard: () => import_Amount.default,
132
+ PisellQRScanner: () => import_pisellQRScanner.default,
132
133
  PisellRow: () => import_pisellRow.default,
133
134
  PisellScan: () => import_pisellScan.default,
134
135
  PisellSider: () => import_sider.default,
@@ -264,6 +265,7 @@ var import_sider = __toESM(require("./components/pisellLayout/sider"));
264
265
  var import_pisellLoading = __toESM(require("./components/pisellLoading"));
265
266
  var import_pisellMenu = __toESM(require("./components/pisellMenu"));
266
267
  var import_pisellModal = __toESM(require("./components/pisellModal"));
268
+ var import_pisellQRScanner = __toESM(require("./components/pisellQRScanner"));
267
269
  var import_pisellRow = __toESM(require("./components/pisellRow"));
268
270
  var import_pisellScan = __toESM(require("./components/pisellScan"));
269
271
  var import_pisellStatisticList = __toESM(require("./components/pisellStatisticList"));
@@ -407,6 +409,7 @@ var import_BaseTranslation = __toESM(require("./components/dataSourceComponents/
407
409
  PisellNavigationMenu,
408
410
  PisellNumberKeyboard,
409
411
  PisellPriceKeyboard,
412
+ PisellQRScanner,
410
413
  PisellRow,
411
414
  PisellScan,
412
415
  PisellSider,
@@ -210,5 +210,18 @@ declare const _default: {
210
210
  'pisell-data-source-form-app-identifier-start-with-letter': string;
211
211
  'pisell-data-source-form-app-identifier-special-ends': string;
212
212
  'pisell-data-source-form-app-identifier-consecutive-special': string;
213
+ 'pisell-group-permissions-rule-required': string;
214
+ 'pisell-group-permissions-rule-limit': string;
215
+ 'pisell-data-source-form-app-identifier-letters-only': string;
216
+ 'pisell-data-source-form-app-identifier-alphanumeric': string;
217
+ "qrscanner-loading": string;
218
+ "qrscanner-success": string;
219
+ "qrscanner-success-qrcode": string;
220
+ "qrscanner-success-barcode": string;
221
+ "qrscanner-error-upload-image": string;
222
+ "qrscanner-error-load-failed": string;
223
+ "qrscanner-error-no-code": string;
224
+ "qrscanner-error-camera-init": string;
225
+ "qrscanner-error-process-image": string;
213
226
  };
214
227
  export default _default;
@@ -254,5 +254,23 @@ var en_US_default = {
254
254
  "pisell-data-source-form-app-identifier-pattern": "Can only contain lowercase letters, numbers, hyphens, dots, and underscores",
255
255
  "pisell-data-source-form-app-identifier-start-with-letter": "Must start with a letter",
256
256
  "pisell-data-source-form-app-identifier-special-ends": "Cannot end with a hyphen, dot, or underscore",
257
- "pisell-data-source-form-app-identifier-consecutive-special": "Cannot contain consecutive hyphens, dots, or underscores"
257
+ "pisell-data-source-form-app-identifier-consecutive-special": "Cannot contain consecutive hyphens, dots, or underscores",
258
+ // TODO(reilly): Added new properties to `zh-CN.ts`, so adding them here to avoid errors.
259
+ // Please update these translations as needed
260
+ "pisell-group-permissions-rule-required": "Required",
261
+ "pisell-group-permissions-rule-limit": "Maximum {{num}} characters",
262
+ "pisell-data-source-form-app-identifier-letters-only": "Must start with a letter",
263
+ "pisell-data-source-form-app-identifier-alphanumeric": "Can only contain letters, numbers, hyphens, dots, and underscores",
264
+ "pisell-data-source-form-app-identifier-special-ends": "Cannot end with a hyphen, dot, or underscore",
265
+ "pisell-data-source-form-app-identifier-consecutive-special": "Cannot contain consecutive hyphens, dots, or underscores",
266
+ // QR Scanner related texts
267
+ "qrscanner-loading": "Recognizing QR code...",
268
+ "qrscanner-success": "Successfully recognized: ",
269
+ "qrscanner-success-qrcode": "QR code successfully recognized: ",
270
+ "qrscanner-success-barcode": "Barcode successfully recognized: ",
271
+ "qrscanner-error-upload-image": "Please upload an image file",
272
+ "qrscanner-error-load-failed": "Failed to read file",
273
+ "qrscanner-error-no-code": "No QR code or barcode detected.",
274
+ "qrscanner-error-camera-init": "Cannot start camera. Please make sure it's authorized.",
275
+ "qrscanner-error-process-image": "Error processing image"
258
276
  };
@@ -209,5 +209,14 @@ declare const _default: {
209
209
  'pisell-data-source-form-app-identifier-start-with-letter': string;
210
210
  'pisell-data-source-form-app-identifier-special-ends': string;
211
211
  'pisell-data-source-form-app-identifier-consecutive-special': string;
212
+ "qrscanner-loading": string;
213
+ "qrscanner-success": string;
214
+ "qrscanner-success-qrcode": string;
215
+ "qrscanner-success-barcode": string;
216
+ "qrscanner-error-upload-image": string;
217
+ "qrscanner-error-load-failed": string;
218
+ "qrscanner-error-no-code": string;
219
+ "qrscanner-error-camera-init": string;
220
+ "qrscanner-error-process-image": string;
212
221
  };
213
222
  export default _default;
@@ -251,5 +251,15 @@ var zh_CN_default = {
251
251
  "pisell-data-source-form-app-identifier-pattern": "只能包含小写字母、数字、连字符、点和下划线",
252
252
  "pisell-data-source-form-app-identifier-start-with-letter": "必须以字母开头",
253
253
  "pisell-data-source-form-app-identifier-special-ends": "不能以连字符、点或下划线结尾",
254
- "pisell-data-source-form-app-identifier-consecutive-special": "不能包含连续的连字符、点或下划线"
254
+ "pisell-data-source-form-app-identifier-consecutive-special": "不能包含连续的连字符、点或下划线",
255
+ // QR Scanner 相关文案
256
+ "qrscanner-loading": "正在识别二维码...",
257
+ "qrscanner-success": "识别成功: ",
258
+ "qrscanner-success-qrcode": "二维码识别成功: ",
259
+ "qrscanner-success-barcode": "条形码识别成功: ",
260
+ "qrscanner-error-upload-image": "请上传图片文件",
261
+ "qrscanner-error-load-failed": "读取文件失败",
262
+ "qrscanner-error-no-code": "未检测到二维码或条形码",
263
+ "qrscanner-error-camera-init": "无法启动摄像头,请确保已授权",
264
+ "qrscanner-error-process-image": "处理图像时出错"
255
265
  };
@@ -209,5 +209,14 @@ declare const _default: {
209
209
  'pisell-data-source-form-app-identifier-start-with-letter': string;
210
210
  'pisell-data-source-form-app-identifier-special-ends': string;
211
211
  'pisell-data-source-form-app-identifier-consecutive-special': string;
212
+ "qrscanner-loading": string;
213
+ "qrscanner-success": string;
214
+ "qrscanner-success-qrcode": string;
215
+ "qrscanner-success-barcode": string;
216
+ "qrscanner-error-upload-image": string;
217
+ "qrscanner-error-load-failed": string;
218
+ "qrscanner-error-no-code": string;
219
+ "qrscanner-error-camera-init": string;
220
+ "qrscanner-error-process-image": string;
212
221
  };
213
222
  export default _default;
@@ -253,5 +253,15 @@ var zh_TW_default = {
253
253
  "pisell-data-source-form-app-identifier-pattern": "只能包含小寫字母、數字、連字符、點和下劃線",
254
254
  "pisell-data-source-form-app-identifier-start-with-letter": "必須以字母開頭",
255
255
  "pisell-data-source-form-app-identifier-special-ends": "不能以連字符、點或下劃線結尾",
256
- "pisell-data-source-form-app-identifier-consecutive-special": "不能包含連續的連字符、點或下劃線"
256
+ "pisell-data-source-form-app-identifier-consecutive-special": "不能包含連續的連字符、點或下劃線",
257
+ // QR Scanner 相關文案
258
+ "qrscanner-loading": "正在識別二維碼...",
259
+ "qrscanner-success": "識別成功: ",
260
+ "qrscanner-success-qrcode": "二維碼識別成功: ",
261
+ "qrscanner-success-barcode": "條形碼識別成功: ",
262
+ "qrscanner-error-upload-image": "請上傳圖片文件",
263
+ "qrscanner-error-load-failed": "讀取文件失敗",
264
+ "qrscanner-error-no-code": "未檢測到二維碼或條形碼",
265
+ "qrscanner-error-camera-init": "無法啟動攝像頭,請確保已授權",
266
+ "qrscanner-error-process-image": "處理圖像時出錯"
257
267
  };
@@ -0,0 +1,86 @@
1
+ import snippets from './snippets';
2
+
3
+ export default {
4
+ snippets,
5
+ componentName: 'PisellQRScanner',
6
+ title: '二维码扫描器',
7
+ category: '数据录入',
8
+ docUrl: '',
9
+ screenshot: '',
10
+ devMode: 'proCode',
11
+ npm: {
12
+ package: '@pisell/materials',
13
+ version: '1.0.3',
14
+ exportName: 'PisellQRScanner',
15
+ main: 'src/index.tsx',
16
+ destructuring: true,
17
+ subName: ''
18
+ },
19
+ props: [
20
+ {
21
+ name: 'visible',
22
+ title: { label: '是否可见', tip: '控制扫码界面是否可见' },
23
+ propType: 'bool',
24
+ defaultValue: false,
25
+ setter: 'BoolSetter'
26
+ },
27
+ {
28
+ name: 'showUpload',
29
+ title: { label: '显示上传图片', tip: '是否显示上传图片按钮,默认开启' },
30
+ propType: 'bool',
31
+ defaultValue: true,
32
+ setter: 'BoolSetter'
33
+ },
34
+ {
35
+ name: 'onClose',
36
+ title: { label: '关闭回调', tip: '扫码界面关闭时的回调函数' },
37
+ propType: 'func',
38
+ setter: {
39
+ componentName: 'FunctionSetter',
40
+ props: {
41
+ template: '() => {\n // 处理关闭事件\n}',
42
+ },
43
+ },
44
+ },
45
+ {
46
+ name: 'onScan',
47
+ title: { label: '扫码成功回调', tip: '扫码成功时的回调函数,参数为扫描结果字符串' },
48
+ propType: 'func',
49
+ setter: {
50
+ componentName: 'FunctionSetter',
51
+ props: {
52
+ template: '(result) => {\n // 处理扫描结果\n console.log(\'扫描结果:\', result);\n}',
53
+ },
54
+ },
55
+ },
56
+ {
57
+ name: 'className',
58
+ title: { label: '类名', tip: '自定义类名' },
59
+ propType: 'string',
60
+ setter: 'StringSetter'
61
+ },
62
+ {
63
+ name: 'style',
64
+ title: { label: '样式', tip: '自定义样式' },
65
+ propType: 'object',
66
+ setter: 'StyleSetter'
67
+ }
68
+ ],
69
+ configure: {
70
+ component: {
71
+ isContainer: false
72
+ },
73
+ supports: {
74
+ style: true,
75
+ className: true
76
+ },
77
+ events: {
78
+ onScan: {
79
+ description: '扫码成功时触发',
80
+ },
81
+ onClose: {
82
+ description: '扫码界面关闭时触发',
83
+ }
84
+ }
85
+ }
86
+ };
@@ -0,0 +1,25 @@
1
+ import { IPublicTypeSnippet } from '@alilc/lowcode-types';
2
+
3
+ const snippets: IPublicTypeSnippet[] = [
4
+ {
5
+ title: '二维码扫描器',
6
+ screenshot: '',
7
+ schema: {
8
+ componentName: 'PisellQRScanner',
9
+ props: {
10
+ visible: false,
11
+ showUpload: true,
12
+ onClose: {
13
+ type: 'JSFunction',
14
+ value: '() => {\n // 处理关闭事件\n}'
15
+ },
16
+ onScan: {
17
+ type: 'JSFunction',
18
+ value: '(result) => {\n // 处理扫描结果\n console.log(\'扫描结果:\', result);\n}'
19
+ }
20
+ }
21
+ }
22
+ }
23
+ ];
24
+
25
+ export default snippets;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/materials",
3
- "version": "6.0.17",
3
+ "version": "6.0.19",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -67,9 +67,9 @@
67
67
  "react-virtualized-auto-sizer": "^1.0.20",
68
68
  "react-window": "^1.8.10",
69
69
  "styled-components": "^6.0.0-rc.3",
70
- "@pisell/utils": "1.0.42",
70
+ "@pisell/icon": "0.0.11",
71
71
  "@pisell/date-picker": "1.0.100",
72
- "@pisell/icon": "0.0.11"
72
+ "@pisell/utils": "1.0.42"
73
73
  },
74
74
  "peerDependencies": {
75
75
  "react": "^18.0.0",
@@ -1,96 +0,0 @@
1
- /* 扫描线动画 */
2
- @keyframes scanAnimation {
3
- 0% {
4
- top: calc(50% - 100px);
5
- }
6
- 50% {
7
- top: calc(50% + 100px);
8
- }
9
- 100% {
10
- top: calc(50% - 100px);
11
- }
12
- }
13
-
14
- /* 扫描全屏容器 */
15
- .pisell-scan-fullscreen {
16
- position: fixed ;
17
- top: 0 ;
18
- left: 0 ;
19
- width: 100vw ;
20
- height: 100vh ;
21
- background-color: #000 ;
22
- z-index: 9999 ;
23
- overflow: hidden ;
24
- }
25
-
26
- /* 视频元素 */
27
- .scan-video {
28
- width: 100% ;
29
- height: 100% ;
30
- object-fit: cover ;
31
- object-position: center ;
32
- }
33
- .pisell-lowcode-input-group-addon{
34
- background-color: var(--Primary-600, #7F56D9);
35
- }
36
- /* 扫码按钮 */
37
- .scan-button {
38
- color: #722ED1;
39
- font-size: 18px;
40
- cursor: pointer;
41
- display: flex;
42
- align-items: center;
43
- }
44
-
45
- /* 关闭按钮 - 左上角 */
46
- .scan-close-left {
47
- position: fixed ;
48
- top: 15px ;
49
- left: 15px ;
50
- z-index: 9999 ;
51
- font-size: 24px ;
52
- color: #fff ;
53
- cursor: pointer ;
54
- background-color: rgba(255, 255, 255, 0.15) ;
55
- width: 40px ;
56
- height: 40px ;
57
- display: flex ;
58
- align-items: center ;
59
- justify-content: center ;
60
- border-radius: 50% ;
61
- }
62
-
63
- /* 上传按钮 - 右下角 */
64
- .scan-upload {
65
- position: fixed ;
66
- right: 20px ;
67
- bottom: 30px ;
68
- width: 50px ;
69
- height: 50px ;
70
- display: flex ;
71
- align-items: center ;
72
- justify-content: center ;
73
- z-index: 9999 ;
74
- font-size: 24px ;
75
- color: #fff ;
76
- background-color: rgba(255, 255, 255, 0.15) ;
77
- border-radius: 50% ;
78
- cursor: pointer ;
79
- }
80
-
81
- /* 隐藏的文件输入框 */
82
- .scan-file-input {
83
- display: none;
84
- }
85
-
86
- /* iconfont通用样式 */
87
- .scan-icon {
88
- font-size: 24px;
89
- color: #fff;
90
- }
91
-
92
- /* 扫码按钮的扫码图标 */
93
- .scan-button-icon {
94
- font-size: 24px;
95
- color: #722ED1;
96
- }
@@ -1,96 +0,0 @@
1
- /* 扫描线动画 */
2
- @keyframes scanAnimation {
3
- 0% {
4
- top: calc(50% - 100px);
5
- }
6
- 50% {
7
- top: calc(50% + 100px);
8
- }
9
- 100% {
10
- top: calc(50% - 100px);
11
- }
12
- }
13
-
14
- /* 扫描全屏容器 */
15
- .pisell-scan-fullscreen {
16
- position: fixed ;
17
- top: 0 ;
18
- left: 0 ;
19
- width: 100vw ;
20
- height: 100vh ;
21
- background-color: #000 ;
22
- z-index: 9999 ;
23
- overflow: hidden ;
24
- }
25
-
26
- /* 视频元素 */
27
- .scan-video {
28
- width: 100% ;
29
- height: 100% ;
30
- object-fit: cover ;
31
- object-position: center ;
32
- }
33
- .pisell-lowcode-input-group-addon{
34
- background-color: var(--Primary-600, #7F56D9);
35
- }
36
- /* 扫码按钮 */
37
- .scan-button {
38
- color: #722ED1;
39
- font-size: 18px;
40
- cursor: pointer;
41
- display: flex;
42
- align-items: center;
43
- }
44
-
45
- /* 关闭按钮 - 左上角 */
46
- .scan-close-left {
47
- position: fixed ;
48
- top: 15px ;
49
- left: 15px ;
50
- z-index: 9999 ;
51
- font-size: 24px ;
52
- color: #fff ;
53
- cursor: pointer ;
54
- background-color: rgba(255, 255, 255, 0.15) ;
55
- width: 40px ;
56
- height: 40px ;
57
- display: flex ;
58
- align-items: center ;
59
- justify-content: center ;
60
- border-radius: 50% ;
61
- }
62
-
63
- /* 上传按钮 - 右下角 */
64
- .scan-upload {
65
- position: fixed ;
66
- right: 20px ;
67
- bottom: 30px ;
68
- width: 50px ;
69
- height: 50px ;
70
- display: flex ;
71
- align-items: center ;
72
- justify-content: center ;
73
- z-index: 9999 ;
74
- font-size: 24px ;
75
- color: #fff ;
76
- background-color: rgba(255, 255, 255, 0.15) ;
77
- border-radius: 50% ;
78
- cursor: pointer ;
79
- }
80
-
81
- /* 隐藏的文件输入框 */
82
- .scan-file-input {
83
- display: none;
84
- }
85
-
86
- /* iconfont通用样式 */
87
- .scan-icon {
88
- font-size: 24px;
89
- color: #fff;
90
- }
91
-
92
- /* 扫码按钮的扫码图标 */
93
- .scan-button-icon {
94
- font-size: 24px;
95
- color: #722ED1;
96
- }