@dooboostore/simple-web-component 1.0.40 → 1.0.41
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 +170 -1
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -3
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/cjs/elements/SwcAppMixin.js +11 -4
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js +9 -3
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +2 -2
- package/dist/esm/elements/SwcAppMixin.js +11 -4
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +20 -7
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +2 -2
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +2 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -1
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +20 -7
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +2 -2
- package/package.json +1 -1
- package/src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts +14 -4
- package/src/elements/SwcAppMixin.ts +16 -4
|
@@ -12,10 +12,12 @@ export interface SwcAppRouteChangeOptions {
|
|
|
12
12
|
currentThis: any;
|
|
13
13
|
helper: HelperHostSet;
|
|
14
14
|
}) => boolean;
|
|
15
|
+
order?: number;
|
|
15
16
|
}
|
|
16
17
|
export declare function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
17
18
|
export declare function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;
|
|
18
19
|
export declare function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType): MethodDecorator;
|
|
20
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(pathPattern: RoutePathType, config: Omit<SwcAppRouteChangeOptions, 'path'>): MethodDecorator;
|
|
19
21
|
export declare function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;
|
|
20
22
|
export declare const getSubscribeSwcAppRouteChangeWhileConnectedMetadata: (target: any) => SwcAppRouteChangeSubscriberMetadata[] | undefined;
|
|
21
23
|
//# sourceMappingURL=subscribeSwcAppRouteChangeWhileConnected.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subscribeSwcAppRouteChangeWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,MAAM,EAAC,MAAM,uBAAuB,CAAC;AAC7C,OAAO,EAAC,aAAa,EAAC,MAAM,UAAU,CAAC;AAEvC,eAAO,MAAM,2DAA2D,eAAoF,CAAC;AAE7J,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,CAAC,CAAC,WAAW,EAAE,GAAG,KAAK,MAAM,GAAG,MAAM,EAAE,CAAC,CAAC;AAE1F,MAAM,WAAW,mCAAmC;IAClD,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,OAAO,CAAC,EAAE,wBAAwB,CAAC;CACpC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;QAAC,WAAW,EAAE,GAAG,CAAC;QAAC,MAAM,EAAE,aAAa,CAAA;KAAC,KAAK,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"subscribeSwcAppRouteChangeWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts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":"SwcAppMixin.d.ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AAExD,OAAO,EAAC,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAA0C,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAGtD,eAAO,MAAM,KAAK,GAAI,GAAG,WAAW,YAEnC,CAAA;AACD,eAAO,MAAM,eAAe,GAAI,GAAG,WAAW,SAE7C,CAAA;AACD,eAAO,MAAM,kBAAkB,GAAI,GAAG,WAAW,SAEhD,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC;kBAmB1D,GAAG,EAAE;;;8BAfJ,YAAY;2BACf,eAAe;;;uCAIH,GAAG;wCACF,GAAG;QAEnC;;;;WAIG;;;;;gDAoB2C,WAAW,MAAM,eAAe;
|
|
1
|
+
{"version":3,"file":"SwcAppMixin.d.ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,aAAa,EAAC,MAAM,UAAU,CAAC;AAExD,OAAO,EAAC,YAAY,EAAE,sBAAsB,EAAE,aAAa,EAAC,MAAM,iBAAiB,CAAC;AACpF,OAAO,EAA0C,YAAY,EAAC,MAAM,mBAAmB,CAAC;AACxF,OAAO,EAAC,eAAe,EAAC,MAAM,uBAAuB,CAAC;AAGtD,eAAO,MAAM,KAAK,GAAI,GAAG,WAAW,YAEnC,CAAA;AACD,eAAO,MAAM,eAAe,GAAI,GAAG,WAAW,SAE7C,CAAA;AACD,eAAO,MAAM,kBAAkB,GAAI,GAAG,WAAW,SAEhD,CAAA;AAED;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,KAAI,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC;kBAmB1D,GAAG,EAAE;;;8BAfJ,YAAY;2BACf,eAAe;;;uCAIH,GAAG;wCACF,GAAG;QAEnC;;;;WAIG;;;;;gDAoB2C,WAAW,MAAM,eAAe;6BAmFnD,WAAW,WAAW;YAAE,YAAY,EAAE,OAAO,CAAA;SAAE;iCAqD3C,GAAG;gCAQV,GAAG;kCAOK,eAAe;yBAOxB,sBAAsB;;;sBAsEzB,MAAM;gBAIlB,IAAI;mBAID,IAAI;kBAIL,IAAI;gCAIU,aAAa,GAAG,IAAI;4CAMR,GAAG,WAAW,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2BlE"}
|
|
@@ -10995,15 +10995,21 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
10995
10995
|
return descriptor;
|
|
10996
10996
|
};
|
|
10997
10997
|
}
|
|
10998
|
-
function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions,
|
|
10999
|
-
if (
|
|
11000
|
-
return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions,
|
|
10998
|
+
function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKeyOrConfig, descriptor) {
|
|
10999
|
+
if (propertyKeyOrConfig && (typeof propertyKeyOrConfig === "string" || typeof propertyKeyOrConfig === "symbol")) {
|
|
11000
|
+
return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKeyOrConfig, descriptor);
|
|
11001
11001
|
}
|
|
11002
11002
|
let options = {};
|
|
11003
11003
|
if (Array.isArray(targetOrOptions)) {
|
|
11004
11004
|
options.path = targetOrOptions;
|
|
11005
|
+
if (propertyKeyOrConfig && typeof propertyKeyOrConfig === "object") {
|
|
11006
|
+
options = { ...options, ...propertyKeyOrConfig };
|
|
11007
|
+
}
|
|
11005
11008
|
} else if (typeof targetOrOptions === "string" || typeof targetOrOptions === "function") {
|
|
11006
11009
|
options.path = targetOrOptions;
|
|
11010
|
+
if (propertyKeyOrConfig && typeof propertyKeyOrConfig === "object") {
|
|
11011
|
+
options = { ...options, ...propertyKeyOrConfig };
|
|
11012
|
+
}
|
|
11007
11013
|
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
11008
11014
|
options = targetOrOptions;
|
|
11009
11015
|
}
|
|
@@ -13459,7 +13465,12 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13459
13465
|
const routeChangeSubscribers = getSubscribeSwcAppRouteChangeWhileConnectedMetadata(instance);
|
|
13460
13466
|
if (routeChangeSubscribers && Array.isArray(routeChangeSubscribers)) {
|
|
13461
13467
|
console.log("[SWC-MIXIN] Route change subscribers found");
|
|
13462
|
-
const
|
|
13468
|
+
const sortedSubscribers = [...routeChangeSubscribers].sort((a, b) => {
|
|
13469
|
+
const orderA = a.options?.order ?? 0;
|
|
13470
|
+
const orderB = b.options?.order ?? 0;
|
|
13471
|
+
return orderA - orderB;
|
|
13472
|
+
});
|
|
13473
|
+
for (const metadata of sortedSubscribers) {
|
|
13463
13474
|
const methodName = metadata.propertyKey;
|
|
13464
13475
|
let pathPattern = metadata.options?.path;
|
|
13465
13476
|
const filter = metadata.options?.filter;
|
|
@@ -13487,10 +13498,12 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
13487
13498
|
const hostSet = SwcUtils.getHelperAndHostSet(this.config.window, this);
|
|
13488
13499
|
const filterPassed = !filter || filter(this.router, { helper: hostSet, currentThis: instance });
|
|
13489
13500
|
if (pathMatched && filterPassed && instance[methodName]) {
|
|
13490
|
-
await instance[methodName]({ ...re, pathData });
|
|
13501
|
+
const result = await instance[methodName]({ ...re, pathData });
|
|
13502
|
+
if (result !== void 0 && result !== null) {
|
|
13503
|
+
break;
|
|
13504
|
+
}
|
|
13491
13505
|
}
|
|
13492
|
-
}
|
|
13493
|
-
await Promise.allSettled(ps);
|
|
13506
|
+
}
|
|
13494
13507
|
}
|
|
13495
13508
|
} finally {
|
|
13496
13509
|
if (this.config?.ssr) {
|