@sunggang/ui-lib 0.2.98 → 0.2.99

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.
@@ -18,9 +18,6 @@ import 'react-date-range/dist/locale/index.js';
18
18
  import 'date-fns/addDays/index.js';
19
19
  import 'date-fns/format/index.js';
20
20
  import '@emotion/react';
21
- import '@mui/material/Radio';
22
- import '@mui/material/RadioGroup';
23
- import '@mui/material/FormControlLabel';
24
21
  import '@tanstack/react-table';
25
22
  import '@radix-ui/react-dropdown-menu';
26
23
  import '@radix-ui/react-icons';
package/index.esm.js CHANGED
@@ -18,9 +18,6 @@ import 'react-date-range/dist/locale/index.js';
18
18
  import 'date-fns/addDays/index.js';
19
19
  import 'date-fns/format/index.js';
20
20
  import '@emotion/react';
21
- import '@mui/material/Radio';
22
- import '@mui/material/RadioGroup';
23
- import '@mui/material/FormControlLabel';
24
21
  import '@tanstack/react-table';
25
22
  import '@radix-ui/react-dropdown-menu';
26
23
  import '@radix-ui/react-icons';
package/index.esm2.js CHANGED
@@ -18,9 +18,6 @@ import * as locales from 'react-date-range/dist/locale/index.js';
18
18
  import addDays from 'date-fns/addDays/index.js';
19
19
  import format$1 from 'date-fns/format/index.js';
20
20
  import { keyframes, jsx as jsx$1, css as css$2 } from '@emotion/react';
21
- import Radio from '@mui/material/Radio';
22
- import RadioGroup from '@mui/material/RadioGroup';
23
- import FormControlLabel from '@mui/material/FormControlLabel';
24
21
  import { useReactTable, getCoreRowModel, getPaginationRowModel, getSortedRowModel, getFilteredRowModel, flexRender } from '@tanstack/react-table';
25
22
  import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
26
23
  import { ChevronRightIcon, CheckIcon, DotFilledIcon } from '@radix-ui/react-icons';
