Sha256: d5df8693283a02cc9d7216fcc1bb95748b6027c3dd5f60d76b270d88d4decd01

Contents?: true

Size: 1.26 KB

Versions: 5

Compression:

Stored size: 1.26 KB

Contents

// This code was heavily inspired by the rails-ujs project.
// Copyright (c) 2007-2021 Rails Core team.
export const buttonClickSelector = {
  selector: "sl-button[data-remote]:not([form]), sl-button[data-confirm]:not([form])",
  exclude: "sl-form sl-button",
}

export const formSubmitSelector = "sl-form[data-remote]"

export const formInputClickSelector = [
  "sl-form sl-button[submit]",
  "sl-form sl-button:not([type])",
  "sl-button[submit][sl-form]",
  "sl-button[sl-form]:not([type])",
].join(", ")

export const formDisableSelector = [
  "sl-input[data-disable-with]:not([disabled])",
  "sl-button[data-disable-with]:not([disabled])",
  "sl-textarea[data-disable-with]:not([disabled])",
  "sl-input[data-disable]:not([disabled])",
  "sl-button[data-disable]:not([disabled])",
  "sl-textarea[data-disable]:not([disabled])",
].join(", ")

export const formEnableSelector = [
  "sl-input[data-disable-with][disabled]",
  "sl-button[data-disable-with][disabled]",
  "sl-textarea[data-disable-with][disabled]",
  "sl-input[data-disable][disabled]",
  "sl-button[data-disable][disabled]",
  "sl-textarea[data-disable][disabled]",
].join(", ")

export const buttonDisableSelector = [
  "sl-button[data-remote][data-disable-with]",
  "sl-button[data-remote][data-disable]",
].join(", ")

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
shoelace-rails-0.4.1 src/turbolinks/selectors.ts
shoelace-rails-0.4.0 src/turbolinks/selectors.ts
shoelace-rails-0.3.0 src/turbolinks/selectors.ts
shoelace-rails-0.2.0 src/turbolinks/selectors.ts
shoelace-rails-0.1.0 src/turbolinks/selectors.ts