Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
semantic-ui-ember
Advanced tools
We have ported our internal Ember Semantic-UI components for an official Semantic-UI integration. The code was original built for CrowdOx and later SpruceMail. This is officially in Alpha. We would appreciate any feedback that you might have.
We feel that the Semantic-UI-Ember project should be an extension of Semantic-UI and not a complete rewrite. With that in mind, we will only be creating components to extend Semantic-UI modules, all other uses of Semantic-UI in your project should follow the official documentation.
As mentioned our goal is to let Semantic do most of the work and we will simply maintain small bits of code to make it native for Ember. We will release when there are new components or incompatibilities but otherwise the same version should continue to work.
Include the library as an NPM dependency, from within an ember-cli app.
ember install:addon semantic-ui-ember
Before 1.5
npm install --save-dev Semantic-Org/Semantic-UI-Ember
Run the library's blueprint to pull in its Bower dependencies. This only needs to be done once.
ember generate semantic-ui-ember
ui accordion
ui-accordion
Replace <div class="ui accordion">
with {{#ui-accordion}}
and fill the inside content with standard Semantic-UI.
{{#ui-accordion}}
<div class="title">
Semantic UI
</div>
<div class="content">
Accordion Component
</div>
{{/ui-accordion}}
Variations can be used with {{#ui-accordion class="styled"}}
.
{{#ui-accordion class="styled"}}
<div class="active title">
<i class="dropdown icon"></i>
What is a dog?
</div>
<div class="active content">
<p>A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
What kinds of dogs are there?
</div>
<div class="content">
<p>There are many breeds of dogs. Each breed varies in size and temperament. Owners often select a breed of dog that they find to be compatible with their own lifestyle and desires from a companion.</p>
</div>
<div class="title">
<i class="dropdown icon"></i>
How do you acquire a dog?
</div>
<div class="content">
<p>Three common ways for a prospective owner to acquire a dog is from pet shops, private owners, or shelters.</p>
<p>A pet shop may be the most convenient way to buy a dog. Buying a dog from a private owner allows you to assess the pedigree and upbringing of your dog before choosing to take it home. Lastly, finding your dog from a shelter, helps give a good home to a dog who may not find one so readily.</p>
</div>
{{/ui-accordion}}
ui checkbox
ui-checkbox
Replace <div class="ui checkbox">
with {{ui-checkbox}}
and bind to a property on your model/controller/component.
export default Ember.Controller.extend({
havingFun: false
});
{{ui-checkbox checked=havingFun}}
ui radio
ui-radio
Replace <div class="ui radio">
with {{ui-radio}}
and bind to a property on your model/controller/component.
export default Ember.Controller.extend({
fruit: null
});
<div class="ui form">
<div class="grouped inline fields">
<div class="field">
{{ui-radio name="fruit" label="Once a week" value="apple" current=fruit}}
</div>
<div class="field">
{{ui-radio name="fruit" label="2-3 times a week" value="orange" current=fruit}}
</div>
<div class="field">
{{ui-radio name="fruit" label="Once a day" value="grape" current=fruit}}
</div>
</div>
</div>
There isn't a corresponding Ember component for this since it isn't rendered to the screen but instead invoked.
ui dropdown
ui-dropdown
optionValuePath
dropdown
content
content
Replace <div class="ui dropdown">
with {{ui-dropdown}}
and bind to a list and set a bound property.
export default Ember.Controller.extend({
itemActions: [ "Edit", "Remove", "Hide"],
selectedAction: null
});
{{ui-dropdown
content=itemActions
value=selectedAction
prompt="Select"
}}
ui modal
ui-modal
In order to use the modal you must first prepare your Ember application for modals. This follows the same instructions found on ember.js.
You must add the modal
outlet to the main application layout
{{outlet}}
{{outlet 'modal'}}
This provides the openModal
and closeModal
actions that allows modals to be opened from any controller.
import SemanticModalMixin from 'semantic-ui-ember/mixins/modal';
var ApplicationRoute = Ember.Route.extend(SemanticModalMixin, {});
Now to use the modal the bare minimum is to create a template and trigger openModal
.
<div class="ui modal">
<i class="close icon"></i>
<div class="header">
Demo Modal
</div>
<div class="content">
Content
</div>
<div class="actions">
<div class="ui black button">
Cancel
</div>
<div class="ui positive right labeled icon button">
Ok
<i class="checkmark icon"></i>
</div>
</div>
</div>
Then you can fire openModal
from any controller
export default Ember.Controller.extend({
actions: {
confirm: function() {
this.send('openModal', 'projects/confirm');
}
}
});
If you want to send a model in just use the third parameter
export default Ember.Controller.extend({
actions: {
confirm: function() {
this.send('openModal', 'projects/confirm', this.get('model'));
}
}
});
If a controller is found with the same name as the template it will be used. You can also use your own view if necessary. You just need to make sure to inherit from the base class.
import Ember from 'ember';
import SemanticModalView from 'semantic-ui-ember/views/ui-modal';
export default SemanticModalView.extend({
templateName: 'shared/modal'
})
ui popup
ui-popup
Replace <div class="ui popup">
with {{ui-popup}}
and fill the inside content with standard Semantic-UI.
{{ui-popup content="The text you'd like to show"}}
You can also create an icon version by specifying the tagName
{{ui-popup tagName="i" class="icon link" content="The text you'd like to show"}}
ui rating
NOT IMPLEMENTED
ui shape
NOT IMPLEMENTED
ui sidebar
NOT IMPLEMENTED
ui sidebar
There isn't a cooresponding Ember component for this since it isn't rendered to the screen but instead invoked.
FAQs
The Official Semantic UI Addon for Ember applications
The npm package semantic-ui-ember receives a total of 1,118 weekly downloads. As such, semantic-ui-ember popularity was classified as popular.
We found that semantic-ui-ember demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.