@enact/ui 4.5.2 → 4.6.1
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 +1 -40
- package/AnnounceDecorator/AnnounceDecorator.js +3 -21
- package/AnnounceDecorator/tests/Announce-specs.js +2 -7
- package/AnnounceDecorator/tests/AnnounceDecorator-specs.js +2 -6
- package/AnnounceDecorator/tests/useAnnounce-specs.js +8 -19
- package/AnnounceDecorator/useAnnounce.js +0 -6
- package/BodyText/BodyText.js +8 -28
- package/BodyText/tests/BodyText-specs.js +0 -19
- package/Button/Button.js +33 -63
- package/Button/tests/Button-specs.js +0 -26
- package/CHANGELOG.md +45 -0
- package/Cancelable/Cancelable.js +8 -47
- package/Cancelable/cancelHandler.js +5 -12
- package/Cancelable/modalHandler.js +3 -11
- package/Cancelable/tests/Cancelable-specs.js +3 -57
- package/Changeable/Changeable.js +2 -34
- package/Changeable/tests/Changeable-specs.js +20 -66
- package/ComponentOverride/ComponentOverride.js +1 -13
- package/FloatingLayer/FloatingLayer.js +17 -73
- package/FloatingLayer/FloatingLayerContainer.js +0 -15
- package/FloatingLayer/FloatingLayerDecorator.js +4 -17
- package/FloatingLayer/Scrim.js +9 -53
- package/FloatingLayer/index.js +0 -4
- package/FloatingLayer/package.json +3 -0
- package/FloatingLayer/tests/FloatingLayer-specs.js +8 -22
- package/FloatingLayer/tests/Scrim-specs.js +0 -9
- package/FloatingLayer/tests/useFloatingLayerDecorator-specs.js +0 -13
- package/FloatingLayer/useFloatingLayer.js +3 -14
- package/FloatingLayer/useFloatingLayerDecorator.js +3 -11
- package/ForwardRef/ForwardRef.js +1 -10
- package/GridListImageItem/GridListImageItem.js +18 -51
- package/Group/Group.js +5 -36
- package/Group/GroupItem.js +16 -33
- package/Group/tests/Group-specs.js +0 -32
- package/Heading/Heading.js +8 -36
- package/Heading/tests/Heading-specs.js +81 -14
- package/Icon/Icon.js +19 -53
- package/Icon/tests/Icon-specs.js +0 -22
- package/IconButton/IconButton.js +24 -57
- package/IconButton/tests/IconButton-specs.js +0 -7
- package/Image/Image.js +17 -46
- package/Image/tests/Image-specs.js +0 -14
- package/ImageItem/ImageItem.js +18 -47
- package/ImageItem/tests/ImageItem-specs.js +0 -25
- package/Item/Item.js +9 -33
- package/Item/tests/Item-specs.js +0 -24
- package/LabeledIcon/LabeledIcon.js +22 -53
- package/LabeledIcon/tests/LabeledIcon-specs.js +0 -14
- package/Layout/Cell.js +18 -44
- package/Layout/Layout.js +23 -46
- package/Layout/tests/Layout-specs.js +10 -39
- package/Marquee/MarqueeBase.js +29 -63
- package/Marquee/MarqueeController.js +11 -72
- package/Marquee/MarqueeDecorator.js +70 -196
- package/Marquee/index.js +1 -5
- package/Marquee/tests/Marquee-specs.js +295 -87
- package/Measurable/Measurable.js +12 -34
- package/Measurable/tests/Measurable-specs.js +115 -0
- package/Media/Media.js +15 -65
- package/Media/tests/Media-specs.js +168 -0
- package/Placeholder/PlaceholderControllerDecorator.js +7 -43
- package/Placeholder/PlaceholderDecorator.js +7 -38
- package/Placeholder/index.js +1 -5
- package/Placeholder/tests/PlaceholderControllerDecorator-specs.js +25 -0
- package/Placeholder/tests/PlaceholderDecorator-specs.js +28 -0
- package/ProgressBar/ProgressBar.js +14 -45
- package/ProgressBar/tests/ProgressBar-specs.js +0 -17
- package/RadioDecorator/RadioControllerDecorator.js +7 -29
- package/RadioDecorator/RadioDecorator.js +9 -42
- package/RadioDecorator/tests/RadioDecorator-specs.js +12 -49
- package/Repeater/Repeater.js +9 -33
- package/Repeater/tests/Repeater-specs.js +0 -38
- package/Resizable/Resizable.js +9 -37
- package/Resizable/tests/Resizable-specs.js +34 -0
- package/Routable/Link.js +11 -47
- package/Routable/Routable.js +12 -35
- package/Routable/Route.js +0 -6
- package/Routable/Router.js +15 -58
- package/Routable/tests/Routable-specs.js +7 -33
- package/Routable/tests/Router-specs.js +18 -44
- package/Routable/useLink.js +4 -8
- package/Routable/util.js +18 -24
- package/Scrollable/ScrollAnimator.js +49 -65
- package/Scrollable/ScrollThumb.js +2 -13
- package/Scrollable/Scrollable.js +180 -387
- package/Scrollable/ScrollableNative.js +189 -392
- package/Scrollable/Scrollbar.js +30 -102
- package/Scroller/Scroller.js +15 -39
- package/Scroller/ScrollerBasic.js +34 -89
- package/Scroller/UiScrollerBase.js +37 -84
- package/Scroller/tests/Scroller-specs.js +56 -0
- package/Skinnable/Skinnable.js +11 -38
- package/Skinnable/tests/Skinnable-specs.js +3 -74
- package/Skinnable/tests/useSkins-specs.js +1 -13
- package/Skinnable/tests/util-specs.js +0 -14
- package/Skinnable/useSkins.js +8 -15
- package/Skinnable/util.js +9 -20
- package/Slider/Knob.js +5 -24
- package/Slider/PositionDecorator.js +16 -54
- package/Slider/Slider.js +29 -67
- package/Slider/tests/Slider-specs.js +94 -7
- package/Slider/utils.js +0 -2
- package/SlotItem/SlotItem.js +23 -45
- package/SlotItem/tests/SlotItem-specs.js +0 -5
- package/Slottable/Slottable.js +4 -12
- package/Slottable/tests/Slottable-specs.js +19 -46
- package/Slottable/tests/useSlots-specs.js +27 -65
- package/Slottable/useSlots.js +8 -33
- package/Spinner/Spinner.js +16 -43
- package/Spinner/tests/Spinner-specs.js +0 -15
- package/ToggleIcon/ToggleIcon.js +10 -36
- package/ToggleIcon/tests/ToggleIcon-specs.js +0 -16
- package/ToggleItem/ToggleItem.js +24 -57
- package/ToggleItem/tests/ToggleItem-specs.js +0 -30
- package/Toggleable/Toggle.js +1 -15
- package/Toggleable/Toggleable.js +12 -45
- package/Toggleable/tests/Toggleable-specs.js +28 -96
- package/Toggleable/useToggle.js +3 -19
- package/Touchable/ClickAllow.js +5 -14
- package/Touchable/Drag.js +16 -54
- package/Touchable/Flick.js +11 -42
- package/Touchable/Hold.js +21 -68
- package/Touchable/Pinch.js +185 -0
- package/Touchable/Touch.js +71 -76
- package/Touchable/Touchable.js +95 -75
- package/Touchable/config.js +27 -24
- package/Touchable/tests/Touchable-specs.js +360 -119
- package/Touchable/tests/useTouch-specs.js +6 -80
- package/Touchable/useTouch.js +57 -65
- package/Transition/Transition.js +37 -118
- package/Transition/tests/Transition-specs.js +20 -60
- package/ViewManager/Arranger.js +10 -22
- package/ViewManager/TransitionGroup.js +32 -107
- package/ViewManager/View.js +35 -91
- package/ViewManager/ViewManager.js +20 -84
- package/ViewManager/tests/View-specs.js +0 -17
- package/ViewManager/tests/ViewManager-specs.js +236 -305
- package/ViewManager/tests/test-utils.js +0 -8
- package/VirtualList/UiVirtualListBase.js +265 -409
- package/VirtualList/VirtualList.js +29 -69
- package/VirtualList/VirtualListBase.js +0 -3
- package/VirtualList/VirtualListBasic.js +273 -431
- package/VirtualList/tests/VirtualGridList-native-specs.js +161 -0
- package/VirtualList/tests/VirtualGridList-specs.js +614 -0
- package/VirtualList/tests/VirtualList-native-specs.js +152 -0
- package/VirtualList/tests/VirtualList-specs.js +423 -95
- package/internal/IdProvider/IdProvider.js +7 -21
- package/internal/IdProvider/Provider.js +4 -17
- package/internal/IdProvider/tests/IdProvider-specs.js +44 -0
- package/internal/IdProvider/tests/useId-specs.js +6 -20
- package/internal/IdProvider/useId.js +0 -6
- package/internal/Pure/Pure.js +3 -30
- package/internal/Pure/tests/Pure-specs.js +88 -0
- package/internal/localized-fonts/localized-fonts.js +33 -62
- package/internal/localized-fonts/tests/localized-fonts-specs.js +33 -0
- package/internal/selection/selection.js +1 -6
- package/internal/selection/tests/selection-specs.js +6 -4
- package/internal/validators/tests/validators-specs.js +80 -0
- package/internal/validators/validators.js +14 -34
- package/package.json +9 -3
- package/resolution/ResolutionDecorator.js +4 -40
- package/resolution/index.js +0 -7
- package/resolution/resolution.js +42 -80
- package/resolution/tests/ResolutionDecorator-specs.js +4 -11
- package/resolution/tests/resolution-specs.js +2 -2
- package/useControlledState/tests/useControlledState-specs.js +15 -46
- package/useControlledState/useControlledState.js +11 -22
- package/useScroll/ScrollAnimator.js +49 -65
- package/useScroll/Scrollbar.js +22 -58
- package/useScroll/ScrollbarTrack.js +3 -19
- package/useScroll/useScroll.js +267 -454
- package/useScroll/utilDOM.js +8 -14
- package/useScroll/utilEvent.js +0 -4
- package/AnnounceDecorator/AnnounceDecorator.d.ts +0 -64
- package/BodyText/BodyText.d.ts +0 -66
- package/Button/Button.d.ts +0 -125
- package/Cancelable/Cancelable.d.ts +0 -64
- package/Changeable/Changeable.d.ts +0 -54
- package/ComponentOverride/ComponentOverride.d.ts +0 -52
- package/ForwardRef/ForwardRef.d.ts +0 -22
- package/GridListImageItem/GridListImageItem.d.ts +0 -85
- package/Group/Group.d.ts +0 -107
- package/Heading/Heading.d.ts +0 -90
- package/Icon/Icon.d.ts +0 -88
- package/IconButton/IconButton.d.ts +0 -115
- package/Image/Image.d.ts +0 -113
- package/ImageItem/ImageItem.d.ts +0 -83
- package/Item/Item.d.ts +0 -64
- package/LabeledIcon/LabeledIcon.d.ts +0 -130
- package/Layout/Layout.d.ts +0 -247
- package/Marquee/index.d.ts +0 -258
- package/Measurable/Measurable.d.ts +0 -26
- package/Media/Media.d.ts +0 -99
- package/Placeholder/index.d.ts +0 -53
- package/ProgressBar/ProgressBar.d.ts +0 -92
- package/RadioDecorator/RadioDecorator.d.ts +0 -35
- package/Repeater/Repeater.d.ts +0 -83
- package/Resizable/Resizable.d.ts +0 -31
- package/Routable/Routable.d.ts +0 -148
- package/Scrollable/Scrollable.d.ts +0 -0
- package/Scroller/Scroller.d.ts +0 -276
- package/Skinnable/Skinnable.d.ts +0 -94
- package/Slider/Slider.d.ts +0 -202
- package/SlotItem/SlotItem.d.ts +0 -118
- package/Slottable/Slottable.d.ts +0 -22
- package/Spinner/Spinner.d.ts +0 -95
- package/ToggleIcon/ToggleIcon.d.ts +0 -90
- package/ToggleItem/ToggleItem.d.ts +0 -134
- package/Toggleable/Toggleable.d.ts +0 -103
- package/Touchable/Touchable.d.ts +0 -175
- package/Transition/Transition.d.ts +0 -196
- package/ViewManager/ViewManager.d.ts +0 -191
- package/VirtualList/VirtualList.d.ts +0 -530
- package/index.d.ts +0 -0
- package/internal/IdProvider/IdProvider.d.ts +0 -0
- package/internal/Pure/Pure.d.ts +0 -0
- package/internal/localized-fonts/localized-fonts.d.ts +0 -53
- package/internal/selection/selection.d.ts +0 -0
- package/internal/validators/validators.d.ts +0 -0
- package/resolution/index.d.ts +0 -187
- package/useControlledState/useControlledState.d.ts +0 -0
- package/useScroll/useScroll.d.ts +0 -0
|
@@ -1,130 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/LabeledIcon
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { SlottableProps as ui_Slottable_SlottableProps } from "@enact/ui/Slottable";
|
|
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 LabeledIconBaseProps {
|
|
10
|
-
/**
|
|
11
|
-
* The label.
|
|
12
|
-
*
|
|
13
|
-
* This accepts strings, DOM, and Components, if you need more elaborate features. It may be
|
|
14
|
-
positioned using `labelPosition` .
|
|
15
|
-
*/
|
|
16
|
-
children?: React.ReactNode;
|
|
17
|
-
/**
|
|
18
|
-
* Called with a reference to the root component.
|
|
19
|
-
*
|
|
20
|
-
* When using , the `ref` prop is forwarded to this
|
|
21
|
-
component as `componentRef` .
|
|
22
|
-
*/
|
|
23
|
-
componentRef?: object | Function;
|
|
24
|
-
/**
|
|
25
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
26
|
-
corresponding internal elements and states of this component.
|
|
27
|
-
*
|
|
28
|
-
* The following classes are supported:
|
|
29
|
-
* * `labeledIcon` - The root component class
|
|
30
|
-
* * `icon` - The icon component class
|
|
31
|
-
* * `iconCell` - Applied to the `iconComponent` directly, like `.icon` . If `icon` in a
|
|
32
|
-
React component, this class is applied to the container of the icon,
|
|
33
|
-
rather than the icon itself.
|
|
34
|
-
* * `label` - The label component class
|
|
35
|
-
* * `inline` - Applied when the inline prop is set
|
|
36
|
-
* * `above` - Applied when the labelPosition prop is set to above
|
|
37
|
-
* * `after` - Applied when the labelPosition prop is set to after
|
|
38
|
-
* * `before` - Applied when the labelPosition prop is set to before
|
|
39
|
-
* * `below` - Applied when the labelPosition prop is set to below
|
|
40
|
-
* * `left` - Applied when the labelPosition prop is set to left
|
|
41
|
-
* * `right` - Applied when the labelPosition prop is set to right
|
|
42
|
-
*/
|
|
43
|
-
css?: object;
|
|
44
|
-
/**
|
|
45
|
-
* Disables the component and becomes non-interactive.
|
|
46
|
-
*/
|
|
47
|
-
disabled?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Flip the icon horizontally, vertically or both.
|
|
50
|
-
*/
|
|
51
|
-
flip?: "both" | "horizontal" | "vertical";
|
|
52
|
-
/**
|
|
53
|
-
* The icon.
|
|
54
|
-
*
|
|
55
|
-
* This will be passed as `children` to the `iconComponent` , unless you supply a React
|
|
56
|
-
element (like JSX) to this prop, directly or via the `<icon>` slot.
|
|
57
|
-
*/
|
|
58
|
-
icon?: string | JSX.Element | React.ComponentType;
|
|
59
|
-
/**
|
|
60
|
-
* The component used to render the `icon` .
|
|
61
|
-
*
|
|
62
|
-
* This will receive the `icon` prop as `children` and should handle it appropriately. This
|
|
63
|
-
prop is ignored in the case of a component being passed into the `icon` prop. It will
|
|
64
|
-
also receive the `flip` and `size` props as set on the component.
|
|
65
|
-
*/
|
|
66
|
-
iconComponent?: React.ComponentType;
|
|
67
|
-
/**
|
|
68
|
-
* Enables this component to be used in an "inline" context.
|
|
69
|
-
*
|
|
70
|
-
* This is useful for when you have several of these components in a row and are not using a
|
|
71
|
-
[Layout] or flex-box configuration.
|
|
72
|
-
*/
|
|
73
|
-
inline?: boolean;
|
|
74
|
-
/**
|
|
75
|
-
* The position of the label in relation to the icon element.
|
|
76
|
-
*
|
|
77
|
-
* Allowed values include:
|
|
78
|
-
* * 'below' (default),
|
|
79
|
-
* * 'above',
|
|
80
|
-
* * 'left',
|
|
81
|
-
* * 'right',
|
|
82
|
-
* * 'before', and
|
|
83
|
-
* * 'after'.
|
|
84
|
-
*
|
|
85
|
-
* The 'before' and 'after' values automatically swap sides when in an RTL locale context.
|
|
86
|
-
*/
|
|
87
|
-
labelPosition?: "above" | "after" | "before" | "below" | "left" | "right";
|
|
88
|
-
/**
|
|
89
|
-
* The size of the icon.
|
|
90
|
-
*
|
|
91
|
-
* Applies the CSS class which can be customized by
|
|
92
|
-
[theming] .
|
|
93
|
-
*/
|
|
94
|
-
size?: string;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* An icon component with a label.
|
|
98
|
-
*/
|
|
99
|
-
|
|
100
|
-
export class LabeledIconBase extends React.Component<
|
|
101
|
-
Merge<React.HTMLProps<HTMLElement>, LabeledIconBaseProps>
|
|
102
|
-
> {}
|
|
103
|
-
|
|
104
|
-
export interface LabeledIconDecoratorProps
|
|
105
|
-
extends ui_Slottable_SlottableProps {}
|
|
106
|
-
export function LabeledIconDecorator<P>(
|
|
107
|
-
Component: React.ComponentType<P> | string
|
|
108
|
-
): React.ComponentType<P & LabeledIconDecoratorProps>;
|
|
109
|
-
|
|
110
|
-
export interface LabeledIconProps
|
|
111
|
-
extends Omit<
|
|
112
|
-
Merge<LabeledIconBaseProps, LabeledIconDecoratorProps>,
|
|
113
|
-
"componentRef"
|
|
114
|
-
> {}
|
|
115
|
-
/**
|
|
116
|
-
* An icon component with a label without any behaviors applied to it.
|
|
117
|
-
*
|
|
118
|
-
* Usage:
|
|
119
|
-
* ```
|
|
120
|
-
<LabeledIcon icon="star" labelPosition="after">
|
|
121
|
-
Favorite
|
|
122
|
-
</LabeledIcon>
|
|
123
|
-
```
|
|
124
|
-
*/
|
|
125
|
-
|
|
126
|
-
export class LabeledIcon extends React.Component<
|
|
127
|
-
Merge<React.HTMLProps<HTMLElement>, LabeledIconProps>
|
|
128
|
-
> {}
|
|
129
|
-
|
|
130
|
-
export default LabeledIcon;
|
package/Layout/Layout.d.ts
DELETED
|
@@ -1,247 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Layout
|
|
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 CellBaseProps {
|
|
10
|
-
/**
|
|
11
|
-
* The alignment of `Cell` .
|
|
12
|
-
*
|
|
13
|
-
* Aligns this `Cell` vertically in the case of a horizontal layout or
|
|
14
|
-
horizontally in the case of a vertical layout. `"start"` , `"center"` and
|
|
15
|
-
`"end"` are the most commonly used, although all values of `align-self` are supported.
|
|
16
|
-
`"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
|
|
17
|
-
`"end"` refers to the bottom in a horizontal layout, and right in a vertical LTR layout
|
|
18
|
-
`"start"` and `"end"` reverse places when in a vertical layout in a RTL locale.
|
|
19
|
-
*/
|
|
20
|
-
align?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Any valid [Node] that should be positioned in this `Cell` .
|
|
23
|
-
*/
|
|
24
|
-
children?: Any;
|
|
25
|
-
/**
|
|
26
|
-
* The type of component to use to render as the `Cell` . May be a DOM node name (e.g 'div',
|
|
27
|
-
'span', etc.) or a custom component.
|
|
28
|
-
*/
|
|
29
|
-
component?: string | React.ComponentType;
|
|
30
|
-
/**
|
|
31
|
-
* Called with a reference to the root component.
|
|
32
|
-
*
|
|
33
|
-
* When using , the `ref` prop is forwarded to this component
|
|
34
|
-
as `componentRef` .
|
|
35
|
-
*/
|
|
36
|
-
componentRef?: object | Function;
|
|
37
|
-
/**
|
|
38
|
-
* Sizes `Cell` to its contents.
|
|
39
|
-
*
|
|
40
|
-
* A `shrink` able cell will contract to its minimum size, according to the dimensions of its
|
|
41
|
-
contents. This is used when you want the size of this Cell's content to influence the
|
|
42
|
-
dimensions of this cell. `shrink` will not allow the contents of the Layout to be pushed
|
|
43
|
-
beyond its boundaries (overflowing). See the [size] property
|
|
44
|
-
for more details.
|
|
45
|
-
*/
|
|
46
|
-
shrink?: boolean;
|
|
47
|
-
/**
|
|
48
|
-
* Sets the desired size of the Cell using any valid CSS measurement value.
|
|
49
|
-
*
|
|
50
|
-
* When used in conjunction with [shrink] , the size will be
|
|
51
|
-
the maximum size, shrinking as necessary, to fit the content.
|
|
52
|
-
*
|
|
53
|
-
* E.g.
|
|
54
|
-
* * `size="400px"` -> cell will be 400px, regardless of the dimensions of your content
|
|
55
|
-
* * `size="400px" shrink` -> cell will be 400px if your content is greater than 400px,
|
|
56
|
-
and will match your contents size if it's smaller
|
|
57
|
-
*
|
|
58
|
-
* This accepts any valid CSS measurement value string. If a numeric value is used, it will
|
|
59
|
-
be treated as a pixel value and converted to a
|
|
60
|
-
[relative unit] based on the rules of
|
|
61
|
-
[resolution independence] .
|
|
62
|
-
*/
|
|
63
|
-
size?: string | number;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* A stateless component that provides a space for your content in a
|
|
67
|
-
[Layout] , without applied.
|
|
68
|
-
*/
|
|
69
|
-
|
|
70
|
-
export class CellBase extends React.Component<
|
|
71
|
-
Merge<React.HTMLProps<HTMLElement>, CellBaseProps>
|
|
72
|
-
> {}
|
|
73
|
-
|
|
74
|
-
export interface CellDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
75
|
-
export function CellDecorator<P>(
|
|
76
|
-
Component: React.ComponentType<P> | string
|
|
77
|
-
): React.ComponentType<P & CellDecoratorProps>;
|
|
78
|
-
|
|
79
|
-
export interface LayoutBaseProps {
|
|
80
|
-
/**
|
|
81
|
-
* The alignment of children.
|
|
82
|
-
*
|
|
83
|
-
* Aligns the children [Cells] vertically in the case of a horizontal
|
|
84
|
-
layout or horizontally in the case of a vertical layout. `"start"` , `"center"` and
|
|
85
|
-
`"end"` are the most commonly used, although all values of `align-items` are supported.
|
|
86
|
-
`"start"` refers to the top in a horizontal layout, and left in a vertical LTR layout
|
|
87
|
-
`"end"` refers to the bottom in a horizontal layout, and right in a vertical LTR layout
|
|
88
|
-
`"start"` and `"end"` reverse places when in a vertical layout in a RTL locale.
|
|
89
|
-
This includes support for `align-parts` which is shorthand for combining `align-items`
|
|
90
|
-
and `justify-content` into a single property, separated by a space, in that order.
|
|
91
|
-
This allows you to specify both the horizontal and vertical alignment in one property,
|
|
92
|
-
separated by a space.
|
|
93
|
-
*/
|
|
94
|
-
align?: string;
|
|
95
|
-
/**
|
|
96
|
-
* Only [Cell] components are supported as children.
|
|
97
|
-
*/
|
|
98
|
-
children?: Cell | Cell[];
|
|
99
|
-
/**
|
|
100
|
-
* The type of component to use to render as the `Layout` . May be a DOM node name (e.g 'div',
|
|
101
|
-
'span', etc.) or a custom component.
|
|
102
|
-
*/
|
|
103
|
-
component?: string | React.ComponentType;
|
|
104
|
-
/**
|
|
105
|
-
* Called with a reference to the root component.
|
|
106
|
-
*
|
|
107
|
-
* When using , the `ref` prop is forwarded to this component
|
|
108
|
-
as `componentRef` .
|
|
109
|
-
*/
|
|
110
|
-
componentRef?: object | Function;
|
|
111
|
-
/**
|
|
112
|
-
* Allows this `Layout` to have following siblings drawn on the same line as itself
|
|
113
|
-
instead of carving out the entire horizontal space for itself.
|
|
114
|
-
*/
|
|
115
|
-
inline?: boolean;
|
|
116
|
-
/**
|
|
117
|
-
* The orientation of the `Layout` , i.e. how the children [Cells] are
|
|
118
|
-
positioned on the screen. Must be either `'horizontal'` or `'vertical'` .
|
|
119
|
-
*/
|
|
120
|
-
orientation?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Sets the Layout's `flex-wrap` values.
|
|
123
|
-
*
|
|
124
|
-
* Determines how a Layout handles its cells if there are more than fit in the available
|
|
125
|
-
space. This works like a normal `Boolean` prop, but also accepts strings for customization
|
|
126
|
-
beyond the basic on/off support. In addition to `true` and `false` , the following strings
|
|
127
|
-
are supported: 'wrap', 'nowrap', 'reverse'. 'reverse' performs standard line wrapping but
|
|
128
|
-
additional lines are placed above/before the preceding line instead of below/after.
|
|
129
|
-
*/
|
|
130
|
-
wrap?: boolean | string;
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* A container for `Cell` s.
|
|
134
|
-
*
|
|
135
|
-
* A stateless component that acts as a containing area for [Cells] to be
|
|
136
|
-
positioned in a row or a column (horizontally or vertically, respectively. It supports an
|
|
137
|
-
[orientation] property for laying-out its contents
|
|
138
|
-
( `Cells` ) in an organized, readable way.
|
|
139
|
-
*
|
|
140
|
-
* Example:
|
|
141
|
-
* ```
|
|
142
|
-
import Input from '@enact/moonstone/Input';
|
|
143
|
-
import css from './LayoutExample.less';
|
|
144
|
-
...
|
|
145
|
-
<fieldset>
|
|
146
|
-
<Layout align="center">
|
|
147
|
-
<Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
|
|
148
|
-
<Cell component={Input} placeholder="First" className={css.input} />
|
|
149
|
-
</Layout>
|
|
150
|
-
<Layout align="center">
|
|
151
|
-
<Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
|
|
152
|
-
<Cell component={Input} placeholder="Last" className={css.input} />
|
|
153
|
-
</Layout>
|
|
154
|
-
</fieldset>
|
|
155
|
-
```
|
|
156
|
-
*/
|
|
157
|
-
|
|
158
|
-
export class LayoutBase extends React.Component<
|
|
159
|
-
Merge<React.HTMLProps<HTMLElement>, LayoutBaseProps>
|
|
160
|
-
> {}
|
|
161
|
-
|
|
162
|
-
export interface CellProps
|
|
163
|
-
extends Omit<Merge<CellBaseProps, CellDecoratorProps>, "componentRef"> {}
|
|
164
|
-
/**
|
|
165
|
-
* A stateless component that provides a space for your content in a
|
|
166
|
-
[Layout] .
|
|
167
|
-
*/
|
|
168
|
-
|
|
169
|
-
export class Cell extends React.Component<
|
|
170
|
-
Merge<React.HTMLProps<HTMLElement>, CellProps>
|
|
171
|
-
> {}
|
|
172
|
-
|
|
173
|
-
export interface LayoutDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
174
|
-
export function LayoutDecorator<P>(
|
|
175
|
-
Component: React.ComponentType<P> | string
|
|
176
|
-
): React.ComponentType<P & LayoutDecoratorProps>;
|
|
177
|
-
|
|
178
|
-
export interface LayoutProps
|
|
179
|
-
extends Omit<
|
|
180
|
-
Merge<LayoutBaseProps, ui_ForwardRef_ForwardRefProps>,
|
|
181
|
-
"componentRef"
|
|
182
|
-
> {}
|
|
183
|
-
/**
|
|
184
|
-
* A container for `Cell` s.
|
|
185
|
-
*
|
|
186
|
-
* A stateless component that acts as a containing area for [Cells] to be
|
|
187
|
-
positioned in a row or a column (horizontally or vertically, respectively. It supports an
|
|
188
|
-
[orientation] property for laying-out its contents
|
|
189
|
-
( `Cells` ) in an organized, readable way.
|
|
190
|
-
*
|
|
191
|
-
* Example:
|
|
192
|
-
* ```
|
|
193
|
-
import Input from '@enact/moonstone/Input';
|
|
194
|
-
import css from './LayoutExample.less';
|
|
195
|
-
...
|
|
196
|
-
<fieldset>
|
|
197
|
-
<Layout align="center">
|
|
198
|
-
<Cell component="label" size="40%" className={css.label} shrink>First Name</Cell>
|
|
199
|
-
<Cell component={Input} placeholder="First" className={css.input} />
|
|
200
|
-
</Layout>
|
|
201
|
-
<Layout align="center">
|
|
202
|
-
<Cell component="label" size="40%" className={css.label} shrink>Last Name</Cell>
|
|
203
|
-
<Cell component={Input} placeholder="Last" className={css.input} />
|
|
204
|
-
</Layout>
|
|
205
|
-
</fieldset>
|
|
206
|
-
```
|
|
207
|
-
*/
|
|
208
|
-
|
|
209
|
-
export class Layout extends React.Component<
|
|
210
|
-
Merge<React.HTMLProps<HTMLElement>, LayoutProps>
|
|
211
|
-
> {}
|
|
212
|
-
|
|
213
|
-
export interface ColumnProps
|
|
214
|
-
extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
|
|
215
|
-
/**
|
|
216
|
-
* Shorthand for `<Layout orientation="vertical">` , which positions its
|
|
217
|
-
[Cells] vertically.
|
|
218
|
-
* ```
|
|
219
|
-
┌────┐
|
|
220
|
-
├────┤
|
|
221
|
-
├────┤
|
|
222
|
-
├────┤
|
|
223
|
-
└────┘
|
|
224
|
-
```
|
|
225
|
-
*/
|
|
226
|
-
|
|
227
|
-
export class Column extends React.Component<
|
|
228
|
-
Merge<React.HTMLProps<HTMLElement>, ColumnProps>
|
|
229
|
-
> {}
|
|
230
|
-
|
|
231
|
-
export interface RowProps
|
|
232
|
-
extends Merge<LayoutProps, ui_ForwardRef_ForwardRefProps> {}
|
|
233
|
-
/**
|
|
234
|
-
* Shorthand for `<Layout orientation="horizontal">` , which positions its
|
|
235
|
-
[Cells] horizontally.
|
|
236
|
-
* ```
|
|
237
|
-
┌─┬─┬─┬─┐
|
|
238
|
-
│ │ │ │ │
|
|
239
|
-
└─┴─┴─┴─┘
|
|
240
|
-
```
|
|
241
|
-
*/
|
|
242
|
-
|
|
243
|
-
export class Row extends React.Component<
|
|
244
|
-
Merge<React.HTMLProps<HTMLElement>, RowProps>
|
|
245
|
-
> {}
|
|
246
|
-
|
|
247
|
-
export default Layout;
|
package/Marquee/index.d.ts
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Marquee
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
|
|
5
|
-
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
6
|
-
type Merge<M, N> = Omit<M, Extract<keyof M, keyof N>> & N;
|
|
7
|
-
|
|
8
|
-
export interface MarqueeBaseProps {
|
|
9
|
-
/**
|
|
10
|
-
* Text alignment value of the marquee
|
|
11
|
-
*
|
|
12
|
-
* Valid values are:
|
|
13
|
-
* * `'left'` ,
|
|
14
|
-
* * `'right'` , and
|
|
15
|
-
* * `'center'`
|
|
16
|
-
*/
|
|
17
|
-
alignment?: string;
|
|
18
|
-
/**
|
|
19
|
-
* Applies animating styles such as removing the ellipsis.
|
|
20
|
-
*/
|
|
21
|
-
animating?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Sets the value of the `aria-label` attribute for the wrapped component.
|
|
24
|
-
*/
|
|
25
|
-
"aria-label"?: string;
|
|
26
|
-
/**
|
|
27
|
-
* The text or a set of components that should be marqueed
|
|
28
|
-
*
|
|
29
|
-
* This prop may be empty in some cases, which is OK.
|
|
30
|
-
*/
|
|
31
|
-
children?: React.ReactNode;
|
|
32
|
-
/**
|
|
33
|
-
* Called when mounting or unmounting with a reference to the client node
|
|
34
|
-
*/
|
|
35
|
-
clientRef?: object | Function;
|
|
36
|
-
/**
|
|
37
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
38
|
-
corresponding internal elements and states of this component.
|
|
39
|
-
*
|
|
40
|
-
* The following classes are supported:
|
|
41
|
-
* * `marquee` - The root component class
|
|
42
|
-
* * `animate` - Applied to the inner content node when the text is animating
|
|
43
|
-
* * `spacing` - The spacing node used between the repeated content
|
|
44
|
-
* * `text` - The inner content node
|
|
45
|
-
* * `willAnimate` - Applied to the inner content node shortly before animation
|
|
46
|
-
*/
|
|
47
|
-
css?: object;
|
|
48
|
-
/**
|
|
49
|
-
* Distance to animate the marquee
|
|
50
|
-
*
|
|
51
|
-
* Usually, the `distance` is the width of the text minus the width of the container
|
|
52
|
-
*/
|
|
53
|
-
distance?: number;
|
|
54
|
-
/**
|
|
55
|
-
* Called when the marquee completes its animation
|
|
56
|
-
*/
|
|
57
|
-
onMarqueeComplete?: Function;
|
|
58
|
-
/**
|
|
59
|
-
* Text overflow setting. Either `'clip'` or `'ellipsis'`
|
|
60
|
-
*/
|
|
61
|
-
overflow?: "clip" | "ellipsis";
|
|
62
|
-
/**
|
|
63
|
-
* `true` if the directionality of the content is right-to-left
|
|
64
|
-
*/
|
|
65
|
-
rtl?: boolean;
|
|
66
|
-
/**
|
|
67
|
-
* Amount of spacing, in pixels, between the instances of the content
|
|
68
|
-
*/
|
|
69
|
-
spacing?: number;
|
|
70
|
-
/**
|
|
71
|
-
* Speed of marquee animation in pixels/second.
|
|
72
|
-
*/
|
|
73
|
-
speed?: number;
|
|
74
|
-
/**
|
|
75
|
-
* Indicates the marquee will animate soon.
|
|
76
|
-
*
|
|
77
|
-
* Should be used by the component to prepare itself for animation such as promoting
|
|
78
|
-
composite layers for improved performance.
|
|
79
|
-
*/
|
|
80
|
-
willAnimate?: boolean;
|
|
81
|
-
}
|
|
82
|
-
/**
|
|
83
|
-
* Marquees the children of the component.
|
|
84
|
-
*
|
|
85
|
-
* For automated marquee calculations use .
|
|
86
|
-
*/
|
|
87
|
-
|
|
88
|
-
export class MarqueeBase extends React.Component<
|
|
89
|
-
Merge<React.HTMLProps<HTMLElement>, MarqueeBaseProps>
|
|
90
|
-
> {}
|
|
91
|
-
|
|
92
|
-
export interface MarqueeControllerConfig extends Object {
|
|
93
|
-
/**
|
|
94
|
-
* When `true` , any `onFocus` events that bubble to the controller will start the contained
|
|
95
|
-
`Marquee` instances. This is useful when a component contains `Marquee` instances that need to be
|
|
96
|
-
started when sibling components are focused.
|
|
97
|
-
*/
|
|
98
|
-
marqueeOnFocus?: boolean;
|
|
99
|
-
}
|
|
100
|
-
export interface MarqueeControllerProps {}
|
|
101
|
-
export function MarqueeController<P>(
|
|
102
|
-
config: MarqueeControllerConfig,
|
|
103
|
-
Component: React.ComponentType<P> | string
|
|
104
|
-
): React.ComponentType<P & MarqueeControllerProps>;
|
|
105
|
-
|
|
106
|
-
export function MarqueeController<P>(
|
|
107
|
-
Component: React.ComponentType<P> | string
|
|
108
|
-
): React.ComponentType<P & MarqueeControllerProps>;
|
|
109
|
-
|
|
110
|
-
export interface MarqueeDecoratorConfig extends Object {
|
|
111
|
-
/**
|
|
112
|
-
* Property containing the callback to stop the animation when `marqueeOn` is `'focus'`
|
|
113
|
-
*/
|
|
114
|
-
blur?: string;
|
|
115
|
-
/**
|
|
116
|
-
* Optional CSS class name to customize the marquee `component`
|
|
117
|
-
*/
|
|
118
|
-
className?: string;
|
|
119
|
-
/**
|
|
120
|
-
* The base marquee component wrapping the content.
|
|
121
|
-
*/
|
|
122
|
-
component?: React.ComponentType;
|
|
123
|
-
/**
|
|
124
|
-
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
125
|
-
corresponding internal elements and states of this component.
|
|
126
|
-
*
|
|
127
|
-
* The following classes are supported:
|
|
128
|
-
* * `marquee` - The root component class
|
|
129
|
-
* * `animate` - Applied to the inner content node when the text is animating
|
|
130
|
-
* * `spacing` - The spacing node used between the repeated content
|
|
131
|
-
* * `text` - The inner content node
|
|
132
|
-
* * `willAnimate` - Applied to the inner content node shortly before animation
|
|
133
|
-
*/
|
|
134
|
-
css?: object;
|
|
135
|
-
/**
|
|
136
|
-
* Property containing the callback to start the animation when `marqueeOn` is `'hover'`
|
|
137
|
-
*/
|
|
138
|
-
enter?: string;
|
|
139
|
-
/**
|
|
140
|
-
* Property containing the callback to start the animation when `marqueeOn` is `'focus'`
|
|
141
|
-
*/
|
|
142
|
-
focus?: string;
|
|
143
|
-
/**
|
|
144
|
-
* Invalidate the distance if any property (like 'inline') changes.
|
|
145
|
-
Expects an array of props which on change trigger invalidateMetrics.
|
|
146
|
-
*/
|
|
147
|
-
invalidateProps?: string[];
|
|
148
|
-
/**
|
|
149
|
-
* Property containing the callback to stop the animation when `marqueeOn` is `'hover'`
|
|
150
|
-
*/
|
|
151
|
-
leave?: string;
|
|
152
|
-
/**
|
|
153
|
-
* A function that determines the text directionality of a string.
|
|
154
|
-
*
|
|
155
|
-
* Returns:
|
|
156
|
-
* * `'rtl'` if the text should marquee to the right
|
|
157
|
-
* * `'ltr'` if the text should marquee to the left
|
|
158
|
-
*/
|
|
159
|
-
marqueeDirection?: Function;
|
|
160
|
-
}
|
|
161
|
-
export interface MarqueeDecoratorProps {
|
|
162
|
-
/**
|
|
163
|
-
* Text alignment value of the marquee. Valid values are `'left'` , `'right'` and `'center'` .
|
|
164
|
-
*/
|
|
165
|
-
alignment?: string;
|
|
166
|
-
/**
|
|
167
|
-
* Children to be marqueed
|
|
168
|
-
*/
|
|
169
|
-
children?: React.ReactNode;
|
|
170
|
-
/**
|
|
171
|
-
* Passed through to the wrapped component.
|
|
172
|
-
*
|
|
173
|
-
* Does not affect Marquee behavior except that components that are `marqueeOn="focus"`
|
|
174
|
-
will be treated as if they were `marqueeOn="hover"` , to allow disabled (and thus,
|
|
175
|
-
unfocusable) components to marquee.
|
|
176
|
-
*/
|
|
177
|
-
disabled?: boolean;
|
|
178
|
-
/**
|
|
179
|
-
* Forces the `direction` of the marquee.
|
|
180
|
-
*
|
|
181
|
-
* Valid values are `'rtl'` , `'ltr'` , and `'locale'` . This includes non-text elements as well.
|
|
182
|
-
The default behavior, if this prop is unset, is to evaluate the text content for
|
|
183
|
-
directionality using .
|
|
184
|
-
*
|
|
185
|
-
* If `'locale'` , the `direction` is determined by the locale, same as .
|
|
186
|
-
In other words, it will not consider the text content for determining the direction.
|
|
187
|
-
*/
|
|
188
|
-
forceDirection?: string;
|
|
189
|
-
/**
|
|
190
|
-
* The current locale as a
|
|
191
|
-
.
|
|
192
|
-
*/
|
|
193
|
-
locale?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Number of milliseconds to wait before starting marquee when `marqueeOn` is `'hover'` or
|
|
196
|
-
`'focus'` or before restarting any marquee.
|
|
197
|
-
*/
|
|
198
|
-
marqueeDelay?: number;
|
|
199
|
-
/**
|
|
200
|
-
* Disables all marquee behavior and removes supporting markup.
|
|
201
|
-
*/
|
|
202
|
-
marqueeDisabled?: boolean;
|
|
203
|
-
/**
|
|
204
|
-
* Determines what triggers the marquee to start its animation.
|
|
205
|
-
*/
|
|
206
|
-
marqueeOn?: "focus" | "hover" | "render";
|
|
207
|
-
/**
|
|
208
|
-
* Number of milliseconds to wait before starting marquee the first time.
|
|
209
|
-
*
|
|
210
|
-
* Has no effect if `marqueeOn` is not `'render'`
|
|
211
|
-
*/
|
|
212
|
-
marqueeOnRenderDelay?: number;
|
|
213
|
-
/**
|
|
214
|
-
* Number of milliseconds to wait before resetting the marquee position after it
|
|
215
|
-
finishes.
|
|
216
|
-
*
|
|
217
|
-
* A minimum of 40 milliseconds is enforced.
|
|
218
|
-
*/
|
|
219
|
-
marqueeResetDelay?: number;
|
|
220
|
-
/**
|
|
221
|
-
* Amount of spacing between the instances of the content when animating.
|
|
222
|
-
*
|
|
223
|
-
* May either be a number indicating the number of pixels or a string indicating the
|
|
224
|
-
percentage relative to the width of the component.
|
|
225
|
-
*
|
|
226
|
-
* _Note:_ When using a number, the value should be based on 1920x1080 display and
|
|
227
|
-
will be scaled automatically for the current resolution using .
|
|
228
|
-
*/
|
|
229
|
-
marqueeSpacing?: string | number;
|
|
230
|
-
/**
|
|
231
|
-
* Rate of marquee measured in pixels/second.
|
|
232
|
-
*/
|
|
233
|
-
marqueeSpeed?: number;
|
|
234
|
-
/**
|
|
235
|
-
* Indicates the text directionality of the current locale is right-to-left
|
|
236
|
-
*/
|
|
237
|
-
rtl?: string;
|
|
238
|
-
}
|
|
239
|
-
export function MarqueeDecorator<P>(
|
|
240
|
-
config: MarqueeDecoratorConfig,
|
|
241
|
-
Component: React.ComponentType<P> | string
|
|
242
|
-
): React.ComponentType<P & MarqueeDecoratorProps>;
|
|
243
|
-
|
|
244
|
-
export function MarqueeDecorator<P>(
|
|
245
|
-
Component: React.ComponentType<P> | string
|
|
246
|
-
): React.ComponentType<P & MarqueeDecoratorProps>;
|
|
247
|
-
|
|
248
|
-
export interface MarqueeProps
|
|
249
|
-
extends Merge<MarqueeBaseProps, MarqueeDecoratorProps> {}
|
|
250
|
-
/**
|
|
251
|
-
* A minimally-styled marquee component.
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
export class Marquee extends React.Component<
|
|
255
|
-
Merge<React.HTMLProps<HTMLElement>, MarqueeProps>
|
|
256
|
-
> {}
|
|
257
|
-
|
|
258
|
-
export default Marquee;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
// Type definitions for ui/Measurable
|
|
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 MeasurableConfig extends Object {
|
|
7
|
-
/**
|
|
8
|
-
* Configures the prop name to pass the measurement object.
|
|
9
|
-
*/
|
|
10
|
-
measurementProp?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Configures the prop name to pass a function to capture a reference to the element to measure.
|
|
13
|
-
*/
|
|
14
|
-
refProp?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface MeasurableProps {}
|
|
17
|
-
export function Measurable<P>(
|
|
18
|
-
config: MeasurableConfig,
|
|
19
|
-
Component: React.ComponentType<P> | string
|
|
20
|
-
): React.ComponentType<P & MeasurableProps>;
|
|
21
|
-
|
|
22
|
-
export function Measurable<P>(
|
|
23
|
-
Component: React.ComponentType<P> | string
|
|
24
|
-
): React.ComponentType<P & MeasurableProps>;
|
|
25
|
-
|
|
26
|
-
export default Measurable;
|