@telperion/elements 1.0.0 → 1.1.1
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/.build-manifest.json +61 -0
- package/README.md +34 -8
- package/drag-drop/drag-element.cjs +59 -60
- package/drag-drop/drag-element.cjs.map +1 -0
- package/drag-drop/drag-element.js +8 -8
- package/drag-drop/drag-element.js.map +1 -1
- package/drag-drop/drag-handle-element.cjs +19 -19
- package/drag-drop/drag-handle-element.cjs.map +1 -0
- package/drag-drop/drag-handle-element.js +8 -7
- package/drag-drop/drag-handle-element.js.map +1 -1
- package/drag-drop/dropzone-element.cjs +32 -32
- package/drag-drop/dropzone-element.cjs.map +1 -0
- package/drag-drop/dropzone-element.js +6 -5
- package/drag-drop/dropzone-element.js.map +1 -1
- package/drag-drop/index.cjs +23 -11
- package/drag-drop/index.cjs.map +1 -0
- package/drag-drop/{drag-element.d.ts → index.d.cts} +73 -5
- package/drag-drop/index.d.ts +172 -6
- package/drag-drop/index.js +4 -5
- package/drag-drop/index.js.map +1 -1
- package/drag-drop/private-props.cjs +10 -6
- package/drag-drop/private-props.cjs.map +1 -0
- package/drag-drop/private-props.js +4 -3
- package/drag-drop/private-props.js.map +1 -1
- package/drag-drop/tha-drag-event.cjs +8 -6
- package/drag-drop/tha-drag-event.cjs.map +1 -0
- package/drag-drop/tha-drag-event.js +4 -2
- package/drag-drop/tha-drag-event.js.map +1 -1
- package/fesm/elements.mjs +1939 -0
- package/fesm/elements.mjs.map +1 -0
- package/icon/icon-element.cjs +136 -37
- package/icon/icon-element.cjs.map +1 -0
- package/icon/icon-element.js +105 -5
- package/icon/icon-element.js.map +1 -1
- package/icon/index.cjs +16 -5
- package/icon/index.cjs.map +1 -0
- package/icon/index.d.cts +89 -0
- package/icon/index.d.ts +89 -1
- package/icon/index.js +2 -2
- package/icon/index.js.map +1 -1
- package/icon/simple-icons-sprite.cjs +129 -0
- package/icon/simple-icons-sprite.cjs.map +1 -0
- package/icon/simple-icons-sprite.js +124 -0
- package/icon/simple-icons-sprite.js.map +1 -0
- package/iife/drag-drop/index.js +73 -0
- package/iife/drag-drop/index.js.map +1 -0
- package/iife/elements.js +180 -0
- package/iife/elements.js.map +1 -0
- package/iife/icon/index.js +35 -0
- package/iife/icon/index.js.map +1 -0
- package/iife/router/index.js +142 -0
- package/iife/router/index.js.map +1 -0
- package/index.cjs +53 -11
- package/index.cjs.map +1 -0
- package/index.d.cts +6 -0
- package/index.d.ts +6 -6
- package/index.js +10 -9
- package/index.js.map +1 -1
- package/package.json +45 -83
- package/router/history-managed.cjs +22 -18
- package/router/history-managed.cjs.map +1 -0
- package/router/history-managed.js +9 -7
- package/router/history-managed.js.map +1 -1
- package/router/history.cjs +20 -16
- package/router/history.cjs.map +1 -0
- package/router/history.js +8 -6
- package/router/history.js.map +1 -1
- package/router/index.cjs +36 -15
- package/router/index.cjs.map +1 -0
- package/router/index.d.cts +895 -0
- package/router/index.d.ts +895 -6
- package/router/index.js +6 -7
- package/router/index.js.map +1 -1
- package/router/signal-watcher-lit-element.cjs +9 -6
- package/router/signal-watcher-lit-element.cjs.map +1 -0
- package/router/signal-watcher-lit-element.js +5 -3
- package/router/signal-watcher-lit-element.js.map +1 -1
- package/router/tha-route.cjs +25 -22
- package/router/tha-route.cjs.map +1 -0
- package/router/tha-route.js +8 -7
- package/router/tha-route.js.map +1 -1
- package/router/tha-router-config.cjs +17 -17
- package/router/tha-router-config.cjs.map +1 -0
- package/router/tha-router-config.js +8 -7
- package/router/tha-router-config.js.map +1 -1
- package/router/tha-router-link.cjs +36 -36
- package/router/tha-router-link.cjs.map +1 -0
- package/router/tha-router-link.js +9 -8
- package/router/tha-router-link.js.map +1 -1
- package/router/tha-router-outlet.cjs +51 -48
- package/router/tha-router-outlet.cjs.map +1 -0
- package/router/tha-router-outlet.js +12 -11
- package/router/tha-router-outlet.js.map +1 -1
- package/router/tha-router-param.cjs +21 -21
- package/router/tha-router-param.cjs.map +1 -0
- package/router/tha-router-param.js +7 -6
- package/router/tha-router-param.js.map +1 -1
- package/router/tha-router.cjs +33 -33
- package/router/tha-router.cjs.map +1 -0
- package/router/tha-router.js +11 -10
- package/router/tha-router.js.map +1 -1
- package/bundle.js +0 -164
- package/bundle.mjs +0 -2630
- package/drag-drop/drag-handle-element.d.ts +0 -12
- package/drag-drop/dropzone-element.d.ts +0 -17
- package/drag-drop/private-props.d.ts +0 -3
- package/drag-drop/tha-drag-event.d.ts +0 -19
- package/icon/icon-element.d.ts +0 -40
- package/router/history-managed.d.ts +0 -76
- package/router/history.d.ts +0 -48
- package/router/signal-watcher-lit-element.d.ts +0 -25
- package/router/tha-route.d.ts +0 -90
- package/router/tha-router-config.d.ts +0 -223
- package/router/tha-router-link.d.ts +0 -95
- package/router/tha-router-outlet.d.ts +0 -112
- package/router/tha-router-param.d.ts +0 -226
- package/router/tha-router.d.ts +0 -69
- package/tha-url-output.cjs +0 -79
- package/tha-url-output.d.ts +0 -41
- package/tha-url-output.js +0 -78
- package/tha-url-output.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@telperion/elements",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"homepage": "https://elements.thalesrc.com",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -13,105 +13,59 @@
|
|
|
13
13
|
"@thalesrc/dom-utils": "^1.0.0",
|
|
14
14
|
"@telperion/js-utils": "^3.7.1",
|
|
15
15
|
"history": "^5.3.0",
|
|
16
|
-
"lit": "^3.3.1"
|
|
16
|
+
"lit": "^3.3.1",
|
|
17
|
+
"tslib": "^2.3.0"
|
|
17
18
|
},
|
|
18
19
|
"main": "./index.js",
|
|
19
20
|
"module": "./index.cjs",
|
|
20
21
|
"typings": "./index.d.ts",
|
|
21
22
|
"private": false,
|
|
22
23
|
"exports": {
|
|
23
|
-
"./icon/material-symbols.css": "./icon/material-symbols.css",
|
|
24
24
|
".": {
|
|
25
|
-
"
|
|
26
|
-
|
|
25
|
+
"types": {
|
|
26
|
+
"import": "./index.d.ts",
|
|
27
|
+
"require": "./index.d.cts"
|
|
28
|
+
},
|
|
27
29
|
"node": "./index.cjs",
|
|
30
|
+
"import": "./index.js",
|
|
28
31
|
"require": "./index.cjs",
|
|
29
|
-
"
|
|
32
|
+
"script": "./iife/elements.js",
|
|
33
|
+
"default": "./index.js"
|
|
30
34
|
},
|
|
31
|
-
"./router": {
|
|
32
|
-
"
|
|
33
|
-
|
|
35
|
+
"./router/index": {
|
|
36
|
+
"types": {
|
|
37
|
+
"import": "./router/index.d.ts",
|
|
38
|
+
"require": "./router/index.d.cts"
|
|
39
|
+
},
|
|
34
40
|
"node": "./router/index.cjs",
|
|
41
|
+
"import": "./router/index.js",
|
|
35
42
|
"require": "./router/index.cjs",
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
"./router/tha-router": {
|
|
39
|
-
"default": "./router/tha-router.cjs",
|
|
40
|
-
"import": "./router/tha-router.js",
|
|
41
|
-
"node": "./router/tha-router.cjs",
|
|
42
|
-
"require": "./router/tha-router.cjs",
|
|
43
|
-
"types": "./router/tha-router.d.ts"
|
|
44
|
-
},
|
|
45
|
-
"./router/tha-route": {
|
|
46
|
-
"default": "./router/tha-route.cjs",
|
|
47
|
-
"import": "./router/tha-route.js",
|
|
48
|
-
"node": "./router/tha-route.cjs",
|
|
49
|
-
"require": "./router/tha-route.cjs",
|
|
50
|
-
"types": "./router/tha-route.d.ts"
|
|
51
|
-
},
|
|
52
|
-
"./router/tha-router-link": {
|
|
53
|
-
"default": "./router/tha-router-link.cjs",
|
|
54
|
-
"import": "./router/tha-router-link.js",
|
|
55
|
-
"node": "./router/tha-router-link.cjs",
|
|
56
|
-
"require": "./router/tha-router-link.cjs",
|
|
57
|
-
"types": "./router/tha-router-link.d.ts"
|
|
58
|
-
},
|
|
59
|
-
"./router/tha-router-outlet": {
|
|
60
|
-
"default": "./router/tha-router-outlet.cjs",
|
|
61
|
-
"import": "./router/tha-router-outlet.js",
|
|
62
|
-
"node": "./router/tha-router-outlet.cjs",
|
|
63
|
-
"require": "./router/tha-router-outlet.cjs",
|
|
64
|
-
"types": "./router/tha-router-outlet.d.ts"
|
|
65
|
-
},
|
|
66
|
-
"./router/tha-router-config": {
|
|
67
|
-
"default": "./router/tha-router-config.cjs",
|
|
68
|
-
"import": "./router/tha-router-config.js",
|
|
69
|
-
"node": "./router/tha-router-config.cjs",
|
|
70
|
-
"require": "./router/tha-router-config.cjs",
|
|
71
|
-
"types": "./router/tha-router-config.d.ts"
|
|
43
|
+
"script": "./iife/router/index.js",
|
|
44
|
+
"default": "./router/index.js"
|
|
72
45
|
},
|
|
73
|
-
"./drag-drop": {
|
|
74
|
-
"
|
|
75
|
-
|
|
46
|
+
"./drag-drop/index": {
|
|
47
|
+
"types": {
|
|
48
|
+
"import": "./drag-drop/index.d.ts",
|
|
49
|
+
"require": "./drag-drop/index.d.cts"
|
|
50
|
+
},
|
|
76
51
|
"node": "./drag-drop/index.cjs",
|
|
52
|
+
"import": "./drag-drop/index.js",
|
|
77
53
|
"require": "./drag-drop/index.cjs",
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
"./drag-drop/drag-element": {
|
|
81
|
-
"default": "./drag-drop/drag-element.cjs",
|
|
82
|
-
"import": "./drag-drop/drag-element.js",
|
|
83
|
-
"node": "./drag-drop/drag-element.cjs",
|
|
84
|
-
"require": "./drag-drop/drag-element.cjs",
|
|
85
|
-
"types": "./drag-drop/drag-element.d.ts"
|
|
86
|
-
},
|
|
87
|
-
"./drag-drop/drag-handle-element": {
|
|
88
|
-
"default": "./drag-drop/drag-handle-element.cjs",
|
|
89
|
-
"import": "./drag-drop/drag-handle-element.js",
|
|
90
|
-
"node": "./drag-drop/drag-handle-element.cjs",
|
|
91
|
-
"require": "./drag-drop/drag-handle-element.cjs",
|
|
92
|
-
"types": "./drag-drop/drag-handle-element.d.ts"
|
|
54
|
+
"script": "./iife/drag-drop/index.js",
|
|
55
|
+
"default": "./drag-drop/index.js"
|
|
93
56
|
},
|
|
94
|
-
"./
|
|
95
|
-
"
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
"types": "./drag-drop/dropzone-element.d.ts"
|
|
100
|
-
},
|
|
101
|
-
"./icon": {
|
|
102
|
-
"default": "./icon/index.cjs",
|
|
103
|
-
"import": "./icon/index.js",
|
|
57
|
+
"./icon/index": {
|
|
58
|
+
"types": {
|
|
59
|
+
"import": "./icon/index.d.ts",
|
|
60
|
+
"require": "./icon/index.d.cts"
|
|
61
|
+
},
|
|
104
62
|
"node": "./icon/index.cjs",
|
|
63
|
+
"import": "./icon/index.js",
|
|
105
64
|
"require": "./icon/index.cjs",
|
|
106
|
-
"
|
|
65
|
+
"script": "./iife/icon/index.js",
|
|
66
|
+
"default": "./icon/index.js"
|
|
107
67
|
},
|
|
108
|
-
"./icon/
|
|
109
|
-
"default": "./icon/icon-element.cjs",
|
|
110
|
-
"import": "./icon/icon-element.js",
|
|
111
|
-
"node": "./icon/icon-element.cjs",
|
|
112
|
-
"require": "./icon/icon-element.cjs",
|
|
113
|
-
"types": "./icon/icon-element.d.ts"
|
|
114
|
-
}
|
|
68
|
+
"./icon/material-symbols.css": "./icon/material-symbols.css"
|
|
115
69
|
},
|
|
116
70
|
"bugs": "https://github.com/telperiontech/telperion/issues",
|
|
117
71
|
"license": "MIT",
|
|
@@ -123,5 +77,13 @@
|
|
|
123
77
|
"funding": {
|
|
124
78
|
"type": "patreon",
|
|
125
79
|
"url": "https://www.patreon.com/alisahin"
|
|
126
|
-
}
|
|
127
|
-
|
|
80
|
+
},
|
|
81
|
+
"sideEffects": [
|
|
82
|
+
"**/*-element.js",
|
|
83
|
+
"**/*-element.cjs",
|
|
84
|
+
"**/*.css"
|
|
85
|
+
],
|
|
86
|
+
"types": "./index.d.ts",
|
|
87
|
+
"unpkg": "./iife/elements.js",
|
|
88
|
+
"jsdelivr": "./iife/elements.js"
|
|
89
|
+
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var decorators_js = require('lit/decorators.js');
|
|
5
|
+
var history = require('./history.cjs');
|
|
6
|
+
var signals = require('@lit-labs/signals');
|
|
7
|
+
|
|
2
8
|
/**
|
|
3
9
|
* @fileoverview History management mixin for Lit elements
|
|
4
10
|
*
|
|
@@ -6,12 +12,6 @@
|
|
|
6
12
|
*
|
|
7
13
|
* @module router/history-managed
|
|
8
14
|
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.HistoryManaged = exports.HISTORY_TYPE = exports.HISTORY = void 0;
|
|
11
|
-
const tslib_1 = require("tslib");
|
|
12
|
-
const decorators_js_1 = require("lit/decorators.js");
|
|
13
|
-
const history_1 = require("./history");
|
|
14
|
-
const signals_1 = require("@lit-labs/signals");
|
|
15
15
|
/**
|
|
16
16
|
* Symbol for accessing the resolved history instance.
|
|
17
17
|
*
|
|
@@ -21,12 +21,12 @@ const signals_1 = require("@lit-labs/signals");
|
|
|
21
21
|
* history.push('/path');
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
const HISTORY = Symbol('HistoryManaged:history');
|
|
25
25
|
/**
|
|
26
26
|
* Symbol for accessing the resolved history type.
|
|
27
27
|
* @internal
|
|
28
28
|
*/
|
|
29
|
-
|
|
29
|
+
const HISTORY_TYPE = Symbol('HistoryManaged:historyType');
|
|
30
30
|
/**
|
|
31
31
|
* Mixin that adds hierarchical history management to Lit elements.
|
|
32
32
|
*
|
|
@@ -60,18 +60,18 @@ const HistoryManaged = (superClass) => {
|
|
|
60
60
|
*/
|
|
61
61
|
this.history = undefined;
|
|
62
62
|
/** Signal for own history type */
|
|
63
|
-
this.#ownHistoryType =
|
|
63
|
+
this.#ownHistoryType = signals.signal(this.history);
|
|
64
64
|
/** Computed signal for parent history type */
|
|
65
|
-
this.#parentHistoryType =
|
|
65
|
+
this.#parentHistoryType = signals.computed(() => {
|
|
66
66
|
const parent = this.closest('tha-router-config, tha-router-outlet');
|
|
67
|
-
return parent?.[
|
|
67
|
+
return parent?.[HISTORY_TYPE]?.get();
|
|
68
68
|
});
|
|
69
69
|
/** Resolved history type: own → parent → global */
|
|
70
|
-
this[_a] =
|
|
70
|
+
this[_a] = signals.computed(() => this.#ownHistoryType.get() ?? this.#parentHistoryType.get() ?? history.GLOBAL_HISTORY_TYPE.get());
|
|
71
71
|
/** Resolved history instance: own → parent → global */
|
|
72
|
-
this[_b] =
|
|
72
|
+
this[_b] = signals.computed(() => history.getHistoryByType(this[HISTORY_TYPE].get()));
|
|
73
73
|
}
|
|
74
|
-
static { _a =
|
|
74
|
+
static { _a = HISTORY_TYPE, _b = HISTORY; }
|
|
75
75
|
/** Signal for own history type */
|
|
76
76
|
#ownHistoryType;
|
|
77
77
|
/** Computed signal for parent history type */
|
|
@@ -88,10 +88,14 @@ const HistoryManaged = (superClass) => {
|
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
91
|
+
tslib.__decorate([
|
|
92
|
+
decorators_js.property({ type: String }),
|
|
93
|
+
tslib.__metadata("design:type", Object)
|
|
94
94
|
], HistoryManagedLitElement.prototype, "history", void 0);
|
|
95
95
|
return HistoryManagedLitElement;
|
|
96
96
|
};
|
|
97
|
+
|
|
98
|
+
exports.HISTORY = HISTORY;
|
|
99
|
+
exports.HISTORY_TYPE = HISTORY_TYPE;
|
|
97
100
|
exports.HistoryManaged = HistoryManaged;
|
|
101
|
+
//# sourceMappingURL=history-managed.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history-managed.cjs","sources":["../../../../libs/elements/src/router/history-managed.ts"],"sourcesContent":[null],"names":["signal","computed","GLOBAL_HISTORY_TYPE","getHistoryByType","__decorate","property"],"mappings":";;;;;;;AAAA;;;;;;AAMG;AAcH;;;;;;;;AAQG;MACU,OAAO,GAAG,MAAM,CAAC,wBAAwB;AAEtD;;;AAGG;MACU,YAAY,GAAG,MAAM,CAAC,4BAA4B;AA4B/D;;;;;;;;;;;;;;;;;;;AAmBG;AACI,MAAM,cAAc,GAAG,CAAoC,UAAa,KAAI;;IACjF,MAAM,wBAAyB,SAAQ,UAAU,CAAA;AAAjD,QAAA,WAAA,GAAA;;AACE;;;;;AAKG;YAEH,IAAA,CAAA,OAAO,GAA4B,SAAS;;AAG5C,YAAA,IAAA,CAAA,eAAe,GAAGA,cAAM,CAA0B,IAAI,CAAC,OAAO,CAAC;;AAG/D,YAAA,IAAA,CAAA,kBAAkB,GAAGC,gBAAQ,CAAC,MAAK;gBACjC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,sCAAsC,CAAwC;gBAE1G,OAAO,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE;AACtC,YAAA,CAAC,CAAC;;YAGF,IAAA,CAAA,EAAA,CAAc,GAAGA,gBAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAIC,2BAAmB,CAAC,GAAG,EAAE,CAAC;;AAGzH,YAAA,IAAA,CAAA,EAAA,CAAS,GAAGD,gBAAQ,CAAC,MAAME,wBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAG,CAAC,CAAC;QAczE;AAjBG,QAAA,SAAA,EAAA,GAAA,YAAY,OAGZ,OAAO,CAAA;;AAbR,QAAA,eAAe;;AAGf,QAAA,kBAAkB;AAYlB;;AAEG;AACM,QAAA,wBAAwB,CAAC,IAAY,EAAE,IAAmB,EAAE,KAAoB,EAAA;YACvF,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;YAEjD,QAAQ,IAAI;AACV,gBAAA,KAAK,SAAS;AACZ,oBAAA,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAgC,CAAC;oBAC1D;;QAEN;AACD;AA9BC,IAAAC,gBAAA,CAAA;AADC,QAAAC,sBAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;AACkB,KAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAgC/C,IAAA,OAAO,wBAAyE;AAClF;;;;;;"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
import { __decorate, __metadata } from 'tslib';
|
|
2
|
+
import { property } from 'lit/decorators.js';
|
|
3
|
+
import { GLOBAL_HISTORY_TYPE, getHistoryByType } from './history.js';
|
|
4
|
+
import { signal, computed } from '@lit-labs/signals';
|
|
5
|
+
|
|
1
6
|
/**
|
|
2
7
|
* @fileoverview History management mixin for Lit elements
|
|
3
8
|
*
|
|
@@ -5,10 +10,6 @@
|
|
|
5
10
|
*
|
|
6
11
|
* @module router/history-managed
|
|
7
12
|
*/
|
|
8
|
-
import { __decorate, __metadata } from "tslib";
|
|
9
|
-
import { property } from "lit/decorators.js";
|
|
10
|
-
import { getHistoryByType, GLOBAL_HISTORY_TYPE } from "./history";
|
|
11
|
-
import { computed, signal } from "@lit-labs/signals";
|
|
12
13
|
/**
|
|
13
14
|
* Symbol for accessing the resolved history instance.
|
|
14
15
|
*
|
|
@@ -18,12 +19,12 @@ import { computed, signal } from "@lit-labs/signals";
|
|
|
18
19
|
* history.push('/path');
|
|
19
20
|
* ```
|
|
20
21
|
*/
|
|
21
|
-
|
|
22
|
+
const HISTORY = Symbol('HistoryManaged:history');
|
|
22
23
|
/**
|
|
23
24
|
* Symbol for accessing the resolved history type.
|
|
24
25
|
* @internal
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
const HISTORY_TYPE = Symbol('HistoryManaged:historyType');
|
|
27
28
|
/**
|
|
28
29
|
* Mixin that adds hierarchical history management to Lit elements.
|
|
29
30
|
*
|
|
@@ -44,7 +45,7 @@ export const HISTORY_TYPE = Symbol('HistoryManaged:historyType');
|
|
|
44
45
|
* @param superClass - The class to extend
|
|
45
46
|
* @returns Extended class with history management
|
|
46
47
|
*/
|
|
47
|
-
|
|
48
|
+
const HistoryManaged = (superClass) => {
|
|
48
49
|
var _a, _b;
|
|
49
50
|
class HistoryManagedLitElement extends superClass {
|
|
50
51
|
constructor() {
|
|
@@ -92,4 +93,5 @@ export const HistoryManaged = (superClass) => {
|
|
|
92
93
|
return HistoryManagedLitElement;
|
|
93
94
|
};
|
|
94
95
|
|
|
96
|
+
export { HISTORY, HISTORY_TYPE, HistoryManaged };
|
|
95
97
|
//# sourceMappingURL=history-managed.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"history-managed.js","sources":["../../../../libs/elements/src/router/history-managed.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAAA;;;;;;AAMG;AAcH;;;;;;;;AAQG;MACU,OAAO,GAAG,MAAM,CAAC,wBAAwB;AAEtD;;;AAGG;MACU,YAAY,GAAG,MAAM,CAAC,4BAA4B;AA4B/D;;;;;;;;;;;;;;;;;;;AAmBG;AACI,MAAM,cAAc,GAAG,CAAoC,UAAa,KAAI;;IACjF,MAAM,wBAAyB,SAAQ,UAAU,CAAA;AAAjD,QAAA,WAAA,GAAA;;AACE;;;;;AAKG;YAEH,IAAA,CAAA,OAAO,GAA4B,SAAS;;AAG5C,YAAA,IAAA,CAAA,eAAe,GAAG,MAAM,CAA0B,IAAI,CAAC,OAAO,CAAC;;AAG/D,YAAA,IAAA,CAAA,kBAAkB,GAAG,QAAQ,CAAC,MAAK;gBACjC,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,sCAAsC,CAAwC;gBAE1G,OAAO,MAAM,GAAG,YAAY,CAAC,EAAE,GAAG,EAAE;AACtC,YAAA,CAAC,CAAC;;YAGF,IAAA,CAAA,EAAA,CAAc,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,eAAe,CAAC,GAAG,EAAE,IAAI,IAAI,CAAC,kBAAkB,CAAC,GAAG,EAAE,IAAI,mBAAmB,CAAC,GAAG,EAAE,CAAC;;AAGzH,YAAA,IAAA,CAAA,EAAA,CAAS,GAAG,QAAQ,CAAC,MAAM,gBAAgB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAG,CAAC,CAAC;QAczE;AAjBG,QAAA,SAAA,EAAA,GAAA,YAAY,OAGZ,OAAO,CAAA;;AAbR,QAAA,eAAe;;AAGf,QAAA,kBAAkB;AAYlB;;AAEG;AACM,QAAA,wBAAwB,CAAC,IAAY,EAAE,IAAmB,EAAE,KAAoB,EAAA;YACvF,KAAK,CAAC,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC;YAEjD,QAAQ,IAAI;AACV,gBAAA,KAAK,SAAS;AACZ,oBAAA,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAgC,CAAC;oBAC1D;;QAEN;AACD;AA9BC,IAAA,UAAA,CAAA;AADC,QAAA,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;;AACkB,KAAA,EAAA,wBAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAgC/C,IAAA,OAAO,wBAAyE;AAClF;;;;"}
|
package/router/history.cjs
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const history_1 = require("history");
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var signals = require('@lit-labs/signals');
|
|
4
|
+
var history = require('history');
|
|
5
|
+
|
|
7
6
|
/**
|
|
8
7
|
* Global registry mapping history types to their singleton instances.
|
|
9
8
|
* Ensures that the same history object is reused across all routers of the same type.
|
|
@@ -13,17 +12,17 @@ const HISTORY_MAP = {};
|
|
|
13
12
|
* Default history type used when no explicit type is specified.
|
|
14
13
|
* Uses browser history (HTML5 History API).
|
|
15
14
|
*/
|
|
16
|
-
|
|
15
|
+
const DEFAULT_HISTORY_TYPE = "browser";
|
|
17
16
|
/**
|
|
18
17
|
* Reactive signal containing the currently active global history type.
|
|
19
18
|
* Changing this signal will cause all routers using the global history to switch types.
|
|
20
19
|
*/
|
|
21
|
-
|
|
20
|
+
const GLOBAL_HISTORY_TYPE = signals.signal(DEFAULT_HISTORY_TYPE);
|
|
22
21
|
/**
|
|
23
22
|
* Computed signal that returns the History instance for the current global history type.
|
|
24
23
|
* Automatically updates when GLOBAL_HISTORY_TYPE changes.
|
|
25
24
|
*/
|
|
26
|
-
|
|
25
|
+
signals.computed(() => getHistoryByType(GLOBAL_HISTORY_TYPE.get()));
|
|
27
26
|
/**
|
|
28
27
|
* Retrieves or creates a History instance for the specified type.
|
|
29
28
|
*
|
|
@@ -47,19 +46,24 @@ exports.GLOBAL_HISTORY = (0, signals_1.computed)(() => getHistoryByType(exports.
|
|
|
47
46
|
* ```
|
|
48
47
|
*/
|
|
49
48
|
function getHistoryByType(type) {
|
|
50
|
-
let history = HISTORY_MAP[type];
|
|
51
|
-
if (!history) {
|
|
49
|
+
let history$1 = HISTORY_MAP[type];
|
|
50
|
+
if (!history$1) {
|
|
52
51
|
switch (type) {
|
|
53
52
|
case 'browser':
|
|
54
|
-
history =
|
|
53
|
+
history$1 = history.createBrowserHistory();
|
|
55
54
|
break;
|
|
56
55
|
case 'hash':
|
|
57
|
-
history =
|
|
56
|
+
history$1 = history.createHashHistory();
|
|
58
57
|
break;
|
|
59
58
|
default:
|
|
60
|
-
history =
|
|
59
|
+
history$1 = history.createMemoryHistory();
|
|
61
60
|
}
|
|
62
|
-
HISTORY_MAP[type] = history;
|
|
61
|
+
HISTORY_MAP[type] = history$1;
|
|
63
62
|
}
|
|
64
|
-
return history;
|
|
63
|
+
return history$1;
|
|
65
64
|
}
|
|
65
|
+
|
|
66
|
+
exports.DEFAULT_HISTORY_TYPE = DEFAULT_HISTORY_TYPE;
|
|
67
|
+
exports.GLOBAL_HISTORY_TYPE = GLOBAL_HISTORY_TYPE;
|
|
68
|
+
exports.getHistoryByType = getHistoryByType;
|
|
69
|
+
//# sourceMappingURL=history.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.cjs","sources":["../../../../libs/elements/src/router/history.ts"],"sourcesContent":[null],"names":["signal","computed","history","createBrowserHistory","createHashHistory","createMemoryHistory"],"mappings":";;;;;AAaA;;;AAGG;AACH,MAAM,WAAW,GAAG,EAAkC;AAEtD;;;AAGG;AACI,MAAM,oBAAoB,GAAgB;AAEjD;;;AAGG;MACU,mBAAmB,GAAGA,cAAM,CAAc,oBAAoB;AAE3E;;;AAGG;AAC2BC,gBAAQ,CAAC,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;AAqBG;AACG,SAAU,gBAAgB,CAAC,IAAiB,EAAA;AAChD,IAAA,IAAIC,SAAO,GAAG,WAAW,CAAC,IAAI,CAAC;IAE/B,IAAI,CAACA,SAAO,EAAE;QACZ,QAAQ,IAAI;AACV,YAAA,KAAK,SAAS;gBACZA,SAAO,GAAGC,4BAAoB,EAAE;gBAChC;AACF,YAAA,KAAK,MAAM;gBACTD,SAAO,GAAGE,yBAAiB,EAAE;gBAC7B;AACF,YAAA;gBACEF,SAAO,GAAGG,2BAAmB,EAAE;;AAGnC,QAAA,WAAW,CAAC,IAAmB,CAAC,GAAGH,SAAO;IAC5C;AAEA,IAAA,OAAOA,SAAO;AAChB;;;;;;"}
|
package/router/history.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { signal, computed } from '@lit-labs/signals';
|
|
2
|
+
import { createMemoryHistory, createHashHistory, createBrowserHistory } from 'history';
|
|
3
|
+
|
|
3
4
|
/**
|
|
4
5
|
* Global registry mapping history types to their singleton instances.
|
|
5
6
|
* Ensures that the same history object is reused across all routers of the same type.
|
|
@@ -9,17 +10,17 @@ const HISTORY_MAP = {};
|
|
|
9
10
|
* Default history type used when no explicit type is specified.
|
|
10
11
|
* Uses browser history (HTML5 History API).
|
|
11
12
|
*/
|
|
12
|
-
|
|
13
|
+
const DEFAULT_HISTORY_TYPE = "browser";
|
|
13
14
|
/**
|
|
14
15
|
* Reactive signal containing the currently active global history type.
|
|
15
16
|
* Changing this signal will cause all routers using the global history to switch types.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
+
const GLOBAL_HISTORY_TYPE = signal(DEFAULT_HISTORY_TYPE);
|
|
18
19
|
/**
|
|
19
20
|
* Computed signal that returns the History instance for the current global history type.
|
|
20
21
|
* Automatically updates when GLOBAL_HISTORY_TYPE changes.
|
|
21
22
|
*/
|
|
22
|
-
|
|
23
|
+
computed(() => getHistoryByType(GLOBAL_HISTORY_TYPE.get()));
|
|
23
24
|
/**
|
|
24
25
|
* Retrieves or creates a History instance for the specified type.
|
|
25
26
|
*
|
|
@@ -42,7 +43,7 @@ export const GLOBAL_HISTORY = computed(() => getHistoryByType(GLOBAL_HISTORY_TYP
|
|
|
42
43
|
* const testHistory = getHistoryByType('memory:test-suite-1');
|
|
43
44
|
* ```
|
|
44
45
|
*/
|
|
45
|
-
|
|
46
|
+
function getHistoryByType(type) {
|
|
46
47
|
let history = HISTORY_MAP[type];
|
|
47
48
|
if (!history) {
|
|
48
49
|
switch (type) {
|
|
@@ -60,4 +61,5 @@ export function getHistoryByType(type) {
|
|
|
60
61
|
return history;
|
|
61
62
|
}
|
|
62
63
|
|
|
64
|
+
export { DEFAULT_HISTORY_TYPE, GLOBAL_HISTORY_TYPE, getHistoryByType };
|
|
63
65
|
//# sourceMappingURL=history.js.map
|
package/router/history.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["
|
|
1
|
+
{"version":3,"file":"history.js","sources":["../../../../libs/elements/src/router/history.ts"],"sourcesContent":[null],"names":[],"mappings":";;;AAaA;;;AAGG;AACH,MAAM,WAAW,GAAG,EAAkC;AAEtD;;;AAGG;AACI,MAAM,oBAAoB,GAAgB;AAEjD;;;AAGG;MACU,mBAAmB,GAAG,MAAM,CAAc,oBAAoB;AAE3E;;;AAGG;AAC2B,QAAQ,CAAC,MAAM,gBAAgB,CAAC,mBAAmB,CAAC,GAAG,EAAE,CAAC;AAExF;;;;;;;;;;;;;;;;;;;;;AAqBG;AACG,SAAU,gBAAgB,CAAC,IAAiB,EAAA;AAChD,IAAA,IAAI,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC;IAE/B,IAAI,CAAC,OAAO,EAAE;QACZ,QAAQ,IAAI;AACV,YAAA,KAAK,SAAS;gBACZ,OAAO,GAAG,oBAAoB,EAAE;gBAChC;AACF,YAAA,KAAK,MAAM;gBACT,OAAO,GAAG,iBAAiB,EAAE;gBAC7B;AACF,YAAA;gBACE,OAAO,GAAG,mBAAmB,EAAE;;AAGnC,QAAA,WAAW,CAAC,IAAmB,CAAC,GAAG,OAAO;IAC5C;AAEA,IAAA,OAAO,OAAO;AAChB;;;;"}
|
package/router/index.cjs
CHANGED
|
@@ -1,15 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
var
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var thaRouter = require('./tha-router.cjs');
|
|
4
|
+
var thaRoute = require('./tha-route.cjs');
|
|
5
|
+
var thaRouterLink = require('./tha-router-link.cjs');
|
|
6
|
+
var thaRouterOutlet = require('./tha-router-outlet.cjs');
|
|
7
|
+
var thaRouterConfig = require('./tha-router-config.cjs');
|
|
8
|
+
var thaRouterParam = require('./tha-router-param.cjs');
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
Object.defineProperty(exports, "ThaRouter", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return thaRouter.ThaRouter; }
|
|
15
|
+
});
|
|
16
|
+
Object.defineProperty(exports, "ThaRoute", {
|
|
17
|
+
enumerable: true,
|
|
18
|
+
get: function () { return thaRoute.ThaRoute; }
|
|
19
|
+
});
|
|
20
|
+
Object.defineProperty(exports, "ThaRouterLink", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function () { return thaRouterLink.ThaRouterLink; }
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, "ThaRouterOutlet", {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () { return thaRouterOutlet.ThaRouterOutlet; }
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports, "ThaRouterConfig", {
|
|
29
|
+
enumerable: true,
|
|
30
|
+
get: function () { return thaRouterConfig.ThaRouterConfig; }
|
|
31
|
+
});
|
|
32
|
+
Object.defineProperty(exports, "ThaRouterParam", {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function () { return thaRouterParam.ThaRouterParam; }
|
|
35
|
+
});
|
|
36
|
+
//# sourceMappingURL=index.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.cjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|