admin_lsac 1.1.3 → 1.2.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.
- package/README.md +2 -16
- package/dist/App.d.ts +2 -1
- package/dist/App.js +38 -4
- package/dist/cjs/App.js +52 -0
- package/dist/cjs/components/GenericForm.js +273 -0
- package/dist/cjs/components/Page.js +95 -0
- package/dist/cjs/index.js +18 -0
- package/dist/cjs/pages/event.js +110 -0
- package/dist/cjs/pages/page.js +347 -0
- package/dist/cjs/reportWebVitals.js +38 -0
- package/dist/cjs/schema/schema.config.js +9 -0
- package/dist/cjs/schema/schema.js +7 -0
- package/dist/cjs/setupTests.js +7 -0
- package/dist/components/GenericForm.js +17 -21
- package/dist/components/Page.js +20 -9
- package/dist/esm/App.js +27 -12
- package/dist/esm/components/GenericForm.js +243 -243
- package/dist/esm/components/Page.js +99 -99
- package/dist/esm/index.js +13 -13
- package/dist/esm/pages/event.js +104 -104
- package/dist/esm/pages/page.js +321 -0
- package/dist/esm/reportWebVitals.js +13 -13
- package/dist/esm/schema/schema.config.js +6 -4
- package/dist/esm/schema/schema.js +3 -3
- package/dist/esm/setupTests.js +5 -5
- package/dist/index.js +1 -1
- package/dist/pages/event.js +1 -1
- package/dist/pages/page.js +343 -0
- package/dist/reportWebVitals.js +1 -5
- package/dist/schema/schema.config.js +3 -1
- package/package.json +1 -1
- package/src/App.tsx +22 -17
- package/src/index.tsx +20 -20
- package/src/pages/page.ts +291 -0
- package/src/schema/schema.config.ts +2 -0
|
@@ -0,0 +1,321 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
11
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
12
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
13
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
14
|
+
function step(op) {
|
|
15
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
16
|
+
while (_) try {
|
|
17
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
18
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
19
|
+
switch (op[0]) {
|
|
20
|
+
case 0: case 1: t = op; break;
|
|
21
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
22
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
23
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
24
|
+
default:
|
|
25
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
27
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
28
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
29
|
+
if (t[2]) _.ops.pop();
|
|
30
|
+
_.trys.pop(); continue;
|
|
31
|
+
}
|
|
32
|
+
op = body.call(thisArg, _);
|
|
33
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
34
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
38
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
39
|
+
if (ar || !(i in from)) {
|
|
40
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
41
|
+
ar[i] = from[i];
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
45
|
+
};
|
|
46
|
+
import * as Yup from 'yup';
|
|
47
|
+
var typeAdding = function (objectField) {
|
|
48
|
+
objectField.type = "object";
|
|
49
|
+
objectField.fields = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], objectField.simpleFields, true), objectField.dropdownFields, true), objectField.objectFields, true), objectField.arrayFields, true);
|
|
50
|
+
if (objectField.objectFields) {
|
|
51
|
+
objectField.objectFields.map(function (objectField) {
|
|
52
|
+
objectField = typeAdding(objectField);
|
|
53
|
+
return objectField;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
if (objectField.arrayFields) {
|
|
57
|
+
objectField.arrayFields.map(function (arrayField) {
|
|
58
|
+
arrayField.element = typeAdding(arrayField.element);
|
|
59
|
+
return arrayField;
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
return objectField;
|
|
63
|
+
};
|
|
64
|
+
var arrayObjs = function (x) {
|
|
65
|
+
if (x > 0)
|
|
66
|
+
return [{
|
|
67
|
+
name: "simpleFields",
|
|
68
|
+
label: "Type SimpleField",
|
|
69
|
+
type: "array",
|
|
70
|
+
element: {
|
|
71
|
+
name: "",
|
|
72
|
+
label: "",
|
|
73
|
+
type: "object",
|
|
74
|
+
fields: [{
|
|
75
|
+
name: "name",
|
|
76
|
+
label: "Name",
|
|
77
|
+
type: "string",
|
|
78
|
+
validationSchema: Yup.string().required()
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
name: "label",
|
|
82
|
+
label: "Label",
|
|
83
|
+
type: "string",
|
|
84
|
+
validationSchema: Yup.string().required()
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
name: "type",
|
|
88
|
+
label: "Type",
|
|
89
|
+
type: "string",
|
|
90
|
+
validationSchema: Yup.string().required()
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
name: "validationSchema",
|
|
94
|
+
label: "Validation Schema",
|
|
95
|
+
type: "string",
|
|
96
|
+
validationSchema: Yup.string().required()
|
|
97
|
+
}]
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
name: "dropdownFields",
|
|
102
|
+
label: "Type DropdownField",
|
|
103
|
+
type: "array",
|
|
104
|
+
element: {
|
|
105
|
+
name: "",
|
|
106
|
+
label: "",
|
|
107
|
+
type: "object",
|
|
108
|
+
fields: [{
|
|
109
|
+
name: "name",
|
|
110
|
+
label: "Name",
|
|
111
|
+
type: "string",
|
|
112
|
+
validationSchema: Yup.string().required()
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
name: "label",
|
|
116
|
+
label: "Label",
|
|
117
|
+
type: "string",
|
|
118
|
+
validationSchema: Yup.string().required()
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
name: "options",
|
|
122
|
+
label: "Options",
|
|
123
|
+
type: "array",
|
|
124
|
+
element: {
|
|
125
|
+
name: "",
|
|
126
|
+
label: "",
|
|
127
|
+
type: "object",
|
|
128
|
+
fields: [{
|
|
129
|
+
name: "value",
|
|
130
|
+
label: "Value",
|
|
131
|
+
type: "string",
|
|
132
|
+
validationSchema: Yup.string().required()
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
name: "display",
|
|
136
|
+
label: "Display",
|
|
137
|
+
type: "string",
|
|
138
|
+
validationSchema: Yup.string().required()
|
|
139
|
+
}]
|
|
140
|
+
}
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
name: "getOptions",
|
|
144
|
+
label: "GetOptions Function",
|
|
145
|
+
type: "string",
|
|
146
|
+
validationSchema: Yup.string().required()
|
|
147
|
+
}]
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "objectFields",
|
|
152
|
+
label: "Type ObjectField",
|
|
153
|
+
type: "array",
|
|
154
|
+
element: {
|
|
155
|
+
name: "",
|
|
156
|
+
label: "",
|
|
157
|
+
type: "object",
|
|
158
|
+
fields: __spreadArray([{
|
|
159
|
+
name: "name",
|
|
160
|
+
label: "Name",
|
|
161
|
+
type: "string",
|
|
162
|
+
validationSchema: Yup.string().required()
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
name: "label",
|
|
166
|
+
label: "Label",
|
|
167
|
+
type: "string",
|
|
168
|
+
validationSchema: Yup.string().required()
|
|
169
|
+
}], arrayObjs(x - 1), true)
|
|
170
|
+
}
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "arrayFields",
|
|
174
|
+
label: "Type ArrayField",
|
|
175
|
+
type: "array",
|
|
176
|
+
element: {
|
|
177
|
+
name: "",
|
|
178
|
+
label: "",
|
|
179
|
+
type: "object",
|
|
180
|
+
fields: __spreadArray([{
|
|
181
|
+
name: "name",
|
|
182
|
+
label: "Name",
|
|
183
|
+
type: "string",
|
|
184
|
+
validationSchema: Yup.string().required()
|
|
185
|
+
},
|
|
186
|
+
{
|
|
187
|
+
name: "label",
|
|
188
|
+
label: "Label",
|
|
189
|
+
type: "string",
|
|
190
|
+
validationSchema: Yup.string().required()
|
|
191
|
+
}], arrayObjs(x - 1), true)
|
|
192
|
+
}
|
|
193
|
+
}];
|
|
194
|
+
else
|
|
195
|
+
return [];
|
|
196
|
+
};
|
|
197
|
+
export var page = {
|
|
198
|
+
name: "Pages",
|
|
199
|
+
getRequest: function () { return __awaiter(void 0, void 0, void 0, function () { return __generator(this, function (_a) {
|
|
200
|
+
return [2 /*return*/, []];
|
|
201
|
+
}); }); },
|
|
202
|
+
tableFields: [],
|
|
203
|
+
actions: [{
|
|
204
|
+
name: "Create New Page",
|
|
205
|
+
fields: [{
|
|
206
|
+
name: "name",
|
|
207
|
+
label: "Page Name",
|
|
208
|
+
type: "string",
|
|
209
|
+
validationSchema: Yup.string().required()
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
name: "getRequest",
|
|
213
|
+
label: "GetRequest",
|
|
214
|
+
type: "string",
|
|
215
|
+
validationSchema: Yup.string().required()
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
name: "tableFields",
|
|
219
|
+
label: "TableFields",
|
|
220
|
+
type: "array",
|
|
221
|
+
element: {
|
|
222
|
+
name: "",
|
|
223
|
+
label: "",
|
|
224
|
+
type: "object",
|
|
225
|
+
fields: [{
|
|
226
|
+
name: "name",
|
|
227
|
+
label: "TableField Name",
|
|
228
|
+
type: "string",
|
|
229
|
+
validationSchema: Yup.string().required()
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
name: "access",
|
|
233
|
+
label: "TableField Access Function",
|
|
234
|
+
type: "string",
|
|
235
|
+
validationSchema: Yup.string().required()
|
|
236
|
+
}]
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "actions",
|
|
241
|
+
label: "Actions",
|
|
242
|
+
type: "array",
|
|
243
|
+
element: {
|
|
244
|
+
name: "",
|
|
245
|
+
label: "",
|
|
246
|
+
type: "object",
|
|
247
|
+
fields: __spreadArray(__spreadArray([{
|
|
248
|
+
name: "name",
|
|
249
|
+
label: "Action Name",
|
|
250
|
+
type: "string",
|
|
251
|
+
validationSchema: Yup.string().required()
|
|
252
|
+
}], arrayObjs(4), true), [{
|
|
253
|
+
name: "onSubmit",
|
|
254
|
+
label: "Action OnSubmit Function",
|
|
255
|
+
type: "string",
|
|
256
|
+
validationSchema: Yup.string().required()
|
|
257
|
+
}], false)
|
|
258
|
+
}
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
name: "rowActions",
|
|
262
|
+
label: "Row Actions",
|
|
263
|
+
type: "array",
|
|
264
|
+
element: {
|
|
265
|
+
name: "",
|
|
266
|
+
label: "",
|
|
267
|
+
type: "object",
|
|
268
|
+
fields: __spreadArray(__spreadArray([{
|
|
269
|
+
name: "name",
|
|
270
|
+
label: "Row Action Name",
|
|
271
|
+
type: "string",
|
|
272
|
+
validationSchema: Yup.string().required()
|
|
273
|
+
}], arrayObjs(4), true), [{
|
|
274
|
+
name: "initialise",
|
|
275
|
+
label: "Row Action Initialise Function",
|
|
276
|
+
type: "string",
|
|
277
|
+
validationSchema: ""
|
|
278
|
+
},
|
|
279
|
+
{
|
|
280
|
+
name: "onSubmit",
|
|
281
|
+
label: "Row Action OnSubmit Function",
|
|
282
|
+
type: "string",
|
|
283
|
+
validationSchema: Yup.string().required()
|
|
284
|
+
}], false)
|
|
285
|
+
}
|
|
286
|
+
}],
|
|
287
|
+
onSubmit: function (formValues) { return __awaiter(void 0, void 0, void 0, function () {
|
|
288
|
+
return __generator(this, function (_a) {
|
|
289
|
+
if (Array.isArray(formValues.actions))
|
|
290
|
+
formValues.actions.map(function (action) {
|
|
291
|
+
var _a, _b, _c;
|
|
292
|
+
(_a = action.dropdownFields) === null || _a === void 0 ? void 0 : _a.map(function (actionField) { return actionField.type = "dropdown"; });
|
|
293
|
+
(_b = action.objectFields) === null || _b === void 0 ? void 0 : _b.map(function (actionField) { return actionField = typeAdding(actionField); });
|
|
294
|
+
(_c = action.arrayFields) === null || _c === void 0 ? void 0 : _c.map(function (actionField) {
|
|
295
|
+
actionField.type = "array";
|
|
296
|
+
actionField.element = typeAdding(actionField.element);
|
|
297
|
+
return actionField;
|
|
298
|
+
});
|
|
299
|
+
action.fields = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], action.simpleFields, true), action.dropdownFields, true), action.objectFields, true), action.arrayFields, true);
|
|
300
|
+
return action;
|
|
301
|
+
});
|
|
302
|
+
if (Array.isArray(formValues.rowActions))
|
|
303
|
+
formValues.actions.map(function (rowAction) {
|
|
304
|
+
var _a, _b, _c;
|
|
305
|
+
(_a = rowAction.dropdownFields) === null || _a === void 0 ? void 0 : _a.map(function (rowActionField) { return rowActionField.type = "dropdown"; });
|
|
306
|
+
(_b = rowAction.objectFields) === null || _b === void 0 ? void 0 : _b.map(function (rowActionField) { return rowActionField = typeAdding(rowActionField); });
|
|
307
|
+
(_c = rowAction.arrayFields) === null || _c === void 0 ? void 0 : _c.map(function (rowActionField) {
|
|
308
|
+
rowActionField.type = "array";
|
|
309
|
+
rowActionField.element = typeAdding(rowActionField.element);
|
|
310
|
+
return rowActionField;
|
|
311
|
+
});
|
|
312
|
+
rowAction.fields = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], rowAction.simpleFields, true), rowAction.dropdownFields, true), rowAction.objectFields, true), rowAction.arrayFields, true);
|
|
313
|
+
return rowAction;
|
|
314
|
+
});
|
|
315
|
+
console.log(formValues);
|
|
316
|
+
return [2 /*return*/, []];
|
|
317
|
+
});
|
|
318
|
+
}); }
|
|
319
|
+
}],
|
|
320
|
+
rowActions: [],
|
|
321
|
+
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
var reportWebVitals = function (onPerfEntry) {
|
|
2
|
-
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
3
|
-
import("web-vitals").then(function (_a) {
|
|
4
|
-
var getCLS = _a.getCLS, getFID = _a.getFID, getFCP = _a.getFCP, getLCP = _a.getLCP, getTTFB = _a.getTTFB;
|
|
5
|
-
getCLS(onPerfEntry);
|
|
6
|
-
getFID(onPerfEntry);
|
|
7
|
-
getFCP(onPerfEntry);
|
|
8
|
-
getLCP(onPerfEntry);
|
|
9
|
-
getTTFB(onPerfEntry);
|
|
10
|
-
});
|
|
11
|
-
}
|
|
12
|
-
};
|
|
13
|
-
export default reportWebVitals;
|
|
1
|
+
var reportWebVitals = function (onPerfEntry) {
|
|
2
|
+
if (onPerfEntry && onPerfEntry instanceof Function) {
|
|
3
|
+
import("web-vitals").then(function (_a) {
|
|
4
|
+
var getCLS = _a.getCLS, getFID = _a.getFID, getFCP = _a.getFCP, getLCP = _a.getLCP, getTTFB = _a.getTTFB;
|
|
5
|
+
getCLS(onPerfEntry);
|
|
6
|
+
getFID(onPerfEntry);
|
|
7
|
+
getFCP(onPerfEntry);
|
|
8
|
+
getLCP(onPerfEntry);
|
|
9
|
+
getTTFB(onPerfEntry);
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
export default reportWebVitals;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export function pageToUrl(page) {
|
|
2
|
-
return "/".concat(page.name.toLowerCase().replace(" ", "_"));
|
|
3
|
-
}
|
|
1
|
+
export function pageToUrl(page) {
|
|
2
|
+
return "/".concat(page.name.toLowerCase().replace(" ", "_"));
|
|
3
|
+
}
|
package/dist/esm/setupTests.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
2
|
-
// allows you to do things like:
|
|
3
|
-
// expect(element).toHaveTextContent(/react/i)
|
|
4
|
-
// learn more: https://github.com/testing-library/jest-dom
|
|
5
|
-
import "@testing-library/jest-dom";
|
|
1
|
+
// jest-dom adds custom jest matchers for asserting on DOM nodes.
|
|
2
|
+
// allows you to do things like:
|
|
3
|
+
// expect(element).toHaveTextContent(/react/i)
|
|
4
|
+
// learn more: https://github.com/testing-library/jest-dom
|
|
5
|
+
import "@testing-library/jest-dom";
|
package/dist/index.js
CHANGED
|
@@ -11,7 +11,7 @@ var App_1 = __importDefault(require("./App"));
|
|
|
11
11
|
var reportWebVitals_1 = __importDefault(require("./reportWebVitals"));
|
|
12
12
|
var event_1 = require("./pages/event");
|
|
13
13
|
var root = client_1.default.createRoot(document.getElementById("root"));
|
|
14
|
-
root.render((0, jsx_runtime_1.jsx)(react_1.default.StrictMode, { children: (0, jsx_runtime_1.jsx)(App_1.default, { pages: [event_1.event] }) }));
|
|
14
|
+
root.render((0, jsx_runtime_1.jsx)(react_1.default.StrictMode, { children: (0, jsx_runtime_1.jsx)(App_1.default, { pages: [event_1.event], basePath: "" }, void 0) }, void 0));
|
|
15
15
|
// If you want to start measuring performance in your app, pass a function
|
|
16
16
|
// to log results (for example: reportWebVitals(console.log))
|
|
17
17
|
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
|
package/dist/pages/event.js
CHANGED
|
@@ -14,7 +14,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
14
14
|
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
15
|
function step(op) {
|
|
16
16
|
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (
|
|
17
|
+
while (_) try {
|
|
18
18
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
19
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
20
|
switch (op[0]) {
|