@dodlhuat/basix 1.2.6 → 1.2.8
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/README.md +1 -1
- package/css/push-menu.scss +1 -0
- package/css/style.css +1 -2
- package/css/style.min.css +1 -1
- package/js/bottom-sheet.d.ts +37 -0
- package/js/calendar.d.ts +115 -0
- package/js/carousel.d.ts +34 -0
- package/js/chart.d.ts +73 -0
- package/js/code-viewer.d.ts +16 -0
- package/js/context-menu.d.ts +31 -0
- package/js/datepicker.d.ts +55 -0
- package/js/datepicker.js +3 -1
- package/js/datepicker.ts +3 -1
- package/js/dropdown.d.ts +30 -0
- package/js/editor.d.ts +41 -0
- package/js/file-uploader.d.ts +48 -0
- package/js/flyout-menu.d.ts +37 -0
- package/js/gallery.d.ts +35 -0
- package/js/group-picker.d.ts +59 -0
- package/js/lightbox.d.ts +46 -0
- package/js/lightbox.js +7 -5
- package/js/lightbox.ts +7 -5
- package/js/modal.d.ts +28 -0
- package/js/modal.js +3 -1
- package/js/modal.ts +3 -1
- package/js/popover.d.ts +46 -0
- package/js/position.d.ts +31 -0
- package/js/push-menu.d.ts +31 -0
- package/js/range-slider.d.ts +9 -0
- package/js/scroll.d.ts +15 -0
- package/js/scrollbar.d.ts +48 -0
- package/js/select.d.ts +16 -0
- package/js/sidebar-nav.d.ts +22 -0
- package/js/stepper.d.ts +26 -0
- package/js/table.d.ts +98 -0
- package/js/tabs.d.ts +57 -0
- package/js/tabs.js +2 -2
- package/js/tabs.ts +2 -2
- package/js/theme.d.ts +65 -0
- package/js/timepicker.d.ts +37 -0
- package/js/toast.d.ts +26 -0
- package/js/tooltip.d.ts +34 -0
- package/js/tooltip.js +1 -1
- package/js/tooltip.ts +1 -2
- package/js/tree.d.ts +40 -0
- package/js/tsconfig.json +1 -0
- package/js/utils.d.ts +24 -0
- package/js/virtual-dropdown.d.ts +55 -0
- package/package.json +1 -1
package/js/tooltip.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface TooltipOptions {
|
|
2
|
+
position?: 'top' | 'bottom' | 'left' | 'right' | 'auto';
|
|
3
|
+
offset?: number;
|
|
4
|
+
delay?: number;
|
|
5
|
+
className?: string;
|
|
6
|
+
/** Set to true when content is trusted HTML (e.g. from data-tooltip-id).
|
|
7
|
+
* Defaults to false — content is treated as plain text and escaped. */
|
|
8
|
+
isHtml?: boolean;
|
|
9
|
+
}
|
|
10
|
+
declare class Tooltip {
|
|
11
|
+
private static activeTooltip;
|
|
12
|
+
private static idCounter;
|
|
13
|
+
private readonly trigger;
|
|
14
|
+
private readonly content;
|
|
15
|
+
private readonly options;
|
|
16
|
+
private tooltipElement;
|
|
17
|
+
private showTimeout;
|
|
18
|
+
private isVisible;
|
|
19
|
+
constructor(trigger: HTMLElement, content: string, options?: TooltipOptions);
|
|
20
|
+
static initializeAll(): void;
|
|
21
|
+
show(): void;
|
|
22
|
+
hide(): void;
|
|
23
|
+
private static hideActive;
|
|
24
|
+
private createTooltip;
|
|
25
|
+
private position;
|
|
26
|
+
private attachEvents;
|
|
27
|
+
private handleMouseEnter;
|
|
28
|
+
private handleMouseLeave;
|
|
29
|
+
private handleFocus;
|
|
30
|
+
private handleBlur;
|
|
31
|
+
destroy(): void;
|
|
32
|
+
}
|
|
33
|
+
export { Tooltip };
|
|
34
|
+
export type { TooltipOptions };
|
package/js/tooltip.js
CHANGED
package/js/tooltip.ts
CHANGED
package/js/tree.d.ts
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
type NodeType = 'file' | 'folder';
|
|
2
|
+
interface TreeOptions {
|
|
3
|
+
onSelect?: (node: TreeNode) => void;
|
|
4
|
+
}
|
|
5
|
+
declare class TreeNode {
|
|
6
|
+
label: string;
|
|
7
|
+
type: NodeType;
|
|
8
|
+
children: TreeNode[];
|
|
9
|
+
expanded: boolean;
|
|
10
|
+
selected: boolean;
|
|
11
|
+
element: HTMLDivElement | null;
|
|
12
|
+
childrenContainer: HTMLUListElement | null;
|
|
13
|
+
constructor(label: string, type?: NodeType, children?: TreeNode[]);
|
|
14
|
+
}
|
|
15
|
+
declare class TreeComponent {
|
|
16
|
+
private container;
|
|
17
|
+
private data;
|
|
18
|
+
private selectedNode;
|
|
19
|
+
private readonly options;
|
|
20
|
+
constructor(elementOrSelector: string | HTMLElement, data: TreeNode[], options?: TreeOptions);
|
|
21
|
+
private init;
|
|
22
|
+
render(): void;
|
|
23
|
+
private renderNode;
|
|
24
|
+
private createIconElement;
|
|
25
|
+
private createLabelElement;
|
|
26
|
+
private createChildrenContainer;
|
|
27
|
+
private toggleNode;
|
|
28
|
+
private expandChildren;
|
|
29
|
+
private collapseChildren;
|
|
30
|
+
selectNode(node: TreeNode): void;
|
|
31
|
+
expandAll(): void;
|
|
32
|
+
collapseAll(): void;
|
|
33
|
+
private traverseNodes;
|
|
34
|
+
destroy(): void;
|
|
35
|
+
getSelectedNode(): TreeNode | null;
|
|
36
|
+
findNodeByLabel(label: string): TreeNode | null;
|
|
37
|
+
private findNode;
|
|
38
|
+
}
|
|
39
|
+
export { TreeComponent, TreeNode };
|
|
40
|
+
export type { NodeType, TreeOptions };
|
package/js/tsconfig.json
CHANGED
package/js/utils.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for DOM manipulation and element handling
|
|
3
|
+
*/
|
|
4
|
+
interface Utils {
|
|
5
|
+
ready(fn: () => void): void;
|
|
6
|
+
value(element: HTMLElement): string;
|
|
7
|
+
text(element: HTMLElement): string;
|
|
8
|
+
attribute(element: HTMLElement, attribute: string): string | undefined;
|
|
9
|
+
isList(element: HTMLElement | NodeList): boolean;
|
|
10
|
+
isHidden(element: HTMLElement): boolean;
|
|
11
|
+
}
|
|
12
|
+
declare const utils: Utils;
|
|
13
|
+
/**
|
|
14
|
+
* Escape a plain-text string so it is safe to inject into innerHTML.
|
|
15
|
+
* Use this whenever inserting user-controlled strings into HTML templates.
|
|
16
|
+
*/
|
|
17
|
+
declare function escapeHtml(text: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* Sanitize an HTML string by removing dangerous elements and attributes
|
|
20
|
+
* (script, iframe, on* handlers, javascript: hrefs) while preserving safe markup.
|
|
21
|
+
* Use this when a component intentionally accepts rich HTML from callers.
|
|
22
|
+
*/
|
|
23
|
+
declare function sanitizeHtml(html: string): string;
|
|
24
|
+
export { utils, escapeHtml, sanitizeHtml };
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
interface DropdownOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string | number;
|
|
4
|
+
}
|
|
5
|
+
interface VirtualDropdownConfig {
|
|
6
|
+
container: string | HTMLElement;
|
|
7
|
+
options: DropdownOption[];
|
|
8
|
+
multiSelect?: boolean;
|
|
9
|
+
searchable?: boolean;
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
renderLimit?: number;
|
|
12
|
+
itemHeight?: number;
|
|
13
|
+
onSelect?: (selectedValues: Array<string | number>) => void;
|
|
14
|
+
}
|
|
15
|
+
declare class VirtualDropdown {
|
|
16
|
+
private readonly container;
|
|
17
|
+
private readonly options;
|
|
18
|
+
private readonly multiSelect;
|
|
19
|
+
private readonly searchable;
|
|
20
|
+
private readonly placeholder;
|
|
21
|
+
private readonly renderLimit;
|
|
22
|
+
private readonly itemHeight;
|
|
23
|
+
private readonly onSelect;
|
|
24
|
+
private readonly anchorName;
|
|
25
|
+
private trigger;
|
|
26
|
+
private triggerText;
|
|
27
|
+
private menu;
|
|
28
|
+
private listWrapper;
|
|
29
|
+
private scroller;
|
|
30
|
+
private spacer;
|
|
31
|
+
private content;
|
|
32
|
+
private searchInput?;
|
|
33
|
+
private selectedValues;
|
|
34
|
+
private filteredOptions;
|
|
35
|
+
private isOpen;
|
|
36
|
+
private scrollTop;
|
|
37
|
+
private boundHandlers;
|
|
38
|
+
constructor(config: VirtualDropdownConfig);
|
|
39
|
+
private init;
|
|
40
|
+
private renderBase;
|
|
41
|
+
private querySelector;
|
|
42
|
+
private bindEvents;
|
|
43
|
+
private toggle;
|
|
44
|
+
private open;
|
|
45
|
+
private close;
|
|
46
|
+
private handleSearch;
|
|
47
|
+
private renderList;
|
|
48
|
+
private handleSelect;
|
|
49
|
+
private updateTrigger;
|
|
50
|
+
getValue(): Array<string | number>;
|
|
51
|
+
setValue(values: Array<string | number>): void;
|
|
52
|
+
clearSelection(): void;
|
|
53
|
+
destroy(): void;
|
|
54
|
+
}
|
|
55
|
+
export { VirtualDropdown, DropdownOption, VirtualDropdownConfig };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dodlhuat/basix",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.8",
|
|
4
4
|
"description": "Basix is intended as a starter for the rapid development of a design. Each design element can be added individually to include only the data required. It is using plain javascript / typescript and therefore is not dependent on any plugin.",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./css/*": "./css/*",
|