@robot-admin/naive-ui-components 0.34.0 → 0.36.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.
Files changed (143) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +11 -7
  3. package/README_EN.md +11 -7
  4. package/THIRD_PARTY_NOTICES.md +10 -1
  5. package/dist/C_DataPicker.cjs +1 -1
  6. package/dist/C_DataPicker.css +63 -48
  7. package/dist/C_DataPicker.d.cts +3 -2
  8. package/dist/C_DataPicker.d.ts +3 -2
  9. package/dist/C_DataPicker.js +1 -1
  10. package/dist/C_DataPicker2.cjs +1 -0
  11. package/dist/C_DataPicker2.js +1 -0
  12. package/dist/C_Date.d.cts +1 -1
  13. package/dist/C_Date.d.ts +1 -1
  14. package/dist/C_Form.d.ts +1 -1
  15. package/dist/C_FormModal.d.ts +1 -1
  16. package/dist/C_Select.d.cts +1 -1
  17. package/dist/C_Select.d.ts +1 -1
  18. package/dist/C_Table.base.css +112 -110
  19. package/dist/C_Table.cjs +1 -1
  20. package/dist/C_Table.css +112 -110
  21. package/dist/C_Table.d.cts +2 -2
  22. package/dist/C_Table.d.ts +6 -3
  23. package/dist/C_Table.js +1 -1
  24. package/dist/C_Table2.cjs +4 -4
  25. package/dist/C_Table2.js +4 -4
  26. package/dist/C_Tree.d.cts +2 -1
  27. package/dist/C_Tree.d.ts +5 -2
  28. package/dist/C_UserPicker.cjs +1 -0
  29. package/dist/C_UserPicker.css +75 -0
  30. package/dist/C_UserPicker.d.cts +3 -0
  31. package/dist/C_UserPicker.d.ts +7 -0
  32. package/dist/C_UserPicker.js +1 -0
  33. package/dist/C_WorkFlow.css +635 -355
  34. package/dist/C_WorkFlow.d.cts +2 -2
  35. package/dist/C_WorkFlow.d.ts +7 -2
  36. package/dist/C_WorkFlow2.cjs +1 -1
  37. package/dist/C_WorkFlow2.js +1 -1
  38. package/dist/NodeConfigModal.cjs +1 -0
  39. package/dist/NodeConfigModal.js +1 -0
  40. package/dist/conditions.cjs +1 -0
  41. package/dist/conditions.js +1 -0
  42. package/dist/constants.d.cts +1 -1
  43. package/dist/constants.d.ts +1 -1
  44. package/dist/constants3.d.cts +1 -1
  45. package/dist/constants3.d.ts +1 -1
  46. package/dist/constants4.d.cts +4 -4
  47. package/dist/constants4.d.ts +4 -4
  48. package/dist/constants5.d.cts +2 -2
  49. package/dist/constants5.d.ts +2 -2
  50. package/dist/data2.d.cts +5 -5
  51. package/dist/data2.d.ts +5 -5
  52. package/dist/editors.d.cts +15 -234
  53. package/dist/editors.d.ts +15 -234
  54. package/dist/formField.cjs +1 -1
  55. package/dist/formField.d.cts +7 -1190
  56. package/dist/formField.d.ts +7 -1190
  57. package/dist/formField.js +1 -1
  58. package/dist/index.cjs +1 -1
  59. package/dist/index.d.cts +12 -9
  60. package/dist/index.d.ts +13 -9
  61. package/dist/index.js +1 -1
  62. package/dist/index.vue.d.cts +4 -4
  63. package/dist/index.vue.d.ts +4 -4
  64. package/dist/index10.vue.d.ts +3 -3
  65. package/dist/index11.vue.d.cts +3 -3
  66. package/dist/index11.vue.d.ts +3 -3
  67. package/dist/index12.vue.d.cts +3 -3
  68. package/dist/index13.vue.d.ts +2 -2
  69. package/dist/index14.vue.d.cts +2 -2
  70. package/dist/index16.vue.d.ts +5 -5
  71. package/dist/index17.vue.d.cts +5 -5
  72. package/dist/index17.vue.d.ts +6 -6
  73. package/dist/index18.vue.d.cts +6 -6
  74. package/dist/index21.vue.d.ts +2 -2
  75. package/dist/index22.vue.d.cts +2 -2
  76. package/dist/index24.vue.d.cts +1 -1
  77. package/dist/index24.vue.d.ts +1 -1
  78. package/dist/index26.vue.d.cts +1 -1
  79. package/dist/index26.vue.d.ts +1 -1
  80. package/dist/index3.vue.d.cts +2 -2
  81. package/dist/index3.vue.d.ts +2 -2
  82. package/dist/index31.vue.d.cts +3 -3
  83. package/dist/index31.vue.d.ts +3 -3
  84. package/dist/index32.vue.d.cts +2 -2
  85. package/dist/index32.vue.d.ts +2 -2
  86. package/dist/index4.vue.d.cts +3 -3
  87. package/dist/index4.vue.d.ts +3 -3
  88. package/dist/index8.vue.d.ts +3 -3
  89. package/dist/index9.vue.d.cts +3 -3
  90. package/dist/mapUtils.d.cts +2 -2
  91. package/dist/mapUtils.d.ts +2 -2
  92. package/dist/resolver.cjs +1 -1
  93. package/dist/resolver.d.cts +1 -1
  94. package/dist/resolver.d.ts +1 -1
  95. package/dist/resolver.js +1 -1
  96. package/dist/source.cjs +1 -0
  97. package/dist/source.d.cts +37 -0
  98. package/dist/source.d.ts +37 -0
  99. package/dist/source.js +1 -0
  100. package/dist/style.css +886 -512
  101. package/dist/types3.d.ts +1223 -53
  102. package/dist/types4.d.cts +1223 -53
  103. package/dist/types4.d.ts +55 -45
  104. package/dist/types5.d.cts +55 -45
  105. package/dist/types5.d.ts +50 -0
  106. package/dist/types6.d.cts +50 -0
  107. package/dist/types6.d.ts +284 -0
  108. package/dist/types7.d.cts +284 -0
  109. package/dist/useCalendarEvents.d.cts +1 -1
  110. package/dist/useCalendarEvents.d.ts +1 -1
  111. package/dist/useCollapsePanel.d.cts +3 -3
  112. package/dist/useCollapsePanel.d.ts +3 -3
  113. package/dist/useComponentLocale.cjs +1 -1
  114. package/dist/useComponentLocale.js +1 -1
  115. package/dist/useCropperCore.d.cts +6 -6
  116. package/dist/useCropperCore.d.ts +6 -6
  117. package/dist/useDynamicFormState.d.cts +1 -1
  118. package/dist/useDynamicFormState.d.ts +1 -1
  119. package/dist/useEdgeInteraction.d.cts +2 -2
  120. package/dist/useEdgeInteraction.d.ts +2 -2
  121. package/dist/useFullscreen.d.cts +2 -2
  122. package/dist/useFullscreen.d.ts +2 -2
  123. package/dist/useInfiniteScroll.d.cts +3 -3
  124. package/dist/useInfiniteScroll.d.ts +3 -3
  125. package/dist/useQRCode.d.cts +4 -4
  126. package/dist/useQRCode.d.ts +4 -4
  127. package/dist/useSignatureHistory.d.cts +4 -4
  128. package/dist/useSignatureHistory.d.ts +4 -4
  129. package/dist/useSplitResize.d.cts +7 -7
  130. package/dist/useSplitResize.d.ts +7 -7
  131. package/dist/useWorkflowValidation.d.cts +165 -43
  132. package/dist/useWorkflowValidation.d.ts +165 -43
  133. package/dist/verification.d.cts +3 -3
  134. package/dist/verification.d.ts +3 -3
  135. package/docs/components.en.md +8 -7
  136. package/docs/components.md +8 -7
  137. package/docs/guides/table-density.md +7 -7
  138. package/docs/guides/user-picker.md +124 -0
  139. package/docs/guides/workflow-people.md +60 -0
  140. package/docs/guides/workflow.md +153 -0
  141. package/docs/people-workflow-review-20261114.md +75 -0
  142. package/licenses/VueFlow.txt +20 -0
  143. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @robot-admin/naive-ui-components
2
2
 
3
+ ## 0.36.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 新增基于 DataPicker 选择会话的组织人员选择入口,支持部门筛选、分页候选、完整已选区与顺序调整;共享取消、回显、范围隔离和确认复核。
8
+ - 工作流补齐节点连接端口、可配置条件字段及显式分支目标,统一人员选择并保留顺序审批配置;继续兼容原流程模型与本地人员数据。
9
+ - 修复配置保存后画布未及时更新、键盘删除绕过约束、导入连线被误过滤与适应窗口留白单位;补齐并隔离流程基础样式,改善连接标签和人员头像显示。
10
+ - 补充独立离线场景、类型与交互回归,以及选择器和工作流画布的按需隔离验证。
11
+
12
+ ## 0.35.0
13
+
14
+ ### Minor Changes
15
+
16
+ - C_Table 默认使用智能适宽:自动业务列基于完整表头与有界内容宽度,空间充足时按基准比例铺满,列多时保留基准并横向滚动。序号、多选、展开与操作列保持紧凑且默认不可调宽。显式宽度、手动偏好和原生布局覆盖仍可按需使用。
17
+
18
+ 修复自动填充列过宽、拖动期间邻列联动和150ms偏好提交后跳动;拖动中的即时宽度与提交结果同源。修正文本操作按钮的额外padding,改善操作间距与窄列容纳。
19
+
3
20
  ## 0.34.0
4
21
 
5
22
  ### Minor Changes
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div align="center">
6
6
  <p><strong>把重复的业务交互,沉淀为可组合的组件。</strong></p>
7
- <p>Vue 3 · Naive UI · TypeScript · 62 个业务组件</p>
7
+ <p>Vue 3 · Naive UI · TypeScript · 63 个业务组件</p>
8
8
  <p>
9
9
  <a href="https://www.npmjs.com/package/@robot-admin/naive-ui-components"><img src="https://img.shields.io/npm/v/@robot-admin/naive-ui-components?style=flat-square&amp;color=249D70&amp;labelColor=183C2E" alt="npm version"></a>
10
10
  <a href="./package.json"><img src="https://img.shields.io/badge/Vue-3.5+-249D70?style=flat-square&amp;logo=vue.js&amp;logoColor=white&amp;labelColor=183C2E" alt="Vue 3.5+"></a>
@@ -30,15 +30,17 @@
30
30
  | -------- | ------------------------------------------------------------------------------------------------------ |
31
31
  | 配置驱动 | 表单字段、表格列、操作按钮与弹窗通过类型化配置组合;表单提供 8 种布局 |
32
32
  | 类型贯通 | 字段路径、列定义、事件与实例方法配套类型;提供 `defineFormOptions`、`useCForm`、`useTableQuery` 等助手 |
33
- | 按需消费 | 62 个独立组件入口、自动导入 Resolver、组件样式入口,以及表单/表格的基础样式层级 |
33
+ | 按需消费 | 63 个独立组件入口、自动导入 Resolver、组件样式入口,以及表单/表格的基础样式层级 |
34
34
  | 独立接入 | 支持全量注册与局部导入;反馈、文案和全局配置可由宿主提供,表单弹窗可接入结构兼容的 Headless CRUD |
35
35
 
36
- 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.34.0**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
36
+ 组件库负责界面与交互。业务接口、身份权限、上传服务和第三方平台配置由应用接入。当前仓库版本 **0.36.0**,版本变化见 [CHANGELOG](./CHANGELOG.md)。
37
37
 
38
38
  0.33 增强树的远程路径定位、分组选项、搜索字段设置和表格编辑契约,并保留原有默认用法。见[兼容接入与独立演示](./docs/guides/component-contracts.md)。
39
39
 
40
40
  0.34 完善树的动态图标、自定义节点状态与操作配置,以及组织架构图的数据映射、受控交互和连线。目录选择使用 `C_Tree`,卡片式汇报关系使用独立的 `C_OrgChart`。见[组织场景示例](./docs/guides/tree-org-examples.md)。
41
41
 
42
+ 0.36 增加组织人员选择入口 `C_UserPicker`,共用分页、草稿和确认机制;完善审批节点端口、显式条件分支及统一选人配置。见[人员选择](./docs/guides/user-picker.md)与[工作流设计](./docs/guides/workflow.md)。
43
+
42
44
  搜索条件、录入字段和操作按钮可以由响应式配置生成。筛选和编辑共享紧凑密度,支持校验、异步选项和业务弹窗。后端字典或权限由项目接入,表单和搜索消费普通选项,表格消费普通列配置。
43
45
 
