pwix:ui-utils

v1.6.0Published last week

pwix:ui-utils

What is it ?

A Meteor package to gather our UI styling utilities while keeping it as light as possible, so that any package can safely use this one without pulling too many unused garbage.

Installation

This Meteor package is installable with the usual command:

    meteor add pwix:ui-utils
    meteor npm install ellipsize lodash --save

Usage

Nothing to do: the stylesheets are automatically made available to the client.

Provides

UIUtils

The exported UIUtils global object provides following items:

Functions

UIUtils.DOM.waitFor( selector, opts )

Returns a Promise which will eventually resolve when the selector be DOM-ready.

opts is an optional options object with following keys:

  • timeout, defaulting to 1000 ms

  • root, the root of the search, defaulting to document.body

  • signal, an AbortController signal, defaulting to null

    Usage of the signal is, for example:

1    const controller = new AbortController();
2
3    try {
4        const el = await waitFor( '.my-selector', {
5            timeout: 5000,
6            signal: controller.signal
7        });
8    } catch( e ){
9        console.error( e );
10    }
11
12    // and later
13    controller.abort();

LESS Stylesheets

The package provides a stylesheet to be imported in your application's main.less as:

    @import '{pwix:ui-utils}/exports/stylesheets.less';

CSS positioning

mixins

Configuration

None at the moment.

NPM peer dependencies

Starting with v 0.1.0, and in accordance with advices from the Meteor Guide, we no more hardcode NPM dependencies in the Npm.depends clause of the package.js.

Instead we check npm versions of installed packages at runtime, on server startup, in development environment.

Dependencies as of v 1.6.0:

1    'ellipsize': '^0.5.1',
2    'lodash': '^4.17.0'

Translations

None at the moment.

Cookies and comparable technologies

None at the moment.

Issues & help

In case of support or error, please report your issue request to our Issues tracker.


P. Wieser

  • Last updated on 2026, Apr. 2nd