@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
|
@@ -11,24 +11,25 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
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
15
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
16
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
16
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
17
17
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
18
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
19
|
+
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); }
|
|
18
20
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
19
21
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
20
22
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
21
23
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
22
24
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
23
25
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
*/
|
|
26
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
|
|
27
|
+
* Default config for PlaceholderDecorator.
|
|
28
|
+
*
|
|
29
|
+
* @memberof ui/Placeholder.PlaceholderDecorator
|
|
30
|
+
* @hocconfig
|
|
31
|
+
* @public
|
|
32
|
+
*/
|
|
32
33
|
var defaultConfig = {
|
|
33
34
|
/**
|
|
34
35
|
* Configures the style of the placeholder element
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
// Type definitions for ui/Placeholder
|
|
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 PlaceholderDecoratorConfig extends Object {
|
|
7
|
+
/**
|
|
8
|
+
* Configures the style of the placeholder element
|
|
9
|
+
*/
|
|
10
|
+
style?: object;
|
|
11
|
+
/**
|
|
12
|
+
* The component to use as a placeholder.
|
|
13
|
+
*/
|
|
14
|
+
placeholderComponent?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PlaceholderDecoratorProps {}
|
|
17
|
+
export function PlaceholderDecorator<P>(
|
|
18
|
+
config: PlaceholderDecoratorConfig,
|
|
19
|
+
Component: React.ComponentType<P> | string
|
|
20
|
+
): React.ComponentType<P & PlaceholderDecoratorProps>;
|
|
21
|
+
|
|
22
|
+
export function PlaceholderDecorator<P>(
|
|
23
|
+
Component: React.ComponentType<P> | string
|
|
24
|
+
): React.ComponentType<P & PlaceholderDecoratorProps>;
|
|
25
|
+
|
|
26
|
+
export interface PlaceholderControllerDecoratorConfig extends Object {
|
|
27
|
+
/**
|
|
28
|
+
* The bounds of the container represented by an object with `height` and `width` members.
|
|
29
|
+
*
|
|
30
|
+
* If the container is a static size, this can be specified at design-time to avoid calculating
|
|
31
|
+
the bounds at run-time (the default behavior).
|
|
32
|
+
*/
|
|
33
|
+
bounds?: object;
|
|
34
|
+
/**
|
|
35
|
+
* Event callback which indicates that the viewport has scrolled and placeholders should be
|
|
36
|
+
notified.
|
|
37
|
+
*/
|
|
38
|
+
notify?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Multiplier used with the wrapped component's height and width to determine the threshold for
|
|
41
|
+
replacing the placeholder component with the true component.
|
|
42
|
+
*/
|
|
43
|
+
thresholdFactor?: number;
|
|
44
|
+
}
|
|
45
|
+
export interface PlaceholderControllerDecoratorProps {}
|
|
46
|
+
export function PlaceholderControllerDecorator<P>(
|
|
47
|
+
config: PlaceholderControllerDecoratorConfig,
|
|
48
|
+
Component: React.ComponentType<P> | string
|
|
49
|
+
): React.ComponentType<P & PlaceholderControllerDecoratorProps>;
|
|
50
|
+
|
|
51
|
+
export function PlaceholderControllerDecorator<P>(
|
|
52
|
+
Component: React.ComponentType<P> | string
|
|
53
|
+
): React.ComponentType<P & PlaceholderControllerDecoratorProps>;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
// Type definitions for ui/ProgressBar
|
|
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 ProgressBarBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* The proportion of the loaded portion of the progress bar.
|
|
12
|
+
* * Valid values are between `0` and `1` .
|
|
13
|
+
*/
|
|
14
|
+
backgroundProgress?: number;
|
|
15
|
+
/**
|
|
16
|
+
* The contents to be displayed with progress bar.
|
|
17
|
+
*/
|
|
18
|
+
children?: React.ReactNode;
|
|
19
|
+
/**
|
|
20
|
+
* Called with a reference to the root component.
|
|
21
|
+
*
|
|
22
|
+
* When using , the `ref` prop is forwarded to this
|
|
23
|
+
component as `componentRef` .
|
|
24
|
+
*/
|
|
25
|
+
componentRef?: object | Function;
|
|
26
|
+
/**
|
|
27
|
+
* Customizes the component by mapping the supplied collection of CSS class names to the
|
|
28
|
+
corresponding internal elements and states of this component.
|
|
29
|
+
*
|
|
30
|
+
* The following classes are supported:
|
|
31
|
+
* * `progressBar` - The root component class
|
|
32
|
+
* * `bar` - The background node (the empty part of the progressBar)
|
|
33
|
+
* * `fill` - The foreground of the progress bar ( `progress` )
|
|
34
|
+
* * `load` - The `backgroundProgress` node
|
|
35
|
+
* * `horizontal` - Applied when `orientation` is `'horizontal'`
|
|
36
|
+
* * `vertical` - Applied when `orientation` is `'vertical'`
|
|
37
|
+
* * `radial` - Applied when `orientation` is `'radial'`
|
|
38
|
+
*/
|
|
39
|
+
css?: object;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the orientation of the slider.
|
|
42
|
+
*
|
|
43
|
+
* Allowed values include:
|
|
44
|
+
* * `'horizontal'` - A left and right orientation
|
|
45
|
+
* * `'vertical'` - An up and down orientation
|
|
46
|
+
* * `'radial'` - A circular orientation
|
|
47
|
+
*/
|
|
48
|
+
orientation?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The proportion of the filled portion of the progress bar.
|
|
51
|
+
* * Valid values are between `0` and `1` .
|
|
52
|
+
*/
|
|
53
|
+
progress?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Sets the point, as a proportion between 0 and 1, from which the progress bar is filled.
|
|
56
|
+
*
|
|
57
|
+
* Applies to both the progress bar's `value` and `backgroundProgress` . In both cases,
|
|
58
|
+
setting the value of `progressAnchor` will cause the progress bar to fill from that point
|
|
59
|
+
down, when `value` or `backgroundProgress` is proportionally less than the anchor, or up,
|
|
60
|
+
when `value` or `backgroundProgress` is proportionally greater than the anchor, rather
|
|
61
|
+
than always from the start of the progress bar.
|
|
62
|
+
*/
|
|
63
|
+
progressAnchor?: number;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* An unstyled progress bar component that can be customized by a theme or application.
|
|
67
|
+
*/
|
|
68
|
+
|
|
69
|
+
export class ProgressBarBase extends React.Component<
|
|
70
|
+
Merge<React.HTMLProps<HTMLElement>, ProgressBarBaseProps>
|
|
71
|
+
> {}
|
|
72
|
+
|
|
73
|
+
export interface ProgressBarDecoratorProps
|
|
74
|
+
extends ui_ForwardRef_ForwardRefProps {}
|
|
75
|
+
export function ProgressBarDecorator<P>(
|
|
76
|
+
Component: React.ComponentType<P> | string
|
|
77
|
+
): React.ComponentType<P & ProgressBarDecoratorProps>;
|
|
78
|
+
|
|
79
|
+
export interface ProgressBarProps
|
|
80
|
+
extends Omit<
|
|
81
|
+
Merge<ProgressBarBaseProps, ProgressBarDecoratorProps>,
|
|
82
|
+
"componentRef"
|
|
83
|
+
> {}
|
|
84
|
+
/**
|
|
85
|
+
* An unstyled progress bar component that can be customized by a theme or application.
|
|
86
|
+
*/
|
|
87
|
+
|
|
88
|
+
export class ProgressBar extends React.Component<
|
|
89
|
+
Merge<React.HTMLProps<HTMLElement>, ProgressBarProps>
|
|
90
|
+
> {}
|
|
91
|
+
|
|
92
|
+
export default ProgressBar;
|
|
@@ -19,7 +19,20 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
19
19
|
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; }
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
|
-
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; }
|
|
22
|
+
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; }
|
|
23
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
24
|
+
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); } /**
|
|
25
|
+
* A basic progress bar component that can display the progress of something in a horizontal,
|
|
26
|
+
* vertical, or radial bar format.
|
|
27
|
+
*
|
|
28
|
+
* A secondary independent progress indicator can be displayed, to indicate
|
|
29
|
+
* an additional degree of information, often used as a background loading progress.
|
|
30
|
+
*
|
|
31
|
+
* @module ui/ProgressBar
|
|
32
|
+
* @exports ProgressBar
|
|
33
|
+
* @exports ProgressBarBase
|
|
34
|
+
* @exports ProgressBarDecorator
|
|
35
|
+
*/
|
|
23
36
|
var progressToProportion = function progressToProportion(value) {
|
|
24
37
|
return (0, _clamp["default"])(0, 1, value);
|
|
25
38
|
};
|
package/README.md
CHANGED
|
@@ -35,7 +35,7 @@ npm install --save @enact/ui
|
|
|
35
35
|
|
|
36
36
|
Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
|
|
37
37
|
|
|
38
|
-
Copyright (c) 2012-
|
|
38
|
+
Copyright (c) 2012-2023 LG Electronics
|
|
39
39
|
|
|
40
40
|
Unless otherwise specified or set forth in the NOTICE file, all content, including all source code files and documentation files in this repository are: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this content except in compliance with the License. You may obtain a copy of the License at
|
|
41
41
|
|
|
@@ -12,10 +12,12 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
-
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; }
|
|
15
|
+
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; }
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
19
21
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
20
22
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
// Type definitions for ui/RadioDecorator
|
|
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 RadioControllerDecoratorProps {}
|
|
7
|
+
export function RadioControllerDecorator<P>(
|
|
8
|
+
Component: React.ComponentType<P> | string
|
|
9
|
+
): React.ComponentType<P & RadioControllerDecoratorProps>;
|
|
10
|
+
|
|
11
|
+
export interface RadioDecoratorConfig extends Object {
|
|
12
|
+
/**
|
|
13
|
+
* The event indicating the wrapped component is activated
|
|
14
|
+
*/
|
|
15
|
+
activate?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The event indicating the wrapped component is deactivated
|
|
18
|
+
*/
|
|
19
|
+
deactivate?: string;
|
|
20
|
+
/**
|
|
21
|
+
* The name of a boolean prop that activates the wrapped component when it is true.
|
|
22
|
+
*/
|
|
23
|
+
prop?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface RadioDecoratorProps {}
|
|
26
|
+
export function RadioDecorator<P>(
|
|
27
|
+
config: RadioDecoratorConfig,
|
|
28
|
+
Component: React.ComponentType<P> | string
|
|
29
|
+
): React.ComponentType<P & RadioDecoratorProps>;
|
|
30
|
+
|
|
31
|
+
export function RadioDecorator<P>(
|
|
32
|
+
Component: React.ComponentType<P> | string
|
|
33
|
+
): React.ComponentType<P & RadioDecoratorProps>;
|
|
34
|
+
|
|
35
|
+
export default RadioDecorator;
|
|
@@ -19,23 +19,31 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
19
19
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
20
20
|
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; }
|
|
21
21
|
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; }
|
|
22
|
-
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; }
|
|
22
|
+
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; }
|
|
23
23
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
24
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
24
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
25
25
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
26
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
27
|
+
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); }
|
|
26
28
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
27
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
28
30
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
29
31
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
30
32
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
31
33
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
32
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
34
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
|
|
35
|
+
* A higher-order component that manages activation of components.
|
|
36
|
+
*
|
|
37
|
+
* @module ui/RadioDecorator
|
|
38
|
+
* @exports RadioDecorator
|
|
39
|
+
* @exports RadioControllerDecorator
|
|
40
|
+
* @deprecated Will be removed in 5.0.0.
|
|
41
|
+
*/ /**
|
|
42
|
+
* Default config for `RadioDecorator`.
|
|
43
|
+
*
|
|
44
|
+
* @memberof ui/RadioDecorator.RadioDecorator
|
|
45
|
+
* @hocconfig
|
|
46
|
+
*/
|
|
39
47
|
var defaultConfig = {
|
|
40
48
|
/**
|
|
41
49
|
* The event indicating the wrapped component is activated
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
// Type definitions for ui/Repeater
|
|
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 RepeaterBaseProps {
|
|
10
|
+
/**
|
|
11
|
+
* Component type to repeat.
|
|
12
|
+
*
|
|
13
|
+
* This can be a React component or a string describing a DOM node (e.g. `'div'` ).
|
|
14
|
+
*/
|
|
15
|
+
childComponent: string | React.ComponentType;
|
|
16
|
+
/**
|
|
17
|
+
* An array of data to be mapped onto the `childComponent` .
|
|
18
|
+
*
|
|
19
|
+
* This supports two data types. If an array of strings is provided, the strings will be used
|
|
20
|
+
in the generated `childComponent` as the readable text. If an array of objects is provided,
|
|
21
|
+
each object will be spread onto the generated `childComponent` with no interpretation.
|
|
22
|
+
You'll be responsible for setting properties like `disabled` , `className` , and setting the
|
|
23
|
+
text content using the `children` key.
|
|
24
|
+
*
|
|
25
|
+
* NOTE : When an array of objects is provided, make sure a unique `key` is assigned to each
|
|
26
|
+
data. See for more information.
|
|
27
|
+
*/
|
|
28
|
+
children: string[] | { key: number | string; [propName: string]: any }[];
|
|
29
|
+
/**
|
|
30
|
+
* The property on each `childComponent` that receives the data in `children` .
|
|
31
|
+
*/
|
|
32
|
+
childProp?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Component type to wrap around all of the repeated elements.
|
|
35
|
+
*
|
|
36
|
+
* This can be a string describing a DOM node or React component (e.g. `'div'` or `Layout` ).
|
|
37
|
+
*/
|
|
38
|
+
component?: string | React.ComponentType;
|
|
39
|
+
/**
|
|
40
|
+
* Called with a reference to the root component.
|
|
41
|
+
*
|
|
42
|
+
* When using , the `ref` prop is forwarded to this component
|
|
43
|
+
as `componentRef` .
|
|
44
|
+
*/
|
|
45
|
+
componentRef?: object | Function;
|
|
46
|
+
/**
|
|
47
|
+
* The property on each `childComponent` that receives the index of the item in the `Repeater` .
|
|
48
|
+
*/
|
|
49
|
+
indexProp?: string;
|
|
50
|
+
/**
|
|
51
|
+
* An object containing properties to be passed to each child.
|
|
52
|
+
*/
|
|
53
|
+
itemProps?: object;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A stateless component that stamps out copies of `childComponent` , without
|
|
57
|
+
applied.
|
|
58
|
+
*/
|
|
59
|
+
|
|
60
|
+
export class RepeaterBase extends React.Component<
|
|
61
|
+
Merge<React.HTMLProps<HTMLElement>, RepeaterBaseProps>
|
|
62
|
+
> {}
|
|
63
|
+
|
|
64
|
+
export interface RepeaterDecoratorProps extends ui_ForwardRef_ForwardRefProps {}
|
|
65
|
+
export function RepeaterDecorator<P>(
|
|
66
|
+
Component: React.ComponentType<P> | string
|
|
67
|
+
): React.ComponentType<P & RepeaterDecoratorProps>;
|
|
68
|
+
|
|
69
|
+
export interface RepeaterProps
|
|
70
|
+
extends Omit<
|
|
71
|
+
Merge<RepeaterBaseProps, RepeaterDecoratorProps>,
|
|
72
|
+
"componentRef"
|
|
73
|
+
> {}
|
|
74
|
+
/**
|
|
75
|
+
* A stateless component that stamps out copies of `childComponent` .
|
|
76
|
+
*/
|
|
77
|
+
|
|
78
|
+
export class Repeater extends React.Component<
|
|
79
|
+
Merge<React.HTMLProps<HTMLElement>, RepeaterProps>
|
|
80
|
+
> {}
|
|
81
|
+
|
|
82
|
+
export default Repeater;
|
package/Repeater/Repeater.js
CHANGED
|
@@ -15,16 +15,22 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
15
15
|
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; }
|
|
16
16
|
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; }
|
|
17
17
|
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; }
|
|
18
|
-
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; }
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
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; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
|
+
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); } /**
|
|
21
|
+
* A repeater component.
|
|
22
|
+
*
|
|
23
|
+
* @module ui/Repeater
|
|
24
|
+
* @exports Repeater
|
|
25
|
+
*/ /**
|
|
26
|
+
* A stateless component that stamps out copies of `childComponent`, without
|
|
27
|
+
* [RepeaterDecorator](ui/Repeater.RepeaterDecorator) applied.
|
|
28
|
+
*
|
|
29
|
+
* @class RepeaterBase
|
|
30
|
+
* @memberof ui/Repeater
|
|
31
|
+
* @ui
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
28
34
|
var RepeaterBase = (0, _kind["default"])({
|
|
29
35
|
name: 'Repeater',
|
|
30
36
|
propTypes: /** @lends ui/Repeater.RepeaterBase.prototype */{
|
|
@@ -8,7 +8,9 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
8
8
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
9
9
|
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; }
|
|
10
10
|
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; }
|
|
11
|
-
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; }
|
|
11
|
+
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; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
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); }
|
|
12
14
|
describe('Repeater Specs', function () {
|
|
13
15
|
var stringItems = ['One', 'Two', 'Three'];
|
|
14
16
|
var objItems = stringItems.map(function (content, key) {
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Type definitions for ui/Resizable
|
|
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 ResizableConfig extends Object {
|
|
7
|
+
/**
|
|
8
|
+
* A handler to process the `resize` event.
|
|
9
|
+
*
|
|
10
|
+
* It should return a truthy value if the event should trigger a resize.
|
|
11
|
+
*/
|
|
12
|
+
filter?: Function;
|
|
13
|
+
/**
|
|
14
|
+
* The name of the event on the wrapped component to listen to for size changes.
|
|
15
|
+
*
|
|
16
|
+
* This event name will be passed to the wrapped component and will also be forwarded (if
|
|
17
|
+
needed) to the parent component.
|
|
18
|
+
*/
|
|
19
|
+
resize: string;
|
|
20
|
+
}
|
|
21
|
+
export interface ResizableProps {}
|
|
22
|
+
export function Resizable<P>(
|
|
23
|
+
config: ResizableConfig,
|
|
24
|
+
Component: React.ComponentType<P> | string
|
|
25
|
+
): React.ComponentType<P & ResizableProps>;
|
|
26
|
+
|
|
27
|
+
export function Resizable<P>(
|
|
28
|
+
Component: React.ComponentType<P> | string
|
|
29
|
+
): React.ComponentType<P & ResizableProps>;
|
|
30
|
+
|
|
31
|
+
export default Resizable;
|
package/Resizable/Resizable.js
CHANGED
|
@@ -12,24 +12,30 @@ var _jsxRuntime = require("react/jsx-runtime");
|
|
|
12
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
13
13
|
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; }
|
|
14
14
|
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; }
|
|
15
|
-
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; }
|
|
15
|
+
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; }
|
|
16
16
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
17
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
17
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
18
18
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
19
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
20
|
+
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); }
|
|
19
21
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
20
22
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
21
23
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
22
24
|
function _possibleConstructorReturn(self, call) { if (call && (typeof call === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
23
25
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
24
26
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
25
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
27
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } /**
|
|
28
|
+
* A higher-order component that handles component resize event.
|
|
29
|
+
*
|
|
30
|
+
* @module ui/Resizable
|
|
31
|
+
* @exports Resizable
|
|
32
|
+
*/ /**
|
|
33
|
+
* Used internally for things to notify children that they need to resize because of a parent
|
|
34
|
+
* update.
|
|
35
|
+
*
|
|
36
|
+
* @type Object
|
|
37
|
+
* @private
|
|
38
|
+
*/
|
|
33
39
|
var ResizeContext = /*#__PURE__*/(0, _react.createContext)();
|
|
34
40
|
|
|
35
41
|
/**
|
package/Routable/Link.js
CHANGED
|
@@ -13,9 +13,17 @@ var _react = require("react");
|
|
|
13
13
|
var _useLink = _interopRequireDefault(require("./useLink"));
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
15
|
var _excluded = ["path"];
|
|
16
|
+
/**
|
|
17
|
+
* A base component that is used to make a link.
|
|
18
|
+
*
|
|
19
|
+
* @class LinkBase
|
|
20
|
+
* @ui
|
|
21
|
+
* @memberof ui/Routable
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
16
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
17
25
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
18
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
26
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
19
27
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
20
28
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
21
29
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -26,17 +34,11 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
26
34
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
27
35
|
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; }
|
|
28
36
|
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; }
|
|
29
|
-
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; }
|
|
37
|
+
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; }
|
|
38
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
39
|
+
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); }
|
|
30
40
|
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; }
|
|
31
41
|
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; }
|
|
32
|
-
/**
|
|
33
|
-
* A base component that is used to make a link.
|
|
34
|
-
*
|
|
35
|
-
* @class LinkBase
|
|
36
|
-
* @ui
|
|
37
|
-
* @memberof ui/Routable
|
|
38
|
-
* @public
|
|
39
|
-
*/
|
|
40
42
|
var LinkBase = (0, _kind["default"])({
|
|
41
43
|
name: 'Link',
|
|
42
44
|
propTypes: /** @lends ui/Routable.Link.prototype */{
|