adminforth 1.1.47 → 1.1.49

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.
@@ -15,9 +15,8 @@ import fsExtra from 'fs-extra';
15
15
  import os from 'os';
16
16
  import path from 'path';
17
17
  import { promisify } from 'util';
18
- import { ADMIN_FORTH_ABSOLUTE_PATH } from './utils.js';
19
- import { getComponentNameFromPath } from './utils.js';
20
- import { styles } from './styles.js';
18
+ import { ADMIN_FORTH_ABSOLUTE_PATH, getComponentNameFromPath } from './utils.js';
19
+ import { StylesGenerator } from './styleGenerator.js';
21
20
  let TMP_DIR;
22
21
  try {
23
22
  TMP_DIR = os.tmpdir();
@@ -87,7 +86,7 @@ class CodeInjector {
87
86
  }
88
87
  prepareSources(_a) {
89
88
  return __awaiter(this, arguments, void 0, function* ({ filesUpdated, verbose = false }) {
90
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
89
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
91
90
  // check SPA_TMP_PATH exists and create if not
92
91
  try {
93
92
  yield fs.promises.access(CodeInjector.SPA_TMP_PATH, fs.constants.F_OK);
@@ -299,21 +298,13 @@ class CodeInjector {
299
298
  appVueContent = appVueContent.replace('/* IMPORTANT:ADMINFORTH CUSTOM USES */', 'addCustomUses(app);');
300
299
  }
301
300
  yield fs.promises.writeFile(appVuePath, appVueContent);
302
- // generate tailwind extend styles
303
- if ((_g = this.adminforth.config) === null || _g === void 0 ? void 0 : _g.styles) {
304
- const tailwindStyles = (_h = this.adminforth.config) === null || _h === void 0 ? void 0 : _h.styles;
305
- const stylesText = JSON.stringify(tailwindStyles, null, 2).slice(1, -1);
306
- let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
307
- let tailwindConfigContent = yield fs.promises.readFile(tailwindConfigPath, 'utf-8');
308
- tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */', stylesText);
309
- yield fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
310
- }
311
- else {
312
- let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
313
- let tailwindConfigContent = yield fs.promises.readFile(tailwindConfigPath, 'utf-8');
314
- tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */', styles());
315
- yield fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
316
- }
301
+ // generate tailwind extend styles
302
+ const stylesGenerator = new StylesGenerator((_g = this.adminforth.config.customization) === null || _g === void 0 ? void 0 : _g.styles);
303
+ const stylesText = JSON.stringify(stylesGenerator.mergeStyles(), null, 2).slice(1, -1);
304
+ let tailwindConfigPath = path.join(CodeInjector.SPA_TMP_PATH, 'tailwind.config.js');
305
+ let tailwindConfigContent = yield fs.promises.readFile(tailwindConfigPath, 'utf-8');
306
+ tailwindConfigContent = tailwindConfigContent.replace('/* IMPORTANT:ADMINFORTH TAILWIND STYLES */', stylesText);
307
+ yield fs.promises.writeFile(tailwindConfigPath, tailwindConfigContent);
317
308
  const routerVuePath = path.join(CodeInjector.SPA_TMP_PATH, 'src', 'router', 'index.ts');
318
309
  let routerVueContent = yield fs.promises.readFile(routerVuePath, 'utf-8');
319
310
  routerVueContent = routerVueContent.replace('/* IMPORTANT:ADMINFORTH ROUTES IMPORTS */', routerComponents);
@@ -321,17 +312,17 @@ class CodeInjector {
321
312
  const indexHtmlPath = path.join(CodeInjector.SPA_TMP_PATH, 'index.html');
322
313
  let indexHtmlContent = yield fs.promises.readFile(indexHtmlPath, 'utf-8');
323
314
  indexHtmlContent = indexHtmlContent.replace('/* IMPORTANT:ADMINFORTH TITLE */', `${this.adminforth.config.customization.title || 'AdminForth'}`);
324
- indexHtmlContent = indexHtmlContent.replace('/* IMPORTANT:ADMINFORTH FAVICON */', ((_j = this.adminforth.config.customization.favicon) === null || _j === void 0 ? void 0 : _j.replace('@@/', `${this.adminforth.baseUrlSlashed}assets/`))
315
+ indexHtmlContent = indexHtmlContent.replace('/* IMPORTANT:ADMINFORTH FAVICON */', ((_h = this.adminforth.config.customization.favicon) === null || _h === void 0 ? void 0 : _h.replace('@@/', `${this.adminforth.baseUrlSlashed}assets/`))
325
316
  ||
326
317
  `${this.adminforth.baseUrlSlashed}assets/favicon.png`);
327
318
  yield fs.promises.writeFile(indexHtmlPath, indexHtmlContent);
328
319
  /* generate custom routes */
329
320
  const homepageMenuItem = this.adminforth.config.menu.find((mi) => mi.homepage);
330
321
  let childrenHomePageMenuItem = this.adminforth.config.menu.find((mi) => { var _a; return mi.children && ((_a = mi.children) === null || _a === void 0 ? void 0 : _a.find((mi) => mi.homepage)); });
331
- let childrenHomepage = (_k = childrenHomePageMenuItem === null || childrenHomePageMenuItem === void 0 ? void 0 : childrenHomePageMenuItem.children) === null || _k === void 0 ? void 0 : _k.find((mi) => mi.homepage);
322
+ let childrenHomepage = (_j = childrenHomePageMenuItem === null || childrenHomePageMenuItem === void 0 ? void 0 : childrenHomePageMenuItem.children) === null || _j === void 0 ? void 0 : _j.find((mi) => mi.homepage);
332
323
  let homePagePath = (homepageMenuItem === null || homepageMenuItem === void 0 ? void 0 : homepageMenuItem.path) || `/resource/${childrenHomepage === null || childrenHomepage === void 0 ? void 0 : childrenHomepage.resourceId}`;
333
324
  if (!homePagePath) {
334
- homePagePath = ((_l = this.adminforth.config.menu.filter((mi) => mi.path)[0]) === null || _l === void 0 ? void 0 : _l.path) || `/resource/${(_m = this.adminforth.config.menu.filter((mi) => mi.children)[0]) === null || _m === void 0 ? void 0 : _m.resourceId}`;
325
+ homePagePath = ((_k = this.adminforth.config.menu.filter((mi) => mi.path)[0]) === null || _k === void 0 ? void 0 : _k.path) || `/resource/${(_l = this.adminforth.config.menu.filter((mi) => mi.children)[0]) === null || _l === void 0 ? void 0 : _l.resourceId}`;
335
326
  }
336
327
  routes += `{
337
328
  path: '/',
@@ -0,0 +1,39 @@
1
+ import { transformObject, deepMerge } from "./utils.js";
2
+ import { styles } from "./styles.js";
3
+ const aliasObject = { lightSidebarText: 'lightSidebarIcons', darkSidebarText: 'darkSidebarIcons', lightSidebarTextHover: 'lightSidebarIconsHover', darkSidebarTextHover: 'darkSidebarIconsHover' };
4
+ export class StylesGenerator {
5
+ constructor(styleConfig) {
6
+ if (!styleConfig) {
7
+ console.log("No styles provided using default styles.");
8
+ }
9
+ this.styleConfig = styleConfig;
10
+ this.defaultStyles = styles();
11
+ }
12
+ generatePlainStyles(styleObj) {
13
+ let plainCustomStyles = {};
14
+ if (styleObj) {
15
+ Object.keys(styleObj).forEach((k) => {
16
+ plainCustomStyles[k] = transformObject(styleObj[k]);
17
+ });
18
+ }
19
+ return plainCustomStyles;
20
+ }
21
+ changeAliases(plateStyles) {
22
+ if (!plateStyles || !plateStyles.colors) {
23
+ return plateStyles;
24
+ }
25
+ let colors = plateStyles.colors;
26
+ Object.keys(aliasObject).forEach((aliasName) => {
27
+ if (colors[aliasObject[aliasName]])
28
+ return;
29
+ if (!colors[aliasName])
30
+ return;
31
+ colors[aliasObject[aliasName]] = colors[aliasName];
32
+ });
33
+ return plateStyles;
34
+ }
35
+ mergeStyles() {
36
+ let mergedStyles = deepMerge(this.defaultStyles, this.changeAliases(this.generatePlainStyles(this.styleConfig)));
37
+ return mergedStyles;
38
+ }
39
+ }
@@ -1,53 +1,84 @@
1
- export const styles = () => `
2
-
3
- "colors": {
4
- "html-bg": "#FFFFFF", // Changed to white
5
- "header-bg": "#FFFFFF", // Light grey
6
- "header-bg-hover": "#D3D3D3", // Light grey hover
7
- "header-text": "#333333", // Dark grey text
8
- "header-text-hover": "#333333", // Dark grey text hover
9
- "header-icons": "#333333", // Dark grey icons
10
- "header-icons-hover": "#333333", // Dark grey icons hover
11
- "header-logo-color": "#333333", // Dark grey logo
12
- "header-border-color": "rgb(229 231 235)", // Light grey border
13
-
14
- "nav-menu-bg": "#ffffff", // Very light grey
15
- "nav-menu-border": "rgb(229 231 235)",
16
- "nav-menu-bg-hover": "rgb(243 244 246)", // Light grey hover
17
- "nav-menu-bg-active": "rgb(233, 234, 236)", // Light grey active
18
- "nav-menu-hover": "#rgb(209 213 219)", // Light grey hover
19
- "nav-menu-active": "#CCCCCC", // Light grey active
20
- "nav-menu-active-text": "#333333", // Dark grey active text
21
- "nav-menu-text": "#333333", // Dark grey text
22
- "nav-menu-text-hover": "#333333", // Dark grey text hover
23
- "nav-menu-text-active": "#333333", // Dark grey text active
24
- "nav-menu-devider": "#E0E0E0", // Light grey divider
25
- "nav-menu-icons": "#333333", // Dark grey icons
26
- "nav-menu-heading": "#333333", // Dark grey heading
27
-
28
- "list-view-bg": "#FFFFFF", // White background
29
- "list-view-table-bg": "#FFFFFF", // White table background
30
- "list-view-table-heading": "rgb(249 250 251)", // Very light grey heading
31
- "list-view-table-heading-text": "#333333", // Dark grey heading text
32
- "list-view-table-text": "#333333", // Dark grey text
33
- "list-view-table-row-hover": "rgb(249 250 251)", // Very light grey row hover
34
- "list-view-bread-crumbs-text": "#666666", // Medium grey bread crumbs
35
- "list-view-border-color": "#DDDDDD", // Light grey border
36
-
37
- "form-view-bg": "#FFFFFF", // White form background
38
- "form-view-border-color": "#F5F5F5", // Very light grey border
39
- "form-view-heading": "#EDEDED" // Dark grey heading
40
- },
41
- "boxShadow": {
42
- "custom-light": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
43
- "header-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
44
- "list-table-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
45
- "resourse-form-shadow": "0 4px 8px rgba(0, 0, 0, 0.1)" // Lighter shadow
46
- },
47
- "fontSize": {
48
- "header-text-size": "1rem"
49
- },
50
- "borderRadius": {
51
- "default": "2px"
52
- }
53
- `;
1
+ export const styles = () => ({
2
+ colors: {
3
+ lightHtml: "#FFFFFF", // main background
4
+ lightNavbar: "#FFFFFF", // navbar background
5
+ lightNavbarHover: "#D3D3D3", // in development
6
+ lightNavbarText: "#333333", // in development
7
+ lightNavbarTextHover: "#333333", // in development
8
+ lightNavbarIcons: "#333333", // in development
9
+ lightNavbarIconsHover: "#333333", // in development
10
+ lightNavbarLogo: "#333333", // in development
11
+ lightNavbarBorder: "rgb(229 231 235)", // border
12
+ lightSidebar: "#ffffff", // sidebar background
13
+ lightSidebarBorder: "rgb(229 231 235)", // sidebar right border
14
+ lightSidebarHover: "rgb(243 244 246)", // in development
15
+ lightSidebarActive: "rgb(233, 234, 236)", // in development
16
+ lightSidebarItemHover: "rgb(243 244 246)", // sidebar list item hover
17
+ lightSidebarItemActive: "rgb(233, 234, 236)", // sidebar list item active
18
+ lightSidebarText: "#4b5563", // sidebar list item text
19
+ lightSidebarTextHover: "#333333", // sidebar list item text hover
20
+ lightSidebarTextActive: "#333333", // sidebar list item text active
21
+ lightSidebarDevider: "#E0E0E0", // sidebar devider
22
+ lightSidebarIcons: "#6b7280", // sidebar list item icons
23
+ lightSidebarIconsHover: "#333333", // sidebar list item icons hover
24
+ lightSidebarHeading: "#333333", // sidebar heading
25
+ lightList: "#FFFFFF", // list view background
26
+ lightListTable: "#FFFFFF", // list view table background
27
+ lightListTableHeading: "rgb(249 250 251)", // list view table heading
28
+ lightListTableHeadingText: "#333333", // list view table heading text
29
+ lightListTableText: "#333333", // list view table text
30
+ lightListTableRowHover: "rgb(249 250 251)", // list view row hover
31
+ lightListBreadcrumbsText: "#666666", // list view breadcrumbs text
32
+ lightListBorder: "#DDDDDD", // list view rows border
33
+ lightForm: "#FFFFFF", // show view background
34
+ lightFormBorder: "#F5F5F5", // show view rows border
35
+ lightFormHeading: "#EDEDED", // show view heading
36
+ // colors for dark theme
37
+ darkHtml: "#111827",
38
+ darkNavbar: "#111827",
39
+ darkNavbarHover: "#444444",
40
+ darkNavbarText: "#FFFFFF",
41
+ darkNavbarTextHover: "#FFFFFF",
42
+ darkNavbarIcons: "#FFFFFF",
43
+ darkNavbarIconsHover: "#FFFFFF",
44
+ darkNavbarLogo: "#FFFFFF",
45
+ darkNavbarBorder: "#e5e7eb",
46
+ darkSidebar: "#1f2937",
47
+ darkSidebarBorder: "#374151",
48
+ darkSidebarHover: "#374151",
49
+ darkSidebarActive: "#444444",
50
+ darkSidebarItemHover: "#374151",
51
+ darkSidebarItemActive: "#52525b",
52
+ darkSidebarItemActiveText: "#FFFFFF",
53
+ darkSidebarText: "#9ca3af",
54
+ darkSidebarTextHover: "#FFFFFF",
55
+ darkSidebarTextActive: "#FFFFFF",
56
+ darkSidebarDevider: "#374151",
57
+ darkSidebarIcons: "#9ca3af",
58
+ darkSidebarIconsHover: "#FFFFFF",
59
+ darkSidebarHeading: "#FFFFFF",
60
+ darkList: "#111111",
61
+ darkListTable: "#1f2937",
62
+ darkListTableHeading: "#334155",
63
+ darkListTableHeadingText: "#9ca3af",
64
+ darkListTableText: "#9ca3af",
65
+ darkListTableRowHover: "#4b5563",
66
+ darkListBreadcrumbsText: "#BBBBBB",
67
+ darkListBorder: "#444444",
68
+ darkForm: "#111111",
69
+ darkFormBorder: "#222222",
70
+ darkFormHeading: "#333333"
71
+ },
72
+ boxShadow: {
73
+ customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
74
+ headerShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
75
+ listTableShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
76
+ resourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.1)" // Lighter shadow
77
+ },
78
+ fontSize: {
79
+ "headerText-size": "1rem"
80
+ },
81
+ borderRadius: {
82
+ "default": "2px"
83
+ }
84
+ });
@@ -31,3 +31,47 @@ export function getComponentNameFromPath(filePath) {
31
31
  export function listify(param) {
32
32
  return param || [];
33
33
  }
34
+ export function deepMerge(target, source) {
35
+ if (typeof target !== 'object' || target === null) {
36
+ return source;
37
+ }
38
+ for (let key in source) {
39
+ if (source.hasOwnProperty(key)) {
40
+ if (typeof source[key] === 'object' && source[key] !== null) {
41
+ if (!target[key]) {
42
+ target[key] = {};
43
+ }
44
+ deepMerge(target[key], source[key]);
45
+ }
46
+ else {
47
+ target[key] = source[key];
48
+ }
49
+ }
50
+ }
51
+ return target;
52
+ }
53
+ function toCamelCase(str) {
54
+ return str.replace(/[-_](.)/g, (_, char) => char.toUpperCase());
55
+ }
56
+ export function transformObject(obj, parentKey = '', result = {}) {
57
+ for (const key in obj) {
58
+ if (obj.hasOwnProperty(key)) {
59
+ const camelCaseKey = toCamelCase(parentKey ? `${parentKey}_${key}` : key);
60
+ if (typeof obj[key] === 'object' && !Array.isArray(obj[key])) {
61
+ transformObject(obj[key], camelCaseKey, result);
62
+ }
63
+ else {
64
+ result[camelCaseKey] = obj[key];
65
+ }
66
+ }
67
+ }
68
+ //remove 'Default' from keys
69
+ for (const key in result) {
70
+ if (key.includes('Main')) {
71
+ const newKey = key.replace('Main', '');
72
+ result[newKey] = result[key];
73
+ delete result[key];
74
+ }
75
+ }
76
+ return result;
77
+ }
@@ -17,7 +17,7 @@
17
17
 
18
18
  </head>
19
19
  <body class=" ">
20
- <div id="app" class="min-h-screen bg-html-bg dark:bg-gray-800"></div>
20
+ <div id="app" class="min-h-screen bg-lightHtml dark:bg-darkHtml"></div>
21
21
  <script type="module" src="/src/main.ts"></script>
22
22
  </body>
23
23
  </html>
@@ -1,12 +1,12 @@
1
1
  <template>
2
2
  <nav
3
3
  v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady"
4
- class="fixed h-14 top-0 z-20 w-full border-b shadow-sm bg-header-bg shadow-header-shadow dark:bg-header-bg-hover dark:border-nav-menu-devider">
4
+ class="fixed h-14 top-0 z-20 w-full border-b shadow-sm bg-lightNavbar shadow-headerShadow dark:bg-darkNavbar dark:border-darkSidebarDevider">
5
5
  <div class="px-3 py-3 lg:px-5 lg:pl-3">
6
6
  <div class="flex items-center justify-between">
7
7
  <div class="flex items-center justify-start rtl:justify-end">
8
8
  <button @click="sideBarOpen = !sideBarOpen"
9
- type="button" class="inline-flex items-center p-2 text-sm rounded-lg sm:hidden hover:bg-nav-menu-bg-hover focus:outline-none focus:ring-2 focus:ring-nav-menu-devider dark:text-nav-menu-icons dark:hover:bg-nav-menu-bg-hover dark:focus:ring-nav-menu-devider">
9
+ type="button" class="inline-flex items-center p-2 text-sm rounded-lg sm:hidden hover:bg-lightSidebarItemHover focus:outline-none focus:ring-2 focus:ring-lightSidebarDevider dark:text-darkSidebarIcons dark:hover:bg-darkSidebarHover dark:focus:ring-lightSidebarDevider">
10
10
  <span class="sr-only">Open sidebar</span>
11
11
  <svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
12
12
  <path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
@@ -17,25 +17,25 @@
17
17
  <div class="flex items-center">
18
18
  <div class="flex items-center ms-3 ">
19
19
  <div>
20
- <button type="button" class="flex text-sm bg-header-bg-hover rounded-full focus:ring-4 focus:ring-nav-menu-devider dark:focus:ring-nav-menu-devider dark:bg-header-bg-hover" aria-expanded="false" data-dropdown-toggle="dropdown-user">
20
+ <button type="button" class="flex text-sm bg- rounded-full focus:ring-4 focus:ring-lightSidebarDevider dark:focus:ring-darkSidebarDevider dark:bg-" aria-expanded="false" data-dropdown-toggle="dropdown-user">
21
21
  <span class="sr-only">Open user menu</span>
22
- <svg class="w-8 h-8 text-nav-menu-icons dark:text-header-icons" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
22
+ <svg class="w-8 h-8 text-lightSidebarIcons dark:text-darkSidebarIcons" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
23
23
  <path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
24
24
  </svg>
25
25
  </button>
26
26
  </div>
27
- <div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:shadow-black dark:bg-nav-menu-bg dark:divide-nav-menu-devider dark:shadow-black" id="dropdown-user">
27
+ <div class="z-50 hidden my-4 text-base list-none bg-white divide-y divide-gray-100 rounded shadow dark:shadow-black dark:bg-darkSidebar dark:divide-darkSidebarDevider dark:shadow-black" id="dropdown-user">
28
28
  <div class="px-4 py-3" role="none">
29
- <p class="text-sm text-gray-900 dark:text-header-text" role="none" v-if="coreStore.userFullname">
29
+ <p class="text-sm text-gray-900 dark:text-darkNavbarText" role="none" v-if="coreStore.userFullname">
30
30
  {{ coreStore.userFullname }}
31
31
  </p>
32
- <p class="text-sm font-medium text-gray-900 truncate dark:text-nav-menu-text" role="none">
32
+ <p class="text-sm font-medium text-gray-900 truncate dark:text-darkSidebarText" role="none">
33
33
  {{ coreStore.username }}
34
34
  </p>
35
35
  </div>
36
36
  <ul class="py-1" role="none">
37
37
  <li>
38
- <span @click="toggleTheme" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html-bg dark:text-nav-menu-text-hover dark:hover:bg-nav-menu-hover dark:hover:text-nav-menu-text-active" role="menuitem">
38
+ <span @click="toggleTheme" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-lightHtml dark:text-darkSidebarTextHover dark:hover:bg-darkHtml dark:hover:text-darkSidebarTextActive" role="menuitem">
39
39
  {{ theme === 'dark' ? 'Light' : 'Dark' }}
40
40
  <IconMoonSolid class="w-5 h-5 text-blue-300" v-if="theme !== 'dark'" />
41
41
  <IconSunSolid class="w-5 h-5 text-yellow-300" v-else />
@@ -43,7 +43,7 @@
43
43
  </span>
44
44
  </li>
45
45
  <li>
46
- <button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html-bg dark:text-nav-menu-text-hover dark:hover:bg-nav-menu-hover dark:hover:text-nav-menu-text-active w-full" role="menuitem">Sign out</button>
46
+ <button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html dark:text-darkSidebarTextHover dark:hover:bg-darkSidebarItemHover dark:hover:text-darkSidebarTextActive w-full" role="menuitem">Sign out</button>
47
47
  </li>
48
48
  </ul>
49
49
  </div>
@@ -59,30 +59,30 @@
59
59
 
60
60
  v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady"
61
61
 
62
- id="logo-sidebar" class="fixed border-none top-0 left-0 z-20 w-64 h-screen transition-transform bg-nav-menu-bg border-r border-nav-menu-border sm:translate-x-0 dark:bg-gray-800 dark:border-gray-700"
62
+ id="logo-lightSidebar" class="fixed bg-lightSidebar border-none top-0 left-0 z-20 w-64 h-screen transition-transform bg-lightSidebar dark:bg-darkSidebar border-r border-lightSidebarBorder sm:translate-x-0 dark:bg-darkSidebar dark:border-darkSidebarBorder"
63
63
  :class="{ '-translate-x-full': !sideBarOpen, 'transform-none': sideBarOpen }"
64
64
  aria-label="Sidebar"
65
65
  >
66
- <div class="h-full px-3 pb-4 overflow-y-auto bg-nav-menu-bg dark:bg-gray-800 border-r">
66
+ <div class="h-full px-3 pb-4 overflow-y-auto bg-lightSidebar dark:bg-darkSidebar border-r dark:border-darkSidebarBorder">
67
67
  <div class="flex ms-2 md:me-24 m-4 ">
68
68
  <img :src="loadFile(coreStore.config?.brandLogo || '@/assets/logo.svg')" :alt="`${ coreStore.config?.brandName } Logo`" class="h-8 me-3" />
69
- <span class="self-center text-header-text-size font-semibold sm:text-header-text-size whitespace-nowrap dark:text-header-text text-header-logo-color">
69
+ <span class="self-center text-lightNavbarText-size font-semibold sm:text-lightNavbarText-size whitespace-nowrap dark:text-darkNavbarText text-lightNavbarLogo">
70
70
  {{ coreStore.config?.brandName }}
71
71
  </span>
72
72
  </div>
73
73
 
74
74
  <ul class="space-y-2 font-medium">
75
75
  <template v-for="(item, i) in coreStore.menu" :key="`menu-${i}`">
76
- <div v-if="item.type === 'divider'" class="border-t border-nav-menu-devider dark:border-gray-700"></div>
76
+ <div v-if="item.type === 'divider'" class="border-t border-lightSidebarDevider dark:border-darkSidebarDevider"></div>
77
77
  <div v-else-if="item.type === 'gap'" class="flex items-center justify-center h-8"></div>
78
78
  <div v-else-if="item.type === 'heading'" class="flex items-center justify-left pl-2 h-8 text-gray-400 dark:text-gray-400
79
79
  ">{{ item.label }}</div>
80
- <li v-else-if="item.children">
81
- <button @click="clickOnMenuItem(i)" type="button" class="flex items-center w-full p-2 text-base text-nav-menu-text rounded-default transition duration-75 group hover:bg-nav-menu-bg-hover dark:text-white dark:hover:bg-gray-700"
80
+ <li v-else-if="item.children" class=" ">
81
+ <button @click="clickOnMenuItem(i)" type="button" class="flex items-center w-full p-2 text-base text-lightSidebarText rounded-default transition duration-75 group hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:text-darkSidebarText dark:hover:bg-darkSidebarHover dark:hover:text-darkSidebarTextHover"
82
82
  :aria-controls="`dropdown-example${i}`"
83
83
  :data-collapse-toggle="`dropdown-example${i}`"
84
84
  >
85
- <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 dark:group-hover:text-white" ></component>
85
+ <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons group-hover:text-lightSidebarIconsHover transition duration-75 dark:group-hover:text-darkSidebarIconsHover dark:text-darkSidebarIcons" ></component>
86
86
 
87
87
  <span class="flex-1 ms-3 text-left rtl:text-right whitespace-nowrap">{{ item.label }}</span>
88
88
  <svg :class="{'rotate-180': opened.includes(i) }" class="w-3 h-3" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
@@ -1,16 +1,16 @@
1
1
  <template>
2
2
  <RouterLink
3
3
  :to="{name: item.resourceId ? 'resource-list' : item.path, params: item.resourceId ? { resourceId: item.resourceId }: {}}"
4
- class="flex items-center py-2 text-nav-menu-text rounded-default hover:bg-nav-menu-bg-hover active:bg-nav-menu-bg-active" role="menuitem"
4
+ class="flex group items-center py-2 text-lightSidebarText dark:text-darkSidebarText rounded-default hover:bg-lightSidebarItemHover hover:text-lightSidebarTextHover dark:hover:bg-darkSidebarHover dark:hover:text-darkSidebarTextHover active:bg-lightSidebarActive dark:active:bg-darkSidebarHover" role="menuitem"
5
5
  :class="{
6
6
  'px-4': isChild,
7
7
  'px-2': !isChild,
8
- 'bg-nav-menu-bg-active dark:bg-gray-700': item.resourceId ?
8
+ 'bg-sidebarActive dark:bg-gray-700': item.resourceId ?
9
9
  ($route.params.resourceId === item.resourceId && $route.name === 'resource-list') :
10
10
  ($route.name === item.path)
11
11
  }"
12
12
  >
13
- <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-gray-500 transition duration-75 dark:text-gray-400 group-hover:text-gray-900 dark:group-hover:text-white" ></component>
13
+ <component v-if="item.icon" :is="getIcon(item.icon)" class="w-5 h-5 text-lightSidebarIcons dark:text-darkSidebarIcons transition duration-75 group-hover:text-lightSidebarIconsHover dark:group-hover:text-darkSidebarIconsHover" ></component>
14
14
  <span class="ms-3">{{ item.label }}</span>
15
15
  </RouterLink>
16
16
  </template>
@@ -2,11 +2,11 @@
2
2
  <div class="rounded-default">
3
3
 
4
4
  <div
5
- class="relative shadow-resourse-form-shadow sm:rounded-lg dark:shadow-2xl dark:shadow-black rounded-default"
5
+ class="relative shadow-resourseFormShadow sm:rounded-lg dark:shadow-2xl dark:shadow-black rounded-default"
6
6
  >
7
7
  <form autocomplete="off" @submit.prevent>
8
8
  <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 ">
9
- <thead class="text-xs text-gray-700 uppercase bg-form-view-heading dark:bg-gray-700 dark:text-gray-400">
9
+ <thead class="text-xs text-gray-700 uppercase bg-lightormHeading dark:bg-gray-700 dark:text-gray-400">
10
10
  <tr>
11
11
  <th scope="col" class="px-6 py-3">
12
12
  Field
@@ -18,7 +18,7 @@
18
18
  </thead>
19
19
  <tbody>
20
20
  <tr v-for="column, i in editableColumns" :key="column.name"
21
- class="bg-form-view-bg dark:bg-gray-800 border-b dark:border-gray-700"
21
+ class="bg-ligftForm dark:bg-gray-800 border-b dark:border-gray-700"
22
22
  >
23
23
  <!-- if column is in customComponentsPerColumn, use this component. If not, use this code -->
24
24
  <template v-if="column?.components?.[props.source].file">
@@ -1,30 +1,15 @@
1
1
  <template>
2
2
  <!-- table -->
3
- <div class="relative overflow-x-auto shadow-list-table-shadow dark:shadow-black overflow-y-hidden rounded-default">
3
+ <div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-black overflow-y-hidden rounded-default">
4
4
 
5
5
  <!-- skelet loader -->
6
6
  <div role="status" v-if="!resource || !resource.columns"
7
7
  class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded shadow animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
8
- <div class="flex items-center justify-between h-16">
9
- <div>
10
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
11
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
12
- </div>
13
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
14
- </div>
15
-
16
- <div class="flex items-center justify-between h-16 pt-4" v-for="i in new Array(10)">
17
- <div>
18
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
19
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
20
- </div>
21
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
22
- </div>
23
- <span class="sr-only">Loading...</span>
8
+
24
9
  </div>
25
10
 
26
11
  <table v-else class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
27
- <thead class="text-xs text-view-table-heading-text bg-list-view-table-heading dark:bg-gray-700 dark:text-gray-400">
12
+ <thead class="text-xs text-view-table-heading-text bg-lightListTableHeading dark:bg-darkListTableHeading dark:text-gray-400">
28
13
  <tr>
29
14
  <th scope="col" class="p-4">
30
15
  <div v-if="rows && rows.length" class="flex items-center">
@@ -69,51 +54,8 @@
69
54
  </tr>
70
55
  </thead>
71
56
  <tbody>
72
- <tr v-if="!rows" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
73
- <td :colspan="resource?.columns.length + 2">
74
-
75
- <div role="status"
76
- class="max-w p-4 space-y-4 divide-y divide-gray-200 rounded animate-pulse dark:divide-gray-700 md:p-6 dark:border-gray-700">
77
- <div class="flex items-center justify-between">
78
- <div>
79
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
80
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
81
- </div>
82
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
83
- </div>
84
- <div class="flex items-center justify-between pt-4">
85
- <div>
86
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
87
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
88
- </div>
89
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
90
- </div>
91
- <div class="flex items-center justify-between pt-4">
92
- <div>
93
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
94
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
95
- </div>
96
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
97
- </div>
98
- <div class="flex items-center justify-between pt-4">
99
- <div>
100
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
101
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
102
- </div>
103
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
104
- </div>
105
- <div class="flex items-center justify-between pt-4">
106
- <div>
107
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-600 w-24 mb-2.5"></div>
108
- <div class="w-32 h-2 bg-gray-200 rounded-full dark:bg-gray-700"></div>
109
- </div>
110
- <div class="h-2.5 bg-gray-300 rounded-full dark:bg-gray-700 w-12"></div>
111
- </div>
112
- <span class="sr-only">Loading...</span>
113
- </div>
114
- </td>
115
- </tr>
116
- <tr v-else-if="rows.length === 0" class="bg-list-view-table-bg border-b dark:bg-gray-800 dark:border-gray-700">
57
+ <SkeleteLoader v-if="!rows?.length" :columns="10" :rows="10"/>
58
+ <tr v-else-if="rows.length === 0" class="bg-lightListTable border-b dark:bg-darkListTable dark:border-darkListTableBorder">
117
59
  <td :colspan="resource?.columns.length + 2">
118
60
 
119
61
  <div id="toast-simple"
@@ -127,7 +69,7 @@
127
69
  </tr>
128
70
 
129
71
  <tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
130
- class="bg-list-view-table-bg border-b dark:bg-gray-800 border-list-view-border-color dark:border-gray-700 hover:bg-list-view-table-row-hover dark:hover:bg-gray-600 cursor-pointer">
72
+ class="bg-lightListTable border-b dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover cursor-pointer">
131
73
  <td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
132
74
  <div class="flex items center ">
133
75
  <input
@@ -287,6 +229,7 @@ import ValueRenderer from '@/components/ValueRenderer.vue';
287
229
  import { getCustomComponent } from '@/utils';
288
230
  import { useCoreStore } from '@/stores/core';
289
231
  import { showSuccesTost } from '@/composables/useFrontendApi';
232
+ import SkeleteLoader from '@/components/SkeleteLoader.vue';
290
233
 
291
234
  import {
292
235
  IconInboxOutline,
@@ -0,0 +1,23 @@
1
+ <template>
2
+ <tr v-for="c in new Array(props.columns)" class="bg-lightListTable border-b dark:bg-darkListTable dark:border-darkListBorder">
3
+ <td v-for="r in new Array(props.rows)" class="items-center px-6 py-20 cursor-default" >
4
+ <div role="status" class="max-w-sm animate-pulse">
5
+ <div class="h-2 bg-gray-200 rounded-full dark:bg-gray-700 max-w-[360px]"></div>
6
+ </div>
7
+ </td>
8
+ </tr>
9
+ </template>
10
+
11
+ <script setup>
12
+
13
+ const props = defineProps({
14
+ columns:Number,
15
+ rows:Number
16
+ });
17
+
18
+
19
+ </script>
20
+
21
+ <style lang="scss" scoped>
22
+
23
+ </style>
@@ -22,7 +22,7 @@
22
22
  v-if="checkboxes.length"
23
23
  data-tooltip-target="tooltip-remove-all"
24
24
  data-tooltip-placement="bottom"
25
- class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
25
+ class="flex gap-1 items-center py-1 px-3 me-2 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded border border-gray-300 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-darkListTable dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700 rounded-default"
26
26
  >
27
27
  <IconBanOutline class="w-5 h-5 "/>
28
28
 
@@ -44,10 +44,10 @@
44
44
  </div>
45
45
  <div
46
46
  v-else
47
- class="relative overflow-x-auto shadow-resourse-form-shadow "
47
+ class="relative overflow-x-auto shadow-resourseFormShadow "
48
48
  >
49
49
  <table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 rounded-default">
50
- <thead class="text-xs text-gray-700 uppercase bg-form-view-heading dark:bg-gray-700 dark:text-gray-400">
50
+ <thead class="text-xs text-gray-700 uppercase bg-lightormHeading dark:bg-gray-700 dark:text-gray-400">
51
51
  <tr>
52
52
  <th scope="col" class="px-6 py-3">
53
53
  Field
@@ -59,7 +59,7 @@
59
59
  </thead>
60
60
  <tbody>
61
61
  <tr v-for="column in coreStore.resource?.columns.filter(c => c.showIn.includes('show'))" :key="column.name"
62
- class="bg-form-view-bg odd:dark:bg-gray-900 even:dark:bg-gray-800 border-b dark:border-gray-700"
62
+ class="bg-lightForm bg-darkForm odd:dark:bg-gray-900 even:dark:bg-gray-800 border-b dark:border-gray-700"
63
63
  >
64
64
  <component
65
65
  v-if="column.components?.showRow"