gxxc-ui 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +41 -0
  3. package/dist/AmountCellUI/index.d.ts +11 -0
  4. package/dist/AmountCellUI/index.js +123 -0
  5. package/dist/AnchorUI/demo/anchor-button.d.ts +3 -0
  6. package/dist/AnchorUI/demo/anchor-button.js +85 -0
  7. package/dist/AnchorUI/demo/use-anchor.d.ts +3 -0
  8. package/dist/AnchorUI/demo/use-anchor.js +69 -0
  9. package/dist/AnchorUI/index.d.ts +4 -0
  10. package/dist/AnchorUI/index.js +56 -0
  11. package/dist/AnchorUI/index.scss +21 -0
  12. package/dist/BackUI/index.d.ts +14 -0
  13. package/dist/BackUI/index.js +35 -0
  14. package/dist/BackUI/index.scss +26 -0
  15. package/dist/BroadcastUI/index.d.ts +12 -0
  16. package/dist/BroadcastUI/index.js +62 -0
  17. package/dist/BroadcastUI/index.scss +43 -0
  18. package/dist/ButtonUI/index.d.ts +9 -0
  19. package/dist/ButtonUI/index.js +17 -0
  20. package/dist/ButtonUI/index.scss +6 -0
  21. package/dist/CellUI/index.d.ts +13 -0
  22. package/dist/CellUI/index.js +78 -0
  23. package/dist/CellUI/index.scss +28 -0
  24. package/dist/Components/index.d.ts +2 -0
  25. package/dist/Components/index.js +4 -0
  26. package/dist/DateUI/index.d.ts +5 -0
  27. package/dist/DateUI/index.js +116 -0
  28. package/dist/DateUI/index.scss +3 -0
  29. package/dist/DescriptionsUI/index.d.ts +19 -0
  30. package/dist/DescriptionsUI/index.js +72 -0
  31. package/dist/DescriptionsUI/index.scss +88 -0
  32. package/dist/EmptyUI/emptyImage.d.ts +3 -0
  33. package/dist/EmptyUI/emptyImage.js +12 -0
  34. package/dist/EmptyUI/index.d.ts +9 -0
  35. package/dist/EmptyUI/index.js +13 -0
  36. package/dist/EmptyUI/index.scss +10 -0
  37. package/dist/FilterUI/index.d.ts +28 -0
  38. package/dist/FilterUI/index.js +252 -0
  39. package/dist/FilterUI/index.scss +80 -0
  40. package/dist/FormUI/index.d.ts +4 -0
  41. package/dist/FormUI/index.js +45 -0
  42. package/dist/FormUI/index.scss +64 -0
  43. package/dist/IconUI/index.d.ts +27 -0
  44. package/dist/IconUI/index.js +22 -0
  45. package/dist/IconUI/material/dictionary.d.ts +4 -0
  46. package/dist/IconUI/material/dictionary.js +71 -0
  47. package/dist/IconUI/material/dictionary.scss +58 -0
  48. package/dist/IconUI/material/material.d.ts +16 -0
  49. package/dist/IconUI/material/material.js +476 -0
  50. package/dist/IconUI/material/rally.d.ts +22 -0
  51. package/dist/IconUI/material/rally.js +50 -0
  52. package/dist/ImageUI/index.d.ts +13 -0
  53. package/dist/ImageUI/index.js +159 -0
  54. package/dist/ImageUI/index.scss +59 -0
  55. package/dist/InputUI/index.d.ts +7 -0
  56. package/dist/InputUI/index.js +114 -0
  57. package/dist/InputUI/index.scss +24 -0
  58. package/dist/LoadingUI/index.d.ts +4 -0
  59. package/dist/LoadingUI/index.js +13 -0
  60. package/dist/LoadingUI/index.scss +47 -0
  61. package/dist/MessageUI/index.d.ts +3 -0
  62. package/dist/MessageUI/index.js +9 -0
  63. package/dist/MessageUI/index.scss +50 -0
  64. package/dist/ModalUI/index.d.ts +4 -0
  65. package/dist/ModalUI/index.js +98 -0
  66. package/dist/ModalUI/index.scss +45 -0
  67. package/dist/NotificationUI/index.d.ts +3 -0
  68. package/dist/NotificationUI/index.js +30 -0
  69. package/dist/NotificationUI/index.scss +0 -0
  70. package/dist/PasswordStrongUI/index.d.ts +8 -0
  71. package/dist/PasswordStrongUI/index.js +67 -0
  72. package/dist/PasswordStrongUI/index.scss +35 -0
  73. package/dist/RichEditorUI/index.d.ts +10 -0
  74. package/dist/RichEditorUI/index.js +68 -0
  75. package/dist/RichEditorUI/index.scss +20 -0
  76. package/dist/SearchUI/index.d.ts +4 -0
  77. package/dist/SearchUI/index.js +55 -0
  78. package/dist/SearchUI/index.scss +20 -0
  79. package/dist/SelectUI/index.d.ts +13 -0
  80. package/dist/SelectUI/index.js +87 -0
  81. package/dist/SelectUI/index.scss +13 -0
  82. package/dist/StatisticUI/index.d.ts +20 -0
  83. package/dist/StatisticUI/index.js +70 -0
  84. package/dist/StatisticUI/index.scss +6 -0
  85. package/dist/SwitchUI/index.d.ts +4 -0
  86. package/dist/SwitchUI/index.js +24 -0
  87. package/dist/SwitchUI/index.scss +0 -0
  88. package/dist/TableUI/demo/index.scss +7 -0
  89. package/dist/TableUI/demo/setting.d.ts +4 -0
  90. package/dist/TableUI/demo/setting.js +107 -0
  91. package/dist/TableUI/index.d.ts +12 -0
  92. package/dist/TableUI/index.js +109 -0
  93. package/dist/TableUI/index.scss +40 -0
  94. package/dist/TableUI/material/Button/index.d.ts +4 -0
  95. package/dist/TableUI/material/Button/index.js +20 -0
  96. package/dist/TableUI/material/Button/index.scss +35 -0
  97. package/dist/TableUI/material/HideMultipleLines/index.d.ts +4 -0
  98. package/dist/TableUI/material/HideMultipleLines/index.js +48 -0
  99. package/dist/TableUI/material/HideMultipleLines/index.scss +11 -0
  100. package/dist/TableUI/material/MultiLine/index.d.ts +4 -0
  101. package/dist/TableUI/material/MultiLine/index.js +23 -0
  102. package/dist/TableUI/material/MultiLine/index.scss +25 -0
  103. package/dist/TableUI/material/Operate/index.d.ts +3 -0
  104. package/dist/TableUI/material/Operate/index.js +43 -0
  105. package/dist/TableUI/material/Operate/index.scss +25 -0
  106. package/dist/TableUI/material/Setting/index.d.ts +3 -0
  107. package/dist/TableUI/material/Setting/index.js +211 -0
  108. package/dist/TableUI/material/Setting/index.scss +52 -0
  109. package/dist/TagUI/index.d.ts +17 -0
  110. package/dist/TagUI/index.js +118 -0
  111. package/dist/TagUI/index.scss +41 -0
  112. package/dist/TestUI/index.d.ts +3 -0
  113. package/dist/TestUI/index.js +5 -0
  114. package/dist/TestUI/index.scss +0 -0
  115. package/dist/TextUI/index.d.ts +7 -0
  116. package/dist/TextUI/index.js +17 -0
  117. package/dist/TextUI/index.scss +10 -0
  118. package/dist/Tiga/demo/demoQuick.d.ts +3 -0
  119. package/dist/Tiga/demo/demoQuick.js +104 -0
  120. package/dist/Tiga/demo/demoQuickType.d.ts +8 -0
  121. package/dist/Tiga/demo/demoQuickType.js +94 -0
  122. package/dist/Tiga/index.d.ts +4 -0
  123. package/dist/Tiga/index.js +68 -0
  124. package/dist/Tiga/index.scss +0 -0
  125. package/dist/Tiga/material/quickType.d.ts +29 -0
  126. package/dist/Tiga/material/quickType.js +75 -0
  127. package/dist/UploadUI/index.d.ts +23 -0
  128. package/dist/UploadUI/index.js +383 -0
  129. package/dist/UploadUI/index.scss +202 -0
  130. package/dist/UploadUI/type.d.ts +4 -0
  131. package/dist/UploadUI/type.js +30 -0
  132. package/dist/VesselUI/index.d.ts +3 -0
  133. package/dist/VesselUI/index.js +199 -0
  134. package/dist/VesselUI/type.d.ts +64 -0
  135. package/dist/VesselUI/type.js +1 -0
  136. package/dist/VideoPreviewUI/index.d.ts +11 -0
  137. package/dist/VideoPreviewUI/index.js +65 -0
  138. package/dist/VideoPreviewUI/index.scss +32 -0
  139. package/dist/assets/index.d.ts +1 -0
  140. package/dist/assets/index.js +1 -0
  141. package/dist/index.d.ts +34 -0
  142. package/dist/index.js +34 -0
  143. package/package.json +87 -0
