@jumpgroup/jump-design-system 0.1.3 → 0.1.5
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/cjs/app-globals-3a1e7e63.js +7 -0
- package/dist/cjs/app-globals-3a1e7e63.js.map +1 -0
- package/dist/cjs/{index-168ed626.js → index-46644e39.js} +503 -152
- package/dist/cjs/index-46644e39.js.map +1 -0
- package/dist/cjs/jump-button.cjs.entry.js +35 -0
- package/dist/cjs/jump-button.cjs.entry.js.map +1 -0
- package/dist/cjs/jump-design-system.cjs.js +6 -4
- package/dist/cjs/jump-design-system.cjs.js.map +1 -1
- package/dist/cjs/{app-icon.cjs.entry.js → jump-icon.cjs.entry.js} +22 -33
- package/dist/cjs/jump-icon.cjs.entry.js.map +1 -0
- package/dist/cjs/jump-pagination.cjs.entry.js +35 -0
- package/dist/cjs/jump-pagination.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -4
- package/dist/cjs/loader.cjs.js.map +1 -1
- package/dist/collection/collection-manifest.json +5 -4
- package/dist/collection/components/app-icon/{app-icon.css → jump-icon.css} +2 -2
- package/dist/collection/components/app-icon/jump-icon.js +64 -0
- package/dist/collection/components/app-icon/jump-icon.js.map +1 -0
- package/dist/collection/components/app-icon/jump-icon.stories.js +25 -0
- package/dist/collection/components/app-icon/jump-icon.stories.js.map +1 -0
- package/dist/collection/components/app-icon/test/jump-icon.e2e.js +10 -0
- package/dist/collection/components/app-icon/test/jump-icon.e2e.js.map +1 -0
- package/dist/collection/components/app-icon/test/jump-icon.spec.js +18 -0
- package/dist/collection/components/app-icon/test/jump-icon.spec.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button.css +107 -0
- package/dist/collection/components/jump-button/jump-button.js +270 -0
- package/dist/collection/components/jump-button/jump-button.js.map +1 -0
- package/dist/collection/components/jump-button/jump-button.stories.js +344 -0
- package/dist/collection/components/jump-button/jump-button.stories.js.map +1 -0
- package/dist/collection/components/jump-button/test/jump-button.e2e.js +10 -0
- package/dist/collection/components/jump-button/test/jump-button.e2e.js.map +1 -0
- package/dist/collection/components/jump-button/test/jump-button.spec.js +18 -0
- package/dist/collection/components/jump-button/test/jump-button.spec.js.map +1 -0
- package/dist/collection/components/jump-pagination/jump-pagination.css +43 -0
- package/dist/collection/components/jump-pagination/jump-pagination.js +180 -0
- package/dist/collection/components/jump-pagination/jump-pagination.js.map +1 -0
- package/dist/collection/components/jump-pagination/jump-pagination.stories.js +116 -0
- package/dist/collection/components/jump-pagination/jump-pagination.stories.js.map +1 -0
- package/dist/collection/components/jump-pagination/test/jump-pagination.e2e.js +10 -0
- package/dist/collection/components/jump-pagination/test/jump-pagination.e2e.js.map +1 -0
- package/dist/collection/components/jump-pagination/test/jump-pagination.spec.js +18 -0
- package/dist/collection/components/jump-pagination/test/jump-pagination.spec.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -1
- package/dist/collection/utils/utils.js.map +1 -1
- package/dist/collection/utils/utils.spec.js +12 -12
- package/dist/collection/utils/utils.spec.js.map +1 -1
- package/dist/components/index.d.ts +6 -0
- package/dist/components/index.js +1 -1
- package/dist/components/{app-button.d.ts → jump-button.d.ts} +4 -4
- package/dist/components/jump-button.js +62 -0
- package/dist/components/jump-button.js.map +1 -0
- package/dist/components/{app-icon.d.ts → jump-icon.d.ts} +4 -4
- package/dist/components/jump-icon.js +8 -0
- package/dist/components/jump-icon.js.map +1 -0
- package/dist/components/{app-icon.js → jump-icon2.js} +39 -53
- package/dist/components/jump-icon2.js.map +1 -0
- package/dist/components/jump-pagination.d.ts +11 -0
- package/dist/components/jump-pagination.js +63 -0
- package/dist/components/jump-pagination.js.map +1 -0
- package/dist/esm/app-globals-0f993ce5.js +5 -0
- package/dist/esm/app-globals-0f993ce5.js.map +1 -0
- package/dist/esm/{index-330d1de1.js → index-b0176170.js} +503 -152
- package/dist/esm/index-b0176170.js.map +1 -0
- package/dist/esm/jump-button.entry.js +31 -0
- package/dist/esm/jump-button.entry.js.map +1 -0
- package/dist/esm/jump-design-system.js +7 -5
- package/dist/esm/jump-design-system.js.map +1 -1
- package/dist/esm/{app-icon.entry.js → jump-icon.entry.js} +22 -33
- package/dist/esm/jump-icon.entry.js.map +1 -0
- package/dist/esm/jump-pagination.entry.js +31 -0
- package/dist/esm/jump-pagination.entry.js.map +1 -0
- package/dist/esm/loader.js +7 -5
- package/dist/esm/loader.js.map +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js +1 -1
- package/dist/jump-design-system/jump-design-system.esm.js.map +1 -1
- package/dist/jump-design-system/p-0d2b55a8.entry.js +2 -0
- package/dist/jump-design-system/p-0d2b55a8.entry.js.map +1 -0
- package/dist/jump-design-system/{p-e8515cce.entry.js → p-3cbc3a68.entry.js} +3 -3
- package/dist/jump-design-system/p-3cbc3a68.entry.js.map +1 -0
- package/dist/jump-design-system/p-68bce598.js +3 -0
- package/dist/jump-design-system/p-68bce598.js.map +1 -0
- package/dist/jump-design-system/p-9e6ea006.entry.js +2 -0
- package/dist/jump-design-system/p-9e6ea006.entry.js.map +1 -0
- package/dist/jump-design-system/p-e1255160.js +2 -0
- package/dist/jump-design-system/p-e1255160.js.map +1 -0
- package/dist/jump-design-system-elements.json +92 -3
- package/dist/types/components/app-icon/jump-icon.d.ts +12 -0
- package/dist/types/components/app-icon/jump-icon.stories.d.ts +19 -0
- package/dist/types/components/jump-button/jump-button.d.ts +55 -0
- package/dist/types/components/jump-button/jump-button.stories.d.ts +157 -0
- package/dist/types/components/jump-pagination/jump-pagination.d.ts +26 -0
- package/dist/types/components/jump-pagination/jump-pagination.stories.d.ts +71 -0
- package/dist/types/components.d.ts +123 -22
- package/dist/types/stencil-public-runtime.d.ts +46 -5
- package/loader/index.d.ts +1 -1
- package/package.json +2 -2
- package/readme.md +33 -66
- package/dist/cjs/app-button.cjs.entry.js +0 -28
- package/dist/cjs/app-button.cjs.entry.js.map +0 -1
- package/dist/cjs/app-icon.cjs.entry.js.map +0 -1
- package/dist/cjs/index-168ed626.js.map +0 -1
- package/dist/collection/components/app-button/app-button.css +0 -107
- package/dist/collection/components/app-button/app-button.js +0 -157
- package/dist/collection/components/app-button/app-button.js.map +0 -1
- package/dist/collection/components/app-button/app-button.stories.js +0 -227
- package/dist/collection/components/app-button/app-button.stories.js.map +0 -1
- package/dist/collection/components/app-button/test/app-button.e2e.js +0 -10
- package/dist/collection/components/app-button/test/app-button.e2e.js.map +0 -1
- package/dist/collection/components/app-button/test/app-button.spec.js +0 -18
- package/dist/collection/components/app-button/test/app-button.spec.js.map +0 -1
- package/dist/collection/components/app-icon/app-icon.js +0 -64
- package/dist/collection/components/app-icon/app-icon.js.map +0 -1
- package/dist/collection/components/app-icon/app-icon.stories.js +0 -25
- package/dist/collection/components/app-icon/app-icon.stories.js.map +0 -1
- package/dist/collection/components/app-icon/test/app-icon.e2e.js +0 -10
- package/dist/collection/components/app-icon/test/app-icon.e2e.js.map +0 -1
- package/dist/collection/components/app-icon/test/app-icon.spec.js +0 -18
- package/dist/collection/components/app-icon/test/app-icon.spec.js.map +0 -1
- package/dist/components/app-button.js +0 -49
- package/dist/components/app-button.js.map +0 -1
- package/dist/components/app-icon.js.map +0 -1
- package/dist/esm/app-button.entry.js +0 -24
- package/dist/esm/app-button.entry.js.map +0 -1
- package/dist/esm/app-icon.entry.js.map +0 -1
- package/dist/esm/index-330d1de1.js.map +0 -1
- package/dist/jump-design-system/p-28b9ffd5.js +0 -3
- package/dist/jump-design-system/p-28b9ffd5.js.map +0 -1
- package/dist/jump-design-system/p-da4d9423.entry.js +0 -2
- package/dist/jump-design-system/p-da4d9423.entry.js.map +0 -1
- package/dist/jump-design-system/p-e8515cce.entry.js.map +0 -1
- package/dist/types/components/app-button/app-button.d.ts +0 -31
- package/dist/types/components/app-button/app-button.stories.d.ts +0 -95
- package/dist/types/components/app-icon/app-icon.d.ts +0 -12
- package/dist/types/components/app-icon/app-icon.stories.d.ts +0 -19
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import feather from "feather-icons";
|
|
2
|
+
export default {
|
|
3
|
+
title: 'Components/Atoms/Button',
|
|
4
|
+
tags: ['autodocs'],
|
|
5
|
+
argTypes: {
|
|
6
|
+
label: {
|
|
7
|
+
name: 'Etichetta',
|
|
8
|
+
description: 'Imposta il testo del bottone',
|
|
9
|
+
control: 'text'
|
|
10
|
+
},
|
|
11
|
+
variant: {
|
|
12
|
+
name: 'Variante',
|
|
13
|
+
description: 'Imposta la variante di colore del bottone',
|
|
14
|
+
control: 'select',
|
|
15
|
+
options: [
|
|
16
|
+
'primary',
|
|
17
|
+
'secondary'
|
|
18
|
+
],
|
|
19
|
+
},
|
|
20
|
+
outline: {
|
|
21
|
+
name: 'Outline',
|
|
22
|
+
description: 'Imposta se il bottone deve avere il solo bordo',
|
|
23
|
+
control: 'boolean'
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
name: 'Dimensione',
|
|
27
|
+
description: 'Imposta la dimensione del bottone',
|
|
28
|
+
control: 'select',
|
|
29
|
+
options: [
|
|
30
|
+
'small',
|
|
31
|
+
'medium',
|
|
32
|
+
'large'
|
|
33
|
+
],
|
|
34
|
+
labels: {
|
|
35
|
+
small: 'Piccolo',
|
|
36
|
+
medium: 'Medio',
|
|
37
|
+
large: 'Grande'
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
pill: {
|
|
41
|
+
name: 'Bordo a Pillola',
|
|
42
|
+
description: 'Imposta se il bottone deve avere il bordo completamente stondato a pillola',
|
|
43
|
+
control: 'boolean'
|
|
44
|
+
},
|
|
45
|
+
disabled: {
|
|
46
|
+
name: 'Disabilitato',
|
|
47
|
+
description: 'Imposta se il bottone deve essere disabilitato',
|
|
48
|
+
control: 'boolean'
|
|
49
|
+
},
|
|
50
|
+
text: {
|
|
51
|
+
name: 'Testo',
|
|
52
|
+
description: 'Imposta se il bottone essere solo testo, quindi senza bordo, sfondo e padding',
|
|
53
|
+
control: 'boolean'
|
|
54
|
+
},
|
|
55
|
+
showIcon: {
|
|
56
|
+
name: 'Mostra Icona',
|
|
57
|
+
description: 'Imposta se il bottone deve mostrare un\'icona',
|
|
58
|
+
control: 'boolean'
|
|
59
|
+
},
|
|
60
|
+
iconOnly: {
|
|
61
|
+
name: 'Mostra solo Icona',
|
|
62
|
+
description: 'Imposta se il bottone deve mostrare solo l\'icona',
|
|
63
|
+
control: 'boolean',
|
|
64
|
+
if: {
|
|
65
|
+
arg: 'showIcon',
|
|
66
|
+
eq: true
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
iconName: {
|
|
70
|
+
name: 'Nome Icona',
|
|
71
|
+
control: 'select',
|
|
72
|
+
options: Object.keys(feather.icons),
|
|
73
|
+
description: 'Seleziona il nome dell\'icona dal menu a tendina',
|
|
74
|
+
defaultValue: Object.keys(feather.icons)[0],
|
|
75
|
+
if: {
|
|
76
|
+
arg: 'showIcon',
|
|
77
|
+
eq: true
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
iconPosition: {
|
|
81
|
+
name: 'Posizione Icona',
|
|
82
|
+
description: 'Imposta la posizione dell\'icona',
|
|
83
|
+
defaultValue: 'left',
|
|
84
|
+
control: 'select',
|
|
85
|
+
options: [
|
|
86
|
+
'left',
|
|
87
|
+
'right'
|
|
88
|
+
],
|
|
89
|
+
if: {
|
|
90
|
+
arg: 'showIcon',
|
|
91
|
+
eq: true
|
|
92
|
+
},
|
|
93
|
+
labels: {
|
|
94
|
+
left: 'Sinistra',
|
|
95
|
+
right: 'Destra'
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
type: {
|
|
99
|
+
name: 'Tipo di bottone',
|
|
100
|
+
description: 'Imposta il tipo di bottone',
|
|
101
|
+
default: 'button',
|
|
102
|
+
control: 'select',
|
|
103
|
+
if: {
|
|
104
|
+
arg: 'anchor',
|
|
105
|
+
eq: false
|
|
106
|
+
},
|
|
107
|
+
options: [
|
|
108
|
+
'button',
|
|
109
|
+
'submit',
|
|
110
|
+
'reset'
|
|
111
|
+
],
|
|
112
|
+
labels: {
|
|
113
|
+
button: 'button',
|
|
114
|
+
submit: 'submit',
|
|
115
|
+
reset: 'reset',
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
name: {
|
|
119
|
+
name: 'Nome del bottone',
|
|
120
|
+
description: 'Imposta il nome del bottone',
|
|
121
|
+
control: 'text',
|
|
122
|
+
if: {
|
|
123
|
+
arg: 'href',
|
|
124
|
+
exists: false
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
value: {
|
|
128
|
+
name: 'Value del bottone',
|
|
129
|
+
description: 'Imposta il value del bottone',
|
|
130
|
+
control: 'text',
|
|
131
|
+
if: {
|
|
132
|
+
arg: 'href',
|
|
133
|
+
exists: false
|
|
134
|
+
}
|
|
135
|
+
},
|
|
136
|
+
ariaLabel: {
|
|
137
|
+
name: 'Aria Label',
|
|
138
|
+
description: 'Imposta aria label',
|
|
139
|
+
control: 'text',
|
|
140
|
+
},
|
|
141
|
+
href: {
|
|
142
|
+
name: 'Href',
|
|
143
|
+
description: 'Imposta l\'href del link',
|
|
144
|
+
control: 'text',
|
|
145
|
+
},
|
|
146
|
+
target: {
|
|
147
|
+
name: 'Target',
|
|
148
|
+
description: 'Imposta il target del link',
|
|
149
|
+
default: '_self',
|
|
150
|
+
control: 'select',
|
|
151
|
+
if: {
|
|
152
|
+
arg: 'href',
|
|
153
|
+
exists: true
|
|
154
|
+
},
|
|
155
|
+
options: [
|
|
156
|
+
'_blank',
|
|
157
|
+
'_parent',
|
|
158
|
+
'_self',
|
|
159
|
+
'_top'
|
|
160
|
+
],
|
|
161
|
+
labels: {
|
|
162
|
+
_blank: '_blank',
|
|
163
|
+
_parent: '_parent',
|
|
164
|
+
_self: '_self',
|
|
165
|
+
_top: '_top'
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
}
|
|
169
|
+
};
|
|
170
|
+
// regular expression to remove all the spaces indenting the template string
|
|
171
|
+
// const AnchorTemplate = (args) =>
|
|
172
|
+
// `${ `<jump-button variant="${args.variant}" size="${args.size}" href="${args.href}" target="${args.target}" ariaLabel="${args.ariaLabel}" ${args.pill == true ? ' pill' : ''} ${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}${ !args.label || args.iconOnly ? ' only-icon' : ''}>${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}${ !args.iconOnly ? args.label : ''}${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
|
|
173
|
+
// </jump-button>`.replace(/\s\s+/g, '')
|
|
174
|
+
// }`;
|
|
175
|
+
const Template = (args) => `${args.href ?
|
|
176
|
+
`<jump-button
|
|
177
|
+
variant="${args.variant}"
|
|
178
|
+
size="${args.size}"
|
|
179
|
+
href="${args.href}"
|
|
180
|
+
target="${args.target}"
|
|
181
|
+
ariaLabel="${args.ariaLabel}"
|
|
182
|
+
${args.pill == true ? ' pill' : ''}
|
|
183
|
+
${args.outline == true ? ' outline' : ''}
|
|
184
|
+
${args.text == true ? ' text' : ''}
|
|
185
|
+
${!args.label || args.iconOnly ? ' only-icon' : ''}>
|
|
186
|
+
${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}
|
|
187
|
+
${!args.iconOnly ? args.label : ''}
|
|
188
|
+
${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
|
|
189
|
+
</jump-button>`
|
|
190
|
+
:
|
|
191
|
+
!args.label && !args.showIcon ? 'Errore nella configurazione del bottone' :
|
|
192
|
+
`<jump-button
|
|
193
|
+
variant="${args.variant}"
|
|
194
|
+
size="${args.size}"
|
|
195
|
+
type="${args.type}"
|
|
196
|
+
ariaLabel="${args.ariaLabel}"
|
|
197
|
+
name="${args.name}"
|
|
198
|
+
value="${args.value}"
|
|
199
|
+
${args.disabled == true ? ' disabled' : ''}
|
|
200
|
+
${args.pill == true ? ' pill' : ''}
|
|
201
|
+
${args.outline == true ? ' outline' : ''}
|
|
202
|
+
${args.text == true ? ' text' : ''}
|
|
203
|
+
${!args.label || args.iconOnly ? ' only-icon' : ''}>
|
|
204
|
+
${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}
|
|
205
|
+
${!args.iconOnly ? args.label : ''}
|
|
206
|
+
${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
|
|
207
|
+
</jump-button>`}`;
|
|
208
|
+
// TODO: gestire la prop che è opzione: cmq se copio il codice e tolgo le props undefined dovrebbe andare tutto
|
|
209
|
+
export const Name = Template.bind({});
|
|
210
|
+
Name.args = {
|
|
211
|
+
label: 'Primary',
|
|
212
|
+
variant: 'primary',
|
|
213
|
+
outline: false,
|
|
214
|
+
pill: false,
|
|
215
|
+
size: 'medium',
|
|
216
|
+
disabled: false,
|
|
217
|
+
text: false,
|
|
218
|
+
showIcon: false,
|
|
219
|
+
iconOnly: false,
|
|
220
|
+
iconName: Object.keys(feather.icons)[0],
|
|
221
|
+
iconPosition: 'left',
|
|
222
|
+
name: 'sono un nome'
|
|
223
|
+
};
|
|
224
|
+
export const Primary = Template.bind({});
|
|
225
|
+
Primary.args = {
|
|
226
|
+
label: 'Primary',
|
|
227
|
+
variant: 'primary',
|
|
228
|
+
outline: false,
|
|
229
|
+
pill: false,
|
|
230
|
+
size: 'medium',
|
|
231
|
+
disabled: false,
|
|
232
|
+
text: false,
|
|
233
|
+
showIcon: false,
|
|
234
|
+
iconOnly: false,
|
|
235
|
+
iconName: Object.keys(feather.icons)[0],
|
|
236
|
+
iconPosition: 'left'
|
|
237
|
+
};
|
|
238
|
+
export const OutlinePrimary = Template.bind({});
|
|
239
|
+
OutlinePrimary.args = {
|
|
240
|
+
label: 'Outline Primary',
|
|
241
|
+
variant: 'primary',
|
|
242
|
+
outline: true,
|
|
243
|
+
pill: false,
|
|
244
|
+
size: 'medium',
|
|
245
|
+
disabled: false,
|
|
246
|
+
text: false,
|
|
247
|
+
showIcon: false,
|
|
248
|
+
iconOnly: false,
|
|
249
|
+
iconName: Object.keys(feather.icons)[0],
|
|
250
|
+
iconPosition: 'left'
|
|
251
|
+
};
|
|
252
|
+
export const PillPrimary = Template.bind({});
|
|
253
|
+
PillPrimary.args = {
|
|
254
|
+
label: 'Pill Primary',
|
|
255
|
+
variant: 'primary',
|
|
256
|
+
outline: false,
|
|
257
|
+
pill: true,
|
|
258
|
+
size: 'medium',
|
|
259
|
+
disabled: false,
|
|
260
|
+
text: false,
|
|
261
|
+
showIcon: false,
|
|
262
|
+
iconOnly: false,
|
|
263
|
+
iconName: Object.keys(feather.icons)[0],
|
|
264
|
+
iconPosition: 'left'
|
|
265
|
+
};
|
|
266
|
+
export const OutlinePillPrimary = Template.bind({});
|
|
267
|
+
OutlinePillPrimary.args = {
|
|
268
|
+
label: 'Pill Primary',
|
|
269
|
+
variant: 'primary',
|
|
270
|
+
outline: true,
|
|
271
|
+
pill: true,
|
|
272
|
+
size: 'medium',
|
|
273
|
+
disabled: false,
|
|
274
|
+
text: false,
|
|
275
|
+
showIcon: false,
|
|
276
|
+
iconOnly: false,
|
|
277
|
+
iconName: Object.keys(feather.icons)[0],
|
|
278
|
+
iconPosition: 'left'
|
|
279
|
+
};
|
|
280
|
+
export const Disabled = Template.bind({});
|
|
281
|
+
Disabled.args = {
|
|
282
|
+
label: 'Disabled',
|
|
283
|
+
variant: 'primary',
|
|
284
|
+
outline: false,
|
|
285
|
+
pill: false,
|
|
286
|
+
size: 'medium',
|
|
287
|
+
disabled: true,
|
|
288
|
+
text: false,
|
|
289
|
+
showIcon: false,
|
|
290
|
+
iconOnly: false,
|
|
291
|
+
iconName: Object.keys(feather.icons)[0],
|
|
292
|
+
iconPosition: 'left'
|
|
293
|
+
};
|
|
294
|
+
export const Text = Template.bind({});
|
|
295
|
+
Text.args = {
|
|
296
|
+
label: 'Text',
|
|
297
|
+
variant: 'secondary',
|
|
298
|
+
outline: false,
|
|
299
|
+
pill: false,
|
|
300
|
+
size: 'medium',
|
|
301
|
+
disabled: false,
|
|
302
|
+
text: true,
|
|
303
|
+
showIcon: false,
|
|
304
|
+
iconOnly: false,
|
|
305
|
+
iconName: Object.keys(feather.icons)[0],
|
|
306
|
+
iconPosition: 'left'
|
|
307
|
+
};
|
|
308
|
+
// const TemplateWithIcon = (args) => `<jump-button variant="${args.variant}" size="${args.size}"${args.disabled == true ? ' disabled' : ''}${args.pill == true ? ' pill' : ''}${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}>
|
|
309
|
+
// ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}
|
|
310
|
+
// ${args.label}
|
|
311
|
+
// ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
|
|
312
|
+
// </jump-button>`;
|
|
313
|
+
// export const WithIcon = TemplateWithIcon.bind({});
|
|
314
|
+
// WithIcon.args = {
|
|
315
|
+
// label: 'Primary',
|
|
316
|
+
// variant: 'primary',
|
|
317
|
+
// outline: false,
|
|
318
|
+
// pill: false,
|
|
319
|
+
// size: 'medium',
|
|
320
|
+
// disabled: false,
|
|
321
|
+
// text: false,
|
|
322
|
+
// showIcon: true,
|
|
323
|
+
// iconName: 'home',
|
|
324
|
+
// iconPosition: 'left'
|
|
325
|
+
// };
|
|
326
|
+
// const TemplateWithOnlyIcon = (args) => `<jump-button variant="${args.variant}" size="${args.size}"${args.disabled == true ? ' disabled' : ''}${args.pill == true ? ' pill' : ''}${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}${ !args.label ? ' only-icon' : ''}>
|
|
327
|
+
// ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot="prefix" name="${args.iconName}"></jump-icon>` : ''}
|
|
328
|
+
// ${args.label}
|
|
329
|
+
// ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot="suffix" name="${args.iconName}"></jump-icon>` : ''}
|
|
330
|
+
// </jump-button>`;
|
|
331
|
+
// export const WithOnlyIcon = TemplateWithOnlyIcon.bind({});
|
|
332
|
+
// WithOnlyIcon.args = {
|
|
333
|
+
// label: '',
|
|
334
|
+
// variant: 'primary',
|
|
335
|
+
// outline: false,
|
|
336
|
+
// pill: true,
|
|
337
|
+
// size: 'medium',
|
|
338
|
+
// disabled: false,
|
|
339
|
+
// text: false,
|
|
340
|
+
// showIcon: true,
|
|
341
|
+
// iconName: 'home',
|
|
342
|
+
// iconPosition: 'left',
|
|
343
|
+
// };
|
|
344
|
+
//# sourceMappingURL=jump-button.stories.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-button.stories.js","sourceRoot":"","sources":["../../../src/components/jump-button/jump-button.stories.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,eAAe;IACb,KAAK,EAAE,yBAAyB;IAChC,IAAI,EAAE,CAAC,UAAU,CAAC;IAClB,QAAQ,EAAE;QACR,KAAK,EAAE;YACL,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,8BAA8B;YAC3C,OAAO,EAAE,MAAM;SAChB;QACD,OAAO,EAAE;YACP,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,2CAA2C;YACxD,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE;gBACP,SAAS;gBACT,WAAW;aACZ;SACF;QACD,OAAO,EAAG;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gDAAgD;YAC7D,OAAO,EAAE,SAAS;SACnB;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,mCAAmC;YAChD,OAAO,EAAE,QAAQ;YACjB,OAAO,EAAE;gBACP,OAAO;gBACP,QAAQ;gBACR,OAAO;aACR;YACD,MAAM,EAAE;gBACN,KAAK,EAAE,SAAS;gBAChB,MAAM,EAAE,OAAO;gBACf,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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AACtC,IAAI,CAAC,IAAI,GAAG;IACV,KAAK,EAAE,MAAM;IACb,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,KAAK;IACd,IAAI,EAAE,KAAK;IACX,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE,IAAI;IACV,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,KAAK;IACf,QAAQ,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACvC,YAAY,EAAE,MAAM;CACrB,CAAC;AAEF,4PAA4P;AAC5P,2HAA2H;AAC3H,kBAAkB;AAClB,4HAA4H;AAC5H,mBAAmB;AACnB,qDAAqD;AACrD,oBAAoB;AACpB,sBAAsB;AACtB,wBAAwB;AACxB,oBAAoB;AACpB,iBAAiB;AACjB,oBAAoB;AACpB,qBAAqB;AACrB,iBAAiB;AACjB,oBAAoB;AACpB,sBAAsB;AACtB,yBAAyB;AACzB,KAAK;AAEL,mSAAmS;AACnS,2HAA2H;AAC3H,kBAAkB;AAClB,4HAA4H;AAC5H,mBAAmB;AACnB,6DAA6D;AAC7D,wBAAwB;AACxB,eAAe;AACf,wBAAwB;AACxB,oBAAoB;AACpB,gBAAgB;AAChB,oBAAoB;AACpB,qBAAqB;AACrB,iBAAiB;AACjB,oBAAoB;AACpB,sBAAsB;AACtB,0BAA0B;AAC1B,KAAK","sourcesContent":["import feather from 'feather-icons';\n\nexport default {\n title: 'Components/Atoms/Button',\n tags: ['autodocs'],\n argTypes: {\n label: {\n name: 'Etichetta',\n description: 'Imposta il testo del bottone',\n control: 'text'\n },\n variant: {\n name: 'Variante',\n description: 'Imposta la variante di colore del bottone',\n control: 'select',\n options: [\n 'primary',\n 'secondary'\n ],\n },\n outline : {\n name: 'Outline',\n description: 'Imposta se il bottone deve avere il solo bordo',\n control: 'boolean'\n },\n size: {\n name: 'Dimensione',\n description: 'Imposta la dimensione del bottone',\n control: 'select',\n options: [\n 'small',\n 'medium',\n 'large'\n ],\n labels: {\n small: 'Piccolo',\n medium: 'Medio',\n large: 'Grande'\n }\n },\n pill: {\n name: 'Bordo a Pillola',\n description: 'Imposta se il bottone deve avere il bordo completamente stondato a pillola',\n control: 'boolean'\n },\n disabled: {\n name: 'Disabilitato',\n description: 'Imposta se il bottone deve essere disabilitato',\n control: 'boolean'\n },\n text: {\n name: 'Testo',\n description: 'Imposta se il bottone essere solo testo, quindi senza bordo, sfondo e padding',\n control: 'boolean'\n },\n showIcon: {\n name: 'Mostra Icona',\n description: 'Imposta se il bottone deve mostrare un\\'icona',\n control: 'boolean'\n },\n iconOnly: {\n name: 'Mostra solo Icona',\n description: 'Imposta se il bottone deve mostrare solo l\\'icona',\n control: 'boolean',\n if: {\n arg: 'showIcon',\n eq: true\n },\n },\n iconName: {\n name: 'Nome Icona',\n control: 'select',\n options: Object.keys(feather.icons),\n description: 'Seleziona il nome dell\\'icona dal menu a tendina',\n defaultValue: Object.keys(feather.icons)[0],\n if: {\n arg: 'showIcon',\n eq: true\n },\n },\n iconPosition: {\n name: 'Posizione Icona',\n description: 'Imposta la posizione dell\\'icona',\n defaultValue: 'left',\n control: 'select',\n options: [\n 'left',\n 'right'\n ],\n if: {\n arg: 'showIcon',\n eq: true\n },\n labels: {\n left: 'Sinistra',\n right: 'Destra'\n }\n },\n type: {\n name: 'Tipo di bottone',\n description: 'Imposta il tipo di bottone',\n default: 'button',\n control: 'select',\n if:{\n arg: 'anchor',\n eq: false\n },\n options: [\n 'button',\n 'submit',\n 'reset'\n ],\n labels: {\n button: 'button',\n submit: 'submit',\n reset: 'reset',\n }\n },\n name: {\n name: 'Nome del bottone',\n description: 'Imposta il nome del bottone',\n control: 'text',\n if:{\n arg: 'href',\n exists: false\n }\n },\n value: {\n name: 'Value del bottone',\n description: 'Imposta il value del bottone',\n control: 'text',\n if:{\n arg: 'href',\n exists: false\n }\n },\n ariaLabel: {\n name: 'Aria Label',\n description: 'Imposta aria label',\n control: 'text',\n },\n href: {\n name: 'Href',\n description: 'Imposta l\\'href del link',\n control: 'text',\n },\n target: {\n name: 'Target',\n description: 'Imposta il target del link',\n default: '_self',\n control: 'select',\n if:{\n arg: 'href',\n exists: true\n },\n options: [\n '_blank',\n '_parent',\n '_self',\n '_top'\n ],\n labels: {\n _blank: '_blank',\n _parent: '_parent',\n _self: '_self',\n _top: '_top'\n }\n },\n\n }\n};\n\n// regular expression to remove all the spaces indenting the template string\n\n\n// const AnchorTemplate = (args) => \n// `${ `<jump-button variant=\"${args.variant}\" size=\"${args.size}\" href=\"${args.href}\" target=\"${args.target}\" ariaLabel=\"${args.ariaLabel}\" ${args.pill == true ? ' pill' : ''} ${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}${ !args.label || args.iconOnly ? ' only-icon' : ''}>${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''}${ !args.iconOnly ? args.label : ''}${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n// </jump-button>`.replace(/\\s\\s+/g, '')\n// }`;\n\nconst Template = (args) => \n`${ \n args.href ? \n `<jump-button\n variant=\"${args.variant}\" \n size=\"${args.size}\" \n href=\"${args.href}\" \n target=\"${args.target}\" \n ariaLabel=\"${args.ariaLabel}\" \n ${args.pill == true ? ' pill' : ''} \n ${args.outline == true ? ' outline' : ''}\n ${args.text == true ? ' text' : ''}\n ${ !args.label || args.iconOnly ? ' only-icon' : ''}>\n ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n ${ !args.iconOnly ? args.label : ''}\n ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n </jump-button>`\n :\n !args.label && !args.showIcon ? 'Errore nella configurazione del bottone' : \n `<jump-button \n variant=\"${args.variant}\" \n size=\"${args.size}\" \n type=\"${args.type}\" \n ariaLabel=\"${args.ariaLabel}\" \n name=\"${args.name}\" \n value=\"${args.value}\" \n ${args.disabled == true ? ' disabled' : ''} \n ${args.pill == true ? ' pill' : ''} \n ${args.outline == true ? ' outline' : ''}\n ${args.text == true ? ' text' : ''} \n ${ !args.label || args.iconOnly ? ' only-icon' : ''}>\n ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n ${ !args.iconOnly ? args.label : ''}\n ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n </jump-button>`\n}`;\n\n// TODO: gestire la prop che è opzione: cmq se copio il codice e tolgo le props undefined dovrebbe andare tutto\n\nexport const Name = Template.bind({});\nName.args = {\n label: 'Primary',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left',\n name: 'sono un nome'\n};\n\nexport const Primary = Template.bind({});\nPrimary.args = {\n label: 'Primary',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\nexport const OutlinePrimary = Template.bind({});\nOutlinePrimary.args = {\n label: 'Outline Primary',\n variant: 'primary',\n outline: true,\n pill: false,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\nexport const PillPrimary = Template.bind({});\nPillPrimary.args = {\n label: 'Pill Primary',\n variant: 'primary',\n outline: false,\n pill: true,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\nexport const OutlinePillPrimary = Template.bind({});\nOutlinePillPrimary.args = {\n label: 'Pill Primary',\n variant: 'primary',\n outline: true,\n pill: true,\n size: 'medium',\n disabled: false,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\nexport const Disabled = Template.bind({});\nDisabled.args = {\n label: 'Disabled',\n variant: 'primary',\n outline: false,\n pill: false,\n size: 'medium',\n disabled: true,\n text: false,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\nexport const Text = Template.bind({});\nText.args = {\n label: 'Text',\n variant: 'secondary',\n outline: false,\n pill: false,\n size: 'medium',\n disabled: false,\n text: true,\n showIcon: false,\n iconOnly: false,\n iconName: Object.keys(feather.icons)[0],\n iconPosition: 'left'\n};\n\n// const TemplateWithIcon = (args) => `<jump-button variant=\"${args.variant}\" size=\"${args.size}\"${args.disabled == true ? ' disabled' : ''}${args.pill == true ? ' pill' : ''}${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}>\n// ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n// ${args.label}\n// ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n// </jump-button>`;\n// export const WithIcon = TemplateWithIcon.bind({});\n// WithIcon.args = {\n// label: 'Primary',\n// variant: 'primary',\n// outline: false,\n// pill: false,\n// size: 'medium',\n// disabled: false,\n// text: false,\n// showIcon: true,\n// iconName: 'home',\n// iconPosition: 'left'\n// };\n\n// const TemplateWithOnlyIcon = (args) => `<jump-button variant=\"${args.variant}\" size=\"${args.size}\"${args.disabled == true ? ' disabled' : ''}${args.pill == true ? ' pill' : ''}${args.outline == true ? ' outline' : ''}${args.text == true ? ' text' : ''}${ !args.label ? ' only-icon' : ''}>\n// ${args.iconPosition == 'left' && args.showIcon ? `<jump-icon slot=\"prefix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n// ${args.label}\n// ${args.iconPosition == 'right' && args.showIcon ? `<jump-icon slot=\"suffix\" name=\"${args.iconName}\"></jump-icon>` : ''}\n// </jump-button>`;\n// export const WithOnlyIcon = TemplateWithOnlyIcon.bind({});\n// WithOnlyIcon.args = {\n// label: '',\n// variant: 'primary',\n// outline: false,\n// pill: true,\n// size: 'medium',\n// disabled: false,\n// text: false,\n// showIcon: true,\n// iconName: 'home',\n// iconPosition: 'left',\n// };\n"]}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { newE2EPage } from "@stencil/core/testing";
|
|
2
|
+
describe('jump-button', () => {
|
|
3
|
+
it('renders', async () => {
|
|
4
|
+
const page = await newE2EPage();
|
|
5
|
+
await page.setContent('<jump-button></jump-button>');
|
|
6
|
+
const element = await page.find('jump-button');
|
|
7
|
+
expect(element).toHaveClass('hydrated');
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
//# sourceMappingURL=jump-button.e2e.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-button.e2e.js","sourceRoot":"","sources":["../../../../src/components/jump-button/test/jump-button.e2e.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEnD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,UAAU,EAAE,CAAC;QAChC,MAAM,IAAI,CAAC,UAAU,CAAC,6BAA6B,CAAC,CAAC;QAErD,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;QAC/C,MAAM,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newE2EPage } from '@stencil/core/testing';\n\ndescribe('jump-button', () => {\n it('renders', async () => {\n const page = await newE2EPage();\n await page.setContent('<jump-button></jump-button>');\n\n const element = await page.find('jump-button');\n expect(element).toHaveClass('hydrated');\n });\n});\n"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { newSpecPage } from "@stencil/core/testing";
|
|
2
|
+
import { AppButton } from "../jump-button";
|
|
3
|
+
describe('jump-button', () => {
|
|
4
|
+
it('renders', async () => {
|
|
5
|
+
const page = await newSpecPage({
|
|
6
|
+
components: [AppButton],
|
|
7
|
+
html: `<jump-button></jump-button>`,
|
|
8
|
+
});
|
|
9
|
+
expect(page.root).toEqualHtml(`
|
|
10
|
+
<jump-button>
|
|
11
|
+
<mock:shadow-root>
|
|
12
|
+
<slot></slot>
|
|
13
|
+
</mock:shadow-root>
|
|
14
|
+
</jump-button>
|
|
15
|
+
`);
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
//# sourceMappingURL=jump-button.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-button.spec.js","sourceRoot":"","sources":["../../../../src/components/jump-button/test/jump-button.spec.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IAC3B,EAAE,CAAC,SAAS,EAAE,KAAK,IAAI,EAAE;QACvB,MAAM,IAAI,GAAG,MAAM,WAAW,CAAC;YAC7B,UAAU,EAAE,CAAC,SAAS,CAAC;YACvB,IAAI,EAAE,6BAA6B;SACpC,CAAC,CAAC;QACH,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,WAAW,CAAC;;;;;;KAM7B,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { newSpecPage } from '@stencil/core/testing';\nimport { AppButton } from '../jump-button';\n\ndescribe('jump-button', () => {\n it('renders', async () => {\n const page = await newSpecPage({\n components: [AppButton],\n html: `<jump-button></jump-button>`,\n });\n expect(page.root).toEqualHtml(`\n <jump-button>\n <mock:shadow-root>\n <slot></slot>\n </mock:shadow-root>\n </jump-button>\n `);\n });\n});\n"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
:host {
|
|
2
|
+
display: block;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
.JumpPagination {
|
|
6
|
+
--pagination-label-color: var(--neutral-grey-secondary);
|
|
7
|
+
--pagination-arrows-color: var(--neutral-grey-secondary);
|
|
8
|
+
font-family: var(--ff-primary);
|
|
9
|
+
}
|
|
10
|
+
.JumpPagination__Wrapper {
|
|
11
|
+
display: flex;
|
|
12
|
+
justify-content: space-between;
|
|
13
|
+
}
|
|
14
|
+
.JumpPagination__Wrapper .elementsPerPage {
|
|
15
|
+
display: flex;
|
|
16
|
+
gap: 1rem;
|
|
17
|
+
align-items: center;
|
|
18
|
+
}
|
|
19
|
+
.JumpPagination__Wrapper .elementsPerPage label {
|
|
20
|
+
color: var(--pagination-label-color);
|
|
21
|
+
font-size: 14px;
|
|
22
|
+
font-weight: normal;
|
|
23
|
+
}
|
|
24
|
+
.JumpPagination__Wrapper .indicators {
|
|
25
|
+
font-size: 16px;
|
|
26
|
+
font-weight: normal;
|
|
27
|
+
display: flex;
|
|
28
|
+
justify-content: space-between;
|
|
29
|
+
gap: 20px;
|
|
30
|
+
color: var(--pagination-label-color);
|
|
31
|
+
}
|
|
32
|
+
.JumpPagination__Wrapper .indicators .arrow {
|
|
33
|
+
color: var(--pagination-arrows-color);
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
gap: 10px;
|
|
37
|
+
}
|
|
38
|
+
.JumpPagination__Wrapper .indicators .elements {
|
|
39
|
+
color: var(--pagination-label-color);
|
|
40
|
+
display: flex;
|
|
41
|
+
align-items: center;
|
|
42
|
+
gap: 5px;
|
|
43
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { Host, h } from "@stencil/core";
|
|
2
|
+
export class JumpPagination {
|
|
3
|
+
constructor() {
|
|
4
|
+
this.totalElements = undefined;
|
|
5
|
+
this.currentPage = undefined;
|
|
6
|
+
this.lastPage = undefined;
|
|
7
|
+
this.labelElementsPerPage = 'Elementi per pagina';
|
|
8
|
+
this.elementsRanges = [10, 20, 60, 100];
|
|
9
|
+
this.firstPage = undefined;
|
|
10
|
+
this.completeVersion = false;
|
|
11
|
+
this.showAdditionalChrevrons = false;
|
|
12
|
+
}
|
|
13
|
+
render() {
|
|
14
|
+
var _a;
|
|
15
|
+
return (h(Host, { key: 'eacb989c1eafddab001bce8a3e7618b42e281604', class: "JumpPagination" }, h("div", { key: '52ebe6a91e9cde9f4bdcbad4be0a7e16d0a3867f', class: "JumpPagination__Wrapper" }, this.completeVersion &&
|
|
16
|
+
h("div", { class: "elementsPerPage" }, h("label", { htmlFor: "elements" }, (_a = this.labelElementsPerPage) !== null && _a !== void 0 ? _a : 'Elements per page'), h("select", { name: "elements", id: "elements" }, this.elementsRanges.map((range) => (h("option", { value: range }, range))))), h("div", { key: '97a70fd1f86f644ee0199f0a6f1945988579705c', class: "indicators" }, h("div", { key: '9e9a1c2f541b3aaad78105a58f051127770b6e4d', class: "elements" }, this.completeVersion ?
|
|
17
|
+
h("span", null, h("span", null, this.firstPage), " - ", h("span", null, this.currentPage), " di ", h("span", null, this.totalElements))
|
|
18
|
+
:
|
|
19
|
+
h("span", null, h("span", null, this.currentPage), " di ", h("span", null, this.lastPage))), h("div", { key: 'e7fe2402c2c6a1906f9f3bfc70cfde428590c964', class: "arrow" }, this.showAdditionalChrevrons && h("jump-icon", { name: "chevrons-left" }), h("jump-icon", { key: 'dadb4d94ce1bf31219adfa554a47b33f19b9b3a7', name: "chevron-left" }), h("jump-icon", { key: '841030e266c11bda6d75800bbc61f7e0899fd1ae', name: "chevron-right" }), this.showAdditionalChrevrons && h("jump-icon", { name: "chevrons-right" }))))));
|
|
20
|
+
}
|
|
21
|
+
static get is() { return "jump-pagination"; }
|
|
22
|
+
static get originalStyleUrls() {
|
|
23
|
+
return {
|
|
24
|
+
"$": ["jump-pagination.scss"]
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
static get styleUrls() {
|
|
28
|
+
return {
|
|
29
|
+
"$": ["jump-pagination.css"]
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
static get properties() {
|
|
33
|
+
return {
|
|
34
|
+
"totalElements": {
|
|
35
|
+
"type": "number",
|
|
36
|
+
"mutable": false,
|
|
37
|
+
"complexType": {
|
|
38
|
+
"original": "number",
|
|
39
|
+
"resolved": "number",
|
|
40
|
+
"references": {}
|
|
41
|
+
},
|
|
42
|
+
"required": false,
|
|
43
|
+
"optional": false,
|
|
44
|
+
"docs": {
|
|
45
|
+
"tags": [],
|
|
46
|
+
"text": ""
|
|
47
|
+
},
|
|
48
|
+
"attribute": "total-elements",
|
|
49
|
+
"reflect": true
|
|
50
|
+
},
|
|
51
|
+
"currentPage": {
|
|
52
|
+
"type": "number",
|
|
53
|
+
"mutable": false,
|
|
54
|
+
"complexType": {
|
|
55
|
+
"original": "number",
|
|
56
|
+
"resolved": "number",
|
|
57
|
+
"references": {}
|
|
58
|
+
},
|
|
59
|
+
"required": false,
|
|
60
|
+
"optional": false,
|
|
61
|
+
"docs": {
|
|
62
|
+
"tags": [],
|
|
63
|
+
"text": ""
|
|
64
|
+
},
|
|
65
|
+
"attribute": "current-page",
|
|
66
|
+
"reflect": true
|
|
67
|
+
},
|
|
68
|
+
"lastPage": {
|
|
69
|
+
"type": "number",
|
|
70
|
+
"mutable": false,
|
|
71
|
+
"complexType": {
|
|
72
|
+
"original": "number",
|
|
73
|
+
"resolved": "number",
|
|
74
|
+
"references": {}
|
|
75
|
+
},
|
|
76
|
+
"required": false,
|
|
77
|
+
"optional": false,
|
|
78
|
+
"docs": {
|
|
79
|
+
"tags": [],
|
|
80
|
+
"text": ""
|
|
81
|
+
},
|
|
82
|
+
"attribute": "last-page",
|
|
83
|
+
"reflect": true
|
|
84
|
+
},
|
|
85
|
+
"labelElementsPerPage": {
|
|
86
|
+
"type": "string",
|
|
87
|
+
"mutable": false,
|
|
88
|
+
"complexType": {
|
|
89
|
+
"original": "string",
|
|
90
|
+
"resolved": "string",
|
|
91
|
+
"references": {}
|
|
92
|
+
},
|
|
93
|
+
"required": false,
|
|
94
|
+
"optional": false,
|
|
95
|
+
"docs": {
|
|
96
|
+
"tags": [],
|
|
97
|
+
"text": "Label for the elements per page select"
|
|
98
|
+
},
|
|
99
|
+
"attribute": "label-elements-per-page",
|
|
100
|
+
"reflect": true,
|
|
101
|
+
"defaultValue": "'Elementi per pagina'"
|
|
102
|
+
},
|
|
103
|
+
"elementsRanges": {
|
|
104
|
+
"type": "unknown",
|
|
105
|
+
"mutable": false,
|
|
106
|
+
"complexType": {
|
|
107
|
+
"original": "Array<number>",
|
|
108
|
+
"resolved": "number[]",
|
|
109
|
+
"references": {
|
|
110
|
+
"Array": {
|
|
111
|
+
"location": "global",
|
|
112
|
+
"id": "global::Array"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
116
|
+
"required": false,
|
|
117
|
+
"optional": false,
|
|
118
|
+
"docs": {
|
|
119
|
+
"tags": [],
|
|
120
|
+
"text": "Values for the elements per page select"
|
|
121
|
+
},
|
|
122
|
+
"defaultValue": "[10, 20, 60, 100]"
|
|
123
|
+
},
|
|
124
|
+
"firstPage": {
|
|
125
|
+
"type": "number",
|
|
126
|
+
"mutable": false,
|
|
127
|
+
"complexType": {
|
|
128
|
+
"original": "number",
|
|
129
|
+
"resolved": "number",
|
|
130
|
+
"references": {}
|
|
131
|
+
},
|
|
132
|
+
"required": false,
|
|
133
|
+
"optional": false,
|
|
134
|
+
"docs": {
|
|
135
|
+
"tags": [],
|
|
136
|
+
"text": "Indicates the first page/product of the list"
|
|
137
|
+
},
|
|
138
|
+
"attribute": "first-page",
|
|
139
|
+
"reflect": true
|
|
140
|
+
},
|
|
141
|
+
"completeVersion": {
|
|
142
|
+
"type": "boolean",
|
|
143
|
+
"mutable": false,
|
|
144
|
+
"complexType": {
|
|
145
|
+
"original": "boolean",
|
|
146
|
+
"resolved": "boolean",
|
|
147
|
+
"references": {}
|
|
148
|
+
},
|
|
149
|
+
"required": false,
|
|
150
|
+
"optional": false,
|
|
151
|
+
"docs": {
|
|
152
|
+
"tags": [],
|
|
153
|
+
"text": "If true, the component will show the complete version of the pagination, with elements informations"
|
|
154
|
+
},
|
|
155
|
+
"attribute": "complete-version",
|
|
156
|
+
"reflect": true,
|
|
157
|
+
"defaultValue": "false"
|
|
158
|
+
},
|
|
159
|
+
"showAdditionalChrevrons": {
|
|
160
|
+
"type": "boolean",
|
|
161
|
+
"mutable": false,
|
|
162
|
+
"complexType": {
|
|
163
|
+
"original": "boolean",
|
|
164
|
+
"resolved": "boolean",
|
|
165
|
+
"references": {}
|
|
166
|
+
},
|
|
167
|
+
"required": false,
|
|
168
|
+
"optional": false,
|
|
169
|
+
"docs": {
|
|
170
|
+
"tags": [],
|
|
171
|
+
"text": ""
|
|
172
|
+
},
|
|
173
|
+
"attribute": "show-additional-chrevrons",
|
|
174
|
+
"reflect": true,
|
|
175
|
+
"defaultValue": "false"
|
|
176
|
+
}
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=jump-pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"jump-pagination.js","sourceRoot":"","sources":["../../../src/components/jump-pagination/jump-pagination.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AAOzD,MAAM,OAAO,cAAc;;;;;oCAe+B,qBAAqB;8BAKpB,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC;;+BAUtB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAEF","sourcesContent":["import { Component, Host, Prop, h } from '@stencil/core';\n\n@Component({\n tag: 'jump-pagination',\n styleUrl: 'jump-pagination.scss',\n shadow: false,\n})\nexport class JumpPagination {\n \n /* ---------------------- @PROPERTIES ------------------------- */\n\n @Prop({ reflect: true }) totalElements: number;\n\n /**\n * \n */\n @Prop({ reflect: true }) currentPage: number;\n @Prop({ reflect: true }) lastPage: number; \n\n /**\n * Label for the elements per page select\n */\n @Prop({ reflect: true }) labelElementsPerPage: string = 'Elementi per pagina';\n\n /**\n * Values for the elements per page select\n */\n @Prop({ reflect: true }) elementsRanges: Array<number> = [10, 20, 60, 100];\n\n /**\n * Indicates the first page/product of the list\n */\n @Prop({ reflect: true }) firstPage: number;\n\n /**\n * If true, the component will show the complete version of the pagination, with elements informations\n */\n @Prop({ reflect: true }) completeVersion: boolean = false;\n\n @Prop({ reflect: true }) showAdditionalChrevrons: boolean = false;\n\n render() {\n return (\n <Host class=\"JumpPagination\">\n <div class=\"JumpPagination__Wrapper\">\n { this.completeVersion && \n <div class=\"elementsPerPage\">\n <label htmlFor=\"elements\">{this.labelElementsPerPage ?? 'Elements per page'}</label>\n <select name=\"elements\" id=\"elements\">\n {this.elementsRanges.map((range) => (\n <option value={range}>{range}</option>\n ))}\n </select>\n </div> \n }\n <div class=\"indicators\"> \n <div class=\"elements\">\n {this.completeVersion ?\n <span>\n <span>{this.firstPage}</span> - <span>{this.currentPage}</span> di <span>{this.totalElements}</span>\n </span>\n \n :\n <span>\n <span>{this.currentPage}</span> di <span>{this.lastPage}</span>\n </span>\n }\n </div>\n <div class=\"arrow\">\n {this.showAdditionalChrevrons && <jump-icon name=\"chevrons-left\"></jump-icon>}\n <jump-icon name=\"chevron-left\"></jump-icon>\n <jump-icon name=\"chevron-right\"></jump-icon>\n {this.showAdditionalChrevrons && <jump-icon name=\"chevrons-right\"></jump-icon>}\n </div> \n </div>\n </div>\n </Host>\n );\n }\n\n}\n"]}
|