ngx-axis-appforge 0.0.24 → 0.0.26
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/axis-components/image/index.d.ts +2 -0
- package/axis-components/radio/index.d.ts +2 -2
- package/axis-components/switch/design/index.d.ts +5 -0
- package/axis-components/switch/index.d.ts +23 -0
- package/axis-components/upload/index.d.ts +23 -22
- package/axis-components-covers/switch.svg +14 -0
- package/core/index.d.ts +2 -1
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs +13 -4
- package/fesm2022/ngx-axis-appforge-axis-components-image.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs +6 -6
- package/fesm2022/ngx-axis-appforge-axis-components-radio.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs +79 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch-design.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs +48 -0
- package/fesm2022/ngx-axis-appforge-axis-components-switch.mjs.map +1 -0
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs +14 -5
- package/fesm2022/ngx-axis-appforge-axis-components-upload.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-axis-components.mjs +18 -0
- package/fesm2022/ngx-axis-appforge-axis-components.mjs.map +1 -1
- package/fesm2022/ngx-axis-appforge-core.mjs +2 -1
- package/fesm2022/ngx-axis-appforge-core.mjs.map +1 -1
- package/package.json +89 -81
|
@@ -7,8 +7,10 @@ declare class ImageOptions extends DataOptions {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
declare class Image extends Base<ImageOptions> {
|
|
10
|
+
private readonly fileBaseUrl;
|
|
10
11
|
options: ImageOptions;
|
|
11
12
|
readonly imgList: _angular_core.Signal<any[]>;
|
|
13
|
+
getUrl(url: string): string;
|
|
12
14
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Image, never>;
|
|
13
15
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Image, "axis-image", never, {}, {}, never, never, true, never>;
|
|
14
16
|
}
|
|
@@ -21,8 +21,8 @@ declare class Radio extends ValueAccess<RadioOptions> {
|
|
|
21
21
|
readonly radioValue: _angular_core.ModelSignal<any[] | undefined>;
|
|
22
22
|
writeValue(value: any): void;
|
|
23
23
|
setInitValue(value: any): void;
|
|
24
|
-
private
|
|
25
|
-
|
|
24
|
+
private valueToRadioValue;
|
|
25
|
+
onRadioChange(value: any): void;
|
|
26
26
|
private buildDisplay;
|
|
27
27
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Radio, never>;
|
|
28
28
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Radio, "axis-radio", never, { "radioValue": { "alias": "radioValue"; "required": false; "isSignal": true; }; }, { "radioValue": "radioValueChange"; }, never, never, true, never>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { ValueAccessOptions, ValueAccess } from 'ngx-axis-appforge/core';
|
|
3
|
+
|
|
4
|
+
declare class SwitchOptions extends ValueAccessOptions {
|
|
5
|
+
readonly onValue: _angular_core.WritableSignal<any>;
|
|
6
|
+
readonly offValue: _angular_core.WritableSignal<any>;
|
|
7
|
+
readonly onLabel: _angular_core.WritableSignal<any>;
|
|
8
|
+
readonly offLabel: _angular_core.WritableSignal<any>;
|
|
9
|
+
readonly size: _angular_core.WritableSignal<"small" | "default">;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
declare class Switch extends ValueAccess<SwitchOptions> {
|
|
13
|
+
options: SwitchOptions;
|
|
14
|
+
readonly switchValue: _angular_core.ModelSignal<boolean>;
|
|
15
|
+
writeValue(value: any): void;
|
|
16
|
+
setInitValue(value: any): void;
|
|
17
|
+
private valueToSwitchValue;
|
|
18
|
+
onSwitchChange(value: boolean): void;
|
|
19
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<Switch, never>;
|
|
20
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<Switch, "axis-switch", never, { "switchValue": { "alias": "switchValue"; "required": false; "isSignal": true; }; }, { "switchValue": "switchValueChange"; }, never, never, true, never>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export { Switch };
|
|
@@ -1,35 +1,35 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { WritableSignal } from '@angular/core';
|
|
3
2
|
import { ValueAccessOptions, ValueAccess } from 'ngx-axis-appforge/core';
|
|
4
3
|
import { NzUploadFile, NzUploadXHRArgs, NzUploadChangeParam } from 'ng-zorro-antd/upload';
|
|
5
4
|
import { Subscription } from 'rxjs';
|
|
6
5
|
|
|
7
6
|
declare class UploadOptions extends ValueAccessOptions {
|
|
8
|
-
readonly url: WritableSignal<string>;
|
|
9
|
-
readonly formName: WritableSignal<string>;
|
|
10
|
-
readonly fullValue: WritableSignal<boolean>;
|
|
11
|
-
readonly urlField: WritableSignal<string>;
|
|
12
|
-
readonly filenameField: WritableSignal<string>;
|
|
13
|
-
readonly responseFn: WritableSignal<string>;
|
|
14
|
-
readonly fileType: WritableSignal<string>;
|
|
15
|
-
readonly multiple: WritableSignal<boolean>;
|
|
16
|
-
readonly directory: WritableSignal<boolean>;
|
|
17
|
-
readonly limitLength: WritableSignal<number | null>;
|
|
18
|
-
readonly limitSize: WritableSignal<number | null>;
|
|
19
|
-
readonly listType: WritableSignal<"text" | "picture" | "picture-card">;
|
|
20
|
-
readonly buttonType: WritableSignal<"drag-file" | "custom">;
|
|
21
|
-
readonly buttonTitle: WritableSignal<string>;
|
|
22
|
-
readonly buttonIcon: WritableSignal<any>;
|
|
23
|
-
readonly buttonStyle: WritableSignal<"text" | "default" | "primary" | "dashed" | "link">;
|
|
24
|
-
readonly buttonSize: WritableSignal<"default" | "large" | "small">;
|
|
25
|
-
readonly buttonBlock: WritableSignal<boolean>;
|
|
26
|
-
readonly buttonShape: WritableSignal<"circle" | "round" | null>;
|
|
27
|
-
readonly dropTitle: WritableSignal<string>;
|
|
28
|
-
readonly dropTip: WritableSignal<string>;
|
|
7
|
+
readonly url: _angular_core.WritableSignal<string>;
|
|
8
|
+
readonly formName: _angular_core.WritableSignal<string>;
|
|
9
|
+
readonly fullValue: _angular_core.WritableSignal<boolean>;
|
|
10
|
+
readonly urlField: _angular_core.WritableSignal<string>;
|
|
11
|
+
readonly filenameField: _angular_core.WritableSignal<string>;
|
|
12
|
+
readonly responseFn: _angular_core.WritableSignal<string>;
|
|
13
|
+
readonly fileType: _angular_core.WritableSignal<string>;
|
|
14
|
+
readonly multiple: _angular_core.WritableSignal<boolean>;
|
|
15
|
+
readonly directory: _angular_core.WritableSignal<boolean>;
|
|
16
|
+
readonly limitLength: _angular_core.WritableSignal<number | null>;
|
|
17
|
+
readonly limitSize: _angular_core.WritableSignal<number | null>;
|
|
18
|
+
readonly listType: _angular_core.WritableSignal<"text" | "picture" | "picture-card">;
|
|
19
|
+
readonly buttonType: _angular_core.WritableSignal<"drag-file" | "custom">;
|
|
20
|
+
readonly buttonTitle: _angular_core.WritableSignal<string>;
|
|
21
|
+
readonly buttonIcon: _angular_core.WritableSignal<any>;
|
|
22
|
+
readonly buttonStyle: _angular_core.WritableSignal<"text" | "default" | "primary" | "dashed" | "link">;
|
|
23
|
+
readonly buttonSize: _angular_core.WritableSignal<"default" | "large" | "small">;
|
|
24
|
+
readonly buttonBlock: _angular_core.WritableSignal<boolean>;
|
|
25
|
+
readonly buttonShape: _angular_core.WritableSignal<"circle" | "round" | null>;
|
|
26
|
+
readonly dropTitle: _angular_core.WritableSignal<string>;
|
|
27
|
+
readonly dropTip: _angular_core.WritableSignal<string>;
|
|
29
28
|
}
|
|
30
29
|
|
|
31
30
|
declare class Upload extends ValueAccess<UploadOptions> {
|
|
32
31
|
protected options: UploadOptions;
|
|
32
|
+
private readonly fileBaseUrl;
|
|
33
33
|
private readonly http;
|
|
34
34
|
private readonly imageService;
|
|
35
35
|
readonly fileList: _angular_core.ModelSignal<NzUploadFile[]>;
|
|
@@ -40,6 +40,7 @@ declare class Upload extends ValueAccess<UploadOptions> {
|
|
|
40
40
|
private updateFileList;
|
|
41
41
|
private getFileNameByUrl;
|
|
42
42
|
private updateValue;
|
|
43
|
+
private getUrl;
|
|
43
44
|
upload: (item: NzUploadXHRArgs) => Subscription;
|
|
44
45
|
fileChange(e: NzUploadChangeParam): void;
|
|
45
46
|
handlePreview: (file: NzUploadFile) => Promise<void>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg width="100px" height="66px" viewBox="0 -10 28 36" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
3
|
+
<title>编组 48</title>
|
|
4
|
+
<g id="页面-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
5
|
+
<g id="Ant-Design-组件缩略图" transform="translate(-1820.000000, -126.000000)">
|
|
6
|
+
<g id="编组-48" transform="translate(1821.000000, 126.000000)">
|
|
7
|
+
<g id="3.DataEntry/Switch/Small/on#" transform="translate(-1.000000, 0.000000)">
|
|
8
|
+
<path d="M0,8 L0,8 C0,3.581722 3.57465974,0 8.00493448,0 L19.9950655,0 C24.4160688,0 28,3.59071231 28,8 L28,8 C28,12.418278 24.4253403,16 19.9950655,16 L8.00493448,16 C3.58393124,16 0,12.4211798 0,8 L0,8 Z" id="Rectangle-77-Copy-11" fill="#1890FF" fill-rule="nonzero"></path>
|
|
9
|
+
<path d="M20,14 C23.3137085,14 26,11.3137085 26,8 C26,4.6862915 23.3137085,2 20,2 C16.6862915,2 14,4.6862915 14,8 C14,11.3137085 16.6862915,14 20,14 Z" id="Oval-1-Copy-15" fill="#FFFFFF" fill-rule="evenodd"></path>
|
|
10
|
+
</g>
|
|
11
|
+
</g>
|
|
12
|
+
</g>
|
|
13
|
+
</g>
|
|
14
|
+
</svg>
|
package/core/index.d.ts
CHANGED
|
@@ -516,6 +516,7 @@ declare const AXIS_HTTP_CONTEXT_DATA_TOKEN: InjectionToken<{
|
|
|
516
516
|
[key: string]: any;
|
|
517
517
|
}>;
|
|
518
518
|
declare const AXIS_FORM_REGISTE_CONTROL_TOKEN: InjectionToken<(opt: RegisteFormControlOptions) => void>;
|
|
519
|
+
declare const AXIS_FILE_BASE_URL_TOKEN: InjectionToken<string>;
|
|
519
520
|
declare const AXIS_HTTP_CONTEXT_TOKEN: HttpContextToken<{
|
|
520
521
|
[key: string]: any;
|
|
521
522
|
}>;
|
|
@@ -822,5 +823,5 @@ interface DynamicFnOptions {
|
|
|
822
823
|
}
|
|
823
824
|
declare function fn(fnBody: string, argsObj: any, ignoreUndefined?: boolean, printError?: boolean): any;
|
|
824
825
|
|
|
825
|
-
export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
|
|
826
|
+
export { AXIS_COMPONENTS_LOADER_TOKEN, AXIS_COMPONENTS_TOKEN, AXIS_CURRENT_USER_PERMISSIONS_TOKEN, AXIS_DESIGN_ALL_PERMISSIONS_TOKEN, AXIS_DESIGN_CHOOSE_COMPONENT_FUNC_TOKEN, AXIS_DESIGN_CMPLIBS_TOKEN, AXIS_DESIGN_COMPONENT_INFO_FOR_SETTING_TOKEN, AXIS_DESIGN_OPTIONS_NODE_FOR_MENU, AXIS_DESIGN_SCOPE_INFOS_GETTER_TOKEN, AXIS_EVENT_HANDLERS_TOKEN, AXIS_EVENT_HANDLER_DESCS_TOKEN, AXIS_FILE_BASE_URL_TOKEN, AXIS_FORM_REGISTE_CONTROL_TOKEN, AXIS_HTTP_CONTEXT_DATA_TOKEN, AXIS_HTTP_CONTEXT_TOKEN, AXIS_INJECT_DATA_TOKEN, AXIS_INJECT_FUNC_TOKEN, AXIS_SCRIPTS_TOKEN, Base, BaseDesignSetting, BaseMenu, BaseOptions, CommonMenu, ComponentsLoader, DataHandler, DataOptions, DesignBuilder, DynamicDirective, ElementNode, FilteredTreeResult, FormValidators, FunField, FunFieldBase, FunFieldValueBase, HowLongPipe, InputTrigger, InputValidator, OptionsNode, ScopeDirective, SimpleMenu, ValueAccess, ValueAccessOptions, ValueDesignSetting, assignDefaultField, baseFbConfig, baseFunField, buildValidators, codeName, copy, deepMerge, fn, isEquals, listSort, nameCode, obj2Arr, objDiff, rebuildObject, recursionArray, recursionObject, trackByFn, updateAndValidAll, valueFbConfig, valueFunField };
|
|
826
827
|
export type { Cmplib, DataSourceOptions, DesignBindElementsResult, DesignBuildResult, DesignConfig, DynamicFnOptions, EventDesc, EventHandlerDesc, EventHandlerDescGroup, EventHandlerOptions, EventsHandler, Example, ExampleBuilder, ExampleDesc, ExampleGroup, FlatNode, FunFieldOptions, FunFieldValue, MyErrorsOptions, MyValidationErrors, NextInfo, OptionsChangeEvent, RegisteFormControlOptions, RegisteValueAccessOptions, ScopeInfo, TriggeEventsOptions };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
-
import { DataOptions, Base } from 'ngx-axis-appforge/core';
|
|
2
|
+
import { signal, inject, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { DataOptions, Base, AXIS_FILE_BASE_URL_TOKEN } from 'ngx-axis-appforge/core';
|
|
4
4
|
import * as i1 from 'ng-zorro-antd/image';
|
|
5
5
|
import { NzImageModule } from 'ng-zorro-antd/image';
|
|
6
6
|
import * as i2 from 'ng-zorro-antd/icon';
|
|
@@ -14,6 +14,7 @@ class ImageOptions extends DataOptions {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
class Image extends Base {
|
|
17
|
+
fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? "";
|
|
17
18
|
options = new ImageOptions();
|
|
18
19
|
imgList = computed(() => {
|
|
19
20
|
const data = this.options.data();
|
|
@@ -27,12 +28,20 @@ class Image extends Base {
|
|
|
27
28
|
return [];
|
|
28
29
|
}
|
|
29
30
|
}, ...(ngDevMode ? [{ debugName: "imgList" }] : []));
|
|
31
|
+
getUrl(url) {
|
|
32
|
+
if (url.startsWith("http")) {
|
|
33
|
+
return url;
|
|
34
|
+
}
|
|
35
|
+
else {
|
|
36
|
+
return this.fileBaseUrl + url;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
30
39
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Image, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
31
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Image, isStandalone: true, selector: "axis-image", usesInheritance: true, ngImport: i0, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i1.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }, { kind: "component", type: i1.NzImageGroupComponent, selector: "nz-image-group", inputs: ["nzScaleStep"], exportAs: ["nzImageGroup"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Image, isStandalone: true, selector: "axis-image", usesInheritance: true, ngImport: i0, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"], dependencies: [{ kind: "ngmodule", type: NzImageModule }, { kind: "directive", type: i1.NzImageDirective, selector: "img[nz-image]", inputs: ["nzSrc", "nzSrcset", "nzDisablePreview", "nzFallback", "nzPlaceholder", "nzScaleStep"], exportAs: ["nzImage"] }, { kind: "component", type: i1.NzImageGroupComponent, selector: "nz-image-group", inputs: ["nzScaleStep"], exportAs: ["nzImageGroup"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i2.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzFlexModule }, { kind: "directive", type: i3.NzFlexDirective, selector: "[nz-flex],nz-flex", inputs: ["nzVertical", "nzJustify", "nzAlign", "nzGap", "nzWrap", "nzFlex"], exportAs: ["nzFlex"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
32
41
|
}
|
|
33
42
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Image, decorators: [{
|
|
34
43
|
type: Component,
|
|
35
|
-
args: [{ selector: 'axis-image', imports: [NzImageModule, NzIconModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"] }]
|
|
44
|
+
args: [{ selector: 'axis-image', imports: [NzImageModule, NzIconModule, NzFlexModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>", styles: [":host{display:block;overflow:hidden;position:relative}.img-box{position:relative;overflow:hidden;border-radius:4px;border:1px solid #00000017;pointer-events:none;width:100%;height:100%}.img-box.preview{pointer-events:all;cursor:pointer}.img-box img{width:100%;height:100%}.img-box img.aspectFill{object-fit:cover}.img-box img.scaleToFill{object-fit:fill}.img-box img.aspectFit{object-fit:contain}.pre{pointer-events:none;transition:all .3s;position:absolute;top:0;left:0;width:100%;height:100%;background-color:#00000080;z-index:1;display:flex;justify-content:center;align-items:center;color:#fff;opacity:0}.img-box:hover .pre{opacity:1}\n"] }]
|
|
36
45
|
}] });
|
|
37
46
|
|
|
38
47
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-image.mjs","sources":["../../../axis-components/image/image.options.ts","../../../axis-components/image/image.ts","../../../axis-components/image/image.html","../../../axis-components/image/ngx-axis-appforge-axis-components-image.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class ImageOptions extends DataOptions {\n\n mode = signal<\"aspectFit\" | \"aspectFill\" | \"scaleToFill\">(\"aspectFit\");\n preview = signal(true);\n}","import { ChangeDetectionStrategy, Component, computed } from '@angular/core';\nimport { Base } from 'ngx-axis-appforge/core';\nimport { ImageOptions } from './image.options';\nimport { NzImageModule } from 'ng-zorro-antd/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\n\n@Component({\n selector: 'axis-image',\n imports: [NzImageModule, NzIconModule, NzFlexModule],\n templateUrl: './image.html',\n styleUrl: './image.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Image extends Base<ImageOptions> {\n\n override options: ImageOptions = new ImageOptions();\n\n readonly imgList = computed(() => {\n const data = this.options.data();\n if (Array.isArray(data)) {\n return data;\n } else if (data) {\n return [data];\n } else {\n return [];\n }\n });\n}\n","<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"i\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './image';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,YAAa,SAAQ,WAAW,CAAA;AAEzC,IAAA,IAAI,GAAG,MAAM,CAA6C,WAAW,gDAAC;AACtE,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,mDAAC;AACzB;;ACOK,MAAO,KAAM,SAAQ,IAAkB,CAAA;
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-image.mjs","sources":["../../../axis-components/image/image.options.ts","../../../axis-components/image/image.ts","../../../axis-components/image/image.html","../../../axis-components/image/ngx-axis-appforge-axis-components-image.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { DataOptions } from \"ngx-axis-appforge/core\";\n\nexport class ImageOptions extends DataOptions {\n\n mode = signal<\"aspectFit\" | \"aspectFill\" | \"scaleToFill\">(\"aspectFit\");\n preview = signal(true);\n}","import { ChangeDetectionStrategy, Component, computed, inject } from '@angular/core';\nimport { AXIS_FILE_BASE_URL_TOKEN, Base } from 'ngx-axis-appforge/core';\nimport { ImageOptions } from './image.options';\nimport { NzImageModule } from 'ng-zorro-antd/image';\nimport { NzIconModule } from 'ng-zorro-antd/icon';\nimport { NzFlexModule } from 'ng-zorro-antd/flex';\n\n@Component({\n selector: 'axis-image',\n imports: [NzImageModule, NzIconModule, NzFlexModule],\n templateUrl: './image.html',\n styleUrl: './image.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Image extends Base<ImageOptions> {\n\n private readonly fileBaseUrl = inject(AXIS_FILE_BASE_URL_TOKEN, { optional: true }) ?? \"\";\n override options: ImageOptions = new ImageOptions();\n\n readonly imgList = computed(() => {\n const data = this.options.data();\n if (Array.isArray(data)) {\n return data;\n } else if (data) {\n return [data];\n } else {\n return [];\n }\n });\n\n getUrl(url: string): string {\n if (url.startsWith(\"http\")) {\n return url;\n } else {\n return this.fileBaseUrl + url;\n }\n }\n}\n","<nz-image-group>\n <nz-flex nzWrap=\"wrap\" nzGap=\"4px\" style=\"width: 100%;height: 100%;\">\n @for (i of imgList(); track $index) {\n <div class=\"img-box\" [class.preview]=\"options.preview()\">\n <img nz-image [nzSrc]=\"getUrl(i)\" [class]=\"options.mode()\" />\n @if (options.preview()) {\n <div class=\"pre\">\n <i nz-icon nzType=\"eye\" nzTheme=\"outline\"></i>\n </div>\n }\n </div>\n }\n </nz-flex>\n</nz-image-group>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './image';\n"],"names":[],"mappings":";;;;;;;;;;AAGM,MAAO,YAAa,SAAQ,WAAW,CAAA;AAEzC,IAAA,IAAI,GAAG,MAAM,CAA6C,WAAW,gDAAC;AACtE,IAAA,OAAO,GAAG,MAAM,CAAC,IAAI,mDAAC;AACzB;;ACOK,MAAO,KAAM,SAAQ,IAAkB,CAAA;AAE1B,IAAA,WAAW,GAAG,MAAM,CAAC,wBAAwB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,IAAI,EAAE;AAChF,IAAA,OAAO,GAAiB,IAAI,YAAY,EAAE;AAE1C,IAAA,OAAO,GAAG,QAAQ,CAAC,MAAK;QAC/B,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;AAChC,QAAA,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;AACvB,YAAA,OAAO,IA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A,YAAA,EAAA,WAAA,EAAA,SAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,CAAA,EAAA,QAAA,EAAA,CAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAKxC,KAAK,EAAA,UAAA,EAAA,CAAA;kBAPjB,SAAS;+BACE,YAAY,EAAA,OAAA,EACb,CAAC,aAAa,EAAE,YAAY,EAAE,YAAY,CAAC,EAAA,eAAA,EAGnC,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,qhBAAA,EAAA,MAAA,EAAA,CAAA,ioBAAA,CAAA,EAAA;;;AEZjD;;AAEG;;;;"}
|
|
@@ -43,13 +43,13 @@ class Radio extends ValueAccess {
|
|
|
43
43
|
radioValue = model(...(ngDevMode ? [undefined, { debugName: "radioValue" }] : []));
|
|
44
44
|
writeValue(value) {
|
|
45
45
|
super.writeValue(value);
|
|
46
|
-
this.
|
|
46
|
+
this.valueToRadioValue();
|
|
47
47
|
}
|
|
48
48
|
setInitValue(value) {
|
|
49
49
|
super.setInitValue(value);
|
|
50
|
-
this.
|
|
50
|
+
this.valueToRadioValue();
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
valueToRadioValue() {
|
|
53
53
|
if (this.value() != undefined) {
|
|
54
54
|
if (this.options.fullValue()) {
|
|
55
55
|
this.radioValue.set(this.value()[this.options.valueField()]);
|
|
@@ -61,7 +61,7 @@ class Radio extends ValueAccess {
|
|
|
61
61
|
}
|
|
62
62
|
this.radioValue.set(undefined);
|
|
63
63
|
}
|
|
64
|
-
|
|
64
|
+
onRadioChange(value) {
|
|
65
65
|
if (this.options.fullValue()) {
|
|
66
66
|
this.value.set(this.options.data().find((item) => item[this.options.valueField()] == value));
|
|
67
67
|
}
|
|
@@ -79,11 +79,11 @@ class Radio extends ValueAccess {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Radio, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
82
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Radio, isStandalone: true, selector: "axis-radio", inputs: { radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { radioValue: "radioValueChange" }, usesInheritance: true, ngImport: i0, template: "@if (options.readonly()) {\n{{displayValue()}}\n}@else {\n<nz-radio-group [(ngModel)]=\"radioValue\" (ngModelChange)=\"
|
|
82
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.1.6", type: Radio, isStandalone: true, selector: "axis-radio", inputs: { radioValue: { classPropertyName: "radioValue", publicName: "radioValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { radioValue: "radioValueChange" }, usesInheritance: true, ngImport: i0, template: "@if (options.readonly()) {\n{{displayValue()}}\n}@else {\n<nz-radio-group [(ngModel)]=\"radioValue\" (ngModelChange)=\"onRadioChange($event)\" [nzSize]=\"options.size()\"\n [nzDisabled]=\"options.disabled()\" [class]=\"options.direction()\" [nzButtonStyle]=\"options.buttonStyle()\">\n @for (item of options.data(); track item[options.valueField()]) {\n @if (options.buttonMode()) {\n <label nz-radio-button [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }@else {\n <label nz-radio [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }\n }\n</nz-radio-group>\n}", styles: [":host{display:block}.vertical [nz-radio]{display:block}\n"], dependencies: [{ kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i1.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i1.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
83
|
}
|
|
84
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Radio, decorators: [{
|
|
85
85
|
type: Component,
|
|
86
|
-
args: [{ selector: 'axis-radio', imports: [NzRadioModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.readonly()) {\n{{displayValue()}}\n}@else {\n<nz-radio-group [(ngModel)]=\"radioValue\" (ngModelChange)=\"
|
|
86
|
+
args: [{ selector: 'axis-radio', imports: [NzRadioModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (options.readonly()) {\n{{displayValue()}}\n}@else {\n<nz-radio-group [(ngModel)]=\"radioValue\" (ngModelChange)=\"onRadioChange($event)\" [nzSize]=\"options.size()\"\n [nzDisabled]=\"options.disabled()\" [class]=\"options.direction()\" [nzButtonStyle]=\"options.buttonStyle()\">\n @for (item of options.data(); track item[options.valueField()]) {\n @if (options.buttonMode()) {\n <label nz-radio-button [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }@else {\n <label nz-radio [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }\n }\n</nz-radio-group>\n}", styles: [":host{display:block}.vertical [nz-radio]{display:block}\n"] }]
|
|
87
87
|
}], ctorParameters: () => [] });
|
|
88
88
|
|
|
89
89
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ngx-axis-appforge-axis-components-radio.mjs","sources":["../../../axis-components/radio/radio.options.ts","../../../axis-components/radio/radio.ts","../../../axis-components/radio/radio.html","../../../axis-components/radio/ngx-axis-appforge-axis-components-radio.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class RadioOptions extends ValueAccessOptions {\n\n readonly labelField = signal(\"title\");\n readonly valueField = signal(\"key\");\n readonly disabledField = signal(\"disabled\");\n readonly fullValue = signal(false);\n readonly defaultFirst = signal(false);\n readonly data = signal<any>(undefined);\n\n readonly buttonMode = signal(false);\n readonly buttonStyle = signal<'outline' | 'solid'>(\"outline\");\n readonly size = signal<'large' | 'small' | 'default'>('default');\n readonly direction = signal<\"horizontal\" | \"vertical\">(\"horizontal\");\n\n}","import { ChangeDetectionStrategy, Component, computed, effect, model, untracked } from '@angular/core';\nimport { ValueAccess } from 'ngx-axis-appforge/core';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { FormsModule } from '@angular/forms';\nimport { RadioOptions } from './radio.options';\n\n@Component({\n selector: 'axis-radio',\n imports: [NzRadioModule, FormsModule],\n templateUrl: './radio.html',\n styleUrl: './radio.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Radio extends ValueAccess<RadioOptions> {\n\n constructor() {\n super();\n effect(() => {\n if (untracked(this.options.defaultFirst)) {\n const data = this.options.data();\n untracked(() => {\n if (data?.length) {\n if (this.options.fullValue()) {\n this.setInitValue(data[0]);\n } else {\n this.setInitValue(data[0][this.options.valueField()]);\n }\n }\n })\n }\n });\n }\n\n override options: RadioOptions = new RadioOptions();\n\n readonly displayValue = computed(() => this.buildDisplay());\n readonly radioValue = model<any[]>();\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-radio.mjs","sources":["../../../axis-components/radio/radio.options.ts","../../../axis-components/radio/radio.ts","../../../axis-components/radio/radio.html","../../../axis-components/radio/ngx-axis-appforge-axis-components-radio.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class RadioOptions extends ValueAccessOptions {\n\n readonly labelField = signal(\"title\");\n readonly valueField = signal(\"key\");\n readonly disabledField = signal(\"disabled\");\n readonly fullValue = signal(false);\n readonly defaultFirst = signal(false);\n readonly data = signal<any>(undefined);\n\n readonly buttonMode = signal(false);\n readonly buttonStyle = signal<'outline' | 'solid'>(\"outline\");\n readonly size = signal<'large' | 'small' | 'default'>('default');\n readonly direction = signal<\"horizontal\" | \"vertical\">(\"horizontal\");\n\n}","import { ChangeDetectionStrategy, Component, computed, effect, model, untracked } from '@angular/core';\nimport { ValueAccess } from 'ngx-axis-appforge/core';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { FormsModule } from '@angular/forms';\nimport { RadioOptions } from './radio.options';\n\n@Component({\n selector: 'axis-radio',\n imports: [NzRadioModule, FormsModule],\n templateUrl: './radio.html',\n styleUrl: './radio.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Radio extends ValueAccess<RadioOptions> {\n\n constructor() {\n super();\n effect(() => {\n if (untracked(this.options.defaultFirst)) {\n const data = this.options.data();\n untracked(() => {\n if (data?.length) {\n if (this.options.fullValue()) {\n this.setInitValue(data[0]);\n } else {\n this.setInitValue(data[0][this.options.valueField()]);\n }\n }\n })\n }\n });\n }\n\n override options: RadioOptions = new RadioOptions();\n\n readonly displayValue = computed(() => this.buildDisplay());\n readonly radioValue = model<any[]>();\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.valueToRadioValue();\n }\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n this.valueToRadioValue();\n }\n\n private valueToRadioValue() {\n if (this.value() != undefined) {\n if (this.options.fullValue()) {\n this.radioValue.set(this.value()[this.options.valueField()]);\n } else {\n this.radioValue.set(this.value());\n }\n return;\n }\n this.radioValue.set(undefined);\n }\n\n onRadioChange(value: any) {\n if (this.options.fullValue()) {\n this.value.set(this.options.data().find((item: any) => item[this.options.valueField()] == value));\n } else {\n this.value.set(value);\n }\n this.onChange?.(this.value());\n }\n\n private buildDisplay(): string {\n if (this.options.fullValue()) {\n return this.value()[this.options.labelField()];\n } else {\n return this.options.data().find((r: any) => this.value() == r[this.options.valueField()])?.[this.options.labelField()];\n }\n }\n}\n","@if (options.readonly()) {\n{{displayValue()}}\n}@else {\n<nz-radio-group [(ngModel)]=\"radioValue\" (ngModelChange)=\"onRadioChange($event)\" [nzSize]=\"options.size()\"\n [nzDisabled]=\"options.disabled()\" [class]=\"options.direction()\" [nzButtonStyle]=\"options.buttonStyle()\">\n @for (item of options.data(); track item[options.valueField()]) {\n @if (options.buttonMode()) {\n <label nz-radio-button [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }@else {\n <label nz-radio [nzValue]=\"item[options.valueField()]\"\n [nzDisabled]=\"item[options.disabledField()]\">{{item[options.labelField()]}}</label>\n }\n }\n</nz-radio-group>\n}","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './radio';\n"],"names":[],"mappings":";;;;;;;;AAGM,MAAO,YAAa,SAAQ,kBAAkB,CAAA;AAEvC,IAAA,UAAU,GAAG,MAAM,CAAC,OAAO,sDAAC;AAC5B,IAAA,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC;AAC1B,IAAA,aAAa,GAAG,MAAM,CAAC,UAAU,yDAAC;AAClC,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,qDAAC;AACzB,IAAA,YAAY,GAAG,MAAM,CAAC,KAAK,wDAAC;AAC5B,IAAA,IAAI,GAAG,MAAM,CAAM,SAAS,gDAAC;AAE7B,IAAA,UAAU,GAAG,MAAM,CAAC,KAAK,sDAAC;AAC1B,IAAA,WAAW,GAAG,MAAM,CAAsB,SAAS,uDAAC;AACpD,IAAA,I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,EACb,CAAC,aAAa,EAAE,WAAW,CAAC,EAAA,eAAA,EAGpB,uBAAuB,CAAC,MAAM,EAAA,QAAA,EAAA,4vBAAA,EAAA,MAAA,EAAA,CAAA,2DAAA,CAAA,EAAA;;;AEXjD;;AAEG;;;;"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { FunFieldValueBase, FormValidators, valueFbConfig, baseFbConfig, valueFunField, baseFunField, BaseDesignSetting, ValueDesignSetting, FunField, DynamicDirective, InputTrigger, OptionsNode, SimpleMenu } from 'ngx-axis-appforge/core';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import * as i1 from '@angular/forms';
|
|
5
|
+
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
6
|
+
import * as i2 from 'ng-zorro-antd/collapse';
|
|
7
|
+
import { NzCollapseModule } from 'ng-zorro-antd/collapse';
|
|
8
|
+
import * as i4 from 'ng-zorro-antd/form';
|
|
9
|
+
import { NzFormModule } from 'ng-zorro-antd/form';
|
|
10
|
+
import * as i5 from 'ng-zorro-antd/input';
|
|
11
|
+
import { NzInputModule } from 'ng-zorro-antd/input';
|
|
12
|
+
import * as i6 from 'ng-zorro-antd/radio';
|
|
13
|
+
import { NzRadioModule } from 'ng-zorro-antd/radio';
|
|
14
|
+
import * as i3 from 'ng-zorro-antd/grid';
|
|
15
|
+
|
|
16
|
+
class Setting extends FunFieldValueBase {
|
|
17
|
+
fg = this.fb.group({
|
|
18
|
+
...baseFbConfig,
|
|
19
|
+
...valueFbConfig,
|
|
20
|
+
onValue: [true, FormValidators.required],
|
|
21
|
+
offValue: [false, FormValidators.required],
|
|
22
|
+
onLabel: [],
|
|
23
|
+
offLabel: [],
|
|
24
|
+
size: [undefined, FormValidators.requiredFun],
|
|
25
|
+
});
|
|
26
|
+
funFields = {
|
|
27
|
+
...baseFunField,
|
|
28
|
+
...valueFunField,
|
|
29
|
+
onLabel: {
|
|
30
|
+
defaultValue: undefined
|
|
31
|
+
},
|
|
32
|
+
offLabel: {
|
|
33
|
+
defaultValue: undefined
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
defaultValue: "default"
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
40
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.1.6", type: Setting, isStandalone: true, selector: "axis-design-single-selector-setting", usesInheritance: true, ngImport: i0, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5F00\u542F\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"onValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5173\u95ED\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"offValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u5F00\u542F\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"onLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u5173\u95ED\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"offLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5927\u5C0F\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"size\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"default\">\u5927</label>\n <label nz-radio-button nzValue=\"small\">\u5C0F</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>", styles: [""], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: NzCollapseModule }, { kind: "component", type: i2.NzCollapsePanelComponent, selector: "nz-collapse-panel", inputs: ["nzActive", "nzDisabled", "nzShowArrow", "nzExtra", "nzHeader", "nzExpandedIcon"], outputs: ["nzActiveChange"], exportAs: ["nzCollapsePanel"] }, { kind: "component", type: i2.NzCollapseComponent, selector: "nz-collapse", inputs: ["nzAccordion", "nzBordered", "nzGhost", "nzExpandIconPosition"], exportAs: ["nzCollapse"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i1.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "ngmodule", type: NzFormModule }, { kind: "directive", type: i3.NzColDirective, selector: "[nz-col],nz-col,nz-form-control,nz-form-label", inputs: ["nzFlex", "nzSpan", "nzOrder", "nzOffset", "nzPush", "nzPull", "nzXs", "nzSm", "nzMd", "nzLg", "nzXl", "nzXXl"], exportAs: ["nzCol"] }, { kind: "directive", type: i3.NzRowDirective, selector: "[nz-row],nz-row,nz-form-item", inputs: ["nzAlign", "nzJustify", "nzGutter"], exportAs: ["nzRow"] }, { kind: "directive", type: i4.NzFormDirective, selector: "[nz-form]", inputs: ["nzLayout", "nzNoColon", "nzAutoTips", "nzDisableAutoTips", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzForm"] }, { kind: "component", type: i4.NzFormItemComponent, selector: "nz-form-item", exportAs: ["nzFormItem"] }, { kind: "component", type: i4.NzFormLabelComponent, selector: "nz-form-label", inputs: ["nzFor", "nzRequired", "nzNoColon", "nzTooltipTitle", "nzTooltipIcon", "nzLabelAlign", "nzLabelWrap"], exportAs: ["nzFormLabel"] }, { kind: "component", type: i4.NzFormControlComponent, selector: "nz-form-control", inputs: ["nzSuccessTip", "nzWarningTip", "nzErrorTip", "nzValidatingTip", "nzExtra", "nzAutoTips", "nzDisableAutoTips", "nzHasFeedback", "nzValidateStatus"], exportAs: ["nzFormControl"] }, { kind: "component", type: BaseDesignSetting, selector: "axis-base-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { kind: "component", type: ValueDesignSetting, selector: "axis-value-design-setting", inputs: ["scopeId", "exclude", "fg"] }, { kind: "ngmodule", type: NzInputModule }, { kind: "directive", type: i5.NzInputDirective, selector: "input[nz-input],textarea[nz-input]", inputs: ["nzBorderless", "nzVariant", "nzSize", "nzStepperless", "nzStatus", "disabled"], exportAs: ["nzInput"] }, { kind: "component", type: FunField, selector: "axis-fun-field", inputs: ["scopes", "exclude", "scopeId", "onlyFun", "noListen", "disabled", "editTip", "value", "open", "showCreateListenModal", "createListenDataSourceName"], outputs: ["valueChange", "openChange", "showCreateListenModalChange", "createListenDataSourceNameChange"] }, { kind: "directive", type: DynamicDirective, selector: "[axisDynamic]", inputs: ["axisDynamic", "standalone", "isDesign"], outputs: ["onRegisteValueAccess"], exportAs: ["axisDynamic"] }, { kind: "component", type: InputTrigger, selector: "axis-input-trigger", inputs: ["internalTriggers", "value", "eventDesc", "isVisibleHandlerModal", "editEventHandler"], outputs: ["valueChange", "isVisibleHandlerModalChange", "editEventHandlerChange"] }, { kind: "ngmodule", type: NzRadioModule }, { kind: "component", type: i6.NzRadioComponent, selector: "[nz-radio],[nz-radio-button]", inputs: ["nzValue", "nzDisabled", "nzAutoFocus", "nz-radio-button"], exportAs: ["nzRadio"] }, { kind: "component", type: i6.NzRadioGroupComponent, selector: "nz-radio-group", inputs: ["nzDisabled", "nzButtonStyle", "nzSize", "nzName"], exportAs: ["nzRadioGroup"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
41
|
+
}
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Setting, decorators: [{
|
|
43
|
+
type: Component,
|
|
44
|
+
args: [{ selector: 'axis-design-single-selector-setting', imports: [FormsModule, NzCollapseModule, ReactiveFormsModule, NzFormModule, BaseDesignSetting, ValueDesignSetting, NzInputModule, FunField, DynamicDirective, InputTrigger, NzRadioModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"\u57FA\u672C\u8BBE\u7F6E\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5F00\u542F\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"onValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5173\u95ED\u503C\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"offValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u5F00\u542F\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"onLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n \u5173\u95ED\u6807\u7B7E\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"offLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n \u5927\u5C0F\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"size\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"default\">\u5927</label>\n <label nz-radio-button nzValue=\"small\">\u5C0F</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>" }]
|
|
45
|
+
}] });
|
|
46
|
+
|
|
47
|
+
const Config = {
|
|
48
|
+
componentName: "开关",
|
|
49
|
+
buildOptionsNodes(nextInfo) {
|
|
50
|
+
return {
|
|
51
|
+
treeNode: new OptionsNode({
|
|
52
|
+
parentId: nextInfo.parentId,
|
|
53
|
+
scopeId: nextInfo.scopeId,
|
|
54
|
+
name: "开关",
|
|
55
|
+
canSetting: true,
|
|
56
|
+
canDrag: true,
|
|
57
|
+
dragType: "component",
|
|
58
|
+
parentObj: nextInfo.parentObject,
|
|
59
|
+
indexOfParentObj: nextInfo.indexOfParent,
|
|
60
|
+
rootOptions: nextInfo.currentObject,
|
|
61
|
+
settingType: Setting,
|
|
62
|
+
contextMenu: SimpleMenu,
|
|
63
|
+
icon: "switcher",
|
|
64
|
+
}),
|
|
65
|
+
};
|
|
66
|
+
},
|
|
67
|
+
bindElementsOptionsNode(element, options) {
|
|
68
|
+
return {
|
|
69
|
+
[options.id]: { element },
|
|
70
|
+
};
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Generated bundle index. Do not edit.
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
export { Config };
|
|
79
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-switch-design.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-switch-design.mjs","sources":["../../../axis-components/switch/design/setting/setting.ts","../../../axis-components/switch/design/setting/setting.html","../../../axis-components/switch/design/config.ts","../../../axis-components/switch/design/ngx-axis-appforge-axis-components-switch-design.ts"],"sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { FormsModule, ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';\nimport { NzCollapseModule } from 'ng-zorro-antd/collapse';\nimport { NzFormModule } from 'ng-zorro-antd/form';\nimport { NzInputModule } from 'ng-zorro-antd/input';\nimport { NzRadioModule } from 'ng-zorro-antd/radio';\nimport { BaseDesignSetting, baseFbConfig, baseFunField, DynamicDirective, FormValidators, FunField, FunFieldOptions, FunFieldValueBase, InputTrigger, ValueDesignSetting, valueFbConfig, valueFunField } from 'ngx-axis-appforge/core';\n\n@Component({\n selector: 'axis-design-single-selector-setting',\n imports: [FormsModule, NzCollapseModule, ReactiveFormsModule, NzFormModule, BaseDesignSetting, ValueDesignSetting, NzInputModule, FunField, DynamicDirective, InputTrigger, NzRadioModule],\n templateUrl: './setting.html',\n styleUrl: './setting.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Setting extends FunFieldValueBase {\n\n override fg: UntypedFormGroup = this.fb.group({\n ...baseFbConfig,\n ...valueFbConfig,\n onValue: [true, FormValidators.required],\n offValue: [false, FormValidators.required],\n onLabel: [],\n offLabel: [],\n size: [undefined, FormValidators.requiredFun],\n });\n\n protected override funFields: FunFieldOptions = {\n ...baseFunField,\n ...valueFunField,\n onLabel: {\n defaultValue: undefined\n },\n offLabel: {\n defaultValue: undefined\n },\n size: {\n defaultValue: \"default\"\n },\n };\n\n}\n","<form [formGroup]=\"fg\" nz-form>\n <nz-collapse [nzBordered]=\"false\">\n <nz-collapse-panel nzHeader=\"基本设置\" nzActive>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 开启值\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"onValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 关闭值\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <ng-container formControlName=\"offValue\"\n [axisDynamic]=\"{component:'axis-components/input-json',inuse:true}\"\n [standalone]=\"true\"></ng-container>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 开启标签\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"onLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\">\n 关闭标签\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"offLabel\">\n <input nz-input ngModel [ngModelOptions]=\"{standalone:true}\" />\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n <nz-form-item>\n <nz-form-label nzSpan=\"8\" nzRequired>\n 大小\n </nz-form-label>\n <nz-form-control nzSpan=\"16\">\n <axis-fun-field formControlName=\"size\">\n <nz-radio-group ngModel [ngModelOptions]=\"{standalone:true}\" nzSize=\"small\">\n <label nz-radio-button nzValue=\"default\">大</label>\n <label nz-radio-button nzValue=\"small\">小</label>\n </nz-radio-group>\n </axis-fun-field>\n </nz-form-control>\n </nz-form-item>\n </nz-collapse-panel>\n <axis-value-design-setting [fg]=\"fg\"></axis-value-design-setting>\n <axis-base-design-setting [fg]=\"fg\"></axis-base-design-setting>\n <axis-input-trigger formControlName=\"triggeEvents\" [internalTriggers]=\"['valueChange']\"></axis-input-trigger>\n </nz-collapse>\n</form>","import { NextInfo, DesignBuildResult, DesignBindElementsResult, DesignConfig, OptionsNode, SimpleMenu } from \"ngx-axis-appforge/core\";\nimport { Setting } from \"./setting/setting\";\n\nexport const Config: DesignConfig = {\n\n componentName: \"开关\",\n buildOptionsNodes(nextInfo: NextInfo): DesignBuildResult {\n return {\n treeNode: new OptionsNode({\n parentId: nextInfo.parentId,\n scopeId: nextInfo.scopeId,\n name: \"开关\",\n canSetting: true,\n canDrag: true,\n dragType: \"component\",\n parentObj: nextInfo.parentObject,\n indexOfParentObj: nextInfo.indexOfParent,\n rootOptions: nextInfo.currentObject,\n settingType: Setting,\n contextMenu: SimpleMenu,\n icon: \"switcher\",\n }),\n };\n },\n bindElementsOptionsNode(element: HTMLElement, options: any): DesignBindElementsResult {\n return {\n [options.id]: { element },\n }\n },\n};\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './config';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;AAeM,MAAO,OAAQ,SAAQ,iBAAiB,CAAA;AAEnC,IAAA,EAAE,GAAqB,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC5C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,aAAa;AAChB,QAAA,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,QAAQ,CAAC;AACxC,QAAA,QAAQ,EAAE,CAAC,KAAK,EAAE,cAAc,CAAC,QAAQ,CAAC;AAC1C,QAAA,OAAO,EAAE,EAAE;AACX,QAAA,QAAQ,EAAE,EAAE;AACZ,QAAA,IAAI,EAAE,CAAC,SAAS,EAAE,cAAc,CAAC,WAAW,CAAC;AAC9C,KAAA,CAAC;AAEiB,IAAA,SAAS,GAAoB;AAC9C,QAAA,GAAG,YAAY;AACf,QAAA,GAAG,aAAa;AAChB,QAAA,OAAO,EAAE;AACP,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,QAAQ,EAAE;AACR,YAAA,YAAY,EAAE;AACf,SAAA;AACD,QAAA,IAAI,EAAE;AACJ,YAAA,YAAY,EAAE;AACf,SAAA;KACF;uGAxBU,OAAO,EAAA,IAAA,EAAA,IAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAAP,OAAO,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,qCAAA,EAAA,eAAA,EAAA,IAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECfpB,uhGA6DO,EAAA,MAAA,EAAA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AAW,EAAE,UAAU;AACvB,gBAAA,IAAI,EAAE,UAAU;aACnB,CAAC;SACL;KACJ;IACD,uBAAuB,CAAC,OAAoB,EAAE,OAAY,EAAA;QACtD,OAAO;AACH,YAAA,CAAC,OAAO,CAAC,EAAE,GAAG,EAAE,OAAO,EAAE;SAC5B;KACJ;;;AC5BL;;AAEG;;;;"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { signal, model, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
3
|
+
import { ValueAccessOptions, ValueAccess } from 'ngx-axis-appforge/core';
|
|
4
|
+
import * as i2 from '@angular/forms';
|
|
5
|
+
import { FormsModule } from '@angular/forms';
|
|
6
|
+
import * as i1 from 'ng-zorro-antd/switch';
|
|
7
|
+
import { NzSwitchModule } from 'ng-zorro-antd/switch';
|
|
8
|
+
|
|
9
|
+
class SwitchOptions extends ValueAccessOptions {
|
|
10
|
+
onValue = signal(true, ...(ngDevMode ? [{ debugName: "onValue" }] : []));
|
|
11
|
+
offValue = signal(false, ...(ngDevMode ? [{ debugName: "offValue" }] : []));
|
|
12
|
+
onLabel = signal(undefined, ...(ngDevMode ? [{ debugName: "onLabel" }] : []));
|
|
13
|
+
offLabel = signal(undefined, ...(ngDevMode ? [{ debugName: "offLabel" }] : []));
|
|
14
|
+
size = signal('default', ...(ngDevMode ? [{ debugName: "size" }] : []));
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
class Switch extends ValueAccess {
|
|
18
|
+
options = new SwitchOptions();
|
|
19
|
+
switchValue = model(false, ...(ngDevMode ? [{ debugName: "switchValue" }] : []));
|
|
20
|
+
writeValue(value) {
|
|
21
|
+
super.writeValue(value);
|
|
22
|
+
this.valueToSwitchValue();
|
|
23
|
+
}
|
|
24
|
+
setInitValue(value) {
|
|
25
|
+
super.setInitValue(value);
|
|
26
|
+
this.valueToSwitchValue();
|
|
27
|
+
}
|
|
28
|
+
valueToSwitchValue() {
|
|
29
|
+
this.switchValue.set(this.value() === this.options.onValue());
|
|
30
|
+
}
|
|
31
|
+
onSwitchChange(value) {
|
|
32
|
+
this.value.set(value ? this.options.onValue() : this.options.offValue());
|
|
33
|
+
this.onChange?.(this.value());
|
|
34
|
+
}
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Switch, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
36
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.1.6", type: Switch, isStandalone: true, selector: "axis-switch", inputs: { switchValue: { classPropertyName: "switchValue", publicName: "switchValue", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { switchValue: "switchValueChange" }, usesInheritance: true, ngImport: i0, template: "<nz-switch [(ngModel)]=\"switchValue\" (ngModelChange)=\"onSwitchChange($event)\"\n [nzDisabled]=\"options.disabled() || options.readonly()\" [nzCheckedChildren]=\"options.onLabel()\"\n [nzUnCheckedChildren]=\"options.offLabel()\" [nzSize]=\"options.size()\"></nz-switch>", styles: [":host{display:block}.vertical [nz-radio]{display:block}\n"], dependencies: [{ kind: "ngmodule", type: NzSwitchModule }, { kind: "component", type: i1.NzSwitchComponent, selector: "nz-switch", inputs: ["nzLoading", "nzDisabled", "nzControl", "nzCheckedChildren", "nzUnCheckedChildren", "nzSize", "nzId"], exportAs: ["nzSwitch"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
37
|
+
}
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.1.6", ngImport: i0, type: Switch, decorators: [{
|
|
39
|
+
type: Component,
|
|
40
|
+
args: [{ selector: 'axis-switch', imports: [NzSwitchModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<nz-switch [(ngModel)]=\"switchValue\" (ngModelChange)=\"onSwitchChange($event)\"\n [nzDisabled]=\"options.disabled() || options.readonly()\" [nzCheckedChildren]=\"options.onLabel()\"\n [nzUnCheckedChildren]=\"options.offLabel()\" [nzSize]=\"options.size()\"></nz-switch>", styles: [":host{display:block}.vertical [nz-radio]{display:block}\n"] }]
|
|
41
|
+
}] });
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Generated bundle index. Do not edit.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
export { Switch };
|
|
48
|
+
//# sourceMappingURL=ngx-axis-appforge-axis-components-switch.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ngx-axis-appforge-axis-components-switch.mjs","sources":["../../../axis-components/switch/switch.options.ts","../../../axis-components/switch/switch.ts","../../../axis-components/switch/switch.html","../../../axis-components/switch/ngx-axis-appforge-axis-components-switch.ts"],"sourcesContent":["import { signal } from \"@angular/core\";\nimport { ValueAccessOptions } from \"ngx-axis-appforge/core\";\n\nexport class SwitchOptions extends ValueAccessOptions {\n\n readonly onValue = signal<any>(true);\n readonly offValue = signal<any>(false);\n readonly onLabel = signal<any>(undefined);\n readonly offLabel = signal<any>(undefined);\n readonly size = signal<'small' | 'default'>('default');\n}","import { ChangeDetectionStrategy, Component, model } from '@angular/core';\nimport { ValueAccess } from 'ngx-axis-appforge/core';\nimport { FormsModule } from '@angular/forms';\nimport { SwitchOptions } from './switch.options';\nimport { NzSwitchModule } from 'ng-zorro-antd/switch';\n\n@Component({\n selector: 'axis-switch',\n imports: [NzSwitchModule, FormsModule],\n templateUrl: './switch.html',\n styleUrl: './switch.css',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Switch extends ValueAccess<SwitchOptions> {\n\n override options: SwitchOptions = new SwitchOptions();\n\n readonly switchValue = model(false);\n\n override writeValue(value: any): void {\n super.writeValue(value);\n this.valueToSwitchValue();\n }\n\n override setInitValue(value: any): void {\n super.setInitValue(value);\n this.valueToSwitchValue();\n }\n\n private valueToSwitchValue() {\n this.switchValue.set(this.value() === this.options.onValue());\n }\n\n onSwitchChange(value: boolean) {\n this.value.set(value ? this.options.onValue() : this.options.offValue());\n this.onChange?.(this.value());\n }\n\n}\n","<nz-switch [(ngModel)]=\"switchValue\" (ngModelChange)=\"onSwitchChange($event)\"\n [nzDisabled]=\"options.disabled() || options.readonly()\" [nzCheckedChildren]=\"options.onLabel()\"\n [nzUnCheckedChildren]=\"options.offLabel()\" [nzSize]=\"options.size()\"></nz-switch>","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './switch';\n"],"names":[],"mappings":";;;;;;;;AAGM,MAAO,aAAc,SAAQ,kBAAkB,CAAA;AAExC,IAAA,OAAO,GAAG,MAAM,CAAM,IAAI,mDAAC;AAC3B,IAAA,QAAQ,GAAG,MAAM,CAAM,KAAK,oDAAC;AAC7B,IAAA,OAAO,GAAG,MAAM,CAAM,SAAS,mDAAC;AAChC,IAAA,QAAQ,GAAG,MAAM,CAAM,SAAS,oDAAC;AACjC,IAAA,IAAI,GAAG,MAAM,CAAsB,SAAS,gDAAC;AACzD;;ACGK,MAAO,MAAO,SAAQ,WAA0B,CAAA;AAE3C,IAAA,OAAO,GAAkB,IAAI,aAAa,EAAE;AAE5C,IAAA,WAAW,GAAG,KAAK,CAAC,KAAK,uDAAC;AAE1B,IAAA,UAAU,CAAC,KAAU,EAAA;AAC5B,QAAA,KAAK,CAAC,UAAU,CAAC,KAAK,CAAC;QACvB,IAAI,CAAC,kBAAkB,EAAE;;AAGlB,IAAA,YAAY,CAAC,KAAU,EAAA;AAC9B,QAAA,KAAK,CAAC,YAAY,CAAC,KAAK,CAAC;QACzB,IAAI,CAAC,kBAAkB,EAAE;;IAGnB,kBAAkB,GAAA;AACxB,QAAA,IAAI,CAAC,WAAW,CAAC,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