@lukso/web-components 1.119.0 → 1.120.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 +8 -7
- package/dist/components/index.js +8 -7
- package/dist/components/lukso-button/index.cjs +3 -3
- package/dist/components/lukso-button/index.js +3 -3
- package/dist/components/lukso-card/index.cjs +7 -7
- package/dist/components/lukso-card/index.js +7 -7
- package/dist/components/lukso-card/lukso-card.stories.d.ts.map +1 -1
- package/dist/components/lukso-checkbox/index.cjs +3 -3
- package/dist/components/lukso-checkbox/index.js +3 -3
- package/dist/components/lukso-color-picker/index.cjs +4 -4
- package/dist/components/lukso-color-picker/index.js +4 -4
- package/dist/components/lukso-dropdown/index.cjs +151 -12
- package/dist/components/lukso-dropdown/index.js +156 -8
- package/dist/components/lukso-dropdown-option/index.cjs +2 -2
- package/dist/components/lukso-dropdown-option/index.js +2 -2
- package/dist/components/lukso-footer/index.cjs +2 -2
- package/dist/components/lukso-footer/index.js +2 -2
- package/dist/components/lukso-icon/index.cjs +3 -3
- package/dist/components/lukso-icon/index.js +3 -3
- package/dist/components/lukso-image/index.cjs +4 -4
- package/dist/components/lukso-image/index.js +4 -4
- package/dist/components/lukso-input/index.cjs +4 -4
- package/dist/components/lukso-input/index.js +4 -4
- package/dist/components/lukso-modal/index.cjs +2 -2
- package/dist/components/lukso-modal/index.js +2 -2
- package/dist/components/lukso-navbar/index.cjs +5 -5
- package/dist/components/lukso-navbar/index.js +5 -5
- package/dist/components/lukso-pagination/index.cjs +4 -4
- package/dist/components/lukso-pagination/index.js +4 -4
- package/dist/components/lukso-profile/index.cjs +5 -5
- package/dist/components/lukso-profile/index.js +5 -5
- package/dist/components/lukso-progress/index.cjs +3 -3
- package/dist/components/lukso-progress/index.js +3 -3
- package/dist/components/lukso-sanitize/index.cjs +2 -2
- package/dist/components/lukso-sanitize/index.js +2 -2
- package/dist/components/lukso-search/index.cjs +8 -7
- package/dist/components/lukso-search/index.js +8 -7
- package/dist/components/lukso-select/index.cjs +76 -75
- package/dist/components/lukso-select/index.js +76 -75
- package/dist/components/lukso-share/index.cjs +24 -27
- package/dist/components/lukso-share/index.js +24 -27
- package/dist/components/lukso-switch/index.cjs +120 -38
- package/dist/components/lukso-switch/index.d.ts +12 -4
- package/dist/components/lukso-switch/index.d.ts.map +1 -1
- package/dist/components/lukso-switch/index.js +120 -38
- package/dist/components/lukso-switch/lukso-switch.stories.d.ts +8 -0
- package/dist/components/lukso-switch/lukso-switch.stories.d.ts.map +1 -1
- package/dist/components/lukso-tag/index.cjs +32 -35
- package/dist/components/lukso-tag/index.js +32 -35
- package/dist/components/lukso-terms/index.cjs +7 -10
- package/dist/components/lukso-terms/index.js +7 -10
- package/dist/components/lukso-test/index.cjs +13 -16
- package/dist/components/lukso-test/index.js +13 -16
- package/dist/components/lukso-textarea/index.cjs +83 -86
- package/dist/components/lukso-textarea/index.js +83 -86
- package/dist/components/lukso-tooltip/index.cjs +35 -38
- package/dist/components/lukso-tooltip/index.js +35 -38
- package/dist/components/lukso-username/index.cjs +50 -53
- package/dist/components/lukso-username/index.js +50 -53
- package/dist/components/lukso-wizard/index.cjs +42 -45
- package/dist/components/lukso-wizard/index.js +42 -45
- package/dist/{index-ff8d75cd.js → index-0fc204c6.js} +2 -2
- package/dist/{index-67915f32.cjs → index-2c4a91c9.cjs} +2 -2
- package/dist/{index-7bb28a79.js → index-81a8cb3d.js} +1 -1
- package/dist/{index-3926da18.cjs → index-b1f10728.cjs} +1 -1
- package/dist/index-c074fb48.js +37 -0
- package/dist/index-f785b4c0.cjs +46 -0
- package/dist/index.cjs +8 -7
- package/dist/index.js +8 -7
- package/dist/{property-bf2eee83.cjs → property-0715f936.cjs} +1 -1
- package/dist/{property-eaa52bd9.js → property-db140eda.js} +1 -1
- package/dist/shared/tailwind-element/index.cjs +1 -1
- package/dist/shared/tailwind-element/index.js +1 -1
- package/dist/{state-1fc9a224.js → state-13f19dcc.js} +1 -1
- package/dist/{state-375dfffc.cjs → state-908940e8.cjs} +1 -1
- package/dist/{style-map-8e54f508.cjs → style-map-074a8e8b.cjs} +1 -1
- package/dist/{style-map-5aef4b6f.js → style-map-3fe95282.js} +1 -1
- package/dist/uniq-id-ce2d165c.js +6 -0
- package/dist/uniq-id-f0b18085.cjs +8 -0
- package/package.json +1 -1
- package/dist/index-104cf124.cjs +0 -161
- package/dist/index-12775596.js +0 -159
- package/dist/index-68c61387.cjs +0 -48
- package/dist/index-92dc158d.js +0 -39
package/dist/index.cjs
CHANGED
|
@@ -6,7 +6,7 @@ const components_luksoButton_index = require('./components/lukso-button/index.cj
|
|
|
6
6
|
const components_luksoCard_index = require('./components/lukso-card/index.cjs');
|
|
7
7
|
const components_luksoCheckbox_index = require('./components/lukso-checkbox/index.cjs');
|
|
8
8
|
const components_luksoColorPicker_index = require('./components/lukso-color-picker/index.cjs');
|
|
9
|
-
const components_luksoDropdown_index = require('./index
|
|
9
|
+
const components_luksoDropdown_index = require('./components/lukso-dropdown/index.cjs');
|
|
10
10
|
const components_luksoDropdownOption_index = require('./components/lukso-dropdown-option/index.cjs');
|
|
11
11
|
const components_luksoFooter_index = require('./components/lukso-footer/index.cjs');
|
|
12
12
|
const components_luksoIcon_index = require('./components/lukso-icon/index.cjs');
|
|
@@ -15,7 +15,7 @@ const components_luksoInput_index = require('./components/lukso-input/index.cjs'
|
|
|
15
15
|
const components_luksoModal_index = require('./components/lukso-modal/index.cjs');
|
|
16
16
|
const components_luksoNavbar_index = require('./components/lukso-navbar/index.cjs');
|
|
17
17
|
const components_luksoPagination_index = require('./components/lukso-pagination/index.cjs');
|
|
18
|
-
const components_luksoProfile_index = require('./index-
|
|
18
|
+
const components_luksoProfile_index = require('./index-2c4a91c9.cjs');
|
|
19
19
|
const components_luksoProgress_index = require('./components/lukso-progress/index.cjs');
|
|
20
20
|
const components_luksoSanitize_index = require('./components/lukso-sanitize/index.cjs');
|
|
21
21
|
const components_luksoSearch_index = require('./components/lukso-search/index.cjs');
|
|
@@ -29,16 +29,17 @@ const components_luksoTextarea_index = require('./components/lukso-textarea/inde
|
|
|
29
29
|
const components_luksoTooltip_index = require('./components/lukso-tooltip/index.cjs');
|
|
30
30
|
const components_luksoUsername_index = require('./components/lukso-username/index.cjs');
|
|
31
31
|
const components_luksoWizard_index = require('./components/lukso-wizard/index.cjs');
|
|
32
|
-
const shared_tailwindElement_index = require('./index-
|
|
32
|
+
const shared_tailwindElement_index = require('./index-f785b4c0.cjs');
|
|
33
33
|
const cn = require('./cn-b6daa995.cjs');
|
|
34
|
-
require('./property-
|
|
35
|
-
require('./state-
|
|
34
|
+
require('./property-0715f936.cjs');
|
|
35
|
+
require('./state-908940e8.cjs');
|
|
36
36
|
require('./index-2b104ecb.cjs');
|
|
37
37
|
require('./tailwind-config.cjs');
|
|
38
|
-
require('./style-map-
|
|
38
|
+
require('./style-map-074a8e8b.cjs');
|
|
39
39
|
require('./directive-8278ab14.cjs');
|
|
40
|
-
require('./index-
|
|
40
|
+
require('./index-b1f10728.cjs');
|
|
41
41
|
require('./index-e9668573.cjs');
|
|
42
|
+
require('./uniq-id-f0b18085.cjs');
|
|
42
43
|
|
|
43
44
|
|
|
44
45
|
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@ export { LuksoButton } from './components/lukso-button/index.js';
|
|
|
2
2
|
export { LuksoCard } from './components/lukso-card/index.js';
|
|
3
3
|
export { LuksoCheckbox } from './components/lukso-checkbox/index.js';
|
|
4
4
|
export { LuksoColorPicker } from './components/lukso-color-picker/index.js';
|
|
5
|
-
export {
|
|
5
|
+
export { LuksoDropdown } from './components/lukso-dropdown/index.js';
|
|
6
6
|
export { LuksoDropdownOption } from './components/lukso-dropdown-option/index.js';
|
|
7
7
|
export { LuksoFooter } from './components/lukso-footer/index.js';
|
|
8
8
|
export { LuksoIcon } from './components/lukso-icon/index.js';
|
|
@@ -11,7 +11,7 @@ export { LuksoInput } from './components/lukso-input/index.js';
|
|
|
11
11
|
export { LuksoModal } from './components/lukso-modal/index.js';
|
|
12
12
|
export { LuksoNavbar } from './components/lukso-navbar/index.js';
|
|
13
13
|
export { LuksoPagination } from './components/lukso-pagination/index.js';
|
|
14
|
-
export { L as LuksoProfile } from './index-
|
|
14
|
+
export { L as LuksoProfile } from './index-0fc204c6.js';
|
|
15
15
|
export { LuksoProgress } from './components/lukso-progress/index.js';
|
|
16
16
|
export { LuksoSanitize } from './components/lukso-sanitize/index.js';
|
|
17
17
|
export { LuksoSearch } from './components/lukso-search/index.js';
|
|
@@ -25,13 +25,14 @@ export { LuksoTextarea } from './components/lukso-textarea/index.js';
|
|
|
25
25
|
export { LuksoTooltip } from './components/lukso-tooltip/index.js';
|
|
26
26
|
export { LuksoUsername } from './components/lukso-username/index.js';
|
|
27
27
|
export { LuksoWizard } from './components/lukso-wizard/index.js';
|
|
28
|
-
export { a as TailwindElement, T as TailwindStyledElement } from './index-
|
|
28
|
+
export { a as TailwindElement, T as TailwindStyledElement } from './index-c074fb48.js';
|
|
29
29
|
export { c as cn } from './cn-90c03edf.js';
|
|
30
|
-
import './property-
|
|
31
|
-
import './state-
|
|
30
|
+
import './property-db140eda.js';
|
|
31
|
+
import './state-13f19dcc.js';
|
|
32
32
|
import './index-d14b6a34.js';
|
|
33
33
|
import './tailwind-config.js';
|
|
34
|
-
import './style-map-
|
|
34
|
+
import './style-map-3fe95282.js';
|
|
35
35
|
import './directive-2bb7789e.js';
|
|
36
|
-
import './index-
|
|
36
|
+
import './index-81a8cb3d.js';
|
|
37
37
|
import './index-5e194caf.js';
|
|
38
|
+
import './uniq-id-ce2d165c.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { a as TailwindElement, T as TailwindStyledElement } from '../../index-
|
|
1
|
+
export { a as TailwindElement, T as TailwindStyledElement } from '../../index-c074fb48.js';
|
package/package.json
CHANGED
package/dist/index-104cf124.cjs
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
const shared_tailwindElement_index = require('./index-68c61387.cjs');
|
|
4
|
-
const property = require('./property-bf2eee83.cjs');
|
|
5
|
-
const index = require('./index-2b104ecb.cjs');
|
|
6
|
-
require('./components/lukso-icon/index.cjs');
|
|
7
|
-
require('./index-67915f32.cjs');
|
|
8
|
-
require('./components/lukso-username/index.cjs');
|
|
9
|
-
|
|
10
|
-
const style = ":host {\n display: flex;\n width: 100%\n}";
|
|
11
|
-
|
|
12
|
-
const uniqId = () => {
|
|
13
|
-
const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
14
|
-
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
const debounceFunction = (func, timeout = 100) => {
|
|
18
|
-
let timer;
|
|
19
|
-
return (...args) => {
|
|
20
|
-
clearTimeout(timer);
|
|
21
|
-
timer = setTimeout(() => {
|
|
22
|
-
typeof func === "function" && func.apply(void 0, args);
|
|
23
|
-
}, timeout);
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var __defProp = Object.defineProperty;
|
|
28
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
29
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
30
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
31
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
32
|
-
if (decorator = decorators[i])
|
|
33
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
34
|
-
if (kind && result)
|
|
35
|
-
__defProp(target, key, result);
|
|
36
|
-
return result;
|
|
37
|
-
};
|
|
38
|
-
exports.LuksoDropdown = class LuksoDropdown extends shared_tailwindElement_index.TailwindStyledElement(style) {
|
|
39
|
-
constructor() {
|
|
40
|
-
super();
|
|
41
|
-
this.id = "";
|
|
42
|
-
this.triggerId = "";
|
|
43
|
-
this.isOpen = false;
|
|
44
|
-
this.isOpenOnOutsideClick = false;
|
|
45
|
-
this.openTop = false;
|
|
46
|
-
this.isRight = false;
|
|
47
|
-
this.isFullWidth = false;
|
|
48
|
-
this.size = "medium";
|
|
49
|
-
this.styles = index.ce({
|
|
50
|
-
base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
|
|
51
|
-
flex absolute flex-col gap-1 overflow-y-auto max-h-64 w-[max-content]`,
|
|
52
|
-
variants: {
|
|
53
|
-
openTop: {
|
|
54
|
-
true: "bottom-[48px] mb-2 mt-0"
|
|
55
|
-
},
|
|
56
|
-
size: {
|
|
57
|
-
small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
|
|
58
|
-
medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
|
|
59
|
-
},
|
|
60
|
-
isRight: {
|
|
61
|
-
true: "right-0"
|
|
62
|
-
},
|
|
63
|
-
isFullWidth: {
|
|
64
|
-
true: "w-full"
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
compoundVariants: [
|
|
68
|
-
{
|
|
69
|
-
isFullWidth: false,
|
|
70
|
-
size: "small",
|
|
71
|
-
class: "max-w-[200px]"
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
isFullWidth: false,
|
|
75
|
-
size: "medium",
|
|
76
|
-
class: "max-w-[300px]"
|
|
77
|
-
}
|
|
78
|
-
]
|
|
79
|
-
});
|
|
80
|
-
this.handleClick = debounceFunction((event) => {
|
|
81
|
-
const element = event.target;
|
|
82
|
-
if (element.id === this.triggerId || this.id === element.id) {
|
|
83
|
-
this.isOpen = !this.isOpen;
|
|
84
|
-
return;
|
|
85
|
-
}
|
|
86
|
-
if (!this.isOpenOnOutsideClick) {
|
|
87
|
-
this.isOpen = false;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
if (!this.id) {
|
|
91
|
-
this.id = uniqId();
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
connectedCallback() {
|
|
95
|
-
super.connectedCallback();
|
|
96
|
-
window.addEventListener("click", this.handleClick.bind(this));
|
|
97
|
-
}
|
|
98
|
-
disconnectedCallback() {
|
|
99
|
-
super.disconnectedCallback();
|
|
100
|
-
window.removeEventListener("click", this.handleClick);
|
|
101
|
-
}
|
|
102
|
-
async willUpdate(changedProperties) {
|
|
103
|
-
if (changedProperties.has("isOpen")) {
|
|
104
|
-
await this.updateComplete;
|
|
105
|
-
const changeEvent = new CustomEvent(
|
|
106
|
-
"on-change",
|
|
107
|
-
{
|
|
108
|
-
detail: {
|
|
109
|
-
isOpen: this.isOpen
|
|
110
|
-
},
|
|
111
|
-
bubbles: false,
|
|
112
|
-
composed: true
|
|
113
|
-
}
|
|
114
|
-
);
|
|
115
|
-
this.dispatchEvent(changeEvent);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
render() {
|
|
119
|
-
const styles = this.styles({
|
|
120
|
-
openTop: this.openTop,
|
|
121
|
-
size: this.size,
|
|
122
|
-
isRight: this.isRight,
|
|
123
|
-
isFullWidth: this.isFullWidth
|
|
124
|
-
});
|
|
125
|
-
if (!this.isOpen) {
|
|
126
|
-
return shared_tailwindElement_index.E;
|
|
127
|
-
}
|
|
128
|
-
return shared_tailwindElement_index.x`<div class="${styles} animate-fade-in animation-duration-200">
|
|
129
|
-
<slot></slot>
|
|
130
|
-
</div>`;
|
|
131
|
-
}
|
|
132
|
-
};
|
|
133
|
-
__decorateClass([
|
|
134
|
-
property.n({ type: String })
|
|
135
|
-
], exports.LuksoDropdown.prototype, "id", 2);
|
|
136
|
-
__decorateClass([
|
|
137
|
-
property.n({ type: String, attribute: "trigger-id" })
|
|
138
|
-
], exports.LuksoDropdown.prototype, "triggerId", 2);
|
|
139
|
-
__decorateClass([
|
|
140
|
-
property.n({ type: Boolean, attribute: "is-open", reflect: true })
|
|
141
|
-
], exports.LuksoDropdown.prototype, "isOpen", 2);
|
|
142
|
-
__decorateClass([
|
|
143
|
-
property.n({ type: Boolean, attribute: "is-open-on-outside-click" })
|
|
144
|
-
], exports.LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
|
|
145
|
-
__decorateClass([
|
|
146
|
-
property.n({ type: Boolean, attribute: "open-top" })
|
|
147
|
-
], exports.LuksoDropdown.prototype, "openTop", 2);
|
|
148
|
-
__decorateClass([
|
|
149
|
-
property.n({ type: Boolean, attribute: "is-right" })
|
|
150
|
-
], exports.LuksoDropdown.prototype, "isRight", 2);
|
|
151
|
-
__decorateClass([
|
|
152
|
-
property.n({ type: Boolean, attribute: "is-full-width" })
|
|
153
|
-
], exports.LuksoDropdown.prototype, "isFullWidth", 2);
|
|
154
|
-
__decorateClass([
|
|
155
|
-
property.n({ type: String })
|
|
156
|
-
], exports.LuksoDropdown.prototype, "size", 2);
|
|
157
|
-
exports.LuksoDropdown = __decorateClass([
|
|
158
|
-
property.t("lukso-dropdown")
|
|
159
|
-
], exports.LuksoDropdown);
|
|
160
|
-
|
|
161
|
-
exports.uniqId = uniqId;
|
package/dist/index-12775596.js
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { T as TailwindStyledElement, E, x } from './index-92dc158d.js';
|
|
2
|
-
import { n, t } from './property-eaa52bd9.js';
|
|
3
|
-
import { c as ce } from './index-d14b6a34.js';
|
|
4
|
-
import './components/lukso-icon/index.js';
|
|
5
|
-
import './index-ff8d75cd.js';
|
|
6
|
-
import './components/lukso-username/index.js';
|
|
7
|
-
|
|
8
|
-
const style = ":host {\n display: flex;\n width: 100%\n}";
|
|
9
|
-
|
|
10
|
-
const uniqId = () => {
|
|
11
|
-
const s4 = () => ((1 + Math.random()) * 65536 | 0).toString(16).substring(1);
|
|
12
|
-
return `${s4() + s4()}-${s4()}-${s4()}-${s4()}-${s4()}${s4()}${s4()}`;
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
const debounceFunction = (func, timeout = 100) => {
|
|
16
|
-
let timer;
|
|
17
|
-
return (...args) => {
|
|
18
|
-
clearTimeout(timer);
|
|
19
|
-
timer = setTimeout(() => {
|
|
20
|
-
typeof func === "function" && func.apply(void 0, args);
|
|
21
|
-
}, timeout);
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
|
|
25
|
-
var __defProp = Object.defineProperty;
|
|
26
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
27
|
-
var __decorateClass = (decorators, target, key, kind) => {
|
|
28
|
-
var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
|
|
29
|
-
for (var i = decorators.length - 1, decorator; i >= 0; i--)
|
|
30
|
-
if (decorator = decorators[i])
|
|
31
|
-
result = (kind ? decorator(target, key, result) : decorator(result)) || result;
|
|
32
|
-
if (kind && result)
|
|
33
|
-
__defProp(target, key, result);
|
|
34
|
-
return result;
|
|
35
|
-
};
|
|
36
|
-
let LuksoDropdown = class extends TailwindStyledElement(style) {
|
|
37
|
-
constructor() {
|
|
38
|
-
super();
|
|
39
|
-
this.id = "";
|
|
40
|
-
this.triggerId = "";
|
|
41
|
-
this.isOpen = false;
|
|
42
|
-
this.isOpenOnOutsideClick = false;
|
|
43
|
-
this.openTop = false;
|
|
44
|
-
this.isRight = false;
|
|
45
|
-
this.isFullWidth = false;
|
|
46
|
-
this.size = "medium";
|
|
47
|
-
this.styles = ce({
|
|
48
|
-
base: `bg-neutral-100 border w-full border-neutral-90 shadow-1xl z-50
|
|
49
|
-
flex absolute flex-col gap-1 overflow-y-auto max-h-64 w-[max-content]`,
|
|
50
|
-
variants: {
|
|
51
|
-
openTop: {
|
|
52
|
-
true: "bottom-[48px] mb-2 mt-0"
|
|
53
|
-
},
|
|
54
|
-
size: {
|
|
55
|
-
small: "rounded-8 p-2 mt-1 min-w-[120px] paragraph-inter-12-regular",
|
|
56
|
-
medium: "rounded-12 p-3 mt-2 min-w-[200px] paragraph-inter-14-regular"
|
|
57
|
-
},
|
|
58
|
-
isRight: {
|
|
59
|
-
true: "right-0"
|
|
60
|
-
},
|
|
61
|
-
isFullWidth: {
|
|
62
|
-
true: "w-full"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
compoundVariants: [
|
|
66
|
-
{
|
|
67
|
-
isFullWidth: false,
|
|
68
|
-
size: "small",
|
|
69
|
-
class: "max-w-[200px]"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
isFullWidth: false,
|
|
73
|
-
size: "medium",
|
|
74
|
-
class: "max-w-[300px]"
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
});
|
|
78
|
-
this.handleClick = debounceFunction((event) => {
|
|
79
|
-
const element = event.target;
|
|
80
|
-
if (element.id === this.triggerId || this.id === element.id) {
|
|
81
|
-
this.isOpen = !this.isOpen;
|
|
82
|
-
return;
|
|
83
|
-
}
|
|
84
|
-
if (!this.isOpenOnOutsideClick) {
|
|
85
|
-
this.isOpen = false;
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
if (!this.id) {
|
|
89
|
-
this.id = uniqId();
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
connectedCallback() {
|
|
93
|
-
super.connectedCallback();
|
|
94
|
-
window.addEventListener("click", this.handleClick.bind(this));
|
|
95
|
-
}
|
|
96
|
-
disconnectedCallback() {
|
|
97
|
-
super.disconnectedCallback();
|
|
98
|
-
window.removeEventListener("click", this.handleClick);
|
|
99
|
-
}
|
|
100
|
-
async willUpdate(changedProperties) {
|
|
101
|
-
if (changedProperties.has("isOpen")) {
|
|
102
|
-
await this.updateComplete;
|
|
103
|
-
const changeEvent = new CustomEvent(
|
|
104
|
-
"on-change",
|
|
105
|
-
{
|
|
106
|
-
detail: {
|
|
107
|
-
isOpen: this.isOpen
|
|
108
|
-
},
|
|
109
|
-
bubbles: false,
|
|
110
|
-
composed: true
|
|
111
|
-
}
|
|
112
|
-
);
|
|
113
|
-
this.dispatchEvent(changeEvent);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
render() {
|
|
117
|
-
const styles = this.styles({
|
|
118
|
-
openTop: this.openTop,
|
|
119
|
-
size: this.size,
|
|
120
|
-
isRight: this.isRight,
|
|
121
|
-
isFullWidth: this.isFullWidth
|
|
122
|
-
});
|
|
123
|
-
if (!this.isOpen) {
|
|
124
|
-
return E;
|
|
125
|
-
}
|
|
126
|
-
return x`<div class="${styles} animate-fade-in animation-duration-200">
|
|
127
|
-
<slot></slot>
|
|
128
|
-
</div>`;
|
|
129
|
-
}
|
|
130
|
-
};
|
|
131
|
-
__decorateClass([
|
|
132
|
-
n({ type: String })
|
|
133
|
-
], LuksoDropdown.prototype, "id", 2);
|
|
134
|
-
__decorateClass([
|
|
135
|
-
n({ type: String, attribute: "trigger-id" })
|
|
136
|
-
], LuksoDropdown.prototype, "triggerId", 2);
|
|
137
|
-
__decorateClass([
|
|
138
|
-
n({ type: Boolean, attribute: "is-open", reflect: true })
|
|
139
|
-
], LuksoDropdown.prototype, "isOpen", 2);
|
|
140
|
-
__decorateClass([
|
|
141
|
-
n({ type: Boolean, attribute: "is-open-on-outside-click" })
|
|
142
|
-
], LuksoDropdown.prototype, "isOpenOnOutsideClick", 2);
|
|
143
|
-
__decorateClass([
|
|
144
|
-
n({ type: Boolean, attribute: "open-top" })
|
|
145
|
-
], LuksoDropdown.prototype, "openTop", 2);
|
|
146
|
-
__decorateClass([
|
|
147
|
-
n({ type: Boolean, attribute: "is-right" })
|
|
148
|
-
], LuksoDropdown.prototype, "isRight", 2);
|
|
149
|
-
__decorateClass([
|
|
150
|
-
n({ type: Boolean, attribute: "is-full-width" })
|
|
151
|
-
], LuksoDropdown.prototype, "isFullWidth", 2);
|
|
152
|
-
__decorateClass([
|
|
153
|
-
n({ type: String })
|
|
154
|
-
], LuksoDropdown.prototype, "size", 2);
|
|
155
|
-
LuksoDropdown = __decorateClass([
|
|
156
|
-
t("lukso-dropdown")
|
|
157
|
-
], LuksoDropdown);
|
|
158
|
-
|
|
159
|
-
export { LuksoDropdown as L, uniqId as u };
|