tntd 3.0.68 → 3.0.69

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 (65) hide show
  1. package/es/index.js +7 -0
  2. package/es/index.js.map +1 -1
  3. package/es/prev-locale.js +4 -2
  4. package/es/prev-locale.js.map +1 -1
  5. package/es/steps/stepStyle/small.less +5 -0
  6. package/es/tntd-checkbox-select/index.js +269 -0
  7. package/es/tntd-checkbox-select/index.js.map +1 -0
  8. package/es/tntd-checkbox-select/index.less +68 -0
  9. package/lib/index.d.ts +1 -0
  10. package/lib/index.d.ts.map +1 -1
  11. package/lib/index.js +7 -0
  12. package/lib/index.js.map +1 -1
  13. package/lib/prev-locale.d.ts +3 -0
  14. package/lib/prev-locale.d.ts.map +1 -1
  15. package/lib/prev-locale.js +4 -2
  16. package/lib/prev-locale.js.map +1 -1
  17. package/lib/steps/stepStyle/small.less +5 -0
  18. package/lib/tntd-checkbox-select/index.d.ts +12 -0
  19. package/lib/tntd-checkbox-select/index.d.ts.map +1 -0
  20. package/lib/tntd-checkbox-select/index.js +354 -0
  21. package/lib/tntd-checkbox-select/index.js.map +1 -0
  22. package/lib/tntd-checkbox-select/index.less +68 -0
  23. package/package.json +2 -2
  24. package/es/query-form/Field/Composition/FieldPopover.js +0 -459
  25. package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
  26. package/es/query-form/Field/Composition/FieldPopover.less +0 -41
  27. package/es/query-form/Field/Composition/Select.js +0 -253
  28. package/es/query-form/Field/Composition/Select.js.map +0 -1
  29. package/es/query-form/Field/Composition/SelectInput.js +0 -111
  30. package/es/query-form/Field/Composition/SelectInput.js.map +0 -1
  31. package/es/query-form/Field/Composition/ValueTag.js +0 -240
  32. package/es/query-form/Field/Composition/ValueTag.js.map +0 -1
  33. package/es/query-form/Field/Composition/index.js +0 -441
  34. package/es/query-form/Field/Composition/index.js.map +0 -1
  35. package/es/query-form/Field/Composition/index.less +0 -167
  36. package/es/query-form/Field/Composition/utils.js +0 -173
  37. package/es/query-form/Field/Composition/utils.js.map +0 -1
  38. package/es/query-form-v2/index.less +0 -133
  39. package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -19
  40. package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
  41. package/lib/query-form/Field/Composition/FieldPopover.js +0 -459
  42. package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
  43. package/lib/query-form/Field/Composition/FieldPopover.less +0 -41
  44. package/lib/query-form/Field/Composition/Select.d.ts +0 -4
  45. package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
  46. package/lib/query-form/Field/Composition/Select.js +0 -253
  47. package/lib/query-form/Field/Composition/Select.js.map +0 -1
  48. package/lib/query-form/Field/Composition/SelectInput.d.ts +0 -3
  49. package/lib/query-form/Field/Composition/SelectInput.d.ts.map +0 -1
  50. package/lib/query-form/Field/Composition/SelectInput.js +0 -111
  51. package/lib/query-form/Field/Composition/SelectInput.js.map +0 -1
  52. package/lib/query-form/Field/Composition/ValueTag.d.ts +0 -13
  53. package/lib/query-form/Field/Composition/ValueTag.d.ts.map +0 -1
  54. package/lib/query-form/Field/Composition/ValueTag.js +0 -240
  55. package/lib/query-form/Field/Composition/ValueTag.js.map +0 -1
  56. package/lib/query-form/Field/Composition/index.d.ts +0 -15
  57. package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
  58. package/lib/query-form/Field/Composition/index.js +0 -441
  59. package/lib/query-form/Field/Composition/index.js.map +0 -1
  60. package/lib/query-form/Field/Composition/index.less +0 -167
  61. package/lib/query-form/Field/Composition/utils.d.ts +0 -21
  62. package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
  63. package/lib/query-form/Field/Composition/utils.js +0 -173
  64. package/lib/query-form/Field/Composition/utils.js.map +0 -1
  65. package/lib/query-form-v2/index.less +0 -133
@@ -1,173 +0,0 @@
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(e) {
19
- return e && e.__esModule ? e : {
20
- "default": e
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
- };
@@ -1 +0,0 @@
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,aAAN,MAAM,uBAAN,MAAM,CAAG,UAAU,aAAV,UAAU,uBAA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AC,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"]}
@@ -1,133 +0,0 @@
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
- }
@@ -1,19 +0,0 @@
1
- declare var _default: React.ForwardRefExoticComponent<Pick<{
2
- [x: string]: any;
3
- visible: any;
4
- setVisible: any;
5
- searchText: any;
6
- children: any;
7
- value: any;
8
- regex: any;
9
- fieldItems: any;
10
- propItem: any;
11
- setFieldItem: any;
12
- onChange: any;
13
- form: any;
14
- locale: any;
15
- clsPrefix: any;
16
- }, string | number> & React.RefAttributes<any>>;
17
- export default _default;
18
- import React from "react";
19
- //# sourceMappingURL=FieldPopover.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"FieldPopover.d.ts","sourceRoot":"","sources":["../../../../src/query-form/Field/Composition/FieldPopover.js"],"names":[],"mappings":""}