@cocoar/vue-ui 2.0.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/_internal/use-router-link.d.ts +32 -0
- package/dist/components/_internal/use-router-link.d.ts.map +1 -0
- package/dist/components/breadcrumb/CoarBreadcrumbItem.vue.d.ts +50 -2
- package/dist/components/breadcrumb/CoarBreadcrumbItem.vue.d.ts.map +1 -1
- package/dist/components/button/CoarButton.vue.d.ts +19 -3
- package/dist/components/button/CoarButton.vue.d.ts.map +1 -1
- package/dist/components/link/CoarLink.vue.d.ts +62 -0
- package/dist/components/link/CoarLink.vue.d.ts.map +1 -0
- package/dist/components/link/index.d.ts +3 -0
- package/dist/components/link/index.d.ts.map +1 -0
- package/dist/components/menu/CoarMenuItem.vue.d.ts +23 -2
- package/dist/components/menu/CoarMenuItem.vue.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/overlay/CoarOverlayOutlet.vue.d.ts.map +1 -1
- package/dist/components/sidebar/CoarSidebarItem.vue.d.ts +30 -2
- package/dist/components/sidebar/CoarSidebarItem.vue.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1709 -1378
- package/package.json +11 -4
- package/styles/link.css +14 -0
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { resolveDynamicComponent } from 'vue';
|
|
2
|
+
/**
|
|
3
|
+
* Shared soft-Vue-Router-integration helper used by `CoarSidebarItem`,
|
|
4
|
+
* `CoarMenuItem`, `CoarButton`, and `CoarLink`. Detects whether `RouterLink`
|
|
5
|
+
* is globally registered (via `app.use(router)`) without taking a hard
|
|
6
|
+
* dependency on `vue-router` — `resolveDynamicComponent` returns the
|
|
7
|
+
* resolved component when present or the literal string `'RouterLink'`
|
|
8
|
+
* otherwise; the string-vs-component check is the canonical Vue 3 detection
|
|
9
|
+
* pattern.
|
|
10
|
+
*
|
|
11
|
+
* Also exposes a one-shot warning for the silent-footgun case: consumer
|
|
12
|
+
* passes a non-string `to` (an object route literal like `{ name: 'docs' }`)
|
|
13
|
+
* to a component that has no router available — we fall back to
|
|
14
|
+
* `<a href={String(to)}>` which renders `href="[object Object]"` and never
|
|
15
|
+
* navigates. The warning fires at most once per call site and only in DEV
|
|
16
|
+
* builds; production output is silent.
|
|
17
|
+
*/
|
|
18
|
+
export interface RouterLinkBinding {
|
|
19
|
+
/** Resolved `<RouterLink>` component, or the string `'RouterLink'` if unregistered. */
|
|
20
|
+
RouterLink: ReturnType<typeof resolveDynamicComponent>;
|
|
21
|
+
/** True when `vue-router` is installed AND its plugin registered globally. */
|
|
22
|
+
hasRouterLink: boolean;
|
|
23
|
+
/**
|
|
24
|
+
* Call from the consuming component (typically inside the same setup block
|
|
25
|
+
* where `to` is read for the first time) to emit a DEV-only warning when
|
|
26
|
+
* `to` is an object but no router is installed. Idempotent — fires only
|
|
27
|
+
* once per `useRouterLink()` call.
|
|
28
|
+
*/
|
|
29
|
+
warnIfMisconfigured(toValue: unknown, componentName: string): void;
|
|
30
|
+
}
|
|
31
|
+
export declare function useRouterLink(): RouterLinkBinding;
|
|
32
|
+
//# sourceMappingURL=use-router-link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-router-link.d.ts","sourceRoot":"","sources":["../../../src/components/_internal/use-router-link.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,KAAK,CAAC;AAE9C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,iBAAiB;IAChC,uFAAuF;IACvF,UAAU,EAAE,UAAU,CAAC,OAAO,uBAAuB,CAAC,CAAC;IACvD,8EAA8E;IAC9E,aAAa,EAAE,OAAO,CAAC;IACvB;;;;;OAKG;IACH,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CACpE;AAED,wBAAgB,aAAa,IAAI,iBAAiB,CAsBjD"}
|
|
@@ -1,17 +1,65 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
1
2
|
type __VLS_Props = {
|
|
2
|
-
/**
|
|
3
|
+
/**
|
|
4
|
+
* Vue Router target. When set, the item renders as `<a href>` instead of
|
|
5
|
+
* requiring the consumer to slot an `<a>` / `<RouterLink>` themselves —
|
|
6
|
+
* for the common 90% case where every crumb is a link. Routing is via
|
|
7
|
+
* `<RouterLink>` if `vue-router` is installed and registered, otherwise
|
|
8
|
+
* a plain `<a href={String(to)}>` fallback.
|
|
9
|
+
*
|
|
10
|
+
* If `active` is also set, `to` is intentionally IGNORED: the current
|
|
11
|
+
* page is by WAI-ARIA convention NOT a link to itself, so the item
|
|
12
|
+
* renders as `<span aria-current="page">`. Consumers can pass `to` for
|
|
13
|
+
* every crumb (including the last) without stripping it manually — the
|
|
14
|
+
* `active` flag is the single source of truth for "this is current page".
|
|
15
|
+
*/
|
|
16
|
+
to?: RouteLocationRaw | string;
|
|
17
|
+
/**
|
|
18
|
+
* External `href`. Used when `to` is not set — for absolute URLs and
|
|
19
|
+
* non-router targets. Same active-wins rule as `to`.
|
|
20
|
+
*/
|
|
21
|
+
href?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Leading icon name (rendered before the slot content, inside the `<a>` /
|
|
24
|
+
* `<span>` so it shares the link's hit-area and styling). Override with
|
|
25
|
+
* the `#icon` slot for custom content (avatar, badge, coloured icon).
|
|
26
|
+
*/
|
|
27
|
+
icon?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Marks this item as the current page. Renders as a non-interactive
|
|
30
|
+
* `<span aria-current="page">` even if `to` / `href` are set. Convention
|
|
31
|
+
* is that the last breadcrumb is the active one.
|
|
32
|
+
*/
|
|
3
33
|
active?: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* Visually de-activates the link. `aria-disabled="true"`, `tabindex="-1"`,
|
|
36
|
+
* navigation suppressed. Only meaningful in link mode (no effect on
|
|
37
|
+
* active mode — already non-interactive — or on bare-slot mode).
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
4
40
|
};
|
|
5
41
|
declare function __VLS_template(): {
|
|
6
42
|
attrs: Partial<{}>;
|
|
7
43
|
slots: {
|
|
44
|
+
icon?(_: {}): any;
|
|
45
|
+
icon?(_: {}): any;
|
|
46
|
+
icon?(_: {}): any;
|
|
47
|
+
default?(_: {}): any;
|
|
48
|
+
default?(_: {}): any;
|
|
49
|
+
default?(_: {}): any;
|
|
8
50
|
default?(_: {}): any;
|
|
9
51
|
};
|
|
10
52
|
refs: {};
|
|
11
53
|
rootEl: HTMLLIElement;
|
|
12
54
|
};
|
|
13
55
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
14
|
-
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
56
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
57
|
+
disabled: boolean;
|
|
58
|
+
to: RouteLocationRaw | string;
|
|
59
|
+
href: string;
|
|
60
|
+
icon: string;
|
|
61
|
+
active: boolean;
|
|
62
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLLIElement>;
|
|
15
63
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
16
64
|
export default _default;
|
|
17
65
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarBreadcrumbItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/CoarBreadcrumbItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoarBreadcrumbItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/breadcrumb/CoarBreadcrumbItem.vue"],"names":[],"mappings":"AA+QA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,KAAK,WAAW,GAAG;IACf;;;;;;;;;;;;OAYG;IACH,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AA+EJ,iBAAS,cAAc;WAwJT,OAAO,IAA6B;;sBAhBxB,GAAG;sBAEF,GAAG;sBAEH,GAAG;yBAHD,GAAG;yBAEF,GAAG;yBAEH,GAAG;yBACH,GAAG;;;;EAehC;AAeD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;cA7PN,OAAO;QAvBb,gBAAgB,GAAG,MAAM;UAKvB,MAAM;UAMN,MAAM;YAMJ,OAAO;uFA2QlB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
1
2
|
export type ButtonVariant = 'primary' | 'secondary' | 'tertiary' | 'danger' | 'ghost';
|
|
2
3
|
export type ButtonSize = 'xs' | 's' | 'm' | 'l';
|
|
3
4
|
export interface CoarButtonProps {
|
|
@@ -9,7 +10,7 @@ export interface CoarButtonProps {
|
|
|
9
10
|
disabled?: boolean;
|
|
10
11
|
/** Whether the button is in loading state */
|
|
11
12
|
loading?: boolean;
|
|
12
|
-
/** Button type attribute */
|
|
13
|
+
/** Button type attribute (only applied when rendering as <button>). */
|
|
13
14
|
type?: 'button' | 'submit' | 'reset';
|
|
14
15
|
/** Icon name to display before the label */
|
|
15
16
|
iconStart?: string;
|
|
@@ -19,6 +20,20 @@ export interface CoarButtonProps {
|
|
|
19
20
|
fullWidth?: boolean;
|
|
20
21
|
/** Optional aria-label for the underlying button */
|
|
21
22
|
ariaLabel?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Optional Vue Router target. Accepts anything `RouterLink.to` accepts
|
|
25
|
+
* (string path, named-route object, etc.). When set the button renders as
|
|
26
|
+
* an `<a href>` (via `RouterLink` if `vue-router` is installed, otherwise
|
|
27
|
+
* a plain anchor) so middle-click / ctrl-click open a new tab, right-click
|
|
28
|
+
* exposes "Open in new tab" / "Copy link address", and screenreaders
|
|
29
|
+
* announce "link" instead of "button". `vue-router` is intentionally NOT a
|
|
30
|
+
* peerDependency — apps without a router can still use buttons normally.
|
|
31
|
+
*
|
|
32
|
+
* `type` and the native `disabled` attribute are dropped on the link path
|
|
33
|
+
* (invalid on `<a>`); disabled/loading state is enforced via
|
|
34
|
+
* `aria-disabled`, `tabindex=-1`, and `pointer-events: none` from CSS.
|
|
35
|
+
*/
|
|
36
|
+
to?: RouteLocationRaw | string;
|
|
22
37
|
}
|
|
23
38
|
declare function __VLS_template(): {
|
|
24
39
|
attrs: Partial<{}>;
|
|
@@ -26,7 +41,7 @@ declare function __VLS_template(): {
|
|
|
26
41
|
default?(_: {}): any;
|
|
27
42
|
};
|
|
28
43
|
refs: {};
|
|
29
|
-
rootEl:
|
|
44
|
+
rootEl: any;
|
|
30
45
|
};
|
|
31
46
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
32
47
|
declare const __VLS_component: import('vue').DefineComponent<CoarButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -43,7 +58,8 @@ declare const __VLS_component: import('vue').DefineComponent<CoarButtonProps, {}
|
|
|
43
58
|
iconEnd: string;
|
|
44
59
|
fullWidth: boolean;
|
|
45
60
|
ariaLabel: string;
|
|
46
|
-
|
|
61
|
+
to: RouteLocationRaw | string;
|
|
62
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
47
63
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
48
64
|
export default _default;
|
|
49
65
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/button/CoarButton.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoarButton.vue.d.ts","sourceRoot":"","sources":["../../../src/components/button/CoarButton.vue"],"names":[],"mappings":"AA+dA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,GAAG,OAAO,CAAC;AACtF,MAAM,MAAM,UAAU,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAEhD,MAAM,WAAW,eAAe;IAC9B,4BAA4B;IAC5B,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,kBAAkB;IAClB,IAAI,CAAC,EAAE,UAAU,CAAC;IAClB,qCAAqC;IACrC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,6CAA6C;IAC7C,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,uEAAuE;IACvE,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,2CAA2C;IAC3C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,oDAAoD;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;;;;;;;OAYG;IACH,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;CAChC;AAwGD,iBAAS,cAAc;WAgLT,OAAO,IAA6B;;yBAVpB,GAAG;;;;EAehC;AAiBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;cA1UR,OAAO;UAIX,QAAQ,GAAG,QAAQ,GAAG,OAAO;UAN7B,UAAU;aAFP,aAAa;aAMb,OAAO;eAIL,MAAM;aAER,MAAM;eAEJ,OAAO;eAEP,MAAM;QAcb,gBAAgB,GAAG,MAAM;6EAyT9B,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
2
|
+
export type CoarLinkVariant = 'accent' | 'subtle';
|
|
3
|
+
export type CoarLinkSize = 's' | 'm' | 'l';
|
|
4
|
+
export interface CoarLinkProps {
|
|
5
|
+
/**
|
|
6
|
+
* Vue Router target. Takes precedence over `href`. When set the link
|
|
7
|
+
* renders via `<RouterLink>` (if installed) for SPA navigation, or a
|
|
8
|
+
* plain `<a href={String(to)}>` fallback. Modifier-click (Ctrl/Cmd/middle)
|
|
9
|
+
* opens a new tab natively in both cases.
|
|
10
|
+
*/
|
|
11
|
+
to?: RouteLocationRaw | string;
|
|
12
|
+
/**
|
|
13
|
+
* External `href`. Used when `to` is not set — for absolute URLs and
|
|
14
|
+
* `mailto:` / `tel:` schemes that have no router target. If `target` is
|
|
15
|
+
* `_blank` and `rel` is not provided, `rel="noopener"` is added
|
|
16
|
+
* automatically to defend against tab-nabbing.
|
|
17
|
+
*/
|
|
18
|
+
href?: string;
|
|
19
|
+
/** Visual variant — `accent` is the default link color, `subtle` blends into surrounding text. */
|
|
20
|
+
variant?: CoarLinkVariant;
|
|
21
|
+
/** Typography size — `s`, `m` (default), `l`. */
|
|
22
|
+
size?: CoarLinkSize;
|
|
23
|
+
/** Disabled state — `aria-disabled`, `tabindex=-1`, navigation suppressed. */
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
/** Anchor `target` attribute. Only applied when rendering as a plain `<a>` (not via `<RouterLink>`). */
|
|
26
|
+
target?: string;
|
|
27
|
+
/** Anchor `rel` attribute. Auto-fills to `noopener` when `target="_blank"` is set and `rel` is omitted. */
|
|
28
|
+
rel?: string;
|
|
29
|
+
}
|
|
30
|
+
declare function __VLS_template(): {
|
|
31
|
+
attrs: Partial<{}>;
|
|
32
|
+
slots: {
|
|
33
|
+
default?(_: {}): any;
|
|
34
|
+
default?(_: {}): any;
|
|
35
|
+
default?(_: {}): any;
|
|
36
|
+
default?(_: {}): any;
|
|
37
|
+
};
|
|
38
|
+
refs: {};
|
|
39
|
+
rootEl: any;
|
|
40
|
+
};
|
|
41
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
42
|
+
declare const __VLS_component: import('vue').DefineComponent<CoarLinkProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
43
|
+
click: (event: MouseEvent) => any;
|
|
44
|
+
}, string, import('vue').PublicProps, Readonly<CoarLinkProps> & Readonly<{
|
|
45
|
+
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
46
|
+
}>, {
|
|
47
|
+
disabled: boolean;
|
|
48
|
+
target: string;
|
|
49
|
+
size: CoarLinkSize;
|
|
50
|
+
variant: CoarLinkVariant;
|
|
51
|
+
to: RouteLocationRaw | string;
|
|
52
|
+
href: string;
|
|
53
|
+
rel: string;
|
|
54
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
55
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
56
|
+
export default _default;
|
|
57
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
58
|
+
new (): {
|
|
59
|
+
$slots: S;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
//# sourceMappingURL=CoarLink.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CoarLink.vue.d.ts","sourceRoot":"","sources":["../../../src/components/link/CoarLink.vue"],"names":[],"mappings":"AA4LA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAGnD,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAClD,MAAM,MAAM,YAAY,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AAE3C,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,kGAAkG;IAClG,OAAO,CAAC,EAAE,eAAe,CAAC;IAC1B,iDAAiD;IACjD,IAAI,CAAC,EAAE,YAAY,CAAC;IACpB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,wGAAwG;IACxG,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,2GAA2G;IAC3G,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAqFD,iBAAS,cAAc;WAqFT,OAAO,IAA6B;;yBAbrB,GAAG;yBACH,GAAG;yBACH,GAAG;yBACH,GAAG;;;;EAe/B;AAkBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;cAvMR,OAAO;YAET,MAAM;UAJR,YAAY;aAFT,eAAe;QATpB,gBAAgB,GAAG,MAAM;UAOvB,MAAM;SAUP,MAAM;6EA2MZ,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/link/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACrD,YAAY,EACV,aAAa,EACb,YAAY,EACZ,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
1
2
|
export interface MenuItemClickEvent {
|
|
2
3
|
/** Call to prevent auto-close of the menu tree */
|
|
3
4
|
keepMenuOpen(): void;
|
|
@@ -9,6 +10,23 @@ type __VLS_Props = {
|
|
|
9
10
|
label?: string;
|
|
10
11
|
/** Optional icon name */
|
|
11
12
|
icon?: string;
|
|
13
|
+
/**
|
|
14
|
+
* Optional Vue Router target. Accepts anything `RouterLink.to` accepts
|
|
15
|
+
* (string path, named-route object, etc.). When set the item renders as a
|
|
16
|
+
* real `<a href>` so middle-click / ctrl-click open a new tab, right-click
|
|
17
|
+
* exposes "Open in new tab" / "Copy link address", and screenreaders
|
|
18
|
+
* announce "link to {label}" instead of just "menuitem". Routing is
|
|
19
|
+
* delegated to `RouterLink` when `vue-router` is installed; otherwise a
|
|
20
|
+
* plain `<a>` is rendered (works for absolute URLs via the browser's
|
|
21
|
+
* native navigation). `vue-router` is intentionally NOT a peerDependency.
|
|
22
|
+
*
|
|
23
|
+
* `clicked` is still emitted on plain-click after navigation kicks off,
|
|
24
|
+
* so `keepMenuOpen()` and other consumer side-effects continue to work.
|
|
25
|
+
* On modifier-click (Ctrl/Cmd/Middle = new tab) the click event is
|
|
26
|
+
* suppressed by the browser default — the menu does NOT auto-close so
|
|
27
|
+
* the user can fire several link items in a row.
|
|
28
|
+
*/
|
|
29
|
+
to?: RouteLocationRaw | string;
|
|
12
30
|
/** Disabled state */
|
|
13
31
|
disabled?: boolean;
|
|
14
32
|
};
|
|
@@ -16,11 +34,13 @@ declare function __VLS_template(): {
|
|
|
16
34
|
attrs: Partial<{}>;
|
|
17
35
|
slots: {
|
|
18
36
|
default?(_: {}): any;
|
|
37
|
+
default?(_: {}): any;
|
|
38
|
+
default?(_: {}): any;
|
|
19
39
|
};
|
|
20
40
|
refs: {
|
|
21
41
|
itemRef: HTMLDivElement;
|
|
22
42
|
};
|
|
23
|
-
rootEl:
|
|
43
|
+
rootEl: any;
|
|
24
44
|
};
|
|
25
45
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
26
46
|
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
@@ -30,10 +50,11 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
|
|
|
30
50
|
}>, {
|
|
31
51
|
label: string;
|
|
32
52
|
disabled: boolean;
|
|
53
|
+
to: RouteLocationRaw | string;
|
|
33
54
|
icon: string;
|
|
34
55
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
35
56
|
itemRef: HTMLDivElement;
|
|
36
|
-
},
|
|
57
|
+
}, any>;
|
|
37
58
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
38
59
|
export default _default;
|
|
39
60
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarMenuItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/menu/CoarMenuItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoarMenuItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/menu/CoarMenuItem.vue"],"names":[],"mappings":"AA2WA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAInD,MAAM,WAAW,kBAAkB;IACjC,kDAAkD;IAClD,YAAY,IAAI,IAAI,CAAC;IACrB,2BAA2B;IAC3B,KAAK,EAAE,UAAU,CAAC;CACnB;AAED,KAAK,WAAW,GAAG;IACf,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;OAeG;IACH,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAC/B,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;AAwKJ,iBAAS,cAAc;WAqKT,OAAO,IAA6B;;yBAbpB,GAAG;yBACH,GAAG;yBACH,GAAG;;;;;;EAgBhC;AAmBD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;WA5XT,MAAM;cAqBH,OAAO;QAFb,gBAAgB,GAAG,MAAM;UAjBvB,MAAM;;;OAmYf,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -77,13 +77,13 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_PublicProps,
|
|
|
77
77
|
name: string;
|
|
78
78
|
placeholder: string;
|
|
79
79
|
size: CoarNumberInputSize;
|
|
80
|
+
step: number;
|
|
80
81
|
max: number;
|
|
81
82
|
readonly: boolean;
|
|
82
83
|
clearable: boolean;
|
|
83
84
|
prefix: string;
|
|
84
85
|
suffix: string;
|
|
85
86
|
min: number;
|
|
86
|
-
step: number;
|
|
87
87
|
decimals: number;
|
|
88
88
|
stepperButtons: CoarNumberInputStepperButtons;
|
|
89
89
|
locale: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarNumberInput.vue.d.ts","sourceRoot":"","sources":["../../../src/components/number-input/CoarNumberInput.vue"],"names":[],"mappings":"AA+qBA,0CAA0C;AAC1C,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,MAAM,mBAAmB,GAAG,IAAI,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;AACzD,MAAM,MAAM,6BAA6B,GAAG,MAAM,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAExF,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,IAAI,CAAC,EAAE,mBAAmB,CAAC;IAC3B,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,4BAA4B;IAC5B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gCAAgC;IAChC,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AAG,WAAW,CAAC;AAKhB,iBAAS,cAAc;WAmKT,OAAO,IAA6B;;wBAZtB,GAAG;wBACH,GAAG;;;;;;EAgB9B;AAkCD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;;;;;;;;;WAjfX,OAAO;cAFJ,OAAO;cAJP,OAAO;QAoBb,MAAM;UAEJ,MAAM;iBAlCC,MAAM;UAEb,mBAAmB;UAMnB,MAAM;SAFP,MAAM;cAQD,OAAO;eAMN,OAAO;YAIV,MAAM;YAEN,MAAM;SAtBT,MAAM;cAMD,MAAM;oBAYA,6BAA6B;YAMrC,MAAM;kBAEA,kBAAkB;;;kBA+ejC,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAapG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarOverlayOutlet.vue.d.ts","sourceRoot":"","sources":["../../../src/components/overlay/CoarOverlayOutlet.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoarOverlayOutlet.vue.d.ts","sourceRoot":"","sources":["../../../src/components/overlay/CoarOverlayOutlet.vue"],"names":[],"mappings":"AAqJA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEzD,KAAK,WAAW,GAAG;IACjB,QAAQ,EAAE,eAAe,CAAC;CAC3B,CAAC;AAqDF,iBAAS,cAAc;WA6FT,OAAO,IAA6B;;yBAZpB,GAAG;;;;;;;EAiBhC;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe;;;OAQnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
+
import { RouteLocationRaw } from 'vue-router';
|
|
1
2
|
type __VLS_Props = {
|
|
2
3
|
/** Item label text */
|
|
3
4
|
label: string;
|
|
4
5
|
/** Icon name (required for collapsed mode) */
|
|
5
6
|
icon?: string;
|
|
6
|
-
/**
|
|
7
|
+
/**
|
|
8
|
+
* Optional Vue Router target. Accepts anything `RouterLink.to` accepts
|
|
9
|
+
* (string path, named-route object, etc.). When set the item renders as a
|
|
10
|
+
* real `<a href>` so:
|
|
11
|
+
* - middle-click + ctrl/cmd-click open in a new tab (browser default)
|
|
12
|
+
* - right-click shows "Open in new tab" / "Copy link address"
|
|
13
|
+
* - screenreaders announce "link" instead of "menuitem"
|
|
14
|
+
* Routing is delegated to `RouterLink` when `vue-router` is installed and
|
|
15
|
+
* its plugin registered globally; otherwise we degrade to a plain anchor
|
|
16
|
+
* that uses the browser's native navigation (works for absolute URLs).
|
|
17
|
+
* `vue-router` is an optional `peerDependenciesMeta` entry — apps without
|
|
18
|
+
* a router still use this component for click-emit items (logout, toggles).
|
|
19
|
+
*
|
|
20
|
+
* A11y note: the `<a>` branch intentionally drops `role="menuitem"`. The
|
|
21
|
+
* surrounding `<CoarSidebar>` is `role="navigation"`, where a native link
|
|
22
|
+
* is semantically complete on its own — adding `role="menuitem"` would
|
|
23
|
+
* require a `role="menu"` parent per WAI-ARIA and would mislead AT
|
|
24
|
+
* announcements. The legacy `<div>` branch (no `to`) keeps the role for
|
|
25
|
+
* back-compat with the original API.
|
|
26
|
+
*/
|
|
27
|
+
to?: RouteLocationRaw | string;
|
|
28
|
+
/**
|
|
29
|
+
* Whether this item is currently active (e.g. current route).
|
|
30
|
+
* If `to` is set and `active` is left undefined, the active state is
|
|
31
|
+
* inferred from `RouterLink`'s `isActive`. Setting `active` explicitly
|
|
32
|
+
* always wins (use for non-route active states, e.g. drawer-open).
|
|
33
|
+
*/
|
|
7
34
|
active?: boolean;
|
|
8
35
|
/** Disabled state */
|
|
9
36
|
disabled?: boolean;
|
|
@@ -14,8 +41,9 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
14
41
|
onClick?: ((event: MouseEvent) => any) | undefined;
|
|
15
42
|
}>, {
|
|
16
43
|
disabled: boolean;
|
|
44
|
+
to: RouteLocationRaw | string;
|
|
17
45
|
icon: string;
|
|
18
46
|
active: boolean;
|
|
19
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {},
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
48
|
export default _default;
|
|
21
49
|
//# sourceMappingURL=CoarSidebarItem.vue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CoarSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/CoarSidebarItem.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CoarSidebarItem.vue.d.ts","sourceRoot":"","sources":["../../../src/components/sidebar/CoarSidebarItem.vue"],"names":[],"mappings":"AAyXA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAcnD,KAAK,WAAW,GAAG;IACf,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;;;;;;;;;;OAmBG;IACH,EAAE,CAAC,EAAE,gBAAgB,GAAG,MAAM,CAAC;IAC/B;;;;;OAKG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,CAAC;;;;;;cADW,OAAO;QATb,gBAAgB,GAAG,MAAM;UArBvB,MAAM;YA4BJ,OAAO;;AAwRpB,wBAQG"}
|