cisse-vue-ui 0.5.21 → 0.5.23
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/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-D3_Oddwt.js → Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js} +114 -10
- package/dist/Button.vue_vue_type_script_setup_true_lang-CD9QPOeU.js.map +1 -0
- package/dist/{ListSkeleton.vue_vue_type_script_setup_true_lang-CrEu33_J.cjs → Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs} +113 -9
- package/dist/Button.vue_vue_type_script_setup_true_lang-Cev21KGJ.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-ClH-pyK8.cjs → Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs} +621 -266
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-D9TIId4E.cjs.map +1 -0
- package/dist/{RangeSlider.vue_vue_type_script_setup_true_lang-B79_S1JL.js → Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js} +595 -240
- package/dist/Combobox.vue_vue_type_script_setup_true_lang-DCLKWzhc.js.map +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-CsDMGhaT.cjs → ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs} +290 -128
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-CwHYxBhR.cjs.map +1 -0
- package/dist/{Skeleton.vue_vue_type_script_setup_true_lang-Q4PcIELi.js → ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js} +291 -129
- package/dist/ConfirmDialog.vue_vue_type_script_setup_true_lang-Dm4kLAnr.js.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-C5SKEGPG.cjs → DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs} +192 -408
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-CSxGvdSP.cjs.map +1 -0
- package/dist/{Timeline.vue_vue_type_script_setup_true_lang-ykGksWXN.js → DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js} +153 -369
- package/dist/DarkModeToggle.vue_vue_type_script_setup_true_lang-D1Q43mhJ.js.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs → Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DNeh9Gi-.cjs.map +1 -0
- package/dist/{Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js → Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js} +32 -15
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.js.map +1 -0
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-D22uNeS1.cjs.map → PageLayout.vue_vue_type_script_setup_true_lang-C0YzyJnK.cjs.map} +1 -1
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js} +2 -2
- package/dist/{PageLayout.vue_vue_type_script_setup_true_lang-kT7np2ir.js.map → PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.js.map} +1 -1
- package/dist/components/core/AccordionItem.vue.d.ts +2 -0
- 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/Dropdown.vue.d.ts +2 -0
- package/dist/components/core/Popover.vue.d.ts +2 -0
- package/dist/components/core/Tooltip.vue.d.ts +2 -0
- package/dist/components/core/index.cjs +23 -21
- package/dist/components/core/index.cjs.map +1 -1
- package/dist/components/core/index.d.ts +2 -0
- package/dist/components/core/index.js +17 -15
- package/dist/components/core/index.js.map +1 -1
- package/dist/components/core/index.test.d.ts +1 -0
- 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/LoadingSpinner.vue.d.ts +6 -1
- package/dist/components/feedback/Modal.vue.d.ts +18 -3
- package/dist/components/feedback/Progress.vue.d.ts +1 -1
- package/dist/components/feedback/index.cjs +17 -16
- 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 -5
- package/dist/components/feedback/index.test.d.ts +1 -0
- package/dist/components/form/Checkbox.vue.d.ts +2 -0
- 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/DatePicker.vue.d.ts +2 -0
- package/dist/components/form/FormHelp.vue.d.ts +2 -0
- package/dist/components/form/Switch.vue.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/form/index.test.d.ts +1 -0
- package/dist/components/index.cjs +57 -54
- package/dist/components/index.cjs.map +1 -1
- package/dist/components/index.js +35 -32
- package/dist/components/index.test.d.ts +1 -0
- package/dist/components/layout/index.cjs +1 -1
- package/dist/components/layout/index.js +1 -1
- package/dist/components/layout/index.test.d.ts +1 -0
- package/dist/components/type/index.test.d.ts +1 -0
- package/dist/composables/index.cjs +9 -2
- package/dist/composables/index.cjs.map +1 -1
- package/dist/composables/index.d.ts +2 -0
- package/dist/composables/index.js +15 -8
- package/dist/composables/index.js.map +1 -1
- package/dist/composables/index.test.d.ts +1 -0
- package/dist/composables/useDarkMode.test.d.ts +1 -0
- package/dist/composables/useDropdown.test.d.ts +1 -0
- package/dist/composables/useExportCSV.test.d.ts +1 -0
- package/dist/composables/useFocusTrap.d.ts +41 -0
- package/dist/composables/useFocusTrap.test.d.ts +1 -0
- package/dist/composables/useId.d.ts +42 -0
- package/dist/composables/useId.test.d.ts +1 -0
- package/dist/composables/useModal.d.ts +1 -1
- package/dist/composables/useModal.test.d.ts +1 -0
- package/dist/index-BMoLBt6A.js +75 -0
- package/dist/index-BMoLBt6A.js.map +1 -0
- package/dist/index-CJwlO351.js +347 -0
- package/dist/index-CJwlO351.js.map +1 -0
- package/dist/index-CUNU12xk.cjs +346 -0
- package/dist/index-CUNU12xk.cjs.map +1 -0
- package/dist/index-DwFvFW-3.cjs +74 -0
- package/dist/index-DwFvFW-3.cjs.map +1 -0
- package/dist/index.cjs +67 -57
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +51 -41
- package/dist/index.js.map +1 -1
- package/dist/index.test.d.ts +1 -0
- package/dist/style.css +1 -1
- package/dist/types/form.d.ts +4 -0
- package/dist/types/index.test.d.ts +1 -0
- 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/useFocusTrap-AnlJsihM.js +120 -0
- package/dist/useFocusTrap-AnlJsihM.js.map +1 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs +119 -0
- package/dist/useFocusTrap-kcxO8AeU.cjs.map +1 -0
- package/dist/useId-nxrBaIC9.cjs +25 -0
- package/dist/useId-nxrBaIC9.cjs.map +1 -0
- package/dist/useId-xeHj7rkg.js +26 -0
- package/dist/useId-xeHj7rkg.js.map +1 -0
- 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 +9 -8
- 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/Dropdown.vue_vue_type_script_setup_true_lang-C3pr8BwC.js.map +0 -1
- package/dist/Dropdown.vue_vue_type_script_setup_true_lang-DKxcVBKu.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-CrEu33_J.cjs.map +0 -1
- package/dist/ListSkeleton.vue_vue_type_script_setup_true_lang-D3_Oddwt.js.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-B79_S1JL.js.map +0 -1
- package/dist/RangeSlider.vue_vue_type_script_setup_true_lang-ClH-pyK8.cjs.map +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-CsDMGhaT.cjs.map +0 -1
- package/dist/Skeleton.vue_vue_type_script_setup_true_lang-Q4PcIELi.js.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-C5SKEGPG.cjs.map +0 -1
- package/dist/Timeline.vue_vue_type_script_setup_true_lang-ykGksWXN.js.map +0 -1
- package/dist/index-C3NAM2ds.js +0 -72
- package/dist/index-C3NAM2ds.js.map +0 -1
- package/dist/index-Ti1RIOEG.cjs +0 -71
- package/dist/index-Ti1RIOEG.cjs.map +0 -1
- package/dist/useToast-CRh_sG82.cjs.map +0 -1
- package/dist/useToast-DwFOkewC.js.map +0 -1
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
export interface UseFocusTrapOptions {
|
|
3
|
+
/** Whether the focus trap is active */
|
|
4
|
+
active?: Ref<boolean> | boolean;
|
|
5
|
+
/** Focus the first focusable element when trap activates */
|
|
6
|
+
focusFirst?: boolean;
|
|
7
|
+
/** Restore focus to the previously focused element when trap deactivates */
|
|
8
|
+
restoreFocus?: boolean;
|
|
9
|
+
/** Initial element to focus (selector or element) */
|
|
10
|
+
initialFocus?: string | HTMLElement | null;
|
|
11
|
+
}
|
|
12
|
+
export interface UseFocusTrapReturn {
|
|
13
|
+
/** Ref to attach to the container element */
|
|
14
|
+
containerRef: Ref<HTMLElement | null>;
|
|
15
|
+
/** Activate the focus trap manually */
|
|
16
|
+
activate: () => void;
|
|
17
|
+
/** Deactivate the focus trap manually */
|
|
18
|
+
deactivate: () => void;
|
|
19
|
+
/** Whether the focus trap is currently active */
|
|
20
|
+
isActive: Ref<boolean>;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Composable for trapping focus within a container element (for modals, dialogs, etc.)
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```vue
|
|
27
|
+
* <script setup>
|
|
28
|
+
* const isOpen = ref(false)
|
|
29
|
+
* const { containerRef } = useFocusTrap({ active: isOpen })
|
|
30
|
+
* </script>
|
|
31
|
+
*
|
|
32
|
+
* <template>
|
|
33
|
+
* <div v-if="isOpen" ref="containerRef" role="dialog">
|
|
34
|
+
* <button>First focusable</button>
|
|
35
|
+
* <input type="text" />
|
|
36
|
+
* <button @click="isOpen = false">Close</button>
|
|
37
|
+
* </div>
|
|
38
|
+
* </template>
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export declare function useFocusTrap(options?: UseFocusTrapOptions): UseFocusTrapReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { Ref } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Generates a unique ID for accessibility relationships (aria-labelledby, aria-describedby, etc.)
|
|
4
|
+
* Pattern: cisse-{prefix}-{counter}
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateId(prefix?: string): string;
|
|
7
|
+
/**
|
|
8
|
+
* Resets the ID counter (useful for testing)
|
|
9
|
+
*/
|
|
10
|
+
export declare function resetIdCounter(): void;
|
|
11
|
+
export interface UseIdOptions {
|
|
12
|
+
/** Prefix for the generated ID */
|
|
13
|
+
prefix?: string;
|
|
14
|
+
/** Custom ID to use instead of generating one */
|
|
15
|
+
id?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface UseIdReturn {
|
|
18
|
+
/** The unique ID (reactive) */
|
|
19
|
+
id: Ref<string>;
|
|
20
|
+
/** Generate a related ID with a suffix (e.g., id-label, id-description) */
|
|
21
|
+
related: (suffix: string) => string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Composable for generating unique IDs for accessibility relationships
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```vue
|
|
28
|
+
* <script setup>
|
|
29
|
+
* const { id, related } = useId({ prefix: 'modal' })
|
|
30
|
+
* // id.value = 'cisse-modal-1'
|
|
31
|
+
* // related('title') = 'cisse-modal-1-title'
|
|
32
|
+
* // related('description') = 'cisse-modal-1-description'
|
|
33
|
+
* </script>
|
|
34
|
+
*
|
|
35
|
+
* <template>
|
|
36
|
+
* <div :id="id" role="dialog" :aria-labelledby="related('title')">
|
|
37
|
+
* <h2 :id="related('title')">Modal Title</h2>
|
|
38
|
+
* </div>
|
|
39
|
+
* </template>
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
export declare function useId(options?: UseIdOptions): UseIdReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -57,4 +57,4 @@ export declare function useModal<T = unknown>(options?: {
|
|
|
57
57
|
* modals.delete.close()
|
|
58
58
|
* ```
|
|
59
59
|
*/
|
|
60
|
-
export declare function useModals<T extends Record<string, UseModalReturn<
|
|
60
|
+
export declare function useModals<T extends Record<string, UseModalReturn<any>>>(modals: T): T;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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-D1Q43mhJ.js";
|
|
2
|
+
import { a as _sfc_main$l, _ as _sfc_main$v } from "./Dropdown.vue_vue_type_script_setup_true_lang-DXV811zB.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-CD9QPOeU.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-DCLKWzhc.js";
|
|
6
|
+
import { _ as _sfc_main$c } from "./index-CJwlO351.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-Dm4kLAnr.js";
|
|
8
|
+
import { _ as _sfc_main$6, a as _sfc_main$B } from "./PageLayout.vue_vue_type_script_setup_true_lang-ClzYGS8h.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-BMoLBt6A.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BMoLBt6A.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,347 @@
|
|
|
1
|
+
import { defineComponent, computed, createElementBlock, openBlock, normalizeClass, createElementVNode, createCommentVNode, toDisplayString, onMounted, nextTick, getCurrentInstance, getCurrentScope, hasInjectionContext, inject, watch, shallowRef, toValue, watchEffect, unref } from "vue";
|
|
2
|
+
import { u as useId } from "./useId-xeHj7rkg.js";
|
|
3
|
+
const _hoisted_1 = ["id", "checked", "disabled", "indeterminate", "aria-describedby"];
|
|
4
|
+
const _hoisted_2 = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "flex flex-col"
|
|
7
|
+
};
|
|
8
|
+
const _hoisted_3 = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-sm font-medium text-gray-900 dark:text-white"
|
|
11
|
+
};
|
|
12
|
+
const _hoisted_4 = ["id"];
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
__name: "Checkbox",
|
|
15
|
+
props: {
|
|
16
|
+
modelValue: { type: Boolean, default: false },
|
|
17
|
+
label: {},
|
|
18
|
+
description: {},
|
|
19
|
+
disabled: { type: Boolean },
|
|
20
|
+
indeterminate: { type: Boolean },
|
|
21
|
+
id: {}
|
|
22
|
+
},
|
|
23
|
+
emits: ["update:modelValue"],
|
|
24
|
+
setup(__props, { emit: __emit }) {
|
|
25
|
+
const props = __props;
|
|
26
|
+
const emit = __emit;
|
|
27
|
+
const { id: generatedId, related } = useId({ prefix: "checkbox", id: props.id });
|
|
28
|
+
const inputId = computed(() => props.id ?? generatedId.value);
|
|
29
|
+
const descriptionId = computed(() => related("description"));
|
|
30
|
+
const toggle = (event) => {
|
|
31
|
+
const target = event.target;
|
|
32
|
+
emit("update:modelValue", target.checked);
|
|
33
|
+
};
|
|
34
|
+
return (_ctx, _cache) => {
|
|
35
|
+
return openBlock(), createElementBlock("label", {
|
|
36
|
+
class: normalizeClass(["inline-flex items-start gap-3", __props.disabled ? "cursor-not-allowed opacity-50" : "cursor-pointer"])
|
|
37
|
+
}, [
|
|
38
|
+
createElementVNode("input", {
|
|
39
|
+
id: inputId.value,
|
|
40
|
+
type: "checkbox",
|
|
41
|
+
checked: __props.modelValue,
|
|
42
|
+
disabled: __props.disabled,
|
|
43
|
+
indeterminate: __props.indeterminate,
|
|
44
|
+
"aria-describedby": __props.description ? descriptionId.value : void 0,
|
|
45
|
+
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",
|
|
46
|
+
onChange: toggle
|
|
47
|
+
}, null, 40, _hoisted_1),
|
|
48
|
+
__props.label || __props.description ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
49
|
+
__props.label ? (openBlock(), createElementBlock("span", _hoisted_3, toDisplayString(__props.label), 1)) : createCommentVNode("", true),
|
|
50
|
+
__props.description ? (openBlock(), createElementBlock("span", {
|
|
51
|
+
key: 1,
|
|
52
|
+
id: descriptionId.value,
|
|
53
|
+
class: "text-sm text-gray-500 dark:text-gray-400"
|
|
54
|
+
}, toDisplayString(__props.description), 9, _hoisted_4)) : createCommentVNode("", true)
|
|
55
|
+
])) : createCommentVNode("", true)
|
|
56
|
+
], 2);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
const localProvidedStateMap = /* @__PURE__ */ new WeakMap();
|
|
61
|
+
const injectLocal = /* @__NO_SIDE_EFFECTS__ */ (...args) => {
|
|
62
|
+
var _getCurrentInstance;
|
|
63
|
+
const key = args[0];
|
|
64
|
+
const instance = (_getCurrentInstance = getCurrentInstance()) === null || _getCurrentInstance === void 0 ? void 0 : _getCurrentInstance.proxy;
|
|
65
|
+
const owner = instance !== null && instance !== void 0 ? instance : getCurrentScope();
|
|
66
|
+
if (owner == null && !hasInjectionContext()) throw new Error("injectLocal must be called in setup");
|
|
67
|
+
if (owner && localProvidedStateMap.has(owner) && key in localProvidedStateMap.get(owner)) return localProvidedStateMap.get(owner)[key];
|
|
68
|
+
return inject(...args);
|
|
69
|
+
};
|
|
70
|
+
const isClient = typeof window !== "undefined" && typeof document !== "undefined";
|
|
71
|
+
typeof WorkerGlobalScope !== "undefined" && globalThis instanceof WorkerGlobalScope;
|
|
72
|
+
const toString = Object.prototype.toString;
|
|
73
|
+
const isObject = (val) => toString.call(val) === "[object Object]";
|
|
74
|
+
const noop = () => {
|
|
75
|
+
};
|
|
76
|
+
function increaseWithUnit(target, delta) {
|
|
77
|
+
var _target$match;
|
|
78
|
+
if (typeof target === "number") return target + delta;
|
|
79
|
+
const value = ((_target$match = target.match(/^-?\d+\.?\d*/)) === null || _target$match === void 0 ? void 0 : _target$match[0]) || "";
|
|
80
|
+
const unit = target.slice(value.length);
|
|
81
|
+
const result = Number.parseFloat(value) + delta;
|
|
82
|
+
if (Number.isNaN(result)) return target;
|
|
83
|
+
return result + unit;
|
|
84
|
+
}
|
|
85
|
+
function pxValue(px) {
|
|
86
|
+
return px.endsWith("rem") ? Number.parseFloat(px) * 16 : Number.parseFloat(px);
|
|
87
|
+
}
|
|
88
|
+
function toArray(value) {
|
|
89
|
+
return Array.isArray(value) ? value : [value];
|
|
90
|
+
}
|
|
91
|
+
function getLifeCycleTarget(target) {
|
|
92
|
+
return getCurrentInstance();
|
|
93
|
+
}
|
|
94
|
+
function tryOnMounted(fn, sync = true, target) {
|
|
95
|
+
if (getLifeCycleTarget()) onMounted(fn, target);
|
|
96
|
+
else if (sync) fn();
|
|
97
|
+
else nextTick(fn);
|
|
98
|
+
}
|
|
99
|
+
function watchImmediate(source, cb, options) {
|
|
100
|
+
return watch(source, cb, {
|
|
101
|
+
...options,
|
|
102
|
+
immediate: true
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
const defaultWindow = isClient ? window : void 0;
|
|
106
|
+
function unrefElement(elRef) {
|
|
107
|
+
var _$el;
|
|
108
|
+
const plain = toValue(elRef);
|
|
109
|
+
return (_$el = plain === null || plain === void 0 ? void 0 : plain.$el) !== null && _$el !== void 0 ? _$el : plain;
|
|
110
|
+
}
|
|
111
|
+
function useEventListener(...args) {
|
|
112
|
+
const register = (el, event, listener, options) => {
|
|
113
|
+
el.addEventListener(event, listener, options);
|
|
114
|
+
return () => el.removeEventListener(event, listener, options);
|
|
115
|
+
};
|
|
116
|
+
const firstParamTargets = computed(() => {
|
|
117
|
+
const test = toArray(toValue(args[0])).filter((e) => e != null);
|
|
118
|
+
return test.every((e) => typeof e !== "string") ? test : void 0;
|
|
119
|
+
});
|
|
120
|
+
return watchImmediate(() => {
|
|
121
|
+
var _firstParamTargets$va, _firstParamTargets$va2;
|
|
122
|
+
return [
|
|
123
|
+
(_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),
|
|
124
|
+
toArray(toValue(firstParamTargets.value ? args[1] : args[0])),
|
|
125
|
+
toArray(unref(firstParamTargets.value ? args[2] : args[1])),
|
|
126
|
+
toValue(firstParamTargets.value ? args[3] : args[2])
|
|
127
|
+
];
|
|
128
|
+
}, ([raw_targets, raw_events, raw_listeners, raw_options], _, onCleanup) => {
|
|
129
|
+
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;
|
|
130
|
+
const optionsClone = isObject(raw_options) ? { ...raw_options } : raw_options;
|
|
131
|
+
const cleanups = raw_targets.flatMap((el) => raw_events.flatMap((event) => raw_listeners.map((listener) => register(el, event, listener, optionsClone))));
|
|
132
|
+
onCleanup(() => {
|
|
133
|
+
cleanups.forEach((fn) => fn());
|
|
134
|
+
});
|
|
135
|
+
}, { flush: "post" });
|
|
136
|
+
}
|
|
137
|
+
function onClickOutside(target, handler, options = {}) {
|
|
138
|
+
const { window: window$1 = defaultWindow, ignore = [], capture = true, detectIframe = false, controls = false } = options;
|
|
139
|
+
if (!window$1) return controls ? {
|
|
140
|
+
stop: noop,
|
|
141
|
+
cancel: noop,
|
|
142
|
+
trigger: noop
|
|
143
|
+
} : noop;
|
|
144
|
+
let shouldListen = true;
|
|
145
|
+
const shouldIgnore = (event) => {
|
|
146
|
+
return toValue(ignore).some((target$1) => {
|
|
147
|
+
if (typeof target$1 === "string") return Array.from(window$1.document.querySelectorAll(target$1)).some((el) => el === event.target || event.composedPath().includes(el));
|
|
148
|
+
else {
|
|
149
|
+
const el = unrefElement(target$1);
|
|
150
|
+
return el && (event.target === el || event.composedPath().includes(el));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
};
|
|
154
|
+
function hasMultipleRoots(target$1) {
|
|
155
|
+
const vm = toValue(target$1);
|
|
156
|
+
return vm && vm.$.subTree.shapeFlag === 16;
|
|
157
|
+
}
|
|
158
|
+
function checkMultipleRoots(target$1, event) {
|
|
159
|
+
const vm = toValue(target$1);
|
|
160
|
+
const children = vm.$.subTree && vm.$.subTree.children;
|
|
161
|
+
if (children == null || !Array.isArray(children)) return false;
|
|
162
|
+
return children.some((child) => child.el === event.target || event.composedPath().includes(child.el));
|
|
163
|
+
}
|
|
164
|
+
const listener = (event) => {
|
|
165
|
+
const el = unrefElement(target);
|
|
166
|
+
if (event.target == null) return;
|
|
167
|
+
if (!(el instanceof Element) && hasMultipleRoots(target) && checkMultipleRoots(target, event)) return;
|
|
168
|
+
if (!el || el === event.target || event.composedPath().includes(el)) return;
|
|
169
|
+
if ("detail" in event && event.detail === 0) shouldListen = !shouldIgnore(event);
|
|
170
|
+
if (!shouldListen) {
|
|
171
|
+
shouldListen = true;
|
|
172
|
+
return;
|
|
173
|
+
}
|
|
174
|
+
handler(event);
|
|
175
|
+
};
|
|
176
|
+
let isProcessingClick = false;
|
|
177
|
+
const cleanup = [
|
|
178
|
+
useEventListener(window$1, "click", (event) => {
|
|
179
|
+
if (!isProcessingClick) {
|
|
180
|
+
isProcessingClick = true;
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
isProcessingClick = false;
|
|
183
|
+
}, 0);
|
|
184
|
+
listener(event);
|
|
185
|
+
}
|
|
186
|
+
}, {
|
|
187
|
+
passive: true,
|
|
188
|
+
capture
|
|
189
|
+
}),
|
|
190
|
+
useEventListener(window$1, "pointerdown", (e) => {
|
|
191
|
+
const el = unrefElement(target);
|
|
192
|
+
shouldListen = !shouldIgnore(e) && !!(el && !e.composedPath().includes(el));
|
|
193
|
+
}, { passive: true }),
|
|
194
|
+
detectIframe && useEventListener(window$1, "blur", (event) => {
|
|
195
|
+
setTimeout(() => {
|
|
196
|
+
var _window$document$acti;
|
|
197
|
+
const el = unrefElement(target);
|
|
198
|
+
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);
|
|
199
|
+
}, 0);
|
|
200
|
+
}, { passive: true })
|
|
201
|
+
].filter(Boolean);
|
|
202
|
+
const stop = () => cleanup.forEach((fn) => fn());
|
|
203
|
+
if (controls) return {
|
|
204
|
+
stop,
|
|
205
|
+
cancel: () => {
|
|
206
|
+
shouldListen = false;
|
|
207
|
+
},
|
|
208
|
+
trigger: (event) => {
|
|
209
|
+
shouldListen = true;
|
|
210
|
+
listener(event);
|
|
211
|
+
shouldListen = false;
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
return stop;
|
|
215
|
+
}
|
|
216
|
+
// @__NO_SIDE_EFFECTS__
|
|
217
|
+
function useMounted() {
|
|
218
|
+
const isMounted = shallowRef(false);
|
|
219
|
+
const instance = getCurrentInstance();
|
|
220
|
+
if (instance) onMounted(() => {
|
|
221
|
+
isMounted.value = true;
|
|
222
|
+
}, instance);
|
|
223
|
+
return isMounted;
|
|
224
|
+
}
|
|
225
|
+
// @__NO_SIDE_EFFECTS__
|
|
226
|
+
function useSupported(callback) {
|
|
227
|
+
const isMounted = /* @__PURE__ */ useMounted();
|
|
228
|
+
return computed(() => {
|
|
229
|
+
isMounted.value;
|
|
230
|
+
return Boolean(callback());
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
const ssrWidthSymbol = Symbol("vueuse-ssr-width");
|
|
234
|
+
// @__NO_SIDE_EFFECTS__
|
|
235
|
+
function useSSRWidth() {
|
|
236
|
+
const ssrWidth = hasInjectionContext() ? /* @__PURE__ */ injectLocal(ssrWidthSymbol, null) : null;
|
|
237
|
+
return typeof ssrWidth === "number" ? ssrWidth : void 0;
|
|
238
|
+
}
|
|
239
|
+
function useMediaQuery(query, options = {}) {
|
|
240
|
+
const { window: window$1 = defaultWindow, ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
241
|
+
const isSupported = /* @__PURE__ */ useSupported(() => window$1 && "matchMedia" in window$1 && typeof window$1.matchMedia === "function");
|
|
242
|
+
const ssrSupport = shallowRef(typeof ssrWidth === "number");
|
|
243
|
+
const mediaQuery = shallowRef();
|
|
244
|
+
const matches = shallowRef(false);
|
|
245
|
+
const handler = (event) => {
|
|
246
|
+
matches.value = event.matches;
|
|
247
|
+
};
|
|
248
|
+
watchEffect(() => {
|
|
249
|
+
if (ssrSupport.value) {
|
|
250
|
+
ssrSupport.value = !isSupported.value;
|
|
251
|
+
matches.value = toValue(query).split(",").some((queryString) => {
|
|
252
|
+
const not = queryString.includes("not all");
|
|
253
|
+
const minWidth = queryString.match(/\(\s*min-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
254
|
+
const maxWidth = queryString.match(/\(\s*max-width:\s*(-?\d+(?:\.\d*)?[a-z]+\s*)\)/);
|
|
255
|
+
let res = Boolean(minWidth || maxWidth);
|
|
256
|
+
if (minWidth && res) res = ssrWidth >= pxValue(minWidth[1]);
|
|
257
|
+
if (maxWidth && res) res = ssrWidth <= pxValue(maxWidth[1]);
|
|
258
|
+
return not ? !res : res;
|
|
259
|
+
});
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
if (!isSupported.value) return;
|
|
263
|
+
mediaQuery.value = window$1.matchMedia(toValue(query));
|
|
264
|
+
matches.value = mediaQuery.value.matches;
|
|
265
|
+
});
|
|
266
|
+
useEventListener(mediaQuery, "change", handler, { passive: true });
|
|
267
|
+
return computed(() => matches.value);
|
|
268
|
+
}
|
|
269
|
+
// @__NO_SIDE_EFFECTS__
|
|
270
|
+
function useBreakpoints(breakpoints, options = {}) {
|
|
271
|
+
function getValue$1(k, delta) {
|
|
272
|
+
let v = toValue(breakpoints[toValue(k)]);
|
|
273
|
+
if (delta != null) v = increaseWithUnit(v, delta);
|
|
274
|
+
if (typeof v === "number") v = `${v}px`;
|
|
275
|
+
return v;
|
|
276
|
+
}
|
|
277
|
+
const { window: window$1 = defaultWindow, strategy = "min-width", ssrWidth = /* @__PURE__ */ useSSRWidth() } = options;
|
|
278
|
+
const ssrSupport = typeof ssrWidth === "number";
|
|
279
|
+
const mounted = ssrSupport ? shallowRef(false) : { value: true };
|
|
280
|
+
if (ssrSupport) tryOnMounted(() => mounted.value = !!window$1);
|
|
281
|
+
function match(query, size) {
|
|
282
|
+
if (!mounted.value && ssrSupport) return query === "min" ? ssrWidth >= pxValue(size) : ssrWidth <= pxValue(size);
|
|
283
|
+
if (!window$1) return false;
|
|
284
|
+
return window$1.matchMedia(`(${query}-width: ${size})`).matches;
|
|
285
|
+
}
|
|
286
|
+
const greaterOrEqual = (k) => {
|
|
287
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(k)})`, options);
|
|
288
|
+
};
|
|
289
|
+
const smallerOrEqual = (k) => {
|
|
290
|
+
return useMediaQuery(() => `(max-width: ${getValue$1(k)})`, options);
|
|
291
|
+
};
|
|
292
|
+
const shortcutMethods = Object.keys(breakpoints).reduce((shortcuts, k) => {
|
|
293
|
+
Object.defineProperty(shortcuts, k, {
|
|
294
|
+
get: () => strategy === "min-width" ? greaterOrEqual(k) : smallerOrEqual(k),
|
|
295
|
+
enumerable: true,
|
|
296
|
+
configurable: true
|
|
297
|
+
});
|
|
298
|
+
return shortcuts;
|
|
299
|
+
}, {});
|
|
300
|
+
function current() {
|
|
301
|
+
const points = Object.keys(breakpoints).map((k) => [
|
|
302
|
+
k,
|
|
303
|
+
shortcutMethods[k],
|
|
304
|
+
pxValue(getValue$1(k))
|
|
305
|
+
]).sort((a, b) => a[2] - b[2]);
|
|
306
|
+
return computed(() => points.filter(([, v]) => v.value).map(([k]) => k));
|
|
307
|
+
}
|
|
308
|
+
return Object.assign(shortcutMethods, {
|
|
309
|
+
greaterOrEqual,
|
|
310
|
+
smallerOrEqual,
|
|
311
|
+
greater(k) {
|
|
312
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(k, 0.1)})`, options);
|
|
313
|
+
},
|
|
314
|
+
smaller(k) {
|
|
315
|
+
return useMediaQuery(() => `(max-width: ${getValue$1(k, -0.1)})`, options);
|
|
316
|
+
},
|
|
317
|
+
between(a, b) {
|
|
318
|
+
return useMediaQuery(() => `(min-width: ${getValue$1(a)}) and (max-width: ${getValue$1(b, -0.1)})`, options);
|
|
319
|
+
},
|
|
320
|
+
isGreater(k) {
|
|
321
|
+
return match("min", getValue$1(k, 0.1));
|
|
322
|
+
},
|
|
323
|
+
isGreaterOrEqual(k) {
|
|
324
|
+
return match("min", getValue$1(k));
|
|
325
|
+
},
|
|
326
|
+
isSmaller(k) {
|
|
327
|
+
return match("max", getValue$1(k, -0.1));
|
|
328
|
+
},
|
|
329
|
+
isSmallerOrEqual(k) {
|
|
330
|
+
return match("max", getValue$1(k));
|
|
331
|
+
},
|
|
332
|
+
isInBetween(a, b) {
|
|
333
|
+
return match("min", getValue$1(a)) && match("max", getValue$1(b, -0.1));
|
|
334
|
+
},
|
|
335
|
+
current,
|
|
336
|
+
active() {
|
|
337
|
+
const bps = current();
|
|
338
|
+
return computed(() => bps.value.length === 0 ? "" : bps.value.at(strategy === "min-width" ? -1 : 0));
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
export {
|
|
343
|
+
_sfc_main as _,
|
|
344
|
+
onClickOutside as o,
|
|
345
|
+
useBreakpoints as u
|
|
346
|
+
};
|
|
347
|
+
//# sourceMappingURL=index-CJwlO351.js.map
|