snice 2.2.2 → 2.3.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.
- package/README.md +17 -10
- package/dist/components/accordion/snice-accordion-item.js +3 -3
- package/dist/components/accordion/snice-accordion-item.js.map +1 -1
- package/dist/components/accordion/snice-accordion.js +1 -1
- package/dist/components/accordion/snice-accordion.js.map +1 -1
- package/dist/components/alert/snice-alert.js +5 -5
- package/dist/components/alert/snice-alert.js.map +1 -1
- package/dist/components/avatar/snice-avatar.js +7 -7
- package/dist/components/avatar/snice-avatar.js.map +1 -1
- package/dist/components/badge/snice-badge.js +10 -10
- package/dist/components/badge/snice-badge.js.map +1 -1
- package/dist/components/breadcrumbs/snice-breadcrumbs.js +3 -3
- package/dist/components/breadcrumbs/snice-breadcrumbs.js.map +1 -1
- package/dist/components/breadcrumbs/snice-crumb.js +5 -5
- package/dist/components/breadcrumbs/snice-crumb.js.map +1 -1
- package/dist/components/button/snice-button.js +12 -12
- package/dist/components/button/snice-button.js.map +1 -1
- package/dist/components/card/snice-card.js +5 -5
- package/dist/components/card/snice-card.js.map +1 -1
- package/dist/components/checkbox/snice-checkbox.js +9 -9
- package/dist/components/checkbox/snice-checkbox.js.map +1 -1
- package/dist/components/chip/snice-chip.js +8 -8
- package/dist/components/chip/snice-chip.js.map +1 -1
- package/dist/components/date-picker/snice-date-picker.js +18 -18
- package/dist/components/date-picker/snice-date-picker.js.map +1 -1
- package/dist/components/divider/snice-divider.js +8 -8
- package/dist/components/divider/snice-divider.js.map +1 -1
- package/dist/components/drawer/snice-drawer.js +9 -9
- package/dist/components/drawer/snice-drawer.js.map +1 -1
- package/dist/components/input/snice-input.js +24 -24
- package/dist/components/input/snice-input.js.map +1 -1
- package/dist/components/layout/snice-layout-card.js +2 -2
- package/dist/components/layout/snice-layout-card.js.map +1 -1
- package/dist/components/layout/snice-layout-centered.js +1 -1
- package/dist/components/layout/snice-layout-centered.js.map +1 -1
- package/dist/components/layout/snice-layout-fullscreen.js +1 -1
- package/dist/components/layout/snice-layout-fullscreen.js.map +1 -1
- package/dist/components/layout/snice-layout-sidebar.js +1 -1
- package/dist/components/layout/snice-layout-sidebar.js.map +1 -1
- package/dist/components/layout/snice-layout-split.js +2 -2
- package/dist/components/layout/snice-layout-split.js.map +1 -1
- package/dist/components/login/snice-login.js +8 -8
- package/dist/components/login/snice-login.js.map +1 -1
- package/dist/components/modal/snice-modal.js +7 -7
- package/dist/components/modal/snice-modal.js.map +1 -1
- package/dist/components/pagination/snice-pagination.js +9 -9
- package/dist/components/pagination/snice-pagination.js.map +1 -1
- package/dist/components/progress/snice-progress.js +11 -11
- package/dist/components/progress/snice-progress.js.map +1 -1
- package/dist/components/radio/snice-radio.js +8 -8
- package/dist/components/radio/snice-radio.js.map +1 -1
- package/dist/components/select/snice-option.js +5 -5
- package/dist/components/select/snice-option.js.map +1 -1
- package/dist/components/select/snice-select.js +14 -14
- package/dist/components/select/snice-select.js.map +1 -1
- package/dist/components/skeleton/snice-skeleton.js +6 -6
- package/dist/components/skeleton/snice-skeleton.js.map +1 -1
- package/dist/components/switch/snice-switch.js +10 -10
- package/dist/components/switch/snice-switch.js.map +1 -1
- package/dist/components/table/snice-cell-boolean.js +8 -8
- package/dist/components/table/snice-cell-boolean.js.map +1 -1
- package/dist/components/table/snice-cell-date.js +8 -8
- package/dist/components/table/snice-cell-date.js.map +1 -1
- package/dist/components/table/snice-cell-duration.js +3 -3
- package/dist/components/table/snice-cell-duration.js.map +1 -1
- package/dist/components/table/snice-cell-filesize.js +3 -3
- package/dist/components/table/snice-cell-filesize.js.map +1 -1
- package/dist/components/table/snice-cell-number.js +9 -9
- package/dist/components/table/snice-cell-number.js.map +1 -1
- package/dist/components/table/snice-cell-progress.js +3 -3
- package/dist/components/table/snice-cell-progress.js.map +1 -1
- package/dist/components/table/snice-cell-rating.js +3 -3
- package/dist/components/table/snice-cell-rating.js.map +1 -1
- package/dist/components/table/snice-cell-sparkline.js +13 -13
- package/dist/components/table/snice-cell-sparkline.js.map +1 -1
- package/dist/components/table/snice-cell-text.js +4 -4
- package/dist/components/table/snice-cell-text.js.map +1 -1
- package/dist/components/table/snice-cell.js +2 -2
- package/dist/components/table/snice-cell.js.map +1 -1
- package/dist/components/table/snice-column.js +10 -10
- package/dist/components/table/snice-column.js.map +1 -1
- package/dist/components/table/snice-header.js +5 -5
- package/dist/components/table/snice-header.js.map +1 -1
- package/dist/components/table/snice-row.js +5 -5
- package/dist/components/table/snice-row.js.map +1 -1
- package/dist/components/table/snice-table.js +7 -7
- package/dist/components/table/snice-table.js.map +1 -1
- package/dist/components/tabs/snice-tab-panel.js +5 -5
- package/dist/components/tabs/snice-tab-panel.js.map +1 -1
- package/dist/components/tabs/snice-tab.js +2 -2
- package/dist/components/tabs/snice-tab.js.map +1 -1
- package/dist/components/tabs/snice-tabs.js +4 -4
- package/dist/components/tabs/snice-tabs.js.map +1 -1
- package/dist/components/toast/snice-toast-container.js +1 -1
- package/dist/components/toast/snice-toast-container.js.map +1 -1
- package/dist/components/toast/snice-toast.js +4 -4
- package/dist/components/toast/snice-toast.js.map +1 -1
- package/dist/components/tooltip/snice-tooltip.js +11 -11
- package/dist/components/tooltip/snice-tooltip.js.map +1 -1
- package/dist/index.cjs +268 -215
- package/dist/index.cjs.map +1 -1
- package/dist/index.esm.js +268 -215
- package/dist/index.esm.js.map +1 -1
- package/dist/index.iife.js +268 -215
- package/dist/index.iife.js.map +1 -1
- package/dist/symbols.cjs.map +1 -1
- package/dist/symbols.esm.js +1 -1
- package/dist/symbols.esm.js.map +1 -1
- package/dist/transitions.cjs.map +1 -1
- package/dist/transitions.esm.js +1 -1
- package/dist/transitions.esm.js.map +1 -1
- package/dist/types/controller.d.ts +1 -7
- package/dist/types/element.d.ts +3 -44
- package/dist/types/events.d.ts +2 -26
- package/dist/types/global.d.ts +1 -5
- package/dist/types/index.d.ts +2 -8
- package/dist/types/observe.d.ts +1 -16
- package/dist/types/request-response.d.ts +2 -28
- package/dist/types/router.d.ts +2 -81
- package/dist/types/testing.d.ts +4 -0
- package/dist/types/transitions.d.ts +2 -30
- package/dist/types/types/DispatchOptions.d.ts +10 -0
- package/dist/types/types/IController.d.ts +8 -0
- package/dist/types/types/ObserveOptions.d.ts +16 -0
- package/dist/types/types/OnOptions.d.ts +16 -0
- package/dist/types/types/PageOptions.d.ts +30 -0
- package/dist/types/types/PartOptions.d.ts +4 -0
- package/dist/types/types/PropertyConverter.d.ts +4 -0
- package/dist/types/types/PropertyOptions.d.ts +8 -0
- package/dist/types/types/QueryOptions.d.ts +4 -0
- package/dist/types/types/RequestOptions.d.ts +18 -0
- package/dist/types/types/RespondOptions.d.ts +10 -0
- package/dist/types/types/RouterInstance.d.ts +10 -0
- package/dist/types/types/RouterOptions.d.ts +32 -0
- package/dist/types/types/SimpleArray.d.ts +17 -0
- package/dist/types/types/SniceElement.d.ts +8 -0
- package/dist/types/types/SniceGlobal.d.ts +5 -0
- package/dist/types/types/Transition.d.ts +33 -0
- package/dist/types/types/index.d.ts +17 -0
- package/dist/types/utils.d.ts +24 -0
- package/package.json +6 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generic transition system for animating between elements
|
|
3
|
+
*/
|
|
4
|
+
export interface Transition {
|
|
5
|
+
/**
|
|
6
|
+
* Name of the transition (for identification)
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Duration of the out transition in ms
|
|
11
|
+
*/
|
|
12
|
+
outDuration?: number;
|
|
13
|
+
/**
|
|
14
|
+
* Duration of the in transition in ms
|
|
15
|
+
*/
|
|
16
|
+
inDuration?: number;
|
|
17
|
+
/**
|
|
18
|
+
* CSS properties for the out transition (as string)
|
|
19
|
+
* Example: 'opacity: 0; transform: scale(0.9)'
|
|
20
|
+
*/
|
|
21
|
+
out?: string;
|
|
22
|
+
/**
|
|
23
|
+
* CSS properties for the in transition (as string)
|
|
24
|
+
* Example: 'opacity: 1; transform: scale(1)'
|
|
25
|
+
*/
|
|
26
|
+
in?: string;
|
|
27
|
+
/**
|
|
28
|
+
* Transition mode:
|
|
29
|
+
* - 'sequential': out transition completes before in transition starts
|
|
30
|
+
* - 'simultaneous': both transitions happen at the same time
|
|
31
|
+
*/
|
|
32
|
+
mode?: 'sequential' | 'simultaneous';
|
|
33
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export * from './QueryOptions';
|
|
2
|
+
export * from './PropertyOptions';
|
|
3
|
+
export * from './PropertyConverter';
|
|
4
|
+
export * from './SniceElement';
|
|
5
|
+
export * from './PartOptions';
|
|
6
|
+
export * from './SimpleArray';
|
|
7
|
+
export * from './RouterOptions';
|
|
8
|
+
export * from './PageOptions';
|
|
9
|
+
export * from './RouterInstance';
|
|
10
|
+
export * from './OnOptions';
|
|
11
|
+
export * from './DispatchOptions';
|
|
12
|
+
export * from './IController';
|
|
13
|
+
export * from './Transition';
|
|
14
|
+
export * from './ObserveOptions';
|
|
15
|
+
export * from './RequestOptions';
|
|
16
|
+
export * from './RespondOptions';
|
|
17
|
+
export * from './SniceGlobal';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { PropertyOptions } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Detects the type constructor from an initial value
|
|
4
|
+
* @param initialValue - The default value assigned to a property field (e.g., `name = "default"` -> "default")
|
|
5
|
+
* @returns The constructor function (String, Number, Boolean, etc.) or undefined if type can't be determined
|
|
6
|
+
*/
|
|
7
|
+
export declare function detectType(initialValue: any): any;
|
|
8
|
+
/**
|
|
9
|
+
* Parses an attribute value based on the property type
|
|
10
|
+
* @param attributeValue - The raw string value from the HTML attribute (e.g., "123", "true", "hello")
|
|
11
|
+
* @param propertyOptions - The options from @property decorator (contains explicit type, attribute name, etc.)
|
|
12
|
+
* @param currentValue - The current stored value of the property (used for type inference when no explicit type)
|
|
13
|
+
* @param initialValue - The default value assigned to the property field (used for type detection as fallback)
|
|
14
|
+
* @returns The parsed value in the correct JavaScript type
|
|
15
|
+
*/
|
|
16
|
+
export declare function parseAttributeValue(attributeValue: string | null, propertyOptions: PropertyOptions, currentValue?: any, initialValue?: any): any;
|
|
17
|
+
/**
|
|
18
|
+
* Converts a property value to its attribute string representation
|
|
19
|
+
* @param value - The property value to convert
|
|
20
|
+
* @param propertyOptions - The options from @property decorator
|
|
21
|
+
* @param initialValue - The default value assigned to the property field (used for type detection)
|
|
22
|
+
* @returns The string representation for the HTML attribute, or null if value should remove attribute
|
|
23
|
+
*/
|
|
24
|
+
export declare function valueToAttribute(value: any, propertyOptions: PropertyOptions, initialValue?: any): string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "snice",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Imperative TypeScript framework for building vanilla web components with decorators, routing, and controllers. No virtual DOM, no build complexity.",
|
|
6
6
|
"main": "dist/index.cjs",
|
|
@@ -78,13 +78,16 @@
|
|
|
78
78
|
"dev": "vite",
|
|
79
79
|
"build": "rm -rf dist && rollup -c && npm run build:types",
|
|
80
80
|
"build:types": "tsc --project components/tsconfig.json --emitDeclarationOnly",
|
|
81
|
+
"build:test": "rollup -c rollup.config.test.js",
|
|
81
82
|
"preview": "vite preview",
|
|
82
83
|
"test": "vitest run",
|
|
83
84
|
"test:watch": "vitest",
|
|
84
85
|
"test:ui": "vitest --ui",
|
|
85
86
|
"test:coverage": "vitest --coverage",
|
|
86
|
-
"test:
|
|
87
|
-
"
|
|
87
|
+
"test:src": "vitest run",
|
|
88
|
+
"test:built": "npm run build:test && TEST_BUILT=true vitest run",
|
|
89
|
+
"test:all": "npm run test:src && npm run test:built",
|
|
90
|
+
"prerelease": "npm run build",
|
|
88
91
|
"release": "semantic-release --no-ci",
|
|
89
92
|
"release:dry": "semantic-release --dry-run --no-ci"
|
|
90
93
|
},
|