Skip to content

Commit 826df24

Browse files
committed
feat: Update demo app with v2.0 features
- Add 24 new v2.0 props to metadata (virtual scroll, validation, tooltips, etc.) - Add 10 new v2.0 example configurations - Update PropDefinition type to include 'v2-features' category - Add @angular/cdk dependency to demo package - Update home page with v2.0 features list - Add v2.0 code examples to docs page (virtual scroll, validation, custom templates, etc.) - Add new v2.0 events (copy, paste, scrollEnd) to docs - Increase component style budget to accommodate new v2.0 styles - Update install command to include @angular/cdk
1 parent 3a88283 commit 826df24

8 files changed

Lines changed: 390 additions & 27 deletions

File tree

demo/angular.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@
3232
},
3333
{
3434
"type": "anyComponentStyle",
35-
"maximumWarning": "5kB",
36-
"maximumError": "15kB"
35+
"maximumWarning": "10kB",
36+
"maximumError": "20kB"
3737
}
3838
],
3939
"outputHashing": "all"

demo/package-lock.json

Lines changed: 16 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

demo/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
"private": true,
1313
"dependencies": {
1414
"@angular/animations": "^20.0.0",
15+
"@angular/cdk": "^20.0.0",
1516
"@angular/common": "^20.0.0",
1617
"@angular/compiler": "^20.0.0",
1718
"@angular/core": "^20.0.0",

demo/src/app/data/select-examples.ts

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,104 @@ export const SELECT_EXAMPLES: Example[] = [
180180
debounceTime: 500,
181181
placeholder: 'Search with debounce...'
182182
}
183+
},
184+
{
185+
name: 'Virtual Scrolling',
186+
description: 'Handle 10,000+ options efficiently (v2.0.0)',
187+
props: {
188+
enableVirtualScroll: true,
189+
virtualScrollItemSize: 40,
190+
placeholder: 'Virtual scroll enabled...'
191+
}
192+
},
193+
{
194+
name: 'Validation Error',
195+
description: 'Show error validation state (v2.0.0)',
196+
props: {
197+
validationState: 'error',
198+
validationMessage: 'Please select a valid country',
199+
placeholder: 'Select a country...'
200+
}
201+
},
202+
{
203+
name: 'Validation Success',
204+
description: 'Show success validation state (v2.0.0)',
205+
props: {
206+
validationState: 'success',
207+
validationMessage: 'Selection verified successfully',
208+
placeholder: 'Select a country...'
209+
}
210+
},
211+
{
212+
name: 'Recent Selections',
213+
description: 'Show recently selected items at top (v2.0.0)',
214+
props: {
215+
showRecentSelections: true,
216+
recentSelectionsLimit: 5,
217+
recentSelectionsLabel: 'Recently Selected',
218+
placeholder: 'Select with recent history...'
219+
}
220+
},
221+
{
222+
name: 'Copy/Paste Multi-Select',
223+
description: 'Copy and paste comma-separated values (v2.0.0)',
224+
props: {
225+
isMulti: true,
226+
enableCopyPaste: true,
227+
copyDelimiter: ', ',
228+
placeholder: 'Try Ctrl+C and Ctrl+V...'
229+
}
230+
},
231+
{
232+
name: 'Advanced Keyboard',
233+
description: 'Home/End, Type-ahead, Ctrl+A (v2.0.0)',
234+
props: {
235+
isMulti: true,
236+
enableAdvancedKeyboard: true,
237+
typeAheadDelay: 500,
238+
placeholder: 'Try keyboard shortcuts...'
239+
}
240+
},
241+
{
242+
name: 'Multi-Select with Validation',
243+
description: 'Combine multi-select with validation (v2.0.0)',
244+
props: {
245+
isMulti: true,
246+
validationState: 'warning',
247+
validationMessage: 'Select at least 2 countries',
248+
placeholder: 'Select multiple...'
249+
}
250+
},
251+
{
252+
name: 'Purple Theme + Recent',
253+
description: 'Purple theme with recent selections (v2.0.0)',
254+
props: {
255+
theme: 'purple',
256+
showRecentSelections: true,
257+
enableRecentSelectionsPersistence: true,
258+
placeholder: 'Purple with recent...'
259+
}
260+
},
261+
{
262+
name: 'Large Size + Validation',
263+
description: 'Large size with success validation (v2.0.0)',
264+
props: {
265+
selectSize: 'large',
266+
containerSize: 'lg',
267+
validationState: 'success',
268+
validationMessage: 'Perfect choice!',
269+
placeholder: 'Large validated select...'
270+
}
271+
},
272+
{
273+
name: 'Green Multi + Copy/Paste',
274+
description: 'Green theme multi-select with copy/paste (v2.0.0)',
275+
props: {
276+
isMulti: true,
277+
theme: 'green',
278+
enableCopyPaste: true,
279+
enableAdvancedKeyboard: true,
280+
placeholder: 'Green multi with copy/paste...'
281+
}
183282
}
184283
];

