procode-lowcode-core 1.0.13 → 1.0.14

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.
@@ -17,10 +17,17 @@ type ValidationProps = {
17
17
  screenDataField: string;
18
18
  executeMode: ExecuteMode;
19
19
  };
20
+ export type EffectiveStyle = {
21
+ selector: string;
22
+ target: string;
23
+ important?: boolean;
24
+ };
20
25
  export type Style = {
21
26
  id?: string;
22
27
  className?: string;
23
28
  inline?: React.CSSProperties;
29
+ important?: boolean;
30
+ effectiveStyles?: EffectiveStyle[];
24
31
  };
25
32
  export interface BaseScreenElement {
26
33
  id: number | string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "procode-lowcode-core",
3
- "version": "1.0.13",
3
+ "version": "1.0.14",
4
4
  "description": "ProCode Core Library - React framework for low-code applications",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -32,6 +32,7 @@ const CellRenderer = ({
32
32
  <div
33
33
  id={widgetStyle?.id || ""}
34
34
  className={widgetStyle?.className || ""}
35
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
35
36
  style={styles}
36
37
  >
37
38
  {children.map((element) => (
@@ -16,6 +16,7 @@ export default function Container({
16
16
  <div
17
17
  id={widgetStyle?.id ?? ""}
18
18
  className={`${widgetStyle?.className ?? ""}`}
19
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
19
20
  style={{ ...(widgetStyle?.inline ?? {}) }}
20
21
  >
21
22
  {children.map((element) => (
@@ -19,6 +19,7 @@ const Drawer = ({
19
19
  <div
20
20
  id={widgetStyle?.id ?? ""}
21
21
  className={`prc-drawer ${widgetStyle?.className ?? ""}`}
22
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
22
23
  style={{ ...(widgetStyle?.inline ?? {}) }}
23
24
  >
24
25
  {children?.map((element: ScreenElement) => (
@@ -7,6 +7,7 @@ const DrawerRenderer = (props: DrawerElement) => {
7
7
  id={props.overlay.widgetStyle?.id ?? ""}
8
8
  style={{ ...(props.overlay.widgetStyle?.inline ?? {}) }}
9
9
  className={`prc-drawer-shield ${props.overlay.widgetStyle?.className ?? ""}`}
10
+ data-prc-col-important={props.overlay.widgetStyle?.important ? props.overlay.widgetStyle?.className || undefined : undefined}
10
11
  >
11
12
  <Drawer {...props} />
12
13
  </div>
@@ -23,6 +23,7 @@ const FormRenderer = ({
23
23
  e.preventDefault();
24
24
  }}
25
25
  className={widgetStyle?.className || ""}
26
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
26
27
  id={widgetStyle?.id || ""}
27
28
  style={{ ...(widgetStyle?.inline || {}) }}
28
29
  >
@@ -18,6 +18,7 @@ const LayoutRenderer = ({
18
18
  <div
19
19
  id={widgetStyle?.id || ""}
20
20
  className={`${widgetStyle?.className || ""}`}
21
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
21
22
  style={{
22
23
  ...(widgetStyle?.inline || {}),
23
24
  display: "grid",
@@ -18,6 +18,7 @@ const GenericLayoutRenderer = ({
18
18
  <div
19
19
  id={widgetStyle?.id || ""}
20
20
  className={`${widgetStyle?.className || ""}`}
21
+ data-prc-col-important={widgetStyle?.important ? widgetStyle?.className || undefined : undefined}
21
22
  style={{
22
23
  ...(widgetStyle?.inline || {}),
23
24
  display: "grid",
@@ -39,10 +39,23 @@ const Widget: React.FC<WidgetInjectorProps> = ({
39
39
  .getCustomWidgetProvider()
40
40
  ?.getWidgets();
41
41
 
42
- const WidgetComponent =
43
- customWidgets?.get?.(widgetProps.widgetType) ??
44
- templateWidgets?.get?.(widgetProps.widgetType) ??
45
- standardWidgets?.get?.(widgetProps.widgetType);
42
+ let WidgetComponent: React.FC<any> | undefined;
43
+
44
+ const targetFactory = widgetProps.targetWidgetFactory;
45
+ if (targetFactory === "CUSTOM") {
46
+ WidgetComponent = customWidgets?.get?.(widgetProps.widgetType);
47
+ } else if (targetFactory === "TEMPLATE") {
48
+ WidgetComponent = templateWidgets?.get?.(widgetProps.widgetType);
49
+ } else if (targetFactory === "DEFAULT") {
50
+ WidgetComponent = standardWidgets?.get?.(widgetProps.widgetType);
51
+ }
52
+
53
+ if (!WidgetComponent) {
54
+ WidgetComponent =
55
+ customWidgets?.get?.(widgetProps.widgetType) ??
56
+ templateWidgets?.get?.(widgetProps.widgetType) ??
57
+ standardWidgets?.get?.(widgetProps.widgetType);
58
+ }
46
59
 
47
60
  if (!WidgetComponent) {
48
61
  return (
@@ -48,7 +48,6 @@ export const useWidgetProps = (
48
48
  validations: getValidationProperty(),
49
49
  eventService: eventService,
50
50
  viewModel: viewModel,
51
- "sssss":"ss",
52
51
  ...events,
53
52
  dynamicEvents: events,
54
53
  });
@@ -17,10 +17,18 @@ type ValidationProps = {
17
17
  executeMode: ExecuteMode;
18
18
  };
19
19
 
20
+ export type EffectiveStyle = {
21
+ selector: string;
22
+ target: string;
23
+ important?: boolean;
24
+ };
25
+
20
26
  export type Style = {
21
27
  id?: string;
22
28
  className?: string;
23
29
  inline?: React.CSSProperties;
30
+ important?: boolean;
31
+ effectiveStyles?: EffectiveStyle[];
24
32
  };
25
33
 
26
34
  export interface BaseScreenElement {