Skip to content

Commit

Permalink
feat: Revert "Feat no hook 2 (#1189)"
Browse files Browse the repository at this point in the history
This reverts commit 44c4edf.
  • Loading branch information
rayhomie committed Jun 14, 2024
1 parent 5436281 commit 2d3a009
Show file tree
Hide file tree
Showing 459 changed files with 8,089 additions and 7,010 deletions.
14 changes: 0 additions & 14 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,8 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [2.33.0](https://github.com/ant-design/ant-design-mini/compare/2.32.0...2.33.0)

#### [2.32.0](https://github.com/ant-design/ant-design-mini/compare/2.31.2...2.32.0)

- Detele functional mini [`#1204`](https://github.com/ant-design/ant-design-mini/pull/1204)
- feat: calendar组件去掉hook实现 [`#1201`](https://github.com/ant-design/ant-design-mini/pull/1201)
- feat: notice-bar微信版本支持icon插槽 [`#1196`](https://github.com/ant-design/ant-design-mini/pull/1196)
- Feat no hook picker [`#1199`](https://github.com/ant-design/ant-design-mini/pull/1199)
- feat: lazy component [`#1197`](https://github.com/ant-design/ant-design-mini/pull/1197)
- Feat no hook picker [`#1192`](https://github.com/ant-design/ant-design-mini/pull/1192)
- Feat no hook 2 [`#1189`](https://github.com/ant-design/ant-design-mini/pull/1189)

#### [2.31.2](https://github.com/ant-design/ant-design-mini/compare/2.31.1...2.31.2)

> 16 May 2024
#### [2.31.1](https://github.com/ant-design/ant-design-mini/compare/2.31.0...2.31.1)

> 16 May 2024
Expand Down
Original file line number Diff line number Diff line change
@@ -1,38 +1,21 @@
import dayjs from 'dayjs';
import equal from 'fast-deep-equal';
import Converter from './js-calendar-converter';
import { Component, getValueFromProps } from '../../../../../src/_util/simply';
Component({
import { mountComponent } from '../../../../../src/_util/component';
const CollapseContainer = (props) => {
var _a, _b, _c;
const time = dayjs((_a = props.cell) === null || _a === void 0 ? void 0 : _a.time);
const vs = Converter.solar2lunar(time.get('year'), time.get('month') + 1, time.get('date'));
if (vs === -1) {
return {
cnday: '',
};
}
return {
cnday: vs.lunarFestival || vs.festival || vs.IDayCn,
festival: !!vs.festival || !!vs.lunarFestival,
unset: ((_b = props.cell) === null || _b === void 0 ? void 0 : _b.isSelectedBegin) || ((_c = props.cell) === null || _c === void 0 ? void 0 : _c.isSelectedEnd),
};
};
mountComponent(CollapseContainer, {
cell: null,
}, {
updateData() {
const cell = getValueFromProps(this, 'cell');
const time = dayjs(cell === null || cell === void 0 ? void 0 : cell.time);
const vs = Converter.solar2lunar(time.get('year'), time.get('month') + 1, time.get('date'));
if (vs === -1) {
this.setData({
cnday: '',
});
return;
}
this.setData({
cnday: vs.lunarFestival || vs.festival || vs.IDayCn,
festival: !!vs.festival || !!vs.lunarFestival,
unset: (cell === null || cell === void 0 ? void 0 : cell.isSelectedBegin) || (cell === null || cell === void 0 ? void 0 : cell.isSelectedEnd),
});
},
}, {
cnday: '',
festival: '',
unset: '',
}, null, {
onInit() {
this.updateData();
},
didUpdate(prevProps) {
const cell = getValueFromProps(this, 'cell');
if (!equal(prevProps.cell, cell)) {
this.updateData();
}
},
});
Original file line number Diff line number Diff line change
@@ -1,30 +1,19 @@
import { Component, getValueFromProps } from '../../../../src/_util/simply';
Component({
import { useEvent, useState } from 'functional-mini/component';
import { mountComponent } from '../../../../src/_util/component';
const CollapseContainer = (props) => {
var _a;
const [collapse, setCollapse] = useState((_a = props.defaultCollapse) !== null && _a !== void 0 ? _a : true);
useEvent('handleToggle', () => {
setCollapse((v) => !v);
});
return {
collapse,
internalHide: props.hide,
containerTitle: props.title,
};
};
mountComponent(CollapseContainer, {
hide: false,
defaultCollapse: null,
title: '',
}, {
handleToggle() {
const { collapse } = this.data;
this.setData({
collapse: !collapse,
});
},
}, {
collapse: true,
internalHide: false,
containerTitle: '',
}, null, {
onInit() {
const [defaultCollapse, hide, title] = getValueFromProps(this, [
'defaultCollapse',
'hide',
'title',
]);
this.setData({
collapse: defaultCollapse !== null && defaultCollapse !== void 0 ? defaultCollapse : true,
internalHide: hide,
containerTitle: title,
});
},
});
1 change: 0 additions & 1 deletion compiled/alipay/src/ActionSheet/index.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"component": true,
"lazyCodeLoading": "renderedComponents",
"usingComponents": {
"ant-popup": "../Popup/index"
}
Expand Down
3 changes: 1 addition & 2 deletions compiled/alipay/src/Avatar/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"component": true,
"lazyCodeLoading": "renderedComponents"
"component": true
}
3 changes: 1 addition & 2 deletions compiled/alipay/src/Badge/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"component": true,
"lazyCodeLoading": "renderedComponents"
"component": true
}
1 change: 0 additions & 1 deletion compiled/alipay/src/Button/index.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"component": true,
"lazyCodeLoading": "renderedComponents",
"usingComponents": {
"loading": "../Loading/index",
"ant-icon": "../Icon/index"
Expand Down
3 changes: 1 addition & 2 deletions compiled/alipay/src/Calendar/index.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
{
"component": true,
"lazyCodeLoading": "renderedComponents"
"component": true
}
Loading

0 comments on commit 2d3a009

Please sign in to comment.