@simple-reporting/base 1.0.12 → 1.0.14
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/dev/package.json +15 -15
- package/dev/src/assets/scss/app.scss +1 -0
- package/dev/src/assets/scss/components/note/accordion.scss +108 -0
- package/dev/src/assets/scss/editor.scss +45 -0
- package/dev/src/assets/scss/general.scss +1 -0
- package/dev/src/components/BypassLinks.vue +3 -5
- package/dev/tsconfig.json +1 -1
- package/dev/vite.config.ts +1 -1
- package/livingdocs/040.Media/030.video/ld-conf.json +1 -1
- package/livingdocs/100.Misc/010.anchor/anchor.html +3 -6
- package/livingdocs/100.Misc/010.anchor/scss/editor.scss +1 -12
- package/livingdocs/110.PDF/010.pdf-pagebreak/pdf-pagebreak.html +2 -2
- package/livingdocs/110.PDF/010.pdf-pagebreak/scss/editor.scss +0 -8
- package/livingdocs/110.PDF/030.pdf-publication-title/pdf-publication-title.html +2 -5
- package/livingdocs/110.PDF/030.pdf-publication-title/scss/editor.scss +0 -11
- package/livingdocs/110.PDF/040.pdf-chapter-title/pdf-chapter-title.html +2 -5
- package/livingdocs/110.PDF/040.pdf-chapter-title/scss/editor.scss +0 -5
- package/package.json +7 -7
- package/plugins/viteSrlPlugin.js +270 -0
- package/scripts/prepare.d.ts +1 -1
- package/scripts/prepare.js +3 -58
- package/srl/components/Srl/Menu/Item/Content/Icon.vue +17 -1
- package/srl/components/Srl/Menu/Item/Content/IconAfter.vue +26 -3
- package/srl/components/Srl/Menu/Item/Content/IconBefore.vue +27 -3
- package/srl/components/Srl/Menu/Item/Content/Image.vue +13 -1
- package/srl/components/Srl/Menu/Item/Content/ImageAfter.vue +21 -2
- package/srl/components/Srl/Menu/Item/Content/ImageBefore.vue +21 -2
- package/srl/components/Srl/Menu/Item/Content/Text.vue +14 -3
- package/srl/components/Srl/Menu/Item/Content.vue +21 -2
- package/srl/components/Srl/Menu/Item.vue +124 -77
- package/srl/components/Srl/Menu/List.vue +97 -57
- package/srl/components/Srl/Note/Accordion/Content.vue +54 -3
- package/srl/components/Srl/Note/Accordion/Toggle.vue +14 -4
- package/srl/components/Srl/Note/Accordion.vue +30 -7
- package/srl/plugins/vueSrlPlugin.ts +4 -7
- package/srl/tsconfig.srl.json +89 -0
- package/srl/types/components.d.ts +3 -0
- package/srl/utils/html.ts +3 -3
- package/srl/utils/uri.ts +3 -1
- package/srl/plugins/viteSrlPlugin.ts +0 -224
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { fileURLToPath, URL } from 'node:url';
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
+
import { join, relative } from 'node:path/posix';
|
|
4
|
+
import { execSync } from 'node:child_process';
|
|
5
|
+
import folders from '../scripts/folders.js';
|
|
6
|
+
import { beaver } from '../scripts/beaver.js';
|
|
7
|
+
import { packageName } from '../scripts/config.js';
|
|
8
|
+
import prepare from '../scripts/prepare.js';
|
|
9
|
+
import { updatePackageJson, updateLivingDocsJson, updateNsWowJson } from '../scripts/utils.js';
|
|
10
|
+
import {
|
|
11
|
+
map,
|
|
12
|
+
mapLdd,
|
|
13
|
+
mapJs,
|
|
14
|
+
mapScss,
|
|
15
|
+
} from '../scripts/build.js';
|
|
16
|
+
import chalk from 'chalk';
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Output prompts message in a box
|
|
21
|
+
*/
|
|
22
|
+
const msgBoxLength = 60;
|
|
23
|
+
function centerText(text) {
|
|
24
|
+
const padding = Math.max(0, (msgBoxLength - text.length) / 2);
|
|
25
|
+
return (
|
|
26
|
+
' '.repeat(Math.floor(padding)) + text + ' '.repeat(Math.ceil(padding))
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
function printPromptsMessage(messages) {
|
|
30
|
+
console.log('');
|
|
31
|
+
console.log(chalk.bgWhiteBright(centerText('')));
|
|
32
|
+
messages.forEach(m => {
|
|
33
|
+
console.log(chalk.bgWhiteBright.black.bold(centerText(m)));
|
|
34
|
+
})
|
|
35
|
+
console.log(chalk.bgWhiteBright(centerText('')));
|
|
36
|
+
console.log('');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
const data = {
|
|
41
|
+
version: null,
|
|
42
|
+
components:{}
|
|
43
|
+
};
|
|
44
|
+
const srlConfig = readConfigJson();
|
|
45
|
+
|
|
46
|
+
function readConfigJson() {
|
|
47
|
+
const configPath = join(folders.srlRoot, 'config.json');
|
|
48
|
+
if (existsSync(configPath)) {
|
|
49
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
50
|
+
return JSON.parse(content);
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function writeConfigJson(config) {
|
|
56
|
+
const configPath = join(folders.srlRoot, 'config.json');
|
|
57
|
+
writeFileSync(configPath, JSON.stringify(config, null, 2), 'utf-8');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function isVersionGreater(v1, v2) {
|
|
61
|
+
const a = v1.split('.').map(Number);
|
|
62
|
+
const b = v2.split('.').map(Number);
|
|
63
|
+
if (a[0] > b[0]) return false;
|
|
64
|
+
if (a[1] > b[1]) return false;
|
|
65
|
+
return a[2] > b[2];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getPackageVersion() {
|
|
69
|
+
try {
|
|
70
|
+
const pkgPath = join(folders.packagePath, 'package.json');
|
|
71
|
+
const pkg = JSON.parse(readFileSync(pkgPath, 'utf-8'));
|
|
72
|
+
return pkg.version || null;
|
|
73
|
+
} catch (e) {
|
|
74
|
+
return null;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function checkForUpdates() {
|
|
79
|
+
try {
|
|
80
|
+
if (!data.version) return;
|
|
81
|
+
|
|
82
|
+
const tag = `v${data.version.split('.')[0]}-lts`;
|
|
83
|
+
|
|
84
|
+
const latest = execSync(`npm view ${packageName}@${tag} version`)
|
|
85
|
+
.toString()
|
|
86
|
+
.trim();
|
|
87
|
+
|
|
88
|
+
if (isVersionGreater(latest, data.version)) {
|
|
89
|
+
printPromptsMessage([
|
|
90
|
+
'Attention !!!',
|
|
91
|
+
`New ${packageName} version available.`,
|
|
92
|
+
`Update: ${data.version} => ${latest}`,
|
|
93
|
+
`Run: npm update -S ${packageName}`,
|
|
94
|
+
])
|
|
95
|
+
}
|
|
96
|
+
} catch (e) {}
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function findVueFilesInSrl() {
|
|
100
|
+
const componentsPath = join(folders.srlSrc, 'components');
|
|
101
|
+
const baseDir = join(componentsPath, 'Srl');
|
|
102
|
+
const result = {};
|
|
103
|
+
|
|
104
|
+
function search(dir) {
|
|
105
|
+
for (const entry of readdirSync(dir)) {
|
|
106
|
+
const fullPath = join(dir, entry);
|
|
107
|
+
if (statSync(fullPath).isDirectory()) {
|
|
108
|
+
search(fullPath);
|
|
109
|
+
} else if (entry.endsWith('.vue')) {
|
|
110
|
+
const path = relative(componentsPath, fullPath);
|
|
111
|
+
const name = path.slice(0, -4)
|
|
112
|
+
.replaceAll('/', '')
|
|
113
|
+
.replaceAll('\\', '');
|
|
114
|
+
|
|
115
|
+
result[name] = `@/components/${path}`;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
if (existsSync(baseDir) && statSync(baseDir).isDirectory()) {
|
|
121
|
+
search(baseDir);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
async function startActions() {
|
|
128
|
+
data.version = getPackageVersion();
|
|
129
|
+
checkForUpdates();
|
|
130
|
+
data.components = findVueFilesInSrl();
|
|
131
|
+
if (!srlConfig || JSON.stringify(srlConfig) !== JSON.stringify(data)) {
|
|
132
|
+
writeConfigJson(data);
|
|
133
|
+
}
|
|
134
|
+
if (srlConfig && srlConfig.version !== data.version) {
|
|
135
|
+
await prepare();
|
|
136
|
+
printPromptsMessage([
|
|
137
|
+
'Srl version changed',
|
|
138
|
+
'Trigger srl prepare',
|
|
139
|
+
]);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
await beaver(0);
|
|
143
|
+
await map();
|
|
144
|
+
await mapJs();
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Timer to trigger live reload actions
|
|
150
|
+
*/
|
|
151
|
+
let timer = null;
|
|
152
|
+
function triggerAction(callback) {
|
|
153
|
+
!timer || clearTimeout(timer);
|
|
154
|
+
timer = setTimeout(async () => {
|
|
155
|
+
await callback();
|
|
156
|
+
}, 200);
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export default function viteSrlPlugin() {
|
|
160
|
+
return {
|
|
161
|
+
name: 'vite-srl-plugin',
|
|
162
|
+
config(config) {
|
|
163
|
+
|
|
164
|
+
startActions();
|
|
165
|
+
|
|
166
|
+
config.base = './';
|
|
167
|
+
|
|
168
|
+
config.resolve = config.resolve || {};
|
|
169
|
+
config.resolve.alias = config.resolve.alias || {};
|
|
170
|
+
config.resolve.alias['~'] = folders.root;
|
|
171
|
+
config.resolve.alias['@'] = folders.srlSrc;
|
|
172
|
+
config.resolve.alias['#components'] = folders.srlComponents;
|
|
173
|
+
config.resolve.alias['#composables'] = folders.srlComposables;
|
|
174
|
+
config.resolve.alias['#plugins'] = folders.srlPlugins;
|
|
175
|
+
config.resolve.alias['#types'] = folders.srlTypes;
|
|
176
|
+
config.resolve.alias['#utils'] = folders.srlUtils;
|
|
177
|
+
config.resolve.alias['#imports'] = folders.srlImports;
|
|
178
|
+
config.resolve.alias['#ld'] = folders.ld;
|
|
179
|
+
config.resolve.alias['assets'] = folders.srlAssets;
|
|
180
|
+
config.resolve.alias['srl'] = folders.srlSystem;
|
|
181
|
+
config.resolve.alias['vue'] = 'vue/dist/vue.esm-bundler.js';
|
|
182
|
+
},
|
|
183
|
+
async configureServer(server) {
|
|
184
|
+
const fontPath = join(folders.srlAssets, 'fonts');
|
|
185
|
+
|
|
186
|
+
server.watcher.on('change', async (path) => {
|
|
187
|
+
if (path.endsWith('/package.json')) {
|
|
188
|
+
await updatePackageJson();
|
|
189
|
+
}
|
|
190
|
+
if (path.endsWith('/livingdocs.config.json')) {
|
|
191
|
+
await updateLivingDocsJson();
|
|
192
|
+
}
|
|
193
|
+
if (path.endsWith('/srl.config.json')) {
|
|
194
|
+
await updateNsWowJson();
|
|
195
|
+
triggerAction(beaver);
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
server.watcher.on('add', (path) => {
|
|
200
|
+
if (
|
|
201
|
+
path.endsWith('/general.scss') ||
|
|
202
|
+
path.endsWith('/app.scss') ||
|
|
203
|
+
path.endsWith('/ldd.scss') ||
|
|
204
|
+
path.endsWith('/editor.scss') ||
|
|
205
|
+
path.endsWith('/pdf.scss') ||
|
|
206
|
+
path.endsWith('/word.scss') ||
|
|
207
|
+
path.endsWith('/xbrl.scss') ||
|
|
208
|
+
(
|
|
209
|
+
path.startsWith(fontPath) &&
|
|
210
|
+
path.endsWith('.scss')
|
|
211
|
+
)
|
|
212
|
+
) {
|
|
213
|
+
triggerAction(mapScss);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
if (
|
|
217
|
+
path.includes('livingdocs') &&
|
|
218
|
+
(path.endsWith('/app.js') || path.endsWith('/app.ts'))
|
|
219
|
+
) {
|
|
220
|
+
triggerAction(mapJs);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
if (
|
|
224
|
+
path.includes('livingdocs') &&
|
|
225
|
+
(path.endsWith('/properties.json') ||
|
|
226
|
+
path.endsWith('/properties.ts') ||
|
|
227
|
+
path.endsWith('/properties.js') ||
|
|
228
|
+
path.endsWith('.vue'))
|
|
229
|
+
) {
|
|
230
|
+
triggerAction(mapLdd);
|
|
231
|
+
}
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
server.watcher.on('unlink', (path) => {
|
|
235
|
+
if (
|
|
236
|
+
path.endsWith('/general.scss') ||
|
|
237
|
+
path.endsWith('/app.scss') ||
|
|
238
|
+
path.endsWith('/ldd.scss') ||
|
|
239
|
+
path.endsWith('/editor.scss') ||
|
|
240
|
+
path.endsWith('/pdf.scss') ||
|
|
241
|
+
path.endsWith('/word.scss') ||
|
|
242
|
+
path.endsWith('/xbrl.scss')||
|
|
243
|
+
(
|
|
244
|
+
path.startsWith(fontPath) &&
|
|
245
|
+
path.endsWith('.scss')
|
|
246
|
+
)
|
|
247
|
+
) {
|
|
248
|
+
triggerAction(mapScss);
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
if (
|
|
252
|
+
path.includes('livingdocs') &&
|
|
253
|
+
(path.endsWith('/app.js') || path.endsWith('/app.ts'))
|
|
254
|
+
) {
|
|
255
|
+
triggerAction(mapJs);
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
if (
|
|
259
|
+
path.includes('livingdocs') &&
|
|
260
|
+
(path.endsWith('/properties.json') ||
|
|
261
|
+
path.endsWith('/properties.ts') ||
|
|
262
|
+
path.endsWith('/properties.js') ||
|
|
263
|
+
path.endsWith('.vue'))
|
|
264
|
+
) {
|
|
265
|
+
triggerAction(mapLdd);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
},
|
|
269
|
+
};
|
|
270
|
+
}
|
package/scripts/prepare.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export default prepare;
|
|
2
|
-
declare function prepare(): void
|
|
2
|
+
declare function prepare(): Promise<void>;
|
package/scripts/prepare.js
CHANGED
|
@@ -1,66 +1,11 @@
|
|
|
1
1
|
import folders from './folders.js';
|
|
2
2
|
import fs from 'fs';
|
|
3
|
-
import path from 'path/posix';
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
'.srl/**/*',
|
|
7
|
-
'.srl/**/*.d.ts',
|
|
8
|
-
'.srl/**/*.vue',
|
|
9
|
-
'livingdocs/**/*',
|
|
10
|
-
'livingdocs/**/*.vue',
|
|
11
|
-
];
|
|
12
|
-
|
|
13
|
-
const tsConfigPaths = {
|
|
14
|
-
'@/*': ['./src/*'],
|
|
15
|
-
'~/*': ['./*'],
|
|
16
|
-
'#srl': ['./.srl'],
|
|
17
|
-
'#srl/*': ['./.srl/*'],
|
|
18
|
-
'#components': ['./.srl/components'],
|
|
19
|
-
'#components/*': ['./.srl/components/*'],
|
|
20
|
-
'#composables': ['./.srl/composables'],
|
|
21
|
-
'#composables/*': ['./.srl/composables/*'],
|
|
22
|
-
'#utils': ['./.srl/utils'],
|
|
23
|
-
'#utils/*': ['./.srl/utils/*'],
|
|
24
|
-
'#plugins': ['./.srl/plugins'],
|
|
25
|
-
'#plugins/*': ['./.srl/plugins/*'],
|
|
26
|
-
'#types': ['./.srl/types'],
|
|
27
|
-
'#types/*': ['./.srl/types/*'],
|
|
28
|
-
'#imports': ['./.srl/imports'],
|
|
29
|
-
'#imports/*': ['./.srl/imports/*'],
|
|
30
|
-
'#ld': ['./livingdocs'],
|
|
31
|
-
'#ld/*': ['./livingdocs/*'],
|
|
32
|
-
assets: ['./src/assets'],
|
|
33
|
-
'assets/*': ['./src/assets/*'],
|
|
34
|
-
srl: ['./.srl/srl'],
|
|
35
|
-
'srl/*': ['./.srl/srl/*'],
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
function prepare() {
|
|
4
|
+
async function prepare() {
|
|
39
5
|
if (fs.existsSync(folders.srlRoot)) {
|
|
40
|
-
fs.rmSync(folders.srlRoot, { recursive: true, force: true });
|
|
41
|
-
}
|
|
42
|
-
fs.cpSync(folders.packageSrl, folders.srlRoot, { recursive: true });
|
|
43
|
-
|
|
44
|
-
const tsConfigPath = path.join(folders.root, 'tsconfig.app.json');
|
|
45
|
-
if (fs.existsSync(tsConfigPath)) {
|
|
46
|
-
const tsConfig = JSON.parse(fs.readFileSync(tsConfigPath, 'utf-8'));
|
|
47
|
-
|
|
48
|
-
const mergedIncludes = [
|
|
49
|
-
...(tsConfig.include || []),
|
|
50
|
-
...tsConfigIncludes.filter((i) => !(tsConfig.include || []).includes(i)),
|
|
51
|
-
];
|
|
52
|
-
tsConfig.include = tsConfig.include || [];
|
|
53
|
-
tsConfig.include = mergedIncludes;
|
|
54
|
-
|
|
55
|
-
const mergedPaths = {
|
|
56
|
-
...(tsConfig.compilerOptions?.paths || {}),
|
|
57
|
-
...tsConfigPaths,
|
|
58
|
-
};
|
|
59
|
-
tsConfig.compilerOptions = tsConfig.compilerOptions || {};
|
|
60
|
-
tsConfig.compilerOptions.paths = mergedPaths;
|
|
61
|
-
|
|
62
|
-
fs.writeFileSync(tsConfigPath, JSON.stringify(tsConfig, null, 2));
|
|
6
|
+
await fs.rmSync(folders.srlRoot, { recursive: true, force: true });
|
|
63
7
|
}
|
|
8
|
+
await fs.cpSync(folders.packageSrl, folders.srlRoot, { recursive: true });
|
|
64
9
|
}
|
|
65
10
|
|
|
66
11
|
export default prepare;
|
|
@@ -1,11 +1,27 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
5
|
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
5
9
|
|
|
6
10
|
const prefix = props.item.iconPrefix ?? 'srl-icon'
|
|
11
|
+
|
|
12
|
+
const classListIcon = computed(() => {
|
|
13
|
+
const res = [
|
|
14
|
+
`${prefix}`,
|
|
15
|
+
`${prefix}-${props.item.icon}`,
|
|
16
|
+
]
|
|
17
|
+
if (!props.disableClasses) {
|
|
18
|
+
res.push('srl-menu__link-icon')
|
|
19
|
+
res.push(`srl-menu__link-icon--level-${props.depth}`)
|
|
20
|
+
}
|
|
21
|
+
return res
|
|
22
|
+
})
|
|
7
23
|
</script>
|
|
8
24
|
|
|
9
25
|
<template>
|
|
10
|
-
<i :class="
|
|
26
|
+
<i :class="classListIcon" aria-hidden="true"></i>
|
|
11
27
|
</template>
|
|
@@ -1,12 +1,35 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
|
-
item: NsWowNavigationItem
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
5
9
|
|
|
6
10
|
const prefix = props.item.iconPrefix ?? 'srl-icon'
|
|
11
|
+
|
|
12
|
+
const classListIcon = computed(() => {
|
|
13
|
+
const res = [
|
|
14
|
+
`${prefix}`,
|
|
15
|
+
`${prefix}-${props.item.iconAfter}`,
|
|
16
|
+
]
|
|
17
|
+
if (!props.disableClasses) {
|
|
18
|
+
res.push('srl-menu__link-icon-after')
|
|
19
|
+
res.push(`srl-menu__link-icon-after--level-${props.depth}`)
|
|
20
|
+
}
|
|
21
|
+
return res
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const classListText = computed(() => {
|
|
25
|
+
return props.disableClasses? [] : [
|
|
26
|
+
'srl-menu__link-text',
|
|
27
|
+
`srl-menu__link-text--level-${props.depth}`
|
|
28
|
+
]
|
|
29
|
+
})
|
|
7
30
|
</script>
|
|
8
31
|
|
|
9
32
|
<template>
|
|
10
|
-
<span
|
|
11
|
-
<i :class="
|
|
33
|
+
<span :class="classListText" v-text="props.item.label"/>
|
|
34
|
+
<i :class="classListIcon" aria-hidden="true"></i>
|
|
12
35
|
</template>
|
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
|
-
item: NsWowNavigationItem
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
5
9
|
|
|
6
10
|
const prefix = props.item.iconPrefix ?? 'srl-icon'
|
|
11
|
+
|
|
12
|
+
const classListIcon = computed(() => {
|
|
13
|
+
const res = [
|
|
14
|
+
`${prefix}`,
|
|
15
|
+
`${prefix}-${props.item.iconBefore}`,
|
|
16
|
+
]
|
|
17
|
+
|
|
18
|
+
if (!props.disableClasses) {
|
|
19
|
+
res.push('srl-menu__link-icon-before')
|
|
20
|
+
res.push(`srl-menu__link-icon-before--level-${props.depth}`)
|
|
21
|
+
}
|
|
22
|
+
return res
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
const classListText = computed(() => {
|
|
26
|
+
return [
|
|
27
|
+
'srl-menu__link-text',
|
|
28
|
+
`srl-menu__link-text--level-${props.depth}`
|
|
29
|
+
]
|
|
30
|
+
})
|
|
7
31
|
</script>
|
|
8
32
|
|
|
9
33
|
<template>
|
|
10
|
-
<i :class="
|
|
11
|
-
<span
|
|
34
|
+
<i :class="classListIcon" aria-hidden="true"></i>
|
|
35
|
+
<span :class="classListText" v-text="props.item.label"/>
|
|
12
36
|
</template>
|
|
@@ -1,11 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
|
-
item: NsWowNavigationItem
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
9
|
+
|
|
10
|
+
const classListIcon = computed(() => {
|
|
11
|
+
return props.disableClasses ? [] : [
|
|
12
|
+
'srl-menu__link-image',
|
|
13
|
+
`srl-menu__link-image--level-${props.depth}`
|
|
14
|
+
]
|
|
15
|
+
})
|
|
5
16
|
</script>
|
|
6
17
|
|
|
7
18
|
<template>
|
|
8
19
|
<img
|
|
20
|
+
:class="classListIcon"
|
|
9
21
|
:src="props.item.img.src"
|
|
10
22
|
:alt="props.item.img.alt ?? props.item.label"
|
|
11
23
|
/>
|
|
@@ -1,12 +1,31 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
|
-
item: NsWowNavigationItem
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
9
|
+
|
|
10
|
+
const classListIcon = computed(() => {
|
|
11
|
+
return props.disableClasses ? [] : [
|
|
12
|
+
'srl-menu__link-image-after',
|
|
13
|
+
`srl-menu__link-image-after--level-${props.depth}`
|
|
14
|
+
]
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const classListText = computed(() => {
|
|
18
|
+
return props.disableClasses ? [] : [
|
|
19
|
+
'srl-menu__link-text',
|
|
20
|
+
`srl-menu__link-text--level-${props.depth}`
|
|
21
|
+
]
|
|
22
|
+
})
|
|
5
23
|
</script>
|
|
6
24
|
|
|
7
25
|
<template>
|
|
8
|
-
<span
|
|
26
|
+
<span :class="classListText" v-text="props.item.label"/>
|
|
9
27
|
<img
|
|
28
|
+
:class="classListIcon"
|
|
10
29
|
:src="props.item.imgAfter.src"
|
|
11
30
|
:alt="props.item.imgAfter.alt ?? props.item.label"
|
|
12
31
|
/>
|
|
@@ -1,13 +1,32 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
2
4
|
const props = defineProps<{
|
|
3
|
-
item: NsWowNavigationItem
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
9
|
+
|
|
10
|
+
const classListIcon = computed(() => {
|
|
11
|
+
return props.disableClasses ? [] : [
|
|
12
|
+
'srl-menu__link-image-before',
|
|
13
|
+
`srl-menu__link-image-before--level-${props.depth}`
|
|
14
|
+
]
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const classListText = computed(() => {
|
|
18
|
+
return props.disableClasses ? [] : [
|
|
19
|
+
'srl-menu__link-text',
|
|
20
|
+
`srl-menu__link-text--level-${props.depth}`
|
|
21
|
+
]
|
|
22
|
+
})
|
|
5
23
|
</script>
|
|
6
24
|
|
|
7
25
|
<template>
|
|
8
26
|
<img
|
|
27
|
+
:class="classListIcon"
|
|
9
28
|
:src="props.item.imgBefore.src"
|
|
10
29
|
:alt="props.item.imgBefore.alt ?? props.item.label"
|
|
11
30
|
/>
|
|
12
|
-
<span
|
|
31
|
+
<span :class="classListText" v-text="props.item.label"/>
|
|
13
32
|
</template>
|
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
|
|
4
|
+
const props = defineProps<{
|
|
5
|
+
item: NsWowNavigationItem
|
|
6
|
+
depth: number
|
|
7
|
+
disableClasses: boolean
|
|
4
8
|
}>();
|
|
9
|
+
|
|
10
|
+
const classListText = computed(() => {
|
|
11
|
+
return props.disableClasses ? [] : [
|
|
12
|
+
'srl-menu__link-text',
|
|
13
|
+
`srl-menu__link-text--level-${props.depth}`
|
|
14
|
+
]
|
|
15
|
+
})
|
|
5
16
|
</script>
|
|
6
17
|
|
|
7
18
|
<template>
|
|
8
|
-
<span
|
|
19
|
+
<span :class="classListText" v-text="props.item.label"/>
|
|
9
20
|
</template>
|
|
@@ -8,7 +8,9 @@ import MenuItemContentIconBefore from './Content/IconBefore.vue';
|
|
|
8
8
|
import MenuItemContentIconAfter from './Content/IconAfter.vue';
|
|
9
9
|
|
|
10
10
|
const props = defineProps<{
|
|
11
|
-
item: NsWowNavigationItem
|
|
11
|
+
item: NsWowNavigationItem
|
|
12
|
+
depth: number
|
|
13
|
+
disableClasses: boolean
|
|
12
14
|
}>();
|
|
13
15
|
</script>
|
|
14
16
|
|
|
@@ -16,26 +18,43 @@ const props = defineProps<{
|
|
|
16
18
|
<MenuItemContentIcon
|
|
17
19
|
v-if="props.item.icon"
|
|
18
20
|
:item="props.item"
|
|
21
|
+
:depth="props.depth"
|
|
22
|
+
:disableClasses="props.disableClasses"
|
|
19
23
|
/>
|
|
20
24
|
<MenuItemContentIconBefore
|
|
21
25
|
v-else-if="props.item.iconBefore"
|
|
22
26
|
:item="props.item"
|
|
27
|
+
:depth="props.depth"
|
|
28
|
+
:disableClasses="props.disableClasses"
|
|
23
29
|
/>
|
|
24
30
|
<MenuItemContentIconAfter
|
|
25
31
|
v-else-if="props.item.iconAfter"
|
|
26
32
|
:item="props.item"
|
|
33
|
+
:depth="props.depth"
|
|
34
|
+
:disableClasses="props.disableClasses"
|
|
27
35
|
/>
|
|
28
36
|
<MenuItemContentImage
|
|
29
37
|
v-else-if="props.item.img"
|
|
30
38
|
:item="props.item"
|
|
39
|
+
:depth="props.depth"
|
|
40
|
+
:disableClasses="props.disableClasses"
|
|
31
41
|
/>
|
|
32
42
|
<MenuItemContentImageBefore
|
|
33
43
|
v-else-if="props.item.imgBefore"
|
|
34
44
|
:item="props.item"
|
|
45
|
+
:depth="props.depth"
|
|
46
|
+
:disableClasses="props.disableClasses"
|
|
35
47
|
/>
|
|
36
48
|
<MenuItemContentImageAfter
|
|
37
49
|
v-else-if="props.item.imgAfter"
|
|
38
50
|
:item="props.item"
|
|
51
|
+
:depth="props.depth"
|
|
52
|
+
:disableClasses="props.disableClasses"
|
|
53
|
+
/>
|
|
54
|
+
<MenuItemContentText
|
|
55
|
+
v-else
|
|
56
|
+
:item="props.item"
|
|
57
|
+
:depth="props.depth"
|
|
58
|
+
:disableClasses="props.disableClasses"
|
|
39
59
|
/>
|
|
40
|
-
<MenuItemContentText v-else :item="props.item" />
|
|
41
60
|
</template>
|