Skip to content

Feat v4 #6329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 345 commits into from
Jul 14, 2023
Merged

Feat v4 #6329

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
345 commits
Select commit Hold shift + click to select a range
c903de3
refactor(icon): remove style dir (#6215)
buqiyuan Jan 28, 2023
8110d8c
refactor: rename locale
tangjinzhou Jan 28, 2023
dfe462e
refactor: locale-provider
tangjinzhou Jan 28, 2023
221b203
refactor: modal
tangjinzhou Jan 28, 2023
94e981e
refactor: menu
tangjinzhou Jan 28, 2023
337d958
fix: custom class (#6217)
zkwolf Jan 29, 2023
1d01df4
refactor: tooltip
tangjinzhou Jan 30, 2023
31ca070
refactor: grid (#6220)
zkwolf Jan 31, 2023
31776a2
fix: row ts type not work
tangjinzhou Jan 31, 2023
4ef70b1
doc: update demo
tangjinzhou Jan 31, 2023
34373ca
refactor: ts
tangjinzhou Feb 1, 2023
7939eb1
refactor: spin (#6222)
aibayanyu20 Feb 1, 2023
8099391
fix: spin error #6222
tangjinzhou Feb 1, 2023
158cca7
test: test case error (#6225)
zkwolf Feb 2, 2023
dd57d1e
refactor: skeleton (#6224)
aibayanyu20 Feb 2, 2023
989bedd
fix(button): link and text should not have wave (#6226)
zkwolf Feb 2, 2023
47c84cd
refactor: dropdown
tangjinzhou Feb 1, 2023
9b5a072
refactor: popover & popconfirm
tangjinzhou Feb 2, 2023
a205615
refactor(tag): less to cssinjs (#6227)
buqiyuan Feb 3, 2023
fc0f0d8
refactor(empty): less to cssinjs (#6230)
buqiyuan Feb 7, 2023
81e26a9
fix: empty props #6230
tangjinzhou Feb 7, 2023
2c1afa5
refactor: progress style (#6234)
aibayanyu20 Feb 7, 2023
a408168
refactor: progress #6234
tangjinzhou Feb 7, 2023
69c17dc
refactor: switch (#6236)
aibayanyu20 Feb 7, 2023
4f3ce35
refactor:input (#6237)
shifeng1993 Feb 7, 2023
8658806
feat: input add disabled
tangjinzhou Feb 8, 2023
fee7c04
refactor:comment (#6238)
shifeng1993 Feb 8, 2023
a9fbf98
refactor:pageheader (#6239)
shifeng1993 Feb 8, 2023
26f98b7
refactor:statistic (#6240)
shifeng1993 Feb 8, 2023
de77b01
refactor:list (#6241)
shifeng1993 Feb 8, 2023
e2d4f8c
feat: update type
tangjinzhou Feb 8, 2023
f064999
refactor(Space): less to cssinjs & add compact mode (#6229)
buqiyuan Feb 12, 2023
23b81b0
perf: space compact
tangjinzhou Feb 12, 2023
82c4c8f
refactor:typography (#6244)
shifeng1993 Feb 12, 2023
197e209
fix: typography #6244
tangjinzhou Feb 12, 2023
80918cb
refactor:datepicker (#6245)
shifeng1993 Feb 12, 2023
1d77450
refactor: datepicker type
tangjinzhou Feb 12, 2023
dc480bd
refactor: rate style (#6254)
songsong0707 Feb 12, 2023
7a34c99
refactor(layout): less to cssinjs (#6249)
buqiyuan Feb 12, 2023
a5389a2
doc: update layout cover
tangjinzhou Feb 12, 2023
4b2ffd7
refactor(result): less to cssinjs (#6246)
buqiyuan Feb 12, 2023
350dbfe
docs: update result cover
tangjinzhou Feb 12, 2023
2f04932
refactor:slider (#6250)
shifeng1993 Feb 12, 2023
f0e5da3
feat: slider deprecated tooltipVisible
tangjinzhou Feb 12, 2023
cb08f85
refactor(crad): less to cssinjs (#6258)
webvs2 Feb 13, 2023
e9ce4eb
refactor: card #6258
tangjinzhou Feb 13, 2023
bbfb3ce
refactor:carousel (#6262)
shifeng1993 Feb 13, 2023
68d295d
refactor:transfer (#6247)
shifeng1993 Feb 13, 2023
4ccb1c3
perf: transfer
tangjinzhou Feb 13, 2023
19ec975
refactor:checkbox (#6248)
shifeng1993 Feb 14, 2023
7de1be6
feat: checkbox add disabled context
tangjinzhou Feb 14, 2023
f6afd7f
refactor:pagination (#6251)
shifeng1993 Feb 14, 2023
44e5d09
style: update pagination props type
tangjinzhou Feb 14, 2023
92795a8
refactor: mentions (#6255)
aibayanyu20 Feb 14, 2023
7e29eb2
doc: update mentions demo
tangjinzhou Feb 14, 2023
0464c84
refcator:upload (#6261)
shifeng1993 Feb 15, 2023
8a233d7
perf: upload motion
tangjinzhou Feb 15, 2023
587c1ca
refactor:timeline (#6263)
shifeng1993 Feb 15, 2023
04e3819
perf: timeline
tangjinzhou Feb 15, 2023
3715ded
refactor:steps (#6264)
shifeng1993 Feb 15, 2023
dc9987a
fix: steps icon clss error
tangjinzhou Feb 15, 2023
2f51f2d
refactor:collapse (#6266)
shifeng1993 Feb 15, 2023
321989b
feat: update collapse type
tangjinzhou Feb 15, 2023
df6a1fd
refactor:inputnumber (#6265)
shifeng1993 Feb 15, 2023
c1ed77f
feat: number add compactSize & disabledContext
tangjinzhou Feb 15, 2023
8472c25
refactor:table (#6267)
shifeng1993 Feb 15, 2023
a6a270b
refactor: table
tangjinzhou Feb 16, 2023
adec521
feat: table add expandColumnTitle slot
tangjinzhou Feb 17, 2023
cd47a27
refactor:calendar (#6269)
shifeng1993 Feb 17, 2023
9f53d53
refactor:timepicker (#6270)
shifeng1993 Feb 17, 2023
895b433
refactor:tree (#6276)
shifeng1993 Feb 17, 2023
7ddf882
Feat v4 fix type errors (#6285)
shifeng1993 Feb 17, 2023
634675e
refactor: rename locale file
tangjinzhou Feb 17, 2023
328e42a
feat: tree add leafIcon
tangjinzhou Feb 17, 2023
6240ab2
[tabs] :less to cssinjs (#6288)
webvs2 Feb 17, 2023
4738534
refactor: tabs #6288
tangjinzhou Feb 17, 2023
62e7f94
feat: add segmented (#6286)
selicens Feb 18, 2023
9df8317
refactor: segmented #6286
tangjinzhou Feb 19, 2023
39e5824
refactor:select (#6295)
shifeng1993 Feb 19, 2023
124aae7
feat: select add context size
tangjinzhou Feb 20, 2023
799eeed
refactor: tree select (#6296)
shifeng1993 Feb 20, 2023
087dfa2
feat: tree-select add context size
tangjinzhou Feb 20, 2023
7af22a7
perf: table
tangjinzhou Feb 20, 2023
3741931
docs: update doc toc
tangjinzhou Feb 20, 2023
62dda88
refactor: cascader
tangjinzhou Feb 20, 2023
e8918ce
refactor: auto-complete
tangjinzhou Feb 20, 2023
c7b15a9
refactor: image
tangjinzhou Feb 20, 2023
8fcb3fd
refactor: drawer
tangjinzhou Feb 20, 2023
e04f73d
refactor:radio (#6299)
shifeng1993 Feb 21, 2023
c301c63
feat: radio add disabled context
tangjinzhou Feb 21, 2023
975d70e
fix: some type & doc (#6292)
JavanShen Feb 21, 2023
f39d489
refactor: form
tangjinzhou Feb 21, 2023
1b51e6f
fix: directive not work
tangjinzhou Feb 23, 2023
37b5d02
fix: use open, remove visible
tangjinzhou Feb 23, 2023
f3ffcdb
doc: update cover
tangjinzhou Feb 23, 2023
53b146a
refactor: remove not use code
tangjinzhou Feb 23, 2023
33a47bc
chore: update build script
tangjinzhou Feb 23, 2023
2b80870
doc: update doc
tangjinzhou Feb 23, 2023
b393a0a
doc: refactor doc
tangjinzhou Feb 24, 2023
261e7d0
chore: update token error
tangjinzhou Feb 27, 2023
d3a919b
chore: update style
tangjinzhou Feb 27, 2023
516b2e5
refactor: rename _style to style
tangjinzhou Feb 27, 2023
9c6a9fb
fix: tag warning
tangjinzhou Feb 27, 2023
dd063b8
fix(dropdown): open invalid (#6316)
zkwolf Feb 28, 2023
6058ca5
feat: add watermark (#6300)
aibayanyu20 Feb 28, 2023
a1e967d
refactor: watermark type
tangjinzhou Feb 28, 2023
f85485e
doc: add theme-editor
tangjinzhou Feb 28, 2023
eda7247
fix: inject value maybe undefined && tag style invalid (#6320)
zkwolf Feb 28, 2023
41a455f
feat: add qrcode (#6315)
selicens Mar 2, 2023
3f5f3ec
Feat v4 floatbutton (#6294)
shifeng1993 Mar 2, 2023
355c41b
refactor: qrcode #6315
tangjinzhou Mar 3, 2023
add208a
refactor: float-button
tangjinzhou Mar 3, 2023
a04cae1
fix: groupsize context error
tangjinzhou Mar 3, 2023
1d9a521
fix: floatbutton animation not work
tangjinzhou Mar 3, 2023
d241a06
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Mar 4, 2023
23a213a
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Mar 8, 2023
f429148
Feat v4 theme editor (#6348)
shifeng1993 Mar 12, 2023
dde2ff1
fix: token effect error
tangjinzhou Mar 12, 2023
f819a1b
Feat v4 theme editor (#6349)
shifeng1993 Mar 13, 2023
b22bd85
fix: cssinjs effect error
tangjinzhou Mar 13, 2023
77d0d18
doc: format code
tangjinzhou Mar 13, 2023
ad1d644
fix: tag click event not trigger
tangjinzhou Mar 13, 2023
fc7cadb
release 4.0.0-alpha.1
tangjinzhou Mar 13, 2023
27c5a6c
fix: qrcode type
tangjinzhou Mar 13, 2023
295c417
fix: remove not use file
tangjinzhou Mar 13, 2023
11c52d4
doc: update doc site
tangjinzhou Mar 14, 2023
f3935eb
doc: update site
tangjinzhou Mar 14, 2023
5cc85f3
doc: fix theme editor bgcolor (#6358)
shifeng1993 Mar 16, 2023
d95861a
fix: motion not work
tangjinzhou Mar 16, 2023
b1f38eb
release 4.0.0-alpha.2
tangjinzhou Mar 16, 2023
89314fb
fix: qrcode ; error, close #6362
tangjinzhou Mar 17, 2023
f265a7b
fix docs dark theme & add docs coverDark (#6367)
shifeng1993 Mar 20, 2023
3653f37
fix: dropdown divider disappear, close #6365 (#6369)
zkwolf Mar 20, 2023
7d1418d
doc: update baner
tangjinzhou Mar 20, 2023
dcc3bb1
fix: button wave not work
tangjinzhou Mar 20, 2023
4d2a37f
fix: ant-piker-cell-range-hover-end style error (#6373)
CCherry07 Mar 21, 2023
bfcbd5b
fix: ConfigProvider error for style, close #6368
tangjinzhou Mar 21, 2023
6d60eba
release 4.0.0-alpha.4
tangjinzhou Mar 21, 2023
9dbe035
style: add dark style for `pre` and `code` (#6382)
kovsu Mar 27, 2023
ae27d43
docs: version menu (#6390)
CCherry07 Mar 27, 2023
48ab5a2
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Apr 5, 2023
f6daa8d
Feat(DatePicker): increase presets prop (#6387)
CCherry07 Apr 5, 2023
5f1cb0d
fix: datepicker presets error #6387
tangjinzhou Apr 5, 2023
bf1e6fe
docs: update datepicker doc #6387
tangjinzhou Apr 5, 2023
b0125de
feat(Steps): add items prop and variants (#6406)
CCherry07 Apr 5, 2023
9a5cbee
docs: update site
tangjinzhou Apr 5, 2023
fbfec0a
refactor: steps #6406
tangjinzhou Apr 5, 2023
7198479
test: update steps
tangjinzhou Apr 5, 2023
3e46f27
perf: shallowRef instead ref
tangjinzhou Apr 5, 2023
84037f8
fix(Modal): fix modal locale (#6423)
ifSadEveryDay Apr 6, 2023
1151bda
feat(StyleProvider): add StyleProvider handle cssinjs features (#6415)
CCherry07 Apr 6, 2023
8a3ed32
docs: update compatiple #6415
tangjinzhou Apr 6, 2023
7db4265
feat(Progress): enhance size prop and add variants (#6409)
CCherry07 Apr 6, 2023
58998c4
fix: progress borderRadius reactive #6409
tangjinzhou Apr 6, 2023
2eaad16
fix(defaultConfigProvider): add getPopupContainer (#6425), close #6419
CCherry07 Apr 6, 2023
33d1553
fix: qrcode size error, close #6418
tangjinzhou Apr 6, 2023
0e1b7fd
release 4.0.0-alpha.4
tangjinzhou Apr 6, 2023
637656b
fix: picker import error
tangjinzhou Apr 6, 2023
bf97057
test: add QRCode unit testing (#6441)
selicens Apr 8, 2023
4e277ea
fix
shifeng1993 Apr 8, 2023
0b85b84
fix(badge): badge props count default value error (#6433)
Apr 8, 2023
be90b53
docs: update site responsive
tangjinzhou Apr 8, 2023
d4f2e97
fix: modal api method i18n not work, close #6438
tangjinzhou Apr 8, 2023
515ab9e
release 4.0.0-alpha.5
tangjinzhou Apr 8, 2023
2bf654d
chore(docs): update docs (#6446)
CCherry07 Apr 12, 2023
838aa71
fix: cssinjs compatibility (#6454)
shifeng1993 Apr 13, 2023
0683ede
feat: add convertLegacyToken
tangjinzhou Apr 21, 2023
118ae9a
docs: v4 vuedocs (#6468)
shifeng1993 Apr 21, 2023
de00607
feat: remove backtop
tangjinzhou Apr 21, 2023
8932aff
feat(anchor): add direction action (#6447)
CCherry07 Apr 21, 2023
bccd920
feat: anchor add customTitle slot #6447
tangjinzhou Apr 21, 2023
5376014
docs: update doc anchor
tangjinzhou Apr 21, 2023
b0990b7
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Apr 23, 2023
8ab50b1
feat(menu): icon support function components with items and update de…
CCherry07 Apr 23, 2023
760c4c2
doc: update menu icon
tangjinzhou Apr 23, 2023
eba8f6b
feat: menu items icon add arg
tangjinzhou Apr 23, 2023
678ec07
fix: antd.min error
tangjinzhou Apr 23, 2023
43009f0
release 4.0.0-alpha.6
tangjinzhou Apr 23, 2023
063c06f
fix: table resizable not work && type error (#6514)
shifeng1993 Apr 27, 2023
9be5807
Refactor(demo): change options to composition api (#6499)
CCherry07 Apr 28, 2023
5439e0c
fix: submenu type lose theme
tangjinzhou Apr 28, 2023
98be707
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Apr 28, 2023
61d6312
fix: dropdown menu hide error
tangjinzhou May 2, 2023
b103b75
fix: dealing with switching topics modal, notification, message does …
aibayanyu20 May 3, 2023
0df6abe
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou May 3, 2023
69640c0
feat(modal): add useModal (#6517)
CCherry07 May 3, 2023
5578c14
perf: useModal #6517
tangjinzhou May 3, 2023
db46965
release 4.0.0-beta.1
tangjinzhou May 3, 2023
ac93c47
docs: fix tab demo error
tangjinzhou May 3, 2023
b61c88e
fix(config-provider): fix ConfigProvider.config is not function close…
aibayanyu20 May 5, 2023
6eb4d8f
Feat(use): add useMessage useNotification (#6527)
CCherry07 May 5, 2023
02ed988
refactor: useMessage #6527
tangjinzhou May 5, 2023
feffe70
refactor: useNotification #6527
tangjinzhou May 5, 2023
fded418
release 4.0.0-beta.2
tangjinzhou May 5, 2023
9fdc297
docs(button): update demo with space (#6536)
CCherry07 May 7, 2023
fd8af23
docs(introduce): update docs (#6539)
CCherry07 May 7, 2023
266482d
docs(customize-theme): update docs (#6540)
shifeng1993 May 8, 2023
d933605
fix: getPopupContainer not work
tangjinzhou May 8, 2023
f2f7cfd
release 4.0.0-beta.3
tangjinzhou May 8, 2023
0d24755
release 4.0.0-beta.4
tangjinzhou May 8, 2023
8bf8515
docs: update grid docs (#6549)
aibayanyu20 May 11, 2023
149cedd
test(alert): update demo with space (#6541)
aibayanyu20 May 11, 2023
e49e72d
fix: components bug & update docs (#6548)
shifeng1993 May 14, 2023
3ed455b
docs(grid): update migrate docs && delete xxxl in grid docs (#6562)
aibayanyu20 May 14, 2023
a694167
fix: segmentd disabled label is undefined (#6556)
selicens May 14, 2023
4c8cc01
fix(grid): remove grid xxxl attribute (#6572)
aibayanyu20 May 16, 2023
21cf533
fix: tooltip custom color error
tangjinzhou May 16, 2023
db4148a
feat: remove Step __legacy
tangjinzhou May 17, 2023
698c0ff
feat: add tour (#6332)
shifeng1993 May 17, 2023
e5787c2
refactor: tour #6332
tangjinzhou May 17, 2023
429172b
fix: tour center
tangjinzhou May 17, 2023
5aad611
fix: picker support v-show
tangjinzhou May 17, 2023
28263bb
test: update snap
tangjinzhou May 17, 2023
1c7b7a3
test: update tour test
tangjinzhou May 17, 2023
8301726
fix: tour-mask attrs pointer-events (#6577)
shifeng1993 May 17, 2023
c36f7e7
fix: tour animated
tangjinzhou May 17, 2023
03760e3
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou May 18, 2023
c9f0841
feat: support vue 3.3 slot type
tangjinzhou May 18, 2023
1d0a273
release 4.0.0-rc.1
tangjinzhou May 19, 2023
d490820
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou May 19, 2023
d3d37f0
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou May 20, 2023
96f940d
release 4.0.0-rc.2, close #6588
tangjinzhou May 20, 2023
64b9347
4.0.0-rc.3
tangjinzhou May 20, 2023
fe3c2bd
chore: remove vue private api
tangjinzhou May 20, 2023
508e8e3
fix: paginantion error, close #6590
tangjinzhou May 23, 2023
42cb687
release 4.0.0-rc.4
tangjinzhou May 23, 2023
2bf8599
fix: checxbox style
tangjinzhou May 25, 2023
afb2619
fix: pagination mini size style
tangjinzhou May 25, 2023
45ede08
release 4.0.0-rc.5
tangjinzhou May 25, 2023
6be947a
docs: update v4 tabs doc error(#6606) (#6607)
selicens Jun 1, 2023
6f032c9
docs: add ant-design-vue nuxt module (#6620)
aibayanyu20 Jun 1, 2023
19f0aea
fix: layout-sider and menu transition style(#6637) (#6640)
selicens Jun 12, 2023
7270855
docs: fixed the style error of online demo (#6630)
valcosmos Jun 12, 2023
58f6d6e
Merge remote-tracking branch 'origin/main' into feat-v4
tangjinzhou Jun 15, 2023
afc1b84
feat: ✨checkbox label slot support use option label (#6642)
waldonUB Jun 15, 2023
308c30c
fix: add disabledContext override with form components (#6618)
CCherry07 Jun 15, 2023
6861a77
fix(tour): target position (#6629)
shifeng1993 Jun 15, 2023
9c26ab0
style: format lint
tangjinzhou Jun 15, 2023
1015994
docs(form): add form disabled demo (#6658)
selicens Jun 15, 2023
e229248
fix: comment node error
tangjinzhou Jun 15, 2023
7fd0e4a
release 4.0
tangjinzhou Jun 15, 2023
e9d26f2
fix: portalWrapper add autoLock prop (#6687), close #6649
CCherry07 Jun 24, 2023
994707b
fix: image animation & zindex, close #6675
tangjinzhou Jun 25, 2023
fc5181d
docs(QRCode): Synchronize QR code demonstration and add SVG (#6660)
selicens Jun 28, 2023
2ce4e7d
feat: calendar select support info.source param (#6697)
aibayanyu20 Jul 3, 2023
f70b04c
docs: synchronous config-provider demo (#6706)
selicens Jul 3, 2023
058e8ec
revert: #6706
tangjinzhou Jul 3, 2023
8b5d716
docs: export space-compact types (#6716)
PanStar Jul 14, 2023
10f990d
release 4.0.0
tangjinzhou Jul 14, 2023
0a738a3
Merge branch 'main' into feat-v4
tangjinzhou Jul 14, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
183 changes: 12 additions & 171 deletions .antd-tools.config.js
Original file line number Diff line number Diff line change
@@ -1,195 +1,36 @@
const fs = require('fs');
const path = require('path');
const defaultVars = require('./scripts/default-vars');
const darkVars = require('./scripts/dark-vars');
const compactVars = require('./scripts/compact-vars');

function generateThemeFileContent(theme) {
return `const { ${theme}ThemeSingle } = require('./theme');\nconst defaultTheme = require('./default-theme');\n
module.exports = {
...defaultTheme,
...${theme}ThemeSingle
}`;
}
const restCssPath = path.join(process.cwd(), 'components', 'style', 'reset.css');
const tokenStatisticPath = path.join(process.cwd(), 'components', 'version', 'token.json');
const tokenMetaPath = path.join(process.cwd(), 'components', 'version', 'token-meta.json');

// We need compile additional content for antd user
function finalizeCompile() {
if (fs.existsSync(path.join(__dirname, './lib'))) {
// Build a entry less file to dist/antd.less
const componentsPath = path.join(process.cwd(), 'components');
let componentsLessContent = '';
// Build components in one file: lib/style/components.less
fs.readdir(componentsPath, (err, files) => {
files.forEach(file => {
if (fs.existsSync(path.join(componentsPath, file, 'style', 'index.less'))) {
componentsLessContent += `@import "../${path.posix.join(
file,
'style',
'index-pure.less',
)}";\n`;
}
});
fs.writeFileSync(
path.join(process.cwd(), 'lib', 'style', 'components.less'),
componentsLessContent,
);
});
if (fs.existsSync(path.join(__dirname, './es'))) {
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'es', 'style', 'reset.css'));
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'es', 'version', 'token.json'));
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'es', 'version', 'token-meta.json'));
}
}

function buildThemeFile(theme, vars) {
// Build less entry file: dist/antd.${theme}.less
if (theme !== 'default') {
fs.writeFileSync(
path.join(process.cwd(), 'dist', `antd.${theme}.less`),
`@import "../lib/style/${theme}.less";\n@import "../lib/style/components.less";`,
);
// eslint-disable-next-line no-console
console.log(`Built a entry less file to dist/antd.${theme}.less`);
} else {
fs.writeFileSync(
path.join(process.cwd(), 'dist', `default-theme.js`),
`module.exports = ${JSON.stringify(vars, null, 2)};\n`,
);
return;
if (fs.existsSync(path.join(__dirname, './lib'))) {
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'lib', 'style', 'reset.css'));
fs.copyFileSync(tokenStatisticPath, path.join(process.cwd(), 'lib', 'version', 'token.json'));
fs.copyFileSync(tokenMetaPath, path.join(process.cwd(), 'lib', 'version', 'token-meta.json'));
}

// Build ${theme}.js: dist/${theme}-theme.js, for less-loader

fs.writeFileSync(
path.join(process.cwd(), 'dist', `theme.js`),
`const ${theme}ThemeSingle = ${JSON.stringify(vars, null, 2)};\n`,
{
flag: 'a',
},
);

fs.writeFileSync(
path.join(process.cwd(), 'dist', `${theme}-theme.js`),
generateThemeFileContent(theme),
);

// eslint-disable-next-line no-console
console.log(`Built a ${theme} theme js file to dist/${theme}-theme.js`);
}

function finalizeDist() {
if (fs.existsSync(path.join(__dirname, './dist'))) {
// Build less entry file: dist/antd.less
fs.writeFileSync(
path.join(process.cwd(), 'dist', 'antd.less'),
'@import "../lib/style/default.less";\n@import "../lib/style/components.less";',
);
// eslint-disable-next-line no-console
fs.writeFileSync(
path.join(process.cwd(), 'dist', 'theme.js'),
`const defaultTheme = require('./default-theme.js');\n`,
);
// eslint-disable-next-line no-console
console.log('Built a entry less file to dist/antd.less');
buildThemeFile('default', defaultVars);
buildThemeFile('dark', darkVars);
buildThemeFile('compact', compactVars);
buildThemeFile('variable', {});
fs.writeFileSync(
path.join(process.cwd(), 'dist', `theme.js`),
`
function getThemeVariables(options = {}) {
let themeVar = {
'hack': \`true;@import "\${require.resolve('ant-design-vue/lib/style/color/colorPalette.less')}";\`,
...defaultTheme
};
if(options.dark) {
themeVar = {
...themeVar,
...darkThemeSingle
}
}
if(options.compact){
themeVar = {
...themeVar,
...compactThemeSingle
}
fs.copyFileSync(restCssPath, path.join(process.cwd(), 'dist', 'reset.css'));
}
return themeVar;
}

module.exports = {
darkThemeSingle,
compactThemeSingle,
getThemeVariables
}`,
{
flag: 'a',
},
);
}
}

function isComponentStyleEntry(file) {
return file.path.match(/style(\/|\\)index\.tsx/);
}

function needTransformStyle(content) {
return content.includes('../../style/index.less') || content.includes('./index.less');
}

module.exports = {
compile: {
includeLessFile: [/(\/|\\)components(\/|\\)style(\/|\\)default.less$/],
transformTSFile(file) {
if (isComponentStyleEntry(file)) {
let content = file.contents.toString();

if (needTransformStyle(content)) {
const cloneFile = file.clone();

// Origin
content = content.replace('../../style/index.less', '../../style/default.less');
cloneFile.contents = Buffer.from(content);

return cloneFile;
}
}
},
transformFile(file) {
if (isComponentStyleEntry(file)) {
const indexLessFilePath = file.path.replace('index.tsx', 'index.less');

if (fs.existsSync(indexLessFilePath)) {
// We put origin `index.less` file to `index-pure.less`
const pureFile = file.clone();
pureFile.contents = Buffer.from(fs.readFileSync(indexLessFilePath, 'utf8'));
pureFile.path = pureFile.path.replace('index.tsx', 'index-pure.less');

// Rewrite `index.less` file with `root-entry-name`
const indexLessFile = file.clone();
indexLessFile.contents = Buffer.from(
[
// Inject variable
'@root-entry-name: default;',
// Point to origin file
"@import './index-pure.less';",
].join('\n\n'),
);
indexLessFile.path = indexLessFile.path.replace('index.tsx', 'index.less');

return [indexLessFile, pureFile];
}
}

return [];
},
lessConfig: {
modifyVars: {
'root-entry-name': 'default',
},
},
finalize: finalizeCompile,
},
dist: {
finalize: finalizeDist,
},
generateThemeFileContent,
bail: true,
};
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jspm_packages/
dist
lib
es
/locale
_site
yarn.lock
package-lock.json
Expand All @@ -78,5 +79,8 @@ report.html

site/src/router/demoRoutes.js

components/version/version.ts
components/version/version.tsx
components/version/token.json
components/version/token-meta.json
~component-api.json
9 changes: 3 additions & 6 deletions .jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ function getTestRegex(libDir) {
module.exports = {
verbose: true,
setupFiles: ['./tests/setup.js'],
setupFilesAfterEnv: ['./tests/setupAfterEnv.ts'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'vue', 'md', 'jpg'],
modulePathIgnorePatterns: ['/_site/'],
testPathIgnorePatterns: testPathIgnorePatterns,
Expand All @@ -30,23 +31,19 @@ module.exports = {
testRegex: getTestRegex(libDir),
moduleNameMapper: {
'^@/(.*)$/': '<rootDir>/$1',
'ant-design-vue$/': '<rootDir>/components/index.ts',
'ant-design-vue/es/': '<rootDir>/components',
'^ant-design-vue$': '<rootDir>/components/index',
'^ant-design-vue/es/(.*)$': '<rootDir>/components/$1',
},
snapshotSerializers: ['<rootDir>/node_modules/jest-serializer-vue'],
collectCoverage: process.env.COVERAGE === 'true',
collectCoverageFrom: [
'components/**/*.{js,jsx,vue}',
'!components/*/style/index.{js,jsx}',
'!components/style/*.{js,jsx}',
'!components/*/locale/*.{js,jsx}',
'!components/*/__tests__/**/type.{js,jsx}',
'!components/vc-*/**/*',
'!components/*/demo/**/*',
'!components/_util/**/*',
'!components/align/**/*',
'!components/trigger/**/*',
'!components/style.js',
'!**/node_modules/**',
],
testEnvironment: 'jsdom',
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ yarn-error.log
.editorconfig
.eslintignore
**/*.yml
components/style/color/*.less
**/assets
.gitattributes
.stylelintrc
Expand Down
41 changes: 34 additions & 7 deletions .stylelintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,40 @@
"stylelint-config-rational-order",
"stylelint-config-prettier"
],
"plugins": ["stylelint-order", "stylelint-declaration-block-no-ignored-properties"],
"customSyntax": "postcss-less",
"plugins": ["stylelint-declaration-block-no-ignored-properties"],
"rules": {
"comment-empty-line-before": null,
"function-name-case": ["lower", { "ignoreFunctions": ["/colorPalette/"] }],
"no-invalid-double-slash-comments": null,
"function-name-case": ["lower"],
"function-no-unknown": [
true,
{
"ignoreFunctions": [
"fade",
"fadeout",
"tint",
"darken",
"ceil",
"fadein",
"floor",
"unit",
"shade",
"lighten",
"percentage",
"-"
]
}
],
"import-notation": null,
"no-descending-specificity": null,
"declaration-empty-line-before": null
},
"ignoreFiles": ["components/style/color/{bezierEasing,colorPalette,tinyColor}.less"]
"no-invalid-position-at-import-rule": null,
"declaration-empty-line-before": null,
"keyframes-name-pattern": null,
"custom-property-pattern": null,
"number-max-precision": 8,
"alpha-value-notation": "number",
"color-function-notation": "legacy",
"selector-class-pattern": null,
"selector-id-pattern": null,
"selector-not-notation": null
}
}
Loading