@eleventheye/asui 2.7.2 → 2.7.4

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.
@@ -1 +1 @@
1
- {"version":3,"file":"ASIconButton.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/ASIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAsG7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ASIconButton.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/ASIconButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAuF7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -6,7 +6,7 @@ const react_1 = require("react");
6
6
  const ASUI_types_1 = require("../apptypes/ASUI.types");
7
7
  const astheme_1 = tslib_1.__importDefault(require("../astheme"));
8
8
  const styles_1 = require("./styles");
9
- const ASIconButton = ({ className = '', onClick = () => undefined, selected = false, toggle = false, size = ASUI_types_1.ComponentSize.Medium, iconSize = size === ASUI_types_1.ComponentSize.Small ? 24 : size === ASUI_types_1.ComponentSize.Medium ? 28 : 40, paddingSize = [ASUI_types_1.ComponentSize.Medium, ASUI_types_1.ComponentSize.Medium], disabled = false, isLoading = false, icon: Icon, theme = astheme_1.default, strokeWidth = 1, strokeColor = astheme_1.default.button.buttonBg, fillColor = astheme_1.default.button.buttonColor, color = astheme_1.default.button.buttonColor, text, id, style, ...props }) => {
9
+ const ASIconButton = ({ className = '', onIconButtonTap = () => undefined, selected = false, toggle = false, size = ASUI_types_1.ComponentSize.Medium, iconSize = size === ASUI_types_1.ComponentSize.Small ? 22 : size === ASUI_types_1.ComponentSize.Medium ? 28 : 40, paddingSize = [ASUI_types_1.ComponentSize.Medium, ASUI_types_1.ComponentSize.Medium], disabled = false, isLoading = false, icon: Icon, theme = astheme_1.default, strokeWidth = 1, strokeColor = astheme_1.default.button.buttonBg, fillColor = astheme_1.default.button.buttonColor, color = astheme_1.default.button.buttonColor, text, id, style, ...props }) => {
10
10
  const tapDebounceRef = (0, react_1.useRef)('None');
11
11
  const [isSelected, setIsSelected] = (0, react_1.useState)(selected);
12
12
  (0, react_1.useEffect)(() => {
@@ -23,14 +23,14 @@ const ASIconButton = ({ className = '', onClick = () => undefined, selected = fa
23
23
  btnEl.ariaPressed = 'true';
24
24
  if (toggle)
25
25
  setIsSelected(!isSelected);
26
- onClick(e);
27
- btnEl.releasePointerCapture(e.pointerId);
28
26
  }
29
27
  };
30
28
  const onTapRelease = (e) => {
31
29
  if (tapDebounceRef.current === 'Down') {
32
30
  tapDebounceRef.current = 'Up';
33
31
  const btnEl = e.currentTarget;
32
+ onIconButtonTap(e);
33
+ btnEl.releasePointerCapture(e.pointerId);
34
34
  console.log(`%c ${tapDebounceRef.current} %c`, clsY, '');
35
35
  setTimeout(() => {
36
36
  btnEl.ariaPressed = 'false';
@@ -1,3 +1,4 @@
1
+ import { PointerEvent } from 'react';
1
2
  import { ASComponentSize, ASPaddingSize, ASTheme } from '../apptypes/ASUI.types';
2
3
  import { ASIcon, IconProps } from '../icons';
3
4
  type ASIconButtonOwnProps = {
@@ -11,6 +12,7 @@ type ASIconButtonOwnProps = {
11
12
  paddingSize?: ASPaddingSize;
12
13
  isLoading?: boolean;
13
14
  icon: typeof ASIcon;
15
+ onIconButtonTap?: (e: PointerEvent) => void;
14
16
  } & IconProps & Omit<React.HTMLProps<HTMLDivElement>, 'size'>;
15
17
  export type ASIconButtonProps = React.PropsWithChildren<ASIconButtonOwnProps>;
16
18
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"ASIconButton.types.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/ASIconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAWd,QAAQ,CAAC,EAAE,OAAO,CAAC;IASnB,MAAM,CAAC,EAAE,OAAO,CAAC;IASjB,IAAI,CAAC,EAAE,eAAe,CAAC;IAQvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,KAAK,CAAC,EAAE,OAAO,CAAC;IAOhB,WAAW,CAAC,EAAE,aAAa,CAAC;IAO5B,SAAS,CAAC,EAAE,OAAO,CAAC;IAOpB,IAAI,EAAE,OAAO,MAAM,CAAC;CACrB,GAAG,SAAS,GACX,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"ASIconButton.types.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/ASIconButton.types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjF,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE7C,KAAK,oBAAoB,GAAG;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IAMnB,IAAI,CAAC,EAAE,MAAM,CAAC;IAWd,QAAQ,CAAC,EAAE,OAAO,CAAC;IASnB,MAAM,CAAC,EAAE,OAAO,CAAC;IASjB,IAAI,CAAC,EAAE,eAAe,CAAC;IAQvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAMlB,KAAK,CAAC,EAAE,OAAO,CAAC;IAOhB,WAAW,CAAC,EAAE,aAAa,CAAC;IAO5B,SAAS,CAAC,EAAE,OAAO,CAAC;IAOpB,IAAI,EAAE,OAAO,MAAM,CAAC;IAEpB,eAAe,CAAC,EAAE,CAAC,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;CAC7C,GAAG,SAAS,GACX,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC,CAAC;AAEhD,MAAM,MAAM,iBAAiB,GAAG,KAAK,CAAC,iBAAiB,CAAC,oBAAoB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,kBAAkB;WAAuB,OAAO;UAAQ,eAAe;YA8LnF,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../src/asiconbutton/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAElE,eAAO,MAAM,kBAAkB;WAAuB,OAAO;UAAQ,eAAe;YAgMnF,CAAC"}
@@ -147,6 +147,8 @@ exports.ASIconButtonStyled = styled_components_1.default.div `
147
147
 
148
148
  &:hover:is([aria-disabled='true']),
149
149
  &:hover:not(:active):not(.Selected):is([aria-disabled='true']) {
150
+ touch-events: none;
151
+ user-select: none;
150
152
  cursor: default;
151
153
  background: ${({ theme }) => theme.button.buttonBgDisabled};
152
154
  color: transparent;
@@ -1 +1 @@
1
- {"version":3,"file":"ASNavBarMW.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/mobile/ASNavBarMW.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAM3F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOlD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAoKvC,CAAC;AAEF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ASNavBarMW.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/mobile/ASNavBarMW.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsE,MAAM,OAAO,CAAC;AAM3F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOlD,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAiKvC,CAAC;AAEF,eAAe,UAAU,CAAC"}
@@ -52,8 +52,6 @@ const ASNavBarMW = ({ id = `asnavbar-mw-${(0, uuid_1.v4)()}`, className = '', na
52
52
  onItemSelected(selected);
53
53
  }, [selected]);
54
54
  const selectPrev = (e) => {
55
- e.stopPropagation();
56
- e.preventDefault();
57
55
  if (scrollContainerRef.current) {
58
56
  const offset = scrollContainerRef.current.scrollLeft - 200;
59
57
  selectedScrolledIntoViewItem(offset);
@@ -61,8 +59,6 @@ const ASNavBarMW = ({ id = `asnavbar-mw-${(0, uuid_1.v4)()}`, className = '', na
61
59
  return false;
62
60
  };
63
61
  const selectNext = (e) => {
64
- e.stopPropagation();
65
- e.preventDefault();
66
62
  if (scrollContainerRef.current) {
67
63
  const offset = scrollContainerRef.current.scrollLeft + 200;
68
64
  selectedScrolledIntoViewItem(offset);
@@ -94,6 +90,7 @@ const ASNavBarMW = ({ id = `asnavbar-mw-${(0, uuid_1.v4)()}`, className = '', na
94
90
  }
95
91
  };
96
92
  const onButtonsPressed = (e, direction) => {
93
+ console.log(`onButtonsPressed`, e);
97
94
  if (direction === ASUI_types_1.ArrowButtonDirection.Left) {
98
95
  selectPrev(e);
99
96
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ASNavBarArrowButtons.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbararrowbuttons/ASNavBarArrowButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAGzE,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CA2BvF,CAAC;AAEF,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqBhE,CAAC;AAEF,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqBjE,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"ASNavBarArrowButtons.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbararrowbuttons/ASNavBarArrowButtons.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAgB,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAK/D,OAAO,EAAE,yBAAyB,EAAE,MAAM,8BAA8B,CAAC;AAMzE,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAAC,yBAAyB,CAAC,CA2BvF,CAAC;AAEF,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAyBhE,CAAC;AAEF,QAAA,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAyBjE,CAAC;AAEF,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,oBAAoB,IAAI,OAAO,EAAE,CAAC"}
@@ -8,16 +8,26 @@ const ASNavBar_1 = require("../../asnavbar/ASNavBar");
8
8
  const astheme_1 = tslib_1.__importDefault(require("../../astheme"));
9
9
  const icons_1 = require("../../icons");
10
10
  const styles_1 = require("./styles");
11
+ const clsY = 'background: goldenrod; color: #000000; border-radius: 10px;';
12
+ const clsG = 'background: forestgreen; color: #000000; border-radius: 10px;';
11
13
  const ASNavBarArrowButtons = ({ className = '', onArrowButtonClicked = () => undefined, selectedIndex = 0, totalItemCount = 0, size = apptypes_1.ComponentSize.Medium, styleOptions = ASNavBar_1.defaultNavBarStyleOptions, theme = astheme_1.default, }) => {
12
14
  return ((0, jsx_runtime_1.jsxs)(styles_1.ASNavBarArrowButtonsStyled, { className: `${className} ${size}`, theme: theme, styleOptions: styleOptions, children: [(0, jsx_runtime_1.jsx)(ASLeftNavBarArrowButton, { onArrowButtonClicked: onArrowButtonClicked, theme: theme, size: size, selectedIndex: selectedIndex, disabled: selectedIndex <= 0 }), (0, jsx_runtime_1.jsx)(ASRightNavBarArrowButton, { onArrowButtonClicked: onArrowButtonClicked, theme: theme, size: size, selectedIndex: selectedIndex, disabled: selectedIndex >= totalItemCount - 1 })] }));
13
15
  };
14
16
  exports.ASNavBarArrowButtons = ASNavBarArrowButtons;
15
17
  exports.default = exports.ASNavBarArrowButtons;
16
18
  const ASLeftNavBarArrowButton = ({ size = apptypes_1.ComponentSize.Medium, theme = astheme_1.default, disabled = false, onArrowButtonClicked = () => undefined, }) => {
17
- return ((0, jsx_runtime_1.jsx)(styles_1.ASIconButtonLeftStyled, { role: "button", icon: icons_1.ArrowLeftIcon, onPointerDown: (e) => onArrowButtonClicked(e, apptypes_1.ArrowButtonDirection.Left), theme: theme, size: size, toggle: false, selected: false, disabled: disabled, id: "LeftButtonId", iconSize: size === apptypes_1.ComponentSize.Large ? 32 : size === apptypes_1.ComponentSize.Medium ? 28 : 24, fillColor: theme.button.buttonIconColor }));
19
+ const tapHandler = (e, dir) => {
20
+ console.log(`e: %c ${e.currentTarget.role} %c, dir: %c ${dir} %c`, clsG, '', clsY, '');
21
+ onArrowButtonClicked(e, dir);
22
+ };
23
+ return ((0, jsx_runtime_1.jsx)(styles_1.ASIconButtonLeftStyled, { icon: icons_1.ArrowLeftIcon, onIconButtonTap: (e) => tapHandler(e, apptypes_1.ArrowButtonDirection.Left), theme: theme, size: size, toggle: false, selected: false, disabled: disabled, id: "LeftButtonId", iconSize: size === apptypes_1.ComponentSize.Large ? 32 : size === apptypes_1.ComponentSize.Medium ? 28 : 24, fillColor: theme.button.buttonIconColor }));
18
24
  };
19
25
  exports.ASLeftNavBarArrowButton = ASLeftNavBarArrowButton;
20
26
  const ASRightNavBarArrowButton = ({ size = apptypes_1.ComponentSize.Medium, theme = astheme_1.default, onArrowButtonClicked = () => undefined, disabled = false, }) => {
21
- return ((0, jsx_runtime_1.jsx)(styles_1.ASIconButtonRightStyled, { role: "button", icon: icons_1.ArrowRightIcon, onPointerDown: (e) => onArrowButtonClicked(e, apptypes_1.ArrowButtonDirection.Right), theme: theme, toggle: false, selected: false, size: size, disabled: disabled, id: "RightButtonId", iconSize: size === apptypes_1.ComponentSize.Large ? 32 : size === apptypes_1.ComponentSize.Medium ? 28 : 24, fillColor: theme.button.buttonIconColor }));
27
+ const tapHandler = (e, dir) => {
28
+ console.log(`e: %c ${e.currentTarget.role} %c, dir: %c ${dir} %c`, clsG, '', clsY, '');
29
+ onArrowButtonClicked(e, dir);
30
+ };
31
+ return ((0, jsx_runtime_1.jsx)(styles_1.ASIconButtonRightStyled, { icon: icons_1.ArrowRightIcon, onIconButtonTap: (e) => tapHandler(e, apptypes_1.ArrowButtonDirection.Right), theme: theme, toggle: false, selected: false, size: size, disabled: disabled, id: "RightButtonId", iconSize: size === apptypes_1.ComponentSize.Large ? 32 : size === apptypes_1.ComponentSize.Medium ? 28 : 24, fillColor: theme.button.buttonIconColor }));
22
32
  };
23
33
  exports.ASRightNavBarArrowButton = ASRightNavBarArrowButton;
@@ -21,6 +21,7 @@ export declare const ASIconButtonRightStyled: import("styled-components/dist/typ
21
21
  paddingSize?: import("../../apptypes").ASPaddingSize;
22
22
  isLoading?: boolean;
23
23
  icon: import("react").FC<import("react").PropsWithChildren<import("../..").IconProps>>;
24
+ onIconButtonTap?: (e: import("react").PointerEvent) => void;
24
25
  } & import("../..").IconProps & Omit<import("react").HTMLProps<HTMLDivElement>, "size"> & {
25
26
  children?: import("react").ReactNode | undefined;
26
27
  }, ASNavBarIconButtonStyledProps>> & string & Omit<import("react").FC<import("../../asiconbutton").ASIconButtonProps>, keyof import("react").Component<any, {}, any>>;
@@ -35,6 +36,7 @@ export declare const ASIconButtonLeftStyled: import("styled-components/dist/type
35
36
  paddingSize?: import("../../apptypes").ASPaddingSize;
36
37
  isLoading?: boolean;
37
38
  icon: import("react").FC<import("react").PropsWithChildren<import("../..").IconProps>>;
39
+ onIconButtonTap?: (e: import("react").PointerEvent) => void;
38
40
  } & import("../..").IconProps & Omit<import("react").HTMLProps<HTMLDivElement>, "size"> & {
39
41
  children?: import("react").ReactNode | undefined;
40
42
  }, ASNavBarIconButtonStyledProps>> & string & Omit<import("react").FC<import("../../asiconbutton").ASIconButtonProps>, keyof import("react").Component<any, {}, any>>;
@@ -1 +1 @@
1
- {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbararrowbuttons/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,gBAAgB,CAAC;AAGzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAwC/E,eAAO,MAAM,0BAA0B,oQA2BtC,CAAC;AAEF,UAAU,6BAA6B;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;qKAKnC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;qKAKlC,CAAC"}
1
+ {"version":3,"file":"styles.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbararrowbuttons/styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,OAAO,EAAiB,MAAM,gBAAgB,CAAC;AAGzE,OAAO,EAAE,+BAA+B,EAAE,MAAM,8BAA8B,CAAC;AAwC/E,eAAO,MAAM,0BAA0B,oQA2BtC,CAAC;AAEF,UAAU,6BAA6B;IACrC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,eAAe,CAAC;CACxB;AAED,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;qKAKnC,CAAC;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;qKAKlC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"ASNavBarItem.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbaritem/ASNavBarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAyE7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
1
+ {"version":3,"file":"ASNavBarItem.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbaritem/ASNavBarItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAQtD,QAAA,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAkG7C,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -7,14 +7,16 @@ const apptypes_1 = require("../../apptypes");
7
7
  const astheme_1 = tslib_1.__importDefault(require("../../astheme"));
8
8
  const styles_1 = require("../styles");
9
9
  const styles_2 = require("./styles");
10
+ const clsR = 'background: crimson; color: #000000; border-radius: 10px;';
11
+ const clsY = 'background: goldenrod; color: #000000; border-radius: 10px;';
12
+ const clsG = 'background: forestgreen; color: #000000; border-radius: 10px;';
10
13
  const ASNavBarItem = ({ className = '', theme = astheme_1.default, displayText = '---', icon, selected = false, itemId, itemIndex = 0, size = apptypes_1.ComponentSize.Medium, onItemClick = () => undefined, onItemResized = () => undefined, }) => {
14
+ const tapDebounceRef = (0, react_1.useRef)('None');
11
15
  const [navItemSizeInitialized, setNavSizeInitialized] = (0, react_1.useState)(false);
12
16
  const navItemWidthRef = (0, react_1.useRef)(0);
13
17
  const navBarItemRef = (0, react_1.useRef)(null);
14
18
  const isNavBarItemSelected = (0, react_1.useRef)(selected);
15
19
  const onItemClickHandler = (e) => {
16
- e.preventDefault();
17
- e.stopPropagation();
18
20
  onItemClick(e, itemId, itemIndex);
19
21
  };
20
22
  (0, react_1.useEffect)(() => {
@@ -44,6 +46,28 @@ const ASNavBarItem = ({ className = '', theme = astheme_1.default, displayText =
44
46
  (0, react_1.useEffect)(() => {
45
47
  isNavBarItemSelected.current = selected;
46
48
  }, [selected]);
47
- return ((0, jsx_runtime_1.jsxs)(styles_2.ASNavBarItemStyled, { id: itemId, theme: theme, title: displayText, ref: navBarItemRef, className: `${className} ${size}`, "$selected": selected, onPointerDown: onItemClickHandler, children: [icon && ((0, jsx_runtime_1.jsx)(styles_1.ASNavBarLeadingIconPadding, { theme: theme, "$selected": selected, "aria-invalid": true, "aria-hidden": true, children: icon })), displayText] }));
49
+ const onTap = (e) => {
50
+ if (tapDebounceRef.current === 'None') {
51
+ tapDebounceRef.current = 'Down';
52
+ console.log(`%c ${tapDebounceRef.current} %c`, clsR, '');
53
+ const btnEl = e.currentTarget;
54
+ btnEl.ariaPressed = 'true';
55
+ }
56
+ };
57
+ const onTapRelease = (e) => {
58
+ if (tapDebounceRef.current === 'Down') {
59
+ tapDebounceRef.current = 'Up';
60
+ const btnEl = e.currentTarget;
61
+ onItemClickHandler(e);
62
+ console.log(`%c ${tapDebounceRef.current} %c`, clsY, '');
63
+ btnEl.releasePointerCapture(e.pointerId);
64
+ setTimeout(() => {
65
+ btnEl.ariaPressed = 'false';
66
+ tapDebounceRef.current = 'None';
67
+ console.log(`%c ${tapDebounceRef.current} %c`, clsG, '');
68
+ }, 400);
69
+ }
70
+ };
71
+ return ((0, jsx_runtime_1.jsxs)(styles_2.ASNavBarItemStyled, { id: itemId, theme: theme, title: displayText, ref: navBarItemRef, className: `${className} ${size}`, "$selected": selected, onPointerDown: onTap, onPointerUp: onTapRelease, children: [icon && ((0, jsx_runtime_1.jsx)(styles_1.ASNavBarLeadingIconPadding, { theme: theme, "$selected": selected, "aria-invalid": true, "aria-hidden": true, children: icon })), displayText] }));
48
72
  };
49
73
  exports.default = ASNavBarItem;
@@ -1 +1 @@
1
- {"version":3,"file":"ASNavBarPickPanelItem.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbarpickpanelitem/ASNavBarPickPanelItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6FtD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
1
+ {"version":3,"file":"ASNavBarPickPanelItem.d.ts","sourceRoot":"","sources":["../../../src/asnavbar/navbarpickpanelitem/ASNavBarPickPanelItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAItD,QAAA,MAAM,qBAAqB,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA8FtD,CAAC;AAEF,eAAe,qBAAqB,CAAC"}
@@ -62,6 +62,6 @@ const ASNavBarPickPanelItem = ({ className = '', theme = astheme_1.default, disp
62
62
  }, 400);
63
63
  }
64
64
  };
65
- return ((0, jsx_runtime_1.jsxs)(styles_2.ASNavBarPickPanelItemStyled, { id: itemId, theme: theme, ref: navBarItemRef, className: `${className} ${size}`, "$selected": selected, onPointerUp: onTapRelease, onPointerDown: onTap, children: [icon && ((0, jsx_runtime_1.jsx)(styles_1.ASNavBarLeadingIconPadding, { theme: theme, "$selected": selected, "aria-invalid": true, "aria-hidden": true, children: icon })), displayText] }));
65
+ return ((0, jsx_runtime_1.jsxs)(styles_2.ASNavBarPickPanelItemStyled, { id: itemId, theme: theme, role: "button", ref: navBarItemRef, className: `${className} ${size}`, "$selected": selected, onPointerUp: onTapRelease, onPointerDown: onTap, children: [icon && ((0, jsx_runtime_1.jsx)(styles_1.ASNavBarLeadingIconPadding, { theme: theme, "$selected": selected, "aria-invalid": true, "aria-hidden": true, children: icon })), displayText] }));
66
66
  };
67
67
  exports.default = ASNavBarPickPanelItem;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eleventheye/asui",
3
- "version": "2.7.2",
3
+ "version": "2.7.4",
4
4
  "private": false,
5
5
  "description": "AS UI React Library by eleventheye (another one!)",
6
6
  "keywords": [