hys-ui 0.2.0 → 0.4.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 +59 -0
- package/README.md +68 -59
- package/dist/components/HysAlert/HysAlert.vue.js +5 -54
- package/dist/components/HysAlert/HysAlert2.vue.js +159 -2
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +5 -41
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber2.vue.js +146 -2
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +2 -2
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +285 -273
- package/dist/components/HysAvatarGroup/HysAvatarGroup.vue.js +1 -1
- package/dist/components/HysAvatarGroup/HysAvatarGroup2.vue.js +102 -98
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +1 -1
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +273 -59
- package/dist/components/HysButton/HysButton.vue.js +2 -2
- package/dist/components/HysButton/HysButton2.vue.js +227 -60
- package/dist/components/HysButtonGroup/HysButtonGroup.vue.js +7 -0
- package/dist/components/HysButtonGroup/HysButtonGroup2.vue.js +51 -0
- package/dist/components/HysCalendar/HysCalendar.vue.js +3 -3
- package/dist/components/HysCalendar/HysCalendar2.vue.js +237 -225
- package/dist/components/HysCascader/HysCascader.vue.js +2 -2
- package/dist/components/HysCascader/HysCascader2.vue.js +337 -324
- 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 +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +239 -217
- 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 +1008 -559
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +2 -0
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +2 -2
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +539 -526
- package/dist/components/HysDateRangePicker/HysDateRangePicker.vue.js +5 -3
- 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/HysFormItem/HysFormItem.vue.js +2 -2
- package/dist/components/HysFormItem/HysFormItem2.vue.js +171 -164
- package/dist/components/HysGantt/HysGantt.vue.js +1 -1
- package/dist/components/HysGantt/HysGantt2.vue.js +810 -795
- package/dist/components/HysMention/HysMention.vue.js +1 -1
- package/dist/components/HysMention/HysMention2.vue.js +1092 -142
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +491 -85
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +243 -180
- 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/HysSearch/HysSearch.vue.js +5 -82
- package/dist/components/HysSearch/HysSearch2.vue.js +176 -2
- package/dist/components/HysSelect/HysSelect.vue.js +2 -2
- package/dist/components/HysSelect/HysSelect2.vue.js +755 -590
- package/dist/components/HysSlider/HysSlider.vue.js +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +192 -188
- package/dist/components/HysSlider/SliderTooltip.vue.js +2 -2
- package/dist/components/HysSlider/SliderTooltip2.vue.js +103 -89
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +315 -58
- package/dist/components/HysSplitPane/HysSplitPane3.vue.js +5 -0
- package/dist/components/HysTable/HysTable.vue.js +2 -2
- package/dist/components/HysTable/HysTable2.vue.js +1416 -1127
- package/dist/components/HysTagInput/HysTagInput.vue.js +5 -82
- package/dist/components/HysTagInput/HysTagInput2.vue.js +396 -2
- 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 +291 -63
- package/dist/components/HysTour/HysTour3.vue.js +5 -0
- package/dist/components/HysTransfer/HysTransfer.vue.js +2 -2
- package/dist/components/HysTransfer/HysTransfer2.vue.js +237 -207
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +1 -1
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +320 -271
- package/dist/components/HysTree/HysTree.vue.js +2 -2
- package/dist/components/HysTree/HysTree2.vue.js +195 -184
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +4 -4
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +389 -377
- package/dist/components/HysUpload/HysUpload.vue.js +2 -2
- package/dist/components/HysUpload/HysUpload2.vue.js +459 -125
- package/dist/components/HysVirtualTable/HysVirtualTable.vue.js +5 -94
- package/dist/components/HysVirtualTable/HysVirtualTable2.vue.js +656 -2
- package/dist/composables/buttonGroup.js +12 -0
- package/dist/composables/color.js +97 -0
- package/dist/composables/dataGrid.js +68 -0
- package/dist/composables/drawer.js +17 -0
- package/dist/composables/feedback.js +14 -0
- package/dist/composables/floatingPosition.js +18 -0
- package/dist/composables/mentionDocument.js +79 -0
- package/dist/composables/mentionEditor.js +58 -0
- package/dist/composables/menu.js +96 -0
- package/dist/composables/modal.js +14 -0
- package/dist/composables/overlayManager.js +48 -18
- package/dist/composables/progress.js +94 -0
- package/dist/composables/selectOptions.js +44 -38
- package/dist/composables/splitPaneSizes.js +58 -0
- package/dist/composables/table.js +128 -105
- package/dist/composables/tagInput.js +16 -0
- package/dist/composables/timeline.js +19 -0
- package/dist/composables/transfer.js +19 -17
- package/dist/composables/upload.js +55 -0
- package/dist/composables/uploadRequest.js +58 -0
- package/dist/composables/useAlert.js +124 -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/useDialog.js +86 -43
- package/dist/composables/useDrawerPush.js +33 -0
- package/dist/composables/useDrawerResize.js +221 -0
- package/dist/composables/useFloating.js +118 -80
- package/dist/composables/useHysModal.js +185 -0
- package/dist/composables/useMentionCaret.js +81 -0
- package/dist/composables/useMentionList.js +81 -0
- package/dist/composables/useMentionModel.js +90 -0
- package/dist/composables/useMentionOptions.js +421 -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/useSplitPaneDrag.js +52 -0
- package/dist/composables/useSplitPaneStorage.js +38 -0
- package/dist/composables/useTable.js +344 -312
- package/dist/composables/useTableSticky.js +79 -0
- package/dist/composables/useTagInput.js +313 -0
- package/dist/composables/useTourLayout.js +129 -0
- package/dist/composables/useTransferMotion.js +185 -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/config.js +11 -11
- package/dist/index.js +175 -153
- package/dist/internal/MultiSplitPane.vue.js +305 -0
- package/dist/internal/MultiSplitPane2.vue.js +4 -0
- 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/HysAlert/HysAlert.vue.d.ts +32 -22
- package/dist/types/components/HysAnimatedNumber/HysAnimatedNumber.vue.d.ts +61 -7
- package/dist/types/components/HysAutocomplete/HysAutocomplete.vue.d.ts +7 -7
- package/dist/types/components/HysAvatarGroup/HysAvatarGroup.vue.d.ts +6 -1
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +3 -3
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +54 -31
- package/dist/types/components/HysButton/HysButton.vue.d.ts +82 -22
- package/dist/types/components/HysButtonGroup/HysButtonGroup.vue.d.ts +30 -0
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +3 -2
- package/dist/types/components/HysCascader/HysCascader.vue.d.ts +7 -7
- package/dist/types/components/HysCascader/HysCascaderColumn.vue.d.ts +2 -2
- 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/HysDatePickerControl.vue.d.ts +3 -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/HysFileManager/HysFileManager.vue.d.ts +2 -2
- package/dist/types/components/HysGantt/HysGantt.vue.d.ts +2 -1
- package/dist/types/components/HysMention/HysMention.vue.d.ts +91 -39
- package/dist/types/components/HysModal/HysModal.vue.d.ts +111 -34
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +2 -2
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +55 -4
- 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/HysRating/HysRating.vue.d.ts +1 -1
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +2 -2
- package/dist/types/components/HysSearch/HysSearch.vue.d.ts +45 -7
- package/dist/types/components/HysSelect/HysSelect.vue.d.ts +19 -5
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +5 -4
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +3 -1
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +125 -14
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +1 -1
- package/dist/types/components/HysTable/HysTable.vue.d.ts +1742 -5
- package/dist/types/components/HysTabs/HysTabs.vue.d.ts +2 -2
- package/dist/types/components/HysTagInput/HysTagInput.vue.d.ts +47 -25
- package/dist/types/components/HysTimeline/HysTimeline.vue.d.ts +19 -32
- package/dist/types/components/HysTooltip/HysTooltip.vue.d.ts +39 -19
- package/dist/types/components/HysTour/HysTour.vue.d.ts +46 -8
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +2 -2
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +5 -3
- package/dist/types/components/HysTree/HysTree.vue.d.ts +2 -2
- 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 +3 -0
- package/dist/types/composables/avatar.d.ts +3 -0
- package/dist/types/composables/buttonGroup.d.ts +9 -0
- package/dist/types/composables/cascader.d.ts +3 -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 +3 -0
- package/dist/types/composables/drawer.d.ts +102 -0
- package/dist/types/composables/feedback.d.ts +98 -0
- package/dist/types/composables/floatingPosition.d.ts +14 -0
- package/dist/types/composables/formContext.d.ts +2 -0
- package/dist/types/composables/mention.d.ts +284 -0
- package/dist/types/composables/mentionDocument.d.ts +15 -0
- package/dist/types/composables/mentionEditor.d.ts +7 -0
- package/dist/types/composables/menu.d.ts +183 -0
- package/dist/types/composables/modal.d.ts +185 -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/selectOptions.d.ts +7 -0
- package/dist/types/composables/splitPaneSizes.d.ts +11 -0
- package/dist/types/composables/table.d.ts +119 -6
- package/dist/types/composables/tagInput.d.ts +96 -0
- package/dist/types/composables/timeline.d.ts +82 -0
- package/dist/types/composables/tour.d.ts +68 -0
- package/dist/types/composables/transfer.d.ts +7 -0
- package/dist/types/composables/tree.d.ts +3 -0
- package/dist/types/composables/treeSelect.d.ts +3 -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 +1 -1
- 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/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 +22 -3
- package/dist/types/composables/useHysModal.d.ts +44 -0
- package/dist/types/composables/useMentionCaret.d.ts +6 -0
- package/dist/types/composables/useMentionList.d.ts +23 -0
- package/dist/types/composables/useMentionModel.d.ts +14 -0
- package/dist/types/composables/useMentionOptions.d.ts +26 -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/useSplitPaneDrag.d.ts +14 -0
- package/dist/types/composables/useSplitPaneStorage.d.ts +4 -0
- package/dist/types/composables/useTable.d.ts +7 -3
- package/dist/types/composables/useTableSticky.d.ts +22 -0
- package/dist/types/composables/useTagInput.d.ts +66 -0
- package/dist/types/composables/useTourLayout.d.ts +33 -0
- package/dist/types/composables/useTransferMotion.d.ts +36 -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/config.d.ts +1 -0
- package/dist/types/index.d.ts +53 -3
- package/dist/types/internal/MultiSplitPane.vue.d.ts +54 -0
- 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 +3 -2
- package/dist/components/HysSplitPane/HysSplitPane2.vue.js +0 -4
- package/dist/components/HysTour/HysTour2.vue.js +0 -4
|
@@ -1,32 +1,52 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as ce, useSlots as de, inject as fe, computed as l, toValue as Y, shallowRef as Z, ref as _, watch as ee, onMounted as ve, onActivated as ye, onBeforeUnmount as be, onDeactivated as he, openBlock as s, createBlock as m, resolveDynamicComponent as S, mergeProps as ge, unref as z, withCtx as me, createElementBlock as w, renderSlot as L, createCommentVNode as H, toDisplayString as ke, createVNode as pe, h as Be, Text as xe, Fragment as Te } from "vue";
|
|
2
|
+
import { LoaderCircle as Ce } from "lucide-vue-next";
|
|
3
|
+
import { useHysConfig as Ae, useHysRootAttrs as Se } from "../../config.js";
|
|
4
|
+
import { useHysControlState as ze } from "../../composables/formContext.js";
|
|
5
|
+
import { useChoiceModel as we } from "../../composables/choiceModel.js";
|
|
6
|
+
import { buttonGroupKey as Le, buttonVariant as Pe, buttonSize as De } from "../../composables/buttonGroup.js";
|
|
7
|
+
import { parseColor as $e, colorRgb as Ie } from "../../composables/color.js";
|
|
8
|
+
const Ee = {
|
|
6
9
|
key: 0,
|
|
7
10
|
class: "hys-ui-button-icon"
|
|
8
|
-
},
|
|
11
|
+
}, He = {
|
|
9
12
|
key: 1,
|
|
10
13
|
class: "hys-ui-button-icon"
|
|
11
|
-
},
|
|
12
|
-
key:
|
|
14
|
+
}, Me = { key: 2 }, Ne = {
|
|
15
|
+
key: 3,
|
|
13
16
|
class: "hys-ui-button-icon"
|
|
14
|
-
},
|
|
17
|
+
}, Ge = /* @__PURE__ */ ce({
|
|
15
18
|
__name: "HysButton",
|
|
16
19
|
props: {
|
|
17
|
-
variant: {
|
|
20
|
+
variant: {},
|
|
18
21
|
size: {},
|
|
19
22
|
disabled: { type: Boolean },
|
|
20
|
-
loading: { type: Boolean },
|
|
23
|
+
loading: { type: [Boolean, Object] },
|
|
24
|
+
loadingIcon: {},
|
|
25
|
+
loadingText: {},
|
|
26
|
+
action: {},
|
|
27
|
+
beforeAction: {},
|
|
28
|
+
actionLoadingDelay: {},
|
|
29
|
+
toggle: { type: Boolean },
|
|
30
|
+
pressed: { type: Boolean, default: void 0 },
|
|
31
|
+
defaultPressed: { type: Boolean },
|
|
21
32
|
plain: { type: Boolean },
|
|
22
33
|
round: { type: Boolean },
|
|
23
34
|
circle: { type: Boolean },
|
|
35
|
+
shape: {},
|
|
24
36
|
block: { type: Boolean },
|
|
25
37
|
dashed: { type: Boolean },
|
|
26
38
|
color: {},
|
|
39
|
+
dark: { type: Boolean, default: void 0 },
|
|
40
|
+
danger: { type: Boolean },
|
|
41
|
+
ghost: { type: Boolean },
|
|
42
|
+
text: { type: Boolean },
|
|
43
|
+
link: { type: Boolean },
|
|
44
|
+
bg: { type: Boolean },
|
|
45
|
+
autoInsertSpace: { type: Boolean, default: void 0 },
|
|
46
|
+
tag: {},
|
|
27
47
|
icon: {},
|
|
28
48
|
iconPosition: { default: "left" },
|
|
29
|
-
type: {
|
|
49
|
+
type: {},
|
|
30
50
|
nativeType: {},
|
|
31
51
|
href: {},
|
|
32
52
|
target: {},
|
|
@@ -35,73 +55,220 @@ const A = {
|
|
|
35
55
|
focusable: { type: Boolean, default: !0 },
|
|
36
56
|
ariaLabel: {}
|
|
37
57
|
},
|
|
38
|
-
emits: ["click"],
|
|
39
|
-
setup(
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
58
|
+
emits: ["click", "update:pressed", "pressedChange", "actionSuccess", "actionError"],
|
|
59
|
+
setup(t, { expose: te, emit: ae }) {
|
|
60
|
+
const a = t, P = de(), b = ae, r = fe(Le, void 0), { disabled: M, size: N } = ze({
|
|
61
|
+
get disabled() {
|
|
62
|
+
return a.disabled || (r == null ? void 0 : r.disabled.value);
|
|
63
|
+
},
|
|
64
|
+
get size() {
|
|
65
|
+
return De(a.size) ?? (r == null ? void 0 : r.size.value);
|
|
66
|
+
}
|
|
67
|
+
}), h = l(() => a.variant ?? Pe(a.type) ?? (r == null ? void 0 : r.variant.value) ?? "primary"), k = l(() => a.link ? "link" : a.text ? "text" : h.value), oe = l(() => a.nativeType ?? (a.type === "submit" || a.type === "reset" ? a.type : "button")), V = Ae(), D = l(() => a.dark ?? Y(V.theme) === "dark"), ne = Se(), p = l(() => a.tag ?? (a.href ? "a" : "button")), B = l(() => p.value === "button"), v = l(() => p.value === "a" || !!a.href && typeof p.value != "string"), j = Z(), x = l(() => {
|
|
68
|
+
const e = j.value, n = e && "$el" in e ? e.$el : e;
|
|
69
|
+
return typeof HTMLElement < "u" && n instanceof HTMLElement ? n : void 0;
|
|
70
|
+
}), y = Z(), T = we({ get modelValue() {
|
|
71
|
+
return a.pressed;
|
|
72
|
+
} }, () => !!a.defaultPressed), R = l(() => a.toggle || a.pressed !== void 0), d = l(() => !!a.loading || !!y.value), c = l(() => M.value || d.value), C = l(() => {
|
|
73
|
+
const e = typeof a.loading == "object" ? a.loading.delay : a.loading ? 0 : a.actionLoadingDelay;
|
|
74
|
+
return typeof e == "number" && Number.isFinite(e) ? Math.max(0, Math.min(3e4, e)) : 0;
|
|
75
|
+
}), f = _(d.value && C.value === 0);
|
|
76
|
+
let $, A = !1;
|
|
77
|
+
function K() {
|
|
78
|
+
clearTimeout($), $ = void 0;
|
|
79
|
+
}
|
|
80
|
+
function I() {
|
|
81
|
+
K(), !d.value || C.value === 0 ? f.value = d.value : A && !f.value && ($ = setTimeout(() => {
|
|
82
|
+
f.value = !0;
|
|
83
|
+
}, C.value));
|
|
84
|
+
}
|
|
85
|
+
ee([d, C], I, { flush: "sync" }), ve(() => {
|
|
86
|
+
A = !0, I();
|
|
87
|
+
}), ye(() => {
|
|
88
|
+
A = !0, I();
|
|
89
|
+
});
|
|
90
|
+
function E() {
|
|
91
|
+
const e = y.value;
|
|
92
|
+
y.value = void 0, e == null || e.abort();
|
|
93
|
+
}
|
|
94
|
+
function O() {
|
|
95
|
+
A = !1, E(), K();
|
|
96
|
+
}
|
|
97
|
+
be(O), he(O);
|
|
98
|
+
const F = {
|
|
99
|
+
danger: "#ed4556",
|
|
100
|
+
success: "#16a46e",
|
|
101
|
+
warning: "#d9860c",
|
|
102
|
+
info: "#697b97"
|
|
103
|
+
}, U = {
|
|
104
|
+
slate: { light: "#475569", dark: "#a5b4c7" },
|
|
105
|
+
blue: { light: "#1d4ed8", dark: "#7cb2ff" },
|
|
106
|
+
indigo: { light: "#4338ca", dark: "#a5aaff" },
|
|
107
|
+
purple: { light: "#7e22ce", dark: "#c4a1ff" },
|
|
108
|
+
cyan: { light: "#0e7490", dark: "#67d7ee" },
|
|
109
|
+
teal: { light: "#0f766e", dark: "#5eead4" },
|
|
110
|
+
green: { light: "#15803d", dark: "#86efac" },
|
|
111
|
+
lime: { light: "#4d7c0f", dark: "#b5df59" },
|
|
112
|
+
amber: { light: "#b45309", dark: "#ffca68" },
|
|
113
|
+
orange: { light: "#c2410c", dark: "#ffab79" },
|
|
114
|
+
red: { light: "#b91c1c", dark: "#ff9090" },
|
|
115
|
+
pink: { light: "#be185d", dark: "#f6a1cf" }
|
|
116
|
+
}, g = l(() => {
|
|
117
|
+
if (!(a.color || a.danger || !Object.hasOwn(U, h.value)))
|
|
118
|
+
return U[h.value][D.value ? "dark" : "light"];
|
|
119
|
+
}), le = l(() => a.color || g.value || (a.danger ? F.danger : F[h.value]) || "var(--hys-ui-primary,var(--hys-ui-theme-primary))"), G = l(() => {
|
|
120
|
+
const e = $e(a.color || g.value);
|
|
121
|
+
if (!e) return;
|
|
122
|
+
const [n, o, i] = Ie(e).map((u) => u <= 0.04045 ? u / 12.92 : ((u + 0.055) / 1.055) ** 2.4);
|
|
123
|
+
return n * 0.2126 + o * 0.7152 + i * 0.0722 > 0.179 ? "#141414" : "#fff";
|
|
124
|
+
}), ie = l(() => (a.autoInsertSpace ?? Y(V.buttonAutoInsertSpace) ?? !1) && k.value !== "text" && k.value !== "link"), q = _(!1);
|
|
125
|
+
function J(e) {
|
|
126
|
+
let n = "";
|
|
127
|
+
for (const o of e)
|
|
128
|
+
if (o.type === xe && typeof o.children == "string") n += o.children;
|
|
129
|
+
else if (o.type === Te && Array.isArray(o.children)) {
|
|
130
|
+
const i = J(o.children);
|
|
131
|
+
if (i === void 0) return;
|
|
132
|
+
n += i;
|
|
133
|
+
} else return;
|
|
134
|
+
return n;
|
|
135
|
+
}
|
|
136
|
+
const ue = ({ hidden: e }) => {
|
|
137
|
+
var u, X;
|
|
138
|
+
const n = ((u = P.default) == null ? void 0 : u.call(P)) ?? [], o = ie.value ? (X = J(n)) == null ? void 0 : X.trim() : void 0, i = !!o && new RegExp("^\\p{Unified_Ideograph}{2}$", "u").test(o);
|
|
139
|
+
return q.value = i, e ? null : i ? Be("span", { class: "hys-ui-button-spaced" }, o) : n;
|
|
140
|
+
};
|
|
141
|
+
function Q() {
|
|
142
|
+
if (R.value)
|
|
143
|
+
return T.commit(!T.current.value, (e) => b("update:pressed", e), (e) => b("pressedChange", e));
|
|
144
|
+
}
|
|
145
|
+
async function re(e, n) {
|
|
146
|
+
const o = new AbortController(), i = { signal: o.signal, event: n, pressed: T.current.value };
|
|
147
|
+
y.value = o;
|
|
148
|
+
try {
|
|
149
|
+
if (a.beforeAction && await a.beforeAction(i) === !1 || o.signal.aborted) return;
|
|
150
|
+
const u = await e(i);
|
|
151
|
+
if (o.signal.aborted) return;
|
|
152
|
+
await Q(), o.signal.aborted || b("actionSuccess", u, i);
|
|
153
|
+
} catch (u) {
|
|
154
|
+
o.signal.aborted || b("actionError", u, i);
|
|
155
|
+
} finally {
|
|
156
|
+
y.value === o && (y.value = void 0);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
ee(M, (e) => {
|
|
160
|
+
e && E();
|
|
161
|
+
}, { flush: "sync" });
|
|
162
|
+
function se(e) {
|
|
163
|
+
if (c.value) {
|
|
164
|
+
e.preventDefault(), e.stopImmediatePropagation();
|
|
44
165
|
return;
|
|
45
166
|
}
|
|
46
|
-
|
|
167
|
+
b("click", e), !e.defaultPrevented && (a.action ? (e.preventDefault(), re(a.action, e)) : Q());
|
|
47
168
|
}
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
ref:
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
type:
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
169
|
+
function W(e, n) {
|
|
170
|
+
const o = e.currentTarget;
|
|
171
|
+
if (!(o instanceof HTMLElement) || e.target !== o || e.isComposing || e.defaultPrevented || o.localName === "button" || o.localName === "a" && o.hasAttribute("href")) return;
|
|
172
|
+
const i = e.key === " " && !v.value;
|
|
173
|
+
!i && e.key !== "Enter" || (e.preventDefault(), !c.value && !e.repeat && (i ? n : !n) && o.click());
|
|
174
|
+
}
|
|
175
|
+
return te({
|
|
176
|
+
element: x,
|
|
177
|
+
ref: x,
|
|
178
|
+
busy: d,
|
|
179
|
+
disabled: c,
|
|
180
|
+
size: N,
|
|
181
|
+
type: h,
|
|
182
|
+
shouldAddSpace: q,
|
|
183
|
+
cancelAction: E,
|
|
184
|
+
focus: () => {
|
|
185
|
+
var e;
|
|
186
|
+
return (e = x.value) == null ? void 0 : e.focus();
|
|
187
|
+
},
|
|
188
|
+
blur: () => {
|
|
189
|
+
var e;
|
|
190
|
+
return (e = x.value) == null ? void 0 : e.blur();
|
|
191
|
+
}
|
|
192
|
+
}), (e, n) => (s(), m(S(p.value), ge({
|
|
193
|
+
ref_key: "root",
|
|
194
|
+
ref: j
|
|
195
|
+
}, z(ne), {
|
|
196
|
+
class: ["hys-ui-btn", ["hys-ui-btn-" + z(N), "hys-ui-button-" + k.value, {
|
|
197
|
+
"hys-ui-button-plain": t.plain,
|
|
198
|
+
"hys-ui-button-round": t.round || t.shape === "round",
|
|
199
|
+
"hys-ui-button-circle": t.circle || t.shape === "circle",
|
|
200
|
+
"hys-ui-button-block": t.block,
|
|
201
|
+
"hys-ui-button-dashed": t.dashed,
|
|
202
|
+
"hys-ui-button-locked": c.value,
|
|
203
|
+
"hys-ui-button-danger-tone": t.danger,
|
|
204
|
+
"hys-ui-button-outline-ghost": t.ghost,
|
|
205
|
+
"hys-ui-button-text-bg": t.bg && k.value === "text",
|
|
206
|
+
"hys-ui-button-palette": g.value,
|
|
207
|
+
"hys-ui-button-palette-dark": g.value && D.value,
|
|
208
|
+
"hys-ui-button-custom-color": t.color,
|
|
209
|
+
"hys-ui-button-custom-dark": t.color && D.value
|
|
210
|
+
}]],
|
|
211
|
+
style: {
|
|
212
|
+
"--hys-ui-button-color": le.value,
|
|
213
|
+
"--hys-ui-button-foreground": G.value,
|
|
214
|
+
"--hys-ui-button-palette-shade": g.value && G.value === "#141414" ? "#fff" : void 0
|
|
215
|
+
},
|
|
216
|
+
type: B.value ? oe.value : void 0,
|
|
217
|
+
href: v.value && !c.value ? t.href : void 0,
|
|
218
|
+
role: v.value ? "link" : B.value ? void 0 : "button",
|
|
219
|
+
target: v.value && t.href ? t.target : void 0,
|
|
220
|
+
rel: v.value && t.href ? t.rel || (t.target === "_blank" ? "noopener noreferrer" : void 0) : void 0,
|
|
221
|
+
disabled: B.value ? c.value : void 0,
|
|
222
|
+
"aria-disabled": c.value || void 0,
|
|
223
|
+
"aria-busy": d.value || void 0,
|
|
224
|
+
"aria-pressed": R.value ? z(T).current.value : void 0,
|
|
225
|
+
"aria-label": t.ariaLabel,
|
|
226
|
+
tabindex: c.value || !t.focusable ? -1 : !B.value && (!v.value || !t.href) ? 0 : void 0,
|
|
227
|
+
autofocus: t.autofocus,
|
|
228
|
+
onClick: se,
|
|
229
|
+
onKeydown: n[0] || (n[0] = (o) => W(o, !1)),
|
|
230
|
+
onKeyup: n[1] || (n[1] = (o) => W(o, !0))
|
|
72
231
|
}), {
|
|
73
|
-
default:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
232
|
+
default: me(() => [
|
|
233
|
+
f.value ? (s(), w("span", Ee, [
|
|
234
|
+
L(e.$slots, "loading", {}, () => [
|
|
235
|
+
t.loadingIcon ? (s(), m(S(t.loadingIcon), {
|
|
236
|
+
key: 0,
|
|
237
|
+
size: 16,
|
|
238
|
+
"aria-hidden": "true"
|
|
239
|
+
})) : (s(), m(z(Ce), {
|
|
240
|
+
key: 1,
|
|
77
241
|
class: "hys-ui-button-spinner",
|
|
78
242
|
size: 16,
|
|
79
243
|
"aria-hidden": "true"
|
|
80
|
-
})
|
|
244
|
+
}))
|
|
81
245
|
], !0)
|
|
82
|
-
])) : (
|
|
83
|
-
|
|
84
|
-
(
|
|
246
|
+
])) : (t.icon || e.$slots.icon) && t.iconPosition === "left" ? (s(), w("span", He, [
|
|
247
|
+
L(e.$slots, "icon", {}, () => [
|
|
248
|
+
(s(), m(S(t.icon), {
|
|
85
249
|
size: 16,
|
|
86
250
|
"aria-hidden": "true"
|
|
87
251
|
}))
|
|
88
252
|
], !0)
|
|
89
|
-
])) :
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
253
|
+
])) : H("", !0),
|
|
254
|
+
f.value && t.loadingText ? (s(), w("span", Me, ke(t.loadingText), 1)) : H("", !0),
|
|
255
|
+
pe(ue, {
|
|
256
|
+
hidden: f.value && !!t.loadingText
|
|
257
|
+
}, null, 8, ["hidden"]),
|
|
258
|
+
!f.value && (t.icon || e.$slots.icon) && t.iconPosition === "right" ? (s(), w("span", Ne, [
|
|
259
|
+
L(e.$slots, "icon", {}, () => [
|
|
260
|
+
(s(), m(S(t.icon), {
|
|
94
261
|
size: 16,
|
|
95
262
|
"aria-hidden": "true"
|
|
96
263
|
}))
|
|
97
264
|
], !0)
|
|
98
|
-
])) :
|
|
99
|
-
|
|
265
|
+
])) : H("", !0),
|
|
266
|
+
L(e.$slots, "suffix", {}, void 0, !0)
|
|
100
267
|
]),
|
|
101
268
|
_: 3
|
|
102
|
-
}, 16, ["class", "style", "type", "href", "role", "target", "rel", "disabled", "aria-disabled", "aria-busy", "aria-label", "tabindex", "autofocus"]));
|
|
269
|
+
}, 16, ["class", "style", "type", "href", "role", "target", "rel", "disabled", "aria-disabled", "aria-busy", "aria-pressed", "aria-label", "tabindex", "autofocus"]));
|
|
103
270
|
}
|
|
104
271
|
});
|
|
105
272
|
export {
|
|
106
|
-
|
|
273
|
+
Ge as default
|
|
107
274
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as d, inject as b, provide as p, computed as a, openBlock as c, createElementBlock as y, mergeProps as m, unref as r, renderSlot as g } from "vue";
|
|
2
|
+
import { useHysRootAttrs as f } from "../../config.js";
|
|
3
|
+
import { buttonGroupKey as u, buttonSize as v, buttonVariant as h } from "../../composables/buttonGroup.js";
|
|
4
|
+
import { useHysControlState as B } from "../../composables/formContext.js";
|
|
5
|
+
const k = ["aria-label", "aria-disabled"], S = /* @__PURE__ */ d({
|
|
6
|
+
__name: "HysButtonGroup",
|
|
7
|
+
props: {
|
|
8
|
+
variant: {},
|
|
9
|
+
size: {},
|
|
10
|
+
type: {},
|
|
11
|
+
direction: { default: "horizontal" },
|
|
12
|
+
joined: { type: Boolean, default: !0 },
|
|
13
|
+
gap: { default: 8 },
|
|
14
|
+
wrap: { type: Boolean },
|
|
15
|
+
block: { type: Boolean },
|
|
16
|
+
disabled: { type: Boolean },
|
|
17
|
+
ariaLabel: {}
|
|
18
|
+
},
|
|
19
|
+
setup(o) {
|
|
20
|
+
const t = o, n = f(), e = b(u, void 0), { disabled: i } = B({
|
|
21
|
+
get disabled() {
|
|
22
|
+
return t.disabled || (e == null ? void 0 : e.disabled.value);
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
p(u, {
|
|
26
|
+
variant: a(() => t.variant ?? h(t.type) ?? (e == null ? void 0 : e.variant.value)),
|
|
27
|
+
size: a(() => v(t.size) ?? (e == null ? void 0 : e.size.value)),
|
|
28
|
+
disabled: i
|
|
29
|
+
});
|
|
30
|
+
const l = a(() => typeof t.gap == "number" ? (Number.isFinite(t.gap) ? Math.max(0, t.gap) : 8) + "px" : t.gap);
|
|
31
|
+
return (s, z) => (c(), y("div", m(r(n), {
|
|
32
|
+
role: "group",
|
|
33
|
+
"aria-label": o.ariaLabel,
|
|
34
|
+
"aria-disabled": r(i) || void 0,
|
|
35
|
+
class: ["hys-ui-button-group", [
|
|
36
|
+
"hys-ui-button-group-" + o.direction,
|
|
37
|
+
{
|
|
38
|
+
"hys-ui-button-group-joined": o.joined,
|
|
39
|
+
"hys-ui-button-group-wrap": o.wrap && !o.joined,
|
|
40
|
+
"hys-ui-button-group-block": o.block
|
|
41
|
+
}
|
|
42
|
+
]],
|
|
43
|
+
style: { "--hys-ui-button-group-gap": l.value }
|
|
44
|
+
}), [
|
|
45
|
+
g(s.$slots, "default", {}, void 0, !0)
|
|
46
|
+
], 16, k));
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
S as default
|
|
51
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysCalendar2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
|
-
import
|
|
4
|
-
const
|
|
3
|
+
import a from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const p = /* @__PURE__ */ a(o, [["__scopeId", "data-v-54c6a7d5"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|