@fairys/taro-tools-simple-form-ui 0.0.5

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.
Files changed (68) hide show
  1. package/README.md +0 -0
  2. package/esm/components/calendar/index.d.ts +10 -0
  3. package/esm/components/calendar/index.js +35 -0
  4. package/esm/components/cascader/index.d.ts +10 -0
  5. package/esm/components/cascader/index.js +85 -0
  6. package/esm/components/checkbox.group/index.d.ts +5 -0
  7. package/esm/components/checkbox.group/index.js +14 -0
  8. package/esm/components/clear/index.d.ts +21 -0
  9. package/esm/components/clear/index.js +31 -0
  10. package/esm/components/date.picker/index.d.ts +18 -0
  11. package/esm/components/date.picker/index.js +122 -0
  12. package/esm/components/index.d.ts +8 -0
  13. package/esm/components/index.js +8 -0
  14. package/esm/components/picker/index.d.ts +9 -0
  15. package/esm/components/picker/index.js +45 -0
  16. package/esm/components/popup.search/base.d.ts +2 -0
  17. package/esm/components/popup.search/base.js +70 -0
  18. package/esm/components/popup.search/index.d.ts +9 -0
  19. package/esm/components/popup.search/index.js +157 -0
  20. package/esm/components/popup.search/instance.d.ts +127 -0
  21. package/esm/components/popup.search/instance.js +319 -0
  22. package/esm/components/popup.search/list.table.d.ts +1 -0
  23. package/esm/components/popup.search/list.table.js +91 -0
  24. package/esm/components/popup.search/list.virtual.d.ts +1 -0
  25. package/esm/components/popup.search/list.virtual.js +71 -0
  26. package/esm/components/radio.group/index.d.ts +5 -0
  27. package/esm/components/radio.group/index.js +13 -0
  28. package/esm/form/form.d.ts +30 -0
  29. package/esm/form/form.item.d.ts +54 -0
  30. package/esm/form/form.item.js +172 -0
  31. package/esm/form/form.js +31 -0
  32. package/esm/form/instance/index.d.ts +63 -0
  33. package/esm/form/instance/index.js +141 -0
  34. package/esm/form/item.config.d.ts +87 -0
  35. package/esm/form/item.config.js +105 -0
  36. package/esm/form/layout.d.ts +1784 -0
  37. package/esm/form/layout.js +134 -0
  38. package/esm/index.d.ts +5 -0
  39. package/esm/index.js +5 -0
  40. package/esm/interface.d.ts +4 -0
  41. package/esm/interface.js +0 -0
  42. package/esm/item.config.d.ts +0 -0
  43. package/esm/item.config.js +0 -0
  44. package/esm/styles/index.css +352 -0
  45. package/lib/index.js +96 -0
  46. package/package.json +38 -0
  47. package/src/components/calendar/index.tsx +45 -0
  48. package/src/components/cascader/index.tsx +127 -0
  49. package/src/components/checkbox.group/index.tsx +16 -0
  50. package/src/components/clear/index.tsx +49 -0
  51. package/src/components/date.picker/index.tsx +167 -0
  52. package/src/components/index.ts +8 -0
  53. package/src/components/picker/index.tsx +57 -0
  54. package/src/components/popup.search/base.tsx +51 -0
  55. package/src/components/popup.search/index.tsx +198 -0
  56. package/src/components/popup.search/instance.ts +440 -0
  57. package/src/components/popup.search/list.table.tsx +92 -0
  58. package/src/components/popup.search/list.virtual.tsx +84 -0
  59. package/src/components/radio.group/index.tsx +16 -0
  60. package/src/form/form.item.tsx +280 -0
  61. package/src/form/form.tsx +54 -0
  62. package/src/form/instance/index.ts +222 -0
  63. package/src/form/item.config.tsx +189 -0
  64. package/src/form/layout.tsx +232 -0
  65. package/src/index.tsx +5 -0
  66. package/src/interface.ts +4 -0
  67. package/src/item.config.tsx +202 -0
  68. package/src/styles/index.css +39 -0
