react-native-platform-components 0.5.5 → 0.6.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.
Files changed (78) hide show
  1. package/README.md +342 -72
  2. package/android/src/main/java/com/platformcomponents/PCContextMenuView.kt +419 -0
  3. package/android/src/main/java/com/platformcomponents/PCContextMenuViewManager.kt +200 -0
  4. package/android/src/main/java/com/platformcomponents/PCSelectionMenuView.kt +4 -0
  5. package/android/src/main/java/com/platformcomponents/PlatformComponentsPackage.kt +1 -0
  6. package/app.plugin.cjs +4 -0
  7. package/expo-module.config.json +4 -0
  8. package/ios/PCContextMenu.h +12 -0
  9. package/ios/PCContextMenu.mm +247 -0
  10. package/ios/PCContextMenu.swift +389 -0
  11. package/ios/PCDatePickerView.swift +25 -11
  12. package/lib/commonjs/ContextMenu.js +118 -0
  13. package/lib/commonjs/ContextMenu.js.map +1 -0
  14. package/lib/commonjs/ContextMenuNativeComponent.ts +141 -0
  15. package/lib/commonjs/DatePicker.js +86 -0
  16. package/lib/commonjs/DatePicker.js.map +1 -0
  17. package/lib/commonjs/DatePickerNativeComponent.ts +69 -0
  18. package/lib/commonjs/SelectionMenu.js +73 -0
  19. package/lib/commonjs/SelectionMenu.js.map +1 -0
  20. package/lib/commonjs/SelectionMenuNativeComponent.ts +97 -0
  21. package/lib/commonjs/index.js +50 -0
  22. package/lib/commonjs/index.js.map +1 -0
  23. package/lib/commonjs/package.json +1 -0
  24. package/lib/commonjs/sharedTypes.js +6 -0
  25. package/lib/commonjs/sharedTypes.js.map +1 -0
  26. package/lib/module/ContextMenu.js +111 -0
  27. package/lib/module/ContextMenu.js.map +1 -0
  28. package/lib/module/ContextMenuNativeComponent.ts +141 -0
  29. package/lib/module/index.js +1 -0
  30. package/lib/module/index.js.map +1 -1
  31. package/lib/typescript/commonjs/package.json +1 -0
  32. package/lib/typescript/commonjs/src/ContextMenu.d.ts +79 -0
  33. package/lib/typescript/commonjs/src/ContextMenu.d.ts.map +1 -0
  34. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts +122 -0
  35. package/lib/typescript/commonjs/src/ContextMenuNativeComponent.d.ts.map +1 -0
  36. package/lib/typescript/commonjs/src/DatePicker.d.ts.map +1 -0
  37. package/lib/typescript/commonjs/src/DatePickerNativeComponent.d.ts.map +1 -0
  38. package/lib/typescript/commonjs/src/SelectionMenu.d.ts.map +1 -0
  39. package/lib/typescript/commonjs/src/SelectionMenuNativeComponent.d.ts.map +1 -0
  40. package/lib/typescript/{src → commonjs/src}/index.d.ts +1 -0
  41. package/lib/typescript/commonjs/src/index.d.ts.map +1 -0
  42. package/lib/typescript/commonjs/src/sharedTypes.d.ts.map +1 -0
  43. package/lib/typescript/module/src/ContextMenu.d.ts +79 -0
  44. package/lib/typescript/module/src/ContextMenu.d.ts.map +1 -0
  45. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts +122 -0
  46. package/lib/typescript/module/src/ContextMenuNativeComponent.d.ts.map +1 -0
  47. package/lib/typescript/module/src/DatePicker.d.ts +40 -0
  48. package/lib/typescript/module/src/DatePicker.d.ts.map +1 -0
  49. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts +54 -0
  50. package/lib/typescript/module/src/DatePickerNativeComponent.d.ts.map +1 -0
  51. package/lib/typescript/module/src/SelectionMenu.d.ts +47 -0
  52. package/lib/typescript/module/src/SelectionMenu.d.ts.map +1 -0
  53. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts +78 -0
  54. package/lib/typescript/module/src/SelectionMenuNativeComponent.d.ts.map +1 -0
  55. package/lib/typescript/module/src/index.d.ts +5 -0
  56. package/lib/typescript/module/src/index.d.ts.map +1 -0
  57. package/lib/typescript/module/src/sharedTypes.d.ts +12 -0
  58. package/lib/typescript/module/src/sharedTypes.d.ts.map +1 -0
  59. package/package.json +32 -11
  60. package/plugin/build/index.cjs +26 -0
  61. package/plugin/build/index.d.ts +22 -0
  62. package/plugin/build/index.d.ts.map +1 -0
  63. package/plugin/tsconfig.json +16 -0
  64. package/src/ContextMenu.tsx +209 -0
  65. package/src/ContextMenuNativeComponent.ts +141 -0
  66. package/src/index.tsx +1 -0
  67. package/lib/typescript/src/DatePicker.d.ts.map +0 -1
  68. package/lib/typescript/src/DatePickerNativeComponent.d.ts.map +0 -1
  69. package/lib/typescript/src/SelectionMenu.d.ts.map +0 -1
  70. package/lib/typescript/src/SelectionMenuNativeComponent.d.ts.map +0 -1
  71. package/lib/typescript/src/index.d.ts.map +0 -1
  72. package/lib/typescript/src/sharedTypes.d.ts.map +0 -1
  73. /package/lib/typescript/{src → commonjs/src}/DatePicker.d.ts +0 -0
  74. /package/lib/typescript/{src → commonjs/src}/DatePickerNativeComponent.d.ts +0 -0
  75. /package/lib/typescript/{src → commonjs/src}/SelectionMenu.d.ts +0 -0
  76. /package/lib/typescript/{src → commonjs/src}/SelectionMenuNativeComponent.d.ts +0 -0
  77. /package/lib/typescript/{src → commonjs/src}/sharedTypes.d.ts +0 -0
  78. /package/lib/typescript/{package.json → module/package.json} +0 -0
