File tree Expand file tree Collapse file tree 3 files changed +16
-3
lines changed
packages/kit-headless/src Expand file tree Collapse file tree 3 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 99 useId ,
1010 useStylesScoped$ ,
1111} from '@builder.io/qwik' ;
12- import { useOrdinal } from '@qwik-ui/ utils' ;
12+ import { useOrdinal } from '../../ utils/use-ordinal ' ;
1313
1414import stylesButtons from './styles/buttons.css?inline' ;
1515import stylesControl from './styles/control.css?inline' ;
Original file line number Diff line number Diff line change 99 useSignal ,
1010 useVisibleTask$ ,
1111} from '@builder.io/qwik' ;
12- import { OmitSignalClass } from '@qwik-ui/utils' ;
1312
1413export const getPercentage = ( value : number , min = 0 , max = 100 ) => {
1514 return ( ( value - min ) * 100 ) / ( max - min ) ;
@@ -25,7 +24,7 @@ interface SliderContextService {
2524
2625export const sliderContext = createContextId < SliderContextService > ( 'slider' ) ;
2726
28- export type SliderProps = OmitSignalClass < QwikIntrinsicElements [ 'div' ] > & {
27+ export type SliderProps = QwikIntrinsicElements [ 'div' ] & {
2928 value : number ;
3029 min : number ;
3130 max : number ;
Original file line number Diff line number Diff line change 1+ import { NoSerialize , noSerialize } from '@builder.io/qwik' ;
2+
3+ export const useOrdinal : ( ) => NoSerialize < ( n : number ) => string > = ( ) => {
4+ return noSerialize ( ( n ) => {
5+ const pr = new Intl . PluralRules ( 'en-GB' , { type : 'ordinal' } ) ;
6+ const suffixes = new Map ( [
7+ [ 'one' , 'st' ] ,
8+ [ 'two' , 'nd' ] ,
9+ [ 'few' , 'rd' ] ,
10+ [ 'other' , 'th' ] ,
11+ ] ) ;
12+ return `${ n } ${ suffixes . get ( pr . select ( n ) ) } ` ;
13+ } ) ;
14+ } ;
You can’t perform that action at this time.
0 commit comments