@pactor-app/runtime 1.34.0 → 1.40.0
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/dist/index.cjs +44 -2
- package/dist/index.d.cts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +44 -2
- package/package.json +4 -4
package/dist/index.cjs
CHANGED
|
@@ -502,8 +502,14 @@ var defaultMessages = {
|
|
|
502
502
|
"pactor.layout.breadcrumb": "\u9762\u5305\u5C51",
|
|
503
503
|
"pactor.table.loading": "\u52A0\u8F7D\u4E2D\u2026",
|
|
504
504
|
"pactor.table.empty": "\u6682\u65E0\u6570\u636E",
|
|
505
|
+
"pactor.table.selectAll": "\u5168\u9009",
|
|
506
|
+
"pactor.table.selectRow": "\u9009\u62E9\u884C",
|
|
507
|
+
"pactor.table.expandRow": "\u5C55\u5F00\u884C",
|
|
508
|
+
"pactor.table.collapseRow": "\u6536\u8D77\u884C",
|
|
509
|
+
"pactor.table.dragRow": "\u62D6\u62FD\u6392\u5E8F",
|
|
505
510
|
"pactor.form.required": "\u5FC5\u586B",
|
|
506
511
|
"pactor.select.clear": "\u6E05\u9664",
|
|
512
|
+
"pactor.select.search": "\u641C\u7D22\u9009\u9879",
|
|
507
513
|
"pactor.input.clear": "\u6E05\u9664",
|
|
508
514
|
"pactor.numberInput.increase": "\u589E\u52A0",
|
|
509
515
|
"pactor.numberInput.decrease": "\u51CF\u5C11",
|
|
@@ -523,7 +529,8 @@ var defaultMessages = {
|
|
|
523
529
|
"pactor.login.password": "\u5BC6\u7801",
|
|
524
530
|
"pactor.login.passwordPlaceholder": "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
525
531
|
"pactor.login.passwordRequired": "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
526
|
-
"pactor.login.submit": "\u767B \u5F55"
|
|
532
|
+
"pactor.login.submit": "\u767B \u5F55",
|
|
533
|
+
"pactor.cardList.total": "\u5171 {{count}} \u4E2A"
|
|
527
534
|
},
|
|
528
535
|
"en-US": {
|
|
529
536
|
"pactor.layout.expandSidebar": "Expand sidebar",
|
|
@@ -533,8 +540,14 @@ var defaultMessages = {
|
|
|
533
540
|
"pactor.layout.breadcrumb": "Breadcrumb",
|
|
534
541
|
"pactor.table.loading": "Loading\u2026",
|
|
535
542
|
"pactor.table.empty": "No data",
|
|
543
|
+
"pactor.table.selectAll": "Select all",
|
|
544
|
+
"pactor.table.selectRow": "Select row",
|
|
545
|
+
"pactor.table.expandRow": "Expand row",
|
|
546
|
+
"pactor.table.collapseRow": "Collapse row",
|
|
547
|
+
"pactor.table.dragRow": "Drag to reorder",
|
|
536
548
|
"pactor.form.required": "Required",
|
|
537
549
|
"pactor.select.clear": "Clear",
|
|
550
|
+
"pactor.select.search": "Search options",
|
|
538
551
|
"pactor.input.clear": "Clear",
|
|
539
552
|
"pactor.numberInput.increase": "Increase",
|
|
540
553
|
"pactor.numberInput.decrease": "Decrease",
|
|
@@ -554,7 +567,8 @@ var defaultMessages = {
|
|
|
554
567
|
"pactor.login.password": "Password",
|
|
555
568
|
"pactor.login.passwordPlaceholder": "Enter password",
|
|
556
569
|
"pactor.login.passwordRequired": "Please enter password",
|
|
557
|
-
"pactor.login.submit": "Sign in"
|
|
570
|
+
"pactor.login.submit": "Sign in",
|
|
571
|
+
"pactor.cardList.total": "Total {{count}}"
|
|
558
572
|
}
|
|
559
573
|
};
|
|
560
574
|
function createDefaultI18n(locale) {
|
|
@@ -598,6 +612,11 @@ function registerBuiltinActions(registry) {
|
|
|
598
612
|
);
|
|
599
613
|
return { ok: true };
|
|
600
614
|
});
|
|
615
|
+
register("delay", async (action) => {
|
|
616
|
+
const raw = Number(action.params?.["ms"] ?? 300);
|
|
617
|
+
await new Promise((resolve) => setTimeout(resolve, Number.isFinite(raw) ? raw : 300));
|
|
618
|
+
return { ok: true };
|
|
619
|
+
});
|
|
601
620
|
register("request", async (action, ctx) => {
|
|
602
621
|
const params = action.params ?? {};
|
|
603
622
|
const { target, method, url, headers, body } = params;
|
|
@@ -749,6 +768,29 @@ function registerBuiltinActions(registry) {
|
|
|
749
768
|
handle.setValues(values);
|
|
750
769
|
return { ok: true };
|
|
751
770
|
});
|
|
771
|
+
register("form.submit", (action, ctx) => {
|
|
772
|
+
const formName = action.params?.["form"];
|
|
773
|
+
const name = typeof formName === "string" && formName !== "" ? formName : "default";
|
|
774
|
+
const handle = ctx.context.forms.get(name);
|
|
775
|
+
if (!handle) {
|
|
776
|
+
return {
|
|
777
|
+
ok: false,
|
|
778
|
+
error: new Error(
|
|
779
|
+
`[@pactor-app/runtime] form.submit \u76EE\u6807\u8868\u5355\u672A\u6CE8\u518C: "${name}"`
|
|
780
|
+
)
|
|
781
|
+
};
|
|
782
|
+
}
|
|
783
|
+
if (typeof handle.submit !== "function") {
|
|
784
|
+
return {
|
|
785
|
+
ok: false,
|
|
786
|
+
error: new Error(
|
|
787
|
+
`[@pactor-app/runtime] form.submit \u76EE\u6807\u8868\u5355\u4E0D\u652F\u6301\u63D0\u4EA4: "${name}"`
|
|
788
|
+
)
|
|
789
|
+
};
|
|
790
|
+
}
|
|
791
|
+
handle.submit();
|
|
792
|
+
return { ok: true };
|
|
793
|
+
});
|
|
752
794
|
}
|
|
753
795
|
function asActions(value) {
|
|
754
796
|
if (Array.isArray(value)) {
|
package/dist/index.d.cts
CHANGED
|
@@ -229,6 +229,9 @@ type CapabilityRegistry = Registry<unknown>;
|
|
|
229
229
|
*/
|
|
230
230
|
interface FormHandle {
|
|
231
231
|
setValues(values: Record<string, unknown>): void;
|
|
232
|
+
/** 触发表单原生提交(requestSubmit):走统一校验与 onSubmit 链路,
|
|
233
|
+
* 供 <form> DOM 外的提交入口(如 Drawer footer 按钮 / form.submit 动作) */
|
|
234
|
+
submit?(): void;
|
|
232
235
|
}
|
|
233
236
|
/** Form Registry:表单名 → 句柄(缺省名 'default') */
|
|
234
237
|
type FormRegistry = Registry<FormHandle>;
|
package/dist/index.d.ts
CHANGED
|
@@ -229,6 +229,9 @@ type CapabilityRegistry = Registry<unknown>;
|
|
|
229
229
|
*/
|
|
230
230
|
interface FormHandle {
|
|
231
231
|
setValues(values: Record<string, unknown>): void;
|
|
232
|
+
/** 触发表单原生提交(requestSubmit):走统一校验与 onSubmit 链路,
|
|
233
|
+
* 供 <form> DOM 外的提交入口(如 Drawer footer 按钮 / form.submit 动作) */
|
|
234
|
+
submit?(): void;
|
|
232
235
|
}
|
|
233
236
|
/** Form Registry:表单名 → 句柄(缺省名 'default') */
|
|
234
237
|
type FormRegistry = Registry<FormHandle>;
|
package/dist/index.js
CHANGED
|
@@ -457,8 +457,14 @@ var defaultMessages = {
|
|
|
457
457
|
"pactor.layout.breadcrumb": "\u9762\u5305\u5C51",
|
|
458
458
|
"pactor.table.loading": "\u52A0\u8F7D\u4E2D\u2026",
|
|
459
459
|
"pactor.table.empty": "\u6682\u65E0\u6570\u636E",
|
|
460
|
+
"pactor.table.selectAll": "\u5168\u9009",
|
|
461
|
+
"pactor.table.selectRow": "\u9009\u62E9\u884C",
|
|
462
|
+
"pactor.table.expandRow": "\u5C55\u5F00\u884C",
|
|
463
|
+
"pactor.table.collapseRow": "\u6536\u8D77\u884C",
|
|
464
|
+
"pactor.table.dragRow": "\u62D6\u62FD\u6392\u5E8F",
|
|
460
465
|
"pactor.form.required": "\u5FC5\u586B",
|
|
461
466
|
"pactor.select.clear": "\u6E05\u9664",
|
|
467
|
+
"pactor.select.search": "\u641C\u7D22\u9009\u9879",
|
|
462
468
|
"pactor.input.clear": "\u6E05\u9664",
|
|
463
469
|
"pactor.numberInput.increase": "\u589E\u52A0",
|
|
464
470
|
"pactor.numberInput.decrease": "\u51CF\u5C11",
|
|
@@ -478,7 +484,8 @@ var defaultMessages = {
|
|
|
478
484
|
"pactor.login.password": "\u5BC6\u7801",
|
|
479
485
|
"pactor.login.passwordPlaceholder": "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
480
486
|
"pactor.login.passwordRequired": "\u8BF7\u8F93\u5165\u5BC6\u7801",
|
|
481
|
-
"pactor.login.submit": "\u767B \u5F55"
|
|
487
|
+
"pactor.login.submit": "\u767B \u5F55",
|
|
488
|
+
"pactor.cardList.total": "\u5171 {{count}} \u4E2A"
|
|
482
489
|
},
|
|
483
490
|
"en-US": {
|
|
484
491
|
"pactor.layout.expandSidebar": "Expand sidebar",
|
|
@@ -488,8 +495,14 @@ var defaultMessages = {
|
|
|
488
495
|
"pactor.layout.breadcrumb": "Breadcrumb",
|
|
489
496
|
"pactor.table.loading": "Loading\u2026",
|
|
490
497
|
"pactor.table.empty": "No data",
|
|
498
|
+
"pactor.table.selectAll": "Select all",
|
|
499
|
+
"pactor.table.selectRow": "Select row",
|
|
500
|
+
"pactor.table.expandRow": "Expand row",
|
|
501
|
+
"pactor.table.collapseRow": "Collapse row",
|
|
502
|
+
"pactor.table.dragRow": "Drag to reorder",
|
|
491
503
|
"pactor.form.required": "Required",
|
|
492
504
|
"pactor.select.clear": "Clear",
|
|
505
|
+
"pactor.select.search": "Search options",
|
|
493
506
|
"pactor.input.clear": "Clear",
|
|
494
507
|
"pactor.numberInput.increase": "Increase",
|
|
495
508
|
"pactor.numberInput.decrease": "Decrease",
|
|
@@ -509,7 +522,8 @@ var defaultMessages = {
|
|
|
509
522
|
"pactor.login.password": "Password",
|
|
510
523
|
"pactor.login.passwordPlaceholder": "Enter password",
|
|
511
524
|
"pactor.login.passwordRequired": "Please enter password",
|
|
512
|
-
"pactor.login.submit": "Sign in"
|
|
525
|
+
"pactor.login.submit": "Sign in",
|
|
526
|
+
"pactor.cardList.total": "Total {{count}}"
|
|
513
527
|
}
|
|
514
528
|
};
|
|
515
529
|
function createDefaultI18n(locale) {
|
|
@@ -553,6 +567,11 @@ function registerBuiltinActions(registry) {
|
|
|
553
567
|
);
|
|
554
568
|
return { ok: true };
|
|
555
569
|
});
|
|
570
|
+
register("delay", async (action) => {
|
|
571
|
+
const raw = Number(action.params?.["ms"] ?? 300);
|
|
572
|
+
await new Promise((resolve) => setTimeout(resolve, Number.isFinite(raw) ? raw : 300));
|
|
573
|
+
return { ok: true };
|
|
574
|
+
});
|
|
556
575
|
register("request", async (action, ctx) => {
|
|
557
576
|
const params = action.params ?? {};
|
|
558
577
|
const { target, method, url, headers, body } = params;
|
|
@@ -704,6 +723,29 @@ function registerBuiltinActions(registry) {
|
|
|
704
723
|
handle.setValues(values);
|
|
705
724
|
return { ok: true };
|
|
706
725
|
});
|
|
726
|
+
register("form.submit", (action, ctx) => {
|
|
727
|
+
const formName = action.params?.["form"];
|
|
728
|
+
const name = typeof formName === "string" && formName !== "" ? formName : "default";
|
|
729
|
+
const handle = ctx.context.forms.get(name);
|
|
730
|
+
if (!handle) {
|
|
731
|
+
return {
|
|
732
|
+
ok: false,
|
|
733
|
+
error: new Error(
|
|
734
|
+
`[@pactor-app/runtime] form.submit \u76EE\u6807\u8868\u5355\u672A\u6CE8\u518C: "${name}"`
|
|
735
|
+
)
|
|
736
|
+
};
|
|
737
|
+
}
|
|
738
|
+
if (typeof handle.submit !== "function") {
|
|
739
|
+
return {
|
|
740
|
+
ok: false,
|
|
741
|
+
error: new Error(
|
|
742
|
+
`[@pactor-app/runtime] form.submit \u76EE\u6807\u8868\u5355\u4E0D\u652F\u6301\u63D0\u4EA4: "${name}"`
|
|
743
|
+
)
|
|
744
|
+
};
|
|
745
|
+
}
|
|
746
|
+
handle.submit();
|
|
747
|
+
return { ok: true };
|
|
748
|
+
});
|
|
707
749
|
}
|
|
708
750
|
function asActions(value) {
|
|
709
751
|
if (Array.isArray(value)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pactor-app/runtime",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.40.0",
|
|
4
4
|
"description": "Pactor runtime: RuntimeContext, StateStore, DataSource runtime, action engine, React renderer and page runtime",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pactor",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
-
"@pactor-app/core": "1.
|
|
49
|
-
"@pactor-app/
|
|
50
|
-
"@pactor-app/
|
|
48
|
+
"@pactor-app/core": "1.40.0",
|
|
49
|
+
"@pactor-app/schema": "1.40.0",
|
|
50
|
+
"@pactor-app/expression": "1.40.0"
|
|
51
51
|
},
|
|
52
52
|
"peerDependencies": {
|
|
53
53
|
"react": ">=18"
|