@italia/popover 0.1.0-alpha.2
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/AUTHORS +3 -0
- package/LICENSE +18 -0
- package/README.md +19 -0
- package/custom-elements.json +198 -0
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +5 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/it-popover.d.ts +34 -0
- package/dist/src/it-popover.d.ts.map +1 -0
- package/dist/src/it-popover.js +2913 -0
- package/dist/src/it-popover.js.map +1 -0
- package/package.json +70 -0
package/AUTHORS
ADDED
package/LICENSE
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
13
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
14
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
15
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
16
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
17
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
18
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Popover Web Component
|
|
2
|
+
|
|
3
|
+
Questo package contiene il web component `<it-popover>`, conforme agli standard del progetto e con stili Bootstrap Italia.
|
|
4
|
+
|
|
5
|
+
## Utilizzo
|
|
6
|
+
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Sviluppo
|
|
12
|
+
|
|
13
|
+
- Stili: solo SCSS, no CSS inline
|
|
14
|
+
- Test: web-test-runner
|
|
15
|
+
- Storie: Storybook
|
|
16
|
+
|
|
17
|
+
## License
|
|
18
|
+
|
|
19
|
+
Vedi LICENSE.
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
{
|
|
2
|
+
"schemaVersion": "1.0.0",
|
|
3
|
+
"readme": "",
|
|
4
|
+
"modules": [
|
|
5
|
+
{
|
|
6
|
+
"kind": "javascript-module",
|
|
7
|
+
"path": "src/index.ts",
|
|
8
|
+
"declarations": [],
|
|
9
|
+
"exports": [
|
|
10
|
+
{
|
|
11
|
+
"kind": "js",
|
|
12
|
+
"name": "ItPopover",
|
|
13
|
+
"declaration": {
|
|
14
|
+
"name": "ItPopover",
|
|
15
|
+
"module": "./it-popover.js"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"kind": "javascript-module",
|
|
22
|
+
"path": "src/it-popover.ts",
|
|
23
|
+
"declarations": [
|
|
24
|
+
{
|
|
25
|
+
"kind": "class",
|
|
26
|
+
"description": "",
|
|
27
|
+
"name": "ItPopover",
|
|
28
|
+
"members": [
|
|
29
|
+
{
|
|
30
|
+
"kind": "field",
|
|
31
|
+
"name": "open",
|
|
32
|
+
"type": {
|
|
33
|
+
"text": "boolean"
|
|
34
|
+
},
|
|
35
|
+
"default": "false",
|
|
36
|
+
"attribute": "open",
|
|
37
|
+
"reflects": true
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"kind": "field",
|
|
41
|
+
"name": "placement",
|
|
42
|
+
"type": {
|
|
43
|
+
"text": "PopoverPlacement"
|
|
44
|
+
},
|
|
45
|
+
"default": "'bottom-start'",
|
|
46
|
+
"attribute": "placement"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"kind": "field",
|
|
50
|
+
"name": "_triggerSlot",
|
|
51
|
+
"type": {
|
|
52
|
+
"text": "HTMLSlotElement"
|
|
53
|
+
},
|
|
54
|
+
"privacy": "private"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"kind": "field",
|
|
58
|
+
"name": "_contentSlot",
|
|
59
|
+
"type": {
|
|
60
|
+
"text": "HTMLSlotElement"
|
|
61
|
+
},
|
|
62
|
+
"privacy": "private"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"kind": "field",
|
|
66
|
+
"name": "_triggerElement",
|
|
67
|
+
"privacy": "private",
|
|
68
|
+
"readonly": true
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"kind": "field",
|
|
72
|
+
"name": "_contentElement",
|
|
73
|
+
"privacy": "private",
|
|
74
|
+
"readonly": true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"kind": "field",
|
|
78
|
+
"name": "_arrowElement",
|
|
79
|
+
"type": {
|
|
80
|
+
"text": "HTMLElement | undefined"
|
|
81
|
+
},
|
|
82
|
+
"privacy": "private"
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
"kind": "field",
|
|
86
|
+
"name": "_cleanup",
|
|
87
|
+
"type": {
|
|
88
|
+
"text": "() => void | undefined"
|
|
89
|
+
},
|
|
90
|
+
"privacy": "private"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"kind": "method",
|
|
94
|
+
"name": "_setChildrenProperties",
|
|
95
|
+
"privacy": "private"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"kind": "method",
|
|
99
|
+
"name": "_createArrow",
|
|
100
|
+
"privacy": "private"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"kind": "method",
|
|
104
|
+
"name": "_show",
|
|
105
|
+
"privacy": "private"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"kind": "method",
|
|
109
|
+
"name": "_hide",
|
|
110
|
+
"privacy": "private"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"kind": "field",
|
|
114
|
+
"name": "_onDocumentClick",
|
|
115
|
+
"privacy": "private"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"kind": "method",
|
|
119
|
+
"name": "_focusContent",
|
|
120
|
+
"privacy": "private"
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
"kind": "method",
|
|
124
|
+
"name": "toggle",
|
|
125
|
+
"privacy": "public"
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
"kind": "method",
|
|
129
|
+
"name": "openPopover",
|
|
130
|
+
"privacy": "public"
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
"kind": "method",
|
|
134
|
+
"name": "closePopover",
|
|
135
|
+
"privacy": "public"
|
|
136
|
+
}
|
|
137
|
+
],
|
|
138
|
+
"events": [
|
|
139
|
+
{
|
|
140
|
+
"name": "it-popover-open",
|
|
141
|
+
"type": {
|
|
142
|
+
"text": "CustomEvent"
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
"name": "it-popover-close",
|
|
147
|
+
"type": {
|
|
148
|
+
"text": "CustomEvent"
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
"attributes": [
|
|
153
|
+
{
|
|
154
|
+
"name": "open",
|
|
155
|
+
"type": {
|
|
156
|
+
"text": "boolean"
|
|
157
|
+
},
|
|
158
|
+
"default": "false",
|
|
159
|
+
"fieldName": "open"
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
"name": "placement",
|
|
163
|
+
"type": {
|
|
164
|
+
"text": "PopoverPlacement"
|
|
165
|
+
},
|
|
166
|
+
"default": "'bottom-start'",
|
|
167
|
+
"fieldName": "placement"
|
|
168
|
+
}
|
|
169
|
+
],
|
|
170
|
+
"superclass": {
|
|
171
|
+
"name": "BaseComponent",
|
|
172
|
+
"package": "@italia/globals"
|
|
173
|
+
},
|
|
174
|
+
"tagName": "it-popover",
|
|
175
|
+
"customElement": true
|
|
176
|
+
}
|
|
177
|
+
],
|
|
178
|
+
"exports": [
|
|
179
|
+
{
|
|
180
|
+
"kind": "js",
|
|
181
|
+
"name": "ItPopover",
|
|
182
|
+
"declaration": {
|
|
183
|
+
"name": "ItPopover",
|
|
184
|
+
"module": "src/it-popover.ts"
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
"kind": "custom-element-definition",
|
|
189
|
+
"name": "it-popover",
|
|
190
|
+
"declaration": {
|
|
191
|
+
"name": "ItPopover",
|
|
192
|
+
"module": "src/it-popover.ts"
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
]
|
|
196
|
+
}
|
|
197
|
+
]
|
|
198
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseComponent } from '@italia/globals';
|
|
2
|
+
import { type Placement } from '@floating-ui/dom';
|
|
3
|
+
type PopoverPlacement = Placement;
|
|
4
|
+
export declare class ItPopover extends BaseComponent {
|
|
5
|
+
static styles: import("lit").CSSResultGroup;
|
|
6
|
+
open: boolean;
|
|
7
|
+
placement: PopoverPlacement;
|
|
8
|
+
private _triggerSlot;
|
|
9
|
+
private _contentSlot;
|
|
10
|
+
private get _triggerElement();
|
|
11
|
+
private get _contentElement();
|
|
12
|
+
private _arrowElement?;
|
|
13
|
+
private _cleanup?;
|
|
14
|
+
private _setChildrenProperties;
|
|
15
|
+
connectedCallback(): void;
|
|
16
|
+
disconnectedCallback(): void;
|
|
17
|
+
updated(changedProps: Map<string, any>): void;
|
|
18
|
+
private _createArrow;
|
|
19
|
+
private _show;
|
|
20
|
+
private _hide;
|
|
21
|
+
private _onDocumentClick;
|
|
22
|
+
private _focusContent;
|
|
23
|
+
toggle(): void;
|
|
24
|
+
openPopover(): void;
|
|
25
|
+
closePopover(): void;
|
|
26
|
+
render(): import("lit").TemplateResult<1>;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'it-popover': ItPopover;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=it-popover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"it-popover.d.ts","sourceRoot":"","sources":["../../src/it-popover.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGhD,OAAO,EAA2D,KAAK,SAAS,EAAQ,MAAM,kBAAkB,CAAC;AAGjH,KAAK,gBAAgB,GAAG,SAAS,CAAC;AAElC,qBACa,SAAU,SAAQ,aAAa;IAC1C,MAAM,CAAC,MAAM,+BAAU;IAEqB,IAAI,UAAS;IAE7B,SAAS,EAAE,gBAAgB,CAAkB;IAE1C,OAAO,CAAC,YAAY,CAAmB;IAEvC,OAAO,CAAC,YAAY,CAAmB;IAEtE,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,KAAK,eAAe,GAE1B;IAED,OAAO,CAAC,aAAa,CAAC,CAAc;IAEpC,OAAO,CAAC,QAAQ,CAAC,CAAa;IAE9B,OAAO,CAAC,sBAAsB;IAc9B,iBAAiB;IAKjB,oBAAoB;IAMpB,OAAO,CAAC,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC;IAatC,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,KAAK;IAuDb,OAAO,CAAC,KAAK;IAKb,OAAO,CAAC,gBAAgB,CAQtB;IAEF,OAAO,CAAC,aAAa;IAId,MAAM;IAIN,WAAW;IAIX,YAAY;IAInB,MAAM;CAMP;AAED,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,qBAAqB;QAC7B,YAAY,EAAE,SAAS,CAAC;KACzB;CACF"}
|