@@ -0,0 +1,118 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ContextMenu = ContextMenu;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _ContextMenuNativeComponent = _interopRequireDefault(require("./ContextMenuNativeComponent"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ // ContextMenu.tsx
13
+
14
+ /**
15
+ * Attributes for a context menu action.
16
+ */
17
+
18
+ /**
19
+ * A single action in the context menu.
20
+ */
21
+
22
+ /**
23
+ * Convert user-friendly subaction to native format (no further nesting).
24
+ */
25
+ function normalizeSubaction(action) {
26
+ return {
27
+ id: action.id,
28
+ title: action.title,
29
+ subtitle: action.subtitle,
30
+ image: action.image,
31
+ imageColor: action.imageColor,
32
+ attributes: action.attributes ? {
33
+ destructive: action.attributes.destructive ? 'true' : 'false',
34
+ disabled: action.attributes.disabled ? 'true' : 'false',
35
+ hidden: action.attributes.hidden ? 'true' : 'false'
36
+ } : undefined,
37
+ state: action.state
38
+ };
39
+ }
40
+
41
+ /**
42
+ * Convert user-friendly action to native format.
43
+ * Note: Only one level of nesting is supported by the native component.
44
+ */
45
+ function normalizeAction(action) {
46
+ return {
47
+ id: action.id,
48
+ title: action.title,
49
+ subtitle: action.subtitle,
50
+ image: action.image,
51
+ imageColor: action.imageColor,
52
+ attributes: action.attributes ? {
53
+ destructive: action.attributes.destructive ? 'true' : 'false',
54
+ disabled: action.attributes.disabled ? 'true' : 'false',
55
+ hidden: action.attributes.hidden ? 'true' : 'false'
56
+ } : undefined,
57
+ state: action.state,
58
+ subactions: action.subactions?.map(normalizeSubaction)
59
+ };
60
+ }
61
+ function ContextMenu(props) {
62
+ const {
63
+ style,
64
+ title,
65
+ actions,
66
+ disabled,
67
+ trigger = 'longPress',
68
+ onPressAction,
69
+ onMenuOpen,
70
+ onMenuClose,
71
+ children,
72
+ ios,
73
+ android,
74
+ ...viewProps
75
+ } = props;
76
+ const nativeActions = (0, _react.useMemo)(() => actions.map(normalizeAction), [actions]);
77
+ const handlePressAction = (0, _react.useCallback)(e => {
78
+ const {
79
+ actionId,
80
+ actionTitle
81
+ } = e.nativeEvent;
82
+ onPressAction?.(actionId, actionTitle);
83
+ }, [onPressAction]);
84
+ const handleMenuOpen = (0, _react.useCallback)(() => {
85
+ onMenuOpen?.();
86
+ }, [onMenuOpen]);
87
+ const handleMenuClose = (0, _react.useCallback)(() => {
88
+ onMenuClose?.();
89
+ }, [onMenuClose]);
90
+ const nativeIOS = (0, _react.useMemo)(() => {
91
+ if (!ios) return undefined;
92
+ return {
93
+ enablePreview: ios.enablePreview ? 'true' : 'false'
94
+ };
95
+ }, [ios]);
96
+ const nativeAndroid = (0, _react.useMemo)(() => {
97
+ if (!android) return undefined;
98
+ return {
99
+ anchorPosition: android.anchorPosition,
100
+ visible: android.visible ? 'open' : 'closed'
101
+ };
102
+ }, [android]);
103
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_ContextMenuNativeComponent.default, {
104
+ style: style,
105
+ title: title,
106
+ actions: nativeActions,
107
+ interactivity: disabled ? 'disabled' : 'enabled',
108
+ trigger: trigger,
109
+ onPressAction: onPressAction ? handlePressAction : undefined,
110
+ onMenuOpen: onMenuOpen ? handleMenuOpen : undefined,
111
+ onMenuClose: onMenuClose ? handleMenuClose : undefined,
112
+ ios: nativeIOS,
113
+ android: nativeAndroid,
114
+ ...viewProps,
115
+ children: children
116
+ });
117
+ }
118
+ //# sourceMappingURL=ContextMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_ContextMenuNativeComponent","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","normalizeSubaction","action","id","title","subtitle","image","imageColor","attributes","destructive","disabled","hidden","undefined","state","normalizeAction","subactions","map","ContextMenu","props","style","actions","trigger","onPressAction","onMenuOpen","onMenuClose","children","ios","android","viewProps","nativeActions","useMemo","handlePressAction","useCallback","actionId","actionTitle","nativeEvent","handleMenuOpen","handleMenuClose","nativeIOS","enablePreview","nativeAndroid","anchorPosition","visible","jsx","interactivity"],"sourceRoot":"../../src","sources":["ContextMenu.tsx"],"mappings":";;;;;;AACA,IAA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EAAEf,OAAO,CAACe,OAAO,GAAG,MAAM,GAAG;IACtC,CAAC;EACH,CAAC,EAAE,CAACf,OAAO,CAAC,CAAC;EAEb,oBACE,IAAA9C,WAAA,CAAA8D,GAAA,EAAChE,2BAAA,CAAAK,OAAiB;IAChBmC,KAAK,EAAEA,KAAM;IACbf,KAAK,EAAEA,KAAM;IACbgB,OAAO,EAAES,aAAc;IACvBe,aAAa,EAAElC,QAAQ,GAAG,UAAU,GAAG,SAAU;IACjDW,OAAO,EAAEA,OAAQ;IACjBC,aAAa,EAAEA,aAAa,GAAGS,iBAAiB,GAAGnB,SAAU;IAC7DW,UAAU,EAAEA,UAAU,GAAGa,cAAc,GAAGxB,SAAU;IACpDY,WAAW,EAAEA,WAAW,GAAGa,eAAe,GAAGzB,SAAU;IACvDc,GAAG,EAAEY,SAAU;IACfX,OAAO,EAAEa,aAAc;IAAA,GACnBZ,SAAS;IAAAH,QAAA,EAEZA;EAAQ,CACQ,CAAC;AAExB","ignoreList":[]}
@@ -0,0 +1,141 @@
1
+ // ContextMenuNativeComponent.ts
2
+ import type { CodegenTypes, HostComponent, ViewProps } from 'react-native';
3
+ import { codegenNativeComponent } from 'react-native';
4
+
5
+ /**
6
+ * Attributes for a context menu action.
7
+ */
8
+ export type ContextMenuActionAttributes = Readonly<{
9
+ /** Whether the action is destructive (red styling) */
10
+ destructive?: string; // 'true' | 'false'
11
+ /** Whether the action is disabled (grayed out) */
12
+ disabled?: string; // 'true' | 'false'
13
+ /** Whether the action is hidden */
14
+ hidden?: string; // 'true' | 'false'
15
+ }>;
16
+
17
+ /**
18
+ * A leaf subaction (no further nesting to avoid codegen recursion issues).
19
+ */
20
+ export type ContextMenuSubaction = Readonly<{
21
+ /** Unique identifier returned in callbacks */
22
+ id: string;
23
+ /** Display title */
24
+ title: string;
25
+ /** Secondary text (iOS only) */
26
+ subtitle?: string;
27
+ /** Icon name (SF Symbol on iOS, drawable resource on Android) */
28
+ image?: string;
29
+ /** Tint color for the icon (hex string, e.g., "#FF0000") */
30
+ imageColor?: string;
31
+ /** Action attributes */
32
+ attributes?: ContextMenuActionAttributes;
33
+ /** Checkmark state: 'off' | 'on' | 'mixed' */
34
+ state?: string;
35
+ }>;
36
+
37
+ /**
38
+ * A single action in the context menu.
39
+ * Actions can be nested one level via `subactions` for submenus.
40
+ */
41
+ export type ContextMenuAction = Readonly<{
42
+ /** Unique identifier returned in callbacks */
43
+ id: string;
44
+ /** Display title */
45
+ title: string;
46
+ /** Secondary text (iOS only) */
47
+ subtitle?: string;
48
+ /** Icon name (SF Symbol on iOS, drawable resource on Android) */
49
+ image?: string;
50
+ /** Tint color for the icon (hex string, e.g., "#FF0000") */
51
+ imageColor?: string;
52
+ /** Action attributes */
53
+ attributes?: ContextMenuActionAttributes;
54
+ /** Checkmark state: 'off' | 'on' | 'mixed' */
55
+ state?: string;
56
+ /** Nested actions for submenu (one level deep) */
57
+ subactions?: ReadonlyArray<ContextMenuSubaction>;
58
+ }>;
59
+
60
+ /**
61
+ * Event emitted when an action is pressed.
62
+ */
63
+ export type ContextMenuPressActionEvent = Readonly<{
64
+ /** The action's unique identifier */
65
+ actionId: string;
66
+ /** The action's title */
67
+ actionTitle: string;
68
+ }>;
69
+
70
+ /** Interactivity state (no booleans for codegen). */
71
+ export type ContextMenuInteractivity = 'enabled' | 'disabled';
72
+
73
+ /** Trigger mode for opening the menu. */
74
+ export type ContextMenuTrigger = 'longPress' | 'tap';
75
+
76
+ /**
77
+ * iOS-specific configuration.
78
+ */
79
+ export type IOSProps = Readonly<{
80
+ /** Enable preview when long-pressing */
81
+ enablePreview?: string; // 'true' | 'false'
82
+ }>;
83
+
84
+ /**
85
+ * Android-specific configuration.
86
+ */
87
+ export type AndroidProps = Readonly<{
88
+ /** Anchor position for the popup menu */
89
+ anchorPosition?: string; // 'left' | 'right'
90
+ /**
91
+ * Programmatic visibility control (Android only).
92
+ * 'open' to show the menu, 'closed' to hide it.
93
+ */
94
+ visible?: string; // 'open' | 'closed'
95
+ }>;
96
+
97
+ export interface ContextMenuProps extends ViewProps {
98
+ /**
99
+ * Menu title (shown as header on iOS).
100
+ */
101
+ title?: string;
102
+
103
+ /**
104
+ * Menu actions.
105
+ */
106
+ actions: ReadonlyArray<ContextMenuAction>;
107
+
108
+ /**
109
+ * Enabled / disabled state.
110
+ */
111
+ interactivity?: string; // ContextMenuInteractivity
112
+
113
+ /**
114
+ * How the menu is triggered:
115
+ * - 'longPress' (default): Long-press opens the menu
116
+ * - 'tap': Single tap opens the menu
117
+ */
118
+ trigger?: string; // ContextMenuTrigger
119
+
120
+ /**
121
+ * Fired when user presses an action.
122
+ */
123
+ onPressAction?: CodegenTypes.BubblingEventHandler<ContextMenuPressActionEvent>;
124
+
125
+ /**
126
+ * Fired when menu opens.
127
+ */
128
+ onMenuOpen?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
129
+
130
+ /**
131
+ * Fired when menu closes.
132
+ */
133
+ onMenuClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
134
+
135
+ ios?: IOSProps;
136
+ android?: AndroidProps;
137
+ }
138
+
139
+ export default codegenNativeComponent<ContextMenuProps>(
140
+ 'PCContextMenu'
141
+ ) as HostComponent<ContextMenuProps>;
@@ -0,0 +1,86 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.DatePicker = DatePicker;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _DatePickerNativeComponent = _interopRequireDefault(require("./DatePickerNativeComponent"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
13
+ // DatePicker.tsx
14
+
15
+ // Sentinel value for "no date". Using MIN_SAFE_INTEGER ensures we don't
16
+ // conflict with valid negative timestamps (dates before 1970).
17
+ const NO_DATE_SENTINEL = Number.MIN_SAFE_INTEGER;
18
+ function dateToMsOrSentinel(d) {
19
+ if (!d) return NO_DATE_SENTINEL;
20
+ const ms = d.getTime();
21
+ return Number.isFinite(ms) ? ms : NO_DATE_SENTINEL;
22
+ }
23
+ function normalizeVisible(presentation, visible) {
24
+ // Only meaningful in modal presentation. Keep undefined for inline to avoid noise.
25
+ if (presentation !== 'modal') return undefined;
26
+ return visible ? 'open' : 'closed';
27
+ }
28
+ function DatePicker(props) {
29
+ const {
30
+ style,
31
+ date,
32
+ minDate,
33
+ maxDate,
34
+ locale,
35
+ timeZoneName,
36
+ mode,
37
+ presentation = 'modal',
38
+ visible,
39
+ onConfirm,
40
+ onClosed,
41
+ ios,
42
+ android,
43
+ testID
44
+ } = props;
45
+ const isModal = presentation === 'modal';
46
+ const handleConfirm = (0, _react.useCallback)(e => {
47
+ onConfirm?.(new Date(e.nativeEvent.timestampMs));
48
+ }, [onConfirm]);
49
+ const handleClosed = (0, _react.useCallback)(() => {
50
+ onClosed?.();
51
+ }, [onClosed]);
52
+ const nativeProps = {
53
+ style: [styles.picker, style],
54
+ mode,
55
+ locale,
56
+ timeZoneName,
57
+ presentation,
58
+ visible: normalizeVisible(presentation, visible),
59
+ dateMs: dateToMsOrSentinel(date),
60
+ minDateMs: dateToMsOrSentinel(minDate),
61
+ maxDateMs: dateToMsOrSentinel(maxDate),
62
+ onConfirm: onConfirm ? handleConfirm : undefined,
63
+ onClosed: isModal && onClosed ? handleClosed : undefined,
64
+ ios: ios ? {
65
+ preferredStyle: ios.preferredStyle,
66
+ countDownDurationSeconds: ios.countDownDurationSeconds,
67
+ minuteInterval: ios.minuteInterval,
68
+ roundsToMinuteInterval: ios.roundsToMinuteInterval
69
+ } : undefined,
70
+ android: android ? {
71
+ firstDayOfWeek: android.firstDayOfWeek,
72
+ material: android.material,
73
+ dialogTitle: android.dialogTitle,
74
+ positiveButtonTitle: android.positiveButtonTitle,
75
+ negativeButtonTitle: android.negativeButtonTitle
76
+ } : undefined
77
+ };
78
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_DatePickerNativeComponent.default, {
79
+ testID: testID,
80
+ ...nativeProps
81
+ });
82
+ }
83
+ const styles = _reactNative.StyleSheet.create({
84
+ picker: {}
85
+ });
86
+ //# sourceMappingURL=DatePicker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_DatePickerNativeComponent","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","NO_DATE_SENTINEL","Number","MIN_SAFE_INTEGER","dateToMsOrSentinel","d","ms","getTime","isFinite","normalizeVisible","presentation","visible","undefined","DatePicker","props","style","date","minDate","maxDate","locale","timeZoneName","mode","onConfirm","onClosed","ios","android","testID","isModal","handleConfirm","useCallback","Date","nativeEvent","timestampMs","handleClosed","nativeProps","styles","picker","dateMs","minDateMs","maxDateMs","preferredStyle","countDownDurationSeconds","minuteInterval","roundsToMinuteInterval","firstDayOfWeek","material","dialogTitle","positiveButtonTitle","negativeButtonTitle","jsx","StyleSheet","create"],"sourceRoot":"../../src","sources":["DatePicker.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,0BAAA,GAAAC,sBAAA,CAAAH,OAAA;AASqC,IAAAI,WAAA,GAAAJ,OAAA;AAAA,SAAAG,uBAAAE,CAAA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,SAAS,EAAEA,SAAS,GAAGM,aAAa,GAAGhB,SAAS;IAChDW,QAAQ,EAAEI,OAAO,IAAIJ,QAAQ,GAAGU,YAAY,GAAGrB,SAAS;IAExDY,GAAG,EAAEA,GAAG,GACJ;MACEgB,cAAc,EAAEhB,GAAG,CAACgB,cAAc;MAClCC,wBAAwB,EAAEjB,GAAG,CAACiB,wBAAwB;MACtDC,cAAc,EAAElB,GAAG,CAACkB,cAAc;MAClCC,sBAAsB,EAAEnB,GAAG,CAACmB;IAC9B,CAAC,GACD/B,SAAS;IAEba,OAAO,EAAEA,OAAO,GACZ;MACEmB,cAAc,EAAEnB,OAAO,CAACmB,cAAc;MACtCC,QAAQ,EAAEpB,OAAO,CAACoB,QAAQ;MAC1BC,WAAW,EAAErB,OAAO,CAACqB,WAAW;MAChCC,mBAAmB,EAAEtB,OAAO,CAACsB,mBAAmB;MAChDC,mBAAmB,EAAEvB,OAAO,CAACuB;IAC/B,CAAC,GACDpC;EACN,CAAC;EAED,oBAAO,IAAA/B,WAAA,CAAAoE,GAAA,EAACtE,0BAAA,CAAAK,OAAgB;IAAC0C,MAAM,EAAEA,MAAO;IAAA,GAAKQ;EAAW,CAAG,CAAC;AAC9D;AAEA,MAAMC,MAAM,GAAGe,uBAAU,CAACC,MAAM,CAAC;EAC/Bf,MAAM,EAAE,CAAC;AACX,CAAC,CAAC","ignoreList":[]}
@@ -0,0 +1,69 @@
1
+ // DatePickerNativeComponent.ts
2
+ import type { CodegenTypes, ViewProps } from 'react-native';
3
+ import { codegenNativeComponent } from 'react-native';
4
+
5
+ export type TimestampMs = CodegenTypes.Double;
6
+
7
+ export type DateChangeEvent = {
8
+ timestampMs: CodegenTypes.Double;
9
+ };
10
+
11
+ export type DatePickerMode = 'date' | 'time' | 'dateAndTime' | 'countDownTimer';
12
+ export type DatePickerPresentation = 'modal' | 'embedded';
13
+
14
+ export type IOSDatePickerStyle = 'automatic' | 'compact' | 'inline' | 'wheels';
15
+ export type IOSRoundsToMinuteInterval = 'inherit' | 'round' | 'noRound';
16
+
17
+ export type IOSProps = {
18
+ preferredStyle?: string; // IOSDatePickerStyle
19
+ countDownDurationSeconds?: CodegenTypes.Double;
20
+ minuteInterval?: CodegenTypes.Int32;
21
+ roundsToMinuteInterval?: string; // IOSRoundsToMinuteInterval
22
+ };
23
+
24
+ export type AndroidProps = {
25
+ firstDayOfWeek?: CodegenTypes.Int32;
26
+ material?: string; // AndroidMaterialMode
27
+ dialogTitle?: string;
28
+ positiveButtonTitle?: string;
29
+ negativeButtonTitle?: string;
30
+ };
31
+
32
+ export type WebProps = Readonly<{}>;
33
+ export type WindowsProps = Readonly<{}>;
34
+ export type MacOSProps = Readonly<{}>;
35
+
36
+ /**
37
+ * Sentinel convention:
38
+ * - `Number.MIN_SAFE_INTEGER` means "no value / unbounded / unset".
39
+ * (Allows negative timestamps for pre-1970 dates.)
40
+ */
41
+ export type CommonProps = {
42
+ mode?: string; // DatePickerMode
43
+
44
+ dateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
45
+ minDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
46
+ maxDateMs?: CodegenTypes.WithDefault<TimestampMs, -9007199254740991>;
47
+
48
+ locale?: string;
49
+ timeZoneName?: string;
50
+
51
+ /**
52
+ * Only used when presentation === "modal".
53
+ * Defaults should be applied in JS wrapper (recommended).
54
+ */
55
+ visible?: string; // Visible
56
+
57
+ /** Defaults should be applied in JS wrapper (recommended). */
58
+ presentation?: string; // DatePickerPresentation
59
+ };
60
+
61
+ export interface NativeProps extends ViewProps, CommonProps {
62
+ ios?: IOSProps;
63
+ android?: AndroidProps;
64
+
65
+ onConfirm?: CodegenTypes.BubblingEventHandler<DateChangeEvent>;
66
+ onClosed?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
67
+ }
68
+
69
+ export default codegenNativeComponent<NativeProps>('PCDatePicker');
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SelectionMenu = SelectionMenu;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _SelectionMenuNativeComponent = _interopRequireDefault(require("./SelectionMenuNativeComponent"));
9
+ var _jsxRuntime = require("react/jsx-runtime");
10
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
11
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
12
+ // SelectionMenu.tsx
13
+
14
+ function normalizeSelectedData(selected) {
15
+ return selected ?? '';
16
+ }
17
+ function normalizeNativeVisible(presentation, visible) {
18
+ // Embedded mode ignores visible; keep it undefined so native isn't spammed.
19
+ if (presentation === 'embedded') return undefined;
20
+ return visible ? 'open' : 'closed';
21
+ }
22
+ function SelectionMenu(props) {
23
+ const {
24
+ style,
25
+ options,
26
+ selected,
27
+ disabled,
28
+ placeholder,
29
+ presentation = 'modal',
30
+ visible,
31
+ onSelect,
32
+ onRequestClose,
33
+ ios,
34
+ android,
35
+ ...viewProps
36
+ } = props;
37
+ const selectedData = (0, _react.useMemo)(() => normalizeSelectedData(selected), [selected]);
38
+ const nativeVisible = (0, _react.useMemo)(() => normalizeNativeVisible(presentation, visible), [presentation, visible]);
39
+ const handleSelect = (0, _react.useCallback)(e => {
40
+ const {
41
+ index,
42
+ label,
43
+ data
44
+ } = e.nativeEvent;
45
+ onSelect?.(data, label, index);
46
+ }, [onSelect]);
47
+ const handleRequestClose = (0, _react.useCallback)(() => {
48
+ onRequestClose?.();
49
+ }, [onRequestClose]);
50
+
51
+ // Keep android prop stable and codegen-friendly (string unions live in native spec).
52
+ const nativeAndroid = (0, _react.useMemo)(() => {
53
+ if (!android) return undefined;
54
+ return {
55
+ material: android.material
56
+ };
57
+ }, [android]);
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_SelectionMenuNativeComponent.default, {
59
+ style: style,
60
+ options: options,
61
+ selectedData: selectedData,
62
+ interactivity: disabled ? 'disabled' : 'enabled',
63
+ placeholder: placeholder,
64
+ anchorMode: presentation === 'embedded' ? 'inline' : 'headless',
65
+ visible: nativeVisible,
66
+ onSelect: onSelect ? handleSelect : undefined,
67
+ onRequestClose: onRequestClose ? handleRequestClose : undefined,
68
+ ios: ios,
69
+ android: nativeAndroid,
70
+ ...viewProps
71
+ });
72
+ }
73
+ //# sourceMappingURL=SelectionMenu.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_SelectionMenuNativeComponent","_interopRequireDefault","_jsxRuntime","e","__esModule","default","t","WeakMap","r","n","o","i","f","__proto__","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","normalizeSelectedData","selected","normalizeNativeVisible","presentation","visible","undefined","SelectionMenu","props","style","options","disabled","placeholder","onSelect","onRequestClose","ios","android","viewProps","selectedData","useMemo","nativeVisible","handleSelect","useCallback","index","label","data","nativeEvent","handleRequestClose","nativeAndroid","material","jsx","interactivity","anchorMode"],"sourceRoot":"../../src","sources":["SelectionMenu.tsx"],"mappings":";;;;;;AACA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAGA,IAAAC,6BAAA,GAAAC,sBAAA,CAAAF,OAAA;AAGwC,IAAAG,WAAA,GAAAH,OAAA;AAAA,SAAAE,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAAA,SAAAL,wBAAAK,CAAA,EAAAG,CAAA,6BAAAC,OAAA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5B,YAAY,KAAK,UAAU,GAAG,QAAQ,GAAG,UAAW;IAChEC,OAAO,EAAEe,aAAc;IACvBP,QAAQ,EAAEA,QAAQ,GAAGQ,YAAY,GAAGf,SAAU;IAC9CQ,cAAc,EAAEA,cAAc,GAAGa,kBAAkB,GAAGrB,SAAU;IAChES,GAAG,EAAEA,GAAI;IACTC,OAAO,EAAEY,aAAc;IAAA,GACnBX;EAAS,CACd,CAAC;AAEN","ignoreList":[]}
@@ -0,0 +1,97 @@
1
+ // SelectionMenuNativeComponent.ts
2
+ import type { CodegenTypes, ViewProps } from 'react-native';
3
+ import { codegenNativeComponent } from 'react-native';
4
+
5
+ /**
6
+ * A single option in the menu.
7
+ */
8
+ export type SelectionMenuOption = Readonly<{
9
+ label: string;
10
+ data: string;
11
+ }>;
12
+
13
+ /**
14
+ * Event emitted when the user selects an option.
15
+ */
16
+ export type SelectionMenuSelectEvent = Readonly<{
17
+ /** Selected option index (implementation detail; stable for this render) */
18
+ index: CodegenTypes.Int32;
19
+
20
+ /** Selected option label */
21
+ label: string;
22
+
23
+ /** Selected option data payload (source of truth) */
24
+ data: string;
25
+ }>;
26
+
27
+ /** Visibility state (headless mode only). */
28
+ export type SelectionMenuVisible = 'open' | 'closed';
29
+
30
+ /** Interactivity state (no booleans). */
31
+ export type SelectionMenuInteractivity = 'enabled' | 'disabled';
32
+
33
+ /** Anchor behavior (no booleans). */
34
+ export type SelectionMenuAnchorMode = 'inline' | 'headless';
35
+
36
+ /**
37
+ * iOS-specific configuration (reserved).
38
+ */
39
+ export type IOSProps = Readonly<{}>;
40
+
41
+ /**
42
+ * Android-specific configuration.
43
+ */
44
+ export type AndroidProps = Readonly<{
45
+ material?: string; // AndroidMaterialMode
46
+ }>;
47
+
48
+ export interface SelectionMenuProps extends ViewProps {
49
+ /**
50
+ * Menu options.
51
+ */
52
+ options: ReadonlyArray<SelectionMenuOption>;
53
+
54
+ /**
55
+ * Controlled selection by `data`.
56
+ *
57
+ * - Empty string means "no selection".
58
+ * - Native should treat this as the single source of truth.
59
+ */
60
+ selectedData?: CodegenTypes.WithDefault<string, ''>;
61
+
62
+ /**
63
+ * Enabled / disabled state.
64
+ */
65
+ interactivity?: string; // SelectionMenuInteractivity
66
+
67
+ /**
68
+ * Placeholder text shown when selectedData === "".
69
+ */
70
+ placeholder?: string;
71
+
72
+ /**
73
+ * Inline vs headless behavior.
74
+ */
75
+ anchorMode?: string; // SelectionMenuAnchorMode
76
+
77
+ /**
78
+ * Headless mode only:
79
+ * controls visibility.
80
+ */
81
+ visible?: string; // SelectionMenuVisible
82
+
83
+ /**
84
+ * Fired when the user selects an option.
85
+ */
86
+ onSelect?: CodegenTypes.BubblingEventHandler<SelectionMenuSelectEvent>;
87
+
88
+ /**
89
+ * Fired when dismissed without selection.
90
+ */
91
+ onRequestClose?: CodegenTypes.BubblingEventHandler<Readonly<{}>>;
92
+
93
+ ios?: IOSProps;
94
+ android?: AndroidProps;
95
+ }
96
+
97
+ export default codegenNativeComponent<SelectionMenuProps>('PCSelectionMenu');
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ var _DatePicker = require("./DatePicker");
7
+ Object.keys(_DatePicker).forEach(function (key) {
8
+ if (key === "default" || key === "__esModule") return;
9
+ if (key in exports && exports[key] === _DatePicker[key]) return;
10
+ Object.defineProperty(exports, key, {
11
+ enumerable: true,
12
+ get: function () {
13
+ return _DatePicker[key];
14
+ }
15
+ });
16
+ });
17
+ var _SelectionMenu = require("./SelectionMenu");
18
+ Object.keys(_SelectionMenu).forEach(function (key) {
19
+ if (key === "default" || key === "__esModule") return;
20
+ if (key in exports && exports[key] === _SelectionMenu[key]) return;
21
+ Object.defineProperty(exports, key, {
22
+ enumerable: true,
23
+ get: function () {
24
+ return _SelectionMenu[key];
25
+ }
26
+ });
27
+ });
28
+ var _ContextMenu = require("./ContextMenu");
29
+ Object.keys(_ContextMenu).forEach(function (key) {
30
+ if (key === "default" || key === "__esModule") return;
31
+ if (key in exports && exports[key] === _ContextMenu[key]) return;
32
+ Object.defineProperty(exports, key, {
33
+ enumerable: true,
34
+ get: function () {
35
+ return _ContextMenu[key];
36
+ }
37
+ });
38
+ });
39
+ var _sharedTypes = require("./sharedTypes");
40
+ Object.keys(_sharedTypes).forEach(function (key) {
41
+ if (key === "default" || key === "__esModule") return;
42
+ if (key in exports && exports[key] === _sharedTypes[key]) return;
43
+ Object.defineProperty(exports, key, {
44
+ enumerable: true,
45
+ get: function () {
46
+ return _sharedTypes[key];
47
+ }
48
+ });
49
+ });
50
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_DatePicker","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_SelectionMenu","_ContextMenu","_sharedTypes"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,WAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,WAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAT,WAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,cAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,cAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,cAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAC,cAAA,CAA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