Commit 01d139c3b53ebbe7062060e1abdefed7e7a7b547
1 parent
02b41190
feat(space): 实现组件
Showing
13 changed files
with
143 additions
and
33 deletions
Show diff stats
build/Space/Space.html
1 | -<div ng-class="'es-space es-space-align-center'+(direction==='vertical'?' es-space-vertical':'')" ng-style="{gap:size+'px'}" ng-transclude></div> | |
2 | 1 | \ No newline at end of file |
2 | +<div ng-class="'ant-space ant-space-'+state.direction+' ant-space-align-center'" ng-style="{gap:state.size+'px'}"></div> | |
3 | 3 | \ No newline at end of file | ... | ... |
build/Space/Space.js
1 | -angular.module("esNgAntd").directive("esSpace", function () { | |
1 | +import template from "./Space.html"; | |
2 | +import style from "antd/lib/space/style/index.css"; | |
3 | +angular.module("esNgAntd").directive("esSpace", function (esNgAntd) { | |
2 | 4 | return { |
3 | 5 | controllerAs: "esSpace", |
4 | 6 | restrict: "E", |
... | ... | @@ -8,16 +10,36 @@ angular.module("esNgAntd").directive("esSpace", function () { |
8 | 10 | direction: "@", |
9 | 11 | size: "@", |
10 | 12 | }, |
13 | + template: template, | |
14 | + controller: function ($scope, $element, $attrs) { | |
15 | + this.getContext = function () { | |
16 | + return $scope; | |
17 | + }; | |
18 | + | |
19 | + $scope.state = { | |
20 | + direction: $scope.direction || "horizontal", | |
21 | + size: $scope.size || 8, | |
22 | + }; | |
23 | + }, | |
11 | 24 | link: function ($scope, $element, $attrs, $controllers, $transclude) { |
12 | - let childrens = $elements.children(); | |
13 | - $elements.empty(); | |
14 | - angular.forEach(childrens, (element, index) => { | |
15 | - let item = angular | |
16 | - .element("<div>") | |
17 | - .addClass("es-space-item") | |
18 | - .append(element); | |
19 | - $elements.append(item); | |
20 | - }); | |
25 | + esNgAntd.createStyle("ant-space", style); | |
26 | + $element.removeAttr("ng-class"); | |
27 | + $element.removeAttr("ng-style"); | |
28 | + let childrens = $transclude(); | |
29 | + | |
30 | + for (const key in childrens) { | |
31 | + if (Object.hasOwnProperty.call(childrens, key)) { | |
32 | + const children = childrens[key]; | |
33 | + | |
34 | + if (children.nodeType === 1) { | |
35 | + let item = angular | |
36 | + .element("<div>") | |
37 | + .addClass("ant-space-item") | |
38 | + .append(children); | |
39 | + $element.append(item); | |
40 | + } | |
41 | + } | |
42 | + } | |
21 | 43 | }, |
22 | 44 | }; |
23 | 45 | }); | ... | ... |
build/Spin/Spin.html
build/Spin/Spin.js
... | ... | @@ -10,7 +10,7 @@ angular.module("esNgAntd").directive("esSpin", function () { |
10 | 10 | spinning: "@", |
11 | 11 | }, |
12 | 12 | template: template, |
13 | - controller: function ($scope, $element) { | |
13 | + controller: function ($scope, $element, $attrs) { | |
14 | 14 | this.getContext = function () { |
15 | 15 | return $scope; |
16 | 16 | }; | ... | ... |
build/Table/Table.html
... | ... | @@ -42,7 +42,7 @@ |
42 | 42 | </td> |
43 | 43 | </tr> |
44 | 44 | <tr ng-if="state.dataSource.length===0" class="ant-table-placeholder"> |
45 | - <td colspan="{{columns.length}}"> | |
45 | + <td colspan="{{rowSelection?columns.length+1:columns.length}}"> | |
46 | 46 | <es-empty image="presented_image_simple"></es-empty> |
47 | 47 | </td> |
48 | 48 | </tr> | ... | ... |
build/index.js
... | ... | @@ -29,6 +29,7 @@ require("./Table/Table"); |
29 | 29 | require("./Textarea/Textarea"); |
30 | 30 | require("./SelectOption/SelectOption"); |
31 | 31 | require("./Select/Select"); |
32 | +require("./Space/Space"); | |
32 | 33 | require("./Divider/Divider"); |
33 | 34 | require("./Row/Row"); |
34 | 35 | require("./Col/Col"); | ... | ... |
dist/ng-antd.js
... | ... | @@ -371,6 +371,17 @@ eval("angular.module(\"esNgAntd\").directive(\"esSlot\", function ($compile) {\n |
371 | 371 | |
372 | 372 | /***/ }), |
373 | 373 | |
374 | +/***/ "./build/Space/Space.js": | |
375 | +/*!******************************!*\ | |
376 | + !*** ./build/Space/Space.js ***! | |
377 | + \******************************/ | |
378 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
379 | + | |
380 | +"use strict"; | |
381 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Space_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Space.html */ \"./build/Space/Space.html\");\n/* harmony import */ var antd_lib_space_style_index_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! antd/lib/space/style/index.css */ \"./node_modules/antd/lib/space/style/index.css\");\n\n\nangular.module(\"esNgAntd\").directive(\"esSpace\", function (esNgAntd) {\n return {\n controllerAs: \"esSpace\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n direction: \"@\",\n size: \"@\",\n },\n template: _Space_html__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.state = {\n direction: $scope.direction || \"horizontal\",\n size: $scope.size || 8,\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n esNgAntd.createStyle(\"ant-space\", antd_lib_space_style_index_css__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n $element.removeAttr(\"ng-class\");\n $element.removeAttr(\"ng-style\");\n let childrens = $transclude();\n\n for (const key in childrens) {\n if (Object.hasOwnProperty.call(childrens, key)) {\n const children = childrens[key];\n\n if (children.nodeType === 1) {\n let item = angular\n .element(\"<div>\")\n .addClass(\"ant-space-item\")\n .append(children);\n $element.append(item);\n }\n }\n }\n },\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Space/Space.js?"); | |
382 | + | |
383 | +/***/ }), | |
384 | + | |
374 | 385 | /***/ "./build/Spin/Spin.js": |
375 | 386 | /*!****************************!*\ |
376 | 387 | !*** ./build/Spin/Spin.js ***! |
... | ... | @@ -378,7 +389,7 @@ eval("angular.module(\"esNgAntd\").directive(\"esSlot\", function ($compile) {\n |
378 | 389 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
379 | 390 | |
380 | 391 | "use strict"; |
381 | -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Spin_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Spin.html */ \"./build/Spin/Spin.html\");\n\nangular.module(\"esNgAntd\").directive(\"esSpin\", function () {\n return {\n controllerAs: \"esSpin\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n size: \"@\",\n spinning: \"@\",\n },\n template: _Spin_html__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n controller: function ($scope, $element) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.state = {\n className: [],\n hasChildren: false,\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n $scope.state.className = [\"ant-spin\", \"ant-spin-spinning\"];\n $scope.state.hasChildren = JSON.stringify($transclude()) !== \"{}\";\n\n if ($scope.size === \"small\") {\n $scope.state.className.splice(1, 0, \"ant-spin-sm\");\n }\n\n if ($scope.size === \"large\") {\n $scope.state.className.splice(1, 0, \"ant-spin-lg\");\n }\n },\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Spin/Spin.js?"); | |
392 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Spin_html__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Spin.html */ \"./build/Spin/Spin.html\");\n\nangular.module(\"esNgAntd\").directive(\"esSpin\", function () {\n return {\n controllerAs: \"esSpin\",\n restrict: \"E\",\n transclude: true,\n replace: true,\n scope: {\n size: \"@\",\n spinning: \"@\",\n },\n template: _Spin_html__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n controller: function ($scope, $element, $attrs) {\n this.getContext = function () {\n return $scope;\n };\n\n $scope.state = {\n className: [],\n hasChildren: false,\n };\n },\n link: function ($scope, $element, $attrs, $controllers, $transclude) {\n $scope.state.className = [\"ant-spin\", \"ant-spin-spinning\"];\n $scope.state.hasChildren = JSON.stringify($transclude()) !== \"{}\";\n\n if ($scope.size === \"small\") {\n $scope.state.className.splice(1, 0, \"ant-spin-sm\");\n }\n\n if ($scope.size === \"large\") {\n $scope.state.className.splice(1, 0, \"ant-spin-lg\");\n }\n },\n };\n});\n\n\n//# sourceURL=webpack://ng-antd/./build/Spin/Spin.js?"); | |
382 | 393 | |
383 | 394 | /***/ }), |
384 | 395 | |
... | ... | @@ -432,7 +443,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Tex |
432 | 443 | \************************/ |
433 | 444 | /***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => { |
434 | 445 | |
435 | -eval("angular.module(\"esNgAntd\", []);\n__webpack_require__(/*! ./Icon/Icon */ \"./build/Icon/Icon.js\");\n__webpack_require__(/*! ./Common/Common */ \"./build/Common/Common.js\");\n__webpack_require__(/*! ./Slot/Slot */ \"./build/Slot/Slot.js\");\n__webpack_require__(/*! ./Button/Button */ \"./build/Button/Button.js\");\n__webpack_require__(/*! ./Modal/Modal */ \"./build/Modal/Modal.js\");\n__webpack_require__(/*! ./Input/Input */ \"./build/Input/Input.js\");\n__webpack_require__(/*! ./InputGroup/InputGroup */ \"./build/InputGroup/InputGroup.js\");\n__webpack_require__(/*! ./InputNumber/InputNumber */ \"./build/InputNumber/InputNumber.js\");\n__webpack_require__(/*! ./InputSearch/InputSearch */ \"./build/InputSearch/InputSearch.js\");\n__webpack_require__(/*! ./Checkbox/Checkbox */ \"./build/Checkbox/Checkbox.js\");\n__webpack_require__(/*! ./CheckableTag/CheckableTag */ \"./build/CheckableTag/CheckableTag.js\");\n__webpack_require__(/*! ./Popover/Popover */ \"./build/Popover/Popover.js\");\n__webpack_require__(/*! ./List/List */ \"./build/List/List.js\");\n__webpack_require__(/*! ./ListItem/ListItem */ \"./build/ListItem/ListItem.js\");\n__webpack_require__(/*! ./Form/Form */ \"./build/Form/Form.js\");\n__webpack_require__(/*! ./FormItem/FormItem */ \"./build/FormItem/FormItem.js\");\n__webpack_require__(/*! ./Radio/Radio */ \"./build/Radio/Radio.js\");\n__webpack_require__(/*! ./RadioGroup/RadioGroup */ \"./build/RadioGroup/RadioGroup.js\");\n__webpack_require__(/*! ./RadioButton/RadioButton */ \"./build/RadioButton/RadioButton.js\");\n__webpack_require__(/*! ./TabPane/TabPane */ \"./build/TabPane/TabPane.js\");\n__webpack_require__(/*! ./Tabs/Tabs */ \"./build/Tabs/Tabs.js\");\n__webpack_require__(/*! ./Empty/Empty */ \"./build/Empty/Empty.js\");\n__webpack_require__(/*! ./ImagePreviewGroup/ImagePreviewGroup */ \"./build/ImagePreviewGroup/ImagePreviewGroup.js\");\n__webpack_require__(/*! ./Image/Image */ \"./build/Image/Image.js\");\n__webpack_require__(/*! ./Spin/Spin */ \"./build/Spin/Spin.js\");\n__webpack_require__(/*! ./Card/Card */ \"./build/Card/Card.js\");\n__webpack_require__(/*! ./Table/Table */ \"./build/Table/Table.js\");\n__webpack_require__(/*! ./Textarea/Textarea */ \"./build/Textarea/Textarea.js\");\n__webpack_require__(/*! ./SelectOption/SelectOption */ \"./build/SelectOption/SelectOption.js\");\n__webpack_require__(/*! ./Select/Select */ \"./build/Select/Select.js\");\n__webpack_require__(/*! ./Divider/Divider */ \"./build/Divider/Divider.js\");\n__webpack_require__(/*! ./Row/Row */ \"./build/Row/Row.js\");\n__webpack_require__(/*! ./Col/Col */ \"./build/Col/Col.js\");\n__webpack_require__(/*! ./Pagination/Pagination */ \"./build/Pagination/Pagination.js\");\n__webpack_require__(/*! ./Message/Message */ \"./build/Message/Message.js\");\n__webpack_require__(/*! ./Alert/Alert */ \"./build/Alert/Alert.js\");\n__webpack_require__(/*! ./Breadcrumb/Breadcrumb */ \"./build/Breadcrumb/Breadcrumb.js\");\n__webpack_require__(/*! ./BreadcrumbItem/BreadcrumbItem */ \"./build/BreadcrumbItem/BreadcrumbItem.js\");\n\n\n//# sourceURL=webpack://ng-antd/./build/index.js?"); | |
446 | +eval("angular.module(\"esNgAntd\", []);\n__webpack_require__(/*! ./Icon/Icon */ \"./build/Icon/Icon.js\");\n__webpack_require__(/*! ./Common/Common */ \"./build/Common/Common.js\");\n__webpack_require__(/*! ./Slot/Slot */ \"./build/Slot/Slot.js\");\n__webpack_require__(/*! ./Button/Button */ \"./build/Button/Button.js\");\n__webpack_require__(/*! ./Modal/Modal */ \"./build/Modal/Modal.js\");\n__webpack_require__(/*! ./Input/Input */ \"./build/Input/Input.js\");\n__webpack_require__(/*! ./InputGroup/InputGroup */ \"./build/InputGroup/InputGroup.js\");\n__webpack_require__(/*! ./InputNumber/InputNumber */ \"./build/InputNumber/InputNumber.js\");\n__webpack_require__(/*! ./InputSearch/InputSearch */ \"./build/InputSearch/InputSearch.js\");\n__webpack_require__(/*! ./Checkbox/Checkbox */ \"./build/Checkbox/Checkbox.js\");\n__webpack_require__(/*! ./CheckableTag/CheckableTag */ \"./build/CheckableTag/CheckableTag.js\");\n__webpack_require__(/*! ./Popover/Popover */ \"./build/Popover/Popover.js\");\n__webpack_require__(/*! ./List/List */ \"./build/List/List.js\");\n__webpack_require__(/*! ./ListItem/ListItem */ \"./build/ListItem/ListItem.js\");\n__webpack_require__(/*! ./Form/Form */ \"./build/Form/Form.js\");\n__webpack_require__(/*! ./FormItem/FormItem */ \"./build/FormItem/FormItem.js\");\n__webpack_require__(/*! ./Radio/Radio */ \"./build/Radio/Radio.js\");\n__webpack_require__(/*! ./RadioGroup/RadioGroup */ \"./build/RadioGroup/RadioGroup.js\");\n__webpack_require__(/*! ./RadioButton/RadioButton */ \"./build/RadioButton/RadioButton.js\");\n__webpack_require__(/*! ./TabPane/TabPane */ \"./build/TabPane/TabPane.js\");\n__webpack_require__(/*! ./Tabs/Tabs */ \"./build/Tabs/Tabs.js\");\n__webpack_require__(/*! ./Empty/Empty */ \"./build/Empty/Empty.js\");\n__webpack_require__(/*! ./ImagePreviewGroup/ImagePreviewGroup */ \"./build/ImagePreviewGroup/ImagePreviewGroup.js\");\n__webpack_require__(/*! ./Image/Image */ \"./build/Image/Image.js\");\n__webpack_require__(/*! ./Spin/Spin */ \"./build/Spin/Spin.js\");\n__webpack_require__(/*! ./Card/Card */ \"./build/Card/Card.js\");\n__webpack_require__(/*! ./Table/Table */ \"./build/Table/Table.js\");\n__webpack_require__(/*! ./Textarea/Textarea */ \"./build/Textarea/Textarea.js\");\n__webpack_require__(/*! ./SelectOption/SelectOption */ \"./build/SelectOption/SelectOption.js\");\n__webpack_require__(/*! ./Select/Select */ \"./build/Select/Select.js\");\n__webpack_require__(/*! ./Space/Space */ \"./build/Space/Space.js\");\n__webpack_require__(/*! ./Divider/Divider */ \"./build/Divider/Divider.js\");\n__webpack_require__(/*! ./Row/Row */ \"./build/Row/Row.js\");\n__webpack_require__(/*! ./Col/Col */ \"./build/Col/Col.js\");\n__webpack_require__(/*! ./Pagination/Pagination */ \"./build/Pagination/Pagination.js\");\n__webpack_require__(/*! ./Message/Message */ \"./build/Message/Message.js\");\n__webpack_require__(/*! ./Alert/Alert */ \"./build/Alert/Alert.js\");\n__webpack_require__(/*! ./Breadcrumb/Breadcrumb */ \"./build/Breadcrumb/Breadcrumb.js\");\n__webpack_require__(/*! ./BreadcrumbItem/BreadcrumbItem */ \"./build/BreadcrumbItem/BreadcrumbItem.js\");\n\n\n//# sourceURL=webpack://ng-antd/./build/index.js?"); | |
436 | 447 | |
437 | 448 | /***/ }), |
438 | 449 | |
... | ... | @@ -9313,6 +9324,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac |
9313 | 9324 | |
9314 | 9325 | /***/ }), |
9315 | 9326 | |
9327 | +/***/ "./node_modules/antd/lib/space/style/index.css": | |
9328 | +/*!*****************************************************!*\ | |
9329 | + !*** ./node_modules/antd/lib/space/style/index.css ***! | |
9330 | + \*****************************************************/ | |
9331 | +/***/ ((module, __webpack_exports__, __webpack_require__) => { | |
9332 | + | |
9333 | +"use strict"; | |
9334 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../css-loader/dist/runtime/noSourceMaps.js */ \"./node_modules/css-loader/dist/runtime/noSourceMaps.js\");\n/* harmony import */ var _css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../../../css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\n/* harmony import */ var _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1__);\n// Imports\n\n\nvar ___CSS_LOADER_EXPORT___ = _css_loader_dist_runtime_api_js__WEBPACK_IMPORTED_MODULE_1___default()((_css_loader_dist_runtime_noSourceMaps_js__WEBPACK_IMPORTED_MODULE_0___default()));\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \"/* stylelint-disable at-rule-empty-line-before,at-rule-name-space-after,at-rule-no-unknown */\\n/* stylelint-disable no-duplicate-selectors */\\n/* stylelint-disable */\\n/* stylelint-disable declaration-bang-space-before,no-duplicate-selectors,string-no-newline */\\n.ant-space {\\n display: inline-flex;\\n}\\n.ant-space-vertical {\\n flex-direction: column;\\n}\\n.ant-space-align-center {\\n align-items: center;\\n}\\n.ant-space-align-start {\\n align-items: flex-start;\\n}\\n.ant-space-align-end {\\n align-items: flex-end;\\n}\\n.ant-space-align-baseline {\\n align-items: baseline;\\n}\\n.ant-space-item:empty {\\n display: none;\\n}\\n.ant-space-rtl {\\n direction: rtl;\\n}\\n\", \"\"]);\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (___CSS_LOADER_EXPORT___);\n\n\n//# sourceURL=webpack://ng-antd/./node_modules/antd/lib/space/style/index.css?"); | |
9335 | + | |
9336 | +/***/ }), | |
9337 | + | |
9316 | 9338 | /***/ "./node_modules/antd/lib/style/index.css": |
9317 | 9339 | /*!***********************************************!*\ |
9318 | 9340 | !*** ./node_modules/antd/lib/style/index.css ***! |
... | ... | @@ -9617,7 +9639,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac |
9617 | 9639 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
9618 | 9640 | |
9619 | 9641 | "use strict"; |
9620 | -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<ul ng-class=\\\"'ant-pagination'+(size==='small'?' mini':'')\\\">\\n <li class=\\\"ant-pagination-total-text\\\" ng-if=\\\"showTotal()\\">{{handleShowTotal()}}</li>\n <li ng-class=\\"'ant-pagination-prev'+(state.current===1?' ant-pagination-disabled':'')\\" ng-click=\\"handlePrev()\\">\n <button type=\\"button\\" class=\\"ant-pagination-item-link\\">\n <es-icon type=\\"LeftOutlined\\"></es-icon>\n </button>\n </li>\n <li ng-repeat=\\"(key, value) in state.pageNumList track by key\\" ng-class=\\"''+getItemLinkClassName(value)\\" ng-click=\\"handleClick(value)\\">\n <a ng-if=\\"value!=='prev'&&value!=='next'\\">{{value}}</a>\n <a ng-if=\\"value==='prev'||value==='next'\\" class=\\"ant-pagination-item-link\\">\n <div class=\\"ant-pagination-item-container\\">\n <es-icon ng-if=\\"value==='prev'\\" type=\\"DoubleLeftOutlined\\" class=\\"ant-pagination-item-link-icon\\"></es-icon>\n <es-icon ng-if=\\"value==='next'\\" type=\\"DoubleRightOutlined\\" class=\\"ant-pagination-item-link-icon\\"></es-icon>\n <span class=\\"ant-pagination-item-ellipsis\\">•••</span>\n </div>\n </a>\n </li>\n <li ng-class=\\"'ant-pagination-next'+(state.current===state.pageNum?' ant-pagination-disabled':'')\\" ng-click=\\"handleNext()\\">\n <button type=\\"button\\" class=\\"ant-pagination-item-link\\">\n <es-icon type=\\"RightOutlined\\"></es-icon>\n </button>\n </li>\n <li class=\\"ant-pagination-options\\">\n <es-select ng-if=\\"showSizeChanger==='true'\\" class=\\"ant-pagination-options-size-changer\\" size=\\"{{size}}\\" value=\\"10\\" get-popup-container=\\"getPopupContainer\\" on-change=\\"handleSelectChange(value)\\">\n <es-select-option value=\\"10\\">10 条/页</es-select-option>\n <es-select-option value=\\"20\\">20 条/页</es-select-option>\n <es-select-option value=\\"30\\">30 条/页</es-select-option>\n <es-select-option value=\\"40\\">40 条/页</es-select-option>\n </es-select>\n <div ng-if=\\"showQuickJumper==='true'\\" class=\\"ant-pagination-options-quick-jumper\\">\n 跳至<input type=\\"text\\" ng-blur=\\"handleBlur($event)\\" ng-keypress=\\"onKeyPress($event)\\" />页\n </div>\n </li>\n</ul>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Pagination/Pagination.html?"); | |
9642 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<ul ng-class=\\\"'ant-pagination'+(size==='small'?' mini':'')\\\">\\n <li ng-if=\\\"showTotal()\\\" class=\\\"ant-pagination-total-text\\">{{handleShowTotal()}}</li>\n <li ng-class=\\"'ant-pagination-prev'+(state.current===1?' ant-pagination-disabled':'')\\" ng-click=\\"handlePrev()\\">\n <button type=\\"button\\" class=\\"ant-pagination-item-link\\">\n <es-icon type=\\"LeftOutlined\\"></es-icon>\n </button>\n </li>\n <li ng-repeat=\\"(key, value) in state.pageNumList track by key\\" ng-class=\\"''+getItemLinkClassName(value)\\" ng-click=\\"handleClick(value)\\">\n <a ng-if=\\"value!=='prev'&&value!=='next'\\">{{value}}</a>\n <a ng-if=\\"value==='prev'||value==='next'\\" class=\\"ant-pagination-item-link\\">\n <div class=\\"ant-pagination-item-container\\">\n <es-icon ng-if=\\"value==='prev'\\" type=\\"DoubleLeftOutlined\\" class=\\"ant-pagination-item-link-icon\\"></es-icon>\n <es-icon ng-if=\\"value==='next'\\" type=\\"DoubleRightOutlined\\" class=\\"ant-pagination-item-link-icon\\"></es-icon>\n <span class=\\"ant-pagination-item-ellipsis\\">•••</span>\n </div>\n </a>\n </li>\n <li ng-class=\\"'ant-pagination-next'+(state.current===state.pageNum?' ant-pagination-disabled':'')\\" ng-click=\\"handleNext()\\">\n <button type=\\"button\\" class=\\"ant-pagination-item-link\\">\n <es-icon type=\\"RightOutlined\\"></es-icon>\n </button>\n </li>\n <li class=\\"ant-pagination-options\\">\n <es-select ng-if=\\"showSizeChanger==='true'\\" class=\\"ant-pagination-options-size-changer\\" size=\\"{{size}}\\" value=\\"10\\" get-popup-container=\\"getPopupContainer\\" on-change=\\"handleSelectChange(value)\\">\n <es-select-option value=\\"10\\">10 条/页</es-select-option>\n <es-select-option value=\\"20\\">20 条/页</es-select-option>\n <es-select-option value=\\"30\\">30 条/页</es-select-option>\n <es-select-option value=\\"40\\">40 条/页</es-select-option>\n </es-select>\n <div ng-if=\\"showQuickJumper==='true'\\" class=\\"ant-pagination-options-quick-jumper\\">\n 跳至<input type=\\"text\\" ng-blur=\\"handleBlur($event)\\" ng-keypress=\\"onKeyPress($event)\\" />页\n </div>\n </li>\n</ul>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Pagination/Pagination.html?"); | |
9621 | 9643 | |
9622 | 9644 | /***/ }), |
9623 | 9645 | |
... | ... | @@ -9698,6 +9720,17 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac |
9698 | 9720 | |
9699 | 9721 | /***/ }), |
9700 | 9722 | |
9723 | +/***/ "./build/Space/Space.html": | |
9724 | +/*!********************************!*\ | |
9725 | + !*** ./build/Space/Space.html ***! | |
9726 | + \********************************/ | |
9727 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
9728 | + | |
9729 | +"use strict"; | |
9730 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div ng-class=\\\"'ant-space ant-space-'+state.direction+' ant-space-align-center'\\\" ng-style=\\\"{gap:state.size+'px'}\\\"></div>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Space/Space.html?"); | |
9731 | + | |
9732 | +/***/ }), | |
9733 | + | |
9701 | 9734 | /***/ "./build/Spin/Spin.html": |
9702 | 9735 | /*!******************************!*\ |
9703 | 9736 | !*** ./build/Spin/Spin.html ***! |
... | ... | @@ -9705,7 +9738,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac |
9705 | 9738 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
9706 | 9739 | |
9707 | 9740 | "use strict"; |
9708 | -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div>\\n <div ng-if=\\\"state.hasChildren\\\" class=\\\"ant-spin-nested-loading\\\">\\n <div ng-if=\\\"spinning!=='false'\\">\n <div ng-class=\\"state.className\\">\n <span class=\\"ant-spin-dot ant-spin-dot-spin\\">\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n </span>\n </div>\n </div>\n <div ng-class=\\"'ant-spin-container'+(spinning==='true'?' ant-spin-blur':'')\\" ng-transclude></div>\n </div>\n <div ng-if=\\"!state.hasChildren\\" ng-class=\\"state.className\\">\n <span class=\\"ant-spin-dot ant-spin-dot-spin\\">\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n </span>\n </div>\n</div>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Spin/Spin.html?"); | |
9741 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div>\\n <div ng-if=\\\"state.hasChildren\\\" class=\\\"ant-spin-nested-loading\\\">\\n <div ng-if=\\\"spinning==='true'\\">\n <div ng-class=\\"state.className\\">\n <span class=\\"ant-spin-dot ant-spin-dot-spin\\">\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n </span>\n </div>\n </div>\n <div ng-class=\\"'ant-spin-container'+(spinning==='true'?' ant-spin-blur':'')\\" ng-transclude></div>\n </div>\n <div ng-if=\\"!state.hasChildren\\" ng-class=\\"state.className\\">\n <span class=\\"ant-spin-dot ant-spin-dot-spin\\">\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n <i class=\\"ant-spin-dot-item\\"></i>\n </span>\n </div>\n</div>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Spin/Spin.html?"); | |
9709 | 9742 | |
9710 | 9743 | /***/ }), |
9711 | 9744 | |
... | ... | @@ -9727,7 +9760,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac |
9727 | 9760 | /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { |
9728 | 9761 | |
9729 | 9762 | "use strict"; |
9730 | -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div class=\\\"ant-table-wrapper\\\">\\n <es-spin spinning=\\\"{{loading}}\\\">\\n <div ng-class=\\\"'ant-table ant-table-'+state.size\\\">\\n <div class=\\\"ant-table-content\\\">\\n <table>\\n <thead class=\\\"ant-table-thead\\\">\\n <tr>\\n <th ng-if=\\\"rowSelection\\\" class=\\\"ant-table-selection-column\\\">\\n <span class=\\\"ant-table-header-column\\\">\\n <div>\\n <span class=\\\"ant-table-column-title\\\">\\n <div class=\\\"ant-table-selection\\\">\\n <es-checkbox on-change=\\\"handleSelectAll(event)\\\" checked=\\\"{{state.isSelectAll}}\\\" />\\n </div>\\n </span>\\n </div>\\n </span>\\n </th>\\n <th ng-repeat=\\\"(key, column) in columns track by key\\\" class=\\\"ant-table-cell ant-table-column-has-sorters\\\" ng-style=\\\"{width:column.width}\\\">\\n <span ng-if=\\\"!column.sorter\\\">{{column.title}}</span>\\n <div ng-if=\\\"column.sorter\\\" class=\\\"ant-table-column-sorters\\\" ng-click=\\\"handleSorter(column.key)\\\">\\n <span class=\\\"ant-table-column-title\\\">{{column.title}}</span>\\n <span class=\\\"ant-table-column-sorter ant-table-column-sorter-full\\\">\\n <span class=\\\"ant-table-column-sorter-inner\\\">\\n <es-icon type=\\\"CaretUpOutlined\\\" ng-class=\\\"'ant-table-column-sorter-up'+(state.sorter.field===column.key&&state.sorter.order==='ascend'?' active':'')\\\"></es-icon>\\n <es-icon type=\\\"CaretDownOutlined\\\" ng-class=\\\"'ant-table-column-sorter-down'+(state.sorter.field===column.key&&state.sorter.order==='descend'?' active':'')\\\"></es-icon>\\n </span>\\n </span>\\n </div>\\n </th>\\n </tr>\\n </thead>\\n <tbody class=\\\"ant-table-tbody\\\">\\n <tr ng-repeat=\\\"(key, record) in state.dataSource track by record[state.rowKey]\\\" class=\\\"ant-table-row\\\">\\n <td ng-if=\\\"rowSelection\\\" class=\\\"ant-table-selection-column\\\">\\n <span>\\n <es-checkbox checked=\\\"record.checked\\\" disabled=\\\"record.disabled\\\" on-change=\\\"handleSelect(event,$index)\\\" />\\n </span>\\n </td>\\n <td ng-repeat=\\\"(key, column) in columns track by key\\\" data-key=\\\"{{column.key}}\\\">\\n <es-slot content=\\\"{{record[column.key]}}\\\" context=\\\"esTable.getContext().$parent\\\" />\\n </td>\\n </tr>\\n <tr ng-if=\\\"state.dataSource.length===0\\\" class=\\\"ant-table-placeholder\\\">\\n <td colspan=\\\"{{columns.length}}\\">\n <es-empty image=\\"presented_image_simple\\"></es-empty>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </es-spin>\n</div>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Table/Table.html?"); | |
9763 | +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n// Module\nvar code = \"<div class=\\\"ant-table-wrapper\\\">\\n <es-spin spinning=\\\"{{loading}}\\\">\\n <div ng-class=\\\"'ant-table ant-table-'+state.size\\\">\\n <div class=\\\"ant-table-content\\\">\\n <table>\\n <thead class=\\\"ant-table-thead\\\">\\n <tr>\\n <th ng-if=\\\"rowSelection\\\" class=\\\"ant-table-selection-column\\\">\\n <span class=\\\"ant-table-header-column\\\">\\n <div>\\n <span class=\\\"ant-table-column-title\\\">\\n <div class=\\\"ant-table-selection\\\">\\n <es-checkbox on-change=\\\"handleSelectAll(event)\\\" checked=\\\"{{state.isSelectAll}}\\\" />\\n </div>\\n </span>\\n </div>\\n </span>\\n </th>\\n <th ng-repeat=\\\"(key, column) in columns track by key\\\" class=\\\"ant-table-cell ant-table-column-has-sorters\\\" ng-style=\\\"{width:column.width}\\\">\\n <span ng-if=\\\"!column.sorter\\\">{{column.title}}</span>\\n <div ng-if=\\\"column.sorter\\\" class=\\\"ant-table-column-sorters\\\" ng-click=\\\"handleSorter(column.key)\\\">\\n <span class=\\\"ant-table-column-title\\\">{{column.title}}</span>\\n <span class=\\\"ant-table-column-sorter ant-table-column-sorter-full\\\">\\n <span class=\\\"ant-table-column-sorter-inner\\\">\\n <es-icon type=\\\"CaretUpOutlined\\\" ng-class=\\\"'ant-table-column-sorter-up'+(state.sorter.field===column.key&&state.sorter.order==='ascend'?' active':'')\\\"></es-icon>\\n <es-icon type=\\\"CaretDownOutlined\\\" ng-class=\\\"'ant-table-column-sorter-down'+(state.sorter.field===column.key&&state.sorter.order==='descend'?' active':'')\\\"></es-icon>\\n </span>\\n </span>\\n </div>\\n </th>\\n </tr>\\n </thead>\\n <tbody class=\\\"ant-table-tbody\\\">\\n <tr ng-repeat=\\\"(key, record) in state.dataSource track by record[state.rowKey]\\\" class=\\\"ant-table-row\\\">\\n <td ng-if=\\\"rowSelection\\\" class=\\\"ant-table-selection-column\\\">\\n <span>\\n <es-checkbox checked=\\\"record.checked\\\" disabled=\\\"record.disabled\\\" on-change=\\\"handleSelect(event,$index)\\\" />\\n </span>\\n </td>\\n <td ng-repeat=\\\"(key, column) in columns track by key\\\" data-key=\\\"{{column.key}}\\\">\\n <es-slot content=\\\"{{record[column.key]}}\\\" context=\\\"esTable.getContext().$parent\\\" />\\n </td>\\n </tr>\\n <tr ng-if=\\\"state.dataSource.length===0\\\" class=\\\"ant-table-placeholder\\\">\\n <td colspan=\\\"{{rowSelection?columns.length+1:columns.length}}\\">\n <es-empty image=\\"presented_image_simple\\"></es-empty>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n </es-spin>\n</div>\";\n// Exports\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (code);\n\n//# sourceURL=webpack://ng-antd/./build/Table/Table.html?"); | |
9731 | 9764 | |
9732 | 9765 | /***/ }), |
9733 | 9766 | ... | ... |
... | ... | @@ -0,0 +1,35 @@ |
1 | +<!DOCTYPE html> | |
2 | +<html> | |
3 | + | |
4 | +<head> | |
5 | + <meta charset="UTF-8" /> | |
6 | + <title></title> | |
7 | + <style> | |
8 | + .container>div { | |
9 | + margin-bottom: 10px; | |
10 | + } | |
11 | + </style> | |
12 | +</head> | |
13 | + | |
14 | +<body> | |
15 | + <div ng-app="esNgAntd" ng-controller="mainCtrl"> | |
16 | + <div class="container" style="padding: 50px"> | |
17 | + <es-space> | |
18 | + <es-button type="primary">AAA</es-button> | |
19 | + <es-button>BBB</es-button> | |
20 | + <es-button>CCC</es-button> | |
21 | + </es-space> | |
22 | + </div> | |
23 | + </div> | |
24 | + <script src="https://cdn.staticfile.org/angular.js/1.2.28/angular.min.js"></script> | |
25 | + <script src="../dist/ng-antd.js"></script> | |
26 | + <script> | |
27 | + angular | |
28 | + .module("esNgAntd") | |
29 | + .controller("mainCtrl", function ($scope) { | |
30 | + | |
31 | + }); | |
32 | + </script> | |
33 | +</body> | |
34 | + | |
35 | +</html> | |
0 | 36 | \ No newline at end of file | ... | ... |
src/Space/Space.html
1 | -<div className={"es-space es-space-align-center" + (direction === "vertical" ? " es-space-vertical": "")} style={{gap: size+'px'}}>{children}</div> | |
2 | 1 | \ No newline at end of file |
2 | +<div className={"ant-space ant-space-"+state.direction+" ant-space-align-center"} style={{gap: state.size+'px'}}></div> | |
3 | 3 | \ No newline at end of file | ... | ... |
src/Space/Space.js
1 | +import template from "./Space.html"; | |
2 | +import style from "antd/lib/space/style/index.css"; | |
1 | 3 | class Space { |
4 | + useModules = ["esNgAntd"]; | |
5 | + | |
2 | 6 | props = { direction: String, size: String }; |
7 | + | |
8 | + state = { | |
9 | + direction: this.props.direction || "horizontal", | |
10 | + size: this.props.size || 8 | |
11 | + }; | |
12 | + | |
13 | + template = template; | |
14 | + | |
3 | 15 | constructor() { |
4 | - let childrens = $elements.children(); | |
5 | - $elements.empty(); | |
6 | - angular.forEach(childrens, (element, index) => { | |
7 | - let item = angular | |
8 | - .element("<div>") | |
9 | - .addClass("es-space-item") | |
10 | - .append(element); | |
11 | - $elements.append(item); | |
12 | - }); | |
16 | + esNgAntd.createStyle("ant-space", style); | |
17 | + $element.removeAttr("ng-class"); | |
18 | + $element.removeAttr("ng-style"); | |
19 | + let childrens = $transclude(); | |
20 | + for (const key in childrens) { | |
21 | + if (Object.hasOwnProperty.call(childrens, key)) { | |
22 | + const children = childrens[key]; | |
23 | + if (children.nodeType === 1) { | |
24 | + let item = angular | |
25 | + .element("<div>") | |
26 | + .addClass("ant-space-item") | |
27 | + .append(children); | |
28 | + $element.append(item); | |
29 | + } | |
30 | + } | |
31 | + } | |
13 | 32 | } |
14 | 33 | } | ... | ... |
src/Spin/Spin.html
src/Table/Table.html
... | ... | @@ -50,7 +50,7 @@ |
50 | 50 | </tr> |
51 | 51 | })} |
52 | 52 | {state.dataSource.length === 0 && <tr className="ant-table-placeholder"> |
53 | - <td colspan={columns.length}> | |
53 | + <td colspan={rowSelection?columns.length+1:columns.length}> | |
54 | 54 | <es-empty image="presented_image_simple"></es-empty> |
55 | 55 | </td> |
56 | 56 | </tr>} | ... | ... |
webpack.config.js
... | ... | @@ -6,9 +6,9 @@ module.exports = { |
6 | 6 | entry: "./build/index.js", |
7 | 7 | output: { |
8 | 8 | // bpms |
9 | - path: "/Users/shann/Project/essa/bpms/bpms-webapp/src/main/webapp/lib/ng-antd", | |
9 | + // path: "/Usersc/shann/Project/essa/bpms/bpms-webapp/src/main/webapp/lib/ng-antd", | |
10 | 10 | // boss |
11 | - // path: "/Users/shann/Project/essa/boss/trunk/vendor-lib/ng-antd", | |
11 | + path: "/Users/shann/Project/essa/boss/trunk/vendor-lib/ng-antd", | |
12 | 12 | // mvo |
13 | 13 | // path: "/Users/shann/Project/essa/mvo/mvo-webapp/public/browser-vendor/ng-antd", |
14 | 14 | // local | ... | ... |