@kwirthmagnify/kwirth-common-front 0.5.24 → 0.5.26
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/HelpButton.d.ts +7 -0
- package/dist/HelpButton.js +24 -0
- package/dist/UserPicker.d.ts +13 -0
- package/dist/UserPicker.js +16 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +5 -1
- package/package.json +1 -1
|
@@ -0,0 +1,24 @@
|
|
|
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.HelpButton = void 0;
|
|
7
|
+
const react_1 = __importDefault(require("react"));
|
|
8
|
+
const material_1 = require("@mui/material");
|
|
9
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
10
|
+
// Botón de ayuda reutilizable para dialogs de configuración: abre la guía (docsify) en un NUEVO tab en
|
|
11
|
+
// una sección concreta, deep-link vía hash routing (p.ej. …/#/admin/06-sla-settings). `section` puede
|
|
12
|
+
// llevar ancla de heading (…?id=slug). Pensado para la barra de título de un dialog.
|
|
13
|
+
// Regla de proyecto: si un dialog tiene sección de ayuda, llevar este botón (ver memoria dialog-help-button).
|
|
14
|
+
const DEFAULT_DOCS_URL = 'http://localhost:4000'; // fallback si no hay docsUrl configurado
|
|
15
|
+
const HelpButton = ({ docsUrl, section }) => {
|
|
16
|
+
const open = () => {
|
|
17
|
+
const base = (docsUrl || DEFAULT_DOCS_URL).replace(/\/+$/, '');
|
|
18
|
+
window.open(`${base}/#/${section}`, '_blank', 'noopener,noreferrer');
|
|
19
|
+
};
|
|
20
|
+
return (react_1.default.createElement(material_1.Tooltip, { arrow: true, title: 'Open the guide for this section' },
|
|
21
|
+
react_1.default.createElement(material_1.IconButton, { size: 'small', "aria-label": 'help', onClick: open },
|
|
22
|
+
react_1.default.createElement(icons_material_1.HelpOutline, { fontSize: 'small' }))));
|
|
23
|
+
};
|
|
24
|
+
exports.HelpButton = HelpButton;
|
|
@@ -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,10 @@ 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';
|
|
93
|
+
export { HelpButton } from './HelpButton';
|
|
94
|
+
export type { IHelpButtonProps } from './HelpButton';
|
|
91
95
|
export interface ITabSummary {
|
|
92
96
|
name: string;
|
|
93
97
|
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.HelpButton = 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,7 @@ 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; } });
|
|
58
|
+
var HelpButton_1 = require("./HelpButton");
|
|
59
|
+
Object.defineProperty(exports, "HelpButton", { enumerable: true, get: function () { return HelpButton_1.HelpButton; } });
|