@vanelsas/baredom 4.0.0-alpha.1 → 4.0.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/CHANGELOG.md +337 -9
- package/README.md +23 -10
- package/custom-elements.json +17352 -4514
- package/dist/baredom.d.ts +92 -94
- package/dist/baremirror-alpha.js +25 -0
- package/dist/base.js +700 -607
- package/dist/integrity.json +113 -113
- package/dist/requests.d.ts +3 -0
- package/dist/requests.js +35 -0
- package/dist/x-alert.js +17 -17
- package/dist/x-avatar-group.js +10 -9
- package/dist/x-avatar.js +14 -14
- package/dist/x-badge.js +9 -9
- package/dist/x-bento-grid.d.ts +5 -0
- package/dist/x-bento-grid.js +6 -5
- package/dist/x-bento-item.d.ts +3 -0
- package/dist/x-bento-item.js +4 -4
- package/dist/x-breadcrumbs.d.ts +6 -5
- package/dist/x-breadcrumbs.js +16 -14
- package/dist/x-button.d.ts +4 -0
- package/dist/x-button.js +1 -1
- package/dist/x-calendar.js +42 -39
- package/dist/x-cancel-dialogue.js +16 -14
- package/dist/x-card.d.ts +4 -0
- package/dist/x-card.js +7 -7
- package/dist/x-carousel.js +37 -35
- package/dist/x-chart.d.ts +2 -0
- package/dist/x-chart.js +48 -47
- package/dist/x-checkbox.d.ts +11 -4
- package/dist/x-checkbox.js +1 -1
- package/dist/x-chip.js +1 -1
- package/dist/x-code.js +29 -27
- package/dist/x-collapse.js +11 -11
- package/dist/x-color-picker.d.ts +7 -0
- package/dist/x-color-picker.js +48 -46
- package/dist/x-combobox.d.ts +12 -4
- package/dist/x-combobox.js +36 -30
- package/dist/x-command-palette.d.ts +9 -1
- package/dist/x-command-palette.js +32 -28
- package/dist/x-confetti.js +24 -24
- package/dist/x-container.d.ts +4 -0
- package/dist/x-container.js +6 -5
- package/dist/x-context-menu.js +20 -20
- package/dist/x-copy.js +1 -1
- package/dist/x-currency-field.d.ts +5 -0
- package/dist/x-currency-field.js +26 -24
- package/dist/x-date-picker.d.ts +20 -2
- package/dist/x-date-picker.js +46 -39
- package/dist/x-divider.js +9 -10
- package/dist/x-drag-panel.d.ts +45 -0
- package/dist/x-drag-panel.js +37 -0
- package/dist/x-drawer.js +12 -11
- package/dist/x-drop-zone.d.ts +49 -0
- package/dist/x-drop-zone.js +12 -0
- package/dist/x-dropdown.js +12 -12
- package/dist/x-fieldset.js +6 -6
- package/dist/x-file-download.d.ts +4 -0
- package/dist/x-file-download.js +15 -7
- package/dist/x-file-upload.d.ts +10 -5
- package/dist/x-file-upload.js +27 -23
- package/dist/x-floating-panel.d.ts +50 -0
- package/dist/x-floating-panel.js +25 -0
- package/dist/x-form-field.d.ts +11 -1
- package/dist/x-form-field.js +18 -15
- package/dist/x-form.js +10 -11
- package/dist/x-gaussian-blur.js +13 -14
- package/dist/x-grid.d.ts +9 -0
- package/dist/x-grid.js +8 -6
- package/dist/x-i18n-provider.js +7 -7
- package/dist/x-i18n.js +4 -4
- package/dist/x-icon.js +7 -7
- package/dist/x-image.js +19 -17
- package/dist/x-kbd.js +16 -16
- package/dist/x-kinetic-canvas.js +26 -26
- package/dist/x-kinetic-font.js +27 -27
- package/dist/x-kinetic-typography.js +35 -35
- package/dist/x-liquid-dock.js +34 -34
- package/dist/x-liquid-fill.js +42 -42
- package/dist/x-liquid-glass.js +42 -41
- package/dist/x-menu-item.js +9 -8
- package/dist/x-menu.js +10 -10
- package/dist/x-metaball-cursor.js +23 -23
- package/dist/x-modal.js +13 -12
- package/dist/x-morph-stack.js +38 -37
- package/dist/x-multi-combobox.d.ts +13 -5
- package/dist/x-multi-combobox.js +42 -36
- package/dist/x-navbar.js +16 -15
- package/dist/x-neural-glow.js +31 -30
- package/dist/x-notification-center.js +9 -9
- package/dist/x-organic-divider.js +18 -18
- package/dist/x-organic-progress.js +35 -35
- package/dist/x-organic-shape.js +13 -14
- package/dist/x-otp-input.d.ts +5 -0
- package/dist/x-otp-input.js +23 -22
- package/dist/x-pagination.js +16 -14
- package/dist/x-particle-button.d.ts +10 -1
- package/dist/x-particle-button.js +55 -51
- package/dist/x-popover.js +28 -27
- package/dist/x-progress-circle.js +8 -9
- package/dist/x-progress.js +8 -8
- package/dist/x-proximity-list.js +20 -20
- package/dist/x-radio.d.ts +10 -3
- package/dist/x-radio.js +13 -11
- package/dist/x-range-slider.d.ts +7 -0
- package/dist/x-range-slider.js +31 -28
- package/dist/x-rating.d.ts +7 -0
- package/dist/x-rating.js +25 -23
- package/dist/x-ripple-effect.js +10 -10
- package/dist/x-scroll-parallax.js +17 -17
- package/dist/x-scroll-stack.js +17 -17
- package/dist/x-scroll-story.js +33 -33
- package/dist/x-scroll-timeline.js +46 -46
- package/dist/x-scroll.js +39 -38
- package/dist/x-search-field.d.ts +10 -3
- package/dist/x-search-field.js +1 -1
- package/dist/x-select.d.ts +12 -2
- package/dist/x-select.js +1 -1
- package/dist/x-sidebar.d.ts +4 -0
- package/dist/x-sidebar.js +17 -18
- package/dist/x-skeleton-group.js +13 -12
- package/dist/x-skeleton.js +1 -1
- package/dist/x-slider.d.ts +7 -0
- package/dist/x-slider.js +17 -16
- package/dist/x-soft-body.js +20 -20
- package/dist/x-spacer.js +4 -4
- package/dist/x-spinner.js +4 -4
- package/dist/x-splash.js +13 -12
- package/dist/x-split-pane.js +15 -15
- package/dist/x-spotlight-card.js +13 -12
- package/dist/x-stat.js +10 -10
- package/dist/x-stepper.js +15 -13
- package/dist/x-switch.d.ts +10 -3
- package/dist/x-switch.js +12 -11
- package/dist/x-tab.d.ts +5 -0
- package/dist/x-tab.js +10 -7
- package/dist/x-table-cell.js +21 -21
- package/dist/x-table-row.js +9 -8
- package/dist/x-table.js +14 -13
- package/dist/x-tabs.d.ts +9 -0
- package/dist/x-tabs.js +11 -11
- package/dist/x-text-area.d.ts +12 -0
- package/dist/x-text-area.js +21 -19
- package/dist/x-theme.js +26 -25
- package/dist/x-timeline-item.js +21 -20
- package/dist/x-timeline.js +8 -8
- package/dist/x-toast.js +22 -22
- package/dist/x-toaster.js +7 -7
- package/dist/x-tooltip.js +14 -12
- package/dist/x-trace-history.js +119 -127
- package/dist/x-typography.js +9 -9
- package/dist/x-welcome-tour.js +63 -63
- package/package.json +25 -26
- package/dist/barebuild-action.d.ts +0 -45
- package/dist/barebuild-action.js +0 -9
- package/dist/barebuild-data.d.ts +0 -39
- package/dist/barebuild-data.js +0 -5
- package/dist/barebuild-invalidate-on.d.ts +0 -42
- package/dist/barebuild-invalidate-on.js +0 -5
- package/dist/barebuild-route.d.ts +0 -39
- package/dist/barebuild-route.js +0 -4
- package/dist/barebuild-router.d.ts +0 -41
- package/dist/barebuild-router.js +0 -13
package/dist/barebuild-data.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// barebuild-data.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
-
|
|
3
|
-
export function init(): void;
|
|
4
|
-
|
|
5
|
-
export interface BarebuildDataEventMap {
|
|
6
|
-
"event-data-state": CustomEvent<{ state: Record<string, any> }>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface BarebuildData extends HTMLElement {
|
|
10
|
-
src: string;
|
|
11
|
-
readonly state: Record<string, any>;
|
|
12
|
-
|
|
13
|
-
addEventListener<K extends keyof BarebuildDataEventMap>(
|
|
14
|
-
type: K,
|
|
15
|
-
listener: (this: BarebuildData, ev: BarebuildDataEventMap[K]) => any,
|
|
16
|
-
options?: boolean | AddEventListenerOptions
|
|
17
|
-
): void;
|
|
18
|
-
addEventListener(
|
|
19
|
-
type: string,
|
|
20
|
-
listener: EventListenerOrEventListenerObject,
|
|
21
|
-
options?: boolean | AddEventListenerOptions
|
|
22
|
-
): void;
|
|
23
|
-
removeEventListener<K extends keyof BarebuildDataEventMap>(
|
|
24
|
-
type: K,
|
|
25
|
-
listener: (this: BarebuildData, ev: BarebuildDataEventMap[K]) => any,
|
|
26
|
-
options?: boolean | EventListenerOptions
|
|
27
|
-
): void;
|
|
28
|
-
removeEventListener(
|
|
29
|
-
type: string,
|
|
30
|
-
listener: EventListenerOrEventListenerObject,
|
|
31
|
-
options?: boolean | EventListenerOptions
|
|
32
|
-
): void;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
declare global {
|
|
36
|
-
interface HTMLElementTagNameMap {
|
|
37
|
-
"barebuild-data": BarebuildData;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/dist/barebuild-data.js
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var w7=function(a){var b=$APP.Yi(a,"src");if($APP.n(b))return $APP.No(a,b,{},Object.freeze({phase:"loading"}),u7);$APP.Ho(a,"__barebuildDataAbort");return $APP.Go(a,v7,u7)},ita=function(a){function b(){return w7(a)}$APP.Q(a,"__barebuildDataRefreshHandler",b);a.addEventListener("barebuild-data-refresh",b)},x7=function(a){if($APP.Li(a))try{var b=new URL(a,location.origin);return""+$APP.P.i(b.origin)+$APP.P.i(b.pathname)+$APP.P.i(b.search)}catch(c){return null}else return null},jta=function(a){function b(d){var e=
|
|
3
|
-
x7(a.getAttribute("src"));$APP.n(e)&&(d=d==null?null:d.detail,e=$APP.z.j(e,x7(d==null?null:d.src)));return $APP.n(e)?w7(a):null}var c=$APP.l(a,"__barebuildDataInvalidateHandler");if($APP.n(c))return c;$APP.Q(a,"__barebuildDataInvalidateHandler",b);return b},kta=function(a){$APP.Xi(a,":host{display:none}","__barebuildDataInit",!1);$APP.n($APP.l(a,"__barebuildDataRefreshHandler"))||ita(a);document.addEventListener("barebuild-invalidate",jta(a));$APP.Q(a,"__barebuildDataState",v7);return w7(a)},lta=
|
|
4
|
-
function(a){$APP.Ho(a,"__barebuildDataAbort");var b=$APP.l(a,"__barebuildDataInvalidateHandler");$APP.n(b)&&document.removeEventListener("barebuild-invalidate",b);return $APP.Q(a,"__barebuildDataState",v7)},mta=function(a){var b=$APP.Vi(a,"__barebuildDataInit");return $APP.n(b?a.isConnected:b)?w7(a):null},ota=function(a){$APP.xj(a,nta);return $APP.tj(a,"state",function(b){b=$APP.l(b,"__barebuildDataState");return $APP.n(b)?b:v7})},y7=function(){return $APP.zi("barebuild-data",new $APP.M(null,5,[$APP.ji,
|
|
5
|
-
pta,$APP.hi,kta,$APP.ei,lta,$APP.di,mta,$APP.ii,ota],null))};var pta=["src"];$APP.eh(["loading","loaded","error","idle"]);var nta=new $APP.M(null,2,[$APP.os,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"src",$APP.wj,""],null),$APP.Ut,new $APP.M(null,2,[$APP.N,$APP.dt,$APP.uj,!0],null)],null);$APP.je(["barebuild-data-state",new $APP.M(null,1,[$APP.V,new $APP.M(null,1,[$APP.Ut,$APP.dt],null)],null)]);var v7=Object.freeze({phase:"idle"}),u7=new $APP.M(null,7,[$APP.Do,"__barebuildDataState",$APP.Io,"__barebuildDataAbort",$APP.Eo,function(a){return a.data},$APP.ej,"barebuild-data-state",$APP.Fo,function(a,b){return{state:b}},$APP.Ko,function(a,b){a={phase:"loaded",data:a};b!=null&&(a.httpStatus=b);return Object.freeze(a)},$APP.Lo,function(a,b){a={phase:"error",error:a};b!=null&&(a.httpStatus=b);return Object.freeze(a)}],null);$APP.fa("baredom.exports.barebuild_data.init",y7);export const init=y7;
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
// barebuild-invalidate-on.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
-
|
|
3
|
-
export function init(): void;
|
|
4
|
-
|
|
5
|
-
export interface BarebuildInvalidateOnEventMap {
|
|
6
|
-
"event-invalidate": CustomEvent<{ src: string }>;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export interface BarebuildInvalidateOn extends HTMLElement {
|
|
10
|
-
event: string;
|
|
11
|
-
whenPhase: string;
|
|
12
|
-
whenName: string;
|
|
13
|
-
src: string;
|
|
14
|
-
invalidate(): void;
|
|
15
|
-
|
|
16
|
-
addEventListener<K extends keyof BarebuildInvalidateOnEventMap>(
|
|
17
|
-
type: K,
|
|
18
|
-
listener: (this: BarebuildInvalidateOn, ev: BarebuildInvalidateOnEventMap[K]) => any,
|
|
19
|
-
options?: boolean | AddEventListenerOptions
|
|
20
|
-
): void;
|
|
21
|
-
addEventListener(
|
|
22
|
-
type: string,
|
|
23
|
-
listener: EventListenerOrEventListenerObject,
|
|
24
|
-
options?: boolean | AddEventListenerOptions
|
|
25
|
-
): void;
|
|
26
|
-
removeEventListener<K extends keyof BarebuildInvalidateOnEventMap>(
|
|
27
|
-
type: K,
|
|
28
|
-
listener: (this: BarebuildInvalidateOn, ev: BarebuildInvalidateOnEventMap[K]) => any,
|
|
29
|
-
options?: boolean | EventListenerOptions
|
|
30
|
-
): void;
|
|
31
|
-
removeEventListener(
|
|
32
|
-
type: string,
|
|
33
|
-
listener: EventListenerOrEventListenerObject,
|
|
34
|
-
options?: boolean | EventListenerOptions
|
|
35
|
-
): void;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
declare global {
|
|
39
|
-
interface HTMLElementTagNameMap {
|
|
40
|
-
"barebuild-invalidate-on": BarebuildInvalidateOn;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Q1=function(a){var b=$APP.Yi(a,"src");b==null&&console.warn("barebuild-invalidate-on: blank `src`; the dispatched barebuild-invalidate matches no broker");return $APP.hj(a,"barebuild-invalidate",{src:$APP.n(b)?b:""})},rpa=function(a){function b(d){var e=$APP.Yi(a,"when-phase"),f=$APP.Yi(a,"when-name");d=d.detail;var h;(h=e==null)||(h=d==null?null:d.state,h=$APP.z.j(e,h==null?null:h.phase));d=f==null||$APP.z.j(f,d==null?null:d.name);return($APP.n(e)?e:f)!=null&&h&&d?Q1(a):null}var c=$APP.l(a,"__barebuildInvalidateOnHandler");
|
|
3
|
-
if($APP.n(c))return c;$APP.Q(a,"__barebuildInvalidateOnHandler",b);return b},S1=function(a){$APP.Bo(a,R1);var b=a.parentNode;var c=$APP.Yi(a,"event");c=$APP.n(c)?c:"barebuild-action-state";return b==null?console.warn("barebuild-invalidate-on: no parentNode source; no-op"):$APP.Co(a,b,c,rpa(a),R1)},spa=function(a){$APP.Xi(a,":host{display:none}","__barebuildInvalidateOnInit",!1);var b=$APP.Yi(a,"when-phase");b=$APP.n(b)?b:$APP.Yi(a,"when-name");$APP.n(b)||console.warn("barebuild-invalidate-on: needs at least one of when-phase / when-name; it will never match");
|
|
4
|
-
return S1(a)},tpa=function(a){return $APP.Bo(a,R1)},upa=function(a,b){var c=$APP.Vi(a,"__barebuildInvalidateOnInit");c?(c=a.isConnected,b=$APP.n(c)?$APP.z.j(b,"event"):c):b=c;return $APP.n(b)?S1(a):null},wpa=function(a){$APP.xj(a,vpa);return a.invalidate=function(){return Q1(this)}},T1=function(){return $APP.zi("barebuild-invalidate-on",new $APP.M(null,5,[$APP.ji,xpa,$APP.hi,spa,$APP.ei,tpa,$APP.di,upa,$APP.ii,wpa],null))};var xpa=["event","when-phase","when-name","src"],vpa=new $APP.M(null,4,[new $APP.F(null,"event","event",301435442),new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"event",$APP.wj,""],null),new $APP.F(null,"whenPhase","whenPhase",-1937229247),new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"when-phase",$APP.wj,""],null),new $APP.F(null,"whenName","whenName",1420789193),new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"when-name",$APP.wj,""],null),$APP.os,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"src",$APP.wj,""],null)],null);
|
|
5
|
-
$APP.je(["barebuild-invalidate",new $APP.M(null,1,[$APP.V,new $APP.M(null,1,[$APP.os,$APP.X],null)],null)]);var R1=new $APP.M(null,3,[$APP.yo,"__barebuildInvalidateOnHandler",$APP.zo,"__barebuildInvalidateOnSource",$APP.Ao,"__barebuildInvalidateOnBoundEvent"],null);$APP.fa("baredom.exports.barebuild_invalidate_on.init",T1);export const init=T1;
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// barebuild-route.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
-
|
|
3
|
-
export function init(): void;
|
|
4
|
-
|
|
5
|
-
export interface BarebuildRouteEventMap {
|
|
6
|
-
"event-route-mounted": CustomEvent<{}>;
|
|
7
|
-
"event-route-unmounted": CustomEvent<{}>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface BarebuildRoute extends HTMLElement {
|
|
11
|
-
path: string;
|
|
12
|
-
|
|
13
|
-
addEventListener<K extends keyof BarebuildRouteEventMap>(
|
|
14
|
-
type: K,
|
|
15
|
-
listener: (this: BarebuildRoute, ev: BarebuildRouteEventMap[K]) => any,
|
|
16
|
-
options?: boolean | AddEventListenerOptions
|
|
17
|
-
): void;
|
|
18
|
-
addEventListener(
|
|
19
|
-
type: string,
|
|
20
|
-
listener: EventListenerOrEventListenerObject,
|
|
21
|
-
options?: boolean | AddEventListenerOptions
|
|
22
|
-
): void;
|
|
23
|
-
removeEventListener<K extends keyof BarebuildRouteEventMap>(
|
|
24
|
-
type: K,
|
|
25
|
-
listener: (this: BarebuildRoute, ev: BarebuildRouteEventMap[K]) => any,
|
|
26
|
-
options?: boolean | EventListenerOptions
|
|
27
|
-
): void;
|
|
28
|
-
removeEventListener(
|
|
29
|
-
type: string,
|
|
30
|
-
listener: EventListenerOrEventListenerObject,
|
|
31
|
-
options?: boolean | EventListenerOptions
|
|
32
|
-
): void;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
declare global {
|
|
36
|
-
interface HTMLElementTagNameMap {
|
|
37
|
-
"barebuild-route": BarebuildRoute;
|
|
38
|
-
}
|
|
39
|
-
}
|
package/dist/barebuild-route.js
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var Dga=function(a){return $APP.He(function(b){return b.lastIndexOf(":",0)==0?new $APP.M(null,2,[$APP.fo,$APP.ho,$APP.Uj,b.substring(1)],null):new $APP.M(null,2,[$APP.fo,$APP.nu,$APP.go,b],null)},$APP.co(a))},YQ=function(a,b){return $APP.I($APP.l(a,"__barebuildRouteVisible"),b)?($APP.Q(a,"__barebuildRouteVisible",b),a.style.display=$APP.n(b)?"":"none"):null},ZQ=function(a){var b=a.getAttribute("path");$APP.Q(a,"__barebuildRoutePattern",$APP.Li(b)?Dga(b):null)},Ega=function(a){function b(c){c=c.detail.path;
|
|
3
|
-
var d=$APP.l(a,"__barebuildRoutePattern");return YQ(a,d!=null&&$APP.jo(d,$APP.co(c))!=null)}$APP.Q(a,"__barebuildRouteChangeHandler",b);a.addEventListener("barebuild-route-change",b)},$Q=function(a){return $APP.hj(a,"barebuild-route-mounted",{pattern:$APP.l(a,"__barebuildRoutePattern")})},Fga=function(a){$APP.Xi(a,":host{display:contents}","__barebuildRouteInit",!0);ZQ(a);YQ(a,!1);$APP.n($APP.l(a,"__barebuildRouteChangeHandler"))||Ega(a);return $Q(a)},Gga=function(a){return $APP.hj(a,"barebuild-route-unmounted",
|
|
4
|
-
{})},Hga=function(a,b,c,d){return $APP.I(c,d)&&$APP.Vi(a,"__barebuildRouteInit")?(ZQ(a),$Q(a)):null},Jga=function(a){return $APP.xj(a,Iga)},aR=function(){return $APP.zi("barebuild-route",new $APP.M(null,5,[$APP.ji,Kga,$APP.hi,Fga,$APP.ei,Gga,$APP.di,Hga,$APP.ii,Jga],null))};var Kga=["path"],Iga=new $APP.M(null,1,[$APP.Ps,new $APP.M(null,3,[$APP.N,$APP.X,$APP.W,"path",$APP.wj,""],null)],null);$APP.je(["barebuild-route-mounted",new $APP.M(null,1,[$APP.V,$APP.ke],null),"barebuild-route-unmounted",new $APP.M(null,1,[$APP.V,$APP.ke],null)]);$APP.fa("baredom.exports.barebuild_route.init",aR);export const init=aR;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
// barebuild-router.d.ts — auto-generated by generate_types.bb, do not edit
|
|
2
|
-
|
|
3
|
-
export function init(): void;
|
|
4
|
-
|
|
5
|
-
export interface BarebuildRouterEventMap {
|
|
6
|
-
"barebuild-route-change": CustomEvent<{ path: string; params: Record<string, any> }>;
|
|
7
|
-
"barebuild-navigate": CustomEvent<{ path: string }>;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export interface BarebuildRouter extends HTMLElement {
|
|
11
|
-
base: string;
|
|
12
|
-
readonly path: string;
|
|
13
|
-
readonly params: Record<string, any>;
|
|
14
|
-
|
|
15
|
-
addEventListener<K extends keyof BarebuildRouterEventMap>(
|
|
16
|
-
type: K,
|
|
17
|
-
listener: (this: BarebuildRouter, ev: BarebuildRouterEventMap[K]) => any,
|
|
18
|
-
options?: boolean | AddEventListenerOptions
|
|
19
|
-
): void;
|
|
20
|
-
addEventListener(
|
|
21
|
-
type: string,
|
|
22
|
-
listener: EventListenerOrEventListenerObject,
|
|
23
|
-
options?: boolean | AddEventListenerOptions
|
|
24
|
-
): void;
|
|
25
|
-
removeEventListener<K extends keyof BarebuildRouterEventMap>(
|
|
26
|
-
type: K,
|
|
27
|
-
listener: (this: BarebuildRouter, ev: BarebuildRouterEventMap[K]) => any,
|
|
28
|
-
options?: boolean | EventListenerOptions
|
|
29
|
-
): void;
|
|
30
|
-
removeEventListener(
|
|
31
|
-
type: string,
|
|
32
|
-
listener: EventListenerOrEventListenerObject,
|
|
33
|
-
options?: boolean | EventListenerOptions
|
|
34
|
-
): void;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare global {
|
|
38
|
-
interface HTMLElementTagNameMap {
|
|
39
|
-
"barebuild-router": BarebuildRouter;
|
|
40
|
-
}
|
|
41
|
-
}
|
package/dist/barebuild-router.js
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { $APP, shadow$provide } from "./base.js";
|
|
2
|
-
var hna=function(a){var b=$APP.re(gna);return new $APP.Id(null,function(){a:{var c=b;for(var d=a;;){d=$APP.q(d);var e;if(e=d)e=$APP.t(d),e=c.i?c.i(e):c.call(null,e);if($APP.n(e))d=$APP.gc(d);else{c=d;break a}}c=void 0}return c},null)},XZ=function(a){a=$APP.l(a,"__barebuildRouterRoutes");return $APP.n(a)?a:$APP.Ge},ina=function(a,b,c){var d=XZ(a);$APP.Q(a,"__barebuildRouterRoutes",$APP.n($APP.pe(function(e){var f=$APP.B(e,0,null);$APP.B(e,1,null);return f===b},d))?$APP.He(function(e){var f=$APP.B(e,
|
|
3
|
-
0,null);$APP.B(e,1,null);return f===b?new $APP.J(null,2,5,$APP.K,[b,c],null):e},d):$APP.Cd.j(d,new $APP.J(null,2,5,$APP.K,[b,c],null)))},jna=function(a){var b=XZ(a);$APP.n($APP.pe(function(c){var d=$APP.B(c,0,null);$APP.B(c,1,null);return $APP.p(d.isConnected)},b))&&$APP.Q(a,"__barebuildRouterRoutes",$APP.Ie(function(c){var d=$APP.B(c,0,null);$APP.B(c,1,null);return d.isConnected},b))},kna=function(a,b){return $APP.pe(function(c){var d=$APP.B(c,0,null);c=$APP.B(c,1,null);return $APP.n($APP.n(c)?d.isConnected:
|
|
4
|
-
c)?$APP.io.i($APP.jo(c,b)):null},XZ(a))},YZ=function(a,b){a.dispatchEvent(new CustomEvent("barebuild-route-change",{detail:b,bubbles:!1,composed:!1}))},ZZ=function(a,b){jna(a);var c=a.getAttribute("base");var d=location.pathname;c=$APP.n(c)?c:"";d=$APP.n(d)?d:"";c=$APP.I(c,"")&&$APP.ia(c,"/")?$APP.yd(c,$APP.w(c)-1):c;var e;(e=$APP.I(c,""))&&!(e=$APP.z.j(d,c))&&(e=""+$APP.P.i(c)+"/",e=d.lastIndexOf(e,0)==0);e&&(c=$APP.w(c),d=d.substring(c),d=$APP.z.j("",d)?"/":d);c=$APP.co(d);c=kna(a,c);d=new $APP.M(null,
|
|
5
|
-
2,[$APP.Ps,d,$APP.io,$APP.n(c)?c:$APP.ke],null);$APP.I(d,$APP.l(a,"__barebuildRouterMatch"))&&(c={path:$APP.Ps.i(d),params:$APP.gm($APP.io.i(d))},$APP.Q(a,"__barebuildRouterMatch",d),$APP.Q(a,"__barebuildRouterDetail",c),$APP.hj(a,"barebuild-route-change",c));a=$APP.l(a,"__barebuildRouterDetail");b=$APP.q(b);d=null;for(var f=e=0;;)if(f<e)c=d.C(null,f),YZ(c,a),f+=1;else if(b=$APP.q(b))d=b,$APP.$c(d)?(b=$APP.Fb(d),e=$APP.Gb(d),d=b,c=$APP.w(b),b=e,e=c):(c=$APP.t(d),YZ(c,a),b=$APP.v(d),d=null,e=0),f=
|
|
6
|
-
0;else return null},lna=function(a,b){b.stopPropagation();var c=b.target;ina(a,c,b.detail.pattern);return queueMicrotask(function(){return ZZ(a,new $APP.J(null,1,5,$APP.K,[c],null))})},gna=function(a){var b=a instanceof HTMLAnchorElement;return b?a.hasAttribute("data-barebuild-route"):b},mna=function(a){return $APP.z.j("barebuild-router",a.localName)},$Z=function(a,b){b=b instanceof $APP.F?b.ea:null;switch(b){case "document":return document;case "window":return window;case "self":return a;default:throw Error("No matching clause: "+
|
|
7
|
-
$APP.P.i(b));}},nna=function(a){var b={};$APP.la(b,"docClick",function(c){a:{var d;if(d=$APP.z.j(0,c.button))d=c.metaKey,$APP.n(d)||(d=c.ctrlKey,$APP.n(d)||(d=c.shiftKey,d=$APP.n(d)?d:c.altKey)),d=$APP.p(d)&&$APP.p(c.defaultPrevented);if(d){d=$APP.Fc(c.composedPath());var e=hna(d);d=$APP.t(e);e=$APP.t($APP.Ee(mna,$APP.gc(e)));if($APP.n(d)){var f=$APP.z.j(d.origin,location.origin);var h=d.target;h=$APP.z.j(h,"")||$APP.z.j(h,"_self");d=new $APP.M(null,7,[a_,d,$APP.aq,!0,$APP.wr,e===a,$APP.Ot,f,$APP.Pp,
|
|
8
|
-
h,$APP.js,d.hasAttribute("download"),$APP.Qt,$APP.z.j(d.pathname,location.pathname)&&$APP.z.j(d.search,location.search)&&$APP.I("",d.hash)],null)}else d=new $APP.M(null,1,[$APP.aq,!1],null);var k=$APP.G(d);e=$APP.C(k,$APP.aq);f=$APP.C(k,$APP.wr);h=$APP.C(k,$APP.Ot);var m=$APP.C(k,$APP.Pp),r=$APP.C(k,$APP.js);k=$APP.C(k,$APP.Qt);if($APP.oe($APP.sd,new $APP.J(null,6,5,$APP.K,[e,f,h,m,$APP.p(r),$APP.p(k)],null))){c.preventDefault();c=a_.i(d);c=""+$APP.P.i(c.pathname)+$APP.P.i(c.search)+$APP.P.i(c.hash);
|
|
9
|
-
c=$APP.hj(a,"barebuild-navigate",{path:c});break a}}c=null}return c});$APP.la(b,"popstate",function(){return ZZ(a,$APP.He($APP.t,XZ(a)))});$APP.la(b,"navigate",function(c){c.stopPropagation();c=c.detail.path;typeof c==="string"?(history.pushState(null,"",c),c=ZZ(a,$APP.He($APP.t,XZ(a)))):c=null;return c});$APP.la(b,"mounted",function(c){return lna(a,c)});return b},ona=function(a){$APP.xj(a,$APP.tv);$APP.tj(a,"path",function(b){b=$APP.l(b,"__barebuildRouterDetail");return $APP.n(b)?b.path:""});return $APP.tj(a,
|
|
10
|
-
"params",function(b){b=$APP.l(b,"__barebuildRouterDetail");return $APP.n(b)?b.params:{}})},pna=function(a){$APP.Xi(a,":host{display:contents}","__barebuildRouterInit",!0);if(!$APP.n($APP.l(a,"__barebuildRouterHandlers")))a:{var b=nna(a);$APP.Q(a,"__barebuildRouterHandlers",b);for(var c=$APP.q(b_),d=null,e=0,f=0;;)if(f<e){var h=d.C(null,f),k=$APP.B(h,0,null),m=$APP.B(h,1,null),r=$APP.B(h,2,null);h=$APP.B(h,3,null);$Z(a,k).addEventListener(m,$APP.l(b,r),h);f+=1}else if(c=$APP.q(c))$APP.$c(c)?(m=$APP.Fb(c),
|
|
11
|
-
c=$APP.Gb(c),k=m,m=$APP.w(m),d=k,e=m):(d=$APP.t(c),k=$APP.B(d,0,null),m=$APP.B(d,1,null),r=$APP.B(d,2,null),h=$APP.B(d,3,null),$Z(a,k).addEventListener(m,$APP.l(b,r),h),c=$APP.v(c),d=null,e=0),f=0;else break a}return ZZ(a,$APP.He($APP.t,XZ(a)))},qna=function(a){var b=$APP.l(a,"__barebuildRouterHandlers");if($APP.n(b)){for(var c=$APP.q(b_),d=null,e=0,f=0;;)if(f<e){var h=d.C(null,f),k=$APP.B(h,0,null),m=$APP.B(h,1,null),r=$APP.B(h,2,null);h=$APP.B(h,3,null);$Z(a,k).removeEventListener(m,$APP.l(b,r),
|
|
12
|
-
h);f+=1}else if(c=$APP.q(c))$APP.$c(c)?(e=$APP.Fb(c),c=$APP.Gb(c),d=e,e=$APP.w(e)):(k=$APP.t(c),d=$APP.B(k,0,null),e=$APP.B(k,1,null),f=$APP.B(k,2,null),k=$APP.B(k,3,null),$Z(a,d).removeEventListener(e,$APP.l(b,f),k),c=$APP.v(c),d=null,e=0),f=0;else break;$APP.Q(a,"__barebuildRouterHandlers",null)}return $APP.Q(a,"__barebuildRouterRoutes",$APP.Ge)},rna=function(a,b,c,d){if(b=$APP.I(c,d))b=(b=$APP.Vi(a,"__barebuildRouterInit"))?a.isConnected:b;return $APP.n(b)?ZZ(a,$APP.He($APP.t,XZ(a))):null},c_=
|
|
13
|
-
function(){return $APP.zi("barebuild-router",new $APP.M(null,5,[$APP.ji,sna,$APP.hi,pna,$APP.ei,qna,$APP.di,rna,$APP.ii,ona],null))},sna=["base"],a_=new $APP.F(null,"anchor","anchor",1549638489),d_=new $APP.F(null,"self","self",-1547428899);var b_=new $APP.J(null,4,5,$APP.K,[new $APP.J(null,4,5,$APP.K,[$APP.$t,"click","docClick",!0],null),new $APP.J(null,4,5,$APP.K,[new $APP.F(null,"window","window",724519534),"popstate","popstate",!1],null),new $APP.J(null,4,5,$APP.K,[d_,"barebuild-navigate","navigate",!1],null),new $APP.J(null,4,5,$APP.K,[d_,"barebuild-route-mounted","mounted",!1],null)],null);$APP.fa("baredom.exports.barebuild_router.init",c_);export const init=c_;
|