@lukso/web-components 1.85.0 → 1.86.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/index.cjs +13 -3
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +5 -3
- package/dist/components/lukso-button/index.cjs +8 -5
- package/dist/components/lukso-button/index.d.ts +1 -1
- package/dist/components/lukso-button/index.d.ts.map +1 -1
- package/dist/components/lukso-button/index.js +8 -5
- package/dist/components/lukso-button/lukso-button.stories.d.ts +2 -0
- package/dist/components/lukso-button/lukso-button.stories.d.ts.map +1 -1
- package/dist/components/lukso-card/index.cjs +3 -3
- package/dist/components/lukso-card/index.js +3 -3
- package/dist/components/lukso-checkbox/index.cjs +1 -1
- package/dist/components/lukso-checkbox/index.js +1 -1
- package/dist/components/lukso-dropdown/index.cjs +26 -0
- package/dist/components/lukso-dropdown/index.d.ts +28 -0
- package/dist/components/lukso-dropdown/index.d.ts.map +1 -0
- package/dist/components/lukso-dropdown/index.js +15 -0
- package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts +9 -0
- package/dist/components/lukso-dropdown/lukso-dropdown.stories.d.ts.map +1 -0
- package/dist/components/lukso-dropdown-option/index.cjs +110 -0
- package/dist/components/lukso-dropdown-option/index.d.ts +19 -0
- package/dist/components/lukso-dropdown-option/index.d.ts.map +1 -0
- package/dist/components/lukso-dropdown-option/index.js +108 -0
- package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts +7 -0
- package/dist/components/lukso-dropdown-option/lukso-dropdown-option.stories.d.ts.map +1 -0
- package/dist/components/lukso-footer/index.cjs +1 -1
- package/dist/components/lukso-footer/index.js +1 -1
- package/dist/components/lukso-icon/index.cjs +2 -2
- package/dist/components/lukso-icon/index.js +2 -2
- package/dist/components/lukso-image/index.cjs +2 -2
- package/dist/components/lukso-image/index.js +2 -2
- package/dist/components/lukso-input/index.cjs +2 -2
- package/dist/components/lukso-input/index.js +2 -2
- package/dist/components/lukso-modal/index.cjs +1 -1
- package/dist/components/lukso-modal/index.js +1 -1
- package/dist/components/lukso-navbar/index.cjs +3 -3
- package/dist/components/lukso-navbar/index.js +3 -3
- package/dist/components/lukso-pagination/index.cjs +2 -2
- package/dist/components/lukso-pagination/index.js +2 -2
- package/dist/components/lukso-profile/index.cjs +2 -2
- package/dist/components/lukso-profile/index.js +2 -2
- package/dist/components/lukso-progress/index.cjs +2 -2
- package/dist/components/lukso-progress/index.js +2 -2
- package/dist/components/lukso-sanitize/index.cjs +1 -1
- package/dist/components/lukso-sanitize/index.js +1 -1
- package/dist/components/lukso-search/index.cjs +62 -71
- package/dist/components/lukso-search/index.d.ts +1 -3
- package/dist/components/lukso-search/index.d.ts.map +1 -1
- package/dist/components/lukso-search/index.js +62 -71
- package/dist/components/lukso-select/index.cjs +29 -98
- package/dist/components/lukso-select/index.d.ts +0 -3
- package/dist/components/lukso-select/index.d.ts.map +1 -1
- package/dist/components/lukso-select/index.js +28 -97
- package/dist/components/lukso-share/index.cjs +1 -1
- package/dist/components/lukso-share/index.js +1 -1
- package/dist/components/lukso-switch/index.cjs +2 -2
- package/dist/components/lukso-switch/index.js +2 -2
- package/dist/components/lukso-tag/index.cjs +2 -2
- package/dist/components/lukso-tag/index.js +2 -2
- package/dist/components/lukso-terms/index.cjs +2 -2
- package/dist/components/lukso-terms/index.js +2 -2
- package/dist/components/lukso-test/index.cjs +1 -1
- package/dist/components/lukso-test/index.js +1 -1
- package/dist/components/lukso-tooltip/index.cjs +2 -2
- package/dist/components/lukso-tooltip/index.js +2 -2
- package/dist/components/lukso-username/index.cjs +2 -2
- package/dist/components/lukso-username/index.js +2 -2
- package/dist/components/lukso-wizard/index.cjs +1 -1
- package/dist/components/lukso-wizard/index.js +1 -1
- package/dist/index-30881141.js +141 -0
- package/dist/index-abf15ef1.cjs +143 -0
- package/dist/index-b2b49383.js +39 -0
- package/dist/{index-3b498928.cjs → index-bf97dd78.cjs} +1 -1
- package/dist/index-df36fb06.cjs +46 -0
- package/dist/{index-8043be8a.js → index-f1acf332.js} +1 -1
- package/dist/index.cjs +13 -3
- package/dist/index.js +5 -3
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{style-map-ad97bcc3.js → style-map-6e8b083a.js} +1 -1
- package/dist/{style-map-a6d61d04.cjs → style-map-7ce21e2c.cjs} +1 -1
- package/dist/styles/main.css +1 -0
- package/dist/styles/main.css.map +1 -1
- package/dist/tailwind-config.cjs +1 -1
- package/dist/tailwind-config.js +1 -1
- package/package.json +11 -1
- package/tools/cn.cjs +1 -1
- package/tools/cn.js +1 -1
- package/tools/index.cjs +1 -1
- package/tools/index.js +1 -1
- package/tools/sass/colors.scss +1 -0
- package/tools/styles/main.css +1 -0
- package/tools/{tailwind-config-cece8e4d.cjs → tailwind-config-783c9054.cjs} +1 -1
- package/tools/{tailwind-config-effbdecc.js → tailwind-config-e386df1d.js} +1 -1
- package/tools/tailwind-config.cjs +1 -1
- package/tools/tailwind-config.js +1 -1
- package/dist/index-e653a9ff.cjs +0 -46
- package/dist/index-f72579d6.js +0 -39
|
@@ -2,14 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const state = require('../../state-d9fb972b.cjs');
|
|
8
8
|
const index = require('../../index-e9668573.cjs');
|
|
9
9
|
require('../lukso-icon/index.cjs');
|
|
10
10
|
require('../lukso-sanitize/index.cjs');
|
|
11
11
|
require('../../directive-8278ab14.cjs');
|
|
12
|
-
require('../../style-map-
|
|
12
|
+
require('../../style-map-7ce21e2c.cjs');
|
|
13
13
|
|
|
14
14
|
const style = ":host {\n display: flex;\n height: 100%\n}";
|
|
15
15
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-b2b49383.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { t } from '../../state-b9ca4e74.js';
|
|
4
4
|
import { c as customClassMap } from '../../index-5e194caf.js';
|
|
5
5
|
import '../lukso-icon/index.js';
|
|
6
6
|
import '../lukso-sanitize/index.js';
|
|
7
7
|
import '../../directive-2bb7789e.js';
|
|
8
|
-
import '../../style-map-
|
|
8
|
+
import '../../style-map-6e8b083a.js';
|
|
9
9
|
|
|
10
10
|
const style = ":host {\n display: flex;\n height: 100%\n}";
|
|
11
11
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const directive = require('../../directive-8278ab14.cjs');
|
|
8
8
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { b as T$1, T as TailwindStyledElement, x as x$1 } from '../../index-
|
|
1
|
+
import { b as T$1, T as TailwindStyledElement, x as x$1 } from '../../index-b2b49383.js';
|
|
2
2
|
import { n as n$3, e as e$3 } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { e as e$2, i as i$3, t as t$3 } from '../../directive-2bb7789e.js';
|
|
4
4
|
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const state = require('../../state-d9fb972b.cjs');
|
|
8
8
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
9
|
-
const styleMap = require('../../style-map-
|
|
9
|
+
const styleMap = require('../../style-map-7ce21e2c.cjs');
|
|
10
10
|
require('../../bundle-mjs-d58a83c6.cjs');
|
|
11
11
|
require('../../directive-8278ab14.cjs');
|
|
12
12
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x } from '../../index-b2b49383.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { t } from '../../state-b9ca4e74.js';
|
|
4
4
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
5
|
-
import { o } from '../../style-map-
|
|
5
|
+
import { o } from '../../style-map-6e8b083a.js';
|
|
6
6
|
import '../../bundle-mjs-fbc6e2a8.js';
|
|
7
7
|
import '../../directive-2bb7789e.js';
|
|
8
8
|
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
8
|
-
const index$1 = require('../../index-
|
|
8
|
+
const index$1 = require('../../index-bf97dd78.cjs');
|
|
9
9
|
require('../../tailwind-config.cjs');
|
|
10
10
|
const cn = require('../../cn-5ceac001.cjs');
|
|
11
11
|
require('../../bundle-mjs-d58a83c6.cjs');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, x, A } from '../../index-
|
|
1
|
+
import { T as TailwindStyledElement, x, A } from '../../index-b2b49383.js';
|
|
2
2
|
import { n, e } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
4
|
-
import { c as customStyleMap } from '../../index-
|
|
4
|
+
import { c as customStyleMap } from '../../index-f1acf332.js';
|
|
5
5
|
import '../../tailwind-config.js';
|
|
6
6
|
import { c as cn } from '../../cn-b54dcc61.js';
|
|
7
7
|
import '../../bundle-mjs-fbc6e2a8.js';
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
|
|
5
|
-
const shared_tailwindElement_index = require('../../index-
|
|
5
|
+
const shared_tailwindElement_index = require('../../index-df36fb06.cjs');
|
|
6
6
|
const queryAssignedElements = require('../../query-assigned-elements-d5e45650.cjs');
|
|
7
7
|
const directive = require('../../directive-8278ab14.cjs');
|
|
8
8
|
const index = require('../../index-1d3f4a5a.cjs');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j, b as T, T as TailwindStyledElement, x } from '../../index-
|
|
1
|
+
import { j, b as T, T as TailwindStyledElement, x } from '../../index-b2b49383.js';
|
|
2
2
|
import { n, e as e$1 } from '../../query-assigned-elements-1c8c9e90.js';
|
|
3
3
|
import { e, i, t } from '../../directive-2bb7789e.js';
|
|
4
4
|
import { c as ce } from '../../index-ca8e900d.js';
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { T as TailwindStyledElement, A, x } from './index-b2b49383.js';
|
|
2
|
+
import { n, e } from './query-assigned-elements-1c8c9e90.js';
|
|
3
|
+
import { t } from './state-b9ca4e74.js';
|
|
4
|
+
import { c as ce } from './index-ca8e900d.js';
|
|
5
|
+
import './components/lukso-icon/index.js';
|
|
6
|
+
import './components/lukso-profile/index.js';
|
|
7
|
+
import './components/lukso-username/index.js';
|
|
8
|
+
|
|
9
|
+
const style = ":host {\n display: flex;\n width: 100%\n}";
|
|
10
|
+
|
|
11
|
+
const uniqId = () => {
|
|
12
|
+
const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
13
|
+
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
var __defProp = Object.defineProperty;
|
|
17
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
18
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
19
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
20
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
21
|
+
if (decorator = decorators[i])
|
|
22
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
23
|
+
if (kind && result)
|
|
24
|
+
__defProp(target, key, result);
|
|
25
|
+
return result;
|
|
26
|
+
};
|
|
27
|
+
let LuksoDropdown = class extends TailwindStyledElement(style) {
|
|
28
|
+
constructor() {
|
|
29
|
+
super();
|
|
30
|
+
this.id = "";
|
|
31
|
+
this.triggerId = "";
|
|
32
|
+
this.isOpen = false;
|
|
33
|
+
this.isOpenOnOutsideClick = false;
|
|
34
|
+
this.openTop = false;
|
|
35
|
+
this.isRight = false;
|
|
36
|
+
this.isFullWidth = false;
|
|
37
|
+
this.size = "medium";
|
|
38
|
+
this._isOpen = false;
|
|
39
|
+
this.styles = ce({
|
|
40
|
+
base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
|
|
41
|
+
flex absolute flex-col gap-1 overflow-y-auto max-h-64 `,
|
|
42
|
+
variants: {
|
|
43
|
+
openTop: {
|
|
44
|
+
true: "bottom-[48px] mb-2 mt-0"
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
|
|
48
|
+
medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
|
|
49
|
+
},
|
|
50
|
+
isRight: {
|
|
51
|
+
true: "right-0"
|
|
52
|
+
},
|
|
53
|
+
isFullWidth: {
|
|
54
|
+
true: "w-full"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
compoundVariants: [
|
|
58
|
+
{
|
|
59
|
+
isFullWidth: false,
|
|
60
|
+
size: "small",
|
|
61
|
+
class: "max-w-[200px]"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
isFullWidth: false,
|
|
65
|
+
size: "medium",
|
|
66
|
+
class: "max-w-[300px]"
|
|
67
|
+
}
|
|
68
|
+
]
|
|
69
|
+
});
|
|
70
|
+
if (!this.id) {
|
|
71
|
+
this.id = uniqId();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
connectedCallback() {
|
|
75
|
+
super.connectedCallback();
|
|
76
|
+
window.addEventListener("click", this.handleClick.bind(this));
|
|
77
|
+
}
|
|
78
|
+
disconnectedCallback() {
|
|
79
|
+
super.disconnectedCallback();
|
|
80
|
+
window.removeEventListener("click", this.handleClick);
|
|
81
|
+
}
|
|
82
|
+
willUpdate(changedProperties) {
|
|
83
|
+
if (changedProperties.has("isOpen")) {
|
|
84
|
+
this._isOpen = this.isOpen;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
handleClick(event) {
|
|
88
|
+
const element = event.target;
|
|
89
|
+
if (element.id === this.triggerId || this.id === element.id) {
|
|
90
|
+
this._isOpen = !this._isOpen;
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!this.isOpenOnOutsideClick) {
|
|
94
|
+
this._isOpen = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
render() {
|
|
98
|
+
const styles = this.styles({
|
|
99
|
+
openTop: this.openTop,
|
|
100
|
+
size: this.size,
|
|
101
|
+
isRight: this.isRight,
|
|
102
|
+
isFullWidth: this.isFullWidth
|
|
103
|
+
});
|
|
104
|
+
if (!this._isOpen) {
|
|
105
|
+
return A;
|
|
106
|
+
}
|
|
107
|
+
return x`<div class="${styles}"><slot></slot></div>`;
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
__decorateClass([
|
|
111
|
+
n({ type: String })
|
|
112
|
+
], LuksoDropdown.prototype, "id", 2);
|
|
113
|
+
__decorateClass([
|
|
114
|
+
n({ type: String, attribute: "trigger-id" })
|
|
115
|
+
], LuksoDropdown.prototype, "triggerId", 2);
|
|
116
|
+
__decorateClass([
|
|
117
|
+
n({ type: Boolean, attribute: "is-open" })
|
|
118
|
+
], LuksoDropdown.prototype, "isOpen", 2);
|
|
119
|
+
__decorateClass([
|
|
120
|
+
n({ type: Boolean, attribute: "is-open-on-outside-click" })
|
|
121
|
+
], LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
|
|
122
|
+
__decorateClass([
|
|
123
|
+
n({ type: Boolean, attribute: "open-top" })
|
|
124
|
+
], LuksoDropdown.prototype, "openTop", 2);
|
|
125
|
+
__decorateClass([
|
|
126
|
+
n({ type: Boolean, attribute: "is-right" })
|
|
127
|
+
], LuksoDropdown.prototype, "isRight", 2);
|
|
128
|
+
__decorateClass([
|
|
129
|
+
n({ type: Boolean, attribute: "is-full-width" })
|
|
130
|
+
], LuksoDropdown.prototype, "isFullWidth", 2);
|
|
131
|
+
__decorateClass([
|
|
132
|
+
n({ type: String })
|
|
133
|
+
], LuksoDropdown.prototype, "size", 2);
|
|
134
|
+
__decorateClass([
|
|
135
|
+
t()
|
|
136
|
+
], LuksoDropdown.prototype, "_isOpen", 2);
|
|
137
|
+
LuksoDropdown = __decorateClass([
|
|
138
|
+
e("lukso-dropdown")
|
|
139
|
+
], LuksoDropdown);
|
|
140
|
+
|
|
141
|
+
export { LuksoDropdown as L, uniqId as u };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const shared_tailwindElement_index = require('./index-df36fb06.cjs');
|
|
4
|
+
const queryAssignedElements = require('./query-assigned-elements-d5e45650.cjs');
|
|
5
|
+
const state = require('./state-d9fb972b.cjs');
|
|
6
|
+
const index = require('./index-1d3f4a5a.cjs');
|
|
7
|
+
require('./components/lukso-icon/index.cjs');
|
|
8
|
+
require('./components/lukso-profile/index.cjs');
|
|
9
|
+
require('./components/lukso-username/index.cjs');
|
|
10
|
+
|
|
11
|
+
const style = ":host {\n display: flex;\n width: 100%\n}";
|
|
12
|
+
|
|
13
|
+
const uniqId = () => {
|
|
14
|
+
const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
15
|
+
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
var __defProp = Object.defineProperty;
|
|
19
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
20
|
+
var __decorateClass = (decorators, target, key, kind) => {
|
|
21
|
+
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
22
|
+
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
23
|
+
if (decorator = decorators[i])
|
|
24
|
+
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
25
|
+
if (kind && result)
|
|
26
|
+
__defProp(target, key, result);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
exports.LuksoDropdown = class LuksoDropdown extends shared_tailwindElement_index.TailwindStyledElement(style) {
|
|
30
|
+
constructor() {
|
|
31
|
+
super();
|
|
32
|
+
this.id = "";
|
|
33
|
+
this.triggerId = "";
|
|
34
|
+
this.isOpen = false;
|
|
35
|
+
this.isOpenOnOutsideClick = false;
|
|
36
|
+
this.openTop = false;
|
|
37
|
+
this.isRight = false;
|
|
38
|
+
this.isFullWidth = false;
|
|
39
|
+
this.size = "medium";
|
|
40
|
+
this._isOpen = false;
|
|
41
|
+
this.styles = index.ce({
|
|
42
|
+
base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
|
|
43
|
+
flex absolute flex-col gap-1 overflow-y-auto max-h-64 `,
|
|
44
|
+
variants: {
|
|
45
|
+
openTop: {
|
|
46
|
+
true: "bottom-[48px] mb-2 mt-0"
|
|
47
|
+
},
|
|
48
|
+
size: {
|
|
49
|
+
small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
|
|
50
|
+
medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
|
|
51
|
+
},
|
|
52
|
+
isRight: {
|
|
53
|
+
true: "right-0"
|
|
54
|
+
},
|
|
55
|
+
isFullWidth: {
|
|
56
|
+
true: "w-full"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
compoundVariants: [
|
|
60
|
+
{
|
|
61
|
+
isFullWidth: false,
|
|
62
|
+
size: "small",
|
|
63
|
+
class: "max-w-[200px]"
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
isFullWidth: false,
|
|
67
|
+
size: "medium",
|
|
68
|
+
class: "max-w-[300px]"
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
});
|
|
72
|
+
if (!this.id) {
|
|
73
|
+
this.id = uniqId();
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
connectedCallback() {
|
|
77
|
+
super.connectedCallback();
|
|
78
|
+
window.addEventListener("click", this.handleClick.bind(this));
|
|
79
|
+
}
|
|
80
|
+
disconnectedCallback() {
|
|
81
|
+
super.disconnectedCallback();
|
|
82
|
+
window.removeEventListener("click", this.handleClick);
|
|
83
|
+
}
|
|
84
|
+
willUpdate(changedProperties) {
|
|
85
|
+
if (changedProperties.has("isOpen")) {
|
|
86
|
+
this._isOpen = this.isOpen;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
handleClick(event) {
|
|
90
|
+
const element = event.target;
|
|
91
|
+
if (element.id === this.triggerId || this.id === element.id) {
|
|
92
|
+
this._isOpen = !this._isOpen;
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!this.isOpenOnOutsideClick) {
|
|
96
|
+
this._isOpen = false;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
render() {
|
|
100
|
+
const styles = this.styles({
|
|
101
|
+
openTop: this.openTop,
|
|
102
|
+
size: this.size,
|
|
103
|
+
isRight: this.isRight,
|
|
104
|
+
isFullWidth: this.isFullWidth
|
|
105
|
+
});
|
|
106
|
+
if (!this._isOpen) {
|
|
107
|
+
return shared_tailwindElement_index.A;
|
|
108
|
+
}
|
|
109
|
+
return shared_tailwindElement_index.x`<div class="${styles}"><slot></slot></div>`;
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
__decorateClass([
|
|
113
|
+
queryAssignedElements.n({ type: String })
|
|
114
|
+
], exports.LuksoDropdown.prototype, "id", 2);
|
|
115
|
+
__decorateClass([
|
|
116
|
+
queryAssignedElements.n({ type: String, attribute: "trigger-id" })
|
|
117
|
+
], exports.LuksoDropdown.prototype, "triggerId", 2);
|
|
118
|
+
__decorateClass([
|
|
119
|
+
queryAssignedElements.n({ type: Boolean, attribute: "is-open" })
|
|
120
|
+
], exports.LuksoDropdown.prototype, "isOpen", 2);
|
|
121
|
+
__decorateClass([
|
|
122
|
+
queryAssignedElements.n({ type: Boolean, attribute: "is-open-on-outside-click" })
|
|
123
|
+
], exports.LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
|
|
124
|
+
__decorateClass([
|
|
125
|
+
queryAssignedElements.n({ type: Boolean, attribute: "open-top" })
|
|
126
|
+
], exports.LuksoDropdown.prototype, "openTop", 2);
|
|
127
|
+
__decorateClass([
|
|
128
|
+
queryAssignedElements.n({ type: Boolean, attribute: "is-right" })
|
|
129
|
+
], exports.LuksoDropdown.prototype, "isRight", 2);
|
|
130
|
+
__decorateClass([
|
|
131
|
+
queryAssignedElements.n({ type: Boolean, attribute: "is-full-width" })
|
|
132
|
+
], exports.LuksoDropdown.prototype, "isFullWidth", 2);
|
|
133
|
+
__decorateClass([
|
|
134
|
+
queryAssignedElements.n({ type: String })
|
|
135
|
+
], exports.LuksoDropdown.prototype, "size", 2);
|
|
136
|
+
__decorateClass([
|
|
137
|
+
state.t()
|
|
138
|
+
], exports.LuksoDropdown.prototype, "_isOpen", 2);
|
|
139
|
+
exports.LuksoDropdown = __decorateClass([
|
|
140
|
+
queryAssignedElements.e("lukso-dropdown")
|
|
141
|
+
], exports.LuksoDropdown);
|
|
142
|
+
|
|
143
|
+
exports.uniqId = uniqId;
|