@paperless/core 3.19.2 → 3.19.3
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/build/p-9781d974.entry.js +1 -0
- package/dist/build/p-a001874d.entry.js +1 -0
- package/dist/build/p-cdd2faed.js +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-submenu-item.cjs.entry.js +22 -16
- package/dist/cjs/p-submenu.cjs.entry.js +92 -9
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/collection/components/molecules/submenu/item/submenu-item.component.css +1 -1
- package/dist/collection/components/molecules/submenu/item/submenu-item.component.js +37 -14
- package/dist/collection/components/molecules/submenu/menu/submenu.component.css +1 -1
- package/dist/collection/components/molecules/submenu/menu/submenu.component.js +106 -8
- package/dist/collection/components/molecules/submenu/menu/submenu.stories.js +8 -2
- package/dist/components/p-submenu-item.js +1 -1
- package/dist/components/p-submenu.js +1 -1
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-submenu-item.entry.js +23 -17
- package/dist/esm/p-submenu.entry.js +92 -9
- package/dist/esm/paperless.js +1 -1
- package/dist/index.html +1 -1
- package/dist/paperless/p-9781d974.entry.js +1 -0
- package/dist/paperless/p-a001874d.entry.js +1 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +1 -1
- package/dist/sw.js.map +1 -1
- package/dist/types/components/molecules/submenu/item/submenu-item.component.d.ts +7 -0
- package/dist/types/components/molecules/submenu/menu/submenu.component.d.ts +15 -0
- package/dist/types/components/molecules/submenu/menu/submenu.stories.d.ts +8 -1
- package/dist/types/components.d.ts +19 -0
- package/hydrate/index.js +127 -35
- package/hydrate/index.mjs +127 -35
- package/package.json +1 -1
- package/dist/build/p-5b0fe9d2.entry.js +0 -1
- package/dist/build/p-81e96c69.entry.js +0 -1
- package/dist/build/p-b344aaa1.js +0 -1
- package/dist/paperless/p-5b0fe9d2.entry.js +0 -1
- package/dist/paperless/p-81e96c69.entry.js +0 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { EventEmitter } from '../../../../stencil-public-runtime';
|
|
1
2
|
import { IconVariant } from '../../../../types/icon';
|
|
2
3
|
export declare class SubmenuItem {
|
|
3
4
|
/**
|
|
@@ -8,5 +9,11 @@ export declare class SubmenuItem {
|
|
|
8
9
|
* Icon to show on the label
|
|
9
10
|
*/
|
|
10
11
|
icon: IconVariant;
|
|
12
|
+
/**
|
|
13
|
+
* Event when the active state changes
|
|
14
|
+
*/
|
|
15
|
+
activeChange: EventEmitter<boolean>;
|
|
16
|
+
private _lastActiveState;
|
|
17
|
+
componentDidRender(): void;
|
|
11
18
|
render(): any;
|
|
12
19
|
}
|
|
@@ -27,6 +27,21 @@ export declare class Submenu {
|
|
|
27
27
|
* The host element
|
|
28
28
|
*/
|
|
29
29
|
private _el;
|
|
30
|
+
private _activeItemPosition;
|
|
31
|
+
private _showItemIndicator;
|
|
32
|
+
private _headerOffset;
|
|
33
|
+
private _submenuItems;
|
|
34
|
+
private _hoveringItem;
|
|
35
|
+
private _itemActiveListener;
|
|
36
|
+
private _itemMouseEnterListener;
|
|
37
|
+
private _itemMouseLeaveListener;
|
|
30
38
|
componentDidLoad(): void;
|
|
39
|
+
componentDidRender(): void;
|
|
40
|
+
disconnectedCallback(): void;
|
|
31
41
|
render(): any;
|
|
42
|
+
onWindowResize(): void;
|
|
43
|
+
private _calculateHeaderOffset;
|
|
44
|
+
private _setItemPosition;
|
|
45
|
+
private _slotChanged;
|
|
46
|
+
private _removeListeners;
|
|
32
47
|
}
|
|
@@ -5,6 +5,12 @@ declare const meta: {
|
|
|
5
5
|
title: string;
|
|
6
6
|
subtitle: string;
|
|
7
7
|
index: number;
|
|
8
|
+
activeItem: boolean;
|
|
9
|
+
};
|
|
10
|
+
argTypes: {
|
|
11
|
+
activeItem: {
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
8
14
|
};
|
|
9
15
|
parameters: {
|
|
10
16
|
docs: {
|
|
@@ -17,8 +23,9 @@ declare const meta: {
|
|
|
17
23
|
};
|
|
18
24
|
export default meta;
|
|
19
25
|
export declare const Default: {
|
|
20
|
-
render: ({ active, open, title, subtitle, index, showIndex }: {
|
|
26
|
+
render: ({ active, activeItem, open, title, subtitle, index, showIndex }: {
|
|
21
27
|
active: any;
|
|
28
|
+
activeItem: any;
|
|
22
29
|
open: any;
|
|
23
30
|
title: any;
|
|
24
31
|
subtitle: any;
|
|
@@ -2796,6 +2796,10 @@ export interface PSelectCustomEvent<T> extends CustomEvent<T> {
|
|
|
2796
2796
|
detail: T;
|
|
2797
2797
|
target: HTMLPSelectElement;
|
|
2798
2798
|
}
|
|
2799
|
+
export interface PSubmenuItemCustomEvent<T> extends CustomEvent<T> {
|
|
2800
|
+
detail: T;
|
|
2801
|
+
target: HTMLPSubmenuItemElement;
|
|
2802
|
+
}
|
|
2799
2803
|
export interface PTableCustomEvent<T> extends CustomEvent<T> {
|
|
2800
2804
|
detail: T;
|
|
2801
2805
|
target: HTMLPTableElement;
|
|
@@ -3528,7 +3532,18 @@ declare global {
|
|
|
3528
3532
|
prototype: HTMLPSubmenuElement;
|
|
3529
3533
|
new (): HTMLPSubmenuElement;
|
|
3530
3534
|
};
|
|
3535
|
+
interface HTMLPSubmenuItemElementEventMap {
|
|
3536
|
+
"activeChange": boolean;
|
|
3537
|
+
}
|
|
3531
3538
|
interface HTMLPSubmenuItemElement extends Components.PSubmenuItem, HTMLStencilElement {
|
|
3539
|
+
addEventListener<K extends keyof HTMLPSubmenuItemElementEventMap>(type: K, listener: (this: HTMLPSubmenuItemElement, ev: PSubmenuItemCustomEvent<HTMLPSubmenuItemElementEventMap[K]>) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3540
|
+
addEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3541
|
+
addEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | AddEventListenerOptions): void;
|
|
3542
|
+
addEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | AddEventListenerOptions): void;
|
|
3543
|
+
removeEventListener<K extends keyof HTMLPSubmenuItemElementEventMap>(type: K, listener: (this: HTMLPSubmenuItemElement, ev: PSubmenuItemCustomEvent<HTMLPSubmenuItemElementEventMap[K]>) => any, options?: boolean | EventListenerOptions): void;
|
|
3544
|
+
removeEventListener<K extends keyof DocumentEventMap>(type: K, listener: (this: Document, ev: DocumentEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
3545
|
+
removeEventListener<K extends keyof HTMLElementEventMap>(type: K, listener: (this: HTMLElement, ev: HTMLElementEventMap[K]) => any, options?: boolean | EventListenerOptions): void;
|
|
3546
|
+
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, options?: boolean | EventListenerOptions): void;
|
|
3532
3547
|
}
|
|
3533
3548
|
var HTMLPSubmenuItemElement: {
|
|
3534
3549
|
prototype: HTMLPSubmenuItemElement;
|
|
@@ -5958,6 +5973,10 @@ declare namespace LocalJSX {
|
|
|
5958
5973
|
* @default 'placeholder'
|
|
5959
5974
|
*/
|
|
5960
5975
|
"icon"?: IconVariant1;
|
|
5976
|
+
/**
|
|
5977
|
+
* Event when the active state changes
|
|
5978
|
+
*/
|
|
5979
|
+
"onActiveChange"?: (event: PSubmenuItemCustomEvent<boolean>) => void;
|
|
5961
5980
|
}
|
|
5962
5981
|
interface PTabContainer {
|
|
5963
5982
|
}
|
package/hydrate/index.js
CHANGED
|
@@ -88670,7 +88670,7 @@ const header$5 = cva(`relative z-[1] inline-flex w-full flex-col justify-start r
|
|
|
88670
88670
|
},
|
|
88671
88671
|
},
|
|
88672
88672
|
});
|
|
88673
|
-
const content$
|
|
88673
|
+
const content$6 = cva('flex items-center gap-2', {
|
|
88674
88674
|
variants: {
|
|
88675
88675
|
variant: {
|
|
88676
88676
|
default: 'py-3',
|
|
@@ -88713,7 +88713,7 @@ class CardHeader {
|
|
|
88713
88713
|
render() {
|
|
88714
88714
|
return (hAsync(ThemedHost, { key: 'b7eb827631c54142f2a4e3fe2b81271c8144b16a' }, hAsync("div", { key: 'fcb33fb73eb61e36d8c4990b5b27e217221b96a4', class: header$5({
|
|
88715
88715
|
variant: this.variant,
|
|
88716
|
-
}) }, hAsync("div", { key: '1ae832e07095882bb8e46398c30609e12fa4d6eb', class: content$
|
|
88716
|
+
}) }, hAsync("div", { key: '1ae832e07095882bb8e46398c30609e12fa4d6eb', class: content$6({
|
|
88717
88717
|
variant: this.variant,
|
|
88718
88718
|
}) }, this.icon ? (hAsync("p-icon", { class: '\n text-storm-300\n dark:text-hurricane-200\n ', flip: this.iconFlip, rotate: this.iconRotate, variant: this.icon })) : (hAsync("slot", { name: 'prefix' })), hAsync("div", { key: '2c9394715612b7415aeb065d9575caf755044e5f', class: title$2() }, hAsync("span", { key: '9d8e7178338dd0e4ed218c5a16d5c77486c7f240', class: 'max-w-full overflow-hidden text-ellipsis' }, this.header?.length ? this.header : hAsync("slot", null)), hAsync("slot", { key: '1483bded5220bda03e8b80228135539a8b099033', name: 'content-suffix' })), hAsync("div", { key: '62055fed1277f466d6e70578c12ce51cb9a73272', class: '\n ml-auto flex items-center justify-end gap-4\n empty:hidden\n ' }, hAsync("slot", { key: '73b2c1a055167b6050ec18f2a8b997bea8f39f8e', name: 'suffix' }))), this.variant === 'default' ? (asBoolean(this.divider) && (hAsync("p-divider", { class: '\n text-off-white-700\n dark:text-white/10\n ' }))) : (hAsync("div", { class: '\n pointer-events-none absolute left-0 top-0 z-[-1] h-full w-full\n overflow-hidden rounded-t-2xl\n ' }, hAsync("p-smile", { class: 'dark:text-hurricane-400', variant: 'card' }))))));
|
|
88719
88719
|
}
|
|
@@ -92573,7 +92573,7 @@ class Datepicker {
|
|
|
92573
92573
|
|
|
92574
92574
|
const dividerComponentCss = () => `*{box-sizing:border-box}p-divider{--tw-content:""}.static{position:static}.flex{display:flex}.h-full{height:100%}.w-full{width:100%}.flex-col{flex-direction:column}.items-center{align-items:center}.px-2{padding-left:.5rem;padding-right:.5rem}.text-sm{font-size:.875rem;line-height:1.25rem}.font-medium{font-weight:500}.text-hurricane-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.text-off-white-700{--tw-text-opacity:1;color:rgb(222 219 213/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.before\\:hidden:before{content:var(--tw-content);display:none}.before\\:h-px:before{content:var(--tw-content);height:1px}.before\\:w-px:before{content:var(--tw-content);width:1px}.before\\:flex-1:before{content:var(--tw-content);flex:1 1 0%}.before\\:bg-current:before{background-color:currentColor;content:var(--tw-content)}.before\\:content-\\[\\"\\"\\]:before{--tw-content:"";content:var(--tw-content)}.after\\:hidden:after{content:var(--tw-content);display:none}.after\\:h-px:after{content:var(--tw-content);height:1px}.after\\:w-px:after{content:var(--tw-content);width:1px}.after\\:flex-1:after{content:var(--tw-content);flex:1 1 0%}.after\\:bg-current:after{background-color:currentColor;content:var(--tw-content)}.after\\:content-\\[\\"\\"\\]:after{--tw-content:"";content:var(--tw-content)}.empty\\:px-0:empty{padding-left:0;padding-right:0}.dark\\:text-hurricane-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.dark\\:text-hurricane-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(163 165 169/var(--tw-text-opacity,1))}.dark\\:text-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}`;
|
|
92575
92575
|
|
|
92576
|
-
const content$
|
|
92576
|
+
const content$5 = cva([
|
|
92577
92577
|
'flex items-center',
|
|
92578
92578
|
`
|
|
92579
92579
|
before:content-[""]
|
|
@@ -92628,7 +92628,7 @@ class Divider {
|
|
|
92628
92628
|
get _el() { return getElement(this); }
|
|
92629
92629
|
render() {
|
|
92630
92630
|
const hasContent = this._el.innerHTML?.length > 0;
|
|
92631
|
-
return (hAsync(ThemedHost, { key: 'ff409606cbaf88fec989b154c9c16eb07b60e185' }, hAsync("div", { key: 'bbf08c6ede2f45885372760c28026fa170dd2cd7', class: cn(content$
|
|
92631
|
+
return (hAsync(ThemedHost, { key: 'ff409606cbaf88fec989b154c9c16eb07b60e185' }, hAsync("div", { key: 'bbf08c6ede2f45885372760c28026fa170dd2cd7', class: cn(content$5({
|
|
92632
92632
|
variant: this.variant,
|
|
92633
92633
|
alignContent: this.alignContent,
|
|
92634
92634
|
}), {
|
|
@@ -92852,7 +92852,7 @@ const header$4 = cva([
|
|
|
92852
92852
|
`,
|
|
92853
92853
|
'inline-flex',
|
|
92854
92854
|
]);
|
|
92855
|
-
const content$
|
|
92855
|
+
const content$4 = cva(['flex justify-between', 'min-h-12 w-full p-4 pb-0']);
|
|
92856
92856
|
const title$1 = cva([
|
|
92857
92857
|
'flex-1 text-center',
|
|
92858
92858
|
`
|
|
@@ -92874,7 +92874,7 @@ class DrawerHeader {
|
|
|
92874
92874
|
*/
|
|
92875
92875
|
close;
|
|
92876
92876
|
render() {
|
|
92877
|
-
return (hAsync(ThemedHost, { key: 'f0cc21f420fc9ede8f37b703e2bdc05b0494fdfb' }, hAsync("div", { key: 'e90c5f4e51592b3dd5aabddc4cdf394a44afc4d6', class: header$4() }, hAsync("div", { key: '7c34db9d5c88f715dc67663c4bd59292f4d5f465', class: content$
|
|
92877
|
+
return (hAsync(ThemedHost, { key: 'f0cc21f420fc9ede8f37b703e2bdc05b0494fdfb' }, hAsync("div", { key: 'e90c5f4e51592b3dd5aabddc4cdf394a44afc4d6', class: header$4() }, hAsync("div", { key: '7c34db9d5c88f715dc67663c4bd59292f4d5f465', class: content$4() }, this.showClose && (hAsync("p-button", { key: '65d62aac568049c275aaf0da50927aa162375291', icon: 'negative', iconOnly: true, variant: 'secondary', onClick: ev => this.close.emit(ev) })), hAsync("div", { key: '7e1809baea3e11b781292e5948dcd88de22adcbf', class: title$1() }, hAsync("slot", { key: 'a197919fc325a031824cc187d9f01c02047c3cce' })), this.showClose && hAsync("div", { key: 'a89a2a5c054a83c7998f8e3537294bb0d9a3654a', class: 'size-8' })), hAsync("p-smile", { key: 'b6247f9b0f7dd88fe13b507507a5802bef0b518f', class: 'dark:text-hurricane-400' }))));
|
|
92878
92878
|
}
|
|
92879
92879
|
static get style() { return drawerHeaderComponentCss(); }
|
|
92880
92880
|
static get cmpMeta() { return {
|
|
@@ -97662,7 +97662,7 @@ const header$2 = cva([
|
|
|
97662
97662
|
`,
|
|
97663
97663
|
'inline-flex aspect-[7/1] max-h-28',
|
|
97664
97664
|
]);
|
|
97665
|
-
const content$
|
|
97665
|
+
const content$3 = cva(['flex justify-end', 'h-12 w-full p-4 pb-0']);
|
|
97666
97666
|
const title = cva([
|
|
97667
97667
|
'flex-1 text-center',
|
|
97668
97668
|
'w-[calc(100%-7rem)]',
|
|
@@ -97686,7 +97686,7 @@ class ModalHeader {
|
|
|
97686
97686
|
*/
|
|
97687
97687
|
close;
|
|
97688
97688
|
render() {
|
|
97689
|
-
return (hAsync(ThemedHost, { key: '6ff888c25d7455ffd6baf7e1dd046d8446555739' }, hAsync("div", { key: '9b9fa9ee81f4174df2f880965afa9cc72b63e800', class: header$2() }, hAsync("div", { key: 'b58b6b353afa85c5e45f71abf9c4d59b5fa42eeb', class: content$
|
|
97689
|
+
return (hAsync(ThemedHost, { key: '6ff888c25d7455ffd6baf7e1dd046d8446555739' }, hAsync("div", { key: '9b9fa9ee81f4174df2f880965afa9cc72b63e800', class: header$2() }, hAsync("div", { key: 'b58b6b353afa85c5e45f71abf9c4d59b5fa42eeb', class: content$3() }, hAsync("div", { key: '576edc988821e2ae50b8a11c8fc4b81fea137cb8', class: title() }, hAsync("slot", { key: 'b9906b5af7dc8542f3d046d8ca9dccc0f8310e9d' })), this.showClose && (hAsync("p-button", { key: 'c5da895fc9b1e6ef042a5f9d829d6e584ff23ab8', icon: 'negative', iconOnly: true, variant: 'secondary', onClick: ev => this.close.emit(ev) }))), hAsync("p-smile", { key: 'e0390b852e9ae3633185cdb5441d9172a07f7986', class: 'dark:text-hurricane-400' }))));
|
|
97690
97690
|
}
|
|
97691
97691
|
static get style() { return modalHeaderComponentCss(); }
|
|
97692
97692
|
static get cmpMeta() { return {
|
|
@@ -100115,7 +100115,7 @@ const circle$1 = cva([
|
|
|
100115
100115
|
},
|
|
100116
100116
|
],
|
|
100117
100117
|
});
|
|
100118
|
-
const content$
|
|
100118
|
+
const content$2 = cva('mt-[1px] flex-1 text-sm font-medium', {
|
|
100119
100119
|
variants: {
|
|
100120
100120
|
finished: {
|
|
100121
100121
|
true: null,
|
|
@@ -100202,7 +100202,7 @@ class StepperItem {
|
|
|
100202
100202
|
direction: this.direction,
|
|
100203
100203
|
active: asBoolean(this.active),
|
|
100204
100204
|
finished: asBoolean(this.finished),
|
|
100205
|
-
}) }, this.number), hAsync("div", { key: 'faafa708b0f4548661dfeb114fa78530377d896f', class: content$
|
|
100205
|
+
}) }, this.number), hAsync("div", { key: 'faafa708b0f4548661dfeb114fa78530377d896f', class: content$2({
|
|
100206
100206
|
active: asBoolean(this.active),
|
|
100207
100207
|
finished: asBoolean(this.finished),
|
|
100208
100208
|
direction: this.direction,
|
|
@@ -100257,7 +100257,7 @@ class StepperLine {
|
|
|
100257
100257
|
}; }
|
|
100258
100258
|
}
|
|
100259
100259
|
|
|
100260
|
-
const submenuComponentCss = () => `*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left
|
|
100260
|
+
const submenuComponentCss = () => `*{box-sizing:border-box}.static{position:static}.absolute{position:absolute}.relative{position:relative}.left-6{left:1.5rem}.top-0{top:0}.z-0{z-index:0}.z-10{z-index:10}.z-\\[1\\]{z-index:1}.m-0{margin:0}.m-2{margin:.5rem}.my-2{margin-bottom:.5rem;margin-top:.5rem}.flex{display:flex}.size-4{height:1rem;width:1rem}.h-8{height:2rem}.w-\\[2px\\]{width:2px}.w-full{width:100%}.w-px{width:1px}.flex-1{flex:1 1 0%}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.cursor-pointer{cursor:pointer}.resize{resize:both}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.gap-2{gap:.5rem}.overflow-hidden{overflow:hidden}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:.5rem}.bg-hurricane-400{--tw-bg-opacity:1;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))}.bg-indigo-100{--tw-bg-opacity:1;background-color:rgb(227 236 254/var(--tw-bg-opacity,1))}.bg-indigo-200{--tw-bg-opacity:1;background-color:rgb(199 217 253/var(--tw-bg-opacity,1))}.bg-indigo-50{--tw-bg-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity,1))}.bg-indigo-500{--tw-bg-opacity:1;background-color:rgb(142 179 251/var(--tw-bg-opacity,1))}.bg-indigo-600{--tw-bg-opacity:1;background-color:rgb(82 138 250/var(--tw-bg-opacity,1))}.bg-off-white-300{--tw-bg-opacity:1;background-color:rgb(248 247 244/var(--tw-bg-opacity,1))}.bg-off-white-400{--tw-bg-opacity:1;background-color:rgb(245 244 241/var(--tw-bg-opacity,1))}.bg-storm-500\\/30{background-color:rgba(24,30,41,.3)}.bg-transparent{background-color:transparent}.p-2{padding:.5rem}.py-1{padding-bottom:.25rem;padding-top:.25rem}.pl-2{padding-left:.5rem}.pr-4{padding-right:1rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-semibold{font-weight:600}.text-hurricane-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-indigo-200{--tw-text-opacity:1;color:rgb(199 217 253/var(--tw-text-opacity,1))}.text-storm-300{--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.text-storm-500{--tw-text-opacity:1;color:rgb(24 30 41/var(--tw-text-opacity,1))}.text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.transition-\\[max-height\\]{transition-duration:.15s;transition-property:max-height;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-all{transition-duration:.15s;transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1)}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:bg-indigo-50:hover{--tw-bg-opacity:1;background-color:rgb(241 246 255/var(--tw-bg-opacity,1))}.group\\/submenu-header:hover .group-hover\\/submenu-header\\:text-white{--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-400:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-bg-opacity:1;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-600\\/30:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:rgba(82,138,250,.3)}.dark\\:bg-storm-500\\/20:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:rgba(24,30,41,.2)}.dark\\:bg-storm-500\\/30:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:rgba(24,30,41,.3)}.dark\\:text-hurricane-100:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.dark\\:text-hurricane-300:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.dark\\:text-hurricane-500:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(54 60 70/var(--tw-text-opacity,1))}.dark\\:text-indigo-200:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(199 217 253/var(--tw-text-opacity,1))}.dark\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-indigo-600\\/10:hover:where(:host([data-theme=dark]),:host([data-theme=dark]) *){background-color:rgba(82,138,250,.1)}.group\\/submenu-header:hover .dark\\:group-hover\\/submenu-header\\:text-white:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:bg-hurricane-400:where([data-theme=dark],[data-theme=dark] *){--tw-bg-opacity:1;background-color:rgb(70 75 84/var(--tw-bg-opacity,1))}.dark\\:bg-indigo-600\\/30:where([data-theme=dark],[data-theme=dark] *){background-color:rgba(82,138,250,.3)}.dark\\:bg-storm-500\\/20:where([data-theme=dark],[data-theme=dark] *){background-color:rgba(24,30,41,.2)}.dark\\:bg-storm-500\\/30:where([data-theme=dark],[data-theme=dark] *){background-color:rgba(24,30,41,.3)}.dark\\:text-hurricane-100:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.dark\\:text-hurricane-300:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(116 120 127/var(--tw-text-opacity,1))}.dark\\:text-hurricane-500:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(54 60 70/var(--tw-text-opacity,1))}.dark\\:text-indigo-200:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(199 217 253/var(--tw-text-opacity,1))}.dark\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}.dark\\:hover\\:bg-indigo-600\\/10:hover:where([data-theme=dark],[data-theme=dark] *){background-color:rgba(82,138,250,.1)}.group\\/submenu-header:hover .dark\\:group-hover\\/submenu-header\\:text-white:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity,1))}`;
|
|
100261
100261
|
|
|
100262
100262
|
const header$1 = cva([
|
|
100263
100263
|
'group/submenu-header',
|
|
@@ -100266,6 +100266,7 @@ const header$1 = cva([
|
|
|
100266
100266
|
'rounded-lg',
|
|
100267
100267
|
'cursor-pointer',
|
|
100268
100268
|
'transition-colors',
|
|
100269
|
+
'relative',
|
|
100269
100270
|
], {
|
|
100270
100271
|
variants: {
|
|
100271
100272
|
open: {
|
|
@@ -100344,6 +100345,36 @@ class Submenu {
|
|
|
100344
100345
|
*/
|
|
100345
100346
|
open = false;
|
|
100346
100347
|
get _el() { return getElement(this); }
|
|
100348
|
+
_activeItemPosition = -1;
|
|
100349
|
+
_showItemIndicator = false;
|
|
100350
|
+
_headerOffset = 0;
|
|
100351
|
+
_submenuItems = [];
|
|
100352
|
+
_hoveringItem = undefined;
|
|
100353
|
+
_itemActiveListener = () => {
|
|
100354
|
+
const activeItemIndex = this._submenuItems.findIndex(i => i.active === true);
|
|
100355
|
+
this.active = activeItemIndex !== -1;
|
|
100356
|
+
if (activeItemIndex === -1) {
|
|
100357
|
+
this._showItemIndicator = false;
|
|
100358
|
+
return;
|
|
100359
|
+
}
|
|
100360
|
+
this._setItemPosition(this._submenuItems[activeItemIndex]);
|
|
100361
|
+
};
|
|
100362
|
+
_itemMouseEnterListener = (event) => {
|
|
100363
|
+
if (this._hoveringItem && this._hoveringItem === event.target) {
|
|
100364
|
+
return;
|
|
100365
|
+
}
|
|
100366
|
+
this._hoveringItem = event.target;
|
|
100367
|
+
this._setItemPosition(this._hoveringItem);
|
|
100368
|
+
};
|
|
100369
|
+
_itemMouseLeaveListener = (event) => {
|
|
100370
|
+
setTimeout(() => {
|
|
100371
|
+
if (this._hoveringItem && this._hoveringItem !== event.target) {
|
|
100372
|
+
return;
|
|
100373
|
+
}
|
|
100374
|
+
this._hoveringItem = undefined;
|
|
100375
|
+
this._itemActiveListener();
|
|
100376
|
+
}, 100);
|
|
100377
|
+
};
|
|
100347
100378
|
componentDidLoad() {
|
|
100348
100379
|
const submenuItems = this._el.querySelectorAll('p-submenu-item');
|
|
100349
100380
|
const hasActiveChild = [...submenuItems].some(i => i.active === true);
|
|
@@ -100355,35 +100386,87 @@ class Submenu {
|
|
|
100355
100386
|
}
|
|
100356
100387
|
this.open = true;
|
|
100357
100388
|
}
|
|
100389
|
+
componentDidRender() {
|
|
100390
|
+
this._calculateHeaderOffset();
|
|
100391
|
+
}
|
|
100392
|
+
disconnectedCallback() {
|
|
100393
|
+
this._removeListeners();
|
|
100394
|
+
}
|
|
100358
100395
|
render() {
|
|
100359
100396
|
const submenuItems = this._el.querySelectorAll('p-submenu-item');
|
|
100360
100397
|
const firstItem = getComputedStyle(submenuItems[0]);
|
|
100361
100398
|
const maxHeight = submenuItems.length *
|
|
100362
100399
|
Number.parseInt(firstItem.height.replace('px', '')) +
|
|
100363
100400
|
16; // the margin of the content
|
|
100364
|
-
return (hAsync(ThemedHost, { key: '
|
|
100401
|
+
return (hAsync(ThemedHost, { key: '98584c2906cf44bfc6d0a6ceeadbeac5decfc5b7' }, hAsync("div", { key: '1ca2652294e276dbee1ad2e8fdde02d1bc758077', class: 'flex w-full flex-col' }, hAsync("div", { key: '3ea18a2afbac997d8f5a4468e4cc725229db5732', class: cn(header$1({
|
|
100365
100402
|
active: this.active,
|
|
100366
100403
|
open: this.open,
|
|
100367
|
-
})), onClick: () => (this.open = !this.open) }, this.showIndex && (hAsync("div", { key: '
|
|
100404
|
+
})), onClick: () => (this.open = !this.open) }, this.showIndex && (hAsync("div", { key: '45181da138600d02b6a5195cf16af0b38bb16041', class: indexContainer({
|
|
100368
100405
|
active: this.active,
|
|
100369
100406
|
open: this.open,
|
|
100370
|
-
}) }, this.index)), hAsync("div", { key: '
|
|
100407
|
+
}) }, this.index)), hAsync("div", { key: 'f01041af66063b671c3418a85dd6bae6092ee869', class: 'flex flex-1 flex-col' }, hAsync("p", { key: '02884dad8820a7e8bb969ca6f69a9d86f65fe07a', class: cn('m-0 text-sm', {
|
|
100371
100408
|
'text-storm-400 dark:text-hurricane-100 dark:group-hover/submenu-header:text-white': !this.active,
|
|
100372
100409
|
'text-storm-500 dark:text-white': this.active,
|
|
100373
|
-
}) }, this.title), hAsync("p", { key: '
|
|
100410
|
+
}) }, this.title), hAsync("p", { key: 'ed8e8933f2bdf88b593564ffbd528f30be8e0404', class: cn('m-0 text-xs', {
|
|
100374
100411
|
'text-storm-300 dark:text-hurricane-300': !this.active,
|
|
100375
100412
|
'text-storm-300 dark:text-indigo-200': this.active,
|
|
100376
|
-
}) }, this.subtitle)), hAsync("p-icon", { key: '
|
|
100413
|
+
}) }, this.subtitle)), hAsync("p-icon", { key: 'c4ad449abe6686983031577c6e7eca6e416c43ef', class: cn({
|
|
100377
100414
|
'text-storm-500 dark:text-white': this.active,
|
|
100378
100415
|
'text-storm-300 dark:text-hurricane-300': !this.active,
|
|
100379
|
-
}), rotate: this.open ? 180 : 0, variant: 'caret' })), hAsync("div", { key: '
|
|
100416
|
+
}), rotate: this.open ? 180 : 0, variant: 'caret' })), hAsync("div", { key: '86f1e812ee4da1903cf30f1066e45ff841664645', class: cn('relative flex flex-col overflow-hidden transition-[max-height]'), style: {
|
|
100380
100417
|
maxHeight: `${this.open ? maxHeight : 0}px`,
|
|
100381
|
-
} }, hAsync("div", { key: '
|
|
100418
|
+
} }, hAsync("div", { key: 'd8a9819377e081d2dc9a916901e7f6aae0d25bde', class: cn('absolute left-6 top-0 z-0 w-px', {
|
|
100382
100419
|
'bg-off-white-400 dark:bg-storm-500/30': !this.active,
|
|
100383
100420
|
'bg-indigo-100 dark:bg-hurricane-400': this.active,
|
|
100384
100421
|
}), style: {
|
|
100385
100422
|
height: `${maxHeight}px`,
|
|
100386
|
-
} }), hAsync("div", { key: '
|
|
100423
|
+
} }), hAsync("div", { key: '05e580e7d2cb16b1efbfd7705b0166b54081dea4', class: cn(`absolute left-6 top-0 z-[1] h-8 w-[2px] transform transition-all`, {
|
|
100424
|
+
'bg-indigo-600': this._showItemIndicator,
|
|
100425
|
+
'bg-transparent': !this._showItemIndicator,
|
|
100426
|
+
}), style: {
|
|
100427
|
+
transform: `translateY(${this._activeItemPosition}px)`,
|
|
100428
|
+
} }), hAsync("div", { key: 'b9b1bf668a1965732fe72eb3566eed336c356e29', class: 'z-10 my-2 flex flex-col' }, hAsync("slot", { key: '654f4a19477c696fa01735d11fdd86d5d7efd543', onSlotchange: () => this._slotChanged() }))))));
|
|
100429
|
+
}
|
|
100430
|
+
onWindowResize() {
|
|
100431
|
+
this._calculateHeaderOffset();
|
|
100432
|
+
this._itemActiveListener();
|
|
100433
|
+
}
|
|
100434
|
+
_calculateHeaderOffset() {
|
|
100435
|
+
const headerEl = this._el.shadowRoot?.querySelector(String.raw `.group\/submenu-header`);
|
|
100436
|
+
if (!headerEl) {
|
|
100437
|
+
this._activeItemPosition = -1;
|
|
100438
|
+
return;
|
|
100439
|
+
}
|
|
100440
|
+
this._headerOffset = headerEl.getBoundingClientRect().bottom;
|
|
100441
|
+
}
|
|
100442
|
+
_setItemPosition(item) {
|
|
100443
|
+
if (!item) {
|
|
100444
|
+
return;
|
|
100445
|
+
}
|
|
100446
|
+
this._activeItemPosition =
|
|
100447
|
+
item.getBoundingClientRect().top - this._headerOffset;
|
|
100448
|
+
if (!this._showItemIndicator) {
|
|
100449
|
+
setTimeout(() => (this._showItemIndicator = true), 50);
|
|
100450
|
+
}
|
|
100451
|
+
}
|
|
100452
|
+
_slotChanged() {
|
|
100453
|
+
this._removeListeners();
|
|
100454
|
+
const submenuItems = [...this._el.querySelectorAll('p-submenu-item')];
|
|
100455
|
+
for (const item of submenuItems) {
|
|
100456
|
+
item.addEventListener('activeChange', this._itemActiveListener);
|
|
100457
|
+
item.addEventListener('mouseenter', this._itemMouseEnterListener);
|
|
100458
|
+
item.addEventListener('mouseleave', this._itemMouseLeaveListener);
|
|
100459
|
+
}
|
|
100460
|
+
this._submenuItems = submenuItems;
|
|
100461
|
+
}
|
|
100462
|
+
_removeListeners() {
|
|
100463
|
+
if (this._submenuItems.length > 0) {
|
|
100464
|
+
for (const item of this._submenuItems) {
|
|
100465
|
+
item.removeEventListener('activeChange', this._itemActiveListener);
|
|
100466
|
+
item.removeEventListener('mouseenter', this._itemMouseEnterListener);
|
|
100467
|
+
item.removeEventListener('mouseleave', this._itemMouseLeaveListener);
|
|
100468
|
+
}
|
|
100469
|
+
}
|
|
100387
100470
|
}
|
|
100388
100471
|
static get style() { return submenuComponentCss(); }
|
|
100389
100472
|
static get cmpMeta() { return {
|
|
@@ -100395,27 +100478,22 @@ class Submenu {
|
|
|
100395
100478
|
"index": [514],
|
|
100396
100479
|
"showIndex": [516, "show-index"],
|
|
100397
100480
|
"active": [516],
|
|
100398
|
-
"open": [516]
|
|
100481
|
+
"open": [516],
|
|
100482
|
+
"_activeItemPosition": [32],
|
|
100483
|
+
"_showItemIndicator": [32]
|
|
100399
100484
|
},
|
|
100400
|
-
"$listeners$":
|
|
100485
|
+
"$listeners$": [[9, "resize", "onWindowResize"]],
|
|
100401
100486
|
"$lazyBundleId$": "-",
|
|
100402
100487
|
"$attrsToReflect$": [["title", "title"], ["subtitle", "subtitle"], ["index", "index"], ["showIndex", "show-index"], ["active", "active"], ["open", "open"]]
|
|
100403
100488
|
}; }
|
|
100404
100489
|
}
|
|
100405
100490
|
|
|
100406
|
-
const submenuItemComponentCss = () => `*{box-sizing:border-box}.static{position:static}.flex{display:flex}.h-8{height:2rem}.
|
|
100491
|
+
const submenuItemComponentCss = () => `*{box-sizing:border-box}.static{position:static}.flex{display:flex}.h-8{height:2rem}.w-full{width:100%}.cursor-pointer{cursor:pointer}.items-center{align-items:center}.gap-2{gap:.5rem}.pl-\\[calc\\(3rem\\+2px\\)\\]{padding-left:calc(3rem + 2px)}.text-hurricane-100{--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.text-indigo-600{--tw-text-opacity:1;color:rgb(82 138 250/var(--tw-text-opacity,1))}.text-storm-400{--tw-text-opacity:1;color:rgb(70 75 84/var(--tw-text-opacity,1))}.transition-colors{transition-duration:.15s;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1)}.dark\\:text-hurricane-100:where(:host([data-theme=dark]),:host([data-theme=dark]) *){--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}.dark\\:text-hurricane-100:where([data-theme=dark],[data-theme=dark] *){--tw-text-opacity:1;color:rgb(209 210 212/var(--tw-text-opacity,1))}`;
|
|
100407
100492
|
|
|
100408
|
-
const content$2 = cva([
|
|
100409
|
-
'flex items-center gap-6',
|
|
100410
|
-
'h-8 w-full pl-6',
|
|
100411
|
-
'cursor-pointer',
|
|
100412
|
-
'group/submenu-item',
|
|
100413
|
-
], {
|
|
100414
|
-
variants: {},
|
|
100415
|
-
});
|
|
100416
100493
|
class SubmenuItem {
|
|
100417
100494
|
constructor(hostRef) {
|
|
100418
100495
|
registerInstance(this, hostRef);
|
|
100496
|
+
this.activeChange = createEvent(this, "activeChange", 3);
|
|
100419
100497
|
}
|
|
100420
100498
|
/**
|
|
100421
100499
|
* Wether the submenu is active or not
|
|
@@ -100425,14 +100503,28 @@ class SubmenuItem {
|
|
|
100425
100503
|
* Icon to show on the label
|
|
100426
100504
|
*/
|
|
100427
100505
|
icon = 'placeholder';
|
|
100506
|
+
/**
|
|
100507
|
+
* Event when the active state changes
|
|
100508
|
+
*/
|
|
100509
|
+
activeChange;
|
|
100510
|
+
_lastActiveState = this.active;
|
|
100511
|
+
componentDidRender() {
|
|
100512
|
+
if (this._lastActiveState === this.active) {
|
|
100513
|
+
return;
|
|
100514
|
+
}
|
|
100515
|
+
this._lastActiveState = this.active;
|
|
100516
|
+
this.activeChange.emit(this.active);
|
|
100517
|
+
}
|
|
100428
100518
|
render() {
|
|
100429
|
-
return (hAsync(ThemedHost, { key: '
|
|
100430
|
-
'
|
|
100431
|
-
'
|
|
100432
|
-
|
|
100519
|
+
return (hAsync(ThemedHost, { key: '38bbc84752e1aa8271568aad5c1fd46bfa435d9a' }, hAsync("div", { key: 'a17fb921e57780d1ff572a3d1ba10331b045276e', class: cn([
|
|
100520
|
+
'flex items-center',
|
|
100521
|
+
'h-8 w-full pl-[calc(3rem+2px)]',
|
|
100522
|
+
'cursor-pointer',
|
|
100523
|
+
'group/submenu-item',
|
|
100524
|
+
]) }, hAsync("div", { key: 'd9c949c6f467524e0590a19774ae86c06e234fe5', class: cn('flex items-center gap-2 transition-colors', {
|
|
100433
100525
|
'text-storm-400 dark:text-hurricane-100': !this.active,
|
|
100434
100526
|
'text-indigo-600': this.active,
|
|
100435
|
-
}) }, hAsync("p-icon", { key: '
|
|
100527
|
+
}) }, hAsync("p-icon", { key: '8eed69a5fd4cef34ef69d7e5a96993289effc37e', variant: this.icon }), hAsync("slot", { key: '5471376f37afb9566f21599ee0e86af42a00b370' })))));
|
|
100436
100528
|
}
|
|
100437
100529
|
static get style() { return submenuItemComponentCss(); }
|
|
100438
100530
|
static get cmpMeta() { return {
|