@@ -47280,53 +47277,51 @@ var City = function(param) {
47280
47277
  // </div>
47281
47278
  // );
47282
47279
  // };
47283
- var RadioField = function(param) {
47284
- var item = param.item;
47285
- var _item_validateOption;
47286
- var _useFormContext = useFormContext(), control = _useFormContext.control, errors = _useFormContext.formState.errors;
47287
- return /*#__PURE__*/ jsxs("div", {
47288
- className: [
47289
- "w-full min-h-[6rem] h-fit",
47290
- item === null || item === void 0 ? void 0 : item.className
47291
- ].join(" "),
47292
- children: [
47293
- (item === null || item === void 0 ? void 0 : item.label) && /*#__PURE__*/ jsx(FieldLabel, {
47294
- item: item
47295
- }),
47296
- /*#__PURE__*/ jsx(Controller, {
47297
- name: item === null || item === void 0 ? void 0 : item.name,
47298
- control: control,
47299
- rules: (item === null || item === void 0 ? void 0 : (_item_validateOption = item.validateOption) === null || _item_validateOption === void 0 ? void 0 : _item_validateOption.required) ? {
47300
- required: item === null || item === void 0 ? void 0 : item.errorText
47301
- } : undefined,
47302
- defaultValue: item === null || item === void 0 ? void 0 : item.defaultValue,
47303
- render: function(param) {
47304
- var field = param.field;
47305
- var _item_radioOptions;
47306
- return /*#__PURE__*/ jsx(RadioGroup, _object_spread_props$3(_object_spread$6({}, field), {
47307
- row: (item === null || item === void 0 ? void 0 : item.direction) === "horizontal",
47308
- "aria-labelledby": "".concat(item === null || item === void 0 ? void 0 : item.id, "-radio-group-label"),
47309
- children: item === null || item === void 0 ? void 0 : (_item_radioOptions = item.radioOptions) === null || _item_radioOptions === void 0 ? void 0 : _item_radioOptions.map(function(option, index) {
47310
- return /*#__PURE__*/ jsx(FormControlLabel, {
47311
- value: option === null || option === void 0 ? void 0 : option.value,
47312
- control: /*#__PURE__*/ jsx(Radio, _object_spread$6({}, item === null || item === void 0 ? void 0 : item.muiProps)),
47313
- label: option === null || option === void 0 ? void 0 : option.label,
47314
- disabled: (option === null || option === void 0 ? void 0 : option.disabled) || false
47315
- }, index);
47316
- })
47317
- }));
47318
- }
47319
- }),
47320
- validateMsg(errors, item) && /*#__PURE__*/ jsxs("div", {
47321
- className: "pt-1 text-xs text-[#EF5533]",
47322
- children: [
47323
- "*",
47324
- validateMsg(errors, item)
47325
- ]
47326
- })
47327
- ]
47328
- });
47329
- };
47280
+ // const RadioField = ({ item }) => {
47281
+ // const {
47282
+ // control,
47283
+ // formState: { errors },
47284
+ // } = useFormContext();
47285
+ // return (
47286
+ // <div className={['w-full min-h-[6rem] h-fit', item?.className].join(' ')}>
47287
+ // {/* 顯示標籤 */}
47288
+ // {item?.label && <FieldLabel item={item} />}
47289
+ // {/* 渲染 RadioGroup */}
47290
+ // <Controller
47291
+ // name={item?.name}
47292
+ // control={control}
47293
+ // rules={
47294
+ // item?.validateOption?.required
47295
+ // ? { required: item?.errorText }
47296
+ // : undefined
47297
+ // }
47298
+ // defaultValue={item?.defaultValue}
47299
+ // render={({ field }) => (
47300
+ // <RadioGroup
47301
+ // {...field}
47302
+ // row={item?.direction === 'horizontal'} // 支援水平或垂直方向
47303
+ // aria-labelledby={`${item?.id}-radio-group-label`}
47304
+ // >
47305
+ // {item?.radioOptions?.map((option, index) => (
47306
+ // <FormControlLabel
47307
+ // key={index}
47308
+ // value={option?.value}
47309
+ // control={<Radio {...item?.muiProps} />}
47310
+ // label={option?.label}
47311
+ // disabled={option?.disabled || false}
47312
+ // />
47313
+ // ))}
47314
+ // </RadioGroup>
47315
+ // )}
47316
+ // />
47317
+ // {validateMsg(errors, item) && (
47318
+ // <div className="pt-1 text-xs text-[#EF5533]">
47319
+ // *{validateMsg(errors, item)}
47320
+ // </div>
47321
+ // )}
47322
+ // </div>
47323
+ // );
47324
+ // };
47330
47325
  var Textarea = function(param) {
47331
47326
  var item = param.item;
47332
47327
  var _useFormContext = useFormContext(), register = _useFormContext.register, errors = _useFormContext.formState.errors;
@@ -47426,8 +47421,8 @@ var Row = function(param) {
47426
47421
  // case 'checkbox':
47427
47422
  // case 'checkboxGroup':
47428
47423
  // return <CheckboxField {...baseConfig} />;
47429
- case "radio":
47430
- return /*#__PURE__*/ jsx(RadioField, _object_spread$6({}, baseConfig));
47424
+ // case 'radio':
47425
+ // return <RadioField {...baseConfig} />;
47431
47426
  case "textarea":
47432
47427
  return /*#__PURE__*/ jsx(Textarea, _object_spread$6({}, baseConfig));
47433
47428
  case "cityOnly":
@@ -47448,7 +47443,6 @@ var Form = {
47448
47443
  SingleSelect: SingleSelect,
47449
47444
  MultipleSelect: MultipleSelect,
47450
47445
  FieldLabel: FieldLabel,
47451
- RadioField: RadioField,
47452
47446
  Time: Time,
47453
47447
  Textarea: Textarea,
47454
47448
  City: City,
package/index.esm3.js CHANGED
@@ -18,9 +18,6 @@ import 'react-date-range/dist/locale/index.js';
18
18
  import 'date-fns/addDays/index.js';
19
19
  import 'date-fns/format/index.js';
20
20
  import '@emotion/react';
21
- import '@mui/material/Radio';
22
- import '@mui/material/RadioGroup';
23
- import '@mui/material/FormControlLabel';
24
21
  import '@tanstack/react-table';
25
22
  import '@radix-ui/react-dropdown-menu';
26
23
  import '@radix-ui/react-icons';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sunggang/ui-lib",
3
- "version": "0.2.98",
3
+ "version": "0.2.99",
4
4
  "dependencies": {
5
5
  "@emotion/react": "^11.14.0",
6
6
  "@emotion/styled": "^11.14.0",
@@ -26,9 +26,6 @@ export declare const Form: {
26
26
  FieldLabel: ({ item }: {
27
27
  item: any;
28
28
  }) => import("react/jsx-runtime").JSX.Element;
29
- RadioField: ({ item }: {
30
- item: any;
31
- }) => import("react/jsx-runtime").JSX.Element;
32
29
  Time: import("react").FC<FormType>;
33
30
  Textarea: import("react").FC<FormType>;
34
31
  City: import("react").FC<FormType>;