@ionic/core 8.4.1-dev.11732734107.1ad7a02d → 8.4.1-dev.11732743645.19f772f4

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/hydrate/index.js CHANGED
@@ -9223,6 +9223,7 @@ const startFocusVisible = (rootEl) => {
9223
9223
  const ref = rootEl ? rootEl.shadowRoot : document;
9224
9224
  const root = rootEl ? rootEl : document.body;
9225
9225
  const setFocus = (elements) => {
9226
+ console.log('setFocus', elements, currentFocus);
9226
9227
  currentFocus.forEach((el) => el.classList.remove(ION_FOCUSED));
9227
9228
  elements.forEach((el) => el.classList.add(ION_FOCUSED));
9228
9229
  currentFocus = elements;
@@ -9243,8 +9244,9 @@ const startFocusVisible = (rootEl) => {
9243
9244
  };
9244
9245
  const onFocusin = (ev) => {
9245
9246
  console.log('onFocusin', ev);
9247
+ let toFocus = [];
9246
9248
  if (keyboardMode && ev.composedPath !== undefined) {
9247
- const toFocus = ev.composedPath().filter((el) => {
9249
+ toFocus = ev.composedPath().filter((el) => {
9248
9250
  // TODO(FW-2832): type
9249
9251
  if (el.classList) {
9250
9252
  return el.classList.contains(ION_FOCUSABLE);
@@ -9253,9 +9255,12 @@ const startFocusVisible = (rootEl) => {
9253
9255
  });
9254
9256
  setFocus(toFocus);
9255
9257
  }
9256
- keyboardMode = true;
9258
+ if (toFocus.length > 0) {
9259
+ keyboardMode = true;
9260
+ }
9257
9261
  };
9258
9262
  const onFocusout = () => {
9263
+ console.log('onFocusout');
9259
9264
  if (ref.activeElement === root) {
9260
9265
  setFocus([]);
9261
9266
  }
package/hydrate/index.mjs CHANGED
@@ -9219,6 +9219,7 @@ const startFocusVisible = (rootEl) => {
9219
9219
  const ref = rootEl ? rootEl.shadowRoot : document;
9220
9220
  const root = rootEl ? rootEl : document.body;
9221
9221
  const setFocus = (elements) => {
9222
+ console.log('setFocus', elements, currentFocus);
9222
9223
  currentFocus.forEach((el) => el.classList.remove(ION_FOCUSED));
9223
9224
  elements.forEach((el) => el.classList.add(ION_FOCUSED));
9224
9225
  currentFocus = elements;
@@ -9239,8 +9240,9 @@ const startFocusVisible = (rootEl) => {
9239
9240
  };
9240
9241
  const onFocusin = (ev) => {
9241
9242
  console.log('onFocusin', ev);
9243
+ let toFocus = [];
9242
9244
  if (keyboardMode && ev.composedPath !== undefined) {
9243
- const toFocus = ev.composedPath().filter((el) => {
9245
+ toFocus = ev.composedPath().filter((el) => {
9244
9246
  // TODO(FW-2832): type
9245
9247
  if (el.classList) {
9246
9248
  return el.classList.contains(ION_FOCUSABLE);
@@ -9249,9 +9251,12 @@ const startFocusVisible = (rootEl) => {
9249
9251
  });
9250
9252
  setFocus(toFocus);
9251
9253
  }
9252
- keyboardMode = true;
9254
+ if (toFocus.length > 0) {
9255
+ keyboardMode = true;
9256
+ }
9253
9257
  };
9254
9258
  const onFocusout = () => {
9259
+ console.log('onFocusout');
9255
9260
  if (ref.activeElement === root) {
9256
9261
  setFocus([]);
9257
9262
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ionic/core",
3
- "version": "8.4.1-dev.11732734107.1ad7a02d",
3
+ "version": "8.4.1-dev.11732743645.19f772f4",
4
4
  "description": "Base components for Ionic",
5
5
  "keywords": [
6
6
  "ionic",
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- var ION_FOCUSED="ion-focused";var ION_FOCUSABLE="ion-focusable";var FOCUS_KEYS=["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp","Home","End","Meta"];var startFocusVisible=function(o){var n=[];var r=true;var t=o?o.shadowRoot:document;var e=o?o:document.body;var u=function(o){n.forEach((function(o){return o.classList.remove(ION_FOCUSED)}));o.forEach((function(o){return o.classList.add(ION_FOCUSED)}));n=o};var c=function(o){console.log("pointerDown",o);r=false;u([])};var i=function(o){console.log("onKeydown",o);r=FOCUS_KEYS.includes(o.key);if(!r){u([])}};var s=function(o){console.log("onFocusin",o);if(r&&o.composedPath!==undefined){var n=o.composedPath().filter((function(o){if(o.classList){return o.classList.contains(ION_FOCUSABLE)}return false}));u(n)}r=true};var a=function(){if(t.activeElement===e){u([])}};t.addEventListener("keydown",i);t.addEventListener("focusin",s);t.addEventListener("focusout",a);t.addEventListener("touchstart",c,{passive:true});t.addEventListener("mousedown",c);var f=function(){t.removeEventListener("keydown",i);t.removeEventListener("focusin",s);t.removeEventListener("focusout",a);t.removeEventListener("touchstart",c);t.removeEventListener("mousedown",c)};return{destroy:f,setFocus:u}};export{startFocusVisible};
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- System.register([],(function(n){"use strict";return{execute:function(){var o="ion-focused";var r="ion-focusable";var t=["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp","Home","End","Meta"];var e=n("startFocusVisible",(function(n){var e=[];var u=true;var c=n?n.shadowRoot:document;var i=n?n:document.body;var s=function(n){e.forEach((function(n){return n.classList.remove(o)}));n.forEach((function(n){return n.classList.add(o)}));e=n};var f=function(n){console.log("pointerDown",n);u=false;s([])};var a=function(n){console.log("onKeydown",n);u=t.includes(n.key);if(!u){s([])}};var v=function(n){console.log("onFocusin",n);if(u&&n.composedPath!==undefined){var o=n.composedPath().filter((function(n){if(n.classList){return n.classList.contains(r)}return false}));s(o)}u=true};var d=function(){if(c.activeElement===i){s([])}};c.addEventListener("keydown",a);c.addEventListener("focusin",v);c.addEventListener("focusout",d);c.addEventListener("touchstart",f,{passive:true});c.addEventListener("mousedown",f);var w=function(){c.removeEventListener("keydown",a);c.removeEventListener("focusin",v);c.removeEventListener("focusout",d);c.removeEventListener("touchstart",f);c.removeEventListener("mousedown",f)};return{destroy:w,setFocus:s}}))}}}));
@@ -1,4 +0,0 @@
1
- /*!
2
- * (C) Ionic http://ionicframework.com - MIT License
3
- */
4
- const o="ion-focused",n=["Tab","ArrowDown","Space","Escape"," ","Shift","Enter","ArrowLeft","ArrowRight","ArrowUp","Home","End","Meta"],e=e=>{let t=[],s=!0;const c=e?e.shadowRoot:document,u=e||document.body,r=n=>{t.forEach((n=>n.classList.remove(o))),n.forEach((n=>n.classList.add(o))),t=n},d=o=>{console.log("pointerDown",o),s=!1,r([])},i=o=>{console.log("onKeydown",o),s=n.includes(o.key),s||r([])},w=o=>{if(console.log("onFocusin",o),s&&void 0!==o.composedPath){const n=o.composedPath().filter((o=>!!o.classList&&o.classList.contains("ion-focusable")));r(n)}s=!0},f=()=>{c.activeElement===u&&r([])};return c.addEventListener("keydown",i),c.addEventListener("focusin",w),c.addEventListener("focusout",f),c.addEventListener("touchstart",d,{passive:!0}),c.addEventListener("mousedown",d),{destroy:()=>{c.removeEventListener("keydown",i),c.removeEventListener("focusin",w),c.removeEventListener("focusout",f),c.removeEventListener("touchstart",d),c.removeEventListener("mousedown",d)},setFocus:r}};export{e as startFocusVisible}