impaktapps-ui-builder 1.0.60 → 1.0.61-alpha.1

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.
@@ -5,7 +5,7 @@ interface funcParamsProps {
5
5
  userValue: any;
6
6
  pageDataProvider: any;
7
7
  functionsProvider?: Record<string, any>;
8
- setExternaldata?: any;
8
+ initFormData?: any;
9
9
  }
10
10
  export declare const extractEvents: (eventConfig: any) => any;
11
11
  declare const _default: (funcParams: funcParamsProps) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "impaktapps-ui-builder",
3
- "version": "1.0.60",
3
+ "version": "1.0.61-alpha.1",
4
4
  "scripts": {
5
5
  "dev": "vite",
6
6
  "build": "tsc && vite build",
@@ -10,6 +10,9 @@ export const buildDate = (config:any,componentScope:string)=> {
10
10
  if(config.layout){
11
11
  dateInputField.config.layout = createLayoutFormat(config.layout)
12
12
  }
13
+ if (config.variant) {
14
+ dateInputField.config.main.variant = config.variant;
15
+ }
13
16
  return dateInputField;
14
17
  }
15
18
  export const buildDateTime = (config:any,componentScope:string)=>{
@@ -20,5 +23,8 @@ export const buildDateTime = (config:any,componentScope:string)=>{
20
23
  if(config.layout){
21
24
  dateTimeInputField.config.layout = createLayoutFormat(config.layout)
22
25
  }
26
+ if (config.variant) {
27
+ dateTimeInputField.config.main.variant = config.variant;
28
+ }
23
29
  return dateTimeInputField;
24
30
  }
@@ -514,6 +514,26 @@ export const buildPropertiesSection = function (type: String) {
514
514
  emptyBox("MultipleSelectEmpty2")
515
515
  ]
516
516
  break;
517
+ case "Date":
518
+ uiSchema.elements = [
519
+ getSelectField("variant", "Variant", [
520
+ { label: "Outlined", value: "outlined" },
521
+ { label: "Filled", value: "filled" },
522
+ { label: "Standard", value: "standard" },
523
+ ]),
524
+ emptyBox("DateEmpty1", { xs: 6, sm: 6, md: 8, lg: 9 }),
525
+ ]
526
+ break;
527
+ case "DateTime":
528
+ uiSchema.elements = [
529
+ getSelectField("variant", "Variant", [
530
+ { label: "Outlined", value: "outlined" },
531
+ { label: "Filled", value: "filled" },
532
+ { label: "Standard", value: "standard" },
533
+ ]),
534
+ emptyBox("DateTimeEmpty1", { xs: 6, sm: 6, md: 8, lg: 9 }),
535
+ ]
536
+ break;
517
537
  case "Thought":
518
538
  uiSchema.elements = [
519
539
  getTextArea("thought", "Today's thought", false),
@@ -50,11 +50,26 @@ export const PageMasterUiSchema: any = (theme) => {
50
50
  },
51
51
  },
52
52
  },
53
+ {
54
+ type: "Control",
55
+ scope: "#/properties/hasBackIcon",
56
+
57
+ options: {
58
+ widget: "RadioInputField",
59
+ },
60
+ config: {
61
+ layout: { xs: 12, sm: 6, md: 4, lg: 3 },
62
+ main: {
63
+ label: "Back Icon",
64
+ options: [{label: "Yes",const: "YES"}, {label: "No",const: "NO"}],
65
+ },
66
+ },
67
+ },
53
68
  {
54
69
  type: "Control",
55
70
  scope: "#/properties/EmptyBox",
56
71
  config: {
57
- layout: { xs: 0, sm: 0, md: 4, lg: 6 },
72
+ layout: { xs: 0, sm: 6, md: 0, lg: 3 },
58
73
  },
59
74
  options: {
60
75
  widget: "EmptyBox",
@@ -20,7 +20,7 @@ interface funcParamsProps {
20
20
  userValue: any,
21
21
  pageDataProvider: any,
22
22
  functionsProvider?: Record<string, any>,
23
- setExternaldata?: any
23
+ initFormData?: any
24
24
  }
25
25
  let pageData: any = false;
26
26
  export const extractEvents = (eventConfig: any) => {
@@ -72,127 +72,18 @@ export default (funcParams: funcParamsProps) => {
72
72
  return {
73
73
  setPage: async function () {
74
74
  funcParams.store.setAdditionalErrors([]);
75
- funcParams.store.setFormdata({});
75
+ funcParams.store.setFormdata(funcParams?.initFormData() || {});
76
76
  funcParams.store.setSchema({ type: "object", properties: {} });
77
77
  funcParams.store.newData = {};
78
78
  eventGroups = {};
79
79
  pageData = await funcParams.pageDataProvider();
80
80
  const config = pageData?.config;
81
-
82
- funcParams?.setExternaldata();
83
-
84
81
  const uiSchema = pageData?.uiSchema;
85
82
  const event = new CustomEvent('pageNameChanged', {
86
- detail: { pageName: config.label, hasBackIcon: true }
83
+ detail: { pageName: config.label, hasBackIcon: config.hasBackIcon === "NO" ? false : true }
87
84
  });
88
85
  window.dispatchEvent(event)
89
86
  const theme = funcParams?.store?.theme?.myTheme;
90
- uiSchema.elements.push(
91
- {
92
- type: "HorizontalLayout",
93
- config: {
94
- main: {
95
- direction: "row",
96
- },
97
- style: {
98
- flexDirection: "row",
99
- position: "absolute",
100
- bottom: 0,
101
- height: "fit-content",
102
- overflow: "hidden",
103
- zIndex: 1000,
104
- width: "inherit",
105
- },
106
- },
107
- elements: [
108
- {
109
- type: "Control",
110
- scope: "#/properties/FooterText",
111
- options: {
112
- widget: "Box",
113
- },
114
- config: {
115
- main: {
116
- heading: "Copywriter@ACT21.IO",
117
- },
118
- style: {
119
- color: theme?.palette?.text?.disabled || "#AFAFAF",
120
- fontSize: "11px",
121
- textAlign: "center",
122
- lineHeight: 2,
123
- width: "fit-content",
124
- left: "50%",
125
- position: "relative",
126
- margin: 0,
127
- flexGrow: 1,
128
- height: 0,
129
- transform: "translate(-50%, 0%)",
130
- },
131
- },
132
- },
133
- {
134
- type: "Control",
135
- scope: "#/properties/FooterBackIcon",
136
- options: {
137
- widget: "Box",
138
- },
139
- config: {
140
- main: {
141
- iconName: "PrevIcon",
142
- onClick: "backHandler",
143
- width: "fit-content",
144
- },
145
- style: {
146
- fill: theme?.palette?.primary?.main,
147
- width: 20,
148
- height: 0,
149
- top: 0,
150
- right: { xs: "12px", sm: "84px" },
151
- position: "absolute",
152
- fontSize: "12px",
153
- cursor: "pointer",
154
- ":hover": {
155
- fill: theme?.palette?.primary?.dark,
156
- },
157
- marginRight: "20px",
158
- },
159
- },
160
- },
161
- {
162
- type: "Control",
163
- scope: "#/properties/FooterBackHandlerText",
164
- options: {
165
- widget: "Box",
166
- },
167
- config: {
168
- main: {
169
- heading: "Previous Page",
170
- onClick: "backHandler",
171
- },
172
- style: {
173
- display: { xs: "none", sm: "flex" },
174
- textAlign: "left",
175
- lineHeight: 1,
176
- height: 0,
177
- width: "fit-content",
178
- color: theme?.palette?.primary?.main,
179
- fontSize: "12px",
180
- cursor: "pointer",
181
- marginLeft: "2px",
182
-
183
- top: 3,
184
- right: "12px",
185
- position: "absolute",
186
- ":hover": {
187
- color: theme?.palette?.primary?.dark,
188
- },
189
- marginRight: "4px",
190
- },
191
- },
192
- },
193
- ],
194
- }
195
- );
196
87
  const schema = pageData?.schema ?? { type: "object", properties: {} };
197
88
  eventGroups = extractEvents(config);
198
89
  executeEventsParameters = {