vanilla-jui 1.7.6 → 1.7.8
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/dist/index.d.ts +24 -4
- package/dist/index.js +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/src/components/toc.ts +403 -62
- package/src/css/components.css +0 -1
- package/src/css/themes/default/form.css +1 -1
- package/src/css/themes/default/toast.css +5 -4
- package/src/css/themes/default/toc.css +15 -12
- package/src/locales/index.ts +2 -0
- package/src/primitives/toast.ts +2 -4
- package/src/utilities/browser.ts +0 -1
- package/src/css/toc.css +0 -10
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
border-radius: var(--radius-md);
|
|
24
24
|
min-width: 200px;
|
|
25
25
|
max-width: 310px;
|
|
26
|
+
backdrop-filter: blur(4px);
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
.j-toast .el-icon {
|
|
@@ -31,25 +32,25 @@
|
|
|
31
32
|
|
|
32
33
|
.j-toast.is-success {
|
|
33
34
|
--toast-fg: var(--state-success);
|
|
34
|
-
--toast-bg: var(--state-success-
|
|
35
|
+
--toast-bg: var(--state-success-soft);
|
|
35
36
|
--toast-border-color: var(--state-success-border);
|
|
36
37
|
}
|
|
37
38
|
|
|
38
39
|
.j-toast.is-error {
|
|
39
40
|
--toast-fg: var(--state-danger);
|
|
40
|
-
--toast-bg: var(--state-danger-
|
|
41
|
+
--toast-bg: var(--state-danger-soft);
|
|
41
42
|
--toast-border-color: var(--state-danger-border);
|
|
42
43
|
}
|
|
43
44
|
|
|
44
45
|
.j-toast.is-warning {
|
|
45
46
|
--toast-fg: var(--state-warning);
|
|
46
|
-
--toast-bg: var(--state-warning-
|
|
47
|
+
--toast-bg: var(--state-warning-soft);
|
|
47
48
|
--toast-border-color: var(--state-warning-border);
|
|
48
49
|
}
|
|
49
50
|
|
|
50
51
|
.j-toast.is-primary {
|
|
51
52
|
--toast-fg: var(--tone-solid);
|
|
52
|
-
--toast-bg: var(--tone-
|
|
53
|
+
--toast-bg: var(--tone-soft);
|
|
53
54
|
--toast-border-color: var(--tone-border);
|
|
54
55
|
}
|
|
55
56
|
|
|
@@ -1,25 +1,28 @@
|
|
|
1
1
|
@layer themes {
|
|
2
|
+
.j-toc .toc-title {
|
|
3
|
+
color: var(--tone-caption);
|
|
4
|
+
margin-bottom: 4px;
|
|
5
|
+
}
|
|
6
|
+
|
|
2
7
|
.j-toc .toc-link {
|
|
3
|
-
padding: 0.375rem
|
|
4
|
-
|
|
8
|
+
padding-top: 0.375rem;
|
|
9
|
+
padding-bottom: 0.375rem;
|
|
5
10
|
color: var(--tone-caption);
|
|
6
11
|
font-size: var(--font-size-sm);
|
|
7
12
|
text-decoration: none;
|
|
13
|
+
display: block;
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
.j-toc .toc-link:hover,
|
|
11
|
-
.j-toc .toc-link
|
|
17
|
+
.j-toc .toc-link[aria-current] {
|
|
12
18
|
color: var(--tone-heading);
|
|
13
19
|
}
|
|
14
20
|
|
|
15
|
-
.j-toc
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
.j-toc .toc-link
|
|
20
|
-
|
|
21
|
-
.j-toc .toc-link.is-level-5,
|
|
22
|
-
.j-toc .toc-link.is-level-6 {
|
|
23
|
-
padding-left: 1.5rem;
|
|
21
|
+
.j-toc:has(.toc-link),
|
|
22
|
+
.j-toc .toc-link[data-toc-level='3'],
|
|
23
|
+
.j-toc .toc-link[data-toc-level='4'],
|
|
24
|
+
.j-toc .toc-link[data-toc-level='5'],
|
|
25
|
+
.j-toc .toc-link[data-toc-level='6'] {
|
|
26
|
+
padding-left: 0.75rem;
|
|
24
27
|
}
|
|
25
28
|
}
|
package/src/locales/index.ts
CHANGED
|
@@ -6,6 +6,7 @@ export default {
|
|
|
6
6
|
md: 'Medium',
|
|
7
7
|
lg: 'Large',
|
|
8
8
|
wn: 'Your browser is outdated and may pose security risks. Please upgrade your browser to access this site.',
|
|
9
|
+
toc: 'On this page',
|
|
9
10
|
},
|
|
10
11
|
zh: {
|
|
11
12
|
b: '返回',
|
|
@@ -52,5 +53,6 @@ export default {
|
|
|
52
53
|
'Go to next page': '访问下一页',
|
|
53
54
|
Next: '下一步',
|
|
54
55
|
Finish: '完成',
|
|
56
|
+
toc: '页面导航',
|
|
55
57
|
},
|
|
56
58
|
};
|
package/src/primitives/toast.ts
CHANGED
|
@@ -57,7 +57,7 @@ export interface ToastOptions extends ToastThemeOptions {
|
|
|
57
57
|
onCancel?: () => void | Promise<void>;
|
|
58
58
|
}
|
|
59
59
|
|
|
60
|
-
export interface ToastConfirmProps extends
|
|
60
|
+
export interface ToastConfirmProps extends ToastClassNameOptions {
|
|
61
61
|
once?: boolean;
|
|
62
62
|
text?: {
|
|
63
63
|
close?: string;
|
|
@@ -453,16 +453,14 @@ function confirm(message = '', props: ToastConfirmProps = {}): HTMLElement {
|
|
|
453
453
|
validateParam('message', message, 'string', 'Toast.confirm');
|
|
454
454
|
const closeText = props.text?.close || translate('Close');
|
|
455
455
|
const confirmText = props.text?.confirm || translate('Confirm');
|
|
456
|
-
const theme = props.theme || 'info';
|
|
457
456
|
validateParam('once', once, 'boolean', 'Toast.confirm');
|
|
458
|
-
validateParam('theme', theme, TOAST_THEME_RULE, 'Toast.confirm');
|
|
459
457
|
const names = mergeShallowConfig(
|
|
460
458
|
classNames,
|
|
461
459
|
props.className ?? {}
|
|
462
460
|
) as ToastClassNames;
|
|
463
461
|
const id = randomId();
|
|
464
462
|
const element = jsx('div', {
|
|
465
|
-
className:
|
|
463
|
+
className: names.confirm,
|
|
466
464
|
'data-toast': id,
|
|
467
465
|
'data-toast-confirm': '',
|
|
468
466
|
children: [
|
package/src/utilities/browser.ts
CHANGED
|
@@ -128,7 +128,6 @@ export function isModernBrowser(): SupportES2022 {
|
|
|
128
128
|
export function checkModernBrowser(): SupportES2022 {
|
|
129
129
|
if (!isModernBrowser()) {
|
|
130
130
|
Toast.confirm(translate('wn'), {
|
|
131
|
-
theme: 'error',
|
|
132
131
|
onConfirm: () => {
|
|
133
132
|
window.open('https://www.google.cn/chrome/fallback/', '_blank');
|
|
134
133
|
},
|