@newlogic-digital/stimulus-components 0.0.10 → 1.0.0-rc.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md ADDED
@@ -0,0 +1,40 @@
1
+ # Stimulus Components
2
+
3
+ ## Info
4
+
5
+ ### ControlSelect
6
+
7
+ ```javascript
8
+ import { useStimulus } from '../../composables/stimulus.js'
9
+ import { ControlSelect } from '@newlogic-digital/stimulus-components'
10
+
11
+ useStimulus.register('x-control-select', ControlSelect)
12
+ ```
13
+
14
+ ### CookieConsent
15
+
16
+ ```javascript
17
+ import { useStimulus } from '../../composables/stimulus.js'
18
+ import { CookieConsentDialog, CookieConsentForm } from '@newlogic-digital/stimulus-components'
19
+
20
+ useStimulus.register('x-cookieconsent-dialog', CookieConsentDialog)
21
+ useStimulus.register('x-cookieconsent-form', CookieConsentForm)
22
+ ```
23
+
24
+ ### ReCaptcha
25
+
26
+ ```javascript
27
+ import { useStimulus } from '../composables/stimulus.js'
28
+ import { ReCaptcha } from '@newlogic-digital/stimulus-components'
29
+
30
+ useStimulus.register('x-recaptcha', ReCaptcha)
31
+ ```
32
+
33
+ ### Reveal
34
+
35
+ ```javascript
36
+ import { useStimulus } from '../composables/stimulus.js'
37
+ import { Reveal } from '@newlogic-digital/stimulus-components'
38
+
39
+ useStimulus.register('x-reveal', Reveal)
40
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@newlogic-digital/stimulus-components",
3
- "version": "0.0.10",
3
+ "version": "1.0.0-rc.1",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "eslint": "eslint '**/*.js'",
@@ -9,19 +9,20 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@hotwired/stimulus": "^3.2.2",
12
- "@newlogic-digital/utils-js": "^1.1.0"
12
+ "@newlogic-digital/utils-js": "^1.1.1"
13
13
  },
14
14
  "devDependencies": {
15
- "eslint": "^9.7.0",
15
+ "eslint": "^9.19.0",
16
16
  "@types/grecaptcha": "^3.0.9",
17
- "neostandard": "^0.11.1",
18
- "@newlogic-digital/cookieconsent-js": "^0.2.2",
19
- "winduum": "^2.0.0-next.15"
17
+ "neostandard": "^0.12.0",
18
+ "@newlogic-digital/cookieconsent-js": "^1.0.0",
19
+ "winduum": "^2.1.0"
20
20
  },
21
21
  "files": [
22
22
  "src"
23
23
  ],
24
24
  "exports": {
25
+ ".": "./index.js",
25
26
  "./src/*": "./src/*"
26
27
  },
27
28
  "repository": {
@@ -17,6 +17,12 @@ export class ControlSelect extends Controller {
17
17
  }
18
18
  }
19
19
 
20
+ /**
21
+ * @method choose
22
+ * @param {CustomEvent} event
23
+ * @param {HTMLElement} event.currentTarget
24
+ * @returns {void}
25
+ */
20
26
  choose({ currentTarget }) {
21
27
  this.select.value = currentTarget.dataset.option
22
28
  dispatchCustomEvent(this.select)
package/src/index.js ADDED
@@ -0,0 +1,6 @@
1
+ import { ControlSelect } from './control-select/index.js'
2
+ import { CookieConsentDialog, CookieConsentForm } from './cookieconsent/index.js'
3
+ import { ReCaptcha } from './recaptcha/index.js'
4
+ import { Reveal } from './reveal/index.js'
5
+
6
+ export { ControlSelect, CookieConsentDialog, CookieConsentForm, ReCaptcha, Reveal }
@@ -18,7 +18,7 @@ export class ReCaptcha extends Controller {
18
18
  if (event?.detail?.recaptchaExecuted) return
19
19
 
20
20
  window.grecaptcha.enterprise.ready(async () => {
21
- this.element.gtoken.value = window.grecaptcha.enterprise.execute(this.apiValue, { action: this.actionValue ?? 'form' })
21
+ this.element.gtoken.value = await window.grecaptcha.enterprise.execute(this.apiValue, { action: this.actionValue ?? 'form' })
22
22
  this.element.dispatchEvent(new CustomEvent('submit', { cancelable: true, detail: { recaptchaExecuted: true } }))
23
23
  })
24
24
  }