Skip to content

v1.0.0-alpha.5

Pre-release
Pre-release
Compare
Choose a tag to compare
@titouanmathis titouanmathis released this 16 Jul 21:46
· 2033 commits to master since this release

Changed

Folder tree

The folder tree has been updated for a more robust and more logical structure (32dc7ed):

  • ./abstracts/ β†’ does not change
  • ./components/ β†’ does not change
  • ./services/ β†’ does not change
  • ./math/ β†’ moved to utils/math/
  • ./utils/ β†’ does not change, but its files are grouped by subject in folders : css, math and object

Added

Base class

  • The Base class $refs, $chilren and $options props are now getters, and event are emitted when they are accessed, following the format get:...
  • Autbinding of event listeners to refs (df9fc0d, #22):
    • The onClick(event) method will be triggered when clicking on this.$el
    • The onFooClick(event, index) method will be triggered when clicking on any of this.$refs.foo
  • Add the possibility to use async components as children (7c32b72, #21)
  • Refs are now resolved more strictly and their naming convention have been simplified as the component's name is not required anymore:
<!-- Foo.$el -->
<div data-component="Foo"> 
  <!-- Foo.$refs.bar -->
  <div data-ref="bar"></div>
  <!-- Baz.$el === Foo.$refs.baz -->
  <div data-component="Baz" data-ref="baz">
      <!-- Baz.$refs.bar -->
      <div data-ref="bar"></div>
  </div>
</div>

Components

  • Add a MediaQuery component (659ebeb)
  • Add an Accordion component (dfe2ec5)

Utils

  • The nextFrame function is now async (1fb1fe0):
// Callback usage
nextFrame(() => doSomething());

// Async usage
await nextFrame();
doSomething();
  • Add CSS utilities
    • ./utils/css/classes.js exports methods to add, remove or toggle classes
    • ./utils/css/styles.js exports methods to add or remove styles
    • ./utils/css/transition.js exports a function to manage CSS transition Γ  la Vue.js (with from, active and to states) (1e89224):
import transition from '@studiometa/js-toolkit/utils/css/transition';

transition(document.body, {
  from: 'opacity-0',
  active: 'transition duration-200',
});
  • Add and regroup object utilities
    • Move the object utilities to the ./utils/object folder
    • Replace the auto-bind package with a local version for easier reuse
    • Add a getAllProperties method to get all the inherited properties of an object

Misc.

  • Use @studiometa/browserslist-config (b89678c, #15)

Fixed

  • Fix the pointer service debounced call (d9215b9)
  • Fix the pointer service starting state (697a570)
  • Rename the EventManager class private properties to follow best practices (db14065)
  • Fix the transition for the Modal component (f2e0b79)
  • Fix the transition for the Tabs component (8765942)