How to use the @cycle/dom.input function in @cycle/dom

To help you get started, we’ve selected a few @cycle/dom 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 ivan-kleshnin / cyclejs-examples / 3.0-crud / src / pages / user.edit.js View on Github external
div(".form-element", [
          label({htmlFor: "email"}, "Email:"),
          br(),
          input("#email", {type: "text", value: formatString(user.email), readOnly: true}),
          p(errors.email),
        ]),
        div(".form-element", [
          label({htmlFor: "points"}, "Points:"),
          br(),
          input("#points", {type: "text", value: formatInteger(form.points), autocomplete: "off"}),
          p(errors.points),
        ]),
        div(".form-element", [
          label({htmlFor: "bonus"}, "Bonus:"),
          br(),
          input("#bonus", {type: "text", value: formatInteger(form.bonus), autocomplete: "off"}),
          p(errors.bonus),
        ]),
        button("#submit.form-element", {type: "submit", disabled: !model}, "Edit"),
      ])
    }
  )
github cyclejs / cyclejs / examples / intermediate / bmi-typescript / src / LabeledSlider.ts View on Github external
.map(([props, value]) =>
      div('.labeled-slider', [
        span('.label', [ props.label + ' ' + value + props.unit ]),
        input('.slider', {
          attrs: {type: 'range', min: props.min, max: props.max, value: value}
        }),
      ]),
    );
github wizardwerdna / FRPBowlingKata / src / view.ts View on Github external
function vInput() {
  return div('#input', [
    label('.playerLabel', 'New Player:'),
    input('.name', {
      props: {type: 'text', autofocus: true},
      hook: {
        update: (oldvNode, {elm}) => elm.value = ''
      }
    })
  ]);
}
github milankinen / stanga / examples / 08-todomvc / components / Header.js View on Github external
DOM: O.merge(intents.reset$, intents.create$, O.just()).map(() =>
      header(".header", [
        h1("todos"),
        input(".new-todo", {
          type: "text",
          value: "",
          attributes: {placeholder: "What needs to be done?"},
          autofocus: true,
          name: "newTodo"
        })
      ]))
  }
github cyclejs-community / cycle-webworker / example / index.ts View on Github external
DOM: xs.combine(result$, number$, calculating$).map(([result, number, calculating]) =>
      div('.example', [
        input('.number', { attrs: { type: 'range', min: 1, max: 40, value: 1 } }),

        div('.result', [
          `Fibonacci number ${number}: ${calculating ? 'Calculating...' : result}`
        ])
      ])
    ),
github laszlokorte / tams-tools / app / components / logic / panels / save / view.js View on Github external
const render = ({table, formula, tree}) => div([
  h1('.modal-box-title', 'Export...'),
  h3('ASCII Table'),
  div([
    textarea('.export-text', {
      attributes: {readonly: true},
    }, table ? table.toString() : ''),
  ]),
  h3('Formula'),
  div([
    input('.export-text-single', {
      attributes: {readonly: true},
      value: formula,
    }),
  ]),
  h3('LaTeX Forest Tree'),
  div([
    input('.export-text-single', {
      attributes: {readonly: true},
      value: tree,
    }),
  ]),
])
;
github raquelxmoss / cycle-color-picker / src / view.js View on Github external
function renderHexInputElement (color) {
  return input('.hex-input', {props: {type: 'text', value: color}});
}
github raquelxmoss / cycle-color-picker / src / view.js View on Github external
function renderHexInputElement (color) {
  return input('.hex-input', {props: {type: 'text', value: color}});
}