@openwebf/react-cupertino-ui 0.3.34 → 0.4.1
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/README.md +207 -0
- package/dist/index.d.mts +115 -1
- package/dist/index.d.ts +115 -1
- package/dist/index.js +55 -10
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +54 -10
- package/dist/index.mjs.map +1 -1
- package/package.json +5 -6
package/README.md
ADDED
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
# WebF Cupertino UI
|
|
2
|
+
|
|
3
|
+
A Cupertino UI component set for WebF.
|
|
4
|
+
|
|
5
|
+
It wraps Flutter's native Cupertino widgets as HTML custom elements (e.g. `<flutter-cupertino-button>`),
|
|
6
|
+
so you can build Flutter app UIs using web technologies with WebF.
|
|
7
|
+
|
|
8
|
+
## React / Vue (npm) — Install & Use
|
|
9
|
+
|
|
10
|
+
These npm packages are for **WebF JavaScript developers**. They provide framework integrations and
|
|
11
|
+
TypeScript types for the Cupertino custom elements rendered by Flutter.
|
|
12
|
+
|
|
13
|
+
> This is not a “run in the browser” UI library. You still need a Flutter app with WebF + this
|
|
14
|
+
> Flutter package installed (see the next section).
|
|
15
|
+
|
|
16
|
+
### Install
|
|
17
|
+
|
|
18
|
+
Vue:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install @openwebf/vue-cupertino-ui
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
React:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npm install @openwebf/react-cupertino-ui
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### React usage (from `@openwebf/react-cupertino-ui`)
|
|
31
|
+
|
|
32
|
+
```tsx
|
|
33
|
+
import React, { useState } from 'react';
|
|
34
|
+
import {
|
|
35
|
+
FlutterCupertinoButton,
|
|
36
|
+
FlutterCupertinoInput,
|
|
37
|
+
FlutterCupertinoSwitch,
|
|
38
|
+
} from '@openwebf/react-cupertino-ui';
|
|
39
|
+
|
|
40
|
+
export function App() {
|
|
41
|
+
const [username, setUsername] = useState('');
|
|
42
|
+
const [enabled, setEnabled] = useState(false);
|
|
43
|
+
|
|
44
|
+
return (
|
|
45
|
+
<>
|
|
46
|
+
<FlutterCupertinoInput
|
|
47
|
+
val={username}
|
|
48
|
+
placeholder="Enter username"
|
|
49
|
+
onInput={(e) => setUsername(e.detail)}
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<FlutterCupertinoSwitch
|
|
53
|
+
checked={enabled}
|
|
54
|
+
onChange={(e) => setEnabled(e.detail)}
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<FlutterCupertinoButton onClick={() => console.log({ username, enabled })}>
|
|
58
|
+
Submit
|
|
59
|
+
</FlutterCupertinoButton>
|
|
60
|
+
</>
|
|
61
|
+
);
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Vue usage (from `@openwebf/vue-cupertino-ui`)
|
|
66
|
+
|
|
67
|
+
1) Enable template type-checking for the custom elements by referencing the package types (for
|
|
68
|
+
example in `src/env.d.ts`):
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
/// <reference types="@openwebf/vue-cupertino-ui" />
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
2) Use the custom elements in your SFC templates:
|
|
75
|
+
|
|
76
|
+
```vue
|
|
77
|
+
<template>
|
|
78
|
+
<flutter-cupertino-input
|
|
79
|
+
:val="username"
|
|
80
|
+
placeholder="Enter username"
|
|
81
|
+
@input="(e) => (username = e.detail)"
|
|
82
|
+
/>
|
|
83
|
+
|
|
84
|
+
<flutter-cupertino-switch
|
|
85
|
+
:checked="enabled"
|
|
86
|
+
@change="(e) => (enabled = e.detail)"
|
|
87
|
+
/>
|
|
88
|
+
|
|
89
|
+
<flutter-cupertino-button @click="submit">
|
|
90
|
+
Submit
|
|
91
|
+
</flutter-cupertino-button>
|
|
92
|
+
</template>
|
|
93
|
+
|
|
94
|
+
<script setup lang="ts">
|
|
95
|
+
import { ref } from 'vue';
|
|
96
|
+
|
|
97
|
+
const username = ref('');
|
|
98
|
+
const enabled = ref(false);
|
|
99
|
+
|
|
100
|
+
function submit() {
|
|
101
|
+
console.log({ username: username.value, enabled: enabled.value });
|
|
102
|
+
}
|
|
103
|
+
</script>
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
## Flutter (WebF runtime) — Install & Use
|
|
107
|
+
|
|
108
|
+
The npm packages above only provide types/framework wrappers. The actual rendering happens inside
|
|
109
|
+
your Flutter app via WebF + this Flutter package.
|
|
110
|
+
|
|
111
|
+
### 1) Add dependencies
|
|
112
|
+
|
|
113
|
+
Add `webf_cupertino_ui` to your `pubspec.yaml`:
|
|
114
|
+
|
|
115
|
+
```yaml
|
|
116
|
+
dependencies:
|
|
117
|
+
webf_cupertino_ui: ^0.4.0
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
This package depends on WebF (`webf: ^0.24.0`) and will pull it in automatically, but you can pin it
|
|
121
|
+
explicitly if your app needs to.
|
|
122
|
+
|
|
123
|
+
### 2) Register the custom elements
|
|
124
|
+
|
|
125
|
+
Call `installWebFCupertinoUI()` before creating/loading any WebF pages:
|
|
126
|
+
|
|
127
|
+
```dart
|
|
128
|
+
import 'package:flutter/material.dart';
|
|
129
|
+
import 'package:webf_cupertino_ui/webf_cupertino_ui.dart';
|
|
130
|
+
|
|
131
|
+
void main() {
|
|
132
|
+
installWebFCupertinoUI();
|
|
133
|
+
runApp(const MyApp());
|
|
134
|
+
}
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
Now your WebF pages can use the Cupertino tags (e.g. `<flutter-cupertino-button>`) and they will
|
|
138
|
+
render as real Flutter Cupertino widgets.
|
|
139
|
+
|
|
140
|
+
## Features
|
|
141
|
+
|
|
142
|
+
- **Native Flutter Widgets**: Use Flutter's native Cupertino widgets through web technologies
|
|
143
|
+
- **Web Framework Development**: Build your Flutter app UI with Vue.js or React
|
|
144
|
+
- **Custom HTML Elements**: Cupertino widgets exposed as HTML custom elements
|
|
145
|
+
- **Full Native Performance**: Renders as native Flutter widgets, not web views
|
|
146
|
+
- **TypeScript Support**: Complete type definitions for better development experience
|
|
147
|
+
|
|
148
|
+
## Components & Docs
|
|
149
|
+
|
|
150
|
+
Component docs live in `lib/src/*.md` (React-focused):
|
|
151
|
+
- [FlutterCupertinoActionSheet](lib/src/action_sheet.md)
|
|
152
|
+
- [FlutterCupertinoAlert](lib/src/alert.md)
|
|
153
|
+
- [FlutterCupertinoButton](lib/src/button.md)
|
|
154
|
+
- [FlutterCupertinoCheckbox](lib/src/checkbox.md)
|
|
155
|
+
- [FlutterCupertinoContextMenu](lib/src/context_menu.md)
|
|
156
|
+
- [FlutterCupertinoDatePicker](lib/src/date_picker.md)
|
|
157
|
+
- [FlutterCupertinoFormSection](lib/src/form_section.md)
|
|
158
|
+
- [FlutterCupertinoInput](lib/src/input.md)
|
|
159
|
+
- [FlutterCupertinoListSection](lib/src/list_section.md)
|
|
160
|
+
- [FlutterCupertinoListTile](lib/src/list_tile.md)
|
|
161
|
+
- [FlutterCupertinoModalPopup](lib/src/modal_popup.md)
|
|
162
|
+
- [FlutterCupertinoRadio](lib/src/radio.md)
|
|
163
|
+
- [FlutterCupertinoSearchTextField](lib/src/search_text_field.md)
|
|
164
|
+
- [FlutterCupertinoSlider](lib/src/slider.md)
|
|
165
|
+
- [FlutterCupertinoSlidingSegmentedControl](lib/src/sliding-segmented-control.md)
|
|
166
|
+
- [FlutterCupertinoSwitch](lib/src/switch.md)
|
|
167
|
+
- [FlutterCupertinoTabBar](lib/src/tab_bar.md)
|
|
168
|
+
- [FlutterCupertinoTabScaffold](lib/src/tab_scaffold.md)
|
|
169
|
+
- [FlutterCupertinoTabView](lib/src/tab_view.md)
|
|
170
|
+
- [FlutterCupertinoTextFormFieldRow](lib/src/text_form_field_row.md)
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
## Contributing & Testing (via `webf codegen`)
|
|
174
|
+
|
|
175
|
+
This repo is the source of truth for:
|
|
176
|
+
- Flutter custom elements (`lib/src/*.dart`)
|
|
177
|
+
- TypeScript typings (`lib/src/*.d.ts`)
|
|
178
|
+
- Generated Dart bindings (`lib/src/*_bindings_generated.dart`, generated by `webf codegen`)
|
|
179
|
+
- Generated npm packages (`@openwebf/react-cupertino-ui`, `@openwebf/vue-cupertino-ui`)
|
|
180
|
+
|
|
181
|
+
Typical workflow:
|
|
182
|
+
|
|
183
|
+
1) Update or add typings in `lib/src/*.d.ts`
|
|
184
|
+
2) Regenerate Dart bindings:
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
webf codegen --dart-only
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
3) Generate the React/Vue npm packages (optionally add `--publish-to-npm`):
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
webf codegen --framework react --package-name @openwebf/react-cupertino-ui
|
|
194
|
+
webf codegen --framework vue --package-name @openwebf/vue-cupertino-ui
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
4) Run tests:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
flutter test
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
See `CONTRIBUTING.md` and `docs/migration-rules.md` for more details and conventions.
|
|
204
|
+
|
|
205
|
+
## License
|
|
206
|
+
|
|
207
|
+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
|
package/dist/index.d.mts
CHANGED
|
@@ -2961,6 +2961,120 @@ declare const FlutterCupertinoFormRow: React.ForwardRefExoticComponent<FlutterCu
|
|
|
2961
2961
|
children?: React.ReactNode;
|
|
2962
2962
|
} & React.RefAttributes<FlutterCupertinoFormRowElement>>;
|
|
2963
2963
|
|
|
2964
|
+
interface FlutterCupertinoDatePickerProps {
|
|
2965
|
+
/**
|
|
2966
|
+
* Display mode of the picker.
|
|
2967
|
+
* - 'time'
|
|
2968
|
+
* - 'date'
|
|
2969
|
+
* - 'dateAndTime'
|
|
2970
|
+
* - 'monthYear'
|
|
2971
|
+
* Default: 'dateAndTime'.
|
|
2972
|
+
*/
|
|
2973
|
+
mode?: string;
|
|
2974
|
+
/**
|
|
2975
|
+
* Minimum selectable date/time, encoded as an ISO8601 string.
|
|
2976
|
+
* Example: '2024-01-01T00:00:00.000'.
|
|
2977
|
+
*/
|
|
2978
|
+
minimumDate?: string;
|
|
2979
|
+
/**
|
|
2980
|
+
* Maximum selectable date/time, encoded as an ISO8601 string.
|
|
2981
|
+
* Example: '2025-12-31T23:59:59.000'.
|
|
2982
|
+
*/
|
|
2983
|
+
maximumDate?: string;
|
|
2984
|
+
/**
|
|
2985
|
+
* Minimum year in 'date' / 'monthYear' modes.
|
|
2986
|
+
* Default: 1.
|
|
2987
|
+
*/
|
|
2988
|
+
minimumYear?: number;
|
|
2989
|
+
/**
|
|
2990
|
+
* Maximum year in 'date' / 'monthYear' modes.
|
|
2991
|
+
* When omitted, there is no upper limit.
|
|
2992
|
+
*/
|
|
2993
|
+
maximumYear?: number;
|
|
2994
|
+
/**
|
|
2995
|
+
* Minute interval for the minutes column.
|
|
2996
|
+
* Must be a positive factor of 60. Default: 1.
|
|
2997
|
+
*/
|
|
2998
|
+
minuteInterval?: number;
|
|
2999
|
+
/**
|
|
3000
|
+
* Whether to use 24-hour format for time display.
|
|
3001
|
+
* Default: false (12-hour with AM/PM).
|
|
3002
|
+
*/
|
|
3003
|
+
use24H?: boolean;
|
|
3004
|
+
/**
|
|
3005
|
+
* Whether to show the day of week in 'date' mode.
|
|
3006
|
+
* Default: false.
|
|
3007
|
+
*/
|
|
3008
|
+
showDayOfWeek?: boolean;
|
|
3009
|
+
/**
|
|
3010
|
+
* Initial value of the picker, encoded as an ISO8601 string.
|
|
3011
|
+
* When omitted, defaults to `DateTime.now()` at the time of first build.
|
|
3012
|
+
*/
|
|
3013
|
+
value?: string;
|
|
3014
|
+
/**
|
|
3015
|
+
* Fired whenever the selected date/time changes according to
|
|
3016
|
+
* the underlying widget's change reporting behavior.
|
|
3017
|
+
* detail = ISO8601 string of the selected DateTime.
|
|
3018
|
+
*/
|
|
3019
|
+
onChange?: (event: CustomEvent<string>) => void;
|
|
3020
|
+
/**
|
|
3021
|
+
* HTML id attribute
|
|
3022
|
+
*/
|
|
3023
|
+
id?: string;
|
|
3024
|
+
/**
|
|
3025
|
+
* Additional CSS styles
|
|
3026
|
+
*/
|
|
3027
|
+
style?: React.CSSProperties;
|
|
3028
|
+
/**
|
|
3029
|
+
* Children elements
|
|
3030
|
+
*/
|
|
3031
|
+
children?: React.ReactNode;
|
|
3032
|
+
/**
|
|
3033
|
+
* Additional CSS class names
|
|
3034
|
+
*/
|
|
3035
|
+
className?: string;
|
|
3036
|
+
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Element interface with methods accessible via ref
|
|
3039
|
+
* @example
|
|
3040
|
+
* ```tsx
|
|
3041
|
+
* const ref = useRef<FlutterCupertinoDatePickerElement>(null);
|
|
3042
|
+
* // Call methods on the element
|
|
3043
|
+
* ref.current?.finishRefresh('success');
|
|
3044
|
+
* ```
|
|
3045
|
+
*/
|
|
3046
|
+
interface FlutterCupertinoDatePickerElement extends WebFElementWithMethods<{
|
|
3047
|
+
/**
|
|
3048
|
+
* Imperatively set the current value.
|
|
3049
|
+
* The argument must be an ISO8601 string (same format as `value`).
|
|
3050
|
+
*/
|
|
3051
|
+
setValue(value: string): void;
|
|
3052
|
+
}> {
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* Properties for <flutter-cupertino-date-picker>.
|
|
3056
|
+
*
|
|
3057
|
+
* @example
|
|
3058
|
+
* ```tsx
|
|
3059
|
+
* const ref = useRef<FlutterCupertinoDatePickerElement>(null);
|
|
3060
|
+
*
|
|
3061
|
+
* <FlutterCupertinoDatePicker
|
|
3062
|
+
* ref={ref}
|
|
3063
|
+
* // Add props here
|
|
3064
|
+
* >
|
|
3065
|
+
* Content
|
|
3066
|
+
* </FlutterCupertinoDatePicker>
|
|
3067
|
+
*
|
|
3068
|
+
* // Call methods on the element
|
|
3069
|
+
* ref.current?.finishRefresh('success');
|
|
3070
|
+
* ```
|
|
3071
|
+
*/
|
|
3072
|
+
declare const FlutterCupertinoDatePicker: React.ForwardRefExoticComponent<FlutterCupertinoDatePickerProps & {
|
|
3073
|
+
className?: string;
|
|
3074
|
+
style?: React.CSSProperties;
|
|
3075
|
+
children?: React.ReactNode;
|
|
3076
|
+
} & React.RefAttributes<FlutterCupertinoDatePickerElement>>;
|
|
3077
|
+
|
|
2964
3078
|
/**
|
|
2965
3079
|
* Properties for <flutter-cupertino-context-menu>.
|
|
2966
3080
|
* Wraps Flutter's CupertinoContextMenu.
|
|
@@ -3505,4 +3619,4 @@ declare const FlutterCupertinoActionSheet: React.ForwardRefExoticComponent<Flutt
|
|
|
3505
3619
|
children?: React.ReactNode;
|
|
3506
3620
|
} & React.RefAttributes<FlutterCupertinoActionSheetElement>>;
|
|
3507
3621
|
|
|
3508
|
-
export { CupertinoColors, CupertinoIcons, FlutterCupertinoActionSheet, type FlutterCupertinoActionSheetElement, FlutterCupertinoAlert, type FlutterCupertinoAlertElement, FlutterCupertinoButton, type FlutterCupertinoButtonElement, FlutterCupertinoCheckbox, type FlutterCupertinoCheckboxElement, FlutterCupertinoContextMenu, type FlutterCupertinoContextMenuElement, FlutterCupertinoFormRow, type FlutterCupertinoFormRowElement, FlutterCupertinoFormSection, type FlutterCupertinoFormSectionElement, FlutterCupertinoIcon, type FlutterCupertinoIconElement, FlutterCupertinoInput, type FlutterCupertinoInputElement, FlutterCupertinoListSection, type FlutterCupertinoListSectionElement, FlutterCupertinoListSectionFooter, type FlutterCupertinoListSectionFooterElement, FlutterCupertinoListSectionHeader, type FlutterCupertinoListSectionHeaderElement, FlutterCupertinoListTile, FlutterCupertinoListTileAdditionalInfo, type FlutterCupertinoListTileAdditionalInfoElement, type FlutterCupertinoListTileElement, FlutterCupertinoListTileLeading, type FlutterCupertinoListTileLeadingElement, FlutterCupertinoListTileSubtitle, type FlutterCupertinoListTileSubtitleElement, FlutterCupertinoListTileTrailing, type FlutterCupertinoListTileTrailingElement, FlutterCupertinoModalPopup, type FlutterCupertinoModalPopupElement, FlutterCupertinoRadio, type FlutterCupertinoRadioElement, FlutterCupertinoSearchTextField, type FlutterCupertinoSearchTextFieldElement, FlutterCupertinoSlider, type FlutterCupertinoSliderElement, FlutterCupertinoSlidingSegmentedControl, type FlutterCupertinoSlidingSegmentedControlElement, FlutterCupertinoSlidingSegmentedControlItem, type FlutterCupertinoSlidingSegmentedControlItemElement, FlutterCupertinoSwitch, type FlutterCupertinoSwitchElement, FlutterCupertinoTabBar, type FlutterCupertinoTabBarElement, FlutterCupertinoTabBarItem, type FlutterCupertinoTabBarItemElement, FlutterCupertinoTabScaffold, type FlutterCupertinoTabScaffoldElement, FlutterCupertinoTabScaffoldTab, type FlutterCupertinoTabScaffoldTabElement, FlutterCupertinoTabView, type FlutterCupertinoTabViewElement, FlutterCupertinoTextFormFieldRow, type FlutterCupertinoTextFormFieldRowElement };
|
|
3622
|
+
export { CupertinoColors, CupertinoIcons, FlutterCupertinoActionSheet, type FlutterCupertinoActionSheetElement, FlutterCupertinoAlert, type FlutterCupertinoAlertElement, FlutterCupertinoButton, type FlutterCupertinoButtonElement, FlutterCupertinoCheckbox, type FlutterCupertinoCheckboxElement, FlutterCupertinoContextMenu, type FlutterCupertinoContextMenuElement, FlutterCupertinoDatePicker, type FlutterCupertinoDatePickerElement, FlutterCupertinoFormRow, type FlutterCupertinoFormRowElement, FlutterCupertinoFormSection, type FlutterCupertinoFormSectionElement, FlutterCupertinoIcon, type FlutterCupertinoIconElement, FlutterCupertinoInput, type FlutterCupertinoInputElement, FlutterCupertinoListSection, type FlutterCupertinoListSectionElement, FlutterCupertinoListSectionFooter, type FlutterCupertinoListSectionFooterElement, FlutterCupertinoListSectionHeader, type FlutterCupertinoListSectionHeaderElement, FlutterCupertinoListTile, FlutterCupertinoListTileAdditionalInfo, type FlutterCupertinoListTileAdditionalInfoElement, type FlutterCupertinoListTileElement, FlutterCupertinoListTileLeading, type FlutterCupertinoListTileLeadingElement, FlutterCupertinoListTileSubtitle, type FlutterCupertinoListTileSubtitleElement, FlutterCupertinoListTileTrailing, type FlutterCupertinoListTileTrailingElement, FlutterCupertinoModalPopup, type FlutterCupertinoModalPopupElement, FlutterCupertinoRadio, type FlutterCupertinoRadioElement, FlutterCupertinoSearchTextField, type FlutterCupertinoSearchTextFieldElement, FlutterCupertinoSlider, type FlutterCupertinoSliderElement, FlutterCupertinoSlidingSegmentedControl, type FlutterCupertinoSlidingSegmentedControlElement, FlutterCupertinoSlidingSegmentedControlItem, type FlutterCupertinoSlidingSegmentedControlItemElement, FlutterCupertinoSwitch, type FlutterCupertinoSwitchElement, FlutterCupertinoTabBar, type FlutterCupertinoTabBarElement, FlutterCupertinoTabBarItem, type FlutterCupertinoTabBarItemElement, FlutterCupertinoTabScaffold, type FlutterCupertinoTabScaffoldElement, FlutterCupertinoTabScaffoldTab, type FlutterCupertinoTabScaffoldTabElement, FlutterCupertinoTabView, type FlutterCupertinoTabViewElement, FlutterCupertinoTextFormFieldRow, type FlutterCupertinoTextFormFieldRowElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -2961,6 +2961,120 @@ declare const FlutterCupertinoFormRow: React.ForwardRefExoticComponent<FlutterCu
|
|
|
2961
2961
|
children?: React.ReactNode;
|
|
2962
2962
|
} & React.RefAttributes<FlutterCupertinoFormRowElement>>;
|
|
2963
2963
|
|
|
2964
|
+
interface FlutterCupertinoDatePickerProps {
|
|
2965
|
+
/**
|
|
2966
|
+
* Display mode of the picker.
|
|
2967
|
+
* - 'time'
|
|
2968
|
+
* - 'date'
|
|
2969
|
+
* - 'dateAndTime'
|
|
2970
|
+
* - 'monthYear'
|
|
2971
|
+
* Default: 'dateAndTime'.
|
|
2972
|
+
*/
|
|
2973
|
+
mode?: string;
|
|
2974
|
+
/**
|
|
2975
|
+
* Minimum selectable date/time, encoded as an ISO8601 string.
|
|
2976
|
+
* Example: '2024-01-01T00:00:00.000'.
|
|
2977
|
+
*/
|
|
2978
|
+
minimumDate?: string;
|
|
2979
|
+
/**
|
|
2980
|
+
* Maximum selectable date/time, encoded as an ISO8601 string.
|
|
2981
|
+
* Example: '2025-12-31T23:59:59.000'.
|
|
2982
|
+
*/
|
|
2983
|
+
maximumDate?: string;
|
|
2984
|
+
/**
|
|
2985
|
+
* Minimum year in 'date' / 'monthYear' modes.
|
|
2986
|
+
* Default: 1.
|
|
2987
|
+
*/
|
|
2988
|
+
minimumYear?: number;
|
|
2989
|
+
/**
|
|
2990
|
+
* Maximum year in 'date' / 'monthYear' modes.
|
|
2991
|
+
* When omitted, there is no upper limit.
|
|
2992
|
+
*/
|
|
2993
|
+
maximumYear?: number;
|
|
2994
|
+
/**
|
|
2995
|
+
* Minute interval for the minutes column.
|
|
2996
|
+
* Must be a positive factor of 60. Default: 1.
|
|
2997
|
+
*/
|
|
2998
|
+
minuteInterval?: number;
|
|
2999
|
+
/**
|
|
3000
|
+
* Whether to use 24-hour format for time display.
|
|
3001
|
+
* Default: false (12-hour with AM/PM).
|
|
3002
|
+
*/
|
|
3003
|
+
use24H?: boolean;
|
|
3004
|
+
/**
|
|
3005
|
+
* Whether to show the day of week in 'date' mode.
|
|
3006
|
+
* Default: false.
|
|
3007
|
+
*/
|
|
3008
|
+
showDayOfWeek?: boolean;
|
|
3009
|
+
/**
|
|
3010
|
+
* Initial value of the picker, encoded as an ISO8601 string.
|
|
3011
|
+
* When omitted, defaults to `DateTime.now()` at the time of first build.
|
|
3012
|
+
*/
|
|
3013
|
+
value?: string;
|
|
3014
|
+
/**
|
|
3015
|
+
* Fired whenever the selected date/time changes according to
|
|
3016
|
+
* the underlying widget's change reporting behavior.
|
|
3017
|
+
* detail = ISO8601 string of the selected DateTime.
|
|
3018
|
+
*/
|
|
3019
|
+
onChange?: (event: CustomEvent<string>) => void;
|
|
3020
|
+
/**
|
|
3021
|
+
* HTML id attribute
|
|
3022
|
+
*/
|
|
3023
|
+
id?: string;
|
|
3024
|
+
/**
|
|
3025
|
+
* Additional CSS styles
|
|
3026
|
+
*/
|
|
3027
|
+
style?: React.CSSProperties;
|
|
3028
|
+
/**
|
|
3029
|
+
* Children elements
|
|
3030
|
+
*/
|
|
3031
|
+
children?: React.ReactNode;
|
|
3032
|
+
/**
|
|
3033
|
+
* Additional CSS class names
|
|
3034
|
+
*/
|
|
3035
|
+
className?: string;
|
|
3036
|
+
}
|
|
3037
|
+
/**
|
|
3038
|
+
* Element interface with methods accessible via ref
|
|
3039
|
+
* @example
|
|
3040
|
+
* ```tsx
|
|
3041
|
+
* const ref = useRef<FlutterCupertinoDatePickerElement>(null);
|
|
3042
|
+
* // Call methods on the element
|
|
3043
|
+
* ref.current?.finishRefresh('success');
|
|
3044
|
+
* ```
|
|
3045
|
+
*/
|
|
3046
|
+
interface FlutterCupertinoDatePickerElement extends WebFElementWithMethods<{
|
|
3047
|
+
/**
|
|
3048
|
+
* Imperatively set the current value.
|
|
3049
|
+
* The argument must be an ISO8601 string (same format as `value`).
|
|
3050
|
+
*/
|
|
3051
|
+
setValue(value: string): void;
|
|
3052
|
+
}> {
|
|
3053
|
+
}
|
|
3054
|
+
/**
|
|
3055
|
+
* Properties for <flutter-cupertino-date-picker>.
|
|
3056
|
+
*
|
|
3057
|
+
* @example
|
|
3058
|
+
* ```tsx
|
|
3059
|
+
* const ref = useRef<FlutterCupertinoDatePickerElement>(null);
|
|
3060
|
+
*
|
|
3061
|
+
* <FlutterCupertinoDatePicker
|
|
3062
|
+
* ref={ref}
|
|
3063
|
+
* // Add props here
|
|
3064
|
+
* >
|
|
3065
|
+
* Content
|
|
3066
|
+
* </FlutterCupertinoDatePicker>
|
|
3067
|
+
*
|
|
3068
|
+
* // Call methods on the element
|
|
3069
|
+
* ref.current?.finishRefresh('success');
|
|
3070
|
+
* ```
|
|
3071
|
+
*/
|
|
3072
|
+
declare const FlutterCupertinoDatePicker: React.ForwardRefExoticComponent<FlutterCupertinoDatePickerProps & {
|
|
3073
|
+
className?: string;
|
|
3074
|
+
style?: React.CSSProperties;
|
|
3075
|
+
children?: React.ReactNode;
|
|
3076
|
+
} & React.RefAttributes<FlutterCupertinoDatePickerElement>>;
|
|
3077
|
+
|
|
2964
3078
|
/**
|
|
2965
3079
|
* Properties for <flutter-cupertino-context-menu>.
|
|
2966
3080
|
* Wraps Flutter's CupertinoContextMenu.
|
|
@@ -3505,4 +3619,4 @@ declare const FlutterCupertinoActionSheet: React.ForwardRefExoticComponent<Flutt
|
|
|
3505
3619
|
children?: React.ReactNode;
|
|
3506
3620
|
} & React.RefAttributes<FlutterCupertinoActionSheetElement>>;
|
|
3507
3621
|
|
|
3508
|
-
export { CupertinoColors, CupertinoIcons, FlutterCupertinoActionSheet, type FlutterCupertinoActionSheetElement, FlutterCupertinoAlert, type FlutterCupertinoAlertElement, FlutterCupertinoButton, type FlutterCupertinoButtonElement, FlutterCupertinoCheckbox, type FlutterCupertinoCheckboxElement, FlutterCupertinoContextMenu, type FlutterCupertinoContextMenuElement, FlutterCupertinoFormRow, type FlutterCupertinoFormRowElement, FlutterCupertinoFormSection, type FlutterCupertinoFormSectionElement, FlutterCupertinoIcon, type FlutterCupertinoIconElement, FlutterCupertinoInput, type FlutterCupertinoInputElement, FlutterCupertinoListSection, type FlutterCupertinoListSectionElement, FlutterCupertinoListSectionFooter, type FlutterCupertinoListSectionFooterElement, FlutterCupertinoListSectionHeader, type FlutterCupertinoListSectionHeaderElement, FlutterCupertinoListTile, FlutterCupertinoListTileAdditionalInfo, type FlutterCupertinoListTileAdditionalInfoElement, type FlutterCupertinoListTileElement, FlutterCupertinoListTileLeading, type FlutterCupertinoListTileLeadingElement, FlutterCupertinoListTileSubtitle, type FlutterCupertinoListTileSubtitleElement, FlutterCupertinoListTileTrailing, type FlutterCupertinoListTileTrailingElement, FlutterCupertinoModalPopup, type FlutterCupertinoModalPopupElement, FlutterCupertinoRadio, type FlutterCupertinoRadioElement, FlutterCupertinoSearchTextField, type FlutterCupertinoSearchTextFieldElement, FlutterCupertinoSlider, type FlutterCupertinoSliderElement, FlutterCupertinoSlidingSegmentedControl, type FlutterCupertinoSlidingSegmentedControlElement, FlutterCupertinoSlidingSegmentedControlItem, type FlutterCupertinoSlidingSegmentedControlItemElement, FlutterCupertinoSwitch, type FlutterCupertinoSwitchElement, FlutterCupertinoTabBar, type FlutterCupertinoTabBarElement, FlutterCupertinoTabBarItem, type FlutterCupertinoTabBarItemElement, FlutterCupertinoTabScaffold, type FlutterCupertinoTabScaffoldElement, FlutterCupertinoTabScaffoldTab, type FlutterCupertinoTabScaffoldTabElement, FlutterCupertinoTabView, type FlutterCupertinoTabViewElement, FlutterCupertinoTextFormFieldRow, type FlutterCupertinoTextFormFieldRowElement };
|
|
3622
|
+
export { CupertinoColors, CupertinoIcons, FlutterCupertinoActionSheet, type FlutterCupertinoActionSheetElement, FlutterCupertinoAlert, type FlutterCupertinoAlertElement, FlutterCupertinoButton, type FlutterCupertinoButtonElement, FlutterCupertinoCheckbox, type FlutterCupertinoCheckboxElement, FlutterCupertinoContextMenu, type FlutterCupertinoContextMenuElement, FlutterCupertinoDatePicker, type FlutterCupertinoDatePickerElement, FlutterCupertinoFormRow, type FlutterCupertinoFormRowElement, FlutterCupertinoFormSection, type FlutterCupertinoFormSectionElement, FlutterCupertinoIcon, type FlutterCupertinoIconElement, FlutterCupertinoInput, type FlutterCupertinoInputElement, FlutterCupertinoListSection, type FlutterCupertinoListSectionElement, FlutterCupertinoListSectionFooter, type FlutterCupertinoListSectionFooterElement, FlutterCupertinoListSectionHeader, type FlutterCupertinoListSectionHeaderElement, FlutterCupertinoListTile, FlutterCupertinoListTileAdditionalInfo, type FlutterCupertinoListTileAdditionalInfoElement, type FlutterCupertinoListTileElement, FlutterCupertinoListTileLeading, type FlutterCupertinoListTileLeadingElement, FlutterCupertinoListTileSubtitle, type FlutterCupertinoListTileSubtitleElement, FlutterCupertinoListTileTrailing, type FlutterCupertinoListTileTrailingElement, FlutterCupertinoModalPopup, type FlutterCupertinoModalPopupElement, FlutterCupertinoRadio, type FlutterCupertinoRadioElement, FlutterCupertinoSearchTextField, type FlutterCupertinoSearchTextFieldElement, FlutterCupertinoSlider, type FlutterCupertinoSliderElement, FlutterCupertinoSlidingSegmentedControl, type FlutterCupertinoSlidingSegmentedControlElement, FlutterCupertinoSlidingSegmentedControlItem, type FlutterCupertinoSlidingSegmentedControlItemElement, FlutterCupertinoSwitch, type FlutterCupertinoSwitchElement, FlutterCupertinoTabBar, type FlutterCupertinoTabBarElement, FlutterCupertinoTabBarItem, type FlutterCupertinoTabBarItemElement, FlutterCupertinoTabScaffold, type FlutterCupertinoTabScaffoldElement, FlutterCupertinoTabScaffoldTab, type FlutterCupertinoTabScaffoldTabElement, FlutterCupertinoTabView, type FlutterCupertinoTabViewElement, FlutterCupertinoTextFormFieldRow, type FlutterCupertinoTextFormFieldRowElement };
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ __export(index_exports, {
|
|
|
27
27
|
FlutterCupertinoButton: () => FlutterCupertinoButton,
|
|
28
28
|
FlutterCupertinoCheckbox: () => FlutterCupertinoCheckbox,
|
|
29
29
|
FlutterCupertinoContextMenu: () => FlutterCupertinoContextMenu,
|
|
30
|
+
FlutterCupertinoDatePicker: () => FlutterCupertinoDatePicker,
|
|
30
31
|
FlutterCupertinoFormRow: () => FlutterCupertinoFormRow,
|
|
31
32
|
FlutterCupertinoFormSection: () => FlutterCupertinoFormSection,
|
|
32
33
|
FlutterCupertinoIcon: () => FlutterCupertinoIcon,
|
|
@@ -760,9 +761,52 @@ var FlutterCupertinoFormRow = (0, import_react_core_ui16.createWebFComponent)({
|
|
|
760
761
|
}
|
|
761
762
|
});
|
|
762
763
|
|
|
763
|
-
// src/lib/src/
|
|
764
|
+
// src/lib/src/date-picker.tsx
|
|
764
765
|
var import_react_core_ui17 = require("@openwebf/react-core-ui");
|
|
765
|
-
var
|
|
766
|
+
var FlutterCupertinoDatePicker = (0, import_react_core_ui17.createWebFComponent)({
|
|
767
|
+
tagName: "flutter-cupertino-date-picker",
|
|
768
|
+
displayName: "FlutterCupertinoDatePicker",
|
|
769
|
+
// Map props to attributes
|
|
770
|
+
attributeProps: [
|
|
771
|
+
"mode",
|
|
772
|
+
"minimumDate",
|
|
773
|
+
"maximumDate",
|
|
774
|
+
"minimumYear",
|
|
775
|
+
"maximumYear",
|
|
776
|
+
"minuteInterval",
|
|
777
|
+
"use24H",
|
|
778
|
+
"showDayOfWeek",
|
|
779
|
+
"value"
|
|
780
|
+
],
|
|
781
|
+
// Convert prop names to attribute names if needed
|
|
782
|
+
attributeMap: {
|
|
783
|
+
minimumDate: "minimum-date",
|
|
784
|
+
maximumDate: "maximum-date",
|
|
785
|
+
minimumYear: "minimum-year",
|
|
786
|
+
maximumYear: "maximum-year",
|
|
787
|
+
minuteInterval: "minute-interval",
|
|
788
|
+
use24H: "use-24-h",
|
|
789
|
+
showDayOfWeek: "show-day-of-week"
|
|
790
|
+
},
|
|
791
|
+
// Event handlers
|
|
792
|
+
events: [
|
|
793
|
+
{
|
|
794
|
+
propName: "onChange",
|
|
795
|
+
eventName: "change",
|
|
796
|
+
handler: (callback) => (event) => {
|
|
797
|
+
callback(event);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
],
|
|
801
|
+
// Default prop values
|
|
802
|
+
defaultProps: {
|
|
803
|
+
// Add default values here
|
|
804
|
+
}
|
|
805
|
+
});
|
|
806
|
+
|
|
807
|
+
// src/lib/src/context-menu.tsx
|
|
808
|
+
var import_react_core_ui18 = require("@openwebf/react-core-ui");
|
|
809
|
+
var FlutterCupertinoContextMenu = (0, import_react_core_ui18.createWebFComponent)({
|
|
766
810
|
tagName: "flutter-cupertino-context-menu",
|
|
767
811
|
displayName: "FlutterCupertinoContextMenu",
|
|
768
812
|
// Map props to attributes
|
|
@@ -790,8 +834,8 @@ var FlutterCupertinoContextMenu = (0, import_react_core_ui17.createWebFComponent
|
|
|
790
834
|
});
|
|
791
835
|
|
|
792
836
|
// src/lib/src/checkbox.tsx
|
|
793
|
-
var
|
|
794
|
-
var FlutterCupertinoCheckbox = (0,
|
|
837
|
+
var import_react_core_ui19 = require("@openwebf/react-core-ui");
|
|
838
|
+
var FlutterCupertinoCheckbox = (0, import_react_core_ui19.createWebFComponent)({
|
|
795
839
|
tagName: "flutter-cupertino-checkbox",
|
|
796
840
|
displayName: "FlutterCupertinoCheckbox",
|
|
797
841
|
// Map props to attributes
|
|
@@ -840,8 +884,8 @@ var FlutterCupertinoCheckbox = (0, import_react_core_ui18.createWebFComponent)({
|
|
|
840
884
|
});
|
|
841
885
|
|
|
842
886
|
// src/lib/src/button.tsx
|
|
843
|
-
var
|
|
844
|
-
var FlutterCupertinoButton = (0,
|
|
887
|
+
var import_react_core_ui20 = require("@openwebf/react-core-ui");
|
|
888
|
+
var FlutterCupertinoButton = (0, import_react_core_ui20.createWebFComponent)({
|
|
845
889
|
tagName: "flutter-cupertino-button",
|
|
846
890
|
displayName: "FlutterCupertinoButton",
|
|
847
891
|
// Map props to attributes
|
|
@@ -874,8 +918,8 @@ var FlutterCupertinoButton = (0, import_react_core_ui19.createWebFComponent)({
|
|
|
874
918
|
});
|
|
875
919
|
|
|
876
920
|
// src/lib/src/alert.tsx
|
|
877
|
-
var
|
|
878
|
-
var FlutterCupertinoAlert = (0,
|
|
921
|
+
var import_react_core_ui21 = require("@openwebf/react-core-ui");
|
|
922
|
+
var FlutterCupertinoAlert = (0, import_react_core_ui21.createWebFComponent)({
|
|
879
923
|
tagName: "flutter-cupertino-alert",
|
|
880
924
|
displayName: "FlutterCupertinoAlert",
|
|
881
925
|
// Map props to attributes
|
|
@@ -926,8 +970,8 @@ var FlutterCupertinoAlert = (0, import_react_core_ui20.createWebFComponent)({
|
|
|
926
970
|
});
|
|
927
971
|
|
|
928
972
|
// src/lib/src/action-sheet.tsx
|
|
929
|
-
var
|
|
930
|
-
var FlutterCupertinoActionSheet = (0,
|
|
973
|
+
var import_react_core_ui22 = require("@openwebf/react-core-ui");
|
|
974
|
+
var FlutterCupertinoActionSheet = (0, import_react_core_ui22.createWebFComponent)({
|
|
931
975
|
tagName: "flutter-cupertino-action-sheet",
|
|
932
976
|
displayName: "FlutterCupertinoActionSheet",
|
|
933
977
|
// Map props to attributes
|
|
@@ -2335,6 +2379,7 @@ var CupertinoColors = /* @__PURE__ */ ((CupertinoColors2) => {
|
|
|
2335
2379
|
FlutterCupertinoButton,
|
|
2336
2380
|
FlutterCupertinoCheckbox,
|
|
2337
2381
|
FlutterCupertinoContextMenu,
|
|
2382
|
+
FlutterCupertinoDatePicker,
|
|
2338
2383
|
FlutterCupertinoFormRow,
|
|
2339
2384
|
FlutterCupertinoFormSection,
|
|
2340
2385
|
FlutterCupertinoIcon,
|