mypgs 1.5.1 → 2.0.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/AGENTS.md +8 -5
- package/README.md +1 -1
- package/assets/javascript/_imports.js +4 -0
- package/assets/javascript/_pgs.js +58 -0
- package/assets/javascript/base/_darkmode.js +27 -105
- package/assets/javascript/base/_svg.js +103 -0
- package/assets/javascript/components/_accordion.js +2 -2
- package/assets/javascript/components/_menu.js +1 -3
- package/assets/javascript/components/_modals.js +159 -136
- package/assets/javascript/components/_notifications.js +19 -9
- package/assets/javascript/components/_search.js +391 -0
- package/assets/javascript/components/_slides.js +66 -32
- package/assets/javascript/components/_stepTabs.js +4 -4
- package/assets/javascript/components/_steps.js +2 -2
- package/assets/javascript/components/_summary.js +2 -2
- package/assets/javascript/functions/_formValidate.js +97 -53
- package/assets/javascript/functions/_scrollY.js +10 -10
- package/assets/javascript/index.js +2 -0
- package/assets/javascript/layout/_header.js +29 -7
- package/assets/scss/base/_color.scss +5 -5
- package/assets/scss/base/_html.scss +2 -2
- package/assets/scss/base/_variables.scss +4 -2
- package/assets/scss/components/_dropdown.scss +2 -1
- package/assets/scss/components/_form.scss +2 -2
- package/assets/scss/components/_logo.scss +2 -2
- package/assets/scss/components/_menu.scss +20 -27
- package/assets/scss/components/_modals.scss +11 -1
- package/assets/scss/components/_notification.scss +23 -30
- package/assets/scss/components/_search.scss +140 -0
- package/assets/scss/index.scss +2 -2
- package/assets/scss/layout/_header.scss +1 -1
- package/assets/scss/layout/_pageShell.scss +19 -15
- package/assets/scss/mixin/_mx-form.scss +7 -7
- package/{templates/html → demo}/demo.html +1 -1
- package/demo/demo.js +240 -0
- package/dist/css/index.css +188 -125
- package/dist/css/index.css.map +1 -1
- package/dist/css/index.min.css +1 -1
- package/dist/index.d.ts +70 -0
- package/dist/javascript/index.js +1038 -405
- package/dist/javascript/index.js.map +1 -1
- package/dist/javascript/index.min.js +1 -1
- package/docs/componenti-e-markup.md +62 -27
- package/docs/components/accordion.md +61 -0
- package/docs/components/badges.md +67 -0
- package/docs/components/breadcumbs.md +43 -0
- package/docs/components/button.md +59 -0
- package/docs/components/card.md +50 -0
- package/docs/components/dropdown.md +135 -0
- package/docs/components/form.md +113 -0
- package/docs/components/logo.md +36 -0
- package/docs/components/menu.md +90 -0
- package/docs/components/modal.md +131 -0
- package/docs/components/notification.md +81 -0
- package/docs/components/search.md +117 -0
- package/docs/components/slides.md +85 -0
- package/docs/components/stepTabs.md +93 -0
- package/docs/components/steps.md +56 -0
- package/docs/components/summary.md +49 -0
- package/docs/components/table.md +42 -0
- package/docs/components/tooltip.md +53 -0
- package/docs/helper-javascript.md +71 -3
- package/docs/layout/body.md +41 -0
- package/docs/layout/flex.md +116 -0
- package/docs/layout/footer.md +71 -0
- package/docs/layout/grid.md +116 -0
- package/docs/layout/header.md +116 -0
- package/docs/layout/pageShell.md +94 -0
- package/docs/layout/section.md +69 -0
- package/docs/patterns/cookieConsent.md +89 -0
- package/package.json +2 -1
- package/scripts/generate-component-docs.js +557 -0
- package/templates/html/components/accordion.html +33 -4
- package/templates/html/components/badges.html +23 -0
- package/templates/html/components/breadcumbs.html +14 -0
- package/templates/html/components/button.html +22 -0
- package/templates/html/components/card.html +20 -0
- package/templates/html/components/dropdown.html +34 -0
- package/templates/html/components/form.html +82 -4
- package/templates/html/components/logo.html +22 -1
- package/templates/html/components/menu.html +40 -1
- package/templates/html/components/modal.html +44 -0
- package/templates/html/components/notification.html +68 -32
- package/templates/html/components/search.html +107 -0
- package/templates/html/components/slides.html +43 -0
- package/templates/html/components/stepTabs.html +47 -0
- package/templates/html/components/steps.html +24 -0
- package/templates/html/components/summary.html +27 -0
- package/templates/html/components/table.html +12 -0
- package/templates/html/components/tooltip.html +35 -0
- package/templates/html/layout/body.html +20 -5
- package/templates/html/layout/flex.html +20 -0
- package/templates/html/layout/footer.html +29 -1
- package/templates/html/layout/grid.html +20 -0
- package/templates/html/layout/header.html +52 -5
- package/templates/html/layout/pageShell.html +19 -0
- package/templates/html/layout/section.html +32 -10
- package/templates/html/patterns/cookieConsent.html +31 -0
- package/templates/react/components/form.jsx +3 -3
- package/templates/react/components/logo.jsx +1 -1
- package/templates/react/components/notification.jsx +4 -4
- package/templates/react/components/{searchbar.jsx → search.jsx} +9 -7
- package/templates/react/patterns/footer.jsx +1 -1
- package/templates/react/patterns/header.jsx +16 -10
- package/assets/scss/components/_searchbar.scss +0 -70
- package/templates/html/components/searchbar.html +0 -29
- package/templates/html/demo.js +0 -137
- /package/{templates/html → demo}/demo.css +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -17,8 +17,12 @@ declare global {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
interface PgsOptionApi {
|
|
20
|
+
add(...values: PgsStateValue[]): PgsOptionApi;
|
|
21
|
+
remove(...values: PgsStateValue[]): PgsOptionApi;
|
|
22
|
+
toggle(value: string, force?: boolean): boolean;
|
|
20
23
|
contains(key: string): boolean;
|
|
21
24
|
getValueBrackets(key: string): string | undefined;
|
|
25
|
+
setValueBrackets(key: string, value?: string): PgsOptionApi;
|
|
22
26
|
value: string | null;
|
|
23
27
|
}
|
|
24
28
|
|
|
@@ -39,6 +43,71 @@ declare global {
|
|
|
39
43
|
|
|
40
44
|
type PgsApi = PgsElementApi | PgsDocumentApi;
|
|
41
45
|
|
|
46
|
+
type PgsSearchSuggestionInput = string | number | {
|
|
47
|
+
label?: string;
|
|
48
|
+
value?: string | number;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
data?: unknown;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
interface PgsSearchSuggestion {
|
|
54
|
+
label: string;
|
|
55
|
+
value: string;
|
|
56
|
+
disabled: boolean;
|
|
57
|
+
data: unknown;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface PgsSearchSourceContext {
|
|
61
|
+
query: string;
|
|
62
|
+
signal: AbortSignal;
|
|
63
|
+
limit: number;
|
|
64
|
+
element: Element;
|
|
65
|
+
input: HTMLInputElement;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
interface PgsSearchSelectDetail {
|
|
69
|
+
item: PgsSearchSuggestion;
|
|
70
|
+
index: number;
|
|
71
|
+
value: string;
|
|
72
|
+
input: HTMLInputElement;
|
|
73
|
+
element: Element;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
interface PgsSearchOptions {
|
|
77
|
+
minLength: number;
|
|
78
|
+
debounce: number;
|
|
79
|
+
limit: number;
|
|
80
|
+
submitOnSelect: boolean;
|
|
81
|
+
searchOnFocus: boolean;
|
|
82
|
+
source: PgsSearchSuggestionInput[] | ((context: PgsSearchSourceContext) => PgsSearchSuggestionInput[] | Promise<PgsSearchSuggestionInput[]>) | null;
|
|
83
|
+
onSelect: ((detail: PgsSearchSelectDetail) => void) | null;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
interface PgsSearchInstance {
|
|
87
|
+
element: Element;
|
|
88
|
+
input: HTMLInputElement;
|
|
89
|
+
list: Element;
|
|
90
|
+
configure(options: Partial<PgsSearchOptions>): PgsSearchInstance;
|
|
91
|
+
setSource(source: PgsSearchOptions["source"]): PgsSearchInstance;
|
|
92
|
+
search(query?: string): Promise<PgsSearchSuggestion[]>;
|
|
93
|
+
open(): void;
|
|
94
|
+
close(): void;
|
|
95
|
+
clear(): void;
|
|
96
|
+
cancel(): void;
|
|
97
|
+
select(index?: number, submit?: boolean): PgsSearchSuggestion | null;
|
|
98
|
+
refresh(): Promise<PgsSearchSuggestion[]>;
|
|
99
|
+
destroy(): void;
|
|
100
|
+
items(): PgsSearchSuggestion[];
|
|
101
|
+
isOpen(): boolean;
|
|
102
|
+
isLoading(): boolean;
|
|
103
|
+
setActiveIndex(index: number): void;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
interface PgsSearchModule {
|
|
107
|
+
init(root?: Document | Element): void;
|
|
108
|
+
api(selector: Element): PgsSearchInstance | undefined;
|
|
109
|
+
}
|
|
110
|
+
|
|
42
111
|
interface PgsFunction {
|
|
43
112
|
(root: Document): PgsDocumentApi;
|
|
44
113
|
(root: Element): PgsElementApi;
|
|
@@ -51,6 +120,7 @@ declare global {
|
|
|
51
120
|
menu?: any;
|
|
52
121
|
modal?: any;
|
|
53
122
|
notification?: any;
|
|
123
|
+
search?: PgsSearchModule;
|
|
54
124
|
slides?: any;
|
|
55
125
|
stepTabs?: any;
|
|
56
126
|
steps?: any;
|