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 9
9
useId ,
10
10
useStylesScoped$ ,
11
11
} from '@builder.io/qwik' ;
12
- import { useOrdinal } from '@qwik-ui/ utils' ;
12
+ import { useOrdinal } from '../../ utils/use-ordinal ' ;
13
13
14
14
import stylesButtons from './styles/buttons.css?inline' ;
15
15
import stylesControl from './styles/control.css?inline' ;
Original file line number Diff line number Diff line change 9
9
useSignal ,
10
10
useVisibleTask$ ,
11
11
} from '@builder.io/qwik' ;
12
- import { OmitSignalClass } from '@qwik-ui/utils' ;
13
12
14
13
export const getPercentage = ( value : number , min = 0 , max = 100 ) => {
15
14
return ( ( value - min ) * 100 ) / ( max - min ) ;
@@ -25,7 +24,7 @@ interface SliderContextService {
25
24
26
25
export const sliderContext = createContextId < SliderContextService > ( 'slider' ) ;
27
26
28
- export type SliderProps = OmitSignalClass < QwikIntrinsicElements [ 'div' ] > & {
27
+ export type SliderProps = QwikIntrinsicElements [ 'div' ] & {
29
28
value : number ;
30
29
min : number ;
31
30
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