@xdmp-open/ui-shared 0.1.1 → 0.1.3

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/CHANGELOG.md CHANGED
@@ -1,14 +1,26 @@
1
1
  # @xdmp-open/ui-shared
2
2
 
3
+ ## 0.1.3
4
+
5
+ ### 补丁变更
6
+
7
+ - 新增 Control Registry(`registerControl` / `resolveControl` / `listControlTypes`),`formItem` 支持 `controlType`(LCDP)并兼容原 `element`。
8
+ - `formItem` 增加 `el-switch`。
9
+
10
+ ## 0.1.2
11
+
12
+ ### 补丁变更
13
+
14
+ - 新增 retain 守卫:`isRetainYes`、`isDevRuntime`、`isRetainFieldDisabled`、`RETAIN_INDEX`(对齐后端 `x-retain-index`)。菜单 `path`/`component` 在 `VITE_RUN_ENV=development` 时不锁(`relaxInDev`)。
15
+
3
16
  ## 0.1.1
4
17
 
5
- ### Patch Changes
18
+ ### 补丁变更
6
19
 
7
20
  - 修复机器人/设备详情页崩溃、属性卡片破图,以及项目查询仍引用未迁入的 host API。
8
21
 
9
22
  ## 0.1.0
10
23
 
11
- Initial public release on the 0.x line, aligned with XDMP platform 2.6.x.
12
- Breaking changes will bump the major version.
24
+ 0.x 线首次公开发布,对齐 XDMP 平台 2.6.x。破坏性变更将升 major。
13
25
 
14
- Shared Vue 3 components, directives, and CSS-variable theme tokens.
26
+ 共享 Vue 3 组件、指令与 CSS 变量主题。
package/README.md CHANGED
@@ -4,7 +4,7 @@ XDMP 平台共享 Vue 3 组件库:业务通用组件、指令、样式主题
4
4
 
5
5
  `vue`、`element-plus`、`@element-plus/icons-vue`、`echarts`、`@xdmp-open/sdk-admin` 为 peerDependencies(宿主应用提供);`vue-router` 为可选 peer(仅 `BackPage`/`PageDecs`/`PageDataInfo`/`PageMoreDataInfo` 运行时使用宿主注入的 `$router`/`$route`)。
6
6
 
7
- ## Install
7
+ ## 安装
8
8
 
