json-crud-ui-components 1.1.1 → 1.2.2
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/bin/v2/commands/buildHeader/template/v1/buildHeader.js +68 -0
- package/bin/v2/commands/buildHeader.js +20 -0
- package/bin/v2/commands/htmlIdClick/steps/resolveFolderName.js +17 -0
- package/bin/v2/commands/init/steps/announce.js +3 -0
- package/bin/v2/commands/init/steps/createProject.js +7 -0
- package/bin/v2/commands/init/steps/locateDestination.js +5 -0
- package/bin/v2/commands/init/steps/locateSource.js +32 -0
- package/bin/{v1 → v2}/core/resolveCommand.js +3 -1
- package/package.json +1 -1
- /package/bin/{v1 → v2}/commands/addListeners/steps/announce.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/steps/createProject.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/steps/locateDestination.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/steps/locateSource.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/steps/resolveFolderName.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/template/v1/AddListeners/start.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners/template/v2/start.js +0 -0
- /package/bin/{v1 → v2}/commands/addListeners.js +0 -0
- /package/bin/{v1/commands/htmlIdClick → v2/commands/buildHeader}/steps/announce.js +0 -0
- /package/bin/{v1/commands/htmlIdClick → v2/commands/buildHeader}/steps/createProject.js +0 -0
- /package/bin/{v1/commands/htmlIdClick → v2/commands/buildHeader}/steps/locateDestination.js +0 -0
- /package/bin/{v1/commands/htmlIdClick → v2/commands/buildHeader}/steps/locateSource.js +0 -0
- /package/bin/{v1/commands/htmlIdClick → v2/commands/buildHeader}/steps/resolveFolderName.js +0 -0
- /package/bin/{v1/commands/init → v2/commands/htmlIdClick}/steps/announce.js +0 -0
- /package/bin/{v1/commands/init → v2/commands/htmlIdClick}/steps/createProject.js +0 -0
- /package/bin/{v1/commands/init → v2/commands/htmlIdClick}/steps/locateDestination.js +0 -0
- /package/bin/{v1/commands/init → v2/commands/htmlIdClick}/steps/locateSource.js +0 -0
- /package/bin/{v1 → v2}/commands/htmlIdClick/template/v1/clickFunc.js +0 -0
- /package/bin/{v1 → v2}/commands/htmlIdClick/template/v1/start.js +0 -0
- /package/bin/{v1 → v2}/commands/htmlIdClick.js +0 -0
- /package/bin/{v1 → v2}/commands/init/steps/resolveFolderName.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v1/Index/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v2/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/DomContentLoaded/buildHeader.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/DomContentLoaded/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/headers.json +0 -0
- /package/bin/{v1 → v2}/commands/init/template/v3/start.js +0 -0
- /package/bin/{v1 → v2}/commands/init.js +0 -0
- /package/bin/{v1 → v2}/core/parseInput.js +0 -0
- /package/bin/{v1 → v2}/core/showUsage.js +0 -0
- /package/bin/{v1 → v2}/start.js +0 -0
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { initHeader } from "../../../../../../header/v5/initHeader.js";
|
|
2
|
+
|
|
3
|
+
const buildHeader = async () => {
|
|
4
|
+
const headerConfig = {
|
|
5
|
+
items: [
|
|
6
|
+
{
|
|
7
|
+
text: "Ledgers",
|
|
8
|
+
id: "LedgersHtmlId",
|
|
9
|
+
icon: [
|
|
10
|
+
"M4 6h16",
|
|
11
|
+
"M4 10h16",
|
|
12
|
+
"M4 14h10",
|
|
13
|
+
"M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
|
|
14
|
+
]
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
text: "StockItems",
|
|
18
|
+
id: "StockItemsHtmlId",
|
|
19
|
+
icon: [
|
|
20
|
+
"M3 7l9 4 9-4",
|
|
21
|
+
"M3 7l9-4 9 4",
|
|
22
|
+
"M3 7v10l9 4 9-4V7",
|
|
23
|
+
"M12 11v10"
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
text: "Transactions",
|
|
28
|
+
id: "1",
|
|
29
|
+
icon: [
|
|
30
|
+
|
|
31
|
+
"M6 2h9l5 5v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",
|
|
32
|
+
"M14 2v6h6",
|
|
33
|
+
"M8 12h8",
|
|
34
|
+
"M8 16h8"
|
|
35
|
+
],
|
|
36
|
+
href: "../../Transactions/V7/Create/index.html"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
text: "FromTally",
|
|
40
|
+
id: "ImportHtmlId",
|
|
41
|
+
icon: [
|
|
42
|
+
"M4 6h16",
|
|
43
|
+
"M4 10h16",
|
|
44
|
+
"M4 14h10",
|
|
45
|
+
"M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
|
|
46
|
+
]
|
|
47
|
+
}
|
|
48
|
+
]
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
await initHeader(headerConfig);
|
|
52
|
+
// await callKSHeader(headerConfig);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const callKSHeader = async (config) => {
|
|
56
|
+
if (window.KSHeader?.initHeader) {
|
|
57
|
+
console.log("table loaded from window.KSTable");
|
|
58
|
+
|
|
59
|
+
return window.KSHeader.initHeader(config); // extension or CDN
|
|
60
|
+
} else {
|
|
61
|
+
// const { initTableOnly } = await import("../../../../../../../../KSTableAi/V28/entry.js"); // local
|
|
62
|
+
const { initTableOnly } = await import("https://keshavsoft.github.io/KsJsTableAi/Public/kstable.js"); // local
|
|
63
|
+
|
|
64
|
+
return initTableOnly(config);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default buildHeader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { locateSource } from "./buildHeader/steps/locateSource.js";
|
|
2
|
+
import { locateDestination } from "./buildHeader/steps/locateDestination.js";
|
|
3
|
+
|
|
4
|
+
import { createProject } from "./buildHeader/steps/createProject.js";
|
|
5
|
+
import { announce } from "./buildHeader/steps/announce.js";
|
|
6
|
+
|
|
7
|
+
import resolveFolderName from "./buildHeader/steps/resolveFolderName.js";
|
|
8
|
+
|
|
9
|
+
export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true }) => {
|
|
10
|
+
const resolvedFolderName = resolveFolderName({
|
|
11
|
+
name: folderName
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const source = locateSource();
|
|
15
|
+
const destination = locateDestination({ inResolvedFolderName: resolvedFolderName });
|
|
16
|
+
|
|
17
|
+
createProject({ source, destination });
|
|
18
|
+
|
|
19
|
+
if (inAnnounce) announce({ inResolvedFolderName: resolvedFolderName });
|
|
20
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
export default function resolveFolderName({ name, inType = "basic" }) {
|
|
4
|
+
const defaultFolerName = "AddListeners";
|
|
5
|
+
|
|
6
|
+
// case 1: force new → timestamp
|
|
7
|
+
if (name === null) {
|
|
8
|
+
name = defaultFolerName;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
// case 2: user provided → strict
|
|
12
|
+
if (fs.existsSync(name)) {
|
|
13
|
+
throw new Error(`Folder already exists: ${name}`);
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
return name;
|
|
17
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
|
|
3
|
+
import path from "path";
|
|
4
|
+
import { fileURLToPath } from "url";
|
|
5
|
+
|
|
6
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
7
|
+
const __dirname = path.dirname(__filename);
|
|
8
|
+
|
|
9
|
+
const templatePath = path.join(
|
|
10
|
+
__dirname,
|
|
11
|
+
"..",
|
|
12
|
+
"template"
|
|
13
|
+
);
|
|
14
|
+
|
|
15
|
+
const versions = fs
|
|
16
|
+
.readdirSync(templatePath)
|
|
17
|
+
.filter(item => item.startsWith("v"));
|
|
18
|
+
|
|
19
|
+
const highestVersion =
|
|
20
|
+
versions.sort().at(-1);
|
|
21
|
+
|
|
22
|
+
const sourceVersion =
|
|
23
|
+
highestVersion;
|
|
24
|
+
|
|
25
|
+
export const locateSource = () => {
|
|
26
|
+
return path.join(
|
|
27
|
+
__dirname,
|
|
28
|
+
"..",
|
|
29
|
+
"template",
|
|
30
|
+
sourceVersion
|
|
31
|
+
);
|
|
32
|
+
};
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import init from "../commands/init.js";
|
|
2
2
|
import addListeners from "../commands/addListeners.js";
|
|
3
3
|
import htmlIdClick from "../commands/htmlIdClick.js";
|
|
4
|
+
import buildHeader from "../commands/buildHeader.js";
|
|
4
5
|
|
|
5
6
|
// resolveCommand.js
|
|
6
7
|
const map = {
|
|
7
8
|
init,
|
|
8
9
|
addListeners,
|
|
9
|
-
htmlIdClick
|
|
10
|
+
htmlIdClick,
|
|
11
|
+
buildHeader
|
|
10
12
|
};
|
|
11
13
|
|
|
12
14
|
export default function resolveCommand(cmd) {
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildHeader.js
RENAMED
|
File without changes
|
/package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/buildMenuItem.js
RENAMED
|
File without changes
|
/package/bin/{v1 → v2}/commands/init/template/v1/Index/FormLoad/DomContentLoaded/runAfterDomLoad.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{v1 → v2}/commands/init/template/v2/FormLoad/DomContentLoaded/runAfterDomLoad.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{v1 → v2}/commands/init/template/v3/FormLoad/DomContentLoaded/runAfterDomLoad.js
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/bin/{v1 → v2}/start.js
RENAMED
|
File without changes
|