reactive-bulma 4.3.2 → 4.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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: n = null,
5
- containerTestId: a = null,
6
- cssClasses: o = null,
4
+ testId: a = null,
5
+ containerTestId: o = null,
6
+ cssClasses: i = null,
7
7
  containerCssClasses: d = null,
8
- style: i = null,
8
+ style: u = null,
9
9
  containerStyle: c = null,
10
- options: u = [],
11
- name: r,
12
- showOptions: m = 1,
13
- isMultiple: s = !1,
14
- color: p = null,
15
- size: f = null,
16
- isRounded: h = null,
17
- isHovered: v = null,
18
- isFocused: C = null,
19
- onClick: S,
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 t = j([
25
+ const s = j([
24
26
  "select",
25
- p,
26
- f,
27
- s ? "is-multiple" : null,
28
- h ? "is-rounded" : null,
29
- v ? "is-hovered" : null,
30
- C ? "is-focused" : null,
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 = n ?? k({
34
+ ]), l = a ?? k({
33
35
  tag: "select",
34
- parsedClasses: t
35
- }), $ = a ?? `${l}-container`;
36
+ parsedClasses: s
37
+ }), x = o ?? `${l}-container`;
36
38
  return /* @__PURE__ */ e(
37
39
  "section",
38
40
  {
39
- "data-testid": $,
40
- className: t,
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: o ?? void 0,
47
- style: i ?? void 0,
48
- name: r,
49
- multiple: s,
50
- size: m,
51
- children: u.map(({ id: g, name: x, selected: y }, N) => /* @__PURE__ */ e(
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-${N}`,
55
- defaultChecked: y ?? !1,
56
- onClick: S,
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
- g.toString()
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` Indicates the options contained on the select */
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.2",
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",