1 | 'use strict';
|
2 |
|
3 | exports.__esModule = true;
|
4 |
|
5 | var _configProvider = require('../config-provider');
|
6 |
|
7 | var _configProvider2 = _interopRequireDefault(_configProvider);
|
8 |
|
9 | var _util = require('../util');
|
10 |
|
11 | var _tag = require('./tag');
|
12 |
|
13 | var _tag2 = _interopRequireDefault(_tag);
|
14 |
|
15 | var _tagGroup = require('./tag-group');
|
16 |
|
17 | var _tagGroup2 = _interopRequireDefault(_tagGroup);
|
18 |
|
19 | var _selectable = require('./selectable');
|
20 |
|
21 | var _selectable2 = _interopRequireDefault(_selectable);
|
22 |
|
23 | var _closeable = require('./closeable');
|
24 |
|
25 | var _closeable2 = _interopRequireDefault(_closeable);
|
26 |
|
27 | function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
28 |
|
29 | var ConfigTag = _configProvider2.default.config(_tag2.default, {
|
30 | transfrom: function transfrom(props, deprecated) {
|
31 | var shape = props.shape,
|
32 | type = props.type;
|
33 |
|
34 | if (shape === 'selectable') {
|
35 | deprecated('shape=selectable', 'Tag.Selectable', 'Tag');
|
36 | }
|
37 |
|
38 | if (shape === 'deletable') {
|
39 | deprecated('shape=deletable', 'Tag.Closeable', 'Tag');
|
40 | }
|
41 |
|
42 | if (shape === 'link') {
|
43 | deprecated('shape=link', '<Tag><a href="x">x</a></Tag>', 'Tag');
|
44 | }
|
45 |
|
46 | if (shape === 'readonly' || shape === 'interactive') {
|
47 | _util.log.warning('Warning: [ shape=' + shape + ' ] is deprecated at [ Tag ]');
|
48 | }
|
49 |
|
50 | if (type === 'secondary') {
|
51 | _util.log.warning('Warning: [ type=secondary ] is deprecated at [ Tag ]');
|
52 | }
|
53 |
|
54 | ['count', 'marked', 'value', 'onChange'].forEach(function (key) {
|
55 | if (key in props) {
|
56 | _util.log.warning('Warning: [ ' + key + ' ] is deprecated at [ Tag ]');
|
57 | }
|
58 | });
|
59 |
|
60 | if ('selected' in props || 'defaultSelected' in props) {
|
61 | _util.log.warning('Warning: [ selected|defaultSelected ] is deprecated at [ Tag ], use [ checked|defaultChecked ] at [ Tag.Selectable ] instead of it');
|
62 | }
|
63 |
|
64 | if ('closed' in props) {
|
65 | _util.log.warning('Warning: [ closed ] is deprecated at [ Tag ], use [ onClose ] at [ Tag.Closeable ] instead of it');
|
66 | }
|
67 |
|
68 | if ('onSelect' in props) {
|
69 | deprecated('onSelect', '<Tag.Selectable onChange/>', 'Tag');
|
70 | }
|
71 |
|
72 | if ('afterClose' in props) {
|
73 | _util.log.warning('Warning: [ afterClose ] is deprecated at [ Tag ], use [ afterClose ] at [ Tag.Closeable ] instead of it');
|
74 | }
|
75 |
|
76 | return props;
|
77 | }
|
78 | });
|
79 |
|
80 | ConfigTag.Group = _configProvider2.default.config(_tagGroup2.default);
|
81 |
|
82 | ConfigTag.Selectable = _configProvider2.default.config(_selectable2.default);
|
83 |
|
84 |
|
85 | ConfigTag.Closable = _configProvider2.default.config(_closeable2.default);
|
86 | ConfigTag.Closeable = ConfigTag.Closable;
|
87 |
|
88 | exports.default = ConfigTag;
|
89 | module.exports = exports['default']; |
\ | No newline at end of file |