File tree Expand file tree Collapse file tree 9 files changed +2704
-2
lines changed Expand file tree Collapse file tree 9 files changed +2704
-2
lines changed Original file line number Diff line number Diff line change
1
+ # uui-pagination
2
+
3
+ ![ npm] ( https://img.shields.io/npm/v/@umbraco-ui/uui-pagination?logoColor=%231B264F )
4
+
5
+ Umbraco style pagination component.
6
+
7
+ ## Installation
8
+
9
+ ### ES imports
10
+
11
+ ``` zsh
12
+ npm i @umbraco-ui/uui-pagination
13
+ ```
14
+
15
+ Import the registration of ` <uui-pagination> ` via:
16
+
17
+ ``` javascript
18
+ import ' @umbraco-ui/uui-pagination/lib' ;
19
+ ```
20
+
21
+ When looking to leverage the ` UUIPaginationElement ` base class as a type and/or for extension purposes, do so via:
22
+
23
+ ``` javascript
24
+ import { UUIPaginationElement } from ' @umbraco-ui/uui-pagination/lib/uui-pagination.element' ;
25
+ ```
26
+
27
+ ### CDN
28
+
29
+ The component is available via CDN. This means it can be added to your application without the need of any bundler configuration. Here is how to use it with jsDelivr.
30
+
31
+ ``` html
32
+ <!-- Latest Version -->
33
+ <script src =" https://cdn.jsdelivr.net/npm/@umbraco-ui/uui-pagination@latest/dist/uui-pagination.min.js" ></script >
34
+
35
+ <!-- Specific version -->
36
+ <
script src =
" https://cdn.jsdelivr.net/npm/@umbraco-ui/[email protected] /dist/uui-pagination.min.js" ></
script >
37
+ ```
38
+
39
+ ## Usage
40
+
41
+ ``` html
42
+ <uui-pagination ></uui-pagination >
43
+ ```
Original file line number Diff line number Diff line change
1
+ import { UUIPaginationElement } from './uui-pagination.element' ;
2
+ import { defineElement } from '@umbraco-ui/uui-base/lib/registration' ;
3
+
4
+ defineElement ( 'uui-pagination' , UUIPaginationElement as any ) ;
Original file line number Diff line number Diff line change
1
+ import { LitElement , html , css } from 'lit' ;
2
+
3
+ /**
4
+ * @element uui-pagination
5
+ */
6
+ export class UUIPaginationElement extends LitElement {
7
+ static styles = [
8
+ css `
9
+ :host {
10
+ /* Styles goes here */
11
+ }
12
+ ` ,
13
+ ] ;
14
+
15
+ render ( ) {
16
+ return html ` Markup goes here ` ;
17
+ }
18
+ }
Original file line number Diff line number Diff line change
1
+ import { Story } from '@storybook/web-components' ;
2
+ import { html } from 'lit-html' ;
3
+ import '@umbraco-ui/uui-pagination/lib/index' ;
4
+
5
+ export default {
6
+ id : 'uui-pagination' ,
7
+ title : 'Pagination' ,
8
+ component : 'uui-pagination' ,
9
+ parameters : {
10
+ docs : {
11
+ source : {
12
+ code : `<uui-pagination></uui-pagination>` ,
13
+ } ,
14
+ } ,
15
+ } ,
16
+ } ;
17
+
18
+ export const Overview : Story = ( ) => html `< uui-pagination > </ uui-pagination > ` ;
Original file line number Diff line number Diff line change
1
+ import { html , fixture , expect } from '@open-wc/testing' ;
2
+ import { UUIPaginationElement } from './uui-pagination.element' ;
3
+ import '.' ;
4
+
5
+ describe ( 'UUIPaginationElement' , ( ) => {
6
+ let element : UUIPaginationElement ;
7
+
8
+ beforeEach ( async ( ) => {
9
+ element = await fixture ( html ` < uui-pagination > </ uui-pagination > ` ) ;
10
+ } ) ;
11
+
12
+ it ( 'passes the a11y audit' , async ( ) => {
13
+ await expect ( element ) . shadowDom . to . be . accessible ( ) ;
14
+ } ) ;
15
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @umbraco-ui/uui-pagination" ,
3
+ "version" : " 0.0.0" ,
4
+ "license" : " MIT" ,
5
+ "keywords" : [
6
+ " Umbraco" ,
7
+ " Custom elements" ,
8
+ " Web components" ,
9
+ " UI" ,
10
+ " Lit" ,
11
+ " Pagination"
12
+ ],
13
+ "description" : " Umbraco UI pagination component" ,
14
+ "repository" : {
15
+ "type" : " git" ,
16
+ "url" : " https://github.com/umbraco/Umbraco.UI.git" ,
17
+ "directory" : " packages/uui-pagination"
18
+ },
19
+ "bugs" : {
20
+ "url" : " https://github.com/umbraco/Umbraco.UI/issues"
21
+ },
22
+ "main" : " ./dist/uui-pagination.min.js" ,
23
+ "module" : " ./lib/index.js" ,
24
+ "customElements" : " custom-elements.json" ,
25
+ "files" : [
26
+ " dist" ,
27
+ " lib/**/*.d.ts" ,
28
+ " lib/**/*.js" ,
29
+ " custom-elements.json"
30
+ ],
31
+ "dependencies" : {
32
+ "@umbraco-ui/uui-base" : " 0.0.13"
33
+ },
34
+ "scripts" : {
35
+ "build" : " npm run analyze && tsc --build --force && rollup -c rollup.config.js" ,
36
+ "clean" : " tsc --build --clean && rimraf dist lib/*.js lib/**/*.js custom-elements.json" ,
37
+ "analyze" : " web-component-analyzer **/*.element.ts --outFile custom-elements.json"
38
+ },
39
+ "publishConfig" : {
40
+ "access" : " public"
41
+ },
42
+ "homepage" : " https://uui.umbraco.com/?path=/story/uui-pagination"
43
+ }
Original file line number Diff line number Diff line change
1
+ import { UUIProdConfig } from '../rollup-package.config' ;
2
+
3
+ export default UUIProdConfig ( {
4
+ entryPoints : [ 'index' , 'uui-pagination.element' ] ,
5
+ bundle : 'index' ,
6
+ } ) ;
Original file line number Diff line number Diff line change
1
+ // Don't edit this file directly. It is generated by /scripts/generate-ts-config.js
2
+
3
+ {
4
+ "extends" : " ../../tsconfig.json" ,
5
+ "compilerOptions" : {
6
+ "outDir" : " ./lib" ,
7
+ "rootDir" : " ./lib" ,
8
+ "composite" : true
9
+ },
10
+ "include" : [" ./**/*.ts" ],
11
+ "exclude" : [" ./**/*.test.ts" , " ./**/*.story.ts" ],
12
+ "references" : [
13
+ {
14
+ "path" : " ../uui-base"
15
+ }
16
+ ]
17
+ }
You can’t perform that action at this time.
0 commit comments