@evoke-platform/ui-components 1.0.0-dev.151 → 1.0.0-dev.152

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.
@@ -25,10 +25,10 @@ const TextField = (props) => {
25
25
  props.required ? (React.createElement(Typography, { sx: { color: 'red', fontSize: '14px' }, component: 'span' }, "*")) : null),
26
26
  instructionText && React.createElement(Typography, { variant: 'caption' }, instructionText),
27
27
  React.createElement(MUITextField, Object.assign({}, props, { label: null, inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly }, sx: readOnly
28
- ? readOnlyStyles
29
- : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
28
+ ? Object.assign(Object.assign({}, readOnlyStyles), props.sx) : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
30
29
  error && React.createElement(FieldError, { required: required, label: errorMessage }))) : (React.createElement(React.Fragment, null,
31
- React.createElement(MUITextField, Object.assign({ "data-testid": "label-inside", inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly } }, props, { sx: readOnly ? readOnlyStyles : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
30
+ React.createElement(MUITextField, Object.assign({ "data-testid": "label-inside", inputProps: { readOnly: readOnly, 'aria-readonly': !!readOnly } }, props, { sx: readOnly
31
+ ? Object.assign(Object.assign({}, readOnlyStyles), props.sx) : Object.assign({ '& fieldset': { borderRadius: '8px' } }, props.sx) })),
32
32
  error && React.createElement(FieldError, { required: required, label: errorMessage })))));
33
33
  };
34
34
  export default TextField;
@@ -3,6 +3,7 @@ export declare type DropdownOptions = {
3
3
  id?: string;
4
4
  label: string;
5
5
  value: boolean;
6
+ disabled?: boolean;
6
7
  };
7
8
  declare type MultiSelectProps = {
8
9
  options: DropdownOptions[];
@@ -114,7 +114,7 @@ export default function MultiSelect(props) {
114
114
  React.createElement(Search, null))),
115
115
  }, fullWidth: true, sx: styles.textField, value: searchText, onChange: filterItems }))),
116
116
  (optionsArray === null || optionsArray === void 0 ? void 0 : optionsArray.length) > 1 && (React.createElement(Grid, { item: true, sx: styles.switch },
117
- React.createElement(FormControlLabel, { control: React.createElement(Switch, { checked: selectAll, onChange: handleSelectAllChange }), label: "Select all fields" }))),
117
+ React.createElement(FormControlLabel, { control: React.createElement(Switch, { checked: selectAll, onChange: handleSelectAllChange }), label: "Select all fields", disabled: optionsArray.every((option) => option.disabled === true) }))),
118
118
  React.createElement(Box, { sx: Object.assign(Object.assign({}, styles.list), { maxHeight: maxHeight !== null && maxHeight !== void 0 ? maxHeight : 'auto' }) }, !!isSortable ? (React.createElement(DndContext, { sensors: sensors, collisionDetection: closestCenter, onDragEnd: handleDragEnd, modifiers: [restrictToVerticalAxis, restrictToWindowEdges] },
119
119
  React.createElement(SortableContext, { items: optionsArray, strategy: verticalListSortingStrategy }, optionsArray.map((option) => {
120
120
  var _a, _b;
@@ -134,7 +134,7 @@ export default function MultiSelect(props) {
134
134
  React.createElement(Switch, { id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label, checked: option.value, onChange: (event) => {
135
135
  var _a;
136
136
  handleFlagChange(event, (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label);
137
- } })))));
137
+ }, disabled: option.disabled })))));
138
138
  }, key: (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label, id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label }));
139
139
  })))) : (React.createElement(React.Fragment, null, sortBy(optionsArray, 'label').map((option) => {
140
140
  var _a, _b;
@@ -146,6 +146,6 @@ export default function MultiSelect(props) {
146
146
  option.label,
147
147
  " ")),
148
148
  React.createElement(Grid, null,
149
- React.createElement(Switch, { id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label, checked: option.value, onChange: (event) => { var _a; return handleFlagChange(event, (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label); } })))));
149
+ React.createElement(Switch, { id: (_b = option === null || option === void 0 ? void 0 : option.id) !== null && _b !== void 0 ? _b : option === null || option === void 0 ? void 0 : option.label, checked: option.value, onChange: (event) => { var _a; return handleFlagChange(event, (_a = option === null || option === void 0 ? void 0 : option.id) !== null && _a !== void 0 ? _a : option === null || option === void 0 ? void 0 : option.label); }, disabled: option.disabled })))));
150
150
  })))))));
151
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/ui-components",
3
- "version": "1.0.0-dev.151",
3
+ "version": "1.0.0-dev.152",
4
4
  "description": "",
5
5
  "main": "dist/published/index.js",
6
6
  "module": "dist/published/index.js",
@@ -11,10 +11,10 @@
11
11
  ],
12
12
  "scripts": {
13
13
  "test": "jest",
14
- "build": "mkdirp -rf /dist && npm run build:esm && npm run build:cjs",
14
+ "build": "rm -rf /dist && npm run build:esm && npm run build:cjs",
15
15
  "build:esm": "tsc",
16
16
  "build:cjs": "tsc --module CommonJS --outDir dist/cjs",
17
- "prepublish": "mkdirp -rf /dist && tsc",
17
+ "prepublish": "rm -rf /dist && tsc",
18
18
  "storybook": "start-storybook -p 6006",
19
19
  "build-storybook": "build-storybook",
20
20
  "lint": "prettier --check src/**/*.*",