@dooboostore/simple-web-component 1.0.32 → 1.0.33
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 +280 -43
- package/dist/cjs/decorators/elementDefine.js +1 -1
- package/dist/cjs/decorators/elementDefine.js.map +2 -2
- package/dist/cjs/decorators/index.js +3 -1
- package/dist/cjs/decorators/index.js.map +2 -2
- package/dist/cjs/decorators/publishSwcAppMessage.js +86 -0
- package/dist/cjs/decorators/publishSwcAppMessage.js.map +7 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js +62 -0
- package/dist/cjs/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
- package/dist/cjs/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +16 -16
- package/dist/cjs/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
- package/dist/cjs/elements/SwcAppMixin.js +31 -2
- package/dist/cjs/elements/SwcAppMixin.js.map +2 -2
- package/dist/cjs/types.js.map +1 -1
- package/dist/esm/decorators/elementDefine.js +1 -1
- package/dist/esm/decorators/elementDefine.js.map +2 -2
- package/dist/esm/decorators/index.js +3 -1
- package/dist/esm/decorators/index.js.map +2 -2
- package/dist/esm/decorators/publishSwcAppMessage.js +67 -0
- package/dist/esm/decorators/publishSwcAppMessage.js.map +7 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js +43 -0
- package/dist/esm/decorators/subscribeSwcAppMessageWhileConnected.js.map +7 -0
- package/dist/esm/decorators/{subscribeSwcAppRouteChange.js → subscribeSwcAppRouteChangeWhileConnected.js} +13 -13
- package/dist/esm/decorators/subscribeSwcAppRouteChangeWhileConnected.js.map +7 -0
- package/dist/esm/elements/SwcAppMixin.js +31 -2
- package/dist/esm/elements/SwcAppMixin.js.map +2 -2
- package/dist/esm/types.js.map +1 -1
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js +119 -14
- package/dist/esm-bundle/dooboostore-simple-web-component.esm.js.map +4 -4
- package/dist/types/decorators/elementDefine.d.ts +1 -0
- package/dist/types/decorators/elementDefine.d.ts.map +1 -1
- package/dist/types/decorators/index.d.ts +3 -1
- package/dist/types/decorators/index.d.ts.map +1 -1
- package/dist/types/decorators/publishSwcAppMessage.d.ts +13 -0
- package/dist/types/decorators/publishSwcAppMessage.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts +16 -0
- package/dist/types/decorators/subscribeSwcAppMessageWhileConnected.d.ts.map +1 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts +18 -0
- package/dist/types/decorators/subscribeSwcAppRouteChangeWhileConnected.d.ts.map +1 -0
- package/dist/types/elements/SwcAppMixin.d.ts +3 -0
- package/dist/types/elements/SwcAppMixin.d.ts.map +1 -1
- package/dist/types/types.d.ts +6 -0
- package/dist/types/types.d.ts.map +1 -1
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js +119 -14
- package/dist/umd-bundle/dooboostore-simple-web-component.umd.js.map +4 -4
- package/package.json +4 -4
- package/src/decorators/elementDefine.ts +2 -1
- package/src/decorators/index.ts +3 -1
- package/src/decorators/publishSwcAppMessage.ts +100 -0
- package/src/decorators/subscribeSwcAppMessageWhileConnected.ts +73 -0
- package/src/decorators/{subscribeSwcAppRouteChange.ts → subscribeSwcAppRouteChangeWhileConnected.ts} +19 -19
- package/src/elements/SwcAppMixin.ts +42 -3
- package/src/types.ts +8 -0
- package/dist/cjs/decorators/subscribeSwcAppRouteChange.js.map +0 -7
- package/dist/esm/decorators/subscribeSwcAppRouteChange.js.map +0 -7
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts +0 -18
- package/dist/types/decorators/subscribeSwcAppRouteChange.d.ts.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"elementDefine.d.ts","sourceRoot":"","sources":["../../../src/decorators/elementDefine.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,kBAAkB,eAAoD,CAAC;AAEpF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,GAAG,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"elementDefine.d.ts","sourceRoot":"","sources":["../../../src/decorators/elementDefine.ts"],"names":[],"mappings":"AAiBA,eAAO,MAAM,kBAAkB,eAAoD,CAAC;AAEpF,MAAM,WAAW,aAAa;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC9B,qBAAqB,CAAC,EAAE,GAAG,CAAC;IAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC;IACpE,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,eAAO,MAAM,gBAAgB,GAAI,QAAQ,GAAG,KAAG,eAAe,GAAG,SAGhE,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,MAAM,GAAG,SAkEnC,CAAC;AA2JF,eAAO,MAAM,aAAa,GACvB,MAAM,MAAM,EAAE,SAAQ,OAAO,CAAC,aAAa,CAAM,KAAG,cAqWpD,CAAC"}
|
|
@@ -11,5 +11,7 @@ export * from './applyClass';
|
|
|
11
11
|
export * from './applyStyle';
|
|
12
12
|
export * from './applyAttribute';
|
|
13
13
|
export * from './setProperty';
|
|
14
|
-
export * from './
|
|
14
|
+
export * from './subscribeSwcAppRouteChangeWhileConnected';
|
|
15
|
+
export * from './subscribeSwcAppMessageWhileConnected';
|
|
16
|
+
export * from './publishSwcAppMessage';
|
|
15
17
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/decorators/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,iBAAiB,CAAC;AAChC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,SAAS,CAAC;AACxB,cAAc,YAAY,CAAC;AAC3B,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,eAAe,CAAC;AAC9B,cAAc,4CAA4C,CAAC;AAC3D,cAAc,wCAAwC,CAAC;AACvD,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare const PUBLISH_SWC_APP_MESSAGE_METADATA_KEY: unique symbol;
|
|
2
|
+
export interface PublishSwcAppMessageMetadata {
|
|
3
|
+
propertyKey: string | symbol;
|
|
4
|
+
messageType?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface PublishSwcAppMessageOptions {
|
|
7
|
+
messageType?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function publishSwcAppMessage(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
10
|
+
export declare function publishSwcAppMessage(): MethodDecorator;
|
|
11
|
+
export declare function publishSwcAppMessage(messageType: string): MethodDecorator;
|
|
12
|
+
export declare const getPublishSwcAppMessageMetadata: (target: any) => PublishSwcAppMessageMetadata[] | undefined;
|
|
13
|
+
//# sourceMappingURL=publishSwcAppMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publishSwcAppMessage.d.ts","sourceRoot":"","sources":["../../../src/decorators/publishSwcAppMessage.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oCAAoC,eAA6D,CAAC;AAE/G,MAAM,WAAW,4BAA4B;IAC3C,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAyDD,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,IAAI,CAAC;AAE9I,wBAAgB,oBAAoB,IAAI,eAAe,CAAC;AACxD,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAAC;AAuB3E,eAAO,MAAM,+BAA+B,GAAI,QAAQ,GAAG,KAAG,4BAA4B,EAAE,GAAG,SAG9F,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { SwcAppMessage } from '../types';
|
|
2
|
+
export declare const SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY: unique symbol;
|
|
3
|
+
export interface SwcAppMessageSubscriberMetadata {
|
|
4
|
+
propertyKey: string | symbol;
|
|
5
|
+
messageType?: string;
|
|
6
|
+
filter?: (message: SwcAppMessage) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SwcAppMessageOptions {
|
|
9
|
+
filter?: (message: SwcAppMessage) => boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function subscribeSwcAppMessageWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
12
|
+
export declare function subscribeSwcAppMessageWhileConnected(messageType: string): MethodDecorator;
|
|
13
|
+
export declare function subscribeSwcAppMessageWhileConnected(options: SwcAppMessageOptions): MethodDecorator;
|
|
14
|
+
export declare function subscribeSwcAppMessageWhileConnected(messageType: string, options: SwcAppMessageOptions): MethodDecorator;
|
|
15
|
+
export declare const getSubscribeSwcAppMessageWhileConnectedMetadata: (target: any) => SwcAppMessageSubscriberMetadata[] | undefined;
|
|
16
|
+
//# sourceMappingURL=subscribeSwcAppMessageWhileConnected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeSwcAppMessageWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppMessageWhileConnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,eAAO,MAAM,sDAAsD,eAA+E,CAAC;AAEnJ,MAAM,WAAW,+BAA+B;IAC9C,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;CAC9C;AAED,MAAM,WAAW,oBAAoB;IACnC,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC;CAC9C;AAmBD,wBAAgB,oCAAoC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,IAAI,CAAC;AAE9J,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAAC;AAE3F,wBAAgB,oCAAoC,CAAC,OAAO,EAAE,oBAAoB,GAAG,eAAe,CAAC;AAErG,wBAAgB,oCAAoC,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,oBAAoB,GAAG,eAAe,CAAC;AA+B1H,eAAO,MAAM,+CAA+C,GAAI,QAAQ,GAAG,KAAG,+BAA+B,EAAE,GAAG,SAGjH,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Router } from '@dooboostore/core-web';
|
|
2
|
+
export declare const SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY: unique symbol;
|
|
3
|
+
export interface SwcAppRouteChangeSubscriberMetadata {
|
|
4
|
+
propertyKey: string | symbol;
|
|
5
|
+
pathPattern?: string | string[];
|
|
6
|
+
filter?: (router: Router) => boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SwcAppRouteChangeOptions {
|
|
9
|
+
path?: string | string[];
|
|
10
|
+
filter?: (router: Router) => boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(target: Object, propertyKey: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor | void;
|
|
13
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(): MethodDecorator;
|
|
14
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(pathPattern: string): MethodDecorator;
|
|
15
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(pathPatterns: string[]): MethodDecorator;
|
|
16
|
+
export declare function subscribeSwcAppRouteChangeWhileConnected(options: SwcAppRouteChangeOptions): MethodDecorator;
|
|
17
|
+
export declare const getSubscribeSwcAppRouteChangeWhileConnectedMetadata: (target: any) => SwcAppRouteChangeSubscriberMetadata[] | undefined;
|
|
18
|
+
//# sourceMappingURL=subscribeSwcAppRouteChangeWhileConnected.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subscribeSwcAppRouteChangeWhileConnected.d.ts","sourceRoot":"","sources":["../../../src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,eAAO,MAAM,2DAA2D,eAAoF,CAAC;AAE7J,MAAM,WAAW,mCAAmC;IAClD,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAChC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACtC;AAED,MAAM,WAAW,wBAAwB;IACvC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC;CACtC;AAoBD,wBAAgB,wCAAwC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,EAAE,kBAAkB,GAAG,kBAAkB,GAAG,IAAI,CAAC;AAElK,wBAAgB,wCAAwC,IAAI,eAAe,CAAC;AAC5E,wBAAgB,wCAAwC,CAAC,WAAW,EAAE,MAAM,GAAG,eAAe,CAAC;AAC/F,wBAAgB,wCAAwC,CAAC,YAAY,EAAE,MAAM,EAAE,GAAG,eAAe,CAAC;AAClG,wBAAgB,wCAAwC,CAAC,OAAO,EAAE,wBAAwB,GAAG,eAAe,CAAC;AA4B7G,eAAO,MAAM,mDAAmD,GAAI,QAAQ,GAAG,KAAG,mCAAmC,EAAE,GAAG,SAGzH,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { SwcAppEngine, SwcAttributeConfigType } from './SwcAppEngine';
|
|
2
|
+
import { SwcAppMessage } from '../types';
|
|
2
3
|
import { Subscription } from '@dooboostore/core';
|
|
3
4
|
import { Router, RouterEventType } from '@dooboostore/core-web';
|
|
4
5
|
export declare function SwcAppMixin<T extends {
|
|
@@ -24,6 +25,8 @@ export declare function SwcAppMixin<T extends {
|
|
|
24
25
|
back(): void;
|
|
25
26
|
forward(): void;
|
|
26
27
|
reload(): void;
|
|
28
|
+
publishMessage(message: SwcAppMessage): void;
|
|
29
|
+
_invokeMessageSubscribers(instance: any, message: SwcAppMessage): void;
|
|
27
30
|
accessKey: string;
|
|
28
31
|
readonly accessKeyLabel: string;
|
|
29
32
|
autocapitalize: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SwcAppMixin.d.ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAiB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"SwcAppMixin.d.ts","sourceRoot":"","sources":["../../../src/elements/SwcAppMixin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,sBAAsB,EAAiB,MAAM,gBAAgB,CAAC;AACrF,OAAO,EAAmB,aAAa,EAAE,MAAM,UAAU,CAAC;AAE1D,OAAO,EAAiB,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAKhE,wBAAgB,WAAW,CAAC,CAAC,SAAS;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,WAAW,CAAA;CAAE,EAAE,IAAI,EAAE,CAAC;kBAA9B,GAAG,EAAE;;;8BAKjC,YAAY;2BACf,eAAe;;;;gDAgBM,GAAG,MAAM,eAAe;6BA2C3C,GAAG;gCAcA,GAAG;kCAMD,eAAe;yBAYlB,sBAAsB;kDA6DH,GAAG;;;sBA0CzB,MAAM;gBAIlB,IAAI;mBAID,IAAI;kBAIL,IAAI;gCAIU,aAAa,GAAG,IAAI;4CAOR,GAAG,WAAW,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA+BlE"}
|
package/dist/types/types.d.ts
CHANGED
|
@@ -39,6 +39,11 @@ export type HostSet = {
|
|
|
39
39
|
export type HelperHostSet = HelperSet & HostSet & {
|
|
40
40
|
$this: any;
|
|
41
41
|
};
|
|
42
|
+
export type SwcAppMessage<T = any> = {
|
|
43
|
+
publisher?: any;
|
|
44
|
+
data?: T;
|
|
45
|
+
type?: string;
|
|
46
|
+
};
|
|
42
47
|
export interface SwcChooseInterface extends HTMLTemplateElement {
|
|
43
48
|
value: any;
|
|
44
49
|
refresh(): void;
|
|
@@ -55,5 +60,6 @@ export interface SwcAppInterface extends HTMLElement {
|
|
|
55
60
|
reload(): void;
|
|
56
61
|
back(): void;
|
|
57
62
|
forward(): void;
|
|
63
|
+
publishMessage(message: SwcAppMessage): void;
|
|
58
64
|
}
|
|
59
65
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,4CAA4C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAC,sBAAsB,EAAC,MAAM,yBAAyB,CAAC;AAE/D,oBAAY,mBAAmB;IAC7B,QAAQ,mCAAmC;IAC3C,QAAQ,mCAAmC;IAC3C,SAAS,oCAAoC;IAC7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AAC;IAChB,OAAO,CAAC,MAAM,CAAC,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IACrC,MAAM,IAAI,IAAI,CAAC;IACf,IAAI,IAAI,IAAI,CAAC;IACb,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,CAAC,OAAO,EAAE,aAAa,GAAG,IAAI,CAAC;CAC9C"}
|
|
@@ -1142,10 +1142,12 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1142
1142
|
ON_CONNECTED_SWC_APP_METADATA_KEY: () => ON_CONNECTED_SWC_APP_METADATA_KEY,
|
|
1143
1143
|
ON_INITIALIZE_METADATA_KEY: () => ON_INITIALIZE_METADATA_KEY,
|
|
1144
1144
|
PROPERTY_SET_METADATA_KEY: () => PROPERTY_SET_METADATA_KEY,
|
|
1145
|
+
PUBLISH_SWC_APP_MESSAGE_METADATA_KEY: () => PUBLISH_SWC_APP_MESSAGE_METADATA_KEY,
|
|
1145
1146
|
QUERY_ALL_METADATA_KEY: () => QUERY_ALL_METADATA_KEY,
|
|
1146
1147
|
QUERY_METADATA_KEY: () => QUERY_METADATA_KEY,
|
|
1147
1148
|
STYLE_METADATA_KEY: () => STYLE_METADATA_KEY,
|
|
1148
|
-
|
|
1149
|
+
SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY: () => SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY,
|
|
1150
|
+
SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY: () => SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY,
|
|
1149
1151
|
SWC_NOT_FOUND: () => SWC_NOT_FOUND,
|
|
1150
1152
|
SwcUtils: () => SwcUtils,
|
|
1151
1153
|
addClass: () => addClass,
|
|
@@ -1196,9 +1198,11 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1196
1198
|
getElementConfig: () => getElementConfig,
|
|
1197
1199
|
getEmitCustomEventMetadataList: () => getEmitCustomEventMetadataList,
|
|
1198
1200
|
getOnConnectedInnerHtmlMetadata: () => getOnConnectedInnerHtmlMetadata,
|
|
1201
|
+
getPublishSwcAppMessageMetadata: () => getPublishSwcAppMessageMetadata,
|
|
1199
1202
|
getQueryAllMetadata: () => getQueryAllMetadata,
|
|
1200
1203
|
getQueryMetadata: () => getQueryMetadata,
|
|
1201
|
-
|
|
1204
|
+
getSubscribeSwcAppMessageWhileConnectedMetadata: () => getSubscribeSwcAppMessageWhileConnectedMetadata,
|
|
1205
|
+
getSubscribeSwcAppRouteChangeWhileConnectedMetadata: () => getSubscribeSwcAppRouteChangeWhileConnectedMetadata,
|
|
1202
1206
|
host: () => host,
|
|
1203
1207
|
htmlAElement: () => htmlAElement,
|
|
1204
1208
|
htmlArticleElement: () => htmlArticleElement,
|
|
@@ -1227,6 +1231,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1227
1231
|
onDisconnected: () => onDisconnected,
|
|
1228
1232
|
onInitialize: () => onInitialize,
|
|
1229
1233
|
parentHost: () => parentHost,
|
|
1234
|
+
publishSwcAppMessage: () => publishSwcAppMessage,
|
|
1230
1235
|
query: () => query,
|
|
1231
1236
|
queryAll: () => queryAll,
|
|
1232
1237
|
queryAllHost: () => queryAllHost,
|
|
@@ -1246,7 +1251,8 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
1246
1251
|
setPropertyHost: () => setPropertyHost,
|
|
1247
1252
|
setStyle: () => setStyle,
|
|
1248
1253
|
setStyleHost: () => setStyleHost,
|
|
1249
|
-
|
|
1254
|
+
subscribeSwcAppMessageWhileConnected: () => subscribeSwcAppMessageWhileConnected,
|
|
1255
|
+
subscribeSwcAppRouteChangeWhileConnected: () => subscribeSwcAppRouteChangeWhileConnected,
|
|
1250
1256
|
textNode: () => textNode,
|
|
1251
1257
|
toggleClass: () => toggleClass,
|
|
1252
1258
|
toggleClassHost: () => toggleClassHost,
|
|
@@ -8066,7 +8072,7 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
8066
8072
|
const appHost2 = hostSet.$appHost;
|
|
8067
8073
|
const conf = getElementConfig(this);
|
|
8068
8074
|
const currentWin = this._resolveWindow(conf);
|
|
8069
|
-
if (connectedInnerHtmlList.some((it) => it.options.useShadow === true) && !this.shadowRoot) {
|
|
8075
|
+
if ((connectedInnerHtmlList.some((it) => it.options.useShadow === true) || conf?.useShadow === true) && !this.shadowRoot) {
|
|
8070
8076
|
this.attachShadow({ mode: "open" });
|
|
8071
8077
|
}
|
|
8072
8078
|
this._executeSwcScript("swc-on-before-connected", hostSet);
|
|
@@ -8902,25 +8908,25 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
8902
8908
|
return setProperty(":host", propertyNameOrOptions, options);
|
|
8903
8909
|
};
|
|
8904
8910
|
|
|
8905
|
-
// src/decorators/
|
|
8906
|
-
var
|
|
8907
|
-
function
|
|
8911
|
+
// src/decorators/subscribeSwcAppRouteChangeWhileConnected.ts
|
|
8912
|
+
var SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for("simple-web-component:subscribe-swc-app-route-change-while-connected");
|
|
8913
|
+
function createSubscribeSwcAppRouteChangeWhileConnected(options) {
|
|
8908
8914
|
return (target, propertyKey, descriptor) => {
|
|
8909
8915
|
const pathPattern = options?.path;
|
|
8910
8916
|
const filter = options?.filter;
|
|
8911
8917
|
const constructor = target.constructor;
|
|
8912
|
-
let list = ReflectUtils.getOwnMetadata(
|
|
8918
|
+
let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
8913
8919
|
if (!list) {
|
|
8914
8920
|
list = [];
|
|
8915
|
-
ReflectUtils.defineMetadata(
|
|
8921
|
+
ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);
|
|
8916
8922
|
}
|
|
8917
8923
|
list.push({ propertyKey, pathPattern, filter });
|
|
8918
8924
|
return descriptor;
|
|
8919
8925
|
};
|
|
8920
8926
|
}
|
|
8921
|
-
function
|
|
8927
|
+
function subscribeSwcAppRouteChangeWhileConnected(targetOrOptions, propertyKey, descriptor) {
|
|
8922
8928
|
if (propertyKey && (typeof propertyKey === "string" || typeof propertyKey === "symbol")) {
|
|
8923
|
-
return
|
|
8929
|
+
return createSubscribeSwcAppRouteChangeWhileConnected({})(targetOrOptions, propertyKey, descriptor);
|
|
8924
8930
|
}
|
|
8925
8931
|
let options = {};
|
|
8926
8932
|
if (Array.isArray(targetOrOptions)) {
|
|
@@ -8930,11 +8936,110 @@ var dooboostoreSimpleWebComponent = (() => {
|
|
|
8930
8936
|
} else if (targetOrOptions && typeof targetOrOptions === "object") {
|
|
8931
8937
|
options = targetOrOptions;
|
|
8932
8938
|
}
|
|
8933
|
-
return
|
|
8939
|
+
return createSubscribeSwcAppRouteChangeWhileConnected(options);
|
|
8934
8940
|
}
|
|
8935
|
-
var
|
|
8941
|
+
var getSubscribeSwcAppRouteChangeWhileConnectedMetadata = (target) => {
|
|
8936
8942
|
const constructor = target instanceof Function ? target : target.constructor;
|
|
8937
|
-
return ReflectUtils.getOwnMetadata(
|
|
8943
|
+
return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_ROUTE_CHANGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
8944
|
+
};
|
|
8945
|
+
|
|
8946
|
+
// src/decorators/subscribeSwcAppMessageWhileConnected.ts
|
|
8947
|
+
var SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY = Symbol.for("simple-web-component:subscribe-swc-app-message-while-connected");
|
|
8948
|
+
function createSubscribeSwcAppMessageWhileConnected(options, messageType) {
|
|
8949
|
+
return (target, propertyKey, descriptor) => {
|
|
8950
|
+
const filter = options?.filter;
|
|
8951
|
+
const constructor = target.constructor;
|
|
8952
|
+
let list = ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
8953
|
+
if (!list) {
|
|
8954
|
+
list = [];
|
|
8955
|
+
ReflectUtils.defineMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, list, constructor);
|
|
8956
|
+
}
|
|
8957
|
+
list.push({ propertyKey, messageType, filter });
|
|
8958
|
+
return descriptor;
|
|
8959
|
+
};
|
|
8960
|
+
}
|
|
8961
|
+
function subscribeSwcAppMessageWhileConnected(targetOrMessageTypeOrOptions, optionsOrPropertyKey, descriptor) {
|
|
8962
|
+
if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === "object" && optionsOrPropertyKey && (typeof optionsOrPropertyKey === "string" || typeof optionsOrPropertyKey === "symbol") && descriptor) {
|
|
8963
|
+
const target = targetOrMessageTypeOrOptions;
|
|
8964
|
+
const propertyKey = optionsOrPropertyKey;
|
|
8965
|
+
return createSubscribeSwcAppMessageWhileConnected({})(target, propertyKey, descriptor);
|
|
8966
|
+
}
|
|
8967
|
+
let messageType;
|
|
8968
|
+
let options = {};
|
|
8969
|
+
if (typeof targetOrMessageTypeOrOptions === "string") {
|
|
8970
|
+
messageType = targetOrMessageTypeOrOptions;
|
|
8971
|
+
if (optionsOrPropertyKey && typeof optionsOrPropertyKey === "object") {
|
|
8972
|
+
options = optionsOrPropertyKey;
|
|
8973
|
+
}
|
|
8974
|
+
} else if (targetOrMessageTypeOrOptions && typeof targetOrMessageTypeOrOptions === "object") {
|
|
8975
|
+
options = targetOrMessageTypeOrOptions;
|
|
8976
|
+
}
|
|
8977
|
+
return createSubscribeSwcAppMessageWhileConnected(options, messageType);
|
|
8978
|
+
}
|
|
8979
|
+
var getSubscribeSwcAppMessageWhileConnectedMetadata = (target) => {
|
|
8980
|
+
const constructor = target instanceof Function ? target : target.constructor;
|
|
8981
|
+
return ReflectUtils.getOwnMetadata(SUBSCRIBE_SWC_APP_MESSAGE_WHILE_CONNECTED_METADATA_KEY, constructor);
|
|
8982
|
+
};
|
|
8983
|
+
|
|
8984
|
+
// src/decorators/publishSwcAppMessage.ts
|
|
8985
|
+
var PUBLISH_SWC_APP_MESSAGE_METADATA_KEY = Symbol.for("simple-web-component:publish-swc-app-message");
|
|
8986
|
+
function createPublishSwcAppMessage(messageType) {
|
|
8987
|
+
return (target, propertyKey, descriptor) => {
|
|
8988
|
+
const constructor = target.constructor;
|
|
8989
|
+
let list = ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
8990
|
+
if (!list) {
|
|
8991
|
+
list = [];
|
|
8992
|
+
ReflectUtils.defineMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, list, constructor);
|
|
8993
|
+
}
|
|
8994
|
+
list.push({ propertyKey, messageType });
|
|
8995
|
+
if (!descriptor) {
|
|
8996
|
+
return descriptor;
|
|
8997
|
+
}
|
|
8998
|
+
const originalMethod = descriptor.value;
|
|
8999
|
+
descriptor.value = function(...args) {
|
|
9000
|
+
const result = originalMethod.apply(this, args);
|
|
9001
|
+
if (result instanceof Promise) {
|
|
9002
|
+
result.then((data) => {
|
|
9003
|
+
const appHost2 = SwcUtils.getAppHost(this);
|
|
9004
|
+
if (appHost2) {
|
|
9005
|
+
appHost2.publishMessage({
|
|
9006
|
+
publisher: this,
|
|
9007
|
+
data,
|
|
9008
|
+
type: messageType
|
|
9009
|
+
});
|
|
9010
|
+
}
|
|
9011
|
+
}).catch((err) => {
|
|
9012
|
+
console.warn("publishSwcAppMessage async error:", err);
|
|
9013
|
+
});
|
|
9014
|
+
} else {
|
|
9015
|
+
const appHost2 = SwcUtils.getAppHost(this);
|
|
9016
|
+
if (appHost2) {
|
|
9017
|
+
appHost2.publishMessage({
|
|
9018
|
+
publisher: this,
|
|
9019
|
+
data: result,
|
|
9020
|
+
type: messageType
|
|
9021
|
+
});
|
|
9022
|
+
}
|
|
9023
|
+
}
|
|
9024
|
+
return result;
|
|
9025
|
+
};
|
|
9026
|
+
return descriptor;
|
|
9027
|
+
};
|
|
9028
|
+
}
|
|
9029
|
+
function publishSwcAppMessage(targetOrMessageType, propertyKey, descriptor) {
|
|
9030
|
+
if (targetOrMessageType && typeof targetOrMessageType === "object" && propertyKey && (typeof propertyKey === "string" || typeof propertyKey === "symbol") && descriptor) {
|
|
9031
|
+
const target = targetOrMessageType;
|
|
9032
|
+
return createPublishSwcAppMessage()(target, propertyKey, descriptor);
|
|
9033
|
+
}
|
|
9034
|
+
let messageType;
|
|
9035
|
+
if (typeof targetOrMessageType === "string") {
|
|
9036
|
+
messageType = targetOrMessageType;
|
|
9037
|
+
}
|
|
9038
|
+
return createPublishSwcAppMessage(messageType);
|
|
9039
|
+
}
|
|
9040
|
+
var getPublishSwcAppMessageMetadata = (target) => {
|
|
9041
|
+
const constructor = target instanceof Function ? target : target.constructor;
|
|
9042
|
+
return ReflectUtils.getOwnMetadata(PUBLISH_SWC_APP_MESSAGE_METADATA_KEY, constructor);
|
|
8938
9043
|
};
|
|
8939
9044
|
|
|
8940
9045
|
// ../simple-boot/dist/esm/decorators/SimDecorator.js
|