@nuralyui/tabs 0.0.13 → 0.0.15
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.
- package/bundle.js +779 -0
- package/index.d.ts +7 -0
- package/index.js +8 -0
- package/index.js.map +1 -1
- package/package.json +31 -3
- package/react.d.ts +48 -7
- package/react.js +43 -9
- package/react.js.map +1 -1
- package/tabs.component.d.ts +60 -27
- package/tabs.component.js +225 -158
- package/tabs.component.js.map +1 -1
- package/tabs.constant.d.ts +18 -24
- package/tabs.constant.js +20 -22
- package/tabs.constant.js.map +1 -1
- package/tabs.style.d.ts +7 -0
- package/tabs.style.js +282 -149
- package/tabs.style.js.map +1 -1
- package/tabs.types.d.ts +141 -0
- package/tabs.types.js +13 -0
- package/tabs.types.js.map +1 -0
- package/demo/tabs-demo.d.ts +0 -32
- package/demo/tabs-demo.d.ts.map +0 -1
- package/demo/tabs-demo.js +0 -263
- package/demo/tabs-demo.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/react.d.ts.map +0 -1
- package/tabs.component.d.ts.map +0 -1
- package/tabs.constant.d.ts.map +0 -1
- package/tabs.style.d.ts.map +0 -1
- package/templates/add-tab.template.d.ts +0 -2
- package/templates/add-tab.template.d.ts.map +0 -1
- package/templates/add-tab.template.js +0 -13
- package/templates/add-tab.template.js.map +0 -1
package/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
1
6
|
export * from './tabs.component.js';
|
|
7
|
+
export * from './tabs.types.js';
|
|
8
|
+
export { NrTabsElement as TabsComponent } from './tabs.component.js';
|
|
2
9
|
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
1
6
|
export * from './tabs.component.js';
|
|
7
|
+
export * from './tabs.types.js';
|
|
8
|
+
// For backward compatibility - will be removed in next major version
|
|
9
|
+
export { NrTabsElement as TabsComponent } from './tabs.component.js';
|
|
2
10
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/tabs/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/tabs/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAEhC,qEAAqE;AACrE,OAAO,EAAE,aAAa,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nexport * from './tabs.component.js';\nexport * from './tabs.types.js';\n\n// For backward compatibility - will be removed in next major version\nexport { NrTabsElement as TabsComponent } from './tabs.component.js';\n"]}
|
package/package.json
CHANGED
|
@@ -1,12 +1,40 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nuralyui/tabs",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "",
|
|
3
|
+
"version": "0.0.15",
|
|
4
|
+
"description": "Versatile tabs component with support for multiple orientations, editable tabs, and drag & drop functionality",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
9
9
|
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"tabs",
|
|
12
|
+
"web-components",
|
|
13
|
+
"lit-element",
|
|
14
|
+
"typescript",
|
|
15
|
+
"drag-drop",
|
|
16
|
+
"editable",
|
|
17
|
+
"accessibility"
|
|
18
|
+
],
|
|
10
19
|
"author": "Labidi Aymen",
|
|
11
|
-
"license": "
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"import": "./index.js"
|
|
24
|
+
},
|
|
25
|
+
"./bundle": {
|
|
26
|
+
"import": "./bundle.js"
|
|
27
|
+
},
|
|
28
|
+
"./react": {
|
|
29
|
+
"import": "./react.js"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"files": [
|
|
33
|
+
"bundle.js",
|
|
34
|
+
"*.js",
|
|
35
|
+
"*.d.ts",
|
|
36
|
+
"*.js.map",
|
|
37
|
+
"react.js",
|
|
38
|
+
"react.d.ts"
|
|
39
|
+
]
|
|
12
40
|
}
|
package/react.d.ts
CHANGED
|
@@ -1,9 +1,50 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { NrTabsElement } from './tabs.component.js';
|
|
7
|
+
/**
|
|
8
|
+
* React wrapper for the nr-tabs component.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```jsx
|
|
12
|
+
* import { NrTabs } from '@nuralyui/tabs/react';
|
|
13
|
+
*
|
|
14
|
+
* const tabs = [
|
|
15
|
+
* { label: 'Tab 1', content: <div>Content 1</div> },
|
|
16
|
+
* { label: 'Tab 2', content: <div>Content 2</div> }
|
|
17
|
+
* ];
|
|
18
|
+
*
|
|
19
|
+
* function MyComponent() {
|
|
20
|
+
* return (
|
|
21
|
+
* <NrTabs
|
|
22
|
+
* tabs={tabs}
|
|
23
|
+
* activeTab={0}
|
|
24
|
+
* orientation="horizontal"
|
|
25
|
+
* onNrTabClick={(e) => console.log('Tab clicked:', e.detail)}
|
|
26
|
+
* />
|
|
27
|
+
* );
|
|
28
|
+
* }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare const NrTabs: import("@lit-labs/react").ReactWebComponent<NrTabsElement, {
|
|
32
|
+
onNrTabClick: string;
|
|
33
|
+
onNrTabChange: string;
|
|
34
|
+
onNrTabAdd: string;
|
|
35
|
+
onNrTabRemove: string;
|
|
36
|
+
onNrTabEdit: string;
|
|
37
|
+
onNrTabOrderChange: string;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* @deprecated Use NrTabs instead. Will be removed in next major version.
|
|
41
|
+
*/
|
|
42
|
+
export declare const HyTabsComponent: import("@lit-labs/react").ReactWebComponent<NrTabsElement, {
|
|
43
|
+
onNrTabClick: string;
|
|
44
|
+
onNrTabChange: string;
|
|
45
|
+
onNrTabAdd: string;
|
|
46
|
+
onNrTabRemove: string;
|
|
47
|
+
onNrTabEdit: string;
|
|
48
|
+
onNrTabOrderChange: string;
|
|
8
49
|
}>;
|
|
9
50
|
//# sourceMappingURL=react.d.ts.map
|
package/react.js
CHANGED
|
@@ -1,16 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
1
6
|
import { createComponent } from '@lit-labs/react';
|
|
2
7
|
import * as React from 'react';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
8
|
+
import { NrTabsElement } from './tabs.component.js';
|
|
9
|
+
/**
|
|
10
|
+
* React wrapper for the nr-tabs component.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```jsx
|
|
14
|
+
* import { NrTabs } from '@nuralyui/tabs/react';
|
|
15
|
+
*
|
|
16
|
+
* const tabs = [
|
|
17
|
+
* { label: 'Tab 1', content: <div>Content 1</div> },
|
|
18
|
+
* { label: 'Tab 2', content: <div>Content 2</div> }
|
|
19
|
+
* ];
|
|
20
|
+
*
|
|
21
|
+
* function MyComponent() {
|
|
22
|
+
* return (
|
|
23
|
+
* <NrTabs
|
|
24
|
+
* tabs={tabs}
|
|
25
|
+
* activeTab={0}
|
|
26
|
+
* orientation="horizontal"
|
|
27
|
+
* onNrTabClick={(e) => console.log('Tab clicked:', e.detail)}
|
|
28
|
+
* />
|
|
29
|
+
* );
|
|
30
|
+
* }
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export const NrTabs = createComponent({
|
|
34
|
+
tagName: 'nr-tabs',
|
|
35
|
+
elementClass: NrTabsElement,
|
|
7
36
|
react: React,
|
|
8
37
|
events: {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
onNrTabClick: 'nr-tab-click',
|
|
39
|
+
onNrTabChange: 'nr-tab-change',
|
|
40
|
+
onNrTabAdd: 'nr-tab-add',
|
|
41
|
+
onNrTabRemove: 'nr-tab-remove',
|
|
42
|
+
onNrTabEdit: 'nr-tab-edit',
|
|
43
|
+
onNrTabOrderChange: 'nr-tab-order-change',
|
|
14
44
|
},
|
|
15
45
|
});
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Use NrTabs instead. Will be removed in next major version.
|
|
48
|
+
*/
|
|
49
|
+
export const HyTabsComponent = NrTabs;
|
|
16
50
|
//# sourceMappingURL=react.js.map
|
package/react.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/tabs/react.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"react.js","sourceRoot":"","sources":["../../../src/components/tabs/react.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,CAAC,MAAM,MAAM,GAAG,eAAe,CAAC;IACpC,OAAO,EAAE,SAAS;IAClB,YAAY,EAAE,aAAa;IAC3B,KAAK,EAAE,KAAK;IACZ,MAAM,EAAE;QACN,YAAY,EAAE,cAAc;QAC5B,aAAa,EAAE,eAAe;QAC9B,UAAU,EAAE,YAAY;QACxB,aAAa,EAAE,eAAe;QAC9B,WAAW,EAAE,aAAa;QAC1B,kBAAkB,EAAE,qBAAqB;KAC1C;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,MAAM,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Nuraly, Laabidi Aymen\n * SPDX-License-Identifier: MIT\n */\n\nimport { createComponent } from '@lit-labs/react';\nimport * as React from 'react';\nimport { NrTabsElement } from './tabs.component.js';\n\n/**\n * React wrapper for the nr-tabs component.\n * \n * @example\n * ```jsx\n * import { NrTabs } from '@nuralyui/tabs/react';\n * \n * const tabs = [\n * { label: 'Tab 1', content: <div>Content 1</div> },\n * { label: 'Tab 2', content: <div>Content 2</div> }\n * ];\n * \n * function MyComponent() {\n * return (\n * <NrTabs \n * tabs={tabs}\n * activeTab={0}\n * orientation=\"horizontal\"\n * onNrTabClick={(e) => console.log('Tab clicked:', e.detail)}\n * />\n * );\n * }\n * ```\n */\nexport const NrTabs = createComponent({\n tagName: 'nr-tabs',\n elementClass: NrTabsElement,\n react: React,\n events: {\n onNrTabClick: 'nr-tab-click',\n onNrTabChange: 'nr-tab-change',\n onNrTabAdd: 'nr-tab-add',\n onNrTabRemove: 'nr-tab-remove',\n onNrTabEdit: 'nr-tab-edit',\n onNrTabOrderChange: 'nr-tab-order-change',\n },\n});\n\n/**\n * @deprecated Use NrTabs instead. Will be removed in next major version.\n */\nexport const HyTabsComponent = NrTabs;\n"]}
|
package/tabs.component.d.ts
CHANGED
|
@@ -1,39 +1,72 @@
|
|
|
1
|
-
import { LitElement, PropertyValueMap, nothing } from 'lit';
|
|
2
|
-
import { TabEditable, TabOrientation, TabsAlign } from './tabs.constant.js';
|
|
3
1
|
/**
|
|
4
|
-
*
|
|
5
|
-
*
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Nuraly, Laabidi Aymen
|
|
4
|
+
* SPDX-License-Identifier: MIT
|
|
5
|
+
*/
|
|
6
|
+
import { LitElement, PropertyValueMap } from 'lit';
|
|
7
|
+
import { TabOrientation, TabsAlign, TabSize, TabType, TabEditable, TabItem } from './tabs.types.js';
|
|
8
|
+
import '../icon/icon.component.js';
|
|
9
|
+
import { type TabsKeyboardHost, type TabsDragDropHost, type TabsEditableHost, type TabsEventHost } from './controllers/index.js';
|
|
10
|
+
declare const NrTabsElement_base: (new (...args: any[]) => import("../../shared/dependency-mixin.js").DependencyAware) & (new (...args: any[]) => import("../../shared/theme-mixin.js").ThemeAware) & (new (...args: any[]) => import("../../shared/event-handler-mixin.js").EventHandlerCapable) & typeof LitElement;
|
|
11
|
+
/**
|
|
12
|
+
* Versatile tabs component with support for multiple orientations, editable tabs, and drag & drop.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```html
|
|
16
|
+
* <!-- Basic usage -->
|
|
17
|
+
* <nr-tabs .tabs=${tabs} activeTab="0"></nr-tabs>
|
|
18
|
+
*
|
|
19
|
+
* <!-- With editing capabilities -->
|
|
20
|
+
* <nr-tabs .tabs=${tabs} .editable=${{canAddTab: true, canDeleteTab: true}}></nr-tabs>
|
|
21
|
+
*
|
|
22
|
+
* <!-- Vertical orientation -->
|
|
23
|
+
* <nr-tabs .tabs=${tabs} orientation="vertical" align="left"></nr-tabs>
|
|
24
|
+
* ```
|
|
6
25
|
*
|
|
7
|
-
*
|
|
8
|
-
* @
|
|
9
|
-
* @
|
|
10
|
-
* @
|
|
11
|
-
* @
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* @
|
|
15
|
-
* @fires addTab - Indicates when tab added
|
|
26
|
+
* @fires nr-tab-click - Tab clicked
|
|
27
|
+
* @fires nr-tab-change - Active tab changed
|
|
28
|
+
* @fires nr-tab-add - New tab requested
|
|
29
|
+
* @fires nr-tab-remove - Tab removal requested
|
|
30
|
+
* @fires nr-tab-edit - Tab edited
|
|
31
|
+
* @fires nr-tab-order-change - Tab order changed via drag & drop
|
|
32
|
+
*
|
|
33
|
+
* @slot default - Tab content
|
|
16
34
|
*/
|
|
17
|
-
export declare class
|
|
35
|
+
export declare class NrTabsElement extends NrTabsElement_base implements TabsKeyboardHost, TabsDragDropHost, TabsEditableHost, TabsEventHost {
|
|
36
|
+
static styles: import("lit").CSSResult;
|
|
37
|
+
/** Currently active tab index */
|
|
18
38
|
activeTab: number;
|
|
39
|
+
/** Tab orientation (horizontal, vertical) */
|
|
19
40
|
orientation: TabOrientation;
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
41
|
+
/** Tab alignment (left, center, right) */
|
|
42
|
+
align: TabsAlign;
|
|
43
|
+
/** Tab size (small, medium, large) */
|
|
44
|
+
tabSize: TabSize;
|
|
45
|
+
/** Tab type/variant */
|
|
46
|
+
variant: TabType;
|
|
47
|
+
/** Editable configuration */
|
|
48
|
+
editable?: TabEditable;
|
|
49
|
+
/** Array of tab items */
|
|
50
|
+
tabs: TabItem[];
|
|
51
|
+
/** Whether tabs are animated */
|
|
52
|
+
animated: boolean;
|
|
53
|
+
/** Whether to destroy inactive tab content */
|
|
54
|
+
destroyInactiveTabPane: boolean;
|
|
55
|
+
/** Custom aria-label for the tabs container */
|
|
56
|
+
tabsAriaLabel: string;
|
|
57
|
+
requiredComponents: string[];
|
|
58
|
+
private keyboardController;
|
|
59
|
+
private dragDropController;
|
|
60
|
+
private editableController;
|
|
61
|
+
private eventController;
|
|
26
62
|
connectedCallback(): void;
|
|
63
|
+
render(): import("lit").TemplateResult<1>;
|
|
27
64
|
private observeChildrenChanges;
|
|
28
|
-
private
|
|
29
|
-
private handleDragOver;
|
|
30
|
-
private handleDragEnter;
|
|
31
|
-
private handleDragLeave;
|
|
32
|
-
private handleDrop;
|
|
33
|
-
renderDeleteIcon(tab: any): typeof nothing | import("lit").TemplateResult<1>;
|
|
65
|
+
private renderDeleteIcon;
|
|
34
66
|
private renderTabs;
|
|
35
67
|
updated(changedProperties: PropertyValueMap<any> | Map<PropertyKey, unknown>): void;
|
|
36
68
|
private renderActiveTab;
|
|
37
|
-
|
|
69
|
+
setActiveTab(index: number, event?: Event): void;
|
|
38
70
|
}
|
|
71
|
+
export {};
|
|
39
72
|
//# sourceMappingURL=tabs.component.d.ts.map
|