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,232 +1,254 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
1
|
+
import { defineComponent as A, computed as v, openBlock as i, createElementBlock as n, mergeProps as w, unref as t, Fragment as E, renderSlot as u, normalizeProps as d, guardReactiveProps as p, createElementVNode as m, normalizeStyle as D, toDisplayString as C, createCommentVNode as s, createVNode as T, withKeys as F, withModifiers as H, createBlock as y, createSlots as $, withCtx as f, Teleport as K } from "vue";
|
|
2
|
+
import { ChevronDown as L } from "lucide-vue-next";
|
|
3
|
+
import P from "./HysColorPanel.vue.js";
|
|
4
|
+
import N from "../../motion/PopupMotion.js";
|
|
5
|
+
import { useHysRootAttrs as M } from "../../config.js";
|
|
6
|
+
import { useColorPicker as R } from "../../composables/useColorPicker.js";
|
|
7
|
+
import { parseColor as W, colorCss as q } from "../../composables/color.js";
|
|
8
|
+
const G = ["data-status"], J = {
|
|
9
|
+
key: 1,
|
|
10
|
+
class: "hys-ui-pf-color-control"
|
|
11
|
+
}, Q = ["id", "aria-label", "aria-controls", "aria-expanded", "disabled", "tabindex"], U = { class: "hys-ui-pf-color-chip" }, X = {
|
|
7
12
|
key: 0,
|
|
8
|
-
class: "hys-ui-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
class: "hys-ui-pf-color-presets",
|
|
12
|
-
role: "group",
|
|
13
|
-
"aria-label": "常用颜色"
|
|
14
|
-
}, be = ["aria-label", "aria-pressed", "onClick"], Me = /* @__PURE__ */ Q({
|
|
13
|
+
class: "hys-ui-color-value"
|
|
14
|
+
}, Y = ["id", "value", "aria-label", "aria-invalid", "aria-describedby", "disabled", "readonly"], Z = ["id"], _ = ["name", "form", "value"], ne = /* @__PURE__ */ A({
|
|
15
|
+
inheritAttrs: !1,
|
|
15
16
|
__name: "HysColorPicker",
|
|
16
17
|
props: {
|
|
17
|
-
modelValue: {},
|
|
18
|
+
modelValue: { default: void 0 },
|
|
19
|
+
defaultValue: {},
|
|
18
20
|
disabled: { type: Boolean },
|
|
21
|
+
readonly: { type: Boolean },
|
|
22
|
+
size: {},
|
|
19
23
|
label: {},
|
|
24
|
+
ariaLabel: {},
|
|
20
25
|
presets: {},
|
|
21
|
-
clearable: { type: Boolean }
|
|
26
|
+
clearable: { type: Boolean },
|
|
27
|
+
showAlpha: { type: Boolean },
|
|
28
|
+
format: {},
|
|
29
|
+
immediate: { type: Boolean, default: !0 },
|
|
30
|
+
showInput: { type: Boolean, default: !0 },
|
|
31
|
+
showText: { type: Boolean },
|
|
32
|
+
showPresets: { type: Boolean, default: !0 },
|
|
33
|
+
inline: { type: Boolean },
|
|
34
|
+
open: { type: Boolean, default: void 0 },
|
|
35
|
+
defaultOpen: { type: Boolean },
|
|
36
|
+
placement: { default: "bottom-start" },
|
|
37
|
+
appendTo: { type: [String, Boolean], default: "body" },
|
|
38
|
+
popupClass: {},
|
|
39
|
+
popupStyle: {},
|
|
40
|
+
popupWidth: { default: 288 },
|
|
41
|
+
showFooter: { type: Boolean, default: !0 },
|
|
42
|
+
confirmText: {},
|
|
43
|
+
cancelText: {},
|
|
44
|
+
clearText: {},
|
|
45
|
+
status: {},
|
|
46
|
+
error: {},
|
|
47
|
+
name: {},
|
|
48
|
+
form: {},
|
|
49
|
+
tabindex: {},
|
|
50
|
+
autofocus: { type: Boolean },
|
|
51
|
+
validateEvent: { type: Boolean, default: !0 },
|
|
52
|
+
inputProps: {},
|
|
53
|
+
popupTransition: {},
|
|
54
|
+
popupTransitionDuration: {}
|
|
22
55
|
},
|
|
23
|
-
emits: ["update:modelValue"],
|
|
24
|
-
setup(
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
e.preventDefault();
|
|
81
|
-
const a = e.currentTarget;
|
|
82
|
-
a.focus(), a.setPointerCapture(e.pointerId), T(e, t);
|
|
83
|
-
}
|
|
84
|
-
function I(e, t) {
|
|
85
|
-
e.currentTarget.hasPointerCapture(e.pointerId) && T(e, t);
|
|
86
|
-
}
|
|
87
|
-
function C(e) {
|
|
88
|
-
const t = e.currentTarget;
|
|
89
|
-
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId);
|
|
90
|
-
}
|
|
91
|
-
function K(e, t) {
|
|
92
|
-
if (i.value || !["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(e.key)) return;
|
|
93
|
-
e.preventDefault();
|
|
94
|
-
const a = e.shiftKey ? 10 : 1;
|
|
95
|
-
if (t === "hue") {
|
|
96
|
-
const l = e.key === "ArrowLeft" || e.key === "ArrowDown" ? -a : a;
|
|
97
|
-
d.value = e.key === "Home" ? 0 : e.key === "End" ? 359 : Math.max(0, Math.min(359, d.value + l));
|
|
98
|
-
} else
|
|
99
|
-
e.key === "ArrowLeft" && (r.value = Math.max(0, r.value - a)), e.key === "ArrowRight" && (r.value = Math.min(100, r.value + a)), e.key === "ArrowUp" && (u.value = Math.min(100, u.value + a)), e.key === "ArrowDown" && (u.value = Math.max(0, u.value - a)), e.key === "Home" && (r.value = 0), e.key === "End" && (r.value = 100);
|
|
100
|
-
x();
|
|
101
|
-
}
|
|
102
|
-
return U(() => i.value, (e) => {
|
|
103
|
-
e && w();
|
|
104
|
-
}), (e, t) => (p(), b("div", z(n(R), { class: "hys-ui-pf-color-picker" }), [
|
|
105
|
-
o("div", de, [
|
|
106
|
-
o("button", {
|
|
107
|
-
ref_key: "trigger",
|
|
108
|
-
ref: S,
|
|
109
|
-
type: "button",
|
|
110
|
-
class: "hys-ui-pf-color-trigger",
|
|
111
|
-
"aria-label": m.label || "选择颜色",
|
|
112
|
-
"aria-haspopup": "dialog",
|
|
113
|
-
"aria-expanded": n(D),
|
|
114
|
-
disabled: n(i),
|
|
115
|
-
onClick: J
|
|
116
|
-
}, [
|
|
117
|
-
o("span", {
|
|
118
|
-
class: "hys-ui-pf-color-chip",
|
|
119
|
-
style: k({ background: m.modelValue ? f.value : "transparent" })
|
|
120
|
-
}, null, 4),
|
|
121
|
-
W(n(ie), {
|
|
122
|
-
size: 14,
|
|
123
|
-
"aria-hidden": "true"
|
|
124
|
-
})
|
|
125
|
-
], 8, fe),
|
|
126
|
-
Z(o("input", {
|
|
127
|
-
"onUpdate:modelValue": t[0] || (t[0] = (a) => s.value = a),
|
|
128
|
-
class: "hys-ui-pf-color-hex",
|
|
129
|
-
"aria-label": "十六进制颜色",
|
|
130
|
-
"aria-invalid": !B.value,
|
|
131
|
-
disabled: n(i),
|
|
132
|
-
maxlength: "7",
|
|
133
|
-
spellcheck: "false",
|
|
134
|
-
onChange: $,
|
|
135
|
-
onKeydown: _($, ["enter"])
|
|
136
|
-
}, null, 40, ce), [
|
|
137
|
-
[ee, s.value]
|
|
138
|
-
])
|
|
139
|
-
]),
|
|
140
|
-
B.value ? P("", !0) : (p(), b("small", pe, "请输入 #RRGGBB 格式")),
|
|
141
|
-
(p(), N(te, { to: "body" }, [
|
|
142
|
-
n(D) ? (p(), b("div", z({ key: 0 }, n(R), {
|
|
143
|
-
ref_key: "panel",
|
|
144
|
-
ref: A,
|
|
145
|
-
class: "hys-ui-v4-menu hys-ui-pf-color-panel",
|
|
146
|
-
style: n(G),
|
|
147
|
-
role: "dialog",
|
|
148
|
-
"aria-label": m.label || "选择颜色"
|
|
149
|
-
}), [
|
|
150
|
-
o("header", null, [
|
|
151
|
-
t[9] || (t[9] = o("strong", null, "选择颜色", -1)),
|
|
152
|
-
o("code", null, ae(f.value.toUpperCase()), 1)
|
|
153
|
-
]),
|
|
154
|
-
o("div", {
|
|
155
|
-
class: "hys-ui-pf-color-palette",
|
|
156
|
-
role: "slider",
|
|
157
|
-
tabindex: "0",
|
|
158
|
-
"aria-label": "饱和度与亮度",
|
|
159
|
-
"aria-valuemin": "0",
|
|
160
|
-
"aria-valuemax": "100",
|
|
161
|
-
"aria-valuenow": Math.round(r.value),
|
|
162
|
-
"aria-valuetext": "饱和度 " + Math.round(r.value) + "%,亮度 " + Math.round(u.value) + "%",
|
|
163
|
-
style: k({ backgroundColor: "hsl(" + d.value + ",100%,50%)" }),
|
|
164
|
-
onPointerdown: t[1] || (t[1] = (a) => E(a, "palette")),
|
|
165
|
-
onPointermove: t[2] || (t[2] = (a) => I(a, "palette")),
|
|
166
|
-
onPointerup: C,
|
|
167
|
-
onPointercancel: C,
|
|
168
|
-
onKeydown: t[3] || (t[3] = (a) => K(a, "palette"))
|
|
169
|
-
}, [
|
|
170
|
-
o("span", {
|
|
171
|
-
class: "hys-ui-pf-color-cursor",
|
|
172
|
-
style: k({ left: r.value + "%", top: 100 - u.value + "%", background: f.value })
|
|
173
|
-
}, null, 4)
|
|
174
|
-
], 44, ye),
|
|
175
|
-
o("div", {
|
|
176
|
-
class: "hys-ui-pf-color-hue",
|
|
177
|
-
role: "slider",
|
|
178
|
-
tabindex: "0",
|
|
179
|
-
"aria-label": "色相",
|
|
180
|
-
"aria-valuemin": "0",
|
|
181
|
-
"aria-valuemax": "359",
|
|
182
|
-
"aria-valuenow": Math.round(d.value),
|
|
183
|
-
onPointerdown: t[4] || (t[4] = (a) => E(a, "hue")),
|
|
184
|
-
onPointermove: t[5] || (t[5] = (a) => I(a, "hue")),
|
|
185
|
-
onPointerup: C,
|
|
186
|
-
onPointercancel: C,
|
|
187
|
-
onKeydown: t[6] || (t[6] = (a) => K(a, "hue"))
|
|
56
|
+
emits: ["update:modelValue", "update:open", "change", "activeChange", "visibleChange", "confirm", "cancel", "clear", "invalid", "focus", "blur"],
|
|
57
|
+
setup(l, { expose: I, emit: x }) {
|
|
58
|
+
const c = l, O = x, S = M(), e = R(
|
|
59
|
+
c,
|
|
60
|
+
(a, ...r) => O(a, ...r)
|
|
61
|
+
), V = v(() => {
|
|
62
|
+
const a = W(e.value.value);
|
|
63
|
+
return a ? q(a) : "transparent";
|
|
64
|
+
}), b = (a) => a === "id" || a.startsWith("aria-") || a === "required", j = v(
|
|
65
|
+
() => Object.fromEntries(
|
|
66
|
+
Object.entries(e.attrs).filter(([a]) => !b(a))
|
|
67
|
+
)
|
|
68
|
+
), z = v(
|
|
69
|
+
() => Object.fromEntries(
|
|
70
|
+
Object.entries(e.attrs).filter(([a]) => b(a))
|
|
71
|
+
)
|
|
72
|
+
);
|
|
73
|
+
return I({
|
|
74
|
+
element: e.element,
|
|
75
|
+
input: e.input,
|
|
76
|
+
panel: e.panel,
|
|
77
|
+
value: e.value,
|
|
78
|
+
draft: e.draft,
|
|
79
|
+
color: v(() => ({ ...e.working.value })),
|
|
80
|
+
open: e.open,
|
|
81
|
+
focus: e.focus,
|
|
82
|
+
blur: e.blur,
|
|
83
|
+
show: e.show,
|
|
84
|
+
hide: e.hide,
|
|
85
|
+
confirm: e.confirm,
|
|
86
|
+
cancel: e.cancel,
|
|
87
|
+
clear: e.clear,
|
|
88
|
+
setColor: e.setColor
|
|
89
|
+
}), (a, r) => {
|
|
90
|
+
var h, g, k, B;
|
|
91
|
+
return i(), n("div", w({
|
|
92
|
+
ref: (o) => t(e).element.value = o
|
|
93
|
+
}, { ...t(S), ...j.value }, {
|
|
94
|
+
class: ["hys-ui-pf-color-picker", [
|
|
95
|
+
"hys-ui-color-picker-" + t(e).control.size.value,
|
|
96
|
+
{
|
|
97
|
+
"hys-ui-color-disabled": t(e).control.disabled.value,
|
|
98
|
+
"hys-ui-color-focused": t(e).focused.value
|
|
99
|
+
}
|
|
100
|
+
]],
|
|
101
|
+
"data-status": t(e).status.value,
|
|
102
|
+
onFocusin: r[4] || (r[4] = //@ts-ignore
|
|
103
|
+
(...o) => t(e).focusIn && t(e).focusIn(...o)),
|
|
104
|
+
onFocusout: r[5] || (r[5] = //@ts-ignore
|
|
105
|
+
(...o) => t(e).focusOut && t(e).focusOut(...o))
|
|
106
|
+
}), [
|
|
107
|
+
l.inline ? s("", !0) : (i(), n(E, { key: 0 }, [
|
|
108
|
+
a.$slots.trigger ? (i(), n("span", {
|
|
109
|
+
key: 0,
|
|
110
|
+
ref: (o) => t(e).trigger.value = o,
|
|
111
|
+
class: "hys-ui-color-custom-trigger",
|
|
112
|
+
tabindex: "-1"
|
|
188
113
|
}, [
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
o("div", ve, [
|
|
194
|
-
(p(!0), b(le, null, oe(y.presets || X, (a) => (p(), b("button", {
|
|
195
|
-
key: a,
|
|
114
|
+
u(a.$slots, "trigger", d(p(t(e).context.value)), void 0, !0)
|
|
115
|
+
], 512)) : (i(), n("div", J, [
|
|
116
|
+
m("button", {
|
|
117
|
+
ref: (o) => t(e).trigger.value = o,
|
|
196
118
|
type: "button",
|
|
197
|
-
"
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
119
|
+
class: "hys-ui-pf-color-trigger",
|
|
120
|
+
id: l.showInput ? void 0 : t(e).attrs.id || ((h = t(e).field) == null ? void 0 : h.id.value),
|
|
121
|
+
"aria-label": l.ariaLabel || t(e).attrs["aria-label"] || l.label || ((g = t(e).field) == null ? void 0 : g.label.value) || "选择颜色",
|
|
122
|
+
"aria-haspopup": "dialog",
|
|
123
|
+
"aria-controls": t(e).open.value ? t(e).panelId : void 0,
|
|
124
|
+
"aria-expanded": t(e).open.value,
|
|
125
|
+
disabled: t(e).control.disabled.value,
|
|
126
|
+
tabindex: l.tabindex,
|
|
127
|
+
onClick: r[0] || (r[0] = (o) => t(e).open.value ? t(e).hide() : t(e).show())
|
|
201
128
|
}, [
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
129
|
+
m("span", U, [
|
|
130
|
+
m("span", {
|
|
131
|
+
style: D({ background: V.value })
|
|
132
|
+
}, null, 4)
|
|
133
|
+
]),
|
|
134
|
+
l.showText ? (i(), n("span", X, C(t(e).value.value || "选择颜色"), 1)) : s("", !0),
|
|
135
|
+
T(t(L), {
|
|
136
|
+
size: 14,
|
|
206
137
|
"aria-hidden": "true"
|
|
207
|
-
}
|
|
208
|
-
],
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
138
|
+
})
|
|
139
|
+
], 8, Q),
|
|
140
|
+
l.showInput ? (i(), n("input", w({
|
|
141
|
+
key: 0,
|
|
142
|
+
ref: (o) => t(e).input.value = o
|
|
143
|
+
}, { ...l.inputProps, ...z.value }, {
|
|
144
|
+
class: "hys-ui-pf-color-hex",
|
|
145
|
+
id: t(e).attrs.id || ((k = t(e).field) == null ? void 0 : k.id.value),
|
|
146
|
+
"data-hys-ui-field-managed": "",
|
|
147
|
+
value: t(e).draft.value,
|
|
148
|
+
"aria-label": l.ariaLabel || t(e).attrs["aria-label"] || (l.label ? l.label + " 颜色值" : t(e).format.value === "hex" ? "十六进制颜色" : "颜色值"),
|
|
149
|
+
"aria-invalid": t(e).status.value === "error" || void 0,
|
|
150
|
+
"aria-describedby": [
|
|
151
|
+
t(e).attrs["aria-describedby"],
|
|
152
|
+
(B = t(e).field) == null ? void 0 : B.describedBy.value,
|
|
153
|
+
l.error ? t(e).errorId : void 0
|
|
154
|
+
].filter(Boolean).join(" ") || void 0,
|
|
155
|
+
disabled: t(e).control.disabled.value,
|
|
156
|
+
readonly: l.readonly,
|
|
157
|
+
spellcheck: "false",
|
|
158
|
+
autocomplete: "off",
|
|
159
|
+
onInput: r[1] || (r[1] = (o) => t(e).draft.value = o.target.value),
|
|
160
|
+
onChange: r[2] || (r[2] = //@ts-ignore
|
|
161
|
+
(...o) => t(e).commitText && t(e).commitText(...o)),
|
|
162
|
+
onKeydown: r[3] || (r[3] = F(H((o) => l.immediate === !1 ? t(e).confirm() : t(e).commitText(), ["prevent"]), ["enter"]))
|
|
163
|
+
}), null, 16, Y)) : s("", !0)
|
|
164
|
+
]))
|
|
165
|
+
], 64)),
|
|
166
|
+
l.error || !t(e).valid.value ? (i(), n("small", {
|
|
167
|
+
key: 1,
|
|
168
|
+
id: t(e).errorId,
|
|
169
|
+
class: "hys-ui-pf-color-error",
|
|
170
|
+
role: "alert"
|
|
171
|
+
}, C(l.error || "请输入有效的颜色值"), 9, Z)) : s("", !0),
|
|
172
|
+
l.inline && t(e).live.value ? (i(), y(P, {
|
|
173
|
+
key: 2,
|
|
174
|
+
state: t(e),
|
|
175
|
+
options: c
|
|
176
|
+
}, $({ _: 2 }, [
|
|
177
|
+
a.$slots.header ? {
|
|
178
|
+
name: "header",
|
|
179
|
+
fn: f((o) => [
|
|
180
|
+
u(a.$slots, "header", d(p(o)), void 0, !0)
|
|
181
|
+
]),
|
|
182
|
+
key: "0"
|
|
183
|
+
} : void 0,
|
|
184
|
+
a.$slots.footer ? {
|
|
185
|
+
name: "footer",
|
|
186
|
+
fn: f((o) => [
|
|
187
|
+
u(a.$slots, "footer", d(p(o)), void 0, !0)
|
|
188
|
+
]),
|
|
189
|
+
key: "1"
|
|
190
|
+
} : void 0,
|
|
191
|
+
a.$slots.preset ? {
|
|
192
|
+
name: "preset",
|
|
193
|
+
fn: f((o) => [
|
|
194
|
+
u(a.$slots, "preset", d(p(o)), void 0, !0)
|
|
195
|
+
]),
|
|
196
|
+
key: "2"
|
|
197
|
+
} : void 0
|
|
198
|
+
]), 1032, ["state"])) : s("", !0),
|
|
199
|
+
!l.inline && t(e).live.value ? (i(), y(K, {
|
|
200
|
+
key: 3,
|
|
201
|
+
to: t(e).teleportTo.value,
|
|
202
|
+
disabled: l.appendTo === !1
|
|
203
|
+
}, [
|
|
204
|
+
T(t(N), {
|
|
205
|
+
"popup-transition": l.popupTransition,
|
|
206
|
+
"popup-transition-duration": l.popupTransitionDuration,
|
|
207
|
+
placement: t(e).floating.placement.value
|
|
208
|
+
}, {
|
|
209
|
+
default: f(() => [
|
|
210
|
+
t(e).floating.open.value ? (i(), y(P, {
|
|
211
|
+
key: 0,
|
|
212
|
+
state: t(e),
|
|
213
|
+
options: c
|
|
214
|
+
}, $({ _: 2 }, [
|
|
215
|
+
a.$slots.header ? {
|
|
216
|
+
name: "header",
|
|
217
|
+
fn: f((o) => [
|
|
218
|
+
u(a.$slots, "header", d(p(o)), void 0, !0)
|
|
219
|
+
]),
|
|
220
|
+
key: "0"
|
|
221
|
+
} : void 0,
|
|
222
|
+
a.$slots.footer ? {
|
|
223
|
+
name: "footer",
|
|
224
|
+
fn: f((o) => [
|
|
225
|
+
u(a.$slots, "footer", d(p(o)), void 0, !0)
|
|
226
|
+
]),
|
|
227
|
+
key: "1"
|
|
228
|
+
} : void 0,
|
|
229
|
+
a.$slots.preset ? {
|
|
230
|
+
name: "preset",
|
|
231
|
+
fn: f((o) => [
|
|
232
|
+
u(a.$slots, "preset", d(p(o)), void 0, !0)
|
|
233
|
+
]),
|
|
234
|
+
key: "2"
|
|
235
|
+
} : void 0
|
|
236
|
+
]), 1032, ["state"])) : s("", !0)
|
|
237
|
+
]),
|
|
238
|
+
_: 3
|
|
239
|
+
}, 8, ["popup-transition", "popup-transition-duration", "placement"])
|
|
240
|
+
], 8, ["to", "disabled"])) : s("", !0),
|
|
241
|
+
l.name && !t(e).control.disabled.value ? (i(), n("input", {
|
|
242
|
+
key: 4,
|
|
243
|
+
type: "hidden",
|
|
244
|
+
name: l.name,
|
|
245
|
+
form: l.form,
|
|
246
|
+
value: t(e).value.value
|
|
247
|
+
}, null, 8, _)) : s("", !0)
|
|
248
|
+
], 16, G);
|
|
249
|
+
};
|
|
228
250
|
}
|
|
229
251
|
});
|
|
230
252
|
export {
|
|
231
|
-
|
|
253
|
+
ne as default
|
|
232
254
|
};
|