9
9
  ```bash
10
10
  pnpm add @xdmp-open/ui-shared
@@ -12,7 +12,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
12
12
  default: () => void;
13
13
  };
14
14
  info: {
15
- type: ArrayConstructor;
15
+ type: (ObjectConstructor | ArrayConstructor)[];
16
16
  default: () => never[];
17
17
  };
18
18
  icon: {
@@ -69,7 +69,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
69
69
  default: () => void;
70
70
  };
71
71
  info: {
72
- type: ArrayConstructor;
72
+ type: (ObjectConstructor | ArrayConstructor)[];
73
73
  default: () => never[];
74
74
  };
75
75
  icon: {
@@ -105,7 +105,7 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
105
105
  keys: Record<string, any>;
106
106
  title: string;
107
107
  icon: string;
108
- info: unknown[];
108
+ info: unknown[] | Record<string, any>;
109
109
  labelWidth: string;
110
110
  isBack: boolean;
111
111
  isEdit: boolean;
@@ -0,0 +1,15 @@
1
+ /**
2
+ * LCDP / SearchForm 控件注册表:独立 controlType ↔ 既有 formItem element。
3
+ * 新增控件优先 registerControl,避免继续堆 formItem v-if。
4
+ */
5
+ export type LcdpControlType = 'INPUT' | 'TEXTAREA' | 'NUMBER' | 'SELECT' | 'DATE' | 'SWITCH' | 'TREE_SELECT';
6
+ export type ControlDescriptor = {
7
+ /** 兼容 SearchForm formItem 的 element 值 */
8
+ element: string;
9
+ /** 额外默认 props(如 textarea) */
10
+ defaultProps?: Record<string, unknown>;
11
+ };
12
+ export declare function registerControl(controlType: string, descriptor: ControlDescriptor): void;
13
+ export declare function resolveControl(controlTypeOrElement: string | undefined | null): ControlDescriptor | null;
14
+ export declare function listControlTypes(): LcdpControlType[];
15
+ export declare function controlTypeToElement(controlType: string): string | undefined;
package/dist/index.d.ts CHANGED
@@ -30,13 +30,16 @@ import { scrollTo } from './utils/scroll-to';
30
30
  import { isExternal, validPassword, validMoblie, validInputLength, validSpecialName, validLegalInput, validBitMapString, validEnumString, isInteger } from './utils/validate';
31
31
  import { debounce } from './utils/debounce';
32
32
  import { Encrypt } from './utils/encrypt';
33
+ import { isDevRuntime, isRetainFieldDisabled, isRetainYes, RETAIN_INDEX, RETAIN_MSG_DELETE, RETAIN_MSG_DISABLE, RETAIN_MSG_UPDATE, YES_OR_NO_YES, RetainEntityMeta, RetainFieldMeta, RetainUpdateStrategy } from './utils/retain';
34
+ import { registerControl, resolveControl, listControlTypes, controlTypeToElement } from './controls/registry';
35
+ export type { LcdpControlType, ControlDescriptor } from './controls/registry';
33
36
  /**
34
37
  * 插件入口:全局注册全部组件与 emoji/highlight 指令。
35
38
  * v-permission 指令需单独调用 setupPermissionDirective 注入判定函数后注册。
36
39
  */
37
40
  declare function install(app: App): void;
38
- export { UiapDrawer, SearchForm, Pagination, TreeSelect, MultipleTree, BackPage, PageDataInfo, PageDecs, PageMoreDataInfo, IconSelect, SvgIcon, KeyboardChart, LineMarkerChart, MixChart, ChartComponent, VueCountTo, ScaleSrceen, AvatarUpload, FileUpload, chartResizeMixin, setupBinaryApi, getBinaryResource, binaryUpload, binaryDownloadBlob, emoji, highlight, createPermissionDirective, setupPermissionDirective, registerSvgIcons, getSvgIconNames, isRegisteredSvgIcon, useIcons, $on, $off, $once, $emit, scrollTo, isExternal, validPassword, validMoblie, validInputLength, validSpecialName, validLegalInput, validBitMapString, validEnumString, isInteger, debounce, Encrypt, install };
39
- export type { HasPermissionFn, BinaryUploadQuery };
41
+ export { UiapDrawer, SearchForm, Pagination, TreeSelect, MultipleTree, BackPage, PageDataInfo, PageDecs, PageMoreDataInfo, IconSelect, SvgIcon, KeyboardChart, LineMarkerChart, MixChart, ChartComponent, VueCountTo, ScaleSrceen, AvatarUpload, FileUpload, chartResizeMixin, setupBinaryApi, getBinaryResource, binaryUpload, binaryDownloadBlob, emoji, highlight, createPermissionDirective, setupPermissionDirective, registerSvgIcons, getSvgIconNames, isRegisteredSvgIcon, useIcons, $on, $off, $once, $emit, scrollTo, isExternal, validPassword, validMoblie, validInputLength, validSpecialName, validLegalInput, validBitMapString, validEnumString, isInteger, debounce, Encrypt, isRetainYes, isRetainFieldDisabled, isDevRuntime, RETAIN_INDEX, RETAIN_MSG_DELETE, RETAIN_MSG_DISABLE, RETAIN_MSG_UPDATE, YES_OR_NO_YES, registerControl, resolveControl, listControlTypes, controlTypeToElement, install };
42
+ export type { HasPermissionFn, BinaryUploadQuery, RetainEntityMeta, RetainFieldMeta, RetainUpdateStrategy };
40
43
  declare const _default: {
41
44
  install: typeof install;
42
45
  };