vft 0.0.429 → 0.0.430
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/attributes.json +1 -1
- package/es/components/alert/alert.vue2.js +38 -38
- package/es/components/autocomplete/autocomplete.vue2.js +82 -82
- package/es/components/avatar/avatar.vue2.js +23 -23
- package/es/components/avatar-stack/avatar-stack.vue2.js +25 -25
- package/es/components/breadcrumb/breadcrumb-item.vue2.js +19 -19
- package/es/components/button/button.vue2.js +37 -37
- package/es/components/card/card.vue2.js +19 -19
- package/es/components/carousel/carousel.vue2.js +75 -75
- package/es/components/carousel/use-carousel.js +1 -1
- package/es/components/cascader-panel/index.vue2.js +2 -2
- package/es/components/cascader-panel/menu.vue2.js +2 -2
- package/es/components/cascader-panel/node.vue2.js +3 -4
- package/es/components/checkbox/checkbox-button.vue2.js +52 -52
- package/es/components/checkbox/checkbox-group.vue2.js +26 -26
- package/es/components/checkbox/checkbox.vue2.js +57 -57
- package/es/components/clamp/clamp.vue2.js +14 -14
- package/es/components/clamp-toggle/clamp-toggle.vue2.js +17 -17
- package/es/components/clamp-tooltip/clamp-tooltip.vue2.js +19 -19
- package/es/components/col/col.vue2.js +20 -20
- package/es/components/color-picker/color-picker.vue2.js +126 -128
- package/es/components/color-picker/components/sv-panel.vue.js +2 -2
- package/es/components/config-provider/hooks/use-global-config.js +3 -3
- package/es/components/context-menu/context-menu.vue2.js +18 -18
- package/es/components/date-picker/date-picker-com/panel-date-pick.vue2.js +37 -39
- package/es/components/date-picker/date-picker-com/panel-date-range.vue2.js +8 -10
- package/es/components/date-picker/date-picker.d.ts +1 -1
- package/es/components/date-picker/index.d.ts +2 -2
- package/es/components/descriptions/description.vue2.js +44 -44
- package/es/components/descriptions/descriptions-row.vue2.js +12 -12
- package/es/components/dialog/dialog-content.vue2.js +31 -31
- package/es/components/dialog/dialog.vue2.js +46 -46
- package/es/components/divider/divider.vue2.js +19 -19
- package/es/components/drawer/drawer.vue2.js +41 -41
- package/es/components/dropdown/dropdown-item-impl.vue2.js +40 -40
- package/es/components/dropdown/dropdown-item.vue2.js +28 -28
- package/es/components/dropdown/dropdown.vue2.js +124 -124
- package/es/components/form/form-item.vue2.js +71 -71
- package/es/components/header-layout/header-layout.vue2.js +25 -25
- package/es/components/icon/icon.vue2.js +15 -15
- package/es/components/icon-text/icon-text.vue2.js +28 -28
- package/es/components/iframe-layout/iframe-layout.vue2.js +13 -13
- package/es/components/iframe-layout/iframe-page.vue2.js +11 -11
- package/es/components/image/image.vue2.js +63 -63
- package/es/components/image-viewer/image-viewer.vue2.js +88 -88
- package/es/components/infinite-scroll/index.d.ts +1 -1
- package/es/components/input/input.vue2.js +112 -112
- package/es/components/input-number/input-number.vue2.js +100 -100
- package/es/components/input-tag/composables/use-input-tag.js +1 -1
- package/es/components/link/link.vue2.js +20 -20
- package/es/components/list-cell/list-cell.vue2.js +19 -19
- package/es/components/logo/logo.vue2.js +22 -22
- package/es/components/menu/menu-item-group.vue2.js +8 -8
- package/es/components/menu/menu-item.vue2.js +48 -48
- package/es/components/message/message.vue2.js +66 -66
- package/es/components/modal/modal-footer-action.vue2.js +25 -25
- package/es/components/modal/modal.vue2.js +40 -40
- package/es/components/multiple-tabs/multiple-tabs.vue2.js +30 -30
- package/es/components/page-wrapper/page-wrapper.vue2.js +12 -12
- package/es/components/pagination/components/jumper.vue2.js +18 -18
- package/es/components/pagination/components/next.vue2.js +11 -11
- package/es/components/pagination/components/pager.vue2.js +74 -74
- package/es/components/pagination/components/prev.vue2.js +9 -9
- package/es/components/pagination/components/sizes.vue2.js +18 -18
- package/es/components/pagination/components/total.vue2.js +8 -8
- package/es/components/popconfirm/popconfirm.vue2.js +47 -47
- package/es/components/popover/popover.vue2.js +28 -28
- package/es/components/popper/trigger.vue2.js +9 -9
- package/es/components/progress/progress.vue2.js +87 -87
- package/es/components/qrcode/qrcode.vue2.js +31 -31
- package/es/components/radio/radio-button.vue2.js +17 -17
- package/es/components/radio/radio-group.vue2.js +35 -35
- package/es/components/router-view-content/router-view-content.vue2.js +25 -25
- package/es/components/roving-focus-group/roving-focus-item.vue2.js +30 -30
- package/es/components/row/row.vue2.js +5 -5
- package/es/components/scrollbar/bar.vue2.js +16 -16
- package/es/components/scrollbar/scrollbar.vue2.js +48 -48
- package/es/components/scrollbar/thumb.vue2.js +27 -27
- package/es/components/search/search.vue2.js +29 -29
- package/es/components/select/index.d.ts +1 -1
- package/es/components/select/select.vue.d.ts +1 -1
- package/es/components/side-menu/index.d.ts +2 -8
- package/es/components/side-menu/side-menu.vue.d.ts +5 -59
- package/es/components/side-menu/types.d.ts +107 -0
- package/es/components/skeleton/skeleton-item.vue2.js +9 -9
- package/es/components/skeleton/skeleton.vue2.js +14 -14
- package/es/components/slider/button.vue2.js +54 -54
- package/es/components/slider/slider.vue2.js +106 -106
- package/es/components/steps/item.vue2.js +56 -56
- package/es/components/steps/steps.vue2.js +16 -16
- package/es/components/super-form/super-form-action.vue2.js +28 -28
- package/es/components/super-form/super-form-item.vue2.js +1 -1
- package/es/components/switch/switch.vue2.js +108 -108
- package/es/components/table/field.d.ts +4 -4
- package/es/components/teleport/teleport.vue2.js +6 -6
- package/es/components/time-picker/common/picker.vue.d.ts +1 -1
- package/es/components/time-picker/index.d.ts +2 -2
- package/es/components/time-picker/time-picker.d.ts +1 -1
- package/es/components/timeline/timeline-item.vue2.js +20 -20
- package/es/components/tooltip/content.vue2.js +57 -57
- package/es/components/tooltip/tooltip.vue2.js +66 -66
- package/es/components/tooltip/trigger.vue2.js +42 -42
- package/es/components/tree/tree.vue2.js +72 -72
- package/es/components/upload/upload-content.vue2.js +85 -85
- package/es/components/upload/upload-list.vue2.js +70 -70
- package/es/components/upload/upload.vue2.js +86 -86
- package/es/components/verify-code/verify-code.vue2.js +18 -18
- package/es/package.json.d.ts +1 -1
- package/es/package.json.js +1 -1
- package/es/utils/vue/vnode.js +1 -1
- package/lib/components/alert/alert.vue2.cjs +1 -1
- package/lib/components/autocomplete/autocomplete.vue2.cjs +1 -1
- package/lib/components/avatar/avatar.vue2.cjs +1 -1
- package/lib/components/avatar-stack/avatar-stack.vue2.cjs +1 -1
- package/lib/components/breadcrumb/breadcrumb-item.vue2.cjs +1 -1
- package/lib/components/button/button.vue2.cjs +1 -1
- package/lib/components/card/card.vue2.cjs +1 -1
- package/lib/components/carousel/carousel.vue2.cjs +1 -1
- package/lib/components/cascader-panel/index.vue2.cjs +1 -1
- package/lib/components/cascader-panel/menu.vue2.cjs +1 -1
- package/lib/components/cascader-panel/node.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-button.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox-group.vue2.cjs +1 -1
- package/lib/components/checkbox/checkbox.vue2.cjs +1 -1
- package/lib/components/clamp/clamp.vue2.cjs +1 -1
- package/lib/components/clamp-toggle/clamp-toggle.vue2.cjs +1 -1
- package/lib/components/clamp-tooltip/clamp-tooltip.vue2.cjs +1 -1
- package/lib/components/col/col.vue2.cjs +1 -1
- package/lib/components/color-picker/color-picker.vue2.cjs +1 -1
- package/lib/components/color-picker/components/sv-panel.vue.cjs +1 -1
- package/lib/components/context-menu/context-menu.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-pick.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker-com/panel-date-range.vue2.cjs +1 -1
- package/lib/components/date-picker/date-picker.d.ts +1 -1
- package/lib/components/date-picker/index.d.ts +2 -2
- package/lib/components/descriptions/description.vue2.cjs +1 -1
- package/lib/components/descriptions/descriptions-row.vue2.cjs +1 -1
- package/lib/components/dialog/dialog-content.vue2.cjs +1 -1
- package/lib/components/dialog/dialog.vue2.cjs +1 -1
- package/lib/components/divider/divider.vue2.cjs +1 -1
- package/lib/components/drawer/drawer.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item-impl.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown-item.vue2.cjs +1 -1
- package/lib/components/dropdown/dropdown.vue2.cjs +1 -1
- package/lib/components/form/form-item.vue2.cjs +1 -1
- package/lib/components/header-layout/header-layout.vue2.cjs +1 -1
- package/lib/components/icon/icon.vue2.cjs +1 -1
- package/lib/components/icon-text/icon-text.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-layout.vue2.cjs +1 -1
- package/lib/components/iframe-layout/iframe-page.vue2.cjs +1 -1
- package/lib/components/image/image.vue2.cjs +1 -1
- package/lib/components/image-viewer/image-viewer.vue2.cjs +1 -1
- package/lib/components/infinite-scroll/index.d.ts +1 -1
- package/lib/components/input/input.vue2.cjs +1 -1
- package/lib/components/input-number/input-number.vue2.cjs +1 -1
- package/lib/components/link/link.vue2.cjs +1 -1
- package/lib/components/list-cell/list-cell.vue2.cjs +1 -1
- package/lib/components/logo/logo.vue2.cjs +1 -1
- package/lib/components/menu/menu-item-group.vue2.cjs +1 -1
- package/lib/components/menu/menu-item.vue2.cjs +1 -1
- package/lib/components/message/message.vue2.cjs +1 -1
- package/lib/components/modal/modal-footer-action.vue2.cjs +1 -1
- package/lib/components/modal/modal.vue2.cjs +1 -1
- package/lib/components/multiple-tabs/multiple-tabs.vue2.cjs +1 -1
- package/lib/components/page-wrapper/page-wrapper.vue2.cjs +1 -1
- package/lib/components/pagination/components/jumper.vue2.cjs +1 -1
- package/lib/components/pagination/components/next.vue2.cjs +1 -1
- package/lib/components/pagination/components/pager.vue2.cjs +1 -1
- package/lib/components/pagination/components/prev.vue2.cjs +1 -1
- package/lib/components/pagination/components/sizes.vue2.cjs +1 -1
- package/lib/components/pagination/components/total.vue2.cjs +1 -1
- package/lib/components/popconfirm/popconfirm.vue2.cjs +1 -1
- package/lib/components/popover/popover.vue2.cjs +1 -1
- package/lib/components/popper/trigger.vue2.cjs +1 -1
- package/lib/components/progress/progress.vue2.cjs +5 -5
- package/lib/components/qrcode/qrcode.vue2.cjs +1 -1
- package/lib/components/radio/radio-button.vue2.cjs +1 -1
- package/lib/components/radio/radio-group.vue2.cjs +1 -1
- package/lib/components/router-view-content/router-view-content.vue2.cjs +1 -1
- package/lib/components/roving-focus-group/roving-focus-item.vue2.cjs +1 -1
- package/lib/components/row/row.vue2.cjs +1 -1
- package/lib/components/scrollbar/bar.vue2.cjs +1 -1
- package/lib/components/scrollbar/scrollbar.vue2.cjs +1 -1
- package/lib/components/scrollbar/thumb.vue2.cjs +1 -1
- package/lib/components/search/search.vue2.cjs +1 -1
- package/lib/components/select/index.d.ts +1 -1
- package/lib/components/select/select.vue.d.ts +1 -1
- package/lib/components/side-menu/index.d.ts +2 -8
- package/lib/components/side-menu/side-menu.vue.d.ts +5 -59
- package/lib/components/side-menu/types.d.ts +107 -0
- package/lib/components/skeleton/skeleton-item.vue2.cjs +1 -1
- package/lib/components/skeleton/skeleton.vue2.cjs +1 -1
- package/lib/components/slider/button.vue2.cjs +1 -1
- package/lib/components/slider/slider.vue2.cjs +1 -1
- package/lib/components/steps/item.vue2.cjs +1 -1
- package/lib/components/steps/steps.vue2.cjs +1 -1
- package/lib/components/super-form/super-form-action.vue2.cjs +1 -1
- package/lib/components/switch/switch.vue2.cjs +1 -1
- package/lib/components/table/field.d.ts +4 -4
- package/lib/components/teleport/teleport.vue2.cjs +1 -1
- package/lib/components/time-picker/common/picker.vue.d.ts +1 -1
- package/lib/components/time-picker/index.d.ts +2 -2
- package/lib/components/time-picker/time-picker.d.ts +1 -1
- package/lib/components/timeline/timeline-item.vue2.cjs +1 -1
- package/lib/components/tooltip/content.vue2.cjs +1 -1
- package/lib/components/tooltip/tooltip.vue2.cjs +1 -1
- package/lib/components/tooltip/trigger.vue2.cjs +1 -1
- package/lib/components/tree/tree.vue2.cjs +1 -1
- package/lib/components/upload/upload-content.vue2.cjs +1 -1
- package/lib/components/upload/upload-list.vue2.cjs +1 -1
- package/lib/components/upload/upload.vue2.cjs +1 -1
- package/lib/components/verify-code/verify-code.vue2.cjs +1 -1
- package/lib/package.json.cjs +1 -1
- package/lib/package.json.d.ts +1 -1
- package/package.json +5 -5
- package/tags.json +1 -1
- package/theme-style/src/mixins/mixins.scss +1 -0
- package/web-types.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as f, inject as d, computed as n, createBlock as h, openBlock as $, resolveDynamicComponent as g, normalizeStyle as b, normalizeClass as v, withCtx as x, renderSlot as y } from "vue";
|
|
2
2
|
import "../row/index.js";
|
|
3
3
|
import "@vueuse/core";
|
|
4
|
-
import { isNumber as
|
|
4
|
+
import { isNumber as c, isObject as _ } from "@vft/utils";
|
|
5
5
|
import "../config-provider/hooks/use-global-config.js";
|
|
6
6
|
import "lodash-es";
|
|
7
7
|
import "../form/index.js";
|
|
@@ -10,9 +10,9 @@ import "../../hooks/use-model-toggle/index.js";
|
|
|
10
10
|
import "@popperjs/core";
|
|
11
11
|
import "../../hooks/use-z-index/index.js";
|
|
12
12
|
import { rowContextKey as j } from "../row/constants.js";
|
|
13
|
-
const E =
|
|
13
|
+
const E = f({
|
|
14
14
|
name: "vft-col"
|
|
15
|
-
}), G = /* @__PURE__ */
|
|
15
|
+
}), G = /* @__PURE__ */ f({
|
|
16
16
|
...E,
|
|
17
17
|
props: {
|
|
18
18
|
tag: { default: "div" },
|
|
@@ -26,31 +26,31 @@ const E = c({
|
|
|
26
26
|
pull: { default: 0 },
|
|
27
27
|
push: { default: 0 }
|
|
28
28
|
},
|
|
29
|
-
setup(
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
return a.value && (
|
|
29
|
+
setup(r) {
|
|
30
|
+
const s = C("col"), o = r, { gutter: a } = d(j, { gutter: n(() => 0) }), i = n(() => {
|
|
31
|
+
const e = {};
|
|
32
|
+
return a.value && (e.paddingLeft = e.paddingRight = `${a.value / 2}px`), e;
|
|
33
33
|
}), m = n(() => {
|
|
34
|
-
const
|
|
35
|
-
return ["span", "offset", "pull", "push"].forEach((
|
|
36
|
-
const l = o[
|
|
37
|
-
|
|
38
|
-
}), ["xs", "sm", "md", "lg", "xl"].forEach((
|
|
39
|
-
|
|
40
|
-
([l,
|
|
41
|
-
|
|
42
|
-
l !== "span" ?
|
|
34
|
+
const e = [];
|
|
35
|
+
return ["span", "offset", "pull", "push"].forEach((t) => {
|
|
36
|
+
const l = o[t];
|
|
37
|
+
c(l) && (t === "span" ? e.push(s.b(`${o[t]}`)) : l > 0 && e.push(s.b(`${t}-${o[t]}`)));
|
|
38
|
+
}), ["xs", "sm", "md", "lg", "xl"].forEach((t) => {
|
|
39
|
+
c(o[t]) ? e.push(s.b(`${t}-${o[t]}`)) : _(o[t]) && Object.entries(o[t]).forEach(
|
|
40
|
+
([l, u]) => {
|
|
41
|
+
e.push(
|
|
42
|
+
l !== "span" ? s.b(`${t}-${l}-${u}`) : s.b(`${t}-${u}`)
|
|
43
43
|
);
|
|
44
44
|
}
|
|
45
45
|
);
|
|
46
|
-
}), a.value &&
|
|
46
|
+
}), a.value && e.push(s.is("guttered")), [s.b(), e];
|
|
47
47
|
});
|
|
48
|
-
return (
|
|
48
|
+
return (e, p) => ($(), h(g(r.tag), {
|
|
49
49
|
class: v(m.value),
|
|
50
50
|
style: b(i.value)
|
|
51
51
|
}, {
|
|
52
52
|
default: x(() => [
|
|
53
|
-
y(
|
|
53
|
+
y(e.$slots, "default")
|
|
54
54
|
]),
|
|
55
55
|
_: 3
|
|
56
56
|
}, 8, ["class", "style"]));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { ClickOutside as
|
|
3
|
-
import { VftButton as
|
|
1
|
+
import { defineComponent as W, ref as c, reactive as ie, computed as b, onMounted as se, watch as g, nextTick as C, provide as ce, createBlock as V, openBlock as m, unref as e, withCtx as y, createElementVNode as u, withKeys as L, normalizeClass as n, createElementBlock as H, createCommentVNode as E, normalizeStyle as ue, withDirectives as M, createVNode as p, vShow as de, createTextVNode as O } from "vue";
|
|
2
|
+
import { ClickOutside as me } from "@vft/directives";
|
|
3
|
+
import { VftButton as R } from "../button/index.js";
|
|
4
4
|
import "../form/index.js";
|
|
5
|
-
import { VftIcon as
|
|
6
|
-
import { VftInput as
|
|
5
|
+
import { VftIcon as U } from "../icon/index.js";
|
|
6
|
+
import { VftInput as pe } from "../input/index.js";
|
|
7
7
|
import { VftTooltip as fe } from "../tooltip/index.js";
|
|
8
|
-
import { UPDATE_MODEL_EVENT as
|
|
8
|
+
import { UPDATE_MODEL_EVENT as P, CHANGE_EVENT as ve } from "../../constants/event.js";
|
|
9
9
|
import "@vueuse/core";
|
|
10
10
|
import "@vft/utils";
|
|
11
|
-
import { debugWarn as
|
|
11
|
+
import { debugWarn as G } from "../../utils/error.js";
|
|
12
12
|
import "../config-provider/hooks/use-global-config.js";
|
|
13
13
|
import { debounce as be } from "lodash-es";
|
|
14
14
|
import { useNamespace as he } from "../../hooks/use-namespace/index.js";
|
|
@@ -20,13 +20,13 @@ import we from "./components/hue-slider.vue.js";
|
|
|
20
20
|
import ge from "./components/predefine.vue.js";
|
|
21
21
|
import Ce from "./components/sv-panel.vue.js";
|
|
22
22
|
import { colorPickerContextKey as Ve } from "./contants.js";
|
|
23
|
-
import
|
|
23
|
+
import $ from "./utils/color.js";
|
|
24
24
|
import { useFormItem as ye, useFormItemInputId as Ee } from "../form/hooks/use-form-item.js";
|
|
25
|
-
import { useFormSize as
|
|
26
|
-
const
|
|
25
|
+
import { useFormSize as xe, useFormDisabled as Ae } from "../form/hooks/use-form-common-props.js";
|
|
26
|
+
const Ie = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex"], Se = W({
|
|
27
27
|
name: "VftColorPicker"
|
|
28
|
-
}), eo = /* @__PURE__ */
|
|
29
|
-
...
|
|
28
|
+
}), eo = /* @__PURE__ */ W({
|
|
29
|
+
...Se,
|
|
30
30
|
props: {
|
|
31
31
|
modelValue: {},
|
|
32
32
|
id: {},
|
|
@@ -41,230 +41,228 @@ const Se = ["id", "aria-label", "aria-labelledby", "aria-description", "tabindex
|
|
|
41
41
|
validateEvent: { type: Boolean, default: !0 }
|
|
42
42
|
},
|
|
43
43
|
emits: [
|
|
44
|
-
|
|
44
|
+
P,
|
|
45
45
|
ve,
|
|
46
46
|
"activeChange",
|
|
47
47
|
"click-outside"
|
|
48
48
|
],
|
|
49
|
-
setup(
|
|
50
|
-
const a =
|
|
51
|
-
formItemContext:
|
|
52
|
-
}),
|
|
49
|
+
setup(i, { expose: j, emit: q }) {
|
|
50
|
+
const a = i, d = q, l = he("color"), { formItem: h } = ye(), J = xe(), x = Ae(), { inputId: Q, isLabeledByFormItem: z } = Ee(a, {
|
|
51
|
+
formItemContext: h
|
|
52
|
+
}), B = c(), X = c(), F = c(), Y = c();
|
|
53
53
|
let A = !0;
|
|
54
|
-
const
|
|
55
|
-
new
|
|
54
|
+
const t = ie(
|
|
55
|
+
new $({
|
|
56
56
|
enableAlpha: a.showAlpha,
|
|
57
57
|
format: a.colorFormat || "",
|
|
58
58
|
value: a.modelValue
|
|
59
59
|
})
|
|
60
|
-
),
|
|
60
|
+
), f = c(!1), s = c(!1), v = c(""), Z = b(() => !a.modelValue && !s.value ? "transparent" : le(t, a.showAlpha)), I = b(() => !a.modelValue && !s.value ? "" : t.value), _ = b(() => z.value ? void 0 : a.label || "色彩选择器"), ee = b(() => z.value ? h?.labelId : void 0), oe = b(() => [
|
|
61
61
|
l.b("picker"),
|
|
62
|
-
l.is("disabled",
|
|
63
|
-
l.bm("picker",
|
|
62
|
+
l.is("disabled", x.value),
|
|
63
|
+
l.bm("picker", J.value)
|
|
64
64
|
]);
|
|
65
|
-
function le(
|
|
66
|
-
if (!(
|
|
65
|
+
function le(o, r) {
|
|
66
|
+
if (!(o instanceof $))
|
|
67
67
|
throw new TypeError("color should be instance of _color Class");
|
|
68
|
-
const { r:
|
|
69
|
-
return
|
|
68
|
+
const { r: w, g: D, b: K } = o.toRgb();
|
|
69
|
+
return r ? `rgba(${w}, ${D}, ${K}, ${o.get("alpha") / 100})` : `rgb(${w}, ${D}, ${K})`;
|
|
70
70
|
}
|
|
71
|
-
function ae(
|
|
72
|
-
|
|
71
|
+
function ae(o) {
|
|
72
|
+
f.value = o;
|
|
73
73
|
}
|
|
74
|
-
const
|
|
75
|
-
function
|
|
76
|
-
|
|
74
|
+
const k = be(ae, 100);
|
|
75
|
+
function te(o) {
|
|
76
|
+
k(!1), S(), d("click-outside", o);
|
|
77
77
|
}
|
|
78
78
|
function S() {
|
|
79
|
-
|
|
80
|
-
a.modelValue ?
|
|
81
|
-
|
|
79
|
+
C(() => {
|
|
80
|
+
a.modelValue ? t.fromString(a.modelValue) : (t.value = "", C(() => {
|
|
81
|
+
s.value = !1;
|
|
82
82
|
}));
|
|
83
83
|
});
|
|
84
84
|
}
|
|
85
|
-
function F() {
|
|
86
|
-
E.value || h(!m.value);
|
|
87
|
-
}
|
|
88
85
|
function N() {
|
|
89
|
-
|
|
86
|
+
x.value || k(!f.value);
|
|
87
|
+
}
|
|
88
|
+
function T() {
|
|
89
|
+
t.fromString(v.value);
|
|
90
90
|
}
|
|
91
|
-
function
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
const
|
|
91
|
+
function re() {
|
|
92
|
+
const o = t.value;
|
|
93
|
+
d(P, o), d("change", o), a.validateEvent && h?.validate("change").catch((r) => G(r)), k(!1), C(() => {
|
|
94
|
+
const r = new $({
|
|
95
95
|
enableAlpha: a.showAlpha,
|
|
96
96
|
format: a.colorFormat || "",
|
|
97
97
|
value: a.modelValue
|
|
98
98
|
});
|
|
99
|
-
|
|
99
|
+
t.compare(r) || S();
|
|
100
100
|
});
|
|
101
101
|
}
|
|
102
102
|
function ne() {
|
|
103
|
-
|
|
103
|
+
k(!1), d(P, null), d("change", null), a.modelValue !== null && a.validateEvent && h?.validate("change").catch((o) => G(o)), S();
|
|
104
104
|
}
|
|
105
105
|
return se(() => {
|
|
106
|
-
a.modelValue && (
|
|
107
|
-
}),
|
|
106
|
+
a.modelValue && (v.value = I.value);
|
|
107
|
+
}), g(
|
|
108
108
|
() => a.modelValue,
|
|
109
|
-
(
|
|
110
|
-
|
|
109
|
+
(o) => {
|
|
110
|
+
o ? o && o !== t.value && (A = !1, t.fromString(o)) : s.value = !1;
|
|
111
111
|
}
|
|
112
|
-
),
|
|
112
|
+
), g(
|
|
113
113
|
() => I.value,
|
|
114
|
-
(
|
|
115
|
-
|
|
114
|
+
(o) => {
|
|
115
|
+
v.value = o, A && d("activeChange", o), A = !0;
|
|
116
116
|
}
|
|
117
|
-
),
|
|
118
|
-
() =>
|
|
117
|
+
), g(
|
|
118
|
+
() => t.value,
|
|
119
119
|
() => {
|
|
120
|
-
!a.modelValue && !
|
|
120
|
+
!a.modelValue && !s.value && (s.value = !0);
|
|
121
121
|
}
|
|
122
|
-
),
|
|
123
|
-
() =>
|
|
122
|
+
), g(
|
|
123
|
+
() => f.value,
|
|
124
124
|
() => {
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
C(() => {
|
|
126
|
+
B.value?.update(), X.value?.update(), F.value?.update();
|
|
127
127
|
});
|
|
128
128
|
}
|
|
129
|
-
),
|
|
129
|
+
), ce(Ve, {
|
|
130
130
|
currentColor: I
|
|
131
|
-
}),
|
|
131
|
+
}), j({
|
|
132
132
|
/**
|
|
133
133
|
* @description current color object
|
|
134
134
|
*/
|
|
135
|
-
color:
|
|
136
|
-
showPicker:
|
|
137
|
-
}), (
|
|
135
|
+
color: t,
|
|
136
|
+
showPicker: f
|
|
137
|
+
}), (o, r) => (m(), V(e(fe), {
|
|
138
138
|
ref_key: "popper",
|
|
139
|
-
ref:
|
|
140
|
-
visible:
|
|
139
|
+
ref: Y,
|
|
140
|
+
visible: f.value,
|
|
141
141
|
"show-arrow": !1,
|
|
142
142
|
"fallback-placements": ["bottom", "top", "right", "left"],
|
|
143
143
|
offset: 0,
|
|
144
144
|
"gpu-acceleration": !1,
|
|
145
|
-
"popper-class": [
|
|
145
|
+
"popper-class": [e(l).be("picker", "panel"), e(l).b("dropdown"), i.popperClass],
|
|
146
146
|
"stop-popper-mouse-event": !1,
|
|
147
147
|
effect: "light",
|
|
148
148
|
trigger: "click",
|
|
149
|
-
transition: `${
|
|
149
|
+
transition: `${e(l).namespace.value}-zoom-in-top`,
|
|
150
150
|
persistent: ""
|
|
151
151
|
}, {
|
|
152
|
-
content:
|
|
153
|
-
|
|
152
|
+
content: y(() => [
|
|
153
|
+
M((m(), H("div", null, [
|
|
154
154
|
u("div", {
|
|
155
|
-
class: n(
|
|
155
|
+
class: n(e(l).be("dropdown", "main-wrapper"))
|
|
156
156
|
}, [
|
|
157
|
-
|
|
157
|
+
p(we, {
|
|
158
158
|
ref_key: "hue",
|
|
159
|
-
ref:
|
|
159
|
+
ref: B,
|
|
160
160
|
class: "hue-slider",
|
|
161
|
-
color:
|
|
161
|
+
color: t,
|
|
162
162
|
vertical: ""
|
|
163
163
|
}, null, 8, ["color"]),
|
|
164
|
-
|
|
164
|
+
p(Ce, {
|
|
165
165
|
ref: "svPanel",
|
|
166
|
-
color:
|
|
166
|
+
color: t
|
|
167
167
|
}, null, 8, ["color"])
|
|
168
168
|
], 2),
|
|
169
|
-
|
|
169
|
+
i.showAlpha ? (m(), V(ke, {
|
|
170
170
|
key: 0,
|
|
171
171
|
ref_key: "alpha",
|
|
172
|
-
ref:
|
|
173
|
-
color:
|
|
174
|
-
}, null, 8, ["color"])) :
|
|
175
|
-
|
|
172
|
+
ref: F,
|
|
173
|
+
color: t
|
|
174
|
+
}, null, 8, ["color"])) : E("", !0),
|
|
175
|
+
i.predefine ? (m(), V(ge, {
|
|
176
176
|
key: 1,
|
|
177
177
|
ref: "predefine",
|
|
178
|
-
color:
|
|
179
|
-
colors:
|
|
180
|
-
}, null, 8, ["color", "colors"])) :
|
|
178
|
+
color: t,
|
|
179
|
+
colors: i.predefine
|
|
180
|
+
}, null, 8, ["color", "colors"])) : E("", !0),
|
|
181
181
|
u("div", {
|
|
182
|
-
class: n(
|
|
182
|
+
class: n(e(l).be("dropdown", "btns"))
|
|
183
183
|
}, [
|
|
184
184
|
u("span", {
|
|
185
|
-
class: n(
|
|
185
|
+
class: n(e(l).be("dropdown", "value"))
|
|
186
186
|
}, [
|
|
187
|
-
|
|
188
|
-
modelValue:
|
|
189
|
-
"onUpdate:modelValue":
|
|
187
|
+
p(e(pe), {
|
|
188
|
+
modelValue: v.value,
|
|
189
|
+
"onUpdate:modelValue": r[0] || (r[0] = (w) => v.value = w),
|
|
190
190
|
"validate-event": !1,
|
|
191
191
|
size: "small",
|
|
192
|
-
onKeyup:
|
|
193
|
-
onBlur:
|
|
192
|
+
onKeyup: L(T, ["enter"]),
|
|
193
|
+
onBlur: T
|
|
194
194
|
}, null, 8, ["modelValue"])
|
|
195
195
|
], 2),
|
|
196
|
-
|
|
197
|
-
class: n(
|
|
196
|
+
p(e(R), {
|
|
197
|
+
class: n(e(l).be("dropdown", "link-btn")),
|
|
198
198
|
text: "",
|
|
199
199
|
size: "small",
|
|
200
200
|
onClick: ne
|
|
201
201
|
}, {
|
|
202
|
-
default:
|
|
203
|
-
|
|
204
|
-
])),
|
|
205
|
-
_: 1
|
|
206
|
-
__: [1]
|
|
202
|
+
default: y(() => [...r[1] || (r[1] = [
|
|
203
|
+
O(" 清除 ", -1)
|
|
204
|
+
])]),
|
|
205
|
+
_: 1
|
|
207
206
|
}, 8, ["class"]),
|
|
208
|
-
|
|
207
|
+
p(e(R), {
|
|
209
208
|
plain: "",
|
|
210
209
|
size: "small",
|
|
211
|
-
class: n(
|
|
212
|
-
onClick:
|
|
210
|
+
class: n(e(l).be("dropdown", "btn")),
|
|
211
|
+
onClick: re
|
|
213
212
|
}, {
|
|
214
|
-
default:
|
|
215
|
-
|
|
216
|
-
])),
|
|
217
|
-
_: 1
|
|
218
|
-
__: [2]
|
|
213
|
+
default: y(() => [...r[2] || (r[2] = [
|
|
214
|
+
O(" 确认 ", -1)
|
|
215
|
+
])]),
|
|
216
|
+
_: 1
|
|
219
217
|
}, 8, ["class"])
|
|
220
218
|
], 2)
|
|
221
219
|
])), [
|
|
222
|
-
[
|
|
220
|
+
[e(me), te]
|
|
223
221
|
])
|
|
224
222
|
]),
|
|
225
|
-
default:
|
|
223
|
+
default: y(() => [
|
|
226
224
|
u("div", {
|
|
227
|
-
id:
|
|
225
|
+
id: e(Q),
|
|
228
226
|
class: n(oe.value),
|
|
229
227
|
role: "button",
|
|
230
|
-
"aria-label":
|
|
228
|
+
"aria-label": _.value,
|
|
231
229
|
"aria-labelledby": ee.value,
|
|
232
|
-
"aria-description": `目前色彩為 {color}。按一下 Enter 以選擇新色彩${
|
|
233
|
-
tabindex:
|
|
234
|
-
onKeydown:
|
|
230
|
+
"aria-description": `目前色彩為 {color}。按一下 Enter 以選擇新色彩${i.modelValue}`,
|
|
231
|
+
tabindex: i.tabindex,
|
|
232
|
+
onKeydown: L(N, ["enter"])
|
|
235
233
|
}, [
|
|
236
|
-
|
|
234
|
+
e(x) ? (m(), H("div", {
|
|
237
235
|
key: 0,
|
|
238
|
-
class: n(
|
|
239
|
-
}, null, 2)) :
|
|
236
|
+
class: n(e(l).be("picker", "mask"))
|
|
237
|
+
}, null, 2)) : E("", !0),
|
|
240
238
|
u("div", {
|
|
241
|
-
class: n(
|
|
242
|
-
onClick:
|
|
239
|
+
class: n(e(l).be("picker", "trigger")),
|
|
240
|
+
onClick: N
|
|
243
241
|
}, [
|
|
244
242
|
u("span", {
|
|
245
|
-
class: n([
|
|
243
|
+
class: n([e(l).be("picker", "color"), e(l).is("alpha", i.showAlpha)])
|
|
246
244
|
}, [
|
|
247
245
|
u("span", {
|
|
248
|
-
class: n(
|
|
249
|
-
style:
|
|
250
|
-
backgroundColor:
|
|
246
|
+
class: n(e(l).be("picker", "color-inner")),
|
|
247
|
+
style: ue({
|
|
248
|
+
backgroundColor: Z.value
|
|
251
249
|
})
|
|
252
250
|
}, [
|
|
253
|
-
|
|
251
|
+
M(p(e(U), {
|
|
254
252
|
icon: "icon-arrow-down",
|
|
255
|
-
class: n([
|
|
253
|
+
class: n([e(l).be("picker", "icon"), e(l).is("icon-arrow-down")])
|
|
256
254
|
}, null, 8, ["class"]), [
|
|
257
|
-
[
|
|
255
|
+
[de, i.modelValue || s.value]
|
|
258
256
|
]),
|
|
259
|
-
!
|
|
257
|
+
!i.modelValue && !s.value ? (m(), V(e(U), {
|
|
260
258
|
key: 0,
|
|
261
259
|
icon: "icon-circle-close",
|
|
262
|
-
class: n([
|
|
263
|
-
}, null, 8, ["class"])) :
|
|
260
|
+
class: n([e(l).be("picker", "empty"), e(l).is("icon-close")])
|
|
261
|
+
}, null, 8, ["class"])) : E("", !0)
|
|
264
262
|
], 6)
|
|
265
263
|
], 2)
|
|
266
264
|
], 2)
|
|
267
|
-
], 42,
|
|
265
|
+
], 42, Ie)
|
|
268
266
|
]),
|
|
269
267
|
_: 1
|
|
270
268
|
}, 8, ["visible", "popper-class", "transition"]));
|
|
@@ -20,9 +20,9 @@ function p(e, l, u, d, c, m) {
|
|
|
20
20
|
top: e.cursorTop + "px",
|
|
21
21
|
left: e.cursorLeft + "px"
|
|
22
22
|
})
|
|
23
|
-
}, l[0] || (l[0] = [
|
|
23
|
+
}, [...l[0] || (l[0] = [
|
|
24
24
|
r("div", null, null, -1)
|
|
25
|
-
]), 6)
|
|
25
|
+
])], 6)
|
|
26
26
|
], 6);
|
|
27
27
|
}
|
|
28
28
|
const b = /* @__PURE__ */ i(n, [["render", p]]);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { keysOf as f } from "@vft/utils";
|
|
2
2
|
import "@vueuse/core";
|
|
3
3
|
import { debugWarn as v } from "../../../utils/error.js";
|
|
4
|
-
import { getCurrentInstance as l, computed as i, unref as p, provide as
|
|
4
|
+
import { ref as g, getCurrentInstance as l, computed as i, unref as p, provide as C, inject as x } from "vue";
|
|
5
5
|
import "lodash-es";
|
|
6
6
|
import "../../form/index.js";
|
|
7
7
|
import { namespaceContextKey as I, useNamespace as b, defaultNamespace as y } from "../../../hooks/use-namespace/index.js";
|
|
@@ -9,7 +9,7 @@ import "../../../hooks/use-model-toggle/index.js";
|
|
|
9
9
|
import "@popperjs/core";
|
|
10
10
|
import { zIndexContextKey as G, useZIndex as z, defaultInitialZIndex as K } from "../../../hooks/use-z-index/index.js";
|
|
11
11
|
import { configProviderContextKey as m } from "../constants.js";
|
|
12
|
-
const a =
|
|
12
|
+
const a = g();
|
|
13
13
|
function d(o, e = void 0) {
|
|
14
14
|
const n = l() ? x(m, a) : a;
|
|
15
15
|
return o ? i(() => n?.value?.[o] ?? e) : n;
|
|
@@ -27,7 +27,7 @@ function B(o) {
|
|
|
27
27
|
};
|
|
28
28
|
}
|
|
29
29
|
const S = (o, e, n = !1) => {
|
|
30
|
-
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ?
|
|
30
|
+
const t = !!l(), r = t ? d() : void 0, u = e?.provide ?? (t ? C : void 0);
|
|
31
31
|
if (!u) {
|
|
32
32
|
v(
|
|
33
33
|
"provideGlobalConfig",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent as p, ref as
|
|
1
|
+
import { defineComponent as p, ref as c, computed as k, createBlock as d, openBlock as r, Transition as C, withCtx as b, withDirectives as g, createElementVNode as m, normalizeClass as z, withModifiers as M, normalizeStyle as $, unref as u, createElementBlock as B, Fragment as E, renderList as S, vShow as F } from "vue";
|
|
2
2
|
import { useTimeoutFn as H, useClickAway as I, useEventListener as f } from "@vft/use";
|
|
3
3
|
import { VftMenuItem as L } from "../menu/index.js";
|
|
4
4
|
import "@vueuse/core";
|
|
@@ -12,7 +12,7 @@ import "@popperjs/core";
|
|
|
12
12
|
import "../../hooks/use-z-index/index.js";
|
|
13
13
|
const R = { class: "vft-sub-menu" }, T = p({
|
|
14
14
|
name: "vft-context-menu"
|
|
15
|
-
}),
|
|
15
|
+
}), U = /* @__PURE__ */ p({
|
|
16
16
|
...T,
|
|
17
17
|
props: {
|
|
18
18
|
axis: {},
|
|
@@ -20,27 +20,27 @@ const R = { class: "vft-sub-menu" }, T = p({
|
|
|
20
20
|
width: {},
|
|
21
21
|
items: {}
|
|
22
22
|
},
|
|
23
|
-
setup(
|
|
23
|
+
setup(n) {
|
|
24
24
|
const v = N("context-menu");
|
|
25
|
-
let a =
|
|
25
|
+
let a = c();
|
|
26
26
|
const x = k(() => {
|
|
27
|
-
const { x: t, y:
|
|
27
|
+
const { x: t, y: o } = n.axis || { x: 0, y: 0 }, e = (n.items || []).length * 40, l = n.width || 0, s = document.body, w = s.clientWidth < t + l ? t - l : t, y = s.clientHeight < o + e ? o - e : o;
|
|
28
28
|
return {
|
|
29
29
|
zIndex: 3e3,
|
|
30
|
-
...
|
|
30
|
+
...n.styles,
|
|
31
31
|
position: "fixed",
|
|
32
|
-
width: `${
|
|
32
|
+
width: `${n.width}px`,
|
|
33
33
|
left: `${w + 1}px`,
|
|
34
34
|
top: `${y + 1}px`
|
|
35
35
|
};
|
|
36
36
|
});
|
|
37
|
-
let
|
|
37
|
+
let i = c(!1);
|
|
38
38
|
H(() => {
|
|
39
|
-
|
|
39
|
+
i.value = !0;
|
|
40
40
|
}, 0), I(
|
|
41
41
|
a,
|
|
42
42
|
() => {
|
|
43
|
-
|
|
43
|
+
i.value = !1;
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
listenerOptions: {
|
|
@@ -51,7 +51,7 @@ const R = { class: "vft-sub-menu" }, T = p({
|
|
|
51
51
|
window,
|
|
52
52
|
"scroll",
|
|
53
53
|
() => {
|
|
54
|
-
|
|
54
|
+
i.value = !1;
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
capture: !0
|
|
@@ -60,27 +60,27 @@ const R = { class: "vft-sub-menu" }, T = p({
|
|
|
60
60
|
window,
|
|
61
61
|
"drag",
|
|
62
62
|
() => {
|
|
63
|
-
|
|
63
|
+
i.value = !1;
|
|
64
64
|
},
|
|
65
65
|
{
|
|
66
66
|
capture: !0
|
|
67
67
|
}
|
|
68
68
|
);
|
|
69
69
|
function h(t) {
|
|
70
|
-
t?.disabled || (t.handler?.(),
|
|
70
|
+
t?.disabled || (t.handler?.(), i.value = !1);
|
|
71
71
|
}
|
|
72
|
-
return (t,
|
|
72
|
+
return (t, o) => (r(), d(C, { name: "vft-zoom-in-top" }, {
|
|
73
73
|
default: b(() => [
|
|
74
74
|
g(m("div", {
|
|
75
75
|
ref_key: "contextMenuRef",
|
|
76
76
|
ref: a,
|
|
77
77
|
style: $(x.value),
|
|
78
|
-
onClick:
|
|
78
|
+
onClick: o[0] || (o[0] = M(() => {
|
|
79
79
|
}, ["stop"])),
|
|
80
80
|
class: z([u(v).b(), "vft-menu"])
|
|
81
81
|
}, [
|
|
82
82
|
m("div", R, [
|
|
83
|
-
(r(!0), B(E, null, S(
|
|
83
|
+
(r(!0), B(E, null, S(n.items, (e, l) => (r(), d(u(L), {
|
|
84
84
|
onClick: (s) => h(e),
|
|
85
85
|
index: l + e.text,
|
|
86
86
|
title: e.text,
|
|
@@ -92,7 +92,7 @@ const R = { class: "vft-sub-menu" }, T = p({
|
|
|
92
92
|
}, null, 8, ["onClick", "index", "title", "divider", "disabled", "icon"]))), 128))
|
|
93
93
|
])
|
|
94
94
|
], 6), [
|
|
95
|
-
[F, u(
|
|
95
|
+
[F, u(i)]
|
|
96
96
|
])
|
|
97
97
|
]),
|
|
98
98
|
_: 1
|
|
@@ -100,5 +100,5 @@ const R = { class: "vft-sub-menu" }, T = p({
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
export {
|
|
103
|
-
|
|
103
|
+
U as default
|
|
104
104
|
};
|