|
|
|
@@ -81,7 +81,7 @@
|
|
|
|
|
/******/
|
|
|
|
|
/******/
|
|
|
|
|
/******/ // Load entry module and return exports
|
|
|
|
|
/******/ return __webpack_require__(__webpack_require__.s = "./step1-07/src/index.tsx");
|
|
|
|
|
/******/ return __webpack_require__(__webpack_require__.s = "./step1-07/final/src/index.tsx");
|
|
|
|
|
/******/ })
|
|
|
|
|
/************************************************************************/
|
|
|
|
|
/******/ ({
|
|
|
|
@@ -229,75 +229,75 @@ eval("var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn th
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/TodoApp.tsx":
|
|
|
|
|
/*!**********************************!*\
|
|
|
|
|
!*** ./step1-07/src/TodoApp.tsx ***!
|
|
|
|
|
\**********************************/
|
|
|
|
|
/***/ "./step1-07/final/src/TodoApp.tsx":
|
|
|
|
|
/*!****************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/TodoApp.tsx ***!
|
|
|
|
|
\****************************************/
|
|
|
|
|
/*! exports provided: TodoApp */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoApp\", function() { return TodoApp; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_TodoFooter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/TodoFooter */ \"./step1-07/src/components/TodoFooter.tsx\");\n/* harmony import */ var _components_TodoHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/TodoHeader */ \"./step1-07/src/components/TodoHeader.tsx\");\n/* harmony import */ var _components_TodoList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/TodoList */ \"./step1-07/src/components/TodoList.tsx\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\nvar index = 0;\nvar TodoApp = /** @class */ (function (_super) {\n __extends(TodoApp, _super);\n function TodoApp(props) {\n var _this = _super.call(this, props) || this;\n _this._addTodo = function (label) {\n var _a;\n var todos = _this.state.todos;\n var id = index++;\n _this.setState({\n todos: __assign({}, todos, (_a = {}, _a[id] = { label: label, completed: false }, _a))\n });\n };\n _this._remove = function (id) {\n var newTodos = __assign({}, _this.state.todos);\n delete newTodos[id];\n _this.setState({\n todos: newTodos\n });\n };\n _this._complete = function (id) {\n var newTodos = __assign({}, _this.state.todos);\n newTodos[id].completed = !newTodos[id].completed;\n _this.setState({\n todos: newTodos\n });\n };\n _this._edit = function (id, label) {\n var newTodos = __assign({}, _this.state.todos);\n newTodos[id] = __assign({}, newTodos[id], { label: label });\n _this.setState({\n todos: newTodos\n });\n };\n _this._clear = function () {\n var todos = _this.state.todos;\n var newTodos = {};\n Object.keys(_this.state.todos).forEach(function (id) {\n if (!todos[id].completed) {\n newTodos[id] = todos[id];\n }\n });\n _this.setState({\n todos: newTodos\n });\n };\n _this._setFilter = function (filter) {\n _this.setState({\n filter: filter\n });\n };\n _this.state = {\n todos: {},\n filter: 'all'\n };\n return _this;\n }\n TodoApp.prototype.render = function () {\n var _a = this.state, filter = _a.filter, todos = _a.todos;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoHeader__WEBPACK_IMPORTED_MODULE_2__[\"TodoHeader\"], { addTodo: this._addTodo, setFilter: this._setFilter, filter: filter }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoList__WEBPACK_IMPORTED_MODULE_3__[\"TodoList\"], { complete: this._complete, todos: todos, filter: filter }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoFooter__WEBPACK_IMPORTED_MODULE_1__[\"TodoFooter\"], { clear: this._clear, todos: todos })));\n };\n return TodoApp;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/src/TodoApp.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoApp\", function() { return TodoApp; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _components_TodoFooter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/TodoFooter */ \"./step1-07/final/src/components/TodoFooter.tsx\");\n/* harmony import */ var _components_TodoHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/TodoHeader */ \"./step1-07/final/src/components/TodoHeader.tsx\");\n/* harmony import */ var _components_TodoList__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/TodoList */ \"./step1-07/final/src/components/TodoList.tsx\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\nvar index = 0;\nvar TodoApp = /** @class */ (function (_super) {\n __extends(TodoApp, _super);\n function TodoApp(props) {\n var _this = _super.call(this, props) || this;\n // business logic\n _this._addTodo = function (label) {\n var _a;\n var todos = _this.state.todos;\n var id = index++;\n _this.setState({\n todos: __assign({}, todos, (_a = {}, _a[id] = { label: label, completed: false }, _a))\n });\n };\n _this._complete = function (id) {\n var newTodos = __assign({}, _this.state.todos);\n newTodos[id].completed = !newTodos[id].completed;\n _this.setState({\n todos: newTodos\n });\n };\n _this._clear = function () {\n var todos = _this.state.todos;\n var newTodos = {};\n Object.keys(_this.state.todos).forEach(function (id) {\n if (!todos[id].completed) {\n newTodos[id] = todos[id];\n }\n });\n _this.setState({\n todos: newTodos\n });\n };\n _this._setFilter = function (filter) {\n _this.setState({\n filter: filter\n });\n };\n _this.state = {\n todos: {},\n filter: 'all'\n };\n return _this;\n }\n TodoApp.prototype.render = function () {\n var _a = this.state, filter = _a.filter, todos = _a.todos;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoHeader__WEBPACK_IMPORTED_MODULE_2__[\"TodoHeader\"], { addTodo: this._addTodo, setFilter: this._setFilter, filter: filter }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoList__WEBPACK_IMPORTED_MODULE_3__[\"TodoList\"], { complete: this._complete, todos: todos, filter: filter }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_components_TodoFooter__WEBPACK_IMPORTED_MODULE_1__[\"TodoFooter\"], { clear: this._clear, todos: todos })));\n };\n return TodoApp;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/final/src/TodoApp.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/components/TodoFooter.tsx":
|
|
|
|
|
/*!************************************************!*\
|
|
|
|
|
!*** ./step1-07/src/components/TodoFooter.tsx ***!
|
|
|
|
|
\************************************************/
|
|
|
|
|
/***/ "./step1-07/final/src/components/TodoFooter.tsx":
|
|
|
|
|
/*!******************************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/components/TodoFooter.tsx ***!
|
|
|
|
|
\******************************************************/
|
|
|
|
|
/*! exports provided: TodoFooter */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoFooter\", function() { return TodoFooter; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar TodoFooter = function (props) {\n var itemCount = Object.keys(props.todos).filter(function (id) { return !props.todos[id].completed; }).length;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"footer\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null,\n itemCount,\n \" item\",\n itemCount > 1 ? 's' : '',\n \" left\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return props.clear(); }, className: \"button\" }, \"Clear Completed\")));\n};\n\n\n//# sourceURL=webpack:///./step1-07/src/components/TodoFooter.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoFooter\", function() { return TodoFooter; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n\nvar TodoFooter = function (props) {\n var itemCount = Object.keys(props.todos).filter(function (id) { return !props.todos[id].completed; }).length;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"footer\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"span\", null,\n itemCount,\n \" item\",\n itemCount > 1 ? 's' : '',\n \" left\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return props.clear(); }, className: \"submit\" }, \"Clear Completed\")));\n};\n\n\n//# sourceURL=webpack:///./step1-07/final/src/components/TodoFooter.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/components/TodoHeader.tsx":
|
|
|
|
|
/*!************************************************!*\
|
|
|
|
|
!*** ./step1-07/src/components/TodoHeader.tsx ***!
|
|
|
|
|
\************************************************/
|
|
|
|
|
/***/ "./step1-07/final/src/components/TodoHeader.tsx":
|
|
|
|
|
/*!******************************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/components/TodoHeader.tsx ***!
|
|
|
|
|
\******************************************************/
|
|
|
|
|
/*! exports provided: TodoHeader */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoHeader\", function() { return TodoHeader; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar TodoHeader = /** @class */ (function (_super) {\n __extends(TodoHeader, _super);\n function TodoHeader(props) {\n var _this = _super.call(this, props) || this;\n _this._onChange = function (evt) {\n _this.setState({ labelInput: evt.target.value });\n };\n _this._onAdd = function () {\n _this.props.addTodo(_this.state.labelInput);\n _this.setState({ labelInput: '' });\n };\n _this.state = { labelInput: '' };\n return _this;\n }\n TodoHeader.prototype.render = function () {\n var _a = this.props, filter = _a.filter, setFilter = _a.setFilter;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h1\", null, \"todos\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", { value: this.state.labelInput, onChange: this._onChange, className: \"textfield\", placeholder: \"add todo\" }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: this._onAdd, className: \"button add\" }, \"Add\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", { className: \"filter\" },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('all'); }, className: filter == 'all' ? 'active' : '' }, \"all\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('active'); }, className: filter == 'active' ? 'active' : '' }, \"active\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('completed'); }, className: filter == 'completed' ? 'active' : '' }, \"completed\"))));\n };\n return TodoHeader;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/src/components/TodoHeader.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoHeader\", function() { return TodoHeader; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar TodoHeader = /** @class */ (function (_super) {\n __extends(TodoHeader, _super);\n function TodoHeader(props) {\n var _this = _super.call(this, props) || this;\n _this._onChange = function (evt) {\n _this.setState({ labelInput: evt.target.value });\n };\n _this._onAdd = function () {\n _this.props.addTodo(_this.state.labelInput);\n _this.setState({ labelInput: '' });\n };\n _this.state = { labelInput: '' };\n return _this;\n }\n TodoHeader.prototype.render = function () {\n var _a = this.props, filter = _a.filter, setFilter = _a.setFilter;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"header\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"h1\", null, \"todos\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"div\", { className: \"addTodo\" },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", { value: this.state.labelInput, onChange: this._onChange, className: \"textfield\", placeholder: \"add todo\" }),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: this._onAdd, className: \"submit\" }, \"Add\")),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"nav\", { className: \"filter\" },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('all'); }, className: filter == 'all' ? 'completed' : '' }, \"all\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('active'); }, className: filter == 'active' ? 'completed' : '' }, \"active\"),\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"button\", { onClick: function () { return setFilter('completed'); }, className: filter == 'completed' ? 'completed' : '' }, \"completed\"))));\n };\n return TodoHeader;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/final/src/components/TodoHeader.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/components/TodoList.tsx":
|
|
|
|
|
/*!**********************************************!*\
|
|
|
|
|
!*** ./step1-07/src/components/TodoList.tsx ***!
|
|
|
|
|
\**********************************************/
|
|
|
|
|
/***/ "./step1-07/final/src/components/TodoList.tsx":
|
|
|
|
|
/*!****************************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/components/TodoList.tsx ***!
|
|
|
|
|
\****************************************************/
|
|
|
|
|
/*! exports provided: TodoList */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoList\", function() { return TodoList; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TodoListItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TodoListItem */ \"./step1-07/src/components/TodoListItem.tsx\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar TodoList = /** @class */ (function (_super) {\n __extends(TodoList, _super);\n function TodoList() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TodoList.prototype.render = function () {\n var _a = this.props, filter = _a.filter, todos = _a.todos, complete = _a.complete;\n var filteredTodos = Object.keys(todos).filter(function (id) {\n return filter === 'all' || (filter === 'completed' && todos[id].completed) || (filter === 'active' && !todos[id].completed);\n });\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", { className: \"todos\" }, filteredTodos.map(function (id) { return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TodoListItem__WEBPACK_IMPORTED_MODULE_1__[\"TodoListItem\"], __assign({ key: id, id: id, complete: complete }, todos[id]))); })));\n };\n return TodoList;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/src/components/TodoList.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoList\", function() { return TodoList; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _TodoListItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TodoListItem */ \"./step1-07/final/src/components/TodoListItem.tsx\");\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (undefined && undefined.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar TodoList = /** @class */ (function (_super) {\n __extends(TodoList, _super);\n function TodoList() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TodoList.prototype.render = function () {\n var _a = this.props, filter = _a.filter, todos = _a.todos, complete = _a.complete;\n var filteredTodos = Object.keys(todos).filter(function (id) {\n return filter === 'all' || (filter === 'completed' && todos[id].completed) || (filter === 'active' && !todos[id].completed);\n });\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"ul\", { className: \"todos\" }, filteredTodos.map(function (id) { return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TodoListItem__WEBPACK_IMPORTED_MODULE_1__[\"TodoListItem\"], __assign({ key: id, id: id, complete: complete }, todos[id]))); })));\n };\n return TodoList;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/final/src/components/TodoList.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/components/TodoListItem.tsx":
|
|
|
|
|
/*!**************************************************!*\
|
|
|
|
|
!*** ./step1-07/src/components/TodoListItem.tsx ***!
|
|
|
|
|
\**************************************************/
|
|
|
|
|
/***/ "./step1-07/final/src/components/TodoListItem.tsx":
|
|
|
|
|
/*!********************************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/components/TodoListItem.tsx ***!
|
|
|
|
|
\********************************************************/
|
|
|
|
|
/*! exports provided: TodoListItem */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoListItem\", function() { return TodoListItem; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar TodoListItem = /** @class */ (function (_super) {\n __extends(TodoListItem, _super);\n function TodoListItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TodoListItem.prototype.render = function () {\n var _a = this.props, label = _a.label, completed = _a.completed, complete = _a.complete, id = _a.id;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", { className: \"todo\" },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", { type: \"checkbox\", checked: completed, onChange: function () { return complete(id); } }),\n \" \",\n label)));\n };\n return TodoListItem;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/src/components/TodoListItem.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TodoListItem\", function() { return TodoListItem; });\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\nvar __extends = (undefined && undefined.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\n\nvar TodoListItem = /** @class */ (function (_super) {\n __extends(TodoListItem, _super);\n function TodoListItem() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n TodoListItem.prototype.render = function () {\n var _a = this.props, label = _a.label, completed = _a.completed, complete = _a.complete, id = _a.id;\n return (react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"li\", { className: \"todo\" },\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"label\", null,\n react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(\"input\", { type: \"checkbox\", checked: completed, onChange: function () { return complete(id); } }),\n \" \",\n label)));\n };\n return TodoListItem;\n}(react__WEBPACK_IMPORTED_MODULE_0___default.a.Component));\n\n\n\n//# sourceURL=webpack:///./step1-07/final/src/components/TodoListItem.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
|
|
/***/ "./step1-07/src/index.tsx":
|
|
|
|
|
/*!********************************!*\
|
|
|
|
|
!*** ./step1-07/src/index.tsx ***!
|
|
|
|
|
\********************************/
|
|
|
|
|
/***/ "./step1-07/final/src/index.tsx":
|
|
|
|
|
/*!**************************************!*\
|
|
|
|
|
!*** ./step1-07/final/src/index.tsx ***!
|
|
|
|
|
\**************************************/
|
|
|
|
|
/*! no exports provided */
|
|
|
|
|
/***/ (function(module, __webpack_exports__, __webpack_require__) {
|
|
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _TodoApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TodoApp */ \"./step1-07/src/TodoApp.tsx\");\n\n\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TodoApp__WEBPACK_IMPORTED_MODULE_2__[\"TodoApp\"], null), document.getElementById('app'));\n\n\n//# sourceURL=webpack:///./step1-07/src/index.tsx?");
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ \"./node_modules/react/index.js\");\n/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-dom */ \"./node_modules/react-dom/index.js\");\n/* harmony import */ var react_dom__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react_dom__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _TodoApp__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TodoApp */ \"./step1-07/final/src/TodoApp.tsx\");\n\n\n\nreact_dom__WEBPACK_IMPORTED_MODULE_1___default.a.render(react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement(_TodoApp__WEBPACK_IMPORTED_MODULE_2__[\"TodoApp\"], null), document.getElementById('app'));\n\n\n//# sourceURL=webpack:///./step1-07/final/src/index.tsx?");
|
|
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|