@nocobase/plugin-mobile-client 0.11.1-alpha.5 → 0.12.0-alpha.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 (206) hide show
  1. package/client.d.ts +2 -3
  2. package/client.js +1 -1
  3. package/dist/client/index.js +2465 -0
  4. package/{lib → dist}/index.d.ts +1 -0
  5. package/dist/index.js +18 -0
  6. package/dist/locale/en-US.js +6 -0
  7. package/dist/locale/fr-FR.js +6 -0
  8. package/dist/locale/zh-CN.js +36 -0
  9. package/dist/server/index.js +11 -0
  10. package/dist/server/migrations/20230620203218-mobile-ui-schema-uid.js +33 -0
  11. package/dist/server/plugin.js +68 -0
  12. package/dist/server/routes.js +42 -0
  13. package/docs/en-US/index.md +7 -0
  14. package/docs/en-US/installation.md +13 -0
  15. package/docs/en-US/tabs.json +14 -0
  16. package/docs/en-US/usage.md +1 -0
  17. package/docs/zh-CN/index.md +7 -0
  18. package/docs/zh-CN/installation.md +13 -0
  19. package/docs/zh-CN/tabs.json +14 -0
  20. package/docs/zh-CN/usage.md +2 -0
  21. package/package.json +16 -27
  22. package/server.d.ts +2 -3
  23. package/server.js +1 -1
  24. package/lib/client/MobileClientProvider.js +0 -64
  25. package/lib/client/configuration/App.js +0 -40
  26. package/lib/client/configuration/Interface.js +0 -20
  27. package/lib/client/configuration/index.js +0 -27
  28. package/lib/client/core/bridge/index.js +0 -17
  29. package/lib/client/core/bridge/injects.js +0 -13
  30. package/lib/client/core/bridge/native-call.js +0 -24
  31. package/lib/client/core/index.js +0 -46
  32. package/lib/client/core/schema/common/index.js +0 -16
  33. package/lib/client/core/schema/common/page.js +0 -23
  34. package/lib/client/core/schema/components/container/Container.Designer.js +0 -139
  35. package/lib/client/core/schema/components/container/Container.js +0 -119
  36. package/lib/client/core/schema/components/container/index.js +0 -16
  37. package/lib/client/core/schema/components/container/style.js +0 -48
  38. package/lib/client/core/schema/components/header/Header.Designer.js +0 -72
  39. package/lib/client/core/schema/components/header/Header.js +0 -86
  40. package/lib/client/core/schema/components/header/index.js +0 -16
  41. package/lib/client/core/schema/components/index.js +0 -71
  42. package/lib/client/core/schema/components/menu/Menu.Designer.js +0 -81
  43. package/lib/client/core/schema/components/menu/Menu.Item.js +0 -106
  44. package/lib/client/core/schema/components/menu/Menu.js +0 -80
  45. package/lib/client/core/schema/components/menu/MenuBlockInitializer.js +0 -51
  46. package/lib/client/core/schema/components/menu/index.js +0 -27
  47. package/lib/client/core/schema/components/menu/schema.js +0 -25
  48. package/lib/client/core/schema/components/menu/style.js +0 -34
  49. package/lib/client/core/schema/components/page/Page.Designer.js +0 -161
  50. package/lib/client/core/schema/components/page/Page.js +0 -130
  51. package/lib/client/core/schema/components/page/index.js +0 -16
  52. package/lib/client/core/schema/components/page/style.js +0 -55
  53. package/lib/client/core/schema/components/settings/Settings.Designer.js +0 -37
  54. package/lib/client/core/schema/components/settings/Settings.js +0 -36
  55. package/lib/client/core/schema/components/settings/SettingsBlockInitializer.js +0 -51
  56. package/lib/client/core/schema/components/settings/index.js +0 -27
  57. package/lib/client/core/schema/components/tab-bar/TabBar.Item.js +0 -73
  58. package/lib/client/core/schema/components/tab-bar/TabBar.js +0 -135
  59. package/lib/client/core/schema/components/tab-bar/index.js +0 -16
  60. package/lib/client/core/schema/components/tab-bar/schema.js +0 -25
  61. package/lib/client/core/schema/helpers/index.js +0 -49
  62. package/lib/client/core/schema/hooks/index.js +0 -16
  63. package/lib/client/core/schema/hooks/useSchemaPatch.js +0 -64
  64. package/lib/client/core/schema/index.js +0 -38
  65. package/lib/client/core/schema/initializers/BlockInitializers.js +0 -79
  66. package/lib/client/core/schema/initializers/index.js +0 -16
  67. package/lib/client/core/schema/scopes/grid-card.js +0 -45
  68. package/lib/client/core/schema/scopes/index.js +0 -16
  69. package/lib/client/devices/iOS6.js +0 -32
  70. package/lib/client/devices/index.js +0 -43
  71. package/lib/client/index.js +0 -83
  72. package/lib/client/locale/index.js +0 -40
  73. package/lib/client/router/Application.js +0 -128
  74. package/lib/client/router/InterfaceProvider.js +0 -29
  75. package/lib/client/router/InterfaceRouter.js +0 -30
  76. package/lib/client/router/index.js +0 -16
  77. package/lib/index.js +0 -13
  78. package/lib/locale/en-US.js +0 -9
  79. package/lib/locale/fr-FR.js +0 -9
  80. package/lib/locale/zh-CN.js +0 -39
  81. package/lib/server/index.js +0 -13
  82. package/lib/server/migrations/20230620203218-mobile-ui-schema-uid.js +0 -59
  83. package/lib/server/plugin.js +0 -102
  84. package/lib/server/routes.js +0 -41
  85. package/src/client/MobileClientProvider.tsx +0 -41
  86. package/src/client/configuration/App.tsx +0 -23
  87. package/src/client/configuration/Interface.tsx +0 -11
  88. package/src/client/configuration/index.ts +0 -2
  89. package/src/client/core/bridge/index.ts +0 -2
  90. package/src/client/core/bridge/injects.ts +0 -15
  91. package/src/client/core/bridge/native-call.ts +0 -23
  92. package/src/client/core/index.tsx +0 -45
  93. package/src/client/core/schema/common/index.ts +0 -1
  94. package/src/client/core/schema/common/page.ts +0 -16
  95. package/src/client/core/schema/components/container/Container.Designer.tsx +0 -89
  96. package/src/client/core/schema/components/container/Container.tsx +0 -89
  97. package/src/client/core/schema/components/container/index.ts +0 -1
  98. package/src/client/core/schema/components/container/style.ts +0 -35
  99. package/src/client/core/schema/components/header/Header.Designer.tsx +0 -39
  100. package/src/client/core/schema/components/header/Header.tsx +0 -49
  101. package/src/client/core/schema/components/header/index.ts +0 -1
  102. package/src/client/core/schema/components/index.ts +0 -6
  103. package/src/client/core/schema/components/menu/Menu.Designer.tsx +0 -46
  104. package/src/client/core/schema/components/menu/Menu.Item.tsx +0 -89
  105. package/src/client/core/schema/components/menu/Menu.tsx +0 -75
  106. package/src/client/core/schema/components/menu/MenuBlockInitializer.tsx +0 -20
  107. package/src/client/core/schema/components/menu/index.ts +0 -2
  108. package/src/client/core/schema/components/menu/schema.ts +0 -19
  109. package/src/client/core/schema/components/menu/style.ts +0 -20
  110. package/src/client/core/schema/components/page/Page.Designer.tsx +0 -107
  111. package/src/client/core/schema/components/page/Page.tsx +0 -115
  112. package/src/client/core/schema/components/page/index.ts +0 -1
  113. package/src/client/core/schema/components/page/style.ts +0 -43
  114. package/src/client/core/schema/components/settings/Settings.Designer.tsx +0 -22
  115. package/src/client/core/schema/components/settings/Settings.tsx +0 -24
  116. package/src/client/core/schema/components/settings/SettingsBlockInitializer.tsx +0 -20
  117. package/src/client/core/schema/components/settings/index.ts +0 -2
  118. package/src/client/core/schema/components/tab-bar/TabBar.Item.tsx +0 -66
  119. package/src/client/core/schema/components/tab-bar/TabBar.tsx +0 -115
  120. package/src/client/core/schema/components/tab-bar/index.ts +0 -1
  121. package/src/client/core/schema/components/tab-bar/schema.ts +0 -18
  122. package/src/client/core/schema/helpers/index.ts +0 -38
  123. package/src/client/core/schema/hooks/index.ts +0 -1
  124. package/src/client/core/schema/hooks/useSchemaPatch.ts +0 -30
  125. package/src/client/core/schema/index.ts +0 -3
  126. package/src/client/core/schema/initializers/BlockInitializers.ts +0 -81
  127. package/src/client/core/schema/initializers/index.ts +0 -1
  128. package/src/client/core/schema/scopes/grid-card.ts +0 -35
  129. package/src/client/core/schema/scopes/index.ts +0 -1
  130. package/src/client/devices/iOS6.tsx +0 -24
  131. package/src/client/devices/index.tsx +0 -27
  132. package/src/client/index.tsx +0 -48
  133. package/src/client/locale/index.ts +0 -21
  134. package/src/client/router/Application.tsx +0 -128
  135. package/src/client/router/InterfaceProvider.tsx +0 -11
  136. package/src/client/router/InterfaceRouter.tsx +0 -16
  137. package/src/client/router/index.ts +0 -1
  138. package/src/index.ts +0 -1
  139. package/src/locale/en-US.ts +0 -3
  140. package/src/locale/fr-FR.ts +0 -3
  141. package/src/locale/zh-CN.ts +0 -33
  142. package/src/server/collections/.gitkeep +0 -0
  143. package/src/server/index.ts +0 -1
  144. package/src/server/migrations/20230620203218-mobile-ui-schema-uid.ts +0 -29
  145. package/src/server/plugin.ts +0 -63
  146. package/src/server/routes.ts +0 -38
  147. /package/{lib → dist}/client/MobileClientProvider.d.ts +0 -0
  148. /package/{lib → dist}/client/configuration/App.d.ts +0 -0
  149. /package/{lib → dist}/client/configuration/Interface.d.ts +0 -0
  150. /package/{lib → dist}/client/configuration/index.d.ts +0 -0
  151. /package/{lib → dist}/client/core/bridge/index.d.ts +0 -0
  152. /package/{lib → dist}/client/core/bridge/injects.d.ts +0 -0
  153. /package/{lib → dist}/client/core/bridge/native-call.d.ts +0 -0
  154. /package/{lib → dist}/client/core/index.d.ts +0 -0
  155. /package/{lib → dist}/client/core/schema/common/index.d.ts +0 -0
  156. /package/{lib → dist}/client/core/schema/common/page.d.ts +0 -0
  157. /package/{lib → dist}/client/core/schema/components/container/Container.Designer.d.ts +0 -0
  158. /package/{lib → dist}/client/core/schema/components/container/Container.d.ts +0 -0
  159. /package/{lib → dist}/client/core/schema/components/container/index.d.ts +0 -0
  160. /package/{lib → dist}/client/core/schema/components/container/style.d.ts +0 -0
  161. /package/{lib → dist}/client/core/schema/components/header/Header.Designer.d.ts +0 -0
  162. /package/{lib → dist}/client/core/schema/components/header/Header.d.ts +0 -0
  163. /package/{lib → dist}/client/core/schema/components/header/index.d.ts +0 -0
  164. /package/{lib → dist}/client/core/schema/components/index.d.ts +0 -0
  165. /package/{lib → dist}/client/core/schema/components/menu/Menu.Designer.d.ts +0 -0
  166. /package/{lib → dist}/client/core/schema/components/menu/Menu.Item.d.ts +0 -0
  167. /package/{lib → dist}/client/core/schema/components/menu/Menu.d.ts +0 -0
  168. /package/{lib → dist}/client/core/schema/components/menu/MenuBlockInitializer.d.ts +0 -0
  169. /package/{lib → dist}/client/core/schema/components/menu/index.d.ts +0 -0
  170. /package/{lib → dist}/client/core/schema/components/menu/schema.d.ts +0 -0
  171. /package/{lib → dist}/client/core/schema/components/menu/style.d.ts +0 -0
  172. /package/{lib → dist}/client/core/schema/components/page/Page.Designer.d.ts +0 -0
  173. /package/{lib → dist}/client/core/schema/components/page/Page.d.ts +0 -0
  174. /package/{lib → dist}/client/core/schema/components/page/index.d.ts +0 -0
  175. /package/{lib → dist}/client/core/schema/components/page/style.d.ts +0 -0
  176. /package/{lib → dist}/client/core/schema/components/settings/Settings.Designer.d.ts +0 -0
  177. /package/{lib → dist}/client/core/schema/components/settings/Settings.d.ts +0 -0
  178. /package/{lib → dist}/client/core/schema/components/settings/SettingsBlockInitializer.d.ts +0 -0
  179. /package/{lib → dist}/client/core/schema/components/settings/index.d.ts +0 -0
  180. /package/{lib → dist}/client/core/schema/components/tab-bar/TabBar.Item.d.ts +0 -0
  181. /package/{lib → dist}/client/core/schema/components/tab-bar/TabBar.d.ts +0 -0
  182. /package/{lib → dist}/client/core/schema/components/tab-bar/index.d.ts +0 -0
  183. /package/{lib → dist}/client/core/schema/components/tab-bar/schema.d.ts +0 -0
  184. /package/{lib → dist}/client/core/schema/helpers/index.d.ts +0 -0
  185. /package/{lib → dist}/client/core/schema/hooks/index.d.ts +0 -0
  186. /package/{lib → dist}/client/core/schema/hooks/useSchemaPatch.d.ts +0 -0
  187. /package/{lib → dist}/client/core/schema/index.d.ts +0 -0
  188. /package/{lib → dist}/client/core/schema/initializers/BlockInitializers.d.ts +0 -0
  189. /package/{lib → dist}/client/core/schema/initializers/index.d.ts +0 -0
  190. /package/{lib → dist}/client/core/schema/scopes/grid-card.d.ts +0 -0
  191. /package/{lib → dist}/client/core/schema/scopes/index.d.ts +0 -0
  192. /package/{lib → dist}/client/devices/iOS6.d.ts +0 -0
  193. /package/{lib → dist}/client/devices/index.d.ts +0 -0
  194. /package/{lib → dist}/client/index.d.ts +0 -0
  195. /package/{lib → dist}/client/locale/index.d.ts +0 -0
  196. /package/{lib → dist}/client/router/Application.d.ts +0 -0
  197. /package/{lib → dist}/client/router/InterfaceProvider.d.ts +0 -0
  198. /package/{lib → dist}/client/router/InterfaceRouter.d.ts +0 -0
  199. /package/{lib → dist}/client/router/index.d.ts +0 -0
  200. /package/{lib → dist}/locale/en-US.d.ts +0 -0
  201. /package/{lib → dist}/locale/fr-FR.d.ts +0 -0
  202. /package/{lib → dist}/locale/zh-CN.d.ts +0 -0
  203. /package/{lib → dist}/server/index.d.ts +0 -0
  204. /package/{lib → dist}/server/migrations/20230620203218-mobile-ui-schema-uid.d.ts +0 -0
  205. /package/{lib → dist}/server/plugin.d.ts +0 -0
  206. /package/{lib → dist}/server/routes.d.ts +0 -0
