@yongdall/types 0.4.0 → 0.4.4

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/index.d.mts CHANGED
@@ -23,6 +23,15 @@ type Field = Field.Base & Field.Extends;
23
23
  * @property {boolean} [hidden]
24
24
  * @property {Field.Layout.Column[]} [columns]
25
25
  */
26
+ /**
27
+ * @typedef {object} Field.Show
28
+ * @property {string} [field]
29
+ * @property {string} [label]
30
+ * @property {number} [width]
31
+ * @property {string} [pattern]
32
+ * @property {'' | 'left' | 'center' | 'right'} [align]
33
+ * @property {boolean} [enableLink]
34
+ */
26
35
  /**
27
36
  * @typedef {Object} Field.Source
28
37
  * @property {*[]} [values] 列表
@@ -41,7 +50,7 @@ type Field = Field.Base & Field.Extends;
41
50
  *
42
51
  * @property {string?} [configurator] 配置信息字段
43
52
  *
44
- * @property {{field?: string; label?: string; width?: number; pattern?: string}[]?} [fields] 显示字段
53
+ * @property {Field.Show[]?} [fields] 显示字段
45
54
  * @property {{ field: string; label?: string; operator: string; }[]?} [queryFilters] 快速过滤字段
46
55
  */
47
56
  /** @typedef {Record<string, string | {source: string}> | {field: string; source: string; }[]} Field.Bind */
@@ -155,6 +164,14 @@ declare namespace Field {
155
164
  label?: string | undefined;
156
165
  };
157
166
  }
167
+ type Show = {
168
+ field?: string | undefined;
169
+ label?: string | undefined;
170
+ width?: number | undefined;
171
+ pattern?: string | undefined;
172
+ align?: "" | "left" | "center" | "right" | undefined;
173
+ enableLink?: boolean | undefined;
174
+ };
158
175
  type Source = {
159
176
  /**
160
177
  * 列表
@@ -207,12 +224,7 @@ declare namespace Field {
207
224
  /**
208
225
  * 显示字段
209
226
  */
210
- fields?: {
211
- field?: string;
212
- label?: string;
213
- width?: number;
214
- pattern?: string;
215
- }[] | null | undefined;
227
+ fields?: Field.Show[] | null | undefined;
216
228
  /**
217
229
  * 快速过滤字段
218
230
  */
@@ -350,6 +362,15 @@ declare namespace Field {
350
362
  };
351
363
  }
352
364
  //#endregion
365
+ //#region packages/types/ModelService.d.mts
366
+ type ModelService = {
367
+ /**
368
+ * // TODO: 子页面
369
+ * // TODO: 脚本
370
+ */
371
+ permissionGroupId?: string | null | undefined;
372
+ };
373
+ //#endregion
353
374
  //#region packages/types/index.d.mts
