@hotstaq/admin-panel 0.2.6 → 0.2.7
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/.vscode/launch.json +5 -4
- package/HotSite.json +2 -2
- package/build/{src/AppAPI.d.ts → AppAPI.d.ts} +0 -0
- package/build/AppAPI.d.ts.map +1 -0
- package/build/{src/AppAPI.js → AppAPI.js} +0 -0
- package/build/AppAPI.js.map +1 -0
- package/build/WebExport.d.ts +3 -0
- package/build/WebExport.d.ts.map +1 -0
- package/build/{src/WebExport.js → WebExport.js} +8 -22
- package/build/WebExport.js.map +1 -0
- package/build/{src/cli.d.ts → cli.d.ts} +0 -0
- package/build/cli.d.ts.map +1 -0
- package/build/{src/cli.js → cli.js} +0 -0
- package/build/cli.js.map +1 -0
- package/build/{src/components → components}/admin-button.d.ts +0 -0
- package/build/components/admin-button.d.ts.map +1 -0
- package/build/{src/components → components}/admin-button.js +0 -0
- package/build/components/admin-button.js.map +1 -0
- package/build/components/admin-checkbox.d.ts +1 -0
- package/build/components/admin-checkbox.d.ts.map +1 -0
- package/build/components/admin-checkbox.js +43 -0
- package/build/components/admin-checkbox.js.map +1 -0
- package/build/{src/components → components}/admin-dashboard.d.ts +0 -0
- package/build/components/admin-dashboard.d.ts.map +1 -0
- package/build/{src/components → components}/admin-dashboard.js +0 -0
- package/build/components/admin-dashboard.js.map +1 -0
- package/build/components/admin-edit.d.ts +87 -0
- package/build/components/admin-edit.d.ts.map +1 -0
- package/build/components/admin-edit.js +297 -0
- package/build/components/admin-edit.js.map +1 -0
- package/build/{src/components → components}/admin-table-field.d.ts +0 -0
- package/build/components/admin-table-field.d.ts.map +1 -0
- package/build/{src/components → components}/admin-table-field.js +2 -2
- package/build/components/admin-table-field.js.map +1 -0
- package/build/{src/components → components}/admin-table-row.d.ts +0 -0
- package/build/components/admin-table-row.d.ts.map +1 -0
- package/build/{src/components → components}/admin-table-row.js +2 -0
- package/build/components/admin-table-row.js.map +1 -0
- package/build/{src/components → components}/admin-table.d.ts +33 -1
- package/build/components/admin-table.d.ts.map +1 -0
- package/build/{src/components → components}/admin-table.js +106 -4
- package/build/components/admin-table.js.map +1 -0
- package/build/{src/components → components}/admin-text.d.ts +12 -0
- package/build/components/admin-text.d.ts.map +1 -0
- package/build/{src/components → components}/admin-text.js +6 -0
- package/build/components/admin-text.js.map +1 -0
- package/build/{src/WebExport.d.ts → index.d.ts} +2 -3
- package/build/index.d.ts.map +1 -0
- package/build/index.js +18 -0
- package/build/index.js.map +1 -0
- package/build-web/AdminPanelComponents.js +2 -2
- package/build-web/AdminPanelWeb_AppAPI.js +87 -0
- package/package.json +7 -6
- package/src/WebExport.ts +9 -24
- package/src/components/admin-checkbox.ts +52 -0
- package/src/components/admin-edit.ts +229 -12
- package/src/components/admin-table-field.ts +2 -2
- package/src/components/admin-table-row.ts +3 -0
- package/src/components/admin-table.ts +163 -5
- package/src/components/admin-text.ts +19 -0
- package/src/index.ts +17 -0
- package/tsconfig.json +1 -0
- package/webpack.config.cjs +2 -1
- package/build/scripts/watch.d.ts +0 -2
- package/build/scripts/watch.d.ts.map +0 -1
- package/build/scripts/watch.js +0 -127
- package/build/scripts/watch.js.map +0 -1
- package/build/src/AppAPI.d.ts.map +0 -1
- package/build/src/AppAPI.js.map +0 -1
- package/build/src/WebExport.d.ts.map +0 -1
- package/build/src/WebExport.js.map +0 -1
- package/build/src/cli.d.ts.map +0 -1
- package/build/src/cli.js.map +0 -1
- package/build/src/components/admin-button.d.ts.map +0 -1
- package/build/src/components/admin-button.js.map +0 -1
- package/build/src/components/admin-dashboard.d.ts.map +0 -1
- package/build/src/components/admin-dashboard.js.map +0 -1
- package/build/src/components/admin-edit.d.ts +0 -36
- package/build/src/components/admin-edit.d.ts.map +0 -1
- package/build/src/components/admin-edit.js +0 -120
- package/build/src/components/admin-edit.js.map +0 -1
- package/build/src/components/admin-table-field.d.ts.map +0 -1
- package/build/src/components/admin-table-field.js.map +0 -1
- package/build/src/components/admin-table-row.d.ts.map +0 -1
- package/build/src/components/admin-table-row.js.map +0 -1
- package/build/src/components/admin-table.d.ts.map +0 -1
- package/build/src/components/admin-table.js.map +0 -1
- package/build/src/components/admin-text.d.ts.map +0 -1
- package/build/src/components/admin-text.js.map +0 -1
- package/scripts/watch.ts +0 -59
package/.vscode/launch.json
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
"type": "node",
|
|
6
6
|
"request": "launch",
|
|
7
7
|
"name": "Debug Web Server",
|
|
8
|
-
"program": "${workspaceFolder}/build/
|
|
8
|
+
"program": "${workspaceFolder}/build/cli.js",
|
|
9
9
|
"skipFiles": [
|
|
10
10
|
"<node_internals>/**"
|
|
11
11
|
],
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
"type": "node",
|
|
23
23
|
"request": "launch",
|
|
24
24
|
"name": "Debug Web/API Server",
|
|
25
|
-
"program": "${workspaceFolder}/build/
|
|
25
|
+
"program": "${workspaceFolder}/build/cli.js",
|
|
26
26
|
"skipFiles": [
|
|
27
27
|
"<node_internals>/**"
|
|
28
28
|
],
|
|
29
29
|
"outputCapture": "std",
|
|
30
30
|
"args": [
|
|
31
31
|
"--development-mode",
|
|
32
|
+
"--verbose",
|
|
32
33
|
"run",
|
|
33
34
|
"--server-type", "web-api"
|
|
34
35
|
],
|
|
@@ -38,7 +39,7 @@
|
|
|
38
39
|
"type": "node",
|
|
39
40
|
"request": "launch",
|
|
40
41
|
"name": "Debug API Server",
|
|
41
|
-
"program": "${workspaceFolder}/build/
|
|
42
|
+
"program": "${workspaceFolder}/build/cli.js",
|
|
42
43
|
"skipFiles": [
|
|
43
44
|
"<node_internals>/**"
|
|
44
45
|
],
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"skipFiles": [
|
|
61
62
|
"<node_internals>/**"
|
|
62
63
|
],
|
|
63
|
-
"program": "${workspaceFolder}/build/
|
|
64
|
+
"program": "${workspaceFolder}/build/cli.js",
|
|
64
65
|
"args": [
|
|
65
66
|
"--development-mode",
|
|
66
67
|
"--hotsite",
|
package/HotSite.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"jsapi": "./js/AdminPanelWeb_AppAPI.js",
|
|
34
34
|
"libraryName": "AdminPanelWeb",
|
|
35
35
|
"apiName": "AppAPI",
|
|
36
|
-
"filepath": "./build/
|
|
36
|
+
"filepath": "./build/AppAPI.js"
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
@@ -44,6 +44,6 @@
|
|
|
44
44
|
"chart.js": "^2.9.4",
|
|
45
45
|
"feather-icons": "^4.29.0"
|
|
46
46
|
},
|
|
47
|
-
"webExport": "./build/
|
|
47
|
+
"webExport": "./build/WebExport.js"
|
|
48
48
|
}
|
|
49
49
|
}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAPI.d.ts","sourceRoot":"","sources":["../src/AppAPI.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,EAE4C,MAAM,SAAS,CAAC;AAGjG;;GAEG;AACH,qBAAa,MAAO,SAAQ,MAAM;gBAEpB,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,GAAG,SAAS,EAAE,EAAE,GAAE,GAAU;CA2E/E"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppAPI.js","sourceRoot":"","sources":["../src/AppAPI.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAEiG;AACjG,gDAA+C;AAE/C;;GAEG;AACH;IAA4B,0BAAM;IAEjC,gBAAa,OAAe,EAAE,UAAiC,EAAE,EAAc;QAAd,mBAAA,EAAA,SAAc;QAA/E,YAEC,kBAAM,OAAO,EAAE,UAAU,EAAE,EAAE,CAAC,SAwE9B;QAtEA,KAAI,CAAC,aAAa,GAAG;;gBAEnB,I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;4BAC7B,QAAQ,GAAG,CAAC,CAAC;wBAEI,qBAAM,EAAE,CAAC,KAAK,CAC/B,0EAA0E,EAC1E,CAAC,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC,EAAA;;wBAF1D,MAAM,GAAQ,SAE4C;wBAE9D,IAAI,MAAM,CAAC,KAAK,IAAI,IAAI;4BACvB,MAAM,IAAI,KAAK,CAAE,MAAM,CAAC,KAAK,CAAC,CAAC;wBAE5B,EAAE,GAAW,MAAM,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;;;wBAfD,IAAI,EAAE,CAAA;;;;;aAmBpD,CAAC,CAAC,CAAC;;IACN,CAAC;IACF,aAAC;AAAD,CAAC,AA7ED,CAA4B,gBAAM,GA6EjC;AA7EY,wBAAM"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebExport.d.ts","sourceRoot":"","sources":["../src/WebExport.ts"],"names":[],"mappings":"AAAA,iBAAe,WAAW,IAAK,OAAO,CAAC,GAAG,CAAC,CAqB1C;AAED,OAAO,EACN,WAAW,EACX,CAAC"}
|
|
@@ -36,21 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.
|
|
40
|
-
var admin_button_1 = require("./components/admin-button");
|
|
41
|
-
Object.defineProperty(exports, "AdminButton", { enumerable: true, get: function () { return admin_button_1.AdminButton; } });
|
|
42
|
-
var admin_dashboard_1 = require("./components/admin-dashboard");
|
|
43
|
-
Object.defineProperty(exports, "AdminDashboard", { enumerable: true, get: function () { return admin_dashboard_1.AdminDashboard; } });
|
|
44
|
-
var admin_edit_1 = require("./components/admin-edit");
|
|
45
|
-
Object.defineProperty(exports, "AdminEdit", { enumerable: true, get: function () { return admin_edit_1.AdminEdit; } });
|
|
46
|
-
var admin_table_1 = require("./components/admin-table");
|
|
47
|
-
Object.defineProperty(exports, "AdminTable", { enumerable: true, get: function () { return admin_table_1.AdminTable; } });
|
|
48
|
-
var admin_table_field_1 = require("./components/admin-table-field");
|
|
49
|
-
Object.defineProperty(exports, "AdminTableField", { enumerable: true, get: function () { return admin_table_field_1.AdminTableField; } });
|
|
50
|
-
var admin_table_row_1 = require("./components/admin-table-row");
|
|
51
|
-
Object.defineProperty(exports, "AdminTableRow", { enumerable: true, get: function () { return admin_table_row_1.AdminTableRow; } });
|
|
52
|
-
var admin_text_1 = require("./components/admin-text");
|
|
53
|
-
Object.defineProperty(exports, "AdminText", { enumerable: true, get: function () { return admin_text_1.AdminText; } });
|
|
39
|
+
exports.buildAssets = void 0;
|
|
54
40
|
function buildAssets() {
|
|
55
41
|
return __awaiter(this, void 0, void 0, function () {
|
|
56
42
|
return __generator(this, function (_a) {
|
|
@@ -65,13 +51,13 @@ function buildAssets() {
|
|
|
65
51
|
js: ["./assets/js/*.*", "./build-web/AdminPanelComponents.js"],
|
|
66
52
|
componentLibrary: "AdminPanelComponentsWeb",
|
|
67
53
|
components: [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
"AdminButton",
|
|
55
|
+
"AdminDashboard",
|
|
56
|
+
"AdminEdit",
|
|
57
|
+
"AdminTable",
|
|
58
|
+
"AdminTableField",
|
|
59
|
+
"AdminTableRow",
|
|
60
|
+
"AdminText"
|
|
75
61
|
]
|
|
76
62
|
})];
|
|
77
63
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WebExport.js","sourceRoot":"","sources":["../src/WebExport.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAe,WAAW;;;YAEzB,sBAAO,CAAC;oBACN,MAAM,EAAE,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,CAAC,kBAAkB,EAAE,mBAAmB,CAAC,EAAE;wBAC/E,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,eAAe,CAAC,EAAE;wBAC5C,UAAU;wBACV,eAAe;wBACf,gBAAgB,CAAC;oBAClB,IAAI,EAAE,CAAC,mBAAmB,CAAC;oBAC3B,GAAG,EAAE,CAAC,kBAAkB,CAAC;oBACzB,EAAE,EAAE,CAAC,iBAAiB,EAAE,qCAAqC,CAAC;oBAC9D,gBAAgB,EAAE,yBAAyB;oBAC3C,UAAU,EAAE;wBACX,aAAa;wBACb,gBAAgB;wBAChB,WAAW;wBACX,YAAY;wBACZ,iBAAiB;wBACjB,eAAe;wBACf,WAAW;qBAAC;iBACb,CAAC,EAAC;;;CACJ;AAGA,kCAAW"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
|
File without changes
|
package/build/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAiC;AAEjC,IAAI,GAAG,GAAW,IAAI,gBAAM,EAAG,CAAC;AAChC,GAAG,CAAC,KAAK,EAAG,CAAC,IAAI,CAAE;;;oBAEX,qBAAM,GAAG,CAAC,KAAK,CAAE,OAAO,CAAC,IAAI,CAAC,EAAA;;gBAA9B,SAA8B,CAAC;;;;KAClC,CAAC,CAAC"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-button.d.ts","sourceRoot":"","sources":["../../src/components/admin-button.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAO,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE7D,qBAAa,WAAY,SAAQ,YAAY;gBAE/B,IAAI,EAAE,YAAY,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM;IAOhD,aAAa,IAAK,OAAO,CAAC,IAAI,CAAC;IAIrC,MAAM,IAAK,MAAM;CAIjB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-button.js","sourceRoot":"","sources":["../../src/components/admin-button.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAA6D;AAE7D;IAAiC,+BAAY;IAE5C,qBAAa,IAA4B,EAAE,GAAW;QAAtD,YAEC,kBAAO,IAAI,EAAE,GAAG,CAAC,SAGjB;QADA,KAAI,CAAC,GAAG,GAAG,cAAc,CAAC;;IAC3B,CAAC;IAEK,mCAAa,GAAnB;;;;;;KAEC;IAED,4BAAM,GAAN;QAEC,OAAO,CAAC,yBAAiB,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,EAAE,sDAAgD,CAAC,CAAC;IACnG,CAAC;IACF,kBAAC;AAAD,CAAC,AAjBD,CAAiC,sBAAY,GAiB5C;AAjBY,kCAAW"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=admin-checkbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-checkbox.d.ts","sourceRoot":"","sources":["../../src/components/admin-checkbox.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// import { HotStaq, Hot, HotAPI, HotComponent, HotComponentOutput } from "hotstaq";
|
|
2
|
+
// export class AdminCheckbox extends HotComponent
|
|
3
|
+
// {
|
|
4
|
+
// /**
|
|
5
|
+
// * The associated database field.
|
|
6
|
+
// */
|
|
7
|
+
// field: string;
|
|
8
|
+
// constructor (copy: HotComponent | HotStaq, api: HotAPI)
|
|
9
|
+
// {
|
|
10
|
+
// super (copy, api);
|
|
11
|
+
// this.tag = "admin-checkbox";
|
|
12
|
+
// this.field = "";
|
|
13
|
+
// }
|
|
14
|
+
// /**
|
|
15
|
+
// * Corrects the placement of the text elements for modals.
|
|
16
|
+
// */
|
|
17
|
+
// onPostPlace (parentHtmlElement: HTMLElement, htmlElement: HTMLElement): HTMLElement
|
|
18
|
+
// {
|
|
19
|
+
// let placeHereArray = parentHtmlElement.querySelectorAll (`hot-place-here[type="modal"]`);
|
|
20
|
+
// if (placeHereArray.length > 0)
|
|
21
|
+
// {
|
|
22
|
+
// let placeHere = placeHereArray[0];
|
|
23
|
+
// parentHtmlElement.removeChild (htmlElement);
|
|
24
|
+
// placeHere.appendChild (htmlElement);
|
|
25
|
+
// // @ts-ignore
|
|
26
|
+
// parentHtmlElement.hotComponent.fieldElements[this.field] = htmlElement.querySelector ("input");
|
|
27
|
+
// }
|
|
28
|
+
// return (null);
|
|
29
|
+
// }
|
|
30
|
+
// output (): string | HotComponentOutput[]
|
|
31
|
+
// {
|
|
32
|
+
// let value: string = "";
|
|
33
|
+
// if (this.value != null)
|
|
34
|
+
// {
|
|
35
|
+
// if ((this.value === true) || (this.value === 1))
|
|
36
|
+
// value = "checked";
|
|
37
|
+
// }
|
|
38
|
+
// return (`<div>
|
|
39
|
+
// <label class="form-label">${this.inner}</label><input class="form-control" type = "checkbox" ${value} />
|
|
40
|
+
// </div>`);
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
//# sourceMappingURL=admin-checkbox.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-checkbox.js","sourceRoot":"","sources":["../../src/components/admin-checkbox.ts"],"names":[],"mappings":"AAAA,oFAAoF;AAEpF,kDAAkD;AAClD,IAAI;AACJ,OAAO;AACP,qCAAqC;AACrC,OAAO;AACP,kBAAkB;AAElB,2DAA2D;AAC3D,KAAK;AACL,uBAAuB;AAEvB,iCAAiC;AACjC,qBAAqB;AACrB,KAAK;AAEL,OAAO;AACP,8DAA8D;AAC9D,OAAO;AACP,uFAAuF;AACvF,KAAK;AACL,8FAA8F;AAE9F,mCAAmC;AACnC,MAAM;AACN,wCAAwC;AACxC,kDAAkD;AAClD,0CAA0C;AAE1C,mBAAmB;AACnB,qGAAqG;AACrG,MAAM;AAEN,mBAAmB;AACnB,KAAK;AAEL,4CAA4C;AAC5C,KAAK;AACL,4BAA4B;AAE5B,4BAA4B;AAC5B,MAAM;AACN,sDAAsD;AACtD,yBAAyB;AACzB,MAAM;AAEN,mBAAmB;AACnB,8GAA8G;AAC9G,cAAc;AACd,KAAK;AACL,IAAI"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-dashboard.d.ts","sourceRoot":"","sources":["../../src/components/admin-dashboard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAO,MAAM,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE7D,qBAAa,cAAe,SAAQ,YAAY;IAE/C;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;gBAEA,IAAI,EAAE,YAAY,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM;IAStD;;OAEG;IACH,WAAW,CAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,WAAW;IASnF,MAAM,IAAK,MAAM;CAejB"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-dashboard.js","sourceRoot":"","sources":["../../src/components/admin-dashboard.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,mCAA6D;AAE7D;IAAoC,kCAAY;IAW/C,wBAAa,IAA4B,EAAE,GAAW;QAAtD,YAEC,kBAAO,IAAI,EAAE,GAAG,CAAC,SAKjB;QAHA,KAAI,CAAC,GAAG,GAAG,iBAAiB,CAAC;QAC7B,KAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,KAAI,CAAC,IAAI,GAAG,EAAE,CAAC;;IAChB,CAAC;IAED;;OAEG;IACH,oCAAW,GAAX,UAAa,iBAA8B,EAAE,WAAwB;QAEpE,kDAAkD;QAClD,IAAI,IAAI,CAAC,IAAI,IAAI,EAAE;YAClB,aAAG,CAAC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC;QAE9B,OAAO,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,+BAAM,GAAN;QAEC,OAAO,CAAC,gOAGW,IAAI,CAAC,KAAK,8RAQrB,CAAC,CAAC;IACX,CAAC;IACF,qBAAC;AAAD,CAAC,AA/CD,CAAoC,sBAAY,GA+C/C;AA/CY,wCAAc"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HotStaq, HotAPI, HotComponent, HotComponentOutput } from "hotstaq";
|
|
2
|
+
import bootstrap from "bootstrap";
|
|
3
|
+
export declare class AdminEdit extends HotComponent {
|
|
4
|
+
/**
|
|
5
|
+
* The title of this edit modal.
|
|
6
|
+
*/
|
|
7
|
+
title: string;
|
|
8
|
+
/**
|
|
9
|
+
* The button title.
|
|
10
|
+
*/
|
|
11
|
+
button_title: string;
|
|
12
|
+
/**
|
|
13
|
+
* The attached list.
|
|
14
|
+
*/
|
|
15
|
+
attached_list: string;
|
|
16
|
+
/**
|
|
17
|
+
* The attached schema.
|
|
18
|
+
*/
|
|
19
|
+
schema: string;
|
|
20
|
+
/**
|
|
21
|
+
* The field elements in the edit modal.
|
|
22
|
+
*/
|
|
23
|
+
fieldElements: {
|
|
24
|
+
[name: string]: any;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* The modal id.
|
|
28
|
+
*/
|
|
29
|
+
modalId: string;
|
|
30
|
+
/**
|
|
31
|
+
* The bootstrap modal instance.
|
|
32
|
+
*/
|
|
33
|
+
modal: bootstrap.Modal;
|
|
34
|
+
/**
|
|
35
|
+
* If set to true, this will close the modal when save is clicked.
|
|
36
|
+
*/
|
|
37
|
+
closeOnSave: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* The type of modal to open. Can be:
|
|
40
|
+
* * add
|
|
41
|
+
* * edit
|
|
42
|
+
* * remove
|
|
43
|
+
*/
|
|
44
|
+
protected modalType: string;
|
|
45
|
+
/**
|
|
46
|
+
* The selected fields.
|
|
47
|
+
*/
|
|
48
|
+
protected selectedFields: any[];
|
|
49
|
+
constructor(copy: HotComponent | HotStaq, api: HotAPI);
|
|
50
|
+
/**
|
|
51
|
+
* The event that can be called when the add button is clicked.
|
|
52
|
+
* This is called before the add modal opens.
|
|
53
|
+
*/
|
|
54
|
+
onAddClicked: () => Promise<boolean>;
|
|
55
|
+
/**
|
|
56
|
+
* Executes when the add button is clicked.
|
|
57
|
+
*/
|
|
58
|
+
addClicked(): Promise<void>;
|
|
59
|
+
/**
|
|
60
|
+
* The event that can be called when the edit button is clicked.
|
|
61
|
+
* This is called before the edit modal opens.
|
|
62
|
+
*/
|
|
63
|
+
onEditClicked: () => Promise<boolean>;
|
|
64
|
+
/**
|
|
65
|
+
* Executes when the edit button is clicked.
|
|
66
|
+
*/
|
|
67
|
+
editClicked(): Promise<void>;
|
|
68
|
+
/**
|
|
69
|
+
* The event that can be called when the remove button is clicked.
|
|
70
|
+
* This is called before the remove modal opens.
|
|
71
|
+
*/
|
|
72
|
+
onRemoveClicked: () => Promise<boolean>;
|
|
73
|
+
/**
|
|
74
|
+
* Executes when the remove button is clicked.
|
|
75
|
+
*/
|
|
76
|
+
removeClicked(): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Save this form.
|
|
79
|
+
*/
|
|
80
|
+
onSave(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Get the list of data from the server.
|
|
83
|
+
*/
|
|
84
|
+
onPostPlace(parentHtmlElement: HTMLElement, htmlElement: HTMLElement): HTMLElement;
|
|
85
|
+
output(): string | HotComponentOutput[];
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=admin-edit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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AEG;IACH,WAAW,CAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,WAAW;IAWnF,MAAM,IAAK,MAAM,GAAG,kBAAkB,EAAE;CA2CxC"}
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
+
function step(op) {
|
|
31
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
+
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;
|
|
34
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
+
switch (op[0]) {
|
|
36
|
+
case 0: case 1: t = op; break;
|
|
37
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
+
default:
|
|
41
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
+
if (t[2]) _.ops.pop();
|
|
46
|
+
_.trys.pop(); continue;
|
|
47
|
+
}
|
|
48
|
+
op = body.call(thisArg, _);
|
|
49
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
+
};
|
|
56
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
|
+
exports.AdminEdit = void 0;
|
|
58
|
+
var hotstaq_1 = require("hotstaq");
|
|
59
|
+
var bootstrap_1 = __importDefault(require("bootstrap"));
|
|
60
|
+
var AdminEdit = /** @class */ (function (_super) {
|
|
61
|
+
__extends(AdminEdit, _super);
|
|
62
|
+
function AdminEdit(copy, api) {
|
|
63
|
+
var _this = _super.call(this, copy, api) || this;
|
|
64
|
+
/**
|
|
65
|
+
* The event that can be called when the add button is clicked.
|
|
66
|
+
* This is called before the add modal opens.
|
|
67
|
+
*/
|
|
68
|
+
_this.onAddClicked = null;
|
|
69
|
+
/**
|
|
70
|
+
* The event that can be called when the edit button is clicked.
|
|
71
|
+
* This is called before the edit modal opens.
|
|
72
|
+
*/
|
|
73
|
+
_this.onEditClicked = null;
|
|
74
|
+
/**
|
|
75
|
+
* The event that can be called when the remove button is clicked.
|
|
76
|
+
* This is called before the remove modal opens.
|
|
77
|
+
*/
|
|
78
|
+
_this.onRemoveClicked = null;
|
|
79
|
+
_this.tag = "admin-edit";
|
|
80
|
+
_this.title = "";
|
|
81
|
+
_this.button_title = "";
|
|
82
|
+
_this.attached_list = "";
|
|
83
|
+
_this.schema = "";
|
|
84
|
+
_this.fieldElements = {};
|
|
85
|
+
_this.modalId = "";
|
|
86
|
+
_this.modal = null;
|
|
87
|
+
_this.modalType = "add";
|
|
88
|
+
_this.closeOnSave = true;
|
|
89
|
+
_this.selectedFields = [];
|
|
90
|
+
return _this;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Executes when the add button is clicked.
|
|
94
|
+
*/
|
|
95
|
+
AdminEdit.prototype.addClicked = function () {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var result, key, fieldElement;
|
|
98
|
+
return __generator(this, function (_a) {
|
|
99
|
+
switch (_a.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
if (!(this.onAddClicked != null)) return [3 /*break*/, 2];
|
|
102
|
+
return [4 /*yield*/, this.onAddClicked()];
|
|
103
|
+
case 1:
|
|
104
|
+
result = _a.sent();
|
|
105
|
+
if (result === false)
|
|
106
|
+
return [2 /*return*/];
|
|
107
|
+
_a.label = 2;
|
|
108
|
+
case 2:
|
|
109
|
+
this.modalType = "add";
|
|
110
|
+
// Clear the values in each field.
|
|
111
|
+
for (key in this.fieldElements) {
|
|
112
|
+
fieldElement = this.fieldElements[key];
|
|
113
|
+
fieldElement.value = "";
|
|
114
|
+
}
|
|
115
|
+
this.selectedFields = [];
|
|
116
|
+
bootstrap_1.default.Modal.getInstance("#".concat(this.modalId)).show();
|
|
117
|
+
return [2 /*return*/];
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
/**
|
|
123
|
+
* Executes when the edit button is clicked.
|
|
124
|
+
*/
|
|
125
|
+
AdminEdit.prototype.editClicked = function () {
|
|
126
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
127
|
+
var result, attachedList, hotComponent, selectedField, key, fieldElement, value;
|
|
128
|
+
return __generator(this, function (_a) {
|
|
129
|
+
switch (_a.label) {
|
|
130
|
+
case 0:
|
|
131
|
+
if (!(this.onEditClicked != null)) return [3 /*break*/, 2];
|
|
132
|
+
return [4 /*yield*/, this.onEditClicked()];
|
|
133
|
+
case 1:
|
|
134
|
+
result = _a.sent();
|
|
135
|
+
if (result === false)
|
|
136
|
+
return [2 /*return*/];
|
|
137
|
+
_a.label = 2;
|
|
138
|
+
case 2:
|
|
139
|
+
this.modalType = "edit";
|
|
140
|
+
attachedList = document.getElementById(this.attached_list);
|
|
141
|
+
hotComponent = attachedList.hotComponent;
|
|
142
|
+
selectedField = hotComponent.getSelected();
|
|
143
|
+
if (selectedField != null) {
|
|
144
|
+
for (key in this.fieldElements) {
|
|
145
|
+
fieldElement = this.fieldElements[key];
|
|
146
|
+
if (fieldElement != null) {
|
|
147
|
+
value = selectedField[key];
|
|
148
|
+
fieldElement.value = value;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
this.selectedFields = [selectedField];
|
|
152
|
+
bootstrap_1.default.Modal.getInstance("#".concat(this.modalId)).show();
|
|
153
|
+
}
|
|
154
|
+
return [2 /*return*/];
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
});
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Executes when the remove button is clicked.
|
|
161
|
+
*/
|
|
162
|
+
AdminEdit.prototype.removeClicked = function () {
|
|
163
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
164
|
+
var result, hotComponent, checkedRows, confirmed;
|
|
165
|
+
return __generator(this, function (_a) {
|
|
166
|
+
switch (_a.label) {
|
|
167
|
+
case 0:
|
|
168
|
+
if (!(this.onRemoveClicked != null)) return [3 /*break*/, 2];
|
|
169
|
+
return [4 /*yield*/, this.onRemoveClicked()];
|
|
170
|
+
case 1:
|
|
171
|
+
result = _a.sent();
|
|
172
|
+
if (result === false)
|
|
173
|
+
return [2 /*return*/];
|
|
174
|
+
_a.label = 2;
|
|
175
|
+
case 2:
|
|
176
|
+
this.modalType = "remove";
|
|
177
|
+
hotComponent = attachedList.hotComponent;
|
|
178
|
+
checkedRows = hotComponent.getCheckedRows();
|
|
179
|
+
if (!(checkedRows != null)) return [3 /*break*/, 4];
|
|
180
|
+
confirmed = confirm("Are you sure you want to remove this item?");
|
|
181
|
+
if (!(confirmed === true)) return [3 /*break*/, 4];
|
|
182
|
+
return [4 /*yield*/, hotstaq_1.Hot.jsonRequest("".concat(hotstaq_1.Hot.Data.baseUrl, "/v1/data/remove"), {
|
|
183
|
+
schema: this.schema,
|
|
184
|
+
whereFields: checkedRows
|
|
185
|
+
})];
|
|
186
|
+
case 3:
|
|
187
|
+
_a.sent();
|
|
188
|
+
_a.label = 4;
|
|
189
|
+
case 4: return [2 /*return*/];
|
|
190
|
+
}
|
|
191
|
+
});
|
|
192
|
+
});
|
|
193
|
+
};
|
|
194
|
+
/**
|
|
195
|
+
* Save this form.
|
|
196
|
+
*/
|
|
197
|
+
AdminEdit.prototype.onSave = function () {
|
|
198
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
199
|
+
var values, key, fieldElement, value, fieldType, selectedField, whereFields, key, fieldElement, value, fieldType, attachedList, table;
|
|
200
|
+
return __generator(this, function (_a) {
|
|
201
|
+
switch (_a.label) {
|
|
202
|
+
case 0:
|
|
203
|
+
values = {};
|
|
204
|
+
for (key in this.fieldElements) {
|
|
205
|
+
fieldElement = this.fieldElements[key];
|
|
206
|
+
if (fieldElement != null) {
|
|
207
|
+
value = fieldElement.value;
|
|
208
|
+
fieldType = fieldElement.parentNode.hotComponent.field_type;
|
|
209
|
+
if (fieldType === "remove")
|
|
210
|
+
continue;
|
|
211
|
+
values[key] = value;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (!(this.modalType === "add")) return [3 /*break*/, 2];
|
|
215
|
+
return [4 /*yield*/, hotstaq_1.Hot.jsonRequest("".concat(hotstaq_1.Hot.Data.baseUrl, "/v1/data/add"), {
|
|
216
|
+
schema: this.schema,
|
|
217
|
+
fields: values
|
|
218
|
+
})];
|
|
219
|
+
case 1:
|
|
220
|
+
_a.sent();
|
|
221
|
+
_a.label = 2;
|
|
222
|
+
case 2:
|
|
223
|
+
if (!(this.modalType === "edit")) return [3 /*break*/, 4];
|
|
224
|
+
if (this.selectedFields.length === 0) {
|
|
225
|
+
alert("No item(s) selected!");
|
|
226
|
+
return [2 /*return*/];
|
|
227
|
+
}
|
|
228
|
+
selectedField = this.selectedFields[0];
|
|
229
|
+
whereFields = {};
|
|
230
|
+
for (key in selectedField) {
|
|
231
|
+
fieldElement = this.fieldElements[key];
|
|
232
|
+
value = selectedField[key];
|
|
233
|
+
if (fieldElement != null) {
|
|
234
|
+
fieldType = fieldElement.parentNode.hotComponent.field_type;
|
|
235
|
+
if (fieldType === "remove")
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
whereFields[key] = value;
|
|
239
|
+
}
|
|
240
|
+
return [4 /*yield*/, hotstaq_1.Hot.jsonRequest("".concat(hotstaq_1.Hot.Data.baseUrl, "/v1/data/edit"), {
|
|
241
|
+
schema: this.schema,
|
|
242
|
+
whereFields: whereFields,
|
|
243
|
+
fields: values
|
|
244
|
+
})];
|
|
245
|
+
case 3:
|
|
246
|
+
_a.sent();
|
|
247
|
+
_a.label = 4;
|
|
248
|
+
case 4:
|
|
249
|
+
attachedList = document.getElementById(this.attached_list);
|
|
250
|
+
table = attachedList.hotComponent;
|
|
251
|
+
return [4 /*yield*/, table.refreshList()];
|
|
252
|
+
case 5:
|
|
253
|
+
_a.sent();
|
|
254
|
+
if (this.closeOnSave === true) {
|
|
255
|
+
bootstrap_1.default.Modal.getInstance("#".concat(this.modalId)).hide();
|
|
256
|
+
}
|
|
257
|
+
return [2 /*return*/];
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
});
|
|
261
|
+
};
|
|
262
|
+
/**
|
|
263
|
+
* Get the list of data from the server.
|
|
264
|
+
*/
|
|
265
|
+
AdminEdit.prototype.onPostPlace = function (parentHtmlElement, htmlElement) {
|
|
266
|
+
this.modal = new bootstrap_1.default.Modal($("#".concat(this.modalId))[0], {
|
|
267
|
+
"backdrop": true,
|
|
268
|
+
"keyboard": true,
|
|
269
|
+
"focus": true
|
|
270
|
+
});
|
|
271
|
+
return (null);
|
|
272
|
+
};
|
|
273
|
+
AdminEdit.prototype.output = function () {
|
|
274
|
+
if (this.name === "")
|
|
275
|
+
throw new Error("You must specify a name for each admin-edit element!");
|
|
276
|
+
this.modalId = "".concat(this.name, "Modal");
|
|
277
|
+
return ([{
|
|
278
|
+
html: "\n\t\t\t<!-- ".concat(this.title, " Modal Start -->\n\t\t\t<div class=\"modal fade\" id=\"").concat(this.modalId, "\" tabindex=\"-1\" aria-labelledby=\"").concat(this.name, "ModalLabel\" aria-hidden=\"true\">\n\t\t\t\t<div class=\"modal-dialog\">\n\t\t\t\t\t<div class=\"modal-content\">\n\t\t\t\t\t<div class=\"modal-header\">\n\t\t\t\t\t\t<h5 class=\"modal-title\" id=\"").concat(this.name, "ModalLabel\">").concat(this.title, "</h5>\n\t\t\t\t\t\t<button type=\"button\" class=\"btn-close\" data-bs-dismiss=\"modal\" aria-label=\"Close\"></button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"modal-body\">\n\t\t\t\t\t\t<hot-place-here name = \"modalBody\" type = \"modal\"></hot-place-here>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"modal-footer\">\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-secondary\" data-bs-dismiss=\"modal\">Cancel</button>\n\t\t\t\t\t\t<button type=\"button\" class=\"btn btn-primary\" onclick = \"document.getElementById('").concat(this.modalId, "').onSave ();\">").concat(this.button_title, "</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<!-- ").concat(this.title, " Modal End -->"),
|
|
279
|
+
documentSelector: "body"
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
html: "<button id = \"".concat(this.modalId, "-add-btn\" type=\"button\" class=\"btn btn-sm btn-outline-secondary\" onclick = \"this.addClicked ();\">Add</button>"),
|
|
283
|
+
documentSelector: "hot-place-here[name=\"buttons\"]"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
html: "<button id = \"".concat(this.modalId, "-edit-btn\" type=\"button\" class=\"btn btn-sm btn-outline-secondary\" onclick = \"this.editClicked ();\">Edit</button>"),
|
|
287
|
+
documentSelector: "hot-place-here[name=\"buttons\"]"
|
|
288
|
+
},
|
|
289
|
+
{
|
|
290
|
+
html: "<button id = \"".concat(this.modalId, "-edit-btn\" type=\"button\" class=\"btn btn-sm btn-outline-secondary\" onclick = \"this.removeClicked ();\">Remove</button>"),
|
|
291
|
+
documentSelector: "hot-place-here[name=\"buttons\"]"
|
|
292
|
+
}]);
|
|
293
|
+
};
|
|
294
|
+
return AdminEdit;
|
|
295
|
+
}(hotstaq_1.HotComponent));
|
|
296
|
+
exports.AdminEdit = AdminEdit;
|
|
297
|
+
//# sourceMappingURL=admin-edit.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-edit.js","sourceRoot":"","sources":["../../src/components/admin-edit.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mCAAiF;AAEjF,wDAAkC;AAIlC;IAA+B,6BAAY;IA8C1C,mBAAa,IAA4B,EAAE,GAAW;QAAtD,YAEC,kBAAO,IAAI,EAAE,GAAG,CAAC,SAejB;QAED;;;WAGG;QACH,kBAAY,GAA2B,IAAI,CAAC;QA8B5C;;;WAGG;QACH,mBAAa,GAA2B,IAAI,CAAC;QA2C7C;;;WAGG;QACH,qBAAe,GAA2B,IAAI,CAAC;QApG9C,KAAI,CAAC,GAAG,GAAG,YAAY,CAAC;QACxB,KAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,KAAI,CAAC,YAAY,GAAG,EAAE,CAAC;QACvB,KAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QACxB,KAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QAEjB,KAAI,CAAC,aAAa,GAAG,EAAE,CAAC;QAExB,KAAI,CAAC,OAAO,GAAG,EAAE,CAAC;QAClB,KAAI,CAAC,KAAK,GAAG,IAAI,CAAC;QAClB,KAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,KAAI,CAAC,cAAc,GAAG,EAAE,CAAC;;IAC1B,CAAC;IAQD;;OAEG;IACG,8BAAU,GAAhB;;;;;;6BAEK,CAAA,IAAI,CAAC,YAAY,IAAI,IAAI,CAAA,EAAzB,wBAAyB;wBAEf,qBAAM,IAAI,CAAC,YAAY,EAAG,EAAA;;wBAAnC,MAAM,GAAG,SAA0B;wBAEvC,IAAI,MAAM,KAAK,KAAK;4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aAClD;YACD;gBACC,IAAI,EAAE,yBAAiB,IAAI,CAAC,OAAO,gIAAsH;gBACzJ,gBAAgB,EAAE,kCAAgC;aAClD,CAAC,CAAC,CAAC;IACL,CAAC;IACF,gBAAC;AAAD,CAAC,AAhUD,CAA+B,sBAAY,GAgU1C;AAhUY,8BAAS"}
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"admin-table-field.d.ts","sourceRoot":"","sources":["../../src/components/admin-table-field.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAO,MAAM,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEjF,qBAAa,eAAgB,SAAQ,YAAY;IAEhD;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;gBAED,IAAI,EAAE,YAAY,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM;IAQtD;;OAEG;IACH,WAAW,CAAE,iBAAiB,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAG,WAAW;IAWnF,MAAM,IAAK,MAAM,GAAG,kBAAkB,EAAE;CAOxC"}
|