@tarragon-ui/js 0.1.0 → 0.2.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/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@tarragon-ui/js",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.2.0",
5
5
  "description": "Lightweight and simple Web Components for Tarragon UI.",
6
- "main": "dist/index.js",
7
- "module": "dist/index.js",
8
- "types": "dist/index.d.ts",
6
+ "main": "dist/tarragon-ui.js",
7
+ "module": "dist/tarragon-ui.js",
9
8
  "files": [
10
9
  "dist"
11
10
  ],
@@ -14,15 +13,14 @@
14
13
  },
15
14
  "devDependencies": {
16
15
  "typescript": "^5.9.3",
17
- "vite": "^7.1.9",
18
- "vite-plugin-dts": "^4.5.4"
16
+ "vite": "^7.1.9"
19
17
  },
20
18
  "exports": {
21
19
  ".": {
22
- "types": "./dist/index.d.ts",
23
- "import": "./dist/index.js",
24
- "require": "./dist/index.js",
25
- "default": "./dist/index.js"
20
+ "development": "./src/tarragon-ui.ts",
21
+ "import": "./dist/tarragon-ui.js",
22
+ "require": "./dist/tarragon-ui.js",
23
+ "default": "./dist/tarragon-ui.js"
26
24
  },
27
25
  "./package.json": "./package.json"
28
26
  },
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ajax-form.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ajax-form.d.ts","sourceRoot":"","sources":["../../src/components/ajax-form.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=ajax-html.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ajax-html.d.ts","sourceRoot":"","sources":["../../src/components/ajax-html.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=dropdown.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dropdown.d.ts","sourceRoot":"","sources":["../../src/components/dropdown.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=exclusive-checkbox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"exclusive-checkbox.d.ts","sourceRoot":"","sources":["../../src/components/exclusive-checkbox.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=select-all.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"select-all.d.ts","sourceRoot":"","sources":["../../src/components/select-all.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=until-selected.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"until-selected.d.ts","sourceRoot":"","sources":["../../src/components/until-selected.ts"],"names":[],"mappings":""}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=validate-form.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validate-form.d.ts","sourceRoot":"","sources":["../../src/components/validate-form.ts"],"names":[],"mappings":""}
@@ -1,95 +0,0 @@
1
- export type Result<Error, Value> = [Error, undefined] | [undefined, Value];
2
- export declare const libNamePrefix = "tui-";
3
- export declare const dataAttributePrefix = "data-tui-";
4
- export declare const focusableElementsSelector = "a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex=\"-1\"])";
5
- export declare const SECOND = 1000;
6
- export declare enum NativeEvent {
7
- Click = "click",
8
- DoubleClick = "dblclick",
9
- MouseUp = "mouseup",
10
- MouseDown = "mousedown",
11
- ContextMenu = "contextmenu",
12
- MouseWheel = "mousewheel",
13
- DOMMouseScroll = "DOMMouseScroll",
14
- MouseOver = "mouseover",
15
- MouseOut = "mouseout",
16
- MouseMove = "mousemove",
17
- SelectStart = "selectstart",
18
- SelectEnd = "selectend",
19
- KeyDown = "keydown",
20
- KeyPress = "keypress",
21
- KeyUp = "keyup",
22
- OrientationChange = "orientationchange",
23
- TouchStart = "touchstart",
24
- TouchMove = "touchmove",
25
- TouchEnd = "touchend",
26
- TouchCancel = "touchcancel",
27
- PointerDown = "pointerdown",
28
- PointerMove = "pointermove",
29
- PointerUp = "pointerup",
30
- PointerLeave = "pointerleave",
31
- PointerCancel = "pointercancel",
32
- GestureStart = "gesturestart",
33
- GestureChange = "gesturechange",
34
- GestureEnd = "gestureend",
35
- Focus = "focus",
36
- Blur = "blur",
37
- Change = "change",
38
- Reset = "reset",
39
- Select = "select",
40
- Submit = "submit",
41
- FocusIn = "focusin",
42
- FocusOut = "focusout",
43
- Load = "load",
44
- Unload = "unload",
45
- BeforeUnload = "beforeunload",
46
- Resize = "resize",
47
- Move = "move",
48
- DOMContentLoaded = "DOMContentLoaded",
49
- ReadyStateChange = "readystatechange",
50
- Error = "error",
51
- Abort = "abort",
52
- Scroll = "scroll",
53
- Input = "input",
54
- Toggle = "toggle",
55
- Close = "close"
56
- }
57
- export declare const Component: {
58
- readonly AjaxForm: {
59
- readonly Name: "tui-ajax-form";
60
- readonly Event: {
61
- readonly Form: "form";
62
- };
63
- };
64
- readonly AjaxHtml: {
65
- readonly Name: "tui-ajax-html";
66
- };
67
- readonly ExclusiveCheckbox: {
68
- readonly Name: "tui-exclusive-checkbox";
69
- readonly Event: {
70
- readonly Toggle: "toggle";
71
- };
72
- };
73
- readonly Dropdown: {
74
- readonly Name: "tui-dropdown";
75
- };
76
- readonly SelectAll: {
77
- readonly Name: "tui-select-all";
78
- readonly Event: {
79
- readonly Toggle: "toggle";
80
- };
81
- };
82
- readonly UntilSelected: {
83
- readonly Name: "tui-until-selected";
84
- readonly Event: {
85
- readonly Toggle: "toggle";
86
- };
87
- };
88
- readonly ValidateForm: {
89
- readonly Name: "tui-validate-form";
90
- readonly Event: {
91
- readonly Validate: "validate";
92
- };
93
- };
94
- };
95
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/const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W;IACjB,KAAK,UAAU;CACf;AAED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmBZ,CAAA"}
@@ -1,2 +0,0 @@
1
- export declare function emitEvent(componentName: string, eventId: string, element: Element, cancelable?: boolean): boolean;
2
- //# sourceMappingURL=emitEvent.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"emitEvent.d.ts","sourceRoot":"","sources":["../src/emitEvent.ts"],"names":[],"mappings":"AAAA,wBAAgB,SAAS,CACxB,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,OAAO,EAChB,UAAU,UAAQ,WAOlB"}
package/dist/fetch.d.ts DELETED
@@ -1,42 +0,0 @@
1
- import { Result } from './constants';
2
- type Method = 'GET' | 'PUT' | 'POST' | 'PATCH' | 'DELETE';
3
- type Headers = Record<string, string>;
4
- type FetchParameters = {
5
- queryParameters?: URLSearchParams;
6
- headers?: Headers;
7
- data?: BodyInit;
8
- };
9
- type FetchError = {
10
- message: string;
11
- error?: Error;
12
- status?: number;
13
- };
14
- export type FetchSuccess = {
15
- type: 'json';
16
- message?: string | null;
17
- redirectUrl?: string | null;
18
- queryKey?: string;
19
- } | {
20
- type: 'html';
21
- document: Document;
22
- };
23
- type FetchResult = Promise<Result<FetchError, FetchSuccess>>;
24
- export declare class FetchClient {
25
- private static instance;
26
- private baseUrl;
27
- private baseHeaders;
28
- constructor(baseUrl: string, headers?: Headers);
29
- static getInstance(baseUrl: string, headers?: Headers): FetchClient;
30
- isMethod(value: string): value is Method;
31
- private buildQueryString;
32
- private buildHeaders;
33
- send(url: string, method: Method, parameters: FetchParameters): FetchResult;
34
- get(url: string, parameters?: FetchParameters): FetchResult;
35
- put(url: string, parameters?: FetchParameters): FetchResult;
36
- post(url: string, parameters?: FetchParameters): FetchResult;
37
- patch(url: string, parameters?: FetchParameters): FetchResult;
38
- delete(url: string, parameters?: FetchParameters): FetchResult;
39
- }
40
- export declare const f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AAG,WAAW;IAkB1E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,MAAM;IAQxC,OAAO,CAAC,gBAAgB;IAOxB,OAAO,CAAC,YAAY;IAOd,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,eAAe,GAAG,WAAW;IAyE1E,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,WAAW;IAI3D,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,WAAW;IAI3D,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,WAAW;IAI5D,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,WAAW;IAI7D,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,CAAC,EAAE,eAAe,GAAG,WAAW;CAGrE;AAED,eAAO,MAAM,WAAW,aAEtB,CAAA"}
package/dist/index.d.ts DELETED
@@ -1 +0,0 @@
1
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,4BAA4B,CAAA;AACnC,OAAO,wBAAwB,CAAA;AAC/B,OAAO,wBAAwB,CAAA;AAC/B,OAAO,uBAAuB,CAAA;AAC9B,OAAO,iCAAiC,CAAA;AACxC,OAAO,yBAAyB,CAAA;AAChC,OAAO,6BAA6B,CAAA"}
@@ -1,57 +0,0 @@
1
- import { FetchSuccess } from './fetch';
2
- type QueryData = FetchSuccess | undefined;
3
- type QueryMeta = {
4
- staleTime: number;
5
- };
6
- export type QueryResult = {
7
- data: QueryData;
8
- isFetching: boolean;
9
- error: string | null;
10
- meta: QueryMeta;
11
- };
12
- type SubscriberCallback = (result: QueryResult) => void;
13
- declare class QueryCache {
14
- private static instance;
15
- private cache;
16
- private subscriptions;
17
- private refetchIntervals;
18
- static getInstance(): QueryCache;
19
- private updateQueryState;
20
- private notifySubscribers;
21
- private manageRefetchInterval;
22
- /**
23
- * Subscribes to a query key.
24
- * @param key The query key.
25
- * @param callback The function to call when the query's data or state updates.
26
- * @param options Query options that might affect initial state or refetch behavior.
27
- * @returns An unsubscribe function.
28
- */
29
- subscribe(key: string, callback: SubscriberCallback, meta?: Partial<QueryMeta>): () => void;
30
- /**
31
- * Gets the current state of a query.
32
- * @param key The query key.
33
- * @returns The current QueryResult, or undefined if not initialized.
34
- */
35
- get(key: string): QueryResult | undefined;
36
- /**
37
- * Sets the data for a query key and notifies subscribers.
38
- * This is used for pushing data without fetching (e.g., from mutations/forms).
39
- * @param key The query key.
40
- * @param data The data to set.
41
- * @param options Options for this query.
42
- */
43
- setQueryData(key: string, data: QueryData, meta?: Partial<QueryMeta>): void;
44
- /**
45
- * Fetches data for a query key. This is an internal method called by subscribe/invalidate.
46
- * It ensures only one fetch is active at a time for a given key.
47
- */
48
- private fetchQuery;
49
- /**
50
- * Invalidates a query, triggering an immediate refetch
51
- * @param key The query key.
52
- */
53
- invalidateQuery(key: string): void;
54
- }
55
- export declare const queryCache: QueryCache;
56
- export {};
57
- //# sourceMappingURL=query-cache.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"query-cache.d.ts","sourceRoot":"","sources":["../src/query-cache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAe,MAAM,SAAS,CAAA;AAEnD,KAAK,SAAS,GAAG,YAAY,GAAG,SAAS,CAAA;AACzC,KAAK,SAAS,GAAG;IAChB,SAAS,EAAE,MAAM,CAAA;CACjB,CAAA;AAGD,MAAM,MAAM,WAAW,GAAG;IACzB,IAAI,EAAE,SAAS,CAAA;IACf,UAAU,EAAE,OAAO,CAAA;IACnB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,IAAI,EAAE,SAAS,CAAA;CACf,C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