sky-ui-kit 0.0.0-stage → 0.1.0

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 CHANGED
@@ -1,3 +1,97 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # UsersSite Element Plus 主题预览
2
+
3
+ 从原项目提取主题,提供独立 Vue 3 / Element Plus 预览站及可发布的样式包。
4
+
5
+ 组件库分类、统一出口和兼容规则见 [COMPONENT-LIBRARY.md](docs/COMPONENT-LIBRARY.md)。基础组件使用 `Ui` 前缀,直接复用 Element Plus API;项目层保留现有组件名。两层共享项目主题。
6
+
7
+ 发布后反向对接以 [INTEGRATION.md](docs/INTEGRATION.md) 为准;逐页依赖见 [PAGE-INVENTORY.md](docs/PAGE-INVENTORY.md),全部原组件清单见 [COMPONENT-INVENTORY.md](docs/COMPONENT-INVENTORY.md)。完整静态扫描数据保存在 docs/project-audit.json,可用 `node scripts/audit-project.mjs` 更新。扫描覆盖不代表全部业务组件已经迁入包。
8
+
9
+ 全部原组件调用依据见 [LEGACY-USAGE.md](docs/LEGACY-USAGE.md)。包内已导出的 10 个组件均有预览和接入示例;Element Plus 展示区提供完整演示源码。业务组件的调用片段保留原页面上下文,不能当作独立可运行示例。
10
+
11
+ ## 本地运行
12
+
13
+ ```powershell
14
+ cd D:\Work\01-项目code\一体化平台\webv1\element-plus-theme
15
+ npm install
16
+ npm run dev
17
+ ```
18
+
19
+ 打开 http://127.0.0.1:5180 。支持明暗切换、六色调色板编辑、字号 / 圆角 / 控件高度 / 阴影调整、浏览器保存、JSON 导入导出。鼠标悬浮、键盘聚焦、输入校验、选择器浮层、日期选择器、弹窗及抽屉可直接核对。
20
+
21
+ ## 提取范围与差异
22
+
23
+ - `src/styles/theme.css`:原项目根变量与暗色变量的快照。
24
+ - `src/styles/vfit-vars.scss`:原项目尺寸变量,默认缩放比例 1,不依赖 VFit 运行时。
25
+ - `src/stores/theme.ts`:保留原主题状态、默认值、迁移及 CSS 派生逻辑;预览站继续保留原浏览器存储键 `userssite-element-plus-theme`,不影响组件包名称。
26
+ - `src/styles/element-plus.css`:新增的 Element Plus 状态适配层,包含主色梯度、禁用、浮层和共享成功 / 警告语义色。这部分需要重点核对。
27
+ - `src/styles/site.css`:仅预览站布局,不进入 npm 样式包。
28
+ - 不包含地图样式规则、业务数据色带、业务页面局部样式、全局 body 重置或字体二进制。HarmonyOS Sans SC 可由使用方自行加载,否则使用系统中文字体回退。
29
+
30
+ 原项目文件不随预览站修改;当前目录是独立快照,后续主题修订在此目录进行。CSS 包使用全局 `:root` / `.theme-dark` 变量,应在 Element Plus CSS 之后加载。
31
+
32
+ ## 项目原生组件
33
+
34
+ 预览站的「项目原生组件」直接使用原项目 `src/components/common` 中的 AppSelect、TreeSelectPanel、MapTimeline 和 TimeRangeQuickSelect。保留原有注释、局部 CSS、下拉浮层、动画及交互逻辑。独立包仅补充显式 Element Plus 导入和类型兼容修正;AppSelect 值类型补充多选数组。
35
+
36
+ `MapTimeline` 是项目中实况 / 预报分段时间轴;旧的 `src/components/timeline/index.vue` 小时时间轴尚未迁入。当前树节点、站点和时间序列为静态示例,不连接原业务接口。
37
+
38
+ ```ts
39
+ import 'element-plus/dist/index.css'
40
+ import 'sky-ui-kit/style.css'
41
+ import { AppSelect, TreeSelectPanel, MapTimeline, TimeRangeQuickSelect } from 'sky-ui-kit/components'
42
+ ```
43
+
44
+ 组件包额外需要 `@element-plus/icons-vue` 和 `motion-v`。组件 CSS 已合并到 `style.css`,包含 Vue scoped 样式。
45
+
46
+ ## 菜单样式
47
+
48
+ ## 地图工具样式
49
+
50
+ 独立展示区提供竖向地图工具栏、横向排列和静态图层控制浮动面板。`MapTools` 提取原 `MapToolbar.vue` 的按钮样式,默认包含图层、模块操作、刷新、定位、地图设置、空间分析和右键菜单。通过 `active` 指定选中工具,通过 `horizontal` 展示横向排列;支持 v-model:active、tool-click 和 context-change 事件;使用方通过事件接入地图、GIS 或业务接口。组件从 `sky-ui-kit/components` 导出,CSS 合并到 `style.css`。
51
+
52
+ ## 地图与普通菜单
53
+
54
+ 新增 `MapSideMenu` 地图胶囊菜单,样式直接提取自原项目 `SideMenuMap.vue`,保留分类圆形图标、橙色标题、蓝色子项、选中状态、连接线、顶部搜索胶囊和纯图标状态。图标使用 Element Plus 图标,可通过菜单项的 `icon` 属性传入自定义 Vue 图标组件。属性为 `title`、`active`、`dark`、`compact`、`items`(key / label / icon)。支持菜单选择、搜索过滤、分类展开收起和图标模式切换;通过 v-model:active、v-model:compact 和 select 事件接入业务。
55
+
56
+ ProjectMenu 从原 Header 和 SideMenu 提取独立菜单样式,仅展示横向、纵向、默认、选中和禁用状态。
57
+
58
+ 从 sky-ui-kit/components 导入 ProjectMenu。属性:direction(horizontal / vertical)、active、items(key / label / disabled)及 groups(label / items)。菜单支持选择和分组折叠,通过 v-model:active 和 select 事件接入业务,不包含平台整体结构。
59
+
60
+ ## 接入其他项目
61
+
62
+ 无需导入 useThemeStore,也无需安装 Pinia。直接引入 Element Plus CSS 与库 CSS,项目已有的同名变量优先;未定义的变量采用库默认值。详细优先级及暗色规则见 [CSS-THEME.md](docs/CSS-THEME.md)。
63
+
64
+ ```ts
65
+ import 'element-plus/dist/index.css'
66
+ import 'sky-ui-kit/style.css'
67
+ import { UiButton, AppSelect } from 'sky-ui-kit'
68
+ ```
69
+
70
+ 默认暗色:在 html 添加 theme-dark 类。当前项目可以继续使用自己的主题 store。预览站调色面板的 store 仅用于站内演示,不导出到 npm 包。
71
+
72
+ ## 检查与打包
73
+
74
+ ```sh
75
+ npm run typecheck
76
+ npm run build
77
+ npm pack --dry-run
78
+ ```
79
+
80
+ `site-dist/` 是可部署的预览网站,`dist/` 是 npm 库产物。npm 包仅包含库产物、主题 store 源文件与 README,不包含预览网站及原业务代码。
81
+
82
+ ## 核对完成后发布
83
+
84
+ 当前 `private: true` 用于防止未审核主题发布。包名已确定为 `sky-ui-kit`,尚未核验 npm 名称可用性。发布前确认包名或 npm scope、版本、代码及字体授权、许可证,并将 `private` 删除或改为 false。若使用 scope,保持接入示例与最终包名一致。
85
+
86
+ ```sh
87
+ npm login
88
+ npm run typecheck
89
+ npm pack --dry-run
90
+ npm publish --access public
91
+ ```
92
+
93
+ `prepack` 会自动构建。不要把 npm token 写入此目录。本次仅准备预览及包结构,等待样式核对后再发布。
94
+
95
+ ## 样式隔离
96
+
97
+ 默认 style.css 只给库组件作用域设置样式,作用域之外的原生 Element Plus 不受库 CSS 覆盖。主动整站换肤才额外导入 global.css。浮层、局部变量和默认 teleported 差异见 [CSS-THEME.md](docs/CSS-THEME.md)。开发验证页:[样式隔离验证](http://127.0.0.1:5180/isolation.html)。
@@ -0,0 +1,28 @@
1
+ export type AppSelectValue = string | number | boolean | Record<string, unknown> | AppSelectValue[] | null | undefined;
2
+ export type AppSelectOption = {
3
+ label: string;
4
+ value: AppSelectValue;
5
+ disabled?: boolean;
6
+ } | string | number;
7
+ type __VLS_Props = {
8
+ modelValue?: AppSelectValue;
9
+ options?: AppSelectOption[];
10
+ emptyLabel?: string;
11
+ popperClass?: string;
12
+ teleported?: boolean;
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ change: (value: AppSelectValue) => any;
16
+ "update:modelValue": (value: AppSelectValue) => any;
17
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
18
+ onChange?: ((value: AppSelectValue) => any) | undefined;
19
+ "onUpdate:modelValue"?: ((value: AppSelectValue) => any) | undefined;
20
+ }>, {
21
+ popperClass: string;
22
+ teleported: boolean;
23
+ modelValue: string | number | boolean | Record<string, unknown> | AppSelectValue[] | null;
24
+ options: AppSelectOption[];
25
+ emptyLabel: string;
26
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
27
+ declare const _default: typeof __VLS_export;
28
+ export default _default;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ title: string;
3
+ subtitle?: string;
4
+ rightOpen?: boolean;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
7
+ subtitle: string;
8
+ rightOpen: boolean;
9
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,16 @@
1
+ type __VLS_Props = {
2
+ open?: boolean;
3
+ openTitle?: string;
4
+ closeTitle?: string;
5
+ };
6
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
7
+ toggle: () => any;
8
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onToggle?: (() => any) | undefined;
10
+ }>, {
11
+ open: boolean;
12
+ openTitle: string;
13
+ closeTitle: string;
14
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
+ declare const _default: typeof __VLS_export;
16
+ export default _default;
@@ -0,0 +1,30 @@
1
+ import type { Component } from 'vue';
2
+ export interface MapMenuItem {
3
+ key: string;
4
+ label: string;
5
+ icon?: Component;
6
+ }
7
+ type __VLS_Props = {
8
+ title?: string;
9
+ active?: string;
10
+ dark?: boolean;
11
+ compact?: boolean;
12
+ items?: MapMenuItem[];
13
+ };
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ select: (item: MapMenuItem) => any;
16
+ "update:active": (key: string) => any;
17
+ "update:compact": (value: boolean) => any;
18
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
19
+ onSelect?: ((item: MapMenuItem) => any) | undefined;
20
+ "onUpdate:active"?: ((key: string) => any) | undefined;
21
+ "onUpdate:compact"?: ((value: boolean) => any) | undefined;
22
+ }>, {
23
+ title: string;
24
+ dark: boolean;
25
+ active: string;
26
+ items: MapMenuItem[];
27
+ compact: boolean;
28
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: typeof __VLS_export;
30
+ export default _default;
@@ -0,0 +1,87 @@
1
+ type IntervalUnit = 'minute' | 'hour' | 'day' | 'month' | 'year';
2
+ type TimelineKind = 'observed' | 'forecast';
3
+ type TimelineTimeInput = string | number | Date;
4
+ export interface TimelinePoint {
5
+ index: number;
6
+ offset: number;
7
+ time: Date;
8
+ value: string;
9
+ label: string;
10
+ kind: TimelineKind;
11
+ disabled?: boolean;
12
+ }
13
+ type __VLS_Props = {
14
+ modelValue?: number;
15
+ startTime?: TimelineTimeInput;
16
+ points?: TimelinePoint[];
17
+ steps?: number;
18
+ pastSteps?: number;
19
+ futureSteps?: number;
20
+ interval?: number;
21
+ unit?: IntervalUnit;
22
+ playing?: boolean;
23
+ speed?: number;
24
+ speeds?: number[];
25
+ internalPlayback?: boolean;
26
+ pageSize?: number;
27
+ loop?: boolean;
28
+ minTime?: TimelineTimeInput;
29
+ maxTime?: TimelineTimeInput;
30
+ forecastCount?: number;
31
+ showScale?: boolean;
32
+ showCurrentMarker?: boolean;
33
+ timeZone?: string;
34
+ };
35
+ declare function setStartTime(value: TimelineTimeInput): void;
36
+ declare function handleJumpChange(value: Date | string | number | null): void;
37
+ declare var __VLS_50: {
38
+ startTime: Date;
39
+ activePoint: TimelinePoint;
40
+ activeIndex: number;
41
+ value: Date | null;
42
+ setStartTime: typeof setStartTime;
43
+ jumpToTime: typeof handleJumpChange;
44
+ };
45
+ type __VLS_Slots = {} & {
46
+ 'date-select'?: (props: typeof __VLS_50) => any;
47
+ };
48
+ declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
49
+ change: (point: TimelinePoint) => any;
50
+ pause: () => any;
51
+ play: () => any;
52
+ "update:modelValue": (value: number) => any;
53
+ "update:startTime": (value: TimelineTimeInput) => any;
54
+ "update:playing": (value: boolean) => any;
55
+ "update:speed": (value: number) => any;
56
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
57
+ onChange?: ((point: TimelinePoint) => any) | undefined;
58
+ onPause?: (() => any) | undefined;
59
+ onPlay?: (() => any) | undefined;
60
+ "onUpdate:modelValue"?: ((value: number) => any) | undefined;
61
+ "onUpdate:startTime"?: ((value: TimelineTimeInput) => any) | undefined;
62
+ "onUpdate:playing"?: ((value: boolean) => any) | undefined;
63
+ "onUpdate:speed"?: ((value: number) => any) | undefined;
64
+ }>, {
65
+ playing: boolean;
66
+ interval: number;
67
+ loop: boolean;
68
+ modelValue: number;
69
+ pageSize: number;
70
+ startTime: TimelineTimeInput;
71
+ points: TimelinePoint[];
72
+ steps: number;
73
+ unit: IntervalUnit;
74
+ speed: number;
75
+ speeds: number[];
76
+ internalPlayback: boolean;
77
+ showScale: boolean;
78
+ showCurrentMarker: boolean;
79
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
80
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
81
+ declare const _default: typeof __VLS_export;
82
+ export default _default;
83
+ type __VLS_WithSlots<T, S> = T & {
84
+ new (): {
85
+ $slots: S;
86
+ };
87
+ };
@@ -0,0 +1,21 @@
1
+ import { type Component } from 'vue';
2
+ type __VLS_Props = {
3
+ active?: string;
4
+ horizontal?: boolean;
5
+ icons?: Record<string, Component>;
6
+ };
7
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
8
+ "update:active": (key: string) => any;
9
+ "tool-click": (key: string) => any;
10
+ "context-change": (enabled: boolean) => any;
11
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ "onUpdate:active"?: ((key: string) => any) | undefined;
13
+ "onTool-click"?: ((key: string) => any) | undefined;
14
+ "onContext-change"?: ((enabled: boolean) => any) | undefined;
15
+ }>, {
16
+ horizontal: boolean;
17
+ icons: Record<string, Component>;
18
+ active: string;
19
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
20
+ declare const _default: typeof __VLS_export;
21
+ export default _default;
@@ -0,0 +1,11 @@
1
+ type __VLS_Props = {
2
+ times: string[];
3
+ series: {
4
+ name: string;
5
+ data: (number | null)[];
6
+ }[];
7
+ loading?: boolean;
8
+ };
9
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ declare const _default: typeof __VLS_export;
11
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import { type Component } from 'vue';
2
+ export interface ProjectMenuItem {
3
+ key: string;
4
+ label: string;
5
+ disabled?: boolean;
6
+ icon?: Component;
7
+ }
8
+ export interface ProjectMenuGroup {
9
+ label: string;
10
+ items: ProjectMenuItem[];
11
+ }
12
+ type __VLS_Props = {
13
+ direction?: 'horizontal' | 'vertical';
14
+ active?: string;
15
+ items?: ProjectMenuItem[];
16
+ groups?: ProjectMenuGroup[];
17
+ };
18
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
19
+ select: (item: ProjectMenuItem) => any;
20
+ "update:active": (key: string) => any;
21
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onSelect?: ((item: ProjectMenuItem) => any) | undefined;
23
+ "onUpdate:active"?: ((key: string) => any) | undefined;
24
+ }>, {
25
+ direction: "horizontal" | "vertical";
26
+ active: string;
27
+ items: ProjectMenuItem[];
28
+ groups: ProjectMenuGroup[];
29
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
30
+ declare const _default: typeof __VLS_export;
31
+ export default _default;
@@ -0,0 +1,22 @@
1
+ export type TimeRangeQuickOption = {
2
+ key: string;
3
+ label: string;
4
+ amount?: number;
5
+ unit?: 'hour' | 'day';
6
+ };
7
+ type __VLS_Props = {
8
+ modelValue: string;
9
+ options: TimeRangeQuickOption[];
10
+ ariaLabel?: string;
11
+ };
12
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
13
+ change: (option: TimeRangeQuickOption) => any;
14
+ "update:modelValue": (value: string) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
16
+ onChange?: ((option: TimeRangeQuickOption) => any) | undefined;
17
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
18
+ }>, {
19
+ ariaLabel: string;
20
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
21
+ declare const _default: typeof __VLS_export;
22
+ export default _default;
@@ -0,0 +1,57 @@
1
+ export interface TreeSelectNode {
2
+ id: string | number;
3
+ label: string;
4
+ tag?: string;
5
+ disabled?: boolean;
6
+ children?: TreeSelectNode[];
7
+ [key: string]: unknown;
8
+ }
9
+ export interface TreeSelectCategory {
10
+ type: string;
11
+ label: string;
12
+ children: TreeSelectNode[];
13
+ }
14
+ type __VLS_Props = {
15
+ modelValue?: string | number | null;
16
+ categories?: TreeSelectCategory[];
17
+ placeholder?: string;
18
+ searchPlaceholder?: string;
19
+ emptyText?: string;
20
+ fallbackTypeLabel?: string;
21
+ popoverWidth?: string | number;
22
+ defaultActiveType?: string;
23
+ defaultExpandAll?: boolean;
24
+ closeOnSelect?: boolean;
25
+ closeOnMouseLeave?: boolean;
26
+ dark?: boolean;
27
+ };
28
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
29
+ select: (node: TreeSelectNode, category: TreeSelectCategory) => any;
30
+ change: (payload: {
31
+ node: TreeSelectNode;
32
+ category: TreeSelectCategory;
33
+ }) => any;
34
+ "update:modelValue": (value: string | number | null) => any;
35
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
36
+ onSelect?: ((node: TreeSelectNode, category: TreeSelectCategory) => any) | undefined;
37
+ onChange?: ((payload: {
38
+ node: TreeSelectNode;
39
+ category: TreeSelectCategory;
40
+ }) => any) | undefined;
41
+ "onUpdate:modelValue"?: ((value: string | number | null) => any) | undefined;
42
+ }>, {
43
+ dark: boolean;
44
+ placeholder: string;
45
+ modelValue: string | number | null;
46
+ emptyText: string;
47
+ defaultExpandAll: boolean;
48
+ categories: TreeSelectCategory[];
49
+ searchPlaceholder: string;
50
+ fallbackTypeLabel: string;
51
+ popoverWidth: string | number;
52
+ defaultActiveType: string;
53
+ closeOnSelect: boolean;
54
+ closeOnMouseLeave: boolean;
55
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
56
+ declare const _default: typeof __VLS_export;
57
+ export default _default;