snice 1.13.7 → 1.13.9
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/components/accordion/snice-accordion-item.ts +1 -1
- package/components/accordion/snice-accordion.ts +1 -1
- package/components/alert/snice-alert.ts +1 -1
- package/components/avatar/snice-avatar.ts +1 -1
- package/components/badge/snice-badge.ts +1 -1
- package/components/breadcrumbs/snice-breadcrumbs.ts +1 -1
- package/components/breadcrumbs/snice-crumb.ts +1 -1
- package/components/button/snice-button.ts +1 -1
- package/components/card/snice-card.ts +1 -1
- package/components/checkbox/snice-checkbox.ts +1 -1
- package/components/chip/snice-chip.ts +1 -1
- package/components/date-picker/snice-date-picker.ts +1 -1
- package/components/divider/snice-divider.ts +1 -1
- package/components/drawer/snice-drawer.ts +1 -1
- package/components/input/snice-input.ts +1 -1
- package/components/layout/snice-layout-blog.ts +1 -1
- package/components/layout/snice-layout-card.ts +1 -1
- package/components/layout/snice-layout-centered.ts +1 -1
- package/components/layout/snice-layout-dashboard.ts +1 -1
- package/components/layout/snice-layout-fullscreen.ts +1 -1
- package/components/layout/snice-layout-landing.ts +1 -1
- package/components/layout/snice-layout-minimal.ts +1 -1
- package/components/layout/snice-layout-sidebar.ts +1 -1
- package/components/layout/snice-layout-split.ts +1 -1
- package/components/layout/snice-layout.ts +1 -1
- package/components/layout/snice-layout.types.ts +1 -1
- package/components/login/snice-login.ts +1 -1
- package/components/modal/snice-modal.ts +1 -1
- package/components/pagination/snice-pagination.ts +1 -1
- package/components/progress/snice-progress.ts +1 -1
- package/components/radio/snice-radio.ts +1 -1
- package/components/select/snice-option.ts +1 -1
- package/components/select/snice-select.ts +1 -1
- package/components/skeleton/snice-skeleton.ts +1 -1
- package/components/switch/snice-switch.ts +1 -1
- package/components/table/snice-cell-boolean.ts +1 -1
- package/components/table/snice-cell-date.ts +1 -1
- package/components/table/snice-cell-duration.ts +1 -1
- package/components/table/snice-cell-filesize.ts +1 -1
- package/components/table/snice-cell-number.ts +1 -1
- package/components/table/snice-cell-progress.ts +1 -1
- package/components/table/snice-cell-rating.ts +1 -1
- package/components/table/snice-cell-sparkline.ts +1 -1
- package/components/table/snice-cell-text.ts +1 -1
- package/components/table/snice-cell.ts +1 -1
- package/components/table/snice-column.ts +1 -1
- package/components/table/snice-header.ts +1 -1
- package/components/table/snice-progress.ts +1 -1
- package/components/table/snice-rating.ts +1 -1
- package/components/table/snice-row.ts +1 -1
- package/components/table/snice-table.ts +1 -1
- package/components/tabs/snice-tab-panel.ts +1 -1
- package/components/tabs/snice-tab.ts +1 -1
- package/components/tabs/snice-tabs.ts +1 -1
- package/components/toast/snice-toast-container.ts +1 -1
- package/components/toast/snice-toast.ts +1 -1
- package/components/tooltip/snice-tooltip.ts +1 -1
- package/components/tsconfig.json +18 -0
- package/dist/controller.d.ts +61 -0
- package/dist/controller.js +297 -0
- package/dist/controller.js.map +1 -0
- package/dist/element.d.ts +77 -0
- package/dist/element.js +805 -0
- package/dist/element.js.map +1 -0
- package/dist/events.d.ts +37 -0
- package/dist/events.js +289 -0
- package/dist/events.js.map +1 -0
- package/dist/global.d.ts +7 -0
- package/dist/global.js +23 -0
- package/dist/global.js.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -0
- package/dist/observe.d.ts +26 -0
- package/dist/observe.js +329 -0
- package/dist/observe.js.map +1 -0
- package/dist/request-response.d.ts +46 -0
- package/dist/request-response.js +267 -0
- package/dist/request-response.js.map +1 -0
- package/dist/router.d.ts +87 -0
- package/dist/router.js +375 -0
- package/dist/router.js.map +1 -0
- package/dist/symbols.d.ts +29 -0
- package/dist/symbols.js +42 -0
- package/dist/symbols.js.map +1 -0
- package/dist/transitions.d.ts +50 -0
- package/dist/transitions.js +199 -0
- package/dist/transitions.js.map +1 -0
- package/package.json +8 -9
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, ready, dispatch, observe } from '
|
|
1
|
+
import { element, property, query, on, watch, ready, dispatch, observe } from 'snice';
|
|
2
2
|
import css from './snice-accordion-item.css?inline';
|
|
3
3
|
import type { SniceAccordionItemElement } from './snice-accordion.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, on, dispatch, ready, queryAll } from '
|
|
1
|
+
import { element, property, on, dispatch, ready, queryAll } from 'snice';
|
|
2
2
|
import css from './snice-accordion.css?inline';
|
|
3
3
|
import type { SniceAccordionElement, SniceAccordionItemElement, AccordionOpenEvent, AccordionCloseEvent } from './snice-accordion.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query, on, dispatch, part } from '
|
|
1
|
+
import { element, property, watch, query, on, dispatch, part } from 'snice';
|
|
2
2
|
import css from './snice-alert.css?inline';
|
|
3
3
|
import type { AlertVariant, AlertSize, SniceAlertElement } from './snice-alert.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query, ready, on, part } from '
|
|
1
|
+
import { element, property, watch, query, ready, on, part } from 'snice';
|
|
2
2
|
import css from './snice-avatar.css?inline';
|
|
3
3
|
import type { AvatarSize, AvatarShape, SniceAvatarElement } from './snice-avatar.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query, ready, part } from '
|
|
1
|
+
import { element, property, watch, query, ready, part } from 'snice';
|
|
2
2
|
import css from './snice-badge.css?inline';
|
|
3
3
|
import type { BadgeVariant, BadgePosition, BadgeSize, SniceBadgeElement } from './snice-badge.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query, dispatch, on, ready } from '
|
|
1
|
+
import { element, property, watch, query, dispatch, on, ready } from 'snice';
|
|
2
2
|
import css from './snice-breadcrumbs.css?inline';
|
|
3
3
|
import type { BreadcrumbItem, BreadcrumbSeparator, BreadcrumbSize, SniceBreadcrumbsElement } from './snice-breadcrumbs.types';
|
|
4
4
|
import type { SniceCrumbElement } from './snice-breadcrumbs.types';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, dispatch, watch } from '
|
|
1
|
+
import { element, property, query, on, dispatch, watch } from 'snice';
|
|
2
2
|
import css from './snice-button.css?inline';
|
|
3
3
|
import type { ButtonVariant, ButtonSize, IconPlacement, SniceButtonElement } from './snice-button.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready } from 'snice';
|
|
2
2
|
import css from './snice-checkbox.css?inline';
|
|
3
3
|
import type { CheckboxSize, SniceCheckboxElement } from './snice-checkbox.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query, on, dispatch } from '
|
|
1
|
+
import { element, property, watch, query, on, dispatch } from 'snice';
|
|
2
2
|
import css from './snice-chip.css?inline';
|
|
3
3
|
import type { ChipVariant, ChipSize, SniceChipElement } from './snice-chip.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready } from 'snice';
|
|
2
2
|
import css from './snice-date-picker.css?inline';
|
|
3
3
|
import type { DatePickerSize, DatePickerVariant, DateFormat, SniceDatePickerElement, DatePickerValue } from './snice-date-picker.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, query } from '
|
|
1
|
+
import { element, property, watch, query } from 'snice';
|
|
2
2
|
import css from './snice-divider.css?inline';
|
|
3
3
|
import type { DividerOrientation, DividerVariant, DividerAlign, DividerSpacing, SniceDividerElement } from './snice-divider.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready, dispose } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready, dispose } from 'snice';
|
|
2
2
|
import css from './snice-drawer.css?inline';
|
|
3
3
|
import type { DrawerPosition, DrawerSize, SniceDrawerElement } from './snice-drawer.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready } from 'snice';
|
|
2
2
|
import css from './snice-input.css?inline';
|
|
3
3
|
import type { InputType, InputSize, InputVariant, SniceInputElement } from './snice-input.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, queryAll, on, dispatch, request, type Response } from '
|
|
1
|
+
import { element, property, query, queryAll, on, dispatch, request, type Response } from 'snice';
|
|
2
2
|
import css from './snice-login.css?inline';
|
|
3
3
|
import type { LoginVariant, LoginSize, LoginCredentials, LoginResult, SniceLoginElement } from './snice-login.types';
|
|
4
4
|
import '../alert/snice-alert';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, ready, dispatch } from '
|
|
1
|
+
import { element, property, query, on, watch, ready, dispatch } from 'snice';
|
|
2
2
|
import css from './snice-modal.css?inline';
|
|
3
3
|
import type { ModalSize, SniceModalElement } from './snice-modal.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query, dispatch } from '
|
|
1
|
+
import { element, property, watch, ready, query, dispatch } from 'snice';
|
|
2
2
|
import css from './snice-progress.css?inline';
|
|
3
3
|
import type { ProgressVariant, ProgressSize, ProgressColor, SniceProgressElement } from './snice-progress.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready } from 'snice';
|
|
2
2
|
import css from './snice-radio.css?inline';
|
|
3
3
|
import type { RadioSize, SniceRadioElement } from './snice-radio.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, queryAll, on, watch, dispatch, ready, dispose } from '
|
|
1
|
+
import { element, property, query, queryAll, on, watch, dispatch, ready, dispose } from 'snice';
|
|
2
2
|
import css from './snice-select.css?inline';
|
|
3
3
|
import type { SelectSize, SelectOption, SniceSelectElement } from './snice-select.types';
|
|
4
4
|
import './snice-option';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready } from '
|
|
1
|
+
import { element, property, watch, ready } from 'snice';
|
|
2
2
|
import css from './snice-skeleton.css?inline';
|
|
3
3
|
import type { SkeletonVariant, SkeletonAnimation, SniceSkeletonElement } from './snice-skeleton.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, dispatch, ready } from '
|
|
1
|
+
import { element, property, query, on, watch, dispatch, ready } from 'snice';
|
|
2
2
|
import css from './snice-switch.css?inline';
|
|
3
3
|
import type { SwitchSize, SniceSwitchElement } from './snice-switch.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { BooleanFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { DateFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { NumberFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { ProgressFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
import './snice-progress';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { RatingFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
import './snice-rating';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query, SimpleArray } from '
|
|
1
|
+
import { element, property, watch, ready, query, SimpleArray } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { SparklineFormat, SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, watch, ready, query } from '
|
|
1
|
+
import { element, property, watch, ready, query } from 'snice';
|
|
2
2
|
import css from './snice-cell.css?inline';
|
|
3
3
|
import type { SniceCellElement, ColumnType, ColumnAlign, ColumnDefinition } from './snice-table.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, dispatch } from '
|
|
1
|
+
import { element, property, query, on, dispatch } from 'snice';
|
|
2
2
|
import css from './snice-tab.css?inline';
|
|
3
3
|
import type { TabSelectDetail, TabCloseDetail, SniceTabElement } from './snice-tabs.types';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, queryAll, on, watch, ready, dispatch } from '
|
|
1
|
+
import { element, property, query, queryAll, on, watch, ready, dispatch } from 'snice';
|
|
2
2
|
import css from './snice-tabs.css?inline';
|
|
3
3
|
import type { TabsPlacement, SniceTabElement, SniceTabPanelElement, TabChangeDetail, TabSelectDetail } from './snice-tabs.types';
|
|
4
4
|
import { transitions } from '../transitions';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, ready, dispose } from '
|
|
1
|
+
import { element, property, ready, dispose } from 'snice';
|
|
2
2
|
import { getSymbol } from '../symbols';
|
|
3
3
|
import type { ToastPosition, ToastOptions, ToastEventDetail, ToastResponseEventDetail, SniceToastContainerElement } from './snice-toast.types';
|
|
4
4
|
import './snice-toast';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { element, property, query, on, watch, ready, dispose } from '
|
|
1
|
+
import { element, property, query, on, watch, ready, dispose } from 'snice';
|
|
2
2
|
import css from './snice-tooltip.css?inline';
|
|
3
3
|
import portalCss from './snice-tooltip-portal.css?inline';
|
|
4
4
|
import type { TooltipPosition, TooltipTrigger, SniceTooltipElement } from './snice-tooltip.types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"noEmit": false,
|
|
5
|
+
"outDir": "../dist/components",
|
|
6
|
+
"rootDir": ".",
|
|
7
|
+
"declaration": true,
|
|
8
|
+
"emitDeclarationOnly": false,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"noUnusedLocals": false,
|
|
11
|
+
"noUnusedParameters": false,
|
|
12
|
+
"paths": {
|
|
13
|
+
"snice": ["../dist/index.ts", "../src/index.ts"]
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"include": ["."],
|
|
17
|
+
"exclude": ["**/*.test.ts", "**/*.spec.ts", "**/*.html", "**/demo*", "**/*.md"]
|
|
18
|
+
}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
type Maybe<T> = T | null | undefined;
|
|
2
|
+
export interface IController<T extends HTMLElement = HTMLElement> {
|
|
3
|
+
element: Maybe<T>;
|
|
4
|
+
attach(element: T): void | Promise<void>;
|
|
5
|
+
detach(element: T): void | Promise<void>;
|
|
6
|
+
}
|
|
7
|
+
export type ControllerClass<T extends HTMLElement = HTMLElement> = new () => IController<T>;
|
|
8
|
+
declare class ControllerScope {
|
|
9
|
+
private cleanupFns;
|
|
10
|
+
private pendingOperations;
|
|
11
|
+
register(key: string, cleanup: Function): void;
|
|
12
|
+
unregister(key: string): void;
|
|
13
|
+
cleanup(): Promise<void>;
|
|
14
|
+
runOperation<T>(operation: () => Promise<T>): Promise<T>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Decorator to register a controller class with a name
|
|
18
|
+
* @param name The name to register the controller under
|
|
19
|
+
*/
|
|
20
|
+
export declare function controller(name: string): <T extends ControllerClass>(constructor: T) => T;
|
|
21
|
+
/**
|
|
22
|
+
* Attaches a controller to an element
|
|
23
|
+
* @param element The element to attach the controller to
|
|
24
|
+
* @param controllerName The name of the controller to attach
|
|
25
|
+
*/
|
|
26
|
+
export declare function attachController(element: HTMLElement, controllerName: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Detaches a controller from an element
|
|
29
|
+
* @param element The element to detach the controller from
|
|
30
|
+
*/
|
|
31
|
+
export declare function detachController(element: HTMLElement): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Gets the controller instance attached to an element
|
|
34
|
+
* @param element The element to get the controller from
|
|
35
|
+
* @returns The controller instance or undefined
|
|
36
|
+
*/
|
|
37
|
+
export declare function getController<T extends IController = IController>(element: HTMLElement): T | undefined;
|
|
38
|
+
/**
|
|
39
|
+
* Gets the controller scope for an element
|
|
40
|
+
* @param element The element to get the scope from
|
|
41
|
+
* @returns The controller scope or undefined
|
|
42
|
+
*/
|
|
43
|
+
export declare function getControllerScope(element: HTMLElement): ControllerScope | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Enable controller support for native HTML elements
|
|
46
|
+
* This sets up a MutationObserver to watch for controller attributes
|
|
47
|
+
* on non-custom elements (elements without hyphens in their tag names)
|
|
48
|
+
*/
|
|
49
|
+
export declare function useNativeElementControllers(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Stop watching for native element controllers
|
|
52
|
+
*/
|
|
53
|
+
export declare function cleanupNativeElementControllers(): void;
|
|
54
|
+
/**
|
|
55
|
+
* Registers a cleanup function for the current controller
|
|
56
|
+
* @param controller The controller instance
|
|
57
|
+
* @param key A unique key for this cleanup function
|
|
58
|
+
* @param cleanup The cleanup function to register
|
|
59
|
+
*/
|
|
60
|
+
export declare function registerControllerCleanup(controller: IController, key: string, cleanup: Function): void;
|
|
61
|
+
export {};
|