@enact/core
@enact/core
contains the set of basic building blocks for an Enact-based application.
Enact core provides several abstractions to be used with React-based applications. These include core/kind
, a
factory for stateless functional components (SFC's), core/jobs
, a smart wrapper for window.setTimeout
,
core/hoc
, a Higher Order Component (HOC) factory, and more.
Install
npm install --save @enact/core
Test
Tests are implemented in mocha and are run with the Karma runner.
npm test
Copyright and License Information
Unless otherwise specified, all content, including all source code files and documentation files in this repository are:
Copyright (c) 2012-2017 LG Electronics
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
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
[1.0.0] - 2017-03-31
NOTE: This version includes a breaking change to the way modules are organized. This change was necessary to prevent further API breakage following the 1.0.0 release and to facilitate changes we want to make in the future. We understand that this will require some work on the part of developers to update their code. Below you will find details about the changes:
Moved/renamed modules:
core/jobs
-> core/util/Job
core/Accelerator
-> spotlight/Accelerator
i18n.$L
-> i18n/$L
i18n.toIString
-> i18n/$L.toIString
spotlight.Spottable
-> spotlight/Spottable
spotlight.spottableClass
-> spotlight/Spottable.spottableClass
spotlight.SpotlightContainerDecorator
-> spotlight/SpotlightContainerDecorator
spotlight.spotlightDefaultClass
-> spotlight/SpotlightContainerDecorator.spotlightDefaultClass
spotlight.SpotlightRootDecorator
-> spotlight/SpotlightRootDecorator
Removed modules:
core/selection
core/fetch
ui/validators
Removed aliases:
core.hoc
- Use core/hoc
core.kind
- Use core/kind
We have also modified most form components to be usable in a controlled (app manages component
state) or uncontrolled (Enact manages component state) manner. To put a component into a
controlled state, pass in value
(or other appropriate state property such as selected
or
open
) at component creation and then respond to events and update the value as needed. To put a
component into an uncontrolled state, do not set value
(or equivalent), at creation. From this
point on, Enact will manage the state and events will be sent when the state is updated. To
specify an initial value, use the defaultValue
(or, defaultSelected,
defaultOpen, etc.)
property. See the documentation for individual components for more information.
Additionally, we no longer export a version
with the root import. If you need a version number, import from package.json
instead.
Added
moonstone/Button
property icon
to support a built-in icon next to the text content. The Icon supports everything that moonstone/Icon
supports, as well as a custom icon.moonstone/MoonstoneDecorator
property textSize
to resize several components to requested CMR sizes. Simply add textSize="large"
to your App
and the new sizes will automatically take effect.ui/Placeholder
module with PlaceholderControllerDecorator
and PlaceholderDecorator
HOCs which facilitate rendering placeholder components until the wrapped component would scroll into the viewport
Changed
i18n
iLib dependency to 20151019-build-12.0-002-04moonstone/Slider
to use the property tooltip
instead of noTooltip
, so the built-in tooltip is not enabled by defaultmoonstone/IncrementSlider
to include tooltip documentationmoonstone/ExpandableList
to accept an array of objects as children which are spread onto the generated componentsmoonstone/CheckboxItem
style to match the latest designs, with support for the moonstone/Checkbox
to be on either the left or the right side by using the iconPosition
propertymoonstone/VideoPlayer
to supply every event callback-method with an object representing the VideoPlayer's current state, including: currentTime
, duration
, paused
, proportionLoaded
, and proportionPlayed
ui/Repeater
to accept an array of objects as children which are spread onto the generated components
Fixed
moonstone/Panels.Panel
behavior for remembering focus on unmount and setting focus after rendermoonstone/VirtualList.VirtualGridList
showing empty items when items are continuously added dynamicallymoonstone/Picker
to marquee on focus once againspotlight/Spotlight
set()
to properly update the container configspotlight/Spotlight
to properly save the last-focused element for nested containers