@peng_kai/kit 0.1.0 → 0.1.1
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/admin/components/filter/src/FilterDrawer.vue +5 -1
- package/admin/components/scroll-nav/src/ScrollNav.vue +1 -1
- package/admin/components/text/src/Hash.vue +10 -1
- package/admin/styles/globalCover.scss +11 -0
- package/antd/hooks/useAntdTheme.ts +2 -2
- package/eslint.config.js +2 -49
- package/package.json +2 -1
- package/pnpm-lock.yaml +2156 -9
- package/request/interceptors/toLogin.ts +6 -4
- package/stylelint.config.cjs +7 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
import { ref } from 'vue';
|
|
3
3
|
import { Button as AButton, Drawer as ADrawer } from 'ant-design-vue';
|
|
4
4
|
|
|
5
|
+
defineOptions({
|
|
6
|
+
inheritAttrs: false,
|
|
7
|
+
});
|
|
8
|
+
|
|
5
9
|
const emits = defineEmits<{
|
|
6
10
|
(e: 'filter'): void
|
|
7
11
|
(e: 'reset', value: number): void
|
|
@@ -20,7 +24,7 @@ function reset() {
|
|
|
20
24
|
</script>
|
|
21
25
|
|
|
22
26
|
<template>
|
|
23
|
-
<div class="p-3 mb-2 bg-
|
|
27
|
+
<div class="p-3 mb-2 bg-$antd-colorBgContainer text-14px" v-bind="$attrs" @click="filterVisible = true">
|
|
24
28
|
<!-- .filter-params 为空时显示 .filter-params-tips -->
|
|
25
29
|
<div class="filter-params">
|
|
26
30
|
<slot name="params" />
|
|
@@ -15,9 +15,12 @@ const props = withDefaults(
|
|
|
15
15
|
hide?: boolean
|
|
16
16
|
chain?: string
|
|
17
17
|
type?: HashType
|
|
18
|
+
empty?: string
|
|
18
19
|
}>(),
|
|
19
20
|
{
|
|
20
21
|
hide: true,
|
|
22
|
+
type: 'transaction',
|
|
23
|
+
empty: '-',
|
|
21
24
|
},
|
|
22
25
|
);
|
|
23
26
|
|
|
@@ -28,6 +31,12 @@ const href = computed(() => {
|
|
|
28
31
|
return;
|
|
29
32
|
return getScanBrowser(chain, hash, type);
|
|
30
33
|
});
|
|
34
|
+
const text = computed(() => {
|
|
35
|
+
if (props.hash)
|
|
36
|
+
return props.hide ? desensitize(props.hash) : props.hash;
|
|
37
|
+
else
|
|
38
|
+
return props.empty;
|
|
39
|
+
});
|
|
31
40
|
</script>
|
|
32
41
|
|
|
33
42
|
<template>
|
|
@@ -36,7 +45,7 @@ const href = computed(() => {
|
|
|
36
45
|
<template v-if="props.hide" #title>
|
|
37
46
|
{{ props.hash }}
|
|
38
47
|
</template>
|
|
39
|
-
<span v-bind="$attrs">{{
|
|
48
|
+
<span v-bind="$attrs"><slot>{{ text }}</slot></span>
|
|
40
49
|
</ATooltip>
|
|
41
50
|
</ATypographyLink>
|
|
42
51
|
</template>
|
|
@@ -19,7 +19,7 @@ export function useAntdTheme(mode: Ref<string>, config: Ref<Record<string, any>>
|
|
|
19
19
|
const screenXXXL = Number.parseFloat(_config.breakpoints.desktop1k);
|
|
20
20
|
const token: ThemeConfig['token'] = {
|
|
21
21
|
...algorithm({ ...theme.defaultSeed, colorPrimary: _config.colors.primary.DEFAULT }),
|
|
22
|
-
borderRadius:
|
|
22
|
+
borderRadius: 4,
|
|
23
23
|
screenXS,
|
|
24
24
|
screenXSMin: screenXS,
|
|
25
25
|
screenXSMax: screenSM - 0.1,
|
|
@@ -83,4 +83,4 @@ function useGlobalCssVariable(prefix: string, vars: Ref<Record<string, any>>) {
|
|
|
83
83
|
});
|
|
84
84
|
|
|
85
85
|
return useStyleTag(cssVariable);
|
|
86
|
-
}
|
|
86
|
+
}
|
package/eslint.config.js
CHANGED
|
@@ -1,50 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { config } from '@peng_kai/lint/antfu.mjs';
|
|
2
2
|
|
|
3
|
-
export default
|
|
4
|
-
{
|
|
5
|
-
stylistic: {
|
|
6
|
-
indent: 2,
|
|
7
|
-
quotes: 'single',
|
|
8
|
-
semi: true,
|
|
9
|
-
jsx: true,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
files: ['**/*.ts', '**/*.vue'],
|
|
14
|
-
rules: {
|
|
15
|
-
'no-console': ['off'],
|
|
16
|
-
'ts/no-use-before-define': ['off'],
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
files: ['**/*.vue'],
|
|
21
|
-
rules: {
|
|
22
|
-
'vue/attribute-hyphenation': ['error', 'never'],
|
|
23
|
-
'vue/v-on-event-hyphenation': ['error', 'never', { autofix: true }],
|
|
24
|
-
'vue/custom-event-name-casing': ['error', 'camelCase'],
|
|
25
|
-
'vue/prop-name-casing': ['error', 'camelCase'],
|
|
26
|
-
'vue/component-definition-name-casing': ['error', 'PascalCase'],
|
|
27
|
-
'vue/component-name-in-template-casing': ['error', 'PascalCase', { registeredComponentsOnly: false }],
|
|
28
|
-
'vue/max-attributes-per-line': ['error', {
|
|
29
|
-
singleline: { max: 3 },
|
|
30
|
-
multiline: { max: 3 },
|
|
31
|
-
}],
|
|
32
|
-
'vue/v-slot-style': ['error', {
|
|
33
|
-
atComponent: 'shorthand',
|
|
34
|
-
default: 'shorthand',
|
|
35
|
-
named: 'shorthand',
|
|
36
|
-
}],
|
|
37
|
-
'vue/block-lang': ['error', {
|
|
38
|
-
script: { lang: 'ts' },
|
|
39
|
-
}],
|
|
40
|
-
'vue/block-order': ['error', {
|
|
41
|
-
order: ['script:not([setup])', 'script[setup]', 'template', 'style[scoped]', 'style:not([scoped])'],
|
|
42
|
-
}],
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
rules: {
|
|
47
|
-
'eslint-comments/no-unlimited-disable': ['off'],
|
|
48
|
-
},
|
|
49
|
-
},
|
|
50
|
-
);
|
|
3
|
+
export default config;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peng_kai/kit",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.1",
|
|
5
5
|
"description": "",
|
|
6
6
|
"author": "",
|
|
7
7
|
"license": "ISC",
|
|
@@ -36,6 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@antfu/eslint-config": "^1.2.1",
|
|
39
|
+
"@peng_kai/lint": "^0.0.13",
|
|
39
40
|
"@types/lodash-es": "^4.17.11",
|
|
40
41
|
"@types/node": "18",
|
|
41
42
|
"@types/nprogress": "^0.2.3",
|