tntd 2.8.0-beta.5 → 2.8.0-beta.7
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.
- package/es/check-card/index.js +2 -3
- package/es/check-card/index.js.map +1 -1
- package/es/color-picker/ColorPicker.js +4 -6
- package/es/color-picker/ColorPicker.js.map +1 -1
- package/es/index.js +2 -0
- package/es/index.js.map +1 -1
- package/es/locale/en_US.js +3 -0
- package/es/locale/en_US.js.map +1 -1
- package/es/locale/zh_CN.js +3 -0
- package/es/locale/zh_CN.js.map +1 -1
- package/es/page-container/index.js +13 -0
- package/es/page-container/index.js.map +1 -0
- package/es/page-container/index.less +38 -0
- package/es/page-loading/index.js +25 -0
- package/es/page-loading/index.js.map +1 -0
- package/es/page-loading/index.less +22 -0
- package/es/page-loading/loading.gif +0 -0
- package/es/table/table.js +1 -2
- package/es/table/table.js.map +1 -1
- package/es/table-container/index.less +1 -0
- package/es/tabs/tabs.js +4 -2
- package/es/tabs/tabs.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/component/getIcons.js +7 -8
- package/es/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/es/tntd-cascader/AntdCascader/index.js +4 -5
- package/es/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/es/tntd-rc-select/_util/getIcons.js +7 -8
- package/es/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/lib/check-card/index.js +1 -2
- package/lib/check-card/index.js.map +1 -1
- package/lib/color-picker/ColorPicker.d.ts.map +1 -1
- package/lib/color-picker/ColorPicker.js +2 -4
- package/lib/color-picker/ColorPicker.js.map +1 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +14 -0
- package/lib/index.js.map +1 -1
- package/lib/locale/default.d.ts +3 -0
- package/lib/locale/default.d.ts.map +1 -1
- package/lib/locale/en_US.d.ts +3 -0
- package/lib/locale/en_US.d.ts.map +1 -1
- package/lib/locale/en_US.js +3 -0
- package/lib/locale/en_US.js.map +1 -1
- package/lib/locale/zh_CN.d.ts +3 -0
- package/lib/locale/zh_CN.d.ts.map +1 -1
- package/lib/locale/zh_CN.js +3 -0
- package/lib/locale/zh_CN.js.map +1 -1
- package/lib/page-container/index.d.ts +4 -0
- package/lib/page-container/index.d.ts.map +1 -0
- package/lib/page-container/index.js +22 -0
- package/lib/page-container/index.js.map +1 -0
- package/lib/page-container/index.less +38 -0
- package/lib/{query-form/Field/Composition/Select.d.ts → page-loading/index.d.ts} +1 -1
- package/lib/page-loading/index.d.ts.map +1 -0
- package/lib/page-loading/index.js +30 -0
- package/lib/page-loading/index.js.map +1 -0
- package/lib/page-loading/index.less +22 -0
- package/lib/page-loading/loading.gif +0 -0
- package/lib/table/table.d.ts.map +1 -1
- package/lib/table/table.js +2 -3
- package/lib/table/table.js.map +1 -1
- package/lib/table-container/index.less +1 -0
- package/lib/tabs/tabs.d.ts.map +1 -1
- package/lib/tabs/tabs.js +3 -1
- package/lib/tabs/tabs.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js +2 -3
- package/lib/tntd-cascader/AntdCascader/component/getIcons.js.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.d.ts.map +1 -1
- package/lib/tntd-cascader/AntdCascader/index.js +1 -2
- package/lib/tntd-cascader/AntdCascader/index.js.map +1 -1
- package/lib/tntd-rc-select/_util/getIcons.js +2 -3
- package/lib/tntd-rc-select/_util/getIcons.js.map +1 -1
- package/package.json +2 -2
- package/es/alert/alert.js +0 -70
- package/es/alert/alert.js.map +0 -1
- package/es/alert/alert.less +0 -128
- package/es/button/button.less +0 -72
- package/es/checkbox/check.png +0 -0
- package/es/checkbox/checkbox.js +0 -48
- package/es/checkbox/checkbox.js.map +0 -1
- package/es/checkbox/checkbox.less +0 -69
- package/es/date-picker/DatePicker.js +0 -101
- package/es/date-picker/DatePicker.js.map +0 -1
- package/es/date-picker/index.less +0 -294
- package/es/drawer/index.less +0 -154
- package/es/form/form.less +0 -36
- package/es/grid/RowContext.js +0 -3
- package/es/grid/RowContext.js.map +0 -1
- package/es/grid/col.js +0 -103
- package/es/grid/col.js.map +0 -1
- package/es/grid/hooks/useBreakpoint.js +0 -18
- package/es/grid/hooks/useBreakpoint.js.map +0 -1
- package/es/grid/row.js +0 -154
- package/es/grid/row.js.map +0 -1
- package/es/grid/style/rtl.less +0 -69
- package/es/input-number/inputNumber.js +0 -29
- package/es/input-number/inputNumber.js.map +0 -1
- package/es/input-number/inputNumber.less +0 -12
- package/es/modal/index.less +0 -36
- package/es/notification/assets/index.js +0 -2
- package/es/notification/assets/index.js.map +0 -1
- package/es/notification/assets/svg-error-tip.js +0 -145
- package/es/notification/assets/svg-error-tip.js.map +0 -1
- package/es/notification/assets/svg-success-tip.js +0 -162
- package/es/notification/assets/svg-success-tip.js.map +0 -1
- package/es/notification/notification.js +0 -80
- package/es/notification/notification.js.map +0 -1
- package/es/notification/notification.less +0 -59
- package/es/popconfirm/index.less +0 -32
- package/es/popconfirm/popconfirm.js +0 -43
- package/es/popconfirm/popconfirm.js.map +0 -1
- package/es/popover/index.less +0 -57
- package/es/popover/popover.js +0 -34
- package/es/popover/popover.js.map +0 -1
- package/es/progress/progress.js +0 -132
- package/es/progress/progress.js.map +0 -1
- package/es/progress/progress.less +0 -82
- package/es/query-form/Field/Composition/FieldPopover.js +0 -284
- package/es/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/es/query-form/Field/Composition/FieldPopover.less +0 -35
- package/es/query-form/Field/Composition/Select.js +0 -108
- package/es/query-form/Field/Composition/Select.js.map +0 -1
- package/es/query-form/Field/Composition/index.js +0 -275
- package/es/query-form/Field/Composition/index.js.map +0 -1
- package/es/query-form/Field/Composition/index.less +0 -106
- package/es/query-form/Field/Composition/utils.js +0 -19
- package/es/query-form/Field/Composition/utils.js.map +0 -1
- package/es/radio/radio.js +0 -57
- package/es/radio/radio.js.map +0 -1
- package/es/radio/radio.less +0 -43
- package/es/steps/assets/background_left.svg +0 -12
- package/es/steps/assets/background_right.svg +0 -12
- package/es/steps/assets/horizontal_line.svg +0 -3
- package/es/steps/assets/vertical_line.svg +0 -3
- package/es/steps/stepStyle/icon.less +0 -51
- package/es/steps/stepStyle/progress-dot.less +0 -10
- package/es/steps/stepStyle/variables.less +0 -8
- package/es/steps/stepStyle/vertical.less +0 -41
- package/es/switch/index.less +0 -46
- package/es/tabs/tabs.less +0 -116
- package/es/tag/color.less +0 -43
- package/es/tag/tag.js +0 -171
- package/es/tag/tag.js.map +0 -1
- package/es/tag/tag.less +0 -193
- package/es/time-picker/TimePicker.js +0 -36
- package/es/time-picker/TimePicker.js.map +0 -1
- package/es/time-picker/index.less +0 -38
- package/es/tntd-action/Action.js +0 -66
- package/es/tntd-action/Action.js.map +0 -1
- package/es/tntd-action/index.less +0 -53
- package/es/tooltip/index.less +0 -29
- package/es/tooltip/tooltip.js +0 -33
- package/es/tooltip/tooltip.js.map +0 -1
- package/lib/alert/alert.d.ts +0 -12
- package/lib/alert/alert.d.ts.map +0 -1
- package/lib/alert/alert.js +0 -92
- package/lib/alert/alert.js.map +0 -1
- package/lib/alert/alert.less +0 -128
- package/lib/button/button.less +0 -72
- package/lib/checkbox/check.png +0 -0
- package/lib/checkbox/checkbox.d.ts +0 -16
- package/lib/checkbox/checkbox.d.ts.map +0 -1
- package/lib/checkbox/checkbox.js +0 -65
- package/lib/checkbox/checkbox.js.map +0 -1
- package/lib/checkbox/checkbox.less +0 -69
- package/lib/date-picker/DatePicker.d.ts +0 -21
- package/lib/date-picker/DatePicker.d.ts.map +0 -1
- package/lib/date-picker/DatePicker.js +0 -128
- package/lib/date-picker/DatePicker.js.map +0 -1
- package/lib/date-picker/index.less +0 -294
- package/lib/drawer/index.less +0 -154
- package/lib/form/form.less +0 -36
- package/lib/grid/RowContext.d.ts +0 -9
- package/lib/grid/RowContext.d.ts.map +0 -1
- package/lib/grid/RowContext.js +0 -9
- package/lib/grid/RowContext.js.map +0 -1
- package/lib/grid/col.d.ts +0 -29
- package/lib/grid/col.d.ts.map +0 -1
- package/lib/grid/col.js +0 -100
- package/lib/grid/col.js.map +0 -1
- package/lib/grid/hooks/useBreakpoint.d.ts +0 -4
- package/lib/grid/hooks/useBreakpoint.d.ts.map +0 -1
- package/lib/grid/hooks/useBreakpoint.js +0 -28
- package/lib/grid/hooks/useBreakpoint.js.map +0 -1
- package/lib/grid/row.d.ts +0 -21
- package/lib/grid/row.d.ts.map +0 -1
- package/lib/grid/row.js +0 -183
- package/lib/grid/row.js.map +0 -1
- package/lib/grid/style/rtl.less +0 -69
- package/lib/input-number/inputNumber.d.ts +0 -10
- package/lib/input-number/inputNumber.d.ts.map +0 -1
- package/lib/input-number/inputNumber.js +0 -48
- package/lib/input-number/inputNumber.js.map +0 -1
- package/lib/input-number/inputNumber.less +0 -12
- package/lib/modal/index.less +0 -36
- package/lib/notification/assets/index.d.ts +0 -3
- package/lib/notification/assets/index.d.ts.map +0 -1
- package/lib/notification/assets/index.js +0 -20
- package/lib/notification/assets/index.js.map +0 -1
- package/lib/notification/assets/svg-error-tip.d.ts +0 -4
- package/lib/notification/assets/svg-error-tip.d.ts.map +0 -1
- package/lib/notification/assets/svg-error-tip.js +0 -154
- package/lib/notification/assets/svg-error-tip.js.map +0 -1
- package/lib/notification/assets/svg-success-tip.d.ts +0 -4
- package/lib/notification/assets/svg-success-tip.d.ts.map +0 -1
- package/lib/notification/assets/svg-success-tip.js +0 -171
- package/lib/notification/assets/svg-success-tip.js.map +0 -1
- package/lib/notification/notification.d.ts +0 -9
- package/lib/notification/notification.d.ts.map +0 -1
- package/lib/notification/notification.js +0 -105
- package/lib/notification/notification.js.map +0 -1
- package/lib/notification/notification.less +0 -59
- package/lib/popconfirm/index.less +0 -32
- package/lib/popconfirm/popconfirm.d.ts +0 -8
- package/lib/popconfirm/popconfirm.d.ts.map +0 -1
- package/lib/popconfirm/popconfirm.js +0 -61
- package/lib/popconfirm/popconfirm.js.map +0 -1
- package/lib/popover/index.less +0 -57
- package/lib/popover/popover.d.ts +0 -14
- package/lib/popover/popover.d.ts.map +0 -1
- package/lib/popover/popover.js +0 -55
- package/lib/popover/popover.js.map +0 -1
- package/lib/progress/progress.d.ts +0 -12
- package/lib/progress/progress.d.ts.map +0 -1
- package/lib/progress/progress.js +0 -148
- package/lib/progress/progress.js.map +0 -1
- package/lib/progress/progress.less +0 -82
- package/lib/query-form/Field/Composition/FieldPopover.d.ts +0 -17
- package/lib/query-form/Field/Composition/FieldPopover.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.js +0 -319
- package/lib/query-form/Field/Composition/FieldPopover.js.map +0 -1
- package/lib/query-form/Field/Composition/FieldPopover.less +0 -35
- package/lib/query-form/Field/Composition/Select.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/Select.js +0 -132
- package/lib/query-form/Field/Composition/Select.js.map +0 -1
- package/lib/query-form/Field/Composition/index.d.ts +0 -14
- package/lib/query-form/Field/Composition/index.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/index.js +0 -330
- package/lib/query-form/Field/Composition/index.js.map +0 -1
- package/lib/query-form/Field/Composition/index.less +0 -106
- package/lib/query-form/Field/Composition/utils.d.ts +0 -6
- package/lib/query-form/Field/Composition/utils.d.ts.map +0 -1
- package/lib/query-form/Field/Composition/utils.js +0 -27
- package/lib/query-form/Field/Composition/utils.js.map +0 -1
- package/lib/radio/radio.d.ts +0 -17
- package/lib/radio/radio.d.ts.map +0 -1
- package/lib/radio/radio.js +0 -75
- package/lib/radio/radio.js.map +0 -1
- package/lib/radio/radio.less +0 -43
- package/lib/steps/assets/background_left.svg +0 -12
- package/lib/steps/assets/background_right.svg +0 -12
- package/lib/steps/assets/horizontal_line.svg +0 -3
- package/lib/steps/assets/vertical_line.svg +0 -3
- package/lib/steps/stepStyle/icon.less +0 -51
- package/lib/steps/stepStyle/progress-dot.less +0 -10
- package/lib/steps/stepStyle/variables.less +0 -8
- package/lib/steps/stepStyle/vertical.less +0 -41
- package/lib/switch/index.less +0 -46
- package/lib/tabs/tabs.less +0 -116
- package/lib/tag/color.less +0 -43
- package/lib/tag/tag.d.ts +0 -41
- package/lib/tag/tag.d.ts.map +0 -1
- package/lib/tag/tag.js +0 -183
- package/lib/tag/tag.js.map +0 -1
- package/lib/tag/tag.less +0 -193
- package/lib/time-picker/TimePicker.d.ts +0 -9
- package/lib/time-picker/TimePicker.d.ts.map +0 -1
- package/lib/time-picker/TimePicker.js +0 -55
- package/lib/time-picker/TimePicker.js.map +0 -1
- package/lib/time-picker/index.less +0 -38
- package/lib/tntd-action/Action.d.ts +0 -6
- package/lib/tntd-action/Action.d.ts.map +0 -1
- package/lib/tntd-action/Action.js +0 -86
- package/lib/tntd-action/Action.js.map +0 -1
- package/lib/tntd-action/index.less +0 -53
- package/lib/tooltip/index.less +0 -29
- package/lib/tooltip/tooltip.d.ts +0 -9
- package/lib/tooltip/tooltip.d.ts.map +0 -1
- package/lib/tooltip/tooltip.js +0 -53
- package/lib/tooltip/tooltip.js.map +0 -1
package/lib/tag/tag.d.ts
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { TagProps as AntdTagProps } from 'antd/lib/tag';
|
|
3
|
-
import type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag';
|
|
4
|
-
import { default as AntdTag } from 'antd/lib/tag';
|
|
5
|
-
export * from 'antd/lib/tag';
|
|
6
|
-
export declare enum TagColors {
|
|
7
|
-
grey = "grey",
|
|
8
|
-
rose = "rose",
|
|
9
|
-
lightblue = "lightblue",
|
|
10
|
-
bluegrey = "bluegrey",
|
|
11
|
-
purplegrey = "purplegrey",
|
|
12
|
-
lightpurple = "lightpurple",
|
|
13
|
-
lightgreen = "lightgreen",
|
|
14
|
-
'tnt-pink' = "tnt-pink",
|
|
15
|
-
'tnt-orange' = "tnt-orange",
|
|
16
|
-
'tnt-purple' = "tnt-purple"
|
|
17
|
-
}
|
|
18
|
-
export interface TagProps extends AntdTagProps {
|
|
19
|
-
color?: TagColors | string;
|
|
20
|
-
size?: 'small' | 'middle' | 'large';
|
|
21
|
-
border?: boolean;
|
|
22
|
-
addonContent?: React.ReactNode;
|
|
23
|
-
addonPosition?: 'prefix' | 'suffix';
|
|
24
|
-
addonType?: 'success' | 'info' | 'warning' | 'error';
|
|
25
|
-
ellipsisOptions?: {
|
|
26
|
-
Popover?: boolean;
|
|
27
|
-
emptyText?: string;
|
|
28
|
-
widthLimit?: number | string;
|
|
29
|
-
lines?: number;
|
|
30
|
-
[key: string]: unknown;
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
export interface CheckableTagProps extends AntdCheckableTagProps {
|
|
34
|
-
disabled?: boolean;
|
|
35
|
-
border?: boolean;
|
|
36
|
-
}
|
|
37
|
-
interface TagComponent extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {
|
|
38
|
-
CheckableTag: React.FC<CheckableTagProps>;
|
|
39
|
-
}
|
|
40
|
-
export declare const Tag: TagComponent;
|
|
41
|
-
//# sourceMappingURL=tag.d.ts.map
|
package/lib/tag/tag.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tag.d.ts","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":"AAQA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAClD,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,iBAAiB,IAAI,qBAAqB,EAAE,MAAM,aAAa,CAAA;AAE7E,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AAMhD,cAAc,aAAa,CAAA;AAE3B,oBAAY,SAAS;IACnB,IAAI,SAAS;IACb,IAAI,SAAS;IACb,SAAS,cAAc;IACvB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,WAAW,gBAAgB;IAC3B,UAAU,eAAe;IACzB,UAAU,aAAa;IACvB,YAAY,eAAe;IAC3B,YAAY,eAAe;CAC5B;AAsBD,MAAM,WAAW,QAAS,SAAQ,YAAY;IAC5C,KAAK,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAC1B,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;IACnC,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,aAAa,CAAC,EAAE,QAAQ,GAAG,QAAQ,CAAA;IACnC,SAAS,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,CAAA;IACpD,eAAe,CAAC,EAAE;QAChB,OAAO,CAAC,EAAE,OAAO,CAAA;QACjB,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,UAAU,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;QAC5B,KAAK,CAAC,EAAE,MAAM,CAAA;QACd,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KACvB,CAAA;CACF;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB;AAED,UAAU,YACR,SAAQ,KAAK,CAAC,yBAAyB,CAAC,QAAQ,GAAG,KAAK,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;IAChF,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,CAAA;CAC1C;AAoCD,eAAO,MAAM,GAAG,cAmFE,CAAA"}
|
package/lib/tag/tag.js
DELETED
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _exportNames = {
|
|
7
|
-
TagColors: true,
|
|
8
|
-
Tag: true
|
|
9
|
-
};
|
|
10
|
-
exports.TagColors = exports.Tag = void 0;
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _configProvider = require("antd/lib/config-provider");
|
|
13
|
-
var _tag = _interopRequireWildcard(require("antd/lib/tag"));
|
|
14
|
-
Object.keys(_tag).forEach(function (key) {
|
|
15
|
-
if (key === "default" || key === "__esModule") return;
|
|
16
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
17
|
-
if (key in exports && exports[key] === _tag[key]) return;
|
|
18
|
-
Object.defineProperty(exports, key, {
|
|
19
|
-
enumerable: true,
|
|
20
|
-
get: function get() {
|
|
21
|
-
return _tag[key];
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
26
|
-
var _ellipsis = _interopRequireDefault(require("../ellipsis"));
|
|
27
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
28
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
29
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
30
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
31
|
-
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); }
|
|
32
|
-
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; }
|
|
33
|
-
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
34
|
-
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); }
|
|
35
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
36
|
-
var t = {};
|
|
37
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
38
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
39
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
40
|
-
}
|
|
41
|
-
return t;
|
|
42
|
-
};
|
|
43
|
-
/*
|
|
44
|
-
* @Author: 周泽飞 zefei.zhou@tongdun.net
|
|
45
|
-
* @Date: 2024-03-04 19:15:22
|
|
46
|
-
* @LastEditors: 周泽飞 zefei.zhou@tongdun.net
|
|
47
|
-
* @LastEditTime: 2024-03-11 10:10:31
|
|
48
|
-
* @FilePath: /tntd/packages/tntd/src/tag/tag.tsx
|
|
49
|
-
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
50
|
-
*/
|
|
51
|
-
|
|
52
|
-
var TagColors;
|
|
53
|
-
(function (TagColors) {
|
|
54
|
-
TagColors["grey"] = "grey";
|
|
55
|
-
TagColors["rose"] = "rose";
|
|
56
|
-
TagColors["lightblue"] = "lightblue";
|
|
57
|
-
TagColors["bluegrey"] = "bluegrey";
|
|
58
|
-
TagColors["purplegrey"] = "purplegrey";
|
|
59
|
-
TagColors["lightpurple"] = "lightpurple";
|
|
60
|
-
TagColors["lightgreen"] = "lightgreen";
|
|
61
|
-
TagColors["tnt-pink"] = "tnt-pink";
|
|
62
|
-
TagColors["tnt-orange"] = "tnt-orange";
|
|
63
|
-
TagColors["tnt-purple"] = "tnt-purple";
|
|
64
|
-
})(TagColors || (exports.TagColors = TagColors = {}));
|
|
65
|
-
// 内置的状态
|
|
66
|
-
var statusMap = {
|
|
67
|
-
success: {
|
|
68
|
-
icon: 'check-circle',
|
|
69
|
-
color: 'green'
|
|
70
|
-
},
|
|
71
|
-
info: {
|
|
72
|
-
icon: 'info-circle',
|
|
73
|
-
color: 'blue'
|
|
74
|
-
},
|
|
75
|
-
error: {
|
|
76
|
-
icon: 'close-circle',
|
|
77
|
-
color: 'red'
|
|
78
|
-
},
|
|
79
|
-
warning: {
|
|
80
|
-
icon: 'info-circle',
|
|
81
|
-
color: 'orange'
|
|
82
|
-
}
|
|
83
|
-
};
|
|
84
|
-
var getDisplayEllipsisOptions = function getDisplayEllipsisOptions(props, prefixCls) {
|
|
85
|
-
var _a;
|
|
86
|
-
var _ref = props || {},
|
|
87
|
-
ellipsisOptions = _ref.ellipsisOptions,
|
|
88
|
-
addonContent = _ref.addonContent,
|
|
89
|
-
addonType = _ref.addonType,
|
|
90
|
-
addonPosition = _ref.addonPosition,
|
|
91
|
-
children = _ref.children;
|
|
92
|
-
var options = Object.assign({}, ellipsisOptions);
|
|
93
|
-
var addonContentInfo = null;
|
|
94
|
-
if (addonContent) {
|
|
95
|
-
addonContentInfo = addonContent;
|
|
96
|
-
} else if (addonType && statusMap[addonType]) {
|
|
97
|
-
addonContentInfo = _react["default"].createElement(_icon["default"], {
|
|
98
|
-
type: (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.icon
|
|
99
|
-
});
|
|
100
|
-
}
|
|
101
|
-
if (addonContentInfo) {
|
|
102
|
-
addonContentInfo = _react["default"].createElement("span", {
|
|
103
|
-
className: "".concat(prefixCls, "-addon")
|
|
104
|
-
}, addonContentInfo);
|
|
105
|
-
if (addonPosition === 'prefix') {
|
|
106
|
-
options.prefix = addonContentInfo;
|
|
107
|
-
}
|
|
108
|
-
if (addonPosition === 'suffix') {
|
|
109
|
-
options.suffix = addonContentInfo;
|
|
110
|
-
}
|
|
111
|
-
if (options.Popover === true) {
|
|
112
|
-
options.content = children;
|
|
113
|
-
} else {
|
|
114
|
-
options.title = children;
|
|
115
|
-
}
|
|
116
|
-
options.contentInfo = addonContentInfo;
|
|
117
|
-
}
|
|
118
|
-
return options;
|
|
119
|
-
};
|
|
120
|
-
var Tag = exports.Tag = (0, _react.forwardRef)(function (props, ref) {
|
|
121
|
-
var _a;
|
|
122
|
-
var className = props.className,
|
|
123
|
-
_props$border = props.border,
|
|
124
|
-
border = _props$border === void 0 ? true : _props$border,
|
|
125
|
-
size = props.size,
|
|
126
|
-
addonType = props.addonType,
|
|
127
|
-
addonContent = props.addonContent,
|
|
128
|
-
_props$addonPosition = props.addonPosition,
|
|
129
|
-
addonPosition = _props$addonPosition === void 0 ? 'prefix' : _props$addonPosition,
|
|
130
|
-
ellipsisOptions = props.ellipsisOptions,
|
|
131
|
-
children = props.children,
|
|
132
|
-
restProps = __rest(props, ["className", "border", "size", "addonType", "addonContent", "addonPosition", "ellipsisOptions", "children"]);
|
|
133
|
-
var _ref2 = props || {},
|
|
134
|
-
color = _ref2.color;
|
|
135
|
-
if (!color && addonType) {
|
|
136
|
-
color = (_a = statusMap[addonType]) === null || _a === void 0 ? void 0 : _a.color;
|
|
137
|
-
}
|
|
138
|
-
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref3) {
|
|
139
|
-
var getPrefixCls = _ref3.getPrefixCls;
|
|
140
|
-
var _a, _b, _c, _d, _e;
|
|
141
|
-
var prefixCls = getPrefixCls('tag');
|
|
142
|
-
var displayEllipsisOptions = getDisplayEllipsisOptions({
|
|
143
|
-
ellipsisOptions: ellipsisOptions,
|
|
144
|
-
addonContent: addonContent,
|
|
145
|
-
addonType: addonType,
|
|
146
|
-
addonPosition: addonPosition,
|
|
147
|
-
children: children
|
|
148
|
-
}, prefixCls);
|
|
149
|
-
// 只有一个icon时 padding距离存在差异
|
|
150
|
-
var onlyIcon = _react["default"].isValidElement(children) && _react["default"].Children.only(children) && (children === null || children === void 0 ? void 0 : children.type) instanceof Function && ((_c = (_b = (_a = children === null || children === void 0 ? void 0 : children.type) === null || _a === void 0 ? void 0 : _a.name) === null || _b === void 0 ? void 0 : _b.toLowerCase) === null || _c === void 0 ? void 0 : _c.call(_b)) === 'icon';
|
|
151
|
-
// 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式
|
|
152
|
-
var addonIsImg = _react["default"].isValidElement(addonContent) && (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) && typeof (addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === 'string' && ((_e = (_d = addonContent === null || addonContent === void 0 ? void 0 : addonContent.type) === null || _d === void 0 ? void 0 : _d.toLowerCase) === null || _e === void 0 ? void 0 : _e.call(_d)) === 'img';
|
|
153
|
-
return _react["default"].createElement(_tag["default"], Object.assign({
|
|
154
|
-
className: (0, _classnames["default"])(_defineProperty({}, "".concat(prefixCls, "-").concat(color), color && !!TagColors[color]), 'tnt-tag', "".concat(prefixCls, "-").concat(size || 'middle'), _defineProperty({}, "".concat(prefixCls, "-no-border"), !border), _defineProperty({}, "".concat(prefixCls, "-only-child"), !children || onlyIcon), _defineProperty({}, "".concat(prefixCls, "-addon-img"), !!addonIsImg), className || '')
|
|
155
|
-
}, restProps, {
|
|
156
|
-
color: !TagColors[color] ? color : '',
|
|
157
|
-
ref: ref
|
|
158
|
-
}), !addonContent && !addonType && !ellipsisOptions && children, (!!addonContent || !!addonType || !!ellipsisOptions) && _react["default"].createElement("span", {
|
|
159
|
-
className: "".concat(prefixCls, "-addon-wrap")
|
|
160
|
-
}, !!children && _react["default"].createElement(_ellipsis["default"], Object.assign({}, displayEllipsisOptions), children), !children && (displayEllipsisOptions === null || displayEllipsisOptions === void 0 ? void 0 : displayEllipsisOptions.contentInfo)));
|
|
161
|
-
});
|
|
162
|
-
});
|
|
163
|
-
Tag.CheckableTag = (0, _react.forwardRef)(function (props, ref) {
|
|
164
|
-
// 默认没有border
|
|
165
|
-
var _a = props || {},
|
|
166
|
-
onChange = _a.onChange,
|
|
167
|
-
disabled = _a.disabled,
|
|
168
|
-
_a$border = _a.border,
|
|
169
|
-
border = _a$border === void 0 ? false : _a$border,
|
|
170
|
-
className = _a.className,
|
|
171
|
-
rest = __rest(_a, ["onChange", "disabled", "border", "className"]);
|
|
172
|
-
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref4) {
|
|
173
|
-
var getPrefixCls = _ref4.getPrefixCls;
|
|
174
|
-
var prefixCls = getPrefixCls('tag-checkable');
|
|
175
|
-
return _react["default"].createElement(_tag["default"].CheckableTag, Object.assign({}, !disabled && {
|
|
176
|
-
onChange: onChange
|
|
177
|
-
}, {
|
|
178
|
-
className: (0, _classnames["default"])('tnt-tag', _defineProperty(_defineProperty({}, "".concat(prefixCls, "-disabled"), disabled), "".concat(prefixCls, "-border"), !!border))
|
|
179
|
-
}, rest, {
|
|
180
|
-
ref: ref
|
|
181
|
-
}));
|
|
182
|
-
});
|
|
183
|
-
});
|
package/lib/tag/tag.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sourceRoot":"","sources":["../../src/tag/tag.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;GAOG;AACH,+CAAkD;AAGlD,6DAAwD;AACxD,sDAAgD;AAEhD,4DAAmC;AACnC,2DAAkC;AAClC,mDAA0B;AAE1B,8CAA2B;AAE3B,IAAY,SA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 2024-03-11 10:10:31\n * @FilePath: /tntd/packages/tntd/src/tag/tag.tsx\n * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE\n */\nimport React, { useMemo, forwardRef } from 'react'\nimport type { TagProps as AntdTagProps } from 'antd/lib/tag'\nimport type { CheckableTagProps as AntdCheckableTagProps } from 'antd/lib/tag'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport { default as AntdTag } from 'antd/lib/tag'\nimport type AntdCheckableTag from 'antd/lib/tag/CheckableTag'\nimport classNames from 'classnames'\nimport Ellipsis from '../ellipsis'\nimport Icon from '../icon'\n\nexport * from 'antd/lib/tag'\n\nexport enum TagColors {\n grey = 'grey',\n rose = 'rose',\n lightblue = 'lightblue',\n bluegrey = 'bluegrey',\n purplegrey = 'purplegrey',\n lightpurple = 'lightpurple',\n lightgreen = 'lightgreen',\n 'tnt-pink' = 'tnt-pink',\n 'tnt-orange' = 'tnt-orange',\n 'tnt-purple' = 'tnt-purple',\n}\n\n// 内置的状态\nconst statusMap = {\n success: {\n icon: 'check-circle',\n color: 'green',\n },\n info: {\n icon: 'info-circle',\n color: 'blue',\n },\n error: {\n icon: 'close-circle',\n color: 'red',\n },\n warning: {\n icon: 'info-circle',\n color: 'orange',\n },\n}\n\nexport interface TagProps extends AntdTagProps {\n color?: TagColors | string\n size?: 'small' | 'middle' | 'large'\n border?: boolean\n addonContent?: React.ReactNode\n addonPosition?: 'prefix' | 'suffix'\n addonType?: 'success' | 'info' | 'warning' | 'error'\n ellipsisOptions?: {\n Popover?: boolean\n emptyText?: string\n widthLimit?: number | string\n lines?: number\n [key: string]: unknown\n }\n}\n\nexport interface CheckableTagProps extends AntdCheckableTagProps {\n disabled?: boolean\n border?: boolean\n}\n\ninterface TagComponent\n extends React.ForwardRefExoticComponent<TagProps & React.RefAttributes<AntdTag>> {\n CheckableTag: React.FC<CheckableTagProps>\n}\n\nconst getDisplayEllipsisOptions = (props: TagProps, prefixCls: string) => {\n const { ellipsisOptions, addonContent, addonType, addonPosition, children } = props || {}\n const options = {\n ...ellipsisOptions,\n }\n\n let addonContentInfo = null\n if (addonContent) {\n addonContentInfo = addonContent\n } else if (addonType && statusMap[addonType]) {\n addonContentInfo = <Icon type={statusMap[addonType]?.icon} />\n }\n\n if (addonContentInfo) {\n addonContentInfo = <span className={`${prefixCls}-addon`}>{addonContentInfo}</span>\n if (addonPosition === 'prefix') {\n options.prefix = addonContentInfo\n }\n\n if (addonPosition === 'suffix') {\n options.suffix = addonContentInfo\n }\n\n if (options.Popover === true) {\n options.content = children\n } else {\n options.title = children\n }\n options.contentInfo = addonContentInfo\n }\n\n return options\n}\n\nexport const Tag = forwardRef<AntdTag, TagProps & { capitalize?: boolean }>((props, ref) => {\n const {\n className,\n border = true,\n size,\n addonType,\n addonContent,\n addonPosition = 'prefix',\n ellipsisOptions,\n children,\n ...restProps\n } = props\n\n let { color } = props || {}\n if (!color && addonType) {\n color = statusMap[addonType]?.color\n }\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag')\n\n const displayEllipsisOptions = getDisplayEllipsisOptions(\n {\n ellipsisOptions,\n addonContent,\n addonType,\n addonPosition,\n children,\n },\n prefixCls\n )\n\n // 只有一个icon时 padding距离存在差异\n const onlyIcon =\n React.isValidElement(children) &&\n React.Children.only(children) &&\n children?.type instanceof Function &&\n children?.type?.name?.toLowerCase?.() === 'icon'\n\n // 前缀是图片 只处理一层节点下是图片的,否则就用户自定义样式\n const addonIsImg =\n React.isValidElement(addonContent) &&\n addonContent?.type &&\n typeof addonContent?.type === 'string' &&\n addonContent?.type?.toLowerCase?.() === 'img'\n\n return (\n <AntdTag\n className={classNames(\n {\n [`${prefixCls}-${color}`]: color && !!TagColors[color as keyof typeof TagColors],\n },\n 'tnt-tag',\n `${prefixCls}-${size || 'middle'}`,\n {\n [`${prefixCls}-no-border`]: !border,\n },\n {\n [`${prefixCls}-only-child`]: !children || onlyIcon,\n },\n {\n [`${prefixCls}-addon-img`]: !!addonIsImg,\n },\n className || ''\n )}\n {...restProps}\n color={!TagColors[color as keyof typeof TagColors] ? color : ''}\n ref={ref}\n >\n {!addonContent && !addonType && !ellipsisOptions && children}\n {(!!addonContent || !!addonType || !!ellipsisOptions) && (\n <span className={`${prefixCls}-addon-wrap`}>\n {!!children && <Ellipsis {...displayEllipsisOptions}>{children}</Ellipsis>}\n {!children && displayEllipsisOptions?.contentInfo}\n </span>\n )}\n </AntdTag>\n )\n }}\n </ConfigConsumer>\n )\n}) as TagComponent\n\nTag.CheckableTag = forwardRef<AntdCheckableTag, CheckableTagProps>(\n (props: CheckableTagProps, ref) => {\n // 默认没有border\n const { onChange, disabled, border = false, className, ...rest } = props || {}\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('tag-checkable')\n return (\n <AntdTag.CheckableTag\n {...(!disabled && { onChange })}\n className={classNames('tnt-tag', {\n [`${prefixCls}-disabled`]: disabled,\n [`${prefixCls}-border`]: !!border,\n })}\n {...rest}\n ref={ref}\n />\n )\n }}\n </ConfigConsumer>\n )\n }\n)\n"]}
|
package/lib/tag/tag.less
DELETED
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
@import '../style/mixins/index';
|
|
2
|
-
@import './color.less';
|
|
3
|
-
@tag-prefix-cls: ~'@{ant-prefix}-tag';
|
|
4
|
-
// 默认
|
|
5
|
-
@tag-height: 20px;
|
|
6
|
-
@tag-small-size: 0 8px;
|
|
7
|
-
@tag-middle-size: 1px 10px;
|
|
8
|
-
@tag-large-size: 3px 12px;
|
|
9
|
-
|
|
10
|
-
// img tag
|
|
11
|
-
@tag-img-small-size: 1px 5px 1px 3px;
|
|
12
|
-
@tag-img-middle-size: 2px 6px 2px 3px;
|
|
13
|
-
@tag-img-large-size: 3px 12px 3px 4px;
|
|
14
|
-
|
|
15
|
-
// 只有icon的尺寸
|
|
16
|
-
@tag-only-icon-small-size: 5px;
|
|
17
|
-
@tag-only-icon-middle-size: 6px;
|
|
18
|
-
@tag-only-icon-large-size: 7px;
|
|
19
|
-
|
|
20
|
-
.tnt-tag.@{tag-prefix-cls} {
|
|
21
|
-
line-height: @tag-height;
|
|
22
|
-
|
|
23
|
-
.@{iconfont-css-prefix}-close {
|
|
24
|
-
.iconfont-size-under-12px(12px);
|
|
25
|
-
vertical-align: middle;
|
|
26
|
-
line-height: 1;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.anticon{
|
|
30
|
-
font-size: @font-size-sm;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// 头像插件 可以为icon 图片
|
|
34
|
-
.@{tag-prefix-cls}-addon-wrap{
|
|
35
|
-
display: inline-block;
|
|
36
|
-
vertical-align: middle;
|
|
37
|
-
margin-top: -1px;
|
|
38
|
-
.@{tag-prefix-cls}-addon{
|
|
39
|
-
.iconfont-size-under-12px(12px);
|
|
40
|
-
display: flex;
|
|
41
|
-
align-items: center;
|
|
42
|
-
justify-content: center;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
.tntd-ellipsis,.tnt-ellipsis{
|
|
46
|
-
align-items: center;
|
|
47
|
-
.@{tag-prefix-cls}-addon{
|
|
48
|
-
>*{
|
|
49
|
-
border-radius: 100%;
|
|
50
|
-
overflow: hidden;
|
|
51
|
-
display: block;
|
|
52
|
-
}
|
|
53
|
-
+*{
|
|
54
|
-
margin-left: 4px;
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
&-small{
|
|
61
|
-
padding: @tag-small-size;
|
|
62
|
-
}
|
|
63
|
-
&-middle{
|
|
64
|
-
padding: @tag-middle-size;
|
|
65
|
-
}
|
|
66
|
-
&-large{
|
|
67
|
-
padding: @tag-large-size;
|
|
68
|
-
font-size: 14px;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
// 不带边框
|
|
72
|
-
&.@{tag-prefix-cls}-no-border{
|
|
73
|
-
border-color:transparent;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// 只有一个icon
|
|
77
|
-
&.@{tag-prefix-cls}-only-child{
|
|
78
|
-
line-height: @font-size-sm;
|
|
79
|
-
&.@{tag-prefix-cls}-small{
|
|
80
|
-
padding: @tag-only-icon-small-size;
|
|
81
|
-
}
|
|
82
|
-
&.@{tag-prefix-cls}-middle{
|
|
83
|
-
padding: @tag-only-icon-middle-size;
|
|
84
|
-
}
|
|
85
|
-
&.@{tag-prefix-cls}-large{
|
|
86
|
-
padding: @tag-only-icon-large-size;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// 带图片
|
|
91
|
-
&.@{tag-prefix-cls}-addon-img{
|
|
92
|
-
&.@{tag-prefix-cls}-small{
|
|
93
|
-
padding: @tag-img-small-size;
|
|
94
|
-
.@{tag-prefix-cls}-addon{
|
|
95
|
-
width: 16px;
|
|
96
|
-
height: 16px;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
&.@{tag-prefix-cls}-middle{
|
|
100
|
-
padding: @tag-img-middle-size;
|
|
101
|
-
.@{tag-prefix-cls}-addon{
|
|
102
|
-
width: 18px;
|
|
103
|
-
height: 18px;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
&.@{tag-prefix-cls}-large{
|
|
107
|
-
padding: @tag-img-large-size;
|
|
108
|
-
.@{tag-prefix-cls}-addon{
|
|
109
|
-
width: 20px;
|
|
110
|
-
height: 20px;
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
// mixin to iterate over colors and create CSS class for each one
|
|
116
|
-
.make-color-classes(@i: length(@preset-colors-custom)) when (@i > 0) {
|
|
117
|
-
.make-color-classes(@i - 1);
|
|
118
|
-
@color: extract(@preset-colors-custom, @i);
|
|
119
|
-
@lightColor: '@{color}-1';
|
|
120
|
-
@lightBorderColor: '@{color}-4';
|
|
121
|
-
@darkColor: '@{color}-7';
|
|
122
|
-
&.@{tag-prefix-cls}-@{color} {
|
|
123
|
-
color: @@darkColor;
|
|
124
|
-
background: @@lightColor;
|
|
125
|
-
border-color: @@lightBorderColor;
|
|
126
|
-
>.@{iconfont-css-prefix}-close {
|
|
127
|
-
color: @@darkColor;//fade(@@darkColor,80%);
|
|
128
|
-
opacity: .8;
|
|
129
|
-
}
|
|
130
|
-
&.@{tag-prefix-cls}-no-border{
|
|
131
|
-
border-color:transparent;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
&.@{tag-prefix-cls}-@{color}-inverse {
|
|
135
|
-
color: @text-color-inverse;
|
|
136
|
-
background: @@darkColor;
|
|
137
|
-
border-color: @@darkColor;
|
|
138
|
-
|
|
139
|
-
&.@{tag-prefix-cls}-no-border{
|
|
140
|
-
border-color:transparent;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.make-color-classes();
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
// 可选
|
|
150
|
-
&.@{tag-prefix-cls}-checkable {
|
|
151
|
-
background-color: @tag-default-bg;
|
|
152
|
-
border-color: transparent;
|
|
153
|
-
padding: 2px 12px;
|
|
154
|
-
cursor: pointer;
|
|
155
|
-
&-border{
|
|
156
|
-
border-color: @border-color-base;
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
&:active,
|
|
160
|
-
&-checked {
|
|
161
|
-
color: @primary-7;
|
|
162
|
-
background-color: @primary-1;
|
|
163
|
-
&.@{tag-prefix-cls}-checkable-border{
|
|
164
|
-
border-color: @primary-3;
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
&-checked {
|
|
169
|
-
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
170
|
-
color: @primary-color;
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
&:not(&-checked){
|
|
175
|
-
&.@{tag-prefix-cls}-checkable-disabled:hover {
|
|
176
|
-
color: inherit;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
&-disabled{
|
|
181
|
-
opacity: 0.5;
|
|
182
|
-
cursor: not-allowed;
|
|
183
|
-
&:hover{
|
|
184
|
-
opacity: 0.5;
|
|
185
|
-
color: inherit;
|
|
186
|
-
}
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { TimePickerProps as AntdTimePickerProps } from 'antd/lib/time-picker';
|
|
3
|
-
export * from 'antd/lib/time-picker';
|
|
4
|
-
declare const TimePicker: React.FC<AntdTimePickerProps & {
|
|
5
|
-
theme?: string;
|
|
6
|
-
readonly?: boolean;
|
|
7
|
-
}>;
|
|
8
|
-
export default TimePicker;
|
|
9
|
-
//# sourceMappingURL=TimePicker.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.d.ts","sourceRoot":"","sources":["../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAA;AAEvC,OAAO,KAAK,EAAE,eAAe,IAAI,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AAIjF,cAAc,qBAAqB,CAAA;AACnC,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,GAAG;IAAE,KAAK,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,CAqBtF,CAAA;AAED,eAAe,UAAU,CAAA"}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
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); }
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
var _exportNames = {};
|
|
8
|
-
exports["default"] = void 0;
|
|
9
|
-
var _react = _interopRequireDefault(require("react"));
|
|
10
|
-
var _icon = _interopRequireDefault(require("../icon"));
|
|
11
|
-
var _configProvider = require("antd/lib/config-provider");
|
|
12
|
-
var _timePicker = _interopRequireWildcard(require("antd/lib/time-picker"));
|
|
13
|
-
Object.keys(_timePicker).forEach(function (key) {
|
|
14
|
-
if (key === "default" || key === "__esModule") return;
|
|
15
|
-
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
|
|
16
|
-
if (key in exports && exports[key] === _timePicker[key]) return;
|
|
17
|
-
Object.defineProperty(exports, key, {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
get: function get() {
|
|
20
|
-
return _timePicker[key];
|
|
21
|
-
}
|
|
22
|
-
});
|
|
23
|
-
});
|
|
24
|
-
var _classnames = _interopRequireDefault(require("classnames"));
|
|
25
|
-
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
26
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { "default": e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n["default"] = e, t && t.set(e, n), n; }
|
|
27
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
28
|
-
var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
29
|
-
var t = {};
|
|
30
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
|
|
31
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
32
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
|
|
33
|
-
}
|
|
34
|
-
return t;
|
|
35
|
-
};
|
|
36
|
-
var TimePicker = function TimePicker(props) {
|
|
37
|
-
//theme样式类型 outline | fill 默认 outline
|
|
38
|
-
var _props$theme = props.theme,
|
|
39
|
-
theme = _props$theme === void 0 ? 'outline' : _props$theme,
|
|
40
|
-
className = props.className,
|
|
41
|
-
suffixIcon = props.suffixIcon,
|
|
42
|
-
restProps = __rest(props, ["theme", "className", "suffixIcon"]);
|
|
43
|
-
var defaultIcon = _react["default"].createElement(_icon["default"], {
|
|
44
|
-
type: "clock-circle"
|
|
45
|
-
});
|
|
46
|
-
return _react["default"].createElement(_configProvider.ConfigConsumer, null, function (_ref) {
|
|
47
|
-
var getPrefixCls = _ref.getPrefixCls;
|
|
48
|
-
var prefixCls = getPrefixCls('time-picker');
|
|
49
|
-
return _react["default"].createElement(_timePicker["default"], Object.assign({
|
|
50
|
-
suffixIcon: suffixIcon || defaultIcon,
|
|
51
|
-
className: (0, _classnames["default"])(className, "".concat(prefixCls, "-").concat(theme))
|
|
52
|
-
}, restProps));
|
|
53
|
-
});
|
|
54
|
-
};
|
|
55
|
-
var _default = exports["default"] = TimePicker;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TimePicker.js","sourceRoot":"","sources":["../../src/time-picker/TimePicker.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,kDAAuC;AACvC,mDAA0B;AAE1B,6DAAwD;AACxD,sEAA+C;AAC/C,4DAAmC;AACnC,sDAAmC;AACnC,MAAM,UAAU,GAA2E,CACzF,KAAK,EACL,EAAE;IACF,sCAAsC;IACtC,MAAM,EAAE,KAAK,GAAG,SAAS,EAAE,SAAS,EAAE,UAAU,KAAmB,KAAK,EAAnB,SAAS,UAAK,KAAK,EAAlE,oCAA0D,CAAQ,CAAA;IACxE,MAAM,WAAW,GAAG,8BAAC,cAAI,IAAC,IAAI,EAAC,cAAc,GAAG,CAAA;IAEhD,OAAO,CACL,8BAAC,gCAAc,QACZ,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;QACpB,MAAM,SAAS,GAAG,YAAY,CAAC,aAAa,CAAC,CAAA;QAC7C,OAAO,CACL,8BAAC,qBAAa,kBACZ,UAAU,EAAE,UAAU,IAAI,WAAW,EACrC,SAAS,EAAE,IAAA,oBAAU,EAAC,SAAS,EAAE,GAAG,SAAS,IAAI,KAAK,EAAE,CAAC,IACrD,SAAS,EACb,CACH,CAAA;IACH,CAAC,CACc,CAClB,CAAA;AACH,CAAC,CAAA;AAED,kBAAe,UAAU,CAAA","sourcesContent":["import React, { useState } from 'react'\nimport Icon from '../icon'\nimport type { TimePickerProps as AntdTimePickerProps } from 'antd/lib/time-picker'\nimport { ConfigConsumer } from 'antd/lib/config-provider'\nimport AntTimePicker from 'antd/lib/time-picker'\nimport classNames from 'classnames'\nexport * from 'antd/lib/time-picker'\nconst TimePicker: React.FC<AntdTimePickerProps & { theme?: string; readonly?: boolean }> = (\n props\n) => {\n //theme样式类型 outline | fill 默认 outline\n const { theme = 'outline', className, suffixIcon, ...restProps } = props\n const defaultIcon = <Icon type=\"clock-circle\" />\n\n return (\n <ConfigConsumer>\n {({ getPrefixCls }) => {\n const prefixCls = getPrefixCls('time-picker')\n return (\n <AntTimePicker\n suffixIcon={suffixIcon || defaultIcon}\n className={classNames(className, `${prefixCls}-${theme}`)}\n {...restProps}\n />\n )\n }}\n </ConfigConsumer>\n )\n}\n\nexport default TimePicker\n"]}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
@import '../style/themes/index';
|
|
2
|
-
|
|
3
|
-
@timepicker-prefix-cls: ~'@{ant-prefix}-time-picker';
|
|
4
|
-
.@{timepicker-prefix-cls} {
|
|
5
|
-
input{
|
|
6
|
-
border-color: @border-color-secondary;
|
|
7
|
-
}
|
|
8
|
-
&:has(input:not([value=''])),&:hover {
|
|
9
|
-
.@{timepicker-prefix-cls}-icon{
|
|
10
|
-
i{
|
|
11
|
-
color: @text-color-secondary;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
&:has(input[disabled]){
|
|
16
|
-
.@{timepicker-prefix-cls}-icon{
|
|
17
|
-
i{
|
|
18
|
-
color: @disabled-color;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
&-fill{
|
|
23
|
-
input {
|
|
24
|
-
background-color: @fill-color-quaternary;
|
|
25
|
-
border-color: @fill-color-quaternary;
|
|
26
|
-
&[disabled] {
|
|
27
|
-
border: none;
|
|
28
|
-
}
|
|
29
|
-
&:focus{
|
|
30
|
-
background-color: @white;
|
|
31
|
-
}
|
|
32
|
-
&:not([value='']):hover {
|
|
33
|
-
background-color: @white;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Action.d.ts","sourceRoot":"","sources":["../../src/tntd-action/Action.js"],"names":[],"mappings":"AASA;;;sBAgBC"}
|