@@ -0,0 +1,211 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["children"];
3
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
4
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
5
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
6
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
7
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
8
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
9
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
10
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
11
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
12
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
13
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
14
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
15
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
16
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
17
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
+ import React, { useEffect, useState } from 'react';
22
+ import { Table, Checkbox } from 'antd';
23
+ import { IconUI, ButtonUI } from "../../..";
24
+ import { DndContext } from '@dnd-kit/core';
25
+ import { restrictToVerticalAxis } from '@dnd-kit/modifiers';
26
+ import { arrayMove, SortableContext, useSortable, verticalListSortingStrategy } from '@dnd-kit/sortable';
27
+ import { CSS } from '@dnd-kit/utilities';
28
+ import "./index.scss";
29
+ export var Setting = function Setting(props) {
30
+ var openModifyHeader = props.openModifyHeader,
31
+ setOpenModifyHeader = props.setOpenModifyHeader,
32
+ tableHeader = props.tableHeader,
33
+ getTableheader = props.getTableheader,
34
+ scrollHeight = props.scrollHeight;
35
+ var _useState = useState(),
36
+ _useState2 = _slicedToArray(_useState, 2),
37
+ dataSource = _useState2[0],
38
+ setDataSource = _useState2[1];
39
+ useEffect(function () {
40
+ setDataSource(tableHeader);
41
+ }, [tableHeader]);
42
+ var Row = function Row(_ref) {
43
+ var _React$Children;
44
+ var children = _ref.children,
45
+ props = _objectWithoutProperties(_ref, _excluded);
46
+ var _useSortable = useSortable({
47
+ id: props['data-row-key'],
48
+ disabled: props['data-row-key'] === 0 || props['data-row-key'] === dataSource.length - 1
49
+ }),
50
+ attributes = _useSortable.attributes,
51
+ listeners = _useSortable.listeners,
52
+ setNodeRef = _useSortable.setNodeRef,
53
+ setActivatorNodeRef = _useSortable.setActivatorNodeRef,
54
+ transform = _useSortable.transform,
55
+ transition = _useSortable.transition,
56
+ isDragging = _useSortable.isDragging;
57
+ var rowClass = props['data-row-key'] === 0 || props['data-row-key'] === dataSource.length - 1 ? 'disabled-row' : '';
58
+ var style = _objectSpread(_objectSpread({}, props.style), {}, {
59
+ transform: CSS.Transform.toString(transform && _objectSpread(_objectSpread({}, transform), {}, {
60
+ scaleY: 1
61
+ })),
62
+ transition: transition
63
+ }, isDragging ? {
64
+ position: 'relative',
65
+ zIndex: 9999
66
+ } : {});
67
+ return /*#__PURE__*/React.createElement("tr", _extends({}, props, {
68
+ ref: setNodeRef,
69
+ style: style,
70
+ className: rowClass
71
+ }, attributes), (_React$Children = React.Children) === null || _React$Children === void 0 ? void 0 : _React$Children.map(children, function (child) {
72
+ if (child.key === 'sort') {
73
+ return /*#__PURE__*/React.cloneElement(child, {
74
+ children: /*#__PURE__*/React.createElement(IconUI, _extends({
75
+ name: "HamburgerButton",
76
+ ref: setActivatorNodeRef,
77
+ size: 16,
78
+ style: {
79
+ touchAction: 'none',
80
+ cursor: 'move'
81
+ }
82
+ }, listeners))
83
+ });
84
+ }
85
+ return child;
86
+ }));
87
+ };
88
+ var onClose = function onClose() {
89
+ setOpenModifyHeader(false);
90
+ };
91
+ var columns = [{
92
+ key: 'sort',
93
+ width: 40,
94
+ align: 'center',
95
+ render: function render(_, record) {
96
+ return /*#__PURE__*/React.createElement(Checkbox, {
97
+ checked: record.selected,
98
+ onChange: function onChange(e) {
99
+ record.selected = e.target.checked;
100
+ setDataSource(_toConsumableArray(dataSource));
101
+ }
102
+ });
103
+ }
104
+ }, {
105
+ key: 'checkbox',
106
+ width: 36,
107
+ align: 'center',
108
+ render: function render(_, record) {
109
+ return /*#__PURE__*/React.createElement(Checkbox, {
110
+ disabled: record === null || record === void 0 ? void 0 : record.disable,
111
+ checked: record.selected,
112
+ onChange: function onChange(e) {
113
+ record.selected = e.target.checked;
114
+ setDataSource(_toConsumableArray(dataSource));
115
+ }
116
+ });
117
+ }
118
+ }, {
119
+ title: '表名',
120
+ dataIndex: 'name'
121
+ }];
122
+ // 移动表头
123
+ var onDragEnd = function onDragEnd(event) {
124
+ var active = event.active,
125
+ over = event.over;
126
+ if (active.id !== (over === null || over === void 0 ? void 0 : over.id)) {
127
+ var arr = [active === null || active === void 0 ? void 0 : active.id, over === null || over === void 0 ? void 0 : over.id];
128
+ var isMove = tableHeader === null || tableHeader === void 0 ? void 0 : tableHeader.filter(function (item) {
129
+ return item.disable;
130
+ }).map(function (item) {
131
+ return arr.includes(item.key);
132
+ });
133
+ if (!(isMove !== null && isMove !== void 0 && isMove.includes(true))) {
134
+ var sort = function sort(previous) {
135
+ var activeIndex = previous.findIndex(function (i) {
136
+ return i.key === active.id;
137
+ });
138
+ var overIndex = previous.findIndex(function (i) {
139
+ return i.key === (over === null || over === void 0 ? void 0 : over.id);
140
+ });
141
+ return arrayMove(previous, activeIndex, overIndex);
142
+ };
143
+ setDataSource(function (previous) {
144
+ return sort(previous);
145
+ });
146
+ }
147
+ }
148
+ };
149
+ // 获取新的表格头部
150
+ var handleGetSortedData = function handleGetSortedData() {
151
+ // eslint-disable-next-line array-callback-return
152
+ dataSource === null || dataSource === void 0 || dataSource.map(function (item, i) {
153
+ item.sort = i + 1;
154
+ });
155
+ getTableheader(dataSource);
156
+ onClose();
157
+ };
158
+ return /*#__PURE__*/React.createElement("div", {
159
+ className: "sic-tableui-setting",
160
+ onClick: function onClick(e) {
161
+ return e.stopPropagation();
162
+ }
163
+ }, /*#__PURE__*/React.createElement("div", {
164
+ className: "sic-tableui-setting-icon",
165
+ onClick: function onClick(e) {
166
+ e.stopPropagation();
167
+ setOpenModifyHeader(!openModifyHeader);
168
+ }
169
+ }, /*#__PURE__*/React.createElement(IconUI, {
170
+ name: "Setting",
171
+ theme: "outline",
172
+ size: "16",
173
+ fill: 'var(--themeColor)'
174
+ })), openModifyHeader && (dataSource === null || dataSource === void 0 ? void 0 : dataSource.length) > 0 && /*#__PURE__*/React.createElement("div", {
175
+ className: "sic-tableui-setting-modify"
176
+ }, /*#__PURE__*/React.createElement("div", {
177
+ className: "modify-title"
178
+ }, "\u8868\u5934\u540D\u79F0"), /*#__PURE__*/React.createElement(DndContext, {
179
+ modifiers: [restrictToVerticalAxis],
180
+ onDragEnd: onDragEnd
181
+ }, /*#__PURE__*/React.createElement(SortableContext, {
182
+ items: dataSource === null || dataSource === void 0 ? void 0 : dataSource.map(function (i) {
183
+ return i.key;
184
+ }),
185
+ strategy: verticalListSortingStrategy
186
+ }, /*#__PURE__*/React.createElement(Table, {
187
+ components: {
188
+ body: {
189
+ row: Row
190
+ }
191
+ },
192
+ rowKey: "key",
193
+ columns: columns,
194
+ dataSource: dataSource,
195
+ pagination: false,
196
+ showHeader: false,
197
+ scroll: {
198
+ y: scrollHeight
199
+ }
200
+ }))), /*#__PURE__*/React.createElement("div", {
201
+ className: "modify-footer"
202
+ }, /*#__PURE__*/React.createElement(ButtonUI, {
203
+ type: "primary",
204
+ onClick: handleGetSortedData
205
+ }, "\u786E\u5B9A"), /*#__PURE__*/React.createElement(ButtonUI, {
206
+ onClick: onClose,
207
+ style: {
208
+ marginLeft: 12
209
+ }
210
+ }, "\u53D6\u6D88"))));
211
+ };
@@ -0,0 +1,52 @@
1
+ .sic-tableui-setting {
2
+ position: relative;
3
+ &-icon {
4
+ width: 24px;
5
+ height: 24px;
6
+ border: 1px solid var(--themeColor);
7
+ display: inline-flex;
8
+ align-items: center;
9
+ justify-content: center;
10
+ border-radius: 4px;
11
+ cursor: pointer;
12
+ }
13
+ &-modify {
14
+ position: absolute;
15
+ top: 30px;
16
+ right: 0;
17
+ z-index: 99999;
18
+ width: 200px;
19
+ display: flex;
20
+ flex-direction: column;
21
+ background-color: #fff;
22
+ border-radius: 4px;
23
+ box-shadow: -2px 4px 20px 0px rgba(51, 51, 51, 0.1);
24
+ .modify-title {
25
+ height: 44px;
26
+ background-color: #f9f9f9;
27
+ font-size: 14px;
28
+ text-align: center;
29
+ line-height: 44px;
30
+ font-weight: bold;
31
+ }
32
+ .modify-footer {
33
+ display: flex;
34
+ justify-content: center;
35
+ height: 32px;
36
+ margin: 17px;
37
+ margin-bottom: 20px;
38
+ }
39
+ .ant-table {
40
+ border-radius: 0;
41
+ }
42
+ .ant-table-tbody > tr > td {
43
+ padding: 8px 0;
44
+ .ant-checkbox-wrapper {
45
+ align-items: end;
46
+ }
47
+ }
48
+ .ant-table-tbody tr:nth-child(2n) {
49
+ background-color: #f9f9f9;
50
+ }
51
+ }
52
+ }
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface IProps {
4
+ className?: string;
5
+ title?: string;
6
+ type?: string | number;
7
+ size?: 'default' | 'large';
8
+ options?: any[];
9
+ dataIndex?: string | number;
10
+ children?: React.ReactNode;
11
+ icon?: React.ReactNode;
12
+ width?: string | number;
13
+ style?: React.CSSProperties;
14
+ onClick?: (params?: any) => void;
15
+ }
16
+ declare const TagUI: (props: IProps) => React.JSX.Element;
17
+ export default TagUI;
@@ -0,0 +1,118 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["className", "title", "type", "size", "options", "dataIndex", "children", "icon", "width", "style"];
3
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
4
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
7
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
8
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
9
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
10
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
11
+ import React, { useMemo } from 'react';
12
+ import { getOptionConfig } from 'sic-util';
13
+ import "./index.scss";
14
+
15
+ // 配置色枚举
16
+ var themeList = [{
17
+ type: 'primary',
18
+ name: '主题色',
19
+ color: 'var(--themeColor)',
20
+ bgcolor: 'var(--themeColor1)'
21
+ }, {
22
+ type: '1',
23
+ name: '绿色',
24
+ color: '#1EAF69',
25
+ bgcolor: 'rgba(30, 175, 105, 0.10)'
26
+ }, {
27
+ type: '2',
28
+ name: '紫色',
29
+ color: '#9747FF',
30
+ bgcolor: 'rgba(151, 71, 255, 0.10)'
31
+ }, {
32
+ type: '3',
33
+ name: '蓝色',
34
+ color: '#2E64FA',
35
+ bgcolor: 'rgba(46, 100, 250, 0.10)'
36
+ }, {
37
+ type: '4',
38
+ name: '灰色',
39
+ color: '#666666',
40
+ bgcolor: '#F5F5F5'
41
+ }, {
42
+ type: '5',
43
+ name: '黄色',
44
+ color: '#FFC22C',
45
+ bgcolor: 'rgba(255, 194, 44, 0.10)'
46
+ }, {
47
+ type: '6',
48
+ name: '红色',
49
+ color: '#ff7875',
50
+ bgcolor: 'rgba(255, 120, 117, 0.10)'
51
+ }, {
52
+ type: '7',
53
+ name: '深红',
54
+ color: '#9E031A',
55
+ bgcolor: 'rgba(158, 3, 26, 0.10)'
56
+ }, {
57
+ type: '8',
58
+ name: '淡青',
59
+ color: '#13C2C2',
60
+ bgcolor: 'rgba(19, 194, 194, 0.1)'
61
+ }, {
62
+ type: '9',
63
+ name: '粉红',
64
+ color: '#F759AB',
65
+ bgcolor: ' rgba(247, 89, 171, 0.1)'
66
+ }, {
67
+ type: '10',
68
+ name: '橄榄色',
69
+ color: '#5B8C00',
70
+ bgcolor: ' rgba(91, 140, 0, 0.10)'
71
+ }];
72
+ var TagUI = function TagUI(props) {
73
+ var className = props.className,
74
+ title = props.title,
75
+ type = props.type,
76
+ _props$size = props.size,
77
+ size = _props$size === void 0 ? 'default' : _props$size,
78
+ options = props.options,
79
+ dataIndex = props.dataIndex,
80
+ children = props.children,
81
+ icon = props.icon,
82
+ width = props.width,
83
+ style = props.style,
84
+ otherProps = _objectWithoutProperties(props, _excluded);
85
+ var theme = useMemo(function () {
86
+ var _getOptionConfig;
87
+ var newType = !!options && (options === null || options === void 0 ? void 0 : options.length) > 0 ? (_getOptionConfig = getOptionConfig(dataIndex, options)) === null || _getOptionConfig === void 0 ? void 0 : _getOptionConfig.type : type;
88
+ return themeList.find(function (item) {
89
+ return item.type === String(newType);
90
+ });
91
+ }, [type, options, dataIndex]);
92
+ if (!!title) {
93
+ return /*#__PURE__*/React.createElement("div", {
94
+ className: "sic-tagTitleui ".concat(className !== null && className !== void 0 ? className : '')
95
+ }, /*#__PURE__*/React.createElement("div", {
96
+ className: "sic-tagTitleui-title",
97
+ style: {
98
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.color
99
+ }
100
+ }, title), /*#__PURE__*/React.createElement("div", {
101
+ className: "sic-tagTitleui-content",
102
+ style: {
103
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.bgcolor
104
+ }
105
+ }, !!options && (options === null || options === void 0 ? void 0 : options.length) > 0 ? getOptionConfig(dataIndex, options) : children, icon));
106
+ } else {
107
+ var _getOptionConfig2;
108
+ return /*#__PURE__*/React.createElement("div", _extends({
109
+ className: "sic-tagui ".concat(size === 'large' ? 'sic-tagui-large' : '', " ").concat(className !== null && className !== void 0 ? className : ''),
110
+ style: _objectSpread({
111
+ width: width !== null && width !== void 0 ? width : 'auto',
112
+ color: theme === null || theme === void 0 ? void 0 : theme.color,
113
+ backgroundColor: theme === null || theme === void 0 ? void 0 : theme.bgcolor
114
+ }, style)
115
+ }, otherProps), !!options && (options === null || options === void 0 ? void 0 : options.length) > 0 ? (_getOptionConfig2 = getOptionConfig(dataIndex, options)) === null || _getOptionConfig2 === void 0 ? void 0 : _getOptionConfig2.label : children, icon);
116
+ }
117
+ };
118
+ export default TagUI;
@@ -0,0 +1,41 @@
1
+ .sic-tagTitleui {
2
+ display: inline-flex;
3
+ font-size: 12px;
4
+ line-height: 14px;
5
+ &-title {
6
+ box-sizing: border-box;
7
+ padding: 4px 8px;
8
+ color: #fff;
9
+ border-radius: 4px 0 0 4px;
10
+ }
11
+
12
+ &-content {
13
+ box-sizing: border-box;
14
+ padding: 4px 8px;
15
+ display: inline-flex;
16
+ align-items: center;
17
+ justify-content: center;
18
+ gap: 2px;
19
+ border-radius: 0 4px 4px 0;
20
+ }
21
+ }
22
+
23
+ .sic-tagui {
24
+ box-sizing: border-box;
25
+ padding: 4px 8px;
26
+ font-size: 12px;
27
+ line-height: 14px;
28
+ display: inline-flex;
29
+ align-items: center;
30
+ justify-content: center;
31
+ gap: 2px;
32
+ border-radius: 4px;
33
+ }
34
+ .sic-tagui-large {
35
+ box-sizing: border-box;
36
+ padding: 6px 12px;
37
+ font-size: 18px;
38
+ line-height: 20px;
39
+ font-weight: bold;
40
+ gap: 4px;
41
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const TestUI: (props: any) => React.JSX.Element;
3
+ export default TestUI;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ var TestUI = function TestUI(props) {
3
+ return /*#__PURE__*/React.createElement("div", null, props === null || props === void 0 ? void 0 : props.children);
4
+ };
5
+ export default TestUI;
File without changes
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ import './index.scss';
3
+ interface TextUIProps extends React.HTMLAttributes<HTMLDivElement> {
4
+ type?: 'primary' | 'danger';
5
+ }
6
+ declare const TextUI: (props: TextUIProps) => React.JSX.Element;
7
+ export default TextUI;
@@ -0,0 +1,17 @@
1
+ var _excluded = ["className", "type", "children"];
2
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
3
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
4
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
5
+ import React from 'react';
6
+ import "./index.scss";
7
+ var TextUI = function TextUI(props) {
8
+ var className = props.className,
9
+ _props$type = props.type,
10
+ type = _props$type === void 0 ? 'primary' : _props$type,
11
+ children = props.children,
12
+ otherProps = _objectWithoutProperties(props, _excluded);
13
+ return /*#__PURE__*/React.createElement("div", _extends({
14
+ className: "textUI ".concat(className !== null && className !== void 0 ? className : '', " ").concat(type !== null && type !== void 0 ? type : '')
15
+ }, otherProps), children);
16
+ };
17
+ export default TextUI;
@@ -0,0 +1,10 @@
1
+ .textUI {
2
+ cursor: pointer;
3
+ }
4
+
5
+ .textUI.primary {
6
+ color: var(--themeColor);
7
+ }
8
+ .textUI.danger {
9
+ color: var(--red);
10
+ }
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ declare const DemoQuick: () => React.JSX.Element;
3
+ export default DemoQuick;
@@ -0,0 +1,104 @@
1
+ function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
2
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
3
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
5
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
6
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
7
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
+ import React, { useState, useEffect } from 'react';
9
+ import { Tiga, LoadingUI } from "../..";
10
+ var DemoQuick = function DemoQuick() {
11
+ var _useState = useState(),
12
+ _useState2 = _slicedToArray(_useState, 2),
13
+ data = _useState2[0],
14
+ setData = _useState2[1];
15
+ var columns1 = [{
16
+ key: 'name',
17
+ name: '姓名'
18
+ }, {
19
+ key: 'age',
20
+ name: '年龄'
21
+ }, {
22
+ key: 'phone',
23
+ name: '电话'
24
+ }];
25
+ var columns2 = [{
26
+ key: 'name',
27
+ name: '姓名',
28
+ sort: 1
29
+ }, {
30
+ key: 'age',
31
+ name: '年龄',
32
+ sort: 4
33
+ }, {
34
+ key: 'phone',
35
+ name: '电话',
36
+ sort: 3
37
+ }];
38
+ var columns3 = [{
39
+ key: 'name',
40
+ name: '姓名',
41
+ sort: 1
42
+ }, {
43
+ key: 'age',
44
+ name: '年龄',
45
+ sort: 4
46
+ }, {
47
+ key: 'phone',
48
+ name: '电话',
49
+ sort: 3,
50
+ selected: false
51
+ }, {
52
+ key: 'fighting',
53
+ name: '战力',
54
+ sort: 2
55
+ }];
56
+ var dataSource = [{
57
+ name: '刘备',
58
+ age: 22,
59
+ phone: 15692837652,
60
+ fighting: 6
61
+ }, {
62
+ name: '关羽',
63
+ age: 21,
64
+ phone: 17697787678,
65
+ fighting: 9
66
+ }, {
67
+ name: '张飞',
68
+ age: 18,
69
+ phone: 12392880611,
70
+ fighting: 7
71
+ }, {
72
+ name: '赵云',
73
+ age: 19,
74
+ phone: 12392880611,
75
+ fighting: 8
76
+ }];
77
+ var current = 1;
78
+ var pageSize = 10;
79
+ var total = 4;
80
+ var tableParams = {
81
+ dataSource: data,
82
+ pageSize: pageSize,
83
+ current: current,
84
+ total: total
85
+ };
86
+ useEffect(function () {
87
+ setTimeout(function () {
88
+ setData(dataSource);
89
+ }, 2000);
90
+ }, []);
91
+ return /*#__PURE__*/React.createElement("div", null, "\u57FA\u7840\u6A21\u5F0F", /*#__PURE__*/React.createElement(LoadingUI, {
92
+ isShowLoading: !data
93
+ }, /*#__PURE__*/React.createElement(Tiga, _extends({
94
+ rowKey: "name",
95
+ tableHeader: columns1
96
+ }, tableParams))), "\u5E26\u6709\u6392\u5E8F", /*#__PURE__*/React.createElement(Tiga, _extends({
97
+ rowKey: "name",
98
+ tableHeader: columns2
99
+ }, tableParams)), "\u5E26\u6709\u7981\u7528", /*#__PURE__*/React.createElement(Tiga, _extends({
100
+ rowKey: "name",
101
+ tableHeader: columns3
102
+ }, tableParams)));
103
+ };
104
+ export default DemoQuick;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export declare const FEERATETYPE: {
3
+ value: number;
4
+ label: string;
5
+ type: number;
6
+ }[];
7
+ declare const DemoQuickType: () => React.JSX.Element;
8
+ export default DemoQuickType;