@uibit/table 0.1.0

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.
@@ -0,0 +1,93 @@
1
+ import { Component, ChangeDetectionStrategy, ElementRef, input, effect, booleanAttribute } from '@angular/core';
2
+ import '@uibit/table';
3
+ import type { Table as HTMLElementClass } from '@uibit/table';
4
+
5
+ @Component({
6
+ selector: 'uibit-table',
7
+ template: '<ng-content></ng-content>',
8
+ changeDetection: ChangeDetectionStrategy.OnPush,
9
+ standalone: true
10
+ })
11
+ export class NgxTable {
12
+ constructor(private el: ElementRef<HTMLElementClass>) {
13
+ effect(() => {
14
+ if (this.el.nativeElement) {
15
+ this.el.nativeElement.searchable = this.searchable();
16
+ }
17
+ });
18
+ effect(() => {
19
+ if (this.el.nativeElement) {
20
+ this.el.nativeElement.paginated = this.paginated();
21
+ }
22
+ });
23
+ effect(() => {
24
+ if (this.el.nativeElement) {
25
+ this.el.nativeElement.exportable = this.exportable();
26
+ }
27
+ });
28
+ effect(() => {
29
+ if (this.el.nativeElement) {
30
+ this.el.nativeElement.selectable = this.selectable();
31
+ }
32
+ });
33
+ effect(() => {
34
+ if (this.el.nativeElement) {
35
+ this.el.nativeElement.filterable = this.filterable();
36
+ }
37
+ });
38
+ effect(() => {
39
+ if (this.el.nativeElement) {
40
+ this.el.nativeElement.resizable = this.resizable();
41
+ }
42
+ });
43
+ effect(() => {
44
+ if (this.el.nativeElement) {
45
+ this.el.nativeElement.columnChooser = this.columnChooser();
46
+ }
47
+ });
48
+ effect(() => {
49
+ if (this.el.nativeElement) {
50
+ this.el.nativeElement.striped = this.striped();
51
+ }
52
+ });
53
+ effect(() => {
54
+ if (this.el.nativeElement) {
55
+ this.el.nativeElement.stickyHeader = this.stickyHeader();
56
+ }
57
+ });
58
+ effect(() => {
59
+ if (this.el.nativeElement) {
60
+ this.el.nativeElement.pageSizes = this.pageSizes();
61
+ }
62
+ });
63
+ effect(() => {
64
+ if (this.el.nativeElement) {
65
+ this.el.nativeElement.controlsLayout = this.controlsLayout();
66
+ }
67
+ });
68
+ effect(() => {
69
+ if (this.el.nativeElement) {
70
+ this.el.nativeElement.infiniteScroll = this.infiniteScroll();
71
+ }
72
+ });
73
+ effect(() => {
74
+ if (this.el.nativeElement) {
75
+ this.el.nativeElement.loading = this.loading();
76
+ }
77
+ });
78
+ }
79
+
80
+ readonly searchable = input<boolean, any>(true, { transform: booleanAttribute });
81
+ readonly paginated = input<boolean, any>(true, { transform: booleanAttribute });
82
+ readonly exportable = input<boolean, any>(true, { transform: booleanAttribute });
83
+ readonly selectable = input<boolean, any>(false, { transform: booleanAttribute });
84
+ readonly filterable = input<boolean, any>(false, { transform: booleanAttribute });
85
+ readonly resizable = input<boolean, any>(false, { transform: booleanAttribute });
86
+ readonly columnChooser = input<boolean, any>(false, { transform: booleanAttribute });
87
+ readonly striped = input<boolean, any>(false, { transform: booleanAttribute });
88
+ readonly stickyHeader = input<boolean, any>(false, { transform: booleanAttribute });
89
+ readonly pageSizes = input<string, any>('10,25,50,100');
90
+ readonly controlsLayout = input<'inline' | 'menu', any>('inline');
91
+ readonly infiniteScroll = input<boolean, any>(false, { transform: booleanAttribute });
92
+ readonly loading = input<boolean, any>(false, { transform: booleanAttribute });
93
+ }
@@ -0,0 +1,10 @@
1
+ import type { Table as HTMLElementClass } from '@uibit/table';
2
+ import '@uibit/table';
3
+
4
+ declare global {
5
+ namespace astroHTML.JSX {
6
+ interface IntrinsicElements {
7
+ 'uibit-table': Partial<HTMLElementClass> & astroHTML.JSX.HTMLAttributes;
8
+ }
9
+ }
10
+ }
@@ -0,0 +1,7 @@
1
+ import { defineNuxtPlugin } from '#app';
2
+
3
+ export default defineNuxtPlugin(() => {
4
+ if (process.client) {
5
+ import('@uibit/table');
6
+ }
7
+ });
@@ -0,0 +1,25 @@
1
+ import type { JSX } from 'preact';
2
+ import type { Table as HTMLElementClass } from '@uibit/table';
3
+ import '@uibit/table';
4
+
5
+ declare module 'preact' {
6
+ namespace JSX {
7
+ interface IntrinsicElements {
8
+ 'uibit-table': JSX.HTMLAttributes<HTMLElementClass> & {
9
+ searchable?: boolean;
10
+ paginated?: boolean;
11
+ exportable?: boolean;
12
+ selectable?: boolean;
13
+ filterable?: boolean;
14
+ resizable?: boolean;
15
+ columnChooser?: boolean;
16
+ striped?: boolean;
17
+ stickyHeader?: boolean;
18
+ pageSizes?: string;
19
+ controlsLayout?: 'inline' | 'menu';
20
+ infiniteScroll?: boolean;
21
+ loading?: boolean;
22
+ };
23
+ }
24
+ }
25
+ }
@@ -0,0 +1,10 @@
1
+ import { component$, Slot } from '@builder.io/qwik';
2
+ import '@uibit/table';
3
+
4
+ export const Table = component$<any>((props) => {
5
+ return (
6
+ <uibit-table {...props}>
7
+ <Slot />
8
+ </uibit-table>
9
+ );
10
+ });
@@ -0,0 +1,29 @@
1
+ import type { HTMLAttributes, ClassAttributes } from 'react';
2
+ import type { Table as HTMLElementClass } from '@uibit/table';
3
+ import '@uibit/table';
4
+
5
+ declare global {
6
+ namespace React {
7
+ namespace JSX {
8
+ interface IntrinsicElements {
9
+ 'uibit-table': ClassAttributes<HTMLElementClass> & HTMLAttributes<HTMLElementClass> & {
10
+ children?: React.ReactNode;
11
+ class?: string;
12
+ searchable?: boolean;
13
+ paginated?: boolean;
14
+ exportable?: boolean;
15
+ selectable?: boolean;
16
+ filterable?: boolean;
17
+ resizable?: boolean;
18
+ columnChooser?: boolean;
19
+ striped?: boolean;
20
+ stickyHeader?: boolean;
21
+ pageSizes?: string;
22
+ controlsLayout?: 'inline' | 'menu';
23
+ infiniteScroll?: boolean;
24
+ loading?: boolean;
25
+ };
26
+ }
27
+ }
28
+ }
29
+ }
@@ -0,0 +1,26 @@
1
+ import type { JSX } from 'solid-js';
2
+ import type { Table as HTMLElementClass } from '@uibit/table';
3
+ import '@uibit/table';
4
+
5
+ declare module 'solid-js' {
6
+ namespace JSX {
7
+ interface IntrinsicElements {
8
+ 'uibit-table': Partial<HTMLElementClass> & JSX.HTMLAttributes<HTMLElementClass> & {
9
+ searchable?: boolean;
10
+ paginated?: boolean;
11
+ exportable?: boolean;
12
+ selectable?: boolean;
13
+ filterable?: boolean;
14
+ resizable?: boolean;
15
+ columnChooser?: boolean;
16
+ striped?: boolean;
17
+ stickyHeader?: boolean;
18
+ pageSizes?: string;
19
+ controlsLayout?: 'inline' | 'menu';
20
+ infiniteScroll?: boolean;
21
+ loading?: boolean;
22
+
23
+ };
24
+ }
25
+ }
26
+ }
@@ -0,0 +1,24 @@
1
+ import type { Table as HTMLElementClass } from '@uibit/table';
2
+ import '@uibit/table';
3
+
4
+ declare module '@stencil/core' {
5
+ export namespace JSX {
6
+ interface IntrinsicElements {
7
+ 'uibit-table': HTMLElementClass & {
8
+ searchable?: boolean;
9
+ paginated?: boolean;
10
+ exportable?: boolean;
11
+ selectable?: boolean;
12
+ filterable?: boolean;
13
+ resizable?: boolean;
14
+ columnChooser?: boolean;
15
+ striped?: boolean;
16
+ stickyHeader?: boolean;
17
+ pageSizes?: string;
18
+ controlsLayout?: 'inline' | 'menu';
19
+ infiniteScroll?: boolean;
20
+ loading?: boolean;
21
+ };
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,91 @@
1
+ <script lang="ts">
2
+ import '@uibit/table';
3
+ import type { Table as HTMLElementClass } from '@uibit/table';
4
+
5
+ let {
6
+ searchable = undefined,
7
+ paginated = undefined,
8
+ exportable = undefined,
9
+ selectable = undefined,
10
+ filterable = undefined,
11
+ resizable = undefined,
12
+ columnChooser = undefined,
13
+ striped = undefined,
14
+ stickyHeader = undefined,
15
+ pageSizes = undefined,
16
+ controlsLayout = undefined,
17
+ infiniteScroll = undefined,
18
+ loading = undefined,
19
+ children
20
+ } = $props<{
21
+ children?: any;
22
+ searchable?: boolean;
23
+ paginated?: boolean;
24
+ exportable?: boolean;
25
+ selectable?: boolean;
26
+ filterable?: boolean;
27
+ resizable?: boolean;
28
+ columnChooser?: boolean;
29
+ striped?: boolean;
30
+ stickyHeader?: boolean;
31
+ pageSizes?: string;
32
+ controlsLayout?: 'inline' | 'menu';
33
+ infiniteScroll?: boolean;
34
+ loading?: boolean;
35
+
36
+ }>();
37
+
38
+ let elementRef: HTMLElementClass | null = $state(null);
39
+
40
+ $effect(() => {
41
+ if (elementRef && searchable !== undefined) {
42
+ elementRef.searchable = searchable;
43
+ }
44
+ if (elementRef && paginated !== undefined) {
45
+ elementRef.paginated = paginated;
46
+ }
47
+ if (elementRef && exportable !== undefined) {
48
+ elementRef.exportable = exportable;
49
+ }
50
+ if (elementRef && selectable !== undefined) {
51
+ elementRef.selectable = selectable;
52
+ }
53
+ if (elementRef && filterable !== undefined) {
54
+ elementRef.filterable = filterable;
55
+ }
56
+ if (elementRef && resizable !== undefined) {
57
+ elementRef.resizable = resizable;
58
+ }
59
+ if (elementRef && columnChooser !== undefined) {
60
+ elementRef.columnChooser = columnChooser;
61
+ }
62
+ if (elementRef && striped !== undefined) {
63
+ elementRef.striped = striped;
64
+ }
65
+ if (elementRef && stickyHeader !== undefined) {
66
+ elementRef.stickyHeader = stickyHeader;
67
+ }
68
+ if (elementRef && pageSizes !== undefined) {
69
+ elementRef.pageSizes = pageSizes;
70
+ }
71
+ if (elementRef && controlsLayout !== undefined) {
72
+ elementRef.controlsLayout = controlsLayout;
73
+ }
74
+ if (elementRef && infiniteScroll !== undefined) {
75
+ elementRef.infiniteScroll = infiniteScroll;
76
+ }
77
+ if (elementRef && loading !== undefined) {
78
+ elementRef.loading = loading;
79
+ }
80
+ });
81
+
82
+ </script>
83
+
84
+ <uibit-table bind:this={elementRef} {...$$restProps}>
85
+
86
+ {#if children}
87
+ {@render children()}
88
+ {:else}
89
+ <slot />
90
+ {/if}
91
+ </uibit-table>
@@ -0,0 +1,34 @@
1
+ import { defineComponent, h } from 'vue';
2
+ import type { Table as HTMLElementClass } from '@uibit/table';
3
+ import '@uibit/table';
4
+
5
+ export const Table = defineComponent({
6
+ name: 'Table',
7
+ props: {
8
+ searchable: { type: [String, Number, Boolean, Array, Object] as any },
9
+ paginated: { type: [String, Number, Boolean, Array, Object] as any },
10
+ exportable: { type: [String, Number, Boolean, Array, Object] as any },
11
+ selectable: { type: [String, Number, Boolean, Array, Object] as any },
12
+ filterable: { type: [String, Number, Boolean, Array, Object] as any },
13
+ resizable: { type: [String, Number, Boolean, Array, Object] as any },
14
+ columnChooser: { type: [String, Number, Boolean, Array, Object] as any },
15
+ striped: { type: [String, Number, Boolean, Array, Object] as any },
16
+ stickyHeader: { type: [String, Number, Boolean, Array, Object] as any },
17
+ pageSizes: { type: [String, Number, Boolean, Array, Object] as any },
18
+ controlsLayout: { type: [String, Number, Boolean, Array, Object] as any },
19
+ infiniteScroll: { type: [String, Number, Boolean, Array, Object] as any },
20
+ loading: { type: [String, Number, Boolean, Array, Object] as any }
21
+ },
22
+ emits: [],
23
+ setup(props, { slots, emit }) {
24
+ return () => {
25
+ const eventListeners: Record<string, any> = {};
26
+
27
+
28
+ return h('uibit-table', {
29
+ ...props,
30
+ ...eventListeners
31
+ }, slots.default?.());
32
+ };
33
+ }
34
+ });
@@ -0,0 +1,3 @@
1
+ export { default, Table } from './table';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,SAAS,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,3 @@
1
+ export { default, Table } from './table';
2
+ export * from './types';
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACzC,cAAc,SAAS,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const styles: import("lit").CSSResult;
2
+ //# sourceMappingURL=styles.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../src/styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM,yBA+gBlB,CAAC"}