hys-ui 0.1.1 → 0.3.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 +149 -0
- package/README.md +17 -1
- package/dist/components/HysAccordion/HysAccordion.vue.js +1 -1
- package/dist/components/HysAccordion/HysAccordion2.vue.js +181 -47
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +639 -0
- package/dist/components/HysAvatar/HysAvatar.vue.js +5 -35
- package/dist/components/HysAvatar/HysAvatar2.vue.js +221 -2
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +7 -0
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +256 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -27
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +288 -2
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +29 -28
- package/dist/components/HysCalendar/HysCalendar.vue.js +5 -92
- package/dist/components/HysCalendar/HysCalendar2.vue.js +815 -2
- package/dist/components/HysCard/HysCard.vue.js +2 -2
- package/dist/components/HysCard/HysCard2.vue.js +175 -42
- package/dist/components/HysCascader/HysCascader.vue.js +5 -194
- package/dist/components/HysCascader/HysCascader2.vue.js +773 -2
- package/dist/components/HysCascader/HysCascaderColumn.vue.js +7 -0
- package/dist/components/HysCascader/HysCascaderColumn2.vue.js +232 -0
- package/dist/components/HysCheckbox/HysCheckbox.vue.js +3 -3
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +180 -65
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPanel.vue.js +7 -0
- package/dist/components/HysColorPicker/HysColorPanel2.vue.js +238 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +1 -1
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -216
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +90 -76
- package/dist/components/HysContextMenu/HysContextMenu.vue.js +5 -89
- package/dist/components/HysContextMenu/HysContextMenu2.vue.js +247 -2
- package/dist/components/HysContextMenu/HysMenuPanel.vue.js +7 -0
- package/dist/components/HysContextMenu/HysMenuPanel2.vue.js +208 -0
- package/dist/components/HysContextMenu/HysMenuSlot.js +10 -0
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +1019 -563
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +270 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +820 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerPanel2.vue.js +357 -0
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +270 -158
- package/dist/components/HysDivider/HysDivider.vue.js +2 -2
- package/dist/components/HysDivider/HysDivider2.vue.js +33 -13
- package/dist/components/HysDrawer/HysDrawer.vue.js +1 -1
- package/dist/components/HysDrawer/HysDrawer2.vue.js +434 -84
- package/dist/components/HysEmpty/HysEmpty.vue.js +5 -41
- package/dist/components/HysEmpty/HysEmpty2.vue.js +181 -2
- package/dist/components/HysFileManager/HysFileManager.vue.js +3 -3
- package/dist/components/HysFileManager/HysFileManager2.vue.js +43 -42
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +578 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -85
- package/dist/components/HysFormItem/HysFormItem2.vue.js +528 -2
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +1380 -268
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +467 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +122 -109
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +490 -85
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -79
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +29 -26
- package/dist/components/HysPagination/HysPagination.vue.js +1 -1
- package/dist/components/HysPagination/HysPagination2.vue.js +2 -0
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +2 -2
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +52 -51
- package/dist/components/HysPopover/HysPopover.vue.js +5 -91
- package/dist/components/HysPopover/HysPopover2.vue.js +120 -2
- package/dist/components/HysProgress/HysProgress.vue.js +2 -2
- package/dist/components/HysProgress/HysProgress2.vue.js +319 -52
- package/dist/components/HysRadio/HysRadio.vue.js +7 -0
- package/dist/components/HysRadio/HysRadio2.vue.js +180 -0
- package/dist/components/HysRadioGroup/HysRadioGroup.vue.js +2 -2
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +190 -65
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +1 -1
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +70 -69
- package/dist/components/HysSearch/HysSearch.vue.js +37 -36
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -63
- package/dist/components/HysSegmented/HysSegmented2.vue.js +273 -2
- package/dist/components/HysSelect/HysSelect.vue.js +3 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +999 -189
- package/dist/components/HysSkeleton/HysSkeleton.vue.js +2 -2
- package/dist/components/HysSkeleton/HysSkeleton2.vue.js +126 -29
- package/dist/components/HysSlider/HysSlider.vue.js +1 -1
- package/dist/components/HysSlider/HysSlider2.vue.js +536 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +170 -0
- package/dist/components/HysSteps/HysSteps.vue.js +1 -1
- package/dist/components/HysSteps/HysSteps2.vue.js +110 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +232 -50
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1494 -88
- package/dist/components/HysTable/HysTableFilterOptions.vue.js +7 -0
- package/dist/components/HysTable/HysTableFilterOptions2.vue.js +133 -0
- package/dist/components/HysTabs/HysTabs.vue.js +2 -2
- package/dist/components/HysTabs/HysTabs2.vue.js +262 -68
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -81
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- package/dist/components/HysTextarea/HysTextarea.vue.js +138 -77
- package/dist/components/HysTimeline/HysTimeline.vue.js +2 -2
- package/dist/components/HysTimeline/HysTimeline2.vue.js +243 -24
- package/dist/components/HysTooltip/HysTooltip.vue.js +5 -64
- package/dist/components/HysTooltip/HysTooltip2.vue.js +110 -2
- package/dist/components/HysTour/HysTour.vue.js +46 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -223
- package/dist/components/HysTransfer/HysTransfer2.vue.js +446 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +503 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +651 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -136
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +570 -2
- package/dist/components/HysTreeSelect/HysTreeSelectPanel.vue.js +7 -0
- package/dist/components/HysTreeSelect/HysTreeSelectPanel2.vue.js +323 -0
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -124
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/autocomplete.js +50 -0
- package/dist/composables/avatar.js +57 -0
- package/dist/composables/calendar.js +96 -0
- package/dist/composables/cascader.js +79 -0
- package/dist/composables/choice.js +38 -0
- package/dist/composables/choiceModel.js +67 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/datePicker.js +227 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/formContext.js +92 -7
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/numberInput.js +91 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/rating.js +16 -0
- package/dist/composables/selectOptions.js +54 -0
- package/dist/composables/table.js +150 -0
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/textInput.js +34 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +65 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useColorPicker.js +402 -0
- package/dist/composables/useContextMenu.js +514 -0
- package/dist/composables/useDataGridRemote.js +67 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +136 -56
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useModal.js +295 -0
- package/dist/composables/useModalInteraction.js +394 -0
- package/dist/composables/usePopupSurface.js +458 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTransferMotion.js +185 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/composables/useUpload.js +472 -0
- package/dist/composables/useUploadModel.js +65 -0
- package/dist/composables/useUploadRequests.js +266 -0
- package/dist/composables/useVirtualTableLayout.js +277 -0
- package/dist/composables/virtualTable.js +43 -0
- package/dist/index.js +152 -139
- package/dist/internal/PopupReference.js +39 -0
- package/dist/internal/PopupSurfacePanel.vue.js +7 -0
- package/dist/internal/PopupSurfacePanel2.vue.js +92 -0
- package/dist/motion/PopupMotion.js +105 -0
- package/dist/motion/popup.js +10 -0
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -22
- package/dist/types/components/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +201 -0
- package/dist/types/components/HysAvatar/HysAvatar.vue.d.ts +28 -15
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +104 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +71 -20
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +120 -31
- package/dist/types/components/HysCard/HysCard.vue.d.ts +55 -7
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +129 -41
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +55 -0
- package/dist/types/components/HysCheckbox/HysCheckbox.vue.d.ts +50 -39
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysColorPicker/HysColorPanel.vue.d.ts +58 -0
- package/dist/types/components/HysColorPicker/HysColorPicker.vue.d.ts +63 -10
- package/dist/types/components/HysCommandPalette/HysCommandPalette.vue.d.ts +2 -1
- package/dist/types/components/HysContextMenu/HysContextMenu.vue.d.ts +50 -34
- package/dist/types/components/HysContextMenu/HysMenuPanel.vue.d.ts +79 -0
- package/dist/types/components/HysContextMenu/HysMenuSlot.d.ts +8 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +65 -118
- package/dist/types/components/HysDatePicker/HysDatePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDatePicker/HysDatePickerControl.vue.d.ts +90 -0
- package/dist/types/components/HysDatePicker/HysDatePickerPanel.vue.d.ts +93 -0
- package/dist/types/components/HysDateRangePicker/HysDateRangePicker.vue.d.ts +66 -14
- package/dist/types/components/HysDivider/HysDivider.vue.d.ts +8 -3
- package/dist/types/components/HysDrawer/HysDrawer.vue.d.ts +92 -35
- package/dist/types/components/HysEmpty/HysEmpty.vue.d.ts +24 -20
- package/dist/types/components/HysForm/HysForm.vue.d.ts +110 -18
- package/dist/types/components/HysFormItem/HysFormItem.vue.d.ts +108 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +84 -5
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +4 -3
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -35
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +1 -0
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +2 -2
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +41 -29
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +18 -24
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +34 -12
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysRichTextEditor/HysRichTextEditor.vue.d.ts +4 -4
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +2 -2
- package/dist/types/components/HysSegmented/HysSegmented.vue.d.ts +64 -32
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +131 -22
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +69 -11
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +24 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +3 -3
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +64 -9
- package/dist/types/components/HysSwitch/HysSwitch.vue.d.ts +76 -17
- package/dist/types/components/HysTable/HysTable.vue.d.ts +206 -32
- package/dist/types/components/HysTable/HysTableFilterOptions.vue.d.ts +18 -0
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +76 -23
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +50 -28
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysToast/HysToast.vue.d.ts +3 -3
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +4 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -40
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +107 -0
- package/dist/types/components/HysTree/HysTree.vue.d.ts +140 -73
- package/dist/types/components/HysTreeSelect/HysTreeSelect.vue.d.ts +102 -23
- package/dist/types/components/HysTreeSelect/HysTreeSelectPanel.vue.d.ts +56 -0
- package/dist/types/components/HysUpload/HysUpload.vue.d.ts +55 -67
- package/dist/types/components/HysVirtualTable/HysVirtualTable.vue.d.ts +71 -40
- package/dist/types/composables/autocomplete.d.ts +109 -0
- package/dist/types/composables/avatar.d.ts +73 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +195 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/color.d.ts +97 -0
- package/dist/types/composables/dataGrid.d.ts +100 -0
- package/dist/types/composables/datePicker.d.ts +250 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/formContext.d.ts +135 -8
- package/dist/types/composables/formLayout.d.ts +11 -0
- package/dist/types/composables/formValidation.d.ts +13 -0
- package/dist/types/composables/gantt.d.ts +68 -0
- package/dist/types/composables/ganttConflicts.d.ts +30 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +183 -0
- package/dist/types/composables/numberInput.d.ts +45 -0
- package/dist/types/composables/overlayManager.d.ts +7 -3
- package/dist/types/composables/popupSurface.d.ts +83 -0
- package/dist/types/composables/progress.d.ts +92 -0
- package/dist/types/composables/rating.d.ts +18 -0
- package/dist/types/composables/segmented.d.ts +15 -0
- package/dist/types/composables/selectOptions.d.ts +46 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +312 -0
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/transfer.d.ts +187 -0
- package/dist/types/composables/tree.d.ts +240 -0
- package/dist/types/composables/treeSelect.d.ts +170 -0
- package/dist/types/composables/upload.d.ts +202 -0
- package/dist/types/composables/uploadRequest.d.ts +3 -0
- package/dist/types/composables/useAlert.d.ts +21 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useColorPicker.d.ts +101 -0
- package/dist/types/composables/useContextMenu.d.ts +81 -0
- package/dist/types/composables/useDataGridRemote.d.ts +15 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useDialog.d.ts +16 -3
- package/dist/types/composables/useDrawerPush.d.ts +6 -0
- package/dist/types/composables/useDrawerResize.d.ts +27 -0
- package/dist/types/composables/useFloating.d.ts +28 -6
- package/dist/types/composables/useGanttDependencies.d.ts +83 -0
- package/dist/types/composables/useGanttHistory.d.ts +42 -0
- package/dist/types/composables/useGanttLabelResize.d.ts +23 -0
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useModal.d.ts +62 -0
- package/dist/types/composables/useModalInteraction.d.ts +27 -0
- package/dist/types/composables/usePopupSurface.d.ts +3341 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/composables/useUpload.d.ts +94 -0
- package/dist/types/composables/useUploadModel.d.ts +14 -0
- package/dist/types/composables/useUploadRequests.d.ts +38 -0
- package/dist/types/composables/useVirtualTableLayout.d.ts +51 -0
- package/dist/types/composables/virtualTable.d.ts +126 -0
- package/dist/types/index.d.ts +50 -9
- package/dist/types/internal/PopupReference.d.ts +18 -0
- package/dist/types/internal/PopupSurfacePanel.vue.d.ts +37 -0
- package/dist/types/motion/PopupMotion.d.ts +59 -0
- package/dist/types/motion/popup.d.ts +12 -0
- package/package.json +2 -1
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
function k(l, n = "value", e = "label") {
|
|
2
|
+
return typeof l == "string" ? l : String(l[n] ?? l.value ?? l[e] ?? l.label ?? "");
|
|
3
|
+
}
|
|
4
|
+
function S(l, n, e) {
|
|
5
|
+
const c = (t) => e.caseSensitive ? t : t.toLocaleLowerCase(), p = c(n);
|
|
6
|
+
function y(t, g = "", b = !1) {
|
|
7
|
+
return t.flatMap((o, h) => {
|
|
8
|
+
if (typeof o != "string" && (!o || typeof o != "object" || Array.isArray(o)))
|
|
9
|
+
return [];
|
|
10
|
+
const i = g + h, r = typeof o == "string" ? void 0 : o, s = r && (Array.isArray(r.options) ? r.options : Array.isArray(r.children) ? r.children : void 0);
|
|
11
|
+
if (s) {
|
|
12
|
+
const f = r, A = y(s, i + "-", b || !!f.disabled);
|
|
13
|
+
return A.length ? [
|
|
14
|
+
{
|
|
15
|
+
key: i,
|
|
16
|
+
kind: "group",
|
|
17
|
+
label: String(f.label ?? ""),
|
|
18
|
+
value: "",
|
|
19
|
+
disabled: !0,
|
|
20
|
+
item: "",
|
|
21
|
+
group: f
|
|
22
|
+
},
|
|
23
|
+
...A
|
|
24
|
+
] : [];
|
|
25
|
+
}
|
|
26
|
+
const a = o, u = k(a, e.valueKey, e.labelKey), v = typeof a == "string" ? a : String(a[e.labelKey] ?? a.label ?? u);
|
|
27
|
+
let d = !0;
|
|
28
|
+
try {
|
|
29
|
+
d = typeof e.filter == "function" ? e.filter(n, a) : !e.filter || !n || c(v).includes(p) || c(u).includes(p);
|
|
30
|
+
} catch {
|
|
31
|
+
d = !1;
|
|
32
|
+
}
|
|
33
|
+
return d ? [
|
|
34
|
+
{
|
|
35
|
+
key: i,
|
|
36
|
+
kind: "option",
|
|
37
|
+
label: v,
|
|
38
|
+
value: u,
|
|
39
|
+
disabled: b || !!(r && r.disabled),
|
|
40
|
+
item: a
|
|
41
|
+
}
|
|
42
|
+
] : [];
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
return y(l);
|
|
46
|
+
}
|
|
47
|
+
export {
|
|
48
|
+
k as autocompleteValue,
|
|
49
|
+
S as normalizeAutocomplete
|
|
50
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { ref as f, watch as d, onActivated as s, onDeactivated as c, onBeforeUnmount as p, computed as b } from "vue";
|
|
2
|
+
const h = Symbol(
|
|
3
|
+
"hys-ui-avatar-group"
|
|
4
|
+
), y = [
|
|
5
|
+
["xs", 0],
|
|
6
|
+
["sm", 576],
|
|
7
|
+
["md", 768],
|
|
8
|
+
["lg", 992],
|
|
9
|
+
["xl", 1200],
|
|
10
|
+
["xxl", 1600]
|
|
11
|
+
], l = f(0), a = /* @__PURE__ */ new Set();
|
|
12
|
+
let o;
|
|
13
|
+
function m() {
|
|
14
|
+
o = void 0, l.value = window.innerWidth;
|
|
15
|
+
}
|
|
16
|
+
function u() {
|
|
17
|
+
o === void 0 && (o = requestAnimationFrame(m));
|
|
18
|
+
}
|
|
19
|
+
function w(e, i) {
|
|
20
|
+
let t = typeof e == "object" ? void 0 : e;
|
|
21
|
+
if (e && typeof e == "object")
|
|
22
|
+
for (const [n, r] of y)
|
|
23
|
+
i >= r && e[n] !== void 0 && (t = e[n]);
|
|
24
|
+
return typeof t == "string" && (t = {
|
|
25
|
+
sm: 24,
|
|
26
|
+
small: 24,
|
|
27
|
+
md: 36,
|
|
28
|
+
medium: 36,
|
|
29
|
+
default: 36,
|
|
30
|
+
lg: 48,
|
|
31
|
+
large: 48
|
|
32
|
+
}[t]), typeof t == "number" && Number.isFinite(t) ? Math.max(1, Math.min(1024, t)) : 36;
|
|
33
|
+
}
|
|
34
|
+
function x(e) {
|
|
35
|
+
const i = f(!0), t = Symbol();
|
|
36
|
+
let n = !1;
|
|
37
|
+
function r() {
|
|
38
|
+
n && (n = !1, a.delete(t), a.size || (window.removeEventListener("resize", u), o !== void 0 && cancelAnimationFrame(o), o = void 0));
|
|
39
|
+
}
|
|
40
|
+
function v() {
|
|
41
|
+
if (!i.value || !e.value || typeof e.value != "object") {
|
|
42
|
+
r();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
n || (n = !0, a.add(t), a.size === 1 && (m(), window.addEventListener("resize", u)));
|
|
46
|
+
}
|
|
47
|
+
return d([i, () => !!e.value && typeof e.value == "object"], v, {
|
|
48
|
+
immediate: !0
|
|
49
|
+
}), s(() => i.value = !0), c(() => {
|
|
50
|
+
i.value = !1, r();
|
|
51
|
+
}), p(r), b(() => w(e.value, l.value));
|
|
52
|
+
}
|
|
53
|
+
export {
|
|
54
|
+
h as avatarGroupKey,
|
|
55
|
+
w as resolveAvatarSize,
|
|
56
|
+
x as useAvatarSize
|
|
57
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
function h(n, t = "YYYY-MM-DD") {
|
|
2
|
+
if (n instanceof Date)
|
|
3
|
+
return Number.isFinite(n.getTime()) ? f(n.getFullYear(), n.getMonth(), n.getDate()) : void 0;
|
|
4
|
+
if (typeof n != "string") return;
|
|
5
|
+
let e = /^(\d{4})-(\d{2})-(\d{2})$/.exec(n);
|
|
6
|
+
if (!e && t !== "YYYY-MM-DD") {
|
|
7
|
+
const d = [], u = t.replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/YYYY|MM|DD/g, (y) => (d.push(y), y === "YYYY" ? "(\\d{4})" : "(\\d{2})"));
|
|
8
|
+
if (d.length !== 3 || new Set(d).size !== 3) return;
|
|
9
|
+
const s = new RegExp("^" + u + "$").exec(n);
|
|
10
|
+
s && (e = [
|
|
11
|
+
s[0],
|
|
12
|
+
s[d.indexOf("YYYY") + 1],
|
|
13
|
+
s[d.indexOf("MM") + 1],
|
|
14
|
+
s[d.indexOf("DD") + 1]
|
|
15
|
+
]);
|
|
16
|
+
}
|
|
17
|
+
if (!e) return;
|
|
18
|
+
const a = +e[1], o = +e[2] - 1, c = +e[3];
|
|
19
|
+
if (a < 1 || a > 9999 || o < 0 || o > 11 || c < 1 || c > 31) return;
|
|
20
|
+
const Y = f(a, o, c), i = new Date(Y * 864e5);
|
|
21
|
+
if (i.getUTCFullYear() === a && i.getUTCMonth() === o && i.getUTCDate() === c)
|
|
22
|
+
return Y;
|
|
23
|
+
}
|
|
24
|
+
function f(n, t, e) {
|
|
25
|
+
const a = /* @__PURE__ */ new Date(0);
|
|
26
|
+
return a.setUTCFullYear(n, t, e), a.setUTCHours(0, 0, 0, 0), a.getTime() / 864e5;
|
|
27
|
+
}
|
|
28
|
+
function r(n) {
|
|
29
|
+
const t = new Date(n * 864e5);
|
|
30
|
+
return {
|
|
31
|
+
year: t.getUTCFullYear(),
|
|
32
|
+
month: t.getUTCMonth(),
|
|
33
|
+
day: t.getUTCDate(),
|
|
34
|
+
weekday: t.getUTCDay()
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
function l(n) {
|
|
38
|
+
const t = r(n);
|
|
39
|
+
return `${String(t.year).padStart(4, "0")}-${String(t.month + 1).padStart(2, "0")}-${String(t.day).padStart(2, "0")}`;
|
|
40
|
+
}
|
|
41
|
+
function p(n) {
|
|
42
|
+
const t = r(n), e = /* @__PURE__ */ new Date(0);
|
|
43
|
+
return e.setFullYear(t.year, t.month, t.day), e.setHours(0, 0, 0, 0), e;
|
|
44
|
+
}
|
|
45
|
+
function M(n, t) {
|
|
46
|
+
const e = r(n);
|
|
47
|
+
return t.replace(
|
|
48
|
+
/YYYY|MM|DD/g,
|
|
49
|
+
(a) => a === "YYYY" ? String(e.year).padStart(4, "0") : String(a === "MM" ? e.month + 1 : e.day).padStart(2, "0")
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
function m(n, t) {
|
|
53
|
+
const e = r(n), a = r(f(e.year, e.month + t, 1)), o = r(f(a.year, a.month + 1, 0)).day;
|
|
54
|
+
return f(a.year, a.month, Math.min(e.day, o));
|
|
55
|
+
}
|
|
56
|
+
function w(n, t, e) {
|
|
57
|
+
return [
|
|
58
|
+
n - (r(n).weekday - e + 7) % 7,
|
|
59
|
+
t + (e + 6 - r(t).weekday + 7) % 7
|
|
60
|
+
];
|
|
61
|
+
}
|
|
62
|
+
function S(n) {
|
|
63
|
+
const t = (r(n).weekday + 6) % 7, e = n + 3 - t, a = r(e).year;
|
|
64
|
+
return 1 + Math.floor((e - f(a, 0, 1)) / 7);
|
|
65
|
+
}
|
|
66
|
+
function T(n, t, e) {
|
|
67
|
+
const a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
68
|
+
for (const c of n) {
|
|
69
|
+
const Y = h(c.date), i = h(c.end ?? c.date);
|
|
70
|
+
if (Y === void 0 || i === void 0 || i < Y || i < t || Y > e)
|
|
71
|
+
continue;
|
|
72
|
+
const d = /* @__PURE__ */ new Set();
|
|
73
|
+
for (let u = Math.max(Y, t); u <= Math.min(i, e); u++) {
|
|
74
|
+
const s = a.get(u) ?? [];
|
|
75
|
+
s.push(c), a.set(u, s);
|
|
76
|
+
const y = r(u), g = y.year * 12 + y.month;
|
|
77
|
+
if (!d.has(g)) {
|
|
78
|
+
const D = o.get(g) ?? [];
|
|
79
|
+
D.push(c), o.set(g, D), d.add(g);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
return { dates: a, months: o };
|
|
84
|
+
}
|
|
85
|
+
export {
|
|
86
|
+
p as calendarDate,
|
|
87
|
+
h as calendarDay,
|
|
88
|
+
T as calendarEvents,
|
|
89
|
+
M as calendarFormat,
|
|
90
|
+
l as calendarISO,
|
|
91
|
+
r as calendarParts,
|
|
92
|
+
m as calendarShift,
|
|
93
|
+
S as calendarWeek,
|
|
94
|
+
w as calendarWeeks,
|
|
95
|
+
f as civilDay
|
|
96
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { treeField as n, treeKey as m } from "./tree.js";
|
|
2
|
+
const L = (r) => JSON.stringify(r.map((e) => [typeof e, e]));
|
|
3
|
+
function P(r) {
|
|
4
|
+
try {
|
|
5
|
+
const e = JSON.parse(r);
|
|
6
|
+
return Array.isArray(e) && e.every(
|
|
7
|
+
(l) => Array.isArray(l) && l.length === 2 && m(l[1]) && typeof l[1] === l[0]
|
|
8
|
+
) ? e.map((l) => l[1]) : [];
|
|
9
|
+
} catch {
|
|
10
|
+
return [];
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
const j = (r) => Array.isArray(r) && r.every(m), B = {
|
|
14
|
+
panel: "级联选择",
|
|
15
|
+
search: "搜索分类",
|
|
16
|
+
empty: "暂无分类",
|
|
17
|
+
noMatch: "无匹配分类",
|
|
18
|
+
loading: "加载中",
|
|
19
|
+
loadError: "加载失败",
|
|
20
|
+
retry: "重试",
|
|
21
|
+
clear: "清空选择",
|
|
22
|
+
close: "关闭",
|
|
23
|
+
level: "第{level}级",
|
|
24
|
+
expand: "展开 {label}",
|
|
25
|
+
remove: "移除 {label}",
|
|
26
|
+
more: "另外 {count} 项",
|
|
27
|
+
limit: "最多选择 {count} 项"
|
|
28
|
+
};
|
|
29
|
+
function F(r, e, l) {
|
|
30
|
+
var A, w, x, C, S, k, K;
|
|
31
|
+
const i = {
|
|
32
|
+
value: "value",
|
|
33
|
+
label: "label",
|
|
34
|
+
children: "children",
|
|
35
|
+
disabled: "disabled",
|
|
36
|
+
leaf: "isLeaf",
|
|
37
|
+
hasChildren: "hasChildren",
|
|
38
|
+
...e.fieldNames
|
|
39
|
+
}, g = [], o = /* @__PURE__ */ new Map(), h = new Set((l == null ? void 0 : l.nodes) ?? []), c = [...r].reverse().map((t) => ({ node: t, parent: l, target: g }));
|
|
40
|
+
for (; c.length; ) {
|
|
41
|
+
const t = c.pop(), { node: a } = t;
|
|
42
|
+
if (t.exit) {
|
|
43
|
+
h.delete(a);
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
46
|
+
if (!a || typeof a != "object" || h.has(a)) continue;
|
|
47
|
+
const f = typeof e.valueKey == "function" ? e.valueKey(a) : n(a, e.valueKey ?? i.value);
|
|
48
|
+
if (!m(f)) continue;
|
|
49
|
+
const M = [...((A = t.parent) == null ? void 0 : A.path) ?? [], f], y = L(M);
|
|
50
|
+
if (o.has(y)) continue;
|
|
51
|
+
const u = [...((w = t.parent) == null ? void 0 : w.nodes) ?? [], a], N = String(n(a, i.label) ?? f), d = n(a, i.children), E = ((x = e.leafMethod) == null ? void 0 : x.call(e, a, u)) ?? n(a, i.leaf) ?? ((C = e.fieldNames) != null && C.leaf ? void 0 : n(a, "leaf")), v = E === !0, J = E === !1, s = {
|
|
52
|
+
value: y,
|
|
53
|
+
label: N,
|
|
54
|
+
raw: a,
|
|
55
|
+
path: M,
|
|
56
|
+
labels: [...((S = t.parent) == null ? void 0 : S.labels) ?? [], N],
|
|
57
|
+
nodes: u,
|
|
58
|
+
disabled: !!((k = t.parent) != null && k.disabled || n(a, i.disabled) || (K = e.disabledMethod) != null && K.call(e, a, u)),
|
|
59
|
+
isLeaf: v,
|
|
60
|
+
hasChildren: !v && !!(Array.isArray(d) && d.length || n(a, i.hasChildren) || J),
|
|
61
|
+
children: []
|
|
62
|
+
};
|
|
63
|
+
if (o.set(y, s), t.target.push(s), h.add(a), c.push({ ...t, exit: !0 }), !v && Array.isArray(d))
|
|
64
|
+
for (let b = d.length - 1; b >= 0; b--)
|
|
65
|
+
c.push({
|
|
66
|
+
node: d[b],
|
|
67
|
+
parent: s,
|
|
68
|
+
target: s.children
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
return { roots: g, map: o };
|
|
72
|
+
}
|
|
73
|
+
export {
|
|
74
|
+
F as cascaderEntries,
|
|
75
|
+
P as cascaderPath,
|
|
76
|
+
L as cascaderToken,
|
|
77
|
+
B as cascaderWords,
|
|
78
|
+
j as validCascaderPath
|
|
79
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const s = Symbol(
|
|
2
|
+
"hys-ui-checkbox-group"
|
|
3
|
+
);
|
|
4
|
+
function c(e) {
|
|
5
|
+
return typeof e == "string" || typeof e == "boolean" || typeof e == "number" && Number.isFinite(e);
|
|
6
|
+
}
|
|
7
|
+
function u(e) {
|
|
8
|
+
return typeof e + ":" + String(e);
|
|
9
|
+
}
|
|
10
|
+
function y(e) {
|
|
11
|
+
return Array.isArray(e) ? [...new Set(e.filter(c))] : [];
|
|
12
|
+
}
|
|
13
|
+
function b(e, o = {}) {
|
|
14
|
+
const a = /* @__PURE__ */ new Set(), i = [];
|
|
15
|
+
if (!Array.isArray(e)) return i;
|
|
16
|
+
for (const r of e) {
|
|
17
|
+
const n = c(r) ? { label: String(r), value: r } : r;
|
|
18
|
+
if (!n || typeof n != "object") continue;
|
|
19
|
+
const t = n[o.value ?? "value"];
|
|
20
|
+
!c(t) || a.has(u(t)) || (a.add(u(t)), i.push({
|
|
21
|
+
...n,
|
|
22
|
+
label: String(n[o.label ?? "label"] ?? t),
|
|
23
|
+
value: t,
|
|
24
|
+
disabled: !!n[o.disabled ?? "disabled"],
|
|
25
|
+
indeterminate: !!n[o.indeterminate ?? "indeterminate"]
|
|
26
|
+
}));
|
|
27
|
+
}
|
|
28
|
+
return i;
|
|
29
|
+
}
|
|
30
|
+
const f = Symbol("hys-ui-radio-group");
|
|
31
|
+
export {
|
|
32
|
+
s as checkboxGroupKey,
|
|
33
|
+
u as choiceKey,
|
|
34
|
+
b as choiceOptions,
|
|
35
|
+
c as isChoice,
|
|
36
|
+
f as radioGroupKey,
|
|
37
|
+
y as uniqueChoices
|
|
38
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { shallowRef as B, inject as C, computed as R, watch as x, onActivated as E, onDeactivated as L, onBeforeUnmount as M, onMounted as T, onUpdated as U, nextTick as j } from "vue";
|
|
2
|
+
import { formKey as b } from "./formContext.js";
|
|
3
|
+
function D(r, v, f = Object.is, c) {
|
|
4
|
+
const i = B(v()), t = C(b, void 0), l = R(
|
|
5
|
+
() => r.modelValue === void 0 ? i.value : r.modelValue
|
|
6
|
+
);
|
|
7
|
+
let n = !0, s = 0, u;
|
|
8
|
+
function o() {
|
|
9
|
+
s++, u = void 0, c == null || c();
|
|
10
|
+
}
|
|
11
|
+
async function a(e, m, h, V = !1) {
|
|
12
|
+
if (!n || f(l.value, e)) return !1;
|
|
13
|
+
const k = ++s;
|
|
14
|
+
return u = { value: e, version: k }, r.modelValue === void 0 && (i.value = e), m(e), V && h(e), await j(), !n || k !== s || (u = void 0, !f(l.value, e)) ? !1 : (V || h(e), !0);
|
|
15
|
+
}
|
|
16
|
+
function d() {
|
|
17
|
+
o(), r.modelValue === void 0 && (i.value = v());
|
|
18
|
+
}
|
|
19
|
+
return x(
|
|
20
|
+
() => r.modelValue,
|
|
21
|
+
(e) => {
|
|
22
|
+
u && f(e, u.value) || o();
|
|
23
|
+
},
|
|
24
|
+
{ flush: "sync" }
|
|
25
|
+
), x(
|
|
26
|
+
() => t == null ? void 0 : t.resetting.value,
|
|
27
|
+
(e) => {
|
|
28
|
+
e && o();
|
|
29
|
+
},
|
|
30
|
+
{ flush: "sync" }
|
|
31
|
+
), E(() => {
|
|
32
|
+
n = !0;
|
|
33
|
+
}), L(() => {
|
|
34
|
+
n = !1, o();
|
|
35
|
+
}), M(() => {
|
|
36
|
+
n = !1, o();
|
|
37
|
+
}), { current: l, commit: a, reset: d, invalidate: o, isLive: () => n };
|
|
38
|
+
}
|
|
39
|
+
function F(r, v, f, c) {
|
|
40
|
+
let i = !0, t, l = 0;
|
|
41
|
+
function n(o) {
|
|
42
|
+
const a = l;
|
|
43
|
+
queueMicrotask(() => {
|
|
44
|
+
!i || a !== l || o.defaultPrevented || (v(), j(() => f == null ? void 0 : f()));
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function s() {
|
|
48
|
+
l++, t == null || t.removeEventListener("reset", n), t = void 0;
|
|
49
|
+
}
|
|
50
|
+
function u() {
|
|
51
|
+
var e, m;
|
|
52
|
+
if (!i) return;
|
|
53
|
+
const o = c == null ? void 0 : c(), a = o ? document.getElementById(o) : ((e = r.value) == null ? void 0 : e.form) || ((m = r.value) == null ? void 0 : m.closest("form")), d = a instanceof HTMLFormElement ? a : void 0;
|
|
54
|
+
d !== t && (s(), t = d, t == null || t.addEventListener("reset", n));
|
|
55
|
+
}
|
|
56
|
+
T(u), U(u), E(() => {
|
|
57
|
+
i = !0, u();
|
|
58
|
+
}), L(() => {
|
|
59
|
+
i = !1, s();
|
|
60
|
+
}), M(() => {
|
|
61
|
+
i = !1, s();
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
export {
|
|
65
|
+
D as useChoiceModel,
|
|
66
|
+
F as useChoiceNativeReset
|
|
67
|
+
};
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
const m = (t, n = 0, r = 1) => Math.max(n, Math.min(r, t)), M = (t) => t.trim() !== "" && Number.isFinite(Number(t)) ? Number(t) : void 0;
|
|
2
|
+
function v(t, n) {
|
|
3
|
+
const r = t.endsWith("%"), s = M(r ? t.slice(0, -1) : t);
|
|
4
|
+
return s === void 0 ? void 0 : m(s / (r ? 100 : n));
|
|
5
|
+
}
|
|
6
|
+
function x(t) {
|
|
7
|
+
var s;
|
|
8
|
+
const n = t.match(/^([-+]?(?:\d*\.)?\d+)(deg|rad|turn|grad)?$/i);
|
|
9
|
+
return n ? (Number(n[1]) * ({ deg: 1, rad: 180 / Math.PI, turn: 360, grad: 0.9 }[((s = n[2]) == null ? void 0 : s.toLowerCase()) ?? "deg"] ?? 1) % 360 + 360) % 360 : void 0;
|
|
10
|
+
}
|
|
11
|
+
function l(t, n, r, s = 1) {
|
|
12
|
+
const e = Math.max(t, n, r), i = Math.min(t, n, r), o = e - i;
|
|
13
|
+
let a = 0;
|
|
14
|
+
return o && (a = (e === t ? (n - r) / o + (n < r ? 6 : 0) : e === n ? (r - t) / o + 2 : (t - n) / o + 4) * 60), { h: a, s: e ? o / e : 0, v: e, a: m(s) };
|
|
15
|
+
}
|
|
16
|
+
function b(t) {
|
|
17
|
+
const n = m(t.s), r = m(t.v), s = (t.h % 360 + 360) % 360, e = (i) => {
|
|
18
|
+
const o = (i + s / 60) % 6;
|
|
19
|
+
return m(r - r * n * Math.max(0, Math.min(o, 4 - o, 1)));
|
|
20
|
+
};
|
|
21
|
+
return [e(5), e(3), e(1)];
|
|
22
|
+
}
|
|
23
|
+
function y(t) {
|
|
24
|
+
if (typeof t != "string") return;
|
|
25
|
+
const n = t.trim().toLowerCase();
|
|
26
|
+
if (n === "transparent") return { h: 0, s: 0, v: 0, a: 0 };
|
|
27
|
+
const r = {
|
|
28
|
+
red: "#ff0000",
|
|
29
|
+
green: "#008000",
|
|
30
|
+
blue: "#0000ff",
|
|
31
|
+
black: "#000000",
|
|
32
|
+
white: "#ffffff",
|
|
33
|
+
yellow: "#ffff00",
|
|
34
|
+
orange: "#ffa500",
|
|
35
|
+
purple: "#800080",
|
|
36
|
+
rebeccapurple: "#663399",
|
|
37
|
+
gray: "#808080",
|
|
38
|
+
grey: "#808080",
|
|
39
|
+
cyan: "#00ffff",
|
|
40
|
+
magenta: "#ff00ff",
|
|
41
|
+
lime: "#00ff00",
|
|
42
|
+
navy: "#000080",
|
|
43
|
+
teal: "#008080",
|
|
44
|
+
pink: "#ffc0cb"
|
|
45
|
+
};
|
|
46
|
+
if (r[n]) return y(r[n]);
|
|
47
|
+
const s = n.match(/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i);
|
|
48
|
+
if (s) {
|
|
49
|
+
const u = s[1].length <= 4 ? [...s[1]].map((f) => f + f).join("") : s[1];
|
|
50
|
+
return l(
|
|
51
|
+
...[0, 2, 4].map((f) => parseInt(u.slice(f, f + 2), 16) / 255),
|
|
52
|
+
u.length === 8 ? parseInt(u.slice(6, 8), 16) / 255 : 1
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
const e = n.match(/^(rgba?|hsla?|hsva?)\(([^()]*)\)$/);
|
|
56
|
+
if (!e) return;
|
|
57
|
+
const i = e[2].trim().replace(/\s*[,/]\s*/g, " ").split(/\s+/);
|
|
58
|
+
if (i.length < 3 || i.length > 4) return;
|
|
59
|
+
const o = i[3] === void 0 ? 1 : v(i[3], 1);
|
|
60
|
+
if (o === void 0) return;
|
|
61
|
+
if (e[1].startsWith("rgb")) {
|
|
62
|
+
const u = i.slice(0, 3).map((f) => v(f, 255));
|
|
63
|
+
return u.some((f) => f === void 0) ? void 0 : l(...u, o);
|
|
64
|
+
}
|
|
65
|
+
const a = x(i[0]), d = v(i[1], 100), c = v(i[2], 100);
|
|
66
|
+
if (a === void 0 || d === void 0 || c === void 0) return;
|
|
67
|
+
if (e[1].startsWith("hsv")) return { h: a, s: d, v: c, a: o };
|
|
68
|
+
const g = c, p = g + d * Math.min(g, 1 - g);
|
|
69
|
+
return { h: a, s: p ? 2 * (1 - g / p) : 0, v: p, a: o };
|
|
70
|
+
}
|
|
71
|
+
const h = (t, n = 1) => Number(t.toFixed(n));
|
|
72
|
+
function C(t, n = "hex", r = !1) {
|
|
73
|
+
const s = b(t), e = h(m(t.a), 3), i = s.map((c) => Math.round(c * 255)), o = h((t.h % 360 + 360) % 360);
|
|
74
|
+
if (n === "hex")
|
|
75
|
+
return "#" + i.map((c) => c.toString(16).padStart(2, "0")).join("") + (r ? Math.round(e * 255).toString(16).padStart(2, "0") : "");
|
|
76
|
+
if (n === "rgb")
|
|
77
|
+
return (r ? "rgba(" : "rgb(") + i.join(", ") + (r ? ", " + e : "") + ")";
|
|
78
|
+
if (n === "hsv")
|
|
79
|
+
return (r ? "hsva(" : "hsv(") + o + ", " + h(t.s * 100) + "%, " + h(t.v * 100) + "%" + (r ? ", " + e : "") + ")";
|
|
80
|
+
const a = t.v * (1 - t.s / 2), d = a > 0 && a < 1 ? (t.v - a) / Math.min(a, 1 - a) : 0;
|
|
81
|
+
return (r ? "hsla(" : "hsl(") + o + ", " + h(d * 100) + "%, " + h(a * 100) + "%" + (r ? ", " + e : "") + ")";
|
|
82
|
+
}
|
|
83
|
+
const N = (t) => C(t, "rgb", !0);
|
|
84
|
+
function w(t, n) {
|
|
85
|
+
if (!t || !n) return t === n;
|
|
86
|
+
const r = b(t), s = b(n);
|
|
87
|
+
return r.every((e, i) => Math.abs(e - s[i]) <= 1 / 255) && Math.abs(t.a - n.a) <= 4e-3;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
m as colorClamp,
|
|
91
|
+
N as colorCss,
|
|
92
|
+
l as colorFromRgb,
|
|
93
|
+
b as colorRgb,
|
|
94
|
+
C as formatColor,
|
|
95
|
+
y as parseColor,
|
|
96
|
+
w as sameColor
|
|
97
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const g = (e) => typeof e == "string" || typeof e == "number" && Number.isFinite(e), u = (e) => typeof e + ":" + e, w = (e, i) => typeof e == "number" && Number.isFinite(e) && e >= 1 ? Math.floor(e) : i;
|
|
2
|
+
function l(e, i) {
|
|
3
|
+
const r = e;
|
|
4
|
+
return Object.hasOwn(r, i) ? r[i] : i.split(".").reduce(
|
|
5
|
+
(d, s) => d && typeof d == "object" && Object.hasOwn(d, s) ? d[s] : void 0,
|
|
6
|
+
r
|
|
7
|
+
);
|
|
8
|
+
}
|
|
9
|
+
function y(e, i) {
|
|
10
|
+
return typeof i.field == "function" ? i.field(e) : l(e, i.field ?? i.key);
|
|
11
|
+
}
|
|
12
|
+
function b(e, i, r) {
|
|
13
|
+
const d = e.map(
|
|
14
|
+
(c, f) => typeof i == "function" ? i(c, f + r) : l(c, i)
|
|
15
|
+
), s = new Set(d.filter(g)), h = /* @__PURE__ */ new Set();
|
|
16
|
+
return e.map((c, f) => {
|
|
17
|
+
const p = d[f];
|
|
18
|
+
let t = f + r;
|
|
19
|
+
if (g(p) && !h.has(p)) t = p;
|
|
20
|
+
else {
|
|
21
|
+
for (; s.has(t); ) t = "row:" + t;
|
|
22
|
+
s.add(t);
|
|
23
|
+
}
|
|
24
|
+
return h.add(t), { row: c, id: t, index: f + r };
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
function k(e, i, r) {
|
|
28
|
+
const d = new Set(e.map(({ id: t }) => t)), s = /* @__PURE__ */ new Map();
|
|
29
|
+
for (const { row: t, id: o } of e) {
|
|
30
|
+
const n = l(t, i);
|
|
31
|
+
g(n) && n !== o && d.has(n) && s.set(o, n);
|
|
32
|
+
}
|
|
33
|
+
const h = /* @__PURE__ */ new Set();
|
|
34
|
+
for (const { id: t } of e) {
|
|
35
|
+
const o = /* @__PURE__ */ new Set();
|
|
36
|
+
let n = t;
|
|
37
|
+
for (; n !== void 0 && !h.has(n); ) {
|
|
38
|
+
if (o.has(n)) {
|
|
39
|
+
s.delete(n);
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
o.add(n), n = s.get(n);
|
|
43
|
+
}
|
|
44
|
+
for (const a of o) h.add(a);
|
|
45
|
+
}
|
|
46
|
+
const c = /* @__PURE__ */ new Map();
|
|
47
|
+
for (const t of e) {
|
|
48
|
+
const o = s.get(t.id), n = c.get(o);
|
|
49
|
+
n ? n.push(t) : c.set(o, [t]);
|
|
50
|
+
}
|
|
51
|
+
const f = (c.get(void 0) ?? []).map((t) => ({ row: t, depth: 0 })).reverse(), p = [];
|
|
52
|
+
for (; f.length; ) {
|
|
53
|
+
const { row: t, depth: o } = f.pop(), n = c.get(t.id);
|
|
54
|
+
if (p.push({ ...t, depth: o, hasChildren: !!(n != null && n.length) }), n && r.has(t.id))
|
|
55
|
+
for (let a = n.length - 1; a >= 0; a--)
|
|
56
|
+
f.push({ row: n[a], depth: o + 1 });
|
|
57
|
+
}
|
|
58
|
+
return p;
|
|
59
|
+
}
|
|
60
|
+
export {
|
|
61
|
+
l as gridField,
|
|
62
|
+
g as gridKey,
|
|
63
|
+
b as gridRows,
|
|
64
|
+
u as gridToken,
|
|
65
|
+
k as gridTree,
|
|
66
|
+
y as gridValue,
|
|
67
|
+
w as positiveInteger
|
|
68
|
+
};
|