tntd 2.8.45 → 2.8.46

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 (185) hide show
  1. package/es/alert/alert.js +153 -0
  2. package/es/alert/alert.js.map +1 -0
  3. package/es/alert/alert.less +128 -0
  4. package/es/cascader/cascader.js +84 -0
  5. package/es/cascader/cascader.js.map +1 -0
  6. package/es/cascader/cascader.less +16 -0
  7. package/es/checkbox/check.png +0 -0
  8. package/es/checkbox/checkbox.js +100 -0
  9. package/es/checkbox/checkbox.js.map +1 -0
  10. package/es/checkbox/checkbox.less +69 -0
  11. package/es/date-picker/DatePicker.js +163 -0
  12. package/es/date-picker/DatePicker.js.map +1 -0
  13. package/es/date-picker/index.less +294 -0
  14. package/es/input-number/inputNumber.js +89 -0
  15. package/es/input-number/inputNumber.js.map +1 -0
  16. package/es/input-number/inputNumber.less +12 -0
  17. package/es/modal/index.less +36 -0
  18. package/es/modal/modal.js +5 -3
  19. package/es/modal/modal.js.map +1 -1
  20. package/es/modal/modal.less +16 -0
  21. package/es/popconfirm/index.less +32 -0
  22. package/es/popconfirm/popconfirm.js +96 -0
  23. package/es/popconfirm/popconfirm.js.map +1 -0
  24. package/es/popover/index.less +57 -0
  25. package/es/popover/popover.js +90 -0
  26. package/es/popover/popover.js.map +1 -0
  27. package/es/progress/progress.js +185 -0
  28. package/es/progress/progress.js.map +1 -0
  29. package/es/progress/progress.less +82 -0
  30. package/es/query-form/Field/Composition/FieldPopover.js +466 -0
  31. package/es/query-form/Field/Composition/FieldPopover.js.map +1 -0
  32. package/es/query-form/Field/Composition/FieldPopover.less +41 -0
  33. package/es/query-form/Field/Composition/Select.js +260 -0
  34. package/es/query-form/Field/Composition/Select.js.map +1 -0
  35. package/es/query-form/Field/Composition/SelectInput.js +112 -0
  36. package/es/query-form/Field/Composition/SelectInput.js.map +1 -0
  37. package/es/query-form/Field/Composition/ValueTag.js +241 -0
  38. package/es/query-form/Field/Composition/ValueTag.js.map +1 -0
  39. package/es/query-form/Field/Composition/index.js +448 -0
  40. package/es/query-form/Field/Composition/index.js.map +1 -0
  41. package/es/query-form/Field/Composition/index.less +167 -0
  42. package/es/query-form/Field/Composition/utils.js +173 -0
  43. package/es/query-form/Field/Composition/utils.js.map +1 -0
  44. package/es/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  45. package/es/query-form-backup/Field/Composition/index.less +114 -0
  46. package/es/query-form-backup/index.less +90 -0
  47. package/es/query-form-v2/index.less +133 -0
  48. package/es/radio/radio.js +110 -0
  49. package/es/radio/radio.js.map +1 -0
  50. package/es/radio/radio.less +43 -0
  51. package/es/spin/spin.js +79 -0
  52. package/es/spin/spin.js.map +1 -0
  53. package/es/spin/spin.less +9 -0
  54. package/es/steps/assets/background_left.svg +12 -0
  55. package/es/steps/assets/background_right.svg +12 -0
  56. package/es/steps/assets/horizontal_line.svg +3 -0
  57. package/es/steps/assets/vertical_line.svg +3 -0
  58. package/es/steps/stepStyle/icon.less +51 -0
  59. package/es/steps/stepStyle/progress-dot.less +10 -0
  60. package/es/steps/stepStyle/variables.less +8 -0
  61. package/es/steps/stepStyle/vertical.less +41 -0
  62. package/es/switch/index.less +45 -0
  63. package/es/tabs/tabs.less +125 -0
  64. package/es/time-picker/TimePicker.js +90 -0
  65. package/es/time-picker/TimePicker.js.map +1 -0
  66. package/es/time-picker/index.less +38 -0
  67. package/es/tntd-action/Action.js +219 -0
  68. package/es/tntd-action/Action.js.map +1 -0
  69. package/es/tntd-action/index.less +61 -0
  70. package/es/tntd-select/index.less +7 -0
  71. package/lib/alert/alert.d.ts +12 -0
  72. package/lib/alert/alert.d.ts.map +1 -0
  73. package/lib/alert/alert.js +153 -0
  74. package/lib/alert/alert.js.map +1 -0
  75. package/lib/alert/alert.less +128 -0
  76. package/lib/cascader/cascader.d.ts +10 -0
  77. package/lib/cascader/cascader.d.ts.map +1 -0
  78. package/lib/cascader/cascader.js +84 -0
  79. package/lib/cascader/cascader.js.map +1 -0
  80. package/lib/cascader/cascader.less +16 -0
  81. package/lib/checkbox/check.png +0 -0
  82. package/lib/checkbox/checkbox.d.ts +16 -0
  83. package/lib/checkbox/checkbox.d.ts.map +1 -0
  84. package/lib/checkbox/checkbox.js +100 -0
  85. package/lib/checkbox/checkbox.js.map +1 -0
  86. package/lib/checkbox/checkbox.less +69 -0
  87. package/lib/date-picker/DatePicker.d.ts +21 -0
  88. package/lib/date-picker/DatePicker.d.ts.map +1 -0
  89. package/lib/date-picker/DatePicker.js +163 -0
  90. package/lib/date-picker/DatePicker.js.map +1 -0
  91. package/lib/date-picker/index.less +294 -0
  92. package/lib/input-number/inputNumber.d.ts +10 -0
  93. package/lib/input-number/inputNumber.d.ts.map +1 -0
  94. package/lib/input-number/inputNumber.js +89 -0
  95. package/lib/input-number/inputNumber.js.map +1 -0
  96. package/lib/input-number/inputNumber.less +12 -0
  97. package/lib/modal/index.less +36 -0
  98. package/lib/modal/modal.d.ts +1 -0
  99. package/lib/modal/modal.d.ts.map +1 -1
  100. package/lib/modal/modal.js +5 -3
  101. package/lib/modal/modal.js.map +1 -1
  102. package/lib/modal/modal.less +16 -0
  103. package/lib/popconfirm/index.less +32 -0
  104. package/lib/popconfirm/popconfirm.d.ts +8 -0
  105. package/lib/popconfirm/popconfirm.d.ts.map +1 -0
  106. package/lib/popconfirm/popconfirm.js +96 -0
  107. package/lib/popconfirm/popconfirm.js.map +1 -0
  108. package/lib/popover/index.less +57 -0
  109. package/lib/popover/popover.d.ts +14 -0
  110. package/lib/popover/popover.d.ts.map +1 -0
  111. package/lib/popover/popover.js +90 -0
  112. package/lib/popover/popover.js.map +1 -0
  113. package/lib/progress/progress.d.ts +12 -0
  114. package/lib/progress/progress.d.ts.map +1 -0
  115. package/lib/progress/progress.js +185 -0
  116. package/lib/progress/progress.js.map +1 -0
  117. package/lib/progress/progress.less +82 -0
  118. package/lib/query-form/Field/Composition/FieldPopover.d.ts +19 -0
  119. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +1 -0
  120. package/lib/query-form/Field/Composition/FieldPopover.js +466 -0
  121. package/lib/query-form/Field/Composition/FieldPopover.js.map +1 -0
  122. package/lib/query-form/Field/Composition/FieldPopover.less +41 -0
  123. package/lib/query-form/Field/Composition/Select.d.ts +4 -0
  124. package/lib/query-form/Field/Composition/Select.d.ts.map +1 -0
  125. package/lib/query-form/Field/Composition/Select.js +260 -0
  126. package/lib/query-form/Field/Composition/Select.js.map +1 -0
  127. package/lib/query-form/Field/Composition/SelectInput.d.ts +3 -0
  128. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +1 -0
  129. package/lib/query-form/Field/Composition/SelectInput.js +112 -0
  130. package/lib/query-form/Field/Composition/SelectInput.js.map +1 -0
  131. package/lib/query-form/Field/Composition/ValueTag.d.ts +13 -0
  132. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +1 -0
  133. package/lib/query-form/Field/Composition/ValueTag.js +241 -0
  134. package/lib/query-form/Field/Composition/ValueTag.js.map +1 -0
  135. package/lib/query-form/Field/Composition/index.d.ts +15 -0
  136. package/lib/query-form/Field/Composition/index.d.ts.map +1 -0
  137. package/lib/query-form/Field/Composition/index.js +448 -0
  138. package/lib/query-form/Field/Composition/index.js.map +1 -0
  139. package/lib/query-form/Field/Composition/index.less +167 -0
  140. package/lib/query-form/Field/Composition/utils.d.ts +21 -0
  141. package/lib/query-form/Field/Composition/utils.d.ts.map +1 -0
  142. package/lib/query-form/Field/Composition/utils.js +173 -0
  143. package/lib/query-form/Field/Composition/utils.js.map +1 -0
  144. package/lib/query-form-backup/Field/Composition/FieldPopover.less +35 -0
  145. package/lib/query-form-backup/Field/Composition/index.less +114 -0
  146. package/lib/query-form-backup/index.less +90 -0
  147. package/lib/query-form-v2/index.less +133 -0
  148. package/lib/radio/radio.d.ts +17 -0
  149. package/lib/radio/radio.d.ts.map +1 -0
  150. package/lib/radio/radio.js +110 -0
  151. package/lib/radio/radio.js.map +1 -0
  152. package/lib/radio/radio.less +43 -0
  153. package/lib/spin/spin.d.ts +9 -0
  154. package/lib/spin/spin.d.ts.map +1 -0
  155. package/lib/spin/spin.js +79 -0
  156. package/lib/spin/spin.js.map +1 -0
  157. package/lib/spin/spin.less +9 -0
  158. package/lib/steps/assets/background_left.svg +12 -0
  159. package/lib/steps/assets/background_right.svg +12 -0
  160. package/lib/steps/assets/horizontal_line.svg +3 -0
  161. package/lib/steps/assets/vertical_line.svg +3 -0
  162. package/lib/steps/stepStyle/icon.less +51 -0
  163. package/lib/steps/stepStyle/progress-dot.less +10 -0
  164. package/lib/steps/stepStyle/variables.less +8 -0
  165. package/lib/steps/stepStyle/vertical.less +41 -0
  166. package/lib/switch/index.less +45 -0
  167. package/lib/tabs/tabs.less +125 -0
  168. package/lib/time-picker/TimePicker.d.ts +9 -0
  169. package/lib/time-picker/TimePicker.d.ts.map +1 -0
  170. package/lib/time-picker/TimePicker.js +90 -0
  171. package/lib/time-picker/TimePicker.js.map +1 -0
  172. package/lib/time-picker/index.less +38 -0
  173. package/lib/tntd-action/Action.d.ts +6 -0
  174. package/lib/tntd-action/Action.d.ts.map +1 -0
  175. package/lib/tntd-action/Action.js +219 -0
  176. package/lib/tntd-action/Action.js.map +1 -0
  177. package/lib/tntd-action/index.less +61 -0
  178. package/lib/tntd-select/index.less +7 -0
  179. package/package.json +2 -2
  180. package/es/array-input/utils.js +0 -414
  181. package/es/array-input/utils.js.map +0 -1
  182. package/lib/array-input/utils.d.ts +0 -2
  183. package/lib/array-input/utils.d.ts.map +0 -1
  184. package/lib/array-input/utils.js +0 -414
  185. package/lib/array-input/utils.js.map +0 -1
