@nice2dev/ui 1.4.5 → 1.4.7
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/CHANGELOG.md +76 -0
- package/dist/{NiceDataGrid-mrnaLHQk.cjs → NiceDataGrid-D3qRQSjy.cjs} +1 -1
- package/dist/NiceForm-BWb4LTQJ.cjs +1 -0
- package/dist/{NiceHtmlEditor-C1OVtLQ6.cjs → NiceHtmlEditor-BzECmDO3.cjs} +1 -1
- package/dist/{NiceMention-tgJKS8PH.cjs → NiceMention-CYRqPKGU.cjs} +19 -19
- package/dist/NiceModuleLifecyclePanel-CiYbPcHV.cjs +1 -0
- package/dist/{NicePagination-D7XxeNFz.cjs → NicePagination-BAxwqeEd.cjs} +1 -1
- package/dist/{NicePivotGrid-Cnkr9WkC.cjs → NicePivotGrid-Cxu5PECg.cjs} +1 -1
- package/dist/{NiceSavedQueryPanel-U1-yaw-Q.cjs → NiceSavedQueryPanel-BSZhE-_l.cjs} +6 -6
- package/dist/{NiceScheduler-Boo-D1S-.cjs → NiceScheduler-BqYiHPvz.cjs} +1 -1
- package/dist/{core-lazy-C_qnVGxE.cjs → core-lazy-BQexApr7.cjs} +1 -1
- package/dist/data.cjs +1 -1
- package/dist/database/NiceDataSourceEditor.mjs +370 -0
- package/dist/database/NiceQueryDesigner.mjs +958 -0
- package/dist/database/moduleDataSource.mjs +151 -0
- package/dist/database/queryDesign.mjs +396 -0
- package/dist/database/queryDesignerPanels.mjs +1214 -0
- package/dist/database/querySql.mjs +481 -0
- package/dist/editors.cjs +1 -1
- package/dist/index.cjs +188 -181
- package/dist/index.d.ts +674 -0
- package/dist/index.mjs +774 -720
- package/dist/lazy.cjs +1 -1
- package/dist/navigation.cjs +1 -1
- package/dist/no-code/NiceNoCodeScriptEditor.mjs +584 -0
- package/dist/no-code/noCodeScript.mjs +326 -0
- package/dist/no-code-B1jzfUF5.cjs +331 -0
- package/dist/no-code.cjs +1 -1
- package/dist/no-code.d.ts +177 -0
- package/dist/no-code.mjs +26 -16
- package/dist/style.css +2 -2
- package/package.json +4 -4
- package/dist/NiceForm-O3sv-DNX.cjs +0 -1
- package/dist/NiceModuleLifecyclePanel-DKlqKPy2.cjs +0 -1
- package/dist/NiceSelect-BNPXs6FQ.cjs +0 -1
- package/dist/no-code-B3BHeyG-.cjs +0 -331
package/dist/no-code.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./no-code-B1jzfUF5.cjs");exports.NICE_NO_CODE_STEP_TYPES=e.NICE_NO_CODE_STEP_TYPES;exports.NiceAPIFlow=e.NiceAPIFlow;exports.NiceCodePreview=e.NiceCodePreview;exports.NiceCodeTemplate=e.NiceCodeTemplate;exports.NiceComponentDesigner=e.NiceComponentDesigner;exports.NiceDataMapper=e.NiceDataMapper;exports.NiceEventOrchestrator=e.NiceEventOrchestrator;exports.NiceLowCodeStudio=e.NiceLowCodeStudio;exports.NiceNoCodeScriptEditor=e.NiceNoCodeScriptEditor;exports.NicePageBuilder=e.NicePageBuilder;exports.NiceStateDesigner=e.NiceStateDesigner;exports.NiceTestBuilder=e.NiceTestBuilder;exports.evaluateNoCodeExpression=e.evaluateNoCodeExpression;exports.newNoCodeStep=e.newNoCodeStep;exports.noCodeConditionsHold=e.noCodeConditionsHold;exports.noCodePath=e.noCodePath;exports.runNoCodeScript=e.runNoCodeScript;exports.validateNoCodeScript=e.validateNoCodeScript;
|
package/dist/no-code.d.ts
CHANGED
|
@@ -188,6 +188,12 @@ declare interface ErrorHandlingConfig {
|
|
|
188
188
|
transformError?: boolean;
|
|
189
189
|
}
|
|
190
190
|
|
|
191
|
+
/**
|
|
192
|
+
* The value of an expression in a scope. Throws on a syntax error. A text template — an expression
|
|
193
|
+
* that is a single string with `{{path}}` in it — fills each `{{…}}` with that path's value.
|
|
194
|
+
*/
|
|
195
|
+
export declare function evaluateNoCodeExpression(source: string, scope: Record<string, unknown>): unknown;
|
|
196
|
+
|
|
191
197
|
declare interface EventCondition {
|
|
192
198
|
field: string;
|
|
193
199
|
operator: 'eq' | 'neq' | 'gt' | 'lt' | 'gte' | 'lte' | 'contains' | 'exists';
|
|
@@ -360,6 +366,12 @@ declare interface MockResponse {
|
|
|
360
366
|
|
|
361
367
|
declare type MockType = 'function' | 'module' | 'api' | 'timer' | 'storage';
|
|
362
368
|
|
|
369
|
+
/** A new step of a type, with empty settings. */
|
|
370
|
+
export declare function newNoCodeStep(type: StepType): NiceNoCodeStep;
|
|
371
|
+
|
|
372
|
+
/** The kinds of step, in the order the editor offers them. */
|
|
373
|
+
export declare const NICE_NO_CODE_STEP_TYPES: readonly ["read", "filter", "map", "aggregate", "set", "if", "forEach", "write", "callScript", "return"];
|
|
374
|
+
|
|
363
375
|
export declare const NiceAPIFlow: default_2.FC<NiceAPIFlowProps>;
|
|
364
376
|
|
|
365
377
|
export declare interface NiceAPIFlowProps extends NiceBaseProps {
|
|
@@ -532,6 +544,152 @@ export declare interface NiceLowCodeStudioProps {
|
|
|
532
544
|
tutorial?: NiceComponentTutorial;
|
|
533
545
|
}
|
|
534
546
|
|
|
547
|
+
/**
|
|
548
|
+
* No-code scripts (1.4.6, R43 — documentation/PLAN.md §2: "skrypty… przede wszystkim no code operujące
|
|
549
|
+
* na źródłach danych"): a script is a list of steps — read rows from a data source, filter, map,
|
|
550
|
+
* aggregate, set variables, branch, loop, write rows, call another script, return a value — run by
|
|
551
|
+
* {@link runNoCodeScript} against the host's data through a small I/O adapter. React-free.
|
|
552
|
+
*
|
|
553
|
+
* Values in steps are expressions of a tiny, safe language (no `eval`): numbers, `'strings'`,
|
|
554
|
+
* `true` / `false` / `null`, variable paths (`order.total`, `rows.length`; inside a row step the
|
|
555
|
+
* row's fields by name), `+ - * /`, comparisons, `&& || !`, parentheses — and text templates
|
|
556
|
+
* (`'Hello {{customer.name}}'`).
|
|
557
|
+
*/
|
|
558
|
+
/** A condition on a value: `field op value` (all conditions of a list must hold). */
|
|
559
|
+
export declare interface NiceNoCodeCondition {
|
|
560
|
+
/** A path into the row (or, outside a row step, into the variables). */
|
|
561
|
+
field: string;
|
|
562
|
+
op: 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'empty' | 'notEmpty';
|
|
563
|
+
/** An expression. Not used by `empty` / `notEmpty`. */
|
|
564
|
+
value?: string;
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/** How a script reaches the host's data. */
|
|
568
|
+
export declare interface NiceNoCodeIo {
|
|
569
|
+
read(source: string): Promise<ReadonlyArray<Record<string, unknown>>>;
|
|
570
|
+
write?(target: string, rows: ReadonlyArray<Record<string, unknown>>, mode: 'insert' | 'update' | 'upsert' | 'delete'): Promise<void>;
|
|
571
|
+
callScript?(name: string, args: Record<string, unknown>): Promise<unknown>;
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/** A problem found in a script. */
|
|
575
|
+
export declare interface NiceNoCodeIssue {
|
|
576
|
+
stepId?: string;
|
|
577
|
+
message: string;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/** What a run gives back: the returned value, the variables at the end, the steps it went through. */
|
|
581
|
+
export declare interface NiceNoCodeRunResult {
|
|
582
|
+
value: unknown;
|
|
583
|
+
variables: Record<string, unknown>;
|
|
584
|
+
/** Step ids in the order they ran (a loop's steps once per row). */
|
|
585
|
+
trace: string[];
|
|
586
|
+
}
|
|
587
|
+
|
|
588
|
+
/** A no-code script: its parameters and its steps. */
|
|
589
|
+
export declare interface NiceNoCodeScript {
|
|
590
|
+
parameters?: Array<{
|
|
591
|
+
name: string;
|
|
592
|
+
type?: string;
|
|
593
|
+
description?: string;
|
|
594
|
+
}>;
|
|
595
|
+
steps: NiceNoCodeStep[];
|
|
596
|
+
}
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* {@link NiceNoCodeScriptEditor} — the steps of a no-code script, nested, with the picked step's
|
|
600
|
+
* settings beside them and the script's problems marked.
|
|
601
|
+
*/
|
|
602
|
+
export declare const NiceNoCodeScriptEditor: default_2.FC<NiceNoCodeScriptEditorProps>;
|
|
603
|
+
|
|
604
|
+
/** Props for the {@link NiceNoCodeScriptEditor} component. */
|
|
605
|
+
export declare interface NiceNoCodeScriptEditorProps extends NiceBaseProps {
|
|
606
|
+
/** The script — **controlled**. Omit it to let the editor keep its own copy. */
|
|
607
|
+
value?: NiceNoCodeScript;
|
|
608
|
+
/** The script at first in the uncontrolled mode. Default: no steps. */
|
|
609
|
+
defaultValue?: NiceNoCodeScript;
|
|
610
|
+
onChange?: (script: NiceNoCodeScript) => void;
|
|
611
|
+
/** Data source keys offered by `read` and `write` steps. */
|
|
612
|
+
dataSources?: string[];
|
|
613
|
+
/** Script names offered by `callScript` steps. */
|
|
614
|
+
scripts?: string[];
|
|
615
|
+
/** The host's data: with it a Run button runs the script and shows its result. */
|
|
616
|
+
io?: NiceNoCodeIo;
|
|
617
|
+
readOnly?: boolean;
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
/** One step of a no-code script. Each has an `id`, unique in the script. */
|
|
621
|
+
export declare type NiceNoCodeStep = {
|
|
622
|
+
id: string;
|
|
623
|
+
type: 'read';
|
|
624
|
+
/** The data source's key. */
|
|
625
|
+
source: string;
|
|
626
|
+
where?: NiceNoCodeCondition[];
|
|
627
|
+
/** The variable the rows go to. */
|
|
628
|
+
into: string;
|
|
629
|
+
} | {
|
|
630
|
+
id: string;
|
|
631
|
+
type: 'filter';
|
|
632
|
+
from: string;
|
|
633
|
+
where: NiceNoCodeCondition[];
|
|
634
|
+
into: string;
|
|
635
|
+
} | {
|
|
636
|
+
id: string;
|
|
637
|
+
type: 'map';
|
|
638
|
+
from: string;
|
|
639
|
+
/** Each target field and its expression over the row. */
|
|
640
|
+
fields: Array<{
|
|
641
|
+
target: string;
|
|
642
|
+
expression: string;
|
|
643
|
+
}>;
|
|
644
|
+
into: string;
|
|
645
|
+
} | {
|
|
646
|
+
id: string;
|
|
647
|
+
type: 'aggregate';
|
|
648
|
+
from: string;
|
|
649
|
+
groupBy?: string[];
|
|
650
|
+
measures: Array<{
|
|
651
|
+
name: string;
|
|
652
|
+
op: 'count' | 'sum' | 'avg' | 'min' | 'max';
|
|
653
|
+
field?: string;
|
|
654
|
+
}>;
|
|
655
|
+
into: string;
|
|
656
|
+
} | {
|
|
657
|
+
id: string;
|
|
658
|
+
type: 'set';
|
|
659
|
+
variable: string;
|
|
660
|
+
expression: string;
|
|
661
|
+
} | {
|
|
662
|
+
id: string;
|
|
663
|
+
type: 'if';
|
|
664
|
+
when: NiceNoCodeCondition[];
|
|
665
|
+
then: NiceNoCodeStep[];
|
|
666
|
+
else?: NiceNoCodeStep[];
|
|
667
|
+
} | {
|
|
668
|
+
id: string;
|
|
669
|
+
type: 'forEach';
|
|
670
|
+
from: string;
|
|
671
|
+
as: string;
|
|
672
|
+
steps: NiceNoCodeStep[];
|
|
673
|
+
} | {
|
|
674
|
+
id: string;
|
|
675
|
+
type: 'write';
|
|
676
|
+
/** The data source or entity written to. */
|
|
677
|
+
target: string;
|
|
678
|
+
from: string;
|
|
679
|
+
mode?: 'insert' | 'update' | 'upsert' | 'delete';
|
|
680
|
+
} | {
|
|
681
|
+
id: string;
|
|
682
|
+
type: 'callScript';
|
|
683
|
+
script: string;
|
|
684
|
+
/** Argument name → expression. */
|
|
685
|
+
args?: Record<string, string>;
|
|
686
|
+
into?: string;
|
|
687
|
+
} | {
|
|
688
|
+
id: string;
|
|
689
|
+
type: 'return';
|
|
690
|
+
expression: string;
|
|
691
|
+
};
|
|
692
|
+
|
|
535
693
|
/**
|
|
536
694
|
* NicePageBuilder - Drag-drop page builder with responsive layouts
|
|
537
695
|
*
|
|
@@ -595,6 +753,12 @@ export declare interface NiceTestBuilderProps extends NiceBaseProps {
|
|
|
595
753
|
tutorial?: NiceComponentTutorial;
|
|
596
754
|
}
|
|
597
755
|
|
|
756
|
+
/** Whether every condition holds for `row` (its fields), with `scope` for the values' expressions. */
|
|
757
|
+
export declare function noCodeConditionsHold(conditions: readonly NiceNoCodeCondition[] | undefined, row: Record<string, unknown>, scope: Record<string, unknown>): boolean;
|
|
758
|
+
|
|
759
|
+
/** The value at a dotted path (`order.lines.length`), or undefined. */
|
|
760
|
+
export declare function noCodePath(scope: Record<string, unknown>, path: string): unknown;
|
|
761
|
+
|
|
598
762
|
declare interface PageLayout {
|
|
599
763
|
id: string;
|
|
600
764
|
name: string;
|
|
@@ -668,6 +832,14 @@ declare interface RetryConfig {
|
|
|
668
832
|
retryOn?: number[];
|
|
669
833
|
}
|
|
670
834
|
|
|
835
|
+
/**
|
|
836
|
+
* Runs a script: its steps in order over `variables` (the arguments), reading and writing through
|
|
837
|
+
* `io`. Stops at a `return` step (its value is the result) or after `maxSteps` (a loop gone wrong).
|
|
838
|
+
*/
|
|
839
|
+
export declare function runNoCodeScript(script: NiceNoCodeScript, io: NiceNoCodeIo, args?: Record<string, unknown>, options?: {
|
|
840
|
+
maxSteps?: number;
|
|
841
|
+
}): Promise<NiceNoCodeRunResult>;
|
|
842
|
+
|
|
671
843
|
declare interface SchemaDefinition {
|
|
672
844
|
type: 'object' | 'array' | 'string' | 'number' | 'boolean';
|
|
673
845
|
properties?: Record<string, SchemaDefinition>;
|
|
@@ -731,6 +903,8 @@ declare interface StateSlice {
|
|
|
731
903
|
computed?: ComputedField[];
|
|
732
904
|
}
|
|
733
905
|
|
|
906
|
+
declare type StepType = NiceNoCodeStep['type'];
|
|
907
|
+
|
|
734
908
|
declare interface StoreDefinition {
|
|
735
909
|
id: string;
|
|
736
910
|
name: string;
|
|
@@ -841,6 +1015,9 @@ declare interface TransformConfig {
|
|
|
841
1015
|
|
|
842
1016
|
declare type TransformType = 'direct' | 'format' | 'convert' | 'concat' | 'split' | 'calculate' | 'lookup' | 'conditional' | 'custom';
|
|
843
1017
|
|
|
1018
|
+
/** The script's problems: missing names, duplicate ids, expressions that do not parse. */
|
|
1019
|
+
export declare function validateNoCodeScript(script: NiceNoCodeScript): NiceNoCodeIssue[];
|
|
1020
|
+
|
|
844
1021
|
declare interface ValidationRule {
|
|
845
1022
|
type: 'required' | 'min' | 'max' | 'pattern' | 'enum';
|
|
846
1023
|
value?: unknown;
|
package/dist/no-code.mjs
CHANGED
|
@@ -1,22 +1,32 @@
|
|
|
1
1
|
import { NiceLowCodeStudio as r } from "./no-code/NiceLowCodeStudio.mjs";
|
|
2
2
|
import { NiceComponentDesigner as i } from "./no-code/NiceComponentDesigner.mjs";
|
|
3
|
-
import { NicePageBuilder as
|
|
4
|
-
import { NiceCodePreview as
|
|
5
|
-
import { NiceStateDesigner as
|
|
6
|
-
import { NiceAPIFlow as
|
|
7
|
-
import { NiceDataMapper as
|
|
8
|
-
import { NiceEventOrchestrator as
|
|
9
|
-
import { NiceTestBuilder as
|
|
10
|
-
import { NiceCodeTemplate as
|
|
3
|
+
import { NicePageBuilder as N } from "./no-code/NicePageBuilder.mjs";
|
|
4
|
+
import { NiceCodePreview as c } from "./no-code/NiceCodePreview.mjs";
|
|
5
|
+
import { NiceStateDesigner as C } from "./no-code/NiceStateDesigner.mjs";
|
|
6
|
+
import { NiceAPIFlow as a } from "./no-code/NiceAPIFlow.mjs";
|
|
7
|
+
import { NiceDataMapper as n } from "./no-code/NiceDataMapper.mjs";
|
|
8
|
+
import { NiceEventOrchestrator as l } from "./no-code/NiceEventOrchestrator.mjs";
|
|
9
|
+
import { NiceTestBuilder as E } from "./no-code/NiceTestBuilder.mjs";
|
|
10
|
+
import { NiceCodeTemplate as u } from "./no-code/NiceCodeTemplate.mjs";
|
|
11
|
+
import { NiceNoCodeScriptEditor as w, newNoCodeStep as D } from "./no-code/NiceNoCodeScriptEditor.mjs";
|
|
12
|
+
import { NICE_NO_CODE_STEP_TYPES as _, evaluateNoCodeExpression as g, noCodeConditionsHold as O, noCodePath as h, runNoCodeScript as B, validateNoCodeScript as I } from "./no-code/noCodeScript.mjs";
|
|
11
13
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
_ as NICE_NO_CODE_STEP_TYPES,
|
|
15
|
+
a as NiceAPIFlow,
|
|
16
|
+
c as NiceCodePreview,
|
|
17
|
+
u as NiceCodeTemplate,
|
|
15
18
|
i as NiceComponentDesigner,
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
n as NiceDataMapper,
|
|
20
|
+
l as NiceEventOrchestrator,
|
|
18
21
|
r as NiceLowCodeStudio,
|
|
19
|
-
|
|
20
|
-
N as
|
|
21
|
-
|
|
22
|
+
w as NiceNoCodeScriptEditor,
|
|
23
|
+
N as NicePageBuilder,
|
|
24
|
+
C as NiceStateDesigner,
|
|
25
|
+
E as NiceTestBuilder,
|
|
26
|
+
g as evaluateNoCodeExpression,
|
|
27
|
+
D as newNoCodeStep,
|
|
28
|
+
O as noCodeConditionsHold,
|
|
29
|
+
h as noCodePath,
|
|
30
|
+
B as runNoCodeScript,
|
|
31
|
+
I as validateNoCodeScript
|
|
22
32
|
};
|