@appcorp/app-corp-vista 0.0.96 → 0.0.98
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,28 @@
|
|
|
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.VistaRadioV1 = void 0;
|
|
7
|
+
var react_1 = __importDefault(require("react"));
|
|
8
|
+
var VistaRadioV1 = function (_a) {
|
|
9
|
+
var description = _a.description, handleOnChange = _a.handleOnChange, list = _a.list, selectedValue = _a.selectedValue, title = _a.title;
|
|
10
|
+
return (react_1.default.createElement("fieldset", null,
|
|
11
|
+
react_1.default.createElement("legend", { className: "text-sm/6 font-semibold text-gray-900" }, title),
|
|
12
|
+
react_1.default.createElement("p", { className: "mt-1 text-sm/6 text-gray-600" }, description),
|
|
13
|
+
react_1.default.createElement("div", { className: "mt-6 space-y-6" }, list
|
|
14
|
+
.filter(function (_a) {
|
|
15
|
+
var enabled = _a.enabled;
|
|
16
|
+
return enabled;
|
|
17
|
+
})
|
|
18
|
+
.sort(function (a, b) { return a.order - b.order; })
|
|
19
|
+
.map(function (_a) {
|
|
20
|
+
var id = _a.id, label = _a.label, value = _a.value;
|
|
21
|
+
return (react_1.default.createElement("div", { key: id, className: "flex items-center" },
|
|
22
|
+
react_1.default.createElement("input", { checked: selectedValue.toLowerCase() === value, className: "relative size-4 appearance-none rounded-full border border-gray-300 bg-white before:absolute before:inset-1 before:rounded-full before:bg-white not-checked:before:hidden checked:border-primary checked:bg-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary disabled:border-gray-300 disabled:bg-gray-100 disabled:before:bg-gray-400 forced-colors:appearance-auto forced-colors:before:hidden", defaultChecked: selectedValue.toLowerCase() === value, id: id, name: id, onChange: function (e) {
|
|
23
|
+
return handleOnChange(id, e.target.value);
|
|
24
|
+
}, type: "radio", value: value }),
|
|
25
|
+
react_1.default.createElement("label", { htmlFor: id, className: "ml-3 block text-sm/6 font-medium text-gray-900" }, label)));
|
|
26
|
+
}))));
|
|
27
|
+
};
|
|
28
|
+
exports.VistaRadioV1 = VistaRadioV1;
|
package/package.json
CHANGED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface VistaRadioV1Props {
|
|
2
|
+
description: string;
|
|
3
|
+
list: {
|
|
4
|
+
id: string;
|
|
5
|
+
label: string;
|
|
6
|
+
value: string;
|
|
7
|
+
enabled: boolean;
|
|
8
|
+
order: number;
|
|
9
|
+
}[];
|
|
10
|
+
selectedValue: string;
|
|
11
|
+
title: string;
|
|
12
|
+
handleOnChange: (k: string, v: string) => void;
|
|
13
|
+
}
|
package/utils/form-schema.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ import { VistaSelectV1Props } from "../type/vista-select-type";
|
|
|
5
5
|
import { VistaComboboxV1Props } from "../type/vista-combobox-type";
|
|
6
6
|
import { VistaVerticalDividerV4Props } from "../type/vista-vertical-divider-type";
|
|
7
7
|
import { VistaCheckboxV1Props, VistaCheckboxV2Props, VistaCheckboxV3Props } from "../type/vista-checkbox-type";
|
|
8
|
+
import { VistaRadioV1Props } from "../type/vista-radio-type";
|
|
8
9
|
export declare enum VISTA_FORM_ELEMENTS {
|
|
9
10
|
CHECKBOX_V1 = "CHECKBOX_V1",
|
|
10
11
|
CHECKBOX_V2 = "CHECKBOX_V2",
|
|
@@ -22,7 +23,7 @@ export declare const formSchema: {
|
|
|
22
23
|
CHECKBOX_V3: (props: VistaCheckboxV3Props) => React.JSX.Element;
|
|
23
24
|
COMBOBOX_V1: (props: VistaComboboxV1Props) => React.JSX.Element;
|
|
24
25
|
DIVIDER_V4: (props: VistaVerticalDividerV4Props) => React.JSX.Element;
|
|
25
|
-
RADIO_V1: (props:
|
|
26
|
+
RADIO_V1: (props: VistaRadioV1Props) => React.JSX.Element;
|
|
26
27
|
SELECT_V1: (props: VistaSelectV1Props) => React.JSX.Element;
|
|
27
28
|
TEXT_AREA_V1: (props: VistaTextAreaV1Props) => React.JSX.Element;
|
|
28
29
|
TEXT_INPUT_V1: (props: VistaTextInputV1Props) => React.JSX.Element;
|
package/utils/form-schema.js
CHANGED
|
@@ -25,6 +25,7 @@ var vista_vertical_divider_v4_1 = require("../molecules/vista-vertical-divider-v
|
|
|
25
25
|
var vista_checkbox_v1_1 = require("../molecules/vista-checkbox-v1/vista-checkbox-v1");
|
|
26
26
|
var vista_checkbox_v2_1 = require("../molecules/vista-checkbox-v2/vista-checkbox-v2");
|
|
27
27
|
var vista_checkbox_v3_1 = require("../molecules/vista-checkbox-v3/vista-checkbox-v3");
|
|
28
|
+
var vista_radio_v1_1 = require("../molecules/vista-radio-v1/vista-radio-v1");
|
|
28
29
|
var VISTA_FORM_ELEMENTS;
|
|
29
30
|
(function (VISTA_FORM_ELEMENTS) {
|
|
30
31
|
VISTA_FORM_ELEMENTS["CHECKBOX_V1"] = "CHECKBOX_V1";
|
|
@@ -43,7 +44,7 @@ exports.formSchema = (_a = {},
|
|
|
43
44
|
_a[VISTA_FORM_ELEMENTS.CHECKBOX_V3] = function (props) { return react_1.default.createElement(vista_checkbox_v3_1.VistaCheckboxV3, __assign({}, props)); },
|
|
44
45
|
_a[VISTA_FORM_ELEMENTS.COMBOBOX_V1] = function (props) { return react_1.default.createElement(vista_combobox_v1_1.VistaComboboxV1, __assign({}, props)); },
|
|
45
46
|
_a[VISTA_FORM_ELEMENTS.DIVIDER_V4] = function (props) { return react_1.default.createElement(vista_vertical_divider_v4_1.VistaVerticalDividerV4, __assign({}, props)); },
|
|
46
|
-
_a[VISTA_FORM_ELEMENTS.RADIO_V1] = function (props) { return react_1.default.createElement(
|
|
47
|
+
_a[VISTA_FORM_ELEMENTS.RADIO_V1] = function (props) { return react_1.default.createElement(vista_radio_v1_1.VistaRadioV1, __assign({}, props)); },
|
|
47
48
|
_a[VISTA_FORM_ELEMENTS.SELECT_V1] = function (props) { return react_1.default.createElement(vista_select_v1_1.VistaSelectV1, __assign({}, props)); },
|
|
48
49
|
_a[VISTA_FORM_ELEMENTS.TEXT_AREA_V1] = function (props) { return react_1.default.createElement(vista_text_area_v1_1.VistaTextAreaV1, __assign({}, props)); },
|
|
49
50
|
_a[VISTA_FORM_ELEMENTS.TEXT_INPUT_V1] = function (props) { return react_1.default.createElement(vista_text_input_v1_1.VistaTextInputV1, __assign({}, props)); },
|