44
46
  `C_Select` 支持独立单选、多选与自由标签。表单和搜索多选共用紧凑标签摘要,日期时间字段可直接读写接口字符串。见[多选与日期时间用法](./docs/guides/data-workflows.md#多选标签和日期时间)。
@@ -55,7 +57,7 @@
55
57
 
56
58
  `C_Table` 保留 Naive UI 原生空态,继承 Provider 的主题、语言与 `componentOptions.DataTable.renderEmpty`。使用 `#empty` 可替换单个表格的空态内容。
57
59
 
58
- `C_Table` 窄列编辑时操作组可自然换行,输入保持可见。功能列保持紧凑宽度,剩余空间由普通自动列承接;显式宽度和已保存的列宽偏好继续生效。
60
+ `C_Table` 窄列编辑时操作组可自然换行,输入保持可见。功能列保持紧凑;普通自动业务列按表头与内容基准比例均衡分配余量,列多时保留基准横向滚动。显式宽度和已保存的列宽偏好继续生效。
59
61
 
60
62
  `C_Table` 默认显示序号和分页,数字与其他内容默认居中。通过 `:row-number="false"` 和 `:pagination="false"` 分别关闭自动序号与分页。后端返回列和行可直接绑定,详见[动态表格示例](./docs/guides/usage.md#后端返回列和行)。
61
63
 
@@ -70,7 +72,7 @@
70
72
  | 工作空间 | `C_Menu` · `C_Tabs` · `C_TagsView` · `C_GlobalSearch` | 菜单、场景切换、多标签导航、全局搜索 |
71
73
  | 通用交互 | `C_Login` · `C_Captcha` · `C_Guide` · `C_PageLoading` | 登录、人机验证、功能引导、页面切换反馈 |
72
74
 
73
- 查看 [全部 62 个组件与依赖](./docs/components.md),或在 [Robot Admin](https://robotadmin.cn) 中体验组件场景。Cron 预览只计算时间,公式只进行本地试算;生产人机验证需接入服务端校验,详见[使用指南](./docs/guides/usage.md)。
75
+ 查看 [全部 63 个组件与依赖](./docs/components.md),或在 [Robot Admin](https://robotadmin.cn) 中体验组件场景。Cron 预览只计算时间,公式只进行本地试算;生产人机验证需接入服务端校验,详见[使用指南](./docs/guides/usage.md)。
74
76
 
75
77
  ## 快速开始
76
78
 
@@ -187,7 +189,7 @@ Resolver 默认解析到组件子路径;`importStyle` 默认是 `false`,需
187
189
  | 文档 | 内容 |
188
190
  | -------------------------------------------------------- | ---------------------------------------------------------------- |
189
191
  | [架构与隔离](./docs/architecture.md) | 依赖边界、实例所有权与独立 Element Plus 演进路线 |
190
- | [组件目录](./docs/components.md) | 62 个组件、外部依赖与各组件的使用边界 |
192
+ | [组件目录](./docs/components.md) | 63 个组件、外部依赖与各组件的使用边界 |
191
193
  | [使用指南](./docs/guides/usage.md) | 导入、表单表格、Cron/公式、地图、引导、人机验证、登录与页面加载 |
192
194
  | [密度与多表工作台](./docs/guides/table-density.md) | 表单/搜索/表格统一密度、编辑模式、分屏与树能力 |
193
195
  | [大列表与异步任务](./docs/guides/runtime-performance.md) | 自动窗口化、聊天滚动、搜索索引、字幕与图片任务 |
@@ -236,7 +238,7 @@ bun run check:audit # 单独运行依赖安全审计,CI 在 verify 前执行
236
238
 
237
239
  ## 内容列宽与状态颜色(0.24)
238
240
 
239
- `C_Table` 未声明 `width` 的业务列默认按表头和显示文字测宽,均匀抽样最多 100 条已加载数据,默认 80–360px。`minWidth/maxWidth` 可调整边界;显式列宽、原生百分比宽度、列设置后的宽度和 `display.columnWidth` 优先。`autoWidth: false` 恢复原统一默认 180px。横向虚拟化同样使用数值测宽,不依赖浏览器扫描所有行;长内容默认省略并提供 tooltip。
241
+ `C_Table` 未声明 `width` 的业务列默认按表头和显示文字测宽,均匀抽样最多 100 条已加载数据,测量基准默认 80–360px;少列时实际显示宽度可按比例扩展。`minWidth/maxWidth` 可调整边界;显式列宽、原生百分比宽度、列设置后的宽度和 `display.columnWidth` 优先。`autoWidth: false` 恢复原统一默认 180px。横向虚拟化同样使用数值测宽,不依赖浏览器扫描所有行;长内容默认省略并提供 tooltip。
240
242
 
241
243
  ```ts
242
244
  const columns = [
@@ -257,6 +259,8 @@ const columns = [
257
259
 
258
260
  状态列复用 Naive UI 标签和主题。支持 `success/warning/danger/info/neutral`,也支持 Naive 的 `error/default/primary` 和 CSS 颜色。未知代码保持中性;`0/false` 是有效值,空值保留空态。显式 render 优先;formatter 文字会用于默认颜色判断和测宽。状态配置只改变展示,不会改写数据、排序、筛选或导出。
259
261
 
262
+ 默认智能布局会在缓存的内容基准上分配可用宽度;空间充足时自动业务列按基准比例铺满,空间不足时不压缩表头。最终数值列宽总和同时决定表格与横向滚动范围,`scrollX` 不再挑某一列单独撑大。拖动只改变目标列,偏好提交后不重新分配余量。需要 Naive UI 原生铺满或强制最小滚动宽度时,显式传 `table-layout="fixed"` / `table-layout="auto"`;百分比等非数值列宽也沿用原生布局。
263
+
260
264
  测宽不额外挂载或执行 render;图标、进度条和复杂自定义内容请显式指定 width。数据与列配置更新会触发新的有界测量,配置和缓存只属于当前组件实例。此版本将未声明宽度的业务列由自然布局改为有界内容宽度;既有显式布局及原生 table-layout 覆盖仍保留。
261
265
 
262
266
  表头默认完整展示,不随单元格 ellipsis 配置省略。所有业务列的最小宽度计入完整标题及排序/筛选控件;初始布局、显式窄列宽、恢复列设置与拖拽缩列均受此下限保护。360px 仅限制数据内容测宽;标题更长时允许超过该值,并使用表格内部横向滚动。复杂自定义标题请配置 minWidth。
package/README_EN.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  <div align="center">
6
6
  <p><strong>Turn recurring business interactions into composable components.</strong></p>
7
- <p>Vue 3 · Naive UI · TypeScript · 62 business components</p>
7
+ <p>Vue 3 · Naive UI · TypeScript · 63 business components</p>
8
8
  <p>
9
9
  <a href="https://www.npmjs.com/package/@robot-admin/naive-ui-components"><img src="https://img.shields.io/npm/v/@robot-admin/naive-ui-components?style=flat-square&amp;color=249D70&amp;labelColor=183C2E" alt="npm version"></a>
10
10
  <a href="./package.json"><img src="https://img.shields.io/badge/Vue-3.5+-249D70?style=flat-square&amp;logo=vue.js&amp;logoColor=white&amp;labelColor=183C2E" alt="Vue 3.5+"></a>
@@ -30,15 +30,17 @@
30
30
  | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ |
31
31
  | Configuration | Typed configuration for fields, columns, actions and dialogs; 8 form layouts |
32
32
  | Connected types | Field paths, columns, events and instance methods, with helpers such as `defineFormOptions`, `useCForm` and `useTableQuery` |
33
- | Selective loading | 62 component entries, an auto-import resolver, component CSS and base styles for forms and tables |
33
+ | Selective loading | 63 component entries, an auto-import resolver, component CSS and base styles for forms and tables |
34
34
  | Application integration | Global registration or local imports; injectable feedback, locale and defaults; form dialogs compatible with structurally matching headless CRUD controllers |
35
35
 
36
- The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.34.0**. See the [changelog](./CHANGELOG.md) for release details.
36
+ The library handles UI and interaction. Applications supply business APIs, authentication, authorization, upload services and platform configuration. The current repository version is **0.36.0**. See the [changelog](./CHANGELOG.md) for release details.
37
37
 
38
38
  0.33 adds optional remote tree paths, grouped options, search field settings and table editing contracts while retaining existing defaults. See the [compatibility and standalone demo guide](./docs/guides/component-contracts.md) (Chinese).
39
39
 
40
40
  0.34 adds state-aware tree icons, richer node contexts and action states, plus organization-chart field mapping, controlled interaction and measured connectors. Use `C_Tree` for hierarchical selection and the independent `C_OrgChart` for reporting relationships. See the [organization examples](./docs/guides/tree-org-examples.md) (Chinese).
41
41
 
42
+ 0.36 adds `C_UserPicker` for organization-based person selection, sharing pagination, drafts and confirmation. Workflow nodes gain real connection ports, explicit conditional targets and the same person-selection interface. See [person selection](./docs/guides/user-picker.md) and [workflow design](./docs/guides/workflow.md) (Chinese).
43
+
42
44
  Use `C_Select` for standalone selections and freeform tags. Multiple selections in forms and search share the compact tag summary. Date and time fields can bind directly to formatted API strings. See the [composition examples](./docs/guides/data-workflows.md#多选标签和日期时间) (Chinese).
43
45
 
44
46
  Remote options, free text suggestions and multi-column entity selection use `C_Select`, `C_AutoComplete` and `C_DataPicker` with a shared request contract. Form and search fields accept `source` directly. See [search workflows](./docs/guides/search-workflows.md#远程选项与自由文本建议) and [scenario coverage](./docs/search-selection-coverage.md) (Chinese).
@@ -55,7 +57,7 @@ Set `searchOnReset: true` to run both search and reset through `onSearch`. Use `
55
57
 
56
58
  `C_Table` retains the native Naive UI empty state, including provider theme, locale and `componentOptions.DataTable.renderEmpty`. Use `#empty` to replace the content of one table.
57
59
 
58
- In narrow `C_Table` cells, edit actions wrap so the input stays visible. Utility columns retain compact widths; an ordinary automatic column absorbs spare space. Explicit widths and saved width preferences remain effective.
60
+ In narrow `C_Table` cells, edit actions wrap so the input stays visible. Utility columns remain compact; automatic business columns share available space proportionally to their measured header/content bases, and preserve their bases with horizontal scrolling when they do not fit. Explicit widths and saved width preferences remain effective.
59
61
 
60
62
  `C_Table` shows row numbers and a pager by default and centers all cells, including numbers. Use `:row-number="false"` and `:pagination="false"` to disable the automatic index and pager respectively. Bind server-provided columns and rows directly as shown in the [usage guide](./docs/guides/usage.en.md).
61
63
 
@@ -70,7 +72,7 @@ In narrow `C_Table` cells, edit actions wrap so the input stays visible. Utility
70
72
  | Workspace | `C_Menu` · `C_Tabs` · `C_TagsView` · `C_GlobalSearch` | Menus, view switching, tab navigation and global search |
71
73
  | Common interactions | `C_Login` · `C_Captcha` · `C_Guide` · `C_PageLoading` | Login UI, human verification, onboarding and navigation feedback |
72
74
 
73
- Browse [all 62 components and dependencies](./docs/components.en.md), or explore scenarios in [Robot Admin](https://robotadmin.cn). Cron previews calculate times only; formulas run locally. Production human verification requires server validation. See the [usage guide](./docs/guides/usage.en.md).
75
+ Browse [all 63 components and dependencies](./docs/components.en.md), or explore scenarios in [Robot Admin](https://robotadmin.cn). Cron previews calculate times only; formulas run locally. Production human verification requires server validation. See the [usage guide](./docs/guides/usage.en.md).
74
76
 
75
77
  ## Quick start
76
78
 
@@ -187,7 +189,7 @@ Root imports aggregate navigation components and require `vue-router` at runtime
187
189
  | Document | Contents |
188
190
  | -------------------------------------------------------------- | ----------------------------------------------------------------------------------------- |
189
191
  | [Architecture and isolation](./docs/architecture.en.md) | Dependency boundaries, instance ownership and the independent Element Plus roadmap |
190
- | [Component catalog](./docs/components.en.md) | All 62 components, dependencies and behavior boundaries |
192
+ | [Component catalog](./docs/components.en.md) | All 63 components, dependencies and behavior boundaries |
191
193
  | [Usage guide](./docs/guides/usage.en.md) | Imports, forms/tables, Cron/formulas, maps, onboarding, captcha, login and page loading |
192
194
  | [Density and workbenches](./docs/guides/table-density.md) | Shared form/search/table density, edit modes, split panes and tree capabilities (Chinese) |
193
195
  | [Lists and async tasks](./docs/guides/runtime-performance.md) | Automatic list windows, chat scrolling, search indexes and media task ownership (Chinese) |
@@ -236,10 +238,12 @@ See [development and build](./docs/engineering.en.md) for individual checks and
236
238
 
237
239
  ## Content widths and status columns (0.24)
238
240
 
239
- Columns without `width` now measure their header and up to 100 evenly sampled loaded rows, using formatted values and status labels. Automatic widths default to 80–360px; use `minWidth/maxWidth` to adjust. Explicit widths (including native strings), saved column widths and `display.columnWidth` take precedence. `autoWidth: false` restores the 180px default. Long automatic cells use ellipsis and a tooltip; horizontal virtualization uses the same numeric widths.
241
+ Columns without `width` now measure their header and up to 100 evenly sampled loaded rows, using formatted values and status labels. Content measurement bases default to 80–360px; final automatic widths may grow proportionally to fill available space. Use `minWidth/maxWidth` to adjust the bounds. Explicit widths (including native strings), saved column widths and `display.columnWidth` take precedence. `autoWidth: false` restores the 180px default. Long automatic cells use ellipsis and a tooltip; horizontal virtualization uses the same numeric widths.
240
242
 
241
243
  Use `{ key: 'status', status: true }` for themed status tags, or `status: { S1B: { label: 'Review', color: 'danger' }, S1C: 'success' }`. Semantic colors and CSS colors are supported. Unknown codes stay neutral, zero/false stay valid, and explicit render functions win. Display changes never rewrite data or export policy. Measurement does not invoke render functions; give graphical/custom columns explicit widths. Data and column updates remeasure a bounded sample; all caches remain component-local.
242
244
 
243
245
  Headers display their full text by default, independently of cell ellipsis. Initial layout, explicit or restored narrow widths, and interactive resizing share a minimum that includes the entire title and its sort/filter controls. The 360px measurement cap applies only to cell content; longer headers use internal horizontal scrolling. Custom header content should declare an appropriate minWidth.
244
246
 
245
247
  Compact forms and searches use a 4px row gap and a 2px empty feedback reserve; validation messages grow naturally. Compact form dialogs use tighter padding and internal scrolling. Per-field entrance and layout-size animations have been removed.
248
+
249
+ The default adaptive layout distributes spare viewport space proportionally among automatic business columns; crowded tables keep their measured bases and scroll horizontally. Utility, explicit-width and manually resized columns retain their widths. Resolved numeric widths drive both the table and horizontal scroll range. Resizing changes only the target column, including after preferences are committed. Explicit native `table-layout` attributes or nonnumeric widths retain Naive UI layout semantics and its `scrollX` minimum.
@@ -7,4 +7,13 @@ This package includes unmodified SheetJS Community Edition 0.20.3 runtime code i
7
7
  - Official release: https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz
8
8
  - License: [licenses/SheetJS.txt](./licenses/SheetJS.txt)
9
9
 
10
- The upstream runtime is minified and bundled for distribution. No SheetJS source changes are applied. Other third-party dependencies retain their respective licenses and are installed separately.
10
+ The upstream runtime is minified and bundled for distribution. No SheetJS source changes are applied.
11
+
12
+ The workflow stylesheet includes the required base styles from `@vue-flow/core` 1.48.2 under the MIT license. Selectors and animation names are scoped to this library's workflow container; layout declarations are retained.
13
+
14
+ - Copyright (c) 2019-2025 webkid GmbH
15
+ - Copyright (c) 2021-2025 Burak Cakmakoglu
16
+ - Upstream: https://vueflow.dev/
17
+ - License: [licenses/VueFlow.txt](./licenses/VueFlow.txt)
18
+
19
+ Other third-party dependencies retain their respective licenses.
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./formField.cjs`);exports.C_DataPicker=e.n,exports.createDataPickerField=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_DataPicker2.cjs`),t=require(`./formField.cjs`);exports.C_DataPicker=e.t,exports.createDataPickerField=t.t;
@@ -141,100 +141,108 @@ to {
141
141
  /* layer: default */
142
142
  .filter[data-v-d7f39843]{filter:var(--un-blur) var(--un-brightness) var(--un-contrast) var(--un-drop-shadow) var(--un-grayscale) var(--un-hue-rotate) var(--un-invert) var(--un-saturate) var(--un-sepia);}
143
143
 
144
- .c-data-picker[data-v-70a385cc] {
144
+ .c-data-picker[data-v-3bddd322] {
145
145
  width: 100%;
146
146
  min-width: 0;
147
147
  }
148
- .c-data-picker__inline[data-v-70a385cc] {
148
+ .c-data-picker__inline[data-v-3bddd322] {
149
149
  margin-top: 8px;
150
150
  min-width: 0;
151
151
  }
152
- .c-data-picker__trigger[data-v-70a385cc] {
152
+ .c-data-picker__trigger[data-v-3bddd322] {
153
153
  display: flex;
154
154
  align-items: center;
155
155
  gap: 8px;
156
156
  }
157
- .c-data-picker[data-v-70a385cc] .c-data-picker__open {
157
+ .c-data-picker[data-v-3bddd322] .c-data-picker__open {
158
158
  flex: 1;
159
159
  min-width: 0;
160
160
  }
161
- .c-data-picker[data-v-70a385cc] .c-data-picker__open .n-button__content {
161
+ .c-data-picker[data-v-3bddd322] .c-data-picker__open .n-button__content {
162
162
  display: flex;
163
163
  gap: 12px;
164
164
  width: 100%;
165
165
  justify-content: space-between;
166
166
  overflow: hidden;
167
167
  }
168
- .c-data-picker[data-v-70a385cc] .c-data-picker__open span:first-child {
168
+ .c-data-picker[data-v-3bddd322] .c-data-picker__open span:first-child {
169
169
  overflow: hidden;
170
170
  text-overflow: ellipsis;
171
171
  white-space: nowrap;
172
172
  }
173
- .c-data-picker[data-v-70a385cc] .c-data-picker__placeholder {
173
+ .c-data-picker[data-v-3bddd322] .c-data-picker__placeholder {
174
174
  opacity: 0.55;
175
175
  }
176
- .c-data-picker__label-error[data-v-70a385cc] {
176
+ .c-data-picker__label-error[data-v-3bddd322] {
177
177
  font-size: 12px;
178
178
  color: var(--n-text-color);
179
179
  }
180
180
 
181
181
  /* layer: icons */
182
- .i-mdi\:close[data-v-70a385cc]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
183
- .i-mdi\:magnify[data-v-70a385cc]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
184
- .i-mdi\:refresh[data-v-70a385cc]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
182
+ .i-mdi\:close[data-v-3bddd322]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
183
+ .i-mdi\:magnify[data-v-3bddd322]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
184
+ .i-mdi\:refresh[data-v-3bddd322]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
185
185
  /* layer: default */
186
- .visible[data-v-70a385cc]{visibility:visible;}
187
- .\!inline[data-v-70a385cc]{display:inline !important;}
188
- .inline[data-v-70a385cc]{display:inline;}
189
- .h-4[data-v-70a385cc]{height:1rem;}
190
- .w-4[data-v-70a385cc]{width:1rem;}
191
- .shrink-0[data-v-70a385cc]{flex-shrink:0;}
192
- .table[data-v-70a385cc]{display:table;}
186
+ .visible[data-v-3bddd322]{visibility:visible;}
187
+ .\!inline[data-v-3bddd322]{display:inline !important;}
188
+ .inline[data-v-3bddd322]{display:inline;}
189
+ .h-4[data-v-3bddd322]{height:1rem;}
190
+ .w-4[data-v-3bddd322]{width:1rem;}
191
+ .shrink-0[data-v-3bddd322]{flex-shrink:0;}
192
+ .table[data-v-3bddd322]{display:table;}
193
193
 
194
- .c-data-picker__layout[data-v-fc3e13b4] {
194
+ .c-data-picker__layout[data-v-138a9248] {
195
195
  display: flex;
196
196
  gap: 12px;
197
197
  align-items: stretch;
198
198
  }
199
- .c-data-picker__navigation[data-v-fc3e13b4] {
199
+ .c-data-picker__navigation[data-v-138a9248] {
200
200
  flex: 0 0 180px;
201
201
  max-height: 420px;
202
202
  overflow: auto;
203
203
  }
204
- .c-data-picker__navigation-title[data-v-fc3e13b4] {
204
+ .c-data-picker__selected-panel[data-v-138a9248] {
205
+ flex: 0 0 224px;
206
+ min-width: 0;
207
+ max-height: 420px;
208
+ overflow: auto;
209
+ border-inline-start: 1px solid var(--n-border-color, #e0e0e6);
210
+ padding-inline-start: 12px;
211
+ }
212
+ .c-data-picker__navigation-title[data-v-138a9248] {
205
213
  margin-block: 4px 8px;
206
214
  font-weight: 600;
207
215
  }
208
- .c-data-picker__favorite[data-v-fc3e13b4] {
216
+ .c-data-picker__favorite[data-v-138a9248] {
209
217
  display: inline-flex;
210
218
  gap: 2px;
211
219
  }
212
- .c-data-picker__main[data-v-fc3e13b4] {
220
+ .c-data-picker__main[data-v-138a9248] {
213
221
  min-width: 0;
214
222
  flex: 1;
215
223
  }
216
- .c-data-picker__footer[data-v-fc3e13b4] {
224
+ .c-data-picker__footer[data-v-138a9248] {
217
225
  margin-top: 12px;
218
226
  }
219
- .c-data-picker__history > div[data-v-fc3e13b4] {
227
+ .c-data-picker__history > div[data-v-138a9248] {
220
228
  display: flex;
221
229
  flex-wrap: wrap;
222
230
  align-items: center;
223
231
  gap: 6px;
224
232
  margin-block: 8px;
225
233
  }
226
- .c-data-picker__content[data-v-fc3e13b4]:focus {
234
+ .c-data-picker__content[data-v-138a9248]:focus {
227
235
  outline: none;
228
236
  }
229
- .c-data-picker__search[data-v-fc3e13b4], .c-data-picker__actions[data-v-fc3e13b4], .c-data-picker__selection[data-v-fc3e13b4] {
237
+ .c-data-picker__search[data-v-138a9248], .c-data-picker__actions[data-v-138a9248], .c-data-picker__selection[data-v-138a9248] {
230
238
  display: flex;
231
239
  align-items: center;
232
240
  gap: 8px;
233
241
  }
234
- .c-data-picker__search[data-v-fc3e13b4] {
242
+ .c-data-picker__search[data-v-138a9248] {
235
243
  margin-bottom: 12px;
236
244
  }
237
- .c-data-picker__result-bar[data-v-fc3e13b4] {
245
+ .c-data-picker__result-bar[data-v-138a9248] {
238
246
  display: flex;
239
247
  align-items: center;
240
248
  justify-content: space-between;
@@ -242,54 +250,61 @@ to {
242
250
  gap: 6px 12px;
243
251
  margin-block-start: 10px;
244
252
  }
245
- .c-data-picker__pagination[data-v-fc3e13b4] {
253
+ .c-data-picker__pagination[data-v-138a9248] {
246
254
  margin-inline-start: auto;
247
255
  max-width: 100%;
248
256
  }
249
- .c-data-picker__pagination[data-v-fc3e13b4] .n-pagination {
257
+ .c-data-picker__pagination[data-v-138a9248] .n-pagination {
250
258
  flex-wrap: wrap;
251
259
  justify-content: flex-end;
252
260
  }
253
- .c-data-picker__selection[data-v-fc3e13b4] {
261
+ .c-data-picker__selection[data-v-138a9248] {
254
262
  flex-wrap: wrap;
255
263
  min-width: 0;
256
264
  max-width: 100%;
257
265
  font-size: 12px;
258
266
  }
259
- .c-data-picker__selection[data-v-fc3e13b4] .n-tag {
267
+ .c-data-picker__selection[data-v-138a9248] .n-tag {
260
268
  max-width: 100%;
261
269
  }
262
- .c-data-picker__selection[data-v-fc3e13b4] .n-tag__content {
270
+ .c-data-picker__selection[data-v-138a9248] .n-tag__content {
263
271
  overflow: hidden;
264
272
  text-overflow: ellipsis;
265
273
  white-space: nowrap;
266
274
  }
267
- .c-data-picker__actions[data-v-fc3e13b4] {
275
+ .c-data-picker__actions[data-v-138a9248] {
268
276
  justify-content: flex-end;
269
277
  }
270
- .c-data-picker__error[data-v-fc3e13b4] {
278
+ .c-data-picker__error[data-v-138a9248] {
271
279
  font-size: 12px;
272
280
  color: var(--n-text-color);
273
281
  }
274
282
  @media (max-width: 640px) {
275
- .c-data-picker__layout[data-v-fc3e13b4] {
283
+ .c-data-picker__layout[data-v-138a9248] {
276
284
  flex-direction: column;
277
285
  }
278
- .c-data-picker__navigation[data-v-fc3e13b4] {
286
+ .c-data-picker__selected-panel[data-v-138a9248] {
287
+ flex-basis: auto;
288
+ max-height: 240px;
289
+ border-inline-start: 0;
290
+ border-top: 1px solid var(--n-border-color, #e0e0e6);
291
+ padding: 12px 0 0;
292
+ }
293
+ .c-data-picker__navigation[data-v-138a9248] {
279
294
  flex-basis: auto;
280
295
  max-height: 160px;
281
296
  }
282
297
  }
283
298
 
284
299
  /* layer: icons */
285
- .i-mdi\:check[data-v-fc3e13b4]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
286
- .i-mdi\:close[data-v-fc3e13b4]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
287
- .i-mdi\:magnify[data-v-fc3e13b4]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
288
- .i-mdi\:refresh[data-v-fc3e13b4]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
300
+ .i-mdi\:check[data-v-138a9248]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M21 7L9 19l-5.5-5.5l1.41-1.41L9 16.17L19.59 5.59z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
301
+ .i-mdi\:close[data-v-138a9248]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
302
+ .i-mdi\:magnify[data-v-138a9248]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5l-1.5 1.5l-5-5v-.79l-.27-.27A6.52 6.52 0 0 1 9.5 16A6.5 6.5 0 0 1 3 9.5A6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14S14 12 14 9.5S12 5 9.5 5'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
303
+ .i-mdi\:refresh[data-v-138a9248]{--un-icon:url("data:image/svg+xml;utf8,%3Csvg viewBox='0 0 24 24' display='inline-block' vertical-align='middle' width='1em' height='1em' xmlns='http://www.w3.org/2000/svg' %3E%3Cpath fill='currentColor' d='M17.65 6.35A7.96 7.96 0 0 0 12 4a8 8 0 0 0-8 8a8 8 0 0 0 8 8c3.73 0 6.84-2.55 7.73-6h-2.08A5.99 5.99 0 0 1 12 18a6 6 0 0 1-6-6a6 6 0 0 1 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z'/%3E%3C/svg%3E");-webkit-mask:var(--un-icon) no-repeat;mask:var(--un-icon) no-repeat;-webkit-mask-size:100% 100%;mask-size:100% 100%;background-color:currentColor;color:inherit;display:inline-block;vertical-align:middle;width:1em;height:1em;}
289
304
  /* layer: default */
290
- .visible[data-v-fc3e13b4]{visibility:visible;}
291
- .inline[data-v-fc3e13b4]{display:inline;}
292
- .hidden[data-v-fc3e13b4]{display:none;}
293
- .h-4[data-v-fc3e13b4]{height:1rem;}
294
- .w-4[data-v-fc3e13b4]{width:1rem;}
295
- .table[data-v-fc3e13b4]{display:table;}
305
+ .visible[data-v-138a9248]{visibility:visible;}
306
+ .inline[data-v-138a9248]{display:inline;}
307
+ .hidden[data-v-138a9248]{display:none;}
308
+ .h-4[data-v-138a9248]{height:1rem;}
309
+ .w-4[data-v-138a9248]{width:1rem;}
310
+ .table[data-v-138a9248]{display:table;}
@@ -1,2 +1,3 @@
1
- import { a as DataPickerNavigation, c as DataPickerRequest, d as DataPickerValue, i as DataPickerHistoryOptions, l as DataPickerSource, n as _default, o as DataPickerNavigationNode, r as DataPickerEmits, s as DataPickerProps, t as createDataPickerField, u as DataPickerSourceInput } from "./formField.cjs";
2
- export { _default as C_DataPicker, type DataPickerEmits, type DataPickerHistoryOptions, type DataPickerNavigation, type DataPickerNavigationNode, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
1
+ import { a as DataPickerNavigationContext, c as DataPickerRequest, d as DataPickerSource, f as DataPickerSourceInput, i as DataPickerNavigation, l as DataPickerSelectedItem, n as DataPickerExpose, o as DataPickerNavigationNode, p as DataPickerValue, r as DataPickerHistoryOptions, s as DataPickerProps, t as DataPickerEmits, u as DataPickerSelectionContext } from "./types4.cjs";
2
+ import { n as _default, t as createDataPickerField } from "./formField.cjs";
3
+ export { _default as C_DataPicker, type DataPickerEmits, type DataPickerExpose, type DataPickerHistoryOptions, type DataPickerNavigation, type DataPickerNavigationContext, type DataPickerNavigationNode, type DataPickerProps, type DataPickerRequest, type DataPickerSelectedItem, type DataPickerSelectionContext, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
@@ -1,6 +1,7 @@
1
1
  import "./types.js";
2
2
  import "./useFormConfig.js";
3
3
  import "./config2.js";
4
- import { a as DataPickerNavigation, c as DataPickerRequest, d as DataPickerValue, i as DataPickerHistoryOptions, l as DataPickerSource, n as _default, o as DataPickerNavigationNode, r as DataPickerEmits, s as DataPickerProps, t as createDataPickerField, u as DataPickerSourceInput } from "./formField.js";
4
+ import { a as DataPickerNavigationContext, c as DataPickerRequest, d as DataPickerSource, f as DataPickerSourceInput, i as DataPickerNavigation, l as DataPickerSelectedItem, n as DataPickerExpose, o as DataPickerNavigationNode, p as DataPickerValue, r as DataPickerHistoryOptions, s as DataPickerProps, t as DataPickerEmits, u as DataPickerSelectionContext } from "./types3.js";
5
+ import { n as _default, t as createDataPickerField } from "./formField.js";
5
6
  import "./useFormRenderer.js";
6
- export { _default as C_DataPicker, type DataPickerEmits, type DataPickerHistoryOptions, type DataPickerNavigation, type DataPickerNavigationNode, type DataPickerProps, type DataPickerRequest, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
7
+ export { _default as C_DataPicker, type DataPickerEmits, type DataPickerExpose, type DataPickerHistoryOptions, type DataPickerNavigation, type DataPickerNavigationContext, type DataPickerNavigationNode, type DataPickerProps, type DataPickerRequest, type DataPickerSelectedItem, type DataPickerSelectionContext, type DataPickerSource, type DataPickerSourceInput, type DataPickerValue, createDataPickerField };
@@ -1 +1 @@
1
- import{n as e,t}from"./formField.js";export{e as C_DataPicker,t as createDataPickerField};
1
+ import{t as e}from"./C_DataPicker2.js";import{t}from"./formField.js";export{e as C_DataPicker,t as createDataPickerField};
@@ -0,0 +1 @@
1
+ require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useDataResource.cjs`),n=require(`./data2.cjs`),r=require(`./useComponentLocale.cjs`),i=require(`./export-helper.cjs`),a=require(`./useFormConfig.cjs`),o=require(`./storage.cjs`),s=require(`./helpers.cjs`);let c=require(`vue`),l=require(`naive-ui`);function u(e){return typeof e==`string`||typeof e==`number`&&Number.isFinite(e)}function d(e,t){let n=typeof e.rowKey==`function`?e.rowKey(t):t[e.rowKey];if(!u(n))throw TypeError(`[C_DataPicker] rowKey 必须为字符串或有限数值`);return n}function f(e,t){return e.value===void 0?d(e,t):e.value(t)}function p(e,t){if(e.value===void 0)return;let n=new Set;for(let r of t){let t=e.value(r);if(!u(t)||n.has(t))throw TypeError(`[C_DataPicker] 业务值必须为唯一的字符串或有限数值`);n.add(t)}}function m(e,t,n){if(!Array.isArray(t.rows)||!Number.isSafeInteger(t.total)||t.total<0)throw TypeError(`[C_DataPicker] request 必须返回 rows 数组和非负安全整数 total`);if(t.rows.length>n||t.rows.length>t.total)throw TypeError(`[C_DataPicker] rows 超过请求的分页或 total 范围`);if(s.l(t.rows,t=>d(e,t)).length)throw TypeError(`[C_DataPicker] rowKey 不得缺失或重复`);p(e,t.rows)}function h(e){let t=(0,c.shallowRef)([]),n=(0,c.shallowRef)([]),r=(0,c.computed)(()=>{let t=e.history?.maxItems;return t!==void 0&&Number.isFinite(t)?Math.max(1,Math.min(50,Math.trunc(t))):10}),i=(0,c.computed)(()=>{let t=e.history;if(!(!e.source.resolve||!t?.storageKey||!t.scope))try{return`c-data-picker:${JSON.stringify([t.storageKey,t.scope,e.fixedFilters??null,...e.scope===void 0?[]:[e.scope]])}`}catch{return}}),a=e=>{if(!Array.isArray(e))return[];let t=new Map;for(let n of e)if(n&&typeof n==`object`&&u(n.value)&&typeof n.label==`string`&&!t.has(n.value)&&t.set(n.value,{value:n.value,label:n.label.slice(0,200)}),t.size===r.value)break;return[...t.values()]};(0,c.watch)([i,r,()=>e.history?.favorites],()=>{let r=i.value?o.t(i.value):null,s=r&&typeof r==`object`?r:{};t.value=a(Reflect.get(s,`recent`)),n.value=e.history?.favorites?a(Reflect.get(s,`favorites`)):[]},{immediate:!0});let s=()=>{i.value&&o.i(i.value,{recent:t.value,favorites:n.value})};return{enabled:(0,c.computed)(()=>!!i.value),recent:t,favorites:n,remember:e=>{i.value&&(t.value=a([...e,...t.value]),s())},toggleFavorite:t=>{if(!i.value||!e.history?.favorites)return;let r=n.value.filter(e=>e.value!==t.value);n.value=r.length===n.value.length?a([t,...r]):r,s()},addFavorites:t=>{if(!i.value||!e.history?.favorites)return;let r=a([...n.value,...t]);r.length===n.value.length&&r.every((e,t)=>e.value===n.value[t].value&&e.label===n.value[t].label)||(n.value=r,s())},canAddFavorite:(0,c.computed)(()=>n.value.length<r.value)}}function g(e){let t=(0,c.shallowRef)(!1),n=(0,c.shallowRef)(null),r,i=()=>{r?.abort(),r=void 0,t.value=!1,n.value=null};return{pending:t,error:n,resolve:async a=>{i();let{source:o}=e;if(!o.resolve)return;let s=new AbortController;r=s,t.value=!0;let c=!1;try{let t=[...e.scope===void 0?await o.resolve(a,s.signal):await o.resolve(a,s.signal,{scope:e.scope})];if(s.signal.aborted||r!==s)return;c=!0,m(o,{rows:t,total:t.length},t.length);let n=new Map(t.map(e=>[f(o,e),e]));if(!a.every(t=>{let r=n.get(t);return r!==void 0&&e.rowCheckable?.(r)!==!1&&!e.disabledReason?.(r)}))throw Error(`Selection is missing or no longer eligible`);return n}catch(e){s.signal.aborted||(n.value={kind:c?`invalid`:`failed`,cause:e});return}finally{r===s&&(r=void 0,t.value=!1)}},abort:i}}function _(e){return e==null?[]:[...new Set(Array.isArray(e)?e:[e])]}function v(e,r,i,a,o=()=>!1){let s=(0,c.shallowRef)(!1),l=(0,c.shallowRef)({page:1,search:``,revision:0}),u=(0,c.computed)({get:()=>l.value.page,set:e=>{l.value={...l.value,page:e}}}),p=(0,c.shallowRef)(``),v=(0,c.computed)(()=>l.value.search),y=(0,c.computed)(()=>{let{debounce:t,minChars:n}=e.source;return{debounce:t!==void 0&&Number.isSafeInteger(t)&&t>=0?t:250,minChars:n!==void 0&&Number.isSafeInteger(n)&&n>=0?n:0}}),b=(0,c.shallowRef)(0),x=(0,c.shallowRef)(0),S=(0,c.shallowRef)(new Map),C=(0,c.shallowRef)(new Map),w=(0,c.computed)(()=>{let t=_(e.modelValue);return e.multiple?t:t.slice(0,1)}),T=(0,c.computed)(()=>Number.isFinite(e.pageSize)&&e.pageSize>0?Math.max(1,Math.trunc(e.pageSize)):20),E=(0,c.computed)(()=>e.disabled||e.readonly),D=(0,c.computed)(()=>{if(!e.multiple)return 1;let t=e.maxSelection;return t!==void 0&&Number.isFinite(t)&&t>=1?Math.trunc(t):1/0}),O=h(e),k=g(e),{pending:A,error:j}=k,M=n.t(e.initialValues),N=n.t(e.fixedFilters),P=!1,F,I=t=>f(e.source,t),L=t=>e.rowCheckable?.(t)!==!1&&!e.disabledReason?.(t),R=t=>!e.multiple||S.value.has(t)||S.value.size<D.value,z=t=>e.fixedFilters===void 0?n.t(t):{...n.t(t),...n.t(e.fixedFilters)},B=()=>{Q(),C.value=new Map,b.value++};(0,c.watch)(()=>[e.source,e.source.request,e.source.resolve,e.source.rowKey,e.source.value],B,{flush:`sync`}),(0,c.watch)(()=>e.fixedFilters,e=>{n.a(N,e)||(N=n.t(e),B())},{deep:!0,flush:`sync`}),(0,c.watch)(()=>e.history?.scope,B,{flush:`sync`}),(0,c.watch)(()=>e.scope,B,{flush:`sync`}),(0,c.watch)(()=>e.initialValues,e=>{n.a(M,e)||(M=n.t(e),Q())},{deep:!0,flush:`sync`});let V=t.t({key:()=>s.value&&(!o()||p.value===v.value&&p.value.length>=y.value.minChars)?JSON.stringify([b.value,x.value,u.value,T.value,l.value.revision]):null,load:async({signal:t})=>{let{source:n}=e,{filters:r}=l.value,i=z(r),a={page:u.value,pageSize:T.value,search:v.value,signal:t,...e.scope===void 0?{}:{scope:e.scope},...i===void 0?{}:{filters:i}},o=await n.request(a);return m(n,o,a.pageSize),{rows:[...o.rows],total:o.total}},isEmpty:e=>e.rows.length===0}),H=t.t({key:()=>e.source.resolve&&w.value.length?JSON.stringify([b.value,w.value]):null,load:async({signal:t})=>{let{source:n}=e,r=[...w.value],i=e.scope===void 0?await n.resolve(r,t):await n.resolve(r,t,{scope:e.scope});if(!Array.isArray(i))throw TypeError(`[C_DataPicker] resolve 必须返回行数组`);let a=new Set(r),o=new Map;for(let e of i){let t=f(n,e);a.has(t)&&o.set(t,e)}return o},isEmpty:e=>e.size===0}),U=[],W=(0,c.computed)(()=>V.data.value?.rows??U),G=(0,c.shallowRef)(null);(0,c.watch)(V.data,e=>{if(!s.value||!e)return;G.value=e.total;let t=Math.max(1,Math.ceil(e.total/T.value));u.value>t&&(u.value=t)});function K(e){let t=C.value.get(e);return t?.fromPage?t.row:H.data.value?.get(e)??t?.row}let q=(0,c.computed)(()=>w.value.map(t=>{let n=K(t);return n?e.source.label(n):String(t)}).join(`、`)),J=(0,c.computed)(()=>S.value.size),Y=(0,c.computed)(()=>!E.value&&!A.value&&J.value<=D.value&&(!e.requireSelection||J.value>0)&&(!(e.rowCheckable||e.disabledReason)||[...S.value.keys()].every(e=>{let t=$(e);return t!==void 0&&L(t)}))),X=(0,c.computed)(()=>{let t=[];for(let n of S.value.keys()){let r=$(n);t.push({value:n,label:r?e.source.label(r):String(n),row:r})}return t}),Z=(0,c.computed)(()=>X.value.slice(0,30)),ee=(0,c.computed)(()=>[{type:`selection`,multiple:e.multiple},...e.columns.filter(e=>e.type!==`selection`)]),te=(0,c.computed)(()=>({density:a(),locale:e.locale,toolbar:{show:!1},pagination:!1,selection:{enabled:!0,maxSelection:Number.isFinite(D.value)?D.value:void 0,rowCheckable:e=>!A.value&&L(e)&&R(I(e))},virtualScroll:{enabled:!0,maxHeight:360}}));function Q(){s.value=!1,G.value=null,S.value=new Map,F=void 0,k.abort()}(0,c.onDeactivated)(Q),(0,c.onScopeDispose)(Q);function ne(){E.value||s.value||(S.value=new Map(w.value.map(e=>[e,void 0])),l.value={page:1,search:``,filters:z(M),revision:0},p.value=``,x.value++,s.value=!0)}function $(e){return S.value.get(e)??K(e)}let re=(0,c.computed)(()=>!!(e.source.resolve&&(e.rowCheckable||e.disabledReason||e.revalidateOnConfirm||O.enabled.value||e.presentation===`popover`)));async function ie(){if(!Y.value||!s.value)return!1;let e=[...S.value.keys()],t=x.value,n=re.value,r=n?await k.resolve(e):void 0;return n&&!r||!s.value||x.value!==t||!Y.value?!1:(ae(e,r),!0)}function ae(t,n){let{source:i}=e,a=new Map,o=[];for(let e of t){let t=n?.get(e)??$(e);t&&(a.set(e,{row:t,fromPage:S.value.get(e)!==void 0||C.value.get(e)?.fromPage===!0}),o.push(t))}C.value=a,O.remember(o.map(e=>({value:I(e),label:i.label(e)}))),Q(),r(`update:modelValue`,e.multiple?t:t[0]??null),r(`select`,o)}function oe(){E.value||!e.clearable||(r(`update:modelValue`,e.multiple?[]:null),r(`select`,[]))}function se(){if(F?.rows===W.value&&F.table===i.value)return F.table}function ce(e,t){if(P||A.value||!s.value||!se())return;let n=le(t);S.value=n;let r=W.value.filter(e=>n.has(I(e)));(t.length!==r.length||t.some(e=>!n.has(I(e))))&&(0,c.nextTick)(fe)}function le(t){let n=new Set(W.value.map(I)),r=new Set(t.map(I)),i=new Map(e.multiple?[...S.value].filter(([e])=>!n.has(e)||r.has(e)):[]),a=new Map(W.value.map(t=>[d(e.source,t),t])),o=e.multiple?t:t.slice(-1);for(let t of o){let n=a.get(d(e.source,t));if(!n||!L(n))continue;let r=I(n);!i.has(r)&&i.size>=D.value||i.set(r,n)}return i}function ue(t){if(A.value)return;let n=new Map(S.value);if(!n.delete(t))return;S.value=n;let r=se();if(!r)return;let i=W.value.find(e=>I(e)===t);if(i){P=!0;try{r.unselectRow(d(e.source,i))}finally{P=!1}}}function de(e,t){if(!s.value||A.value||E.value||!Number.isInteger(t))return;let n=[...S.value],r=n.findIndex(([t])=>t===e),i=r+t;if(r<0||i<0||i>=n.length||r===i)return;let[a]=n.splice(r,1);n.splice(i,0,a),S.value=new Map(n)}function fe(){let t=i.value;if(!(!s.value||!t)){P=!0;try{F={table:t,rows:W.value};let n;t.clearSelection();for(let r of W.value){let i=I(r);S.value.has(i)&&(S.value.get(i)!==r&&(n??=new Map(S.value)).set(i,r),L(r)&&t.selectRow(e.source.value===void 0?i:d(e.source,r)))}n&&(S.value=n)}finally{P=!1}}}function pe(){ye(p.value,l.value.filters)}function me(e){ye(``,z(e))}function he(t){let{navigation:n}=e;if(!n)return;let r={...l.value.filters};t===void 0?Reflect.deleteProperty(r,n.field):Reflect.set(r,n.field,t),ye(p.value,z(r))}async function ge(t){if(E.value||!s.value||!e.source.resolve||A.value)return;let n=(await k.resolve([t]))?.get(t);!n||!s.value||R(t)&&(S.value=e.multiple?new Map(S.value).set(t,n):new Map([[t,n]]),fe())}function _e(){if(E.value||!Y.value)return;let t=[];for(let n of S.value.keys()){let r=$(n);r&&L(r)&&t.push({value:n,label:e.source.label(r)})}O.addFavorites(t)}function ve(e){if(E.value||A.value)return;let t=O.favorites.value.find(t=>t.value===e);t&&O.toggleFavorite(t)}function ye(e,t){if(!s.value||E.value)return;let r=l.value,i=r.search===e&&n.a(r.filters,t);if(r.page===1&&i){V.reload();return}i||(G.value=null),l.value={page:1,search:e,filters:n.t(t),revision:r.revision+1}}return(0,c.watch)([W,i],()=>{(0,c.nextTick)(fe)},{flush:`post`}),(0,c.watch)(w,(e,t)=>{if(e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))||(Q(),!C.value.size))return;let n=new Set(e);C.value=new Map([...C.value].filter(([e])=>n.has(e)))},{flush:`sync`}),(0,c.watch)([()=>e.multiple,()=>e.disabled,()=>e.readonly],Q,{flush:`sync`}),{opened:s,reset:B,open:ne,close:Q,confirm:ie,clear:oe,page:u,pageSize:T,searchDraft:p,search:v,searchOptions:y,query:pe,submitFilters:me,list:V,labels:H,rows:W,total:G,display:q,selected:Z,selectedItems:X,move:de,selectedCount:J,canConfirm:Y,columns:ee,tableConfig:te,selectPage:ce,remove:ue,confirming:A,selectionError:j,history:O,chooseHistory:ge,navigate:he,favoriteSelection:_e,removeFavorite:ve,canFavorite:(0,c.computed)(()=>Y.value&&O.canAddFavorite.value&&[...S.value.keys()].some(e=>$(e)!==void 0&&!O.favorites.value.some(t=>t.value===e))),filters:(0,c.computed)(()=>n.t(l.value.filters)),setTable:e=>{i.value=e}}}const y=[`id`,`role`,`aria-label`],b=[`tabindex`],x={class:`c-data-picker__layout`},S={key:0,class:`c-data-picker__navigation`},C={key:0,class:`c-data-picker__navigation-title`},w={class:`c-data-picker__main`},T={key:1,class:`c-data-picker__error`,role:`alert`},E={key:1,class:`c-data-picker__selected-panel`},D={key:0,role:`alert`,class:`c-data-picker__error`},O={key:1,class:`c-data-picker__history`},k={key:0},A={key:1},j={class:`c-data-picker__result-bar`},M={class:`c-data-picker__selection`,"aria-live":`polite`},N={key:0},P={key:1},F=[`aria-label`],I={key:0,class:`c-data-picker__footer`},L={class:`c-data-picker__actions`},R=(0,c.defineComponent)({__name:`PickerPanel`,props:{state:{},options:{},densityValue:{},inline:{type:Boolean},popup:{type:Boolean},panelId:{}},emits:[`confirm`,`dismiss`],setup(t,{expose:n,emit:i}){let a=t,o=i,{t:s}=r.t(()=>a.options.locale),u=(0,c.computed)(()=>e.t(a.densityValue)),{opened:d,page:f,pageSize:p,searchDraft:m,query:h,submitFilters:g,list:_,rows:v,total:R,selected:z,selectedItems:B,move:V,selectedCount:H,canConfirm:U,columns:W,tableConfig:G,selectPage:K,remove:q,confirming:J,selectionError:Y,history:X,chooseHistory:Z,navigate:ee,filters:te}=a.state,Q=(0,c.computed)(()=>a.options.source),ne=(0,c.computed)(()=>a.options.initialValues),$=(0,c.shallowRef)(null),re=(0,c.defineAsyncComponent)({loader:()=>Promise.resolve().then(()=>require(`./C_Table2.cjs`)).then(e=>e.n),loadingComponent:()=>(0,c.h)(`div`,{role:`status`},s(`table.loading`)),errorComponent:()=>(0,c.h)(`div`,{role:`alert`},s(`picker.loadFailed`))}),ie=(0,c.defineAsyncComponent)(()=>Promise.resolve().then(()=>require(`./C_Tree2.cjs`)).then(e=>e.n)),ae=e=>{let t=typeof e==`object`&&!!e&&[`clearSelection`,`selectRow`,`unselectRow`].every(t=>typeof Reflect.get(e,t)==`function`);a.state.setTable(t?e:null)};function oe(e){!a.inline||e.isComposing||(e.preventDefault(),e.stopPropagation(),h())}let se=()=>a.options.navigation?.render?.({value:ce.value[0],select:ee,disabled:J.value||!!a.options.disabled||!!a.options.readonly,density:a.densityValue}),ce=(0,c.computed)(()=>{let e=a.options.navigation?.field,t=e&&te.value?Reflect.get(te.value,e):void 0;return typeof t==`string`||typeof t==`number`?[t]:[]});return n({focus:()=>{($.value?.querySelector(`input:not([type="hidden"])`)??$.value)?.focus()}}),(e,n)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,{class:`c-data-picker__panel`,id:t.popup?t.panelId:void 0,role:t.popup?`dialog`:void 0,"aria-label":t.options.title??(0,c.unref)(s)(`picker.title`)},[(0,c.createElementVNode)(`div`,{ref_key:`panelContent`,ref:$,class:`c-data-picker__content`,tabindex:t.inline?-1:void 0},[(0,c.createElementVNode)(`div`,x,[t.options.navigation||e.$slots.navigation?((0,c.openBlock)(),(0,c.createElementBlock)(`aside`,S,[(0,c.renderSlot)(e.$slots,`navigation`,{filters:(0,c.unref)(te),submit:(0,c.unref)(g),loading:(0,c.unref)(_).loading.value},()=>[t.options.navigation?.render?((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(se),{key:0})):((0,c.openBlock)(),(0,c.createElementBlock)(c.Fragment,{key:1},[t.options.navigation?.title?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,C,(0,c.toDisplayString)(t.options.navigation.title),1)):(0,c.createCommentVNode)(`v-if`,!0),(0,c.createVNode)((0,c.unref)(l.NButton),{text:``,onClick:n[0]||=e=>(0,c.unref)(ee)(void 0)},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(s)(`picker.allCategories`)),1)]),_:1}),t.options.navigation?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(ie),{key:1,density:t.densityValue,data:[...t.options.navigation.options],"key-field":`key`,"label-field":`label`,"selected-keys":ce.value,addable:!1,refreshable:!1,onNodeSelect:n[1]||=(e,t)=>(0,c.unref)(ee)(t[0])},null,8,[`density`,`data`,`selected-keys`])):(0,c.createCommentVNode)(`v-if`,!0)],64))],!0)])):(0,c.createCommentVNode)(`v-if`,!0),(0,c.createElementVNode)(`div`,w,[(0,c.unref)(d)?(0,c.renderSlot)(e.$slots,`query`,{initialValues:ne.value,submit:(0,c.unref)(g),loading:(0,c.unref)(_).loading.value},()=>[((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(t.inline?`div`:`form`),{class:`c-data-picker__search`,onSubmit:(0,c.withModifiers)((0,c.unref)(h),[`stop`,`prevent`])},{default:(0,c.withCtx)(()=>[(0,c.createVNode)((0,c.unref)(l.NInput),{value:(0,c.unref)(m),"onUpdate:value":n[2]||=e=>(0,c.isRef)(m)?m.value=e:null,size:u.value.size,placeholder:(0,c.unref)(s)(`picker.searchPlaceholder`),"input-props":{"aria-label":(0,c.unref)(s)(`picker.searchLabel`)},onKeydown:(0,c.withKeys)(oe,[`enter`]),clearable:``},null,8,[`value`,`size`,`placeholder`,`input-props`]),(0,c.createVNode)((0,c.unref)(l.NButton),{"attr-type":t.inline?`button`:`submit`,size:u.value.size,loading:(0,c.unref)(_).loading.value,type:`primary`,onClick:n[3]||=e=>t.inline&&(0,c.unref)(h)()},{icon:(0,c.withCtx)(()=>[...n[7]||=[(0,c.createElementVNode)(`span`,{class:`i-mdi:magnify w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)(` `+(0,c.toDisplayString)((0,c.unref)(s)(`picker.search`)),1)]),_:1},8,[`attr-type`,`size`,`loading`])]),_:1},40,[`onSubmit`]))],!0,0):(0,c.createCommentVNode)(`v-if`,!0),(0,c.unref)(_).status.value===`error`?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,T,[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(s)(`picker.loadFailed`))+` `,1),(0,c.createVNode)((0,c.unref)(l.NButton),{size:u.value.size,onClick:(0,c.unref)(_).reload},{icon:(0,c.withCtx)(()=>[...n[8]||=[(0,c.createElementVNode)(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)(` `+(0,c.toDisplayString)((0,c.unref)(s)(`common.retry`)),1)]),_:1},8,[`size`,`onClick`])])):(0,c.unref)(d)?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(re),{key:2,ref:ae,data:(0,c.unref)(v),columns:(0,c.unref)(W),"row-key":Q.value.rowKey,loading:(0,c.unref)(_).loading.value,config:(0,c.unref)(G),onSelectionChange:(0,c.unref)(K)},null,8,[`data`,`columns`,`row-key`,`loading`,`config`,`onSelectionChange`])):(0,c.createCommentVNode)(`v-if`,!0)]),e.$slots.selected?((0,c.openBlock)(),(0,c.createElementBlock)(`aside`,E,[(0,c.renderSlot)(e.$slots,`selected`,{items:(0,c.unref)(B),remove:(0,c.unref)(q),move:(0,c.unref)(V),disabled:(0,c.unref)(J)},void 0,!0)])):(0,c.createCommentVNode)(`v-if`,!0)]),(0,c.unref)(Y)?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,D,(0,c.toDisplayString)((0,c.unref)(s)((0,c.unref)(Y).kind===`invalid`?`picker.selectionInvalid`:`picker.selectionFailed`)),1)):(0,c.createCommentVNode)(`v-if`,!0),(0,c.unref)(X).enabled.value?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,O,[(0,c.unref)(X).recent.value.length?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,k,[(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)((0,c.unref)(s)(`picker.recent`)),1),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)((0,c.unref)(X).recent.value,e=>((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(l.NButton),{key:typeof e.value+`:`+e.value,size:`tiny`,disabled:(0,c.unref)(J),onClick:t=>(0,c.unref)(Z)(e.value)},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)]),_:2},1032,[`disabled`,`onClick`]))),128))])):(0,c.createCommentVNode)(`v-if`,!0),t.options.history?.favorites&&(0,c.unref)(X).favorites.value.length?((0,c.openBlock)(),(0,c.createElementBlock)(`div`,A,[(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)((0,c.unref)(s)(`picker.favorites`)),1),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)((0,c.unref)(X).favorites.value,e=>((0,c.openBlock)(),(0,c.createElementBlock)(`span`,{key:typeof e.value+`:`+e.value,class:`c-data-picker__favorite`},[(0,c.createVNode)((0,c.unref)(l.NButton),{size:`tiny`,disabled:(0,c.unref)(J),onClick:t=>(0,c.unref)(Z)(e.value)},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)]),_:2},1032,[`disabled`,`onClick`]),(0,c.createVNode)((0,c.unref)(l.NButton),{size:`tiny`,disabled:(0,c.unref)(J),"aria-label":`${(0,c.unref)(s)(`picker.removeFavorite`)} ${e.label}`,onClick:n=>t.state.removeFavorite(e.value)},{default:(0,c.withCtx)(()=>[...n[9]||=[(0,c.createTextVNode)(`×`,-1)]]),_:1},8,[`disabled`,`aria-label`,`onClick`])]))),128))])):(0,c.createCommentVNode)(`v-if`,!0),t.options.history?.favorites?((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(l.NButton),{key:2,text:``,disabled:!t.state.canFavorite.value,onClick:t.state.favoriteSelection},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(s)(`picker.favorite`)),1)]),_:1},8,[`disabled`,`onClick`])):(0,c.createCommentVNode)(`v-if`,!0)])):(0,c.createCommentVNode)(`v-if`,!0),(0,c.createElementVNode)(`div`,j,[(0,c.createElementVNode)(`div`,M,[(0,c.unref)(R)===null?(0,c.createCommentVNode)(`v-if`,!0):((0,c.openBlock)(),(0,c.createElementBlock)(`span`,N,(0,c.toDisplayString)((0,c.unref)(s)(`picker.total`,{count:(0,c.unref)(R)})),1)),(0,c.createElementVNode)(`span`,null,(0,c.toDisplayString)((0,c.unref)(s)(`picker.selected`,{count:(0,c.unref)(H)})),1),((0,c.openBlock)(!0),(0,c.createElementBlock)(c.Fragment,null,(0,c.renderList)(e.$slots.selected?[]:(0,c.unref)(z),e=>((0,c.openBlock)(),(0,c.createBlock)((0,c.unref)(l.NTag),{key:`${typeof e.value}:${e.value}`,size:`small`,closable:``,title:e.label,onClose:t=>(0,c.unref)(q)(e.value)},{default:(0,c.withCtx)(()=>[(0,c.createTextVNode)((0,c.toDisplayString)(e.label),1)]),_:2},1032,[`title`,`onClose`]))),128)),!e.$slots.selected&&(0,c.unref)(H)>30?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,P,(0,c.toDisplayString)((0,c.unref)(s)(`picker.moreSelected`,{count:(0,c.unref)(H)-30})),1)):(0,c.createCommentVNode)(`v-if`,!0)]),(0,c.unref)(R)!==null&&(0,c.unref)(R)>(0,c.unref)(p)?((0,c.openBlock)(),(0,c.createElementBlock)(`nav`,{key:0,class:`c-data-picker__pagination`,"aria-label":(0,c.unref)(s)(`picker.pagination`)},[(0,c.createVNode)((0,c.unref)(l.NPagination),{page:(0,c.unref)(f),"onUpdate:page":n[4]||=e=>(0,c.isRef)(f)?f.value=e:null,"page-size":(0,c.unref)(p),"item-count":(0,c.unref)(R),"page-slot":5,size:u.value.size},null,8,[`page`,`page-size`,`item-count`,`size`])],8,F)):(0,c.createCommentVNode)(`v-if`,!0)])],8,b),t.options.showActions===!1?(0,c.createCommentVNode)(`v-if`,!0):((0,c.openBlock)(),(0,c.createElementBlock)(`div`,I,[(0,c.createElementVNode)(`div`,L,[(0,c.createVNode)((0,c.unref)(l.NButton),{size:u.value.size,onClick:n[5]||=e=>o(`dismiss`)},{icon:(0,c.withCtx)(()=>[...n[10]||=[(0,c.createElementVNode)(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)(` `+(0,c.toDisplayString)((0,c.unref)(s)(`common.cancel`)),1)]),_:1},8,[`size`]),(0,c.createVNode)((0,c.unref)(l.NButton),{type:`primary`,size:u.value.size,disabled:!(0,c.unref)(U),loading:(0,c.unref)(J),onClick:n[6]||=e=>o(`confirm`)},{icon:(0,c.withCtx)(()=>[...n[11]||=[(0,c.createElementVNode)(`span`,{class:`i-mdi:check w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)(` `+(0,c.toDisplayString)((0,c.unref)(s)(`common.confirm`)),1)]),_:1},8,[`size`,`disabled`,`loading`])])]))],8,y))}});var z=i.t(R,[[`__scopeId`,`data-v-138a9248`]]);const B={class:`c-data-picker`},V={key:1,class:`c-data-picker__label-error`,role:`status`},H=(0,c.defineComponent)({name:`C_DataPicker`,__name:`index`,props:{source:{},columns:{},modelValue:{},multiple:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},title:{},placeholder:{},density:{},locale:{},pageSize:{default:20},scope:{},showActions:{type:Boolean,default:!0},showTrigger:{type:Boolean,default:!0},revalidateOnConfirm:{type:Boolean},disabledReason:{},requireSelection:{type:Boolean},presentation:{},initialValues:{},fixedFilters:{},rowCheckable:{},maxSelection:{},navigation:{},history:{}},emits:[`update:modelValue`,`select`,`cancel`],setup(t,{expose:n,emit:i}){let o=t,s=i,u=(0,c.useSlots)(),d=(0,c.shallowRef)(null),f=(0,c.shallowRef)(null),p=(0,c.shallowRef)(null),m=(0,c.useId)(),h=(0,c.computed)(()=>o.presentation===`inline`),g=(0,c.computed)(()=>o.presentation===`popover`),_=(0,c.computed)(()=>o.disabled||o.readonly),y=(0,c.shallowRef)(!1),b=(0,c.computed)(()=>g.value&&!y.value?l.NPopover:h.value?l.NCard:l.NModal),x=a.o(),S=(0,c.computed)(()=>o.density??x.density??`compact`),C=(0,c.computed)(()=>e.t(S.value)),{t:w}=r.t(()=>o.locale),T=v(o,s,d,()=>S.value,()=>g.value&&!y.value),{opened:E,close:D,confirm:O,clear:k,searchDraft:A,query:j,labels:M,display:N}=T,P=null,F=!1,I;(0,c.watch)(E,e=>{e||(clearTimeout(I),I=void 0,y.value=!1)}),(0,c.onScopeDispose)(()=>clearTimeout(I));function L(e){E.value||_.value||(P=e?.currentTarget??(typeof document>`u`?null:document.activeElement),T.open(),h.value&&(0,c.nextTick)(()=>f.value?.focus()))}function R(){let e=E.value;clearTimeout(I),I=void 0,D(),e&&s(`cancel`),y.value=!1;let t=P;P=null,(0,c.nextTick)(()=>{let e=t?.isConnected?t:p.value?.querySelector(`input, button`);F=!0,e?.focus(),queueMicrotask(()=>{F=!1})})}async function H(){let e=await O();return e&&R(),e}function U(e){_.value||(L(),A.value=e,clearTimeout(I),I=setTimeout(()=>{I=void 0,E.value&&e.length>=T.searchOptions.value.minChars&&j()},T.searchOptions.value.debounce))}function W(){_.value||(clearTimeout(I),I=void 0,L(),A.value!==T.search.value&&j(),y.value=!0)}function G(){if(F){F=!1;return}L()}function K(e){e.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),R()):e.key===`ArrowDown`?(e.preventDefault(),L(),(0,c.nextTick)(()=>f.value?.focus())):e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),clearTimeout(I),I=void 0,L(),j()))}let q=()=>(0,c.h)(l.NInput,{value:E.value?A.value:N.value,placeholder:o.placeholder??w(`picker.quickSearch`),size:C.value.size,disabled:o.disabled,readonly:o.readonly,inputProps:{"aria-label":o.title??w(`picker.title`),"aria-expanded":E.value,"aria-controls":E.value?m:void 0},"onUpdate:value":U,onFocus:G,onClick:()=>L(),onKeydown:K}),J=()=>(0,c.h)(l.NButton,{class:`c-data-picker__open`,size:C.value.size,disabled:o.disabled,"aria-readonly":o.readonly,"aria-expanded":h.value?E.value:void 0,"aria-controls":h.value&&E.value?m:void 0,title:N.value,onClick:e=>h.value&&E.value?R():L(e)},()=>[(0,c.h)(`span`,{class:N.value?void 0:`c-data-picker__placeholder`},N.value||(o.placeholder??w(`picker.placeholder`))),(0,c.h)(`span`,{class:`i-mdi:magnify w-4 h-4 shrink-0`,"aria-hidden":`true`})]),Y=()=>{if(u.trigger)return u.trigger({open:L,disabled:!!_.value,opened:E.value,display:N.value});let e=[g.value?q():J()];return g.value&&e.push((0,c.h)(l.NButton,{class:`c-data-picker__more`,size:C.value.size,disabled:_.value,onClick:W},()=>w(`picker.more`))),o.clearable&&o.modelValue!=null&&(!Array.isArray(o.modelValue)||o.modelValue.length)&&e.push((0,c.h)(l.NButton,{class:`c-data-picker__clear`,size:C.value.size,disabled:_.value,"aria-label":w(`picker.clear`),onClick:k},()=>(0,c.h)(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`}))),(0,c.h)(`div`,{class:`c-data-picker__trigger`,ref:p},e)};function X(e){e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),R())}let Z=(0,c.computed)(()=>{let e=o.title??w(`picker.title`);return g.value&&!y.value?{show:E.value,trigger:`manual`,placement:`bottom-start`,showArrow:!1,width:640,style:{maxWidth:`calc(100vw - 24px)`},onClickoutside:e=>{e.target instanceof Node&&p.value?.contains(e.target)||R()},onKeydown:X}:h.value?{id:m,class:`c-data-picker__inline`,role:`region`,"aria-label":e,title:o.showActions===!1&&o.showTrigger===!1?void 0:e,size:`small`,onKeydown:X}:{show:E.value,preset:`card`,class:`c-data-picker__modal`,title:e,"aria-label":e,style:{width:`min(${u.selected?1160:960}px, calc(100vw - 24px))`},"onUpdate:show":e=>{e||R()}}});return n({open:L,close:R,reset:T.reset,confirm:H}),(e,t)=>((0,c.openBlock)(),(0,c.createElementBlock)(`div`,B,[o.showTrigger!==!1&&(!g.value||y.value)?((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(Y),{key:0})):(0,c.createCommentVNode)(`v-if`,!0),(0,c.unref)(M).status.value===`error`?((0,c.openBlock)(),(0,c.createElementBlock)(`span`,V,[(0,c.createTextVNode)((0,c.toDisplayString)((0,c.unref)(w)(`picker.labelFailed`))+` `,1),(0,c.createVNode)((0,c.unref)(l.NButton),{text:``,size:`tiny`,onClick:(0,c.unref)(M).reload},{icon:(0,c.withCtx)(()=>[...t[0]||=[(0,c.createElementVNode)(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:(0,c.withCtx)(()=>[(0,c.createTextVNode)(` `+(0,c.toDisplayString)((0,c.unref)(w)(`common.retry`)),1)]),_:1},8,[`onClick`])])):(0,c.createCommentVNode)(`v-if`,!0),!h.value||(0,c.unref)(E)?((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(b.value),(0,c.normalizeProps)((0,c.mergeProps)({key:2},Z.value)),(0,c.createSlots)({default:(0,c.withCtx)(()=>[(0,c.unref)(E)?((0,c.openBlock)(),(0,c.createBlock)(z,{key:0,ref_key:`panelRef`,ref:f,state:(0,c.unref)(T),options:o,"density-value":S.value,inline:h.value||g.value&&!y.value,popup:g.value&&!y.value,"panel-id":(0,c.unref)(m),onConfirm:H,onDismiss:R,onKeydown:X},(0,c.createSlots)({_:2},[e.$slots.query?{name:`query`,fn:(0,c.withCtx)(t=>[(0,c.renderSlot)(e.$slots,`query`,(0,c.normalizeProps)((0,c.guardReactiveProps)(t)),void 0,!0)]),key:`0`}:void 0,e.$slots.navigation?{name:`navigation`,fn:(0,c.withCtx)(t=>[(0,c.renderSlot)(e.$slots,`navigation`,(0,c.normalizeProps)((0,c.guardReactiveProps)(t)),void 0,!0)]),key:`1`}:void 0,e.$slots.selected?{name:`selected`,fn:(0,c.withCtx)(t=>[(0,c.renderSlot)(e.$slots,`selected`,(0,c.normalizeProps)((0,c.guardReactiveProps)(t)),void 0,!0)]),key:`2`}:void 0]),1032,[`state`,`density-value`,`inline`,`popup`,`panel-id`])):(0,c.createCommentVNode)(`v-if`,!0)]),_:2},[g.value&&!y.value?{name:`trigger`,fn:(0,c.withCtx)(()=>[((0,c.openBlock)(),(0,c.createBlock)((0,c.resolveDynamicComponent)(Y)))]),key:`0`}:void 0]),1040)):(0,c.createCommentVNode)(`v-if`,!0)]))}});var U=i.t(H,[[`__scopeId`,`data-v-3bddd322`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}});
@@ -0,0 +1 @@
1
+ import{t as e}from"./density.js";import{t}from"./useDataResource.js";import{a as n,t as r}from"./data2.js";import{t as i}from"./useComponentLocale.js";import{t as a}from"./export-helper.js";import{o}from"./useFormConfig.js";import{i as s,t as c}from"./storage.js";import{l}from"./helpers.js";import{Fragment as u,computed as d,createBlock as f,createCommentVNode as p,createElementBlock as m,createElementVNode as h,createSlots as g,createTextVNode as _,createVNode as v,defineAsyncComponent as y,defineComponent as b,guardReactiveProps as x,h as S,isRef as C,mergeProps as w,nextTick as T,normalizeProps as E,onDeactivated as D,onScopeDispose as O,openBlock as k,renderList as A,renderSlot as j,resolveDynamicComponent as M,shallowRef as N,toDisplayString as P,unref as F,useId as I,useSlots as ee,watch as L,withCtx as R,withKeys as z,withModifiers as te}from"vue";import{NButton as B,NCard as ne,NInput as V,NModal as re,NPagination as ie,NPopover as ae,NTag as H}from"naive-ui";function U(e){return typeof e==`string`||typeof e==`number`&&Number.isFinite(e)}function W(e,t){let n=typeof e.rowKey==`function`?e.rowKey(t):t[e.rowKey];if(!U(n))throw TypeError(`[C_DataPicker] rowKey 必须为字符串或有限数值`);return n}function G(e,t){return e.value===void 0?W(e,t):e.value(t)}function K(e,t){if(e.value===void 0)return;let n=new Set;for(let r of t){let t=e.value(r);if(!U(t)||n.has(t))throw TypeError(`[C_DataPicker] 业务值必须为唯一的字符串或有限数值`);n.add(t)}}function oe(e,t,n){if(!Array.isArray(t.rows)||!Number.isSafeInteger(t.total)||t.total<0)throw TypeError(`[C_DataPicker] request 必须返回 rows 数组和非负安全整数 total`);if(t.rows.length>n||t.rows.length>t.total)throw TypeError(`[C_DataPicker] rows 超过请求的分页或 total 范围`);if(l(t.rows,t=>W(e,t)).length)throw TypeError(`[C_DataPicker] rowKey 不得缺失或重复`);K(e,t.rows)}function q(e){let t=N([]),n=N([]),r=d(()=>{let t=e.history?.maxItems;return t!==void 0&&Number.isFinite(t)?Math.max(1,Math.min(50,Math.trunc(t))):10}),i=d(()=>{let t=e.history;if(!(!e.source.resolve||!t?.storageKey||!t.scope))try{return`c-data-picker:${JSON.stringify([t.storageKey,t.scope,e.fixedFilters??null,...e.scope===void 0?[]:[e.scope]])}`}catch{return}}),a=e=>{if(!Array.isArray(e))return[];let t=new Map;for(let n of e)if(n&&typeof n==`object`&&U(n.value)&&typeof n.label==`string`&&!t.has(n.value)&&t.set(n.value,{value:n.value,label:n.label.slice(0,200)}),t.size===r.value)break;return[...t.values()]};L([i,r,()=>e.history?.favorites],()=>{let r=i.value?c(i.value):null,o=r&&typeof r==`object`?r:{};t.value=a(Reflect.get(o,`recent`)),n.value=e.history?.favorites?a(Reflect.get(o,`favorites`)):[]},{immediate:!0});let o=()=>{i.value&&s(i.value,{recent:t.value,favorites:n.value})};return{enabled:d(()=>!!i.value),recent:t,favorites:n,remember:e=>{i.value&&(t.value=a([...e,...t.value]),o())},toggleFavorite:t=>{if(!i.value||!e.history?.favorites)return;let r=n.value.filter(e=>e.value!==t.value);n.value=r.length===n.value.length?a([t,...r]):r,o()},addFavorites:t=>{if(!i.value||!e.history?.favorites)return;let r=a([...n.value,...t]);r.length===n.value.length&&r.every((e,t)=>e.value===n.value[t].value&&e.label===n.value[t].label)||(n.value=r,o())},canAddFavorite:d(()=>n.value.length<r.value)}}function se(e){let t=N(!1),n=N(null),r,i=()=>{r?.abort(),r=void 0,t.value=!1,n.value=null};return{pending:t,error:n,resolve:async a=>{i();let{source:o}=e;if(!o.resolve)return;let s=new AbortController;r=s,t.value=!0;let c=!1;try{let t=[...e.scope===void 0?await o.resolve(a,s.signal):await o.resolve(a,s.signal,{scope:e.scope})];if(s.signal.aborted||r!==s)return;c=!0,oe(o,{rows:t,total:t.length},t.length);let n=new Map(t.map(e=>[G(o,e),e]));if(!a.every(t=>{let r=n.get(t);return r!==void 0&&e.rowCheckable?.(r)!==!1&&!e.disabledReason?.(r)}))throw Error(`Selection is missing or no longer eligible`);return n}catch(e){s.signal.aborted||(n.value={kind:c?`invalid`:`failed`,cause:e});return}finally{r===s&&(r=void 0,t.value=!1)}},abort:i}}function J(e){return e==null?[]:[...new Set(Array.isArray(e)?e:[e])]}function ce(e,i,a,o,s=()=>!1){let c=N(!1),l=N({page:1,search:``,revision:0}),u=d({get:()=>l.value.page,set:e=>{l.value={...l.value,page:e}}}),f=N(``),p=d(()=>l.value.search),m=d(()=>{let{debounce:t,minChars:n}=e.source;return{debounce:t!==void 0&&Number.isSafeInteger(t)&&t>=0?t:250,minChars:n!==void 0&&Number.isSafeInteger(n)&&n>=0?n:0}}),h=N(0),g=N(0),_=N(new Map),v=N(new Map),y=d(()=>{let t=J(e.modelValue);return e.multiple?t:t.slice(0,1)}),b=d(()=>Number.isFinite(e.pageSize)&&e.pageSize>0?Math.max(1,Math.trunc(e.pageSize)):20),x=d(()=>e.disabled||e.readonly),S=d(()=>{if(!e.multiple)return 1;let t=e.maxSelection;return t!==void 0&&Number.isFinite(t)&&t>=1?Math.trunc(t):1/0}),C=q(e),w=se(e),{pending:E,error:k}=w,A=r(e.initialValues),j=r(e.fixedFilters),M=!1,P,F=t=>G(e.source,t),I=t=>e.rowCheckable?.(t)!==!1&&!e.disabledReason?.(t),ee=t=>!e.multiple||_.value.has(t)||_.value.size<S.value,R=t=>e.fixedFilters===void 0?r(t):{...r(t),...r(e.fixedFilters)},z=()=>{Y(),v.value=new Map,h.value++};L(()=>[e.source,e.source.request,e.source.resolve,e.source.rowKey,e.source.value],z,{flush:`sync`}),L(()=>e.fixedFilters,e=>{n(j,e)||(j=r(e),z())},{deep:!0,flush:`sync`}),L(()=>e.history?.scope,z,{flush:`sync`}),L(()=>e.scope,z,{flush:`sync`}),L(()=>e.initialValues,e=>{n(A,e)||(A=r(e),Y())},{deep:!0,flush:`sync`});let te=t({key:()=>c.value&&(!s()||f.value===p.value&&f.value.length>=m.value.minChars)?JSON.stringify([h.value,g.value,u.value,b.value,l.value.revision]):null,load:async({signal:t})=>{let{source:n}=e,{filters:r}=l.value,i=R(r),a={page:u.value,pageSize:b.value,search:p.value,signal:t,...e.scope===void 0?{}:{scope:e.scope},...i===void 0?{}:{filters:i}},o=await n.request(a);return oe(n,o,a.pageSize),{rows:[...o.rows],total:o.total}},isEmpty:e=>e.rows.length===0}),B=t({key:()=>e.source.resolve&&y.value.length?JSON.stringify([h.value,y.value]):null,load:async({signal:t})=>{let{source:n}=e,r=[...y.value],i=e.scope===void 0?await n.resolve(r,t):await n.resolve(r,t,{scope:e.scope});if(!Array.isArray(i))throw TypeError(`[C_DataPicker] resolve 必须返回行数组`);let a=new Set(r),o=new Map;for(let e of i){let t=G(n,e);a.has(t)&&o.set(t,e)}return o},isEmpty:e=>e.size===0}),ne=[],V=d(()=>te.data.value?.rows??ne),re=N(null);L(te.data,e=>{if(!c.value||!e)return;re.value=e.total;let t=Math.max(1,Math.ceil(e.total/b.value));u.value>t&&(u.value=t)});function ie(e){let t=v.value.get(e);return t?.fromPage?t.row:B.data.value?.get(e)??t?.row}let ae=d(()=>y.value.map(t=>{let n=ie(t);return n?e.source.label(n):String(t)}).join(`、`)),H=d(()=>_.value.size),U=d(()=>!x.value&&!E.value&&H.value<=S.value&&(!e.requireSelection||H.value>0)&&(!(e.rowCheckable||e.disabledReason)||[..._.value.keys()].every(e=>{let t=X(e);return t!==void 0&&I(t)}))),K=d(()=>{let t=[];for(let n of _.value.keys()){let r=X(n);t.push({value:n,label:r?e.source.label(r):String(n),row:r})}return t}),ce=d(()=>K.value.slice(0,30)),le=d(()=>[{type:`selection`,multiple:e.multiple},...e.columns.filter(e=>e.type!==`selection`)]),ue=d(()=>({density:o(),locale:e.locale,toolbar:{show:!1},pagination:!1,selection:{enabled:!0,maxSelection:Number.isFinite(S.value)?S.value:void 0,rowCheckable:e=>!E.value&&I(e)&&ee(F(e))},virtualScroll:{enabled:!0,maxHeight:360}}));function Y(){c.value=!1,re.value=null,_.value=new Map,P=void 0,w.abort()}D(Y),O(Y);function de(){x.value||c.value||(_.value=new Map(y.value.map(e=>[e,void 0])),l.value={page:1,search:``,filters:R(A),revision:0},f.value=``,g.value++,c.value=!0)}function X(e){return _.value.get(e)??ie(e)}let Z=d(()=>!!(e.source.resolve&&(e.rowCheckable||e.disabledReason||e.revalidateOnConfirm||C.enabled.value||e.presentation===`popover`)));async function Q(){if(!U.value||!c.value)return!1;let e=[..._.value.keys()],t=g.value,n=Z.value,r=n?await w.resolve(e):void 0;return n&&!r||!c.value||g.value!==t||!U.value?!1:($(e,r),!0)}function $(t,n){let{source:r}=e,a=new Map,o=[];for(let e of t){let t=n?.get(e)??X(e);t&&(a.set(e,{row:t,fromPage:_.value.get(e)!==void 0||v.value.get(e)?.fromPage===!0}),o.push(t))}v.value=a,C.remember(o.map(e=>({value:F(e),label:r.label(e)}))),Y(),i(`update:modelValue`,e.multiple?t:t[0]??null),i(`select`,o)}function fe(){x.value||!e.clearable||(i(`update:modelValue`,e.multiple?[]:null),i(`select`,[]))}function pe(){if(P?.rows===V.value&&P.table===a.value)return P.table}function me(e,t){if(M||E.value||!c.value||!pe())return;let n=he(t);_.value=n;let r=V.value.filter(e=>n.has(F(e)));(t.length!==r.length||t.some(e=>!n.has(F(e))))&&T(ve)}function he(t){let n=new Set(V.value.map(F)),r=new Set(t.map(F)),i=new Map(e.multiple?[..._.value].filter(([e])=>!n.has(e)||r.has(e)):[]),a=new Map(V.value.map(t=>[W(e.source,t),t])),o=e.multiple?t:t.slice(-1);for(let t of o){let n=a.get(W(e.source,t));if(!n||!I(n))continue;let r=F(n);!i.has(r)&&i.size>=S.value||i.set(r,n)}return i}function ge(t){if(E.value)return;let n=new Map(_.value);if(!n.delete(t))return;_.value=n;let r=pe();if(!r)return;let i=V.value.find(e=>F(e)===t);if(i){M=!0;try{r.unselectRow(W(e.source,i))}finally{M=!1}}}function _e(e,t){if(!c.value||E.value||x.value||!Number.isInteger(t))return;let n=[..._.value],r=n.findIndex(([t])=>t===e),i=r+t;if(r<0||i<0||i>=n.length||r===i)return;let[a]=n.splice(r,1);n.splice(i,0,a),_.value=new Map(n)}function ve(){let t=a.value;if(!(!c.value||!t)){M=!0;try{P={table:t,rows:V.value};let n;t.clearSelection();for(let r of V.value){let i=F(r);_.value.has(i)&&(_.value.get(i)!==r&&(n??=new Map(_.value)).set(i,r),I(r)&&t.selectRow(e.source.value===void 0?i:W(e.source,r)))}n&&(_.value=n)}finally{M=!1}}}function ye(){Te(f.value,l.value.filters)}function be(e){Te(``,R(e))}function xe(t){let{navigation:n}=e;if(!n)return;let r={...l.value.filters};t===void 0?Reflect.deleteProperty(r,n.field):Reflect.set(r,n.field,t),Te(f.value,R(r))}async function Se(t){if(x.value||!c.value||!e.source.resolve||E.value)return;let n=(await w.resolve([t]))?.get(t);!n||!c.value||ee(t)&&(_.value=e.multiple?new Map(_.value).set(t,n):new Map([[t,n]]),ve())}function Ce(){if(x.value||!U.value)return;let t=[];for(let n of _.value.keys()){let r=X(n);r&&I(r)&&t.push({value:n,label:e.source.label(r)})}C.addFavorites(t)}function we(e){if(x.value||E.value)return;let t=C.favorites.value.find(t=>t.value===e);t&&C.toggleFavorite(t)}function Te(e,t){if(!c.value||x.value)return;let i=l.value,a=i.search===e&&n(i.filters,t);if(i.page===1&&a){te.reload();return}a||(re.value=null),l.value={page:1,search:e,filters:r(t),revision:i.revision+1}}return L([V,a],()=>{T(ve)},{flush:`post`}),L(y,(e,t)=>{if(e.length===t.length&&e.every((e,n)=>Object.is(e,t[n]))||(Y(),!v.value.size))return;let n=new Set(e);v.value=new Map([...v.value].filter(([e])=>n.has(e)))},{flush:`sync`}),L([()=>e.multiple,()=>e.disabled,()=>e.readonly],Y,{flush:`sync`}),{opened:c,reset:z,open:de,close:Y,confirm:Q,clear:fe,page:u,pageSize:b,searchDraft:f,search:p,searchOptions:m,query:ye,submitFilters:be,list:te,labels:B,rows:V,total:re,display:ae,selected:ce,selectedItems:K,move:_e,selectedCount:H,canConfirm:U,columns:le,tableConfig:ue,selectPage:me,remove:ge,confirming:E,selectionError:k,history:C,chooseHistory:Se,navigate:xe,favoriteSelection:Ce,removeFavorite:we,canFavorite:d(()=>U.value&&C.canAddFavorite.value&&[..._.value.keys()].some(e=>X(e)!==void 0&&!C.favorites.value.some(t=>t.value===e))),filters:d(()=>r(l.value.filters)),setTable:e=>{a.value=e}}}const le=[`id`,`role`,`aria-label`],ue=[`tabindex`],Y={class:`c-data-picker__layout`},de={key:0,class:`c-data-picker__navigation`},X={key:0,class:`c-data-picker__navigation-title`},Z={class:`c-data-picker__main`},Q={key:1,class:`c-data-picker__error`,role:`alert`},$={key:1,class:`c-data-picker__selected-panel`},fe={key:0,role:`alert`,class:`c-data-picker__error`},pe={key:1,class:`c-data-picker__history`},me={key:0},he={key:1},ge={class:`c-data-picker__result-bar`},_e={class:`c-data-picker__selection`,"aria-live":`polite`},ve={key:0},ye={key:1},be=[`aria-label`],xe={key:0,class:`c-data-picker__footer`},Se={class:`c-data-picker__actions`};var Ce=a(b({__name:`PickerPanel`,props:{state:{},options:{},densityValue:{},inline:{type:Boolean},popup:{type:Boolean},panelId:{}},emits:[`confirm`,`dismiss`],setup(t,{expose:n,emit:r}){let a=t,o=r,{t:s}=i(()=>a.options.locale),c=d(()=>e(a.densityValue)),{opened:l,page:g,pageSize:b,searchDraft:x,query:w,submitFilters:T,list:E,rows:D,total:O,selected:I,selectedItems:ee,move:L,selectedCount:ne,canConfirm:re,columns:ae,tableConfig:U,selectPage:W,remove:G,confirming:K,selectionError:oe,history:q,chooseHistory:se,navigate:J,filters:ce}=a.state,Ce=d(()=>a.options.source),we=d(()=>a.options.initialValues),Te=N(null),Ee=y({loader:()=>import(`./C_Table2.js`).then(e=>e.n),loadingComponent:()=>S(`div`,{role:`status`},s(`table.loading`)),errorComponent:()=>S(`div`,{role:`alert`},s(`picker.loadFailed`))}),De=y(()=>import(`./C_Tree2.js`).then(e=>e.n)),Oe=e=>{let t=typeof e==`object`&&!!e&&[`clearSelection`,`selectRow`,`unselectRow`].every(t=>typeof Reflect.get(e,t)==`function`);a.state.setTable(t?e:null)};function ke(e){!a.inline||e.isComposing||(e.preventDefault(),e.stopPropagation(),w())}let Ae=()=>a.options.navigation?.render?.({value:je.value[0],select:J,disabled:K.value||!!a.options.disabled||!!a.options.readonly,density:a.densityValue}),je=d(()=>{let e=a.options.navigation?.field,t=e&&ce.value?Reflect.get(ce.value,e):void 0;return typeof t==`string`||typeof t==`number`?[t]:[]});return n({focus:()=>{(Te.value?.querySelector(`input:not([type="hidden"])`)??Te.value)?.focus()}}),(e,n)=>(k(),m(`div`,{class:`c-data-picker__panel`,id:t.popup?t.panelId:void 0,role:t.popup?`dialog`:void 0,"aria-label":t.options.title??F(s)(`picker.title`)},[h(`div`,{ref_key:`panelContent`,ref:Te,class:`c-data-picker__content`,tabindex:t.inline?-1:void 0},[h(`div`,Y,[t.options.navigation||e.$slots.navigation?(k(),m(`aside`,de,[j(e.$slots,`navigation`,{filters:F(ce),submit:F(T),loading:F(E).loading.value},()=>[t.options.navigation?.render?(k(),f(M(Ae),{key:0})):(k(),m(u,{key:1},[t.options.navigation?.title?(k(),m(`div`,X,P(t.options.navigation.title),1)):p(`v-if`,!0),v(F(B),{text:``,onClick:n[0]||=e=>F(J)(void 0)},{default:R(()=>[_(P(F(s)(`picker.allCategories`)),1)]),_:1}),t.options.navigation?(k(),f(F(De),{key:1,density:t.densityValue,data:[...t.options.navigation.options],"key-field":`key`,"label-field":`label`,"selected-keys":je.value,addable:!1,refreshable:!1,onNodeSelect:n[1]||=(e,t)=>F(J)(t[0])},null,8,[`density`,`data`,`selected-keys`])):p(`v-if`,!0)],64))],!0)])):p(`v-if`,!0),h(`div`,Z,[F(l)?j(e.$slots,`query`,{initialValues:we.value,submit:F(T),loading:F(E).loading.value},()=>[(k(),f(M(t.inline?`div`:`form`),{class:`c-data-picker__search`,onSubmit:te(F(w),[`stop`,`prevent`])},{default:R(()=>[v(F(V),{value:F(x),"onUpdate:value":n[2]||=e=>C(x)?x.value=e:null,size:c.value.size,placeholder:F(s)(`picker.searchPlaceholder`),"input-props":{"aria-label":F(s)(`picker.searchLabel`)},onKeydown:z(ke,[`enter`]),clearable:``},null,8,[`value`,`size`,`placeholder`,`input-props`]),v(F(B),{"attr-type":t.inline?`button`:`submit`,size:c.value.size,loading:F(E).loading.value,type:`primary`,onClick:n[3]||=e=>t.inline&&F(w)()},{icon:R(()=>[...n[7]||=[h(`span`,{class:`i-mdi:magnify w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:R(()=>[_(` `+P(F(s)(`picker.search`)),1)]),_:1},8,[`attr-type`,`size`,`loading`])]),_:1},40,[`onSubmit`]))],!0,0):p(`v-if`,!0),F(E).status.value===`error`?(k(),m(`div`,Q,[_(P(F(s)(`picker.loadFailed`))+` `,1),v(F(B),{size:c.value.size,onClick:F(E).reload},{icon:R(()=>[...n[8]||=[h(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:R(()=>[_(` `+P(F(s)(`common.retry`)),1)]),_:1},8,[`size`,`onClick`])])):F(l)?(k(),f(F(Ee),{key:2,ref:Oe,data:F(D),columns:F(ae),"row-key":Ce.value.rowKey,loading:F(E).loading.value,config:F(U),onSelectionChange:F(W)},null,8,[`data`,`columns`,`row-key`,`loading`,`config`,`onSelectionChange`])):p(`v-if`,!0)]),e.$slots.selected?(k(),m(`aside`,$,[j(e.$slots,`selected`,{items:F(ee),remove:F(G),move:F(L),disabled:F(K)},void 0,!0)])):p(`v-if`,!0)]),F(oe)?(k(),m(`div`,fe,P(F(s)(F(oe).kind===`invalid`?`picker.selectionInvalid`:`picker.selectionFailed`)),1)):p(`v-if`,!0),F(q).enabled.value?(k(),m(`div`,pe,[F(q).recent.value.length?(k(),m(`div`,me,[h(`span`,null,P(F(s)(`picker.recent`)),1),(k(!0),m(u,null,A(F(q).recent.value,e=>(k(),f(F(B),{key:typeof e.value+`:`+e.value,size:`tiny`,disabled:F(K),onClick:t=>F(se)(e.value)},{default:R(()=>[_(P(e.label),1)]),_:2},1032,[`disabled`,`onClick`]))),128))])):p(`v-if`,!0),t.options.history?.favorites&&F(q).favorites.value.length?(k(),m(`div`,he,[h(`span`,null,P(F(s)(`picker.favorites`)),1),(k(!0),m(u,null,A(F(q).favorites.value,e=>(k(),m(`span`,{key:typeof e.value+`:`+e.value,class:`c-data-picker__favorite`},[v(F(B),{size:`tiny`,disabled:F(K),onClick:t=>F(se)(e.value)},{default:R(()=>[_(P(e.label),1)]),_:2},1032,[`disabled`,`onClick`]),v(F(B),{size:`tiny`,disabled:F(K),"aria-label":`${F(s)(`picker.removeFavorite`)} ${e.label}`,onClick:n=>t.state.removeFavorite(e.value)},{default:R(()=>[...n[9]||=[_(`×`,-1)]]),_:1},8,[`disabled`,`aria-label`,`onClick`])]))),128))])):p(`v-if`,!0),t.options.history?.favorites?(k(),f(F(B),{key:2,text:``,disabled:!t.state.canFavorite.value,onClick:t.state.favoriteSelection},{default:R(()=>[_(P(F(s)(`picker.favorite`)),1)]),_:1},8,[`disabled`,`onClick`])):p(`v-if`,!0)])):p(`v-if`,!0),h(`div`,ge,[h(`div`,_e,[F(O)===null?p(`v-if`,!0):(k(),m(`span`,ve,P(F(s)(`picker.total`,{count:F(O)})),1)),h(`span`,null,P(F(s)(`picker.selected`,{count:F(ne)})),1),(k(!0),m(u,null,A(e.$slots.selected?[]:F(I),e=>(k(),f(F(H),{key:`${typeof e.value}:${e.value}`,size:`small`,closable:``,title:e.label,onClose:t=>F(G)(e.value)},{default:R(()=>[_(P(e.label),1)]),_:2},1032,[`title`,`onClose`]))),128)),!e.$slots.selected&&F(ne)>30?(k(),m(`span`,ye,P(F(s)(`picker.moreSelected`,{count:F(ne)-30})),1)):p(`v-if`,!0)]),F(O)!==null&&F(O)>F(b)?(k(),m(`nav`,{key:0,class:`c-data-picker__pagination`,"aria-label":F(s)(`picker.pagination`)},[v(F(ie),{page:F(g),"onUpdate:page":n[4]||=e=>C(g)?g.value=e:null,"page-size":F(b),"item-count":F(O),"page-slot":5,size:c.value.size},null,8,[`page`,`page-size`,`item-count`,`size`])],8,be)):p(`v-if`,!0)])],8,ue),t.options.showActions===!1?p(`v-if`,!0):(k(),m(`div`,xe,[h(`div`,Se,[v(F(B),{size:c.value.size,onClick:n[5]||=e=>o(`dismiss`)},{icon:R(()=>[...n[10]||=[h(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:R(()=>[_(` `+P(F(s)(`common.cancel`)),1)]),_:1},8,[`size`]),v(F(B),{type:`primary`,size:c.value.size,disabled:!F(re),loading:F(K),onClick:n[6]||=e=>o(`confirm`)},{icon:R(()=>[...n[11]||=[h(`span`,{class:`i-mdi:check w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:R(()=>[_(` `+P(F(s)(`common.confirm`)),1)]),_:1},8,[`size`,`disabled`,`loading`])])]))],8,le))}}),[[`__scopeId`,`data-v-138a9248`]]);const we={class:`c-data-picker`},Te={key:1,class:`c-data-picker__label-error`,role:`status`};var Ee=a(b({name:`C_DataPicker`,__name:`index`,props:{source:{},columns:{},modelValue:{},multiple:{type:Boolean},disabled:{type:Boolean},readonly:{type:Boolean},clearable:{type:Boolean},title:{},placeholder:{},density:{},locale:{},pageSize:{default:20},scope:{},showActions:{type:Boolean,default:!0},showTrigger:{type:Boolean,default:!0},revalidateOnConfirm:{type:Boolean},disabledReason:{},requireSelection:{type:Boolean},presentation:{},initialValues:{},fixedFilters:{},rowCheckable:{},maxSelection:{},navigation:{},history:{}},emits:[`update:modelValue`,`select`,`cancel`],setup(t,{expose:n,emit:r}){let a=t,s=r,c=ee(),l=N(null),u=N(null),y=N(null),b=I(),C=d(()=>a.presentation===`inline`),D=d(()=>a.presentation===`popover`),A=d(()=>a.disabled||a.readonly),z=N(!1),te=d(()=>D.value&&!z.value?ae:C.value?ne:re),ie=o(),H=d(()=>a.density??ie.density??`compact`),U=d(()=>e(H.value)),{t:W}=i(()=>a.locale),G=ce(a,s,l,()=>H.value,()=>D.value&&!z.value),{opened:K,close:oe,confirm:q,clear:se,searchDraft:J,query:le,labels:ue,display:Y}=G,de=null,X=!1,Z;L(K,e=>{e||(clearTimeout(Z),Z=void 0,z.value=!1)}),O(()=>clearTimeout(Z));function Q(e){K.value||A.value||(de=e?.currentTarget??(typeof document>`u`?null:document.activeElement),G.open(),C.value&&T(()=>u.value?.focus()))}function $(){let e=K.value;clearTimeout(Z),Z=void 0,oe(),e&&s(`cancel`),z.value=!1;let t=de;de=null,T(()=>{let e=t?.isConnected?t:y.value?.querySelector(`input, button`);X=!0,e?.focus(),queueMicrotask(()=>{X=!1})})}async function fe(){let e=await q();return e&&$(),e}function pe(e){A.value||(Q(),J.value=e,clearTimeout(Z),Z=setTimeout(()=>{Z=void 0,K.value&&e.length>=G.searchOptions.value.minChars&&le()},G.searchOptions.value.debounce))}function me(){A.value||(clearTimeout(Z),Z=void 0,Q(),J.value!==G.search.value&&le(),z.value=!0)}function he(){if(X){X=!1;return}Q()}function ge(e){e.isComposing||(e.key===`Escape`?(e.preventDefault(),e.stopPropagation(),$()):e.key===`ArrowDown`?(e.preventDefault(),Q(),T(()=>u.value?.focus())):e.key===`Enter`&&(e.preventDefault(),e.stopPropagation(),clearTimeout(Z),Z=void 0,Q(),le()))}let _e=()=>S(V,{value:K.value?J.value:Y.value,placeholder:a.placeholder??W(`picker.quickSearch`),size:U.value.size,disabled:a.disabled,readonly:a.readonly,inputProps:{"aria-label":a.title??W(`picker.title`),"aria-expanded":K.value,"aria-controls":K.value?b:void 0},"onUpdate:value":pe,onFocus:he,onClick:()=>Q(),onKeydown:ge}),ve=()=>S(B,{class:`c-data-picker__open`,size:U.value.size,disabled:a.disabled,"aria-readonly":a.readonly,"aria-expanded":C.value?K.value:void 0,"aria-controls":C.value&&K.value?b:void 0,title:Y.value,onClick:e=>C.value&&K.value?$():Q(e)},()=>[S(`span`,{class:Y.value?void 0:`c-data-picker__placeholder`},Y.value||(a.placeholder??W(`picker.placeholder`))),S(`span`,{class:`i-mdi:magnify w-4 h-4 shrink-0`,"aria-hidden":`true`})]),ye=()=>{if(c.trigger)return c.trigger({open:Q,disabled:!!A.value,opened:K.value,display:Y.value});let e=[D.value?_e():ve()];return D.value&&e.push(S(B,{class:`c-data-picker__more`,size:U.value.size,disabled:A.value,onClick:me},()=>W(`picker.more`))),a.clearable&&a.modelValue!=null&&(!Array.isArray(a.modelValue)||a.modelValue.length)&&e.push(S(B,{class:`c-data-picker__clear`,size:U.value.size,disabled:A.value,"aria-label":W(`picker.clear`),onClick:se},()=>S(`span`,{class:`i-mdi:close w-4 h-4`,"aria-hidden":`true`}))),S(`div`,{class:`c-data-picker__trigger`,ref:y},e)};function be(e){e.key!==`Escape`||e.defaultPrevented||(e.preventDefault(),e.stopPropagation(),$())}let xe=d(()=>{let e=a.title??W(`picker.title`);return D.value&&!z.value?{show:K.value,trigger:`manual`,placement:`bottom-start`,showArrow:!1,width:640,style:{maxWidth:`calc(100vw - 24px)`},onClickoutside:e=>{e.target instanceof Node&&y.value?.contains(e.target)||$()},onKeydown:be}:C.value?{id:b,class:`c-data-picker__inline`,role:`region`,"aria-label":e,title:a.showActions===!1&&a.showTrigger===!1?void 0:e,size:`small`,onKeydown:be}:{show:K.value,preset:`card`,class:`c-data-picker__modal`,title:e,"aria-label":e,style:{width:`min(${c.selected?1160:960}px, calc(100vw - 24px))`},"onUpdate:show":e=>{e||$()}}});return n({open:Q,close:$,reset:G.reset,confirm:fe}),(e,t)=>(k(),m(`div`,we,[a.showTrigger!==!1&&(!D.value||z.value)?(k(),f(M(ye),{key:0})):p(`v-if`,!0),F(ue).status.value===`error`?(k(),m(`span`,Te,[_(P(F(W)(`picker.labelFailed`))+` `,1),v(F(B),{text:``,size:`tiny`,onClick:F(ue).reload},{icon:R(()=>[...t[0]||=[h(`span`,{class:`i-mdi:refresh w-4 h-4`,"aria-hidden":`true`},null,-1)]]),default:R(()=>[_(` `+P(F(W)(`common.retry`)),1)]),_:1},8,[`onClick`])])):p(`v-if`,!0),!C.value||F(K)?(k(),f(M(te.value),E(w({key:2},xe.value)),g({default:R(()=>[F(K)?(k(),f(Ce,{key:0,ref_key:`panelRef`,ref:u,state:F(G),options:a,"density-value":H.value,inline:C.value||D.value&&!z.value,popup:D.value&&!z.value,"panel-id":F(b),onConfirm:fe,onDismiss:$,onKeydown:be},g({_:2},[e.$slots.query?{name:`query`,fn:R(t=>[j(e.$slots,`query`,E(x(t)),void 0,!0)]),key:`0`}:void 0,e.$slots.navigation?{name:`navigation`,fn:R(t=>[j(e.$slots,`navigation`,E(x(t)),void 0,!0)]),key:`1`}:void 0,e.$slots.selected?{name:`selected`,fn:R(t=>[j(e.$slots,`selected`,E(x(t)),void 0,!0)]),key:`2`}:void 0]),1032,[`state`,`density-value`,`inline`,`popup`,`panel-id`])):p(`v-if`,!0)]),_:2},[D.value&&!z.value?{name:`trigger`,fn:R(()=>[(k(),f(M(ye)))]),key:`0`}:void 0]),1040)):p(`v-if`,!0)]))}}),[[`__scopeId`,`data-v-3bddd322`]]);export{G as n,U as r,Ee as t};
package/dist/C_Date.d.cts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./types4.cjs";
1
+ import { a as DateProps, i as DatePickerMode, n as DateExpose, o as DateRangeValue, r as DateModelValue, s as DateValue, t as DateEmits } from "./types5.cjs";
2
2
  import { AllowedComponentProps, ComponentCustomProps, EmitFn, VNode, VNodeProps } from "vue";
3
3
 
4
4
  //#region src/components/C_Date/index.d.ts