@panneau/filter-button 4.0.39 → 4.0.40-alpha.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.
Files changed (2) hide show
  1. package/dist/index.js +114 -43
  2. package/package.json +5 -5
package/dist/index.js CHANGED
@@ -1,54 +1,125 @@
1
- import _objectSpread from '@babel/runtime/helpers/objectSpread2';
2
- import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
3
- import { useMemo, useCallback } from 'react';
1
+ import { c } from 'react/compiler-runtime';
4
2
  import Button from '@panneau/element-button';
5
3
  import { jsx } from 'react/jsx-runtime';
6
4
 
7
- var _excluded = ["onChange", "onClear", "name", "label", "value", "href", "theme", "activeTheme", "disableOutline", "className"];
8
- function ButtonFilter(_ref) {
9
- var _ref$onChange = _ref.onChange,
10
- onChange = _ref$onChange === void 0 ? null : _ref$onChange;
11
- _ref.onClear;
12
- var _ref$name = _ref.name,
13
- name = _ref$name === void 0 ? 'button' : _ref$name,
14
- _ref$label = _ref.label,
15
- label = _ref$label === void 0 ? null : _ref$label,
16
- _ref$value = _ref.value,
17
- value = _ref$value === void 0 ? false : _ref$value,
18
- _ref$href = _ref.href,
19
- href = _ref$href === void 0 ? null : _ref$href,
20
- _ref$theme = _ref.theme,
21
- theme = _ref$theme === void 0 ? 'primary' : _ref$theme,
22
- _ref$activeTheme = _ref.activeTheme,
23
- activeTheme = _ref$activeTheme === void 0 ? 'primary' : _ref$activeTheme,
24
- _ref$disableOutline = _ref.disableOutline,
25
- disableOutline = _ref$disableOutline === void 0 ? false : _ref$disableOutline,
26
- _ref$className = _ref.className,
27
- className = _ref$className === void 0 ? null : _ref$className,
28
- props = _objectWithoutProperties(_ref, _excluded);
29
- var isActive = useMemo(function () {
30
- return value !== null && (value === true || value === 'true' || value === 1 || value === '1');
31
- }, [value]);
32
- var onClick = useCallback(function () {
33
- if (href === null) {
34
- if (isActive) {
35
- onChange(null);
36
- } else {
37
- onChange(true);
5
+ function ButtonFilter(t0) {
6
+ const $ = c(27);
7
+ let props;
8
+ let t1;
9
+ let t10;
10
+ let t2;
11
+ let t3;
12
+ let t4;
13
+ let t5;
14
+ let t6;
15
+ let t7;
16
+ let t8;
17
+ let t9;
18
+ if ($[0] !== t0) {
19
+ ({
20
+ onChange: t1,
21
+ onClear: t2,
22
+ name: t3,
23
+ label: t4,
24
+ value: t5,
25
+ href: t6,
26
+ theme: t7,
27
+ activeTheme: t8,
28
+ disableOutline: t9,
29
+ className: t10,
30
+ ...props
31
+ } = t0);
32
+ $[0] = t0;
33
+ $[1] = props;
34
+ $[2] = t1;
35
+ $[3] = t10;
36
+ $[4] = t2;
37
+ $[5] = t3;
38
+ $[6] = t4;
39
+ $[7] = t5;
40
+ $[8] = t6;
41
+ $[9] = t7;
42
+ $[10] = t8;
43
+ $[11] = t9;
44
+ } else {
45
+ props = $[1];
46
+ t1 = $[2];
47
+ t10 = $[3];
48
+ t2 = $[4];
49
+ t3 = $[5];
50
+ t4 = $[6];
51
+ t5 = $[7];
52
+ t6 = $[8];
53
+ t7 = $[9];
54
+ t8 = $[10];
55
+ t9 = $[11];
56
+ }
57
+ const onChange = t1 === undefined ? null : t1;
58
+ const name = t3 === undefined ? "button" : t3;
59
+ const label = t4 === undefined ? null : t4;
60
+ const value = t5 === undefined ? false : t5;
61
+ const href = t6 === undefined ? null : t6;
62
+ const theme = t7 === undefined ? "primary" : t7;
63
+ const activeTheme = t8 === undefined ? "primary" : t8;
64
+ const disableOutline = t9 === undefined ? false : t9;
65
+ const className = t10 === undefined ? null : t10;
66
+ const isActive = value !== null && (value === true || value === "true" || value === 1 || value === "1");
67
+ let t11;
68
+ if ($[12] !== href || $[13] !== isActive || $[14] !== onChange) {
69
+ t11 = () => {
70
+ if (href === null) {
71
+ if (isActive) {
72
+ onChange(null);
73
+ } else {
74
+ onChange(true);
75
+ }
38
76
  }
39
- }
40
- }, [isActive, href, onChange]);
41
- return /*#__PURE__*/jsx("div", {
42
- className: className,
43
- children: /*#__PURE__*/jsx(Button, _objectSpread({
77
+ };
78
+ $[12] = href;
79
+ $[13] = isActive;
80
+ $[14] = onChange;
81
+ $[15] = t11;
82
+ } else {
83
+ t11 = $[15];
84
+ }
85
+ const onClick = t11;
86
+ const t12 = (!isActive || href !== null) && !disableOutline;
87
+ const t13 = isActive ? activeTheme : theme;
88
+ let t14;
89
+ if ($[16] !== href || $[17] !== label || $[18] !== name || $[19] !== onClick || $[20] !== props || $[21] !== t12 || $[22] !== t13) {
90
+ t14 = /*#__PURE__*/jsx(Button, {
44
91
  href: href,
45
92
  label: label,
46
93
  name: name,
47
94
  onClick: onClick,
48
- outline: (!isActive || href !== null) && !disableOutline,
49
- theme: isActive ? activeTheme : theme
50
- }, props))
51
- });
95
+ outline: t12,
96
+ theme: t13,
97
+ ...props
98
+ });
99
+ $[16] = href;
100
+ $[17] = label;
101
+ $[18] = name;
102
+ $[19] = onClick;
103
+ $[20] = props;
104
+ $[21] = t12;
105
+ $[22] = t13;
106
+ $[23] = t14;
107
+ } else {
108
+ t14 = $[23];
109
+ }
110
+ let t15;
111
+ if ($[24] !== className || $[25] !== t14) {
112
+ t15 = /*#__PURE__*/jsx("div", {
113
+ className: className,
114
+ children: t14
115
+ });
116
+ $[24] = className;
117
+ $[25] = t14;
118
+ $[26] = t15;
119
+ } else {
120
+ t15 = $[26];
121
+ }
122
+ return t15;
52
123
  }
53
124
 
54
125
  export { ButtonFilter as default };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@panneau/filter-button",
3
- "version": "4.0.39",
3
+ "version": "4.0.40-alpha.1",
4
4
  "description": "Button filter",
5
5
  "keywords": [
6
6
  "javascript"
@@ -60,13 +60,13 @@
60
60
  },
61
61
  "dependencies": {
62
62
  "@babel/runtime": "^7.28.6",
63
- "@panneau/core": "^4.0.38",
64
- "@panneau/element-button": "^4.0.39",
65
- "@panneau/themes": "^4.0.38",
63
+ "@panneau/core": "^4.0.40-alpha.1",
64
+ "@panneau/element-button": "^4.0.40-alpha.1",
65
+ "@panneau/themes": "^4.0.40-alpha.1",
66
66
  "classnames": "^2.5.1"
67
67
  },
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "621c5233f083c1ba95cd46cd427c38361723d5d6"
71
+ "gitHead": "66520f92373b3aa371222b354d60ed3cf3d20c96"
72
72
  }