@jt-home/mfe-components 1.0.62-beta.0 → 1.0.62
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/JtAttachmentPreview/index.cjs +1 -2
- package/dist/JtAttachmentPreview/index.mjs +1118 -8
- package/dist/JtAttachmentPreview/style.css +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +1678 -1680
- package/dist/locale/index.cjs +1 -0
- package/dist/locale/index.mjs +629 -0
- package/dist/pdf-BmBuG7of.js +18058 -0
- package/dist/pdf-Da0bm_Ya.cjs +55 -0
- package/dist/pdf.worker.min-4PI-nNLo.js +4 -0
- package/dist/pdf.worker.min-BAJUPwg6.cjs +1 -0
- package/dist/style.css +1 -1
- package/dist/types/components/JtAttachmentPreview/index.d.ts +3 -3
- package/dist/types/components/JtAttachmentPreview/types.d.ts +4 -6
- package/dist/types/components/form/types.d.ts +4 -1
- package/dist/types/components/globalInfo/model/slotIdentity.d.ts +1 -1
- package/dist/types/components/globalInfo/model/types.d.ts +1 -1
- package/dist/types/locale/index.d.ts +2 -1
- package/dist/types/locale/types.d.ts +1 -2
- package/dist/types/main.d.ts +1 -5
- package/package.json +32 -28
- package/readme.md +694 -694
- package/dist/index-BdgCXrMw.js +0 -1542
- package/dist/index-DtqPcdZG.cjs +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import './style.scss';
|
|
2
|
+
import type { JtAttachmentPreviewHandler, JtAttachmentPreviewOptions, JtAttachmentPreviewRequestConfig } from './types';
|
|
3
|
+
export type { JtAttachmentPreviewMode, JtAttachmentPreviewOptions, JtAttachmentPreviewDownloadContext, JtAttachmentPreviewDownloadHandler, JtAttachmentPreviewDownloadResult, JtAttachmentPreviewFileOptions, JtAttachmentPreviewHandler, JtAttachmentPreviewRequestConfig, JtAttachmentPreviewResolvedType, JtAttachmentPreviewService, } from './types';
|
|
3
4
|
declare function openAttachmentPreview(options: string | JtAttachmentPreviewOptions): JtAttachmentPreviewHandler;
|
|
4
|
-
export declare function setupJtAttachmentPreview<Params = unknown>(resolveFile: JtAttachmentPreviewResolveFileHandler<Params>): void;
|
|
5
5
|
export declare function setupJtAttachmentPreview<Params = unknown, Response = unknown, DownloadResponse = unknown>(config: JtAttachmentPreviewRequestConfig<Params, Response, DownloadResponse>): void;
|
|
6
6
|
export declare function JtAttachmentPreviewByParams<Params = unknown>(params: Params): JtAttachmentPreviewHandler;
|
|
7
7
|
export declare const JtAttachmentPreview: typeof openAttachmentPreview & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type JtAttachmentPreviewMode = 'auto' | 'image' | 'pdf';
|
|
1
|
+
export type JtAttachmentPreviewMode = 'auto' | 'image' | 'pdf' | 'video' | 'audio' | 'iframe';
|
|
2
2
|
export interface JtAttachmentPreviewDownloadContext<Params = unknown> {
|
|
3
3
|
url: string;
|
|
4
4
|
name: string;
|
|
@@ -40,6 +40,8 @@ export interface JtAttachmentPreviewOptions {
|
|
|
40
40
|
download?: JtAttachmentPreviewDownloadHandler;
|
|
41
41
|
/** 弹窗层级。 */
|
|
42
42
|
zIndex?: number;
|
|
43
|
+
/** iframe sandbox 属性,不传则不限制 iframe。 */
|
|
44
|
+
sandbox?: string;
|
|
43
45
|
/** 按 Esc 时是否关闭弹窗。 */
|
|
44
46
|
closeOnPressEscape?: boolean;
|
|
45
47
|
/** 加载成功回调。 */
|
|
@@ -50,7 +52,6 @@ export interface JtAttachmentPreviewOptions {
|
|
|
50
52
|
onClose?: () => void;
|
|
51
53
|
}
|
|
52
54
|
export type JtAttachmentPreviewFileOptions = JtAttachmentPreviewOptions;
|
|
53
|
-
export type JtAttachmentPreviewResolveFileHandler<Params = unknown> = (params: Params) => JtAttachmentPreviewFileOptions | Promise<JtAttachmentPreviewFileOptions>;
|
|
54
55
|
export interface JtAttachmentPreviewRequestConfig<Params = unknown, Response = unknown, DownloadResponse = unknown> {
|
|
55
56
|
/** 根据业务参数请求文件信息。可以直接调用 axios、fetch 或项目内 request。 */
|
|
56
57
|
request: (params: Params) => Promise<Response>;
|
|
@@ -68,8 +69,5 @@ export interface JtAttachmentPreviewHandler {
|
|
|
68
69
|
export interface JtAttachmentPreviewService {
|
|
69
70
|
(options: string | JtAttachmentPreviewOptions): JtAttachmentPreviewHandler;
|
|
70
71
|
openByParams: <Params = unknown>(params: Params) => JtAttachmentPreviewHandler;
|
|
71
|
-
setup:
|
|
72
|
-
<Params = unknown>(resolveFile: JtAttachmentPreviewResolveFileHandler<Params>): void;
|
|
73
|
-
<Params = unknown, Response = unknown, DownloadResponse = unknown>(config: JtAttachmentPreviewRequestConfig<Params, Response, DownloadResponse>): void;
|
|
74
|
-
};
|
|
72
|
+
setup: <Params = unknown, Response = unknown, DownloadResponse = unknown>(config: JtAttachmentPreviewRequestConfig<Params, Response, DownloadResponse>) => void;
|
|
75
73
|
}
|
|
@@ -21,7 +21,7 @@ interface JTFormItemBaseConfig {
|
|
|
21
21
|
prop: string;
|
|
22
22
|
/** 标签文本 */
|
|
23
23
|
label: string;
|
|
24
|
-
/**
|
|
24
|
+
/** 占几列,上限跟随 JtFormItems.gridColumns */
|
|
25
25
|
span?: number;
|
|
26
26
|
/** 是否显示当前表单项,false 时不渲染 */
|
|
27
27
|
show?: boolean;
|
|
@@ -66,6 +66,9 @@ export interface JTFormItemsProps {
|
|
|
66
66
|
configs: JTFormItemConfig[];
|
|
67
67
|
/** 表单数据对象 */
|
|
68
68
|
formData: JTFormItemsForm;
|
|
69
|
+
/** 表单 grid 总列数,默认 4,支持 1-24 */
|
|
70
|
+
gridColumns?: number;
|
|
71
|
+
/** 统一设置表单项占用列数,上限跟随 gridColumns */
|
|
69
72
|
span?: number;
|
|
70
73
|
}
|
|
71
74
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GlobalInfoNode, GlobalInfoSection } from './types';
|
|
2
2
|
type SlotRegistry = Record<string, unknown>;
|
|
3
3
|
export declare function getNodeSlotIdentity(node: Pick<GlobalInfoNode, 'code'>): string;
|
|
4
|
-
export declare function getSectionSlotIdentity(node:
|
|
4
|
+
export declare function getSectionSlotIdentity(node: Pick<GlobalInfoNode, 'code'>, section?: Pick<GlobalInfoSection, 'code'> | null): string;
|
|
5
5
|
export declare function findGlobalInfoSlotName(slotMap: SlotRegistry, prefix: string, identity: string): string;
|
|
6
6
|
export {};
|
|
@@ -418,7 +418,7 @@ export interface GlobalInfoField {
|
|
|
418
418
|
placeholder?: string;
|
|
419
419
|
/** 静态或动态加载后的选项。 */
|
|
420
420
|
options?: GlobalInfoFieldOption[];
|
|
421
|
-
/** 信息集枚举来源类型:
|
|
421
|
+
/** 信息集枚举来源类型:NOTRANS 不处理,REST 调接口,ENUMS 使用详情响应内联枚举。 */
|
|
422
422
|
valueListType?: string;
|
|
423
423
|
/** 字段动态接口描述,常用于级联下拉。 */
|
|
424
424
|
interface?: GlobalInfoApiOperation;
|
|
@@ -6,7 +6,8 @@ export { defaultMessages };
|
|
|
6
6
|
export { normalizeLocale };
|
|
7
7
|
export type { LocaleCode, LocaleMessageTree, LocaleMessages, LocaleOptions, LocaleParams, LocaleSource, } from './types.js';
|
|
8
8
|
export declare function setLocale(locale: LocaleCode): void;
|
|
9
|
-
export declare function getLocale(): string;
|
|
9
|
+
export declare function getLocale(): string | undefined;
|
|
10
10
|
export declare function resetLocale(): void;
|
|
11
|
+
export declare function install(app: App, options?: LocaleOptions): void;
|
|
11
12
|
export declare function installLocale(_app: App, options?: LocaleOptions): void;
|
|
12
13
|
export declare function t(key: string, fallback?: string, params?: LocaleParams): string;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { ComputedRef, Ref } from 'vue';
|
|
2
1
|
export type LocaleCode = 'zh-cn' | 'en' | 'th' | 'vi' | 'es' | 'id' | 'de' | 'pt' | 'km' | string;
|
|
3
2
|
export type LocaleValue = string | number | boolean | null | undefined;
|
|
4
3
|
export type LocaleParams = Record<string, LocaleValue>;
|
|
@@ -6,7 +5,7 @@ export type LocaleMessageTree = {
|
|
|
6
5
|
[key: string]: LocaleValue | LocaleMessageTree;
|
|
7
6
|
};
|
|
8
7
|
export type LocaleMessages = Record<string, LocaleMessageTree>;
|
|
9
|
-
export type LocaleSource = LocaleCode
|
|
8
|
+
export type LocaleSource = LocaleCode;
|
|
10
9
|
export type LocaleOptions = {
|
|
11
10
|
/** 当前组件库语言,业务方通常只需要传这个值。 */
|
|
12
11
|
locale?: LocaleSource;
|
package/dist/types/main.d.ts
CHANGED
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import './assets/styles/base.css';
|
|
2
|
-
|
|
3
|
-
import type { App } from 'vue';
|
|
4
|
-
import type { LocaleOptions } from './locale';
|
|
5
|
-
export declare function install(app: App, options?: LocaleOptions): void;
|
|
6
|
-
export { getLocale as getJtLocale, installLocale, normalizeLocale, resetLocale as resetJtLocale, setLocale as setJtLocale, } from './locale';
|
|
2
|
+
export { getLocale as getJtLocale, install, installLocale, normalizeLocale, resetLocale as resetJtLocale, setLocale as setJtLocale, } from './locale';
|
|
7
3
|
export type { LocaleCode, LocaleOptions, LocaleSource, } from './locale';
|
|
8
4
|
export { GlobalInfoAutoRenderer, GlobalInfoDeleteConfirm, GlobalInfoFieldControl, GlobalInfoFieldValue, GlobalInfoFormRenderer, GlobalInfoGroup, GlobalInfoLeftNav, GlobalInfoMultiFormRenderer, GlobalInfoProvider, GlobalInfoSectionBlock, GlobalInfoSectionOutlet, GlobalInfoSections, GlobalInfoTableRenderer, JtAttachmentPreview, JtAttachmentPreviewByParams, JtCascader, JtButton, JtCrudTable, JtDatePicker, JtFilterBar, JtFormItems, JtInput, JtPageHeader, JtPagination, JtSelect, JtTable, buildGlobalInfoUpdatePayload, createEmptyGlobalInfoViewModel, isGlobalInfoNode, mergeGlobalInfoChildren, normalizeGlobalInfoDetail, normalizeGlobalInfoOptions, normalizeGlobalInfoTree, resolveGlobalInfoRenderType, setupJtAttachmentPreview, useGlobalInfoController, DEFAULT_GLOBAL_INFO_REQUIRED_INFO_SET_EMPTY_MESSAGE, validateGlobalInfoRequiredInfoSet, } from './components/index';
|
|
9
5
|
export type { GlobalInfoActions, GlobalInfoApiOperation, GlobalInfoDetailParams, GlobalInfoField, GlobalInfoFieldHiddenContext, GlobalInfoFieldHiddenRule, GlobalInfoFieldOption, GlobalInfoInfoSet, GlobalInfoNode, GlobalInfoOperationContext, GlobalInfoOpenTreeParams, GlobalInfoProviderSlotProps, GlobalInfoRawRecord, GlobalInfoRenderConfig, GlobalInfoRenderType, GlobalInfoRequiredInfoSetEmptyMessage, GlobalInfoRequiredInfoSetEmptyMessageContext, GlobalInfoScheme, GlobalInfoSection, GlobalInfoSectionLoadTarget, GlobalInfoSectionSlotScope, GlobalInfoSectionStatus, GlobalInfoSectionTarget, GlobalInfoService, GlobalInfoSetMark, GlobalInfoState, GlobalInfoTemplateTreeParams, GlobalInfoUpdateParams, GlobalInfoViewModel, JTCascaderFormItemConfig, JtCrudColumn, JtCrudOption, JtDicItem, JTCompatibleFormItemType, JTElementFormItemType, JTFormItemConfig, JTFormItemEventHandler, JTFormItemType, JTFormItemsForm, JTFormItemsProps, JTFormItemCascaderOption, JtAttachmentPreviewHandler, JtAttachmentPreviewFileOptions, JtAttachmentPreviewRequestConfig, JtAttachmentPreviewService, JtAttachmentPreviewMode, JtAttachmentPreviewOptions, JtAttachmentPreviewResolvedType, JtOptionItem, JtPageHeaderOperate, JtPageHeaderProps, JtPaginationData, JtSearchType, } from './components/index';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jt-home/mfe-components",
|
|
3
|
-
"version": "1.0.62
|
|
3
|
+
"version": "1.0.62",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -16,12 +16,18 @@
|
|
|
16
16
|
"import": "./dist/index.mjs",
|
|
17
17
|
"require": "./dist/index.cjs"
|
|
18
18
|
},
|
|
19
|
+
"./locale": {
|
|
20
|
+
"types": "./dist/types/locale/index.d.ts",
|
|
21
|
+
"import": "./dist/locale/index.mjs",
|
|
22
|
+
"require": "./dist/locale/index.cjs"
|
|
23
|
+
},
|
|
19
24
|
"./JtAttachmentPreview": {
|
|
20
25
|
"types": "./dist/types/components/JtAttachmentPreview/index.d.ts",
|
|
21
26
|
"import": "./dist/JtAttachmentPreview/index.mjs",
|
|
22
27
|
"require": "./dist/JtAttachmentPreview/index.cjs"
|
|
23
28
|
},
|
|
24
|
-
"./style.css": "./dist/style.css"
|
|
29
|
+
"./style.css": "./dist/style.css",
|
|
30
|
+
"./JtAttachmentPreview/style.css": "./dist/JtAttachmentPreview/style.css"
|
|
25
31
|
},
|
|
26
32
|
"files": [
|
|
27
33
|
"dist"
|
|
@@ -30,32 +36,11 @@
|
|
|
30
36
|
"*.css",
|
|
31
37
|
"*.scss"
|
|
32
38
|
],
|
|
33
|
-
"scripts": {
|
|
34
|
-
"dev": "vite",
|
|
35
|
-
"build:types": "vue-tsc -p tsconfig.lib.json",
|
|
36
|
-
"build:bundle": "vite build",
|
|
37
|
-
"build:dev": "vite build -w",
|
|
38
|
-
"build": "pnpm run build:bundle && pnpm run build:types",
|
|
39
|
-
"build:analyze": "vite build --mode analyze",
|
|
40
|
-
"changeset": "changeset",
|
|
41
|
-
"changeset:status": "changeset status",
|
|
42
|
-
"version:packages": "changeset version",
|
|
43
|
-
"release": "pnpm run changeset:status && pnpm run version:packages && pnpm build && changeset publish",
|
|
44
|
-
"prepublishOnly": "pnpm build",
|
|
45
|
-
"preview": "vite preview --host 127.0.0.1 --port 5001",
|
|
46
|
-
"i18n:extract": "npx -y --package @jt-home/i18n-cli i18n-cli -c ./i18n.config.cjs",
|
|
47
|
-
"i18n:translate": "npx -y --package @jt-home/i18n-cli i18n-cli translate -c ./i18n.config.cjs",
|
|
48
|
-
"i18n:sync": "node scripts/sync-component-locale.cjs",
|
|
49
|
-
"i18n:export": "npx -y --package @jt-home/i18n-cli i18n-cli exportExcel -c ./i18n.config.cjs",
|
|
50
|
-
"test:locale": "tsc --skipLibCheck --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests-locale src/locale/index.ts src/locale/locale.test.ts src/locale/messages.test.ts && node tmp/unit-tests-locale/locale.test.js && node tmp/unit-tests-locale/messages.test.js",
|
|
51
|
-
"test:component-attrs": "tsc --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests src/utils/componentAttrs.ts src/utils/componentAttrs.test.ts && node tmp/unit-tests/componentAttrs.test.js",
|
|
52
|
-
"test:cascader-props": "tsc --skipLibCheck --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests src/components/form/item/JtCascader/cascaderProps.ts src/components/form/item/JtCascader/cascaderProps.test.ts && node tmp/unit-tests/cascaderProps.test.js"
|
|
53
|
-
},
|
|
54
39
|
"dependencies": {
|
|
40
|
+
"@element-plus/icons-vue": "^2.3.2",
|
|
55
41
|
"@jt-home/jt-language-tools": "^1.0.2",
|
|
56
42
|
"@jt-home/sdk-tools": "1.2.1-beta.4",
|
|
57
|
-
"
|
|
58
|
-
"vue-demi": "0.14.6"
|
|
43
|
+
"pdfjs-dist": "^5.7.284"
|
|
59
44
|
},
|
|
60
45
|
"devDependencies": {
|
|
61
46
|
"@babel/eslint-parser": "^7.24.5",
|
|
@@ -68,7 +53,6 @@
|
|
|
68
53
|
"@typescript-eslint/parser": "^7.9.0",
|
|
69
54
|
"@vitejs/plugin-vue": "^5.2.4",
|
|
70
55
|
"@vue/tsconfig": "^0.8.1",
|
|
71
|
-
"@element-plus/icons-vue": "^2.3.2",
|
|
72
56
|
"element-plus": "^2.14.0",
|
|
73
57
|
"eslint": "^8.57.0",
|
|
74
58
|
"eslint-config-prettier": "^9.1.0",
|
|
@@ -94,8 +78,28 @@
|
|
|
94
78
|
"vue-tsc": "^3.1.5"
|
|
95
79
|
},
|
|
96
80
|
"peerDependencies": {
|
|
97
|
-
"@element-plus/icons-vue": "^2.3.2",
|
|
98
81
|
"element-plus": "^2.14.0",
|
|
99
82
|
"vue": "^3.5.10"
|
|
83
|
+
},
|
|
84
|
+
"scripts": {
|
|
85
|
+
"dev": "vite",
|
|
86
|
+
"build:types": "vue-tsc -p tsconfig.lib.json",
|
|
87
|
+
"build:bundle": "vite build",
|
|
88
|
+
"build:dev": "vite build -w",
|
|
89
|
+
"build": "pnpm run build:bundle && pnpm run build:types",
|
|
90
|
+
"build:analyze": "vite build --mode analyze",
|
|
91
|
+
"changeset": "changeset",
|
|
92
|
+
"changeset:status": "changeset status",
|
|
93
|
+
"version:packages": "changeset version",
|
|
94
|
+
"release": "pnpm run changeset:status && pnpm run version:packages && pnpm build && changeset publish",
|
|
95
|
+
"release:beta": "changeset version --snapshot beta && pnpm build && changeset publish --tag beta",
|
|
96
|
+
"preview": "vite preview --host 127.0.0.1 --port 5001",
|
|
97
|
+
"i18n:extract": "npx -y --package @jt-home/i18n-cli i18n-cli -c ./i18n.config.cjs",
|
|
98
|
+
"i18n:translate": "npx -y --package @jt-home/i18n-cli i18n-cli translate -c ./i18n.config.cjs",
|
|
99
|
+
"i18n:sync": "node scripts/sync-component-locale.cjs",
|
|
100
|
+
"i18n:export": "npx -y --package @jt-home/i18n-cli i18n-cli exportExcel -c ./i18n.config.cjs",
|
|
101
|
+
"test:locale": "tsc --skipLibCheck --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests-locale src/locale/index.ts src/locale/locale.test.ts src/locale/messages.test.ts && node tmp/unit-tests-locale/locale.test.js && node tmp/unit-tests-locale/messages.test.js",
|
|
102
|
+
"test:component-attrs": "tsc --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests src/utils/componentAttrs.ts src/utils/componentAttrs.test.ts && node tmp/unit-tests/componentAttrs.test.js",
|
|
103
|
+
"test:cascader-props": "tsc --skipLibCheck --module NodeNext --moduleResolution NodeNext --target ES2020 --outDir tmp/unit-tests src/components/form/item/JtCascader/cascaderProps.ts src/components/form/item/JtCascader/cascaderProps.test.ts && node tmp/unit-tests/cascaderProps.test.js"
|
|
100
104
|
}
|
|
101
|
-
}
|
|
105
|
+
}
|