drapcode-constant 1.2.2 → 1.2.3
Sign up to get free protection for your applications and to get access to all the features.
- package/build/constants/FieldTypes.js +51 -49
- package/build/constants/builder.js +28 -25
- package/build/constants/query.js +10 -8
- package/build/index.js +5 -1
- package/package.json +1 -1
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4
|
+
if (ar || !(i in from)) {
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
6
|
+
ar[i] = from[i];
|
7
|
+
}
|
8
|
+
}
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
8
10
|
};
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
12
|
exports.filterFieldsForDataTable = exports.fieldToShow = exports.filterFieldForCommandObj = exports.collectionDefaultFieldSortOrder = exports.AllSelectOptionFields = exports.nonReferenceField = exports.NonBelongsSelectOptionFields = exports.MultiSelectOptionFields = exports.SelectOptionFields = exports.level3ReferenceField = exports.level3ReferenceField2 = exports.BelongsCreatedByRefField = exports.notFieldForImport = exports.notFieldForExport = exports.hiddenFormField = exports.DefaultPrivateField = exports.systemAndRefField = exports.placeholderField = exports.ReferenceCreatedByFields = exports.referenceAndDynamicField = exports.BelongsToReferenceField = exports.ImageUrlFields = exports.StringFields = exports.referenceTextField = exports.pageCollectionFields = exports.textField1 = exports.NoRefFields = exports.textEmailPasswordField = exports.simpleTextFeild = exports.pureTextField = exports.mixedField = exports.systemHideField = exports.linkField = exports.numberTextField = exports.exportHideField = exports.uuidField = exports.passwordField = exports.emailField = exports.systemDateField = exports.FileUrlFields = exports.URLFields = exports.ImageFields = exports.childDataField = exports.onlyReferenceField = exports.OptionTypeFields = exports.filterFieldsForForm = exports.fieldType = exports.crudKeys = exports.defaultFields = exports.FieldTypes = void 0;
|
@@ -326,87 +328,87 @@ exports.mixedField = [
|
|
326
328
|
boolean.id,
|
327
329
|
];
|
328
330
|
/** Usage of emailField */
|
329
|
-
var stringField =
|
330
|
-
exports.pureTextField =
|
331
|
+
var stringField = __spreadArray(__spreadArray([], exports.emailField, true), [color.id, uuid.id, custom_uuid.id], false);
|
332
|
+
exports.pureTextField = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], exports.emailField, true), exports.numberTextField, true), exports.linkField, true), [
|
331
333
|
color.id,
|
332
|
-
]);
|
333
|
-
exports.simpleTextFeild =
|
334
|
+
], false);
|
335
|
+
exports.simpleTextFeild = __spreadArray(__spreadArray([], exports.emailField, true), [
|
334
336
|
boolean.id,
|
335
337
|
url.id,
|
336
338
|
large_text.id,
|
337
339
|
number.id,
|
338
|
-
]);
|
339
|
-
exports.textEmailPasswordField =
|
340
|
-
exports.NoRefFields =
|
340
|
+
], false);
|
341
|
+
exports.textEmailPasswordField = __spreadArray(__spreadArray([], exports.emailField, true), [password.id], false);
|
342
|
+
exports.NoRefFields = __spreadArray(__spreadArray(__spreadArray([], exports.emailField, true), exports.numberTextField, true), [
|
341
343
|
color.id,
|
342
344
|
boolean.id,
|
343
|
-
]);
|
344
|
-
exports.textField1 =
|
345
|
+
], false);
|
346
|
+
exports.textField1 = __spreadArray(__spreadArray(__spreadArray([], exports.emailField, true), exports.numberTextField, true), [
|
345
347
|
boolean.id,
|
346
348
|
url.id,
|
347
|
-
]);
|
349
|
+
], false);
|
348
350
|
/** Usage of uuidField */
|
349
|
-
exports.pageCollectionFields =
|
351
|
+
exports.pageCollectionFields = __spreadArray(__spreadArray([], exports.uuidField, true), [
|
350
352
|
large_text.id,
|
351
353
|
createdAt.id,
|
352
354
|
number.id,
|
353
355
|
boolean.id,
|
354
|
-
]);
|
355
|
-
exports.referenceTextField =
|
356
|
+
], false);
|
357
|
+
exports.referenceTextField = __spreadArray(__spreadArray(__spreadArray([], exports.uuidField, true), exports.childDataField, true), [number.id], false);
|
356
358
|
/** Usage of textEmailPasswordField */
|
357
|
-
exports.StringFields =
|
359
|
+
exports.StringFields = __spreadArray(__spreadArray([], exports.textEmailPasswordField, true), exports.linkField, true);
|
358
360
|
/** Usage of ImageFields */
|
359
|
-
exports.ImageUrlFields =
|
361
|
+
exports.ImageUrlFields = __spreadArray(__spreadArray([], exports.ImageFields, true), [file.id], false);
|
360
362
|
/** Usage of onlyReferenceField */
|
361
|
-
exports.BelongsToReferenceField =
|
362
|
-
exports.referenceAndDynamicField =
|
363
|
+
exports.BelongsToReferenceField = __spreadArray(__spreadArray([], exports.onlyReferenceField, true), [belongsTo.id], false);
|
364
|
+
exports.referenceAndDynamicField = __spreadArray(__spreadArray([], exports.onlyReferenceField, true), [
|
363
365
|
dynamic_option.id,
|
364
|
-
]);
|
365
|
-
exports.ReferenceCreatedByFields =
|
366
|
-
exports.placeholderField =
|
366
|
+
], false);
|
367
|
+
exports.ReferenceCreatedByFields = __spreadArray(__spreadArray([], exports.onlyReferenceField, true), [createdBy.id], false);
|
368
|
+
exports.placeholderField = __spreadArray(__spreadArray(__spreadArray([], exports.onlyReferenceField, true), exports.systemDateField, true), [
|
367
369
|
createdBy.id,
|
368
370
|
isDeleted.id,
|
369
371
|
password.id,
|
370
|
-
]);
|
372
|
+
], false);
|
371
373
|
/** Usage of systemDateField and systemHideField */
|
372
|
-
exports.systemAndRefField =
|
373
|
-
exports.DefaultPrivateField =
|
374
|
-
exports.hiddenFormField =
|
375
|
-
exports.notFieldForExport =
|
374
|
+
exports.systemAndRefField = __spreadArray(__spreadArray([], exports.systemHideField, true), exports.referenceAndDynamicField, true);
|
375
|
+
exports.DefaultPrivateField = __spreadArray(__spreadArray([], exports.systemHideField, true), [password.id], false);
|
376
|
+
exports.hiddenFormField = __spreadArray(__spreadArray([], exports.systemHideField, true), exports.systemDateField, true);
|
377
|
+
exports.notFieldForExport = __spreadArray(__spreadArray(__spreadArray([], exports.systemDateField, true), exports.exportHideField, true), [
|
376
378
|
isDeleted.id,
|
377
379
|
object.id,
|
378
380
|
createdBy.id,
|
379
|
-
]);
|
380
|
-
exports.notFieldForImport =
|
381
|
+
], false);
|
382
|
+
exports.notFieldForImport = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], exports.systemDateField, true), exports.systemHideField, true), exports.ImageFields, true), [
|
381
383
|
password.id,
|
382
|
-
]);
|
384
|
+
], false);
|
383
385
|
/** Usage of BelongsToReferenceField */
|
384
|
-
exports.BelongsCreatedByRefField =
|
386
|
+
exports.BelongsCreatedByRefField = __spreadArray(__spreadArray([], exports.BelongsToReferenceField, true), [
|
385
387
|
createdBy.id,
|
386
|
-
]);
|
387
|
-
exports.level3ReferenceField2 =
|
388
|
-
exports.level3ReferenceField =
|
388
|
+
], false);
|
389
|
+
exports.level3ReferenceField2 = __spreadArray(__spreadArray(__spreadArray([], exports.BelongsToReferenceField, true), exports.hiddenFormField, true), exports.exportHideField, true);
|
390
|
+
exports.level3ReferenceField = __spreadArray(__spreadArray(__spreadArray(__spreadArray([], exports.BelongsCreatedByRefField, true), exports.systemDateField, true), exports.exportHideField, true), [
|
389
391
|
isDeleted.id,
|
390
|
-
]);
|
392
|
+
], false);
|
391
393
|
/** Usage of OptionTypeFields */
|
392
|
-
exports.SelectOptionFields =
|
393
|
-
exports.MultiSelectOptionFields =
|
394
|
-
exports.NonBelongsSelectOptionFields =
|
395
|
-
exports.nonReferenceField =
|
394
|
+
exports.SelectOptionFields = __spreadArray(__spreadArray([], exports.OptionTypeFields, true), [reference.id], false);
|
395
|
+
exports.MultiSelectOptionFields = __spreadArray(__spreadArray([], exports.OptionTypeFields, true), [belongsTo.id], false);
|
396
|
+
exports.NonBelongsSelectOptionFields = __spreadArray(__spreadArray([], exports.OptionTypeFields, true), exports.onlyReferenceField, true);
|
397
|
+
exports.nonReferenceField = __spreadArray(__spreadArray(__spreadArray([], stringField, true), exports.linkField, true), [
|
396
398
|
large_text.id,
|
397
399
|
number.id,
|
398
400
|
password.id,
|
399
401
|
video_link.id,
|
400
402
|
boolean.id,
|
401
|
-
]);
|
402
|
-
exports.AllSelectOptionFields =
|
403
|
-
var textField =
|
403
|
+
], false);
|
404
|
+
exports.AllSelectOptionFields = __spreadArray(__spreadArray([], exports.onlyReferenceField, true), exports.MultiSelectOptionFields, true);
|
405
|
+
var textField = __spreadArray(__spreadArray(__spreadArray([], exports.linkField, true), stringField, true), [
|
404
406
|
number.id,
|
405
407
|
date.id,
|
406
408
|
boolean.id,
|
407
409
|
unix_timestamp.id,
|
408
410
|
password.id,
|
409
|
-
]);
|
411
|
+
], false);
|
410
412
|
exports.collectionDefaultFieldSortOrder = [
|
411
413
|
{ order: 1, field: uuid.id },
|
412
414
|
{ order: 2, field: createdAt.id },
|
@@ -415,11 +417,11 @@ exports.collectionDefaultFieldSortOrder = [
|
|
415
417
|
];
|
416
418
|
var filterFieldForCommandObj = function () {
|
417
419
|
return Object.keys(exports.FieldTypes).filter(function (field) {
|
418
|
-
return !
|
420
|
+
return !__spreadArray(__spreadArray(__spreadArray(__spreadArray([], exports.systemDateField, true), exports.systemAndRefField, true), exports.ImageUrlFields, true), [
|
419
421
|
belongsTo.id,
|
420
422
|
static_option.id,
|
421
423
|
color.id,
|
422
|
-
]).includes(field);
|
424
|
+
], false).includes(field);
|
423
425
|
});
|
424
426
|
};
|
425
427
|
exports.filterFieldForCommandObj = filterFieldForCommandObj;
|
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4
|
+
if (ar || !(i in from)) {
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
6
|
+
ar[i] = from[i];
|
7
|
+
}
|
8
|
+
}
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
8
10
|
};
|
9
11
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
10
12
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
@@ -20,7 +22,7 @@ var getTimezoneOffset = function (time) {
|
|
20
22
|
time = "(GMT+5:30)";
|
21
23
|
}
|
22
24
|
var str = time.substring(4, 10);
|
23
|
-
return moment_1.default().utcOffset(str).utcOffset();
|
25
|
+
return (0, moment_1.default)().utcOffset(str).utcOffset();
|
24
26
|
};
|
25
27
|
exports.getTimezoneOffset = getTimezoneOffset;
|
26
28
|
var replaceNbsps = function (str) {
|
@@ -32,13 +34,13 @@ exports.defaultMetaTags = [
|
|
32
34
|
'<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">',
|
33
35
|
];
|
34
36
|
var getAssetLink = function (path) {
|
35
|
-
return "https://asset.drapcode.com/"
|
37
|
+
return "https://asset.drapcode.com/".concat(path);
|
36
38
|
};
|
37
39
|
exports.getAssetLink = getAssetLink;
|
38
40
|
var getScriptTag = function (paths, isDefer) {
|
39
41
|
if (isDefer === void 0) { isDefer = false; }
|
40
42
|
return paths.map(function (path) {
|
41
|
-
return "<script type=\"text/javascript\" src=\""
|
43
|
+
return "<script type=\"text/javascript\" src=\"".concat((0, exports.getAssetLink)("js/".concat(path)), "\" ").concat(isDefer ? "defer" : "", "></script>");
|
42
44
|
});
|
43
45
|
};
|
44
46
|
exports.getScriptTag = getScriptTag;
|
@@ -46,20 +48,20 @@ var getCssTag = function (paths, loadAsync) {
|
|
46
48
|
if (loadAsync === void 0) { loadAsync = false; }
|
47
49
|
if (loadAsync) {
|
48
50
|
return paths.map(function (path) {
|
49
|
-
return "<link rel=\"preload\" href=\""
|
51
|
+
return "<link rel=\"preload\" href=\"".concat((0, exports.getAssetLink)("css/".concat(path)), "\" as=\"style\" onload=\"this.onload=null;this.rel='stylesheet'\">\n <noscript><link rel=\"stylesheet\" href=\"").concat((0, exports.getAssetLink)("css/".concat(path)), "\"></noscript>");
|
50
52
|
});
|
51
53
|
}
|
52
54
|
else {
|
53
55
|
return paths.map(function (path) {
|
54
|
-
return "<link rel='stylesheet' type='text/css' href=\""
|
56
|
+
return "<link rel='stylesheet' type='text/css' href=\"".concat((0, exports.getAssetLink)("css/".concat(path)), "\">");
|
55
57
|
});
|
56
58
|
}
|
57
59
|
};
|
58
60
|
exports.getCssTag = getCssTag;
|
59
|
-
exports.defaultHeaderJS =
|
61
|
+
exports.defaultHeaderJS = __spreadArray(__spreadArray([], (0, exports.getScriptTag)(["popper.min.js", "bootstrap.min.js", "feather.min.js"], true), true), [
|
60
62
|
'<script type="text/javascript" src="https://polyfill.io/v3/polyfill.min.js?features=default" defer></script>',
|
61
|
-
]);
|
62
|
-
exports.defaultHeaderCSS =
|
63
|
+
], false);
|
64
|
+
exports.defaultHeaderCSS = __spreadArray(__spreadArray([], (0, exports.getCssTag)([
|
63
65
|
"bootstrap.min.css",
|
64
66
|
"toastr.min.css",
|
65
67
|
"sweetalert2.min.css",
|
@@ -70,23 +72,23 @@ exports.defaultHeaderCSS = __spreadArrays(exports.getCssTag([
|
|
70
72
|
"all.min.css",
|
71
73
|
"dc-custom.min.css",
|
72
74
|
"coloris.min.css",
|
73
|
-
], true), [
|
74
|
-
"<link rel='stylesheet' type='text/css' href='"
|
75
|
+
], true), true), [
|
76
|
+
"<link rel='stylesheet' type='text/css' href='".concat((0, exports.getAssetLink)("intl-tel-input/intlTelInput.min.css"), "'>"),
|
75
77
|
"<link rel='stylesheet' type='text/css' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css'>",
|
76
78
|
"<link rel='stylesheet' type='text/css' href='https://unpkg.com/dropzone@5/dist/min/dropzone.min.css'>",
|
77
79
|
"<link rel='stylesheet' type='text/css' href='https://cdnjs.cloudflare.com/ajax/libs/magnific-popup.js/1.1.0/magnific-popup.min.css'>",
|
78
|
-
]);
|
79
|
-
exports.defaultFonts =
|
80
|
+
], false);
|
81
|
+
exports.defaultFonts = __spreadArray([
|
80
82
|
'<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>'
|
81
|
-
], exports.getCssTag(["googlefonts.css"], true));
|
83
|
+
], (0, exports.getCssTag)(["googlefonts.css"], true), true);
|
82
84
|
var brandMessage = function (brand_msg) {
|
83
|
-
return "<div style=\"background-color:white;padding:5px; position: fixed;right: 15px;bottom: 15px;font-size: 15px;font-weight: 600;border-radius: 5px;border: 1px solid #223049;z-index:9999;\">\n <a target=\"_blank\" href=\"https://drapcode.com\" style=\"text-decoration: none;color: #223049;display: flex;align-items: center\">\n <img src=\"https://drapcode.com/favicon.png\" alt=\"DrapCode\" style=\"object-fit: contain;width: 20px\"/> \n "
|
85
|
+
return "<div style=\"background-color:white;padding:5px; position: fixed;right: 15px;bottom: 15px;font-size: 15px;font-weight: 600;border-radius: 5px;border: 1px solid #223049;z-index:9999;\">\n <a target=\"_blank\" href=\"https://drapcode.com\" style=\"text-decoration: none;color: #223049;display: flex;align-items: center\">\n <img src=\"https://drapcode.com/favicon.png\" alt=\"DrapCode\" style=\"object-fit: contain;width: 20px\"/> \n ".concat(brand_msg, "\n </a>\n </div>");
|
84
86
|
};
|
85
87
|
exports.brandMessage = brandMessage;
|
86
|
-
exports.primaryBodyJS =
|
88
|
+
exports.primaryBodyJS = __spreadArray(__spreadArray([
|
87
89
|
'<script type="text/javascript" src="/resources/constant.js"></script>',
|
88
90
|
'<script type="text/javascript" src="/resources/drapcode.min.js"></script>'
|
89
|
-
], exports.getScriptTag([
|
91
|
+
], (0, exports.getScriptTag)([
|
90
92
|
"jquery.validate.min.js",
|
91
93
|
"math.min.js",
|
92
94
|
"moment.js",
|
@@ -102,8 +104,9 @@ exports.primaryBodyJS = __spreadArrays([
|
|
102
104
|
"axios.js",
|
103
105
|
"sweetalert2.all.min.js",
|
104
106
|
"coloris.min.js",
|
105
|
-
]), [
|
106
|
-
"<script type=\"text/javascript\" src=\""
|
107
|
+
]), true), [
|
108
|
+
"<script type=\"text/javascript\" src=\"".concat((0, exports.getAssetLink)("intl-tel-input/intlTelInput-jquery.min.js"), "\"></script>"),
|
109
|
+
"<script type=\"text/javascript\" src=\"".concat((0, exports.getAssetLink)("intl-tel-input/utils.js"), "\"></script>"),
|
107
110
|
'<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/apexcharts"></script>',
|
108
111
|
'<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/lodash@4.17.21/lodash.min.js"></script>',
|
109
112
|
'<script type="text/javascript" src="https://unpkg.com/dropzone@5/dist/min/dropzone.min.js"></script>',
|
@@ -120,4 +123,4 @@ exports.primaryBodyJS = __spreadArrays([
|
|
120
123
|
'<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/showdown/2.1.0/showdown.min.js"></script>',
|
121
124
|
'<script src="https://unpkg.com/@popperjs/core@2"></script>',
|
122
125
|
'<script src="https://unpkg.com/tippy.js@6"></script>',
|
123
|
-
]);
|
126
|
+
], false);
|
package/build/constants/query.js
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
"use strict";
|
2
|
-
var
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
3
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
4
|
+
if (ar || !(i in from)) {
|
5
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
6
|
+
ar[i] = from[i];
|
7
|
+
}
|
8
|
+
}
|
9
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
8
10
|
};
|
9
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
10
12
|
exports.DateConstant = exports.DateTimeUnit = exports.YEAR = exports.MONTH = exports.WEEK = exports.DAY = exports.HOUR = exports.CURRENT_DATE_TIME = exports.CURRENT_DATE = exports.CURRENT_TIME = exports.CURRENT_TENANT = exports.CURRENT_USER = exports.NOT_EQUAL = exports.BETWEEN = exports.GREATER_THAN_EQUALS_TO = exports.LESS_THAN_EQUALS_TO = exports.GREATER_THAN = exports.LESS_THAN = exports.NOT_IN_LIST = exports.IN_LIST = exports.LIKE = exports.IS_NULL = exports.IS_NOT_NULL = exports.EQUALS = void 0;
|
@@ -31,11 +33,11 @@ exports.WEEK = "WEEK";
|
|
31
33
|
exports.MONTH = "MONTH";
|
32
34
|
exports.YEAR = "YEAR";
|
33
35
|
exports.DateTimeUnit = [exports.HOUR, exports.DAY, exports.WEEK, exports.MONTH, exports.YEAR];
|
34
|
-
exports.DateConstant =
|
36
|
+
exports.DateConstant = __spreadArray([
|
35
37
|
exports.CURRENT_DATE,
|
36
38
|
exports.CURRENT_TIME,
|
37
39
|
exports.CURRENT_DATE_TIME
|
38
|
-
], exports.DateTimeUnit);
|
40
|
+
], exports.DateTimeUnit, true);
|
39
41
|
/*
|
40
42
|
export const dateRangeConstants = [
|
41
43
|
CURRENT_USER,
|
package/build/index.js
CHANGED
@@ -1,7 +1,11 @@
|
|
1
1
|
"use strict";
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
3
3
|
if (k2 === undefined) k2 = k;
|
4
|
-
Object.
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
7
|
+
}
|
8
|
+
Object.defineProperty(o, k2, desc);
|
5
9
|
}) : (function(o, m, k, k2) {
|
6
10
|
if (k2 === undefined) k2 = k;
|
7
11
|
o[k2] = m[k];
|