@paperless/core 0.1.0-alpha.25 → 0.1.0-alpha.28
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/CHANGELOG.md +30 -0
- package/dist/build/p-a669807e.entry.js +1 -0
- package/dist/build/p-a7086ffa.js +1 -0
- package/dist/build/p-d7c82962.entry.js +1 -0
- package/dist/build/p-e7019eab.entry.js +1 -0
- package/dist/build/p-faa4ee42.entry.js +1 -0
- package/dist/build/paperless.esm.js +1 -1
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/p-dropdown-menu-container.cjs.entry.js +19 -0
- package/dist/cjs/p-dropdown-menu-item.cjs.entry.js +23 -0
- package/dist/cjs/p-dropdown.cjs.entry.js +131 -0
- package/dist/cjs/p-tooltip.cjs.entry.js +25 -1803
- package/dist/cjs/paperless.cjs.js +1 -1
- package/dist/cjs/popper-e0c4ed4c.js +1790 -0
- package/dist/collection/collection-manifest.json +3 -0
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.css +5 -0
- package/dist/collection/components/atoms/dropdown-menu-container/dropdown-menu-container.component.js +14 -0
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.css +13 -0
- package/dist/collection/components/atoms/dropdown-menu-item/dropdown-menu-item.component.js +41 -0
- package/dist/collection/components/atoms/tooltip/tooltip.component.css +4 -1
- package/dist/collection/components/atoms/tooltip/tooltip.component.js +24 -16
- package/dist/collection/components/molecules/dropdown/dropdown.component.css +9 -0
- package/dist/collection/components/molecules/dropdown/dropdown.component.js +223 -0
- package/dist/collection/tailwind/border-radius.js +8 -7
- package/dist/collection/utils/child-of.js +5 -0
- package/dist/components/dropdown-menu-container.component.js +29 -0
- package/dist/components/index.d.ts +3 -0
- package/dist/components/index.js +3 -0
- package/dist/components/p-dropdown-menu-container.d.ts +11 -0
- package/dist/components/p-dropdown-menu-container.js +6 -0
- package/dist/components/p-dropdown-menu-item.d.ts +11 -0
- package/dist/components/p-dropdown-menu-item.js +39 -0
- package/dist/components/p-dropdown.d.ts +11 -0
- package/dist/components/p-dropdown.js +156 -0
- package/dist/components/popper.js +1788 -0
- package/dist/components/tooltip.component.js +26 -1804
- package/dist/esm/loader.js +1 -1
- package/dist/esm/p-dropdown-menu-container.entry.js +15 -0
- package/dist/esm/p-dropdown-menu-item.entry.js +19 -0
- package/dist/esm/p-dropdown.entry.js +127 -0
- package/dist/esm/p-tooltip.entry.js +24 -1802
- package/dist/esm/paperless.js +1 -1
- package/dist/esm/popper-41c6f9cd.js +1788 -0
- package/dist/index.html +1 -1
- package/dist/paperless/p-a669807e.entry.js +1 -0
- package/dist/paperless/p-a7086ffa.js +1 -0
- package/dist/paperless/p-d7c82962.entry.js +1 -0
- package/dist/paperless/p-e7019eab.entry.js +1 -0
- package/dist/paperless/p-faa4ee42.entry.js +1 -0
- package/dist/paperless/paperless.css +40 -0
- package/dist/paperless/paperless.esm.js +1 -1
- package/dist/sw.js +109 -14
- package/dist/types/components/atoms/dropdown-menu-container/dropdown-menu-container.component.d.ts +3 -0
- package/dist/types/components/atoms/dropdown-menu-item/dropdown-menu-item.component.d.ts +7 -0
- package/dist/types/components/atoms/tooltip/tooltip.component.d.ts +1 -1
- package/dist/types/components/molecules/dropdown/dropdown.component.d.ts +41 -0
- package/dist/types/components.d.ts +89 -2
- package/dist/types/utils/child-of.d.ts +1 -0
- package/package.json +1 -1
- package/dist/build/p-f65d7bbf.entry.js +0 -1
- package/dist/paperless/p-f65d7bbf.entry.js +0 -1
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
|
|
2
|
+
import { d as defineCustomElement$2 } from './dropdown-menu-container.component.js';
|
|
3
|
+
import { c as createPopper } from './popper.js';
|
|
4
|
+
|
|
5
|
+
const childOf = (c, p) => {
|
|
6
|
+
while ((c = c.parentNode) && c !== p)
|
|
7
|
+
;
|
|
8
|
+
return !!c;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const dropdownComponentCss = "/*! tailwindcss v3.1.4 | MIT License | https://tailwindcss.com*/*,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;border:0 solid;box-sizing:border-box}:after,:before{--tw-content:\"\"}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5;-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{line-height:inherit;margin:0}hr{border-top-width:1px;color:inherit;height:0}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{border-collapse:collapse;border-color:inherit;text-indent:0}button,input,optgroup,select,textarea{color:inherit;font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,fieldset,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{color:#9ca3af;opacity:1}input::placeholder,textarea::placeholder{color:#9ca3af;opacity:1}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{height:auto;max-width:100%}::-webkit-backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(59,130,246,.5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.flex{display:flex!important}.hidden{display:none!important}.h-auto{height:auto!important}.w-auto{width:auto!important}:host .trigger{display:inline-block;height:auto;width:auto}:host p-dropdown-menu-container{display:none}:host p-dropdown-menu-container[data-show]{display:flex}.visible{visibility:visible!important}.static{position:static!important}";
|
|
12
|
+
|
|
13
|
+
const Dropdown = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
this.__registerHost();
|
|
17
|
+
this.__attachShadow();
|
|
18
|
+
this.isOpen = createEvent(this, "isOpen", 7);
|
|
19
|
+
/**
|
|
20
|
+
* The content of the dropdown menu
|
|
21
|
+
*/
|
|
22
|
+
this.placement = 'bottom';
|
|
23
|
+
/**
|
|
24
|
+
* Wether to show the dropdown menu
|
|
25
|
+
*/
|
|
26
|
+
this.show = false;
|
|
27
|
+
/**
|
|
28
|
+
* Wether to automatically close the dropdown menu after clicking inside
|
|
29
|
+
*/
|
|
30
|
+
this.insideClick = false;
|
|
31
|
+
/**
|
|
32
|
+
* Wether to automatically close the dropdown menu after clicking inside
|
|
33
|
+
*/
|
|
34
|
+
this.disableTriggerClick = false;
|
|
35
|
+
this._loaded = false;
|
|
36
|
+
}
|
|
37
|
+
componentShouldUpdate() {
|
|
38
|
+
this._setOptions();
|
|
39
|
+
if (this._loaded && this.show) {
|
|
40
|
+
this._show();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h(Host, { class: "p-dropdown" }, h("div", { class: "trigger", onClick: () => this._triggerClickHandler() }, h("slot", { name: "trigger" })), h("p-dropdown-menu-container", { role: "popover", ref: (el) => this._load(el), onClick: () => this._containerClickHandler() }, h("slot", { name: "items" }))));
|
|
45
|
+
}
|
|
46
|
+
_containerClickHandler() {
|
|
47
|
+
if (this.insideClick) {
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (this._menu.hasAttribute('data-show')) {
|
|
51
|
+
this._hide();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
_triggerClickHandler() {
|
|
55
|
+
if (this.disableTriggerClick) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
if (this._menu.hasAttribute('data-show')) {
|
|
59
|
+
this._hide();
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
this._show();
|
|
63
|
+
}
|
|
64
|
+
documentClickHandler({ target }) {
|
|
65
|
+
if (!this._menu.hasAttribute('data-show') ||
|
|
66
|
+
childOf(target, this._el)) {
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this._hide();
|
|
70
|
+
}
|
|
71
|
+
_load(popover) {
|
|
72
|
+
this._menu = popover;
|
|
73
|
+
if (popover) {
|
|
74
|
+
this._popper = createPopper(this._el, popover);
|
|
75
|
+
this._setOptions();
|
|
76
|
+
this._loaded = true;
|
|
77
|
+
if (this.show) {
|
|
78
|
+
setTimeout(() => this._show(), 100);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_setOptions() {
|
|
83
|
+
if (!this._popper) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
this._popper.setOptions({
|
|
87
|
+
placement: `${this.placement}-start`,
|
|
88
|
+
modifiers: [
|
|
89
|
+
{
|
|
90
|
+
name: 'offset',
|
|
91
|
+
options: {
|
|
92
|
+
offset: [0, 8],
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
_show() {
|
|
99
|
+
if (!this._loaded) {
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
// Make the popover visible
|
|
103
|
+
this._menu.setAttribute('data-show', '');
|
|
104
|
+
this.isOpen.emit(true);
|
|
105
|
+
// Enable the event listeners
|
|
106
|
+
this._popper.setOptions((options) => (Object.assign(Object.assign({}, options), { modifiers: [
|
|
107
|
+
...options.modifiers,
|
|
108
|
+
{ name: 'eventListeners', enabled: true },
|
|
109
|
+
] })));
|
|
110
|
+
// Update its position
|
|
111
|
+
this._popper.update();
|
|
112
|
+
}
|
|
113
|
+
_hide() {
|
|
114
|
+
if (!this._loaded || this.show) {
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
// Hide the popover
|
|
118
|
+
this._menu.removeAttribute('data-show');
|
|
119
|
+
this.isOpen.emit(false);
|
|
120
|
+
// Disable the event listeners
|
|
121
|
+
this._popper.setOptions((options) => (Object.assign(Object.assign({}, options), { modifiers: [
|
|
122
|
+
...options.modifiers,
|
|
123
|
+
{ name: 'eventListeners', enabled: false },
|
|
124
|
+
] })));
|
|
125
|
+
}
|
|
126
|
+
get _el() { return this; }
|
|
127
|
+
static get style() { return dropdownComponentCss; }
|
|
128
|
+
}, [1, "p-dropdown", {
|
|
129
|
+
"placement": [1],
|
|
130
|
+
"show": [4],
|
|
131
|
+
"insideClick": [4, "inside-click"],
|
|
132
|
+
"disableTriggerClick": [4, "disable-trigger-click"]
|
|
133
|
+
}, [[6, "click", "documentClickHandler"]]]);
|
|
134
|
+
function defineCustomElement$1() {
|
|
135
|
+
if (typeof customElements === "undefined") {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const components = ["p-dropdown", "p-dropdown-menu-container"];
|
|
139
|
+
components.forEach(tagName => { switch (tagName) {
|
|
140
|
+
case "p-dropdown":
|
|
141
|
+
if (!customElements.get(tagName)) {
|
|
142
|
+
customElements.define(tagName, Dropdown);
|
|
143
|
+
}
|
|
144
|
+
break;
|
|
145
|
+
case "p-dropdown-menu-container":
|
|
146
|
+
if (!customElements.get(tagName)) {
|
|
147
|
+
defineCustomElement$2();
|
|
148
|
+
}
|
|
149
|
+
break;
|
|
150
|
+
} });
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const PDropdown = Dropdown;
|
|
154
|
+
const defineCustomElement = defineCustomElement$1;
|
|
155
|
+
|
|
156
|
+
export { PDropdown, defineCustomElement };
|