@@ -0,0 +1,173 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.formatLabel = formatLabel;
7
+ exports.getLabel = getLabel;
8
+ exports.getLabelByValue = getLabelByValue;
9
+ exports.highlightSubstring = highlightSubstring;
10
+ exports.isInput = void 0;
11
+ exports.parseArrayToObject = parseArrayToObject;
12
+ exports.parseObjectToArray = parseObjectToArray;
13
+ var _flatten2 = _interopRequireDefault(require("lodash/flatten"));
14
+ var _isString2 = _interopRequireDefault(require("lodash/isString"));
15
+ var _isArray2 = _interopRequireDefault(require("lodash/isArray"));
16
+ var _react = _interopRequireDefault(require("react"));
17
+ var _moment = _interopRequireDefault(require("moment"));
18
+ function _interopRequireDefault(obj) {
19
+ return obj && obj.__esModule ? obj : {
20
+ "default": obj
21
+ };
22
+ }
23
+ function highlightSubstring(str, substring) {
24
+ var highlighted = "<span class=\"tnt-highlight\">".concat(substring, "</span>");
25
+ return str.replace(new RegExp(substring, 'g'), highlighted);
26
+ }
27
+ function getLabelByValue(_ref) {
28
+ var value = _ref.value,
29
+ options = _ref.options,
30
+ _ref$fieldNames = _ref.fieldNames,
31
+ fieldNames = _ref$fieldNames === void 0 ? {
32
+ label: 'label',
33
+ value: 'value'
34
+ } : _ref$fieldNames;
35
+ var getLabel = function getLabel(value) {
36
+ var target = options === null || options === void 0 ? void 0 : options.find(function (item) {
37
+ var valueKey = fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.value;
38
+ var itemValue = item instanceof Object ? item[valueKey] : item;
39
+ return itemValue === value;
40
+ });
41
+ if (target) {
42
+ return target instanceof Object ? target === null || target === void 0 ? void 0 : target[fieldNames === null || fieldNames === void 0 ? void 0 : fieldNames.label] : target;
43
+ } else {
44
+ return value;
45
+ }
46
+ };
47
+ if ((0, _isArray2["default"])(value)) {
48
+ return value.map(getLabel).join(' | ');
49
+ } else {
50
+ return getLabel(value);
51
+ }
52
+ }
53
+ function formatLabel(reactDom) {
54
+ return (0, _flatten2["default"])(_react["default"].Children.map(reactDom.props.children, function (child) {
55
+ if (_react["default"].isValidElement(child)) {
56
+ return formatLabel(child);
57
+ } else if ((0, _isString2["default"])(child)) {
58
+ return child;
59
+ }
60
+ return '';
61
+ })).join('');
62
+ }
63
+ function parseObjectToArray(value, data) {
64
+ var _a, _b;
65
+ return (_b = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a.map(function (key) {
66
+ var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
67
+ var _a, _b;
68
+ return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key || ((_b = item.props) === null || _b === void 0 ? void 0 : _b.pName) === key;
69
+ });
70
+ if (!target) return null;
71
+ var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
72
+ var _ref2 = dataItem || {},
73
+ _ref2$type = _ref2.type,
74
+ type = _ref2$type === void 0 ? 'input' : _ref2$type,
75
+ component = _ref2.component,
76
+ setLabel = _ref2.setLabel;
77
+ if (!type && component && !setLabel) {
78
+ console.error('自定义组件需要传入setLabel()方法');
79
+ }
80
+ return {
81
+ key: key,
82
+ value: value[key]
83
+ };
84
+ })) === null || _b === void 0 ? void 0 : _b.filter(function (item) {
85
+ return !!item;
86
+ });
87
+ }
88
+ function parseArrayToObject(value) {
89
+ return value === null || value === void 0 ? void 0 : value.reduce(function (acc, v) {
90
+ acc[v.key] = v.value;
91
+ return acc;
92
+ }, {});
93
+ }
94
+ function getLabel(_ref3, data, locale) {
95
+ var key = _ref3.key,
96
+ value = _ref3.value;
97
+ var _a, _b, _c, _d;
98
+ var otherTarget = data === null || data === void 0 ? void 0 : data.find(function (item) {
99
+ var _a;
100
+ return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.pName) === key;
101
+ });
102
+ if (otherTarget) {
103
+ // otherInput
104
+ var selectKey = (_a = Object.keys(value || {})) === null || _a === void 0 ? void 0 : _a[0];
105
+ if (!selectKey) {
106
+ // 17. inputSelect组件,初始值{},展示undefined:undefined
107
+ return false;
108
+ }
109
+ var otherTargetObj = data.find(function (item) {
110
+ return item.props.pName === key && item.props.cName === selectKey;
111
+ });
112
+ if (!otherTargetObj) {
113
+ return false;
114
+ }
115
+ return otherTargetObj.props.title + ':' + (value[selectKey] || '');
116
+ }
117
+ var target = data === null || data === void 0 ? void 0 : data.find(function (item) {
118
+ var _a;
119
+ return ((_a = item.props) === null || _a === void 0 ? void 0 : _a.name) === key;
120
+ });
121
+ if (!target) return null;
122
+ var dataItem = (target === null || target === void 0 ? void 0 : target.props) || {};
123
+ var _ref4 = dataItem || {},
124
+ _ref4$type = _ref4.type,
125
+ type = _ref4$type === void 0 ? 'input' : _ref4$type,
126
+ setLabel = _ref4.setLabel,
127
+ fieldProps = _ref4.props,
128
+ propsTitle = _ref4.propsTitle,
129
+ title = _ref4.title,
130
+ name = _ref4.name;
131
+ var _propsTitle = propsTitle || title || name;
132
+ var _ref5 = fieldProps || {},
133
+ options = _ref5.options,
134
+ format = _ref5.format;
135
+ var labelValue = value;
136
+ if (setLabel) {
137
+ // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制
138
+ labelValue = setLabel(value);
139
+ } else if (options) {
140
+ if (type === 'selectInput') {
141
+ var _selectKey = (_b = Object.keys(value || {})) === null || _b === void 0 ? void 0 : _b[0];
142
+ if (!_selectKey) {
143
+ // 17. inputSelect组件,初始值{},展示undefined:undefined
144
+ return false;
145
+ }
146
+ var inputValue = value[_selectKey];
147
+ var selectLabel = (_c = options === null || options === void 0 ? void 0 : options.find(function (v) {
148
+ return v.value === _selectKey;
149
+ })) === null || _c === void 0 ? void 0 : _c.label;
150
+ return selectLabel + ':' + inputValue;
151
+ }
152
+ labelValue = getLabelByValue({
153
+ value: value,
154
+ options: options,
155
+ fieldNames: ((_d = dataItem === null || dataItem === void 0 ? void 0 : dataItem.props) === null || _d === void 0 ? void 0 : _d.fieldNames) || {
156
+ label: 'label',
157
+ value: 'value'
158
+ }
159
+ });
160
+ } else if (type === 'checkbox') {
161
+ labelValue = value ? locale.yes : locale.no;
162
+ } else if (type === 'dateRange' && format) {
163
+ if (value === null || value === void 0 ? void 0 : value.length) {
164
+ labelValue = [(0, _moment["default"])(value === null || value === void 0 ? void 0 : value[0]).format(format), (0, _moment["default"])(value === null || value === void 0 ? void 0 : value[1]).format(format)].join('~');
165
+ }
166
+ } else if (type === 'date' && format) {
167
+ labelValue = value ? (0, _moment["default"])(value).format(format) : undefined;
168
+ }
169
+ return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue);
170
+ }
171
+ var isInput = exports.isInput = function isInput(type) {
172
+ return ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type);
173
+ };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/utils.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACnD,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,UAAU,kBAAkB,CAAC,GAAG,EAAE,SAAS;IAC/C,MAAM,WAAW,GAAG,+BAA+B,SAAS,SAAS,CAAA;IACrE,OAAO,GAAG,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,EAAE,WAAW,CAAC,CAAA;AAC7D,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,EAC9B,KAAK,EACL,OAAO,EACP,UAAU,GAAG;IACX,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,OAAO;CACf,GACF;IACC,MAAM,QAAQ,GAAG,CAAC,KAAK,EAAE,EAAE;QACzB,MAAM,MAAM,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;YACpC,MAAM,QAAQ,GAAG,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAA;YAClC,MAAM,SAAS,GAAG,IAAI,YAAY,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;YAChE,OAAO,SAAS,KAAK,KAAK,CAAA;QAC5B,CAAC,CAAC,CAAA;QACF,IAAI,MAAM,EAAE;YACV,OAAO,MAAM,YAAY,MAAM,CAAC,CAAC,CAAC,MAAM,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AM,IAAI,MAAM,EAAE;QACpC,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;KAC9D;IACD,OAAO,WAAW,GAAG,GAAG,GAAG,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAU,CAAC,CAAA;AACzE,CAAC;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,IAAI,EAAE,EAAE,CAC9B,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,aAAa,EAAE,QAAQ,EAAE,aAAa,EAAE,YAAY,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA","sourcesContent":["import React from 'react'\nimport { isArray, isString, flatten } from 'lodash'\nimport moment from 'moment'\n\nexport function highlightSubstring(str, substring) {\n const highlighted = `<span class=\"tnt-highlight\">${substring}</span>`\n return str.replace(new RegExp(substring, 'g'), highlighted)\n}\n\nexport function getLabelByValue({\n value,\n options,\n fieldNames = {\n label: 'label',\n value: 'value',\n },\n}) {\n const getLabel = (value) => {\n const target = options?.find((item) => {\n const valueKey = fieldNames?.value\n const itemValue = item instanceof Object ? item[valueKey] : item\n return itemValue === value\n })\n if (target) {\n return target instanceof Object ? target?.[fieldNames?.label] : target\n } else {\n return value\n }\n }\n if (isArray(value)) {\n return value.map(getLabel).join(' | ')\n } else {\n return getLabel(value)\n }\n}\n\nexport function formatLabel(reactDom) {\n return flatten(\n React.Children.map(reactDom.props.children, (child) => {\n if (React.isValidElement(child)) {\n return formatLabel(child)\n } else if (isString(child)) {\n return child\n }\n return ''\n })\n ).join('')\n}\n\nexport function parseObjectToArray(value, data) {\n return Object.keys(value || {})\n ?.map((key) => {\n const target = data?.find((item) => item.props?.name === key || item.props?.pName === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', component, setLabel } = dataItem || {}\n if (!type && component && !setLabel) {\n console.error('自定义组件需要传入setLabel()方法')\n }\n return {\n key,\n value: value[key],\n }\n })\n ?.filter((item) => !!item)\n}\n\nexport function parseArrayToObject(value) {\n return value?.reduce((acc, v) => {\n acc[v.key] = v.value\n return acc\n }, {})\n}\n\nexport function getLabel({ key, value }, data, locale) {\n const otherTarget = data?.find((item) => item.props?.pName === key)\n if (otherTarget) {\n // otherInput\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const otherTargetObj = data.find(\n (item) => item.props.pName === key && item.props.cName === selectKey\n )\n if (!otherTargetObj) {\n return false\n }\n return otherTargetObj.props.title + ':' + (value[selectKey] || '')\n }\n\n const target = data?.find((item) => item.props?.name === key)\n if (!target) return null\n const dataItem = target?.props || {}\n const { type = 'input', setLabel, props: fieldProps, propsTitle, title, name } = dataItem || {}\n const _propsTitle = propsTitle || title || name\n const { options, format } = fieldProps || {}\n let labelValue = value\n if (setLabel) {\n // setLabel: 对于自定义组件,无法控制label的显示,可以通过setLabel方法控制\n labelValue = setLabel(value)\n } else if (options) {\n if (type === 'selectInput') {\n const selectKey = Object.keys(value || {})?.[0]\n if (!selectKey) {\n // 17. inputSelect组件,初始值{},展示undefined:undefined\n return false\n }\n const inputValue = value[selectKey]\n const selectLabel = options?.find((v) => v.value === selectKey)?.label\n return selectLabel + ':' + inputValue\n }\n labelValue = getLabelByValue({\n value,\n options,\n fieldNames: dataItem?.props?.fieldNames || {\n label: 'label',\n value: 'value',\n },\n })\n } else if (type === 'checkbox') {\n labelValue = value ? locale.yes : locale.no\n } else if (type === 'dateRange' && format) {\n if (value?.length) {\n labelValue = [moment(value?.[0]).format(format), moment(value?.[1]).format(format)].join('~')\n }\n } else if (type === 'date' && format) {\n labelValue = value ? moment(value).format(format) : undefined\n }\n return _propsTitle + ':' + (labelValue === undefined ? '' : labelValue)\n}\n\nexport const isInput = (type) =>\n ['input', 'string', 'search', 'aloneSearch', 'number', 'inputNumber', 'otherInput'].includes(type)\n"]}
@@ -0,0 +1,35 @@
1
+ .tnt-queryform-field-popover {
2
+ min-width: 280px;
3
+ .ant-popover-inner-content {
4
+ padding: @padding-sm 0;
5
+ }
6
+ .ant-calendar-picker {
7
+ margin: @margin-xxs 0;
8
+ }
9
+ label {
10
+ color: tint(@text-color, 50%);
11
+ margin-bottom: @margin-xs;
12
+ display: block;
13
+ padding: 0 @padding-sm;
14
+ }
15
+ .ant-select-dropdown-menu {
16
+ &-item {
17
+ padding: @padding-xxs @padding-sm;
18
+ &:hover {
19
+ background-color: @bg-color-quaternary;
20
+ }
21
+ }
22
+ }
23
+ &-content {
24
+ padding: @padding-xxs @padding-sm;
25
+ }
26
+ .ant-select-selected-icon {
27
+ position: absolute;
28
+ right: @margin-base;
29
+ top: @margin-xs;
30
+ color: @blue-6;
31
+ }
32
+ .tnt-highlight {
33
+ color: @blue-6;
34
+ }
35
+ }
@@ -0,0 +1,114 @@
1
+ @import '../../../style/themes/index';
2
+ @import '../../../style/mixins/index';
3
+ @import '../../../input/style/mixin';
4
+
5
+ .tnt-queryform-composition-input {
6
+ // width: 100%;
7
+ max-height: 162px;
8
+ overflow-x: hidden;
9
+ cursor: text;
10
+ padding: 2px @padding-xl;
11
+ position: relative;
12
+ box-sizing: border-box;
13
+ background-color: @select-background;
14
+ border: @border-width-base @border-style-base @select-border-color;
15
+ border-top-width: calc(@border-width-base + 0.02px);
16
+ border-radius: @border-radius-base;
17
+ outline: none;
18
+ transition: all 0.3s @ease-in-out;
19
+ user-select: none;
20
+ margin-bottom: @margin-sm;
21
+
22
+ &-prefix {
23
+ position: absolute;
24
+ left: @padding-sm;
25
+ top: 50%;
26
+ transform: translateY(-50%);
27
+ i.anticon {
28
+ color: tint(@bg-color-spotilight, 50%);
29
+ }
30
+ }
31
+
32
+ &-width {
33
+ height: 0;
34
+ opacity: 0;
35
+ width: auto;
36
+ position: absolute;
37
+ max-width: 100%;
38
+ }
39
+
40
+ &-items {
41
+ float: left;
42
+ padding: 0;
43
+ list-style: none;
44
+ margin: 0;
45
+ width: 100%;
46
+ &-item {
47
+ padding: 3px 0;
48
+ }
49
+ li {
50
+ float: left;
51
+ line-height: 1;
52
+ }
53
+ &-input {
54
+ .inputClass {
55
+ background: none;
56
+ border: none !important;
57
+ outline: none;
58
+ box-shadow: none !important;
59
+ width: 150px !important;
60
+ height: 26px;
61
+ line-height: 26px;
62
+ padding: 0;
63
+ input {
64
+ border: none !important;
65
+ outline: none !important;
66
+ box-shadow: none !important;
67
+ height: 26px;
68
+ line-height: 26px;
69
+ padding: 0;
70
+ }
71
+ textarea {
72
+ padding: 0;
73
+ }
74
+ }
75
+ .inputClass-with-placeholder {
76
+ min-width: 398px !important;
77
+ }
78
+ }
79
+ }
80
+ &-clear {
81
+ position: absolute;
82
+ right: @margin-sm;
83
+ top: 50%;
84
+ transform: translateY(-50%);
85
+ display: none;
86
+ i.anticon {
87
+ color: tint(@bg-color-spotilight, 50%);
88
+ }
89
+ &:hover {
90
+ .anticon {
91
+ color: @text-color-secondary !important;
92
+ }
93
+ }
94
+ }
95
+ &:hover {
96
+ border-color: @blue-6;
97
+ outline: 0;
98
+ .tnt-queryform-composition-input-clear {
99
+ display: block;
100
+ }
101
+ // box-shadow: 0 0 0 2px rgb(18 107 251 / 20%);
102
+ }
103
+ &:focus,
104
+ &:active {
105
+ border-color: @blue-5;
106
+ outline: 0;
107
+ // box-shadow: 0 0 0 2px rgb(18 107 251 / 20%);
108
+ }
109
+ .ant-tag {
110
+ padding: 0 @padding-xs;
111
+ border: none;
112
+ background: @fill-color-tertiary;
113
+ }
114
+ }
@@ -0,0 +1,90 @@
1
+ .tnt-queryform {
2
+ &-top {
3
+ display: flex;
4
+ &-body {
5
+ flex: 1;
6
+ .ant-btn {
7
+ margin-right: 10px;
8
+ }
9
+ }
10
+ }
11
+
12
+ &-extra {
13
+ & > * {
14
+ margin-left: 10px;
15
+ }
16
+ }
17
+
18
+ .ant-form {
19
+ // margin-bottom: @margin-sm;
20
+ &.ant-form-inline {
21
+ flex-wrap: unset;
22
+ position: relative;
23
+ }
24
+
25
+ &.ant-form-inline .ant-form-item {
26
+ margin-right: 10px;
27
+ margin-bottom: @margin-sm;
28
+ display: inline-block;
29
+ }
30
+
31
+ .ant-form-item-control {
32
+ // min-width: 160px;
33
+ line-height: unset;
34
+ .ant-calendar-picker-input {
35
+ padding: 0 @padding-sm;
36
+ }
37
+ .ant-form-item-children {
38
+ & > .ant-input,
39
+ & > .ant-input-affix-wrapper {
40
+ width: 160px;
41
+ // width: 200px;
42
+ }
43
+ }
44
+ }
45
+ }
46
+
47
+ &-drawer {
48
+ margin-top: @margin-xxl;
49
+ &.large-size {
50
+ margin-top: 60px;
51
+ }
52
+
53
+ &.ant-drawer.ant-drawer-open {
54
+ .ant-drawer-mask {
55
+ opacity: 0;
56
+ background: unset;
57
+ }
58
+ }
59
+ .ant-drawer-body {
60
+ .ant-form-item {
61
+ display: block;
62
+ margin-right: 0;
63
+ margin-bottom: @margin-md;
64
+ width: 100%;
65
+ }
66
+ .ant-form-item-label {
67
+ display: block;
68
+ text-align: left;
69
+ line-height: 22px;
70
+ margin-bottom: 10px;
71
+ }
72
+ .ant-form-item-control-wrapper,
73
+ .ant-form-item-control,
74
+ .ant-calendar-picker,
75
+ .ant-input {
76
+ min-width: 100%;
77
+ width: 100%;
78
+ }
79
+
80
+ & > .ant-btn {
81
+ display: block;
82
+ width: 100%;
83
+ margin-bottom: 10px;
84
+ &.ant-btn-primary {
85
+ margin-top: @margin-md;
86
+ }
87
+ }
88
+ }
89
+ }
90
+ }
@@ -0,0 +1,133 @@
1
+ .tnt-queryform {
2
+ display: flex;
3
+
4
+ &-extra {
5
+ line-height: 32px;
6
+ margin-left: 12px;
7
+ & > * {
8
+ margin-left: 8px;
9
+ }
10
+ }
11
+
12
+ &-actions {
13
+ align-items: center;
14
+ display: inline-block;
15
+ height: 32px;
16
+ line-height: 32px;
17
+
18
+ & > *:not(.expand-link) {
19
+ margin-right: 10px;
20
+ }
21
+ & > .expand-link {
22
+ padding: 0;
23
+ margin-right: 0;
24
+ }
25
+ & > .ant-badge {
26
+ .tnt-icon {
27
+ margin-right: 8px;
28
+ }
29
+ }
30
+ }
31
+
32
+ .ant-form {
33
+ display: inline-block;
34
+ margin-bottom: 12px;
35
+ display: flex;
36
+ flex: 1;
37
+ &.ant-form-inline {
38
+ flex-wrap: unset;
39
+ }
40
+
41
+ & > div:nth-child(1) {
42
+ height: 32px;
43
+ overflow: hidden;
44
+ .ant-form-item-label {
45
+ label {
46
+ // bottom: 4px;
47
+ }
48
+ }
49
+ }
50
+
51
+ &.expanded {
52
+ & > div:nth-child(1) {
53
+ height: auto !important;
54
+ }
55
+ }
56
+
57
+ &.showMore {
58
+ & > div:nth-child(1) {
59
+ .ant-form-item {
60
+ margin-bottom: 12px;
61
+ }
62
+ }
63
+ }
64
+
65
+ & > div:nth-child(2) {
66
+ display: flex;
67
+ }
68
+
69
+ &.ant-form-inline .ant-form-item {
70
+ margin-right: 10px;
71
+ display: inline-block;
72
+ }
73
+
74
+ .ant-form-item-control {
75
+ // min-width: 160px;
76
+ line-height: unset;
77
+ .ant-calendar-picker-input {
78
+ padding: 0 11px;
79
+ }
80
+ .ant-form-item-children {
81
+ & > .ant-input,
82
+ & > .ant-input-affix-wrapper {
83
+ width: 160px;
84
+ // width: 200px;
85
+ }
86
+ }
87
+ }
88
+ }
89
+
90
+ &-drawer {
91
+ margin-top: 50px;
92
+ &.large-size {
93
+ margin-top: 60px;
94
+ }
95
+
96
+ &.ant-drawer.ant-drawer-open {
97
+ .ant-drawer-mask {
98
+ opacity: 0;
99
+ background: unset;
100
+ }
101
+ }
102
+ .ant-drawer-body {
103
+ .ant-form-item {
104
+ display: block;
105
+ margin-right: 0;
106
+ margin-bottom: 20px;
107
+ width: 100%;
108
+ }
109
+ .ant-form-item-label {
110
+ display: block;
111
+ text-align: left;
112
+ line-height: 22px;
113
+ margin-bottom: 10px;
114
+ }
115
+ .ant-form-item-control-wrapper,
116
+ .ant-form-item-control,
117
+ .ant-calendar-picker,
118
+ .ant-input {
119
+ min-width: 100%;
120
+ width: 100%;
121
+ }
122
+
123
+ & > .ant-btn {
124
+ display: block;
125
+ width: 100%;
126
+ margin-bottom: 10px;
127
+ &.ant-btn-primary {
128
+ margin-top: 20px;
129
+ }
130
+ }
131
+ }
132
+ }
133
+ }
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ function _typeof(o) {
4
+ "@babel/helpers - typeof";
5
+
6
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
7
+ return typeof o;
8
+ } : function (o) {
9
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
10
+ }, _typeof(o);
11
+ }
12
+ Object.defineProperty(exports, "__esModule", {
13
+ value: true
14
+ });
15
+ var _exportNames = {};
16
+ exports["default"] = void 0;
17
+ var _configProvider = require("antd/es/config-provider");
18
+ var _radio = _interopRequireWildcard(require("antd/es/radio"));
19
+ Object.keys(_radio).forEach(function (key) {
20
+ if (key === "default" || key === "__esModule") return;
21
+ if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
22
+ if (key in exports && exports[key] === _radio[key]) return;
23
+ Object.defineProperty(exports, key, {
24
+ enumerable: true,
25
+ get: function get() {
26
+ return _radio[key];
27
+ }
28
+ });
29
+ });
30
+ var _classnames = _interopRequireDefault(require("classnames"));
31
+ var _react = _interopRequireWildcard(require("react"));
32
+ var _connect = require("../connect");
33
+ var _previewText = require("../preview-text");
34
+ function _interopRequireDefault(obj) {
35
+ return obj && obj.__esModule ? obj : {
36
+ "default": obj
37
+ };
38
+ }
39
+ function _getRequireWildcardCache(e) {
40
+ if ("function" != typeof WeakMap) return null;
41
+ var r = new WeakMap(),
42
+ t = new WeakMap();
43
+ return (_getRequireWildcardCache = function _getRequireWildcardCache(e) {
44
+ return e ? t : r;
45
+ })(e);
46
+ }
47
+ function _interopRequireWildcard(e, r) {
48
+ if (!r && e && e.__esModule) return e;
49
+ if (null === e || "object" != _typeof(e) && "function" != typeof e) return {
50
+ "default": e
51
+ };
52
+ var t = _getRequireWildcardCache(r);
53
+ if (t && t.has(e)) return t.get(e);
54
+ var n = {
55
+ __proto__: null
56
+ },
57
+ a = Object.defineProperty && Object.getOwnPropertyDescriptor;
58
+ for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) {
59
+ var i = a ? Object.getOwnPropertyDescriptor(e, u) : null;
60
+ i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u];
61
+ }
62
+ return n["default"] = e, t && t.set(e, n), n;
63
+ }
64
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
65
+ var t = {};
66
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
67
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
68
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
69
+ }
70
+ return t;
71
+ };
72
+ /*
73
+ * @Author: 周泽飞 zefei.zhou@tongdun.net
74
+ * @Date: 2024-03-14 16:55:05
75
+ * @LastEditors: 周泽飞 zefei.zhou@tongdun.net
76
+ * @LastEditTime: 2024-03-14 17:00:03
77
+ * @FilePath: /tntd/packages/tntd/src/radio/radio.tsx
78
+ * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
79
+ */
80
+
81
+ var tntPrefixCls = 'tnt-radio';
82
+ var Radio = (0, _react.forwardRef)(function (_a, ref) {
83
+ var className = _a.className,
84
+ children = _a.children,
85
+ desc = _a.desc,
86
+ rest = __rest(_a, ["className", "children", "desc"]);
87
+ return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
88
+ return _react["default"].createElement(_radio["default"], Object.assign({}, rest, {
89
+ ref: ref,
90
+ className: (0, _classnames["default"])(className, tntPrefixCls)
91
+ }), children ? _react["default"].createElement("span", {
92
+ className: "".concat(tntPrefixCls, "-children")
93
+ }, _react["default"].createElement("span", null, children), !!desc && _react["default"].createElement("span", {
94
+ className: "".concat(tntPrefixCls, "-desc")
95
+ }, desc)) : undefined);
96
+ });
97
+ });
98
+ var RadioGroup = (0, _react.forwardRef)(function (_a, ref) {
99
+ var className = _a.className,
100
+ rest = __rest(_a, ["className"]);
101
+ return _react["default"].createElement(_configProvider.ConfigConsumer, null, function () {
102
+ return _react["default"].createElement(_radio["default"].Group, Object.assign({}, rest, {
103
+ ref: ref,
104
+ className: (0, _classnames["default"])(className, "".concat(tntPrefixCls, "-group"))
105
+ }));
106
+ });
107
+ });
108
+ Radio.Group = (0, _connect.connectReadonlyComponent)(RadioGroup, _previewText.PreviewText.Select);
109
+ Radio.Button = _radio["default"].Button;
110
+ var _default = exports["default"] = Radio;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"radio.js","sourceRoot":"","sources":["../../src/radio/radio.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAKxD,OAAO,SAAS,MAAM,eAAe,CAAA;AAErC,OAAO,UAAU,MAAM,YAAY,CAAA;AACnC,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AACzC,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAA;AAE7C,cAAc,eAAe,CAAA;AAe7B,MAAM,YAAY,GAAG,WAAW,CAAA;AAEhC,MAAM,KAAK,GAAG,UAAU,CAAwB,CAAC,EAAsC,EAAE,GAAG,EAAE,EAAE;QAA/C,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,OAAW,EAAN,IAAI,cAApC,iCAAsC,CAAF;IACnF,OAAO,CACL,oBAAC,cAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,oBAAC,SAAS,oBAAK,IAAI,IAAE,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,YAAY,CAAC,KAC1E,QAAQ,CAAC,CAAC,CAAC,CACV,8BAAM,SAAS,EAAE,GAAG,YAAY,WAAW;YACzC,kCAAO,QAAQ,CAAQ;YACtB,CAAC,CAAC,IAAI,IAAI,8BAAM,SAAS,EAAE,GAAG,YAAY,OAAO,IAAG,IAAI,CAAQ,CAC5D,CACR,CAAC,CAAC,CAAC,SAAS,CACH,CACb,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAmB,CAAA;AAEpB,MAAM,UAAU,GAAG,UAAU,CAAkC,CAAC,EAAsB,EAAE,GAAG,EAAE,EAAE;QAA/B,EAAE,SAAS,OAAW,EAAN,IAAI,cAApB,aAAsB,CAAF;IAClF,OAAO,CACL,oBAAC,cAAc,QACZ,GAAG,EAAE;QACJ,OAAO,CACL,oBAAC,SAAS,CAAC,KAAK,oBACV,IAAI,IACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,SAAS,EAAE,GAAG,YAAY,QAAQ,CAAC,IACzD,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,KAAK,CAAC,KAAK,GAAG,wBAAwB,CAAC,UAAU,EAAE,WAAW,CAAC,MAAM,CAAC,CAAA;AACtE,KAAK,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAA;AAE/B,eAAe,KAAK,CAAA","sourcesContent":["/*\n * @Author: 周泽飞 zefei.zhou@tongdun.net\n * @Date: 2024-03-14 16:55:05\n * @LastEditors: 周泽飞 zefei.zhou@tongdun.net\n * @LastEditTime: 2024-03-14 17:00:03\n * @FilePath: /tntd/packages/tntd/src/radio/radio.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport { ConfigConsumer } from 'antd/es/config-provider'\nimport type {\n RadioGroupProps as AntdRadioGroupProps,\n RadioProps as AntdRadioProps,\n} from 'antd/es/radio'\nimport AntdRadio from 'antd/es/radio'\nimport type AntdRadioGroup from 'antd/es/radio/group'\nimport classNames from 'classnames'\nimport React, { forwardRef } from 'react'\nimport { connectReadonlyComponent } from '../connect'\nimport { PreviewText } from '../preview-text'\n\nexport * from 'antd/es/radio'\n\nexport type RadioProps = AntdRadioProps & {\n desc?: string | React.ReactNode\n}\nexport type RadioGroupProps = AntdRadioGroupProps & {\n readonly?: boolean\n}\n\ninterface RadioComponent\n extends React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<AntdRadio>> {\n Group: React.FC<RadioGroupProps>\n Button: typeof AntdRadio.Button\n}\n\nconst tntPrefixCls = 'tnt-radio'\n\nconst Radio = forwardRef<AntdRadio, RadioProps>(({ className, children, desc, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {() => {\n return (\n <AntdRadio {...rest} ref={ref} className={classNames(className, tntPrefixCls)}>\n {children ? (\n <span className={`${tntPrefixCls}-children`}>\n <span>{children}</span>\n {!!desc && <span className={`${tntPrefixCls}-desc`}>{desc}</span>}\n </span>\n ) : undefined}\n </AntdRadio>\n )\n }}\n </ConfigConsumer>\n )\n}) as RadioComponent\n\nconst RadioGroup = forwardRef<AntdRadioGroup, RadioGroupProps>(({ className, ...rest }, ref) => {\n return (\n <ConfigConsumer>\n {() => {\n return (\n <AntdRadio.Group\n {...rest}\n ref={ref}\n className={classNames(className, `${tntPrefixCls}-group`)}\n />\n )\n }}\n </ConfigConsumer>\n )\n})\n\nRadio.Group = connectReadonlyComponent(RadioGroup, PreviewText.Select)\nRadio.Button = AntdRadio.Button\n\nexport default Radio\n"]}