How to use uno-js - 6 common examples

To help you get started, we’ve selected a few uno-js examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github unosquare / uno-material-ui / src / TextValidator.tsx View on Github external
validators,
            requiredError,
            helperText,
            validatorListener,
            withRequiredValidator,
            label,
            id,
            ...rest
        } = this.props;
        const { isValid } = this.state;

        return (
            
        );
    }
}
github unosquare / tubular-react / src / DataGrid / DataGridCard.tsx View on Github external
{columns.map((column: ColumnModel, index: number) => (
                    <div>
                        
                            {humanize(column.Name)}:
                        
                        
                            {columnRender(column, item)}
                        
                    </div>
                ))}
github unosquare / uno-react / src / hooks / useResolutionSwitch.ts View on Github external
export const useResolutionSwitch = (outerWidth = 1000, timeout = 500): [boolean] =&gt; {
    const [isMobileResolution, setMobileResolution] = React.useState(false);
    const handleResolutionChange = (): void =&gt; setMobileResolution(window.outerWidth &lt; outerWidth);

    const listener = debounce(handleResolutionChange, timeout);

    React.useEffect(() =&gt; {
        window.addEventListener('resize', listener);
        handleResolutionChange();

        return (): void =&gt; window.removeEventListener('resize', listener);
    }, []);

    return [isMobileResolution];
};
github unosquare / uno-react / lib / hooks / useResolutionSwitch.js View on Github external
exports.useResolutionSwitch = function (outerWidth, timeout) {
    if (outerWidth === void 0) { outerWidth = 1000; }
    if (timeout === void 0) { timeout = 500; }
    var _a = React.useState(false), isMobileResolution = _a[0], setMobileResolution = _a[1];
    var handleResolutionChange = function () { return setMobileResolution(window.outerWidth &lt; outerWidth); };
    var listener = uno_js_1.debounce(handleResolutionChange, timeout);
    React.useEffect(function () {
        window.addEventListener('resize', listener);
        handleResolutionChange();
        return function () { return window.removeEventListener('resize', listener); };
    }, []);
    return [isMobileResolution];
};
github unosquare / uno-material-ui / dist / SnackbarService.js View on Github external
var _this = this;
        if (type === void 0) { type = 'success'; }
        return new Promise(function () {
            _this.snackbar = {
                isMobile: false,
                message: {
                    messageText: message,
                    messageType: type,
                },
                seconds: 5000,
            };
            _this.inform();
        });
    };
    return SnackbarService;
}(uno_js_1.SimpleObservable));
exports.snackbarService = new SnackbarService();
//# sourceMappingURL=SnackbarService.js.map

uno-js

JS/TS common used functions, zero dependencies

MIT
Latest version published 7 days ago

Package Health Score

75 / 100
Full package analysis