@universal-tennis/ui-shared 0.1.10 → 0.1.11
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/dist/stories/molecules/Cards/DrawCard.d.ts +1 -1
- package/dist/stories/molecules/Cards/DrawCard.js +3 -3
- package/dist/stories/molecules/Cards/DrawCard.js.map +1 -1
- package/dist/stories/molecules/Cards/sharedTypes.d.ts +1 -0
- package/package.json +1 -1
- package/src/stories/molecules/Cards/DrawCard.tsx +3 -1
- package/src/stories/molecules/Cards/sharedTypes.ts +1 -0
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { DrawCardProps } from "./sharedTypes";
|
|
3
|
-
export default function DrawCard({ options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, ...props }: DrawCardProps): JSX.Element;
|
|
3
|
+
export default function DrawCard({ options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, ...props }: DrawCardProps): JSX.Element;
|
|
@@ -42,7 +42,7 @@ const Positions = {
|
|
|
42
42
|
TWO: '2',
|
|
43
43
|
};
|
|
44
44
|
export default function DrawCard(_a) {
|
|
45
|
-
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel", "emptyLabel"]);
|
|
45
|
+
var { options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled } = _a, props = __rest(_a, ["options", "onChange", "onEditClick", "selectedOptions", "dateLabel", "locationLabel", "emptyLabel", "isDisabled"]);
|
|
46
46
|
const { optionOne, optionTwo } = selectedOptions || null;
|
|
47
47
|
const handleOnSelectionChange = (event, position) => {
|
|
48
48
|
const id = event.target.value;
|
|
@@ -52,12 +52,12 @@ export default function DrawCard(_a) {
|
|
|
52
52
|
};
|
|
53
53
|
return (React.createElement(StyledCard, Object.assign({}, props),
|
|
54
54
|
React.createElement(InputLabel, { id: "draw-card-select-label-top" }, emptyLabel),
|
|
55
|
-
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-top", id: "draw-card-select-top", value: optionOne, label: React.createElement(OutlinedInput, { label: emptyLabel }), onChange: (e) => handleOnSelectionChange(e, Positions.ONE), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
55
|
+
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-top", id: "draw-card-select-top", value: optionOne, disabled: isDisabled, label: React.createElement(OutlinedInput, { label: emptyLabel }), onChange: (e) => handleOnSelectionChange(e, Positions.ONE), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
56
56
|
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
57
57
|
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
58
58
|
React.createElement(Box, { pt: 1 }),
|
|
59
59
|
React.createElement(InputLabel, { id: "draw-card-select-label-bot" }, emptyLabel),
|
|
60
|
-
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-bot", id: "draw-card-select-bot", value: optionTwo, onChange: (e) => handleOnSelectionChange(e, Positions.TWO), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
60
|
+
React.createElement(StyledMuiSelect, { labelId: "draw-card-select-label-bot", id: "draw-card-select-bot", value: optionTwo, disabled: isDisabled, onChange: (e) => handleOnSelectionChange(e, Positions.TWO), input: React.createElement(OutlinedInput, { label: emptyLabel }) },
|
|
61
61
|
options.map((option) => React.createElement(MenuItem, { key: option.id, value: option.id }, option.label)),
|
|
62
62
|
React.createElement(MenuItem, { sx: { borderTop: '1px solid var(--cool-grey-500)' }, value: "bye" }, "Set bye")),
|
|
63
63
|
React.createElement(BottomGrid, null,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DrawCard.js","sourceRoot":"","sources":["../../../../src/stories/molecules/Cards/DrawCard.t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,4BAA4B,EACpC,EAAE,EAAC,sBAAsB,EACzB,KAAK,EAAE,SAAS,EAChB,QAAQ,EAAE,UAAU,EACpB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,EAAE,SAAS,CAAC,GAAG,CAAC,EAC1D,KAAK,EAAE,oBAAC,aAAa,IAAC,KAAK,EAAE,UAAU,GAAI;YAE1C,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,oBAAC,QAAQ,IAAC,GAAG,EAAE,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,EAAE,IAAG,MAAM,CAAC,KAAK,CAAY,CAAC;YAC/F,oBAAC,QAAQ,IAAC,EAAE,EAAE,EAAE,SAAS,EAAE,gCAAgC,EAAE,EAAE,KAAK,EAAC,KAAK,cAAmB,CAC/E;QAClB,oBAAC,UAAU;YAEP,oBAAC,GAAG;gBACA,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,SAAS,IAC9E,SAAS,CACD;gBACb,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,SAAS,IAC9E,aAAa,CACL,CACX;YACN,oBAAC,MAAM,IACH,KAAK,EAAE;oBACL,OAAO,EAAE,MAAM;oBACf,cAAc,EAAE,KAAK;iBACtB,EACD,OAAO,EAAE,WAAW,EACpB,QAAQ,EAAC,MAAM;gBAEf,oBAAC,UAAU,IAAC,QAAQ,EAAE,aAAa,CAAC,SAAS,EAAE,IAAI,EAAE,oBAAoB,CAAC,eAAe,WAE5E,CACR,CACA,CACJ,CAChB,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -38,7 +38,7 @@ const Positions = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
export default function DrawCard({
|
|
41
|
-
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, ...props
|
|
41
|
+
options, onChange, onEditClick, selectedOptions, dateLabel, locationLabel, emptyLabel, isDisabled, ...props
|
|
42
42
|
}: DrawCardProps) {
|
|
43
43
|
const { optionOne, optionTwo } = selectedOptions || null;
|
|
44
44
|
|
|
@@ -59,6 +59,7 @@ export default function DrawCard({
|
|
|
59
59
|
labelId="draw-card-select-label-top"
|
|
60
60
|
id="draw-card-select-top"
|
|
61
61
|
value={optionOne}
|
|
62
|
+
disabled={isDisabled}
|
|
62
63
|
label={<OutlinedInput label={emptyLabel} />}
|
|
63
64
|
onChange={(e) => handleOnSelectionChange(e, Positions.ONE)}
|
|
64
65
|
input={<OutlinedInput label={emptyLabel} />}
|
|
@@ -73,6 +74,7 @@ export default function DrawCard({
|
|
|
73
74
|
labelId="draw-card-select-label-bot"
|
|
74
75
|
id="draw-card-select-bot"
|
|
75
76
|
value={optionTwo}
|
|
77
|
+
disabled={isDisabled}
|
|
76
78
|
onChange={(e) => handleOnSelectionChange(e, Positions.TWO)}
|
|
77
79
|
input={<OutlinedInput label={emptyLabel} />}
|
|
78
80
|
>
|