@robot-admin/naive-ui-components 0.40.4 → 0.41.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.
- package/CHANGELOG.md +16 -0
- package/README.md +62 -214
- package/README_EN.md +62 -195
- package/dist/ActionOverflow.cjs +1 -0
- package/dist/ActionOverflow.js +1 -0
- package/dist/C_ActionBar.css +63 -53
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_ApprovalViewer.cjs +1 -0
- package/dist/C_ApprovalViewer.css +79 -0
- package/dist/C_ApprovalViewer.d.cts +2 -0
- package/dist/C_ApprovalViewer.d.ts +2 -0
- package/dist/C_ApprovalViewer.js +1 -0
- package/dist/C_ApprovalViewer2.cjs +1 -0
- package/dist/C_ApprovalViewer2.js +1 -0
- package/dist/C_Attachments.cjs +1 -0
- package/dist/C_Attachments.css +204 -0
- package/dist/C_Attachments.d.cts +2 -0
- package/dist/C_Attachments.d.ts +2 -0
- package/dist/C_Attachments.js +1 -0
- package/dist/C_Attachments2.cjs +1 -0
- package/dist/C_Attachments2.js +1 -0
- package/dist/C_AudioPlayer.d.cts +1 -1
- package/dist/C_AudioPlayer.d.ts +1 -1
- package/dist/C_AutoComplete.d.cts +2 -2
- package/dist/C_AutoComplete.d.ts +2 -2
- package/dist/C_AvatarGroup.d.cts +1 -1
- package/dist/C_AvatarGroup.d.ts +1 -1
- package/dist/C_Barcode.d.cts +1 -1
- package/dist/C_Barcode.d.ts +1 -1
- package/dist/C_BatchResult.css +10 -10
- package/dist/C_BatchResult.d.cts +1 -1
- package/dist/C_BatchResult.d.ts +1 -1
- package/dist/C_BatchResult2.cjs +1 -1
- package/dist/C_BatchResult2.js +1 -1
- package/dist/C_Breadcrumb.d.cts +2 -2
- package/dist/C_Breadcrumb.d.ts +1 -1
- package/dist/C_Cascade.d.cts +1 -1
- package/dist/C_Cascade.d.ts +1 -1
- package/dist/C_ChangeReview.cjs +1 -0
- package/dist/C_ChangeReview.css +49 -0
- package/dist/C_ChangeReview.d.cts +2 -0
- package/dist/C_ChangeReview.d.ts +2 -0
- package/dist/C_ChangeReview.js +1 -0
- package/dist/C_ChangeReview2.cjs +1 -0
- package/dist/C_ChangeReview2.js +1 -0
- package/dist/C_Chat.css +120 -67
- package/dist/C_Chat.d.cts +2 -2
- package/dist/C_Chat.d.ts +2 -2
- package/dist/C_Chat2.cjs +1 -1
- package/dist/C_Chat2.js +1 -1
- package/dist/C_City.d.cts +1 -1
- package/dist/C_City.d.ts +1 -1
- package/dist/C_Code.d.cts +1 -1
- package/dist/C_Code.d.ts +1 -1
- package/dist/C_ContextMenu.d.cts +1 -1
- package/dist/C_ContextMenu.d.ts +1 -1
- package/dist/C_DataPicker.cjs +1 -1
- package/dist/C_DataPicker.css +125 -50
- package/dist/C_DataPicker.d.cts +3 -3
- package/dist/C_DataPicker.d.ts +4 -3
- package/dist/C_DataPicker.js +1 -1
- package/dist/C_DataPicker2.cjs +1 -1
- package/dist/C_DataPicker2.js +1 -1
- package/dist/C_Date.d.cts +1 -1
- package/dist/C_Date.d.ts +1 -1
- package/dist/C_Density.d.cts +1 -1
- package/dist/C_Density.d.ts +1 -1
- package/dist/C_Descriptions.cjs +1 -0
- package/dist/C_Descriptions.css +86 -0
- package/dist/C_Descriptions.d.cts +2 -0
- package/dist/C_Descriptions.d.ts +2 -0
- package/dist/C_Descriptions.js +1 -0
- package/dist/C_Descriptions2.cjs +1 -0
- package/dist/C_Descriptions2.js +1 -0
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_Editor2.cjs +1 -1
- package/dist/C_Editor2.js +1 -1
- package/dist/C_ErrorSummary.d.cts +1 -1
- package/dist/C_ErrorSummary.d.ts +1 -1
- package/dist/C_FilePreview.cjs +1 -1
- package/dist/C_FilePreview.d.cts +2 -1
- package/dist/C_FilePreview.d.ts +2 -1
- package/dist/C_FilePreview.js +1 -1
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_FilterBuilder.cjs +1 -0
- package/dist/C_FilterBuilder.css +59 -0
- package/dist/C_FilterBuilder.d.cts +2 -0
- package/dist/C_FilterBuilder.d.ts +2 -0
- package/dist/C_FilterBuilder.js +1 -0
- package/dist/C_FilterBuilder2.cjs +1 -0
- package/dist/C_FilterBuilder2.js +1 -0
- package/dist/C_Form.base.css +16 -16
- package/dist/C_Form.css +16 -16
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +3 -3
- package/dist/C_FormModal.css +64 -54
- package/dist/C_FormModal.d.cts +2 -2
- package/dist/C_FormModal.d.ts +4 -4
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.d.cts +2 -1
- package/dist/C_FormSearch.d.ts +3 -2
- package/dist/C_GlobalSearch.css +156 -137
- package/dist/C_GlobalSearch.d.cts +2 -2
- package/dist/C_GlobalSearch.d.ts +2 -2
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_Guide.css +49 -3
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Guide2.cjs +1 -1
- package/dist/C_Guide2.js +1 -1
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_ImageAnnotator.cjs +1 -0
- package/dist/C_ImageAnnotator.css +143 -0
- package/dist/C_ImageAnnotator.d.cts +2 -0
- package/dist/C_ImageAnnotator.d.ts +2 -0
- package/dist/C_ImageAnnotator.js +1 -0
- package/dist/C_ImageAnnotator2.cjs +1 -0
- package/dist/C_ImageAnnotator2.js +1 -0
- package/dist/C_ImportWizard.cjs +1 -0
- package/dist/C_ImportWizard.css +42 -0
- package/dist/C_ImportWizard.d.cts +2 -0
- package/dist/C_ImportWizard.d.ts +2 -0
- package/dist/C_ImportWizard.js +1 -0
- package/dist/C_ImportWizard2.cjs +1 -0
- package/dist/C_ImportWizard2.js +1 -0
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Loading.d.cts +1 -1
- package/dist/C_Loading.d.ts +1 -1
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Markdown2.cjs +1 -1
- package/dist/C_Markdown2.js +1 -1
- package/dist/C_Menu.d.cts +2 -2
- package/dist/C_Menu.d.ts +1 -1
- package/dist/C_NotificationCenter.cjs +1 -1
- package/dist/C_NotificationCenter.css +39 -39
- package/dist/C_NotificationCenter.d.cts +2 -1
- package/dist/C_NotificationCenter.d.ts +2 -1
- package/dist/C_NotificationCenter.js +1 -1
- package/dist/C_NotificationCenter2.cjs +1 -1
- package/dist/C_NotificationCenter2.js +1 -1
- package/dist/C_NotificationInbox.cjs +1 -0
- package/dist/C_NotificationInbox.css +154 -0
- package/dist/C_NotificationInbox.d.cts +2 -0
- package/dist/C_NotificationInbox.d.ts +2 -0
- package/dist/C_NotificationInbox.js +1 -0
- package/dist/C_NotificationInbox2.cjs +1 -0
- package/dist/C_NotificationInbox2.js +1 -0
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_QRCode2.cjs +1 -1
- package/dist/C_QRCode2.js +1 -1
- package/dist/C_RecordList.cjs +1 -0
- package/dist/C_RecordList.css +70 -0
- package/dist/C_RecordList.d.cts +2 -0
- package/dist/C_RecordList.d.ts +2 -0
- package/dist/C_RecordList.js +1 -0
- package/dist/C_RecordList2.cjs +1 -0
- package/dist/C_RecordList2.js +1 -0
- package/dist/C_RecurrenceEditor.cjs +1 -0
- package/dist/C_RecurrenceEditor.css +68 -0
- package/dist/C_RecurrenceEditor.d.cts +2 -0
- package/dist/C_RecurrenceEditor.d.ts +2 -0
- package/dist/C_RecurrenceEditor.js +1 -0
- package/dist/C_RecurrenceEditor2.cjs +1 -0
- package/dist/C_RecurrenceEditor2.js +1 -0
- package/dist/C_RelationshipExplorer.cjs +1 -0
- package/dist/C_RelationshipExplorer.css +76 -0
- package/dist/C_RelationshipExplorer.d.cts +2 -0
- package/dist/C_RelationshipExplorer.d.ts +2 -0
- package/dist/C_RelationshipExplorer.js +1 -0
- package/dist/C_RelationshipExplorer2.cjs +1 -0
- package/dist/C_RelationshipExplorer2.js +1 -0
- package/dist/C_ResourceSchedule.cjs +1 -0
- package/dist/C_ResourceSchedule.css +104 -0
- package/dist/C_ResourceSchedule.d.cts +2 -0
- package/dist/C_ResourceSchedule.d.ts +2 -0
- package/dist/C_ResourceSchedule.js +1 -0
- package/dist/C_ResourceSchedule2.cjs +1 -0
- package/dist/C_ResourceSchedule2.js +1 -0
- package/dist/C_ScanInput.cjs +1 -0
- package/dist/C_ScanInput.css +33 -0
- package/dist/C_ScanInput.d.cts +2 -0
- package/dist/C_ScanInput.d.ts +2 -0
- package/dist/C_ScanInput.js +1 -0
- package/dist/C_ScanInput2.cjs +1 -0
- package/dist/C_ScanInput2.js +1 -0
- package/dist/C_SectionNav.d.cts +1 -1
- package/dist/C_SectionNav.d.ts +1 -1
- package/dist/C_Select.d.cts +2 -2
- package/dist/C_Select.d.ts +2 -2
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +194 -184
- package/dist/C_Table.css +178 -168
- package/dist/C_Table.d.cts +2 -2
- package/dist/C_Table.d.ts +15 -14
- package/dist/C_Table2.cjs +3 -3
- package/dist/C_Table2.js +3 -3
- package/dist/C_TagsView.d.cts +2 -2
- package/dist/C_TagsView.d.ts +1 -1
- package/dist/C_TaskBoard.cjs +1 -0
- package/dist/C_TaskBoard.css +58 -0
- package/dist/C_TaskBoard.d.cts +2 -0
- package/dist/C_TaskBoard.d.ts +2 -0
- package/dist/C_TaskBoard.js +1 -0
- package/dist/C_TaskBoard2.cjs +1 -0
- package/dist/C_TaskBoard2.js +1 -0
- package/dist/C_TaskPanel.cjs +1 -0
- package/dist/C_TaskPanel.css +68 -0
- package/dist/C_TaskPanel.d.cts +2 -0
- package/dist/C_TaskPanel.d.ts +2 -0
- package/dist/C_TaskPanel.js +1 -0
- package/dist/C_TaskPanel2.cjs +1 -0
- package/dist/C_TaskPanel2.js +1 -0
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Timeline2.cjs +1 -1
- package/dist/C_Timeline2.js +1 -1
- package/dist/C_Transfer.css +108 -41
- package/dist/C_Transfer.d.cts +2 -2
- package/dist/C_Transfer.d.ts +2 -2
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Tree.d.cts +1 -1
- package/dist/C_Tree.d.ts +13 -12
- package/dist/C_Upload.cjs +1 -1
- package/dist/C_Upload.d.cts +2 -1
- package/dist/C_Upload.d.ts +2 -1
- package/dist/C_Upload.js +1 -1
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_UserPicker.d.cts +1 -1
- package/dist/C_UserPicker.d.ts +2 -2
- package/dist/C_WorkFlow.d.ts +2 -2
- package/dist/ExportMenu.cjs +1 -0
- package/dist/ExportMenu.js +1 -0
- package/dist/NotificationItem.cjs +1 -0
- package/dist/NotificationItem.js +1 -0
- package/dist/component-config.d.ts +33 -10
- package/dist/config.d.cts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/constants.cjs +1 -0
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants.js +1 -0
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +6 -232
- package/dist/constants3.d.ts +6 -232
- package/dist/constants4.d.cts +9 -199
- package/dist/constants4.d.ts +9 -199
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/context.d.cts +33 -10
- package/dist/data2.d.cts +8 -8
- package/dist/data2.d.ts +8 -8
- package/dist/dateRange.d.cts +4 -263
- package/dist/dateRange.d.ts +4 -263
- package/dist/editors.d.cts +11 -11
- package/dist/editors.d.ts +11 -11
- package/dist/excel.cjs +1 -0
- package/dist/excel.js +1 -0
- package/dist/fieldRenderers.cjs +1 -1
- package/dist/fieldRenderers.js +1 -1
- package/dist/fileUrl.cjs +1 -0
- package/dist/fileUrl.js +1 -0
- package/dist/html2.cjs +1 -0
- package/dist/html2.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +88 -69
- package/dist/index.d.ts +87 -68
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +54 -75
- package/dist/index.vue.d.ts +54 -75
- package/dist/index10.vue.d.cts +25 -27
- package/dist/index10.vue.d.ts +54 -41
- package/dist/index11.vue.d.cts +54 -41
- package/dist/index11.vue.d.ts +133 -75
- package/dist/index12.vue.d.cts +133 -75
- package/dist/index12.vue.d.ts +24 -6
- package/dist/index13.vue.d.cts +24 -6
- package/dist/index13.vue.d.ts +39 -57
- package/dist/index14.vue.d.cts +39 -57
- package/dist/index14.vue.d.ts +80 -16
- package/dist/index15.vue.d.cts +80 -16
- package/dist/index15.vue.d.ts +16 -56
- package/dist/index16.vue.d.cts +16 -56
- package/dist/index16.vue.d.ts +40 -118
- package/dist/index17.vue.d.cts +40 -118
- package/dist/index17.vue.d.ts +58 -52
- package/dist/index18.vue.d.cts +58 -52
- package/dist/index18.vue.d.ts +16 -20
- package/dist/index19.vue.d.cts +16 -20
- package/dist/index19.vue.d.ts +67 -14
- package/dist/index2.vue.d.cts +55 -17
- package/dist/index2.vue.d.ts +55 -17
- package/dist/index20.vue.d.cts +67 -14
- package/dist/index20.vue.d.ts +127 -123
- package/dist/index21.vue.d.cts +127 -123
- package/dist/index21.vue.d.ts +51 -76
- package/dist/index22.vue.d.cts +51 -76
- package/dist/index22.vue.d.ts +31 -71
- package/dist/index23.vue.d.cts +31 -129
- package/dist/index23.vue.d.ts +62 -118
- package/dist/index24.vue.d.cts +75 -50
- package/dist/index24.vue.d.ts +20 -49
- package/dist/index25.vue.d.cts +18 -18
- package/dist/index25.vue.d.ts +14 -22
- package/dist/index26.vue.d.cts +16 -26
- package/dist/index26.vue.d.ts +129 -24
- package/dist/index27.vue.d.cts +113 -81
- package/dist/index27.vue.d.ts +78 -96
- package/dist/index28.vue.d.cts +76 -29
- package/dist/index28.vue.d.ts +73 -31
- package/dist/index29.vue.d.cts +65 -13
- package/dist/index29.vue.d.ts +65 -13
- package/dist/index3.vue.d.cts +67 -70
- package/dist/index3.vue.d.ts +67 -70
- package/dist/index30.vue.d.cts +130 -81
- package/dist/index30.vue.d.ts +130 -81
- package/dist/index31.vue.d.cts +41 -94
- package/dist/index31.vue.d.ts +41 -94
- package/dist/index32.vue.d.cts +44 -61
- package/dist/index32.vue.d.ts +44 -61
- package/dist/index33.vue.d.cts +58 -0
- package/dist/index33.vue.d.ts +58 -0
- package/dist/index34.vue.d.cts +62 -0
- package/dist/index34.vue.d.ts +62 -0
- package/dist/index35.vue.d.cts +42 -0
- package/dist/index35.vue.d.ts +42 -0
- package/dist/index36.vue.d.cts +28 -0
- package/dist/index36.vue.d.ts +28 -0
- package/dist/index37.vue.d.cts +30 -0
- package/dist/index37.vue.d.ts +30 -0
- package/dist/index38.vue.d.cts +103 -0
- package/dist/index38.vue.d.ts +103 -0
- package/dist/index39.vue.d.cts +38 -0
- package/dist/index39.vue.d.ts +38 -0
- package/dist/index4.vue.d.cts +27 -36
- package/dist/index4.vue.d.ts +27 -36
- package/dist/index40.vue.d.cts +19 -0
- package/dist/index40.vue.d.ts +19 -0
- package/dist/index41.vue.d.cts +89 -0
- package/dist/index41.vue.d.ts +89 -0
- package/dist/index42.vue.d.cts +110 -0
- package/dist/index42.vue.d.ts +110 -0
- package/dist/index43.vue.d.cts +89 -0
- package/dist/index43.vue.d.ts +89 -0
- package/dist/index44.vue.d.cts +71 -0
- package/dist/index44.vue.d.ts +71 -0
- package/dist/index45.vue.d.cts +50 -0
- package/dist/index45.vue.d.ts +50 -0
- package/dist/index5.vue.d.cts +78 -17
- package/dist/index5.vue.d.ts +78 -17
- package/dist/index6.vue.d.cts +34 -132
- package/dist/index6.vue.d.ts +31 -34
- package/dist/index7.vue.d.cts +20 -34
- package/dist/index7.vue.d.ts +20 -28
- package/dist/index8.vue.d.cts +130 -29
- package/dist/index8.vue.d.ts +33 -118
- package/dist/index9.vue.d.cts +33 -118
- package/dist/index9.vue.d.ts +25 -27
- package/dist/localSource.cjs +1 -0
- package/dist/{formField.d.cts → localSource.d.cts} +42 -2
- package/dist/{formField.d.ts → localSource.d.ts} +42 -2
- package/dist/localSource.js +1 -0
- package/dist/mapUtils.d.cts +5 -5
- package/dist/mapUtils.d.ts +5 -5
- package/dist/model.d.cts +88 -0
- package/dist/model.d.ts +88 -0
- package/dist/presets.d.cts +2 -2
- package/dist/presets.d.ts +2 -2
- package/dist/previewLimits.cjs +1 -0
- package/dist/previewLimits.js +1 -0
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.cts +1 -1
- package/dist/resolver.d.ts +1 -1
- package/dist/resolver.js +1 -1
- package/dist/rule.d.cts +51 -0
- package/dist/rule.d.ts +51 -0
- package/dist/source.cjs +1 -1
- package/dist/source.d.cts +2 -2
- package/dist/source.d.ts +2 -2
- package/dist/source.js +1 -1
- package/dist/style.css +1974 -542
- package/dist/types.d.cts +4 -0
- package/dist/types.d.ts +4 -0
- package/dist/types10.d.cts +229 -0
- package/dist/types10.d.ts +285 -0
- package/dist/types11.d.cts +285 -0
- package/dist/types2.d.cts +188 -31
- package/dist/types2.d.ts +188 -31
- package/dist/types3.d.cts +84 -101
- package/dist/types3.d.ts +82 -105
- package/dist/types4.d.cts +24 -106
- package/dist/types4.d.ts +30 -55
- package/dist/types5.d.cts +106 -55
- package/dist/types5.d.ts +130 -41
- package/dist/types6.d.cts +130 -41
- package/dist/types6.d.ts +244 -265
- package/dist/types7.d.cts +244 -265
- package/dist/types7.d.ts +60 -0
- package/dist/types8.d.cts +60 -0
- package/dist/types8.d.ts +50 -0
- package/dist/types9.d.cts +50 -0
- package/dist/types9.d.ts +229 -0
- package/dist/useCalendarEvents.d.cts +2 -2
- package/dist/useCalendarEvents.d.ts +2 -2
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useComponentTheme.cjs +1 -1
- package/dist/useComponentTheme.js +1 -1
- package/dist/useCropperCore.d.cts +8 -8
- package/dist/useCropperCore.d.ts +8 -8
- package/dist/useDynamicFormState.d.cts +5 -4
- package/dist/useDynamicFormState.d.ts +5 -4
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFormArray.cjs +1 -1
- package/dist/useFormArray.d.cts +39 -3
- package/dist/useFormArray.d.ts +39 -3
- package/dist/useFormArray.js +1 -1
- package/dist/useFormRenderer.d.cts +6 -2
- package/dist/useFormRenderer.d.ts +6 -2
- package/dist/useFullscreen.d.cts +7 -99
- package/dist/useFullscreen.d.ts +7 -99
- package/dist/useGlobalSearch.d.cts +45 -3
- package/dist/useGlobalSearch.d.ts +45 -3
- package/dist/useInfiniteScroll.d.cts +2 -2
- package/dist/useInfiniteScroll.d.ts +2 -2
- package/dist/useLocalFileUrl.cjs +1 -0
- package/dist/useLocalFileUrl.js +1 -0
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSignatureHistory.d.cts +6 -6
- package/dist/useSignatureHistory.d.ts +6 -6
- package/dist/useSplitResize.d.cts +10 -10
- package/dist/useSplitResize.d.ts +10 -10
- package/dist/useWorkflowValidation.d.cts +108 -108
- package/dist/useWorkflowValidation.d.ts +108 -108
- package/dist/verification.d.cts +2 -2
- package/dist/verification.d.ts +2 -2
- package/dist/workflows.cjs +1 -1
- package/dist/workflows.d.cts +2 -2
- package/dist/workflows.d.ts +2 -2
- package/dist/workflows.js +1 -1
- package/docs/components.en.md +125 -135
- package/docs/components.md +125 -135
- package/docs/engineering.en.md +12 -4
- package/docs/engineering.md +12 -4
- package/docs/guides/api-migration.md +17 -1
- package/docs/guides/approval-viewer.md +50 -0
- package/docs/guides/attachments.md +39 -0
- package/docs/guides/batch-results.md +3 -1
- package/docs/guides/change-review.md +49 -0
- package/docs/guides/component-contracts.md +8 -0
- package/docs/guides/data-picker.md +75 -1
- package/docs/guides/data-workflows.md +27 -1
- package/docs/guides/dockable-workbench.md +49 -0
- package/docs/guides/filter-builder.md +47 -0
- package/docs/guides/global-search.md +49 -0
- package/docs/guides/image-annotator.md +27 -0
- package/docs/guides/import-wizard.md +40 -0
- package/docs/guides/notification-center.md +29 -0
- package/docs/guides/resource-schedule.md +58 -0
- package/docs/guides/scene-components.md +53 -0
- package/docs/guides/search-workflows.md +2 -0
- package/docs/guides/split-pane.md +2 -0
- package/docs/guides/table-density.md +47 -1
- package/docs/guides/task-board.md +53 -0
- package/docs/guides/task-panel.md +30 -0
- package/docs/guides/transfer.md +35 -0
- package/docs/guides/usage.en.md +23 -17
- package/docs/guides/usage.md +10 -24
- package/package.json +1 -1
- package/dist/formField.cjs +0 -1
- package/dist/formField.js +0 -1
- package/dist/html.cjs +0 -1
- package/dist/html.js +0 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
@import "./shared-tokens.css";
|
|
2
|
+
.c-record-list[data-v-a46bf181] {
|
|
3
|
+
--c-record-list-padding: 12px;
|
|
4
|
+
color: var(--c-text-1, var(--c-theme-text-1));
|
|
5
|
+
}
|
|
6
|
+
.c-record-list.is-compact[data-v-a46bf181] {
|
|
7
|
+
--c-record-list-padding: 8px 10px;
|
|
8
|
+
}
|
|
9
|
+
.c-record-list__items[data-v-a46bf181] {
|
|
10
|
+
display: grid;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
list-style: none;
|
|
15
|
+
}
|
|
16
|
+
.c-record-list__items.is-cards[data-v-a46bf181] {
|
|
17
|
+
grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
|
|
18
|
+
}
|
|
19
|
+
.c-record-list__item[data-v-a46bf181] {
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
align-items: start;
|
|
23
|
+
gap: 6px 12px;
|
|
24
|
+
padding: var(--c-record-list-padding);
|
|
25
|
+
border: 1px solid var(--c-border, var(--c-theme-border));
|
|
26
|
+
border-radius: var(--c-radius, var(--c-theme-radius));
|
|
27
|
+
background: var(--c-bg-card, var(--c-theme-bg-card));
|
|
28
|
+
}
|
|
29
|
+
.c-record-list__item.is-selected[data-v-a46bf181] {
|
|
30
|
+
border-color: var(--c-primary, var(--c-theme-primary));
|
|
31
|
+
background: var(--c-bg-active, var(--c-theme-bg-active));
|
|
32
|
+
}
|
|
33
|
+
.c-record-list__body[data-v-a46bf181] {
|
|
34
|
+
flex: 1 1 10rem;
|
|
35
|
+
min-width: 0;
|
|
36
|
+
}
|
|
37
|
+
.c-record-list__heading[data-v-a46bf181] {
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
flex-wrap: wrap;
|
|
41
|
+
gap: 4px 8px;
|
|
42
|
+
overflow-wrap: anywhere;
|
|
43
|
+
}
|
|
44
|
+
.c-record-list__select[data-v-a46bf181] {
|
|
45
|
+
padding: 2px 0;
|
|
46
|
+
border: 0;
|
|
47
|
+
background: transparent;
|
|
48
|
+
color: var(--c-primary, var(--c-theme-primary));
|
|
49
|
+
font: inherit;
|
|
50
|
+
font-weight: 600;
|
|
51
|
+
text-align: start;
|
|
52
|
+
cursor: pointer;
|
|
53
|
+
overflow-wrap: anywhere;
|
|
54
|
+
}
|
|
55
|
+
.c-record-list__select[data-v-a46bf181]:focus-visible {
|
|
56
|
+
outline: 2px solid currentcolor;
|
|
57
|
+
outline-offset: 2px;
|
|
58
|
+
}
|
|
59
|
+
.c-record-list__select[data-v-a46bf181]:disabled {
|
|
60
|
+
color: var(--c-text-4, var(--c-theme-text-4));
|
|
61
|
+
cursor: not-allowed;
|
|
62
|
+
}
|
|
63
|
+
.c-record-list__description[data-v-a46bf181], .c-record-list__placeholder[data-v-a46bf181] {
|
|
64
|
+
margin: 4px 0;
|
|
65
|
+
color: var(--c-text-2, var(--c-theme-text-2));
|
|
66
|
+
overflow-wrap: anywhere;
|
|
67
|
+
}
|
|
68
|
+
.c-record-list__actions[data-v-a46bf181] {
|
|
69
|
+
max-width: 100%;
|
|
70
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RecordListKey, i as RecordListItemView, n as RecordListEmits, o as RecordListProps, r as RecordListItemContext, s as RecordListStatusType, t as _default } from "./index32.vue.cjs";
|
|
2
|
+
export { _default as C_RecordList, type RecordListEmits, type RecordListItemContext, type RecordListItemView, type RecordListKey, type RecordListProps, type RecordListStatusType };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RecordListKey, i as RecordListItemView, n as RecordListEmits, o as RecordListProps, r as RecordListItemContext, s as RecordListStatusType, t as _default } from "./index32.vue.js";
|
|
2
|
+
export { _default as C_RecordList, type RecordListEmits, type RecordListItemContext, type RecordListItemView, type RecordListKey, type RecordListProps, type RecordListStatusType };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./C_RecordList2.js";export{e as C_RecordList};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./useComponentDensity.cjs`),r=require(`./useScopedComponentLocale.cjs`);let i=require(`vue`),a=require(`naive-ui`);const o={"recordList.title":`记录列表`,"recordList.empty":`暂无记录`,"recordList.loading":`正在加载记录`},s={"recordList.title":`Record list`,"recordList.empty":`No records`,"recordList.loading":`Loading records`},c=[`aria-label`,`aria-busy`],l={key:0,class:`c-record-list__placeholder`,role:`status`},u={class:`c-record-list__body`},d={class:`c-record-list__heading`},f=[`aria-pressed`,`disabled`,`onClick`],p={key:1},m={key:0,class:`c-record-list__description`},h={key:0,class:`c-record-list__actions`},g={key:2,class:`c-record-list__placeholder`},_=(0,i.defineComponent)({name:`C_RecordList`,__name:`index`,props:{items:{},itemKey:{type:Function},itemView:{type:Function},modelValue:{},selectable:{type:Boolean},layout:{},loading:{type:Boolean},emptyText:{},ariaLabel:{},density:{},locale:{}},emits:[`update:modelValue`,`select`],setup(t,{emit:_}){let v=t,y=_,b=e.n(),x=n.t(()=>v.density),{t:S}=r.t(o,s,()=>v.locale),C=(0,i.computed)(()=>v.items.map(e=>({item:e,itemKey:v.itemKey(e),view:v.itemView(e)}))),w=(0,i.computed)(()=>C.value.map(e=>({...e,selected:e.itemKey===v.modelValue})));function T(e){!v.selectable||e.view.disabled||(y(`update:modelValue`,e.itemKey),y(`select`,e.item,e.itemKey))}return(e,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`section`,{class:(0,i.normalizeClass)([`c-record-list`,{"is-compact":(0,i.unref)(x)===`compact`}]),style:(0,i.normalizeStyle)((0,i.unref)(b)),"aria-label":t.ariaLabel||(0,i.unref)(S)(`recordList.title`),"aria-busy":t.loading||void 0},[t.loading?((0,i.openBlock)(),(0,i.createElementBlock)(`p`,l,(0,i.toDisplayString)((0,i.unref)(S)(`recordList.loading`)),1)):(0,i.createCommentVNode)(`v-if`,!0),w.value.length?((0,i.openBlock)(),(0,i.createElementBlock)(`ul`,{key:1,class:(0,i.normalizeClass)([`c-record-list__items`,{"is-cards":t.layout===`cards`}])},[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)(w.value,n=>((0,i.openBlock)(),(0,i.createElementBlock)(`li`,{key:n.itemKey,class:(0,i.normalizeClass)([`c-record-list__item`,{"is-selected":n.selected}])},[(0,i.createElementVNode)(`div`,u,[(0,i.createElementVNode)(`div`,d,[t.selectable?((0,i.openBlock)(),(0,i.createElementBlock)(`button`,{key:0,type:`button`,class:`c-record-list__select`,"aria-pressed":n.selected,disabled:n.view.disabled,onClick:e=>T(n)},(0,i.toDisplayString)(n.view.title),9,f)):((0,i.openBlock)(),(0,i.createElementBlock)(`strong`,p,(0,i.toDisplayString)(n.view.title),1)),n.view.status?((0,i.openBlock)(),(0,i.createBlock)((0,i.unref)(a.NTag),{key:2,size:`small`,round:``,bordered:!1,type:typeof n.view.status==`string`?`default`:n.view.status.type},{default:(0,i.withCtx)(()=>[(0,i.createTextVNode)((0,i.toDisplayString)(typeof n.view.status==`string`?n.view.status:n.view.status.label),1)]),_:2},1032,[`type`])):(0,i.createCommentVNode)(`v-if`,!0)]),(0,i.renderSlot)(e.$slots,`description`,(0,i.mergeProps)({ref_for:!0},n),()=>[n.view.description?((0,i.openBlock)(),(0,i.createElementBlock)(`p`,m,(0,i.toDisplayString)(n.view.description),1)):(0,i.createCommentVNode)(`v-if`,!0)],!0)]),e.$slots.actions?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,h,[(0,i.renderSlot)(e.$slots,`actions`,(0,i.mergeProps)({ref_for:!0},n),void 0,!0)])):(0,i.createCommentVNode)(`v-if`,!0)],2))),128))],2)):t.loading?(0,i.createCommentVNode)(`v-if`,!0):((0,i.openBlock)(),(0,i.createElementBlock)(`p`,g,(0,i.toDisplayString)(t.emptyText??(0,i.unref)(S)(`recordList.empty`)),1))],14,c))}});var v=t.t(_,[[`__scopeId`,`data-v-a46bf181`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return v}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./useComponentDensity.js";import{t as r}from"./useScopedComponentLocale.js";import{Fragment as i,computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createTextVNode as u,defineComponent as d,mergeProps as f,normalizeClass as p,normalizeStyle as m,openBlock as h,renderList as g,renderSlot as _,toDisplayString as v,unref as y,withCtx as b}from"vue";import{NTag as x}from"naive-ui";const S={"recordList.title":`记录列表`,"recordList.empty":`暂无记录`,"recordList.loading":`正在加载记录`},C={"recordList.title":`Record list`,"recordList.empty":`No records`,"recordList.loading":`Loading records`},w=[`aria-label`,`aria-busy`],T={key:0,class:`c-record-list__placeholder`,role:`status`},E={class:`c-record-list__body`},D={class:`c-record-list__heading`},O=[`aria-pressed`,`disabled`,`onClick`],k={key:1},A={key:0,class:`c-record-list__description`},j={key:0,class:`c-record-list__actions`},M={key:2,class:`c-record-list__placeholder`};var N=t(d({name:`C_RecordList`,__name:`index`,props:{items:{},itemKey:{type:Function},itemView:{type:Function},modelValue:{},selectable:{type:Boolean},layout:{},loading:{type:Boolean},emptyText:{},ariaLabel:{},density:{},locale:{}},emits:[`update:modelValue`,`select`],setup(t,{emit:d}){let N=t,P=d,F=e(),I=n(()=>N.density),{t:L}=r(S,C,()=>N.locale),R=a(()=>N.items.map(e=>({item:e,itemKey:N.itemKey(e),view:N.itemView(e)}))),z=a(()=>R.value.map(e=>({...e,selected:e.itemKey===N.modelValue})));function B(e){!N.selectable||e.view.disabled||(P(`update:modelValue`,e.itemKey),P(`select`,e.item,e.itemKey))}return(e,n)=>(h(),c(`section`,{class:p([`c-record-list`,{"is-compact":y(I)===`compact`}]),style:m(y(F)),"aria-label":t.ariaLabel||y(L)(`recordList.title`),"aria-busy":t.loading||void 0},[t.loading?(h(),c(`p`,T,v(y(L)(`recordList.loading`)),1)):s(`v-if`,!0),z.value.length?(h(),c(`ul`,{key:1,class:p([`c-record-list__items`,{"is-cards":t.layout===`cards`}])},[(h(!0),c(i,null,g(z.value,n=>(h(),c(`li`,{key:n.itemKey,class:p([`c-record-list__item`,{"is-selected":n.selected}])},[l(`div`,E,[l(`div`,D,[t.selectable?(h(),c(`button`,{key:0,type:`button`,class:`c-record-list__select`,"aria-pressed":n.selected,disabled:n.view.disabled,onClick:e=>B(n)},v(n.view.title),9,O)):(h(),c(`strong`,k,v(n.view.title),1)),n.view.status?(h(),o(y(x),{key:2,size:`small`,round:``,bordered:!1,type:typeof n.view.status==`string`?`default`:n.view.status.type},{default:b(()=>[u(v(typeof n.view.status==`string`?n.view.status:n.view.status.label),1)]),_:2},1032,[`type`])):s(`v-if`,!0)]),_(e.$slots,`description`,f({ref_for:!0},n),()=>[n.view.description?(h(),c(`p`,A,v(n.view.description),1)):s(`v-if`,!0)],!0)]),e.$slots.actions?(h(),c(`div`,j,[_(e.$slots,`actions`,f({ref_for:!0},n),void 0,!0)])):s(`v-if`,!0)],2))),128))],2)):t.loading?s(`v-if`,!0):(h(),c(`p`,M,v(t.emptyText??y(L)(`recordList.empty`)),1))],14,w))}}),[[`__scopeId`,`data-v-a46bf181`]]);export{N as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_RecurrenceEditor2.cjs`);exports.C_RecurrenceEditor=e.t,exports.formatRecurrenceRule=e.n,exports.parseRecurrenceRule=e.r;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@import "./shared-tokens.css";
|
|
2
|
+
.c-recurrence[data-v-bbfffd9b] {
|
|
3
|
+
--c-recurrence-control-height: var(--c-theme-control-height-small);
|
|
4
|
+
display: grid;
|
|
5
|
+
gap: 12px;
|
|
6
|
+
min-width: 0;
|
|
7
|
+
margin: 0;
|
|
8
|
+
padding: 10px 12px 12px;
|
|
9
|
+
border: 1px solid var(--c-border, var(--c-theme-border));
|
|
10
|
+
border-radius: var(--c-radius, var(--c-theme-radius));
|
|
11
|
+
color: var(--c-text-1, var(--c-theme-text-1));
|
|
12
|
+
accent-color: var(--c-primary, var(--c-theme-primary));
|
|
13
|
+
}
|
|
14
|
+
.c-recurrence.is-compact[data-v-bbfffd9b] {
|
|
15
|
+
--c-recurrence-control-height: var(--c-theme-control-height-tiny);
|
|
16
|
+
gap: 8px;
|
|
17
|
+
}
|
|
18
|
+
.c-recurrence legend[data-v-bbfffd9b] {
|
|
19
|
+
padding-inline: 4px;
|
|
20
|
+
font-weight: 600;
|
|
21
|
+
}
|
|
22
|
+
.c-recurrence__row[data-v-bbfffd9b] {
|
|
23
|
+
display: grid;
|
|
24
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 150px), 1fr));
|
|
25
|
+
gap: 8px;
|
|
26
|
+
}
|
|
27
|
+
.c-recurrence__row label[data-v-bbfffd9b] {
|
|
28
|
+
display: grid;
|
|
29
|
+
gap: 4px;
|
|
30
|
+
min-width: 0;
|
|
31
|
+
}
|
|
32
|
+
.c-recurrence__weekdays[data-v-bbfffd9b] {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-wrap: wrap;
|
|
35
|
+
gap: 4px 12px;
|
|
36
|
+
margin: 0;
|
|
37
|
+
padding: 0;
|
|
38
|
+
border: 0;
|
|
39
|
+
}
|
|
40
|
+
.c-recurrence__day[data-v-bbfffd9b] {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 3px;
|
|
44
|
+
min-height: 24px;
|
|
45
|
+
}
|
|
46
|
+
.c-recurrence select[data-v-bbfffd9b],
|
|
47
|
+
.c-recurrence input[data-v-bbfffd9b]:not([type=checkbox]) {
|
|
48
|
+
box-sizing: border-box;
|
|
49
|
+
min-width: 0;
|
|
50
|
+
min-height: var(--c-recurrence-control-height);
|
|
51
|
+
padding-inline: 6px;
|
|
52
|
+
border: 1px solid var(--c-border, var(--c-theme-border));
|
|
53
|
+
border-radius: var(--c-radius-sm, var(--c-theme-radius-sm));
|
|
54
|
+
background: var(--c-bg-card, var(--c-theme-bg-card));
|
|
55
|
+
color: inherit;
|
|
56
|
+
font: inherit;
|
|
57
|
+
}
|
|
58
|
+
.c-recurrence[data-v-bbfffd9b] :focus-visible {
|
|
59
|
+
outline: 2px solid var(--c-primary, var(--c-theme-primary));
|
|
60
|
+
outline-offset: 2px;
|
|
61
|
+
}
|
|
62
|
+
.c-recurrence [role=status][data-v-bbfffd9b] {
|
|
63
|
+
margin: 0;
|
|
64
|
+
color: var(--c-error, var(--c-theme-error));
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/* layer: default */
|
|
68
|
+
.ordinal[data-v-bbfffd9b]{--un-ordinal:ordinal;font-variant-numeric:var(--un-ordinal) var(--un-slashed-zero) var(--un-numeric-figure) var(--un-numeric-spacing) var(--un-numeric-fraction);}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RecurrenceEnd, c as RecurrenceRule, i as RecurrenceEditorProps, l as RecurrenceWeekday, n as parseRecurrenceRule, o as RecurrenceFrequency, r as _default, s as RecurrenceMonthPattern, t as formatRecurrenceRule } from "./rule.cjs";
|
|
2
|
+
export { _default as C_RecurrenceEditor, type RecurrenceEditorProps, type RecurrenceEnd, type RecurrenceFrequency, type RecurrenceMonthPattern, type RecurrenceRule, type RecurrenceWeekday, formatRecurrenceRule, parseRecurrenceRule };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RecurrenceEnd, c as RecurrenceRule, i as RecurrenceEditorProps, l as RecurrenceWeekday, n as parseRecurrenceRule, o as RecurrenceFrequency, r as _default, s as RecurrenceMonthPattern, t as formatRecurrenceRule } from "./rule.js";
|
|
2
|
+
export { _default as C_RecurrenceEditor, type RecurrenceEditorProps, type RecurrenceEnd, type RecurrenceFrequency, type RecurrenceMonthPattern, type RecurrenceRule, type RecurrenceWeekday, formatRecurrenceRule, parseRecurrenceRule };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,r as t,t as n}from"./C_RecurrenceEditor2.js";export{n as C_RecurrenceEditor,e as formatRecurrenceRule,t as parseRecurrenceRule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./useComponentDensity.cjs`),r=require(`./useScopedComponentLocale.cjs`);let i=require(`vue`);const a=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],o=[`daily`,`weekly`,`monthly`,`yearly`],s=[1,2,3,4,5,-1],c=e=>o.some(t=>t===e),l=e=>a.some(t=>t===e),u=e=>s.some(t=>t===e),d=(e,t=2**53-1)=>Number.isSafeInteger(e)&&e>=1&&e<=t;function f(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||e.startsWith(`0000`))return!1;let t=new Date(`${e}T00:00:00Z`);return Number.isFinite(t.getTime())&&t.toISOString().slice(0,10)===e}function p({frequency:e,weekdays:t}){if(!t?.length)return``;if(e!==`weekly`||!t.every(l))throw RangeError(`Invalid weekly weekdays`);let n=new Set(t);return`BYDAY=${a.filter(e=>n.has(e)).join(`,`)}`}function m({frequency:e,monthPattern:t}){if(!t)return``;if(e!==`monthly`)throw RangeError(`A month pattern requires monthly frequency`);if(t.type===`date`&&d(t.day,31))return`BYMONTHDAY=${t.day}`;if(t.type===`weekday`&&u(t.ordinal)&&l(t.day))return`BYDAY=${t.ordinal}${t.day}`;throw RangeError(`Invalid month pattern`)}function h(e){if(!e)return``;if(e.type===`count`&&d(e.count))return`COUNT=${e.count}`;if(e.type===`until`&&f(e.date))return`UNTIL=${e.date.replace(/-/g,``)}`;throw RangeError(`Invalid recurrence end`)}function g(e){if(!e)return``;let{frequency:t,interval:n=1,end:r}=e;if(!c(t)||!d(n))throw RangeError(`Invalid recurrence frequency or interval`);return[`FREQ=${t.toUpperCase()}`,n===1?``:`INTERVAL=${n}`,p(e),m(e),h(r)].filter(Boolean).join(`;`)}function _(e){let t=new Map;for(let n of e.split(`;`)){let e=/^(FREQ|INTERVAL|BYDAY|BYMONTHDAY|COUNT|UNTIL)=([^=]+)$/.exec(n);if(!e||t.has(e[1]))throw RangeError(`Unsupported recurrence part: ${n}`);t.set(e[1],e[2])}return t}function v(e,t){let n=e.get(t);if(n!==void 0){if(!/^\d+$/.test(n))throw RangeError(`Invalid ${t}`);return Number(n)}}function y(e,t){let n=v(e,`BYMONTHDAY`),r=e.get(`BYDAY`);if(n!==void 0){if(r)throw RangeError(`Use one month pattern`);return{monthPattern:{type:`date`,day:n}}}if(!r)return{};if(t===`weekly`){let e=r.split(`,`);if(!e.every(l))throw RangeError(`Invalid weekly weekdays`);return{weekdays:e}}let[,i,a]=/^([+]?[1-5]|-1)([A-Z]{2})$/.exec(r)??[],o=Number(i);if(!u(o)||!a||!l(a))throw RangeError(`Unsupported monthly pattern`);return{monthPattern:{type:`weekday`,ordinal:o,day:a}}}function b(e){let t=v(e,`COUNT`),n=e.get(`UNTIL`);if(n&&t!==void 0)throw RangeError(`Use one recurrence end`);if(t!==void 0)return{type:`count`,count:t};if(n){if(!/^\d{8}$/.test(n))throw RangeError(`UNTIL must use a calendar date`);return{type:`until`,date:`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6)}`}}}function x(e){let t=e.trim().toUpperCase().replace(/^RRULE:/,``);if(!t)return null;let n=_(t),r=n.get(`FREQ`)?.toLowerCase()??``;if(!c(r))throw RangeError(`Unsupported recurrence frequency`);let i={frequency:r,...y(n,r)},a=v(n,`INTERVAL`),o=b(n);return a!==void 0&&(i.interval=a),o!==void 0&&(i.end=o),g(i),i}const S={"recurrence.title":`重复计划`,"recurrence.frequency":`重复频率`,"recurrence.none":`不重复`,"recurrence.daily":`按天`,"recurrence.weekly":`按周`,"recurrence.monthly":`按月`,"recurrence.yearly":`按年`,"recurrence.interval":`间隔`,"recurrence.weekdays":`重复日期`,"recurrence.weekday":`星期`,"recurrence.monthPattern":`每月规则`,"recurrence.startDate":`与开始日期相同`,"recurrence.monthDay":`每月几号`,"recurrence.ordinalWeekday":`第几个星期几`,"recurrence.ordinal":`顺序`,"recurrence.last":`最后一个`,"recurrence.end":`结束方式`,"recurrence.unlimited":`不设结束`,"recurrence.count":`重复次数`,"recurrence.until":`截止日期`,"recurrence.invalidDate":`请选择有效的截止日期`,"recurrence.day.MO":`周一`,"recurrence.day.TU":`周二`,"recurrence.day.WE":`周三`,"recurrence.day.TH":`周四`,"recurrence.day.FR":`周五`,"recurrence.day.SA":`周六`,"recurrence.day.SU":`周日`},C={"recurrence.title":`Recurrence`,"recurrence.frequency":`Frequency`,"recurrence.none":`Does not repeat`,"recurrence.daily":`Daily`,"recurrence.weekly":`Weekly`,"recurrence.monthly":`Monthly`,"recurrence.yearly":`Yearly`,"recurrence.interval":`Interval`,"recurrence.weekdays":`Repeat on`,"recurrence.weekday":`Weekday`,"recurrence.monthPattern":`Monthly pattern`,"recurrence.startDate":`Same day as the start date`,"recurrence.monthDay":`Day of the month`,"recurrence.ordinalWeekday":`Position of weekday`,"recurrence.ordinal":`Position`,"recurrence.last":`Last`,"recurrence.end":`Ends`,"recurrence.unlimited":`No end`,"recurrence.count":`Number of occurrences`,"recurrence.until":`End date`,"recurrence.invalidDate":`Select a valid end date`,"recurrence.day.MO":`Mon`,"recurrence.day.TU":`Tue`,"recurrence.day.WE":`Wed`,"recurrence.day.TH":`Thu`,"recurrence.day.FR":`Fri`,"recurrence.day.SA":`Sat`,"recurrence.day.SU":`Sun`},w=[`disabled`],T={class:`c-recurrence__row`},E={value:`none`},D=[`value`],O={key:0},k={key:0,class:`c-recurrence__weekdays`},A=[`checked`,`onChange`],j={key:1,class:`c-recurrence__row`},M={value:`start`},N={value:`date`},P={value:`weekday`},F={key:0},I=[`value`],L=[`value`],R={key:2,class:`c-recurrence__row`},z={value:`none`},B={value:`count`},V={value:`until`},H={key:0},U={key:1},W=[`aria-invalid`],G={key:3,role:`status`},K=(0,i.defineComponent)({name:`C_RecurrenceEditor`,__name:`index`,props:{modelValue:{},disabled:{type:Boolean},density:{},locale:{}},emits:[`update:modelValue`],setup(t,{emit:c}){let l=t,u=c,{t:d}=r.t(S,C,()=>l.locale),p=e.n(),m=n.t(()=>l.density);function h(e){l.modelValue&&!l.disabled&&u(`update:modelValue`,{...l.modelValue,...e})}let g=(e,t=2**53-1)=>Number.isSafeInteger(e)?Math.min(t,Math.max(1,e)):1,_=(0,i.computed)({get:()=>l.modelValue?.frequency??`none`,set:e=>{if(l.disabled)return;let{interval:t,end:n}=l.modelValue??{};u(`update:modelValue`,e===`none`?null:{frequency:e,interval:t,end:n})}}),v=(0,i.computed)({get:()=>l.modelValue?.interval??1,set:e=>h({interval:g(e)})}),y=(0,i.computed)(()=>l.modelValue?.monthPattern),b=(0,i.computed)({get:()=>y.value?.type??`start`,set:e=>h({monthPattern:e===`start`?void 0:e===`date`?{type:e,day:1}:{type:e,ordinal:1,day:`MO`}})}),x=(0,i.computed)({get:()=>y.value?.type===`date`?y.value.day:1,set:e=>h({monthPattern:{type:`date`,day:g(e,31)}})}),K=(0,i.computed)({get:()=>y.value?.type===`weekday`?y.value.ordinal:1,set:e=>h({monthPattern:{type:`weekday`,ordinal:e,day:q.value}})}),q=(0,i.computed)({get:()=>y.value?.type===`weekday`?y.value.day:`MO`,set:e=>h({monthPattern:{type:`weekday`,ordinal:K.value,day:e}})}),J=(0,i.computed)(()=>l.modelValue?.end),Y=(0,i.computed)({get:()=>J.value?.type??`none`,set:e=>h({end:e===`none`?void 0:e===`count`?{type:e,count:10}:{type:e,date:``}})}),X=(0,i.computed)({get:()=>J.value?.type===`count`?J.value.count:10,set:e=>h({end:{type:`count`,count:g(e)}})}),Z=(0,i.computed)({get:()=>J.value?.type===`until`?J.value.date:``,set:e=>h({end:{type:`until`,date:e}})});function Q(e){let t=new Set(l.modelValue?.weekdays);t.has(e)?t.delete(e):t.add(e),h({weekdays:a.filter(e=>t.has(e))})}return(e,n)=>((0,i.openBlock)(),(0,i.createElementBlock)(`fieldset`,{class:(0,i.normalizeClass)([`c-recurrence`,{"is-compact":(0,i.unref)(m)===`compact`}]),style:(0,i.normalizeStyle)((0,i.unref)(p)),disabled:t.disabled},[(0,i.createElementVNode)(`legend`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.title`)),1),(0,i.createElementVNode)(`div`,T,[(0,i.createElementVNode)(`label`,null,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.frequency`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`select`,{"onUpdate:modelValue":n[0]||=e=>_.value=e},[(0,i.createElementVNode)(`option`,E,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.none`)),1),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(o),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`option`,{key:e,value:e},(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.${e}`)),9,D))),128))],512),[[i.vModelSelect,_.value]])]),t.modelValue?((0,i.openBlock)(),(0,i.createElementBlock)(`label`,O,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.interval`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`input`,{"onUpdate:modelValue":n[1]||=e=>v.value=e,type:`number`,min:`1`,step:`1`},null,512),[[i.vModelText,v.value,void 0,{lazy:!0,number:!0}]])])):(0,i.createCommentVNode)(`v-if`,!0)]),_.value===`weekly`?((0,i.openBlock)(),(0,i.createElementBlock)(`fieldset`,k,[(0,i.createElementVNode)(`legend`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.weekdays`)),1),((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(a),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`label`,{key:e,class:`c-recurrence__day`},[(0,i.createElementVNode)(`input`,{type:`checkbox`,checked:t.modelValue?.weekdays?.includes(e),onChange:t=>Q(e)},null,40,A),(0,i.createTextVNode)(` `+(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.day.${e}`)),1)]))),128))])):(0,i.createCommentVNode)(`v-if`,!0),_.value===`monthly`?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,j,[(0,i.createElementVNode)(`label`,null,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.monthPattern`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`select`,{"onUpdate:modelValue":n[2]||=e=>b.value=e},[(0,i.createElementVNode)(`option`,M,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.startDate`)),1),(0,i.createElementVNode)(`option`,N,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.monthDay`)),1),(0,i.createElementVNode)(`option`,P,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.ordinalWeekday`)),1)],512),[[i.vModelSelect,b.value]])]),b.value===`date`?((0,i.openBlock)(),(0,i.createElementBlock)(`label`,F,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.monthDay`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`input`,{"onUpdate:modelValue":n[3]||=e=>x.value=e,type:`number`,min:`1`,max:`31`,step:`1`},null,512),[[i.vModelText,x.value,void 0,{lazy:!0,number:!0}]])])):(0,i.createCommentVNode)(`v-if`,!0),b.value===`weekday`?((0,i.openBlock)(),(0,i.createElementBlock)(i.Fragment,{key:1},[(0,i.createElementVNode)(`label`,null,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.ordinal`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`select`,{"onUpdate:modelValue":n[4]||=e=>K.value=e},[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(s),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`option`,{key:e,value:e},(0,i.toDisplayString)(e===-1?(0,i.unref)(d)(`recurrence.last`):e),9,I))),128))],512),[[i.vModelSelect,K.value]])]),(0,i.createElementVNode)(`label`,null,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.weekday`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`select`,{"onUpdate:modelValue":n[5]||=e=>q.value=e},[((0,i.openBlock)(!0),(0,i.createElementBlock)(i.Fragment,null,(0,i.renderList)((0,i.unref)(a),e=>((0,i.openBlock)(),(0,i.createElementBlock)(`option`,{key:e,value:e},(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.day.${e}`)),9,L))),128))],512),[[i.vModelSelect,q.value]])])],64)):(0,i.createCommentVNode)(`v-if`,!0)])):(0,i.createCommentVNode)(`v-if`,!0),t.modelValue?((0,i.openBlock)(),(0,i.createElementBlock)(`div`,R,[(0,i.createElementVNode)(`label`,null,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.end`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`select`,{"onUpdate:modelValue":n[6]||=e=>Y.value=e},[(0,i.createElementVNode)(`option`,z,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.unlimited`)),1),(0,i.createElementVNode)(`option`,B,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.count`)),1),(0,i.createElementVNode)(`option`,V,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.until`)),1)],512),[[i.vModelSelect,Y.value]])]),Y.value===`count`?((0,i.openBlock)(),(0,i.createElementBlock)(`label`,H,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.count`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`input`,{"onUpdate:modelValue":n[7]||=e=>X.value=e,type:`number`,min:`1`,step:`1`},null,512),[[i.vModelText,X.value,void 0,{lazy:!0,number:!0}]])])):(0,i.createCommentVNode)(`v-if`,!0),Y.value===`until`?((0,i.openBlock)(),(0,i.createElementBlock)(`label`,U,[(0,i.createElementVNode)(`span`,null,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.until`)),1),(0,i.withDirectives)((0,i.createElementVNode)(`input`,{"onUpdate:modelValue":n[8]||=e=>Z.value=e,type:`date`,"aria-invalid":!(0,i.unref)(f)(Z.value),required:``},null,8,W),[[i.vModelText,Z.value]])])):(0,i.createCommentVNode)(`v-if`,!0)])):(0,i.createCommentVNode)(`v-if`,!0),Y.value===`until`&&!(0,i.unref)(f)(Z.value)?((0,i.openBlock)(),(0,i.createElementBlock)(`p`,G,(0,i.toDisplayString)((0,i.unref)(d)(`recurrence.invalidDate`)),1)):(0,i.createCommentVNode)(`v-if`,!0)],14,w))}});var q=t.t(K,[[`__scopeId`,`data-v-bbfffd9b`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return q}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./useComponentDensity.js";import{t as r}from"./useScopedComponentLocale.js";import{Fragment as i,computed as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as ee,defineComponent as l,normalizeClass as u,normalizeStyle as te,openBlock as d,renderList as f,toDisplayString as p,unref as m,vModelSelect as h,vModelText as g,withDirectives as _}from"vue";const v=[`MO`,`TU`,`WE`,`TH`,`FR`,`SA`,`SU`],y=[`daily`,`weekly`,`monthly`,`yearly`],b=[1,2,3,4,5,-1],x=e=>y.some(t=>t===e),S=e=>v.some(t=>t===e),C=e=>b.some(t=>t===e),w=(e,t=2**53-1)=>Number.isSafeInteger(e)&&e>=1&&e<=t;function T(e){if(!/^\d{4}-\d{2}-\d{2}$/.test(e)||e.startsWith(`0000`))return!1;let t=new Date(`${e}T00:00:00Z`);return Number.isFinite(t.getTime())&&t.toISOString().slice(0,10)===e}function E({frequency:e,weekdays:t}){if(!t?.length)return``;if(e!==`weekly`||!t.every(S))throw RangeError(`Invalid weekly weekdays`);let n=new Set(t);return`BYDAY=${v.filter(e=>n.has(e)).join(`,`)}`}function D({frequency:e,monthPattern:t}){if(!t)return``;if(e!==`monthly`)throw RangeError(`A month pattern requires monthly frequency`);if(t.type===`date`&&w(t.day,31))return`BYMONTHDAY=${t.day}`;if(t.type===`weekday`&&C(t.ordinal)&&S(t.day))return`BYDAY=${t.ordinal}${t.day}`;throw RangeError(`Invalid month pattern`)}function O(e){if(!e)return``;if(e.type===`count`&&w(e.count))return`COUNT=${e.count}`;if(e.type===`until`&&T(e.date))return`UNTIL=${e.date.replace(/-/g,``)}`;throw RangeError(`Invalid recurrence end`)}function k(e){if(!e)return``;let{frequency:t,interval:n=1,end:r}=e;if(!x(t)||!w(n))throw RangeError(`Invalid recurrence frequency or interval`);return[`FREQ=${t.toUpperCase()}`,n===1?``:`INTERVAL=${n}`,E(e),D(e),O(r)].filter(Boolean).join(`;`)}function A(e){let t=new Map;for(let n of e.split(`;`)){let e=/^(FREQ|INTERVAL|BYDAY|BYMONTHDAY|COUNT|UNTIL)=([^=]+)$/.exec(n);if(!e||t.has(e[1]))throw RangeError(`Unsupported recurrence part: ${n}`);t.set(e[1],e[2])}return t}function j(e,t){let n=e.get(t);if(n!==void 0){if(!/^\d+$/.test(n))throw RangeError(`Invalid ${t}`);return Number(n)}}function M(e,t){let n=j(e,`BYMONTHDAY`),r=e.get(`BYDAY`);if(n!==void 0){if(r)throw RangeError(`Use one month pattern`);return{monthPattern:{type:`date`,day:n}}}if(!r)return{};if(t===`weekly`){let e=r.split(`,`);if(!e.every(S))throw RangeError(`Invalid weekly weekdays`);return{weekdays:e}}let[,i,a]=/^([+]?[1-5]|-1)([A-Z]{2})$/.exec(r)??[],o=Number(i);if(!C(o)||!a||!S(a))throw RangeError(`Unsupported monthly pattern`);return{monthPattern:{type:`weekday`,ordinal:o,day:a}}}function N(e){let t=j(e,`COUNT`),n=e.get(`UNTIL`);if(n&&t!==void 0)throw RangeError(`Use one recurrence end`);if(t!==void 0)return{type:`count`,count:t};if(n){if(!/^\d{8}$/.test(n))throw RangeError(`UNTIL must use a calendar date`);return{type:`until`,date:`${n.slice(0,4)}-${n.slice(4,6)}-${n.slice(6)}`}}}function P(e){let t=e.trim().toUpperCase().replace(/^RRULE:/,``);if(!t)return null;let n=A(t),r=n.get(`FREQ`)?.toLowerCase()??``;if(!x(r))throw RangeError(`Unsupported recurrence frequency`);let i={frequency:r,...M(n,r)},a=j(n,`INTERVAL`),o=N(n);return a!==void 0&&(i.interval=a),o!==void 0&&(i.end=o),k(i),i}const ne={"recurrence.title":`重复计划`,"recurrence.frequency":`重复频率`,"recurrence.none":`不重复`,"recurrence.daily":`按天`,"recurrence.weekly":`按周`,"recurrence.monthly":`按月`,"recurrence.yearly":`按年`,"recurrence.interval":`间隔`,"recurrence.weekdays":`重复日期`,"recurrence.weekday":`星期`,"recurrence.monthPattern":`每月规则`,"recurrence.startDate":`与开始日期相同`,"recurrence.monthDay":`每月几号`,"recurrence.ordinalWeekday":`第几个星期几`,"recurrence.ordinal":`顺序`,"recurrence.last":`最后一个`,"recurrence.end":`结束方式`,"recurrence.unlimited":`不设结束`,"recurrence.count":`重复次数`,"recurrence.until":`截止日期`,"recurrence.invalidDate":`请选择有效的截止日期`,"recurrence.day.MO":`周一`,"recurrence.day.TU":`周二`,"recurrence.day.WE":`周三`,"recurrence.day.TH":`周四`,"recurrence.day.FR":`周五`,"recurrence.day.SA":`周六`,"recurrence.day.SU":`周日`},re={"recurrence.title":`Recurrence`,"recurrence.frequency":`Frequency`,"recurrence.none":`Does not repeat`,"recurrence.daily":`Daily`,"recurrence.weekly":`Weekly`,"recurrence.monthly":`Monthly`,"recurrence.yearly":`Yearly`,"recurrence.interval":`Interval`,"recurrence.weekdays":`Repeat on`,"recurrence.weekday":`Weekday`,"recurrence.monthPattern":`Monthly pattern`,"recurrence.startDate":`Same day as the start date`,"recurrence.monthDay":`Day of the month`,"recurrence.ordinalWeekday":`Position of weekday`,"recurrence.ordinal":`Position`,"recurrence.last":`Last`,"recurrence.end":`Ends`,"recurrence.unlimited":`No end`,"recurrence.count":`Number of occurrences`,"recurrence.until":`End date`,"recurrence.invalidDate":`Select a valid end date`,"recurrence.day.MO":`Mon`,"recurrence.day.TU":`Tue`,"recurrence.day.WE":`Wed`,"recurrence.day.TH":`Thu`,"recurrence.day.FR":`Fri`,"recurrence.day.SA":`Sat`,"recurrence.day.SU":`Sun`},ie=[`disabled`],ae={class:`c-recurrence__row`},F={value:`none`},I=[`value`],L={key:0},R={key:0,class:`c-recurrence__weekdays`},z=[`checked`,`onChange`],B={key:1,class:`c-recurrence__row`},V={value:`start`},H={value:`date`},U={value:`weekday`},W={key:0},G=[`value`],K=[`value`],q={key:2,class:`c-recurrence__row`},oe={value:`none`},se={value:`count`},ce={value:`until`},le={key:0},ue={key:1},de=[`aria-invalid`],J={key:3,role:`status`};var Y=t(l({name:`C_RecurrenceEditor`,__name:`index`,props:{modelValue:{},disabled:{type:Boolean},density:{},locale:{}},emits:[`update:modelValue`],setup(t,{emit:l}){let x=t,S=l,{t:C}=r(ne,re,()=>x.locale),w=e(),E=n(()=>x.density);function D(e){x.modelValue&&!x.disabled&&S(`update:modelValue`,{...x.modelValue,...e})}let O=(e,t=2**53-1)=>Number.isSafeInteger(e)?Math.min(t,Math.max(1,e)):1,k=a({get:()=>x.modelValue?.frequency??`none`,set:e=>{if(x.disabled)return;let{interval:t,end:n}=x.modelValue??{};S(`update:modelValue`,e===`none`?null:{frequency:e,interval:t,end:n})}}),A=a({get:()=>x.modelValue?.interval??1,set:e=>D({interval:O(e)})}),j=a(()=>x.modelValue?.monthPattern),M=a({get:()=>j.value?.type??`start`,set:e=>D({monthPattern:e===`start`?void 0:e===`date`?{type:e,day:1}:{type:e,ordinal:1,day:`MO`}})}),N=a({get:()=>j.value?.type===`date`?j.value.day:1,set:e=>D({monthPattern:{type:`date`,day:O(e,31)}})}),P=a({get:()=>j.value?.type===`weekday`?j.value.ordinal:1,set:e=>D({monthPattern:{type:`weekday`,ordinal:e,day:Y.value}})}),Y=a({get:()=>j.value?.type===`weekday`?j.value.day:`MO`,set:e=>D({monthPattern:{type:`weekday`,ordinal:P.value,day:e}})}),X=a(()=>x.modelValue?.end),Z=a({get:()=>X.value?.type??`none`,set:e=>D({end:e===`none`?void 0:e===`count`?{type:e,count:10}:{type:e,date:``}})}),Q=a({get:()=>X.value?.type===`count`?X.value.count:10,set:e=>D({end:{type:`count`,count:O(e)}})}),$=a({get:()=>X.value?.type===`until`?X.value.date:``,set:e=>D({end:{type:`until`,date:e}})});function fe(e){let t=new Set(x.modelValue?.weekdays);t.has(e)?t.delete(e):t.add(e),D({weekdays:v.filter(e=>t.has(e))})}return(e,n)=>(d(),s(`fieldset`,{class:u([`c-recurrence`,{"is-compact":m(E)===`compact`}]),style:te(m(w)),disabled:t.disabled},[c(`legend`,null,p(m(C)(`recurrence.title`)),1),c(`div`,ae,[c(`label`,null,[c(`span`,null,p(m(C)(`recurrence.frequency`)),1),_(c(`select`,{"onUpdate:modelValue":n[0]||=e=>k.value=e},[c(`option`,F,p(m(C)(`recurrence.none`)),1),(d(!0),s(i,null,f(m(y),e=>(d(),s(`option`,{key:e,value:e},p(m(C)(`recurrence.${e}`)),9,I))),128))],512),[[h,k.value]])]),t.modelValue?(d(),s(`label`,L,[c(`span`,null,p(m(C)(`recurrence.interval`)),1),_(c(`input`,{"onUpdate:modelValue":n[1]||=e=>A.value=e,type:`number`,min:`1`,step:`1`},null,512),[[g,A.value,void 0,{lazy:!0,number:!0}]])])):o(`v-if`,!0)]),k.value===`weekly`?(d(),s(`fieldset`,R,[c(`legend`,null,p(m(C)(`recurrence.weekdays`)),1),(d(!0),s(i,null,f(m(v),e=>(d(),s(`label`,{key:e,class:`c-recurrence__day`},[c(`input`,{type:`checkbox`,checked:t.modelValue?.weekdays?.includes(e),onChange:t=>fe(e)},null,40,z),ee(` `+p(m(C)(`recurrence.day.${e}`)),1)]))),128))])):o(`v-if`,!0),k.value===`monthly`?(d(),s(`div`,B,[c(`label`,null,[c(`span`,null,p(m(C)(`recurrence.monthPattern`)),1),_(c(`select`,{"onUpdate:modelValue":n[2]||=e=>M.value=e},[c(`option`,V,p(m(C)(`recurrence.startDate`)),1),c(`option`,H,p(m(C)(`recurrence.monthDay`)),1),c(`option`,U,p(m(C)(`recurrence.ordinalWeekday`)),1)],512),[[h,M.value]])]),M.value===`date`?(d(),s(`label`,W,[c(`span`,null,p(m(C)(`recurrence.monthDay`)),1),_(c(`input`,{"onUpdate:modelValue":n[3]||=e=>N.value=e,type:`number`,min:`1`,max:`31`,step:`1`},null,512),[[g,N.value,void 0,{lazy:!0,number:!0}]])])):o(`v-if`,!0),M.value===`weekday`?(d(),s(i,{key:1},[c(`label`,null,[c(`span`,null,p(m(C)(`recurrence.ordinal`)),1),_(c(`select`,{"onUpdate:modelValue":n[4]||=e=>P.value=e},[(d(!0),s(i,null,f(m(b),e=>(d(),s(`option`,{key:e,value:e},p(e===-1?m(C)(`recurrence.last`):e),9,G))),128))],512),[[h,P.value]])]),c(`label`,null,[c(`span`,null,p(m(C)(`recurrence.weekday`)),1),_(c(`select`,{"onUpdate:modelValue":n[5]||=e=>Y.value=e},[(d(!0),s(i,null,f(m(v),e=>(d(),s(`option`,{key:e,value:e},p(m(C)(`recurrence.day.${e}`)),9,K))),128))],512),[[h,Y.value]])])],64)):o(`v-if`,!0)])):o(`v-if`,!0),t.modelValue?(d(),s(`div`,q,[c(`label`,null,[c(`span`,null,p(m(C)(`recurrence.end`)),1),_(c(`select`,{"onUpdate:modelValue":n[6]||=e=>Z.value=e},[c(`option`,oe,p(m(C)(`recurrence.unlimited`)),1),c(`option`,se,p(m(C)(`recurrence.count`)),1),c(`option`,ce,p(m(C)(`recurrence.until`)),1)],512),[[h,Z.value]])]),Z.value===`count`?(d(),s(`label`,le,[c(`span`,null,p(m(C)(`recurrence.count`)),1),_(c(`input`,{"onUpdate:modelValue":n[7]||=e=>Q.value=e,type:`number`,min:`1`,step:`1`},null,512),[[g,Q.value,void 0,{lazy:!0,number:!0}]])])):o(`v-if`,!0),Z.value===`until`?(d(),s(`label`,ue,[c(`span`,null,p(m(C)(`recurrence.until`)),1),_(c(`input`,{"onUpdate:modelValue":n[8]||=e=>$.value=e,type:`date`,"aria-invalid":!m(T)($.value),required:``},null,8,de),[[g,$.value]])])):o(`v-if`,!0)])):o(`v-if`,!0),Z.value===`until`&&!m(T)($.value)?(d(),s(`p`,J,p(m(C)(`recurrence.invalidDate`)),1)):o(`v-if`,!0)],14,ie))}}),[[`__scopeId`,`data-v-bbfffd9b`]]);export{k as n,P as r,Y as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_RelationshipExplorer2.cjs`);exports.C_RelationshipExplorer=e.t;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
@import "./shared-tokens.css";
|
|
2
|
+
.c-relationship-explorer[data-v-88f53557] {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: 10px;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
color: var(--c-text-1, var(--c-theme-text-1));
|
|
7
|
+
overflow-wrap: anywhere;
|
|
8
|
+
}
|
|
9
|
+
.c-relationship-explorer__layout[data-v-88f53557] {
|
|
10
|
+
display: grid;
|
|
11
|
+
grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
|
|
12
|
+
gap: 8px;
|
|
13
|
+
}
|
|
14
|
+
.c-relationship-explorer__panel[data-v-88f53557], .c-relationship-explorer__path[data-v-88f53557] {
|
|
15
|
+
display: grid;
|
|
16
|
+
align-content: start;
|
|
17
|
+
gap: 4px;
|
|
18
|
+
min-width: 0;
|
|
19
|
+
padding: 8px 10px;
|
|
20
|
+
border: 1px solid var(--c-border, var(--c-theme-border));
|
|
21
|
+
border-radius: var(--c-radius, var(--c-theme-radius));
|
|
22
|
+
background: var(--c-bg-card, var(--c-theme-bg-card));
|
|
23
|
+
}
|
|
24
|
+
.c-relationship-explorer__current[data-v-88f53557] {
|
|
25
|
+
grid-column: 1/-1;
|
|
26
|
+
grid-row: 1;
|
|
27
|
+
border-color: var(--c-primary, var(--c-theme-primary));
|
|
28
|
+
background: var(--c-bg-active, var(--c-theme-bg-active));
|
|
29
|
+
}
|
|
30
|
+
.c-relationship-explorer__current[data-v-88f53557] .n-button {
|
|
31
|
+
justify-self: start;
|
|
32
|
+
}
|
|
33
|
+
.c-relationship-explorer ol[data-v-88f53557],
|
|
34
|
+
.c-relationship-explorer ul[data-v-88f53557] {
|
|
35
|
+
margin: 0;
|
|
36
|
+
padding: 0;
|
|
37
|
+
list-style: none;
|
|
38
|
+
}
|
|
39
|
+
.c-relationship-explorer ol[data-v-88f53557] {
|
|
40
|
+
display: flex;
|
|
41
|
+
flex-wrap: wrap;
|
|
42
|
+
align-items: center;
|
|
43
|
+
gap: 4px;
|
|
44
|
+
}
|
|
45
|
+
.c-relationship-explorer ol li + li[data-v-88f53557]::before {
|
|
46
|
+
content: "→";
|
|
47
|
+
margin-inline-end: 4px;
|
|
48
|
+
color: var(--c-text-3, var(--c-theme-text-3));
|
|
49
|
+
}
|
|
50
|
+
.c-relationship-explorer li button[data-v-88f53557] {
|
|
51
|
+
padding: 3px 6px;
|
|
52
|
+
border: 0;
|
|
53
|
+
border-radius: var(--c-radius-sm, var(--c-theme-radius-sm));
|
|
54
|
+
background: transparent;
|
|
55
|
+
color: var(--c-primary, var(--c-theme-primary));
|
|
56
|
+
font: inherit;
|
|
57
|
+
text-align: start;
|
|
58
|
+
cursor: pointer;
|
|
59
|
+
}
|
|
60
|
+
.c-relationship-explorer li button[data-v-88f53557]:hover, .c-relationship-explorer li button[data-traced][data-v-88f53557] {
|
|
61
|
+
background: var(--c-bg-active, var(--c-theme-bg-active));
|
|
62
|
+
}
|
|
63
|
+
.c-relationship-explorer li button[data-v-88f53557]:focus-visible {
|
|
64
|
+
outline: 2px solid currentcolor;
|
|
65
|
+
outline-offset: 1px;
|
|
66
|
+
}
|
|
67
|
+
.c-relationship-explorer p[data-v-88f53557] {
|
|
68
|
+
margin: 0;
|
|
69
|
+
}
|
|
70
|
+
.c-relationship-explorer small[data-v-88f53557] {
|
|
71
|
+
display: block;
|
|
72
|
+
color: var(--c-text-2, var(--c-theme-text-2));
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/* layer: default */
|
|
76
|
+
.visible[data-v-88f53557]{visibility:visible;}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RelationshipNeighbor, i as RelationshipKey, n as RelationshipEdge, o as RelationshipNode, r as RelationshipExplorerProps, t as _default } from "./index33.vue.cjs";
|
|
2
|
+
export { _default as C_RelationshipExplorer, type RelationshipEdge, type RelationshipExplorerProps, type RelationshipKey, type RelationshipNeighbor, type RelationshipNode };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as RelationshipNeighbor, i as RelationshipKey, n as RelationshipEdge, o as RelationshipNode, r as RelationshipExplorerProps, t as _default } from "./index33.vue.js";
|
|
2
|
+
export { _default as C_RelationshipExplorer, type RelationshipEdge, type RelationshipExplorerProps, type RelationshipKey, type RelationshipNeighbor, type RelationshipNode };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./C_RelationshipExplorer2.js";export{e as C_RelationshipExplorer};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./useComponentTheme.cjs`),t=require(`./export-helper.cjs`),n=require(`./useScopedComponentLocale.cjs`);let r=require(`vue`),i=require(`naive-ui`);function a(e,t,n){let r=new Map(e.map(e=>[e.key,e])),i=new Map,a=new Map,o=n&&new Set(n),s=new Set,c=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])};for(let e of t)!r.has(e.from)||!r.has(e.to)||s.has(e.key)||o&&(e.type===void 0||!o.has(e.type))||(s.add(e.key),c(a,e.from,e),c(i,e.to,e));return{nodeByKey:r,incoming:i,outgoing:a}}function o(e,t,n){let r=new Map([[t,void 0]]),i=[t];for(let t=0;t<i.length&&!r.has(n);t++)for(let n of e.get(i[t])??[])r.has(n.to)||(r.set(n.to,n),i.push(n.to));if(!r.has(n))return;let a=[];for(let e=r.get(n);e;e=r.get(e.from))a.push(e);return a.reverse()}const s={"relations.title":`关系追溯`,"relations.select":`选择要查看的记录`,"relations.path":`追溯路径`,"relations.noPath":`已加载关系中暂无可达路径`,"relations.current":`当前记录`,"relations.incoming":`上游记录`,"relations.outgoing":`下游记录`,"relations.emptyNeighbors":`暂无关联记录`,"relations.expand":`加载更多关联`,"relations.loading":`正在加载关系`,"relations.empty":`请选择一条记录开始追溯`},c={"relations.title":`Relationship explorer`,"relations.select":`Choose a record to explore`,"relations.path":`Trace path`,"relations.noPath":`No path among the loaded relationships`,"relations.current":`Current record`,"relations.incoming":`Upstream`,"relations.outgoing":`Downstream`,"relations.emptyNeighbors":`No related records`,"relations.expand":`Load more relationships`,"relations.loading":`Loading relationships`,"relations.empty":`Choose a record to start tracing`},l=[`aria-label`,`aria-busy`],u={key:0,class:`c-relationship-explorer__path`},d={key:0},f=[`onClick`],p={key:1},m={class:`c-relationship-explorer__layout`},h=[`aria-label`],g={key:0},_=[`data-traced`,`onClick`],v={key:0},y={key:1},b=[`aria-label`],x={key:0},S={key:1},C={key:1,role:`status`},w=(0,r.defineComponent)({name:`C_RelationshipExplorer`,__name:`index`,props:{nodes:{},edges:{},modelValue:{},traceFrom:{},edgeTypes:{},expandable:{type:Boolean},loading:{type:Boolean},locale:{}},emits:[`update:modelValue`,`select`,`expand`],setup(t,{emit:w}){let T=t,E=w,D=e.n(),{t:O}=n.t(s,c,()=>T.locale),k=(0,r.computed)(()=>a(T.nodes,T.edges,T.edgeTypes)),A=(0,r.computed)(()=>[...k.value.nodeByKey.values()].map(e=>({value:e.key,label:e.label}))),j=(0,r.computed)(()=>T.modelValue==null?void 0:k.value.nodeByKey.get(T.modelValue)),M=(0,r.computed)(()=>{if(!(T.traceFrom==null||!j.value||!k.value.nodeByKey.has(T.traceFrom)))return o(k.value.outgoing,T.traceFrom,j.value.key)}),N=(0,r.computed)(()=>{let e=T.traceFrom==null?void 0:k.value.nodeByKey.get(T.traceFrom);return!e||!M.value?[]:[e,...M.value.flatMap(e=>k.value.nodeByKey.get(e.to)??[])]}),P=(0,r.computed)(()=>{let e=j.value;if(!e)return[];let t=new Set(M.value?.map(e=>e.key));return[`incoming`,`outgoing`].map(n=>{let r=[];for(let i of k.value[n].get(e.key)??[]){let e=k.value.nodeByKey.get(n===`incoming`?i.from:i.to);e&&r.push({node:e,edge:i,traced:t.has(i.key)})}return{direction:n,rows:r}})});function F(e){if(e==null)return;let t=k.value.nodeByKey.get(e);t&&(E(`update:modelValue`,t.key),E(`select`,t))}return(e,n)=>((0,r.openBlock)(),(0,r.createElementBlock)(`section`,{class:`c-relationship-explorer`,style:(0,r.normalizeStyle)((0,r.unref)(D)),"aria-label":(0,r.unref)(O)(`relations.title`),"aria-busy":t.loading||void 0},[(0,r.createVNode)((0,r.unref)(i.NSelect),{value:t.modelValue??null,options:A.value,filterable:``,"virtual-scroll":``,size:`small`,placeholder:(0,r.unref)(O)(`relations.select`),"aria-label":(0,r.unref)(O)(`relations.select`),"onUpdate:value":F},null,8,[`value`,`options`,`placeholder`,`aria-label`]),j.value?((0,r.openBlock)(),(0,r.createElementBlock)(r.Fragment,{key:0},[t.traceFrom==null?(0,r.createCommentVNode)(`v-if`,!0):((0,r.openBlock)(),(0,r.createElementBlock)(`div`,u,[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)((0,r.unref)(O)(`relations.path`)),1),N.value.length?((0,r.openBlock)(),(0,r.createElementBlock)(`ol`,d,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(N.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:e.key},[(0,r.createElementVNode)(`button`,{type:`button`,onClick:t=>F(e.key)},(0,r.toDisplayString)(e.label),9,f)]))),128))])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,p,(0,r.toDisplayString)((0,r.unref)(O)(`relations.noPath`)),1))])),(0,r.createElementVNode)(`div`,m,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(P.value,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`section`,{key:e.direction,class:`c-relationship-explorer__panel`,"aria-label":(0,r.unref)(O)(`relations.${e.direction}`)},[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)((0,r.unref)(O)(`relations.${e.direction}`)),1),e.rows.length?((0,r.openBlock)(),(0,r.createElementBlock)(`ul`,g,[((0,r.openBlock)(!0),(0,r.createElementBlock)(r.Fragment,null,(0,r.renderList)(e.rows,e=>((0,r.openBlock)(),(0,r.createElementBlock)(`li`,{key:e.edge.key},[(0,r.createElementVNode)(`button`,{type:`button`,"data-traced":e.traced||void 0,onClick:t=>F(e.node.key)},[(0,r.createElementVNode)(`span`,null,(0,r.toDisplayString)(e.node.label),1),e.edge.label?((0,r.openBlock)(),(0,r.createElementBlock)(`small`,v,(0,r.toDisplayString)(e.edge.label),1)):(0,r.createCommentVNode)(`v-if`,!0)],8,_)]))),128))])):((0,r.openBlock)(),(0,r.createElementBlock)(`span`,y,(0,r.toDisplayString)((0,r.unref)(O)(`relations.emptyNeighbors`)),1))],8,h))),128)),(0,r.createElementVNode)(`section`,{class:`c-relationship-explorer__panel c-relationship-explorer__current`,"aria-label":(0,r.unref)(O)(`relations.current`)},[(0,r.createElementVNode)(`strong`,null,(0,r.toDisplayString)(j.value.label),1),j.value.type?((0,r.openBlock)(),(0,r.createElementBlock)(`small`,x,(0,r.toDisplayString)(j.value.type),1)):(0,r.createCommentVNode)(`v-if`,!0),j.value.subtitle?((0,r.openBlock)(),(0,r.createElementBlock)(`p`,S,(0,r.toDisplayString)(j.value.subtitle),1)):(0,r.createCommentVNode)(`v-if`,!0),(0,r.renderSlot)(e.$slots,`details`,{node:j.value},void 0,!0),t.expandable?((0,r.openBlock)(),(0,r.createBlock)((0,r.unref)(i.NButton),{key:2,size:`small`,loading:t.loading,disabled:t.loading,onClick:n[0]||=e=>E(`expand`,j.value)},{default:(0,r.withCtx)(()=>[(0,r.createTextVNode)((0,r.toDisplayString)((0,r.unref)(O)(`relations.expand`)),1)]),_:1},8,[`loading`,`disabled`])):(0,r.createCommentVNode)(`v-if`,!0)],8,b)])],64)):((0,r.openBlock)(),(0,r.createElementBlock)(`p`,C,(0,r.toDisplayString)((0,r.unref)(O)(t.loading?`relations.loading`:`relations.empty`)),1))],12,l))}});var T=t.t(w,[[`__scopeId`,`data-v-88f53557`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return T}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e}from"./useComponentTheme.js";import{t}from"./export-helper.js";import{t as n}from"./useScopedComponentLocale.js";import{Fragment as r,computed as i,createBlock as a,createCommentVNode as o,createElementBlock as s,createElementVNode as c,createTextVNode as l,createVNode as u,defineComponent as d,normalizeStyle as f,openBlock as p,renderList as m,renderSlot as h,toDisplayString as g,unref as _,withCtx as v}from"vue";import{NButton as y,NSelect as b}from"naive-ui";function x(e,t,n){let r=new Map(e.map(e=>[e.key,e])),i=new Map,a=new Map,o=n&&new Set(n),s=new Set,c=(e,t,n)=>{let r=e.get(t);r?r.push(n):e.set(t,[n])};for(let e of t)!r.has(e.from)||!r.has(e.to)||s.has(e.key)||o&&(e.type===void 0||!o.has(e.type))||(s.add(e.key),c(a,e.from,e),c(i,e.to,e));return{nodeByKey:r,incoming:i,outgoing:a}}function S(e,t,n){let r=new Map([[t,void 0]]),i=[t];for(let t=0;t<i.length&&!r.has(n);t++)for(let n of e.get(i[t])??[])r.has(n.to)||(r.set(n.to,n),i.push(n.to));if(!r.has(n))return;let a=[];for(let e=r.get(n);e;e=r.get(e.from))a.push(e);return a.reverse()}const C={"relations.title":`关系追溯`,"relations.select":`选择要查看的记录`,"relations.path":`追溯路径`,"relations.noPath":`已加载关系中暂无可达路径`,"relations.current":`当前记录`,"relations.incoming":`上游记录`,"relations.outgoing":`下游记录`,"relations.emptyNeighbors":`暂无关联记录`,"relations.expand":`加载更多关联`,"relations.loading":`正在加载关系`,"relations.empty":`请选择一条记录开始追溯`},w={"relations.title":`Relationship explorer`,"relations.select":`Choose a record to explore`,"relations.path":`Trace path`,"relations.noPath":`No path among the loaded relationships`,"relations.current":`Current record`,"relations.incoming":`Upstream`,"relations.outgoing":`Downstream`,"relations.emptyNeighbors":`No related records`,"relations.expand":`Load more relationships`,"relations.loading":`Loading relationships`,"relations.empty":`Choose a record to start tracing`},T=[`aria-label`,`aria-busy`],E={key:0,class:`c-relationship-explorer__path`},D={key:0},O=[`onClick`],k={key:1},A={class:`c-relationship-explorer__layout`},j=[`aria-label`],M={key:0},N=[`data-traced`,`onClick`],P={key:0},F={key:1},I=[`aria-label`],L={key:0},R={key:1},z={key:1,role:`status`};var B=t(d({name:`C_RelationshipExplorer`,__name:`index`,props:{nodes:{},edges:{},modelValue:{},traceFrom:{},edgeTypes:{},expandable:{type:Boolean},loading:{type:Boolean},locale:{}},emits:[`update:modelValue`,`select`,`expand`],setup(t,{emit:d}){let B=t,V=d,H=e(),{t:U}=n(C,w,()=>B.locale),W=i(()=>x(B.nodes,B.edges,B.edgeTypes)),G=i(()=>[...W.value.nodeByKey.values()].map(e=>({value:e.key,label:e.label}))),K=i(()=>B.modelValue==null?void 0:W.value.nodeByKey.get(B.modelValue)),q=i(()=>{if(!(B.traceFrom==null||!K.value||!W.value.nodeByKey.has(B.traceFrom)))return S(W.value.outgoing,B.traceFrom,K.value.key)}),J=i(()=>{let e=B.traceFrom==null?void 0:W.value.nodeByKey.get(B.traceFrom);return!e||!q.value?[]:[e,...q.value.flatMap(e=>W.value.nodeByKey.get(e.to)??[])]}),Y=i(()=>{let e=K.value;if(!e)return[];let t=new Set(q.value?.map(e=>e.key));return[`incoming`,`outgoing`].map(n=>{let r=[];for(let i of W.value[n].get(e.key)??[]){let e=W.value.nodeByKey.get(n===`incoming`?i.from:i.to);e&&r.push({node:e,edge:i,traced:t.has(i.key)})}return{direction:n,rows:r}})});function X(e){if(e==null)return;let t=W.value.nodeByKey.get(e);t&&(V(`update:modelValue`,t.key),V(`select`,t))}return(e,n)=>(p(),s(`section`,{class:`c-relationship-explorer`,style:f(_(H)),"aria-label":_(U)(`relations.title`),"aria-busy":t.loading||void 0},[u(_(b),{value:t.modelValue??null,options:G.value,filterable:``,"virtual-scroll":``,size:`small`,placeholder:_(U)(`relations.select`),"aria-label":_(U)(`relations.select`),"onUpdate:value":X},null,8,[`value`,`options`,`placeholder`,`aria-label`]),K.value?(p(),s(r,{key:0},[t.traceFrom==null?o(`v-if`,!0):(p(),s(`div`,E,[c(`strong`,null,g(_(U)(`relations.path`)),1),J.value.length?(p(),s(`ol`,D,[(p(!0),s(r,null,m(J.value,e=>(p(),s(`li`,{key:e.key},[c(`button`,{type:`button`,onClick:t=>X(e.key)},g(e.label),9,O)]))),128))])):(p(),s(`span`,k,g(_(U)(`relations.noPath`)),1))])),c(`div`,A,[(p(!0),s(r,null,m(Y.value,e=>(p(),s(`section`,{key:e.direction,class:`c-relationship-explorer__panel`,"aria-label":_(U)(`relations.${e.direction}`)},[c(`strong`,null,g(_(U)(`relations.${e.direction}`)),1),e.rows.length?(p(),s(`ul`,M,[(p(!0),s(r,null,m(e.rows,e=>(p(),s(`li`,{key:e.edge.key},[c(`button`,{type:`button`,"data-traced":e.traced||void 0,onClick:t=>X(e.node.key)},[c(`span`,null,g(e.node.label),1),e.edge.label?(p(),s(`small`,P,g(e.edge.label),1)):o(`v-if`,!0)],8,N)]))),128))])):(p(),s(`span`,F,g(_(U)(`relations.emptyNeighbors`)),1))],8,j))),128)),c(`section`,{class:`c-relationship-explorer__panel c-relationship-explorer__current`,"aria-label":_(U)(`relations.current`)},[c(`strong`,null,g(K.value.label),1),K.value.type?(p(),s(`small`,L,g(K.value.type),1)):o(`v-if`,!0),K.value.subtitle?(p(),s(`p`,R,g(K.value.subtitle),1)):o(`v-if`,!0),h(e.$slots,`details`,{node:K.value},void 0,!0),t.expandable?(p(),a(_(y),{key:2,size:`small`,loading:t.loading,disabled:t.loading,onClick:n[0]||=e=>V(`expand`,K.value)},{default:v(()=>[l(g(_(U)(`relations.expand`)),1)]),_:1},8,[`loading`,`disabled`])):o(`v-if`,!0)],8,I)])],64)):(p(),s(`p`,z,g(_(U)(t.loading?`relations.loading`:`relations.empty`)),1))],12,T))}}),[[`__scopeId`,`data-v-88f53557`]]);export{B as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_ResourceSchedule2.cjs`);exports.C_ResourceSchedule=e.t;
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
@import "./shared-tokens.css";
|
|
2
|
+
.c-resource-schedule[data-v-415786eb] {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: 12px;
|
|
5
|
+
min-inline-size: 0;
|
|
6
|
+
}
|
|
7
|
+
.c-resource-schedule__header[data-v-415786eb], .c-resource-schedule__navigation[data-v-415786eb], .c-resource-schedule__detail[data-v-415786eb] {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
flex-wrap: wrap;
|
|
11
|
+
gap: 8px;
|
|
12
|
+
}
|
|
13
|
+
.c-resource-schedule__header[data-v-415786eb] {
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
}
|
|
16
|
+
.c-resource-schedule__header h3[data-v-415786eb] {
|
|
17
|
+
margin: 0;
|
|
18
|
+
}
|
|
19
|
+
.c-resource-schedule__viewport[data-v-415786eb] {
|
|
20
|
+
overflow: auto;
|
|
21
|
+
border: 1px solid var(--c-schedule-border, var(--c-border, var(--c-theme-border)));
|
|
22
|
+
border-radius: var(--c-schedule-radius, var(--c-radius-panel, var(--c-radius, var(--c-theme-radius))));
|
|
23
|
+
}
|
|
24
|
+
.c-resource-schedule__row[data-v-415786eb] {
|
|
25
|
+
display: grid;
|
|
26
|
+
grid-template-columns: 10rem minmax(var(--c-schedule-axis-min), 1fr);
|
|
27
|
+
min-inline-size: calc(10rem + var(--c-schedule-axis-min));
|
|
28
|
+
border-block-end: 1px solid var(--c-schedule-border, var(--c-border, var(--c-theme-border)));
|
|
29
|
+
}
|
|
30
|
+
.c-resource-schedule__row[data-v-415786eb]:last-child {
|
|
31
|
+
border-block-end: 0;
|
|
32
|
+
}
|
|
33
|
+
.c-resource-schedule__label[data-v-415786eb] {
|
|
34
|
+
position: sticky;
|
|
35
|
+
inset-inline-start: 0;
|
|
36
|
+
z-index: 1;
|
|
37
|
+
padding: 8px;
|
|
38
|
+
overflow-wrap: anywhere;
|
|
39
|
+
background: var(--c-schedule-panel, var(--c-bg-body, var(--c-theme-bg-body)));
|
|
40
|
+
border-inline-end: 1px solid var(--c-schedule-border, var(--c-border, var(--c-theme-border)));
|
|
41
|
+
}
|
|
42
|
+
.c-resource-schedule__time[data-v-415786eb], .c-resource-schedule__track[data-v-415786eb] {
|
|
43
|
+
position: relative;
|
|
44
|
+
}
|
|
45
|
+
.c-resource-schedule__time[data-v-415786eb] {
|
|
46
|
+
min-block-size: 2rem;
|
|
47
|
+
line-height: 2rem;
|
|
48
|
+
font-size: 0.75em;
|
|
49
|
+
font-variant-numeric: tabular-nums;
|
|
50
|
+
}
|
|
51
|
+
.c-resource-schedule__time > span[data-v-415786eb] {
|
|
52
|
+
position: absolute;
|
|
53
|
+
transform: translateX(-50%);
|
|
54
|
+
white-space: nowrap;
|
|
55
|
+
}
|
|
56
|
+
.c-resource-schedule__time > span[data-v-415786eb]:first-child {
|
|
57
|
+
transform: translateX(0);
|
|
58
|
+
}
|
|
59
|
+
.c-resource-schedule__time > span[data-v-415786eb]:last-child {
|
|
60
|
+
transform: translateX(-100%);
|
|
61
|
+
}
|
|
62
|
+
.c-resource-schedule__track[data-v-415786eb] {
|
|
63
|
+
background: linear-gradient(90deg, var(--c-schedule-border, var(--c-border, var(--c-theme-border))) 1px, transparent 1px) 0 0/var(--c-schedule-interval) 100%;
|
|
64
|
+
}
|
|
65
|
+
.c-resource-schedule__working-window[data-v-415786eb], .c-resource-schedule__booking[data-v-415786eb] {
|
|
66
|
+
box-sizing: border-box;
|
|
67
|
+
position: absolute;
|
|
68
|
+
}
|
|
69
|
+
.c-resource-schedule__working-window[data-v-415786eb] {
|
|
70
|
+
inset-block: 0;
|
|
71
|
+
background: var(--c-schedule-working, var(--c-bg-hover, var(--c-theme-bg-hover)));
|
|
72
|
+
pointer-events: none;
|
|
73
|
+
}
|
|
74
|
+
.c-resource-schedule__booking[data-v-415786eb] {
|
|
75
|
+
block-size: calc(var(--c-schedule-track-height) - 8px);
|
|
76
|
+
padding: 0 min(4px, 0.3%);
|
|
77
|
+
overflow: hidden;
|
|
78
|
+
border: 1px solid var(--c-schedule-booking, var(--c-primary, var(--c-theme-primary-suppl)));
|
|
79
|
+
border-radius: var(--c-schedule-radius, var(--c-radius, var(--c-theme-radius)));
|
|
80
|
+
color: var(--c-schedule-text, var(--c-text-1, var(--c-theme-text-1)));
|
|
81
|
+
background: color-mix(in srgb, var(--c-schedule-booking, var(--c-primary, var(--c-theme-primary-suppl))) 20%, var(--c-schedule-panel, var(--c-bg-body, var(--c-theme-bg-body))));
|
|
82
|
+
font: inherit;
|
|
83
|
+
font-size: 0.875em;
|
|
84
|
+
text-overflow: ellipsis;
|
|
85
|
+
white-space: nowrap;
|
|
86
|
+
cursor: pointer;
|
|
87
|
+
}
|
|
88
|
+
.c-resource-schedule__booking.is-conflict[data-v-415786eb] {
|
|
89
|
+
border-color: var(--c-schedule-conflict, var(--c-error, var(--c-theme-error)));
|
|
90
|
+
}
|
|
91
|
+
.c-resource-schedule__booking[aria-pressed=true][data-v-415786eb], .c-resource-schedule__booking[data-v-415786eb]:focus-visible {
|
|
92
|
+
z-index: 1;
|
|
93
|
+
outline: 2px solid var(--c-schedule-selected, var(--c-primary, var(--c-theme-primary)));
|
|
94
|
+
outline-offset: -2px;
|
|
95
|
+
}
|
|
96
|
+
.c-resource-schedule__conflict-marker[data-v-415786eb] {
|
|
97
|
+
margin-inline-end: 4px;
|
|
98
|
+
color: var(--c-schedule-conflict, var(--c-error, var(--c-theme-error)));
|
|
99
|
+
font-weight: 600;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* layer: default */
|
|
103
|
+
.visible[data-v-415786eb]{visibility:visible;}
|
|
104
|
+
.h23[data-v-415786eb]{height:5.75rem;}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ResourceScheduleProps, i as ResourceScheduleKey, n as ResourceScheduleBooking, o as ResourceScheduleRange, r as ResourceScheduleBookingSlot, s as ResourceScheduleResource, t as _default } from "./index34.vue.cjs";
|
|
2
|
+
export { _default as C_ResourceSchedule, type ResourceScheduleBooking, type ResourceScheduleBookingSlot, type ResourceScheduleKey, type ResourceScheduleProps, type ResourceScheduleRange, type ResourceScheduleResource };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ResourceScheduleProps, i as ResourceScheduleKey, n as ResourceScheduleBooking, o as ResourceScheduleRange, r as ResourceScheduleBookingSlot, s as ResourceScheduleResource, t as _default } from "./index34.vue.js";
|
|
2
|
+
export { _default as C_ResourceSchedule, type ResourceScheduleBooking, type ResourceScheduleBookingSlot, type ResourceScheduleKey, type ResourceScheduleProps, type ResourceScheduleRange, type ResourceScheduleResource };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./C_ResourceSchedule2.js";export{e as C_ResourceSchedule};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./useComponentDensity.cjs`),i=require(`./useScopedComponentLocale.cjs`);let a=require(`vue`),o=require(`naive-ui`);const s=864e13;function c(e){let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t<n&&t>=-s&&n<=s}function l(e,t,n){let r=Math.max(e,n[0]),i=Math.min(t,n[1]);if(!c([e,t])||r>=i)return;let a=n[1]-n[0];return{start:r,end:i,offset:(r-n[0])/a*100,width:(i-r)/a*100}}function u(e,t){let n=e.flatMap(e=>{let n=l(e.start,e.end,t);return n?[{booking:e,...n}]:[]});n.sort((e,t)=>e.start-t.start||t.end-e.end);let r=[],i=-1/0;return{bookings:n.map((e,t)=>{let a=r.findIndex(t=>t<=e.start);a===-1&&(a=r.length),r[a]=e.end;let o=e.start<i||(n[t+1]?.start??1/0)<e.end;return i=Math.max(i,e.end),{...e,track:a,conflict:o}}),trackCount:Math.max(1,r.length)}}function d(e,t,n){if(!c(n))return[];let r=new Map,i=new Set;for(let e of t){if(i.has(e.key))continue;i.add(e.key);let t=r.get(e.resourceKey);t?t.push(e):r.set(e.resourceKey,[e])}let a=new Set,o=[];for(let t of e){if(a.has(t.key))continue;a.add(t.key);let e=(t.workingWindows??[]).flatMap(([e,t])=>{let r=l(e,t,n);return r?[r]:[]});o.push({resource:t,workingWindows:e,...u(r.get(t.key)??[],n)})}return o}function f(e,t=7){if(!c(e))return[];let n=Number.isFinite(t)?Math.max(2,Math.min(24,Math.trunc(t))):7,r=e[1]-e[0];return Array.from({length:n},(t,i)=>{let a=i/(n-1);return{time:e[0]+r*a,offset:a*100}})}const p={"resourceSchedule.title":`资源排班`,"resourceSchedule.resources":`资源`,"resourceSchedule.previous":`上个时段`,"resourceSchedule.next":`下个时段`,"resourceSchedule.viewport":`排班时段 {range}`,"resourceSchedule.invalidRange":`请选择一个有效的时段`,"resourceSchedule.noResources":`当前没有可展示的资源`,"resourceSchedule.conflict":`预约时间冲突`},m={"resourceSchedule.title":`Resource schedule`,"resourceSchedule.resources":`Resources`,"resourceSchedule.previous":`Previous period`,"resourceSchedule.next":`Next period`,"resourceSchedule.viewport":`Schedule for {range}`,"resourceSchedule.invalidRange":`Choose a valid time range`,"resourceSchedule.noResources":`No resources to display`,"resourceSchedule.conflict":`Conflicting booking`},h=[`aria-label`],g={class:`c-resource-schedule__header`},_={key:0,class:`c-resource-schedule__navigation`},v={key:0,role:`status`},y={key:1,role:`status`},b=[`aria-label`],x={class:`c-resource-schedule__row c-resource-schedule__axis`},S={class:`c-resource-schedule__label`},C={class:`c-resource-schedule__time`,dir:`ltr`,"aria-hidden":`true`},w=[`aria-label`],T={class:`c-resource-schedule__label`},E=[`aria-pressed`,`aria-label`,`title`,`onClick`],D={key:0,"aria-hidden":`true`,class:`c-resource-schedule__conflict-marker`},O={key:0,class:`c-resource-schedule__detail`},k={key:0,class:`c-resource-schedule__conflict-marker`},A=(0,a.defineComponent)({name:`C_ResourceSchedule`,__name:`index`,props:{range:{},resources:{},bookings:{},modelValue:{},title:{},timeZone:{},tickCount:{},navigation:{type:Boolean},density:{},locale:{}},emits:[`update:range`,`update:modelValue`,`select`],setup(n,{emit:s}){let l=n,u=s,{t:A,locale:j}=i.t(p,m,()=>l.locale),M=(e,t)=>A(`resourceSchedule.${e}`,t),N=r.t(()=>l.density),P=(0,a.computed)(()=>e.t(N.value).size),F=t.n(),I=(0,a.computed)(()=>{let e={month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`,timeZone:l.timeZone??`UTC`};try{return new Intl.DateTimeFormat(j.value,e)}catch{return new Intl.DateTimeFormat(j.value,{...e,timeZone:`UTC`})}}),L=(0,a.computed)(()=>I.value.resolvedOptions().timeZone),R=e=>I.value.format(e),z=(e,t)=>`${R(e)} – ${R(t)}`,B=(0,a.shallowRef)(),V=(0,a.computed)(()=>l.modelValue===void 0?B.value:l.modelValue),H=(0,a.computed)(()=>d(l.resources,l.bookings,l.range)),U=(0,a.computed)(()=>f(l.range,l.tickCount)),W=(0,a.computed)(()=>{for(let e of H.value){let t=e.bookings.find(e=>e.booking.key===V.value);if(t)return{item:t,resource:e.resource}}}),G=e=>{B.value=e.key,u(`update:modelValue`,e.key),u(`select`,e)},K=e=>{let[t,n]=l.range,r=(n-t)*e;return[t+r,n+r]},q=e=>c(K(e)),J=e=>{let t=K(e);c(t)&&u(`update:range`,t)},Y=(e,t)=>{let n=`${e.label}, ${z(e.start,e.end)}`;return t?`${n}, ${M(`conflict`)}`:n},X=e=>`${e}%`,Z=({offset:e,width:t})=>({left:X(e),width:X(t)}),Q=(0,a.computed)(()=>({...F.value,"--c-schedule-interval":X(100/Math.max(1,U.value.length-1)),"--c-schedule-axis-min":`${Math.max(24,(U.value.length-1)*7)}rem`,"--c-schedule-track-height":{small:`30px`,medium:`36px`,large:`42px`}[P.value]}));return(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`section`,{class:`c-resource-schedule`,"aria-label":n.title??M(`title`),style:(0,a.normalizeStyle)(Q.value)},[(0,a.createElementVNode)(`header`,g,[(0,a.createElementVNode)(`h3`,null,(0,a.toDisplayString)(n.title??M(`title`)),1),n.navigation&&U.value.length?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,_,[(0,a.createVNode)((0,a.unref)(o.NButton),{size:P.value,disabled:!q(-1),onClick:t[0]||=e=>J(-1)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(M(`previous`)),1)]),_:1},8,[`size`,`disabled`]),(0,a.createVNode)((0,a.unref)(o.NButton),{size:P.value,disabled:!q(1),onClick:t[1]||=e=>J(1)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)(M(`next`)),1)]),_:1},8,[`size`,`disabled`])])):(0,a.createCommentVNode)(`v-if`,!0)]),U.value.length?H.value.length?((0,a.openBlock)(),(0,a.createElementBlock)(a.Fragment,{key:2},[(0,a.createElementVNode)(`div`,{class:`c-resource-schedule__viewport`,role:`region`,tabindex:`0`,"aria-label":M(`viewport`,{range:z(n.range[0],n.range[1])})},[(0,a.createElementVNode)(`div`,x,[(0,a.createElementVNode)(`span`,S,(0,a.toDisplayString)(M(`resources`))+` · `+(0,a.toDisplayString)(L.value),1),(0,a.createElementVNode)(`div`,C,[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(U.value,e=>((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:e.offset,style:(0,a.normalizeStyle)({left:X(e.offset)})},(0,a.toDisplayString)(R(e.time)),5))),128))])]),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(H.value,t=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{key:t.resource.key,class:`c-resource-schedule__row`,role:`group`,"aria-label":t.resource.label},[(0,a.createElementVNode)(`span`,T,(0,a.toDisplayString)(t.resource.label),1),(0,a.createElementVNode)(`div`,{class:`c-resource-schedule__track`,dir:`ltr`,style:(0,a.normalizeStyle)({blockSize:`calc(var(--c-schedule-track-height) * ${t.trackCount})`})},[((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(t.workingWindows,(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`span`,{key:t,class:`c-resource-schedule__working-window`,style:(0,a.normalizeStyle)(Z(e)),"aria-hidden":`true`},null,4))),128)),((0,a.openBlock)(!0),(0,a.createElementBlock)(a.Fragment,null,(0,a.renderList)(t.bookings,n=>((0,a.openBlock)(),(0,a.createElementBlock)(`button`,{key:n.booking.key,class:(0,a.normalizeClass)([`c-resource-schedule__booking`,{"is-conflict":n.conflict}]),type:`button`,style:(0,a.normalizeStyle)({...Z(n),top:`calc(var(--c-schedule-track-height) * ${n.track} + 4px)`}),"aria-pressed":V.value===n.booking.key,"aria-label":Y(n.booking,n.conflict),title:Y(n.booking,n.conflict),onClick:e=>G(n.booking)},[n.conflict?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,D,`!`)):(0,a.createCommentVNode)(`v-if`,!0),(0,a.renderSlot)(e.$slots,`booking`,{booking:n.booking,resource:t.resource,conflict:n.conflict},()=>[(0,a.createTextVNode)((0,a.toDisplayString)(n.booking.label),1)],!0)],14,E))),128))],4)],8,w))),128))],8,b),W.value?((0,a.openBlock)(),(0,a.createElementBlock)(`div`,O,[(0,a.renderSlot)(e.$slots,`details`,{booking:W.value.item.booking,resource:W.value.resource,conflict:W.value.item.conflict},()=>[(0,a.createElementVNode)(`strong`,null,(0,a.toDisplayString)(W.value.item.booking.label),1),(0,a.createElementVNode)(`span`,null,(0,a.toDisplayString)(W.value.resource.label),1),(0,a.createElementVNode)(`span`,null,(0,a.toDisplayString)(z(W.value.item.booking.start,W.value.item.booking.end)),1),W.value.item.conflict?((0,a.openBlock)(),(0,a.createElementBlock)(`span`,k,(0,a.toDisplayString)(M(`conflict`)),1)):(0,a.createCommentVNode)(`v-if`,!0)],!0)])):(0,a.createCommentVNode)(`v-if`,!0)],64)):((0,a.openBlock)(),(0,a.createElementBlock)(`p`,y,(0,a.toDisplayString)(M(`noResources`)),1)):((0,a.openBlock)(),(0,a.createElementBlock)(`p`,v,(0,a.toDisplayString)(M(`invalidRange`)),1))],12,h))}});var j=n.t(A,[[`__scopeId`,`data-v-415786eb`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return j}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./density.js";import{n as t}from"./useComponentTheme.js";import{t as n}from"./export-helper.js";import{t as r}from"./useComponentDensity.js";import{t as i}from"./useScopedComponentLocale.js";import{Fragment as a,computed as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createTextVNode as u,createVNode as d,defineComponent as f,normalizeClass as ee,normalizeStyle as p,openBlock as m,renderList as h,renderSlot as g,shallowRef as _,toDisplayString as v,unref as y,withCtx as b}from"vue";import{NButton as x}from"naive-ui";const S=864e13;function C(e){let[t,n]=e;return Number.isFinite(t)&&Number.isFinite(n)&&t<n&&t>=-S&&n<=S}function w(e,t,n){let r=Math.max(e,n[0]),i=Math.min(t,n[1]);if(!C([e,t])||r>=i)return;let a=n[1]-n[0];return{start:r,end:i,offset:(r-n[0])/a*100,width:(i-r)/a*100}}function T(e,t){let n=e.flatMap(e=>{let n=w(e.start,e.end,t);return n?[{booking:e,...n}]:[]});n.sort((e,t)=>e.start-t.start||t.end-e.end);let r=[],i=-1/0;return{bookings:n.map((e,t)=>{let a=r.findIndex(t=>t<=e.start);a===-1&&(a=r.length),r[a]=e.end;let o=e.start<i||(n[t+1]?.start??1/0)<e.end;return i=Math.max(i,e.end),{...e,track:a,conflict:o}}),trackCount:Math.max(1,r.length)}}function te(e,t,n){if(!C(n))return[];let r=new Map,i=new Set;for(let e of t){if(i.has(e.key))continue;i.add(e.key);let t=r.get(e.resourceKey);t?t.push(e):r.set(e.resourceKey,[e])}let a=new Set,o=[];for(let t of e){if(a.has(t.key))continue;a.add(t.key);let e=(t.workingWindows??[]).flatMap(([e,t])=>{let r=w(e,t,n);return r?[r]:[]});o.push({resource:t,workingWindows:e,...T(r.get(t.key)??[],n)})}return o}function E(e,t=7){if(!C(e))return[];let n=Number.isFinite(t)?Math.max(2,Math.min(24,Math.trunc(t))):7,r=e[1]-e[0];return Array.from({length:n},(t,i)=>{let a=i/(n-1);return{time:e[0]+r*a,offset:a*100}})}const D={"resourceSchedule.title":`资源排班`,"resourceSchedule.resources":`资源`,"resourceSchedule.previous":`上个时段`,"resourceSchedule.next":`下个时段`,"resourceSchedule.viewport":`排班时段 {range}`,"resourceSchedule.invalidRange":`请选择一个有效的时段`,"resourceSchedule.noResources":`当前没有可展示的资源`,"resourceSchedule.conflict":`预约时间冲突`},O={"resourceSchedule.title":`Resource schedule`,"resourceSchedule.resources":`Resources`,"resourceSchedule.previous":`Previous period`,"resourceSchedule.next":`Next period`,"resourceSchedule.viewport":`Schedule for {range}`,"resourceSchedule.invalidRange":`Choose a valid time range`,"resourceSchedule.noResources":`No resources to display`,"resourceSchedule.conflict":`Conflicting booking`},k=[`aria-label`],A={class:`c-resource-schedule__header`},j={key:0,class:`c-resource-schedule__navigation`},ne={key:0,role:`status`},re={key:1,role:`status`},ie=[`aria-label`],ae={class:`c-resource-schedule__row c-resource-schedule__axis`},oe={class:`c-resource-schedule__label`},se={class:`c-resource-schedule__time`,dir:`ltr`,"aria-hidden":`true`},ce=[`aria-label`],le={class:`c-resource-schedule__label`},ue=[`aria-pressed`,`aria-label`,`title`,`onClick`],de={key:0,"aria-hidden":`true`,class:`c-resource-schedule__conflict-marker`},M={key:0,class:`c-resource-schedule__detail`},N={key:0,class:`c-resource-schedule__conflict-marker`};var P=n(f({name:`C_ResourceSchedule`,__name:`index`,props:{range:{},resources:{},bookings:{},modelValue:{},title:{},timeZone:{},tickCount:{},navigation:{type:Boolean},density:{},locale:{}},emits:[`update:range`,`update:modelValue`,`select`],setup(n,{emit:f}){let S=n,w=f,{t:T,locale:P}=i(D,O,()=>S.locale),F=(e,t)=>T(`resourceSchedule.${e}`,t),I=r(()=>S.density),L=o(()=>e(I.value).size),R=t(),z=o(()=>{let e={month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,hourCycle:`h23`,timeZone:S.timeZone??`UTC`};try{return new Intl.DateTimeFormat(P.value,e)}catch{return new Intl.DateTimeFormat(P.value,{...e,timeZone:`UTC`})}}),B=o(()=>z.value.resolvedOptions().timeZone),V=e=>z.value.format(e),H=(e,t)=>`${V(e)} – ${V(t)}`,U=_(),W=o(()=>S.modelValue===void 0?U.value:S.modelValue),G=o(()=>te(S.resources,S.bookings,S.range)),K=o(()=>E(S.range,S.tickCount)),q=o(()=>{for(let e of G.value){let t=e.bookings.find(e=>e.booking.key===W.value);if(t)return{item:t,resource:e.resource}}}),fe=e=>{U.value=e.key,w(`update:modelValue`,e.key),w(`select`,e)},J=e=>{let[t,n]=S.range,r=(n-t)*e;return[t+r,n+r]},Y=e=>C(J(e)),X=e=>{let t=J(e);C(t)&&w(`update:range`,t)},Z=(e,t)=>{let n=`${e.label}, ${H(e.start,e.end)}`;return t?`${n}, ${F(`conflict`)}`:n},Q=e=>`${e}%`,$=({offset:e,width:t})=>({left:Q(e),width:Q(t)}),pe=o(()=>({...R.value,"--c-schedule-interval":Q(100/Math.max(1,K.value.length-1)),"--c-schedule-axis-min":`${Math.max(24,(K.value.length-1)*7)}rem`,"--c-schedule-track-height":{small:`30px`,medium:`36px`,large:`42px`}[L.value]}));return(e,t)=>(m(),c(`section`,{class:`c-resource-schedule`,"aria-label":n.title??F(`title`),style:p(pe.value)},[l(`header`,A,[l(`h3`,null,v(n.title??F(`title`)),1),n.navigation&&K.value.length?(m(),c(`div`,j,[d(y(x),{size:L.value,disabled:!Y(-1),onClick:t[0]||=e=>X(-1)},{default:b(()=>[u(v(F(`previous`)),1)]),_:1},8,[`size`,`disabled`]),d(y(x),{size:L.value,disabled:!Y(1),onClick:t[1]||=e=>X(1)},{default:b(()=>[u(v(F(`next`)),1)]),_:1},8,[`size`,`disabled`])])):s(`v-if`,!0)]),K.value.length?G.value.length?(m(),c(a,{key:2},[l(`div`,{class:`c-resource-schedule__viewport`,role:`region`,tabindex:`0`,"aria-label":F(`viewport`,{range:H(n.range[0],n.range[1])})},[l(`div`,ae,[l(`span`,oe,v(F(`resources`))+` · `+v(B.value),1),l(`div`,se,[(m(!0),c(a,null,h(K.value,e=>(m(),c(`span`,{key:e.offset,style:p({left:Q(e.offset)})},v(V(e.time)),5))),128))])]),(m(!0),c(a,null,h(G.value,t=>(m(),c(`div`,{key:t.resource.key,class:`c-resource-schedule__row`,role:`group`,"aria-label":t.resource.label},[l(`span`,le,v(t.resource.label),1),l(`div`,{class:`c-resource-schedule__track`,dir:`ltr`,style:p({blockSize:`calc(var(--c-schedule-track-height) * ${t.trackCount})`})},[(m(!0),c(a,null,h(t.workingWindows,(e,t)=>(m(),c(`span`,{key:t,class:`c-resource-schedule__working-window`,style:p($(e)),"aria-hidden":`true`},null,4))),128)),(m(!0),c(a,null,h(t.bookings,n=>(m(),c(`button`,{key:n.booking.key,class:ee([`c-resource-schedule__booking`,{"is-conflict":n.conflict}]),type:`button`,style:p({...$(n),top:`calc(var(--c-schedule-track-height) * ${n.track} + 4px)`}),"aria-pressed":W.value===n.booking.key,"aria-label":Z(n.booking,n.conflict),title:Z(n.booking,n.conflict),onClick:e=>fe(n.booking)},[n.conflict?(m(),c(`span`,de,`!`)):s(`v-if`,!0),g(e.$slots,`booking`,{booking:n.booking,resource:t.resource,conflict:n.conflict},()=>[u(v(n.booking.label),1)],!0)],14,ue))),128))],4)],8,ce))),128))],8,ie),q.value?(m(),c(`div`,M,[g(e.$slots,`details`,{booking:q.value.item.booking,resource:q.value.resource,conflict:q.value.item.conflict},()=>[l(`strong`,null,v(q.value.item.booking.label),1),l(`span`,null,v(q.value.resource.label),1),l(`span`,null,v(H(q.value.item.booking.start,q.value.item.booking.end)),1),q.value.item.conflict?(m(),c(`span`,N,v(F(`conflict`)),1)):s(`v-if`,!0)],!0)])):s(`v-if`,!0)],64)):(m(),c(`p`,re,v(F(`noResources`)),1)):(m(),c(`p`,ne,v(F(`invalidRange`)),1))],12,k))}}),[[`__scopeId`,`data-v-415786eb`]]);export{P as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./C_ScanInput2.cjs`);exports.C_ScanInput=e.t;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@import "./shared-tokens.css";
|
|
2
|
+
.c-scan-input[data-v-0ac248fa] {
|
|
3
|
+
display: grid;
|
|
4
|
+
gap: 8px;
|
|
5
|
+
min-width: 0;
|
|
6
|
+
}
|
|
7
|
+
.c-scan-input__controls[data-v-0ac248fa] {
|
|
8
|
+
display: flex;
|
|
9
|
+
flex-wrap: wrap;
|
|
10
|
+
gap: 6px;
|
|
11
|
+
}
|
|
12
|
+
.c-scan-input__controls[data-v-0ac248fa] .n-input {
|
|
13
|
+
flex: 1 1 160px;
|
|
14
|
+
}
|
|
15
|
+
.c-scan-input video[data-v-0ac248fa] {
|
|
16
|
+
display: block;
|
|
17
|
+
width: min(100%, 380px);
|
|
18
|
+
max-height: 280px;
|
|
19
|
+
border-radius: var(--c-radius, var(--c-theme-radius));
|
|
20
|
+
background: var(--c-bg-muted, var(--c-theme-bg-muted));
|
|
21
|
+
}
|
|
22
|
+
.c-scan-input p[data-v-0ac248fa] {
|
|
23
|
+
margin: 0;
|
|
24
|
+
color: var(--c-text-2, var(--c-theme-text-2));
|
|
25
|
+
font-size: 0.875em;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* layer: default */
|
|
29
|
+
.grid[data-v-0ac248fa]{display:grid;}
|
|
30
|
+
.block[data-v-0ac248fa]{display:block;}
|
|
31
|
+
.hidden[data-v-0ac248fa]{display:none;}
|
|
32
|
+
.flex[data-v-0ac248fa]{display:flex;}
|
|
33
|
+
.flex-wrap[data-v-0ac248fa]{flex-wrap:wrap;}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./C_ScanInput2.js";export{e as C_ScanInput};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./density.cjs`),t=require(`./useComponentTheme.cjs`),n=require(`./export-helper.cjs`),r=require(`./useComponentDensity.cjs`),i=require(`./useScopedComponentLocale.cjs`);let a=require(`vue`),o=require(`naive-ui`);const s={"scan.placeholder":`输入编码或使用扫码枪`,"scan.input":`编码`,"scan.camera":`摄像头扫码`,"scan.photo":`识别图片`,"scan.cancel":`停止识别`,"scan.preview":`摄像头画面`,"scan.cameraProgress":`将条码或二维码对准摄像头`,"scan.photoProgress":`正在识别图片`,"scan.found":`已识别编码`,"scan.empty":`未识别到编码,请重试或手动输入`,"scan.failed":`识别失败,请重试或手动输入`,"scan.unavailable":`当前环境无法识别,请手动输入或使用扫码枪`},c={"scan.placeholder":`Enter a code or use a handheld scanner`,"scan.input":`Code`,"scan.camera":`Use camera`,"scan.photo":`Read image`,"scan.cancel":`Stop scanning`,"scan.preview":`Camera preview`,"scan.cameraProgress":`Point the camera at the barcode or QR code`,"scan.photoProgress":`Reading image`,"scan.found":`Code recognised`,"scan.empty":`No code found. Try again or enter it manually.`,"scan.failed":`Could not scan the code. Try again or enter it manually.`,"scan.unavailable":`Scanning is unavailable. Enter the code or use a handheld scanner.`};function l(){return globalThis.BarcodeDetector}function u(){let e=l();if(!e)throw Error(`Barcode detection is unavailable`);let t=new e;return async e=>{let[n]=await t.detect(e);return n?{value:n.rawValue,format:n.format}:null}}function d(e,t,n){let r=(0,a.ref)(),i=(0,a.ref)(),o=(0,a.ref)(),s=(0,a.computed)(()=>!!(e.decode||l())),c=(0,a.computed)(()=>s.value&&typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia),d=(0,a.computed)(()=>s.value&&typeof createImageBitmap==`function`),f,p,m;function h(){f?.abort(),f=void 0,m!==void 0&&clearTimeout(m),m=void 0,r.value&&(r.value.srcObject=null),p?.getTracks().forEach(e=>e.stop()),p=void 0,i.value=void 0,o.value=void 0}function g(e){h();let t=new AbortController;return f=t,i.value=e,t.signal}function _(e,n){h(),o.value=`found`,t(e,n)}function v(e,t){h(),o.value=`failed`,n(e,t)}function y(t){return e.disabled?!1:t===`camera`?e.camera&&c.value&&i.value!==`camera`:e.photo&&d.value}async function b(){if(!y(`camera`))return;let t=g(`camera`);try{let n=e.decode??u(),i=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:`environment`}}});if(t.aborted){i.getTracks().forEach(e=>e.stop());return}p=i,await(0,a.nextTick)();let o=r.value;if(!o||t.aborted)return;o.srcObject=i,await o.play();async function s(){if(!(t.aborted||!o))try{if(o.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA){let e=await n(o,t);if(t.aborted)return;if(e?.value){_(e,`camera`);return}}m=setTimeout(s,180)}catch(e){t.aborted||v(e,`camera`)}}await s()}catch(e){t.aborted||v(e,`camera`)}}async function x(t){if(!y(`photo`))return;let n=g(`photo`),r,i=()=>{r?.close(),r=void 0};try{let a=e.decode??u();if(r=await createImageBitmap(t),n.aborted)return;n.addEventListener(`abort`,i,{once:!0});let s=await a(r,n);if(n.aborted)return;s?.value?_(s,`photo`):(h(),o.value=`empty`)}catch(e){n.aborted||v(e,`photo`)}finally{n.removeEventListener(`abort`,i),i()}}return(0,a.watch)(()=>[e.camera,e.photo,e.disabled,e.decode,e.scope],h,{flush:`sync`}),(0,a.onBeforeUnmount)(h),{video:r,mode:i,message:o,canCamera:c,canPhoto:d,openCamera:b,scanPhoto:x,stop:h}}const f={class:`c-scan-input__controls`},p=[`aria-label`],m={key:1,role:`status`},h=(0,a.defineComponent)({name:`C_ScanInput`,__name:`index`,props:{modelValue:{},camera:{type:Boolean},photo:{type:Boolean},decode:{type:Function},scope:{},disabled:{type:Boolean},placeholder:{},locale:{}},emits:[`update:modelValue`,`scan`,`submit`,`error`],setup(n,{emit:l}){let u=n,h=l,g=t.n(),_=r.t(),v=(0,a.computed)(()=>e.t(_.value).size),{t:y}=i.t(s,c,()=>u.locale),b=(0,a.ref)(),{mode:x,message:S,video:C,canCamera:w,canPhoto:T,openCamera:E,scanPhoto:D,stop:O}=d(u,(e,t)=>{h(`update:modelValue`,e.value),h(`scan`,e,t)},(e,t)=>h(`error`,e,t)),k=(0,a.computed)(()=>S.value?y(`scan.${S.value}`):x.value?y(`scan.${x.value}Progress`):(u.camera||u.photo)&&!(u.camera&&w.value)&&!(u.photo&&T.value)?y(`scan.unavailable`):``);function A(e){let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.files?.[0];t.value=``,n&&D(n)}function j(e){e.isComposing||e.keyCode===229||u.disabled||!u.modelValue||(e.preventDefault(),h(`submit`,u.modelValue))}function M(e){x.value&&O(),h(`update:modelValue`,e)}return(e,t)=>((0,a.openBlock)(),(0,a.createElementBlock)(`div`,{class:`c-scan-input`,style:(0,a.normalizeStyle)((0,a.unref)(g))},[(0,a.createElementVNode)(`div`,f,[(0,a.createVNode)((0,a.unref)(o.NInput),{value:n.modelValue??``,disabled:n.disabled,size:v.value,placeholder:n.placeholder??(0,a.unref)(y)(`scan.placeholder`),"input-props":{"aria-label":(0,a.unref)(y)(`scan.input`)},"onUpdate:value":M,onKeydown:(0,a.withKeys)(j,[`enter`])},null,8,[`value`,`disabled`,`size`,`placeholder`,`input-props`]),n.camera&&(0,a.unref)(w)?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.NButton),{key:0,size:v.value,disabled:n.disabled||(0,a.unref)(x)===`camera`,onClick:(0,a.unref)(E)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)((0,a.unref)(y)(`scan.camera`)),1)]),_:1},8,[`size`,`disabled`,`onClick`])):(0,a.createCommentVNode)(`v-if`,!0),n.photo&&(0,a.unref)(T)?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.NButton),{key:1,size:v.value,disabled:n.disabled||(0,a.unref)(x)===`photo`,onClick:t[0]||=e=>b.value?.click()},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)((0,a.unref)(y)(`scan.photo`)),1)]),_:1},8,[`size`,`disabled`])):(0,a.createCommentVNode)(`v-if`,!0),(0,a.unref)(x)?((0,a.openBlock)(),(0,a.createBlock)((0,a.unref)(o.NButton),{key:2,size:v.value,onClick:(0,a.unref)(O)},{default:(0,a.withCtx)(()=>[(0,a.createTextVNode)((0,a.toDisplayString)((0,a.unref)(y)(`scan.cancel`)),1)]),_:1},8,[`size`,`onClick`])):(0,a.createCommentVNode)(`v-if`,!0),n.photo&&(0,a.unref)(T)?((0,a.openBlock)(),(0,a.createElementBlock)(`input`,{key:3,ref_key:`photoInput`,ref:b,type:`file`,accept:`image/*`,hidden:``,onChange:A},null,544)):(0,a.createCommentVNode)(`v-if`,!0)]),(0,a.unref)(x)===`camera`?((0,a.openBlock)(),(0,a.createElementBlock)(`video`,{key:0,ref_key:`video`,ref:C,muted:``,playsinline:``,"aria-label":(0,a.unref)(y)(`scan.preview`)},null,8,p)):(0,a.createCommentVNode)(`v-if`,!0),k.value?((0,a.openBlock)(),(0,a.createElementBlock)(`p`,m,(0,a.toDisplayString)(k.value),1)):(0,a.createCommentVNode)(`v-if`,!0)],4))}});var g=n.t(h,[[`__scopeId`,`data-v-0ac248fa`]]);Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return g}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{t as e}from"./density.js";import{n as t}from"./useComponentTheme.js";import{t as n}from"./export-helper.js";import{t as r}from"./useComponentDensity.js";import{t as i}from"./useScopedComponentLocale.js";import{computed as a,createBlock as o,createCommentVNode as s,createElementBlock as c,createElementVNode as l,createTextVNode as u,createVNode as d,defineComponent as f,nextTick as p,normalizeStyle as m,onBeforeUnmount as h,openBlock as g,ref as _,toDisplayString as v,unref as y,watch as b,withCtx as x,withKeys as S}from"vue";import{NButton as C,NInput as w}from"naive-ui";const T={"scan.placeholder":`输入编码或使用扫码枪`,"scan.input":`编码`,"scan.camera":`摄像头扫码`,"scan.photo":`识别图片`,"scan.cancel":`停止识别`,"scan.preview":`摄像头画面`,"scan.cameraProgress":`将条码或二维码对准摄像头`,"scan.photoProgress":`正在识别图片`,"scan.found":`已识别编码`,"scan.empty":`未识别到编码,请重试或手动输入`,"scan.failed":`识别失败,请重试或手动输入`,"scan.unavailable":`当前环境无法识别,请手动输入或使用扫码枪`},E={"scan.placeholder":`Enter a code or use a handheld scanner`,"scan.input":`Code`,"scan.camera":`Use camera`,"scan.photo":`Read image`,"scan.cancel":`Stop scanning`,"scan.preview":`Camera preview`,"scan.cameraProgress":`Point the camera at the barcode or QR code`,"scan.photoProgress":`Reading image`,"scan.found":`Code recognised`,"scan.empty":`No code found. Try again or enter it manually.`,"scan.failed":`Could not scan the code. Try again or enter it manually.`,"scan.unavailable":`Scanning is unavailable. Enter the code or use a handheld scanner.`};function D(){return globalThis.BarcodeDetector}function O(){let e=D();if(!e)throw Error(`Barcode detection is unavailable`);let t=new e;return async e=>{let[n]=await t.detect(e);return n?{value:n.rawValue,format:n.format}:null}}function k(e,t,n){let r=_(),i=_(),o=_(),s=a(()=>!!(e.decode||D())),c=a(()=>s.value&&typeof navigator<`u`&&!!navigator.mediaDevices?.getUserMedia),l=a(()=>s.value&&typeof createImageBitmap==`function`),u,d,f;function m(){u?.abort(),u=void 0,f!==void 0&&clearTimeout(f),f=void 0,r.value&&(r.value.srcObject=null),d?.getTracks().forEach(e=>e.stop()),d=void 0,i.value=void 0,o.value=void 0}function g(e){m();let t=new AbortController;return u=t,i.value=e,t.signal}function v(e,n){m(),o.value=`found`,t(e,n)}function y(e,t){m(),o.value=`failed`,n(e,t)}function x(t){return e.disabled?!1:t===`camera`?e.camera&&c.value&&i.value!==`camera`:e.photo&&l.value}async function S(){if(!x(`camera`))return;let t=g(`camera`);try{let n=e.decode??O(),i=await navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:{ideal:`environment`}}});if(t.aborted){i.getTracks().forEach(e=>e.stop());return}d=i,await p();let a=r.value;if(!a||t.aborted)return;a.srcObject=i,await a.play();async function o(){if(!(t.aborted||!a))try{if(a.readyState>=HTMLMediaElement.HAVE_CURRENT_DATA){let e=await n(a,t);if(t.aborted)return;if(e?.value){v(e,`camera`);return}}f=setTimeout(o,180)}catch(e){t.aborted||y(e,`camera`)}}await o()}catch(e){t.aborted||y(e,`camera`)}}async function C(t){if(!x(`photo`))return;let n=g(`photo`),r,i=()=>{r?.close(),r=void 0};try{let a=e.decode??O();if(r=await createImageBitmap(t),n.aborted)return;n.addEventListener(`abort`,i,{once:!0});let s=await a(r,n);if(n.aborted)return;s?.value?v(s,`photo`):(m(),o.value=`empty`)}catch(e){n.aborted||y(e,`photo`)}finally{n.removeEventListener(`abort`,i),i()}}return b(()=>[e.camera,e.photo,e.disabled,e.decode,e.scope],m,{flush:`sync`}),h(m),{video:r,mode:i,message:o,canCamera:c,canPhoto:l,openCamera:S,scanPhoto:C,stop:m}}const A={class:`c-scan-input__controls`},j=[`aria-label`],M={key:1,role:`status`};var N=n(f({name:`C_ScanInput`,__name:`index`,props:{modelValue:{},camera:{type:Boolean},photo:{type:Boolean},decode:{type:Function},scope:{},disabled:{type:Boolean},placeholder:{},locale:{}},emits:[`update:modelValue`,`scan`,`submit`,`error`],setup(n,{emit:f}){let p=n,h=f,b=t(),D=r(),O=a(()=>e(D.value).size),{t:N}=i(T,E,()=>p.locale),P=_(),{mode:F,message:I,video:L,canCamera:R,canPhoto:z,openCamera:B,scanPhoto:V,stop:H}=k(p,(e,t)=>{h(`update:modelValue`,e.value),h(`scan`,e,t)},(e,t)=>h(`error`,e,t)),U=a(()=>I.value?N(`scan.${I.value}`):F.value?N(`scan.${F.value}Progress`):(p.camera||p.photo)&&!(p.camera&&R.value)&&!(p.photo&&z.value)?N(`scan.unavailable`):``);function W(e){let t=e.target;if(!(t instanceof HTMLInputElement))return;let n=t.files?.[0];t.value=``,n&&V(n)}function G(e){e.isComposing||e.keyCode===229||p.disabled||!p.modelValue||(e.preventDefault(),h(`submit`,p.modelValue))}function K(e){F.value&&H(),h(`update:modelValue`,e)}return(e,t)=>(g(),c(`div`,{class:`c-scan-input`,style:m(y(b))},[l(`div`,A,[d(y(w),{value:n.modelValue??``,disabled:n.disabled,size:O.value,placeholder:n.placeholder??y(N)(`scan.placeholder`),"input-props":{"aria-label":y(N)(`scan.input`)},"onUpdate:value":K,onKeydown:S(G,[`enter`])},null,8,[`value`,`disabled`,`size`,`placeholder`,`input-props`]),n.camera&&y(R)?(g(),o(y(C),{key:0,size:O.value,disabled:n.disabled||y(F)===`camera`,onClick:y(B)},{default:x(()=>[u(v(y(N)(`scan.camera`)),1)]),_:1},8,[`size`,`disabled`,`onClick`])):s(`v-if`,!0),n.photo&&y(z)?(g(),o(y(C),{key:1,size:O.value,disabled:n.disabled||y(F)===`photo`,onClick:t[0]||=e=>P.value?.click()},{default:x(()=>[u(v(y(N)(`scan.photo`)),1)]),_:1},8,[`size`,`disabled`])):s(`v-if`,!0),y(F)?(g(),o(y(C),{key:2,size:O.value,onClick:y(H)},{default:x(()=>[u(v(y(N)(`scan.cancel`)),1)]),_:1},8,[`size`,`onClick`])):s(`v-if`,!0),n.photo&&y(z)?(g(),c(`input`,{key:3,ref_key:`photoInput`,ref:P,type:`file`,accept:`image/*`,hidden:``,onChange:W},null,544)):s(`v-if`,!0)]),y(F)===`camera`?(g(),c(`video`,{key:0,ref_key:`video`,ref:L,muted:``,playsinline:``,"aria-label":y(N)(`scan.preview`)},null,8,j)):s(`v-if`,!0),U.value?(g(),c(`p`,M,v(U.value),1)):s(`v-if`,!0)],4))}}),[[`__scopeId`,`data-v-0ac248fa`]]);export{N as t};
|