@archbiz/element-plus 0.0.0-stage → 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/dist/style.css ADDED
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * Archbiz
3
+ * @archbiz/element-plus v0.1.1
4
+ * (c) 2018-2026 Dio Zhu
5
+ * Released under the MIT License.
6
+ */
7
+ .ab-search-expand-enter-active[data-v-bfc6a8b4]{transition:all .3s ease-in-out}.ab-search-expand-leave-active[data-v-bfc6a8b4]{transition:all .2s ease-out}.ab-search-expand-enter[data-v-bfc6a8b4],.ab-search-expand-leave-active[data-v-bfc6a8b4]{transform:translateZ(0);height:0;opacity:0}.ab-input-range{display:flex;align-items:center}.ab-input-range .range-splitter,.ab-input-range .range-prefix,.ab-input-range .range-suffix{margin:0 10px;font-weight:300;white-space:nowrap}.ab-time-period{display:flex;align-items:center;justify-content:flex-start}.ab-time-period__warning{width:100%;color:var(--el-color-warning)}.ab-time-period .el-slider.is-empty .el-slider__bar{visibility:hidden}.ab-time-period .start-time,.ab-time-period .end-time{width:78px;height:100%}.ab-time-period .end-time{text-align:right}.ab-upload-file__list{margin:0;padding:0;list-style:none}.ab-upload-file__item{display:flex;align-items:center;gap:8px}
package/package.json CHANGED
@@ -1,6 +1,63 @@
1
1
  {
2
2
  "name": "@archbiz/element-plus",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "Archbiz adapter for Element Plus and VXE",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "main": "./dist/element-plus.cjs",
8
+ "module": "./dist/element-plus.min.js",
9
+ "types": "./types/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./types/index.d.ts",
13
+ "import": "./dist/element-plus.min.js",
14
+ "require": "./dist/element-plus.cjs"
15
+ },
16
+ "./style.css": "./dist/style.css"
17
+ },
18
+ "scripts": {
19
+ "dev": "vite --config vite.dev.config.mjs",
20
+ "build": "vite build --config vite.build.config.mjs",
21
+ "prepack": "npm run build"
22
+ },
23
+ "keywords": [
24
+ "@archbiz"
25
+ ],
26
+ "files": [
27
+ "README.md",
28
+ "package.json",
29
+ "LICENSE",
30
+ "types",
31
+ "dist"
32
+ ],
33
+ "author": "Dio Zhu",
34
+ "publishConfig": {
35
+ "access": "public"
36
+ },
37
+ "dependencies": {
38
+ "@archbiz/core-v3": "^0.1.0",
39
+ "@archbiz/utils": "^0.1.0",
40
+ "@purge-icons/generated": "^0.10.0",
41
+ "dayjs": "^1.11.23",
42
+ "lodash-es": "^4.18.1"
43
+ },
44
+ "peerDependencies": {
45
+ "element-plus": "^2.14.0",
46
+ "vue": "^3.5.12",
47
+ "vue-router": "^5.5.0",
48
+ "vxe-pc-ui": "^4.20.40",
49
+ "vxe-table": "^4.23.17"
50
+ },
51
+ "devDependencies": {
52
+ "@element-plus/icons-vue": "^2.3.1",
53
+ "@idss-d/json-editor-vue3": "^1.0.5",
54
+ "@types/lodash-es": "^4.17.12",
55
+ "@vitejs/plugin-vue": "^5.2.4",
56
+ "@vitejs/plugin-vue-jsx": "^4.2.0",
57
+ "monaco-editor": "^0.57.0",
58
+ "npm-run-all": "^4.1.5",
59
+ "rimraf": "^6.0.1",
60
+ "vite": "^5.4.21",
61
+ "vite-plugin-banner": "^0.8.0"
62
+ }
63
+ }
@@ -0,0 +1,22 @@
1
+ import type { FormRule as CoreFormRule, Rule as CoreRule } from '@archbiz/core-v3/ab-form/types';
2
+ import type { VxeColumnPropTypes } from 'vxe-table';
3
+ import type { AbTableColumn, AbRouterLinkConfig } from '../ab-table';
4
+
5
+ export interface AbElementRuleAttrs {
6
+ title?: string | { title?: string; show?: boolean; native?: boolean; [key: string]: unknown };
7
+ formatter?: VxeColumnPropTypes.Formatter;
8
+ cellRender?: boolean | VxeColumnPropTypes.CellRender<any>;
9
+ rangeFields?: string[];
10
+ link?: AbRouterLinkConfig | string[];
11
+ }
12
+
13
+ type CoreElementRule = CoreRule<unknown, unknown, AbElementRuleAttrs, unknown>;
14
+
15
+ export type AbFormRule = CoreFormRule<unknown, unknown, AbElementRuleAttrs, unknown>;
16
+
17
+ export type AbRule = Omit<CoreElementRule, 'children'> &
18
+ Omit<Partial<AbTableColumn>, 'children' | 'cellRender' | 'formatter' | 'link' | 'title'> & {
19
+ children?: Array<AbRule | string>;
20
+ link?: AbRouterLinkConfig | string[];
21
+ title?: AbElementRuleAttrs['title'];
22
+ };
@@ -0,0 +1,115 @@
1
+ import type { VxeColumnPropTypes, VxeColumnProps, VxeComponentSizeType, VxeTableDefines, VxeTablePropTypes } from 'vxe-table';
2
+ import type { Creator } from '@archbiz/core-v3';
3
+
4
+ export type AbTableRow = Record<string, any>;
5
+ export type AbTableOption = string | Record<string, unknown>;
6
+ export type AbTableQueryResult = AbTableRow[] | { data?: AbTableRow[]; list?: AbTableRow[]; total?: number };
7
+ export type AbTableSummaryTotals = Readonly<Record<string, number | null>>;
8
+ export type AbTableSummaryHandler = (params: { rows: readonly AbTableRow[]; totals: AbTableSummaryTotals }) => number | null;
9
+ export interface AbTableFooterSummary {
10
+ labelField: string;
11
+ label?: string;
12
+ fields: Array<string | Record<string, AbTableSummaryHandler>>;
13
+ }
14
+ export type AbTableFooterFormatter = (params: {
15
+ cellValue: number;
16
+ row: Readonly<Record<string, number | string | null>>;
17
+ column: VxeTableDefines.ColumnInfo | AbTableColumn;
18
+ }) => unknown;
19
+ export type AbRouterLinkConfig =
20
+ | string
21
+ | {
22
+ name: string;
23
+ query?: string | Record<string, string>;
24
+ params?: string | Record<string, string>;
25
+ }
26
+ | ((row: AbTableRow) => import('vue-router').RouteLocationRaw | undefined);
27
+
28
+ export interface AbTablePagerConfig {
29
+ pageNoField?: string;
30
+ pageSizeField?: string;
31
+ sortFieldTableField?: string;
32
+ sortFieldField?: string;
33
+ sortTypeField?: string;
34
+ layouts?: (
35
+ 'Home' | 'PrevJump' | 'PrevPage' | 'Number' | 'NextPage' | 'NextJump' | 'End' | 'Sizes' | 'FullJump' | 'Total' | 'Jump' | 'PageCount' | 'JumpNumber'
36
+ )[];
37
+ }
38
+
39
+ /** Column configuration shared by the table and its column groups. */
40
+ export interface AbTableColumn extends VxeColumnProps {
41
+ type?: string;
42
+ title?: string;
43
+ children?: AbTableColumn[];
44
+ group?: string | string[];
45
+ groupAlign?: VxeColumnProps['align'];
46
+ expand?: { title?: string };
47
+ field2?: string;
48
+ transField?: string;
49
+ formatter?: VxeColumnPropTypes.Formatter;
50
+ footerFormatter?: AbTableFooterFormatter;
51
+ cellRender?: boolean | VxeColumnPropTypes.CellRender<any>;
52
+ tableVisible?: boolean;
53
+ hidden?: boolean;
54
+ sortField?: string;
55
+ sortFieldTable?: string | boolean;
56
+ options?: any;
57
+ props?: any;
58
+ link?: AbRouterLinkConfig;
59
+ edit?: {
60
+ type?: string;
61
+ value?: unknown;
62
+ options?: AbTableOption[];
63
+ };
64
+ on?: any;
65
+ cellArrow?: boolean;
66
+ }
67
+
68
+ export interface AbTableProps {
69
+ id?: string;
70
+ idField?: string;
71
+ idFieldTable?: string;
72
+ parentIdField?: string;
73
+ hasChildField?: string;
74
+ accordion?: boolean;
75
+ lazyMethod?: VxeTablePropTypes.TreeConfig['loadMethod'];
76
+ modelValue?: Record<string, unknown>;
77
+ rule?: AbTableColumn[];
78
+ columns?: (AbTableColumn | Creator)[];
79
+ query?: Record<string, unknown>;
80
+ pagerConfig?: AbTablePagerConfig;
81
+ validRules?: VxeTablePropTypes.EditRules;
82
+ autoLoad?: boolean;
83
+ dataList?: AbTableRow[];
84
+ queryHandler?: (params: Record<string, unknown>) => AbTableQueryResult | Promise<AbTableQueryResult>;
85
+ singleSelect?: boolean;
86
+ multiSelect?: boolean;
87
+ editable?: boolean;
88
+ sortable?: boolean;
89
+ sortLocally?: boolean;
90
+ sortField?: string;
91
+ pagerEnable?: boolean;
92
+ footerSummary?: AbTableFooterSummary;
93
+ seqEnable?: boolean;
94
+ seqTitle?: string;
95
+ size?: VxeComponentSizeType;
96
+ rowClassName?: VxeTablePropTypes.RowClassName<AbTableRow>;
97
+ headerCellClassName?: VxeTablePropTypes.HeaderCellClassName<AbTableRow>;
98
+ cellClassName?: VxeTablePropTypes.CellClassName<AbTableRow>;
99
+ rowStyle?: VxeTablePropTypes.RowStyle<AbTableRow>;
100
+ isCurrent?: boolean;
101
+ checkboxLabelField?: string;
102
+ autoHeight?: boolean;
103
+ layouts?: (
104
+ 'Home' | 'PrevJump' | 'PrevPage' | 'Number' | 'NextPage' | 'NextJump' | 'End' | 'Sizes' | 'FullJump' | 'Total' | 'Jump' | 'PageCount' | 'JumpNumber'
105
+ )[];
106
+ pagerClassName?: string;
107
+ defIds?: unknown[] | null;
108
+ offsetTop?: number;
109
+ readonly?: boolean;
110
+ dragable?: boolean;
111
+ absDragable?: boolean;
112
+ compactMode?: boolean;
113
+ maxHeight?: number;
114
+ expandConfig?: VxeTablePropTypes.ExpandConfig<AbTableRow>;
115
+ }
@@ -0,0 +1,53 @@
1
+ export type UploadId = string | number;
2
+
3
+ export interface UploadFileInfo {
4
+ id?: UploadId;
5
+ fileId: UploadId;
6
+ name: string;
7
+ url: string;
8
+ size?: number;
9
+ isCover?: boolean | number;
10
+ }
11
+
12
+ export interface UploadBusinessParams {
13
+ businessType?: string;
14
+ businessCode?: string;
15
+ businessId: UploadId;
16
+ }
17
+
18
+ export interface UploadApis {
19
+ upload(args: { file: File }): Promise<{ data: { id: UploadId; name: string; url: string; size?: number } }>;
20
+ list(args: UploadBusinessParams & { pageSize: number }): Promise<{ list: UploadFileInfo[] }>;
21
+ attach(args: UploadBusinessParams & { fileIds: UploadId[]; isCover: number }): Promise<unknown>;
22
+ remove(args: UploadBusinessParams & { fileId: UploadId }): Promise<unknown>;
23
+ setCover(id: UploadId, isCover: number): Promise<unknown>;
24
+ }
25
+
26
+ export interface ArchbizKitOptions {
27
+ upload?: UploadApis;
28
+ }
29
+
30
+ export interface AbUploadFileProps {
31
+ modelValue?: string[];
32
+ apis?: UploadApis;
33
+ idFieldTable?: string;
34
+ businessCode?: string;
35
+ fileType?: string[];
36
+ fileSize?: number;
37
+ limit?: number;
38
+ drag?: boolean;
39
+ isShowTip?: boolean;
40
+ readonly?: boolean;
41
+ disabled?: boolean;
42
+ delEnabled?: boolean;
43
+ preEnabled?: boolean;
44
+ dowEnabled?: boolean;
45
+ coverEnabled?: boolean;
46
+ autoCover?: boolean;
47
+ }
48
+
49
+ export interface AbUploadFileInstance {
50
+ waitForUploads(): Promise<void>;
51
+ waitForAssociations(): Promise<void>;
52
+ retryAssociations(): void;
53
+ }
package/types/css.d.ts ADDED
@@ -0,0 +1 @@
1
+ declare module "*.css";
@@ -0,0 +1,33 @@
1
+ import type { App, DefineComponent, Plugin } from "vue";
2
+ import type { AbTableProps } from "./ab-table";
3
+ import type { AbUploadFileProps, AbUploadFileInstance, ArchbizKitOptions } from "./ab-upload";
4
+
5
+ export type { AbElementRuleAttrs, AbFormRule, AbRule } from "./ab-form";
6
+ export type { ArchbizKitOptions, AbUploadFileProps, AbUploadFileInstance, UploadApis, UploadBusinessParams, UploadFileInfo, UploadId } from "./ab-upload";
7
+ export declare const AbUploadFile: DefineComponent<AbUploadFileProps> & {
8
+ new (): AbUploadFileInstance;
9
+ };
10
+ export type {
11
+ AbTableColumn,
12
+ AbTableFooterFormatter,
13
+ AbTableFooterSummary,
14
+ AbTableOption,
15
+ AbTablePagerConfig,
16
+ AbTableProps,
17
+ AbTableQueryResult,
18
+ AbTableRow,
19
+ AbTableSummaryHandler,
20
+ AbTableSummaryTotals,
21
+ AbRouterLinkConfig,
22
+ } from "./ab-table";
23
+ export declare const AbTable: DefineComponent<AbTableProps> & {
24
+ new (): { reload(): Promise<void>; refresh(): Promise<void> };
25
+ };
26
+
27
+ export declare const AbForm: Plugin & {
28
+ use(fn: unknown, options?: unknown): unknown;
29
+ maker: Record<string, unknown>;
30
+ };
31
+ export declare const maker: Record<string, unknown>;
32
+
33
+ export declare function setupArchbizKit(app: App<Element>, options?: ArchbizKitOptions): void;
package/types/jsx.d.ts ADDED
@@ -0,0 +1,13 @@
1
+ declare module "*.jsx" {
2
+ import type { DefineComponent } from "vue";
3
+
4
+ const component: DefineComponent;
5
+ export default component;
6
+ }
7
+
8
+ declare module "*.vue" {
9
+ import type { DefineComponent } from "vue";
10
+
11
+ const component: DefineComponent;
12
+ export default component;
13
+ }
@@ -0,0 +1,5 @@
1
+ declare module "@purge-icons/generated" {
2
+ const Iconify: typeof import("@iconify/iconify").default;
3
+ export default Iconify;
4
+ export * from "@iconify/iconify";
5
+ }