@@ -0,0 +1,2465 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.id = "@nocobase/plugin-mobile-client";
7
+ elementStyle.appendChild(document.createTextNode(":root {\n --adm-radius-s: 4px;\n --adm-radius-m: 8px;\n --adm-radius-l: 12px;\n --adm-font-size-1: 9px;\n --adm-font-size-2: 10px;\n --adm-font-size-3: 11px;\n --adm-font-size-4: 12px;\n --adm-font-size-5: 13px;\n --adm-font-size-6: 14px;\n --adm-font-size-7: 15px;\n --adm-font-size-8: 16px;\n --adm-font-size-9: 17px;\n --adm-font-size-10: 18px;\n --adm-color-primary: #1677ff;\n --adm-color-success: #00b578;\n --adm-color-warning: #ff8f1f;\n --adm-color-danger: #ff3141;\n --adm-color-text: #333333;\n --adm-color-text-secondary: #666666;\n --adm-color-weak: #999999;\n --adm-color-light: #cccccc;\n --adm-color-border: #eeeeee;\n --adm-color-background: #ffffff;\n --adm-color-white: #ffffff;\n --adm-color-box: #f5f5f5;\n --adm-color-text-light-solid: var(--adm-color-white);\n --adm-color-text-dark-solid: #000000;\n --adm-color-fill-content: var(--adm-color-box);\n --adm-font-size-main: var(--adm-font-size-5);\n --adm-font-family: -apple-system, blinkmacsystemfont, 'Helvetica Neue',\n helvetica, segoe ui, arial, roboto, 'PingFang SC', 'miui',\n 'Hiragino Sans GB', 'Microsoft Yahei', sans-serif;\n --adm-border-color: var(--adm-color-border);\n}\nhtml[data-prefers-color-scheme='dark'] {\n --adm-color-primary: #3086ff;\n --adm-color-success: #34b368;\n --adm-color-warning: #ffa930;\n --adm-color-danger: #ff4a58;\n --adm-color-text: #e6e6e6;\n --adm-color-text-secondary: #b3b3b3;\n --adm-color-weak: #808080;\n --adm-color-light: #4d4d4d;\n --adm-color-border: #2b2b2b;\n --adm-color-box: #0a0a0a;\n --adm-color-background: #1a1a1a;\n --adm-border-color: var(--adm-color-border);\n}\n:root {\n -webkit-tap-highlight-color: rgba(0, 0, 0, 0);\n}\nbody {\n color: var(--adm-color-text);\n font-size: var(--adm-font-size-main);\n font-family: var(--adm-font-family);\n}\na,\nbutton {\n cursor: pointer;\n}\na {\n color: var(--adm-color-primary);\n transition: opacity ease-in-out 0.2s;\n}\na:active {\n opacity: 0.8;\n}\n.adm-plain-anchor {\n color: unset;\n transition: none;\n}\n.adm-plain-anchor:active {\n opacity: unset;\n}\nbody.adm-overflow-hidden {\n overflow: hidden !important;\n}\ndiv.adm-px-tester {\n --size: 1;\n height: calc(var(--size) / 2 * 2px);\n width: 0;\n position: fixed;\n right: -100vw;\n bottom: -100vh;\n -webkit-user-select: none;\n user-select: none;\n pointer-events: none;\n}\n.adm-safe-area {\n --multiple: var(--adm-safe-area-multiple, 1);\n display: block;\n width: 100%;\n}\n.adm-safe-area-position-top {\n padding-top: calc(env(safe-area-inset-top) * var(--multiple));\n}\n.adm-safe-area-position-bottom {\n padding-bottom: calc(env(safe-area-inset-bottom) * var(--multiple));\n}\n.adm-badge-wrapper {\n display: inline-block;\n position: relative;\n}\n.adm-badge {\n display: inline-flex;\n vertical-align: middle;\n box-sizing: content-box;\n border-radius: 100px;\n background-color: var(--color);\n --right: 0;\n --top: 0;\n --color: var(--adm-badge-color, #ff411c);\n}\n.adm-badge-content {\n color: var(--adm-color-text-light-solid);\n box-sizing: border-box;\n min-width: 8px;\n padding: 1px 4px;\n font-size: var(--adm-font-size-1);\n line-height: 12px;\n white-space: nowrap;\n font-weight: normal;\n text-align: center;\n}\n.adm-badge-fixed {\n position: absolute;\n right: var(--right);\n top: var(--top);\n transform: translate(50%, -50%);\n}\n.adm-badge-dot {\n min-width: 10px;\n width: 10px;\n height: 10px;\n border-radius: 5px;\n}\n.adm-badge-bordered {\n border: solid 1px var(--adm-color-text-light-solid);\n}\n.adm-list {\n --header-font-size: var(--adm-font-size-7);\n --prefix-width: 'auto';\n --prefix-padding-right: 12px;\n --align-items: center;\n --active-background-color: var(--adm-color-border);\n --border-inner: solid 1px var(--adm-color-border);\n --border-top: solid 1px var(--adm-color-border);\n --border-bottom: solid 1px var(--adm-color-border);\n --padding-left: 12px;\n --padding-right: 12px;\n --font-size: var(--adm-font-size-9);\n --extra-max-width: 70%;\n}\n.adm-list-header {\n color: var(--adm-color-weak);\n font-size: var(--header-font-size);\n padding: 8px var(--padding-right) 8px var(--padding-left);\n}\n.adm-list-body {\n background-color: var(--adm-color-background);\n overflow: hidden;\n font-size: var(--font-size);\n}\n.adm-list-body-inner {\n margin-top: -1px;\n}\n.adm-list-default .adm-list-body {\n border-top: var(--border-top);\n border-bottom: var(--border-bottom);\n}\n.adm-list-card {\n margin: 12px;\n}\n.adm-list-card .adm-list-body {\n border-radius: 8px;\n}\n.adm-list-card .adm-list-header {\n padding-left: 0;\n}\n.adm-list-item {\n display: block;\n padding-left: var(--padding-left);\n position: relative;\n background-color: var(--adm-color-background);\n line-height: 1.5;\n}\n.adm-list-item-title,\n.adm-list-item-description {\n color: var(--adm-color-weak);\n font-size: var(--adm-font-size-main);\n}\n.adm-list-item-content {\n display: flex;\n align-items: var(--align-items);\n justify-content: flex-start;\n border-top: var(--border-inner);\n padding-right: var(--padding-right);\n}\n.adm-list-item-content-prefix {\n width: var(--prefix-width);\n flex: none;\n padding-right: var(--prefix-padding-right);\n}\n.adm-list-item-content-main {\n flex: auto;\n padding: 12px 0;\n}\n.adm-list-item-content-extra {\n flex: none;\n padding-left: 12px;\n font-size: var(--adm-font-size-7);\n color: var(--adm-color-weak);\n max-width: var(--extra-max-width);\n}\n.adm-list-item-content-arrow {\n flex: none;\n display: flex;\n align-items: center;\n margin-left: 4px;\n color: var(--adm-color-light);\n font-size: 19px;\n}\n.adm-list-item-disabled {\n cursor: not-allowed;\n}\n.adm-list-item-disabled.adm-list-item-disabled > .adm-list-item-content > * {\n opacity: 0.4;\n pointer-events: none;\n}\na.adm-list-item:active:not(.adm-list-item-disabled) {\n background-color: var(--active-background-color);\n}\na.adm-list-item:active:not(.adm-list-item-disabled)::after {\n content: ' ';\n display: block;\n position: absolute;\n width: 100%;\n bottom: -1px;\n left: 0;\n border-bottom: var(--border-inner);\n}\n.adm-nav-bar {\n --height: 45px;\n --border-bottom: none;\n display: flex;\n align-items: center;\n height: var(--height);\n border-bottom: var(--border-bottom);\n padding: 0 12px;\n white-space: nowrap;\n}\n.adm-nav-bar-left,\n.adm-nav-bar-right {\n flex: 1;\n}\n.adm-nav-bar-title {\n flex: auto;\n text-align: center;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.adm-nav-bar-back {\n display: flex;\n align-items: center;\n margin-right: 16px;\n padding: 6px 0;\n cursor: pointer;\n}\n.adm-nav-bar-back-arrow {\n font-size: 24px;\n margin-right: 4px;\n}\n.adm-nav-bar-left {\n font-size: var(--adm-font-size-7);\n display: flex;\n justify-content: flex-start;\n align-items: center;\n}\n.adm-nav-bar-title {\n justify-content: center;\n white-space: nowrap;\n font-size: var(--adm-font-size-10);\n padding: 0 12px;\n}\n.adm-nav-bar-right {\n text-align: right;\n}\n.adm-tab-bar-wrap {\n display: flex;\n flex-wrap: nowrap;\n justify-content: flex-start;\n align-items: stretch;\n overflow: hidden;\n min-height: 48px;\n}\n.adm-tab-bar-item {\n flex: 1;\n color: var(--adm-color-text-secondary);\n white-space: nowrap;\n padding: 4px 8px;\n width: -webkit-min-content;\n width: min-content;\n position: relative;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-direction: column;\n}\n.adm-tab-bar-item-icon {\n font-size: 24px;\n height: 24px;\n line-height: 1;\n}\n.adm-tab-bar-item-title {\n font-size: var(--adm-font-size-2);\n line-height: 15px;\n}\n.adm-tab-bar-item-title-with-icon {\n margin-top: 2px;\n}\n.adm-tab-bar-item-active {\n color: var(--adm-color-primary);\n}\n.adm-tab-bar-icon-badge {\n --top: 6px;\n}\n.adm-tab-bar-title-badge {\n --right: -2px;\n --top: -2px;\n}"));
8
+ document.head.appendChild(elementStyle);
9
+ }
10
+ } catch (e) {
11
+ console.error("vite-plugin-css-injected-by-js", e);
12
+ }
13
+ })();
14
+ (function(global2, factory) {
15
+ typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("react"), require("@nocobase/client"), require("react-router-dom"), require("antd"), require("react-i18next"), require("@ant-design/icons"), require("@formily/react"), require("lodash"), require("@formily/shared"), require("@formily/antd-v5")) : typeof define === "function" && define.amd ? define(["exports", "react", "@nocobase/client", "react-router-dom", "antd", "react-i18next", "@ant-design/icons", "@formily/react", "lodash", "@formily/shared", "@formily/antd-v5"], factory) : (global2 = typeof globalThis !== "undefined" ? globalThis : global2 || self, factory(global2["@nocobase/plugin-mobile-client"] = {}, global2.react, global2["@nocobase/client"], global2["react-router-dom"], global2.antd, global2["react-i18next"], global2["@ant-design/icons"], global2["@formily/react"], global2.lodash, global2["@formily/shared"], global2["@formily/antd-v5"]));
16
+ })(this, function(exports2, React, client, reactRouterDom, antd, reactI18next, icons, react, lodash, shared, antdV5) {
17
+ "use strict";var __defProp = Object.defineProperty;
18
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
19
+ var __publicField = (obj, key, value) => {
20
+ __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
21
+ return value;
22
+ };
23
+
24
+ function _interopNamespaceDefault(e2) {
25
+ const n2 = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
26
+ if (e2) {
27
+ for (const k2 in e2) {
28
+ if (k2 !== "default") {
29
+ const d2 = Object.getOwnPropertyDescriptor(e2, k2);
30
+ Object.defineProperty(n2, k2, d2.get ? d2 : {
31
+ enumerable: true,
32
+ get: () => e2[k2]
33
+ });
34
+ }
35
+ }
36
+ }
37
+ n2.default = e2;
38
+ return Object.freeze(n2);
39
+ }
40
+ const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
41
+ var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
42
+ function getDefaultExportFromCjs(x) {
43
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
44
+ }
45
+ var jsxRuntime = { exports: {} };
46
+ var reactJsxRuntime_production_min = {};
47
+ /**
48
+ * @license React
49
+ * react-jsx-runtime.production.min.js
50
+ *
51
+ * Copyright (c) Facebook, Inc. and its affiliates.
52
+ *
53
+ * This source code is licensed under the MIT license found in the
54
+ * LICENSE file in the root directory of this source tree.
55
+ */
56
+ var f$1 = React, k$1 = Symbol.for("react.element"), l$1 = Symbol.for("react.fragment"), m$1 = Object.prototype.hasOwnProperty, n$1 = f$1.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, p$1 = { key: true, ref: true, __self: true, __source: true };
57
+ function q$1(c2, a, g2) {
58
+ var b2, d2 = {}, e2 = null, h2 = null;
59
+ void 0 !== g2 && (e2 = "" + g2);
60
+ void 0 !== a.key && (e2 = "" + a.key);
61
+ void 0 !== a.ref && (h2 = a.ref);
62
+ for (b2 in a)
63
+ m$1.call(a, b2) && !p$1.hasOwnProperty(b2) && (d2[b2] = a[b2]);
64
+ if (c2 && c2.defaultProps)
65
+ for (b2 in a = c2.defaultProps, a)
66
+ void 0 === d2[b2] && (d2[b2] = a[b2]);
67
+ return { $$typeof: k$1, type: c2, key: e2, ref: h2, props: d2, _owner: n$1.current };
68
+ }
69
+ reactJsxRuntime_production_min.Fragment = l$1;
70
+ reactJsxRuntime_production_min.jsx = q$1;
71
+ reactJsxRuntime_production_min.jsxs = q$1;
72
+ {
73
+ jsxRuntime.exports = reactJsxRuntime_production_min;
74
+ }
75
+ var jsxRuntimeExports = jsxRuntime.exports;
76
+ const NAMESPACE = "mobile-client";
77
+ function generateNTemplate(key) {
78
+ return `{{t('${key}', { ns: '${NAMESPACE}', nsMode: 'fallback' })}}`;
79
+ }
80
+ function useTranslation() {
81
+ return reactI18next.useTranslation([NAMESPACE, "client"], {
82
+ nsMode: "fallback"
83
+ });
84
+ }
85
+ const AppConfiguration = () => {
86
+ const { t: t2 } = useTranslation();
87
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
88
+ antd.Card,
89
+ {
90
+ style: {
91
+ minHeight: "600px"
92
+ },
93
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Form, { layout: "vertical", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
94
+ antd.Form.Item,
95
+ {
96
+ tooltip: `${t2("The full address is")} ${window.origin}/mobile`,
97
+ label: t2("Mobile client access address"),
98
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(antd.Input, { value: "/mobile", disabled: true })
99
+ }
100
+ ) })
101
+ }
102
+ );
103
+ };
104
+ const InterfaceContext = React.createContext(null);
105
+ const InterfaceProvider = (props) => {
106
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(InterfaceContext.Provider, { value: { interface: true }, children: props.children });
107
+ };
108
+ const useInterfaceContext = () => {
109
+ return React.useContext(InterfaceContext);
110
+ };
111
+ const InterfaceRouter = React.memo(() => {
112
+ const plugin = client.usePlugin(MobileClientPlugin);
113
+ const MobileRouter = plugin.getMobileRouterComponent();
114
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(InterfaceProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileRouter, {}) });
115
+ });
116
+ InterfaceRouter.displayName = "InterfaceRouter";
117
+ const iOS6 = (props) => {
118
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
119
+ "div",
120
+ {
121
+ className: client.cx(
122
+ "nb-mobile-device-ios6",
123
+ client.css(`
124
+ display: flex;
125
+ width: 375px;
126
+ height: 667px;
127
+ `),
128
+ props.className
129
+ ),
130
+ children: props.children
131
+ }
132
+ );
133
+ };
134
+ const MobileDevice = (props) => {
135
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
136
+ "div",
137
+ {
138
+ className: client.cx(
139
+ "nb-mobile-device-wrapper",
140
+ client.css`
141
+ width: 100%;
142
+ height: 100%;
143
+ display: flex;
144
+ justify-content: center;
145
+ align-items: center;
146
+ `
147
+ ),
148
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
149
+ iOS6,
150
+ {
151
+ className: client.css`
152
+ box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
153
+ `,
154
+ ...props
155
+ }
156
+ )
157
+ }
158
+ );
159
+ };
160
+ const InterfaceConfiguration = () => {
161
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(MobileDevice, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(InterfaceRouter, {}) });
162
+ };
163
+ const getJsBridge = () => window.JsBridge;
164
+ const invoke = (params, cb) => {
165
+ return getJsBridge().invoke(params, cb);
166
+ };
167
+ const isJSBridge = () => !!getJsBridge();
168
+ const JSBridgeFunction = {
169
+ /**
170
+ * @description JSBridge injects
171
+ */
172
+ onBackPressed: () => {
173
+ if (history.length === 1) {
174
+ invoke({ action: "moveTaskToBack" });
175
+ } else {
176
+ history.back();
177
+ }
178
+ }
179
+ };
180
+ Object.keys(JSBridgeFunction).forEach((key) => {
181
+ window[key] = JSBridgeFunction[key];
182
+ });
183
+ const MobileClientProvider = React.memo((props) => {
184
+ const { t: t2 } = useTranslation();
185
+ const location = reactRouterDom.useLocation();
186
+ const navigation = reactRouterDom.useNavigate();
187
+ React.useEffect(() => {
188
+ if (isJSBridge() && location.pathname === "/admin") {
189
+ navigation("/mobile", { replace: true });
190
+ }
191
+ }, [location.pathname, navigation]);
192
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
193
+ client.SettingsCenterProvider,
194
+ {
195
+ settings: {
196
+ ["mobile-client"]: {
197
+ title: t2("Mobile Client-side"),
198
+ icon: "MobileOutlined",
199
+ tabs: {
200
+ interface: {
201
+ title: t2("Interface Configuration"),
202
+ component: InterfaceConfiguration
203
+ },
204
+ app: {
205
+ title: t2("App Configuration"),
206
+ component: AppConfiguration
207
+ }
208
+ }
209
+ }
210
+ },
211
+ children: props.children
212
+ }
213
+ );
214
+ });
215
+ const MBlockInitializers = {
216
+ title: '{{t("Add block")}}',
217
+ icon: "PlusOutlined",
218
+ wrap: client.gridRowColWrap,
219
+ items: [
220
+ {
221
+ key: "dataBlocks",
222
+ type: "itemGroup",
223
+ title: '{{t("Data blocks")}}',
224
+ children: [
225
+ {
226
+ key: "GridCard",
227
+ type: "item",
228
+ title: '{{t("Grid Card")}}',
229
+ component: "GridCardBlockInitializer"
230
+ },
231
+ {
232
+ key: "table",
233
+ type: "item",
234
+ title: '{{t("Table")}}',
235
+ component: "TableBlockInitializer"
236
+ },
237
+ {
238
+ key: "form",
239
+ type: "item",
240
+ title: '{{t("Form")}}',
241
+ component: "FormBlockInitializer"
242
+ },
243
+ {
244
+ key: "details",
245
+ type: "item",
246
+ title: '{{t("Details")}}',
247
+ component: "DetailsBlockInitializer"
248
+ },
249
+ {
250
+ key: "calendar",
251
+ type: "item",
252
+ title: '{{t("Calendar")}}',
253
+ component: "CalendarBlockInitializer"
254
+ },
255
+ {
256
+ key: "mapBlock",
257
+ type: "item",
258
+ title: generateNTemplate("Map"),
259
+ component: "MapBlockInitializer"
260
+ }
261
+ ]
262
+ },
263
+ {
264
+ key: "otherBlocks",
265
+ type: "itemGroup",
266
+ title: '{{t("Other blocks")}}',
267
+ children: [
268
+ {
269
+ key: "menu",
270
+ type: "item",
271
+ title: generateNTemplate("Menu"),
272
+ component: "MMenuBlockInitializer",
273
+ sort: 100
274
+ },
275
+ {
276
+ key: "markdown",
277
+ type: "item",
278
+ title: '{{t("Markdown")}}',
279
+ component: "MarkdownBlockInitializer"
280
+ },
281
+ {
282
+ key: "settings",
283
+ type: "item",
284
+ title: generateNTemplate("Settings"),
285
+ component: "MSettingsBlockInitializer",
286
+ sort: 100
287
+ }
288
+ ]
289
+ }
290
+ ]
291
+ };
292
+ const MMenuBlockInitializer = (props) => {
293
+ const { insert } = props;
294
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
295
+ client.SchemaInitializer.Item,
296
+ {
297
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
298
+ onClick: async () => {
299
+ insert({
300
+ type: "void",
301
+ "x-component": "MMenu",
302
+ "x-designer": "MMenu.Designer",
303
+ "x-component-props": {}
304
+ });
305
+ }
306
+ }
307
+ );
308
+ };
309
+ const global$1 = "";
310
+ const canUseDom = !!(typeof window !== "undefined" && typeof document !== "undefined" && window.document && window.document.createElement);
311
+ if (canUseDom) {
312
+ document.addEventListener("touchstart", () => {
313
+ }, true);
314
+ }
315
+ function __read(o, n2) {
316
+ var m2 = typeof Symbol === "function" && o[Symbol.iterator];
317
+ if (!m2)
318
+ return o;
319
+ var i = m2.call(o), r, ar = [], e2;
320
+ try {
321
+ while ((n2 === void 0 || n2-- > 0) && !(r = i.next()).done)
322
+ ar.push(r.value);
323
+ } catch (error) {
324
+ e2 = { error };
325
+ } finally {
326
+ try {
327
+ if (r && !r.done && (m2 = i["return"]))
328
+ m2.call(i);
329
+ } finally {
330
+ if (e2)
331
+ throw e2.error;
332
+ }
333
+ }
334
+ return ar;
335
+ }
336
+ typeof SuppressedError === "function" ? SuppressedError : function(error, suppressed, message) {
337
+ var e2 = new Error(message);
338
+ return e2.name = "SuppressedError", e2.error = error, e2.suppressed = suppressed, e2;
339
+ };
340
+ function attachPropertiesToComponent(component, properties) {
341
+ const ret = component;
342
+ for (const key in properties) {
343
+ if (properties.hasOwnProperty(key)) {
344
+ ret[key] = properties[key];
345
+ }
346
+ }
347
+ return ret;
348
+ }
349
+ var classnames = { exports: {} };
350
+ /*!
351
+ Copyright (c) 2018 Jed Watson.
352
+ Licensed under the MIT License (MIT), see
353
+ http://jedwatson.github.io/classnames
354
+ */
355
+ (function(module2) {
356
+ (function() {
357
+ var hasOwn = {}.hasOwnProperty;
358
+ function classNames2() {
359
+ var classes = [];
360
+ for (var i = 0; i < arguments.length; i++) {
361
+ var arg = arguments[i];
362
+ if (!arg)
363
+ continue;
364
+ var argType = typeof arg;
365
+ if (argType === "string" || argType === "number") {
366
+ classes.push(arg);
367
+ } else if (Array.isArray(arg)) {
368
+ if (arg.length) {
369
+ var inner = classNames2.apply(null, arg);
370
+ if (inner) {
371
+ classes.push(inner);
372
+ }
373
+ }
374
+ } else if (argType === "object") {
375
+ if (arg.toString !== Object.prototype.toString && !arg.toString.toString().includes("[native code]")) {
376
+ classes.push(arg.toString());
377
+ continue;
378
+ }
379
+ for (var key in arg) {
380
+ if (hasOwn.call(arg, key) && arg[key]) {
381
+ classes.push(key);
382
+ }
383
+ }
384
+ }
385
+ }
386
+ return classes.join(" ");
387
+ }
388
+ if (module2.exports) {
389
+ classNames2.default = classNames2;
390
+ module2.exports = classNames2;
391
+ } else {
392
+ window.classNames = classNames2;
393
+ }
394
+ })();
395
+ })(classnames);
396
+ var classnamesExports = classnames.exports;
397
+ const classNames = /* @__PURE__ */ getDefaultExportFromCjs(classnamesExports);
398
+ function withNativeProps(props, element) {
399
+ const p2 = Object.assign({}, element.props);
400
+ if (props.className) {
401
+ p2.className = classNames(element.props.className, props.className);
402
+ }
403
+ if (props.style) {
404
+ p2.style = Object.assign(Object.assign({}, p2.style), props.style);
405
+ }
406
+ if (props.tabIndex !== void 0) {
407
+ p2.tabIndex = props.tabIndex;
408
+ }
409
+ for (const key in props) {
410
+ if (!props.hasOwnProperty(key))
411
+ continue;
412
+ if (key.startsWith("data-") || key.startsWith("aria-")) {
413
+ p2[key] = props[key];
414
+ }
415
+ }
416
+ return React.cloneElement(element, p2);
417
+ }
418
+ var freeGlobal$1 = typeof commonjsGlobal == "object" && commonjsGlobal && commonjsGlobal.Object === Object && commonjsGlobal;
419
+ var _freeGlobal = freeGlobal$1;
420
+ var freeGlobal = _freeGlobal;
421
+ var freeSelf = typeof self == "object" && self && self.Object === Object && self;
422
+ var root$2 = freeGlobal || freeSelf || Function("return this")();
423
+ var _root = root$2;
424
+ var root$1 = _root;
425
+ var Symbol$3 = root$1.Symbol;
426
+ var _Symbol = Symbol$3;
427
+ var Symbol$2 = _Symbol;
428
+ var objectProto$7 = Object.prototype;
429
+ var hasOwnProperty$5 = objectProto$7.hasOwnProperty;
430
+ var nativeObjectToString$1 = objectProto$7.toString;
431
+ var symToStringTag$1 = Symbol$2 ? Symbol$2.toStringTag : void 0;
432
+ function getRawTag$1(value) {
433
+ var isOwn = hasOwnProperty$5.call(value, symToStringTag$1), tag = value[symToStringTag$1];
434
+ try {
435
+ value[symToStringTag$1] = void 0;
436
+ var unmasked = true;
437
+ } catch (e2) {
438
+ }
439
+ var result = nativeObjectToString$1.call(value);
440
+ if (unmasked) {
441
+ if (isOwn) {
442
+ value[symToStringTag$1] = tag;
443
+ } else {
444
+ delete value[symToStringTag$1];
445
+ }
446
+ }
447
+ return result;
448
+ }
449
+ var _getRawTag = getRawTag$1;
450
+ var objectProto$6 = Object.prototype;
451
+ var nativeObjectToString = objectProto$6.toString;
452
+ function objectToString$1(value) {
453
+ return nativeObjectToString.call(value);
454
+ }
455
+ var _objectToString = objectToString$1;
456
+ var Symbol$1 = _Symbol, getRawTag = _getRawTag, objectToString = _objectToString;
457
+ var nullTag = "[object Null]", undefinedTag = "[object Undefined]";
458
+ var symToStringTag = Symbol$1 ? Symbol$1.toStringTag : void 0;
459
+ function baseGetTag$3(value) {
460
+ if (value == null) {
461
+ return value === void 0 ? undefinedTag : nullTag;
462
+ }
463
+ return symToStringTag && symToStringTag in Object(value) ? getRawTag(value) : objectToString(value);
464
+ }
465
+ var _baseGetTag = baseGetTag$3;
466
+ function isObject$3(value) {
467
+ var type = typeof value;
468
+ return value != null && (type == "object" || type == "function");
469
+ }
470
+ var isObject_1 = isObject$3;
471
+ var baseGetTag$2 = _baseGetTag, isObject$2 = isObject_1;
472
+ var asyncTag = "[object AsyncFunction]", funcTag$1 = "[object Function]", genTag = "[object GeneratorFunction]", proxyTag = "[object Proxy]";
473
+ function isFunction$3(value) {
474
+ if (!isObject$2(value)) {
475
+ return false;
476
+ }
477
+ var tag = baseGetTag$2(value);
478
+ return tag == funcTag$1 || tag == genTag || tag == asyncTag || tag == proxyTag;
479
+ }
480
+ var isFunction_1 = isFunction$3;
481
+ var root = _root;
482
+ var coreJsData$1 = root["__core-js_shared__"];
483
+ var _coreJsData = coreJsData$1;
484
+ var coreJsData = _coreJsData;
485
+ var maskSrcKey = function() {
486
+ var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || "");
487
+ return uid ? "Symbol(src)_1." + uid : "";
488
+ }();
489
+ function isMasked$1(func) {
490
+ return !!maskSrcKey && maskSrcKey in func;
491
+ }
492
+ var _isMasked = isMasked$1;
493
+ var funcProto$1 = Function.prototype;
494
+ var funcToString$1 = funcProto$1.toString;
495
+ function toSource$1(func) {
496
+ if (func != null) {
497
+ try {
498
+ return funcToString$1.call(func);
499
+ } catch (e2) {
500
+ }
501
+ try {
502
+ return func + "";
503
+ } catch (e2) {
504
+ }
505
+ }
506
+ return "";
507
+ }
508
+ var _toSource = toSource$1;
509
+ var isFunction$2 = isFunction_1, isMasked = _isMasked, isObject$1 = isObject_1, toSource = _toSource;
510
+ var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
511
+ var reIsHostCtor = /^\[object .+?Constructor\]$/;
512
+ var funcProto = Function.prototype, objectProto$5 = Object.prototype;
513
+ var funcToString = funcProto.toString;
514
+ var hasOwnProperty$4 = objectProto$5.hasOwnProperty;
515
+ var reIsNative = RegExp(
516
+ "^" + funcToString.call(hasOwnProperty$4).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
517
+ );
518
+ function baseIsNative$1(value) {
519
+ if (!isObject$1(value) || isMasked(value)) {
520
+ return false;
521
+ }
522
+ var pattern = isFunction$2(value) ? reIsNative : reIsHostCtor;
523
+ return pattern.test(toSource(value));
524
+ }
525
+ var _baseIsNative = baseIsNative$1;
526
+ function getValue$1(object, key) {
527
+ return object == null ? void 0 : object[key];
528
+ }
529
+ var _getValue = getValue$1;
530
+ var baseIsNative = _baseIsNative, getValue = _getValue;
531
+ function getNative$1(object, key) {
532
+ var value = getValue(object, key);
533
+ return baseIsNative(value) ? value : void 0;
534
+ }
535
+ var _getNative = getNative$1;
536
+ var getNative = _getNative;
537
+ var defineProperty$2 = function() {
538
+ try {
539
+ var func = getNative(Object, "defineProperty");
540
+ func({}, "", {});
541
+ return func;
542
+ } catch (e2) {
543
+ }
544
+ }();
545
+ var _defineProperty = defineProperty$2;
546
+ var defineProperty$1 = _defineProperty;
547
+ function baseAssignValue$2(object, key, value) {
548
+ if (key == "__proto__" && defineProperty$1) {
549
+ defineProperty$1(object, key, {
550
+ "configurable": true,
551
+ "enumerable": true,
552
+ "value": value,
553
+ "writable": true
554
+ });
555
+ } else {
556
+ object[key] = value;
557
+ }
558
+ }
559
+ var _baseAssignValue = baseAssignValue$2;
560
+ function eq$2(value, other) {
561
+ return value === other || value !== value && other !== other;
562
+ }
563
+ var eq_1 = eq$2;
564
+ var baseAssignValue$1 = _baseAssignValue, eq$1 = eq_1;
565
+ var objectProto$4 = Object.prototype;
566
+ var hasOwnProperty$3 = objectProto$4.hasOwnProperty;
567
+ function assignValue$1(object, key, value) {
568
+ var objValue = object[key];
569
+ if (!(hasOwnProperty$3.call(object, key) && eq$1(objValue, value)) || value === void 0 && !(key in object)) {
570
+ baseAssignValue$1(object, key, value);
571
+ }
572
+ }
573
+ var _assignValue = assignValue$1;
574
+ var assignValue = _assignValue, baseAssignValue = _baseAssignValue;
575
+ function copyObject$1(source, props, object, customizer) {
576
+ var isNew = !object;
577
+ object || (object = {});
578
+ var index = -1, length = props.length;
579
+ while (++index < length) {
580
+ var key = props[index];
581
+ var newValue = customizer ? customizer(object[key], source[key], key, object, source) : void 0;
582
+ if (newValue === void 0) {
583
+ newValue = source[key];
584
+ }
585
+ if (isNew) {
586
+ baseAssignValue(object, key, newValue);
587
+ } else {
588
+ assignValue(object, key, newValue);
589
+ }
590
+ }
591
+ return object;
592
+ }
593
+ var _copyObject = copyObject$1;
594
+ function identity$2(value) {
595
+ return value;
596
+ }
597
+ var identity_1 = identity$2;
598
+ function apply$1(func, thisArg, args) {
599
+ switch (args.length) {
600
+ case 0:
601
+ return func.call(thisArg);
602
+ case 1:
603
+ return func.call(thisArg, args[0]);
604
+ case 2:
605
+ return func.call(thisArg, args[0], args[1]);
606
+ case 3:
607
+ return func.call(thisArg, args[0], args[1], args[2]);
608
+ }
609
+ return func.apply(thisArg, args);
610
+ }
611
+ var _apply = apply$1;
612
+ var apply = _apply;
613
+ var nativeMax = Math.max;
614
+ function overRest$1(func, start, transform) {
615
+ start = nativeMax(start === void 0 ? func.length - 1 : start, 0);
616
+ return function() {
617
+ var args = arguments, index = -1, length = nativeMax(args.length - start, 0), array = Array(length);
618
+ while (++index < length) {
619
+ array[index] = args[start + index];
620
+ }
621
+ index = -1;
622
+ var otherArgs = Array(start + 1);
623
+ while (++index < start) {
624
+ otherArgs[index] = args[index];
625
+ }
626
+ otherArgs[start] = transform(array);
627
+ return apply(func, this, otherArgs);
628
+ };
629
+ }
630
+ var _overRest = overRest$1;
631
+ function constant$1(value) {
632
+ return function() {
633
+ return value;
634
+ };
635
+ }
636
+ var constant_1 = constant$1;
637
+ var constant = constant_1, defineProperty = _defineProperty, identity$1 = identity_1;
638
+ var baseSetToString$1 = !defineProperty ? identity$1 : function(func, string) {
639
+ return defineProperty(func, "toString", {
640
+ "configurable": true,
641
+ "enumerable": false,
642
+ "value": constant(string),
643
+ "writable": true
644
+ });
645
+ };
646
+ var _baseSetToString = baseSetToString$1;
647
+ var HOT_COUNT = 800, HOT_SPAN = 16;
648
+ var nativeNow = Date.now;
649
+ function shortOut$1(func) {
650
+ var count = 0, lastCalled = 0;
651
+ return function() {
652
+ var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled);
653
+ lastCalled = stamp;
654
+ if (remaining > 0) {
655
+ if (++count >= HOT_COUNT) {
656
+ return arguments[0];
657
+ }
658
+ } else {
659
+ count = 0;
660
+ }
661
+ return func.apply(void 0, arguments);
662
+ };
663
+ }
664
+ var _shortOut = shortOut$1;
665
+ var baseSetToString = _baseSetToString, shortOut = _shortOut;
666
+ var setToString$1 = shortOut(baseSetToString);
667
+ var _setToString = setToString$1;
668
+ var identity = identity_1, overRest = _overRest, setToString = _setToString;
669
+ function baseRest$1(func, start) {
670
+ return setToString(overRest(func, start, identity), func + "");
671
+ }
672
+ var _baseRest = baseRest$1;
673
+ var MAX_SAFE_INTEGER$1 = 9007199254740991;
674
+ function isLength$2(value) {
675
+ return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER$1;
676
+ }
677
+ var isLength_1 = isLength$2;
678
+ var isFunction$1 = isFunction_1, isLength$1 = isLength_1;
679
+ function isArrayLike$2(value) {
680
+ return value != null && isLength$1(value.length) && !isFunction$1(value);
681
+ }
682
+ var isArrayLike_1 = isArrayLike$2;
683
+ var MAX_SAFE_INTEGER = 9007199254740991;
684
+ var reIsUint = /^(?:0|[1-9]\d*)$/;
685
+ function isIndex$2(value, length) {
686
+ var type = typeof value;
687
+ length = length == null ? MAX_SAFE_INTEGER : length;
688
+ return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length);
689
+ }
690
+ var _isIndex = isIndex$2;
691
+ var eq = eq_1, isArrayLike$1 = isArrayLike_1, isIndex$1 = _isIndex, isObject = isObject_1;
692
+ function isIterateeCall$1(value, index, object) {
693
+ if (!isObject(object)) {
694
+ return false;
695
+ }
696
+ var type = typeof index;
697
+ if (type == "number" ? isArrayLike$1(object) && isIndex$1(index, object.length) : type == "string" && index in object) {
698
+ return eq(object[index], value);
699
+ }
700
+ return false;
701
+ }
702
+ var _isIterateeCall = isIterateeCall$1;
703
+ var baseRest = _baseRest, isIterateeCall = _isIterateeCall;
704
+ function createAssigner$1(assigner) {
705
+ return baseRest(function(object, sources) {
706
+ var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : void 0, guard = length > 2 ? sources[2] : void 0;
707
+ customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : void 0;
708
+ if (guard && isIterateeCall(sources[0], sources[1], guard)) {
709
+ customizer = length < 3 ? void 0 : customizer;
710
+ length = 1;
711
+ }
712
+ object = Object(object);
713
+ while (++index < length) {
714
+ var source = sources[index];
715
+ if (source) {
716
+ assigner(object, source, index, customizer);
717
+ }
718
+ }
719
+ return object;
720
+ });
721
+ }
722
+ var _createAssigner = createAssigner$1;
723
+ function baseTimes$1(n2, iteratee) {
724
+ var index = -1, result = Array(n2);
725
+ while (++index < n2) {
726
+ result[index] = iteratee(index);
727
+ }
728
+ return result;
729
+ }
730
+ var _baseTimes = baseTimes$1;
731
+ function isObjectLike$3(value) {
732
+ return value != null && typeof value == "object";
733
+ }
734
+ var isObjectLike_1 = isObjectLike$3;
735
+ var baseGetTag$1 = _baseGetTag, isObjectLike$2 = isObjectLike_1;
736
+ var argsTag$1 = "[object Arguments]";
737
+ function baseIsArguments$1(value) {
738
+ return isObjectLike$2(value) && baseGetTag$1(value) == argsTag$1;
739
+ }
740
+ var _baseIsArguments = baseIsArguments$1;
741
+ var baseIsArguments = _baseIsArguments, isObjectLike$1 = isObjectLike_1;
742
+ var objectProto$3 = Object.prototype;
743
+ var hasOwnProperty$2 = objectProto$3.hasOwnProperty;
744
+ var propertyIsEnumerable = objectProto$3.propertyIsEnumerable;
745
+ var isArguments$1 = baseIsArguments(function() {
746
+ return arguments;
747
+ }()) ? baseIsArguments : function(value) {
748
+ return isObjectLike$1(value) && hasOwnProperty$2.call(value, "callee") && !propertyIsEnumerable.call(value, "callee");
749
+ };
750
+ var isArguments_1 = isArguments$1;
751
+ var isArray$1 = Array.isArray;
752
+ var isArray_1 = isArray$1;
753
+ var isBuffer$1 = { exports: {} };
754
+ function stubFalse() {
755
+ return false;
756
+ }
757
+ var stubFalse_1 = stubFalse;
758
+ isBuffer$1.exports;
759
+ (function(module2, exports3) {
760
+ var root2 = _root, stubFalse2 = stubFalse_1;
761
+ var freeExports = exports3 && !exports3.nodeType && exports3;
762
+ var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
763
+ var moduleExports = freeModule && freeModule.exports === freeExports;
764
+ var Buffer2 = moduleExports ? root2.Buffer : void 0;
765
+ var nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : void 0;
766
+ var isBuffer2 = nativeIsBuffer || stubFalse2;
767
+ module2.exports = isBuffer2;
768
+ })(isBuffer$1, isBuffer$1.exports);
769
+ var isBufferExports = isBuffer$1.exports;
770
+ var baseGetTag = _baseGetTag, isLength = isLength_1, isObjectLike = isObjectLike_1;
771
+ var argsTag = "[object Arguments]", arrayTag = "[object Array]", boolTag = "[object Boolean]", dateTag = "[object Date]", errorTag = "[object Error]", funcTag = "[object Function]", mapTag = "[object Map]", numberTag = "[object Number]", objectTag = "[object Object]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", weakMapTag = "[object WeakMap]";
772
+ var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]";
773
+ var typedArrayTags = {};
774
+ typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;
775
+ typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;
776
+ function baseIsTypedArray$1(value) {
777
+ return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)];
778
+ }
779
+ var _baseIsTypedArray = baseIsTypedArray$1;
780
+ function baseUnary$1(func) {
781
+ return function(value) {
782
+ return func(value);
783
+ };
784
+ }
785
+ var _baseUnary = baseUnary$1;
786
+ var _nodeUtil = { exports: {} };
787
+ _nodeUtil.exports;
788
+ (function(module2, exports3) {
789
+ var freeGlobal2 = _freeGlobal;
790
+ var freeExports = exports3 && !exports3.nodeType && exports3;
791
+ var freeModule = freeExports && true && module2 && !module2.nodeType && module2;
792
+ var moduleExports = freeModule && freeModule.exports === freeExports;
793
+ var freeProcess = moduleExports && freeGlobal2.process;
794
+ var nodeUtil2 = function() {
795
+ try {
796
+ var types = freeModule && freeModule.require && freeModule.require("util").types;
797
+ if (types) {
798
+ return types;
799
+ }
800
+ return freeProcess && freeProcess.binding && freeProcess.binding("util");
801
+ } catch (e2) {
802
+ }
803
+ }();
804
+ module2.exports = nodeUtil2;
805
+ })(_nodeUtil, _nodeUtil.exports);
806
+ var _nodeUtilExports = _nodeUtil.exports;
807
+ var baseIsTypedArray = _baseIsTypedArray, baseUnary = _baseUnary, nodeUtil = _nodeUtilExports;
808
+ var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;
809
+ var isTypedArray$1 = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;
810
+ var isTypedArray_1 = isTypedArray$1;
811
+ var baseTimes = _baseTimes, isArguments = isArguments_1, isArray = isArray_1, isBuffer = isBufferExports, isIndex = _isIndex, isTypedArray = isTypedArray_1;
812
+ var objectProto$2 = Object.prototype;
813
+ var hasOwnProperty$1 = objectProto$2.hasOwnProperty;
814
+ function arrayLikeKeys$1(value, inherited) {
815
+ var isArr = isArray(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType, result = skipIndexes ? baseTimes(value.length, String) : [], length = result.length;
816
+ for (var key in value) {
817
+ if ((inherited || hasOwnProperty$1.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode.
818
+ (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
819
+ isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays.
820
+ isType && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties.
821
+ isIndex(key, length)))) {
822
+ result.push(key);
823
+ }
824
+ }
825
+ return result;
826
+ }
827
+ var _arrayLikeKeys = arrayLikeKeys$1;
828
+ var objectProto$1 = Object.prototype;
829
+ function isPrototype$1(value) {
830
+ var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto$1;
831
+ return value === proto;
832
+ }
833
+ var _isPrototype = isPrototype$1;
834
+ function overArg$1(func, transform) {
835
+ return function(arg) {
836
+ return func(transform(arg));
837
+ };
838
+ }
839
+ var _overArg = overArg$1;
840
+ var overArg = _overArg;
841
+ var nativeKeys$1 = overArg(Object.keys, Object);
842
+ var _nativeKeys = nativeKeys$1;
843
+ var isPrototype = _isPrototype, nativeKeys = _nativeKeys;
844
+ var objectProto = Object.prototype;
845
+ var hasOwnProperty = objectProto.hasOwnProperty;
846
+ function baseKeys$1(object) {
847
+ if (!isPrototype(object)) {
848
+ return nativeKeys(object);
849
+ }
850
+ var result = [];
851
+ for (var key in Object(object)) {
852
+ if (hasOwnProperty.call(object, key) && key != "constructor") {
853
+ result.push(key);
854
+ }
855
+ }
856
+ return result;
857
+ }
858
+ var _baseKeys = baseKeys$1;
859
+ var arrayLikeKeys = _arrayLikeKeys, baseKeys = _baseKeys, isArrayLike = isArrayLike_1;
860
+ function keys$1(object) {
861
+ return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);
862
+ }
863
+ var keys_1 = keys$1;
864
+ var copyObject = _copyObject, createAssigner = _createAssigner, keys = keys_1;
865
+ var assignWith = createAssigner(function(object, source, srcIndex, customizer) {
866
+ copyObject(source, keys(source), object, customizer);
867
+ });
868
+ var assignWith_1 = assignWith;
869
+ const assignWith$1 = /* @__PURE__ */ getDefaultExportFromCjs(assignWith_1);
870
+ function mergeProps(...items) {
871
+ function customizer(objValue, srcValue) {
872
+ return srcValue === void 0 ? objValue : srcValue;
873
+ }
874
+ let ret = Object.assign({}, items[0]);
875
+ for (let i = 1; i < items.length; i++) {
876
+ ret = assignWith$1(ret, items[i], customizer);
877
+ }
878
+ return ret;
879
+ }
880
+ var isFunction = function(value) {
881
+ return typeof value === "function";
882
+ };
883
+ var isDev = false;
884
+ const isDev$1 = isDev;
885
+ function useMemoizedFn(fn) {
886
+ if (isDev$1) {
887
+ if (!isFunction(fn)) {
888
+ console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof fn));
889
+ }
890
+ }
891
+ var fnRef = React.useRef(fn);
892
+ fnRef.current = React.useMemo(function() {
893
+ return fn;
894
+ }, [fn]);
895
+ var memoizedFn = React.useRef();
896
+ if (!memoizedFn.current) {
897
+ memoizedFn.current = function() {
898
+ var args = [];
899
+ for (var _i = 0; _i < arguments.length; _i++) {
900
+ args[_i] = arguments[_i];
901
+ }
902
+ return fnRef.current.apply(this, args);
903
+ };
904
+ }
905
+ return memoizedFn.current;
906
+ }
907
+ var useUpdate = function() {
908
+ var _a = __read(React.useState({}), 2), setState = _a[1];
909
+ return React.useCallback(function() {
910
+ return setState({});
911
+ }, []);
912
+ };
913
+ const useUpdate$1 = useUpdate;
914
+ function LeftOutline(props) {
915
+ return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
916
+ width: "1em",
917
+ height: "1em",
918
+ viewBox: "0 0 48 48",
919
+ xmlns: "http://www.w3.org/2000/svg",
920
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
921
+ }, props, {
922
+ style: Object.assign({
923
+ verticalAlign: "-0.125em"
924
+ }, props.style),
925
+ className: ["antd-mobile-icon", props.className].filter(Boolean).join(" ")
926
+ }), /* @__PURE__ */ React__namespace.createElement("g", {
927
+ id: "LeftOutline-LeftOutline",
928
+ stroke: "none",
929
+ strokeWidth: 1,
930
+ fill: "none",
931
+ fillRule: "evenodd"
932
+ }, /* @__PURE__ */ React__namespace.createElement("g", {
933
+ id: "LeftOutline-编组"
934
+ }, /* @__PURE__ */ React__namespace.createElement("rect", {
935
+ id: "LeftOutline-矩形",
936
+ fill: "#FFFFFF",
937
+ opacity: 0,
938
+ x: 0,
939
+ y: 0,
940
+ width: 48,
941
+ height: 48
942
+ }), /* @__PURE__ */ React__namespace.createElement("path", {
943
+ d: "M31.7053818,5.11219264 L13.5234393,22.6612572 L13.5234393,22.6612572 C12.969699,23.2125856 12.9371261,24.0863155 13.4257204,24.6755735 L13.5234393,24.7825775 L31.7045714,42.8834676 C31.7795345,42.9580998 31.8810078,43 31.9867879,43 L35.1135102,43 C35.3344241,43 35.5135102,42.8209139 35.5135102,42.6 C35.5135102,42.4936115 35.4711279,42.391606 35.3957362,42.316542 L16.7799842,23.7816937 L16.7799842,23.7816937 L35.3764658,5.6866816 C35.5347957,5.53262122 35.5382568,5.27937888 35.3841964,5.121049 C35.3088921,5.04365775 35.205497,5 35.0975148,5 L31.9831711,5 C31.8795372,5 31.7799483,5.04022164 31.7053818,5.11219264 Z",
944
+ id: "LeftOutline-路径",
945
+ fill: "currentColor",
946
+ fillRule: "nonzero"
947
+ }))));
948
+ }
949
+ function RightOutline(props) {
950
+ return /* @__PURE__ */ React__namespace.createElement("svg", Object.assign({
951
+ width: "1em",
952
+ height: "1em",
953
+ viewBox: "0 0 48 48",
954
+ xmlns: "http://www.w3.org/2000/svg",
955
+ xmlnsXlink: "http://www.w3.org/1999/xlink"
956
+ }, props, {
957
+ style: Object.assign({
958
+ verticalAlign: "-0.125em"
959
+ }, props.style),
960
+ className: ["antd-mobile-icon", props.className].filter(Boolean).join(" ")
961
+ }), /* @__PURE__ */ React__namespace.createElement("g", {
962
+ id: "RightOutline-RightOutline",
963
+ stroke: "none",
964
+ strokeWidth: 1,
965
+ fill: "none",
966
+ fillRule: "evenodd"
967
+ }, /* @__PURE__ */ React__namespace.createElement("g", {
968
+ id: "RightOutline-RightOutlined"
969
+ }, /* @__PURE__ */ React__namespace.createElement("rect", {
970
+ id: "RightOutline-矩形",
971
+ fill: "#FFFFFF",
972
+ opacity: 0,
973
+ x: 0,
974
+ y: 0,
975
+ width: 48,
976
+ height: 48
977
+ }), /* @__PURE__ */ React__namespace.createElement("path", {
978
+ d: "M17.3947957,5.11219264 L35.5767382,22.6612572 L35.5767382,22.6612572 C36.1304785,23.2125856 36.1630514,24.0863155 35.6744571,24.6755735 L35.5767382,24.7825775 L17.3956061,42.8834676 C17.320643,42.9580998 17.2191697,43 17.1133896,43 L13.9866673,43 C13.7657534,43 13.5866673,42.8209139 13.5866673,42.6 C13.5866673,42.4936115 13.6290496,42.391606 13.7044413,42.316542 L32.3201933,23.7816937 L32.3201933,23.7816937 L13.7237117,5.6866816 C13.5653818,5.53262122 13.5619207,5.27937888 13.7159811,5.121049 C13.7912854,5.04365775 13.8946805,5 14.0026627,5 L17.1170064,5 C17.2206403,5 17.3202292,5.04022164 17.3947957,5.11219264 Z",
979
+ id: "RightOutline-right",
980
+ fill: "currentColor",
981
+ fillRule: "nonzero"
982
+ }))));
983
+ }
984
+ const safeArea = "";
985
+ const classPrefix$5 = "adm-safe-area";
986
+ const SafeArea = (props) => {
987
+ return withNativeProps(props, React.createElement("div", {
988
+ className: classNames(classPrefix$5, `${classPrefix$5}-position-${props.position}`)
989
+ }));
990
+ };
991
+ const badge = "";
992
+ const classPrefix$4 = `adm-badge`;
993
+ const dot = React.createElement(React.Fragment, null);
994
+ const Badge$1 = (props) => {
995
+ const {
996
+ content,
997
+ color,
998
+ children
999
+ } = props;
1000
+ const isDot = content === dot;
1001
+ const badgeCls = classNames(classPrefix$4, !!children && `${classPrefix$4}-fixed`, isDot && `${classPrefix$4}-dot`, props.bordered && `${classPrefix$4}-bordered`);
1002
+ const element = content || content === 0 ? withNativeProps(props, React.createElement("div", {
1003
+ className: badgeCls,
1004
+ style: {
1005
+ "--color": color
1006
+ }
1007
+ }, !isDot && React.createElement("div", {
1008
+ className: `${classPrefix$4}-content`
1009
+ }, content))) : null;
1010
+ return children ? React.createElement("div", {
1011
+ className: classNames(`${classPrefix$4}-wrapper`, props.wrapperClassName),
1012
+ style: props.wrapperStyle
1013
+ }, children, element) : element;
1014
+ };
1015
+ const Badge = attachPropertiesToComponent(Badge$1, {
1016
+ dot
1017
+ });
1018
+ function usePropsValue(options) {
1019
+ const {
1020
+ value,
1021
+ defaultValue,
1022
+ onChange
1023
+ } = options;
1024
+ const update = useUpdate$1();
1025
+ const stateRef = React.useRef(value !== void 0 ? value : defaultValue);
1026
+ if (value !== void 0) {
1027
+ stateRef.current = value;
1028
+ }
1029
+ const setState = useMemoizedFn((v2, forceTrigger = false) => {
1030
+ const nextValue = typeof v2 === "function" ? v2(stateRef.current) : v2;
1031
+ if (!forceTrigger && nextValue === stateRef.current)
1032
+ return;
1033
+ stateRef.current = nextValue;
1034
+ update();
1035
+ return onChange === null || onChange === void 0 ? void 0 : onChange(nextValue);
1036
+ });
1037
+ return [stateRef.current, setState];
1038
+ }
1039
+ var reactIs = { exports: {} };
1040
+ var reactIs_production_min = {};
1041
+ /**
1042
+ * @license React
1043
+ * react-is.production.min.js
1044
+ *
1045
+ * Copyright (c) Facebook, Inc. and its affiliates.
1046
+ *
1047
+ * This source code is licensed under the MIT license found in the
1048
+ * LICENSE file in the root directory of this source tree.
1049
+ */
1050
+ var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
1051
+ u = Symbol.for("react.module.reference");
1052
+ function v(a) {
1053
+ if ("object" === typeof a && null !== a) {
1054
+ var r = a.$$typeof;
1055
+ switch (r) {
1056
+ case b:
1057
+ switch (a = a.type, a) {
1058
+ case d:
1059
+ case f:
1060
+ case e:
1061
+ case m:
1062
+ case n:
1063
+ return a;
1064
+ default:
1065
+ switch (a = a && a.$$typeof, a) {
1066
+ case k:
1067
+ case h:
1068
+ case l:
1069
+ case q:
1070
+ case p:
1071
+ case g:
1072
+ return a;
1073
+ default:
1074
+ return r;
1075
+ }
1076
+ }
1077
+ case c:
1078
+ return r;
1079
+ }
1080
+ }
1081
+ }
1082
+ reactIs_production_min.ContextConsumer = h;
1083
+ reactIs_production_min.ContextProvider = g;
1084
+ reactIs_production_min.Element = b;
1085
+ reactIs_production_min.ForwardRef = l;
1086
+ reactIs_production_min.Fragment = d;
1087
+ reactIs_production_min.Lazy = q;
1088
+ reactIs_production_min.Memo = p;
1089
+ reactIs_production_min.Portal = c;
1090
+ reactIs_production_min.Profiler = f;
1091
+ reactIs_production_min.StrictMode = e;
1092
+ reactIs_production_min.Suspense = m;
1093
+ reactIs_production_min.SuspenseList = n;
1094
+ reactIs_production_min.isAsyncMode = function() {
1095
+ return false;
1096
+ };
1097
+ reactIs_production_min.isConcurrentMode = function() {
1098
+ return false;
1099
+ };
1100
+ reactIs_production_min.isContextConsumer = function(a) {
1101
+ return v(a) === h;
1102
+ };
1103
+ reactIs_production_min.isContextProvider = function(a) {
1104
+ return v(a) === g;
1105
+ };
1106
+ reactIs_production_min.isElement = function(a) {
1107
+ return "object" === typeof a && null !== a && a.$$typeof === b;
1108
+ };
1109
+ reactIs_production_min.isForwardRef = function(a) {
1110
+ return v(a) === l;
1111
+ };
1112
+ reactIs_production_min.isFragment = function(a) {
1113
+ return v(a) === d;
1114
+ };
1115
+ reactIs_production_min.isLazy = function(a) {
1116
+ return v(a) === q;
1117
+ };
1118
+ reactIs_production_min.isMemo = function(a) {
1119
+ return v(a) === p;
1120
+ };
1121
+ reactIs_production_min.isPortal = function(a) {
1122
+ return v(a) === c;
1123
+ };
1124
+ reactIs_production_min.isProfiler = function(a) {
1125
+ return v(a) === f;
1126
+ };
1127
+ reactIs_production_min.isStrictMode = function(a) {
1128
+ return v(a) === e;
1129
+ };
1130
+ reactIs_production_min.isSuspense = function(a) {
1131
+ return v(a) === m;
1132
+ };
1133
+ reactIs_production_min.isSuspenseList = function(a) {
1134
+ return v(a) === n;
1135
+ };
1136
+ reactIs_production_min.isValidElementType = function(a) {
1137
+ return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
1138
+ };
1139
+ reactIs_production_min.typeOf = v;
1140
+ {
1141
+ reactIs.exports = reactIs_production_min;
1142
+ }
1143
+ var reactIsExports = reactIs.exports;
1144
+ function traverseReactNode(children, fn) {
1145
+ let i = 0;
1146
+ function handle(target) {
1147
+ React.Children.forEach(target, (child) => {
1148
+ if (!reactIsExports.isFragment(child)) {
1149
+ fn(child, i);
1150
+ i += 1;
1151
+ } else {
1152
+ handle(child.props.children);
1153
+ }
1154
+ });
1155
+ }
1156
+ handle(children);
1157
+ }
1158
+ const list = "";
1159
+ const classPrefix$3 = `adm-list`;
1160
+ const defaultProps$2 = {
1161
+ mode: "default"
1162
+ };
1163
+ const List$1 = React.forwardRef((p2, ref) => {
1164
+ const props = mergeProps(defaultProps$2, p2);
1165
+ const nativeElementRef = React.useRef(null);
1166
+ React.useImperativeHandle(ref, () => ({
1167
+ get nativeElement() {
1168
+ return nativeElementRef.current;
1169
+ }
1170
+ }));
1171
+ return withNativeProps(props, React.createElement("div", {
1172
+ className: classNames(classPrefix$3, `${classPrefix$3}-${props.mode}`),
1173
+ ref: nativeElementRef
1174
+ }, props.header && React.createElement("div", {
1175
+ className: `${classPrefix$3}-header`
1176
+ }, props.header), React.createElement("div", {
1177
+ className: `${classPrefix$3}-body`
1178
+ }, React.createElement("div", {
1179
+ className: `${classPrefix$3}-body-inner`
1180
+ }, props.children))));
1181
+ });
1182
+ function isNodeWithContent(node) {
1183
+ return node !== void 0 && node !== null && node !== false;
1184
+ }
1185
+ const classPrefix$2 = `adm-list-item`;
1186
+ const ListItem = (props) => {
1187
+ var _a;
1188
+ const clickable = (_a = props.clickable) !== null && _a !== void 0 ? _a : !!props.onClick;
1189
+ const arrow = props.arrow === void 0 ? clickable : props.arrow;
1190
+ const content = React.createElement("div", {
1191
+ className: `${classPrefix$2}-content`
1192
+ }, isNodeWithContent(props.prefix) && React.createElement("div", {
1193
+ className: `${classPrefix$2}-content-prefix`
1194
+ }, props.prefix), React.createElement("div", {
1195
+ className: `${classPrefix$2}-content-main`
1196
+ }, isNodeWithContent(props.title) && React.createElement("div", {
1197
+ className: `${classPrefix$2}-title`
1198
+ }, props.title), props.children, isNodeWithContent(props.description) && React.createElement("div", {
1199
+ className: `${classPrefix$2}-description`
1200
+ }, props.description)), isNodeWithContent(props.extra) && React.createElement("div", {
1201
+ className: `${classPrefix$2}-content-extra`
1202
+ }, props.extra), isNodeWithContent(arrow) && React.createElement("div", {
1203
+ className: `${classPrefix$2}-content-arrow`
1204
+ }, arrow === true ? React.createElement(RightOutline, null) : arrow));
1205
+ return withNativeProps(props, React.createElement(clickable ? "a" : "div", {
1206
+ className: classNames(`${classPrefix$2}`, clickable ? ["adm-plain-anchor"] : [], props.disabled && `${classPrefix$2}-disabled`),
1207
+ onClick: props.disabled ? void 0 : props.onClick
1208
+ }, content));
1209
+ };
1210
+ const List = attachPropertiesToComponent(List$1, {
1211
+ Item: ListItem
1212
+ });
1213
+ const navBar = "";
1214
+ const classPrefix$1 = `adm-nav-bar`;
1215
+ const defaultProps$1 = {
1216
+ backArrow: true
1217
+ };
1218
+ const NavBar = (p2) => {
1219
+ const props = mergeProps(defaultProps$1, p2);
1220
+ const {
1221
+ back,
1222
+ backArrow
1223
+ } = props;
1224
+ return withNativeProps(props, React.createElement("div", {
1225
+ className: classNames(classPrefix$1)
1226
+ }, React.createElement("div", {
1227
+ className: `${classPrefix$1}-left`,
1228
+ role: "button"
1229
+ }, back !== null && React.createElement("div", {
1230
+ className: `${classPrefix$1}-back`,
1231
+ onClick: props.onBack
1232
+ }, backArrow && React.createElement("span", {
1233
+ className: `${classPrefix$1}-back-arrow`
1234
+ }, backArrow === true ? React.createElement(LeftOutline, null) : backArrow), React.createElement("span", {
1235
+ "aria-hidden": "true"
1236
+ }, back)), props.left), React.createElement("div", {
1237
+ className: `${classPrefix$1}-title`
1238
+ }, props.children), React.createElement("div", {
1239
+ className: `${classPrefix$1}-right`
1240
+ }, props.right)));
1241
+ };
1242
+ const tabBar = "";
1243
+ const TabBarItem$1 = () => {
1244
+ return null;
1245
+ };
1246
+ const classPrefix = `adm-tab-bar`;
1247
+ const defaultProps = {
1248
+ safeArea: false
1249
+ };
1250
+ const TabBar$1 = (p2) => {
1251
+ var _a;
1252
+ const props = mergeProps(defaultProps, p2);
1253
+ let firstActiveKey = null;
1254
+ const items = [];
1255
+ traverseReactNode(props.children, (child, index) => {
1256
+ if (!React.isValidElement(child))
1257
+ return;
1258
+ const key = child.key;
1259
+ if (typeof key !== "string")
1260
+ return;
1261
+ if (index === 0) {
1262
+ firstActiveKey = key;
1263
+ }
1264
+ items.push(child);
1265
+ });
1266
+ const [activeKey, setActiveKey] = usePropsValue({
1267
+ value: props.activeKey,
1268
+ defaultValue: (_a = props.defaultActiveKey) !== null && _a !== void 0 ? _a : firstActiveKey,
1269
+ onChange: (v2) => {
1270
+ var _a2;
1271
+ if (v2 === null)
1272
+ return;
1273
+ (_a2 = props.onChange) === null || _a2 === void 0 ? void 0 : _a2.call(props, v2);
1274
+ }
1275
+ });
1276
+ return withNativeProps(props, React.createElement("div", {
1277
+ className: classPrefix
1278
+ }, React.createElement("div", {
1279
+ className: `${classPrefix}-wrap`
1280
+ }, items.map((item) => {
1281
+ const active = item.key === activeKey;
1282
+ function renderContent() {
1283
+ const iconElement = item.props.icon && React.createElement("div", {
1284
+ className: `${classPrefix}-item-icon`
1285
+ }, typeof item.props.icon === "function" ? item.props.icon(active) : item.props.icon);
1286
+ const titleElement = item.props.title && React.createElement("div", {
1287
+ className: classNames(`${classPrefix}-item-title`, Boolean(iconElement) && `${classPrefix}-item-title-with-icon`)
1288
+ }, typeof item.props.title === "function" ? item.props.title(active) : item.props.title);
1289
+ if (iconElement) {
1290
+ return React.createElement(React.Fragment, null, React.createElement(Badge, {
1291
+ content: item.props.badge,
1292
+ className: `${classPrefix}-icon-badge`
1293
+ }, iconElement), titleElement);
1294
+ } else if (titleElement) {
1295
+ return React.createElement(Badge, {
1296
+ content: item.props.badge,
1297
+ className: `${classPrefix}-title-badge`
1298
+ }, titleElement);
1299
+ }
1300
+ return null;
1301
+ }
1302
+ return withNativeProps(item.props, React.createElement("div", {
1303
+ key: item.key,
1304
+ onClick: () => {
1305
+ const {
1306
+ key
1307
+ } = item;
1308
+ if (key === void 0 || key === null)
1309
+ return;
1310
+ setActiveKey(key.toString());
1311
+ },
1312
+ className: classNames(`${classPrefix}-item`, {
1313
+ [`${classPrefix}-item-active`]: active
1314
+ })
1315
+ }, renderContent()));
1316
+ })), props.safeArea && React.createElement(SafeArea, {
1317
+ position: "bottom"
1318
+ })));
1319
+ };
1320
+ const TabBar = attachPropertiesToComponent(TabBar$1, {
1321
+ Item: TabBarItem$1
1322
+ });
1323
+ const PageSchema = {
1324
+ type: "void",
1325
+ "x-component": "MPage",
1326
+ "x-designer": "MPage.Designer",
1327
+ "x-component-props": {},
1328
+ properties: {
1329
+ grid: {
1330
+ type: "void",
1331
+ "x-component": "Grid",
1332
+ "x-initializer": "MBlockInitializers",
1333
+ "x-component-props": {
1334
+ showDivider: false
1335
+ }
1336
+ }
1337
+ }
1338
+ };
1339
+ const MenuDesigner = (props) => {
1340
+ const { t: t2 } = useTranslation();
1341
+ const fieldSchema = react.useFieldSchema();
1342
+ const { dn } = client.useDesignable();
1343
+ const field = react.useField();
1344
+ const schemaSettingsProps = {
1345
+ dn,
1346
+ field,
1347
+ fieldSchema
1348
+ };
1349
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1350
+ client.SchemaSettings,
1351
+ {
1352
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(
1353
+ antd.Button,
1354
+ {
1355
+ style: {
1356
+ borderColor: "var(--colorSettings)",
1357
+ color: "var(--colorSettings)"
1358
+ },
1359
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
1360
+ type: "dashed",
1361
+ children: t2("Menu configuration")
1362
+ }
1363
+ ),
1364
+ ...schemaSettingsProps,
1365
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1366
+ client.SchemaSettings.Remove,
1367
+ {
1368
+ removeParentsIfNoChildren: true,
1369
+ confirm: {
1370
+ title: t2("Delete menu block")
1371
+ },
1372
+ breakRemoveOn: {
1373
+ "x-component": "Grid"
1374
+ }
1375
+ },
1376
+ "remove"
1377
+ )
1378
+ }
1379
+ );
1380
+ };
1381
+ const useSchemaPatch = () => {
1382
+ const { dn } = client.useDesignable();
1383
+ const fieldSchema = react.useFieldSchema();
1384
+ const field = react.useField();
1385
+ const onUpdateComponentProps = React.useCallback((data) => {
1386
+ lodash.set(fieldSchema, "x-component-props", data);
1387
+ field.componentProps = { ...field.componentProps, ...data };
1388
+ dn.emit("patch", {
1389
+ schema: {
1390
+ ["x-uid"]: fieldSchema["x-uid"],
1391
+ "x-component-props": fieldSchema["x-component-props"],
1392
+ "x-server-hooks": [
1393
+ {
1394
+ type: "onSelfSave",
1395
+ method: "extractTextToLocale"
1396
+ }
1397
+ ]
1398
+ }
1399
+ });
1400
+ dn.refresh();
1401
+ }, []);
1402
+ return { onUpdateComponentProps };
1403
+ };
1404
+ const menuItemSchema = {
1405
+ properties: {
1406
+ name: {
1407
+ type: "string",
1408
+ title: generateNTemplate("Menu name"),
1409
+ required: true,
1410
+ "x-component": "Input",
1411
+ "x-decorator": "FormItem"
1412
+ },
1413
+ icon: {
1414
+ "x-decorator": "FormItem",
1415
+ "x-component": "IconPicker",
1416
+ title: generateNTemplate("Icon"),
1417
+ "x-component-props": {}
1418
+ }
1419
+ }
1420
+ };
1421
+ const InternalMenuItem = (props) => {
1422
+ const { icon, name } = props;
1423
+ const Designer2 = client.useDesigner();
1424
+ const navigate = reactRouterDom.useNavigate();
1425
+ const location = reactRouterDom.useLocation();
1426
+ const fieldSchema = react.useFieldSchema();
1427
+ const compile = client.useCompile();
1428
+ const params = reactRouterDom.useParams();
1429
+ const onToPage = () => {
1430
+ const locationPath = location.pathname.endsWith("/") ? location.pathname.slice(0, -1) : location.pathname;
1431
+ navigate(params.name ? `/mobile/${fieldSchema["x-uid"]}` : `${locationPath}/${fieldSchema["x-uid"]}`);
1432
+ };
1433
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1434
+ client.SortableItem,
1435
+ {
1436
+ className: client.cx(
1437
+ "nb-mobile-menu-item",
1438
+ client.css`
1439
+ width: 100%;
1440
+ background: var(--adm-color-background);
1441
+ > .adm-list-item {
1442
+ background: inherit;
1443
+ }
1444
+ `
1445
+ ),
1446
+ children: [
1447
+ /* @__PURE__ */ jsxRuntimeExports.jsx(List.Item, { arrow: true, clickable: true, ...props, prefix: /* @__PURE__ */ jsxRuntimeExports.jsx(client.Icon, { type: icon }), onClick: onToPage, children: compile(name) }),
1448
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {})
1449
+ ]
1450
+ }
1451
+ );
1452
+ };
1453
+ const MenuItemDesigner = () => {
1454
+ const { t: t2 } = useTranslation();
1455
+ const { onUpdateComponentProps } = useSchemaPatch();
1456
+ const field = react.useField();
1457
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.GeneralSchemaDesigner, { children: [
1458
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1459
+ client.SchemaSettings.ModalItem,
1460
+ {
1461
+ title: t2("Edit menu info"),
1462
+ initialValues: field.componentProps,
1463
+ schema: menuItemSchema,
1464
+ onSubmit: onUpdateComponentProps
1465
+ }
1466
+ ),
1467
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1468
+ client.SchemaSettings.Remove,
1469
+ {
1470
+ removeParentsIfNoChildren: true,
1471
+ confirm: {
1472
+ title: t2("Delete menu item?")
1473
+ },
1474
+ breakRemoveOn: {
1475
+ "x-component": "MMenu"
1476
+ }
1477
+ },
1478
+ "remove"
1479
+ )
1480
+ ] });
1481
+ };
1482
+ const MenuItem = InternalMenuItem;
1483
+ MenuItem.Designer = MenuItemDesigner;
1484
+ const useStyles$2 = client.createStyles(({ token, css }) => {
1485
+ return {
1486
+ mobileMenu: css`
1487
+ --adm-color-primary: ${token.colorPrimary};
1488
+ --adm-color-primary-hover: ${token.colorPrimaryHover};
1489
+ --adm-color-primary-active: ${token.colorPrimaryActive};
1490
+ --padding-left: ${token.paddingSM}px;
1491
+ --adm-color-background: ${token.colorBgContainer};
1492
+ --adm-color-border: ${token.colorBorder};
1493
+
1494
+ background: ${token.colorBgContainer};
1495
+ width: 100%;
1496
+ margin-bottom: var(--nb-spacing);
1497
+ `
1498
+ };
1499
+ });
1500
+ const InternalMenu = (props) => {
1501
+ const { styles } = useStyles$2();
1502
+ const Designer2 = client.useDesigner();
1503
+ const fieldSchema = react.useFieldSchema();
1504
+ const { insertBeforeEnd, designable } = client.useDesignable();
1505
+ const { t: t2 } = useTranslation();
1506
+ const onAddMenuItem = (values) => {
1507
+ const properties = {
1508
+ page: PageSchema
1509
+ };
1510
+ return insertBeforeEnd({
1511
+ type: "void",
1512
+ title: values.name,
1513
+ "x-component": "MMenu.Item",
1514
+ "x-component-props": values,
1515
+ "x-designer": "MMenu.Item.Designer",
1516
+ properties
1517
+ });
1518
+ };
1519
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(client.SortableItem, { className: client.cx("nb-mobile-menu", styles.mobileMenu), children: /* @__PURE__ */ jsxRuntimeExports.jsxs(List, { children: [
1520
+ designable && /* @__PURE__ */ jsxRuntimeExports.jsx(List.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}) }),
1521
+ /* @__PURE__ */ jsxRuntimeExports.jsx(client.DndContext, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { onlyRenderProperties: true, schema: fieldSchema }) }),
1522
+ designable ? /* @__PURE__ */ jsxRuntimeExports.jsx(List.Item, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1523
+ client.SchemaInitializer.ActionModal,
1524
+ {
1525
+ buttonText: t2("Add menu item"),
1526
+ title: t2("Add menu item"),
1527
+ schema: menuItemSchema,
1528
+ onSubmit: onAddMenuItem
1529
+ }
1530
+ ) }) : null
1531
+ ] }) });
1532
+ };
1533
+ const MMenu = InternalMenu;
1534
+ MMenu.Item = MenuItem;
1535
+ MMenu.Designer = MenuDesigner;
1536
+ const findSchema = (schema, component) => {
1537
+ const gridSchema = schema.reduceProperties(
1538
+ (schema2, next) => schema2 || next["x-component"] === component && next
1539
+ );
1540
+ return gridSchema;
1541
+ };
1542
+ const findGridSchema = (schema) => {
1543
+ return findSchema(schema, "Grid");
1544
+ };
1545
+ const allowComponents = ["Grid", "Grid.Row"];
1546
+ const plusComponent = ["Grid.Col"];
1547
+ const countGridCol = (schema, countToStop) => {
1548
+ if (!schema)
1549
+ return 0;
1550
+ let count = 0;
1551
+ if (plusComponent.includes(schema["x-component"])) {
1552
+ count += 1;
1553
+ }
1554
+ if (typeof countToStop === "number" && count >= countToStop)
1555
+ return count;
1556
+ if (allowComponents.includes(schema["x-component"])) {
1557
+ schema.mapProperties((schema2) => {
1558
+ count += countGridCol(schema2, countToStop);
1559
+ });
1560
+ }
1561
+ return count;
1562
+ };
1563
+ const ContainerDesigner = () => {
1564
+ const { t: t2 } = useTranslation();
1565
+ const fieldSchema = react.useFieldSchema();
1566
+ const { dn } = client.useDesignable();
1567
+ const tabBarSchema = fieldSchema.reduceProperties(
1568
+ (schema, next) => schema || next["x-component"] === "MTabBar" && next
1569
+ );
1570
+ const navigate = reactRouterDom.useNavigate();
1571
+ const field = react.useField();
1572
+ const schemaSettingsProps = {
1573
+ dn,
1574
+ field,
1575
+ fieldSchema
1576
+ };
1577
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1578
+ client.SchemaSettings,
1579
+ {
1580
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(
1581
+ antd.Button,
1582
+ {
1583
+ style: {
1584
+ borderColor: "var(--colorSettings)",
1585
+ color: "var(--colorSettings)",
1586
+ width: "100%"
1587
+ },
1588
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
1589
+ type: "dashed",
1590
+ children: t2("App level Configuration")
1591
+ }
1592
+ ),
1593
+ ...schemaSettingsProps,
1594
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1595
+ client.SchemaSettings.SwitchItem,
1596
+ {
1597
+ checked: !!tabBarSchema,
1598
+ title: t2("Enable TabBar"),
1599
+ onChange: async (v2) => {
1600
+ var _a;
1601
+ if (v2) {
1602
+ const pageSchema = findSchema(fieldSchema, "MPage");
1603
+ if (!pageSchema)
1604
+ return;
1605
+ await dn.remove(pageSchema);
1606
+ await dn.insertBeforeEnd({
1607
+ type: "void",
1608
+ "x-component": "MTabBar",
1609
+ "x-component-props": {},
1610
+ name: "tabBar",
1611
+ properties: {
1612
+ [shared.uid()]: {
1613
+ type: "void",
1614
+ "x-component": "MTabBar.Item",
1615
+ "x-designer": "MTabBar.Item.Designer",
1616
+ "x-component-props": {
1617
+ icon: "HomeOutlined",
1618
+ title: generateNTemplate("Untitled")
1619
+ },
1620
+ properties: {
1621
+ page: pageSchema.toJSON()
1622
+ }
1623
+ }
1624
+ }
1625
+ });
1626
+ } else {
1627
+ const tabBarSchemaFirstKey = (_a = Object.keys(tabBarSchema.properties || {})) == null ? void 0 : _a[0];
1628
+ const pageSchema = tabBarSchemaFirstKey ? findSchema(tabBarSchema.properties[tabBarSchemaFirstKey], "MPage") : null;
1629
+ await dn.remove(tabBarSchema);
1630
+ await dn.insertBeforeEnd(pageSchema || PageSchema, {
1631
+ onSuccess() {
1632
+ navigate("../");
1633
+ }
1634
+ });
1635
+ }
1636
+ }
1637
+ }
1638
+ )
1639
+ }
1640
+ );
1641
+ };
1642
+ const useStyles$1 = client.createStyles(({ token, css }) => {
1643
+ return {
1644
+ mobileContainer: css`
1645
+ --adm-color-primary: ${token.colorPrimary};
1646
+
1647
+ & > .general-schema-designer > .general-schema-designer-icons {
1648
+ right: unset;
1649
+ left: 2px;
1650
+ }
1651
+ background: var(--nb-box-bg);
1652
+ display: flex;
1653
+ flex-direction: column;
1654
+ width: 100%;
1655
+ height: 100%;
1656
+ overflow-y: scroll;
1657
+ position: initial !important;
1658
+ `,
1659
+ tabBar: css`
1660
+ & > .general-schema-designer {
1661
+ --nb-designer-top: ${token.marginMD}px;
1662
+ }
1663
+ position: absolute;
1664
+ background: ${token.colorBgContainer};
1665
+ width: 100%;
1666
+ bottom: 0;
1667
+ left: 0;
1668
+ z-index: 1000;
1669
+ `
1670
+ };
1671
+ });
1672
+ const findGrid = (schema, uid) => {
1673
+ return schema.reduceProperties((final, next) => {
1674
+ if (final)
1675
+ return final;
1676
+ if (next["x-component"] === "MTabBar") {
1677
+ return findGrid(next, uid);
1678
+ }
1679
+ if (next["x-component"] === "MTabBar.Item" && uid === next["x-uid"]) {
1680
+ return next;
1681
+ }
1682
+ });
1683
+ };
1684
+ const TabContentComponent = () => {
1685
+ const { name } = reactRouterDom.useParams();
1686
+ const fieldSchema = react.useFieldSchema();
1687
+ if (!name)
1688
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {});
1689
+ const gridSchema = findGrid(fieldSchema.properties["tabBar"], name.replace("tab_", ""));
1690
+ if (!gridSchema) {
1691
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { replace: true, to: "../" });
1692
+ }
1693
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { schema: gridSchema });
1694
+ };
1695
+ const InternalContainer = (props) => {
1696
+ var _a, _b;
1697
+ const { styles } = useStyles$1();
1698
+ const { token } = client.useToken();
1699
+ const Designer2 = client.useDesigner();
1700
+ const fieldSchema = react.useFieldSchema();
1701
+ const navigate = reactRouterDom.useNavigate();
1702
+ const params = reactRouterDom.useParams();
1703
+ const location = reactRouterDom.useLocation();
1704
+ const tabBarSchema = (_a = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _a["tabBar"];
1705
+ const tabBarCurrentFirstKey = (tabBarSchema == null ? void 0 : tabBarSchema.properties) ? Object.keys(tabBarSchema.properties)[0] : null;
1706
+ let redirectToUid = null;
1707
+ if (tabBarCurrentFirstKey) {
1708
+ redirectToUid = (_b = tabBarSchema == null ? void 0 : tabBarSchema.properties[tabBarCurrentFirstKey]) == null ? void 0 : _b["x-uid"];
1709
+ }
1710
+ React.useEffect(() => {
1711
+ if (redirectToUid && !params.name) {
1712
+ const locationPath = location.pathname.endsWith("/") ? location.pathname.slice(0, -1) : location.pathname;
1713
+ navigate(`${locationPath}/tab_${redirectToUid}`, { replace: true });
1714
+ }
1715
+ }, [location.pathname, navigate, params.name, redirectToUid]);
1716
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { eid: "nb-mobile-scroll-wrapper", className: client.cx("nb-mobile-container", styles.mobileContainer), children: [
1717
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}),
1718
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1719
+ "div",
1720
+ {
1721
+ style: {
1722
+ paddingBottom: redirectToUid ? token.paddingLG * 2 : 0
1723
+ },
1724
+ className: "nb-mobile-container-content",
1725
+ children: redirectToUid ? /* @__PURE__ */ jsxRuntimeExports.jsx(TabContentComponent, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(
1726
+ client.SchemaComponent,
1727
+ {
1728
+ filterProperties: (schema) => {
1729
+ return schema["x-component"] !== "MTabBar";
1730
+ },
1731
+ schema: fieldSchema
1732
+ }
1733
+ )
1734
+ }
1735
+ ),
1736
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: client.cx("nb-mobile-container-tab-bar", styles.tabBar), children: /* @__PURE__ */ jsxRuntimeExports.jsx(
1737
+ client.SchemaComponent,
1738
+ {
1739
+ onlyRenderProperties: true,
1740
+ filterProperties: (schema) => {
1741
+ return schema["x-component"] === "MTabBar";
1742
+ },
1743
+ schema: fieldSchema
1744
+ }
1745
+ ) })
1746
+ ] });
1747
+ };
1748
+ const MContainer = InternalContainer;
1749
+ MContainer.Designer = ContainerDesigner;
1750
+ MContainer.displayName = "MContainer";
1751
+ const tabItemSchema = {
1752
+ properties: {
1753
+ title: {
1754
+ type: "string",
1755
+ title: `{{ t('Title') }}`,
1756
+ required: true,
1757
+ "x-component": "Input",
1758
+ "x-decorator": "FormItem"
1759
+ },
1760
+ icon: {
1761
+ required: true,
1762
+ "x-decorator": "FormItem",
1763
+ "x-component": "IconPicker",
1764
+ title: `{{ t('Icon') }}`,
1765
+ "x-component-props": {}
1766
+ }
1767
+ }
1768
+ };
1769
+ const InternalItem = () => {
1770
+ const Designer2 = client.useDesigner();
1771
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1772
+ client.SortableItem,
1773
+ {
1774
+ className: client.cx(
1775
+ "nb-mobile-tab-bar-item",
1776
+ client.css`
1777
+ position: absolute !important;
1778
+ width: 100%;
1779
+ height: 100%;
1780
+ top: 0;
1781
+ left: 0;
1782
+ `
1783
+ ),
1784
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {})
1785
+ }
1786
+ );
1787
+ };
1788
+ const Designer = () => {
1789
+ const { t: t2 } = useTranslation();
1790
+ const fieldSchema = react.useFieldSchema();
1791
+ const { onUpdateComponentProps } = useSchemaPatch();
1792
+ const field = react.useField();
1793
+ const tabItems = Object.keys(fieldSchema.parent.properties).length;
1794
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.GeneralSchemaDesigner, { children: [
1795
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1796
+ client.SchemaSettings.ModalItem,
1797
+ {
1798
+ title: t2("Edit info"),
1799
+ initialValues: field.componentProps,
1800
+ schema: tabItemSchema,
1801
+ onSubmit: onUpdateComponentProps
1802
+ }
1803
+ ),
1804
+ tabItems > 1 ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1805
+ client.SchemaSettings.Remove,
1806
+ {
1807
+ removeParentsIfNoChildren: true,
1808
+ confirm: {
1809
+ title: t2("Delete tab item?")
1810
+ },
1811
+ breakRemoveOn: {
1812
+ "x-component": "MTabBar"
1813
+ }
1814
+ },
1815
+ "remove"
1816
+ ) : null
1817
+ ] });
1818
+ };
1819
+ const TabBarItem = InternalItem;
1820
+ TabBarItem.Designer = Designer;
1821
+ const InternalTabBar = (props) => {
1822
+ const fieldSchema = react.useFieldSchema();
1823
+ const { designable } = client.useDesignable();
1824
+ const { t: t2 } = useTranslation();
1825
+ const { insertBeforeEnd } = client.useDesignable();
1826
+ const navigate = reactRouterDom.useNavigate();
1827
+ const params = reactRouterDom.useParams();
1828
+ const compile = client.useCompile();
1829
+ const onAddTab = React.useCallback((values) => {
1830
+ return insertBeforeEnd({
1831
+ type: "void",
1832
+ "x-component": "MTabBar.Item",
1833
+ "x-component-props": values,
1834
+ "x-designer": "MTabBar.Item.Designer",
1835
+ properties: {
1836
+ [shared.uid()]: PageSchema
1837
+ },
1838
+ "x-server-hooks": [
1839
+ {
1840
+ type: "onSelfSave",
1841
+ method: "extractTextToLocale"
1842
+ }
1843
+ ]
1844
+ });
1845
+ }, []);
1846
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
1847
+ client.SortableItem,
1848
+ {
1849
+ className: client.cx(
1850
+ "nb-mobile-tab-bar",
1851
+ client.css`
1852
+ position: relative;
1853
+ width: 100%;
1854
+ display: flex;
1855
+ align-items: center;
1856
+ `
1857
+ ),
1858
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.DndContext, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
1859
+ TabBar,
1860
+ {
1861
+ activeKey: params.name,
1862
+ onChange: (key) => {
1863
+ if (key === "add-tab") {
1864
+ return;
1865
+ }
1866
+ navigate(`/mobile/${key}`);
1867
+ },
1868
+ safeArea: true,
1869
+ className: client.cx(
1870
+ client.css`
1871
+ width: 100%;
1872
+ `
1873
+ ),
1874
+ children: [
1875
+ fieldSchema.mapProperties((schema, name) => {
1876
+ const cp = schema["x-component-props"];
1877
+ return /* @__PURE__ */ React.createElement(
1878
+ TabBar.Item,
1879
+ {
1880
+ ...cp,
1881
+ key: `tab_${schema["x-uid"]}`,
1882
+ title: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
1883
+ t2(compile(cp.title)),
1884
+ /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaComponent, { schema, name })
1885
+ ] }),
1886
+ icon: cp.icon ? /* @__PURE__ */ jsxRuntimeExports.jsx(client.Icon, { type: cp.icon }) : void 0
1887
+ }
1888
+ );
1889
+ }),
1890
+ designable && (!fieldSchema.properties || Object.keys(fieldSchema.properties).length < 5) ? /* @__PURE__ */ jsxRuntimeExports.jsx(
1891
+ TabBar.Item,
1892
+ {
1893
+ className: client.css`
1894
+ .adm-tab-bar-item-icon {
1895
+ height: auto;
1896
+ }
1897
+ `,
1898
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(client.SchemaInitializer.ActionModal, { title: t2("Add tab"), onSubmit: onAddTab, schema: tabItemSchema })
1899
+ },
1900
+ "add-tab"
1901
+ ) : null
1902
+ ]
1903
+ }
1904
+ ) })
1905
+ }
1906
+ );
1907
+ };
1908
+ const MTabBar = InternalTabBar;
1909
+ MTabBar.Item = TabBarItem;
1910
+ MTabBar.displayName = "MTabBar";
1911
+ const PageDesigner = (props) => {
1912
+ var _a, _b;
1913
+ const { showBack } = props;
1914
+ const { t: t2 } = useTranslation();
1915
+ const fieldSchema = react.useFieldSchema();
1916
+ const { dn } = client.useDesignable();
1917
+ const headerSchema = (_a = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _a["header"];
1918
+ const tabsSchema = (_b = fieldSchema == null ? void 0 : fieldSchema.properties) == null ? void 0 : _b["tabs"];
1919
+ const field = react.useField();
1920
+ const schemaSettingsProps = {
1921
+ dn,
1922
+ field,
1923
+ fieldSchema
1924
+ };
1925
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
1926
+ client.SchemaSettings,
1927
+ {
1928
+ title: /* @__PURE__ */ jsxRuntimeExports.jsx(
1929
+ antd.Button,
1930
+ {
1931
+ style: {
1932
+ borderColor: "var(--colorSettings)",
1933
+ color: "var(--colorSettings)",
1934
+ width: "100%"
1935
+ },
1936
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.MenuOutlined, {}),
1937
+ type: "dashed",
1938
+ children: t2("Page configuration")
1939
+ }
1940
+ ),
1941
+ ...schemaSettingsProps,
1942
+ children: [
1943
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1944
+ client.SchemaSettings.SwitchItem,
1945
+ {
1946
+ checked: !!headerSchema,
1947
+ title: t2("Enable Header"),
1948
+ onChange: async (v2) => {
1949
+ var _a2;
1950
+ if (v2) {
1951
+ await dn.insertAfterBegin({
1952
+ type: "void",
1953
+ name: "header",
1954
+ "x-component": "MHeader",
1955
+ "x-designer": "MHeader.Designer",
1956
+ "x-component-props": {
1957
+ title: (_a2 = fieldSchema.parent["x-component-props"]) == null ? void 0 : _a2.name,
1958
+ showBack
1959
+ }
1960
+ });
1961
+ } else {
1962
+ await dn.remove(headerSchema);
1963
+ }
1964
+ dn.refresh();
1965
+ }
1966
+ }
1967
+ ),
1968
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
1969
+ client.SchemaSettings.SwitchItem,
1970
+ {
1971
+ checked: !!tabsSchema,
1972
+ title: t2("Enable Tabs"),
1973
+ onChange: async (v2) => {
1974
+ if (v2) {
1975
+ const gridSchema = findGridSchema(fieldSchema);
1976
+ if (gridSchema) {
1977
+ return dn.remove(gridSchema).then(() => {
1978
+ return dn.insertBeforeEnd({
1979
+ type: "void",
1980
+ name: "tabs",
1981
+ "x-component": "Tabs",
1982
+ "x-component-props": {},
1983
+ "x-initializer": "TabPaneInitializers",
1984
+ "x-initializer-props": {
1985
+ gridInitializer: "MBlockInitializers"
1986
+ },
1987
+ properties: {
1988
+ tab1: {
1989
+ type: "void",
1990
+ title: generateNTemplate("Untitled"),
1991
+ "x-component": "Tabs.TabPane",
1992
+ "x-designer": "Tabs.Designer",
1993
+ "x-component-props": {},
1994
+ properties: {
1995
+ grid: {
1996
+ ...gridSchema,
1997
+ "x-uid": shared.uid()
1998
+ }
1999
+ }
2000
+ }
2001
+ }
2002
+ });
2003
+ });
2004
+ }
2005
+ } else {
2006
+ const gridSchema = findGridSchema(tabsSchema.properties[Object.keys(tabsSchema.properties)[0]]);
2007
+ if (gridSchema) {
2008
+ return dn.remove(tabsSchema).then(() => dn.insertBeforeEnd(gridSchema, {}));
2009
+ }
2010
+ }
2011
+ }
2012
+ }
2013
+ )
2014
+ ]
2015
+ }
2016
+ );
2017
+ };
2018
+ const useStyles = client.createStyles(({ token, css }) => {
2019
+ return {
2020
+ globalActionCSS: css`
2021
+ #nb-position-container > & {
2022
+ height: ${token.sizeXXL}px;
2023
+ border-top: 1px solid var(--nb-box-bg);
2024
+ margin-bottom: 0px !important;
2025
+ padding: 0 var(--nb-spacing);
2026
+ align-items: center;
2027
+ overflow-x: auto;
2028
+ background: ${token.colorBgContainer};
2029
+ z-index: 100;
2030
+ }
2031
+ `,
2032
+ mobilePage: css`
2033
+ background: var(--nb-box-bg);
2034
+ display: flex;
2035
+ flex-direction: column;
2036
+ width: 100%;
2037
+ height: 100%;
2038
+ overflow-x: hidden;
2039
+ overflow-y: auto;
2040
+ padding-bottom: var(--nb-spacing);
2041
+ `,
2042
+ mobilePageHeader: css`
2043
+ & > .ant-tabs > .ant-tabs-nav {
2044
+ .ant-tabs-tab {
2045
+ margin: 0 !important;
2046
+ padding: 0 ${token.paddingContentHorizontal}px !important;
2047
+ }
2048
+ background: ${token.colorBgContainer};
2049
+ }
2050
+ display: flex;
2051
+ flex-direction: column;
2052
+ `
2053
+ };
2054
+ });
2055
+ const InternalPage = (props) => {
2056
+ var _a, _b, _c, _d;
2057
+ const { styles } = useStyles();
2058
+ const Designer2 = client.useDesigner();
2059
+ const fieldSchema = react.useFieldSchema();
2060
+ const [searchParams, setSearchParams] = reactRouterDom.useSearchParams();
2061
+ const tabsSchema = (_a = fieldSchema.properties) == null ? void 0 : _a["tabs"];
2062
+ const onlyInPage = fieldSchema.root === fieldSchema.parent;
2063
+ let hasGlobalActions = false;
2064
+ if (!tabsSchema && fieldSchema.properties) {
2065
+ hasGlobalActions = countGridCol(fieldSchema.properties["grid"], 2) === 1;
2066
+ } else if (searchParams.has("tab") && ((_b = tabsSchema == null ? void 0 : tabsSchema.properties) == null ? void 0 : _b[searchParams.get("tab")])) {
2067
+ hasGlobalActions = countGridCol((_d = (_c = tabsSchema.properties[searchParams.get("tab")]) == null ? void 0 : _c.properties) == null ? void 0 : _d["grid"], 2) === 1;
2068
+ } else if (tabsSchema == null ? void 0 : tabsSchema.properties) {
2069
+ const schema = Object.values(tabsSchema.properties).sort((t1, t2) => t1["x-index"] - t2["x-index"])[0];
2070
+ if (schema) {
2071
+ setTimeout(() => {
2072
+ setSearchParams([["tab", schema.name.toString()]], {
2073
+ replace: true
2074
+ });
2075
+ });
2076
+ }
2077
+ }
2078
+ const onTabsChange = React.useCallback(
2079
+ (key) => {
2080
+ setSearchParams([["tab", key]], {
2081
+ replace: true
2082
+ });
2083
+ },
2084
+ [setSearchParams]
2085
+ );
2086
+ const GlobalActionProvider = React.useCallback(
2087
+ (props2) => {
2088
+ if (hasGlobalActions) {
2089
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(client.TabsContextProvider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2090
+ client.ActionBarProvider,
2091
+ {
2092
+ container: (typeof props2.active !== "undefined" ? props2.active : true) && onlyInPage ? document.getElementById("nb-position-container") : null,
2093
+ forceProps: {
2094
+ layout: "one-column",
2095
+ className: styles.globalActionCSS
2096
+ },
2097
+ children: props2.children
2098
+ }
2099
+ ) });
2100
+ }
2101
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: props2.children });
2102
+ },
2103
+ [hasGlobalActions, onlyInPage]
2104
+ );
2105
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { eid: "nb-mobile-scroll-wrapper", className: client.cx("nb-mobile-page", styles.mobilePage), children: [
2106
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, { ...fieldSchema == null ? void 0 : fieldSchema["x-designer-props"] }),
2107
+ /* @__PURE__ */ jsxRuntimeExports.jsxs(
2108
+ "div",
2109
+ {
2110
+ style: {
2111
+ paddingBottom: tabsSchema ? null : "var(--nb-spacing)"
2112
+ },
2113
+ className: client.cx("nb-mobile-page-header", styles.mobilePageHeader),
2114
+ children: [
2115
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
2116
+ react.RecursionField,
2117
+ {
2118
+ schema: fieldSchema,
2119
+ filterProperties: (s) => {
2120
+ return "MHeader" === s["x-component"];
2121
+ }
2122
+ }
2123
+ ),
2124
+ /* @__PURE__ */ jsxRuntimeExports.jsx(
2125
+ client.TabsContextProvider,
2126
+ {
2127
+ PaneRoot: GlobalActionProvider,
2128
+ activeKey: searchParams.get("tab"),
2129
+ onChange: onTabsChange,
2130
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2131
+ react.RecursionField,
2132
+ {
2133
+ schema: fieldSchema,
2134
+ filterProperties: (s) => {
2135
+ return "Tabs" === s["x-component"];
2136
+ }
2137
+ }
2138
+ )
2139
+ }
2140
+ )
2141
+ ]
2142
+ }
2143
+ ),
2144
+ /* @__PURE__ */ jsxRuntimeExports.jsx(GlobalActionProvider, { children: !tabsSchema && /* @__PURE__ */ jsxRuntimeExports.jsx(
2145
+ react.RecursionField,
2146
+ {
2147
+ schema: fieldSchema,
2148
+ filterProperties: (s) => {
2149
+ return s["x-component"] !== "MHeader";
2150
+ }
2151
+ }
2152
+ ) })
2153
+ ] });
2154
+ };
2155
+ const MPage = InternalPage;
2156
+ MPage.Designer = PageDesigner;
2157
+ MPage.displayName = "MPage";
2158
+ const HeaderDesigner = () => {
2159
+ const field = react.useField();
2160
+ const { onUpdateComponentProps } = useSchemaPatch();
2161
+ const { t: t2 } = useTranslation();
2162
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(client.GeneralSchemaDesigner, { draggable: false, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2163
+ client.SchemaSettings.ModalItem,
2164
+ {
2165
+ title: t2("Edit info"),
2166
+ components: { Switch: antdV5.Switch },
2167
+ initialValues: field.componentProps,
2168
+ schema: {
2169
+ properties: {
2170
+ title: {
2171
+ type: "string",
2172
+ title: t2("Title"),
2173
+ required: true,
2174
+ "x-component": "Input",
2175
+ "x-decorator": "FormItem"
2176
+ },
2177
+ showBack: {
2178
+ type: "boolean",
2179
+ title: t2("Display back button"),
2180
+ "x-component": "Switch",
2181
+ "x-decorator": "FormItem"
2182
+ }
2183
+ }
2184
+ },
2185
+ onSubmit: onUpdateComponentProps
2186
+ }
2187
+ ) });
2188
+ };
2189
+ const InternalHeader = (props) => {
2190
+ const field = react.useField();
2191
+ const { title = generateNTemplate("Untitled"), showBack = false } = { ...props, ...field == null ? void 0 : field.componentProps };
2192
+ const Designer2 = client.useDesigner();
2193
+ const compile = client.useCompile();
2194
+ const compiledTitle = compile(title);
2195
+ const navigate = reactRouterDom.useNavigate();
2196
+ const { setTitle } = client.useDocumentTitle();
2197
+ const { token } = client.useToken();
2198
+ React.useEffect(() => {
2199
+ setTitle(compiledTitle);
2200
+ }, [compiledTitle]);
2201
+ const style = React.useMemo(() => {
2202
+ return {
2203
+ width: "100%",
2204
+ background: token.colorBgContainer
2205
+ };
2206
+ }, [token.colorBgContainer]);
2207
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(client.SortableItem, { className: client.cx("nb-mobile-header"), style, children: [
2208
+ /* @__PURE__ */ jsxRuntimeExports.jsx(NavBar, { backArrow: showBack, onBack: () => navigate(-1), children: compiledTitle }),
2209
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {})
2210
+ ] });
2211
+ };
2212
+ const MHeader = InternalHeader;
2213
+ MHeader.Designer = HeaderDesigner;
2214
+ const SettingsDesigner = () => {
2215
+ const { t: t2 } = useTranslation();
2216
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(client.GeneralSchemaDesigner, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2217
+ client.SchemaSettings.Remove,
2218
+ {
2219
+ removeParentsIfNoChildren: true,
2220
+ confirm: {
2221
+ title: t2("Delete settings block")
2222
+ },
2223
+ breakRemoveOn: {
2224
+ "x-component": "Grid"
2225
+ }
2226
+ },
2227
+ "remove"
2228
+ ) });
2229
+ };
2230
+ const InternalSettings = () => {
2231
+ const Designer2 = client.useDesigner();
2232
+ return /* @__PURE__ */ jsxRuntimeExports.jsxs(
2233
+ client.SortableItem,
2234
+ {
2235
+ className: client.cx(
2236
+ "nb-mobile-setting",
2237
+ client.css`
2238
+ margin-bottom: var(--nb-spacing);
2239
+ `
2240
+ ),
2241
+ children: [
2242
+ /* @__PURE__ */ jsxRuntimeExports.jsx(Designer2, {}),
2243
+ /* @__PURE__ */ jsxRuntimeExports.jsx(client.SettingsMenu, { redirectUrl: "/mobile" })
2244
+ ]
2245
+ }
2246
+ );
2247
+ };
2248
+ const MSettings = InternalSettings;
2249
+ MSettings.Designer = SettingsDesigner;
2250
+ const MSettingsBlockInitializer = (props) => {
2251
+ const { insert } = props;
2252
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
2253
+ client.SchemaInitializer.Item,
2254
+ {
2255
+ icon: /* @__PURE__ */ jsxRuntimeExports.jsx(icons.SettingOutlined, {}),
2256
+ onClick: async () => {
2257
+ insert({
2258
+ type: "void",
2259
+ "x-component": "MSettings",
2260
+ "x-designer": "MSettings.Designer",
2261
+ "x-component-props": {}
2262
+ });
2263
+ }
2264
+ }
2265
+ );
2266
+ };
2267
+ const listCss = client.css`
2268
+ padding: 0 var(--nb-spacing);
2269
+ & > .nb-action-bar {
2270
+ padding: unset !important;
2271
+ background: unset !important;
2272
+ }
2273
+ `;
2274
+ const useGridCardBlockItemProps = () => {
2275
+ return {
2276
+ className: listCss
2277
+ };
2278
+ };
2279
+ const columnCountConfig = {
2280
+ xs: 1,
2281
+ sm: 1,
2282
+ md: 1,
2283
+ lg: 1,
2284
+ xl: 1,
2285
+ xxl: 1
2286
+ };
2287
+ const useGridCardBlockProps = () => {
2288
+ const isInterface = useInterfaceContext();
2289
+ return {
2290
+ columnCount: isInterface ? columnCountConfig : null,
2291
+ pagination: {
2292
+ simple: true
2293
+ }
2294
+ };
2295
+ };
2296
+ const MobileCore = (props) => {
2297
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(
2298
+ client.SchemaInitializerProvider,
2299
+ {
2300
+ initializers: {
2301
+ MBlockInitializers
2302
+ },
2303
+ children: /* @__PURE__ */ jsxRuntimeExports.jsx(
2304
+ client.SchemaComponentOptions,
2305
+ {
2306
+ components: {
2307
+ MMenuBlockInitializer,
2308
+ MSettingsBlockInitializer,
2309
+ MContainer,
2310
+ MMenu,
2311
+ MTabBar,
2312
+ MPage,
2313
+ MHeader,
2314
+ MSettings
2315
+ },
2316
+ scope: {
2317
+ useGridCardBlockItemProps,
2318
+ useGridCardBlockProps
2319
+ },
2320
+ children: props.children
2321
+ }
2322
+ )
2323
+ }
2324
+ );
2325
+ };
2326
+ const commonCSSVariables = client.css`
2327
+ --nb-spacing: 14px;
2328
+ `;
2329
+ const commonCSSOverride = client.css``;
2330
+ const commonDesignerCSS = client.css`
2331
+ --nb-designer-top: 2px;
2332
+ --nb-designer-right: 2px;
2333
+ .nb-sortable-designer:hover {
2334
+ position: relative;
2335
+ > .general-schema-designer {
2336
+ display: block;
2337
+ }
2338
+ }
2339
+ .general-schema-designer {
2340
+ position: absolute;
2341
+ z-index: 999;
2342
+ top: 0;
2343
+ bottom: 0;
2344
+ left: 0;
2345
+ right: 0;
2346
+ display: none;
2347
+ border: 0;
2348
+ pointer-events: none;
2349
+ > .general-schema-designer-icons {
2350
+ position: absolute;
2351
+ top: var(--nb-designer-top);
2352
+ right: var(--nb-designer-right);
2353
+ line-height: 16px;
2354
+ pointer-events: all;
2355
+ .ant-space-item {
2356
+ background-color: var(--colorSettings);
2357
+ color: #fff;
2358
+ line-height: 16px;
2359
+ width: 16px;
2360
+ padding-left: 1px;
2361
+ align-self: stretch;
2362
+ }
2363
+ }
2364
+ }
2365
+ `;
2366
+ const drawerProps = {
2367
+ getContainer: ".nb-mobile-application",
2368
+ width: "90%",
2369
+ style: {
2370
+ position: "absolute"
2371
+ }
2372
+ };
2373
+ const modalProps = {
2374
+ ...drawerProps,
2375
+ style: {
2376
+ maxWidth: "calc(100% - 16px)"
2377
+ },
2378
+ maskStyle: {
2379
+ position: "absolute"
2380
+ },
2381
+ wrapClassName: client.css`
2382
+ position: absolute !important;
2383
+ `
2384
+ };
2385
+ const useMobileSchemaUid = () => {
2386
+ var _a, _b, _c;
2387
+ const ctx = client.useSystemSettings();
2388
+ return (_c = (_b = (_a = ctx == null ? void 0 : ctx.data) == null ? void 0 : _a.data) == null ? void 0 : _b.options) == null ? void 0 : _c.mobileSchemaUid;
2389
+ };
2390
+ const MApplication = (props) => {
2391
+ const mobileSchemaUid = useMobileSchemaUid();
2392
+ const params = reactRouterDom.useParams();
2393
+ const interfaceContext = useInterfaceContext();
2394
+ const Provider = React.useMemo(() => {
2395
+ return interfaceContext ? React.Fragment : client.AdminProvider;
2396
+ }, [interfaceContext]);
2397
+ client.useViewport();
2398
+ return /* @__PURE__ */ jsxRuntimeExports.jsx(Provider, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(MobileCore, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(client.ActionContextProvider, { modalProps, drawerProps, children: /* @__PURE__ */ jsxRuntimeExports.jsxs(
2399
+ "div",
2400
+ {
2401
+ className: client.cx(
2402
+ "nb-mobile-application",
2403
+ commonDesignerCSS,
2404
+ commonCSSVariables,
2405
+ commonCSSOverride,
2406
+ client.css`
2407
+ display: flex;
2408
+ flex-direction: column;
2409
+ width: 100%;
2410
+ height: 100%;
2411
+ position: relative;
2412
+ overflow: hidden;
2413
+ `
2414
+ ),
2415
+ children: [
2416
+ params.name && !params.name.startsWith("tab_") ? /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Outlet, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(client.RemoteSchemaComponent, { uid: mobileSchemaUid, children: props.children }, mobileSchemaUid),
2417
+ /* @__PURE__ */ jsxRuntimeExports.jsx("div", { id: "nb-position-container" })
2418
+ ]
2419
+ }
2420
+ ) }) }) });
2421
+ };
2422
+ class MobileClientPlugin extends client.Plugin {
2423
+ constructor() {
2424
+ super(...arguments);
2425
+ __publicField(this, "mobileRouter");
2426
+ }
2427
+ async load() {
2428
+ this.setMobileRouter();
2429
+ this.addRoutes();
2430
+ this.app.use(MobileClientProvider);
2431
+ }
2432
+ setMobileRouter() {
2433
+ const router = client.createRouterManager({ type: "hash" });
2434
+ router.add("root", {
2435
+ path: "/",
2436
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(reactRouterDom.Navigate, { replace: true, to: "/mobile" })
2437
+ });
2438
+ router.add("mobile", {
2439
+ path: "/mobile",
2440
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(MApplication, {})
2441
+ });
2442
+ router.add("mobile.page", {
2443
+ path: "/mobile/:name",
2444
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(client.RouteSchemaComponent, {})
2445
+ });
2446
+ this.mobileRouter = router;
2447
+ }
2448
+ getMobileRouterComponent() {
2449
+ return this.mobileRouter.getRouterComponent();
2450
+ }
2451
+ addRoutes() {
2452
+ this.app.router.add("mobile", {
2453
+ path: "/mobile",
2454
+ element: /* @__PURE__ */ jsxRuntimeExports.jsx(MApplication, {})
2455
+ });
2456
+ this.app.router.add("mobile.page", {
2457
+ path: "/mobile/:name",
2458
+ Component: "RouteSchemaComponent"
2459
+ });
2460
+ }
2461
+ }
2462
+ exports2.MobileClientPlugin = MobileClientPlugin;
2463
+ exports2.default = MobileClientPlugin;
2464
+ Object.defineProperties(exports2, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
2465
+ });