react-ui-basics 0.0.246 → 0.0.248
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/Animated.d.ts +36 -0
- package/Animated.js +125 -124
- package/Animated.js.map +1 -1
- package/AutocompleteSelect.js +30 -18
- package/AutocompleteSelect.js.map +1 -1
- package/ReactConstants.d.ts +5 -0
- package/ReactConstants.js.map +1 -1
- package/bundle.css +754 -754
- package/package.json +1 -1
- package/router/Link.js +1 -2
- package/router/Link.js.map +1 -1
- package/router/NavLink.js +1 -2
- package/router/NavLink.js.map +1 -1
- package/router/Route.d.ts +14 -0
- package/router/Route.js +163 -159
- package/router/Route.js.map +1 -1
- package/router/index.d.ts +8 -0
- package/router/index.js +3 -3
- package/router/index.js.map +1 -1
- package/src/{Animated.js → Animated.tsx} +77 -74
- package/src/AutocompleteSelect.js +27 -14
- package/src/ReactConstants.ts +12 -0
- package/src/router/{Route.js → Route.tsx} +50 -46
- package/src/router/index.ts +9 -0
- package/src/router/index.js +0 -9
package/Animated.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
2
|
+
import './Animated.css';
|
|
3
|
+
import { PureComponent } from "./ReactConstants";
|
|
4
|
+
export interface AnimatedStyles {
|
|
5
|
+
mounting?: CSSProperties;
|
|
6
|
+
mounted?: CSSProperties;
|
|
7
|
+
unmounting?: CSSProperties;
|
|
8
|
+
default?: CSSProperties;
|
|
9
|
+
}
|
|
10
|
+
export interface AnimatedProps {
|
|
11
|
+
value: boolean;
|
|
12
|
+
className?: string;
|
|
13
|
+
styles?: AnimatedStyles;
|
|
14
|
+
mountingDelay?: number;
|
|
15
|
+
unmountingDelay?: number;
|
|
16
|
+
mounting?: number;
|
|
17
|
+
unmounting?: number;
|
|
18
|
+
}
|
|
19
|
+
export interface AnimatedState {
|
|
20
|
+
enabled: boolean;
|
|
21
|
+
mounting: boolean;
|
|
22
|
+
unmounting: boolean;
|
|
23
|
+
mounted: boolean;
|
|
24
|
+
}
|
|
25
|
+
declare class Animated extends PureComponent<AnimatedProps, AnimatedState> {
|
|
26
|
+
static defaultProps: {
|
|
27
|
+
className: string;
|
|
28
|
+
mounting: number;
|
|
29
|
+
unmounting: number;
|
|
30
|
+
styles: {};
|
|
31
|
+
mountingDelay: number;
|
|
32
|
+
unmountingDelay: number;
|
|
33
|
+
};
|
|
34
|
+
constructor(properties: any);
|
|
35
|
+
}
|
|
36
|
+
export default Animated;
|
package/Animated.js
CHANGED
|
@@ -1,134 +1,135 @@
|
|
|
1
|
-
import ReactConstants from "./ReactConstants"; import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields"; import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers"; import './Animated.css'; import
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './ReactCreateElement.js';
|
|
4
|
-
import 'prop-types';
|
|
1
|
+
import ReactConstants from "./ReactConstants"; import {clientHeight as __clientHeight, clientWidth as __clientWidth, createAccessor as __createAccessor, data as __data, height as __height, left as __left, length as __length, pageX as __pageX, pageY as __pageY, props as __props, scrollLeft as __scrollLeft, scrollTop as __scrollTop, state as __state, style as __style, target as __target, top as __top, value as __value, width as __width} from "./CommonFields"; import {toConsumableArray as __toConsumableArray} from "./_virtual/_rollupPluginBabelHelpers"; import {extends as __extends} from "./_virtual/_rollupPluginBabelHelpers"; import {inherits as __inherits} from "./_virtual/_rollupPluginBabelHelpers"; import './Animated.css'; import React from 'react';
|
|
5
2
|
import { setOf, allPropsExcept, classNames, requestAnimationFrame, clearTimeout, setTimeout } from './Tools.js';
|
|
6
|
-
import { children, className, componentDidMount, props, componentWillUnmount, render, state, componentDidUpdate, setState
|
|
3
|
+
import { children, className, PureComponent, componentDidMount, props, componentWillUnmount, render, state, componentDidUpdate, setState } from './ReactConstants.js';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
const mounting = 'mounting', unmounting = 'unmounting', mounted = 'mounted', enabled = 'enabled', mountingDelay = 'mountingDelay', unmountingDelay = 'unmountingDelay', timeout = 'timeout', value = 'value', selfProps = setOf([
|
|
6
|
+
children,
|
|
7
|
+
className,
|
|
8
|
+
'styles',
|
|
9
|
+
mountingDelay,
|
|
10
|
+
unmountingDelay,
|
|
11
|
+
mounting,
|
|
12
|
+
unmounting,
|
|
13
|
+
value,
|
|
14
|
+
]);
|
|
15
|
+
const clearTimer = that => clearTimeout(that[timeout]);
|
|
16
|
+
const animatedState = (isEnabled, isMounting, isMounted, isUnMounting) => {
|
|
17
|
+
const r = {};
|
|
18
|
+
r[enabled] = isEnabled;
|
|
19
|
+
r[mounting] = isMounting;
|
|
20
|
+
r[mounted] = isMounted;
|
|
21
|
+
r[unmounting] = isUnMounting;
|
|
22
|
+
return r;
|
|
20
23
|
};
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
r[mounting] = isMounting;
|
|
25
|
-
r[mounted] = isMounted;
|
|
26
|
-
r[unmounting] = isUnMounting;
|
|
27
|
-
return r;
|
|
24
|
+
const doMounting = (that, duration) => {
|
|
25
|
+
setState(that, animatedState(true, true, false, false));
|
|
26
|
+
that[timeout] = setTimeout(setState, duration, that, animatedState(true, false, true, false));
|
|
28
27
|
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
const processMounting = (that, duration, mountingDelay) => {
|
|
29
|
+
const _state = state(that);
|
|
30
|
+
if (_state[mounting] || _state[mounted])
|
|
31
|
+
return;
|
|
32
|
+
clearTimer(that);
|
|
33
|
+
if (_state[unmounting])
|
|
34
|
+
return doMounting(that, duration);
|
|
35
|
+
if (mountingDelay) {
|
|
36
|
+
that[timeout] = setTimeout(() => {
|
|
37
|
+
if (state(that)[mounted])
|
|
38
|
+
return;
|
|
39
|
+
doMounting(that, duration);
|
|
40
|
+
}, mountingDelay);
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
doMounting(that, duration);
|
|
44
|
+
}
|
|
32
45
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
clearTimer(that);
|
|
37
|
-
if (_state[unmounting]) return doMounting(that, duration);
|
|
38
|
-
if (mountingDelay) {
|
|
39
|
-
that[timeout] = setTimeout(function () {
|
|
40
|
-
if (state(that)[mounted]) return;
|
|
41
|
-
doMounting(that, duration);
|
|
42
|
-
}, mountingDelay);
|
|
43
|
-
} else {
|
|
44
|
-
doMounting(that, duration);
|
|
45
|
-
}
|
|
46
|
+
const doUnmounting = (that, duration) => {
|
|
47
|
+
setState(that, animatedState(true, false, false, true));
|
|
48
|
+
that[timeout] = setTimeout(setState, duration, that, animatedState(false, false, false, false));
|
|
46
49
|
};
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
+
const processUnmounting = (that, duration, unmountingDelay) => {
|
|
51
|
+
const _state = state(that);
|
|
52
|
+
if (_state[unmounting])
|
|
53
|
+
return;
|
|
54
|
+
clearTimer(that);
|
|
55
|
+
if (_state[mounting])
|
|
56
|
+
return doUnmounting(that, duration);
|
|
57
|
+
if (unmountingDelay) {
|
|
58
|
+
that[timeout] = setTimeout(() => {
|
|
59
|
+
if (props(that)[value])
|
|
60
|
+
return;
|
|
61
|
+
doUnmounting(that, duration);
|
|
62
|
+
}, unmountingDelay);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
doUnmounting(that, duration);
|
|
66
|
+
}
|
|
50
67
|
};
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
doUnmounting(that, duration);
|
|
60
|
-
}, unmountingDelay);
|
|
61
|
-
} else {
|
|
62
|
-
doUnmounting(that, duration);
|
|
63
|
-
}
|
|
64
|
-
};
|
|
65
|
-
var Animated = function (_PureComponent) {
|
|
66
|
-
_inherits(Animated, _PureComponent);
|
|
67
|
-
var _super = _createSuper(Animated);
|
|
68
|
-
function Animated(properties) {
|
|
69
|
-
var _this;
|
|
70
|
-
_classCallCheck(this, Animated);
|
|
71
|
-
_this = _super.call(this, properties);
|
|
72
|
-
var that = _assertThisInitialized(_this);
|
|
73
|
-
that.state = animatedState(!!properties[value]);
|
|
74
|
-
that[ReactConstants[0]] = function () {
|
|
75
|
-
var _props = props(that);
|
|
76
|
-
if (!!_props[value]) processMounting(that, _props[mounting], _props[mountingDelay]);
|
|
77
|
-
};
|
|
78
|
-
that[ReactConstants[1]] = function () {
|
|
79
|
-
clearTimer(that);
|
|
80
|
-
};
|
|
81
|
-
that[ReactConstants[3]] = function () {
|
|
82
|
-
var _state = state(that);
|
|
83
|
-
if (!_state[enabled]) return null;
|
|
84
|
-
var _props = props(that),
|
|
85
|
-
styles = _props.styles,
|
|
86
|
-
isMounting = _state[mounting],
|
|
87
|
-
isUnMounting = _state[unmounting],
|
|
88
|
-
isMounted = _state[mounted];
|
|
89
|
-
var childStyles = styles["default"];
|
|
90
|
-
if (isMounting) childStyles = styles[mounting];else if (isUnMounting) childStyles = styles[unmounting];else if (isMounted) childStyles = styles[mounted] || styles[mounting];
|
|
91
|
-
var otherProps = allPropsExcept(_props, selfProps);
|
|
92
|
-
return React.Children.map(_props[ReactConstants[4]], function (child) {
|
|
93
|
-
var _objectSpread2$1;
|
|
94
|
-
return child && React.cloneElement(child, _objectSpread2((_objectSpread2$1 = {}, _defineProperty(_objectSpread2$1, className, classNames(props(child)[ReactConstants[5]], _props[ReactConstants[5]], isMounting && mounting, isMounted && mounted, isUnMounting && unmounting)), _defineProperty(_objectSpread2$1, "style", _objectSpread2(_objectSpread2({}, __style(props(child))), childStyles)), _objectSpread2$1), otherProps));
|
|
95
|
-
});
|
|
96
|
-
};
|
|
97
|
-
that[ReactConstants[2]] = function () {
|
|
98
|
-
var p = props;
|
|
99
|
-
var t = that;
|
|
100
|
-
var _props = p(t) || props(that),
|
|
101
|
-
_state = state(that),
|
|
102
|
-
v = _props[value],
|
|
103
|
-
mountingDuration = _props[mounting],
|
|
104
|
-
unmountingDuration = _props[unmounting],
|
|
105
|
-
isMounting = _state[mounting],
|
|
106
|
-
isUnMounting = _state[unmounting],
|
|
107
|
-
isMounted = _state[mounted],
|
|
108
|
-
isEnabled = _state[enabled];
|
|
109
|
-
if (isUnMounting && v) return processMounting(that, mountingDuration, _props[mountingDelay]);
|
|
110
|
-
if (isMounting && !v) return processUnmounting(that, unmountingDuration, _props[unmountingDelay]);
|
|
111
|
-
var toggled = isEnabled && !v || !isEnabled && !!v;
|
|
112
|
-
if (toggled) {
|
|
113
|
-
if (!!v) {
|
|
114
|
-
setState(that, animatedState(true));
|
|
115
|
-
} else processUnmounting(that, unmountingDuration, _props[unmountingDelay]);
|
|
116
|
-
} else {
|
|
117
|
-
if (isEnabled && !isMounting && !isMounted && !isUnMounting) {
|
|
118
|
-
requestAnimationFrame(function () {
|
|
119
|
-
return requestAnimationFrame(function () {
|
|
120
|
-
return processMounting(that, mountingDuration, _props[mountingDelay]);
|
|
121
|
-
});
|
|
122
|
-
});
|
|
123
|
-
}
|
|
124
|
-
}
|
|
68
|
+
class Animated extends PureComponent {
|
|
69
|
+
static defaultProps = {
|
|
70
|
+
[ReactConstants[5]]: 'animated',
|
|
71
|
+
[mounting]: 250,
|
|
72
|
+
[unmounting]: 250,
|
|
73
|
+
styles: {},
|
|
74
|
+
[mountingDelay]: 0,
|
|
75
|
+
[unmountingDelay]: 0,
|
|
125
76
|
};
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
77
|
+
constructor(properties) {
|
|
78
|
+
super(properties);
|
|
79
|
+
const that = this;
|
|
80
|
+
that.state = animatedState(!!properties[value]);
|
|
81
|
+
that[ReactConstants[0]] = () => {
|
|
82
|
+
const _props = props(that);
|
|
83
|
+
if (!!_props[value])
|
|
84
|
+
processMounting(that, _props[mounting], _props[mountingDelay]);
|
|
85
|
+
};
|
|
86
|
+
that[ReactConstants[1]] = () => {
|
|
87
|
+
clearTimer(that);
|
|
88
|
+
};
|
|
89
|
+
that[ReactConstants[3]] = () => {
|
|
90
|
+
const _state = state(that);
|
|
91
|
+
if (!_state[enabled])
|
|
92
|
+
return null;
|
|
93
|
+
const _props = props(that), { styles } = _props, { [mounting]: isMounting, [unmounting]: isUnMounting, [mounted]: isMounted, } = _state;
|
|
94
|
+
let childStyles = styles.default;
|
|
95
|
+
if (isMounting)
|
|
96
|
+
childStyles = styles[mounting];
|
|
97
|
+
else if (isUnMounting)
|
|
98
|
+
childStyles = styles[unmounting];
|
|
99
|
+
else if (isMounted)
|
|
100
|
+
childStyles = styles[mounted] || styles[mounting];
|
|
101
|
+
const otherProps = allPropsExcept(_props, selfProps);
|
|
102
|
+
return React.Children.map(_props[ReactConstants[4]], child => child && React.cloneElement(child, {
|
|
103
|
+
[ReactConstants[5]]: classNames(props(child)[ReactConstants[5]], _props[ReactConstants[5]], isMounting && mounting, isMounted && mounted, isUnMounting && unmounting),
|
|
104
|
+
// @ts-ignore
|
|
105
|
+
style: { ...__style(props(child)), ...childStyles },
|
|
106
|
+
...otherProps,
|
|
107
|
+
}));
|
|
108
|
+
};
|
|
109
|
+
that[ReactConstants[2]] = () => {
|
|
110
|
+
const _props = props(that), _state = state(that), { [value]: v, [mounting]: mountingDuration, [unmounting]: unmountingDuration, } = _props, { [mounting]: isMounting, [unmounting]: isUnMounting, [mounted]: isMounted, [enabled]: isEnabled, } = _state;
|
|
111
|
+
if (isUnMounting && v)
|
|
112
|
+
return processMounting(that, mountingDuration, _props[mountingDelay]);
|
|
113
|
+
if (isMounting && !v)
|
|
114
|
+
return processUnmounting(that, unmountingDuration, _props[unmountingDelay]);
|
|
115
|
+
let toggled = (isEnabled && !v) || (!isEnabled && !!v);
|
|
116
|
+
if (toggled) {
|
|
117
|
+
if (!!v) {
|
|
118
|
+
// just set enable to true and wait until react will mount children
|
|
119
|
+
setState(that, animatedState(true));
|
|
120
|
+
}
|
|
121
|
+
else
|
|
122
|
+
processUnmounting(that, unmountingDuration, _props[unmountingDelay]);
|
|
123
|
+
}
|
|
124
|
+
else {
|
|
125
|
+
if (isEnabled && !isMounting && !isMounted && !isUnMounting) {
|
|
126
|
+
// react requires a delay to mount children, one requestAnimationFrame is not enough
|
|
127
|
+
requestAnimationFrame(() => requestAnimationFrame(() => processMounting(that, mountingDuration, _props[mountingDelay])));
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
}
|
|
132
133
|
|
|
133
|
-
export { Animated
|
|
134
|
+
export { Animated as default };
|
|
134
135
|
//# sourceMappingURL=Animated.js.map
|
package/Animated.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Animated.js","sources":["./src/Animated.js"],"sourcesContent":["import React from 'react';\nimport ReactCreateElement from './ReactCreateElement';\nimport PropTypes from 'prop-types';\nimport './Animated.css'\nimport {allPropsExcept, classNames, setOf, setTimeout, requestAnimationFrame, clearTimeout} from \"./Tools\";\nimport {props, state, setState, componentWillUnmount, componentDidMount, render, componentDidUpdate, className, children, PureComponent} from \"./ReactConstants\";\n\nlet mounting = 'mounting',\n unmounting = 'unmounting',\n mounted = 'mounted',\n enabled = 'enabled',\n mountingDelay = 'mountingDelay',\n unmountingDelay = 'unmountingDelay',\n timeout = 'timeout',\n value = 'value'\n;\n\nconst selfProps = setOf([\n children,\n className,\n 'styles',\n mountingDelay,\n unmountingDelay,\n mounting,\n unmounting,\n value,\n]);\n\nconst clearTimer = that => clearTimeout(that[timeout]);\n\nconst animatedState = (isEnabled, isMounting, isMounted, isUnMounting) => {\n const r = {};\n r[enabled] = isEnabled;\n r[mounting] = isMounting;\n r[mounted] = isMounted;\n r[unmounting] = isUnMounting;\n return r;\n};\n\nconst doMounting = (that, duration) => {\n setState(that, animatedState(true, true, false, false));\n\n that[timeout] = setTimeout(setState, duration, that, animatedState(true, false, true, false))\n};\n\nconst processMounting = (that, duration, mountingDelay) => {\n const _state = state(that);\n if (_state[mounting] || _state[mounted]) return;\n clearTimer(that);\n\n if (_state[unmounting])\n return doMounting(that, duration);\n\n if (mountingDelay) {\n that[timeout] = setTimeout(() => {\n if (state(that)[mounted]) return;\n doMounting(that, duration)\n }, mountingDelay);\n } else {\n doMounting(that, duration);\n }\n};\n\nconst doUnmounting = (that, duration) => {\n setState(that, animatedState(true, false, false, true));\n that[timeout] = setTimeout(setState, duration, that, animatedState(false, false, false, false));\n};\n\nconst processUnmounting = (that, duration, unmountingDelay) => {\n const _state = state(that);\n if (_state[unmounting]) return;\n clearTimer(that);\n\n if (_state[mounting])\n return doUnmounting(that, duration);\n\n if (unmountingDelay) {\n that[timeout] = setTimeout(() => {\n if (props(that)[value]) return;\n doUnmounting(that, duration);\n }, unmountingDelay);\n } else {\n doUnmounting(that, duration);\n }\n};\n\nclass Animated extends PureComponent {\n\n constructor(properties) {\n super(properties);\n const that = this;\n that.state = animatedState(!!properties[value]);\n\n that[componentDidMount] = () => {\n const _props = props(that);\n if (!!_props[value])\n processMounting(that, _props[mounting], _props[mountingDelay])\n };\n\n that[componentWillUnmount] = () => {\n clearTimer(that)\n };\n\n that[render] = () => {\n const _state = state(that);\n if (!_state[enabled]) return null;\n\n const _props = props(that),\n {styles} = _props,\n {\n [mounting]: isMounting,\n [unmounting]: isUnMounting,\n [mounted]: isMounted,\n } = _state;\n\n let childStyles = styles.default;\n if (isMounting)\n childStyles = styles[mounting];\n else if (isUnMounting)\n childStyles = styles[unmounting];\n else if (isMounted)\n childStyles = styles[mounted] || styles[mounting];\n\n const otherProps = allPropsExcept(_props, selfProps);\n return React.Children.map(_props[children], child =>\n child && React.cloneElement(child, {\n [className]: classNames(\n props(child)[className],\n _props[className],\n isMounting && mounting,\n isMounted && mounted,\n isUnMounting && unmounting\n ),\n style: {...props(child).style, ...childStyles},\n ...otherProps,\n }));\n };\n\n that[componentDidUpdate] = () => {\n const p = props;\n const t = that;\n const _props = p(t)||props(that),\n _state = state(that),\n {\n [value]: v,\n [mounting]: mountingDuration,\n [unmounting]: unmountingDuration,\n } = _props,\n {\n [mounting]: isMounting,\n [unmounting]: isUnMounting,\n [mounted]: isMounted,\n [enabled]: isEnabled,\n } = _state;\n\n if (isUnMounting && v)\n return processMounting(that, mountingDuration, _props[mountingDelay]);\n if (isMounting && !v)\n return processUnmounting(that, unmountingDuration, _props[unmountingDelay]);\n\n let toggled = (isEnabled && !v) || (!isEnabled && !!v);\n if (toggled) {\n if (!!v) {\n // just set enable to true and wait until react will mount children\n setState(that, animatedState(true))\n } else\n processUnmounting(that, unmountingDuration, _props[unmountingDelay]);\n } else {\n if (isEnabled && !isMounting && !isMounted && !isUnMounting) {\n // react requires a delay to mount children, one requestAnimationFrame is not enough\n requestAnimationFrame(() => requestAnimationFrame(() => processMounting(that, mountingDuration, _props[mountingDelay])))\n }\n }\n }\n }\n}\n\nif (window.isNotProductionEnvironment) {\n Animated.propTypes = {\n [value]: PropTypes.bool,\n [className]: PropTypes.string,\n styles: PropTypes.shape({\n [mounting]: PropTypes.object,\n [mounted]: PropTypes.object,\n [unmounting]: PropTypes.object,\n }),\n [mountingDelay]: PropTypes.number,\n [unmountingDelay]: PropTypes.number,\n [mounting]: PropTypes.number,\n [unmounting]: PropTypes.number,\n };\n}\n\nAnimated.defaultProps = {\n [className]: 'animated',\n [mounting]: 250,\n [unmounting]: 250,\n styles: {},\n [mountingDelay]: 0,\n [unmountingDelay]: 0,\n};\n\n// forcing webpack to NOT inline constant fields\n// mounting = mounting || 1;\n// mounted = mounted || 1;\n// unmounting = unmounting || 1;\n// enabled = enabled || 1;\n// mountingDelay = mountingDelay || 1;\n// unmountingDelay = unmountingDelay || 1;\n// value = value || 1;\n// timeout = timeout || 1;\n\nexport default Animated"],"names":["mounting","unmounting","mounted","enabled","mountingDelay","unmountingDelay","timeout","value","selfProps","setOf","children","className","clearTimer","that","clearTimeout","animatedState","isEnabled","isMounting","isMounted","isUnMounting","r","doMounting","duration","setState","setTimeout","processMounting","_state","state","doUnmounting","processUnmounting","props","Animated","_PureComponent","_inherits","_super","_createSuper","properties","_this","_classCallCheck","call","_assertThisInitialized","componentDidMount","_props","componentWillUnmount","render","styles","childStyles","otherProps","allPropsExcept","React","Children","map","child","_objectSpread2","cloneElement","_objectSpread","_defineProperty","classNames","style","componentDidUpdate","p","t","v","mountingDuration","unmountingDuration","toggled","requestAnimationFrame","_createClass","PureComponent","defaultProps","_Animated$defaultProp"],"mappings":";;;;;;;;AAOA,IAAIA,QAAQ,GAAG,UAAU;AACrBC,EAAAA,UAAU,GAAG,YAAY;AACzBC,EAAAA,OAAO,GAAG,SAAS;AACnBC,EAAAA,OAAO,GAAG,SAAS;AACnBC,EAAAA,aAAa,GAAG,eAAe;AAC/BC,EAAAA,eAAe,GAAG,iBAAiB;AACnCC,EAAAA,OAAO,GAAG,SAAS;AACnBC,EAAAA,KAAK,GAAG,OAAO,CAAA;AAGnB,IAAMC,SAAS,GAAGC,KAAK,CAAC,CACpBC,QAAQ,EACRC,SAAS,EACT,QAAQ,EACRP,aAAa,EACbC,eAAe,EACfL,QAAQ,EACRC,UAAU,EACVM,KAAK,CACR,CAAC,CAAA;AAEF,IAAMK,UAAU,GAAG,SAAbA,UAAUA,CAAGC,IAAI,EAAA;AAAA,EAAA,OAAIC,YAAY,CAACD,IAAI,CAACP,OAAO,CAAC,CAAC,CAAA;AAAA,CAAA,CAAA;AAEtD,IAAMS,aAAa,GAAG,SAAhBA,aAAaA,CAAIC,SAAS,EAAEC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,MAAM,eAAe,CAAC,IAAI,EAAE,gBAAgB,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAA;AAC3H,iBAAA;AACJ,aAAA;AACL,SAAC,CAAA;KACJ;;;;;"}
|
package/AutocompleteSelect.js
CHANGED
|
@@ -287,6 +287,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
287
287
|
className = _this$props4[ReactConstants[5]],
|
|
288
288
|
scrollToValue = _this$props4.scrollToValue,
|
|
289
289
|
scroll = _this$props4.scroll,
|
|
290
|
+
disabled = _this$props4.disabled,
|
|
290
291
|
required = _this$props4.required,
|
|
291
292
|
allowCustom = _this$props4.allowCustom,
|
|
292
293
|
inlineSelected = _this$props4.inlineSelected,
|
|
@@ -316,23 +317,27 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
316
317
|
var selectedIds = Object.values(selected);
|
|
317
318
|
var hasSelected = __length(selectedIds) !== 0;
|
|
318
319
|
var setActive = function setActive(e) {
|
|
319
|
-
|
|
320
|
-
_this3.setState({
|
|
321
|
-
isActive: true
|
|
322
|
-
}, function () {
|
|
323
|
-
scrollToValue && __length(selectedIds) > 0 && data.includes(selectedIds[0]) && _this3.list.selected(selectedIds[0]);
|
|
324
|
-
});
|
|
325
|
-
};
|
|
326
|
-
var toggle = function toggle(e) {
|
|
327
|
-
if (!__state(_this3).isActive) {
|
|
328
|
-
setActive(e);
|
|
329
|
-
} else {
|
|
320
|
+
if (!disabled) {
|
|
330
321
|
stopPropagation(e);
|
|
331
322
|
_this3.setState({
|
|
332
|
-
isActive:
|
|
323
|
+
isActive: true
|
|
324
|
+
}, function () {
|
|
325
|
+
scrollToValue && __length(selectedIds) > 0 && data.includes(selectedIds[0]) && _this3.list.selected(selectedIds[0]);
|
|
333
326
|
});
|
|
334
327
|
}
|
|
335
328
|
};
|
|
329
|
+
var toggle = function toggle(e) {
|
|
330
|
+
if (!disabled) {
|
|
331
|
+
if (!__state(_this3).isActive) {
|
|
332
|
+
setActive(e);
|
|
333
|
+
} else {
|
|
334
|
+
stopPropagation(e);
|
|
335
|
+
_this3.setState({
|
|
336
|
+
isActive: false
|
|
337
|
+
});
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
};
|
|
336
341
|
var isInline = mode === MODE_INLINE || mode === MODE_INLINE_MULTIPLE || mode === MODE_MULTIPLE_MINI_INLINE;
|
|
337
342
|
var filterValueTrimmed = filterValue.trim();
|
|
338
343
|
var dataFiltered = allowCustom && !scrollToValue ? [filterValueTrimmed].concat(_toConsumableArray(data.filter(function (suggestion) {
|
|
@@ -361,7 +366,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
361
366
|
filteredList = listPortal ? ReactDOM.createPortal(filteredList, listPortal) : filteredList;
|
|
362
367
|
return ReactCreateElement("div", {
|
|
363
368
|
id: id,
|
|
364
|
-
[ReactConstants[5]]: classNames('AutocompleteSelect', mode, isMultipleSelect(mode) && 'multi', className, withFilter ? 'withFilter' : 'withoutFilter', isActive && 'active', errored && 'errored', inlineSelected && 'inlineSelected', hasSelected && 'hasSelected'),
|
|
369
|
+
[ReactConstants[5]]: classNames('AutocompleteSelect', mode, isMultipleSelect(mode) && 'multi', className, withFilter ? 'withFilter' : 'withoutFilter', isActive && 'active', errored && 'errored', inlineSelected && 'inlineSelected', hasSelected && 'hasSelected', disabled && 'disabled'),
|
|
365
370
|
ref: ref('el', this)
|
|
366
371
|
}, label && ReactCreateElement("label", {
|
|
367
372
|
[ReactConstants[5]]: classNames("label", (hasSelected || filterValue) && 'active', hasSelected && 'hasSelected'),
|
|
@@ -374,7 +379,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
374
379
|
}, label, required && ' *', withArrow && ReactCreateElement("span", {
|
|
375
380
|
[ReactConstants[5]]: "arrow"
|
|
376
381
|
})), (!isActive || mode === MODE_MULTIPLE || mode === MODE_INLINE_MULTIPLE || mode === MODE_MULTIPLE_MINI_INLINE || mode === MODE_MULTIPLE_AUTO || !withFilter) && !inlineSelected && hasSelected && ReactCreateElement("div", {
|
|
377
|
-
[ReactConstants[5]]: classNames('selected', !label && 'nolabel', (mode === MODE_MULTIPLE_MINI || mode === MODE_MINI || mode === MODE_MULTIPLE_MINI_INLINE) && 'clickable', selectedMode),
|
|
382
|
+
[ReactConstants[5]]: classNames('selected', !label && 'nolabel', disabled && 'disabled', (mode === MODE_MULTIPLE_MINI || mode === MODE_MINI || mode === MODE_MULTIPLE_MINI_INLINE) && 'clickable', selectedMode),
|
|
378
383
|
[ReactConstants[6]]: toggle
|
|
379
384
|
}, selectedMode === 'full' && selectedIds.map(function (id) {
|
|
380
385
|
return ReactCreateElement("div", {
|
|
@@ -387,8 +392,10 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
387
392
|
})), ReactCreateElement("div", {
|
|
388
393
|
[ReactConstants[5]]: "button remove",
|
|
389
394
|
[ReactConstants[6]]: function onClick(e) {
|
|
390
|
-
|
|
391
|
-
|
|
395
|
+
if (!disabled) {
|
|
396
|
+
stopPropagation(e);
|
|
397
|
+
_this3.remove(id);
|
|
398
|
+
}
|
|
392
399
|
}
|
|
393
400
|
}, removeIcon));
|
|
394
401
|
}), selectedMode === 'inline' && selectedIds.map(function (id) {
|
|
@@ -403,6 +410,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
403
410
|
[ReactConstants[5]]: "arrow"
|
|
404
411
|
}), withReset && ReactCreateElement(Button, {
|
|
405
412
|
[ReactConstants[5]]: "reset",
|
|
413
|
+
disabled: disabled,
|
|
406
414
|
raised: false,
|
|
407
415
|
[ReactConstants[6]]: this.clean
|
|
408
416
|
}, removeIcon)), inlineSelected && hasSelected && ReactCreateElement(React.Fragment, null, selectedMode === 'full' && selectedIds.map(function (id) {
|
|
@@ -416,8 +424,10 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
416
424
|
})), ReactCreateElement("div", {
|
|
417
425
|
[ReactConstants[5]]: "button remove",
|
|
418
426
|
[ReactConstants[6]]: function onClick(e) {
|
|
419
|
-
|
|
420
|
-
|
|
427
|
+
if (!disabled) {
|
|
428
|
+
stopPropagation(e);
|
|
429
|
+
_this3.remove(id);
|
|
430
|
+
}
|
|
421
431
|
}
|
|
422
432
|
}, removeIcon));
|
|
423
433
|
}), selectedMode === 'inline' && selectedIds.map(function (id) {
|
|
@@ -438,6 +448,7 @@ var AutocompleteSelect = function (_PureComponent) {
|
|
|
438
448
|
focused: isActive,
|
|
439
449
|
value: filterValue,
|
|
440
450
|
label: inputLabel,
|
|
451
|
+
disabled: disabled,
|
|
441
452
|
[ReactConstants[7]]: this[ReactConstants[7]],
|
|
442
453
|
onFocus: function onFocus(e) {
|
|
443
454
|
return _this3.setState({
|
|
@@ -486,6 +497,7 @@ AutocompleteSelect.defaultProps = {
|
|
|
486
497
|
selectCustomOnClickOutside: true,
|
|
487
498
|
withReset: false,
|
|
488
499
|
scrollToValue: false,
|
|
500
|
+
disabled: false,
|
|
489
501
|
mode: MODE_DEFAULT,
|
|
490
502
|
selectedMode: 'full',
|
|
491
503
|
listPortalPosition: 'left',
|