@enact/ui 4.6.1 → 4.7.0
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/AnnounceDecorator/Announce.js +27 -15
- package/AnnounceDecorator/AnnounceDecorator.d.ts +64 -0
- package/AnnounceDecorator/AnnounceDecorator.js +15 -6
- package/AnnounceDecorator/useAnnounce.js +1 -2
- package/BodyText/BodyText.d.ts +66 -0
- package/BodyText/BodyText.js +14 -6
- package/Button/Button.d.ts +125 -0
- package/Button/Button.js +18 -10
- package/CHANGELOG.md +14 -0
- package/Cancelable/Cancelable.d.ts +64 -0
- package/Cancelable/Cancelable.js +17 -9
- package/Cancelable/tests/Cancelable-specs.js +3 -1
- package/Changeable/Changeable.d.ts +54 -0
- package/Changeable/Changeable.js +15 -9
- package/ComponentOverride/ComponentOverride.d.ts +52 -0
- package/ComponentOverride/ComponentOverride.js +18 -5
- package/FloatingLayer/FloatingLayer.js +14 -13
- package/FloatingLayer/FloatingLayerContainer.js +3 -1
- package/FloatingLayer/FloatingLayerDecorator.js +11 -6
- package/FloatingLayer/Scrim.js +4 -2
- package/FloatingLayer/index.d.ts +100 -0
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +3 -1
- package/FloatingLayer/useFloatingLayer.js +2 -2
- package/ForwardRef/ForwardRef.d.ts +22 -0
- package/ForwardRef/ForwardRef.js +13 -7
- package/GridListImageItem/GridListImageItem.d.ts +85 -0
- package/GridListImageItem/GridListImageItem.js +16 -7
- package/Group/Group.d.ts +107 -0
- package/Group/Group.js +17 -6
- package/Group/GroupItem.js +16 -10
- package/Heading/Heading.d.ts +89 -0
- package/Heading/Heading.js +22 -9
- package/Icon/Icon.d.ts +88 -0
- package/Icon/Icon.js +15 -6
- package/IconButton/IconButton.d.ts +115 -0
- package/IconButton/IconButton.js +26 -11
- package/Image/Image.d.ts +113 -0
- package/Image/Image.js +16 -6
- package/ImageItem/ImageItem.d.ts +83 -0
- package/ImageItem/ImageItem.js +12 -2
- package/ImageItem/tests/ImageItem-specs.js +3 -1
- package/Item/Item.d.ts +64 -0
- package/Item/Item.js +17 -7
- package/LabeledIcon/LabeledIcon.d.ts +130 -0
- package/LabeledIcon/LabeledIcon.js +16 -6
- package/Layout/Cell.js +30 -5
- package/Layout/Layout.d.ts +284 -0
- package/Layout/Layout.js +181 -36
- package/Layout/Layout.module.css +8 -0
- package/Layout/tests/Layout-specs.js +44 -3
- package/Marquee/MarqueeBase.js +3 -1
- package/Marquee/MarqueeController.js +54 -2
- package/Marquee/MarqueeDecorator.js +44 -4
- package/Marquee/index.d.ts +258 -0
- package/Marquee/tests/Marquee-specs.js +3 -1
- package/Measurable/Measurable.d.ts +26 -0
- package/Measurable/Measurable.js +16 -10
- package/Measurable/tests/Measurable-specs.js +8 -6
- package/Media/Media.d.ts +99 -0
- package/Media/Media.js +36 -27
- package/Placeholder/PlaceholderControllerDecorator.js +13 -10
- package/Placeholder/PlaceholderDecorator.js +11 -10
- package/Placeholder/index.d.ts +53 -0
- package/ProgressBar/ProgressBar.d.ts +92 -0
- package/ProgressBar/ProgressBar.js +14 -1
- package/README.md +1 -1
- package/RadioDecorator/RadioControllerDecorator.js +4 -2
- package/RadioDecorator/RadioDecorator.d.ts +35 -0
- package/RadioDecorator/RadioDecorator.js +17 -9
- package/Repeater/Repeater.d.ts +82 -0
- package/Repeater/Repeater.js +16 -10
- package/Repeater/tests/Repeater-specs.js +3 -1
- package/Resizable/Resizable.d.ts +31 -0
- package/Resizable/Resizable.js +16 -10
- package/Routable/Link.js +12 -10
- package/Routable/Routable.d.ts +148 -0
- package/Routable/Routable.js +17 -8
- package/Routable/Router.js +14 -12
- package/Routable/tests/Routable-specs.js +5 -3
- package/Scrollable/ScrollAnimator.js +3 -1
- package/Scrollable/ScrollThumb.js +10 -9
- package/Scrollable/Scrollable.d.ts +0 -0
- package/Scrollable/Scrollable.js +27 -3
- package/Scrollable/ScrollableNative.js +16 -2
- package/Scrollable/Scrollbar.js +4 -2
- package/Scroller/Scroller.d.ts +276 -0
- package/Scroller/Scroller.js +10 -1
- package/Scroller/ScrollerBasic.js +12 -11
- package/Scroller/UiScrollerBase.js +15 -14
- package/Skinnable/Skinnable.d.ts +94 -0
- package/Skinnable/Skinnable.js +20 -6
- package/Skinnable/tests/Skinnable-specs.js +3 -1
- package/Skinnable/tests/useSkins-specs.js +3 -1
- package/Skinnable/useSkins.js +1 -2
- package/Slider/Knob.js +8 -6
- package/Slider/PositionDecorator.js +4 -2
- package/Slider/Slider.d.ts +202 -0
- package/Slider/Slider.js +18 -9
- package/SlotItem/SlotItem.d.ts +118 -0
- package/SlotItem/SlotItem.js +20 -6
- package/Slottable/Slottable.d.ts +22 -0
- package/Slottable/Slottable.js +16 -8
- package/Slottable/useSlots.js +3 -1
- package/Spinner/Spinner.d.ts +95 -0
- package/Spinner/Spinner.js +24 -7
- package/ToggleIcon/ToggleIcon.d.ts +90 -0
- package/ToggleIcon/ToggleIcon.js +21 -7
- package/ToggleItem/ToggleItem.d.ts +132 -0
- package/ToggleItem/ToggleItem.js +17 -2
- package/ToggleItem/tests/ToggleItem-specs.js +3 -1
- package/Toggleable/Toggle.js +4 -2
- package/Toggleable/Toggleable.d.ts +103 -0
- package/Toggleable/Toggleable.js +13 -7
- package/Toggleable/useToggle.js +1 -2
- package/Touchable/ClickAllow.js +3 -1
- package/Touchable/Drag.js +6 -3
- package/Touchable/Flick.js +6 -2
- package/Touchable/Hold.js +6 -2
- package/Touchable/Pinch.js +6 -3
- package/Touchable/Touch.js +6 -4
- package/Touchable/Touchable.d.ts +217 -0
- package/Touchable/Touchable.js +10 -1
- package/Touchable/config.js +3 -1
- package/Touchable/tests/useTouch-specs.js +3 -1
- package/Touchable/useTouch.js +5 -4
- package/Transition/Transition.d.ts +194 -0
- package/Transition/Transition.js +22 -4
- package/Transition/tests/Transition-specs.js +5 -3
- package/ViewManager/Arranger.js +6 -1
- package/ViewManager/TransitionGroup.js +8 -5
- package/ViewManager/View.js +7 -4
- package/ViewManager/ViewManager.d.ts +191 -0
- package/ViewManager/ViewManager.js +29 -11
- package/ViewManager/tests/ViewManager-specs.js +47 -1
- package/VirtualList/UiVirtualListBase.js +9 -3
- package/VirtualList/VirtualList.d.ts +528 -0
- package/VirtualList/VirtualList.js +13 -1
- package/VirtualList/VirtualListBasic.js +9 -3
- package/VirtualList/tests/VirtualGridList-native-specs.js +3 -1
- package/VirtualList/tests/VirtualGridList-specs.js +3 -1
- package/VirtualList/tests/VirtualList-native-specs.js +3 -1
- package/VirtualList/tests/VirtualList-specs.js +3 -1
- package/index.d.ts +0 -0
- package/internal/IdProvider/IdProvider.d.ts +0 -0
- package/internal/IdProvider/IdProvider.js +8 -7
- package/internal/IdProvider/Provider.js +3 -1
- package/internal/IdProvider/tests/IdProvider-specs.js +3 -1
- package/internal/IdProvider/tests/useId-specs.js +4 -3
- package/internal/IdProvider/useId.js +0 -1
- package/internal/Pure/Pure.d.ts +0 -0
- package/internal/Pure/Pure.js +15 -9
- package/internal/Pure/tests/Pure-specs.js +4 -2
- package/internal/localized-fonts/localized-fonts.d.ts +53 -0
- package/internal/localized-fonts/localized-fonts.js +2 -2
- package/internal/selection/selection.d.ts +0 -0
- package/internal/validators/validators.d.ts +0 -0
- package/package.json +2 -2
- package/resolution/ResolutionDecorator.js +40 -9
- package/resolution/index.d.ts +187 -0
- package/resolution/resolution.js +23 -7
- package/useControlledState/tests/useControlledState-specs.js +2 -2
- package/useControlledState/useControlledState.d.ts +0 -0
- package/useControlledState/useControlledState.js +2 -2
- package/useScroll/ScrollAnimator.js +3 -1
- package/useScroll/Scrollbar.js +6 -4
- package/useScroll/ScrollbarTrack.js +8 -6
- package/useScroll/useScroll.d.ts +0 -0
- package/useScroll/useScroll.js +80 -52
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
// Type definitions for ui/Slider
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ChangeableProps as ui_Changeable_ChangeableProps } from "@enact/ui/Changeable";
|
|
5
|
+
import { TouchableProps as ui_Touchable_TouchableProps } from "@enact/ui/Touchable";
|
|
6
|
+
|
|
7
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
8
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
9
|
+
|
|
10
|
+
export interface KnobProps {
|
|
11
|
+
/**
|
|
12
|
+
* The orientation of the slider, either `"horizontal"` or `"vertical"` .
|
|
13
|
+
*/
|
|
14
|
+
orientation?: string;
|
|
15
|
+
/**
|
|
16
|
+
* A number between 0 and 1 representing the proportion of the `value` in terms of `min`
|
|
17
|
+
and `max` props of the slider.
|
|
18
|
+
*/
|
|
19
|
+
proportion?: boolean;
|
|
20
|
+
/**
|
|
21
|
+
* Adds a tooltip to the knob using the provided component.
|
|
22
|
+
*
|
|
23
|
+
* The following props are forwarded to the tooltip:
|
|
24
|
+
* * `children` - The `value` prop from the slider
|
|
25
|
+
* * `orientation` - The value of the `orientation` prop from the slider
|
|
26
|
+
* * `proportion` - The value of the `proportion` prop from the knob
|
|
27
|
+
*
|
|
28
|
+
* This prop accepts either a Component (e.g. `MyTooltip` } which will be instantiated with
|
|
29
|
+
the above props or a component instance (e.g. `<MyTooltip customProp="value" />` ) which
|
|
30
|
+
will have its props merged with the above props.
|
|
31
|
+
*/
|
|
32
|
+
tooltipComponent?: Function | JSX.Element;
|
|
33
|
+
/**
|
|
34
|
+
* The value of the slider.
|
|
35
|
+
*/
|
|
36
|
+
value?: number;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* An unstyled, knob component to be used with a `Slider` .
|
|
40
|
+
*/
|
|
41
|
+
|
|
42
|
+
export class Knob extends React.Component<
|
|
43
|
+
Merge<React.HTMLProps<HTMLElement>, KnobProps>
|
|
44
|
+
> {}
|
|
45
|
+
|
|
46
|
+
export interface SliderBaseProps {
|
|
47
|
+
/**
|
|
48
|
+
* The component used to render the progress bar within the slider.
|
|
49
|
+
*
|
|
50
|
+
* The provided component will receive the following props from `Slider`
|
|
51
|
+
* * backgroundProgress - The value of `backgroundProgress`
|
|
52
|
+
* * orientation - The value of `orientation`
|
|
53
|
+
* * progress - The `value` as a proportion between `min` and `max`
|
|
54
|
+
* * progressAnchor - The value of `progressAnchor`
|
|
55
|
+
*
|
|
56
|
+
* This prop accepts either a Component (e.g. `MyProgress` } which will be instantiated with
|
|
57
|
+
the above props or a component instance (e.g. `<MyProgress customProp="value" />` ) which
|
|
58
|
+
will have its props merged with the above props.
|
|
59
|
+
*/
|
|
60
|
+
progressBarComponent: React.ComponentType | JSX.Element;
|
|
61
|
+
/**
|
|
62
|
+
* Background progress, as a proportion between `0` and `1` .
|
|
63
|
+
*/
|
|
64
|
+
backgroundProgress?: number;
|
|
65
|
+
/**
|
|
66
|
+
* Called with a reference to the root component.
|
|
67
|
+
*
|
|
68
|
+
* When using , the `ref` prop is forwarded to this component
|
|
69
|
+
as `componentRef` .
|
|
70
|
+
*/
|
|
71
|
+
componentRef?: object | Function;
|
|
72
|
+
/**
|
|
73
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
74
|
+
corresponding internal elements and states of this component.
|
|
75
|
+
*
|
|
76
|
+
* The following classes are supported:
|
|
77
|
+
* * `slider` - The root component class
|
|
78
|
+
* * `knob` - The knob node
|
|
79
|
+
* * `horizontal` - Applied when `orientation` prop is `"horizontal"``
|
|
80
|
+
* * `pressed` - Applied when `pressed` prop is `true`
|
|
81
|
+
* * `noFill` - Applied when `noFill` prop is `true`
|
|
82
|
+
* * `vertical` - Applied when `orientation` prop is `"vertical"`
|
|
83
|
+
*/
|
|
84
|
+
css?: object;
|
|
85
|
+
/**
|
|
86
|
+
* Disables component and does not generate events.
|
|
87
|
+
*/
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Defines a custom knob component for the slider.
|
|
91
|
+
*
|
|
92
|
+
* By default, Slider will use its own implementation, .
|
|
93
|
+
*
|
|
94
|
+
* The following props are forwarded to the knob:
|
|
95
|
+
* * `className` - A `knob` class applied by the slider
|
|
96
|
+
* * `disabled` - The value of `disabled`
|
|
97
|
+
* * `orientation` - The value of `orientation`
|
|
98
|
+
* * `proportion` - The `value` as a proportion between `min` and `max`
|
|
99
|
+
* * `tooltipComponent` - The value of `tooltipComponent`
|
|
100
|
+
* * `value` - The value of `value`
|
|
101
|
+
*
|
|
102
|
+
* This prop accepts either a Component (e.g. `MyKnob` } which will be instantiated with
|
|
103
|
+
the above props or a component instance (e.g. `<MyKnob customProp="value" />` ) which
|
|
104
|
+
will have its props merged with the above props.
|
|
105
|
+
*/
|
|
106
|
+
knobComponent?: React.ComponentType | JSX.Element;
|
|
107
|
+
/**
|
|
108
|
+
* The maximum value of the slider.
|
|
109
|
+
*
|
|
110
|
+
* The range between `min` and `max` should be evenly divisible by
|
|
111
|
+
.
|
|
112
|
+
*/
|
|
113
|
+
max?: number;
|
|
114
|
+
/**
|
|
115
|
+
* The minimum value of the slider.
|
|
116
|
+
*
|
|
117
|
+
* The range between `min` and `max` should be evenly divisible by
|
|
118
|
+
.
|
|
119
|
+
*/
|
|
120
|
+
min?: number;
|
|
121
|
+
/**
|
|
122
|
+
* Applies the style where the slider bar does not display filled.
|
|
123
|
+
*/
|
|
124
|
+
noFill?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* The orientation of the slider.
|
|
127
|
+
*
|
|
128
|
+
* Allowed values include:
|
|
129
|
+
* * `'horizontal'` - A left and right orientation
|
|
130
|
+
* * `'vertical'` - An up and down orientation
|
|
131
|
+
*/
|
|
132
|
+
orientation?: string;
|
|
133
|
+
/**
|
|
134
|
+
* Applies a pressed visual effect.
|
|
135
|
+
*/
|
|
136
|
+
pressed?: boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Sets the point, as a proportion between 0 and 1, from which the slider is filled.
|
|
139
|
+
*
|
|
140
|
+
* Applies to both the slider's `value` and `backgroundProgress` . In both cases,
|
|
141
|
+
setting the value of `progressAnchor` will cause the slider to fill from that point
|
|
142
|
+
down, when `value` or `backgroundProgress` is proportionally less than the anchor, or up,
|
|
143
|
+
when `value` or `backgroundProgress` is proportionally greater than the anchor, rather
|
|
144
|
+
than always from the start of the slider.
|
|
145
|
+
*/
|
|
146
|
+
progressAnchor?: number;
|
|
147
|
+
/**
|
|
148
|
+
* The amount to increment or decrement the value.
|
|
149
|
+
*
|
|
150
|
+
* It must evenly divide into the range designated by `min` and `max` .
|
|
151
|
+
*/
|
|
152
|
+
step?: number;
|
|
153
|
+
/**
|
|
154
|
+
* Adds a tooltip to the slider using the provided component.
|
|
155
|
+
*
|
|
156
|
+
* The following props are forwarded to the tooltip:
|
|
157
|
+
* * `children` - The `value` prop from the slider
|
|
158
|
+
* * `orientation` - The value of the `orientation` prop from the slider
|
|
159
|
+
* * `proportion` - The `value` as a proportion between `min` and `max`
|
|
160
|
+
*
|
|
161
|
+
* This prop accepts either a Component (e.g. `MyTooltip` } which will be instantiated with
|
|
162
|
+
the above props or a component instance (e.g. `<MyTooltip customProp="value" />` ) which
|
|
163
|
+
will have its props merged with the above props.
|
|
164
|
+
*/
|
|
165
|
+
tooltipComponent?: React.ComponentType | JSX.Element;
|
|
166
|
+
/**
|
|
167
|
+
* The value of the slider.
|
|
168
|
+
*
|
|
169
|
+
* Defaults to the value of `min` .
|
|
170
|
+
*/
|
|
171
|
+
value?: number;
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* An unstyled, sliding range-selection component.
|
|
175
|
+
*/
|
|
176
|
+
|
|
177
|
+
export class SliderBase extends React.Component<
|
|
178
|
+
Merge<React.HTMLProps<HTMLElement>, SliderBaseProps>
|
|
179
|
+
> {}
|
|
180
|
+
|
|
181
|
+
export interface SliderDecoratorProps
|
|
182
|
+
extends Merge<ui_Changeable_ChangeableProps, ui_Touchable_TouchableProps> {}
|
|
183
|
+
export function SliderDecorator<P>(
|
|
184
|
+
Component: React.ComponentType<P> | string
|
|
185
|
+
): React.ComponentType<P & SliderDecoratorProps>;
|
|
186
|
+
|
|
187
|
+
export interface SliderProps
|
|
188
|
+
extends Omit<Merge<SliderBaseProps, SliderDecoratorProps>, "componentRef"> {
|
|
189
|
+
/**
|
|
190
|
+
* Called when the value is changed.
|
|
191
|
+
*/
|
|
192
|
+
onChange?: Function;
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* A minimally-styled slider component with touch and drag support.
|
|
196
|
+
*/
|
|
197
|
+
|
|
198
|
+
export class Slider extends React.Component<
|
|
199
|
+
Merge<React.HTMLProps<HTMLElement>, SliderProps>
|
|
200
|
+
> {}
|
|
201
|
+
|
|
202
|
+
export default Slider;
|
package/Slider/Slider.js
CHANGED
|
@@ -29,15 +29,24 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
29
29
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
30
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
31
31
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
32
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
34
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
35
|
+
* Unstyled slider components and behaviors to be customized by a theme or application.
|
|
36
|
+
*
|
|
37
|
+
* @module ui/Slider
|
|
38
|
+
* @exports Knob
|
|
39
|
+
* @exports Slider
|
|
40
|
+
* @exports SliderBase
|
|
41
|
+
* @exports SliderDecorator
|
|
42
|
+
*/ /**
|
|
43
|
+
* An unstyled, sliding range-selection component.
|
|
44
|
+
*
|
|
45
|
+
* @class SliderBase
|
|
46
|
+
* @memberof ui/Slider
|
|
47
|
+
* @ui
|
|
48
|
+
* @public
|
|
49
|
+
*/
|
|
41
50
|
var SliderBase = (0, _kind["default"])({
|
|
42
51
|
name: 'ui:Slider',
|
|
43
52
|
propTypes: /** @lends ui/Slider.SliderBase.prototype */{
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Type definitions for ui/SlotItem
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { SlottableProps as ui_Slottable_SlottableProps } from "@enact/ui/Slottable";
|
|
5
|
+
import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
|
|
6
|
+
|
|
7
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
8
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
9
|
+
|
|
10
|
+
export interface SlotItemBaseProps {
|
|
11
|
+
/**
|
|
12
|
+
* The type of component to use to render the item.
|
|
13
|
+
*
|
|
14
|
+
* This component will receive the `inline` prop and any additional unhandled props provided
|
|
15
|
+
to `SlotItem` . A derivative of is recommended.
|
|
16
|
+
*/
|
|
17
|
+
component: React.ComponentType;
|
|
18
|
+
/**
|
|
19
|
+
* Controls the visibility state of the slots.
|
|
20
|
+
*
|
|
21
|
+
* One, both, or neither slot can be shown. Choosing `'after'` will leave `slotBefore`
|
|
22
|
+
visible at all times; only `slotAfter` will have its visibility toggled. Valid values
|
|
23
|
+
are `'before'` , `'after'` and `'both'` . Omitting the property will result in
|
|
24
|
+
no-auto-hiding for either slot so they will both be present.
|
|
25
|
+
*
|
|
26
|
+
* In order for `autoHide` to have a visual affect, the `hidden` class must be tied to
|
|
27
|
+
another condition such as focus.
|
|
28
|
+
* ```
|
|
29
|
+
.slot.hidden:not(:focus) {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
```
|
|
33
|
+
*/
|
|
34
|
+
autoHide?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Called with a reference to the root component.
|
|
37
|
+
*
|
|
38
|
+
* When using , the `ref` prop is forwarded to this component
|
|
39
|
+
as `componentRef` .
|
|
40
|
+
*/
|
|
41
|
+
componentRef?: object | Function;
|
|
42
|
+
/**
|
|
43
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
44
|
+
corresponding internal elements and states of this component.
|
|
45
|
+
*
|
|
46
|
+
* The following classes are supported:
|
|
47
|
+
* * `slotItem` - The root class name
|
|
48
|
+
* * `slot` - Applied to both slots
|
|
49
|
+
* * `after` - Applied to the slot that falls after the content
|
|
50
|
+
* * `before` - Applied to the slot that falls before the content
|
|
51
|
+
* * `hidden` - Applied to a slot when that slot is supposed to be hidden, according to
|
|
52
|
+
`autoHide` prop
|
|
53
|
+
*/
|
|
54
|
+
css?: object;
|
|
55
|
+
/**
|
|
56
|
+
* Applies inline styling to the component.
|
|
57
|
+
*/
|
|
58
|
+
inline?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* The layout technique for `SlotItem` .
|
|
61
|
+
*
|
|
62
|
+
* `"flex"` is applied as a default and gives basic flex support to the wrapping elements.
|
|
63
|
+
This may be set to `null` to define your own layout method.
|
|
64
|
+
*/
|
|
65
|
+
layout?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Nodes to be inserted after `children` and hidden using `autoHide` .
|
|
68
|
+
*
|
|
69
|
+
* If nothing is specified, nothing, not even an empty container, is rendered in this place.
|
|
70
|
+
*/
|
|
71
|
+
slotAfter?: React.ReactNode;
|
|
72
|
+
/**
|
|
73
|
+
* Nodes to be inserted before `children` and hidden using `autoHide` .
|
|
74
|
+
*
|
|
75
|
+
* If nothing is specified, nothing, not even an empty container, is rendered in this place.
|
|
76
|
+
*/
|
|
77
|
+
slotBefore?: React.ReactNode;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* A ui-styled `SlotItem` without any behavior.
|
|
81
|
+
*/
|
|
82
|
+
|
|
83
|
+
export class SlotItemBase extends React.Component<
|
|
84
|
+
Merge<React.HTMLProps<HTMLElement>, SlotItemBaseProps>
|
|
85
|
+
> {}
|
|
86
|
+
|
|
87
|
+
export interface SlotItemDecoratorProps
|
|
88
|
+
extends Merge<ui_Slottable_SlottableProps, ui_ForwardRef_ForwardRefProps> {}
|
|
89
|
+
export function SlotItemDecorator<P>(
|
|
90
|
+
Component: React.ComponentType<P> | string
|
|
91
|
+
): React.ComponentType<P & SlotItemDecoratorProps>;
|
|
92
|
+
|
|
93
|
+
export interface SlotItemProps
|
|
94
|
+
extends Omit<
|
|
95
|
+
Merge<SlotItemBaseProps, SlotItemDecoratorProps>,
|
|
96
|
+
"componentRef"
|
|
97
|
+
> {}
|
|
98
|
+
/**
|
|
99
|
+
* A ui-styled item with built-in support for slots.
|
|
100
|
+
*
|
|
101
|
+
* Example:
|
|
102
|
+
* ```
|
|
103
|
+
<SlotItem component={Item} autoHide="both">
|
|
104
|
+
<slotBefore>
|
|
105
|
+
<Icon>flag</Icon>
|
|
106
|
+
<Icon>star</Icon>
|
|
107
|
+
</slotBefore>
|
|
108
|
+
An Item that will show some icons slotBefore and slotAfter this text when spotted
|
|
109
|
+
<Icon slot="slotAfter">trash</Icon>
|
|
110
|
+
</SlotItem>
|
|
111
|
+
```
|
|
112
|
+
*/
|
|
113
|
+
|
|
114
|
+
export class SlotItem extends React.Component<
|
|
115
|
+
Merge<React.HTMLProps<HTMLElement>, SlotItemProps>
|
|
116
|
+
> {}
|
|
117
|
+
|
|
118
|
+
export default SlotItem;
|
package/SlotItem/SlotItem.js
CHANGED
|
@@ -14,12 +14,18 @@ var _SlotItemModule = _interopRequireDefault(require("./SlotItem.module.css"));
|
|
|
14
14
|
var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
15
15
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
16
16
|
var _excluded = ["children", "component", "componentRef", "inline", "slotAfter", "slotBefore"];
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
/**
|
|
18
|
+
* An unstyled item component that accepts multiple positions of children.
|
|
19
|
+
*
|
|
20
|
+
* Using the usual `children` prop, as well as two additional props: `slotBefore`, and `slotAfter`.
|
|
21
|
+
* It is able to be customized by a theme or application.
|
|
22
|
+
*
|
|
23
|
+
* @module ui/SlotItem
|
|
24
|
+
* @exports SlotItem
|
|
25
|
+
* @exports SlotItemBase
|
|
26
|
+
* @exports SlotItemDecorator
|
|
27
|
+
* @deprecated Will be removed in 5.0.0.
|
|
28
|
+
*/
|
|
23
29
|
/**
|
|
24
30
|
* A ui-styled `SlotItem` without any behavior.
|
|
25
31
|
*
|
|
@@ -28,6 +34,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
28
34
|
* @ui
|
|
29
35
|
* @public
|
|
30
36
|
*/
|
|
37
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
40
|
+
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; }
|
|
41
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
42
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
43
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
44
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
31
45
|
var SlotItemBase = (0, _kind["default"])({
|
|
32
46
|
name: 'SlotItem',
|
|
33
47
|
propTypes: /** @lends ui/SlotItem.SlotItemBase.prototype */{
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// Type definitions for ui/Slottable
|
|
2
|
+
|
|
3
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
4
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
5
|
+
|
|
6
|
+
export interface SlottableConfig extends Object {
|
|
7
|
+
/**
|
|
8
|
+
* Array of slot names which will be extracted from `children` and distributed to props.
|
|
9
|
+
*/
|
|
10
|
+
slots?: string[];
|
|
11
|
+
}
|
|
12
|
+
export interface SlottableProps {}
|
|
13
|
+
export function Slottable<P>(
|
|
14
|
+
config: SlottableConfig,
|
|
15
|
+
Component: React.ComponentType<P> | string
|
|
16
|
+
): React.ComponentType<P & SlottableProps>;
|
|
17
|
+
|
|
18
|
+
export function Slottable<P>(
|
|
19
|
+
Component: React.ComponentType<P> | string
|
|
20
|
+
): React.ComponentType<P & SlottableProps>;
|
|
21
|
+
|
|
22
|
+
export default Slottable;
|
package/Slottable/Slottable.js
CHANGED
|
@@ -16,14 +16,22 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
17
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
18
18
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
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; }
|
|
20
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
21
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /**
|
|
22
|
+
* Provides a higher-order component that render child components into pre-designated slots.
|
|
23
|
+
*
|
|
24
|
+
* See {@link ui/SlotItem.SlotItemDecorator|SlotItem} for the use of `Slottable`.
|
|
25
|
+
*
|
|
26
|
+
* @module ui/Slottable
|
|
27
|
+
* @exports Slottable
|
|
28
|
+
*/ /**
|
|
29
|
+
* Default config for `Slottable`.
|
|
30
|
+
*
|
|
31
|
+
* @memberof ui/Slottable.Slottable
|
|
32
|
+
* @hocconfig
|
|
33
|
+
* @public
|
|
34
|
+
*/
|
|
27
35
|
var defaultConfig = {
|
|
28
36
|
/**
|
|
29
37
|
* Array of slot names which will be extracted from `children` and distributed to props.
|
package/Slottable/useSlots.js
CHANGED
|
@@ -11,7 +11,9 @@ var _excluded = ["children"];
|
|
|
11
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
12
12
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
13
13
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
14
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
14
|
+
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; }
|
|
15
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
16
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
15
17
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
16
18
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
17
19
|
// ** WARNING ** This is an intentional but likely dangerous hack necessary to clone a child while
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Type definitions for ui/Spinner
|
|
2
|
+
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ForwardRefProps as ui_ForwardRef_ForwardRefProps } from "@enact/ui/ForwardRef";
|
|
5
|
+
|
|
6
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
7
|
+
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
8
|
+
|
|
9
|
+
export interface SpinnerBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* A theme-supplied component that performs the animation.
|
|
12
|
+
*
|
|
13
|
+
* Theme authors can use the `css.running` class to attach the animation CSS.
|
|
14
|
+
This element should accept a `children` prop which takes the form of an optional message
|
|
15
|
+
for the user.
|
|
16
|
+
*
|
|
17
|
+
* Unlike most other components, this does _not_ represent the root rendered element, and
|
|
18
|
+
instead refers to the "spinner" part of this component. The presence of `blockClickOn`
|
|
19
|
+
changes the rendering tree and where this is used.
|
|
20
|
+
*/
|
|
21
|
+
component: string | React.ComponentType;
|
|
22
|
+
/**
|
|
23
|
+
* Determines how far the click-blocking should extend.
|
|
24
|
+
* * `null` does not block clicking
|
|
25
|
+
* * 'screen' blocks entire screen
|
|
26
|
+
* * 'container' blocks up to the nearest ancestor with absolute or relative positioning
|
|
27
|
+
*
|
|
28
|
+
* When `blockClickOn` is either `'screen'` or `'container'` , a translucent scrim can be added
|
|
29
|
+
by setting prop to `true` .
|
|
30
|
+
*/
|
|
31
|
+
blockClickOn?: string | any;
|
|
32
|
+
/**
|
|
33
|
+
* Centers the spinner horizontally and vertically relative to its containing component.
|
|
34
|
+
*/
|
|
35
|
+
centered?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* Called with a reference to the root component.
|
|
38
|
+
*
|
|
39
|
+
* When using , the `ref` prop is forwarded to this component
|
|
40
|
+
as `componentRef` .
|
|
41
|
+
*/
|
|
42
|
+
componentRef?: object | Function;
|
|
43
|
+
/**
|
|
44
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
45
|
+
corresponding internal elements and states of this component.
|
|
46
|
+
*
|
|
47
|
+
* The following classes are supported:
|
|
48
|
+
* * `spinner` - The root `component` class
|
|
49
|
+
* * `spinnerContainer` - Added as a parent in the case of `blockOnClick="container"
|
|
50
|
+
* * `blockClickOn` - Applied if interaction should be blocked
|
|
51
|
+
* * `centered` - Applied if the `centered` prop is present
|
|
52
|
+
* * `running` - Always applied to `component` . Attach animation name property to this class.
|
|
53
|
+
* * `scrim` - The blocking layer behind the Spinner
|
|
54
|
+
*/
|
|
55
|
+
css?: object;
|
|
56
|
+
/**
|
|
57
|
+
* Halts the animation of the spinner
|
|
58
|
+
*/
|
|
59
|
+
paused?: boolean;
|
|
60
|
+
/**
|
|
61
|
+
* Sets a scrim behind the spinner with the `css.scrim` class applied.
|
|
62
|
+
*
|
|
63
|
+
* Only has an effect when `blockClickOn` is `'screen'` or `'container'` and has no effect
|
|
64
|
+
by default or when blockClickOn is `null` .
|
|
65
|
+
*/
|
|
66
|
+
scrim?: boolean;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A minimally styled component that controls `Spinner` positioning and interaction states, without
|
|
70
|
+
applied.
|
|
71
|
+
*/
|
|
72
|
+
|
|
73
|
+
export class SpinnerBase extends React.Component<
|
|
74
|
+
Merge<React.HTMLProps<HTMLElement>, SpinnerBaseProps>
|
|
75
|
+
> {}
|
|
76
|
+
|
|
77
|
+
export interface SpinnerDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
78
|
+
export function SpinnerDecorator<P>(
|
|
79
|
+
Component: React.ComponentType<P> | string
|
|
80
|
+
): React.ComponentType<P & SpinnerDecoratorProps>;
|
|
81
|
+
|
|
82
|
+
export interface SpinnerProps
|
|
83
|
+
extends Omit<
|
|
84
|
+
Merge<SpinnerBaseProps, SpinnerDecoratorProps>,
|
|
85
|
+
"componentRef"
|
|
86
|
+
> {}
|
|
87
|
+
/**
|
|
88
|
+
* A minimally styled component that controls `Spinner` positioning and interaction states.
|
|
89
|
+
*/
|
|
90
|
+
|
|
91
|
+
export class Spinner extends React.Component<
|
|
92
|
+
Merge<React.HTMLProps<HTMLElement>, SpinnerProps>
|
|
93
|
+
> {}
|
|
94
|
+
|
|
95
|
+
export default Spinner;
|
package/Spinner/Spinner.js
CHANGED
|
@@ -12,12 +12,21 @@ var _ForwardRef = _interopRequireDefault(require("../ForwardRef"));
|
|
|
12
12
|
var _SpinnerModule = _interopRequireDefault(require("./Spinner.module.css"));
|
|
13
13
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
14
14
|
var _excluded = ["blockClickOn", "component", "componentRef", "scrimClassName", "scrimType", "spinnerContainerClassName"];
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
15
|
+
/**
|
|
16
|
+
* An unstyled indeterminate progress indicator (Spinner) component to be customized by a
|
|
17
|
+
* theme or application.
|
|
18
|
+
*
|
|
19
|
+
* Basically, this positions your `Spinner` component where you want it on the
|
|
20
|
+
* screen, and hooks into the interaction blocking code and scrim management.
|
|
21
|
+
*
|
|
22
|
+
* The theme using this component must supply a `component` element which follows the requirements
|
|
23
|
+
* listed by the {@link ui/Spinner.Spinner.component|component} prop documentation.
|
|
24
|
+
*
|
|
25
|
+
* @module ui/Spinner
|
|
26
|
+
* @exports Spinner
|
|
27
|
+
* @exports SpinnerBase
|
|
28
|
+
* @exports SpinnerDecorator
|
|
29
|
+
*/
|
|
21
30
|
/**
|
|
22
31
|
* A minimally styled component that controls `Spinner` positioning and interaction states, without
|
|
23
32
|
* [SpinnerDecorator](ui/Spinner.SpinnerDecorator) applied.
|
|
@@ -27,6 +36,14 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
27
36
|
* @ui
|
|
28
37
|
* @public
|
|
29
38
|
*/
|
|
39
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
40
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
41
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
42
|
+
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; }
|
|
43
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
44
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
45
|
+
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
46
|
+
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
30
47
|
var SpinnerBase = (0, _kind["default"])({
|
|
31
48
|
name: 'ui:Spinner',
|
|
32
49
|
propTypes: /** @lends ui/Spinner.SpinnerBase.prototype */{
|
|
@@ -54,7 +71,7 @@ var SpinnerBase = (0, _kind["default"])({
|
|
|
54
71
|
* * 'container' blocks up to the nearest ancestor with absolute or relative positioning
|
|
55
72
|
*
|
|
56
73
|
* When `blockClickOn` is either `'screen'` or `'container'`, a translucent scrim can be added
|
|
57
|
-
* by setting {@link ui/Spinner.
|
|
74
|
+
* by setting {@link ui/Spinner.SpinnerBase.scrim|scrim} prop to `true`.
|
|
58
75
|
*
|
|
59
76
|
* @type {String|null}
|
|
60
77
|
* @public
|