@nativescript-community/ui-material-ripple 7.2.18 → 7.2.19
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/angular/index.d.ts +10 -0
- package/package.json +3 -3
- package/ripple-common.d.ts +4 -0
- package/ripple-common.js +12 -0
- package/ripple-common.js.map +1 -0
- package/ripple.android.d.ts +9 -0
- package/ripple.android.js +216 -0
- package/ripple.android.js.map +1 -0
- package/ripple.d.ts +8 -0
- package/ripple.ios.d.ts +5 -0
- package/ripple.ios.js +25 -0
- package/ripple.ios.js.map +1 -0
- package/vue/index.d.ts +4 -0
- package/vue/index.js +11 -0
- package/vue/index.js.map +1 -0
@@ -0,0 +1,10 @@
|
|
1
|
+
import * as i0 from "@angular/core";
|
2
|
+
export declare class MaterialRippleDirective {
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MaterialRippleDirective, never>;
|
4
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<MaterialRippleDirective, "MDRipple", never, {}, {}, never, never, false, never>;
|
5
|
+
}
|
6
|
+
export declare class NativeScriptMaterialRippleModule {
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NativeScriptMaterialRippleModule, never>;
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<NativeScriptMaterialRippleModule, [typeof MaterialRippleDirective], never, [typeof MaterialRippleDirective]>;
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<NativeScriptMaterialRippleModule>;
|
10
|
+
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@nativescript-community/ui-material-ripple",
|
3
|
-
"version": "7.2.
|
3
|
+
"version": "7.2.19",
|
4
4
|
"description": "The Material Design Ripple component provides a radial action in the form of a visual ripple expanding outward from the user's touch. Ripple is a visual form of feedback for touch events providing users a clear signal that an element is being touched.",
|
5
5
|
"main": "./ripple",
|
6
6
|
"sideEffects": false,
|
@@ -46,7 +46,7 @@
|
|
46
46
|
},
|
47
47
|
"readmeFilename": "README.md",
|
48
48
|
"dependencies": {
|
49
|
-
"@nativescript-community/ui-material-core": "^7.2.
|
49
|
+
"@nativescript-community/ui-material-core": "^7.2.19"
|
50
50
|
},
|
51
|
-
"gitHead": "
|
51
|
+
"gitHead": "ad632905c09ad7f94f264d4ab200970df5e8e291"
|
52
52
|
}
|
package/ripple-common.js
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
import { CSSType, Color, StackLayout } from '@nativescript/core';
|
2
|
+
import { cssProperty } from '@nativescript-community/ui-material-core';
|
3
|
+
let RippleBase = class RippleBase extends StackLayout {
|
4
|
+
};
|
5
|
+
__decorate([
|
6
|
+
cssProperty
|
7
|
+
], RippleBase.prototype, "rippleColor", void 0);
|
8
|
+
RippleBase = __decorate([
|
9
|
+
CSSType('MDRipple')
|
10
|
+
], RippleBase);
|
11
|
+
export { RippleBase };
|
12
|
+
//# sourceMappingURL=ripple-common.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ripple-common.js","sourceRoot":"../src/","sources":["ripple-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAGhE,IAAe,UAAU,GAAzB,MAAe,UAAW,SAAQ,WAAW;CAEnD,CAAA;AADgB;IAAZ,WAAW;+CAAoB;AADd,UAAU;IAD/B,OAAO,CAAC,UAAU,CAAC;GACE,UAAU,CAE/B;SAFqB,UAAU"}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { RippleBase } from './ripple-common';
|
2
|
+
export declare class Ripple extends RippleBase {
|
3
|
+
nativeViewProtected: android.view.View;
|
4
|
+
ripple: android.graphics.drawable.RippleDrawable;
|
5
|
+
createNativeView(): globalAndroid.view.View;
|
6
|
+
rippleDrawable: android.graphics.drawable.Drawable;
|
7
|
+
getRippleColor(): any;
|
8
|
+
setRippleDrawable(view: android.view.View, topLeftRadius?: number, topRightRadius?: number, bottomRightRadius?: number, bottomLeftRadius?: number): void;
|
9
|
+
}
|
@@ -0,0 +1,216 @@
|
|
1
|
+
import { getRippleColor, rippleColorAlphaProperty, rippleColorProperty, themer } from '@nativescript-community/ui-material-core';
|
2
|
+
import { createRippleDrawable, getColorStateList, isPostLollipopMR1, isPostMarshmallow } from '@nativescript-community/ui-material-core/android/utils';
|
3
|
+
import { Background, Color, Length, backgroundInternalProperty } from '@nativescript/core';
|
4
|
+
import { RippleBase } from './ripple-common';
|
5
|
+
let MDStackLayout;
|
6
|
+
const DEFAULT_STROKE_VALUE = -1;
|
7
|
+
function initMDStackLayout() {
|
8
|
+
if (!MDStackLayout) {
|
9
|
+
if (isPostLollipopMR1) {
|
10
|
+
MDStackLayout = org.nativescript.widgets.StackLayout;
|
11
|
+
}
|
12
|
+
else {
|
13
|
+
initializePreLollipopStackLayout();
|
14
|
+
MDStackLayout = PreLollipopStackLayout;
|
15
|
+
}
|
16
|
+
}
|
17
|
+
}
|
18
|
+
// eslint-disable-next-line no-redeclare
|
19
|
+
let PreLollipopStackLayout;
|
20
|
+
function initializePreLollipopStackLayout() {
|
21
|
+
if (PreLollipopStackLayout) {
|
22
|
+
return;
|
23
|
+
}
|
24
|
+
var PreLollipopStackLayoutImpl = /** @class */ (function (_super) {
|
25
|
+
__extends(PreLollipopStackLayoutImpl, _super);
|
26
|
+
function PreLollipopStackLayoutImpl(context) {
|
27
|
+
var _this = _super.call(this, context) || this;
|
28
|
+
_this.mSelfBounds = new android.graphics.Rect();
|
29
|
+
_this.mOverlayBounds = new android.graphics.Rect();
|
30
|
+
_this.mForegroundGravity = android.view.Gravity.FILL;
|
31
|
+
_this.mForegroundInPadding = true;
|
32
|
+
_this.mForegroundBoundsChanged = false;
|
33
|
+
return global.__native(_this);
|
34
|
+
}
|
35
|
+
/**
|
36
|
+
* Describes how the foreground is positioned.
|
37
|
+
*
|
38
|
+
* @return foreground gravity.
|
39
|
+
* @see #setForegroundGravity(int)
|
40
|
+
*/
|
41
|
+
PreLollipopStackLayoutImpl.prototype.getForegroundGravity = function () {
|
42
|
+
return this.mForegroundGravity;
|
43
|
+
};
|
44
|
+
/**
|
45
|
+
* Describes how the foreground is positioned. Defaults to START and TOP.
|
46
|
+
*
|
47
|
+
* @param foregroundGravity See {@link android.view.Gravity}
|
48
|
+
* @see #getForegroundGravity()
|
49
|
+
*/
|
50
|
+
PreLollipopStackLayoutImpl.prototype.setForegroundGravity = function (foregroundGravity) {
|
51
|
+
if (this.mForegroundGravity !== foregroundGravity) {
|
52
|
+
if ((foregroundGravity & android.view.Gravity.RELATIVE_HORIZONTAL_GRAVITY_MASK) === 0) {
|
53
|
+
foregroundGravity |= android.view.Gravity.START;
|
54
|
+
}
|
55
|
+
if ((foregroundGravity & android.view.Gravity.VERTICAL_GRAVITY_MASK) === 0) {
|
56
|
+
foregroundGravity |= android.view.Gravity.TOP;
|
57
|
+
}
|
58
|
+
this.mForegroundGravity = foregroundGravity;
|
59
|
+
if (this.mForegroundGravity === android.view.Gravity.FILL && this.mForeground != null) {
|
60
|
+
var padding = new android.graphics.Rect();
|
61
|
+
this.mForeground.getPadding(padding);
|
62
|
+
}
|
63
|
+
this.requestLayout();
|
64
|
+
}
|
65
|
+
};
|
66
|
+
PreLollipopStackLayoutImpl.prototype.verifyDrawable = function (who) {
|
67
|
+
return _super.prototype.verifyDrawable.call(this, who) || who === this.mForeground;
|
68
|
+
};
|
69
|
+
PreLollipopStackLayoutImpl.prototype.jumpDrawablesToCurrentState = function () {
|
70
|
+
_super.prototype.jumpDrawablesToCurrentState.call(this);
|
71
|
+
if (this.mForeground != null) {
|
72
|
+
this.mForeground.jumpToCurrentState();
|
73
|
+
}
|
74
|
+
};
|
75
|
+
PreLollipopStackLayoutImpl.prototype.drawableStateChanged = function () {
|
76
|
+
_super.prototype.drawableStateChanged.call(this);
|
77
|
+
if (this.mForeground != null && this.mForeground.isStateful()) {
|
78
|
+
this.mForeground.setState(this.getDrawableState());
|
79
|
+
}
|
80
|
+
};
|
81
|
+
/**
|
82
|
+
* Supply a Drawable that is to be rendered on top of all of the child
|
83
|
+
* views in the frame Utils.layout. Any padding in the Drawable will be taken
|
84
|
+
* into account by ensuring that the children are inset to be placed
|
85
|
+
* inside of the padding area.
|
86
|
+
*
|
87
|
+
* @param drawable The Drawable to be drawn on top of the children.
|
88
|
+
*/
|
89
|
+
PreLollipopStackLayoutImpl.prototype.setForeground = function (drawable) {
|
90
|
+
if (this.mForeground !== drawable) {
|
91
|
+
if (this.mForeground != null) {
|
92
|
+
this.mForeground.setCallback(null);
|
93
|
+
this.unscheduleDrawable(this.mForeground);
|
94
|
+
}
|
95
|
+
this.mForeground = drawable;
|
96
|
+
if (drawable != null) {
|
97
|
+
this.setWillNotDraw(false);
|
98
|
+
drawable.setCallback(this);
|
99
|
+
if (drawable.isStateful()) {
|
100
|
+
drawable.setState(this.getDrawableState());
|
101
|
+
}
|
102
|
+
if (this.mForegroundGravity === android.view.Gravity.FILL) {
|
103
|
+
var padding = new android.graphics.Rect();
|
104
|
+
drawable.getPadding(padding);
|
105
|
+
}
|
106
|
+
}
|
107
|
+
else {
|
108
|
+
this.setWillNotDraw(true);
|
109
|
+
}
|
110
|
+
this.requestLayout();
|
111
|
+
this.invalidate();
|
112
|
+
}
|
113
|
+
};
|
114
|
+
/**
|
115
|
+
* Returns the drawable used as the foreground of this FrameLayout. The
|
116
|
+
* foreground drawable, if non-null, is always drawn on top of the children.
|
117
|
+
*
|
118
|
+
* @return A Drawable or null if no foreground was set.
|
119
|
+
*/
|
120
|
+
PreLollipopStackLayoutImpl.prototype.getForeground = function () {
|
121
|
+
return this.mForeground;
|
122
|
+
};
|
123
|
+
PreLollipopStackLayoutImpl.prototype.onLayout = function (changed, left, top, right, bottom) {
|
124
|
+
_super.prototype.onLayout.call(this, changed, left, top, right, bottom);
|
125
|
+
this.mForegroundBoundsChanged = this.mForegroundBoundsChanged || changed;
|
126
|
+
};
|
127
|
+
PreLollipopStackLayoutImpl.prototype.onSizeChanged = function (w, h, oldw, oldh) {
|
128
|
+
_super.prototype.onSizeChanged.call(this, w, h, oldw, oldh);
|
129
|
+
this.mForegroundBoundsChanged = true;
|
130
|
+
};
|
131
|
+
PreLollipopStackLayoutImpl.prototype.draw = function (canvas) {
|
132
|
+
_super.prototype.draw.call(this, canvas);
|
133
|
+
if (this.mForeground != null) {
|
134
|
+
var foreground = this.mForeground;
|
135
|
+
if (this.mForegroundBoundsChanged) {
|
136
|
+
this.mForegroundBoundsChanged = false;
|
137
|
+
var selfBounds = this.mSelfBounds;
|
138
|
+
var overlayBounds = this.mOverlayBounds;
|
139
|
+
var w = this.getRight() - this.getLeft();
|
140
|
+
var h = this.getBottom() - this.getTop();
|
141
|
+
if (this.mForegroundInPadding) {
|
142
|
+
selfBounds.set(0, 0, w, h);
|
143
|
+
}
|
144
|
+
else {
|
145
|
+
selfBounds.set(this.getPaddingLeft(), this.getPaddingTop(), w - this.getPaddingRight(), h - this.getPaddingBottom());
|
146
|
+
}
|
147
|
+
android.view.Gravity.apply(this.mForegroundGravity, foreground.getIntrinsicWidth(), foreground.getIntrinsicHeight(), selfBounds, overlayBounds);
|
148
|
+
foreground.setBounds(overlayBounds);
|
149
|
+
}
|
150
|
+
foreground.draw(canvas);
|
151
|
+
}
|
152
|
+
};
|
153
|
+
PreLollipopStackLayoutImpl.prototype.drawableHotspotChanged = function (x, y) {
|
154
|
+
_super.prototype.drawableHotspotChanged.call(this, x, y);
|
155
|
+
if (this.mForeground != null) {
|
156
|
+
this.mForeground.setHotspot(x, y);
|
157
|
+
}
|
158
|
+
};
|
159
|
+
return PreLollipopStackLayoutImpl;
|
160
|
+
}(org.nativescript.widgets.StackLayout));
|
161
|
+
PreLollipopStackLayout = PreLollipopStackLayoutImpl;
|
162
|
+
}
|
163
|
+
export class Ripple extends RippleBase {
|
164
|
+
createNativeView() {
|
165
|
+
// initMDStackLayout();
|
166
|
+
const view = super.createNativeView();
|
167
|
+
// view.setClickable(true);
|
168
|
+
this.setRippleDrawable(view); // set default ripple
|
169
|
+
return view;
|
170
|
+
}
|
171
|
+
getRippleColor() {
|
172
|
+
if (this.rippleColor) {
|
173
|
+
return getRippleColor(this.rippleColor);
|
174
|
+
}
|
175
|
+
return getRippleColor(themer.getAccentColor());
|
176
|
+
}
|
177
|
+
setRippleDrawable(view, topLeftRadius = 0, topRightRadius = 0, bottomRightRadius = 0, bottomLeftRadius = 0) {
|
178
|
+
if (!this.rippleDrawable) {
|
179
|
+
this.rippleDrawable = createRippleDrawable(this.getRippleColor(), topLeftRadius, topRightRadius, bottomRightRadius, bottomLeftRadius);
|
180
|
+
if (isPostMarshmallow) {
|
181
|
+
view.setForeground(this.rippleDrawable);
|
182
|
+
}
|
183
|
+
}
|
184
|
+
}
|
185
|
+
[rippleColorProperty.setNative](color) {
|
186
|
+
if (!this.rippleDrawable) {
|
187
|
+
this.setRippleDrawable(this.nativeViewProtected, Length.toDevicePixels(this.style.borderTopLeftRadius), Length.toDevicePixels(this.style.borderTopRightRadius), Length.toDevicePixels(this.style.borderBottomRightRadius), Length.toDevicePixels(this.style.borderBottomLeftRadius));
|
188
|
+
}
|
189
|
+
else {
|
190
|
+
const nColor = getRippleColor(color, this.rippleColorAlpha);
|
191
|
+
if (isPostLollipopMR1) {
|
192
|
+
this.rippleDrawable.setColor(color ? getColorStateList(nColor) : null);
|
193
|
+
}
|
194
|
+
else {
|
195
|
+
this.rippleDrawable.rippleShape.getPaint().setColor(nColor);
|
196
|
+
}
|
197
|
+
}
|
198
|
+
}
|
199
|
+
[rippleColorAlphaProperty.setNative](value) {
|
200
|
+
if (this.rippleColor) {
|
201
|
+
this[rippleColorProperty.setNative](this.rippleColor);
|
202
|
+
}
|
203
|
+
}
|
204
|
+
[backgroundInternalProperty.setNative](value) {
|
205
|
+
super[backgroundInternalProperty.setNative](value);
|
206
|
+
if (this.nativeViewProtected) {
|
207
|
+
if (value instanceof android.graphics.drawable.Drawable) {
|
208
|
+
}
|
209
|
+
else {
|
210
|
+
this.rippleDrawable = null;
|
211
|
+
this.setRippleDrawable(this.nativeViewProtected, value.borderTopLeftRadius, value.borderTopRightRadius, value.borderBottomRightRadius, value.borderBottomLeftRadius);
|
212
|
+
}
|
213
|
+
}
|
214
|
+
}
|
215
|
+
}
|
216
|
+
//# sourceMappingURL=ripple.android.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ripple.android.js","sourceRoot":"../src/","sources":["ripple.android.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AACjI,OAAO,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AACvJ,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,IAAI,aAA0D,CAAC;AAE/D,MAAM,oBAAoB,GAAG,CAAC,CAAC,CAAC;AAChC,SAAS,iBAAiB;IACtB,IAAI,CAAC,aAAa,EAAE;QAChB,IAAI,iBAAiB,EAAE;YACnB,aAAa,GAAG,GAAG,CAAC,YAAY,CAAC,OAAO,CAAC,WAAW,CAAC;SACxD;aAAM;YACH,gCAAgC,EAAE,CAAC;YACnC,aAAa,GAAG,sBAA6B,CAAC;SACjD;KACJ;AACL,CAAC;AAMD,wCAAwC;AACxC,IAAI,sBAA8C,CAAC;AAEnD,SAAS,gCAAgC;IACrC,IAAI,sBAAsB,EAAE;QACxB,OAAO;KACV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,0 +1,25 @@
|
|
1
|
+
import { getRippleColor, rippleColorAlphaProperty, rippleColorProperty, themer } from '@nativescript-community/ui-material-core';
|
2
|
+
import { Color } from '@nativescript/core';
|
3
|
+
import { RippleBase } from './ripple-common';
|
4
|
+
export class Ripple extends RippleBase {
|
5
|
+
createNativeView() {
|
6
|
+
const view = UIView.alloc().init();
|
7
|
+
this.inkTouchController = MDCRippleTouchController.alloc().initWithView(view);
|
8
|
+
const colorScheme = themer.getAppColorScheme();
|
9
|
+
if (colorScheme && colorScheme.primaryColor) {
|
10
|
+
this.inkTouchController.rippleView.rippleColor = colorScheme.primaryColor.colorWithAlphaComponent(0.24);
|
11
|
+
}
|
12
|
+
// this.inkTouchController
|
13
|
+
// MDCInkColorThemer.applyColorSchemeToInkView(colorScheme, this.inkTouchController.defaultInkView);
|
14
|
+
return view;
|
15
|
+
}
|
16
|
+
[rippleColorProperty.setNative](color) {
|
17
|
+
this.inkTouchController.rippleView.rippleColor = getRippleColor(color, this.rippleColorAlpha);
|
18
|
+
}
|
19
|
+
[rippleColorAlphaProperty.setNative](value) {
|
20
|
+
if (this.rippleColor) {
|
21
|
+
this[rippleColorProperty.setNative](this.rippleColor);
|
22
|
+
}
|
23
|
+
}
|
24
|
+
}
|
25
|
+
//# sourceMappingURL=ripple.ios.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"ripple.ios.js","sourceRoot":"../src/","sources":["ripple.ios.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,wBAAwB,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,0CAA0C,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,MAAM,OAAO,MAAO,SAAQ,UAAU;IAE3B,gBAAgB;QACnB,MAAM,IAAI,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC,IAAI,EAAE,CAAC;QACnC,IAAI,CAAC,kBAAkB,GAAG,wBAAwB,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;QAE9E,MAAM,WAAW,GAAG,MAAM,CAAC,iBAAiB,EAA4B,CAAC;QACzE,IAAI,WAAW,IAAI,WAAW,CAAC,YAAY,EAAE;YACzC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,WAAW,GAAE,WAAW,CAAC,YAAY,CAAC,uBAAuB,CAAC,IAAI,CAAC,CAAC;SAC1G;QACD,0BAA0B;QAC1B,oGAAoG;QACpG,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,KAAY;QACxC,IAAI,CAAC,kBAAkB,CAAC,UAAU,CAAC,WAAW,GAAG,cAAc,CAAC,KAAK,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAAC;IAClG,CAAC;IACD,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC,KAAa;QAC9C,IAAI,IAAI,CAAC,WAAW,EAAE;YAClB,IAAI,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzD;IACL,CAAC;CACJ"}
|
package/vue/index.d.ts
ADDED
package/vue/index.js
ADDED
package/vue/index.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"../src/","sources":["vue/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC,IAAI,SAAS,GAAG,KAAK,CAAC;AACtB,eAAe;IACX,OAAO,CAAC,GAAG;QACP,IAAI,CAAC,SAAS,EAAE;YACZ,SAAS,GAAG,IAAI,CAAC;YACjB,GAAG,CAAC,eAAe,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;SACrD;IACL,CAAC;CACJ,CAAC"}
|