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
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
1
|
+
import { defineComponent as te, useModel as ae, ref as g, useId as le, computed as k, watch as D, onBeforeUnmount as oe, onDeactivated as ne, openBlock as C, createElementBlock as F, mergeProps as O, unref as o, withDirectives as ie, createElementVNode as z, vModelText as re, createBlock as de, Teleport as se, Fragment as ue, renderList as ce, withModifiers as ve, normalizeClass as fe, renderSlot as pe, toDisplayString as U, createCommentVNode as he, mergeModels as K, nextTick as j } from "vue";
|
|
2
|
+
import { useHysControlState as me } from "../../composables/formContext.js";
|
|
3
|
+
import { useHysRootAttrs as ge } from "../../config.js";
|
|
4
|
+
import { useFloating as be } from "../../composables/useFloating.js";
|
|
5
|
+
const ye = ["placeholder", "disabled", "readonly", "maxlength", "aria-label", "aria-controls", "aria-expanded", "aria-activedescendant"], xe = ["id"], we = ["id", "disabled", "aria-selected", "data-active", "onPointerenter", "onClick"], ke = {
|
|
5
6
|
class: "hys-ui-mention-avatar",
|
|
6
7
|
"aria-hidden": "true"
|
|
7
|
-
},
|
|
8
|
+
}, Se = /* @__PURE__ */ te({
|
|
8
9
|
__name: "HysMention",
|
|
9
|
-
props: /* @__PURE__ */
|
|
10
|
+
props: /* @__PURE__ */ K({
|
|
10
11
|
users: {},
|
|
11
12
|
placeholder: {},
|
|
12
13
|
disabled: { type: Boolean },
|
|
@@ -17,9 +18,9 @@ const me = ["placeholder", "disabled", "readonly", "maxlength", "aria-label", "a
|
|
|
17
18
|
modelValue: { default: "" },
|
|
18
19
|
modelModifiers: {}
|
|
19
20
|
}),
|
|
20
|
-
emits: /* @__PURE__ */
|
|
21
|
-
setup(
|
|
22
|
-
const
|
|
21
|
+
emits: /* @__PURE__ */ K(["select", "change"], ["update:modelValue"]),
|
|
22
|
+
setup(h, { expose: q, emit: J }) {
|
|
23
|
+
const M = h, { disabled: R, label: G } = me(M), r = ae(h, "modelValue"), T = J, H = ge(), n = g(0), c = g(!1), V = g(!1), d = g(), $ = g(), L = g(r.value.length), B = le(), Q = k(() => d.value ? { getBoundingClientRect: Z, contains: (e) => {
|
|
23
24
|
var t;
|
|
24
25
|
return !!((t = d.value) != null && t.contains(e));
|
|
25
26
|
}, focus: () => {
|
|
@@ -28,62 +29,62 @@ const me = ["placeholder", "disabled", "readonly", "maxlength", "aria-label", "a
|
|
|
28
29
|
}, get isConnected() {
|
|
29
30
|
var e;
|
|
30
31
|
return !!((e = d.value) != null && e.isConnected);
|
|
31
|
-
} } : void 0), { open:
|
|
32
|
+
} } : void 0), { open: v, style: X, show: I, close: b, update: Y } = be(Q, $, { gap: 6 }), E = k(() => r.value.slice(0, L.value)), W = k(() => {
|
|
32
33
|
var e;
|
|
33
|
-
return ((e =
|
|
34
|
+
return ((e = E.value.match(/@([^\s@]*)$/)) == null ? void 0 : e[1]) ?? null;
|
|
34
35
|
});
|
|
35
|
-
let
|
|
36
|
-
function
|
|
37
|
-
|
|
36
|
+
let i;
|
|
37
|
+
function A() {
|
|
38
|
+
i == null || i.remove(), i = void 0;
|
|
38
39
|
}
|
|
39
|
-
function
|
|
40
|
+
function Z() {
|
|
40
41
|
const e = d.value, t = e.getBoundingClientRect();
|
|
41
42
|
if (!t.width && !t.height) return t;
|
|
42
43
|
const l = getComputedStyle(e);
|
|
43
|
-
|
|
44
|
-
for (const
|
|
45
|
-
Object.assign(
|
|
46
|
-
const a = parseFloat(l.borderLeftWidth) || 0,
|
|
47
|
-
|
|
48
|
-
const u = Math.max(0,
|
|
49
|
-
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
const
|
|
53
|
-
return { x: m, y:
|
|
44
|
+
i || (i = document.createElement("div"), i.setAttribute("aria-hidden", "true"), document.body.append(i));
|
|
45
|
+
for (const N of ["direction", "font", "font-family", "font-size", "font-weight", "font-style", "font-variant", "letter-spacing", "word-spacing", "text-transform", "text-indent", "text-align", "line-height", "padding-top", "padding-right", "padding-bottom", "padding-left", "border-top-width", "border-right-width", "border-bottom-width", "border-left-width", "border-style", "box-sizing", "tab-size"]) i.style.setProperty(N, l.getPropertyValue(N));
|
|
46
|
+
Object.assign(i.style, { position: "fixed", top: "0px", left: "-10000px", visibility: "hidden", pointerEvents: "none", height: "auto", overflow: "hidden", whiteSpace: e.wrap === "off" ? "pre" : "pre-wrap", overflowWrap: "break-word", wordBreak: l.wordBreak });
|
|
47
|
+
const a = parseFloat(l.borderLeftWidth) || 0, f = parseFloat(l.borderTopWidth) || 0;
|
|
48
|
+
i.style.width = (e.clientWidth || t.width - a - (parseFloat(l.borderRightWidth) || 0)) + a + (parseFloat(l.borderRightWidth) || 0) + "px";
|
|
49
|
+
const u = Math.max(0, E.value.lastIndexOf("@"));
|
|
50
|
+
i.textContent = r.value.slice(0, u);
|
|
51
|
+
const p = document.createElement("span");
|
|
52
|
+
p.textContent = r.value.slice(u) || "@", i.append(p);
|
|
53
|
+
const w = parseFloat(l.lineHeight) || (parseFloat(l.fontSize) || 14) * 1.6, m = t.left + p.offsetLeft + a - e.scrollLeft, S = t.top + p.offsetTop + f - e.scrollTop;
|
|
54
|
+
return { x: m, y: S, left: m, top: S, right: m + 1, bottom: S + w, width: 1, height: w, toJSON: () => ({ left: m, top: S, width: 1, height: w }) };
|
|
54
55
|
}
|
|
55
|
-
|
|
56
|
-
e ||
|
|
57
|
-
}),
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
}),
|
|
62
|
-
|
|
56
|
+
D(v, (e) => {
|
|
57
|
+
e || A();
|
|
58
|
+
}), oe(A), ne(A);
|
|
59
|
+
const y = k(() => W.value === null || R.value || M.readonly || c.value || !V.value ? [] : M.users.filter((e) => e.name.toLocaleLowerCase().includes(W.value.toLocaleLowerCase())).slice(0, 8)), s = k(() => y.value.filter((e) => !e.disabled));
|
|
60
|
+
D(W, () => {
|
|
61
|
+
n.value = 0, c.value = !1;
|
|
62
|
+
}), D(y, (e) => {
|
|
63
|
+
n.value = Math.min(n.value, Math.max(0, s.value.length - 1)), e.length ? I() : b();
|
|
63
64
|
}, { flush: "post" });
|
|
64
|
-
async function
|
|
65
|
+
async function x() {
|
|
65
66
|
var e;
|
|
66
|
-
await
|
|
67
|
+
await j(), L.value = ((e = d.value) == null ? void 0 : e.selectionStart) ?? r.value.length, v.value && Y();
|
|
67
68
|
}
|
|
68
|
-
|
|
69
|
+
D(r, () => void x(), { flush: "post" });
|
|
69
70
|
async function P(e) {
|
|
70
|
-
var
|
|
71
|
-
if (!e || e.disabled ||
|
|
72
|
-
const t =
|
|
73
|
-
|
|
71
|
+
var f, u;
|
|
72
|
+
if (!e || e.disabled || R.value || M.readonly) return;
|
|
73
|
+
const t = E.value.replace(/@[^\s@]*$/, "@" + e.name + " "), l = r.value.slice(L.value), a = l.startsWith(" ") ? l.slice(1) : l;
|
|
74
|
+
r.value = t + a, c.value = !0, n.value = 0, b(), T("select", e), T("change", r.value), await j(), (f = d.value) == null || f.focus(), (u = d.value) == null || u.setSelectionRange(t.length, t.length), L.value = t.length;
|
|
74
75
|
}
|
|
75
|
-
function
|
|
76
|
+
function _(e) {
|
|
76
77
|
var t, l;
|
|
77
78
|
if (e.key === "Tab") {
|
|
78
|
-
|
|
79
|
+
c.value = !0, b();
|
|
79
80
|
return;
|
|
80
81
|
}
|
|
81
|
-
|
|
82
|
+
y.value.length && (e.key === "Escape" ? (e.preventDefault(), c.value = !0, b()) : e.key === "ArrowDown" || e.key === "ArrowUp" ? (e.preventDefault(), v.value ? n.value = (n.value + (e.key === "ArrowDown" ? 1 : -1) + Math.max(1, s.value.length)) % Math.max(1, s.value.length) : I(), (l = (t = $.value) == null ? void 0 : t.querySelector('[data-active="true"]')) == null || l.scrollIntoView({ block: "nearest" })) : e.key === "Enter" && !e.isComposing && s.value[n.value] && (e.preventDefault(), P(s.value[n.value])));
|
|
82
83
|
}
|
|
83
|
-
function
|
|
84
|
-
|
|
84
|
+
function ee() {
|
|
85
|
+
c.value = !1, x(), T("change", r.value);
|
|
85
86
|
}
|
|
86
|
-
return
|
|
87
|
+
return q({ focus: () => {
|
|
87
88
|
var e;
|
|
88
89
|
return (e = d.value) == null ? void 0 : e.focus();
|
|
89
90
|
}, blur: () => {
|
|
@@ -91,75 +92,75 @@ const me = ["placeholder", "disabled", "readonly", "maxlength", "aria-label", "a
|
|
|
91
92
|
return (e = d.value) == null ? void 0 : e.blur();
|
|
92
93
|
} }), (e, t) => {
|
|
93
94
|
var l;
|
|
94
|
-
return
|
|
95
|
-
|
|
95
|
+
return C(), F("div", O(o(H), { class: "hys-ui-ent-mention" }), [
|
|
96
|
+
ie(z("textarea", {
|
|
96
97
|
ref_key: "input",
|
|
97
98
|
ref: d,
|
|
98
|
-
"onUpdate:modelValue": t[0] || (t[0] = (a) =>
|
|
99
|
-
placeholder:
|
|
100
|
-
disabled:
|
|
101
|
-
readonly:
|
|
102
|
-
maxlength:
|
|
103
|
-
"aria-label":
|
|
104
|
-
"aria-controls":
|
|
105
|
-
"aria-expanded":
|
|
106
|
-
"aria-activedescendant":
|
|
99
|
+
"onUpdate:modelValue": t[0] || (t[0] = (a) => r.value = a),
|
|
100
|
+
placeholder: h.placeholder || "输入 @ 提及成员",
|
|
101
|
+
disabled: o(R),
|
|
102
|
+
readonly: h.readonly,
|
|
103
|
+
maxlength: h.maxlength,
|
|
104
|
+
"aria-label": h.ariaLabel || o(G) || "提及输入",
|
|
105
|
+
"aria-controls": o(v) ? o(B) : void 0,
|
|
106
|
+
"aria-expanded": o(v),
|
|
107
|
+
"aria-activedescendant": o(v) ? o(B) + "-" + ((l = s.value[n.value]) == null ? void 0 : l.id) : void 0,
|
|
107
108
|
role: "combobox",
|
|
108
|
-
onKeydown:
|
|
109
|
-
onKeyup:
|
|
109
|
+
onKeydown: _,
|
|
110
|
+
onKeyup: x,
|
|
110
111
|
onClick: t[1] || (t[1] = (a) => {
|
|
111
|
-
|
|
112
|
+
c.value = !1, x();
|
|
112
113
|
}),
|
|
113
114
|
onFocus: t[2] || (t[2] = (a) => {
|
|
114
|
-
|
|
115
|
+
V.value = !0, x();
|
|
115
116
|
}),
|
|
116
117
|
onBlur: t[3] || (t[3] = (a) => {
|
|
117
|
-
|
|
118
|
+
V.value = !1, o(b)();
|
|
118
119
|
}),
|
|
119
|
-
onInput:
|
|
120
|
-
}, null, 40,
|
|
121
|
-
[
|
|
120
|
+
onInput: ee
|
|
121
|
+
}, null, 40, ye), [
|
|
122
|
+
[re, r.value]
|
|
122
123
|
]),
|
|
123
|
-
(
|
|
124
|
-
|
|
124
|
+
(C(), de(se, { to: "body" }, [
|
|
125
|
+
o(v) && y.value.length ? (C(), F("div", O({
|
|
125
126
|
key: 0,
|
|
126
|
-
id:
|
|
127
|
+
id: o(B),
|
|
127
128
|
ref_key: "panel",
|
|
128
|
-
ref:
|
|
129
|
-
},
|
|
129
|
+
ref: $
|
|
130
|
+
}, o(H), {
|
|
130
131
|
class: "hys-ui-mention-list hys-ui-floating-surface",
|
|
131
|
-
style: { ...
|
|
132
|
+
style: { ...o(X), maxHeight: "min(240px,calc(100vh - 20px))" },
|
|
132
133
|
role: "listbox",
|
|
133
134
|
"aria-label": "提及候选成员"
|
|
134
135
|
}), [
|
|
135
|
-
(
|
|
136
|
-
var
|
|
137
|
-
return
|
|
138
|
-
id:
|
|
136
|
+
(C(!0), F(ue, null, ce(y.value, (a) => {
|
|
137
|
+
var f, u, p;
|
|
138
|
+
return C(), F("button", {
|
|
139
|
+
id: o(B) + "-" + a.id,
|
|
139
140
|
key: a.id,
|
|
140
141
|
type: "button",
|
|
141
142
|
role: "option",
|
|
142
143
|
disabled: a.disabled,
|
|
143
|
-
"aria-selected": ((
|
|
144
|
-
"data-active": ((u = s.value[
|
|
145
|
-
class:
|
|
146
|
-
onMousedown: t[4] || (t[4] =
|
|
144
|
+
"aria-selected": ((f = s.value[n.value]) == null ? void 0 : f.id) === a.id,
|
|
145
|
+
"data-active": ((u = s.value[n.value]) == null ? void 0 : u.id) === a.id,
|
|
146
|
+
class: fe({ "hys-ui-mention-active": ((p = s.value[n.value]) == null ? void 0 : p.id) === a.id }),
|
|
147
|
+
onMousedown: t[4] || (t[4] = ve(() => {
|
|
147
148
|
}, ["prevent"])),
|
|
148
|
-
onPointerenter: (
|
|
149
|
-
onClick: (
|
|
149
|
+
onPointerenter: (w) => !a.disabled && (n.value = s.value.findIndex((m) => m.id === a.id)),
|
|
150
|
+
onClick: (w) => P(a)
|
|
150
151
|
}, [
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
152
|
+
pe(e.$slots, "option", { user: a }, () => [
|
|
153
|
+
z("span", ke, U(a.name.slice(0, 1)), 1),
|
|
154
|
+
z("span", null, U(a.name), 1)
|
|
154
155
|
], !0)
|
|
155
|
-
], 42,
|
|
156
|
+
], 42, we);
|
|
156
157
|
}), 128))
|
|
157
|
-
], 16,
|
|
158
|
+
], 16, xe)) : he("", !0)
|
|
158
159
|
]))
|
|
159
160
|
], 16);
|
|
160
161
|
};
|
|
161
162
|
}
|
|
162
163
|
});
|
|
163
164
|
export {
|
|
164
|
-
|
|
165
|
+
Se as default
|
|
165
166
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysModal2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const p = /* @__PURE__ */ t(o, [["__scopeId", "data-v-518b4887"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
p as default
|
|
7
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as B, ref as g, toRef as E, watch as O, onDeactivated as $, openBlock as
|
|
1
|
+
import { defineComponent as B, ref as g, toRef as E, watch as O, onDeactivated as $, openBlock as r, createBlock as x, Teleport as D, createVNode as C, Transition as M, withCtx as S, unref as f, withDirectives as H, createElementBlock as y, mergeProps as N, withModifiers as R, createElementVNode as u, normalizeStyle as V, renderSlot as h, toDisplayString as z, createCommentVNode as m, vShow as A } from "vue";
|
|
2
2
|
import { useHysRootAttrs as P } from "../../config.js";
|
|
3
3
|
import { X as T } from "lucide-vue-next";
|
|
4
4
|
import { useDialog as q } from "../../composables/useDialog.js";
|
|
@@ -21,75 +21,75 @@ const W = ["aria-label", "aria-busy"], X = { class: "hys-ui-dialog-head" }, j =
|
|
|
21
21
|
},
|
|
22
22
|
emits: ["close", "closeError"],
|
|
23
23
|
setup(e, { expose: k, emit: w }) {
|
|
24
|
-
const p = P(), s = e,
|
|
25
|
-
s.closeOnEscape &&
|
|
24
|
+
const p = P(), s = e, v = w, d = g(), l = g(!1), { active: n } = q(E(s, "open"), d, () => {
|
|
25
|
+
s.closeOnEscape && i("escape");
|
|
26
26
|
});
|
|
27
|
-
let
|
|
27
|
+
let a = 0;
|
|
28
28
|
function b() {
|
|
29
|
-
|
|
29
|
+
a++, l.value = !1;
|
|
30
30
|
}
|
|
31
31
|
O(() => s.open, (o) => {
|
|
32
32
|
o || b();
|
|
33
33
|
}), $(b);
|
|
34
|
-
async function
|
|
35
|
-
if (
|
|
36
|
-
const
|
|
37
|
-
|
|
34
|
+
async function i(o = "button") {
|
|
35
|
+
if (l.value || !s.open || !n.value) return;
|
|
36
|
+
const t = ++a;
|
|
37
|
+
l.value = !0;
|
|
38
38
|
try {
|
|
39
39
|
if (s.beforeClose && await s.beforeClose(o) === !1) return;
|
|
40
|
-
|
|
41
|
-
} catch (
|
|
42
|
-
|
|
40
|
+
n.value && t === a && v("close");
|
|
41
|
+
} catch (c) {
|
|
42
|
+
n.value && t === a && v("closeError", c);
|
|
43
43
|
} finally {
|
|
44
|
-
|
|
44
|
+
t === a && (l.value = !1);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
return k({ close:
|
|
47
|
+
return k({ close: i, element: d }), (o, t) => (r(), x(D, { to: "body" }, [
|
|
48
48
|
C(M, { name: "hys-ui-modal-motion" }, {
|
|
49
49
|
default: S(() => [
|
|
50
|
-
|
|
50
|
+
f(n) && (e.open || !e.destroyOnClose) ? H((r(), y("div", N({ key: 0 }, f(p), {
|
|
51
51
|
class: ["hys-ui-overlay", { "hys-ui-modal-fullscreen": e.fullscreen }],
|
|
52
|
-
onPointerdown:
|
|
52
|
+
onPointerdown: t[1] || (t[1] = R((c) => e.closeOnMask && i("mask"), ["self"]))
|
|
53
53
|
}), [
|
|
54
|
-
|
|
54
|
+
u("section", {
|
|
55
55
|
ref_key: "dialog",
|
|
56
|
-
ref:
|
|
56
|
+
ref: d,
|
|
57
57
|
tabindex: "-1",
|
|
58
58
|
class: "hys-ui-modal",
|
|
59
59
|
role: "dialog",
|
|
60
60
|
"aria-modal": "true",
|
|
61
61
|
"aria-label": e.title,
|
|
62
|
-
"aria-busy":
|
|
62
|
+
"aria-busy": l.value,
|
|
63
63
|
style: V({ maxWidth: e.fullscreen ? "100%" : e.width, width: e.fullscreen ? "100%" : void 0, height: e.fullscreen ? "100dvh" : void 0, maxHeight: e.fullscreen ? "100dvh" : void 0 })
|
|
64
64
|
}, [
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
65
|
+
u("header", X, [
|
|
66
|
+
h(o.$slots, "header", {}, () => [
|
|
67
|
+
u("h3", null, z(e.title), 1)
|
|
68
68
|
], !0),
|
|
69
|
-
e.showClose ? (
|
|
69
|
+
e.showClose ? (r(), y("button", {
|
|
70
70
|
key: 0,
|
|
71
71
|
type: "button",
|
|
72
72
|
class: "hys-ui-icon-action",
|
|
73
73
|
"aria-label": "关闭",
|
|
74
|
-
disabled:
|
|
75
|
-
onClick:
|
|
74
|
+
disabled: l.value,
|
|
75
|
+
onClick: t[0] || (t[0] = (c) => i("button"))
|
|
76
76
|
}, [
|
|
77
|
-
C(
|
|
78
|
-
], 8, j)) :
|
|
77
|
+
C(f(T), { size: 18 })
|
|
78
|
+
], 8, j)) : m("", !0)
|
|
79
79
|
]),
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
u("div", F, [
|
|
81
|
+
h(o.$slots, "default", {}, void 0, !0)
|
|
82
82
|
]),
|
|
83
|
-
o.$slots.footer ? (
|
|
84
|
-
|
|
85
|
-
close:
|
|
86
|
-
closing:
|
|
83
|
+
o.$slots.footer ? (r(), y("footer", G, [
|
|
84
|
+
h(o.$slots, "footer", {
|
|
85
|
+
close: i,
|
|
86
|
+
closing: l.value
|
|
87
87
|
}, void 0, !0)
|
|
88
|
-
])) :
|
|
88
|
+
])) : m("", !0)
|
|
89
89
|
], 12, W)
|
|
90
90
|
], 16)), [
|
|
91
91
|
[A, e.open]
|
|
92
|
-
]) :
|
|
92
|
+
]) : m("", !0)
|
|
93
93
|
]),
|
|
94
94
|
_: 3
|
|
95
95
|
})
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as y, ref as
|
|
2
|
-
import { useHysRootAttrs as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent as y, ref as h, computed as v, openBlock as d, createElementBlock as n, mergeProps as f, unref as k, createElementVNode as l, toDisplayString as i, Fragment as C, renderList as g, normalizeClass as p, createCommentVNode as x } from "vue";
|
|
2
|
+
import { useHysRootAttrs as $ } from "../../config.js";
|
|
3
|
+
const B = { class: "hys-ui-ent-toolbar" }, N = ["disabled"], A = { class: "hys-ui-ent-toolbar" }, E = ["disabled", "aria-pressed"], H = ["disabled", "aria-pressed"], R = { class: "hys-ui-ent-notices" }, T = ["disabled", "onClick"], V = {
|
|
4
4
|
key: 0,
|
|
5
5
|
class: "hys-ui-ent-muted"
|
|
6
|
-
},
|
|
6
|
+
}, F = /* @__PURE__ */ y({
|
|
7
7
|
__name: "HysNotificationCenter",
|
|
8
8
|
props: {
|
|
9
9
|
items: {},
|
|
@@ -12,50 +12,51 @@ const $ = { class: "hys-ui-ent-toolbar" }, B = ["disabled"], N = { class: "hys-u
|
|
|
12
12
|
disabled: { type: Boolean }
|
|
13
13
|
},
|
|
14
14
|
emits: ["read", "read-all", "open"],
|
|
15
|
-
setup(
|
|
16
|
-
const
|
|
17
|
-
return (u, s) => (
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
setup(e, { emit: b }) {
|
|
16
|
+
const c = $(), m = e, o = b, a = h("all"), r = v(() => m.items.filter((u) => a.value === "all" || !u.read));
|
|
17
|
+
return (u, s) => (d(), n("section", f(k(c), { class: "hys-ui-ent-panel" }), [
|
|
18
|
+
l("header", B, [
|
|
19
|
+
l("strong", null, i(e.title || "通知中心") + " (" + i(e.items.filter((t) => !t.read).length) + ")", 1),
|
|
20
|
+
l("button", {
|
|
21
21
|
type: "button",
|
|
22
|
-
disabled:
|
|
23
|
-
onClick: s[0] || (s[0] = (
|
|
24
|
-
}, "全部已读", 8,
|
|
22
|
+
disabled: e.disabled,
|
|
23
|
+
onClick: s[0] || (s[0] = (t) => !e.disabled && o("read-all"))
|
|
24
|
+
}, "全部已读", 8, N)
|
|
25
25
|
]),
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
l("div", A, [
|
|
27
|
+
l("button", {
|
|
28
28
|
type: "button",
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
disabled: e.disabled,
|
|
30
|
+
"aria-pressed": a.value === "all",
|
|
31
|
+
onClick: s[1] || (s[1] = (t) => !e.disabled && (a.value = "all"))
|
|
32
|
+
}, "全部", 8, E),
|
|
33
|
+
l("button", {
|
|
33
34
|
type: "button",
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
disabled: e.disabled,
|
|
36
|
+
"aria-pressed": a.value === "unread",
|
|
37
|
+
onClick: s[2] || (s[2] = (t) => !e.disabled && (a.value = "unread"))
|
|
38
|
+
}, "未读", 8, H)
|
|
37
39
|
]),
|
|
38
|
-
|
|
39
|
-
(
|
|
40
|
-
key:
|
|
41
|
-
class:
|
|
40
|
+
l("ul", R, [
|
|
41
|
+
(d(!0), n(C, null, g(r.value, (t) => (d(), n("li", {
|
|
42
|
+
key: t.id,
|
|
43
|
+
class: p({ "hys-ui-unread": !t.read })
|
|
42
44
|
}, [
|
|
43
|
-
|
|
45
|
+
l("button", {
|
|
44
46
|
type: "button",
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
}
|
|
47
|
+
disabled: e.disabled,
|
|
48
|
+
onClick: (w) => !e.disabled && (o("open", t.id), o("read", t.id))
|
|
48
49
|
}, [
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
], 8,
|
|
50
|
+
l("strong", null, i(t.title), 1),
|
|
51
|
+
l("span", null, i(t.detail), 1),
|
|
52
|
+
l("small", null, i(t.time), 1)
|
|
53
|
+
], 8, T)
|
|
53
54
|
], 2))), 128))
|
|
54
55
|
]),
|
|
55
|
-
|
|
56
|
+
r.value.length ? x("", !0) : (d(), n("p", V, i(e.emptyText || "暂无通知"), 1))
|
|
56
57
|
], 16));
|
|
57
58
|
}
|
|
58
59
|
});
|
|
59
60
|
export {
|
|
60
|
-
|
|
61
|
+
F as default
|
|
61
62
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import o from "./HysNumberInput2.vue.js";
|
|
2
2
|
/* empty css */
|
|
3
3
|
import t from "../../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
-
const
|
|
4
|
+
const a = /* @__PURE__ */ t(o, [["__scopeId", "data-v-d19c4dda"]]);
|
|
5
5
|
export {
|
|
6
|
-
|
|
6
|
+
a as default
|
|
7
7
|
};
|