demo/src/app/data/select-metadata.ts

Lines changed: 171 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ import { ComponentMetadata } from '../models/playground.types';
22

33
export const SELECT_METADATA: ComponentMetadata = {
44
id: 'select',
5-
name: 'Perfect Select',
5+
name: 'Perfect Select v2.0',
66
description:
7-
'A modern, feature-rich select component with react-select API compatibility, color themes, and enhanced animations',
7+
'A modern, feature-rich select component with react-select API compatibility, virtual scrolling, custom templates, validation states, and advanced features',
88
defaultProps: {
99
options: [
1010
{ id: 'sl', label: 'Sri Lanka', value: 'sl' },
@@ -190,6 +190,175 @@ export const SELECT_METADATA: ComponentMetadata = {
190190
defaultValue: 0,
191191
category: 'advanced'
192192
},
193+
// v2.0.0 Props - Virtual Scrolling (4)
194+
{
195+
name: 'enableVirtualScroll',
196+
type: 'boolean',
197+
control: { type: 'boolean' },
198+
description: 'Enable virtual scrolling for large datasets - v2.0.0',
199+
defaultValue: false,
200+
category: 'v2-features'
201+
},
202+
{
203+
name: 'virtualScrollItemSize',
204+
type: 'number',
205+
control: { type: 'number', min: 20, max: 100 },
206+
description: 'Item height in pixels for virtual scroll - v2.0.0',
207+
defaultValue: 40,
208+
category: 'v2-features'
209+
},
210+
{
211+
name: 'virtualScrollMinBufferPx',
212+
type: 'number',
213+
control: { type: 'number', min: 0 },
214+
description: 'Minimum buffer in pixels for virtual scroll - v2.0.0',
215+
defaultValue: 200,
216+
category: 'v2-features'
217+
},
218+
{
219+
name: 'virtualScrollMaxBufferPx',
220+
type: 'number',
221+
control: { type: 'number', min: 0 },
222+
description: 'Maximum buffer in pixels for virtual scroll - v2.0.0',
223+
defaultValue: 400,
224+
category: 'v2-features'
225+
},
226+
// v2.0.0 Props - Validation (3)
227+
{
228+
name: 'validationState',
229+
type: 'string',
230+
control: {
231+
type: 'select',
232+
options: ['default', 'error', 'warning', 'success', 'info']
233+
},
234+
description: 'Validation state for visual feedback - v2.0.0',
235+
defaultValue: 'default',
236+
category: 'v2-features'
237+
},
238+
{
239+
name: 'validationMessage',
240+
type: 'string',
241+
control: { type: 'text' },
242+
description: 'Validation message to display - v2.0.0',
243+
defaultValue: '',
244+
category: 'v2-features'
245+
},
246+
{
247+
name: 'showValidationIcon',
248+
type: 'boolean',
249+
control: { type: 'boolean' },
250+
description: 'Show icon in validation message - v2.0.0',
251+
defaultValue: true,
252+
category: 'v2-features'
253+
},
254+
// v2.0.0 Props - Tooltips (2)
255+
{
256+
name: 'showTooltips',
257+
type: 'boolean',
258+
control: { type: 'boolean' },
259+
description: 'Enable tooltips on options - v2.0.0',
260+
defaultValue: false,
261+
category: 'v2-features'
262+
},
263+
{
264+
name: 'tooltipDelay',
265+
type: 'number',
266+
control: { type: 'number', min: 0, step: 100 },
267+
description: 'Tooltip hover delay in milliseconds - v2.0.0',
268+
defaultValue: 300,
269+
category: 'v2-features'
270+
},
271+
// v2.0.0 Props - Recent Selections (4)
272+
{
273+
name: 'showRecentSelections',
274+
type: 'boolean',
275+
control: { type: 'boolean' },
276+
description: 'Show recently selected items at top - v2.0.0',
277+
defaultValue: false,
278+
category: 'v2-features'
279+
},
280+
{
281+
name: 'recentSelectionsLimit',
282+
type: 'number',
283+
control: { type: 'number', min: 1, max: 20 },
284+
description: 'Maximum number of recent items - v2.0.0',
285+
defaultValue: 5,
286+
category: 'v2-features'
287+
},
288+
{
289+
name: 'recentSelectionsLabel',
290+
type: 'string',
291+
control: { type: 'text' },
292+
description: 'Label for recent selections section - v2.0.0',
293+
defaultValue: 'Recent',
294+
category: 'v2-features'
295+
},
296+
{
297+
name: 'enableRecentSelectionsPersistence',
298+
type: 'boolean',
299+
control: { type: 'boolean' },
300+
description: 'Persist recent selections in localStorage - v2.0.0',
301+
defaultValue: false,
302+
category: 'v2-features'
303+
},
304+
// v2.0.0 Props - Infinite Scroll (3)
305+
{
306+
name: 'enableInfiniteScroll',
307+
type: 'boolean',
308+
control: { type: 'boolean' },
309+
description: 'Enable infinite scroll for pagination - v2.0.0',
310+
defaultValue: false,
311+
category: 'v2-features'
312+
},
313+
{
314+
name: 'infiniteScrollThreshold',
315+
type: 'number',
316+
control: { type: 'number', min: 0, max: 100 },
317+
description: 'Scroll percentage to trigger load (%) - v2.0.0',
318+
defaultValue: 80,
319+
category: 'v2-features'
320+
},
321+
{
322+
name: 'totalOptionsCount',
323+
type: 'number',
324+
control: { type: 'number', min: 0 },
325+
description: 'Total options count for pagination - v2.0.0',
326+
defaultValue: null,
327+
category: 'v2-features'
328+
},
329+
// v2.0.0 Props - Advanced Keyboard (4)
330+
{
331+
name: 'enableAdvancedKeyboard',
332+
type: 'boolean',
333+
control: { type: 'boolean' },
334+
description: 'Enable advanced keyboard shortcuts - v2.0.0',
335+
defaultValue: true,
336+
category: 'v2-features'
337+
},
338+
{
339+
name: 'typeAheadDelay',
340+
type: 'number',
341+
control: { type: 'number', min: 0, step: 100 },
342+
description: 'Type-ahead buffer timeout (ms) - v2.0.0',
343+
defaultValue: 500,
344+
category: 'v2-features'
345+
},
346+
{
347+
name: 'enableCopyPaste',
348+
type: 'boolean',
349+
control: { type: 'boolean' },
350+
description: 'Enable copy/paste functionality - v2.0.0',
351+
defaultValue: true,
352+
category: 'v2-features'
353+
},
354+
{
355+
name: 'copyDelimiter',
356+
type: 'string',
357+
control: { type: 'text' },
358+
description: 'Delimiter for copying values - v2.0.0',
359+
defaultValue: ', ',
360+
category: 'v2-features'
361+
},
193362
// Behavior Props (4)
194363
{
195364
name: 'closeMenuOnSelect',

demo/src/app/models/playground.types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export interface PropDefinition {
1515
control: ControlConfig;
1616
description: string;
1717
defaultValue?: any;
18-
category?: 'basic' | 'advanced' | 'styling' | 'async' | 'behavior';
18+
category?: 'basic' | 'advanced' | 'styling' | 'async' | 'behavior' | 'v2-features';
1919
}
2020

2121
export interface Example {

0 commit comments

Comments
 (0)