cisse-vue-ui 0.5.17 → 0.5.22
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/README.md +666 -666
- package/dist/Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js +236 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js.map +1 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs +235 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DrGM65ny.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-y3zIxWfI.js → Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js} +408 -185
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-Cv1OwT9S.cjs → Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs} +435 -212
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-FdUrjmSG.cjs.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-Bech-H58.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js} +226 -248
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-CHoagJ0-.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs} +225 -247
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-DXb9wQQv.cjs.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-CuPF4MPe.js → DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js} +209 -415
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-CqeiZOID.cjs → DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs} +234 -440
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-BoB48313.cjs.map +1 -0
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js.map +1 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs.map +1 -1
- package/dist/PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js.map +1 -1
- package/dist/cisse-vue-ui.css +51 -51
- package/dist/components/core/AccordionItem.stories.d.ts +10 -0
- package/dist/components/core/Avatar.vue.d.ts +1 -1
- package/dist/components/core/Button.vue.d.ts +1 -1
- package/dist/components/core/CardComponent.stories.d.ts +3 -0
- package/dist/components/core/CardComponent.vue.d.ts +15 -2
- package/dist/components/core/DarkModeToggle.stories.d.ts +15 -0
- package/dist/components/core/DarkModeToggle.test.d.ts +1 -0
- package/dist/components/core/DarkModeToggle.vue.d.ts +21 -0
- package/dist/components/core/MobileList.stories.d.ts +13 -0
- package/dist/components/core/MobileList.vue.d.ts +6 -0
- package/dist/components/core/ResponsiveList.stories.d.ts +15 -0
- package/dist/components/core/ResponsiveList.vue.d.ts +6 -0
- package/dist/components/core/TabPanel.stories.d.ts +8 -0
- package/dist/components/core/TableAction.stories.d.ts +14 -0
- package/dist/components/core/TableComponent.stories.d.ts +2 -0
- package/dist/components/core/TableComponent.vue.d.ts +6 -0
- package/dist/components/core/index.cjs +22 -20
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +16 -14
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/feedback/CardSkeleton.stories.d.ts +11 -0
- package/dist/components/feedback/CardSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/CardSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/ConfirmDialog.stories.d.ts +12 -0
- package/dist/components/feedback/ConfirmDialog.test.d.ts +1 -0
- package/dist/components/feedback/ConfirmDialog.vue.d.ts +53 -0
- package/dist/components/feedback/ListSkeleton.stories.d.ts +12 -0
- package/dist/components/feedback/ListSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/ListSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/Modal.vue.d.ts +11 -2
- package/dist/components/feedback/NotificationComponent.stories.d.ts +14 -0
- package/dist/components/feedback/NotificationList.stories.d.ts +11 -0
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/Skeleton.vue.d.ts +1 -1
- package/dist/components/feedback/TableSkeleton.stories.d.ts +12 -0
- package/dist/components/feedback/TableSkeleton.test.d.ts +1 -0
- package/dist/components/feedback/TableSkeleton.vue.d.ts +1 -1
- package/dist/components/feedback/ToastContainer.stories.d.ts +15 -0
- package/dist/components/feedback/index.cjs +17 -15
- package/dist/components/feedback/index.cjs.map +1 -1
- package/dist/components/feedback/index.d.ts +2 -0
- package/dist/components/feedback/index.js +6 -4
- package/dist/components/feedback/index.js.map +1 -1
- package/dist/components/form/ColorPicker.vue.d.ts +3 -0
- package/dist/components/form/Combobox.stories.d.ts +15 -0
- package/dist/components/form/Combobox.test.d.ts +1 -0
- package/dist/components/form/Combobox.vue.d.ts +46 -0
- package/dist/components/form/FileUpload.vue.d.ts +1 -1
- package/dist/components/form/FormHelp.stories.d.ts +11 -0
- package/dist/components/form/FormLabel.stories.d.ts +12 -0
- package/dist/components/form/FormSelect.stories.d.ts +2 -0
- package/dist/components/form/index.cjs +17 -16
- package/dist/components/form/index.cjs.map +1 -1
- package/dist/components/form/index.d.ts +2 -0
- package/dist/components/form/index.js +3 -2
- package/dist/components/index.cjs +55 -51
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +36 -32
- package/dist/components/index.js.map +1 -1
- package/dist/composables/index.cjs +3 -2
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.js +9 -8
- package/dist/composables/index.js.map +1 -1
- package/dist/index-D7HVSFi2.cjs +337 -0
- package/dist/index-D7HVSFi2.cjs.map +1 -0
- package/dist/index-DZYqrXV0.js +75 -0
- package/dist/index-DZYqrXV0.js.map +1 -0
- package/dist/index-Dghdw1yo.js +338 -0
- package/dist/index-Dghdw1yo.js.map +1 -0
- package/dist/index-DjEv91o4.cjs +74 -0
- package/dist/index-DjEv91o4.cjs.map +1 -0
- package/dist/index.cjs +59 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +46 -41
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/useDarkMode-Cl5QWTlC.js +53 -0
- package/dist/useDarkMode-Cl5QWTlC.js.map +1 -0
- package/dist/useDarkMode-DLZcJEUQ.cjs +52 -0
- package/dist/useDarkMode-DLZcJEUQ.cjs.map +1 -0
- package/dist/useDropdown-DHFnd259.cjs.map +1 -1
- package/dist/useDropdown-iVu14E6s.js.map +1 -1
- package/dist/{useToast-CRh_sG82.cjs → useToast-Bk60GArg.cjs} +1 -50
- package/dist/useToast-Bk60GArg.cjs.map +1 -0
- package/dist/{useToast-DwFOkewC.js → useToast-ina5g3mj.js} +6 -55
- package/dist/useToast-ina5g3mj.js.map +1 -0
- package/package.json +168 -168
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-B-nLCCNY.js +0 -54
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-B-nLCCNY.js.map +0 -1
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DIoHDji4.cjs +0 -53
- package/dist/Checkbox.vue_vue_type_script_setup_true_lang-DIoHDji4.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-Bech-H58.js.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-CHoagJ0-.cjs.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-Cv1OwT9S.cjs.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-y3zIxWfI.js.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-CqeiZOID.cjs.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-CuPF4MPe.js.map +0 -1
- package/dist/index-5Ru0o5KY.js +0 -71
- package/dist/index-5Ru0o5KY.js.map +0 -1
- package/dist/index-CnDEGRt-.cjs +0 -70
- package/dist/index-CnDEGRt-.cjs.map +0 -1
- package/dist/useToast-CRh_sG82.cjs.map +0 -1
- package/dist/useToast-DwFOkewC.js.map +0 -1
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { o as _sfc_main, p as _sfc_main$1, d as _sfc_main$3, f as _sfc_main$4, n as _sfc_main$8, _ as _sfc_main$a, j as _sfc_main$d, r as _sfc_main$h, m as _sfc_main$k, b as _sfc_main$w, l as _sfc_main$D, c as _sfc_main$G, i as _sfc_main$K, h as _sfc_main$M, e as _sfc_main$N, a as _sfc_main$O, g as _sfc_main$Q, q as _sfc_main$S, k as _sfc_main$V } from "./DarkModeToggle.vue_vue_type_script_setup_true_lang-43fxlbro.js";
|
|
2
|
+
import { a as _sfc_main$l, _ as _sfc_main$v } from "./Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js";
|
|
3
|
+
import { e as _sfc_main$5, d as _sfc_main$7, c as _sfc_main$j, b as _sfc_main$A, _ as _sfc_main$J, a as _sfc_main$R } from "./BadgeType.vue_vue_type_script_setup_true_lang-CnB5eNEM.js";
|
|
4
|
+
import { _ as _sfc_main$9, b as _sfc_main$b, c as _sfc_main$t, a as _sfc_main$P } from "./Button.vue_vue_type_script_setup_true_lang-DKE8elsf.js";
|
|
5
|
+
import { j as _sfc_main$e, l as _sfc_main$f, g as _sfc_main$i, h as _sfc_main$n, d as _sfc_main$o, a as _sfc_main$p, b as _sfc_main$q, _ as _sfc_main$r, c as _sfc_main$s, k as _sfc_main$E, i as _sfc_main$F, e as _sfc_main$H, S as Slider, f as _sfc_main$L } from "./Combobox.vue_vue_type_script_setup_true_lang-DhcLb6DX.js";
|
|
6
|
+
import { _ as _sfc_main$c } from "./index-Dghdw1yo.js";
|
|
7
|
+
import { e as _sfc_main$2, j as _sfc_main$g, f as _sfc_main$m, _ as _sfc_main$u, a as _sfc_main$x, c as _sfc_main$y, d as _sfc_main$z, b as _sfc_main$C, P as Progress, i as _sfc_main$I, g as _sfc_main$T, h as _sfc_main$U } from "./ConfirmDialog.vue_vue_type_script_setup_true_lang-CNucAMQg.js";
|
|
8
|
+
import { _ as _sfc_main$6, a as _sfc_main$B } from "./PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js";
|
|
9
|
+
const components = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
10
|
+
__proto__: null,
|
|
11
|
+
Accordion: _sfc_main,
|
|
12
|
+
AccordionItem: _sfc_main$1,
|
|
13
|
+
Alert: _sfc_main$2,
|
|
14
|
+
AutocompleteComponent: _sfc_main$3,
|
|
15
|
+
Avatar: _sfc_main$4,
|
|
16
|
+
BadgeType: _sfc_main$5,
|
|
17
|
+
BaseLayout: _sfc_main$6,
|
|
18
|
+
BooleanType: _sfc_main$7,
|
|
19
|
+
Breadcrumb: _sfc_main$8,
|
|
20
|
+
Button: _sfc_main$9,
|
|
21
|
+
CardComponent: _sfc_main$a,
|
|
22
|
+
CardSkeleton: _sfc_main$b,
|
|
23
|
+
Checkbox: _sfc_main$c,
|
|
24
|
+
CollapsibleCard: _sfc_main$d,
|
|
25
|
+
ColorPicker: _sfc_main$e,
|
|
26
|
+
Combobox: _sfc_main$f,
|
|
27
|
+
ConfirmDialog: _sfc_main$g,
|
|
28
|
+
DarkModeToggle: _sfc_main$h,
|
|
29
|
+
DatePicker: _sfc_main$i,
|
|
30
|
+
DateType: _sfc_main$j,
|
|
31
|
+
Drawer: _sfc_main$k,
|
|
32
|
+
Dropdown: _sfc_main$l,
|
|
33
|
+
EmptyState: _sfc_main$m,
|
|
34
|
+
FileUpload: _sfc_main$n,
|
|
35
|
+
FormGroup: _sfc_main$o,
|
|
36
|
+
FormHelp: _sfc_main$p,
|
|
37
|
+
FormInput: _sfc_main$q,
|
|
38
|
+
FormLabel: _sfc_main$r,
|
|
39
|
+
FormSelect: _sfc_main$s,
|
|
40
|
+
ListSkeleton: _sfc_main$t,
|
|
41
|
+
LoadingSpinner: _sfc_main$u,
|
|
42
|
+
MenuItem: _sfc_main$v,
|
|
43
|
+
MobileList: _sfc_main$w,
|
|
44
|
+
Modal: _sfc_main$x,
|
|
45
|
+
NotificationComponent: _sfc_main$y,
|
|
46
|
+
NotificationList: _sfc_main$z,
|
|
47
|
+
NumberType: _sfc_main$A,
|
|
48
|
+
PageLayout: _sfc_main$B,
|
|
49
|
+
PaginationControls: _sfc_main$C,
|
|
50
|
+
Popover: _sfc_main$D,
|
|
51
|
+
Progress,
|
|
52
|
+
RangeSlider: _sfc_main$E,
|
|
53
|
+
Rating: _sfc_main$F,
|
|
54
|
+
ResponsiveList: _sfc_main$G,
|
|
55
|
+
SearchInput: _sfc_main$H,
|
|
56
|
+
Skeleton: _sfc_main$I,
|
|
57
|
+
Slider,
|
|
58
|
+
StatusBadge: _sfc_main$J,
|
|
59
|
+
Stepper: _sfc_main$K,
|
|
60
|
+
Switch: _sfc_main$L,
|
|
61
|
+
TabPanel: _sfc_main$M,
|
|
62
|
+
TableAction: _sfc_main$N,
|
|
63
|
+
TableComponent: _sfc_main$O,
|
|
64
|
+
TableSkeleton: _sfc_main$P,
|
|
65
|
+
Tabs: _sfc_main$Q,
|
|
66
|
+
TextType: _sfc_main$R,
|
|
67
|
+
Timeline: _sfc_main$S,
|
|
68
|
+
Toast: _sfc_main$T,
|
|
69
|
+
ToastContainer: _sfc_main$U,
|
|
70
|
+
Tooltip: _sfc_main$V
|
|
71
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
72
|
+
export {
|
|
73
|
+
components as c
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=index-DZYqrXV0.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DZYqrXV0.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import { defineComponent, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, onMounted, nextTick, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, watch, shallowRef, computed, toValue, watchEffect, unref } from "vue";
|
|
2
|
+
const _hoisted_1 = ["checked", "disabled", "indeterminate"];
|
|
3
|
+
const _hoisted_2 = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "flex flex-col"
|
|
6
|
+
};
|
|
7
|
+
const _hoisted_3 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
10
|
+
};
|
|
11
|
+
const _hoisted_4 = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
14
|
+
};
|
|
15
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
16
|
+
__name: "Checkbox",
|
|
17
|
+
props: {
|
|
18
|
+
modelValue: { type: Boolean, default: false },
|
|
19
|
+
label: {},
|
|
20
|
+
description: {},
|
|
21
|
+
disabled: { type: Boolean },
|
|
22
|
+
indeterminate: { type: Boolean }
|
|
23
|
+
},
|
|
24
|
+
emits: ["update:modelValue"],
|
|
25
|
+
setup(__props, { emit: __emit }) {
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const toggle = (event) => {
|
|
28
|
+
const target = event.target;
|
|
29
|
+
emit("update:modelValue", target.checked);
|
|
30
|
+
};
|
|
31
|
+
return (_ctx, _cache) => {
|
|
32
|
+
return openBlock(), createElementBlock("label", {
|
|
33
|
+
class: normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
34
|
+
}, [
|
|
35
|
+
createElementVNode("input", {
|
|
36
|
+
type: "checkbox",
|
|
37
|
+
checked: __props.modelValue,
|
|
38
|
+
disabled: __props.disabled,
|
|
39
|
+
indeterminate: __props.indeterminate,
|
|
40
|
+
class: "mt-0.5 size-4 rounded border-gray-300 text-primary/90 focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed dark:border-gray-600 dark:bg-gray-800 dark:focus:ring-offset-gray-900",
|
|
41
|
+
onChange: toggle
|
|
42
|
+
}, null, 40, _hoisted_1),
|
|
43
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
44
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
45
|
+
__props.description ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString(__props.description), 1)) : createCommentVNode("", true)
|
|
46
|
+
])) : createCommentVNode("", true)
|
|
47
|
+
], 2);
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
52
|
+
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
53
|
+
var _getCurrentInstance;
|
|
54
|
+
const key = args[0];
|
|
55
|
+
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
|
|
56
|
+
const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
|
|
57
|
+
if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
|
|
58
|
+
if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
|
|
59
|
+
return inject(...args);
|
|
60
|
+
};
|
|
61
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
62
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
63
|
+
const toString = Object.prototype.toString;
|
|
64
|
+
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
65
|
+
const noop = () => {
|
|
66
|
+
};
|
|
67
|
+
function increaseWithUnit(target, delta) {
|
|
68
|
+
var _target$match;
|
|
69
|
+
if (typeof target === "number") return target + delta;
|
|
70
|
+
const value = ((_target$match = target.match(/^-?\d+\.?\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || "";
|
|
71
|
+
const unit = target.slice(value.length);
|
|
72
|
+
const result = Number.parseFloat(value) + delta;
|
|
73
|
+
if (Number.isNaN(result)) return target;
|
|
74
|
+
return result + unit;
|
|
75
|
+
}
|
|
76
|
+
function pxValue(px) {
|
|
77
|
+
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
|
|
78
|
+
}
|
|
79
|
+
function toArray(value) {
|
|
80
|
+
return Array.isArray(value) ? value : [value];
|
|
81
|
+
}
|
|
82
|
+
function getLifeCycleTarget(target) {
|
|
83
|
+
return getCurrentInstance();
|
|
84
|
+
}
|
|
85
|
+
function tryOnMounted(fn, sync = true, target) {
|
|
86
|
+
if (getLifeCycleTarget()) onMounted(fn, target);
|
|
87
|
+
else if (sync) fn();
|
|
88
|
+
else nextTick(fn);
|
|
89
|
+
}
|
|
90
|
+
function watchImmediate(source, cb, options) {
|
|
91
|
+
return watch(source, cb, {
|
|
92
|
+
...options,
|
|
93
|
+
immediate: true
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
const defaultWindow = isClient ? window : void 0;
|
|
97
|
+
function unrefElement(elRef) {
|
|
98
|
+
var _$el;
|
|
99
|
+
const plain = toValue(elRef);
|
|
100
|
+
return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
|
|
101
|
+
}
|
|
102
|
+
function useEventListener(...args) {
|
|
103
|
+
const register = (el, event, listener, options) => {
|
|
104
|
+
el.addEventListener(event, listener, options);
|
|
105
|
+
return () => el.removeEventListener(event, listener, options);
|
|
106
|
+
};
|
|
107
|
+
const firstParamTargets = computed(() => {
|
|
108
|
+
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
109
|
+
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
110
|
+
});
|
|
111
|
+
return watchImmediate(() => {
|
|
112
|
+
var _firstParamTargets$va, _firstParamTargets$va2;
|
|
113
|
+
return [
|
|
114
|
+
(_firstParamTargets$va = (_firstParamTargets$va2 = firstParamTargets.value) === null || _firstParamTargets$va2 === void 0 ? void 0 : _firstParamTargets$va2.map((e) => unrefElement(e))) !== null && _firstParamTargets$va !== void 0 ? _firstParamTargets$va : [defaultWindow].filter((e) => e != null),
|
|
115
|
+
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
116
|
+
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
117
|
+
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
118
|
+
];
|
|
119
|
+
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
|
|
120
|
+
if (!(raw_targets === null || raw_targets === void 0 ? void 0 : raw_targets.length) || !(raw_events === null || raw_events === void 0 ? void 0 : raw_events.length) || !(raw_listeners === null || raw_listeners === void 0 ? void 0 : raw_listeners.length)) return;
|
|
121
|
+
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
122
|
+
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
|
|
123
|
+
onCleanup(() => {
|
|
124
|
+
cleanups.forEach((fn) => fn());
|
|
125
|
+
});
|
|
126
|
+
}, { flush: "post" });
|
|
127
|
+
}
|
|
128
|
+
function onClickOutside(target, handler, options = {}) {
|
|
129
|
+
const { window: window$1 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;
|
|
130
|
+
if (!window$1) return controls ? {
|
|
131
|
+
stop: noop,
|
|
132
|
+
cancel: noop,
|
|
133
|
+
trigger: noop
|
|
134
|
+
} : noop;
|
|
135
|
+
let shouldListen = true;
|
|
136
|
+
const shouldIgnore = (event) => {
|
|
137
|
+
return toValue(ignore).some((target$1) => {
|
|
138
|
+
if (typeof target$1 === "string") return Array.from(window$1.document.querySelectorAll(target$1)).some((el) => el === event.target || event.composedPath().includes(el));
|
|
139
|
+
else {
|
|
140
|
+
const el = unrefElement(target$1);
|
|
141
|
+
return el && (event.target === el || event.composedPath().includes(el));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
};
|
|
145
|
+
function hasMultipleRoots(target$1) {
|
|
146
|
+
const vm = toValue(target$1);
|
|
147
|
+
return vm && vm.$.subTree.shapeFlag === 16;
|
|
148
|
+
}
|
|
149
|
+
function checkMultipleRoots(target$1, event) {
|
|
150
|
+
const vm = toValue(target$1);
|
|
151
|
+
const children = vm.$.subTree && vm.$.subTree.children;
|
|
152
|
+
if (children == null || !Array.isArray(children)) return false;
|
|
153
|
+
return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
|
|
154
|
+
}
|
|
155
|
+
const listener = (event) => {
|
|
156
|
+
const el = unrefElement(target);
|
|
157
|
+
if (event.target == null) return;
|
|
158
|
+
if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
|
|
159
|
+
if (!el || el === event.target || event.composedPath().includes(el)) return;
|
|
160
|
+
if ("detail" in event && event.detail === 0) shouldListen = !shouldIgnore(event);
|
|
161
|
+
if (!shouldListen) {
|
|
162
|
+
shouldListen = true;
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
handler(event);
|
|
166
|
+
};
|
|
167
|
+
let isProcessingClick = false;
|
|
168
|
+
const cleanup = [
|
|
169
|
+
useEventListener(window$1, "click", (event) => {
|
|
170
|
+
if (!isProcessingClick) {
|
|
171
|
+
isProcessingClick = true;
|
|
172
|
+
setTimeout(() => {
|
|
173
|
+
isProcessingClick = false;
|
|
174
|
+
}, 0);
|
|
175
|
+
listener(event);
|
|
176
|
+
}
|
|
177
|
+
}, {
|
|
178
|
+
passive: true,
|
|
179
|
+
capture
|
|
180
|
+
}),
|
|
181
|
+
useEventListener(window$1, "pointerdown", (e) => {
|
|
182
|
+
const el = unrefElement(target);
|
|
183
|
+
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
|
|
184
|
+
}, { passive: true }),
|
|
185
|
+
detectIframe && useEventListener(window$1, "blur", (event) => {
|
|
186
|
+
setTimeout(() => {
|
|
187
|
+
var _window$document$acti;
|
|
188
|
+
const el = unrefElement(target);
|
|
189
|
+
if (((_window$document$acti = window$1.document.activeElement) === null || _window$document$acti === void 0 ? void 0 : _window$document$acti.tagName) === "IFRAME" && !(el === null || el === void 0 ? void 0 : el.contains(window$1.document.activeElement))) handler(event);
|
|
190
|
+
}, 0);
|
|
191
|
+
}, { passive: true })
|
|
192
|
+
].filter(Boolean);
|
|
193
|
+
const stop = () => cleanup.forEach((fn) => fn());
|
|
194
|
+
if (controls) return {
|
|
195
|
+
stop,
|
|
196
|
+
cancel: () => {
|
|
197
|
+
shouldListen = false;
|
|
198
|
+
},
|
|
199
|
+
trigger: (event) => {
|
|
200
|
+
shouldListen = true;
|
|
201
|
+
listener(event);
|
|
202
|
+
shouldListen = false;
|
|
203
|
+
}
|
|
204
|
+
};
|
|
205
|
+
return stop;
|
|
206
|
+
}
|
|
207
|
+
// @__NO_SIDE_EFFECTS__
|
|
208
|
+
function useMounted() {
|
|
209
|
+
const isMounted = shallowRef(false);
|
|
210
|
+
const instance = getCurrentInstance();
|
|
211
|
+
if (instance) onMounted(() => {
|
|
212
|
+
isMounted.value = true;
|
|
213
|
+
}, instance);
|
|
214
|
+
return isMounted;
|
|
215
|
+
}
|
|
216
|
+
// @__NO_SIDE_EFFECTS__
|
|
217
|
+
function useSupported(callback) {
|
|
218
|
+
const isMounted = /* @__PURE__ */ useMounted();
|
|
219
|
+
return computed(() => {
|
|
220
|
+
isMounted.value;
|
|
221
|
+
return Boolean(callback());
|
|
222
|
+
});
|
|
223
|
+
}
|
|
224
|
+
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
225
|
+
// @__NO_SIDE_EFFECTS__
|
|
226
|
+
function useSSRWidth() {
|
|
227
|
+
const ssrWidth = hasInjectionContext() ? /* @__PURE__ */ injectLocal(ssrWidthSymbol, null) : null;
|
|
228
|
+
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
229
|
+
}
|
|
230
|
+
function useMediaQuery(query, options = {}) {
|
|
231
|
+
const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
232
|
+
const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
|
|
233
|
+
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
234
|
+
const mediaQuery = shallowRef();
|
|
235
|
+
const matches = shallowRef(false);
|
|
236
|
+
const handler = (event) => {
|
|
237
|
+
matches.value = event.matches;
|
|
238
|
+
};
|
|
239
|
+
watchEffect(() => {
|
|
240
|
+
if (ssrSupport.value) {
|
|
241
|
+
ssrSupport.value = !isSupported.value;
|
|
242
|
+
matches.value = toValue(query).split(",").some((queryString) => {
|
|
243
|
+
const not = queryString.includes("not all");
|
|
244
|
+
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
245
|
+
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
246
|
+
let res = Boolean(minWidth || maxWidth);
|
|
247
|
+
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
|
|
248
|
+
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
|
|
249
|
+
return not ? !res : res;
|
|
250
|
+
});
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
253
|
+
if (!isSupported.value) return;
|
|
254
|
+
mediaQuery.value = window$1.matchMedia(toValue(query));
|
|
255
|
+
matches.value = mediaQuery.value.matches;
|
|
256
|
+
});
|
|
257
|
+
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
258
|
+
return computed(() => matches.value);
|
|
259
|
+
}
|
|
260
|
+
// @__NO_SIDE_EFFECTS__
|
|
261
|
+
function useBreakpoints(breakpoints, options = {}) {
|
|
262
|
+
function getValue$1(k, delta) {
|
|
263
|
+
let v = toValue(breakpoints[toValue(k)]);
|
|
264
|
+
if (delta != null) v = increaseWithUnit(v, delta);
|
|
265
|
+
if (typeof v === "number") v = `${v}px`;
|
|
266
|
+
return v;
|
|
267
|
+
}
|
|
268
|
+
const { window: window$1 = defaultWindow, strategy = "min-width", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
269
|
+
const ssrSupport = typeof ssrWidth === "number";
|
|
270
|
+
const mounted = ssrSupport ? shallowRef(false) : { value: true };
|
|
271
|
+
if (ssrSupport) tryOnMounted(() => mounted.value = !!window$1);
|
|
272
|
+
function match(query, size) {
|
|
273
|
+
if (!mounted.value && ssrSupport) return query === "min" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);
|
|
274
|
+
if (!window$1) return false;
|
|
275
|
+
return window$1.matchMedia(`(${query}-width: ${size})`).matches;
|
|
276
|
+
}
|
|
277
|
+
const greaterOrEqual = (k) => {
|
|
278
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(k)})`, options);
|
|
279
|
+
};
|
|
280
|
+
const smallerOrEqual = (k) => {
|
|
281
|
+
return useMediaQuery(() => `(max-width: ${getValue$1(k)})`, options);
|
|
282
|
+
};
|
|
283
|
+
const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
|
|
284
|
+
Object.defineProperty(shortcuts, k, {
|
|
285
|
+
get: () => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k),
|
|
286
|
+
enumerable: true,
|
|
287
|
+
configurable: true
|
|
288
|
+
});
|
|
289
|
+
return shortcuts;
|
|
290
|
+
}, {});
|
|
291
|
+
function current() {
|
|
292
|
+
const points = Object.keys(breakpoints).map((k) => [
|
|
293
|
+
k,
|
|
294
|
+
shortcutMethods[k],
|
|
295
|
+
pxValue(getValue$1(k))
|
|
296
|
+
]).sort((a, b) => a[2] - b[2]);
|
|
297
|
+
return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));
|
|
298
|
+
}
|
|
299
|
+
return Object.assign(shortcutMethods, {
|
|
300
|
+
greaterOrEqual,
|
|
301
|
+
smallerOrEqual,
|
|
302
|
+
greater(k) {
|
|
303
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(k, 0.1)})`, options);
|
|
304
|
+
},
|
|
305
|
+
smaller(k) {
|
|
306
|
+
return useMediaQuery(() => `(max-width: ${getValue$1(k, -0.1)})`, options);
|
|
307
|
+
},
|
|
308
|
+
between(a, b) {
|
|
309
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(a)}) and (max-width: ${getValue$1(b, -0.1)})`, options);
|
|
310
|
+
},
|
|
311
|
+
isGreater(k) {
|
|
312
|
+
return match("min", getValue$1(k, 0.1));
|
|
313
|
+
},
|
|
314
|
+
isGreaterOrEqual(k) {
|
|
315
|
+
return match("min", getValue$1(k));
|
|
316
|
+
},
|
|
317
|
+
isSmaller(k) {
|
|
318
|
+
return match("max", getValue$1(k, -0.1));
|
|
319
|
+
},
|
|
320
|
+
isSmallerOrEqual(k) {
|
|
321
|
+
return match("max", getValue$1(k));
|
|
322
|
+
},
|
|
323
|
+
isInBetween(a, b) {
|
|
324
|
+
return match("min", getValue$1(a)) && match("max", getValue$1(b, -0.1));
|
|
325
|
+
},
|
|
326
|
+
current,
|
|
327
|
+
active() {
|
|
328
|
+
const bps = current();
|
|
329
|
+
return computed(() => bps.value.length === 0 ? "" : bps.value.at(strategy === "min-width" ? -1 : 0));
|
|
330
|
+
}
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
export {
|
|
334
|
+
_sfc_main as _,
|
|
335
|
+
onClickOutside as o,
|
|
336
|
+
useBreakpoints as u
|
|
337
|
+
};
|
|
338
|
+
//# sourceMappingURL=index-Dghdw1yo.js.map
|