json-crud-ui-components 1.4.3 → 1.5.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.
Files changed (78) hide show
  1. package/bin/cli.js +1 -1
  2. package/bin/v5/commands/addListeners/steps/checks.js +25 -0
  3. package/bin/{v3/commands/addListeners/template/v2/start.js → v5/commands/addListeners/template/v2/hookAllListeners.js} +1 -1
  4. package/bin/{v3 → v5}/commands/addListeners.js +12 -0
  5. package/bin/v5/commands/htmlIdClick/steps/checks.js +25 -0
  6. package/bin/v5/commands/htmlIdClick/steps/resolveFolderName.js +14 -0
  7. package/bin/{v3 → v5}/commands/htmlIdClick.js +13 -1
  8. package/bin/v5/commands/init/steps/checks.js +23 -0
  9. package/bin/v5/commands/init/template/v4/index.html +48 -0
  10. package/bin/v5/commands/init/template/v4/tailwindcss-3.4.17.css +83 -0
  11. package/bin/{v3 → v5}/commands/init.js +4 -2
  12. package/bin/v5/commands/initHtml/steps/announce.js +3 -0
  13. package/bin/v5/commands/initHtml/steps/checks.js +23 -0
  14. package/bin/v5/commands/initHtml/steps/createProject.js +7 -0
  15. package/bin/v5/commands/initHtml/steps/locateDestination.js +5 -0
  16. package/bin/v5/commands/initHtml/steps/locateSource.js +32 -0
  17. package/bin/{v3/commands/htmlIdClick → v5/commands/initHtml}/steps/resolveFolderName.js +1 -1
  18. package/bin/{v3/commands/init/template/v1/Index → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/buildHeader.js +6 -16
  19. package/bin/{v3/commands/init/template/v1/Index → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/runAfterDomLoad.js +1 -1
  20. package/bin/v5/commands/initHtml/template/v3/headers.json +45 -0
  21. package/bin/v5/commands/initHtml/template/v4/index.html +48 -0
  22. package/bin/v5/commands/initHtml/template/v4/tailwindcss-3.4.17.css +83 -0
  23. package/bin/v5/commands/initHtml.js +25 -0
  24. package/bin/v5/commands/initJs/steps/announce.js +3 -0
  25. package/bin/v5/commands/initJs/steps/checks.js +23 -0
  26. package/bin/v5/commands/initJs/steps/createProject.js +7 -0
  27. package/bin/v5/commands/initJs/steps/locateDestination.js +5 -0
  28. package/bin/v5/commands/initJs/steps/locateSource.js +32 -0
  29. package/bin/v5/commands/initJs/steps/resolveFolderName.js +17 -0
  30. package/bin/{v3/commands/init/template/v2 → v5/commands/initJs/template/v3}/FormLoad/DomContentLoaded/buildHeader.js +6 -16
  31. package/bin/{v3/commands/init/template/v2 → v5/commands/initJs/template/v3}/FormLoad/DomContentLoaded/runAfterDomLoad.js +1 -1
  32. package/bin/v5/commands/initJs/template/v3/headers.json +45 -0
  33. package/bin/v5/commands/initJs.js +25 -0
  34. package/bin/v5/core/getAllVersions.js +12 -0
  35. package/bin/v5/core/showUsage.js +41 -0
  36. package/bin/{v3 → v5}/start.js +2 -0
  37. package/package.json +1 -1
  38. package/bin/v3/core/showUsage.js +0 -39
  39. /package/bin/{v3 → v5}/commands/addListeners/steps/announce.js +0 -0
  40. /package/bin/{v3 → v5}/commands/addListeners/steps/createProject.js +0 -0
  41. /package/bin/{v3 → v5}/commands/addListeners/steps/locateDestination.js +0 -0
  42. /package/bin/{v3 → v5}/commands/addListeners/steps/locateSource.js +0 -0
  43. /package/bin/{v3 → v5}/commands/addListeners/steps/resolveFolderName.js +0 -0
  44. /package/bin/{v3 → v5}/commands/buildHeader/steps/announce.js +0 -0
  45. /package/bin/{v3 → v5}/commands/buildHeader/steps/createProject.js +0 -0
  46. /package/bin/{v3 → v5}/commands/buildHeader/steps/locateDestination.js +0 -0
  47. /package/bin/{v3 → v5}/commands/buildHeader/steps/locateSource.js +0 -0
  48. /package/bin/{v3 → v5}/commands/buildHeader/steps/resolveFolderName.js +0 -0
  49. /package/bin/{v3 → v5}/commands/buildHeader/template/v1/buildHeader.js +0 -0
  50. /package/bin/{v3 → v5}/commands/buildHeader.js +0 -0
  51. /package/bin/{v3 → v5}/commands/htmlIdClick/steps/announce.js +0 -0
  52. /package/bin/{v3 → v5}/commands/htmlIdClick/steps/createProject.js +0 -0
  53. /package/bin/{v3 → v5}/commands/htmlIdClick/steps/locateDestination.js +0 -0
  54. /package/bin/{v3 → v5}/commands/htmlIdClick/steps/locateSource.js +0 -0
  55. /package/bin/{v3 → v5}/commands/htmlIdClick/template/v1/clickFunc.js +0 -0
  56. /package/bin/{v3 → v5}/commands/htmlIdClick/template/v1/start.js +0 -0
  57. /package/bin/{v3 → v5}/commands/init/steps/announce.js +0 -0
  58. /package/bin/{v3 → v5}/commands/init/steps/createProject.js +0 -0
  59. /package/bin/{v3 → v5}/commands/init/steps/locateDestination.js +0 -0
  60. /package/bin/{v3 → v5}/commands/init/steps/locateSource.js +0 -0
  61. /package/bin/{v3 → v5}/commands/init/steps/resolveFolderName.js +0 -0
  62. /package/bin/{v3 → v5}/commands/init/template/v3/FormLoad/DomContentLoaded/buildHeader.js +0 -0
  63. /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
  64. /package/bin/{v3 → v5}/commands/init/template/v3/FormLoad/DomContentLoaded/runAfterDomLoad.js +0 -0
  65. /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/DomContentLoaded/start.js +0 -0
  66. /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/FormLoad/start.js +0 -0
  67. /package/bin/{v3 → v5}/commands/init/template/v3/headers.json +0 -0
  68. /package/bin/{v3/commands/init/template/v1/Index → v5/commands/init/template/v3}/start.js +0 -0
  69. /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
  70. /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/DomContentLoaded/start.js +0 -0
  71. /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/FormLoad/start.js +0 -0
  72. /package/bin/{v3/commands/init/template/v2 → v5/commands/initHtml/template/v3}/start.js +0 -0
  73. /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/DomContentLoaded/buildMenuItem.js +0 -0
  74. /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/DomContentLoaded/start.js +0 -0
  75. /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/FormLoad/start.js +0 -0
  76. /package/bin/{v3/commands/init → v5/commands/initJs}/template/v3/start.js +0 -0
  77. /package/bin/{v3 → v5}/core/parseInput.js +0 -0
  78. /package/bin/{v3 → v5}/core/resolveCommand.js +0 -0
@@ -5,8 +5,12 @@ import { createProject } from "./init/steps/createProject.js";
5
5
  import { announce } from "./init/steps/announce.js";
6
6
 
7
7
  import resolveFolderName from "./init/steps/resolveFolderName.js";
8
+ import checks from "./init/steps/checks.js";
8
9
 
9
10
  export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true }) => {
11
+ const fromChecks = checks({ toPath, inAnnounce });
12
+
13
+ if (fromChecks) return false;
10
14
 
11
15
  const resolvedFolderName = resolveFolderName({
12
16
  name: folderName
@@ -18,6 +22,4 @@ export default ({ folderName = "", toPath = process.cwd(), inAnnounce = true })
18
22
  createProject({ source, destination });
19
23
 
20
24
  if (inAnnounce) announce({ inResolvedFolderName: resolvedFolderName });
21
-
22
- console.log("aaaaaaaaa ", folderName, toPath, resolvedFolderName);
23
25
  };
@@ -0,0 +1,3 @@
1
+ export const announce = ({ inResolvedFolderName }) => {
2
+ console.log(`[keshavsoft] Project created: ${inResolvedFolderName}`);
3
+ };
@@ -0,0 +1,23 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+
4
+ const validate = ({ toPath }) => {
5
+ const htmlPath = path.join(toPath, "index.html");
6
+ const indexPath = path.join(toPath, "index");
7
+
8
+ if (!fs.existsSync(htmlPath)) {
9
+ console.log("index.html not found");
10
+
11
+ return true;
12
+ };
13
+
14
+ if (fs.existsSync(indexPath)) {
15
+ console.log("index folder found");
16
+
17
+ return true;
18
+ };
19
+
20
+ return false;
21
+ };
22
+
23
+ export default validate;
@@ -0,0 +1,7 @@
1
+ import fs from "fs";
2
+
3
+ export const createProject = ({ source, destination }) => {
4
+ fs.mkdirSync(destination, { recursive: true });
5
+
6
+ fs.cpSync(source, destination, { recursive: true });
7
+ };
@@ -0,0 +1,5 @@
1
+ import path from "path";
2
+
3
+ export const locateDestination = ({ inResolvedFolderName }) => {
4
+ return path.join(process.cwd(), inResolvedFolderName);
5
+ };
@@ -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,7 +1,7 @@
1
1
  import fs from "fs";
2
2
 
3
3
  export default function resolveFolderName({ name, inType = "basic" }) {
4
- const defaultFolerName = "AddListeners";
4
+ const defaultFolerName = "Index";
5
5
 
6
6
  // case 1: force new → timestamp
7
7
  if (name === null) {
@@ -1,7 +1,7 @@
1
1
  import { initHeader } from "../../../../../../header/v6/initHeader.js";
2
2
 
3
- const buildHeader = () => {
4
- const headerConfig = {
3
+ const buildHeader = async () => {
4
+ const headerConfig1 = {
5
5
  items: [
6
6
  {
7
7
  text: "ShowAll",
@@ -48,21 +48,11 @@ const buildHeader = () => {
48
48
  ]
49
49
  };
50
50
 
51
- initHeader(headerConfig);
52
- // callKSHeader(headerConfig).then();
53
- };
54
-
55
- const callKSHeader = async (config) => {
56
- if (window.KSHeader?.initHeader) {
57
- console.log("table loaded from window.KSTable");
51
+ const fromFetch = await fetch("./Index/headers.json");
52
+ const headerConfig = await fromFetch.json();
58
53
 
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
- };
54
+ await initHeader(headerConfig);
55
+ // callKSHeader(headerConfig).then();
66
56
  };
67
57
 
68
58
  export { buildHeader };
@@ -1,7 +1,7 @@
1
1
  import { buildHeader } from "./buildHeader.js";
2
2
 
3
3
  const runAfterDomLoad = () => {
4
- buildHeader();
4
+ buildHeader().then();
5
5
  };
6
6
 
7
7
  export { runAfterDomLoad };
@@ -0,0 +1,45 @@
1
+ {
2
+ "items": [
3
+ {
4
+ "text": "ShowAll",
5
+ "id": "ShowAllHtmlId",
6
+ "icon": [
7
+ "M4 6h16",
8
+ "M4 10h16",
9
+ "M4 14h10",
10
+ "M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
11
+ ]
12
+ },
13
+ {
14
+ "text": "Search",
15
+ "id": "SearchHtmlId",
16
+ "icon": [
17
+ "M3 7l9 4 9-4",
18
+ "M3 7l9-4 9 4",
19
+ "M3 7v10l9 4 9-4V7",
20
+ "M12 11v10"
21
+ ]
22
+ },
23
+ {
24
+ "text": "Transactions",
25
+ "id": "1",
26
+ "icon": [
27
+ "M6 2h9l5 5v15a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z",
28
+ "M14 2v6h6",
29
+ "M8 12h8",
30
+ "M8 16h8"
31
+ ],
32
+ "href": "../../Transactions/V7/Create/index.html"
33
+ },
34
+ {
35
+ "text": "FromTally",
36
+ "id": "ImportHtmlId",
37
+ "icon": [
38
+ "M4 6h16",
39
+ "M4 10h16",
40
+ "M4 14h10",
41
+ "M6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"
42
+ ]
43
+ }
44
+ ]
45
+ }
@@ -0,0 +1,48 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+
4
+ <head>
5
+ <meta charset="UTF-8">
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
7
+ <title>KeshavSoft</title>
8
+
9
+ <!-- Tailwind CDN -->
10
+ <!-- <script src="https://cdn.tailwindcss.com"></script> -->
11
+ <script src="./tailwindcss-3.4.17.css"></script>
12
+ <!-- Heroicons (SVG inline, no extra CDN needed) -->
13
+
14
+ <style>
15
+ mark {
16
+ background-color: yellow;
17
+ color: black;
18
+ }
19
+ </style>
20
+ </head>
21
+
22
+ <body class="bg-gray-100 flex flex-col min-h-screen">
23
+
24
+ <main class="flex-grow">
25
+
26
+ <div id="header"></div>
27
+
28
+ <section class="mx-auto px-3 py-6
29
+ max-w-3xl
30
+ lg:max-w-5xl
31
+ xl:max-w-6xl">
32
+
33
+ <div id="kSTableContainer"></div>
34
+
35
+ </section>
36
+
37
+ </main>
38
+
39
+ <footer class="bg-gray-200 text-gray-700 text-center py-4">
40
+ <div class="max-w-6xl mx-auto px-4">
41
+ © 2026 KeshavSoft • Contact
42
+ </div>
43
+ </footer>
44
+
45
+ <script type="module" src="./Index/start.js"></script>
46
+ </body>
47
+
48
+ </html>