354
375
  type Tenant = {
355
376
  /**
@@ -414,4 +435,4 @@ type Permissions = {
414
435
  size: number;
415
436
  };
416
437
  //#endregion
417
- export { Field, MaybePromise, Permission, Permissions, Tenant };
438
+ export { Field, MaybePromise, ModelService, Permission, Permissions, Tenant };
package/index.mjs CHANGED
@@ -23,6 +23,15 @@
23
23
  * @property {Field.Layout.Column[]} [columns]
24
24
  */
25
25
  /**
26
+ * @typedef {object} Field.Show
27
+ * @property {string} [field]
28
+ * @property {string} [label]
29
+ * @property {number} [width]
30
+ * @property {string} [pattern]
31
+ * @property {'' | 'left' | 'center' | 'right'} [align]
32
+ * @property {boolean} [enableLink]
33
+ */
34
+ /**
26
35
  * @typedef {Object} Field.Source
27
36
  * @property {*[]} [values] 列表
28
37
  * @property {'enumeration' | 'model'} [type] 列表类型
@@ -40,7 +49,7 @@
40
49
  *
41
50
  * @property {string?} [configurator] 配置信息字段
42
51
  *
43
- * @property {{field?: string; label?: string; width?: number; pattern?: string}[]?} [fields] 显示字段
52
+ * @property {Field.Show[]?} [fields] 显示字段
44
53
  * @property {{ field: string; label?: string; operator: string; }[]?} [queryFilters] 快速过滤字段
45
54
  */
46
55
  /** @typedef {Record<string, string | {source: string}> | {field: string; source: string; }[]} Field.Bind */
package/index.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/types/Field.mjs","../../packages/types/index.mjs"],"sourcesContent":["\n/**\n * @typedef {Object} Field.Layout.Column\n * @property {string[]} [actions] 操作\n * @property {string} [action] 操作\n * @property {string} [field] 字段\n * @property {number} [placeholder] 占位符\n * @property {string} [pattern] 模式\n * @property {number} [width] 宽度\n * @property {string} [label] 标签\n */\n/**\n * @typedef {Object} Field.Layout\n * @property {number} [colSpan] 占用列数\n * @property {number} [colStart] 列起点\n * @property {number} [colEnd] 列终点\n * @property {number} [rowSpan] 占用行数\n * @property {number} [rowStart] 行起点\n * @property {number} [rowEnd] 行终点\n * @property {string} [levelKey]\n * @property {number} [head]\n * @property {boolean} [hidden]\n * @property {Field.Layout.Column[]} [columns]\n */\n/**\n * @typedef {Object} Field.Source\n * @property {*[]} [values] 列表\n * @property {'enumeration' | 'model'} [type] 列表类型\n * @property {string?} [name] 名称\n * @property {string?} [search] 搜索信息\n * \n * @property {string?} [id] id字段(或模式)\n * @property {string?} [label] 标签字段(或模式)\n * @property {string?} [value] 值字段(或模式)\n * @property {string?} [parent] 父节点字段(或模式)\n * \n * @property {string?} [children] 子列表\n * @property {string?} [sequence] 序列字段\n * @property {string?} [disabled] 禁用字段\n * \n * @property {string?} [configurator] 配置信息字段\n * \n * @property {{field?: string; label?: string; width?: number; pattern?: string}[]?} [fields] 显示字段\n * @property {{ field: string; label?: string; operator: string; }[]?} [queryFilters] 快速过滤字段\n */\n/** @typedef {Record<string, string | {source: string}> | {field: string; source: string; }[]} Field.Bind */\n/**\n * @typedef {Object} Field.Base\n * @property {string | Record<string, Field>} type 字段的基本类型\n * @property {boolean} [nullable] 是否可为空\n * @property {any} [default] 默认值\n * @property {boolean} [array] \n * \n * @property {number} [scale] 缩放比\n * @property {number} [primary] 是否为主键\n * @property {boolean} [uncreatable] 是否为可创建值\n * @property {boolean} [immutable] 是否为固定值\n * @property {number} [sort] 排序顺序,绝对值表示在排序列表中的顺序,负数表示逆序排序, 0 表示不排序\n * \n * \n * \n * @property {string} [options]\n * \n * @property {boolean} [quick]\n * @property {boolean} [translatable]\n * \n * @property {boolean} [ignorePermissions]\n * @property {boolean} [noCopy]\n */\n/**\n * @typedef {Object} Field.Extends\n * @property {number?} [no] - 字段序号\n * @property {string?} [label] - 字段的显示标签。\n * @property {string?} [description] - 字段的详细描述信息,可用于提示或帮助文本。\n * @property {string?} [placeholder] - 输入框等控件的占位提示文字。\n * @property {number?} [step] - 数值输入时的步长(如用于 number 类型 input 的 step 属性)。\n * @property {number?} [max] - 字段允许的最大值(常用于数值或日期类型校验)。\n * @property {number?} [min] - 字段允许的最小值(常用于数值或日期类型校验)。\n * @property {boolean} [readonly] - 是否只读,用户可聚焦但不可修改内容。\n * @property {boolean} [required] - 是否为必填项,用于表单验证。\n * @property {boolean} [clearable] - 是否支持清空操作(如带“×”按钮的输入框或选择器)。\n * @property {boolean} [disabled] - 是否禁用,禁用状态下用户无法交互且通常视觉上置灰。\n * @property {string} [group] - 字段所属的逻辑分组名称,用于权限分组。\n * @property {number} [layoutOrder] - 布局顺序\n * @property {({component: string; values?: any[]; [k: string]: any} | string)[] | {component: string; values?: any[]; [k: string]: any} | string} [renderer] - 渲染器配置数组\n * @property {(string | [string, object])[] | null} [scripts] - 脚本列表,可以是字符串或 [脚本名, 配置对象] 的元组\n * @property {Field.Layout} [layout] - 布局信息\n * @property {string} [model] - 关联模型\n * @property {Field.Bind} [bind]\n * @property {Field.Source | any[] | null} [source]\n */\n/** @typedef {Field.Base & Field.Extends} Field */\n\nexport const Field = {\n\t\n}\n","export * from './Field.mjs'\n/**\n * @typedef {Object} Tenant\n * @property {string} id - 租户的唯一标识符。\n * @property {string} label - 租户的名称。\n * @property {boolean} single - 指示该租户是否为单实例模式。\n * @property {Object.<string, string>} providers - 包含提供商名称及其对应值的键值对记录。\n * @property {Uint8Array<ArrayBuffer> | string} salt 加密盐\n */\n\n/**\n * @typedef {object} Permission 模型权限定义\n * @property {string} [permission] - 关联到的权限信息\n * @property {string | string[]} [group] - 字段分组\n * @property {string | string[]} [fields] - 字段\n * @property {Record<string, {value?: unknown; values?: unknown[]; user?: boolean}>} [constraints] - 字段信息约束\n * @property {string[] | Set<string>} [authorizations] - 授权列表\n * @property {string} [organizationField] - 可选,组织类型字段,其值为模型的组织类型字段,如果设置此项,则表示用户需要在文档此字段所示组织内由上述权限,此规则才生效\n */\n\n/**\n * @template T\n * @typedef {PromiseLike<T> | T} MaybePromise\n */\n\n/**\n * @typedef {object} Permissions\n * @property {(permission: string) => boolean} has\n * @property {number} size\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6FA,MAAa,QAAQ,EAEpB"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../../packages/types/Field.mjs","../../packages/types/index.mjs"],"sourcesContent":["\n/**\n * @typedef {Object} Field.Layout.Column\n * @property {string[]} [actions] 操作\n * @property {string} [action] 操作\n * @property {string} [field] 字段\n * @property {number} [placeholder] 占位符\n * @property {string} [pattern] 模式\n * @property {number} [width] 宽度\n * @property {string} [label] 标签\n */\n/**\n * @typedef {Object} Field.Layout\n * @property {number} [colSpan] 占用列数\n * @property {number} [colStart] 列起点\n * @property {number} [colEnd] 列终点\n * @property {number} [rowSpan] 占用行数\n * @property {number} [rowStart] 行起点\n * @property {number} [rowEnd] 行终点\n * @property {string} [levelKey]\n * @property {number} [head]\n * @property {boolean} [hidden]\n * @property {Field.Layout.Column[]} [columns]\n */\n\n/**\n * @typedef {object} Field.Show\n * @property {string} [field]\n * @property {string} [label]\n * @property {number} [width]\n * @property {string} [pattern]\n * @property {'' | 'left' | 'center' | 'right'} [align]\n * @property {boolean} [enableLink]\n */\n/**\n * @typedef {Object} Field.Source\n * @property {*[]} [values] 列表\n * @property {'enumeration' | 'model'} [type] 列表类型\n * @property {string?} [name] 名称\n * @property {string?} [search] 搜索信息\n * \n * @property {string?} [id] id字段(或模式)\n * @property {string?} [label] 标签字段(或模式)\n * @property {string?} [value] 值字段(或模式)\n * @property {string?} [parent] 父节点字段(或模式)\n * \n * @property {string?} [children] 子列表\n * @property {string?} [sequence] 序列字段\n * @property {string?} [disabled] 禁用字段\n * \n * @property {string?} [configurator] 配置信息字段\n * \n * @property {Field.Show[]?} [fields] 显示字段\n * @property {{ field: string; label?: string; operator: string; }[]?} [queryFilters] 快速过滤字段\n */\n/** @typedef {Record<string, string | {source: string}> | {field: string; source: string; }[]} Field.Bind */\n/**\n * @typedef {Object} Field.Base\n * @property {string | Record<string, Field>} type 字段的基本类型\n * @property {boolean} [nullable] 是否可为空\n * @property {any} [default] 默认值\n * @property {boolean} [array] \n * \n * @property {number} [scale] 缩放比\n * @property {number} [primary] 是否为主键\n * @property {boolean} [uncreatable] 是否为可创建值\n * @property {boolean} [immutable] 是否为固定值\n * @property {number} [sort] 排序顺序,绝对值表示在排序列表中的顺序,负数表示逆序排序, 0 表示不排序\n * \n * \n * \n * @property {string} [options]\n * \n * @property {boolean} [quick]\n * @property {boolean} [translatable]\n * \n * @property {boolean} [ignorePermissions]\n * @property {boolean} [noCopy]\n */\n/**\n * @typedef {Object} Field.Extends\n * @property {number?} [no] - 字段序号\n * @property {string?} [label] - 字段的显示标签。\n * @property {string?} [description] - 字段的详细描述信息,可用于提示或帮助文本。\n * @property {string?} [placeholder] - 输入框等控件的占位提示文字。\n * @property {number?} [step] - 数值输入时的步长(如用于 number 类型 input 的 step 属性)。\n * @property {number?} [max] - 字段允许的最大值(常用于数值或日期类型校验)。\n * @property {number?} [min] - 字段允许的最小值(常用于数值或日期类型校验)。\n * @property {boolean} [readonly] - 是否只读,用户可聚焦但不可修改内容。\n * @property {boolean} [required] - 是否为必填项,用于表单验证。\n * @property {boolean} [clearable] - 是否支持清空操作(如带“×”按钮的输入框或选择器)。\n * @property {boolean} [disabled] - 是否禁用,禁用状态下用户无法交互且通常视觉上置灰。\n * @property {string} [group] - 字段所属的逻辑分组名称,用于权限分组。\n * @property {number} [layoutOrder] - 布局顺序\n * @property {({component: string; values?: any[]; [k: string]: any} | string)[] | {component: string; values?: any[]; [k: string]: any} | string} [renderer] - 渲染器配置数组\n * @property {(string | [string, object])[] | null} [scripts] - 脚本列表,可以是字符串或 [脚本名, 配置对象] 的元组\n * @property {Field.Layout} [layout] - 布局信息\n * @property {string} [model] - 关联模型\n * @property {Field.Bind} [bind]\n * @property {Field.Source | any[] | null} [source]\n */\n/** @typedef {Field.Base & Field.Extends} Field */\n\nexport const Field = {\n\t\n}\n","export * from './Field.mjs'\nexport * from './ModelService.mjs'\n/**\n * @typedef {Object} Tenant\n * @property {string} id - 租户的唯一标识符。\n * @property {string} label - 租户的名称。\n * @property {boolean} single - 指示该租户是否为单实例模式。\n * @property {Object.<string, string>} providers - 包含提供商名称及其对应值的键值对记录。\n * @property {Uint8Array<ArrayBuffer> | string} salt 加密盐\n */\n\n/**\n * @typedef {object} Permission 模型权限定义\n * @property {string} [permission] - 关联到的权限信息\n * @property {string | string[]} [group] - 字段分组\n * @property {string | string[]} [fields] - 字段\n * @property {Record<string, {value?: unknown; values?: unknown[]; user?: boolean}>} [constraints] - 字段信息约束\n * @property {string[] | Set<string>} [authorizations] - 授权列表\n * @property {string} [organizationField] - 可选,组织类型字段,其值为模型的组织类型字段,如果设置此项,则表示用户需要在文档此字段所示组织内由上述权限,此规则才生效\n */\n\n/**\n * @template T\n * @typedef {PromiseLike<T> | T} MaybePromise\n */\n\n/**\n * @typedef {object} Permissions\n * @property {(permission: string) => boolean} has\n * @property {number} size\n */\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuGA,MAAa,QAAQ,EAEpB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yongdall/types",
3
- "version": "0.4.0",
3
+ "version": "0.4.4",
4
4
  "type": "module",
5
5
  "main": "./index.mjs",
6
6
  "exports": {