@pisell/materials 1.0.571 → 1.0.572
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/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +4 -4
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.js +11 -11
- package/es/components/dataSourceComponents/dataSourceForm/BaseForm.js +94 -3
- package/es/components/dataSourceComponents/dataSourceForm/type.d.ts +8 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/es/components/dataSourceComponents/dataSourceForm/utils.js +11 -0
- package/es/components/dataSourceComponents/dataSourceTable/BaseTable.js +46 -8
- package/es/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/es/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -1
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +4 -1
- package/es/components/dataSourceComponents/provider/actions/ActionsProvider.js +0 -1
- package/lib/components/dataSourceComponents/dataSourceForm/BaseForm.js +77 -4
- package/lib/components/dataSourceComponents/dataSourceForm/type.d.ts +8 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.d.ts +1 -0
- package/lib/components/dataSourceComponents/dataSourceForm/utils.js +8 -0
- package/lib/components/dataSourceComponents/dataSourceTable/BaseTable.js +14 -2
- package/lib/components/dataSourceComponents/dataSourceTable/hooks/useDrawerState.d.ts +2 -2
- package/lib/components/dataSourceComponents/provider/actions/ActionsContext.d.ts +6 -1
- package/lib/components/dataSourceComponents/provider/actions/ActionsProvider.d.ts +4 -1
- package/lowcode/data-source-form/meta.ts +131 -0
- package/lowcode/data-source-form/snippets.ts +54 -0
- package/lowcode/data-source-table/utils.tsx +28 -0
- package/package.json +3 -3
|
@@ -472,6 +472,137 @@ const dataSourceForm: MetaType = {
|
|
|
472
472
|
},
|
|
473
473
|
],
|
|
474
474
|
},
|
|
475
|
+
{
|
|
476
|
+
type: 'group',
|
|
477
|
+
title: {
|
|
478
|
+
type: 'i18n',
|
|
479
|
+
'en-US': 'Interaction behavior',
|
|
480
|
+
'zh-CN': '交互行为',
|
|
481
|
+
},
|
|
482
|
+
display: 'accordion',
|
|
483
|
+
items: [
|
|
484
|
+
{
|
|
485
|
+
name: 'leaveConfirmConfig',
|
|
486
|
+
title: {
|
|
487
|
+
label: {
|
|
488
|
+
type: 'i18n',
|
|
489
|
+
'en-US': 'Unsaved warning',
|
|
490
|
+
'zh-CN': '未保存离开提示',
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
setter: {
|
|
494
|
+
componentName: 'ObjectSetter',
|
|
495
|
+
props: {
|
|
496
|
+
config: {
|
|
497
|
+
items: [
|
|
498
|
+
{
|
|
499
|
+
name: 'enable',
|
|
500
|
+
title: {
|
|
501
|
+
type: 'i18n',
|
|
502
|
+
'en-US': 'Enable',
|
|
503
|
+
'zh-CN': '启用',
|
|
504
|
+
},
|
|
505
|
+
setter: 'BoolSetter',
|
|
506
|
+
isRequired: true,
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
name: 'icon',
|
|
510
|
+
title: {
|
|
511
|
+
type: 'i18n',
|
|
512
|
+
'en-US': 'Icon',
|
|
513
|
+
'zh-CN': '图标',
|
|
514
|
+
},
|
|
515
|
+
setter: [
|
|
516
|
+
{
|
|
517
|
+
componentName: 'SlotSetter',
|
|
518
|
+
initialValue: {
|
|
519
|
+
type: 'JSSlot',
|
|
520
|
+
value: [
|
|
521
|
+
{
|
|
522
|
+
componentName: 'Icon',
|
|
523
|
+
props: {
|
|
524
|
+
type: 'SmileOutlined',
|
|
525
|
+
size: 20,
|
|
526
|
+
rotate: 0,
|
|
527
|
+
spin: false,
|
|
528
|
+
},
|
|
529
|
+
},
|
|
530
|
+
],
|
|
531
|
+
},
|
|
532
|
+
defaultValue: null,
|
|
533
|
+
},
|
|
534
|
+
],
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
name: 'title',
|
|
538
|
+
title: {
|
|
539
|
+
type: 'i18n',
|
|
540
|
+
'en-US': 'Title',
|
|
541
|
+
'zh-CN': '标题',
|
|
542
|
+
},
|
|
543
|
+
setter: ['PisellI18nSetter', 'VariableSetter'],
|
|
544
|
+
defaultValue: {
|
|
545
|
+
type: 'i18n',
|
|
546
|
+
en: 'Unsaved Changes',
|
|
547
|
+
'zh-CN': '未保存的更改',
|
|
548
|
+
'zh-HK': '未保存的更改',
|
|
549
|
+
},
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: 'content',
|
|
553
|
+
title: {
|
|
554
|
+
type: 'i18n',
|
|
555
|
+
'en-US': 'Helper text',
|
|
556
|
+
'zh-CN': '辅助文字',
|
|
557
|
+
},
|
|
558
|
+
setter: ['PisellI18nSetter', 'VariableSetter'],
|
|
559
|
+
defaultValue: {
|
|
560
|
+
type: 'i18n',
|
|
561
|
+
en: 'You have unsaved changes. Are you sure you want to leave?',
|
|
562
|
+
'zh-CN': '您有未保存的更改,确定要离开?',
|
|
563
|
+
'zh-HK': '您有未保存的更改,確定要離開?',
|
|
564
|
+
},
|
|
565
|
+
},
|
|
566
|
+
{
|
|
567
|
+
name: 'cancelText',
|
|
568
|
+
title: {
|
|
569
|
+
type: 'i18n',
|
|
570
|
+
'en-US': 'Cancel button text',
|
|
571
|
+
'zh-CN': '取消按钮文字',
|
|
572
|
+
},
|
|
573
|
+
setter: ['PisellI18nSetter', 'VariableSetter'],
|
|
574
|
+
defaultValue: {
|
|
575
|
+
type: 'i18n',
|
|
576
|
+
en: 'Cancel',
|
|
577
|
+
'zh-CN': '取消',
|
|
578
|
+
'zh-HK': '取消',
|
|
579
|
+
},
|
|
580
|
+
},
|
|
581
|
+
{
|
|
582
|
+
name: 'okText',
|
|
583
|
+
title: {
|
|
584
|
+
type: 'i18n',
|
|
585
|
+
'en-US': 'OK button text',
|
|
586
|
+
'zh-CN': '确定按钮文字',
|
|
587
|
+
},
|
|
588
|
+
setter: ['PisellI18nSetter', 'VariableSetter'],
|
|
589
|
+
defaultValue: {
|
|
590
|
+
type: 'i18n',
|
|
591
|
+
en: 'Leave',
|
|
592
|
+
'zh-CN': '离开',
|
|
593
|
+
'zh-HK': '離開',
|
|
594
|
+
},
|
|
595
|
+
},
|
|
596
|
+
],
|
|
597
|
+
},
|
|
598
|
+
columns: 1,
|
|
599
|
+
forceInline: 1,
|
|
600
|
+
mode: 'popup',
|
|
601
|
+
},
|
|
602
|
+
},
|
|
603
|
+
},
|
|
604
|
+
]
|
|
605
|
+
},
|
|
475
606
|
],
|
|
476
607
|
configure: {
|
|
477
608
|
props: [
|
|
@@ -39,6 +39,33 @@ export default [
|
|
|
39
39
|
"function onFinishFailed({ values, errorFields, outOfDate }) {\n console.log('onFinishFailed', values, errorFields, outOfDate);\n}",
|
|
40
40
|
},
|
|
41
41
|
name: 'basic',
|
|
42
|
+
leaveConfirmConfig: {
|
|
43
|
+
enable: true,
|
|
44
|
+
title: {
|
|
45
|
+
type: 'i18n',
|
|
46
|
+
en: 'Unsaved Changes',
|
|
47
|
+
'zh-CN': '未保存的更改',
|
|
48
|
+
'zh-HK': '未保存的更改',
|
|
49
|
+
},
|
|
50
|
+
content: {
|
|
51
|
+
type: 'i18n',
|
|
52
|
+
en: 'You have unsaved changes. Are you sure you want to leave?',
|
|
53
|
+
'zh-CN': '您有未保存的更改,确定要离开?',
|
|
54
|
+
'zh-HK': '您有未保存的更改,確定要離開?',
|
|
55
|
+
},
|
|
56
|
+
okText: {
|
|
57
|
+
type: 'i18n',
|
|
58
|
+
en: 'Leave',
|
|
59
|
+
'zh-CN': '离开',
|
|
60
|
+
'zh-HK': '離開',
|
|
61
|
+
},
|
|
62
|
+
cancelText: {
|
|
63
|
+
type: 'i18n',
|
|
64
|
+
en: 'Cancel',
|
|
65
|
+
'zh-CN': '取消',
|
|
66
|
+
'zh-HK': '取消',
|
|
67
|
+
},
|
|
68
|
+
},
|
|
42
69
|
},
|
|
43
70
|
children: [],
|
|
44
71
|
},
|
|
@@ -85,6 +112,33 @@ export default [
|
|
|
85
112
|
"function onFinishFailed({ values, errorFields, outOfDate }) {\n console.log('onFinishFailed', values, errorFields, outOfDate);\n}",
|
|
86
113
|
},
|
|
87
114
|
name: 'basic',
|
|
115
|
+
leaveConfirmConfig: {
|
|
116
|
+
enable: true,
|
|
117
|
+
title: {
|
|
118
|
+
type: 'i18n',
|
|
119
|
+
en: 'Unsaved Changes',
|
|
120
|
+
'zh-CN': '未保存的更改',
|
|
121
|
+
'zh-HK': '未保存的更改',
|
|
122
|
+
},
|
|
123
|
+
content: {
|
|
124
|
+
type: 'i18n',
|
|
125
|
+
en: 'You have unsaved changes. Are you sure you want to leave?',
|
|
126
|
+
'zh-CN': '您有未保存的更改,确定要离开?',
|
|
127
|
+
'zh-HK': '您有未保存的更改,確定要離開?',
|
|
128
|
+
},
|
|
129
|
+
okText: {
|
|
130
|
+
type: 'i18n',
|
|
131
|
+
en: 'Leave',
|
|
132
|
+
'zh-CN': '离开',
|
|
133
|
+
'zh-HK': '離開',
|
|
134
|
+
},
|
|
135
|
+
cancelText: {
|
|
136
|
+
type: 'i18n',
|
|
137
|
+
en: 'Cancel',
|
|
138
|
+
'zh-CN': '取消',
|
|
139
|
+
'zh-HK': '取消',
|
|
140
|
+
},
|
|
141
|
+
},
|
|
88
142
|
},
|
|
89
143
|
children: [],
|
|
90
144
|
},
|
|
@@ -272,6 +272,34 @@ export const getFormContent = (target: any, mode: 'add' | 'edit' | 'view') => {
|
|
|
272
272
|
mode !== 'add'
|
|
273
273
|
? genDataSourceValueKey(target, 'currentRecord')
|
|
274
274
|
: undefined,
|
|
275
|
+
leaveConfirmConfig: mode !== 'view' ? {
|
|
276
|
+
enable: true,
|
|
277
|
+
title: {
|
|
278
|
+
type: 'i18n',
|
|
279
|
+
en: 'Unsaved Changes',
|
|
280
|
+
'zh-CN': '未保存的更改',
|
|
281
|
+
'zh-HK': '未保存的更改',
|
|
282
|
+
},
|
|
283
|
+
content: {
|
|
284
|
+
type: 'i18n',
|
|
285
|
+
en: 'You have unsaved changes. Are you sure you want to leave?',
|
|
286
|
+
'zh-CN': '您有未保存的更改,确定要离开?',
|
|
287
|
+
'zh-HK': '您有未保存的更改,確定要離開?',
|
|
288
|
+
},
|
|
289
|
+
okText: {
|
|
290
|
+
type: 'i18n',
|
|
291
|
+
en: 'Leave',
|
|
292
|
+
'zh-CN': '离开',
|
|
293
|
+
'zh-HK': '離開',
|
|
294
|
+
},
|
|
295
|
+
cancelText: {
|
|
296
|
+
type: 'i18n',
|
|
297
|
+
en: 'Cancel',
|
|
298
|
+
'zh-CN': '取消',
|
|
299
|
+
'zh-HK': '取消',
|
|
300
|
+
},
|
|
301
|
+
}
|
|
302
|
+
: undefined,
|
|
275
303
|
},
|
|
276
304
|
children: childrenSchemas,
|
|
277
305
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/materials",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.572",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -69,9 +69,9 @@
|
|
|
69
69
|
"libphonenumber-js": "^1.11.17",
|
|
70
70
|
"swiper": "^8.4.7",
|
|
71
71
|
"react-barcode": "^1.5.3",
|
|
72
|
+
"@pisell/utils": "1.0.43",
|
|
72
73
|
"@pisell/date-picker": "1.0.115",
|
|
73
|
-
"@pisell/icon": "0.0.10"
|
|
74
|
-
"@pisell/utils": "1.0.43"
|
|
74
|
+
"@pisell/icon": "0.0.10"
|
|
75
75
|
},
|
|
76
76
|
"peerDependencies": {
|
|
77
77
|
"react": "^18.0.0",
|