impaktapps-ui-builder 0.0.101-alpha.224 → 0.0.101-alpha.225

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "0.0.101-alpha.224",
3
+ "version": "0.0.101-alpha.225",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -40,7 +40,6 @@ import { buildDataGrid } from "./buildDataGrid";
40
40
  import { buildInputSlider } from "./buildInputSlider";
41
41
  import { buildTreeMap } from "./buildTreeMap";
42
42
  import { buildThoughtOfTheDay } from "./buildThoughtOfTheDay";
43
- import { buildPdfViewer } from "./buildPdfViewer";
44
43
  export let schema = {
45
44
  type: "object",
46
45
  properties: {},
@@ -308,8 +307,6 @@ const buildUiSchema = (config: any, store?: any) => {
308
307
  case "Thought":
309
308
  elements = buildThoughtOfTheDay(config, componentScope);
310
309
  break;
311
- case "PdfViewer":
312
- elements = buildPdfViewer(config);
313
310
  break;
314
311
  default:
315
312
  schema = {
@@ -340,44 +337,40 @@ const buildUiSchema = (config: any, store?: any) => {
340
337
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : []
341
338
  }
342
339
  })
343
- }
344
- else if (config.type == "Table") {
340
+ } else if (config.type == "Table") {
345
341
  const sizeMap = {}
346
- const filterMap = {}
342
+
347
343
  if (config.sizeHolder) {
348
344
  config.sizeHolder.map((e, i) => {
349
345
  sizeMap[e.keyName] = e.value
350
346
  });
351
347
  }
352
- if (config.enableColumnFilter) {
353
- config.enableColumnFilter.map((e) => {
354
- filterMap[e.keyName] = true
355
- })
356
- }
348
+
357
349
  elements.elements = config.elements.map((cellElem, elemInd) => {
358
350
  const commonProperties = {
359
351
  accessorKey: cellElem.name,
360
352
  type: cellElem.columnFormat,
361
353
  header: cellElem.label || cellElem.name,
362
354
  size: sizeMap[cellElem.name] || 180,
363
- enableColumnFilter: Object.keys(filterMap).length === 0 ? true : filterMap[cellElem.name] ?? false,
364
- columnFilterModeOptions: config.filteringOptions,
365
- enableSorting: config.enableSorting === "No" ? false : true,
366
- columnKey: config.columnKey
355
+ enableColumnFilter: cellElem.enableFilter === "No"?false:true,
356
+ columnFilterModeOptions: cellElem.filteringOptions,
357
+ enableSorting: cellElem.enableSorting === "No" ? false : true,
358
+ columnKey: cellElem.columnKey
367
359
  }
368
360
  if (cellElem.type) {
369
361
  return {
370
362
  widget: cellElem.type != "ColumnGroup" ? buildUiSchema(cellElem, store) : undefined,
371
363
  elements: cellElem.type == "ColumnGroup" ? cellElem.elements.map((childCellElem) => buildUiSchema(childCellElem, store)) : [],
372
364
  ...commonProperties
373
-
365
+
374
366
  }
375
367
  } else {
376
368
  return commonProperties
377
369
  }
378
-
370
+
379
371
  })
380
372
  }
373
+
381
374
  else if (config.type == "Array") {
382
375
  elements.options.detail.elements = config.elements.map((e: any, elemInd: number) => {
383
376
  return buildUiSchema(e, store)
@@ -148,7 +148,7 @@ export default function Card(theme){
148
148
  textWrap: "wrap",
149
149
  background: "inherit",
150
150
  width: "calc(100%+8px)",
151
- margin: "-16px",
151
+ margin: "-8px",
152
152
  marginTop: {xs: "0px", md: "12px"},
153
153
  lineHeight: "1",
154
154
  },
@@ -40,8 +40,7 @@ export const ComponentSchema: any = {
40
40
  { title: "Upload", const: "UploadFile" },
41
41
  { title: "Tree ", const: "TreeMap" },
42
42
  { title: "Column Group", const: "ColumnGroup" },
43
- { title: "Thought of the day", const: "Thought" },
44
- { title: "PDF", const: "PdfViewer"}
43
+ { title: "Thought of the day", const: "Thought" }
45
44
  ]
46
45
  },
47
46
  columnFormat: {
@@ -1 +0,0 @@
1
- export declare const buildPdfViewer: (config: any) => any;
@@ -1,19 +0,0 @@
1
- declare const _default: {
2
- type: string;
3
- scope: string;
4
- options: {
5
- widget: string;
6
- };
7
- config: {
8
- layout: {
9
- xs: number;
10
- sm: number;
11
- md: number;
12
- lg: number;
13
- };
14
- main: {
15
- title: string;
16
- };
17
- };
18
- };
19
- export default _default;
@@ -1,22 +0,0 @@
1
- import pdfViewer from "./uischema/pdfViewer";
2
- import buildUiSchema from "./buildUiSchema";
3
- import _ from "lodash";
4
- import { createLayoutFormat } from "./buildConfig";
5
-
6
- export const buildPdfViewer = (config) => {
7
- const PdfViewer: any = _.cloneDeep(pdfViewer)
8
- PdfViewer.config.main.label = config.label
9
- if (config.name) {
10
- PdfViewer.scope=`#/properties/${config.name}`
11
- }
12
- if (config.layout) {
13
- PdfViewer.config.layout = createLayoutFormat(config.layout);
14
- }
15
- if(config.label) {
16
- PdfViewer.config.main.title = config.label
17
- }
18
- if (config.style) {
19
- PdfViewer.config.style = JSON.parse(config.style)
20
- }
21
- return PdfViewer
22
- }
@@ -1,18 +0,0 @@
1
- export default {
2
- type: "Control",
3
- scope: "#/properties/pdfviewer",
4
- options: {
5
- widget: "PdfViewer",
6
- },
7
- config: {
8
- layout: {
9
- xs: 12,
10
- sm: 12,
11
- md: 12,
12
- lg: 12,
13
- },
14
- main: {
15
- title: "PDF"
16
- },
17
- },
18
- }