This commit is contained in:
CHEVALLIER Abel
2025-11-13 16:23:22 +01:00
parent de9c515a47
commit cb235644dc
34924 changed files with 3811102 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
.site-input-split {
background-color: #fff;
}
.site-input-right:not(.ant-input-rtl) {
border-left-width: 0;
}
.site-input-right:not(.ant-input-rtl):hover,
.site-input-right:not(.ant-input-rtl):focus {
border-left-width: 1px;
}
.site-input-right.ant-input-rtl {
border-right-width: 0;
}
.site-input-right.ant-input-rtl:hover,
.site-input-right.ant-input-rtl:focus {
border-right-width: 1px;
}

View File

@@ -0,0 +1,161 @@
<nz-space-compact nzBlock>
<input nz-input value="0571" [style.width.%]="20" />
<input nz-input value="26888888" [style.width.%]="30" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock nzSize="small">
<input nz-input value="https://ng.ant.design" [style.width]="'calc(100% - 200px)'" />
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="https://ng.ant.design" [style.width]="'calc(100% - 200px)'" />
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="git@github.com:NG-ZORRO/ng-zorro-antd.git" [style.width]="'calc(100% - 200px)'" />
<button nz-button nz-tooltip nzTooltipTitle="copy git url">
<nz-icon nzType="copy" />
</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Zhejianggggg">
<nz-option nzLabel="Zhejianggggg" nzValue="Zhejianggggg"></nz-option>
<nz-option nzLabel="Jiangsu" nzValue="Jiangsu"></nz-option>
</nz-select>
<input nz-input value="Xihu District, Hangzhou" [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="30">
<input nz-input value="0571" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="50">
<input nz-input value="26888888" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="20">
<input nz-input value="+1" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select nzMode="multiple" [ngModel]="['Zhejianggggg']" [style.width.%]="50">
<nz-option nzLabel="Zhejianggggg" nzValue="Zhejianggggg"></nz-option>
<nz-option nzLabel="Jiangsu" nzValue="Jiangsu"></nz-option>
</nz-select>
<input nz-input value="Xihu District, Hangzhou" [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Option1">
<nz-option nzLabel="Option1" nzValue="Option1"></nz-option>
<nz-option nzLabel="Option2" nzValue="Option2"></nz-option>
</nz-select>
<input nz-input value="input content" [style.width.%]="50" />
<nz-input-number [ngModel]="12" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="input content" [style.width.%]="50" />
<nz-date-picker [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-range-picker [style.width.%]="70" />
<input nz-input value="input content" [style.width.%]="30" />
<button nz-button nzType="primary">查询</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="input content" [style.width.%]="30" />
<nz-range-picker [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Option1-1">
<nz-option nzLabel="Option1-1" nzValue="Option1-1"></nz-option>
<nz-option nzLabel="Option2-1" nzValue="Option2-1"></nz-option>
</nz-select>
<nz-select ngModel="Option1-2">
<nz-option nzLabel="Option1-2" nzValue="Option1-2"></nz-option>
<nz-option nzLabel="Option2-2" nzValue="Option2-2"></nz-option>
</nz-select>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="1">
<nz-option nzLabel="Between" nzValue="1"></nz-option>
<nz-option nzLabel="Except" nzValue="2"></nz-option>
</nz-select>
<input nz-input placeholder="Minimum" style="width: 100px; text-align: center" />
<input
nz-input
class="site-input-split"
style="
width: 30px;
border-left: 0;
border-right: 0;
pointer-events: none
"
placeholder="~"
disabled
/>
<input nz-input class="site-input-right" style="width: 100px; text-align: center" placeholder="Maximum" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Sign Up" [style.width.%]="30">
<nz-option nzLabel="Sign Up" nzValue="Sign Up"></nz-option>
<nz-option nzLabel="Sign In" nzValue="Sign In"></nz-option>
</nz-select>
<nz-autocomplete #auto [nzDataSource]="['text 1', 'text 2']" />
<input nz-input placeholder="Email" [nzAutocomplete]="auto" [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-time-picker [style.width.%]="70" />
<nz-cascader [nzOptions]="cascaderOptions" nzPlaceholder="Select Address" [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-tree-select
[nzNodes]="nodes"
nzShowSearch
nzPlaceHolder="Please select"
ngModel="10010"
nzDefaultExpandAll
[style.width.%]="60"
></nz-tree-select>
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-input-group nzAddOnBefore="Http://" nzAddOnAfter=".com" [style.width.%]="50">
<input nz-input placeholder="input here" />
</nz-input-group>
<nz-input-number>
<span nzInputPrefix>$</span>
</nz-input-number>
<nz-input-number>
<span nzInputAddonBefore>$</span>
</nz-input-number>
</nz-space-compact>

View File

@@ -0,0 +1,23 @@
import { fakeAsync, ComponentFixture, TestBed } from '@angular/core/testing';
import { <%= classify(name) %>Component } from './<%= dasherize(name) %>.component';
describe('<%= classify(name) %>Component', () => {
let component: <%= classify(name) %>Component;
let fixture: ComponentFixture<<%= classify(name) %>Component>;
beforeEach(fakeAsync(() => {
TestBed.configureTestingModule({
declarations: [ <%= classify(name) %>Component ]
})
.compileComponents();
;
fixture = TestBed.createComponent(<%= classify(name) %>Component);
component = fixture.componentInstance;
fixture.detectChanges();
}));
it('should compile', () => {
expect(component).toBeTruthy();
});
});

View File

@@ -0,0 +1,278 @@
import { Component } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { NzAutocompleteModule } from 'ng-zorro-antd/auto-complete';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzCascaderModule, NzCascaderOption } from 'ng-zorro-antd/cascader';
import { NzDatePickerModule } from 'ng-zorro-antd/date-picker';
import { NzIconModule } from 'ng-zorro-antd/icon';
import { NzInputModule } from 'ng-zorro-antd/input';
import { NzInputNumberModule } from 'ng-zorro-antd/input-number';
import { NzSelectModule } from 'ng-zorro-antd/select';
import { NzSpaceModule } from 'ng-zorro-antd/space';
import { NzTimePickerModule } from 'ng-zorro-antd/time-picker';
import { NzTooltipModule } from 'ng-zorro-antd/tooltip';
import { NzTreeSelectModule } from 'ng-zorro-antd/tree-select';
@Component({
selector: '<%= selector %>',
imports: [
NzSpaceModule,
NzButtonModule,
NzIconModule,
NzInputModule,
NzInputNumberModule,
NzSelectModule,
NzCascaderModule,
NzTreeSelectModule,
NzDatePickerModule,
NzTimePickerModule,
NzAutocompleteModule,
NzTooltipModule,
FormsModule
],
<% if(inlineTemplate) { %>template: `
<nz-space-compact nzBlock>
<input nz-input value="0571" [style.width.%]="20" />
<input nz-input value="26888888" [style.width.%]="30" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock nzSize="small">
<input nz-input value="https://ng.ant.design" [style.width]="'calc(100% - 200px)'" />
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="https://ng.ant.design" [style.width]="'calc(100% - 200px)'" />
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="git@github.com:NG-ZORRO/ng-zorro-antd.git" [style.width]="'calc(100% - 200px)'" />
<button nz-button nz-tooltip nzTooltipTitle="copy git url">
<nz-icon nzType="copy" />
</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Zhejianggggg">
<nz-option nzLabel="Zhejianggggg" nzValue="Zhejianggggg"></nz-option>
<nz-option nzLabel="Jiangsu" nzValue="Jiangsu"></nz-option>
</nz-select>
<input nz-input value="Xihu District, Hangzhou" [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="30">
<input nz-input value="0571" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="50">
<input nz-input value="26888888" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
<nz-input-group nzSearch [nzAddOnAfter]="addonTmpl" [style.width.%]="20">
<input nz-input value="+1" />
<ng-template #addonTmpl>
<button nz-button class="ant-input-search-button">
<nz-icon nzType="search" />
</button>
</ng-template>
</nz-input-group>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select nzMode="multiple" [ngModel]="['Zhejianggggg']" [style.width.%]="50">
<nz-option nzLabel="Zhejianggggg" nzValue="Zhejianggggg"></nz-option>
<nz-option nzLabel="Jiangsu" nzValue="Jiangsu"></nz-option>
</nz-select>
<input nz-input value="Xihu District, Hangzhou" [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Option1">
<nz-option nzLabel="Option1" nzValue="Option1"></nz-option>
<nz-option nzLabel="Option2" nzValue="Option2"></nz-option>
</nz-select>
<input nz-input value="input content" [style.width.%]="50" />
<nz-input-number [ngModel]="12" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="input content" [style.width.%]="50" />
<nz-date-picker [style.width.%]="50" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-range-picker [style.width.%]="70" />
<input nz-input value="input content" [style.width.%]="30" />
<button nz-button nzType="primary">查询</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<input nz-input value="input content" [style.width.%]="30" />
<nz-range-picker [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Option1-1">
<nz-option nzLabel="Option1-1" nzValue="Option1-1"></nz-option>
<nz-option nzLabel="Option2-1" nzValue="Option2-1"></nz-option>
</nz-select>
<nz-select ngModel="Option1-2">
<nz-option nzLabel="Option1-2" nzValue="Option1-2"></nz-option>
<nz-option nzLabel="Option2-2" nzValue="Option2-2"></nz-option>
</nz-select>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="1">
<nz-option nzLabel="Between" nzValue="1"></nz-option>
<nz-option nzLabel="Except" nzValue="2"></nz-option>
</nz-select>
<input nz-input placeholder="Minimum" style="width: 100px; text-align: center" />
<input
nz-input
class="site-input-split"
style="
width: 30px;
border-left: 0;
border-right: 0;
pointer-events: none
"
placeholder="~"
disabled
/>
<input nz-input class="site-input-right" style="width: 100px; text-align: center" placeholder="Maximum" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-select ngModel="Sign Up" [style.width.%]="30">
<nz-option nzLabel="Sign Up" nzValue="Sign Up"></nz-option>
<nz-option nzLabel="Sign In" nzValue="Sign In"></nz-option>
</nz-select>
<nz-autocomplete #auto [nzDataSource]="['text 1', 'text 2']" />
<input nz-input placeholder="Email" [nzAutocomplete]="auto" [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-time-picker [style.width.%]="70" />
<nz-cascader [nzOptions]="cascaderOptions" nzPlaceholder="Select Address" [style.width.%]="70" />
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-tree-select
[nzNodes]="nodes"
nzShowSearch
nzPlaceHolder="Please select"
ngModel="10010"
nzDefaultExpandAll
[style.width.%]="60"
></nz-tree-select>
<button nz-button nzType="primary">Submit</button>
</nz-space-compact>
<br />
<nz-space-compact nzBlock>
<nz-input-group nzAddOnBefore="Http://" nzAddOnAfter=".com" [style.width.%]="50">
<input nz-input placeholder="input here" />
</nz-input-group>
<nz-input-number>
<span nzInputPrefix>$</span>
</nz-input-number>
<nz-input-number>
<span nzInputAddonBefore>$</span>
</nz-input-number>
</nz-space-compact>
`<% } else { %>templateUrl: './<%= dasherize(name) %>.component.html'<% } %>,
<% if(inlineStyle) { %>styles: [`
.site-input-split {
background-color: #fff;
}
.site-input-right:not(.ant-input-rtl) {
border-left-width: 0;
}
.site-input-right:not(.ant-input-rtl):hover,
.site-input-right:not(.ant-input-rtl):focus {
border-left-width: 1px;
}
.site-input-right.ant-input-rtl {
border-right-width: 0;
}
.site-input-right.ant-input-rtl:hover,
.site-input-right.ant-input-rtl:focus {
border-right-width: 1px;
}
`]<% } else { %>styleUrls: ['./<%= dasherize(name) %>.component.<%= style %>']<% } %>
})
export class <%= classify(name) %>Component {
cascaderOptions: NzCascaderOption[] = [
{
value: 'zhejiang',
label: 'Zhejiang',
children: [
{
value: 'hangzhou',
label: 'Hangzhou',
children: [
{
value: 'xihu',
label: 'West Lake',
isLeaf: true
}
]
}
]
},
{
value: 'jiangsu',
label: 'Jiangsu',
children: [
{
value: 'nanjing',
label: 'Nanjing',
children: [
{
value: 'zhonghuamen',
label: 'Zhong Hua Men',
isLeaf: true
}
]
}
]
}
];
nodes = [
{
title: 'parent 1',
key: '100',
children: [
{
title: 'parent 1-0',
key: '1001',
children: [
{ title: 'leaf 1-0-0', key: '10010', isLeaf: true },
{ title: 'leaf 1-0-1', key: '10011', isLeaf: true }
]
},
{
title: 'parent 1-1',
key: '1002',
children: [{ title: 'leaf 1-1-0', key: '10020', isLeaf: true }]
}
]
}
];
}

View File

@@ -0,0 +1,14 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const schematics_1 = require("@angular-devkit/schematics");
const build_component_1 = require("../../utils/build-component");
function default_1(options) {
return (0, schematics_1.chain)([
(0, build_component_1.buildComponent)(Object.assign({}, options), {
template: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.html.template',
stylesheet: './__path__/__name@dasherize@if-flat__/__name@dasherize__.component.__style__.template'
})
]);
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../schematics/demo/space-compact/index.ts"],"names":[],"mappings":";;AAQA,4BAUC;AAlBD,2DAGoC;AACpC,iEAA6D;AAI7D,mBAAwB,OAAe;IACrC,OAAO,IAAA,kBAAK,EAAC;QACX,IAAA,gCAAc,oBACP,OAAO,GACZ;YACE,QAAQ,EAAE,kFAAkF;YAC5F,UAAU,EAAE,uFAAuF;SACpG,CACF;KACF,CAAC,CAAC;AACL,CAAC"}

View File

@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=schema.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../schematics/demo/space-compact/schema.ts"],"names":[],"mappings":""}

View File

@@ -0,0 +1 @@
{"$schema":"http://json-schema.org/schema","$id":"compact-space","title":"NG-ZORRO compact space","type":"object","properties":{"path":{"type":"string","format":"path","description":"The path to create the component.","visible":false},"project":{"type":"string","description":"The name of the project.","$default":{"$source":"projectName"}},"name":{"type":"string","description":"The name of the component.","$default":{"$source":"argv","index":0},"x-prompt":"What should be the name of the component?"},"inlineStyle":{"description":"When true, includes styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"s"},"inlineTemplate":{"description":"When true, includes template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.","type":"boolean","default":false,"alias":"t"},"standalone":{"description":"Whether the generated component is standalone.","type":"boolean"},"prefix":{"type":"string","description":"The prefix to apply to the generated component selector.","alias":"p","oneOf":[{"maxLength":0},{"minLength":1,"format":"html-selector"}]},"styleext":{"description":"The file extension to use for style files.","type":"string","default":"css","x-deprecated":"Use \"style\" instead."},"style":{"description":"The file extension or preprocessor to use for style files.","type":"string","default":"css","enum":["css","scss","sass","less","styl"]},"spec":{"type":"boolean","description":"When true (the default), generates a \"spec.ts\" test file for the new component.","default":true,"x-deprecated":"Use \"skipTests\" instead."},"skipTests":{"type":"boolean","description":"When true, does not create \"spec.ts\" test files for the new component."},"flat":{"type":"boolean","description":"Flag to indicate if a dir is created.","default":false},"skipImport":{"type":"boolean","description":"When true, does not import this component into the owning NgModule."},"selector":{"type":"string","format":"html-selector","description":"The selector to use for the component."},"module":{"type":"string","description":"Allows specification of the declaring module.","alias":"m"},"export":{"type":"boolean","default":false,"description":"When true, the declaring NgModule exports this component."},"entryComponent":{"type":"boolean","default":false,"description":"When true, the new component is the entry component of the declaring NgModule."},"classnameWithModule":{"type":"boolean","description":"When true, Use module class name as additional prefix for the component classname.","default":false}},"required":["name"]}