reactive-bulma 4.3.2 → 4.3.3
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,64 +1,68 @@
|
|
1
1
|
import { jsx as e } from "react/jsx-runtime";
|
2
2
|
import { parseClasses as j, parseTestId as k } from "../../../functions/parsers.js";
|
3
3
|
const q = ({
|
4
|
-
testId:
|
5
|
-
containerTestId:
|
6
|
-
cssClasses:
|
4
|
+
testId: a = null,
|
5
|
+
containerTestId: o = null,
|
6
|
+
cssClasses: i = null,
|
7
7
|
containerCssClasses: d = null,
|
8
|
-
style:
|
8
|
+
style: u = null,
|
9
9
|
containerStyle: c = null,
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
10
|
+
isDisabled: r,
|
11
|
+
options: p = [],
|
12
|
+
selectedValues: m,
|
13
|
+
name: f,
|
14
|
+
showOptions: v = 1,
|
15
|
+
isMultiple: t = !1,
|
16
|
+
color: S = null,
|
17
|
+
size: h = null,
|
18
|
+
isRounded: $ = null,
|
19
|
+
isHovered: g = null,
|
20
|
+
isFocused: y = null,
|
21
|
+
onClick: C,
|
20
22
|
onChange: I,
|
21
23
|
onBlur: T
|
22
24
|
}) => {
|
23
|
-
const
|
25
|
+
const s = j([
|
24
26
|
"select",
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
S,
|
28
|
+
h,
|
29
|
+
t ? "is-multiple" : null,
|
30
|
+
$ ? "is-rounded" : null,
|
31
|
+
g ? "is-hovered" : null,
|
32
|
+
y ? "is-focused" : null,
|
31
33
|
d
|
32
|
-
]), l =
|
34
|
+
]), l = a ?? k({
|
33
35
|
tag: "select",
|
34
|
-
parsedClasses:
|
35
|
-
}),
|
36
|
+
parsedClasses: s
|
37
|
+
}), x = o ?? `${l}-container`;
|
36
38
|
return /* @__PURE__ */ e(
|
37
39
|
"section",
|
38
40
|
{
|
39
|
-
"data-testid":
|
40
|
-
className:
|
41
|
+
"data-testid": x,
|
42
|
+
className: s,
|
41
43
|
style: c ?? void 0,
|
42
44
|
children: /* @__PURE__ */ e(
|
43
45
|
"select",
|
44
46
|
{
|
45
47
|
"data-testid": l,
|
46
|
-
className:
|
47
|
-
style:
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
48
|
+
className: i ?? void 0,
|
49
|
+
style: u ?? void 0,
|
50
|
+
defaultValue: m,
|
51
|
+
name: f,
|
52
|
+
disabled: r ?? !1,
|
53
|
+
multiple: t,
|
54
|
+
size: v,
|
55
|
+
onClick: C,
|
56
|
+
onChange: I,
|
57
|
+
onBlur: T,
|
58
|
+
children: p.map(({ id: n, name: N }, b) => /* @__PURE__ */ e(
|
52
59
|
"option",
|
53
60
|
{
|
54
|
-
"data-testid": `${l}-option-${
|
55
|
-
|
56
|
-
|
57
|
-
onChange: I,
|
58
|
-
onBlur: T,
|
59
|
-
children: x
|
61
|
+
"data-testid": `${l}-option-${b}`,
|
62
|
+
value: n.toString(),
|
63
|
+
children: N
|
60
64
|
},
|
61
|
-
|
65
|
+
`key-option-${n.toString()}`
|
62
66
|
))
|
63
67
|
}
|
64
68
|
)
|
@@ -5,5 +5,6 @@ export default _default;
|
|
5
5
|
export declare const OnlyRequiredProps: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
6
6
|
export declare const WithOneOption: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
7
7
|
export declare const WithSeveralOptions: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
8
|
+
export declare const Disabled: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
8
9
|
export declare const ShowsThreeOptions: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
9
10
|
export declare const FirstOptionsSelected: import('@storybook/csf').AnnotatedStoryFn<import('@storybook/react').ReactRenderer, import('../../../interfaces/atomProps').SelectProps>;
|
@@ -159,11 +159,14 @@ export interface DeleteProps extends ElementProps, ClickeableProps {
|
|
159
159
|
export interface SelectOption {
|
160
160
|
id: string | number;
|
161
161
|
name: string;
|
162
|
-
selected?: boolean;
|
163
162
|
}
|
164
163
|
export interface SelectProps extends ComposedElementProps, InteractiveOnChangeProps, NamedInputProps {
|
165
|
-
/** `Attribute`
|
164
|
+
/** `Attribute` Will disable the input */
|
165
|
+
isDisabled?: boolean;
|
166
|
+
/** `Attribute` Indicates the select contained on the select */
|
166
167
|
options?: SelectOption[];
|
168
|
+
/** `Attribute` Will select a different default option if the user provides it. It can be an multiple selection if `isMultiple` is true */
|
169
|
+
selectedValues?: string | string[];
|
167
170
|
/** `Attribute` Indicates how many options will be shown at first glance (before looking for the whole list */
|
168
171
|
showOptions?: number;
|
169
172
|
/** `Attribute` Will allow multiple selection */
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "reactive-bulma",
|
3
|
-
"version": "4.3.
|
3
|
+
"version": "4.3.3",
|
4
4
|
"type": "module",
|
5
5
|
"description": "A component library based on React, Bulma, Typescript and Vite",
|
6
6
|
"keywords": [
|
@@ -41,7 +41,7 @@
|
|
41
41
|
"prettier": "prettier src/**/*.{tsx,ts} --write",
|
42
42
|
"prettier:ci": "prettier src/**/*.{tsx,ts} --check",
|
43
43
|
"lint-staged": "lint-staged -v",
|
44
|
-
"setup": "npm ci",
|
44
|
+
"setup": "npm ci && husky",
|
45
45
|
"compile": "tsc -b",
|
46
46
|
"build": "npm run compile && vite build",
|
47
47
|
"build:storybook": "storybook build",
|