impaktapps-ui-builder 1.0.71 → 1.0.72

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.
@@ -0,0 +1 @@
1
+ export declare const buildImage: (config: any, componentScope: any) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.71",
3
+ "version": "1.0.72",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -0,0 +1,44 @@
1
+ import _ from "lodash";
2
+ import { createLayoutFormat } from "./buildConfig";
3
+
4
+ const imageUiSchema = {
5
+ type: "Control",
6
+ scope: "#/properties/Logo",
7
+
8
+ options: {
9
+ widget: "Image",
10
+ },
11
+ config: {
12
+ layout: 3,
13
+ main: {
14
+ url: "",
15
+ },
16
+ style: {
17
+ // imageStyle: { width: 300 },
18
+
19
+ // containerStyle: {
20
+ // display: "flex",
21
+ // justifyContent: "center",
22
+ // alignItems: "center",
23
+ // marginLeft: "32px",
24
+ // marginTop: 2,
25
+ // },
26
+ },
27
+ },
28
+ };
29
+
30
+ export const buildImage = (config, componentScope) => {
31
+ const image: any = _.cloneDeep(imageUiSchema);
32
+ image.scope = componentScope;
33
+ image.config.main.url = config.imageUrl;
34
+ if (config.layout) {
35
+ image.config.layout = createLayoutFormat(config.layout);
36
+ }
37
+ if (config.style) {
38
+ image.config.style = JSON.parse(config.style);
39
+ }
40
+ if (config.height) {
41
+ image.config.style.imageStyle = {...image.config.style.imageStyle, height: config.height}
42
+ }
43
+ return image;
44
+ };
@@ -41,6 +41,7 @@ import { buildInputSlider } from "./buildInputSlider";
41
41
  import { buildTreeMap } from "./buildTreeMap";
42
42
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
43
43
  import { buildHorizontalLayout } from "./buildHorizontalLayout";
44
+ import { buildImage } from "./buildImage";
44
45
  export let schema = {
45
46
  type: "object",
46
47
  properties: {},
@@ -311,6 +312,8 @@ const buildUiSchema = (config: any, store?: any) => {
311
312
  case "Thought":
312
313
  elements = buildThoughtOfTheDay(config, componentScope);
313
314
  break;
315
+ case "Image":
316
+ elements = buildImage(config, componentScope);
314
317
  break;
315
318
  default:
316
319
  schema = {
@@ -539,6 +539,13 @@ export const buildPropertiesSection = function (type: String) {
539
539
  getTextArea("thought", "Today's thought", false),
540
540
  ]
541
541
  break;
542
+ case "Image":
543
+ uiSchema.elements = [
544
+ getInputField("imageUrl", "Image URL"),
545
+ getInputField("height", "Image Height"),
546
+ emptyBox("imageEmpty", { xs: 0, sm: 0, md: 4, lg: 6 }),
547
+ ]
548
+ break;
542
549
  }
543
550
  return uiSchema;
544
551
  };
@@ -18,6 +18,7 @@ export const ComponentSchema: any = {
18
18
  { title: "Empty Box", const: "EmptyBox" },
19
19
  { title: "File Handler", const: "FileInput" },
20
20
  { title: "Graph", const: "Graph" },
21
+ { title: "Image", const: "Image" },
21
22
  { title: "Input Slider", const: "InputSlider" },
22
23
  { title: "Label", const: "Box" },
23
24
  { title: "Leaderboard", const: "LeaderBoard" },
@@ -42,7 +42,8 @@ const sectionLabels = {
42
42
  ColumnGroup: ["Core", "Components"],
43
43
  Thought: ["Core", "Properties", "Events", "Style", "Validation"],
44
44
  Date: ["Core", "Properties", "Events", "Style", "Validation"],
45
- DateTime: ["Core", "Properties", "Events", "Style", "Validation"]
45
+ DateTime: ["Core", "Properties", "Events", "Style", "Validation"],
46
+ Image: ["Core", "Properties","Style"],
46
47
  }
47
48
 
48
49
  export function refreshPage(type: string, store: any) {