@kwirthmagnify/kwirth-common-front 0.5.23 → 0.5.25

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.
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import { IUserInfo } from '@kwirthmagnify/kwirth-common';
3
+ export interface IUserPickerProps {
4
+ users: IUserInfo[];
5
+ value?: string;
6
+ onChange: (id: string | undefined) => void;
7
+ label?: string;
8
+ size?: 'small' | 'medium';
9
+ fullWidth?: boolean;
10
+ disabled?: boolean;
11
+ }
12
+ declare const UserPicker: React.FC<IUserPickerProps>;
13
+ export { UserPicker };
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.UserPicker = void 0;
7
+ const react_1 = __importDefault(require("react"));
8
+ const material_1 = require("@mui/material");
9
+ const UserPicker = ({ users, value, onChange, label = 'User', size = 'small', fullWidth, disabled }) => {
10
+ var _a;
11
+ const selected = (_a = users.find(u => u.id === value)) !== null && _a !== void 0 ? _a : null;
12
+ return (react_1.default.createElement(material_1.Autocomplete, { options: users, value: selected, disabled: disabled, size: size, fullWidth: fullWidth, getOptionLabel: u => u.name, isOptionEqualToValue: (a, b) => a.id === b.id, onChange: (_e, u) => onChange(u === null || u === void 0 ? void 0 : u.id), renderOption: (props, u) => (react_1.default.createElement("li", Object.assign({}, props, { key: u.id, style: { display: 'flex', alignItems: 'center', gap: 8 } }),
13
+ react_1.default.createElement("span", { style: { flex: 1 } }, u.name),
14
+ u.idp && react_1.default.createElement(material_1.Chip, { label: u.idp, size: "small", variant: "outlined", sx: { height: 18, fontSize: 10 } }))), renderInput: p => react_1.default.createElement(material_1.TextField, Object.assign({}, p, { label: label })) }));
15
+ };
16
+ exports.UserPicker = UserPicker;
package/dist/index.d.ts CHANGED
@@ -88,6 +88,8 @@ export { MarkdownViewer } from './MarkdownViewer';
88
88
  export { MiniGauge } from './MiniGauge';
89
89
  export type { IMiniGaugeProps } from './MiniGauge';
90
90
  export { MsgBoxButtons, MsgBoxOk, MsgBoxOkWarning, MsgBoxOkError, MsgBoxOkCancel, MsgBoxYesNo, MsgBoxYesNoCancel, MsgBoxWait, MsgBoxWaitCancel } from './MsgBox';
91
+ export { UserPicker } from './UserPicker';
92
+ export type { IUserPickerProps } from './UserPicker';
91
93
  export interface ITabSummary {
92
94
  name: string;
93
95
  description: string;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MsgBoxWaitCancel = exports.MsgBoxWait = exports.MsgBoxYesNoCancel = exports.MsgBoxYesNo = exports.MsgBoxOkCancel = exports.MsgBoxOkError = exports.MsgBoxOkWarning = exports.MsgBoxOk = exports.MsgBoxButtons = exports.MiniGauge = exports.MarkdownViewer = exports.cleanANSI = exports.MetricDefinition = exports.ENotifyLevel = exports.EChannelRefreshAction = exports.useKeyboard = void 0;
3
+ exports.UserPicker = exports.MsgBoxWaitCancel = exports.MsgBoxWait = exports.MsgBoxYesNoCancel = exports.MsgBoxYesNo = exports.MsgBoxOkCancel = exports.MsgBoxOkError = exports.MsgBoxOkWarning = exports.MsgBoxOk = exports.MsgBoxButtons = exports.MiniGauge = exports.MarkdownViewer = exports.cleanANSI = exports.MetricDefinition = exports.ENotifyLevel = exports.EChannelRefreshAction = exports.useKeyboard = void 0;
4
4
  const react_1 = require("react");
5
5
  const kwirth_common_1 = require("@kwirthmagnify/kwirth-common");
6
6
  Object.defineProperty(exports, "EChannelRefreshAction", { enumerable: true, get: function () { return kwirth_common_1.EChannelRefreshAction; } });
@@ -53,3 +53,5 @@ Object.defineProperty(exports, "MsgBoxYesNo", { enumerable: true, get: function
53
53
  Object.defineProperty(exports, "MsgBoxYesNoCancel", { enumerable: true, get: function () { return MsgBox_1.MsgBoxYesNoCancel; } });
54
54
  Object.defineProperty(exports, "MsgBoxWait", { enumerable: true, get: function () { return MsgBox_1.MsgBoxWait; } });
55
55
  Object.defineProperty(exports, "MsgBoxWaitCancel", { enumerable: true, get: function () { return MsgBox_1.MsgBoxWaitCancel; } });
56
+ var UserPicker_1 = require("./UserPicker");
57
+ Object.defineProperty(exports, "UserPicker", { enumerable: true, get: function () { return UserPicker_1.UserPicker; } });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kwirthmagnify/kwirth-common-front",
3
- "version": "0.5.23",
3
+ "version": "0.5.25",
4
4
  "description": "Frontend channel interfaces for Kwirth plugins and channels",
5
5
  "scripts": {
6
6
  "build": "del .\\dist\\* /s /q && tsc"
@@ -43,6 +43,7 @@
43
43
  "./icons": {
44
44
  "types": "./dist/kwirthicons.d.ts",
45
45
  "default": "./dist/kwirthicons.js"
46
- }
46
+ },
47
+ "./package.json": "./package.json"
47
48
  }
48
49
  }