How to use hornet-js-utils - 10 common examples

To help you get started, we’ve selected a few hornet-js-utils 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 diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-filters.jsx View on Github external
var TableStore = require("src/table/store/table-store");

var TableActions = require("src/table/actions/table-actions");

var DatePickerField = require("src/calendar/date-picker-field");

var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");

// Composants de formulaire
var newforms = require("newforms");
var Form = require("src/form/form");
var GridForm = require("src/form/grid-form");
var Row = GridForm.Row;
var Field = GridForm.Field;

var logger = utils.getLogger("hornet-js-components.table.table-filters");
var _ = utils._;

var TableFilters = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: ({
        tableName: React.PropTypes.string,
        columns: React.PropTypes.shape({
            title: React.PropTypes.oneOfType([
                React.PropTypes.string,
                React.PropTypes.object
            ]),
            sort: React.PropTypes.oneOfType([
                React.PropTypes.string,
                React.PropTypes.object
            ]),
github diplomatiegouvfr / hornet-js / hornet-js-components / src / calendar / date-picker-field.jsx View on Github external
"use strict";
var newforms = require("newforms");
var validators = require("validators");
var DatePickerInput = require("src/calendar/date-picker-input");
var utils = require("hornet-js-utils");

var logger = utils.getLogger("hornet-js-component.calendar.date-picker-field");

/*
 Création d"un nouveau composant héritant du Widget Date et ajoutant un bouton pour afficher le calendrier
 Le nouveau widget est ensuite ajouté au Field
 */
var DatePickerField = newforms.DateField.extend({
    constructor(kwargs) {
        logger.trace("Construction DatePickerField. kwargs : ", kwargs);
        if (!(this instanceof DatePickerField)) {
            return new DatePickerField(kwargs);
        }
        kwargs.controlled = true;

        var widgetArgs = {attrs: {}};

        // Si un ou plusieurs formats d'entrée sont spécifiés pour le champ, on utilise le premier pour le rendu dans le widget
github diplomatiegouvfr / hornet-js / hornet-js-components / src / form / grid-form.jsx View on Github external
"use strict";

var utils = require("hornet-js-utils");
var React = require("react/addons");
var newforms = require("newforms");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");
var ToolTip = require("hornet-js-components/src/tool-tip/tool-tip");
var classNames = require("classnames");
var ReadOnlyWidget = require("src/form/read-only-widget");

var logger = utils.getLogger("hornet-js-components.form.grid-form");

var newFormsPropType = React.PropTypes.oneOfType([      // Form instance or constructor
    React.PropTypes.func,
    React.PropTypes.instanceOf(newforms.Form)
]);

var GridForm = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: {
        children: React.PropTypes.oneOfType([
            React.PropTypes.object,
            React.PropTypes.array
        ]),
        classNames: React.PropTypes.string,
        context: React.PropTypes.object,
github diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-tools-action-add.jsx View on Github external
"use strict";

var React = require("react")
var utils = require("hornet-js-utils");
var Icon = require("src/icon/icon");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");

var logger = utils.getLogger("hornet-js-components.table.table-tools-action-add");

var TableToolsActionAdd = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: {
        options: React.PropTypes.object,
        routes: React.PropTypes.object,
        actions: React.PropTypes.object,
        messages: React.PropTypes.object,
        classAction: React.PropTypes.string,

        enabled: React.PropTypes.bool,
        icoAjouter: React.PropTypes.string,
        imgFilePath: React.PropTypes.string,
        tableName: React.PropTypes.string.isRequired,
        pagination: React.PropTypes.object,
github diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-header-column.jsx View on Github external
"use strict";
var utils = require("hornet-js-utils");
var React = require("react");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");
var classNames = require("classnames");

var _ = utils._;

var logger = utils.getLogger("hornet-js-components.table.table-header-column");

var orderAsc = "ASC";
var orderDesc = "DESC";

var TableHeaderColumn = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: ({
        tableName: React.PropTypes.string,

        columnName: React.PropTypes.string,
        column: React.PropTypes.shape({
            title: React.PropTypes.oneOfType([
                React.PropTypes.string,
                React.PropTypes.object
            ]),
github diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-tools-action-export-button.jsx View on Github external
"use strict";

var React = require("react")
var utils = require("hornet-js-utils");
var Icon = require("src/icon/icon");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");

var logger = utils.getLogger("hornet-js-components.table.table-tools-action-export-button");

var TableToolsActionExportButton = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: {
        tableName: React.PropTypes.string.isRequired,
        routes: React.PropTypes.object,
        actions: React.PropTypes.object,
        messages: React.PropTypes.object,
        classExportButton: React.PropTypes.string,

        enabled: React.PropTypes.bool,
        icoExport: React.PropTypes.string,

        mediaType: React.PropTypes.string,
        mediaTypeTitle: React.PropTypes.string,
github diplomatiegouvfr / hornet-js / hornet-js-components / src / auto-complete / auto-complete.jsx View on Github external
"use strict";
var newforms = require("newforms");
var utils = require("hornet-js-utils");
var React = require("react");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");
var AutoCompleteSelector = require("src/auto-complete/auto-complete-selector");

var _ = utils._;
var keyEvent = utils.keyEvent;
var logger = utils.getLogger("hornet-js-components.auto-complete.auto-complete");

var HIDDEN_INPUT_FIELD_REF = "AutoComplete#InputField";

var AutoComplete = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: {
        onUserInputChange: React.PropTypes.func.isRequired,
        sourceStore: function (props, propName) {
            var store = props[propName];
            if (!store) {
                return new Error("The sourceStore must be provided ");
            }

            if (!store.class || !store.functionName || !_.isFunction(store.class.prototype[store.functionName])) {
                return new Error("The sourceStore must provide a class and method \"" + store.functionName + "\" ");
github diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-tools-action-mass.jsx View on Github external
"use strict";

var React = require("react")
var utils = require("hornet-js-utils");
var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");

var logger = utils.getLogger("hornet-js-components.table.table-tools-action-mass");

var TableToolsActionMass = React.createClass({
    mixins: [HornetComponentMixin],

    propTypes: {
        tableName: React.PropTypes.string.isRequired,
        options: React.PropTypes.object,
        routes: React.PropTypes.object,
        actions: React.PropTypes.object,
        messages: React.PropTypes.object,
        classAction: React.PropTypes.string,
        openDeleteAlert: React.PropTypes.func,
        enabled: React.PropTypes.bool,
        pagination: React.PropTypes.object,
        onchangePaginationData: React.PropTypes.func,
        /** Choix de taille de page proposés */
github diplomatiegouvfr / hornet-js / hornet-js-components / src / table / table-tools-top.jsx View on Github external
"use strict";

var React = require("react");
var utils = require("hornet-js-utils");

var TableToolsActionAdd = require("src/table/table-tools-action-add");
var TableToolsActionMass = require("src/table/table-tools-action-mass");
var TableToolsActionExport = require("src/table/table-tools-action-export");
var TableToolsActionFilter = require("src/table/table-tools-action-filter");

var HornetComponentMixin = require("hornet-js-core/src/mixins/react-mixins");

var logger = utils.getLogger("hornet-js-components.table.table-top-tools");

var TableToolsTop = React.createClass({

    mixins: [HornetComponentMixin],

    propTypes: {
        tableName: React.PropTypes.string.isRequired,
        options: React.PropTypes.object,
        routes: React.PropTypes.object,
        actions: React.PropTypes.object,
        messages: React.PropTypes.object,

        openDeleteAlert: React.PropTypes.func,

        toggleFilters: React.PropTypes.func,
        filtersVisible: React.PropTypes.bool,
github diplomatiegouvfr / hornet-js / hornet-js-components / src / upload-file / upload-file-widget.jsx View on Github external
"use strict";
var utils = require("hornet-js-utils");
var newforms = require("newforms");
var React = require("react");

var logger = utils.getLogger("hornet-js-components.upload-file.upload-file-widget");

/**
 Affiche une image et un input File, la value de cet argument est un objet de type File ou Image (Hornet).
 */
var FileWidget = newforms.ClearableFileInput.extend({
    constructor: function FileWidgetConstructor(kwargs) {
        logger.trace("Construction FileWidget");

        if (!(this instanceof FileWidget)) {
            return new FileWidget(kwargs)
        }
        newforms.Widget.call(this, kwargs)
    },

    getDefaultProps: function () {
        return {

hornet-js-utils

Partie commune et utilitaire à tous les composants hornet-js

CECILL-2.1
Latest version published 5 years ago

Package Health Score

39 / 100
Full package analysis

Popular hornet-js-utils functions

Similar packages