-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Revert "Feat no hook 2 (#1189)"
This reverts commit 44c4edf.
- Loading branch information
Showing
459 changed files
with
8,089 additions
and
7,010 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
51 changes: 17 additions & 34 deletions
51
compiled/alipay/demo/pages/Calendar/collapse-container/cn-day/cn-day.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
}, | ||
}); |
41 changes: 15 additions & 26 deletions
41
compiled/alipay/demo/pages/Calendar/collapse-container/collapse-container.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
}); | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"component": true, | ||
"lazyCodeLoading": "renderedComponents" | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"component": true, | ||
"lazyCodeLoading": "renderedComponents" | ||
"component": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
{ | ||
"component": true, | ||
"lazyCodeLoading": "renderedComponents" | ||
"component": true | ||
} |
Oops, something went wrong.