package/README.md ADDED
File without changes
@@ -0,0 +1,10 @@
1
+ import { ViewProps } from '@tarojs/components';
2
+ import { CalendarProps } from '@nutui/nutui-react-taro';
3
+ export interface FairysTaroCalendarProps extends Partial<CalendarProps> {
4
+ placeholder?: string;
5
+ value?: string;
6
+ className?: string;
7
+ style?: ViewProps['style'];
8
+ onChange?: (value: string, date: string | string[]) => void;
9
+ }
10
+ export declare const FairysTaroCalendarBase: (props: FairysTaroCalendarProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,35 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { View } from "@tarojs/components";
3
+ import { Calendar } from "@nutui/nutui-react-taro";
4
+ import { useState } from "react";
5
+ import { FairysTaroTextClearBase } from "../clear/index.js";
6
+ const FairysTaroCalendarBase = (props)=>{
7
+ const { placeholder = "\u8BF7\u9009\u62E9", value, className, style, onChange, ...rest } = props;
8
+ const [visible, setVisible] = useState(false);
9
+ return /*#__PURE__*/ jsxs(View, {
10
+ className: `fairys-taro-calendar ${className || ''}`,
11
+ style: style,
12
+ children: [
13
+ /*#__PURE__*/ jsx(FairysTaroTextClearBase, {
14
+ warpClassName: "fairys-taro-calendar-text",
15
+ isValue: !!value,
16
+ onTextClick: ()=>setVisible(true),
17
+ onClearClick: ()=>onChange?.(void 0, void 0),
18
+ children: value || placeholder
19
+ }),
20
+ /*#__PURE__*/ jsx(Calendar, {
21
+ ...rest,
22
+ visible: visible,
23
+ defaultValue: value,
24
+ onClose: ()=>setVisible(false),
25
+ onConfirm: (date)=>{
26
+ const [year, month, day] = date;
27
+ if (year) onChange?.(`${year}-${month}-${day}`, date);
28
+ else onChange?.(void 0, date);
29
+ setVisible(false);
30
+ }
31
+ })
32
+ ]
33
+ });
34
+ };
35
+ export { FairysTaroCalendarBase };
@@ -0,0 +1,10 @@
1
+ import { CascaderProps, CascaderOption } from '@nutui/nutui-react-taro';
2
+ export interface FairysTaroCascaderProps extends Omit<Partial<CascaderProps>, 'visible' | 'onClose' | 'onChange' | 'value'> {
3
+ placeholder?: string;
4
+ labelInValue?: boolean;
5
+ value?: (string | number | CascaderOption)[];
6
+ onChange?: (value: (string | number | CascaderOption)[], pathNodes: CascaderOption[]) => void;
7
+ bodyClassName?: string;
8
+ bodyStyle?: React.CSSProperties;
9
+ }
10
+ export declare const FairysTaroCascaderBase: (props: FairysTaroCascaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,85 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { View } from "@tarojs/components";
3
+ import { Cascader } from "@nutui/nutui-react-taro";
4
+ import { useMemo, useState } from "react";
5
+ import { FairysTaroTextClearBase } from "../clear/index.js";
6
+ const FairysTaroCascaderBase = (props)=>{
7
+ const { placeholder = "\u8BF7\u9009\u62E9", value, className, style, onChange, labelInValue = true, options, optionKey, bodyClassName, bodyStyle, ...rest } = props;
8
+ const [visible, setVisible] = useState(false);
9
+ const valueKey = optionKey?.valueKey || 'value';
10
+ const textKey = optionKey?.textKey || 'text';
11
+ const childrenKey = optionKey?.childrenKey || 'children';
12
+ const render = useMemo(()=>{
13
+ if (Array.isArray(value) && value.length) if (labelInValue) return value.map((it)=>{
14
+ if ('string' == typeof it || 'number' == typeof it) return it;
15
+ if (labelInValue) return it?.[textKey] || '';
16
+ return '';
17
+ }).filter(Boolean).join('/');
18
+ else {
19
+ const _value = [];
20
+ let _options = options || [];
21
+ while(_options.length){
22
+ const it = _options.shift();
23
+ if ('string' == typeof it || 'number' == typeof it) {
24
+ const findx = _options.findIndex((it)=>it[valueKey] === it);
25
+ if (findx) {
26
+ _value.push(it?.[textKey]);
27
+ _options = it?.[childrenKey] || [];
28
+ } else break;
29
+ } else break;
30
+ }
31
+ return _value.join('/');
32
+ }
33
+ return '';
34
+ }, [
35
+ value,
36
+ labelInValue,
37
+ valueKey,
38
+ textKey
39
+ ]);
40
+ const _value = useMemo(()=>{
41
+ if (Array.isArray(value) && value.length) return value.map((it)=>{
42
+ if ('string' == typeof it || 'number' == typeof it) return it;
43
+ if (labelInValue) return it[valueKey];
44
+ return '';
45
+ }).filter((it)=>'' !== it);
46
+ return [];
47
+ }, [
48
+ value,
49
+ labelInValue,
50
+ valueKey
51
+ ]);
52
+ return /*#__PURE__*/ jsxs(View, {
53
+ className: `fairys-taro-cascader ${className || ''}`,
54
+ style: style,
55
+ children: [
56
+ /*#__PURE__*/ jsx(FairysTaroTextClearBase, {
57
+ warpClassName: "fairys-taro-cascader-text",
58
+ isValue: !!render,
59
+ onTextClick: ()=>setVisible(true),
60
+ onClearClick: ()=>onChange?.(void 0, void 0),
61
+ children: render || placeholder
62
+ }),
63
+ /*#__PURE__*/ jsx(Cascader, {
64
+ ...rest,
65
+ className: `fairys-taro-cascader-body fairystaroform__text-left ${bodyClassName || ''}`,
66
+ style: bodyStyle,
67
+ optionKey: optionKey,
68
+ options: options,
69
+ value: _value,
70
+ visible: visible,
71
+ onChange: (value, pathNodes)=>{
72
+ if (labelInValue) {
73
+ const _value = pathNodes.map((it)=>{
74
+ const { children, ...rest } = it;
75
+ return rest;
76
+ });
77
+ onChange?.(_value, pathNodes);
78
+ } else onChange?.(value, pathNodes);
79
+ },
80
+ onClose: ()=>setVisible(false)
81
+ })
82
+ ]
83
+ });
84
+ };
85
+ export { FairysTaroCascaderBase };
@@ -0,0 +1,5 @@
1
+ import { CheckboxGroupProps, CheckboxProps } from '@nutui/nutui-react-taro';
2
+ export interface FairysTaroCheckboxGroupProps extends Partial<CheckboxGroupProps> {
3
+ items?: Partial<CheckboxProps>[];
4
+ }
5
+ export declare const FairysTaroCheckboxGroupBase: (props: FairysTaroCheckboxGroupProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { Checkbox, CheckboxGroup } from "@nutui/nutui-react-taro";
3
+ const FairysTaroCheckboxGroupBase = (props)=>{
4
+ const { items, className, ...rest } = props;
5
+ return /*#__PURE__*/ jsx(CheckboxGroup, {
6
+ className: `fairys-taro-checkbox-group ${className || ''}`,
7
+ direction: "horizontal",
8
+ ...rest,
9
+ children: items?.map((item)=>/*#__PURE__*/ jsx(Checkbox, {
10
+ ...item
11
+ }, item.value))
12
+ });
13
+ };
14
+ export { FairysTaroCheckboxGroupBase };
@@ -0,0 +1,21 @@
1
+ import { ITouchEvent } from '@tarojs/components';
2
+ export interface SVG_IconProps {
3
+ className?: string;
4
+ style?: React.CSSProperties;
5
+ viewBox?: string;
6
+ name?: string;
7
+ color?: string;
8
+ width?: string | number;
9
+ height?: string | number;
10
+ size?: string | number;
11
+ svg64?: string;
12
+ svgSrc?: string;
13
+ children?: React.ReactNode;
14
+ fallback?: boolean;
15
+ isValue?: boolean;
16
+ warpClassName?: string;
17
+ warpStyle?: React.CSSProperties;
18
+ onTextClick?: (event: ITouchEvent) => void;
19
+ onClearClick?: (event: React.MouseEvent) => void;
20
+ }
21
+ export declare const FairysTaroTextClearBase: (props: SVG_IconProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,31 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { Close2 } from "@nutui/icons-react-taro";
3
+ import { Text, View } from "@tarojs/components";
4
+ import clsx from "clsx";
5
+ import { Fragment, useMemo } from "react";
6
+ const FairysTaroTextClearBase = (props)=>{
7
+ const { isValue = true, children, warpClassName, warpStyle, onTextClick, onClearClick, ...rest } = props;
8
+ const clsx_text = useMemo(()=>clsx('fairys-taro-text fairystaroform__flex-1', {
9
+ 'fairys-taro-text-placeholder fairystaroform__text-gray-600 fairystaroform__font-normal': !isValue,
10
+ 'fairys-taro-text-value fairystaroform__text-black': isValue
11
+ }), [
12
+ isValue
13
+ ]);
14
+ return /*#__PURE__*/ jsxs(View, {
15
+ className: `fairys-taro-clear fairystaroform__flex fairystaroform__items-center fairystaroform__gap-1 ${warpClassName || ''}`,
16
+ style: warpStyle,
17
+ children: [
18
+ /*#__PURE__*/ jsx(Text, {
19
+ onClick: onTextClick,
20
+ className: clsx_text,
21
+ children: children
22
+ }),
23
+ isValue ? /*#__PURE__*/ jsx(Close2, {
24
+ color: "#c2c4cc",
25
+ onClick: onClearClick,
26
+ ...rest
27
+ }) : /*#__PURE__*/ jsx(Fragment, {})
28
+ ]
29
+ });
30
+ };
31
+ export { FairysTaroTextClearBase };
@@ -0,0 +1,18 @@
1
+ import { DatePickerProps } from '@nutui/nutui-react-taro';
2
+ export interface FairysTaroDatePickerProps extends Omit<Partial<DatePickerProps>, 'value' | 'onChange'> {
3
+ placeholder?: string;
4
+ /**
5
+ * 日期格式
6
+ * @description
7
+ * 当 type 为 date 时,格式为 YYYY-MM-DD
8
+ * 当 type 为 time 时,格式为 HH:mm:ss
9
+ * 当 type 为 year-month 时,格式为 YYYY-MM
10
+ * 当 type 为 month-day 时,格式为 MM-DD
11
+ * 当 type 为 datehour 时,格式为 YYYY-MM-DD HH
12
+ * 当 type 为 datetime 时,格式为 YYYY-MM-DD HH:mm
13
+ * 当 type 为 hour-minutes 时,格式为 HH:mm
14
+ */
15
+ value?: string | Date;
16
+ onChange?: (value?: string) => void;
17
+ }
18
+ export declare const FairysTaroDatePickerBase: (props: FairysTaroDatePickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,122 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { View } from "@tarojs/components";
3
+ import { DatePicker } from "@nutui/nutui-react-taro";
4
+ import { useMemo, useState } from "react";
5
+ import { FairysTaroTextClearBase } from "../clear/index.js";
6
+ const getDate = (selectedValue, type)=>{
7
+ if (Array.isArray(selectedValue) && selectedValue.length) {
8
+ const [year, month, day, hour, minute, second] = selectedValue;
9
+ let date = `${year}-${month}-${day} ${hour}:${minute}`;
10
+ if ('date' === type) date = `${year}-${month}-${day}`;
11
+ else if ('time' === type) date = `${hour}:${minute}:${second}`;
12
+ else if ('year-month' === type) date = `${year}-${month}`;
13
+ else if ('month-day' === type) date = `${month}-${day}`;
14
+ else if ('datehour' === type) date = `${year}-${month}-${day} ${hour}`;
15
+ else if ('datetime' === type) date = `${year}-${month}-${day} ${hour}:${minute}`;
16
+ else if ('hour-minutes' === type) date = `${hour}:${minute}`;
17
+ return date;
18
+ }
19
+ };
20
+ const renderDate = (date, type)=>{
21
+ let renderStr;
22
+ let _value;
23
+ const defaultValue = new Date();
24
+ if (date) {
25
+ const isDate = date instanceof Date;
26
+ if ('date' === type) if (isDate) {
27
+ renderStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}`;
28
+ _value = date;
29
+ } else {
30
+ const [year, month, day] = date.split(/[-|\s]/);
31
+ renderStr = `${year}-${month}-${day}`;
32
+ _value = new Date(`${year}-${month}-${day}`);
33
+ }
34
+ else if ('time' === type) if (isDate) {
35
+ renderStr = `${date.getHours()}:${date.getMinutes()}:${date.getSeconds()}`;
36
+ _value = date;
37
+ } else {
38
+ const [hour, minute, second] = date.split(/[:|]/);
39
+ renderStr = `${hour}:${minute}:${second}`;
40
+ _value = new Date(`${defaultValue.getFullYear()}-${defaultValue.getMonth() + 1}-${defaultValue.getDate()} ${hour}:${minute}:${second}`);
41
+ }
42
+ else if ('year-month' === type) if (isDate) {
43
+ renderStr = `${date.getFullYear()}-${date.getMonth() + 1}`;
44
+ _value = date;
45
+ } else {
46
+ const [year, month] = date.split(/[-|\s]/);
47
+ renderStr = `${year}-${month}`;
48
+ _value = new Date(`${year}-${month}-01`);
49
+ }
50
+ else if ('month-day' === type) if (isDate) {
51
+ renderStr = `${date.getMonth() + 1}-${date.getDate()}`;
52
+ _value = date;
53
+ } else {
54
+ const [month, day] = date.split(/[-|\s]/);
55
+ renderStr = `${month}-${day}`;
56
+ _value = new Date(`${defaultValue.getFullYear()}-${month}-${day}`);
57
+ }
58
+ else if ('datehour' === type) if (isDate) {
59
+ renderStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}`;
60
+ _value = date;
61
+ } else {
62
+ const [year, month, day, hour] = date.split(/[-|\s|:]/);
63
+ renderStr = `${year}-${month}-${day} ${hour}`;
64
+ _value = new Date(`${year}-${month}-${day} ${hour}:00:00`);
65
+ }
66
+ else if ('datetime' === type) if (isDate) {
67
+ renderStr = `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()} ${date.getHours()}:${date.getMinutes()}`;
68
+ _value = date;
69
+ } else {
70
+ const [year, month, day, hour, minute] = date.split(/[-|\s|:]/);
71
+ renderStr = `${year}-${month}-${day} ${hour}:${minute}`;
72
+ _value = new Date(`${year}-${month}-${day} ${hour}:${minute}:00`);
73
+ }
74
+ else if ('hour-minutes' === type) if (isDate) {
75
+ renderStr = `${date.getHours()}:${date.getMinutes()}`;
76
+ _value = date;
77
+ } else {
78
+ const [hour, minute] = date.split(/[:|]/);
79
+ renderStr = `${hour}:${minute}`;
80
+ _value = new Date(`${defaultValue.getFullYear()}-${defaultValue.getMonth() + 1}-${defaultValue.getDate()} ${hour}:${minute}:00`);
81
+ }
82
+ }
83
+ return {
84
+ renderStr,
85
+ _value
86
+ };
87
+ };
88
+ const FairysTaroDatePickerBase = (props)=>{
89
+ const { placeholder = "\u8BF7\u9009\u62E9", value, className, style, onChange, type = 'date', ...rest } = props;
90
+ const [visible, setVisible] = useState(false);
91
+ const render = useMemo(()=>renderDate(value, type), [
92
+ value,
93
+ type
94
+ ]);
95
+ return /*#__PURE__*/ jsxs(View, {
96
+ className: `fairys-taro-date-picker ${className || ''}`,
97
+ style: style,
98
+ children: [
99
+ /*#__PURE__*/ jsx(FairysTaroTextClearBase, {
100
+ warpClassName: "fairys-taro-date-picker-text",
101
+ isValue: !!render.renderStr,
102
+ onTextClick: ()=>setVisible(true),
103
+ onClearClick: ()=>onChange?.(void 0),
104
+ children: render.renderStr || placeholder
105
+ }),
106
+ /*#__PURE__*/ jsx(DatePicker, {
107
+ type: type,
108
+ showChinese: true,
109
+ ...rest,
110
+ value: render._value,
111
+ visible: visible,
112
+ onClose: ()=>setVisible(false),
113
+ onConfirm: (_, selectedValue)=>{
114
+ if (Array.isArray(selectedValue) && selectedValue.length) onChange?.(getDate(selectedValue, type));
115
+ else onChange?.(void 0);
116
+ setVisible(false);
117
+ }
118
+ })
119
+ ]
120
+ });
121
+ };
122
+ export { FairysTaroDatePickerBase };
@@ -0,0 +1,8 @@
1
+ export * from './calendar';
2
+ export * from './cascader';
3
+ export * from './checkbox.group';
4
+ export * from './clear';
5
+ export * from './date.picker';
6
+ export * from './picker';
7
+ export * from './popup.search';
8
+ export * from './radio.group';
@@ -0,0 +1,8 @@
1
+ export * from "./calendar/index.js";
2
+ export * from "./cascader/index.js";
3
+ export * from "./checkbox.group/index.js";
4
+ export * from "./clear/index.js";
5
+ export * from "./date.picker/index.js";
6
+ export * from "./picker/index.js";
7
+ export * from "./popup.search/index.js";
8
+ export * from "./radio.group/index.js";
@@ -0,0 +1,9 @@
1
+ import { TaroPickerProps, PickerOptions } from '@nutui/nutui-react-taro';
2
+ export interface FairysTaroPickerProps extends Omit<Partial<TaroPickerProps>, 'value' | 'onChange'> {
3
+ placeholder?: string;
4
+ value?: PickerOptions;
5
+ onChange?: (value: PickerOptions) => void;
6
+ bodyClassName?: string;
7
+ bodyStyle?: React.CSSProperties;
8
+ }
9
+ export declare const FairysTaroPickerBase: (props: FairysTaroPickerProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,45 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { View } from "@tarojs/components";
3
+ import { Picker } from "@nutui/nutui-react-taro";
4
+ import { useMemo, useState } from "react";
5
+ import { FairysTaroTextClearBase } from "../clear/index.js";
6
+ const FairysTaroPickerBase = (props)=>{
7
+ const { placeholder = "\u8BF7\u9009\u62E9", bodyClassName, bodyStyle, className, style, value, onChange, ...rest } = props;
8
+ const [visible, setVisible] = useState(false);
9
+ const _renderValue = useMemo(()=>{
10
+ if (Array.isArray(value)) return value.map((item)=>item.label).join(' / ');
11
+ }, [
12
+ value
13
+ ]);
14
+ const _value = useMemo(()=>{
15
+ if (Array.isArray(value)) return value.map((item)=>item.value);
16
+ }, [
17
+ value
18
+ ]);
19
+ return /*#__PURE__*/ jsxs(View, {
20
+ className: `fairys-taro-picker ${className || ''}`,
21
+ style: style,
22
+ children: [
23
+ /*#__PURE__*/ jsx(FairysTaroTextClearBase, {
24
+ warpClassName: "fairys-taro-picker-text",
25
+ isValue: !!_renderValue,
26
+ onTextClick: ()=>setVisible(true),
27
+ onClearClick: ()=>onChange?.(void 0),
28
+ children: _renderValue || placeholder
29
+ }),
30
+ /*#__PURE__*/ jsx(Picker, {
31
+ ...rest,
32
+ className: `fairys-taro-picker-body fairystaroform__text-left ${bodyClassName || ''}`,
33
+ style: bodyStyle,
34
+ value: _value,
35
+ visible: visible,
36
+ onClose: ()=>setVisible(false),
37
+ onConfirm: (selectedOptions)=>{
38
+ setVisible(false);
39
+ onChange?.(selectedOptions);
40
+ }
41
+ })
42
+ ]
43
+ });
44
+ };
45
+ export { FairysTaroPickerBase };
@@ -0,0 +1,2 @@
1
+ export declare function FairysTaroPopupSearchFooterBase<T = any>(): import("react/jsx-runtime").JSX.Element;
2
+ export declare function FairysTaroPopupSearchInputBase<T = any>(): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,70 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { View } from "@tarojs/components";
3
+ import { Button, Checkbox, Input } from "@nutui/nutui-react-taro";
4
+ import { Fragment } from "react";
5
+ import { useFairysTaroPopupSearchBaseInstanceContext } from "./instance.js";
6
+ import { Del, Search } from "@nutui/icons-react-taro";
7
+ function FairysTaroPopupSearchFooterBase() {
8
+ const [state, instance] = useFairysTaroPopupSearchBaseInstanceContext();
9
+ const operationStatus = state.operationStatus;
10
+ return /*#__PURE__*/ jsxs(View, {
11
+ className: "fairys-taro-popup-search-content-footer fairystaroform__flex fairystaroform__flex-row fairystaroform__items-center fairystaroform__flex-nowrap fairystaroform__py-2 fairystaroform__box-border fairystaroform__px-2",
12
+ children: [
13
+ /*#__PURE__*/ jsxs(View, {
14
+ className: "fairystaroform__flex-1 fairystaroform__flex fairystaroform__flex-row fairystaroform__items-center fairystaroform__flex-nowrap fairystaroform__justify-between",
15
+ children: [
16
+ /*#__PURE__*/ jsx(View, {
17
+ className: "fairystaroform__flex-1",
18
+ children: /*#__PURE__*/ jsx(Checkbox, {
19
+ checked: state.allChecked,
20
+ onChange: instance.onAllChecked,
21
+ label: "\u5168\u9009"
22
+ })
23
+ }),
24
+ 'manage' === operationStatus ? /*#__PURE__*/ jsx(View, {
25
+ className: "fairystaroform__flex-1 fairystaroform__flex fairystaroform__flex-row fairystaroform__items-center fairystaroform__flex-nowrap fairystaroform__justify-end",
26
+ children: /*#__PURE__*/ jsx(Button, {
27
+ icon: /*#__PURE__*/ jsx(Del, {
28
+ color: "#fff"
29
+ }),
30
+ type: "danger",
31
+ onClick: ()=>instance.onDeleteData(),
32
+ children: "\u5220\u9664"
33
+ })
34
+ }) : /*#__PURE__*/ jsx(Fragment, {})
35
+ ]
36
+ }),
37
+ 'select' === operationStatus ? /*#__PURE__*/ jsx(View, {
38
+ className: "fairystaroform__flex-1",
39
+ children: /*#__PURE__*/ jsx(Button, {
40
+ onClick: instance.onSave,
41
+ block: true,
42
+ type: "primary",
43
+ children: "\u786E\u5B9A"
44
+ })
45
+ }) : /*#__PURE__*/ jsx(Fragment, {})
46
+ ]
47
+ });
48
+ }
49
+ function FairysTaroPopupSearchInputBase() {
50
+ const [state, instance] = useFairysTaroPopupSearchBaseInstanceContext({
51
+ sync: true
52
+ });
53
+ const search = state.search || '';
54
+ return /*#__PURE__*/ jsxs(View, {
55
+ className: "fairys-taro-popup-search-content-header fairystaroform__flex fairystaroform__flex-row fairystaroform__items-center fairystaroform__flex-nowrap fairystaroform__px-1 fairystaroform__box-border fairystaroform__pr-4 fairystaroform__border-b-1 fairystaroform__border-b-solid fairystaroform__border-b-gray-200",
56
+ children: [
57
+ /*#__PURE__*/ jsx(Input, {
58
+ placeholder: "\u8BF7\u8F93\u5165",
59
+ value: search,
60
+ onChange: instance.onSearch
61
+ }),
62
+ /*#__PURE__*/ jsx(View, {
63
+ children: /*#__PURE__*/ jsx(Search, {
64
+ className: "fairys-taro-popup-search-content-header-search fairystaroform__text-gray-600 fairystaroform__cursor-pointer"
65
+ })
66
+ })
67
+ ]
68
+ });
69
+ }
70
+ export { FairysTaroPopupSearchFooterBase, FairysTaroPopupSearchInputBase };
@@ -0,0 +1,9 @@
1
+ import { TaroPopupProps } from '@nutui/nutui-react-taro';
2
+ import type { FairysTaroPopupSearchBaseInstanceMount } from './instance';
3
+ /**
4
+ * 如果是多选,怎么移除某几个选中项
5
+ * */
6
+ export interface FairysTaroPopupSearchProps<T = any> extends Partial<TaroPopupProps>, FairysTaroPopupSearchBaseInstanceMount<T> {
7
+ placeholder?: string;
8
+ }
9
+ export declare function FairysTaroPopupSearchBase<T = any>(props: FairysTaroPopupSearchProps<T>): import("react/jsx-runtime").JSX.Element;