rhjy-ui 0.1.0 → 0.2.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/README.md +133 -109
- package/dist/_plugin-vue_export-helper-dad06003.js +9 -0
- package/dist/_plugin-vue_export-helper-f246444f.cjs +1 -0
- package/dist/data-center/index.cjs +1 -1
- package/dist/data-center/index.js +147 -151
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +8 -4
- package/dist/responsive-info-grid/RhResponsiveInfoGrid.vue.d.ts +53 -0
- package/dist/responsive-info-grid/RhResponsiveInfoGridItem.vue.d.ts +49 -0
- package/dist/responsive-info-grid/index.cjs +1 -0
- package/dist/responsive-info-grid/index.d.ts +2 -0
- package/dist/responsive-info-grid/index.js +54 -0
- package/dist/style.css +1 -1
- package/package.json +53 -47
- package/src/responsive-info-grid/README.md +137 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
declare function __VLS_template(): {
|
|
2
|
+
title?(_: {}): any;
|
|
3
|
+
content?(_: {}): any;
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
6
|
+
title?: string;
|
|
7
|
+
content?: string | number;
|
|
8
|
+
span?: number;
|
|
9
|
+
}>, {
|
|
10
|
+
title: string;
|
|
11
|
+
content: string;
|
|
12
|
+
span: number;
|
|
13
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<{
|
|
14
|
+
title?: string;
|
|
15
|
+
content?: string | number;
|
|
16
|
+
span?: number;
|
|
17
|
+
}>, {
|
|
18
|
+
title: string;
|
|
19
|
+
content: string;
|
|
20
|
+
span: number;
|
|
21
|
+
}>>> & Readonly<{}>, {
|
|
22
|
+
span: number;
|
|
23
|
+
title: string;
|
|
24
|
+
content: string | number;
|
|
25
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
26
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
|
|
27
|
+
export default _default;
|
|
28
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
29
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
30
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
31
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
32
|
+
} : {
|
|
33
|
+
type: import('vue').PropType<T[K]>;
|
|
34
|
+
required: true;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
type __VLS_WithDefaults<P, D> = {
|
|
38
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
39
|
+
default: D[K];
|
|
40
|
+
}> : P[K];
|
|
41
|
+
};
|
|
42
|
+
type __VLS_Prettify<T> = {
|
|
43
|
+
[K in keyof T]: T[K];
|
|
44
|
+
} & {};
|
|
45
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
46
|
+
new (): {
|
|
47
|
+
$slots: S;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),o=require("../_plugin-vue_export-helper-f246444f.cjs"),i=e.defineComponent({__name:"RhResponsiveInfoGrid",props:{columns:{default:4},tabletColumns:{default:2},mobileColumns:{default:1},gap:{default:"15px 15px"}},setup(t){return(n,s)=>(e.openBlock(),e.createElementBlock("div",{class:"responsive-info-grid",style:e.normalizeStyle({"--responsive-info-grid-columns":String(t.columns),"--responsive-info-grid-tablet-columns":String(t.tabletColumns),"--responsive-info-grid-mobile-columns":String(t.mobileColumns),"--responsive-info-grid-gap":t.gap})},[e.renderSlot(n.$slots,"default",{},void 0,!0)],4))}});const l=o._export_sfc(i,[["__scopeId","data-v-85b5413b"]]),r={class:"responsive-info-grid-item__title"},d={class:"responsive-info-grid-item__content"},a=e.defineComponent({__name:"RhResponsiveInfoGridItem",props:{title:{default:""},content:{default:""},span:{default:1}},setup(t){return(n,s)=>(e.openBlock(),e.createElementBlock("div",{class:"responsive-info-grid-item",style:e.normalizeStyle({gridColumn:t.span>1?`span ${t.span}`:void 0})},[e.createElementVNode("div",r,[e.renderSlot(n.$slots,"title",{},()=>[e.createTextVNode(e.toDisplayString(t.title),1)],!0)]),e.createElementVNode("div",d,[e.renderSlot(n.$slots,"content",{},()=>[e.createTextVNode(e.toDisplayString(t.content),1)],!0)])],4))}});const c=o._export_sfc(a,[["__scopeId","data-v-67645283"]]);exports.RhResponsiveInfoGrid=l;exports.RhResponsiveInfoGridItem=c;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { defineComponent as l, openBlock as r, createElementBlock as d, normalizeStyle as a, renderSlot as n, createElementVNode as o, createTextVNode as s, toDisplayString as i } from "vue";
|
|
2
|
+
import { _ as c } from "../_plugin-vue_export-helper-dad06003.js";
|
|
3
|
+
const u = /* @__PURE__ */ l({
|
|
4
|
+
__name: "RhResponsiveInfoGrid",
|
|
5
|
+
props: {
|
|
6
|
+
columns: { default: 4 },
|
|
7
|
+
tabletColumns: { default: 2 },
|
|
8
|
+
mobileColumns: { default: 1 },
|
|
9
|
+
gap: { default: "15px 15px" }
|
|
10
|
+
},
|
|
11
|
+
setup(e) {
|
|
12
|
+
return (t, m) => (r(), d("div", {
|
|
13
|
+
class: "responsive-info-grid",
|
|
14
|
+
style: a({
|
|
15
|
+
"--responsive-info-grid-columns": String(e.columns),
|
|
16
|
+
"--responsive-info-grid-tablet-columns": String(e.tabletColumns),
|
|
17
|
+
"--responsive-info-grid-mobile-columns": String(e.mobileColumns),
|
|
18
|
+
"--responsive-info-grid-gap": e.gap
|
|
19
|
+
})
|
|
20
|
+
}, [
|
|
21
|
+
n(t.$slots, "default", {}, void 0, !0)
|
|
22
|
+
], 4));
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const R = /* @__PURE__ */ c(u, [["__scopeId", "data-v-85b5413b"]]), p = { class: "responsive-info-grid-item__title" }, _ = { class: "responsive-info-grid-item__content" }, f = /* @__PURE__ */ l({
|
|
26
|
+
__name: "RhResponsiveInfoGridItem",
|
|
27
|
+
props: {
|
|
28
|
+
title: { default: "" },
|
|
29
|
+
content: { default: "" },
|
|
30
|
+
span: { default: 1 }
|
|
31
|
+
},
|
|
32
|
+
setup(e) {
|
|
33
|
+
return (t, m) => (r(), d("div", {
|
|
34
|
+
class: "responsive-info-grid-item",
|
|
35
|
+
style: a({ gridColumn: e.span > 1 ? `span ${e.span}` : void 0 })
|
|
36
|
+
}, [
|
|
37
|
+
o("div", p, [
|
|
38
|
+
n(t.$slots, "title", {}, () => [
|
|
39
|
+
s(i(e.title), 1)
|
|
40
|
+
], !0)
|
|
41
|
+
]),
|
|
42
|
+
o("div", _, [
|
|
43
|
+
n(t.$slots, "content", {}, () => [
|
|
44
|
+
s(i(e.content), 1)
|
|
45
|
+
], !0)
|
|
46
|
+
])
|
|
47
|
+
], 4));
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
const I = /* @__PURE__ */ c(f, [["__scopeId", "data-v-67645283"]]);
|
|
51
|
+
export {
|
|
52
|
+
R as RhResponsiveInfoGrid,
|
|
53
|
+
I as RhResponsiveInfoGridItem
|
|
54
|
+
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--rh-ui-data-center-primary: #00828a;--rh-ui-data-center-primary-soft: #cfe8ea;--rh-ui-data-center-panel-width: 606px;--rh-ui-data-center-panel-height: 500px;--rh-ui-data-center-text: #333;--rh-ui-data-center-secondary-text: #999;--rh-ui-data-center-border: #e9e9e9}.rh-data-center-panel{width:var(--rh-ui-data-center-panel-width);height:var(--rh-ui-data-center-panel-height);display:flex;overflow:hidden;box-sizing:border-box;background:#fff;border:1px solid var(--rh-ui-data-center-border);border-radius:8px;box-shadow:0 12px 32px #0f172a29}.rh-data-center-panel__sidebar{width:124px;flex:0 0 124px;box-sizing:border-box;padding:16px 10px;border-right:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__main{min-width:0;flex:1;padding:16px 0 10px 15px}.rh-data-center-panel__title{display:flex;align-items:center;justify-content:space-between;margin:0 10px 15px 0;color:var(--rh-ui-data-center-text);font-size:16px;font-weight:600}.rh-data-center-panel__category{width:104px;min-height:32px;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;margin:10px 0;padding:0 10px;border-radius:3px;color:#666;cursor:pointer;font-size:14px}.rh-data-center-panel__category.is-active{background:var(--rh-ui-data-center-primary-soft);color:var(--rh-ui-data-center-primary);font-weight:600}.rh-data-center-panel__categoryCount{color:#999;font-size:12px;font-weight:400}.rh-data-center-panel__category.is-active .rh-data-center-panel__categoryCount{color:var(--rh-ui-data-center-primary)}.rh-data-center-panel__scroll{height:calc(100% - 48px);padding-right:10px;overflow-y:auto}.rh-data-center-panel__task{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;box-sizing:border-box;min-height:84px;margin-bottom:10px;padding:0 10px 10px 0;border-bottom:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__taskMain{min-width:0;flex:1}.rh-data-center-panel__taskTitle{overflow:hidden;color:var(--rh-ui-data-center-text);font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.rh-data-center-panel__taskTag{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:12px;background:#f5f6f7;color:#999;font-size:12px;line-height:20px;vertical-align:1px}.rh-data-center-panel__progress{width:100%;height:4px;margin:7px 0 5px;overflow:hidden;border-radius:4px;background:#edf0f1}.rh-data-center-panel__progressBar{height:100%;border-radius:inherit;background:var(--rh-ui-data-center-primary);transition:width .3s ease}.rh-data-center-panel__progressBar.is-failed{background:#f04444}.rh-data-center-panel__meta,.rh-data-center-panel__message{color:var(--rh-ui-data-center-secondary-text);font-size:11px;line-height:18px}.rh-data-center-panel__message.is-failed{color:#f04444;font-size:12px}.rh-data-center-panel__actions{flex:0 0 auto;display:flex;align-items:flex-end;gap:10px;min-height:56px;padding-bottom:1px}.rh-data-center-panel__action{padding:0;border:0;background:transparent;color:#008ae6;cursor:pointer;font-size:12px;white-space:nowrap}.rh-data-center-panel__action:disabled{color:#bbb;cursor:not-allowed}.rh-data-center-panel__state{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--rh-ui-data-center-secondary-text);font-size:14px}.rh-data-center-panel__retry{border:0;background:transparent;color:var(--rh-ui-data-center-primary);cursor:pointer}.rh-data-center-panel__footer{display:flex;justify-content:space-between;box-sizing:border-box;padding:8px 10px 0 0;color:var(--rh-ui-data-center-secondary-text);font-size:12px}.rh-data-center-tip__content{display:flex;flex-direction:column;align-items:center;color:var(--rh-ui-data-center-text)}.rh-data-center-tip__minutes{color:var(--rh-ui-data-center-primary);font-size:18px}.rh-data-center-tip__description{margin:15px 0 30px;font-size:14px;line-height:22px}.rh-data-center-tip__guide{width:120px;height:56px;position:relative;margin:-20px auto 8px;border-radius:50%;background:radial-gradient(circle at 50% 55%,rgba(0,130,138,.18),transparent 65%)}.rh-data-center-tip__guide:after{content:">";position:absolute;top:0;right:15px;color:var(--rh-ui-data-center-primary);font-size:32px;animation:rh-data-center-guide 1.5s ease-in-out infinite}@keyframes rh-data-center-guide{0%,to{transform:translate(-8px,5px)}50%{transform:translate(0)}}.rh-data-center[data-v-
|
|
1
|
+
:root{--rh-ui-data-center-primary: #00828a;--rh-ui-data-center-primary-soft: #cfe8ea;--rh-ui-data-center-panel-width: 606px;--rh-ui-data-center-panel-height: 500px;--rh-ui-data-center-text: #333;--rh-ui-data-center-secondary-text: #999;--rh-ui-data-center-border: #e9e9e9}.rh-data-center-panel{width:var(--rh-ui-data-center-panel-width);height:var(--rh-ui-data-center-panel-height);display:flex;overflow:hidden;box-sizing:border-box;background:#fff;border:1px solid var(--rh-ui-data-center-border);border-radius:8px;box-shadow:0 12px 32px #0f172a29}.rh-data-center-panel__sidebar{width:124px;flex:0 0 124px;box-sizing:border-box;padding:16px 10px;border-right:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__main{min-width:0;flex:1;padding:16px 0 10px 15px}.rh-data-center-panel__title{display:flex;align-items:center;justify-content:space-between;margin:0 10px 15px 0;color:var(--rh-ui-data-center-text);font-size:16px;font-weight:600}.rh-data-center-panel__category{width:104px;min-height:32px;display:flex;align-items:center;justify-content:space-between;box-sizing:border-box;margin:10px 0;padding:0 10px;border-radius:3px;color:#666;cursor:pointer;font-size:14px}.rh-data-center-panel__category.is-active{background:var(--rh-ui-data-center-primary-soft);color:var(--rh-ui-data-center-primary);font-weight:600}.rh-data-center-panel__categoryCount{color:#999;font-size:12px;font-weight:400}.rh-data-center-panel__category.is-active .rh-data-center-panel__categoryCount{color:var(--rh-ui-data-center-primary)}.rh-data-center-panel__scroll{height:calc(100% - 48px);padding-right:10px;overflow-y:auto}.rh-data-center-panel__task{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;box-sizing:border-box;min-height:84px;margin-bottom:10px;padding:0 10px 10px 0;border-bottom:1px solid var(--rh-ui-data-center-border)}.rh-data-center-panel__taskMain{min-width:0;flex:1}.rh-data-center-panel__taskTitle{overflow:hidden;color:var(--rh-ui-data-center-text);font-size:14px;line-height:20px;text-overflow:ellipsis;white-space:nowrap}.rh-data-center-panel__taskTag{display:inline-block;margin-left:8px;padding:1px 8px;border-radius:12px;background:#f5f6f7;color:#999;font-size:12px;line-height:20px;vertical-align:1px}.rh-data-center-panel__progress{width:100%;height:4px;margin:7px 0 5px;overflow:hidden;border-radius:4px;background:#edf0f1}.rh-data-center-panel__progressBar{height:100%;border-radius:inherit;background:var(--rh-ui-data-center-primary);transition:width .3s ease}.rh-data-center-panel__progressBar.is-failed{background:#f04444}.rh-data-center-panel__meta,.rh-data-center-panel__message{color:var(--rh-ui-data-center-secondary-text);font-size:11px;line-height:18px}.rh-data-center-panel__message.is-failed{color:#f04444;font-size:12px}.rh-data-center-panel__actions{flex:0 0 auto;display:flex;align-items:flex-end;gap:10px;min-height:56px;padding-bottom:1px}.rh-data-center-panel__action{padding:0;border:0;background:transparent;color:#008ae6;cursor:pointer;font-size:12px;white-space:nowrap}.rh-data-center-panel__action:disabled{color:#bbb;cursor:not-allowed}.rh-data-center-panel__state{min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;color:var(--rh-ui-data-center-secondary-text);font-size:14px}.rh-data-center-panel__retry{border:0;background:transparent;color:var(--rh-ui-data-center-primary);cursor:pointer}.rh-data-center-panel__footer{display:flex;justify-content:space-between;box-sizing:border-box;padding:8px 10px 0 0;color:var(--rh-ui-data-center-secondary-text);font-size:12px}.rh-data-center-tip__content{display:flex;flex-direction:column;align-items:center;color:var(--rh-ui-data-center-text)}.rh-data-center-tip__minutes{color:var(--rh-ui-data-center-primary);font-size:18px}.rh-data-center-tip__description{margin:15px 0 30px;font-size:14px;line-height:22px}.rh-data-center-tip__guide{width:120px;height:56px;position:relative;margin:-20px auto 8px;border-radius:50%;background:radial-gradient(circle at 50% 55%,rgba(0,130,138,.18),transparent 65%)}.rh-data-center-tip__guide:after{content:">";position:absolute;top:0;right:15px;color:var(--rh-ui-data-center-primary);font-size:32px;animation:rh-data-center-guide 1.5s ease-in-out infinite}@keyframes rh-data-center-guide{0%,to{transform:translate(-8px,5px)}50%{transform:translate(0)}}.rh-data-center[data-v-94eef479]{position:relative;display:inline-flex;align-items:center}.rh-data-center__trigger[data-v-94eef479]{display:inline-flex;align-items:center;min-height:30px;padding:0 8px;border-radius:4px;color:var(--rh-ui-data-center-text);cursor:pointer;transition:background-color .2s ease,color .2s ease}.rh-data-center__trigger[data-v-94eef479]:hover,.rh-data-center__trigger.is-active[data-v-94eef479]{background:rgba(0,130,138,.08);color:var(--rh-ui-data-center-primary)}.rh-data-center__icon[data-v-94eef479]{width:22px;margin-right:5px}.rh-data-center__popover[data-v-94eef479]{position:fixed;z-index:3000;box-sizing:border-box}.responsive-info-grid[data-v-85b5413b]{display:grid;grid-template-columns:repeat(var(--responsive-info-grid-columns),minmax(0,1fr));gap:var(--responsive-info-grid-gap)}@media (max-width: 1200px){.responsive-info-grid[data-v-85b5413b]{grid-template-columns:repeat(var(--responsive-info-grid-tablet-columns),minmax(0,1fr))}}@media (max-width: 768px){.responsive-info-grid[data-v-85b5413b]{grid-template-columns:repeat(var(--responsive-info-grid-mobile-columns),minmax(0,1fr))}}.responsive-info-grid-item[data-v-67645283]{min-width:0;color:#333;font-size:14px;line-height:22px;word-break:break-all;display:flex}.responsive-info-grid-item__title[data-v-67645283]{display:inline-block;color:#777;white-space:nowrap}.responsive-info-grid-item__content[data-v-67645283]{display:inline}@media (max-width: 768px){.responsive-info-grid-item[data-v-67645283]{grid-column:span 1!important}}
|
package/package.json
CHANGED
|
@@ -1,47 +1,53 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "rhjy-ui",
|
|
3
|
-
"version": "0.1
|
|
4
|
-
"description": "Vue 3 and Element Plus business UI components",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"publishConfig": {
|
|
7
|
-
"access": "public",
|
|
8
|
-
"registry": "https://registry.npmjs.org"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"README.md"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
"
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "rhjy-ui",
|
|
3
|
+
"version": "0.2.1",
|
|
4
|
+
"description": "Vue 3 and Element Plus business UI components",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"publishConfig": {
|
|
7
|
+
"access": "public",
|
|
8
|
+
"registry": "https://registry.npmjs.org"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"src/responsive-info-grid/README.md"
|
|
14
|
+
],
|
|
15
|
+
"main": "./dist/index.cjs",
|
|
16
|
+
"module": "./dist/index.js",
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"exports": {
|
|
19
|
+
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
21
|
+
"import": "./dist/index.js",
|
|
22
|
+
"require": "./dist/index.cjs"
|
|
23
|
+
},
|
|
24
|
+
"./data-center": {
|
|
25
|
+
"types": "./dist/data-center/index.d.ts",
|
|
26
|
+
"import": "./dist/data-center/index.js",
|
|
27
|
+
"require": "./dist/data-center/index.cjs"
|
|
28
|
+
},
|
|
29
|
+
"./responsive-info-grid": {
|
|
30
|
+
"types": "./dist/responsive-info-grid/index.d.ts",
|
|
31
|
+
"import": "./dist/responsive-info-grid/index.js",
|
|
32
|
+
"require": "./dist/responsive-info-grid/index.cjs"
|
|
33
|
+
},
|
|
34
|
+
"./style.css": "./dist/style.css"
|
|
35
|
+
},
|
|
36
|
+
"scripts": {
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"package": "vite build",
|
|
39
|
+
"pack:check": "npm pack --dry-run"
|
|
40
|
+
},
|
|
41
|
+
"peerDependencies": {
|
|
42
|
+
"@element-plus/icons-vue": ">=1.1.4 <3",
|
|
43
|
+
"element-plus": ">=2.4.0 <3",
|
|
44
|
+
"vue": ">=3.2.0 <4"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@vitejs/plugin-vue": "^4.1.0",
|
|
48
|
+
"sass": "^1.63.6",
|
|
49
|
+
"typescript": "^5.0.2",
|
|
50
|
+
"vite": "^4.3.9",
|
|
51
|
+
"vite-plugin-dts": "^3.8.3"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# Responsive Info Grid
|
|
2
|
+
|
|
3
|
+
Responsive Info Grid 用于按响应式网格展示标题与内容组成的信息项,适合详情页、概览卡片和只读表单等场景。组件包含布局容器 `RhResponsiveInfoGrid` 和信息项 `RhResponsiveInfoGridItem`。
|
|
4
|
+
|
|
5
|
+
请在应用入口引入一次组件库样式:
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import 'rhjy-ui/style.css'
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## 导入方式
|
|
12
|
+
|
|
13
|
+
从主入口导入:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import {
|
|
17
|
+
RhResponsiveInfoGrid,
|
|
18
|
+
RhResponsiveInfoGridItem,
|
|
19
|
+
} from 'rhjy-ui'
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
也可以从 Responsive Info Grid 子入口导入:
|
|
23
|
+
|
|
24
|
+
```ts
|
|
25
|
+
import {
|
|
26
|
+
RhResponsiveInfoGrid,
|
|
27
|
+
RhResponsiveInfoGridItem,
|
|
28
|
+
} from 'rhjy-ui/responsive-info-grid'
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
两种方式提供相同的组件,可根据项目的导入规范选择。
|
|
32
|
+
|
|
33
|
+
## RhResponsiveInfoGrid
|
|
34
|
+
|
|
35
|
+
`RhResponsiveInfoGrid` 负责定义网格列数和间距。
|
|
36
|
+
|
|
37
|
+
### Props
|
|
38
|
+
|
|
39
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
40
|
+
| --- | --- | --- | --- |
|
|
41
|
+
| `columns` | `number` | `4` | 宽度大于 1200px 时的列数 |
|
|
42
|
+
| `tabletColumns` | `number` | `2` | 宽度不大于 1200px 且大于 768px 时的列数 |
|
|
43
|
+
| `mobileColumns` | `number` | `1` | 宽度不大于 768px 时的列数 |
|
|
44
|
+
| `gap` | `string` | `'15px 15px'` | CSS Grid 的 `gap` 值,可同时设置行间距和列间距 |
|
|
45
|
+
|
|
46
|
+
### 插槽
|
|
47
|
+
|
|
48
|
+
| 插槽 | 说明 |
|
|
49
|
+
| --- | --- |
|
|
50
|
+
| `default` | 网格内容,通常放置一个或多个 `RhResponsiveInfoGridItem` |
|
|
51
|
+
|
|
52
|
+
### 响应式断点
|
|
53
|
+
|
|
54
|
+
组件根据视口宽度切换列数:
|
|
55
|
+
|
|
56
|
+
| 视口宽度 | 使用的属性 |
|
|
57
|
+
| --- | --- |
|
|
58
|
+
| 大于 1200px | `columns` |
|
|
59
|
+
| 不大于 1200px 且大于 768px | `tabletColumns` |
|
|
60
|
+
| 不大于 768px | `mobileColumns` |
|
|
61
|
+
|
|
62
|
+
## RhResponsiveInfoGridItem
|
|
63
|
+
|
|
64
|
+
`RhResponsiveInfoGridItem` 展示一组标题和内容,并可横跨多列。
|
|
65
|
+
|
|
66
|
+
### Props
|
|
67
|
+
|
|
68
|
+
| 属性 | 类型 | 默认值 | 说明 |
|
|
69
|
+
| --- | --- | --- | --- |
|
|
70
|
+
| `title` | `string` | `''` | 标题文字;提供 `title` 插槽时作为后备内容 |
|
|
71
|
+
| `content` | `string \| number` | `''` | 内容文字或数字;提供 `content` 插槽时作为后备内容 |
|
|
72
|
+
| `span` | `number` | `1` | 大于 `1` 时横跨指定列数;不大于 `1` 时占一列 |
|
|
73
|
+
|
|
74
|
+
### 插槽
|
|
75
|
+
|
|
76
|
+
| 插槽 | 说明 |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `title` | 自定义标题区域;未提供时显示 `title` 属性 |
|
|
79
|
+
| `content` | 自定义内容区域;未提供时显示 `content` 属性 |
|
|
80
|
+
|
|
81
|
+
在视口宽度不大于 768px 时,每个信息项都会强制占一列,`span` 不再横跨多列,以避免移动端内容溢出。
|
|
82
|
+
|
|
83
|
+
## 基础文字内容
|
|
84
|
+
|
|
85
|
+
```vue
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import {
|
|
88
|
+
RhResponsiveInfoGrid,
|
|
89
|
+
RhResponsiveInfoGridItem,
|
|
90
|
+
} from 'rhjy-ui'
|
|
91
|
+
import 'rhjy-ui/style.css'
|
|
92
|
+
</script>
|
|
93
|
+
|
|
94
|
+
<template>
|
|
95
|
+
<RhResponsiveInfoGrid :columns="3" :tablet-columns="2" :mobile-columns="1">
|
|
96
|
+
<RhResponsiveInfoGridItem title="项目名称:" content="智慧园区" />
|
|
97
|
+
<RhResponsiveInfoGridItem title="负责人:" content="张三" />
|
|
98
|
+
<RhResponsiveInfoGridItem title="设备数量:" :content="128" />
|
|
99
|
+
<RhResponsiveInfoGridItem title="项目说明:" content="覆盖园区全部楼栋" :span="2" />
|
|
100
|
+
</RhResponsiveInfoGrid>
|
|
101
|
+
</template>
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
## 自定义插槽
|
|
105
|
+
|
|
106
|
+
```vue
|
|
107
|
+
<script setup lang="ts">
|
|
108
|
+
import { ElTag } from 'element-plus'
|
|
109
|
+
import {
|
|
110
|
+
RhResponsiveInfoGrid,
|
|
111
|
+
RhResponsiveInfoGridItem,
|
|
112
|
+
} from 'rhjy-ui/responsive-info-grid'
|
|
113
|
+
import 'rhjy-ui/style.css'
|
|
114
|
+
</script>
|
|
115
|
+
|
|
116
|
+
<template>
|
|
117
|
+
<RhResponsiveInfoGrid gap="20px 24px">
|
|
118
|
+
<RhResponsiveInfoGridItem>
|
|
119
|
+
<template #title>
|
|
120
|
+
<strong>运行状态:</strong>
|
|
121
|
+
</template>
|
|
122
|
+
<template #content>
|
|
123
|
+
<ElTag type="success">正常</ElTag>
|
|
124
|
+
</template>
|
|
125
|
+
</RhResponsiveInfoGridItem>
|
|
126
|
+
|
|
127
|
+
<RhResponsiveInfoGridItem :span="2">
|
|
128
|
+
<template #title>
|
|
129
|
+
<strong>最近更新:</strong>
|
|
130
|
+
</template>
|
|
131
|
+
<template #content>
|
|
132
|
+
<time datetime="2026-09-09T10:30:00+08:00">2026-09-09 10:30</time>
|
|
133
|
+
</template>
|
|
134
|
+
</RhResponsiveInfoGridItem>
|
|
135
|
+
</RhResponsiveInfoGrid>
|
|
136
|
+
</template>
|
|
137
|
+
```
|