shineout 2.0.0-rc.7 → 2.0.0-rc.9

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.
@@ -68,7 +68,7 @@ export default class<Item> {
68
68
  getPath(id: KeygenResult): TreePathType;
69
69
  getChecked(id: KeygenResult): boolean | "indeterminate";
70
70
  getKey(data: Item, id?: KeygenResult, index?: number): KeygenResult;
71
- initValue(ids?: KeygenResult[], forceCheck?: boolean): 0 | undefined;
71
+ initValue(ids?: KeygenResult[], forceCheck?: boolean): CheckedStatus | undefined;
72
72
  initData(data: Item[], path: KeygenResult[], disabled?: boolean, index?: number[]): KeygenResult[];
73
73
  setData(data?: Item[], dispatch?: boolean): void;
74
74
  subscribe(name: string, fn: Function): void;
package/css/Datum/Tree.js CHANGED
@@ -297,7 +297,7 @@ function () {
297
297
  });
298
298
  }
299
299
 
300
- var checked = 0;
300
+ var checked;
301
301
  ids.forEach(function (id) {
302
302
  var _this4$pathMap$get = _this4.pathMap.get(id),
303
303
  children = _this4$pathMap$get.children;
@@ -211,7 +211,9 @@ function (_PureComponent) {
211
211
  _proto.renderType = function renderType(src) {
212
212
  var _this$props4 = this.props,
213
213
  title = _this$props4.title,
214
- fit = _this$props4.fit;
214
+ fit = _this$props4.fit,
215
+ _this$props4$noImgDra = _this$props4.noImgDrag,
216
+ noImgDrag = _this$props4$noImgDra === void 0 ? false : _this$props4$noImgDra;
215
217
  return fit === 'fill' || fit === 'fit' ? _react.default.createElement("div", {
216
218
  className: (0, _styles.imageClass)('inner'),
217
219
  title: title,
@@ -223,7 +225,8 @@ function (_PureComponent) {
223
225
  title: title
224
226
  }, _react.default.createElement("img", {
225
227
  alt: "",
226
- src: src
228
+ src: src,
229
+ draggable: !noImgDrag
227
230
  }));
228
231
  };
229
232
 
@@ -130,6 +130,14 @@ export interface ImageProps extends StandardProps {
130
130
  * default: -
131
131
  */
132
132
  title?: string;
133
+ /**
134
+ * The original property of html
135
+ *
136
+ * 是否禁止 img 元素原生 draggable 属性
137
+ *
138
+ * default: false
139
+ */
140
+ noImgDrag?: boolean;
133
141
  }
134
142
  export interface ImageGroupProps extends StandardProps {
135
143
  /**
@@ -83,9 +83,11 @@ function (_Component) {
83
83
 
84
84
  _this = _Component.call(this, props) || this;
85
85
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "table", void 0);
86
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)), "visibleObserver", void 0);
86
87
  _this.state = {
87
88
  scrollLeft: 0,
88
- scrollRight: 0
89
+ scrollRight: 0,
90
+ inView: false
89
91
  };
90
92
  _this.bindTable = _this.bindTable.bind((0, _assertThisInitialized2.default)((0, _assertThisInitialized2.default)(_this)));
91
93
  return _this;
@@ -93,6 +95,22 @@ function (_Component) {
93
95
 
94
96
  var _proto = Table.prototype;
95
97
 
98
+ _proto.componentDidMount = function componentDidMount() {
99
+ var _this2 = this;
100
+
101
+ if (this.props.sticky && this.table && global.IntersectionObserver) {
102
+ var observer = new IntersectionObserver(function (entries) {
103
+ var entry = entries[0];
104
+
105
+ _this2.setState({
106
+ inView: entry.intersectionRatio > 0
107
+ });
108
+ });
109
+ observer.observe(this.table);
110
+ this.visibleObserver = observer;
111
+ }
112
+ };
113
+
96
114
  _proto.componentDidUpdate = function componentDidUpdate(preProps) {
97
115
  var _this$props = this.props,
98
116
  datum = _this$props.datum,
@@ -105,6 +123,13 @@ function (_Component) {
105
123
  }
106
124
  };
107
125
 
126
+ _proto.componentWillUnmount = function componentWillUnmount() {
127
+ if (this.visibleObserver) {
128
+ this.visibleObserver.disconnect();
129
+ this.visibleObserver = null;
130
+ }
131
+ };
132
+
108
133
  _proto.getRowsInView = function getRowsInView() {
109
134
  var _this$props2 = this.props,
110
135
  _this$props2$rowsInVi = _this$props2.rowsInView,
@@ -116,6 +141,10 @@ function (_Component) {
116
141
  return parseInt(String(rowsInView), 10);
117
142
  };
118
143
 
144
+ _proto.getShouldSticky = function getShouldSticky() {
145
+ return this.props.sticky && this.state.inView;
146
+ };
147
+
119
148
  _proto.bindTable = function bindTable(el) {
120
149
  var bindWrapper = this.props.bindWrapper;
121
150
  this.table = el;
@@ -144,7 +173,7 @@ function (_Component) {
144
173
  var _this$state = this.state,
145
174
  scrollLeft = _this$state.scrollLeft,
146
175
  scrollRight = _this$state.scrollRight;
147
- var className = (0, _classnames.default)((0, _styles.tableClass)('_', size, hover && 'hover', bordered && 'bordered', fixed && 'fixed', scrollLeft > 0 && 'left-float', scrollRight < 0 && 'right-float', "vertical-" + verticalAlign, columnResizable && 'resize', others.sticky && 'sticky', (0, _config.isRTL)() && 'rtl'), this.props.className);
176
+ var className = (0, _classnames.default)((0, _styles.tableClass)('_', size, hover && 'hover', bordered && 'bordered', fixed && 'fixed', scrollLeft > 0 && 'left-float', scrollRight < 0 && 'right-float', "vertical-" + verticalAlign, columnResizable && 'resize', this.getShouldSticky() && 'sticky', (0, _config.isRTL)() && 'rtl'), this.props.className);
148
177
  var props = (0, _objectSpread2.default)({}, others, {
149
178
  children: children,
150
179
  fixed: fixed,
@@ -172,7 +201,8 @@ function (_Component) {
172
201
  ref: this.bindTable,
173
202
  style: newStyle
174
203
  }, events), _react.default.createElement(RenderTable, (0, _extends2.default)({}, props, {
175
- bordered: bordered
204
+ bordered: bordered,
205
+ sticky: this.getShouldSticky()
176
206
  })), loading && _react.default.createElement("div", {
177
207
  className: (0, _styles.tableClass)('loading')
178
208
  }, typeof loading === 'boolean' ? _react.default.createElement(_Spin.default, {
package/css/index.d.ts CHANGED
@@ -1,58 +1,150 @@
1
- declare namespace _default {
2
- export { utils };
3
- export const version: string;
1
+ // Created by scripts/src-index.js.
2
+ import * as AlertType from './Alert/interface'
3
+ import * as BreadcrumbType from './Breadcrumb/interface'
4
+ import * as ButtonType from './Button/interface'
5
+ import * as CardType from './Card/interface'
6
+ import * as CardGroupType from './CardGroup/interface'
7
+ import * as CarouselType from './Carousel/interface'
8
+ import * as CascaderType from './Cascader/interface'
9
+ import * as CheckboxType from './Checkbox/interface'
10
+ import * as DatePickerType from './DatePicker/interface'
11
+ import * as DividerType from './Divider/interface'
12
+ import * as DrawerType from './Drawer/interface'
13
+ import * as DropdownType from './Dropdown/interface'
14
+ import * as EditableAreaType from './EditableArea/interface'
15
+ import * as FormType from './Form/interface'
16
+ import * as GapType from './Gap/interface'
17
+ import * as GridType from './Grid/interface'
18
+ import * as IconType from './Icon/interface'
19
+ import * as ImageType from './Image/interface'
20
+ import * as InputType from './Input/interface'
21
+ import * as ListType from './List/interface'
22
+ import * as MenuType from './Menu/interface'
23
+ import * as MessageType from './Message/interface'
24
+ import * as ModalType from './Modal/interface'
25
+ import * as PaginationType from './Pagination/interface'
26
+ import * as PopoverType from './Popover/interface'
27
+ import * as ProgressType from './Progress/interface'
28
+ import * as RadioType from './Radio/interface'
29
+ import * as RateType from './Rate/interface'
30
+ import * as RuleType from './Rule/interface'
31
+ import * as SelectType from './Select/interface'
32
+ import * as SliderType from './Slider/interface'
33
+ import * as SpinType from './Spin/interface'
34
+ import * as StickyType from './Sticky/interface'
35
+ import * as SwitchType from './Switch/interface'
36
+ import * as TableType from './Table/interface'
37
+ import * as TabsType from './Tabs/interface'
38
+ import * as TagType from './Tag/interface'
39
+ import * as TextareaType from './Textarea/interface'
40
+ import * as TooltipType from './Tooltip/interface'
41
+ import * as TransferType from './Transfer/interface'
42
+ import * as TreeType from './Tree/interface'
43
+ import * as TreeSelectType from './TreeSelect/interface'
44
+ import * as UploadType from './Upload/interface'
45
+ export declare namespace TYPE {
46
+ export import Alert = AlertType
47
+ export import Breadcrumb = BreadcrumbType
48
+ export import Button = ButtonType
49
+ export import Card = CardType
50
+ export import CardGroup = CardGroupType
51
+ export import Carousel = CarouselType
52
+ export import Cascader = CascaderType
53
+ export import Checkbox = CheckboxType
54
+ export import DatePicker = DatePickerType
55
+ export import Divider = DividerType
56
+ export import Drawer = DrawerType
57
+ export import Dropdown = DropdownType
58
+ export import EditableArea = EditableAreaType
59
+ export import Form = FormType
60
+ export import Gap = GapType
61
+ export import Grid = GridType
62
+ export import Icon = IconType
63
+ export import Image = ImageType
64
+ export import Input = InputType
65
+ export import List = ListType
66
+ export import Menu = MenuType
67
+ export import Message = MessageType
68
+ export import Modal = ModalType
69
+ export import Pagination = PaginationType
70
+ export import Popover = PopoverType
71
+ export import Progress = ProgressType
72
+ export import Radio = RadioType
73
+ export import Rate = RateType
74
+ export import Rule = RuleType
75
+ export import Select = SelectType
76
+ export import Slider = SliderType
77
+ export import Spin = SpinType
78
+ export import Sticky = StickyType
79
+ export import Switch = SwitchType
80
+ export import Table = TableType
81
+ export import Tabs = TabsType
82
+ export import Tag = TagType
83
+ export import Textarea = TextareaType
84
+ export import Tooltip = TooltipType
85
+ export import Transfer = TransferType
86
+ export import Tree = TreeType
87
+ export import TreeSelect = TreeSelectType
88
+ export import Upload = UploadType
4
89
  }
5
- export default _default;
6
- export { utils };
7
- export { setLocale } from "./locale";
8
- export { default as LazyList } from "./AnimationList/LazyList";
9
- export { default as Alert } from "./Alert";
10
- export { default as AnimationList } from "./AnimationList";
11
- export { default as Breadcrumb } from "./Breadcrumb";
12
- export { default as Button } from "./Button";
13
- export { default as Card } from "./Card";
14
- export { default as CardGroup } from "./CardGroup";
15
- export { default as Carousel } from "./Carousel";
16
- export { default as Cascader } from "./Cascader";
17
- export { default as Checkbox } from "./Checkbox";
18
- export { default as DatePicker } from "./DatePicker";
19
- export { default as Datum } from "./Datum";
20
- export { default as Divider } from "./Divider";
21
- export { default as Drawer } from "./Drawer";
22
- export { default as Dropdown } from "./Dropdown";
23
- export { default as EditableArea } from "./EditableArea";
24
- export { default as Form } from "./Form";
25
- export { default as Gap } from "./Gap";
26
- export { default as Grid } from "./Grid";
27
- export { default as Icon } from "./Icon";
28
- export { default as Image } from "./Image";
29
- export { default as Input } from "./Input";
30
- export { default as Lazyload } from "./Lazyload";
31
- export { default as List } from "./List";
32
- export { default as Menu } from "./Menu";
33
- export { default as Message } from "./Message";
34
- export { default as Modal } from "./Modal";
35
- export { default as Pagination } from "./Pagination";
36
- export { default as Popover } from "./Popover";
37
- export { default as Progress } from "./Progress";
38
- export { default as Radio } from "./Radio";
39
- export { default as Rate } from "./Rate";
40
- export { default as Rule } from "./Rule";
41
- export { default as Scroll } from "./Scroll";
42
- export { default as Select } from "./Select";
43
- export { default as Slider } from "./Slider";
44
- export { default as Spin } from "./Spin";
45
- export { default as Sticky } from "./Sticky";
46
- export { default as Switch } from "./Switch";
47
- export { default as Table } from "./Table";
48
- export { default as Tabs } from "./Tabs";
49
- export { default as Tag } from "./Tag";
50
- export { default as Textarea } from "./Textarea";
51
- export { default as Tooltip } from "./Tooltip";
52
- export { default as Transfer } from "./Transfer";
53
- export { default as Tree } from "./Tree";
54
- export { default as TreeSelect } from "./TreeSelect";
55
- export { default as Upload } from "./Upload";
56
- import * as utils from "./utils";
57
- export { color, style } from "./utils/expose";
58
- export { default as config, setConfig, isRTL } from "./config";
90
+ import * as utils from './utils'
91
+
92
+ declare const __default: {
93
+ utils: typeof utils,
94
+ version: '1.12.0-rc.6'
95
+ }
96
+ export default __default
97
+
98
+ export { utils }
99
+ export { setLocale } from './locale'
100
+ export { color, style } from './utils/expose'
101
+ export { default as config, setConfig, isRTL } from './config'
102
+
103
+ export { default as LazyList } from './AnimationList/LazyList'
104
+ export { default as Alert } from './Alert'
105
+ export { default as AnimationList } from './AnimationList'
106
+ export { default as Breadcrumb } from './Breadcrumb'
107
+ export { default as Button } from './Button'
108
+ export { default as Card } from './Card'
109
+ export { default as CardGroup } from './CardGroup'
110
+ export { default as Carousel } from './Carousel'
111
+ export { default as Cascader } from './Cascader'
112
+ export { default as Checkbox } from './Checkbox'
113
+ export { default as DatePicker } from './DatePicker'
114
+ export { default as Datum } from './Datum'
115
+ export { default as Divider } from './Divider'
116
+ export { default as Drawer } from './Drawer'
117
+ export { default as Dropdown } from './Dropdown'
118
+ export { default as EditableArea } from './EditableArea'
119
+ export { default as Form } from './Form'
120
+ export { default as Gap } from './Gap'
121
+ export { default as Grid } from './Grid'
122
+ export { default as Icon } from './Icon'
123
+ export { default as Image } from './Image'
124
+ export { default as Input } from './Input'
125
+ export { default as Lazyload } from './Lazyload'
126
+ export { default as List } from './List'
127
+ export { default as Menu } from './Menu'
128
+ export { default as Message } from './Message'
129
+ export { default as Modal } from './Modal'
130
+ export { default as Pagination } from './Pagination'
131
+ export { default as Popover } from './Popover'
132
+ export { default as Progress } from './Progress'
133
+ export { default as Radio } from './Radio'
134
+ export { default as Rate } from './Rate'
135
+ export { default as Rule } from './Rule'
136
+ export { default as Scroll } from './Scroll'
137
+ export { default as Select } from './Select'
138
+ export { default as Slider } from './Slider'
139
+ export { default as Spin } from './Spin'
140
+ export { default as Sticky } from './Sticky'
141
+ export { default as Switch } from './Switch'
142
+ export { default as Table } from './Table'
143
+ export { default as Tabs } from './Tabs'
144
+ export { default as Tag } from './Tag'
145
+ export { default as Textarea } from './Textarea'
146
+ export { default as Tooltip } from './Tooltip'
147
+ export { default as Transfer } from './Transfer'
148
+ export { default as Tree } from './Tree'
149
+ export { default as TreeSelect } from './TreeSelect'
150
+ export { default as Upload } from './Upload'
package/css/index.js CHANGED
@@ -220,6 +220,6 @@ exports.Upload = _Upload.default;
220
220
  // Created by scripts/src-index.js.
221
221
  var _default = {
222
222
  utils: utils,
223
- version: '2.0.0-rc.7'
223
+ version: '2.0.0-rc.9'
224
224
  };
225
225
  exports.default = _default;