hys-ui 0.1.0 → 0.2.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 +137 -1
- package/README.md +18 -6
- 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 +14 -14
- package/dist/components/HysAnimatedNumber/HysAnimatedNumber.vue.js +23 -20
- package/dist/components/HysAutocomplete/HysAutocomplete.vue.js +7 -0
- package/dist/components/HysAutocomplete/HysAutocomplete2.vue.js +627 -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 +252 -0
- package/dist/components/HysBadge/HysBadge.vue.js +2 -2
- package/dist/components/HysBadge/HysBadge2.vue.js +154 -26
- package/dist/components/HysBreadcrumb/HysBreadcrumb.vue.js +5 -38
- package/dist/components/HysBreadcrumb/HysBreadcrumb2.vue.js +74 -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 -84
- package/dist/components/HysCalendar/HysCalendar2.vue.js +803 -2
- package/dist/components/HysCard/HysCard.vue.js +1 -1
- package/dist/components/HysCard/HysCard2.vue.js +177 -44
- package/dist/components/HysCascader/HysCascader.vue.js +5 -182
- package/dist/components/HysCascader/HysCascader2.vue.js +760 -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 +5 -39
- package/dist/components/HysCheckbox/HysCheckbox2.vue.js +200 -2
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup.vue.js +7 -0
- package/dist/components/HysCheckboxGroup/HysCheckboxGroup2.vue.js +237 -0
- package/dist/components/HysColorPicker/HysColorPicker.vue.js +2 -2
- package/dist/components/HysColorPicker/HysColorPicker2.vue.js +107 -106
- package/dist/components/HysCommandPalette/HysCommandPalette.vue.js +52 -51
- package/dist/components/HysCommentEditor/HysCommentEditor.vue.js +17 -17
- package/dist/components/HysDataGrid/HysDataGrid.vue.js +1 -1
- package/dist/components/HysDataGrid/HysDataGrid2.vue.js +397 -390
- package/dist/components/HysDatePicker/HysDatePicker.vue.js +268 -139
- package/dist/components/HysDatePicker/HysDatePickerControl.vue.js +7 -0
- package/dist/components/HysDatePicker/HysDatePickerControl2.vue.js +807 -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 +268 -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 +55 -54
- package/dist/components/HysFileManager/HysFileManager.vue.js +5 -63
- package/dist/components/HysFileManager/HysFileManager2.vue.js +86 -2
- package/dist/components/HysForm/HysForm.vue.js +3 -3
- package/dist/components/HysForm/HysForm2.vue.js +580 -92
- package/dist/components/HysFormItem/HysFormItem.vue.js +5 -69
- package/dist/components/HysFormItem/HysFormItem2.vue.js +521 -2
- package/dist/components/HysGantt/HysGantt.vue.js +5 -264
- package/dist/components/HysGantt/HysGantt2.vue.js +1399 -2
- package/dist/components/HysInput/HysInput.vue.js +2 -2
- package/dist/components/HysInput/HysInput2.vue.js +468 -120
- package/dist/components/HysMention/HysMention.vue.js +2 -2
- package/dist/components/HysMention/HysMention2.vue.js +89 -88
- package/dist/components/HysModal/HysModal.vue.js +2 -2
- package/dist/components/HysModal/HysModal2.vue.js +35 -35
- package/dist/components/HysNotificationCenter/HysNotificationCenter.vue.js +37 -36
- package/dist/components/HysNumberInput/HysNumberInput.vue.js +2 -2
- package/dist/components/HysNumberInput/HysNumberInput2.vue.js +561 -70
- package/dist/components/HysOrgTree/HysOrgTree.vue.js +41 -36
- package/dist/components/HysPagination/HysPagination.vue.js +2 -2
- package/dist/components/HysPagination/HysPagination2.vue.js +93 -91
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix.vue.js +5 -41
- package/dist/components/HysPermissionMatrix/HysPermissionMatrix2.vue.js +101 -2
- 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 +5 -40
- package/dist/components/HysRadioGroup/HysRadioGroup2.vue.js +205 -2
- package/dist/components/HysRating/HysRating.vue.js +1 -1
- package/dist/components/HysRating/HysRating2.vue.js +288 -68
- package/dist/components/HysResizablePanel/HysResizablePanel.vue.js +46 -28
- package/dist/components/HysRichTextEditor/HysRichTextEditor.vue.js +2 -2
- package/dist/components/HysRichTextEditor/HysRichTextEditor2.vue.js +87 -67
- package/dist/components/HysSearch/HysSearch.vue.js +50 -38
- package/dist/components/HysSegmented/HysSegmented.vue.js +5 -58
- 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 +859 -164
- 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 +2 -2
- package/dist/components/HysSlider/HysSlider2.vue.js +532 -59
- package/dist/components/HysSlider/SliderTooltip.vue.js +7 -0
- package/dist/components/HysSlider/SliderTooltip2.vue.js +156 -0
- package/dist/components/HysSplitPane/HysSplitPane.vue.js +48 -42
- package/dist/components/HysSteps/HysSteps.vue.js +2 -2
- package/dist/components/HysSteps/HysSteps2.vue.js +111 -36
- package/dist/components/HysSwitch/HysSwitch.vue.js +2 -2
- package/dist/components/HysSwitch/HysSwitch2.vue.js +235 -42
- package/dist/components/HysTable/HysTable.vue.js +1 -1
- package/dist/components/HysTable/HysTable2.vue.js +1471 -82
- 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 -66
- package/dist/components/HysTagInput/HysTagInput.vue.js +43 -42
- package/dist/components/HysTextarea/HysTextarea.vue.js +137 -66
- package/dist/components/HysToast/HysToast.vue.js +2 -2
- package/dist/components/HysToast/HysToast2.vue.js +121 -38
- package/dist/components/HysTour/HysTour.vue.js +47 -42
- package/dist/components/HysTransfer/HysTransfer.vue.js +5 -207
- package/dist/components/HysTransfer/HysTransfer2.vue.js +416 -2
- package/dist/components/HysTransfer/HysTransferPanel.vue.js +7 -0
- package/dist/components/HysTransfer/HysTransferPanel2.vue.js +454 -0
- package/dist/components/HysTree/HysTree.vue.js +2 -3
- package/dist/components/HysTree/HysTree2.vue.js +641 -301
- package/dist/components/HysTreeSelect/HysTreeSelect.vue.js +5 -129
- package/dist/components/HysTreeSelect/HysTreeSelect2.vue.js +558 -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 +97 -78
- 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/datePicker.js +227 -0
- package/dist/composables/formContext.js +94 -3
- package/dist/composables/formLayout.js +57 -0
- package/dist/composables/formValidation.js +240 -0
- package/dist/composables/ganttConflicts.js +143 -0
- package/dist/composables/numberInput.js +91 -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/textInput.js +34 -0
- package/dist/composables/toastEscape.js +16 -0
- package/dist/composables/transfer.js +63 -0
- package/dist/composables/tree.js +118 -0
- package/dist/composables/treeSelect.js +71 -0
- package/dist/composables/useCascader.js +438 -0
- package/dist/composables/useDatePicker.js +425 -0
- package/dist/composables/useDialog.js +16 -16
- package/dist/composables/useFloating.js +98 -52
- package/dist/composables/useGanttDependencies.js +306 -0
- package/dist/composables/useGanttHistory.js +157 -0
- package/dist/composables/useGanttLabelResize.js +100 -0
- package/dist/composables/useHysToast.js +148 -0
- package/dist/composables/useTable.js +474 -0
- package/dist/composables/useTextareaSize.js +72 -0
- package/dist/composables/useTransfer.js +257 -0
- package/dist/composables/useTree.js +439 -0
- package/dist/composables/useTreeSelect.js +361 -0
- package/dist/config.js +18 -15
- package/dist/index.js +149 -136
- package/dist/style.css +1 -1
- package/dist/types/components/HysAccordion/HysAccordion.vue.d.ts +61 -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 +99 -0
- package/dist/types/components/HysBadge/HysBadge.vue.d.ts +41 -4
- package/dist/types/components/HysBreadcrumb/HysBreadcrumb.vue.d.ts +38 -10
- package/dist/types/components/HysButton/HysButton.vue.d.ts +0 -1
- package/dist/types/components/HysCalendar/HysCalendar.vue.d.ts +119 -29
- package/dist/types/components/HysCard/HysCard.vue.d.ts +57 -5
- 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 +55 -27
- package/dist/types/components/HysCheckboxGroup/HysCheckboxGroup.vue.d.ts +73 -0
- package/dist/types/components/HysDataGrid/HysDataGrid.vue.d.ts +1 -1
- 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 +1 -0
- package/dist/types/components/HysFileManager/HysFileManager.vue.d.ts +8 -4
- 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 +88 -4
- package/dist/types/components/HysInput/HysInput.vue.d.ts +52 -29
- package/dist/types/components/HysMention/HysMention.vue.d.ts +2 -2
- package/dist/types/components/HysNumberInput/HysNumberInput.vue.d.ts +93 -33
- package/dist/types/components/HysOrgTree/HysOrgTree.vue.d.ts +4 -1
- package/dist/types/components/HysPagination/HysPagination.vue.d.ts +1 -1
- package/dist/types/components/HysPermissionMatrix/HysPermissionMatrix.vue.d.ts +8 -1
- package/dist/types/components/HysPopover/HysPopover.vue.d.ts +3 -3
- package/dist/types/components/HysProgress/HysProgress.vue.d.ts +1 -1
- package/dist/types/components/HysRadio/HysRadio.vue.d.ts +56 -0
- package/dist/types/components/HysRadioGroup/HysRadioGroup.vue.d.ts +62 -17
- package/dist/types/components/HysRating/HysRating.vue.d.ts +85 -5
- package/dist/types/components/HysResizablePanel/HysResizablePanel.vue.d.ts +6 -0
- 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 +120 -14
- package/dist/types/components/HysSkeleton/HysSkeleton.vue.d.ts +30 -2
- package/dist/types/components/HysSlider/HysSlider.vue.d.ts +66 -9
- package/dist/types/components/HysSlider/SliderTooltip.vue.d.ts +22 -0
- package/dist/types/components/HysSplitPane/HysSplitPane.vue.d.ts +6 -0
- package/dist/types/components/HysSteps/HysSteps.vue.d.ts +65 -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 +5 -5
- package/dist/types/components/HysTextarea/HysTextarea.vue.d.ts +44 -27
- package/dist/types/components/HysToast/HysToast.vue.d.ts +55 -7
- package/dist/types/components/HysTour/HysTour.vue.d.ts +5 -3
- package/dist/types/components/HysTransfer/HysTransfer.vue.d.ts +55 -30
- package/dist/types/components/HysTransfer/HysTransferPanel.vue.d.ts +105 -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/composables/autocomplete.d.ts +106 -0
- package/dist/types/composables/avatar.d.ts +70 -0
- package/dist/types/composables/calendar.d.ts +66 -0
- package/dist/types/composables/cascader.d.ts +192 -0
- package/dist/types/composables/choice.d.ts +110 -0
- package/dist/types/composables/choiceModel.d.ts +11 -0
- package/dist/types/composables/datePicker.d.ts +247 -0
- package/dist/types/composables/formContext.d.ts +138 -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/numberInput.d.ts +45 -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 +44 -0
- package/dist/types/composables/slider.d.ts +21 -0
- package/dist/types/composables/table.d.ts +309 -0
- package/dist/types/composables/textInput.d.ts +76 -0
- package/dist/types/composables/toastEscape.d.ts +1 -0
- package/dist/types/composables/transfer.d.ts +180 -0
- package/dist/types/composables/tree.d.ts +237 -0
- package/dist/types/composables/treeSelect.d.ts +167 -0
- package/dist/types/composables/useCascader.d.ts +162 -0
- package/dist/types/composables/useDatePicker.d.ts +79 -0
- package/dist/types/composables/useFloating.d.ts +8 -5
- 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/useHysToast.d.ts +50 -0
- package/dist/types/composables/useTable.d.ts +60 -0
- package/dist/types/composables/useTextareaSize.d.ts +3 -0
- package/dist/types/composables/useTransfer.d.ts +58 -0
- package/dist/types/composables/useTree.d.ts +77 -0
- package/dist/types/composables/useTreeSelect.d.ts +117 -0
- package/dist/types/index.d.ts +38 -7
- package/package.json +47 -11
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import { defineComponent as X, inject as Y, useAttrs as Z, ref as _, useId as ee, computed as n, shallowRef as ae, provide as le, onMounted as te, openBlock as m, createElementBlock as y, mergeProps as ue, unref as o, Fragment as T, renderList as G, createBlock as re, withCtx as ie, renderSlot as q, createTextVNode as F, toDisplayString as N, createCommentVNode as R, createElementVNode as oe } from "vue";
|
|
2
|
+
import ne from "../HysCheckbox/HysCheckbox.vue.js";
|
|
3
|
+
import { useHysControlState as se, fieldKey as de } from "../../composables/formContext.js";
|
|
4
|
+
import { uniqueChoices as $, choiceOptions as ve, checkboxGroupKey as ce, choiceKey as O } from "../../composables/choice.js";
|
|
5
|
+
import { useHysRootAttrs as me } from "../../config.js";
|
|
6
|
+
import { useChoiceModel as fe, useChoiceNativeReset as ye } from "../../composables/choiceModel.js";
|
|
7
|
+
const be = ["id", "aria-label", "aria-disabled", "aria-readonly", "aria-required", "aria-invalid", "aria-describedby"], he = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "hys-ui-checkbox-empty"
|
|
10
|
+
}, ge = { class: "hys-ui-checkbox-empty" }, pe = ["name", "form", "value", "disabled"], ke = ["id"], qe = /* @__PURE__ */ X({
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
__name: "HysCheckboxGroup",
|
|
13
|
+
props: {
|
|
14
|
+
modelValue: {},
|
|
15
|
+
defaultValue: {},
|
|
16
|
+
options: {},
|
|
17
|
+
fieldNames: {},
|
|
18
|
+
disabled: { type: Boolean },
|
|
19
|
+
readonly: { type: Boolean },
|
|
20
|
+
size: {},
|
|
21
|
+
min: {},
|
|
22
|
+
max: {},
|
|
23
|
+
required: { type: Boolean },
|
|
24
|
+
name: {},
|
|
25
|
+
form: {},
|
|
26
|
+
ariaLabel: {},
|
|
27
|
+
vertical: { type: Boolean },
|
|
28
|
+
type: { default: "checkbox" },
|
|
29
|
+
buttonStyle: {},
|
|
30
|
+
border: { type: Boolean },
|
|
31
|
+
error: {},
|
|
32
|
+
status: {},
|
|
33
|
+
autofocus: { type: Boolean },
|
|
34
|
+
emptyText: { default: "暂无选项" }
|
|
35
|
+
},
|
|
36
|
+
emits: ["update:modelValue", "change", "reject", "focus", "blur"],
|
|
37
|
+
setup(s, { expose: P, emit: J }) {
|
|
38
|
+
const l = s, g = J, { disabled: f, size: Q } = se(l), v = Y(de, void 0), A = Z(), U = me(), b = _(), j = ee(), h = fe(
|
|
39
|
+
l,
|
|
40
|
+
() => $(l.defaultValue ?? []),
|
|
41
|
+
(e, a) => Array.isArray(e) && Array.isArray(a) && e.length === a.length && e.every((t, r) => t === a[r])
|
|
42
|
+
), u = n(() => $(h.current.value ?? [])), p = n(
|
|
43
|
+
() => ve(l.options ?? [], l.fieldNames)
|
|
44
|
+
), c = ae(
|
|
45
|
+
[]
|
|
46
|
+
), S = n(
|
|
47
|
+
() => Math.max(
|
|
48
|
+
l.required ? 1 : 0,
|
|
49
|
+
Number.isFinite(l.min) ? Math.floor(l.min) : 0
|
|
50
|
+
)
|
|
51
|
+
), V = n(
|
|
52
|
+
() => l.max !== void 0 && Number.isFinite(l.max) ? Math.max(0, Math.floor(l.max)) : 1 / 0
|
|
53
|
+
), k = n(() => S.value > V.value), w = n(
|
|
54
|
+
() => {
|
|
55
|
+
var e, a;
|
|
56
|
+
return l.error || (e = v == null ? void 0 : v.invalid) != null && e.value || l.status === "error" || k.value || u.value.length > V.value ? "error" : l.status ?? ((a = v == null ? void 0 : v.status) == null ? void 0 : a.value);
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
function H(e) {
|
|
60
|
+
return k.value || (u.value.includes(e) ? u.value.length <= S.value : u.value.length >= V.value);
|
|
61
|
+
}
|
|
62
|
+
async function L(e, a) {
|
|
63
|
+
return e.length === u.value.length && e.every((t, r) => t === u.value[r]) ? !1 : h.commit(
|
|
64
|
+
e,
|
|
65
|
+
(t) => g("update:modelValue", t),
|
|
66
|
+
(t) => g("change", t, a),
|
|
67
|
+
!0
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
async function E(e, a = !u.value.includes(e)) {
|
|
71
|
+
if (!h.isLive() || f.value || l.readonly) return !1;
|
|
72
|
+
const t = c.value.find((d) => d.value.value === e), r = p.value.find((d) => d.value === e);
|
|
73
|
+
return !t && !r || t != null && t.locked.value || r != null && r.disabled || u.value.includes(e) === a ? !1 : H(e) ? (g("reject", {
|
|
74
|
+
value: e,
|
|
75
|
+
checked: a,
|
|
76
|
+
reason: k.value ? "range" : a ? "max" : "min"
|
|
77
|
+
}), !1) : L(
|
|
78
|
+
a ? [...u.value, e] : u.value.filter((d) => d !== e),
|
|
79
|
+
{ value: e, checked: a, source: "toggle" }
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
const x = n(
|
|
83
|
+
() => l.options !== void 0 ? p.value.filter((e) => !e.disabled).map((e) => e.value) : [
|
|
84
|
+
...new Set(
|
|
85
|
+
c.value.filter(
|
|
86
|
+
(e) => !e.locked.value && e.value.value !== void 0
|
|
87
|
+
).map((e) => e.value.value)
|
|
88
|
+
)
|
|
89
|
+
]
|
|
90
|
+
), M = n(
|
|
91
|
+
() => x.value.length > 0 && x.value.every((e) => u.value.includes(e))
|
|
92
|
+
), I = n(
|
|
93
|
+
() => !M.value && x.value.some((e) => u.value.includes(e))
|
|
94
|
+
);
|
|
95
|
+
async function K() {
|
|
96
|
+
if (!h.isLive() || f.value || l.readonly || k.value)
|
|
97
|
+
return !1;
|
|
98
|
+
const e = [...u.value];
|
|
99
|
+
for (const a of x.value)
|
|
100
|
+
!e.includes(a) && e.length < V.value && e.push(a);
|
|
101
|
+
return L(e, { source: "all" });
|
|
102
|
+
}
|
|
103
|
+
async function z() {
|
|
104
|
+
if (!h.isLive() || f.value || l.readonly || k.value)
|
|
105
|
+
return !1;
|
|
106
|
+
const e = new Set(x.value), a = u.value.filter((t) => !e.has(t));
|
|
107
|
+
for (const t of u.value)
|
|
108
|
+
a.length < S.value && !a.includes(t) && a.push(t);
|
|
109
|
+
return L(a, { source: "clear" });
|
|
110
|
+
}
|
|
111
|
+
function D(e) {
|
|
112
|
+
var t, r;
|
|
113
|
+
if (f.value) return;
|
|
114
|
+
const a = c.value.find(
|
|
115
|
+
(d) => {
|
|
116
|
+
var B;
|
|
117
|
+
return d.value.value === (e ?? u.value[0]) && !((B = d.input.value) != null && B.disabled);
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
(r = (a == null ? void 0 : a.input.value) || ((t = b.value) == null ? void 0 : t.querySelector(
|
|
121
|
+
'input[type="checkbox"]:not(:disabled)'
|
|
122
|
+
))) == null || r.focus();
|
|
123
|
+
}
|
|
124
|
+
le(ce, {
|
|
125
|
+
values: u,
|
|
126
|
+
disabled: f,
|
|
127
|
+
readonly: n(() => !!l.readonly),
|
|
128
|
+
size: Q,
|
|
129
|
+
button: n(() => l.type === "button"),
|
|
130
|
+
border: n(() => !!l.border),
|
|
131
|
+
solid: n(() => l.buttonStyle === "solid"),
|
|
132
|
+
status: w,
|
|
133
|
+
form: n(() => l.form),
|
|
134
|
+
isLimited: H,
|
|
135
|
+
toggle: E,
|
|
136
|
+
register: (e) => (c.value.includes(e) || (c.value = [...c.value, e]), () => c.value = c.value.filter((a) => a !== e))
|
|
137
|
+
}), ye(b, h.reset, void 0, () => l.form);
|
|
138
|
+
function W(e) {
|
|
139
|
+
var a, t;
|
|
140
|
+
return !!((a = p.value.find((r) => r.value === e)) != null && a.disabled) || !!((t = c.value.find((r) => r.value.value === e)) != null && t.disabled.value);
|
|
141
|
+
}
|
|
142
|
+
return te(() => {
|
|
143
|
+
l.autofocus && D();
|
|
144
|
+
}), P({
|
|
145
|
+
values: u,
|
|
146
|
+
allChecked: M,
|
|
147
|
+
indeterminate: I,
|
|
148
|
+
focus: D,
|
|
149
|
+
blur: () => {
|
|
150
|
+
var a;
|
|
151
|
+
const e = document.activeElement;
|
|
152
|
+
e && ((a = b.value) != null && a.contains(e)) && e.blur();
|
|
153
|
+
},
|
|
154
|
+
checkAll: K,
|
|
155
|
+
clear: z,
|
|
156
|
+
toggle: E
|
|
157
|
+
}), (e, a) => {
|
|
158
|
+
var t, r, d, B;
|
|
159
|
+
return m(), y("div", ue({
|
|
160
|
+
ref_key: "root",
|
|
161
|
+
ref: b
|
|
162
|
+
}, { ...o(U), ...o(A) }, {
|
|
163
|
+
id: o(A).id || ((t = o(v)) == null ? void 0 : t.id.value),
|
|
164
|
+
role: "group",
|
|
165
|
+
"data-hys-ui-field-managed": "",
|
|
166
|
+
class: ["hys-ui-checkbox-group", { "hys-ui-checkbox-group-vertical": s.vertical }],
|
|
167
|
+
"aria-label": s.ariaLabel || o(A)["aria-label"] || ((r = o(v)) == null ? void 0 : r.label.value) || "复选框组",
|
|
168
|
+
"aria-disabled": o(f) || void 0,
|
|
169
|
+
"aria-readonly": s.readonly || void 0,
|
|
170
|
+
"aria-required": s.required || ((d = o(v)) == null ? void 0 : d.required.value) || S.value > 0 || void 0,
|
|
171
|
+
"aria-invalid": w.value === "error" || void 0,
|
|
172
|
+
"aria-describedby": [s.error ? o(j) : (B = o(v)) == null ? void 0 : B.describedBy.value, o(A)["aria-describedby"]].filter(Boolean).join(" ") || void 0,
|
|
173
|
+
onFocusin: a[0] || (a[0] = (i) => {
|
|
174
|
+
var C;
|
|
175
|
+
return !((C = b.value) != null && C.contains(i.relatedTarget)) && g("focus", i);
|
|
176
|
+
}),
|
|
177
|
+
onFocusout: a[1] || (a[1] = (i) => {
|
|
178
|
+
var C;
|
|
179
|
+
return !((C = b.value) != null && C.contains(i.relatedTarget)) && g("blur", i);
|
|
180
|
+
})
|
|
181
|
+
}), [
|
|
182
|
+
l.options !== void 0 ? (m(), y(T, { key: 0 }, [
|
|
183
|
+
(m(!0), y(T, null, G(p.value, (i) => (m(), re(ne, {
|
|
184
|
+
key: o(O)(i.value),
|
|
185
|
+
value: i.value,
|
|
186
|
+
disabled: i.disabled,
|
|
187
|
+
indeterminate: i.indeterminate
|
|
188
|
+
}, {
|
|
189
|
+
default: ie(() => [
|
|
190
|
+
q(e.$slots, "option", {
|
|
191
|
+
option: i,
|
|
192
|
+
checked: u.value.includes(i.value)
|
|
193
|
+
}, () => [
|
|
194
|
+
F(N(i.label), 1)
|
|
195
|
+
], !0)
|
|
196
|
+
]),
|
|
197
|
+
_: 2
|
|
198
|
+
}, 1032, ["value", "disabled", "indeterminate"]))), 128)),
|
|
199
|
+
p.value.length ? R("", !0) : (m(), y("span", he, [
|
|
200
|
+
q(e.$slots, "empty", {}, () => [
|
|
201
|
+
F(N(s.emptyText), 1)
|
|
202
|
+
], !0)
|
|
203
|
+
]))
|
|
204
|
+
], 64)) : q(e.$slots, "default", {
|
|
205
|
+
values: u.value,
|
|
206
|
+
allChecked: M.value,
|
|
207
|
+
indeterminate: I.value,
|
|
208
|
+
checkAll: K,
|
|
209
|
+
clear: z
|
|
210
|
+
}, () => [
|
|
211
|
+
oe("span", ge, [
|
|
212
|
+
q(e.$slots, "empty", {}, () => [
|
|
213
|
+
F(N(s.emptyText), 1)
|
|
214
|
+
], !0)
|
|
215
|
+
])
|
|
216
|
+
], !0, 1),
|
|
217
|
+
s.name ? (m(!0), y(T, { key: 2 }, G(u.value, (i) => (m(), y("input", {
|
|
218
|
+
key: o(O)(i),
|
|
219
|
+
type: "hidden",
|
|
220
|
+
name: s.name,
|
|
221
|
+
form: s.form,
|
|
222
|
+
value: String(i),
|
|
223
|
+
disabled: o(f) || W(i)
|
|
224
|
+
}, null, 8, pe))), 128)) : R("", !0),
|
|
225
|
+
s.error ? (m(), y("small", {
|
|
226
|
+
key: 3,
|
|
227
|
+
id: o(j),
|
|
228
|
+
role: "alert",
|
|
229
|
+
class: "hys-ui-checkbox-group-error"
|
|
230
|
+
}, N(s.error), 9, ke)) : R("", !0)
|
|
231
|
+
], 16, be);
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
export {
|
|
236
|
+
qe as default
|
|
237
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysColorPicker2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import r from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const m = /* @__PURE__ */ r(o, [["__scopeId", "data-v-2a198a4e"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
m as default
|
|
7
7
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { defineComponent as Q, ref as v, computed as L, watch as U, openBlock as p, createElementBlock as b, mergeProps as z, unref as n, createElementVNode as o, normalizeStyle as k, createVNode as W, withDirectives as Z, withKeys as _, vModelText as ee, createCommentVNode as P, createBlock as N, Teleport as te, toDisplayString as ae, Fragment as le, renderList as oe } from "vue";
|
|
2
|
+
import { useHysControlState as re } from "../../composables/formContext.js";
|
|
3
|
+
import { useHysRootAttrs as ne } from "../../config.js";
|
|
4
|
+
import { ChevronDown as ie, Check as ue } from "lucide-vue-next";
|
|
5
|
+
import { useFloating as se } from "../../composables/useFloating.js";
|
|
6
|
+
const de = { class: "hys-ui-pf-color-control" }, fe = ["aria-label", "aria-expanded", "disabled"], ce = ["aria-invalid", "disabled"], pe = {
|
|
6
7
|
key: 0,
|
|
7
8
|
class: "hys-ui-pf-color-error",
|
|
8
9
|
role: "alert"
|
|
9
|
-
},
|
|
10
|
+
}, me = ["aria-label"], ye = ["aria-valuenow", "aria-valuetext"], he = ["aria-valuenow"], ve = {
|
|
10
11
|
class: "hys-ui-pf-color-presets",
|
|
11
12
|
role: "group",
|
|
12
13
|
"aria-label": "常用颜色"
|
|
13
|
-
},
|
|
14
|
+
}, be = ["aria-label", "aria-pressed", "onClick"], Me = /* @__PURE__ */ Q({
|
|
14
15
|
__name: "HysColorPicker",
|
|
15
16
|
props: {
|
|
16
17
|
modelValue: {},
|
|
@@ -20,135 +21,135 @@ const ue = { class: "hys-ui-pf-color-control" }, se = ["aria-label", "aria-expan
|
|
|
20
21
|
clearable: { type: Boolean }
|
|
21
22
|
},
|
|
22
23
|
emits: ["update:modelValue"],
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
function
|
|
26
|
-
const e =
|
|
27
|
-
const
|
|
28
|
-
return Math.round(255 * (t - t * e * Math.max(0, Math.min(
|
|
24
|
+
setup(m, { emit: F }) {
|
|
25
|
+
const R = ne(), y = m, { disabled: i } = re(y), V = F, S = v(), A = v(), { open: D, style: G, show: q, close: w } = se(S, A), d = v(0), r = v(0), u = v(0), s = v(y.modelValue), B = L(() => !s.value || /^#[0-9a-f]{6}$/i.test(s.value)), X = ["#3867f5", "#8955ea", "#ec4899", "#ef4444", "#f59e0b", "#22a06b", "#06b6d4", "#172a4d", "#ffffff", "#000000"];
|
|
26
|
+
function Y() {
|
|
27
|
+
const e = r.value / 100, t = u.value / 100, a = (l) => {
|
|
28
|
+
const c = (l + d.value / 60) % 6;
|
|
29
|
+
return Math.round(255 * (t - t * e * Math.max(0, Math.min(c, 4 - c, 1)))).toString(16).padStart(2, "0");
|
|
29
30
|
};
|
|
30
31
|
return "#" + a(5) + a(3) + a(1);
|
|
31
32
|
}
|
|
32
|
-
const
|
|
33
|
-
function
|
|
33
|
+
const f = L(Y);
|
|
34
|
+
function H(e) {
|
|
34
35
|
if (!/^#[0-9a-f]{6}$/i.test(e)) return;
|
|
35
|
-
const t = [1, 3, 5].map((M) => parseInt(e.slice(M, M + 2), 16) / 255), [a, l,
|
|
36
|
-
if (
|
|
37
|
-
const M = h === a ? (l -
|
|
38
|
-
|
|
36
|
+
const t = [1, 3, 5].map((M) => parseInt(e.slice(M, M + 2), 16) / 255), [a, l, c] = t, h = Math.max(...t), O = Math.min(...t), g = h - O;
|
|
37
|
+
if (g) {
|
|
38
|
+
const M = h === a ? (l - c) / g : h === l ? (c - a) / g + 2 : (a - l) / g + 4;
|
|
39
|
+
d.value = (M * 60 + 360) % 360;
|
|
39
40
|
}
|
|
40
|
-
|
|
41
|
+
r.value = h ? g / h * 100 : 0, u.value = h * 100;
|
|
41
42
|
}
|
|
42
|
-
|
|
43
|
-
s.value = e, /^#[0-9a-f]{6}$/i.test(e) && e.toLowerCase() !==
|
|
43
|
+
U(() => y.modelValue, (e) => {
|
|
44
|
+
s.value = e, /^#[0-9a-f]{6}$/i.test(e) && e.toLowerCase() !== f.value && H(e);
|
|
44
45
|
}, { immediate: !0 });
|
|
45
|
-
function
|
|
46
|
-
s.value =
|
|
46
|
+
function x() {
|
|
47
|
+
s.value = f.value, V("update:modelValue", f.value);
|
|
47
48
|
}
|
|
48
49
|
function $() {
|
|
49
|
-
if (!(
|
|
50
|
+
if (!(i.value || !B.value)) {
|
|
50
51
|
if (!s.value) {
|
|
51
|
-
|
|
52
|
+
y.clearable ? V("update:modelValue", "") : s.value = y.modelValue;
|
|
52
53
|
return;
|
|
53
54
|
}
|
|
54
|
-
|
|
55
|
+
H(s.value), x();
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
function
|
|
58
|
-
|
|
58
|
+
function j(e) {
|
|
59
|
+
i.value || !/^#[0-9a-f]{6}$/i.test(e) || (H(e), x());
|
|
59
60
|
}
|
|
60
|
-
async function
|
|
61
|
+
async function J() {
|
|
61
62
|
var e, t;
|
|
62
|
-
if (!
|
|
63
|
-
if (
|
|
64
|
-
|
|
63
|
+
if (!i.value) {
|
|
64
|
+
if (D.value) {
|
|
65
|
+
w();
|
|
65
66
|
return;
|
|
66
67
|
}
|
|
67
|
-
await
|
|
68
|
+
await q(), (t = (e = A.value) == null ? void 0 : e.querySelector('[role="slider"]')) == null || t.focus();
|
|
68
69
|
}
|
|
69
70
|
}
|
|
70
|
-
function
|
|
71
|
-
if (
|
|
71
|
+
function T(e, t) {
|
|
72
|
+
if (i.value) return;
|
|
72
73
|
const l = e.currentTarget.getBoundingClientRect();
|
|
73
74
|
if (!l.width || !l.height) return;
|
|
74
|
-
const
|
|
75
|
-
t === "hue" ?
|
|
75
|
+
const c = Math.max(0, Math.min(1, (e.clientX - l.left) / l.width));
|
|
76
|
+
t === "hue" ? d.value = c * 359 : (r.value = c * 100, u.value = (1 - Math.max(0, Math.min(1, (e.clientY - l.top) / l.height))) * 100), x();
|
|
76
77
|
}
|
|
77
|
-
function
|
|
78
|
-
if (e.button !== 0 ||
|
|
78
|
+
function E(e, t) {
|
|
79
|
+
if (e.button !== 0 || i.value) return;
|
|
79
80
|
e.preventDefault();
|
|
80
81
|
const a = e.currentTarget;
|
|
81
|
-
a.focus(), a.setPointerCapture(e.pointerId),
|
|
82
|
+
a.focus(), a.setPointerCapture(e.pointerId), T(e, t);
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
e.currentTarget.hasPointerCapture(e.pointerId) &&
|
|
84
|
+
function I(e, t) {
|
|
85
|
+
e.currentTarget.hasPointerCapture(e.pointerId) && T(e, t);
|
|
85
86
|
}
|
|
86
|
-
function
|
|
87
|
+
function C(e) {
|
|
87
88
|
const t = e.currentTarget;
|
|
88
89
|
t.hasPointerCapture(e.pointerId) && t.releasePointerCapture(e.pointerId);
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
-
if (
|
|
91
|
+
function K(e, t) {
|
|
92
|
+
if (i.value || !["ArrowLeft", "ArrowRight", "ArrowUp", "ArrowDown", "Home", "End"].includes(e.key)) return;
|
|
92
93
|
e.preventDefault();
|
|
93
94
|
const a = e.shiftKey ? 10 : 1;
|
|
94
95
|
if (t === "hue") {
|
|
95
96
|
const l = e.key === "ArrowLeft" || e.key === "ArrowDown" ? -a : a;
|
|
96
|
-
|
|
97
|
+
d.value = e.key === "Home" ? 0 : e.key === "End" ? 359 : Math.max(0, Math.min(359, d.value + l));
|
|
97
98
|
} else
|
|
98
|
-
e.key === "ArrowLeft" && (
|
|
99
|
-
|
|
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();
|
|
100
101
|
}
|
|
101
|
-
return
|
|
102
|
-
e &&
|
|
103
|
-
}), (e, t) => (
|
|
104
|
-
o("div",
|
|
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, [
|
|
105
106
|
o("button", {
|
|
106
107
|
ref_key: "trigger",
|
|
107
|
-
ref:
|
|
108
|
+
ref: S,
|
|
108
109
|
type: "button",
|
|
109
110
|
class: "hys-ui-pf-color-trigger",
|
|
110
|
-
"aria-label":
|
|
111
|
+
"aria-label": m.label || "选择颜色",
|
|
111
112
|
"aria-haspopup": "dialog",
|
|
112
|
-
"aria-expanded":
|
|
113
|
-
disabled: i
|
|
114
|
-
onClick:
|
|
113
|
+
"aria-expanded": n(D),
|
|
114
|
+
disabled: n(i),
|
|
115
|
+
onClick: J
|
|
115
116
|
}, [
|
|
116
117
|
o("span", {
|
|
117
118
|
class: "hys-ui-pf-color-chip",
|
|
118
|
-
style:
|
|
119
|
+
style: k({ background: m.modelValue ? f.value : "transparent" })
|
|
119
120
|
}, null, 4),
|
|
120
|
-
|
|
121
|
+
W(n(ie), {
|
|
121
122
|
size: 14,
|
|
122
123
|
"aria-hidden": "true"
|
|
123
124
|
})
|
|
124
|
-
], 8,
|
|
125
|
-
|
|
125
|
+
], 8, fe),
|
|
126
|
+
Z(o("input", {
|
|
126
127
|
"onUpdate:modelValue": t[0] || (t[0] = (a) => s.value = a),
|
|
127
128
|
class: "hys-ui-pf-color-hex",
|
|
128
129
|
"aria-label": "十六进制颜色",
|
|
129
130
|
"aria-invalid": !B.value,
|
|
130
|
-
disabled: i
|
|
131
|
+
disabled: n(i),
|
|
131
132
|
maxlength: "7",
|
|
132
133
|
spellcheck: "false",
|
|
133
134
|
onChange: $,
|
|
134
|
-
onKeydown:
|
|
135
|
-
}, null, 40,
|
|
136
|
-
[
|
|
135
|
+
onKeydown: _($, ["enter"])
|
|
136
|
+
}, null, 40, ce), [
|
|
137
|
+
[ee, s.value]
|
|
137
138
|
])
|
|
138
139
|
]),
|
|
139
|
-
B.value ?
|
|
140
|
-
(
|
|
141
|
-
|
|
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), {
|
|
142
143
|
ref_key: "panel",
|
|
143
|
-
ref:
|
|
144
|
+
ref: A,
|
|
144
145
|
class: "hys-ui-v4-menu hys-ui-pf-color-panel",
|
|
145
|
-
style:
|
|
146
|
+
style: n(G),
|
|
146
147
|
role: "dialog",
|
|
147
|
-
"aria-label":
|
|
148
|
+
"aria-label": m.label || "选择颜色"
|
|
148
149
|
}), [
|
|
149
150
|
o("header", null, [
|
|
150
151
|
t[9] || (t[9] = o("strong", null, "选择颜色", -1)),
|
|
151
|
-
o("code", null,
|
|
152
|
+
o("code", null, ae(f.value.toUpperCase()), 1)
|
|
152
153
|
]),
|
|
153
154
|
o("div", {
|
|
154
155
|
class: "hys-ui-pf-color-palette",
|
|
@@ -157,20 +158,20 @@ const ue = { class: "hys-ui-pf-color-control" }, se = ["aria-label", "aria-expan
|
|
|
157
158
|
"aria-label": "饱和度与亮度",
|
|
158
159
|
"aria-valuemin": "0",
|
|
159
160
|
"aria-valuemax": "100",
|
|
160
|
-
"aria-valuenow": Math.round(
|
|
161
|
-
"aria-valuetext": "饱和度 " + Math.round(
|
|
162
|
-
style:
|
|
163
|
-
onPointerdown: t[1] || (t[1] = (a) =>
|
|
164
|
-
onPointermove: t[2] || (t[2] = (a) =>
|
|
165
|
-
onPointerup:
|
|
166
|
-
onPointercancel:
|
|
167
|
-
onKeydown: t[3] || (t[3] = (a) =>
|
|
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"))
|
|
168
169
|
}, [
|
|
169
170
|
o("span", {
|
|
170
171
|
class: "hys-ui-pf-color-cursor",
|
|
171
|
-
style:
|
|
172
|
+
style: k({ left: r.value + "%", top: 100 - u.value + "%", background: f.value })
|
|
172
173
|
}, null, 4)
|
|
173
|
-
], 44,
|
|
174
|
+
], 44, ye),
|
|
174
175
|
o("div", {
|
|
175
176
|
class: "hys-ui-pf-color-hue",
|
|
176
177
|
role: "slider",
|
|
@@ -178,54 +179,54 @@ const ue = { class: "hys-ui-pf-color-control" }, se = ["aria-label", "aria-expan
|
|
|
178
179
|
"aria-label": "色相",
|
|
179
180
|
"aria-valuemin": "0",
|
|
180
181
|
"aria-valuemax": "359",
|
|
181
|
-
"aria-valuenow": Math.round(
|
|
182
|
-
onPointerdown: t[4] || (t[4] = (a) =>
|
|
183
|
-
onPointermove: t[5] || (t[5] = (a) =>
|
|
184
|
-
onPointerup:
|
|
185
|
-
onPointercancel:
|
|
186
|
-
onKeydown: t[6] || (t[6] = (a) =>
|
|
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"))
|
|
187
188
|
}, [
|
|
188
189
|
o("span", {
|
|
189
|
-
style:
|
|
190
|
+
style: k({ left: d.value / 359 * 100 + "%" })
|
|
190
191
|
}, null, 4)
|
|
191
|
-
], 40,
|
|
192
|
-
o("div",
|
|
193
|
-
(
|
|
192
|
+
], 40, he),
|
|
193
|
+
o("div", ve, [
|
|
194
|
+
(p(!0), b(le, null, oe(y.presets || X, (a) => (p(), b("button", {
|
|
194
195
|
key: a,
|
|
195
196
|
type: "button",
|
|
196
197
|
"aria-label": a,
|
|
197
|
-
"aria-pressed":
|
|
198
|
-
style:
|
|
199
|
-
onClick: (l) =>
|
|
198
|
+
"aria-pressed": f.value === a,
|
|
199
|
+
style: k({ background: a }),
|
|
200
|
+
onClick: (l) => j(a)
|
|
200
201
|
}, [
|
|
201
|
-
|
|
202
|
+
f.value === a ? (p(), N(n(ue), {
|
|
202
203
|
key: 0,
|
|
203
204
|
size: 13,
|
|
204
|
-
style:
|
|
205
|
+
style: k({ color: a === "#ffffff" ? "#172a4d" : "white" }),
|
|
205
206
|
"aria-hidden": "true"
|
|
206
|
-
}, null, 8, ["style"])) :
|
|
207
|
-
], 12,
|
|
207
|
+
}, null, 8, ["style"])) : P("", !0)
|
|
208
|
+
], 12, be))), 128))
|
|
208
209
|
]),
|
|
209
|
-
|
|
210
|
+
m.clearable && !n(i) && m.modelValue ? (p(), b("button", {
|
|
210
211
|
key: 0,
|
|
211
212
|
type: "button",
|
|
212
213
|
class: "hys-ui-color-clear",
|
|
213
214
|
onClick: t[7] || (t[7] = (a) => {
|
|
214
|
-
|
|
215
|
+
V("update:modelValue", ""), n(w)(!0);
|
|
215
216
|
})
|
|
216
|
-
}, "清空颜色")) :
|
|
217
|
+
}, "清空颜色")) : P("", !0),
|
|
217
218
|
o("footer", null, [
|
|
218
219
|
t[10] || (t[10] = o("span", null, "方向键微调 · Shift 加速", -1)),
|
|
219
220
|
o("button", {
|
|
220
221
|
type: "button",
|
|
221
|
-
onClick: t[8] || (t[8] = (a) =>
|
|
222
|
+
onClick: t[8] || (t[8] = (a) => n(w)(!0))
|
|
222
223
|
}, "完成")
|
|
223
224
|
])
|
|
224
|
-
], 16,
|
|
225
|
+
], 16, me)) : P("", !0)
|
|
225
226
|
]))
|
|
226
227
|
], 16));
|
|
227
228
|
}
|
|
228
229
|
});
|
|
229
230
|
export {
|
|
230
|
-
|
|
231
|
+
Me as default
|
|
231
232
|
};
|