mypgs 2.0.0 → 2.1.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/README.md +25 -25
- package/assets/scss/components/_accordion.scss +0 -2
- package/assets/scss/components/_button.scss +1 -1
- package/assets/scss/components/_form.scss +0 -16
- package/assets/scss/components/_formAddon.scss +18 -0
- package/assets/scss/components/_modals.scss +5 -3
- package/assets/scss/components/_search.scss +2 -2
- package/assets/scss/components/_slides.scss +0 -1
- package/assets/scss/components/_tooltip.scss +0 -1
- package/assets/scss/index.scss +1 -0
- package/assets/scss/layout/_footer.scss +0 -2
- package/assets/scss/layout/_header.scss +9 -1
- package/assets/scss/layout/_pageShell.scss +6 -2
- package/assets/scss/mixin/_mx-button.scss +30 -76
- package/assets/scss/mixin/_mx-card.scss +11 -9
- package/assets/scss/mixin/_mx-form.scss +3 -5
- package/assets/scss/mixin/{_mx-form-addon.scss → _mx-formAddon.scss} +23 -26
- package/assets/scss/mixin/_mx-hover.scss +75 -0
- package/assets/scss/mixin/_settings.scss +2 -1
- package/assets/scss/mixin/mixin.scss +2 -1
- package/demo/demo.js +4 -3
- package/dist/css/index.css +1166 -1517
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/docs/componenti-e-markup.md +6 -5
- package/docs/components/accordion.md +22 -22
- package/docs/components/badges.md +19 -19
- package/docs/components/breadcumbs.md +8 -8
- package/docs/components/button.md +17 -17
- package/docs/components/card.md +19 -19
- package/docs/components/dropdown.md +29 -29
- package/docs/components/form.md +63 -40
- package/docs/components/formAddon.md +79 -0
- package/docs/components/logo.md +11 -11
- package/docs/components/menu.md +20 -20
- package/docs/components/modal.md +46 -46
- package/docs/components/notification.md +34 -34
- package/docs/components/search.md +51 -50
- package/docs/components/slides.md +39 -39
- package/docs/components/stepTabs.md +41 -41
- package/docs/components/steps.md +16 -16
- package/docs/components/summary.md +20 -20
- package/docs/components/table.md +7 -7
- package/docs/components/tooltip.md +22 -22
- package/docs/convenzioni.md +11 -11
- package/docs/export-e-sviluppo.md +3 -3
- package/docs/helper-javascript.md +7 -7
- package/docs/layout/body.md +11 -11
- package/docs/layout/flex.md +44 -44
- package/docs/layout/footer.md +23 -23
- package/docs/layout/grid.md +44 -44
- package/docs/layout/header.md +34 -34
- package/docs/layout/pageShell.md +11 -11
- package/docs/layout/section.md +26 -26
- package/docs/patterns/cookieConsent.md +38 -38
- package/docs/utilizzo-css-scss.md +8 -8
- package/package.json +1 -1
- package/scripts/generate-component-docs.js +5 -5
- package/templates/html/components/accordion.html +19 -19
- package/templates/html/components/badges.html +17 -17
- package/templates/html/components/breadcumbs.html +6 -6
- package/templates/html/components/button.html +15 -15
- package/templates/html/components/card.html +17 -17
- package/templates/html/components/dropdown.html +25 -25
- package/templates/html/components/form.html +58 -35
- package/templates/html/components/formAddon.html +72 -0
- package/templates/html/components/logo.html +9 -9
- package/templates/html/components/menu.html +16 -16
- package/templates/html/components/modal.html +42 -42
- package/templates/html/components/notification.html +30 -30
- package/templates/html/components/search.html +43 -42
- package/templates/html/components/slides.html +31 -31
- package/templates/html/components/stepTabs.html +37 -37
- package/templates/html/components/steps.html +13 -13
- package/templates/html/components/summary.html +17 -17
- package/templates/html/components/table.html +5 -5
- package/templates/html/components/tooltip.html +18 -18
- package/templates/html/layout/body.html +9 -10
- package/templates/html/layout/flex.html +42 -42
- package/templates/html/layout/footer.html +20 -20
- package/templates/html/layout/grid.html +42 -42
- package/templates/html/layout/header.html +32 -32
- package/templates/html/layout/pageShell.html +8 -8
- package/templates/html/layout/section.html +24 -24
- package/templates/html/patterns/cookieConsent.html +33 -33
- package/templates/react/components/accordion.jsx +4 -4
- package/templates/react/components/breadcumbs.jsx +1 -1
- package/templates/react/components/button.jsx +5 -5
- package/templates/react/components/card.jsx +4 -4
- package/templates/react/components/dropdown.jsx +8 -8
- package/templates/react/components/form.jsx +2 -2
- package/templates/react/components/modal.jsx +14 -14
- package/templates/react/components/notification.jsx +3 -3
- package/templates/react/components/search.jsx +5 -5
- package/templates/react/components/slides.jsx +3 -3
- package/templates/react/components/stepTabs.jsx +8 -8
- package/templates/react/components/summary.jsx +3 -3
- package/templates/react/components/table.jsx +2 -2
- package/templates/react/layout/flex.jsx +8 -8
- package/templates/react/layout/grid.jsx +8 -8
- package/templates/react/layout/section.jsx +12 -12
- package/templates/react/patterns/cookieConsent.jsx +8 -8
- package/templates/react/patterns/footer.jsx +3 -3
- package/templates/react/patterns/header.jsx +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Components and markup
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Complete templates are available in `templates/`. Use those files as the reference source before creating new markup.
|
|
4
4
|
|
|
5
5
|
## Componenti disponibili
|
|
6
6
|
|
|
@@ -13,6 +13,7 @@ Componenti:
|
|
|
13
13
|
- [`card`](components/card.md)
|
|
14
14
|
- [`dropdown`](components/dropdown.md)
|
|
15
15
|
- [`form`](components/form.md)
|
|
16
|
+
- [`formAddon`](components/formAddon.md)
|
|
16
17
|
- [`logo`](components/logo.md)
|
|
17
18
|
- [`menu`](components/menu.md)
|
|
18
19
|
- [`modal`](components/modal.md)
|
|
@@ -39,7 +40,7 @@ Pattern:
|
|
|
39
40
|
|
|
40
41
|
- [`cookieConsent`](patterns/cookieConsent.md)
|
|
41
42
|
|
|
42
|
-
## Search
|
|
43
|
+
## Search with suggestions
|
|
43
44
|
|
|
44
45
|
`search` include sia lo stile sia il comportamento di ricerca e usa `search-suggestions` come lista opzionale:
|
|
45
46
|
|
|
@@ -51,7 +52,7 @@ Pattern:
|
|
|
51
52
|
</form>
|
|
52
53
|
```
|
|
53
54
|
|
|
54
|
-
|
|
55
|
+
The project provides the data source; `mypgs` does not depend on specific backend endpoints or formats:
|
|
55
56
|
|
|
56
57
|
```js
|
|
57
58
|
const form = pgs(document).querySelector("search");
|
|
@@ -75,7 +76,7 @@ pgs.search.api(form)?.configure({
|
|
|
75
76
|
|
|
76
77
|
La sorgente puo' essere anche un array locale di stringhe o oggetti. Il componente gestisce debounce, annullamento richieste, risposte fuori ordine, tastiera, selezione, click esterno, stati `open`, `loading` ed `error` e attributi ARIA. Gli eventi `pgs:search:select` e `pgs:search:error` sono emessi sul root `search`.
|
|
77
78
|
|
|
78
|
-
##
|
|
79
|
+
## Other elements without templates
|
|
79
80
|
|
|
80
81
|
Base:
|
|
81
82
|
|
|
@@ -1,60 +1,60 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/accordion.html. Edit templates/html/components/accordion.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Accordion
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Interactive component that expands one panel at a time while synchronizing visibility, ARIA attributes, and keyboard navigation.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `accordion`:
|
|
10
|
-
- `accordion-button`:
|
|
11
|
-
- `accordion-content`:
|
|
9
|
+
- `accordion`: identifies each expandable element initialized by the JavaScript module.
|
|
10
|
+
- `accordion-button`: identifies the control that opens or closes the associated panel.
|
|
11
|
+
- `accordion-content`: identifies the content panel managed through the hidden attribute.
|
|
12
12
|
|
|
13
13
|
## PGS States
|
|
14
14
|
|
|
15
|
-
- `open`:
|
|
15
|
+
- `open`: indicates the accordion element that is currently open and visible.
|
|
16
16
|
|
|
17
|
-
## API
|
|
17
|
+
## JavaScript API
|
|
18
18
|
|
|
19
|
-
- `pgs.accordion.init(root)`:
|
|
20
|
-
- `pgs.accordion.api(element)`:
|
|
21
|
-
- `instance.open()`:
|
|
22
|
-
- `instance.close()`:
|
|
23
|
-
- `instance.toggle()`:
|
|
24
|
-
- `instance.refresh()`:
|
|
25
|
-
- `instance.isOpen()`:
|
|
19
|
+
- `pgs.accordion.init(root)`: initializes unregistered accordions within the specified Document or Element.
|
|
20
|
+
- `pgs.accordion.api(element)`: returns the instance associated with an initialized accordion root.
|
|
21
|
+
- `instance.open()`: opens the panel and closes any other accordions on the page.
|
|
22
|
+
- `instance.close()`: closes the current panel.
|
|
23
|
+
- `instance.toggle()`: toggles the panel between its open and closed states.
|
|
24
|
+
- `instance.refresh()`: reruns initialization within the accordion container and returns the instance.
|
|
25
|
+
- `instance.isOpen()`: returns true when the open state is active.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Related elements
|
|
28
28
|
|
|
29
|
-
- `flexColumnTexts`:
|
|
29
|
+
- `flexColumnTexts`: applies text spacing between the list items.
|
|
30
30
|
|
|
31
31
|
## Output
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
HTML list of accessible accordion items with an associated button and panel.
|
|
34
34
|
|
|
35
|
-
##
|
|
35
|
+
## Example
|
|
36
36
|
|
|
37
37
|
```html
|
|
38
38
|
<ul pgs="flexColumnTexts">
|
|
39
39
|
<li pgs="accordion">
|
|
40
40
|
<button pgs="accordion-button" type="button">
|
|
41
41
|
<i class="fa-solid fa-circle-question" aria-hidden="true"></i>
|
|
42
|
-
<span>
|
|
42
|
+
<span>Frequently asked question</span>
|
|
43
43
|
</button>
|
|
44
44
|
|
|
45
45
|
<div pgs="accordion-content" hidden>
|
|
46
|
-
<p>
|
|
46
|
+
<p>Example answer with reusable text content.</p>
|
|
47
47
|
</div>
|
|
48
48
|
</li>
|
|
49
49
|
|
|
50
50
|
<li pgs="accordion">
|
|
51
51
|
<button pgs="accordion-button" type="button">
|
|
52
52
|
<i class="fa-solid fa-circle-info" aria-hidden="true"></i>
|
|
53
|
-
<span>
|
|
53
|
+
<span>Second section</span>
|
|
54
54
|
</button>
|
|
55
55
|
|
|
56
56
|
<div pgs="accordion-content" hidden>
|
|
57
|
-
<p>
|
|
57
|
+
<p>Additional accordion panel content.</p>
|
|
58
58
|
</div>
|
|
59
59
|
</li>
|
|
60
60
|
</ul>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/badges.html. Edit templates/html/components/badges.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Badge
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Collection of compact indicators for displaying categories, priorities, and visual states with consistent color variants.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `badge`:
|
|
10
|
-
- `badgePrimary`:
|
|
11
|
-
- `badgeStrong`:
|
|
12
|
-
- `badgeSuccess`:
|
|
13
|
-
- `badgeDot`:
|
|
14
|
-
- `badgeWarning`:
|
|
15
|
-
- `badgeError`:
|
|
16
|
-
- `badgeInfo`:
|
|
17
|
-
- `badgeNeutral`:
|
|
9
|
+
- `badge`: identifies the base badge variant.
|
|
10
|
+
- `badgePrimary`: applies the primary color variant.
|
|
11
|
+
- `badgeStrong`: applies the high-contrast variant.
|
|
12
|
+
- `badgeSuccess`: represents a successful result.
|
|
13
|
+
- `badgeDot`: adds a dot indicator to the badge.
|
|
14
|
+
- `badgeWarning`: represents a warning.
|
|
15
|
+
- `badgeError`: represents an error.
|
|
16
|
+
- `badgeInfo`: represents informational content.
|
|
17
|
+
- `badgeNeutral`: applies the neutral variant.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Related elements
|
|
20
20
|
|
|
21
|
-
- `flexRow`:
|
|
21
|
+
- `flexRow`: arranges badges horizontally and allows them to wrap.
|
|
22
22
|
|
|
23
23
|
## Output
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
HTML examples of the available badge variants.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Example
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
30
|
<div pgs="flexRow">
|
|
@@ -41,17 +41,17 @@ Esempi HTML delle varianti badge disponibili.
|
|
|
41
41
|
</span>
|
|
42
42
|
|
|
43
43
|
<span pgs="badgeSuccess badgeDot">
|
|
44
|
-
|
|
44
|
+
Active
|
|
45
45
|
</span>
|
|
46
46
|
|
|
47
47
|
<span pgs="badgeWarning">
|
|
48
48
|
<i class="fa-solid fa-triangle-exclamation" aria-hidden="true"></i>
|
|
49
|
-
|
|
49
|
+
Warning
|
|
50
50
|
</span>
|
|
51
51
|
|
|
52
52
|
<span pgs="badgeError">
|
|
53
53
|
<i class="fa-solid fa-xmark" aria-hidden="true"></i>
|
|
54
|
-
|
|
54
|
+
Error
|
|
55
55
|
</span>
|
|
56
56
|
|
|
57
57
|
<span pgs="badgeInfo">
|
|
@@ -60,7 +60,7 @@ Esempi HTML delle varianti badge disponibili.
|
|
|
60
60
|
</span>
|
|
61
61
|
|
|
62
62
|
<span pgs="badgeNeutral" href="#">
|
|
63
|
-
|
|
63
|
+
Neutral
|
|
64
64
|
</span>
|
|
65
65
|
|
|
66
66
|
</div>
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/breadcumbs.html. Edit templates/html/components/breadcumbs.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Breadcrumb
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Hierarchical navigation that shows the current page path with links, separators, and a semantic indication of the active item.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `breadcrumb`:
|
|
10
|
-
- `breadcrumb-item`:
|
|
11
|
-
- `breadcrumb-item-separator`:
|
|
9
|
+
- `breadcrumb`: identifies the main navigation path list.
|
|
10
|
+
- `breadcrumb-item`: identifies each level in the path.
|
|
11
|
+
- `breadcrumb-item-separator`: identifies the decorative separator hidden from assistive technologies.
|
|
12
12
|
|
|
13
13
|
## Output
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Semantic breadcrumb HTML structure wrapped in a nav element.
|
|
16
16
|
|
|
17
|
-
##
|
|
17
|
+
## Example
|
|
18
18
|
|
|
19
19
|
```html
|
|
20
20
|
<nav aria-label="Breadcrumb">
|
|
@@ -35,7 +35,7 @@ Struttura HTML semantica di una breadcrumb racchiusa in un elemento nav.
|
|
|
35
35
|
|
|
36
36
|
<li pgs="breadcrumb-item">
|
|
37
37
|
<span aria-current="page">
|
|
38
|
-
|
|
38
|
+
Sample article
|
|
39
39
|
</span>
|
|
40
40
|
</li>
|
|
41
41
|
</ul>
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/button.html. Edit templates/html/components/button.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Button
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Button and action-link variants with sizes, emphasis, and icon-text composition defined by the design system.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `button`:
|
|
10
|
-
- `buttonStrong`:
|
|
11
|
-
- `buttonIcon`:
|
|
12
|
-
- `buttonMini`:
|
|
13
|
-
- `buttonBig`:
|
|
9
|
+
- `button`: identifies the standard button, which can also be used on anchor elements.
|
|
10
|
+
- `buttonStrong`: applies the variant with stronger visual emphasis.
|
|
11
|
+
- `buttonIcon`: identifies a compact button composed primarily of an icon.
|
|
12
|
+
- `buttonMini`: applies the smallest size variant.
|
|
13
|
+
- `buttonBig`: applies the large size variant.
|
|
14
14
|
|
|
15
15
|
## PGS Options
|
|
16
16
|
|
|
17
|
-
- `buttonReverse`:
|
|
17
|
+
- `buttonReverse`: reverses the visual order of the text and icon on the button.
|
|
18
18
|
|
|
19
|
-
##
|
|
19
|
+
## Related elements
|
|
20
20
|
|
|
21
|
-
- `flexRow`:
|
|
21
|
+
- `flexRow`: arranges the button examples in a flexible row.
|
|
22
22
|
|
|
23
23
|
## Output
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
HTML collection of the main button variants.
|
|
26
26
|
|
|
27
|
-
##
|
|
27
|
+
## Example
|
|
28
28
|
|
|
29
29
|
```html
|
|
30
30
|
<div pgs="flexRow">
|
|
@@ -34,7 +34,7 @@ Raccolta HTML delle principali varianti di button.
|
|
|
34
34
|
</a>
|
|
35
35
|
|
|
36
36
|
<button pgs="button" type="button" pgs-option="buttonReverse">
|
|
37
|
-
|
|
37
|
+
Next
|
|
38
38
|
<i class="fa-solid fa-arrow-right" aria-hidden="true"></i>
|
|
39
39
|
</button>
|
|
40
40
|
|
|
@@ -43,17 +43,17 @@ Raccolta HTML delle principali varianti di button.
|
|
|
43
43
|
Submit
|
|
44
44
|
</button>
|
|
45
45
|
|
|
46
|
-
<button pgs="buttonIcon" type="button" aria-label="
|
|
46
|
+
<button pgs="buttonIcon" type="button" aria-label="Settings">
|
|
47
47
|
<i class="fa-solid fa-gear" aria-hidden="true"></i>
|
|
48
48
|
</button>
|
|
49
49
|
|
|
50
|
-
<button pgs="buttonMini" type="button" aria-label="
|
|
50
|
+
<button pgs="buttonMini" type="button" aria-label="Information">
|
|
51
51
|
<i class="fa-solid fa-info" aria-hidden="true"></i>
|
|
52
52
|
</button>
|
|
53
53
|
|
|
54
|
-
<button pgs="buttonBig" type="button" aria-label="
|
|
54
|
+
<button pgs="buttonBig" type="button" aria-label="Large button">
|
|
55
55
|
<i class="fa-solid fa-rocket" aria-hidden="true"></i>
|
|
56
|
-
|
|
56
|
+
Large button
|
|
57
57
|
</button>
|
|
58
58
|
</div>
|
|
59
59
|
```
|
package/docs/components/card.md
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/card.html. Edit templates/html/components/card.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Card
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Reusable container for grouping an image, title, text, and actions in responsive previews or collections.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `card`:
|
|
10
|
-
- `card-img`:
|
|
9
|
+
- `card`: identifies the main card container.
|
|
10
|
+
- `card-img`: identifies the main card image.
|
|
11
11
|
|
|
12
|
-
##
|
|
12
|
+
## Related elements
|
|
13
13
|
|
|
14
|
-
- `flex-2`:
|
|
15
|
-
- `flexColumn`:
|
|
16
|
-
- `imgCover`:
|
|
17
|
-
- `flexColumnTexts`:
|
|
18
|
-
- `button`:
|
|
14
|
+
- `flex-2`: arranges the cards in a responsive two-item layout.
|
|
15
|
+
- `flexColumn`: organizes the card or link content vertically.
|
|
16
|
+
- `imgCover`: scales the image to fill the available area.
|
|
17
|
+
- `flexColumnTexts`: applies vertical spacing to text content.
|
|
18
|
+
- `button`: presents the final link as a standard button.
|
|
19
19
|
|
|
20
20
|
## Output
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
Two card HTML structures, one with a separate action and one that is fully clickable.
|
|
23
23
|
|
|
24
|
-
##
|
|
24
|
+
## Example
|
|
25
25
|
|
|
26
26
|
```html
|
|
27
27
|
<div pgs="flex-2">
|
|
28
28
|
|
|
29
29
|
<article pgs="card flexColumn">
|
|
30
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="
|
|
30
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
31
31
|
|
|
32
32
|
<div pgs="flexColumnTexts">
|
|
33
|
-
<h3>
|
|
34
|
-
<p>
|
|
35
|
-
<a pgs="button" href="#">
|
|
33
|
+
<h3>Reusable card</h3>
|
|
34
|
+
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
35
|
+
<a pgs="button" href="#">Read more</a>
|
|
36
36
|
</div>
|
|
37
37
|
</article>
|
|
38
38
|
|
|
39
39
|
<article pgs="card">
|
|
40
40
|
<a pgs="flexColumn" href="">
|
|
41
|
-
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="
|
|
41
|
+
<img pgs="card-img imgCover" src="https://placehold.co/800x500" alt="Placeholder image">
|
|
42
42
|
|
|
43
43
|
<div pgs="flexColumnTexts">
|
|
44
|
-
<h3>
|
|
45
|
-
<p>
|
|
44
|
+
<h3>Reusable card</h3>
|
|
45
|
+
<p>Descriptive card content suitable for lists, previews, and grids.</p>
|
|
46
46
|
</div>
|
|
47
47
|
</a>
|
|
48
48
|
</article>
|
|
@@ -1,44 +1,44 @@
|
|
|
1
|
-
<!--
|
|
1
|
+
<!-- Automatically generated from templates/html/components/dropdown.html. Edit templates/html/components/dropdown.html and run npm run docs:generate again. -->
|
|
2
2
|
|
|
3
3
|
# Dropdown
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Popup component that connects a control to content positioned relative to its trigger and handles opening, closing, outside clicks, and Escape.
|
|
6
6
|
|
|
7
7
|
## PGS
|
|
8
8
|
|
|
9
|
-
- `dropdown`:
|
|
10
|
-
- `dropdown-button`:
|
|
11
|
-
- `dropdown-content`:
|
|
9
|
+
- `dropdown`: identifies the container initialized by the dropdown module.
|
|
10
|
+
- `dropdown-button`: identifies the control that opens or closes the content.
|
|
11
|
+
- `dropdown-content`: identifies the panel positioned relative to the control.
|
|
12
12
|
|
|
13
13
|
## PGS Options
|
|
14
14
|
|
|
15
|
-
- `position`:
|
|
16
|
-
- `buttonReverse`:
|
|
15
|
+
- `position`: configures the root as position[side alignment]; side accepts top, right, bottom, or left, while compatible alignment values are top, right, bottom, left, or center. The default is bottom center.
|
|
16
|
+
- `buttonReverse`: reverses text and icon on the example buttons and belongs to the button component.
|
|
17
17
|
|
|
18
18
|
## PGS States
|
|
19
19
|
|
|
20
|
-
- `open`:
|
|
20
|
+
- `open`: indicates that the dropdown is open and its content is visible.
|
|
21
21
|
|
|
22
|
-
## API
|
|
22
|
+
## JavaScript API
|
|
23
23
|
|
|
24
|
-
- `pgs.dropdown.init(root)`:
|
|
25
|
-
- `pgs.dropdown.api(element)`:
|
|
26
|
-
- `instance.open()`:
|
|
27
|
-
- `instance.close()`:
|
|
28
|
-
- `instance.toggle()`:
|
|
29
|
-
- `instance.refresh()`:
|
|
30
|
-
- `instance.isOpen()`:
|
|
24
|
+
- `pgs.dropdown.init(root)`: initializes unregistered dropdowns within the specified Document or Element.
|
|
25
|
+
- `pgs.dropdown.api(element)`: returns the instance associated with an initialized dropdown root.
|
|
26
|
+
- `instance.open()`: opens the dropdown and closes any other open dropdowns.
|
|
27
|
+
- `instance.close()`: closes the current dropdown.
|
|
28
|
+
- `instance.toggle()`: toggles between the open and closed states.
|
|
29
|
+
- `instance.refresh()`: reinitializes the context and recalculates content positioning.
|
|
30
|
+
- `instance.isOpen()`: returns true when the dropdown is open.
|
|
31
31
|
|
|
32
|
-
##
|
|
32
|
+
## Related elements
|
|
33
33
|
|
|
34
|
-
- `flexRow`:
|
|
35
|
-
- `button`:
|
|
34
|
+
- `flexRow`: arranges the placement examples on the same flexible row.
|
|
35
|
+
- `button`: applies standard styling to dropdown controls.
|
|
36
36
|
|
|
37
37
|
## Output
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
Series of HTML dropdowns demonstrating the supported placement directions.
|
|
40
40
|
|
|
41
|
-
##
|
|
41
|
+
## Example
|
|
42
42
|
|
|
43
43
|
```html
|
|
44
44
|
<div pgs="flexRow">
|
|
@@ -50,7 +50,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
50
50
|
</button>
|
|
51
51
|
|
|
52
52
|
<div pgs="dropdown-content">
|
|
53
|
-
|
|
53
|
+
bottom center content
|
|
54
54
|
</div>
|
|
55
55
|
</span>
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
61
61
|
</button>
|
|
62
62
|
|
|
63
63
|
<div pgs="dropdown-content">
|
|
64
|
-
|
|
64
|
+
top left content
|
|
65
65
|
</div>
|
|
66
66
|
</span>
|
|
67
67
|
|
|
@@ -72,7 +72,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
72
72
|
</button>
|
|
73
73
|
|
|
74
74
|
<div pgs="dropdown-content">
|
|
75
|
-
|
|
75
|
+
top center content
|
|
76
76
|
</div>
|
|
77
77
|
</span>
|
|
78
78
|
|
|
@@ -83,7 +83,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
83
83
|
</button>
|
|
84
84
|
|
|
85
85
|
<div pgs="dropdown-content">
|
|
86
|
-
|
|
86
|
+
top right content
|
|
87
87
|
</div>
|
|
88
88
|
</span>
|
|
89
89
|
|
|
@@ -94,7 +94,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
94
94
|
</button>
|
|
95
95
|
|
|
96
96
|
<div pgs="dropdown-content">
|
|
97
|
-
|
|
97
|
+
bottom left content
|
|
98
98
|
</div>
|
|
99
99
|
</span>
|
|
100
100
|
|
|
@@ -105,7 +105,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
105
105
|
</button>
|
|
106
106
|
|
|
107
107
|
<div pgs="dropdown-content">
|
|
108
|
-
|
|
108
|
+
bottom right content
|
|
109
109
|
</div>
|
|
110
110
|
</span>
|
|
111
111
|
|
|
@@ -116,7 +116,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
116
116
|
</button>
|
|
117
117
|
|
|
118
118
|
<div pgs="dropdown-content">
|
|
119
|
-
|
|
119
|
+
left center content
|
|
120
120
|
</div>
|
|
121
121
|
</span>
|
|
122
122
|
|
|
@@ -127,7 +127,7 @@ Serie di dropdown HTML che dimostra le direzioni di posizionamento supportate.
|
|
|
127
127
|
</button>
|
|
128
128
|
|
|
129
129
|
<div pgs="dropdown-content">
|
|
130
|
-
|
|
130
|
+
right center content
|
|
131
131
|
</div>
|
|
132
132
|
</span>
|
|
133
133
|
|