@dxtmisha/scripts 0.11.8 → 1.1.0

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 (335) hide show
  1. package/CHANGELOG.md +77 -0
  2. package/ai-resources/componentMaterials.md +19 -0
  3. package/ai-resources/componentPrompt.md +381 -0
  4. package/ai-resources/componentWiki.md +13 -0
  5. package/bin/arguments.ts +168 -0
  6. package/bin/build-packages.ts +34 -3
  7. package/bin/build-publish-packages.ts +12 -2
  8. package/bin/design-component.ts +7 -1
  9. package/bin/design-constructor.ts +22 -3
  10. package/bin/design-figma.ts +26 -4
  11. package/bin/design-flags.ts +14 -2
  12. package/bin/design-library.ts +7 -1
  13. package/bin/design-package.ts +29 -5
  14. package/bin/design-prompt.ts +27 -3
  15. package/bin/design-screenshot.ts +12 -2
  16. package/bin/design-types-save.ts +32 -5
  17. package/bin/design-types.ts +32 -6
  18. package/bin/design-ui.ts +21 -3
  19. package/bin/design-wiki-storm.ts +11 -3
  20. package/dist/AiZAi-BiLAcdFy.js +232 -0
  21. package/dist/PropertiesConfig-BKZz_FWW.js +262 -0
  22. package/{src/config.ts → dist/config.d.ts} +185 -158
  23. package/dist/config.js +20 -0
  24. package/dist/figmaApiTypes-CArSsNW8.js +6 -0
  25. package/dist/library-ai.d.ts +482 -0
  26. package/dist/library-ai.js +2 -0
  27. package/dist/library-figma.d.ts +462 -0
  28. package/dist/library-figma.js +75 -0
  29. package/dist/library-ui.d.ts +586 -0
  30. package/dist/library-ui.js +3760 -0
  31. package/dist/library.d.ts +4910 -0
  32. package/dist/library.js +1568 -0
  33. package/dist/propertyTypes-C64u6rT3.js +236 -0
  34. package/package.json +76 -27
  35. package/bin/ai-doc.ts +0 -7
  36. package/bin/build-functional.ts +0 -5
  37. package/bin/design-component-wiki.ts +0 -11
  38. package/src/classes/Ai/AiAbstract.ts +0 -242
  39. package/src/classes/Ai/AiClaude.ts +0 -26
  40. package/src/classes/Ai/AiClaudeAgent.ts +0 -16
  41. package/src/classes/Ai/AiClaudeAgentLite.ts +0 -86
  42. package/src/classes/Ai/AiClaudeCli.ts +0 -24
  43. package/src/classes/Ai/AiClaudeCliLite.ts +0 -108
  44. package/src/classes/Ai/AiClaudeLite.ts +0 -112
  45. package/src/classes/Ai/AiDoc.ts +0 -81
  46. package/src/classes/Ai/AiDocItem.ts +0 -27
  47. package/src/classes/Ai/AiDocItemAbstract.ts +0 -209
  48. package/src/classes/Ai/AiDocItemClasses.ts +0 -27
  49. package/src/classes/Ai/AiDocItemComposables.ts +0 -20
  50. package/src/classes/Ai/AiDocType.ts +0 -45
  51. package/src/classes/Ai/AiGoogle.ts +0 -26
  52. package/src/classes/Ai/AiGoogleCli.ts +0 -24
  53. package/src/classes/Ai/AiGoogleCliLite.ts +0 -108
  54. package/src/classes/Ai/AiGoogleLite.ts +0 -78
  55. package/src/classes/Ai/AiOpenAi.ts +0 -26
  56. package/src/classes/Ai/AiOpenAiLite.ts +0 -107
  57. package/src/classes/Ai/AiZAi.ts +0 -17
  58. package/src/classes/Ai/AiZAiLite.ts +0 -77
  59. package/src/classes/Ai/ApiTmp.ts +0 -43
  60. package/src/classes/BrowserItem.ts +0 -408
  61. package/src/classes/Build/BuildFunctional.ts +0 -54
  62. package/src/classes/Build/BuildPackages.ts +0 -137
  63. package/src/classes/Build/BuildPublishPackages.ts +0 -105
  64. package/src/classes/BuildItem.ts +0 -187
  65. package/src/classes/Component/ComponentCreator.ts +0 -45
  66. package/src/classes/Component/ComponentItem.ts +0 -161
  67. package/src/classes/Component/ComponentWiki.ts +0 -258
  68. package/src/classes/Component/ComponentWikiFile.ts +0 -138
  69. package/src/classes/Design/DesignCommand.ts +0 -243
  70. package/src/classes/Design/DesignComponent.ts +0 -824
  71. package/src/classes/Design/DesignConstructor.ts +0 -222
  72. package/src/classes/Design/DesignConstructors.ts +0 -101
  73. package/src/classes/Design/DesignFigma.ts +0 -61
  74. package/src/classes/Design/DesignFlags.ts +0 -215
  75. package/src/classes/Design/DesignReplace.ts +0 -672
  76. package/src/classes/Design/DesignScreenshot.ts +0 -140
  77. package/src/classes/Design/DesignStructure.ts +0 -201
  78. package/src/classes/Design/DesignStructureClasses.ts +0 -105
  79. package/src/classes/Design/DesignStructureItemAbstract.ts +0 -52
  80. package/src/classes/Design/DesignStructureRead.ts +0 -349
  81. package/src/classes/Design/DesignStructureStyles.ts +0 -45
  82. package/src/classes/Design/DesignTypes.ts +0 -94
  83. package/src/classes/Design/DesignTypesAi.ts +0 -135
  84. package/src/classes/Design/DesignTypesDescription.ts +0 -121
  85. package/src/classes/Design/DesignTypesMake.ts +0 -460
  86. package/src/classes/Design/DesignTypesMcp.ts +0 -90
  87. package/src/classes/Design/DesignTypesPrompts.ts +0 -332
  88. package/src/classes/Design/DesignTypescript.ts +0 -244
  89. package/src/classes/Design/DesignUi.ts +0 -143
  90. package/src/classes/Design/DesignWiki.ts +0 -52
  91. package/src/classes/Design/DesignWikiStorm.ts +0 -95
  92. package/src/classes/Design/DesignWikiStormItem.ts +0 -316
  93. package/src/classes/FigmaApi.ts +0 -190
  94. package/src/classes/Git/GitRead.ts +0 -261
  95. package/src/classes/Library/LibraryAiMcpItem.ts +0 -67
  96. package/src/classes/Library/LibraryAiPrompt.ts +0 -268
  97. package/src/classes/Library/LibraryAiPromptItem.ts +0 -331
  98. package/src/classes/Library/LibraryAiWiki.ts +0 -127
  99. package/src/classes/Library/LibraryAiWikiItem.ts +0 -79
  100. package/src/classes/Library/LibraryExport.ts +0 -167
  101. package/src/classes/Library/LibraryFlags.ts +0 -62
  102. package/src/classes/Library/LibraryItems.ts +0 -138
  103. package/src/classes/Library/LibraryList.ts +0 -189
  104. package/src/classes/Library/LibraryMedia.ts +0 -139
  105. package/src/classes/Library/LibraryPlugin.ts +0 -73
  106. package/src/classes/Library/LibraryTypes.ts +0 -130
  107. package/src/classes/Package/PackageFile.ts +0 -154
  108. package/src/classes/Package/PackageInit.ts +0 -54
  109. package/src/classes/Package/PackageItem.ts +0 -329
  110. package/src/classes/Properties/Properties.ts +0 -175
  111. package/src/classes/Properties/PropertiesCache.ts +0 -248
  112. package/src/classes/Properties/PropertiesConfig.ts +0 -213
  113. package/src/classes/Properties/PropertiesConvector.ts +0 -52
  114. package/src/classes/Properties/PropertiesFile.ts +0 -522
  115. package/src/classes/Properties/PropertiesImport.ts +0 -182
  116. package/src/classes/Properties/PropertiesItems.ts +0 -605
  117. package/src/classes/Properties/PropertiesKeys.ts +0 -121
  118. package/src/classes/Properties/PropertiesMain.ts +0 -138
  119. package/src/classes/Properties/PropertiesPalette.ts +0 -149
  120. package/src/classes/Properties/PropertiesPath.ts +0 -193
  121. package/src/classes/Properties/PropertiesScss.ts +0 -261
  122. package/src/classes/Properties/PropertiesSeparator.ts +0 -118
  123. package/src/classes/Properties/PropertiesSettings.ts +0 -104
  124. package/src/classes/Properties/PropertiesStandard.ts +0 -180
  125. package/src/classes/Properties/PropertiesTool.ts +0 -80
  126. package/src/classes/Properties/PropertiesTypes.ts +0 -147
  127. package/src/classes/Properties/PropertiesValues.ts +0 -75
  128. package/src/classes/Properties/PropertiesWrap.ts +0 -187
  129. package/src/classes/Properties/convector/convectorColor.ts +0 -27
  130. package/src/classes/Properties/convector/convectorFontFamilies.ts +0 -18
  131. package/src/classes/Properties/convector/convectorShadow.ts +0 -61
  132. package/src/classes/Properties/convector/convectorTypography.ts +0 -19
  133. package/src/classes/Properties/to/PropertiesToAbstract.ts +0 -51
  134. package/src/classes/Properties/to/PropertiesToAnimate.ts +0 -59
  135. package/src/classes/Properties/to/PropertiesToClass.ts +0 -49
  136. package/src/classes/Properties/to/PropertiesToClone.ts +0 -114
  137. package/src/classes/Properties/to/PropertiesToComponent.ts +0 -52
  138. package/src/classes/Properties/to/PropertiesToDrag.ts +0 -231
  139. package/src/classes/Properties/to/PropertiesToDuplicate.ts +0 -165
  140. package/src/classes/Properties/to/PropertiesToFull.ts +0 -36
  141. package/src/classes/Properties/to/PropertiesToLink.ts +0 -259
  142. package/src/classes/Properties/to/PropertiesToMedia.ts +0 -187
  143. package/src/classes/Properties/to/PropertiesToMulti.ts +0 -101
  144. package/src/classes/Properties/to/PropertiesToNone.ts +0 -46
  145. package/src/classes/Properties/to/PropertiesToPalette.ts +0 -241
  146. package/src/classes/Properties/to/PropertiesToProperty.ts +0 -31
  147. package/src/classes/Properties/to/PropertiesToRemove.ts +0 -33
  148. package/src/classes/Properties/to/PropertiesToReplace.ts +0 -77
  149. package/src/classes/Properties/to/PropertiesToRoot.ts +0 -40
  150. package/src/classes/Properties/to/PropertiesToSimilar.ts +0 -128
  151. package/src/classes/Properties/to/PropertiesToSort.ts +0 -146
  152. package/src/classes/Properties/to/PropertiesToState.ts +0 -65
  153. package/src/classes/Properties/to/PropertiesToStyle.ts +0 -52
  154. package/src/classes/Properties/to/PropertiesToSub.ts +0 -95
  155. package/src/classes/Properties/to/PropertiesToSubclass.ts +0 -76
  156. package/src/classes/Properties/to/PropertiesToVar.ts +0 -194
  157. package/src/classes/Properties/to/PropertiesToVariable.ts +0 -176
  158. package/src/classes/Styles/Styles.ts +0 -247
  159. package/src/classes/Styles/StylesClasses.ts +0 -86
  160. package/src/classes/Styles/StylesProperties.ts +0 -197
  161. package/src/classes/Styles/StylesRoot.ts +0 -103
  162. package/src/classes/Styles/StylesTool.ts +0 -112
  163. package/src/classes/Styles/to/StylesToAbstract.ts +0 -93
  164. package/src/classes/Styles/to/StylesToAnimate.ts +0 -19
  165. package/src/classes/Styles/to/StylesToClass.ts +0 -25
  166. package/src/classes/Styles/to/StylesToClassFull.ts +0 -19
  167. package/src/classes/Styles/to/StylesToContainer.ts +0 -24
  168. package/src/classes/Styles/to/StylesToMedia.ts +0 -19
  169. package/src/classes/Styles/to/StylesToProperty.ts +0 -123
  170. package/src/classes/Styles/to/StylesToRoot.ts +0 -14
  171. package/src/classes/Styles/to/StylesToSelector.ts +0 -71
  172. package/src/classes/Styles/to/StylesToVar.ts +0 -105
  173. package/src/classes/Styles/to/StylesToVirtual.ts +0 -33
  174. package/src/composables/useAi.ts +0 -38
  175. package/src/demo/ai.ts +0 -10
  176. package/src/functions/getComponentPaths.ts +0 -13
  177. package/src/functions/getConfigAi.ts +0 -14
  178. package/src/functions/getConstructorProperties.ts +0 -54
  179. package/src/functions/getDirname.ts +0 -17
  180. package/src/functions/getNameDirByPaths.ts +0 -16
  181. package/src/functions/getPackageJson.ts +0 -19
  182. package/src/functions/hasNativeDirname.ts +0 -8
  183. package/src/functions/run.ts +0 -47
  184. package/src/functions/toPathStandardSep.ts +0 -14
  185. package/src/library-ai.ts +0 -10
  186. package/src/library.ts +0 -73
  187. package/src/media/ai/ai-doc-types.ts +0 -21
  188. package/src/media/properties/css.ts +0 -634
  189. package/src/media/properties/cssSelector.ts +0 -74
  190. package/src/media/properties/cssVirtual.ts +0 -12
  191. package/src/media/properties/listSort.ts +0 -113
  192. package/src/media/properties/style.ts +0 -81
  193. package/src/media/templates/component/DesignComponent.mdx +0 -30
  194. package/src/media/templates/component/DesignComponent.stories.ts +0 -34
  195. package/src/media/templates/component/DesignComponent.vue +0 -54
  196. package/src/media/templates/component/DesignComponentAiWiki.vue +0 -25
  197. package/src/media/templates/component/index.ts +0 -13
  198. package/src/media/templates/component/props.ts +0 -27
  199. package/src/media/templates/component/styleToken.scss +0 -17
  200. package/src/media/templates/component/wiki.ts +0 -13
  201. package/src/media/templates/component/wikiData.ts +0 -28
  202. package/src/media/templates/componentDoc/ComponentDoc.vue +0 -26
  203. package/src/media/templates/componentDoc/index.ts +0 -12
  204. package/src/media/templates/componentDoc/materials/README.md +0 -8
  205. package/src/media/templates/componentDoc/materials/prompt.md +0 -38
  206. package/src/media/templates/componentDoc/subcomponents/_.gitignore.txt +0 -0
  207. package/src/media/templates/componentDoc/types.ts +0 -15
  208. package/src/media/templates/componentDoc/wiki/ComponentDoc.mdx +0 -13
  209. package/src/media/templates/componentDoc/wiki/ComponentDoc.stories.ts +0 -24
  210. package/src/media/templates/componentDoc/wiki/prompt.md +0 -41
  211. package/src/media/templates/constructors/Constructors.ts +0 -33
  212. package/src/media/templates/constructors/ConstructorsDesign.tsx +0 -129
  213. package/src/media/templates/constructors/basicTypes.ts +0 -0
  214. package/src/media/templates/constructors/index.ts +0 -5
  215. package/src/media/templates/constructors/props.ts +0 -28
  216. package/src/media/templates/constructors/style.scss +0 -5
  217. package/src/media/templates/constructors/types.ts +0 -47
  218. package/src/media/templates/packages/figma/README.md +0 -1
  219. package/src/media/templates/packages/figma/_.gitignore.txt +0 -29
  220. package/src/media/templates/packages/figma/ai.sample.config.ts +0 -2
  221. package/src/media/templates/packages/figma/design.config.json +0 -3
  222. package/src/media/templates/packages/figma/index.html +0 -12
  223. package/src/media/templates/packages/figma/manifest.json +0 -25
  224. package/src/media/templates/packages/figma/package.json +0 -37
  225. package/src/media/templates/packages/figma/src/App.vue +0 -9
  226. package/src/media/templates/packages/figma/src/classes/_.gitignore.txt +0 -1
  227. package/src/media/templates/packages/figma/src/code.ts +0 -16
  228. package/src/media/templates/packages/figma/src/components/_.gitignore.txt +0 -1
  229. package/src/media/templates/packages/figma/src/composables/_.gitignore.txt +0 -1
  230. package/src/media/templates/packages/figma/src/config.ts +0 -0
  231. package/src/media/templates/packages/figma/src/functions/_.gitignore.txt +0 -1
  232. package/src/media/templates/packages/figma/src/library.ts +0 -0
  233. package/src/media/templates/packages/figma/src/main.ts +0 -4
  234. package/src/media/templates/packages/figma/src/media/_.gitignore.txt +0 -1
  235. package/src/media/templates/packages/figma/src/storybook/_.gitignore.txt +0 -1
  236. package/src/media/templates/packages/figma/src/types/_.gitignore.txt +0 -1
  237. package/src/media/templates/packages/figma/src/vite-env.d.ts +0 -1
  238. package/src/media/templates/packages/figma/tsconfig.app.json +0 -12
  239. package/src/media/templates/packages/figma/tsconfig.json +0 -7
  240. package/src/media/templates/packages/figma/tsconfig.node.json +0 -8
  241. package/src/media/templates/packages/figma/vite.config.ts +0 -7
  242. package/src/media/templates/packages/library/README.md +0 -1
  243. package/src/media/templates/packages/library/_.gitignore.txt +0 -27
  244. package/src/media/templates/packages/library/ai-description.md +0 -15
  245. package/src/media/templates/packages/library/design.config.json +0 -3
  246. package/src/media/templates/packages/library/index.html +0 -12
  247. package/src/media/templates/packages/library/materials/README.md +0 -8
  248. package/src/media/templates/packages/library/materials/prompt.md +0 -45
  249. package/src/media/templates/packages/library/package.json +0 -46
  250. package/src/media/templates/packages/library/src/App.vue +0 -8
  251. package/src/media/templates/packages/library/src/classes/_.gitignore.txt +0 -1
  252. package/src/media/templates/packages/library/src/components/_.gitignore.txt +0 -1
  253. package/src/media/templates/packages/library/src/composables/_.gitignore.txt +0 -1
  254. package/src/media/templates/packages/library/src/functions/_.gitignore.txt +0 -1
  255. package/src/media/templates/packages/library/src/library.ts +0 -0
  256. package/src/media/templates/packages/library/src/main.ts +0 -6
  257. package/src/media/templates/packages/library/src/style.scss +0 -0
  258. package/src/media/templates/packages/library/src/types/_.gitignore.txt +0 -1
  259. package/src/media/templates/packages/library/src/vite-env.d.ts +0 -1
  260. package/src/media/templates/packages/library/tsconfig.app.json +0 -11
  261. package/src/media/templates/packages/library/tsconfig.json +0 -7
  262. package/src/media/templates/packages/library/tsconfig.node.json +0 -7
  263. package/src/media/templates/packages/library/vite.config.ts +0 -14
  264. package/src/media/templates/packages/nitro/README.md +0 -1
  265. package/src/media/templates/packages/nitro/_.gitignore.txt +0 -28
  266. package/src/media/templates/packages/nitro/index.html +0 -2
  267. package/src/media/templates/packages/nitro/package.json +0 -25
  268. package/src/media/templates/packages/nitro/server/plugins/ui-plugin.ts +0 -7
  269. package/src/media/templates/packages/nitro/server/routes/api/hello.ts +0 -13
  270. package/src/media/templates/packages/nitro/src/App.vue +0 -10
  271. package/src/media/templates/packages/nitro/src/assets/_.gitignore.txt +0 -0
  272. package/src/media/templates/packages/nitro/src/components/_.gitignore.txt +0 -0
  273. package/src/media/templates/packages/nitro/src/composables/_.gitignore.txt +0 -0
  274. package/src/media/templates/packages/nitro/src/entry-client.ts +0 -13
  275. package/src/media/templates/packages/nitro/src/entry-server.ts +0 -29
  276. package/src/media/templates/packages/nitro/src/main.ts +0 -14
  277. package/src/media/templates/packages/nitro/src/pages/HomePage.vue +0 -8
  278. package/src/media/templates/packages/nitro/src/router.ts +0 -11
  279. package/src/media/templates/packages/nitro/src/style.scss +0 -0
  280. package/src/media/templates/packages/nitro/src/templates/main.html +0 -21
  281. package/src/media/templates/packages/nitro/src/vite-env.d.ts +0 -11
  282. package/src/media/templates/packages/nitro/tsconfig.app.json +0 -14
  283. package/src/media/templates/packages/nitro/tsconfig.json +0 -7
  284. package/src/media/templates/packages/nitro/tsconfig.node.json +0 -12
  285. package/src/media/templates/packages/nitro/vite.config.ts +0 -17
  286. package/src/media/templates/packages/project/README.md +0 -1
  287. package/src/media/templates/packages/project/_.gitignore.txt +0 -28
  288. package/src/media/templates/packages/project/design.config.json +0 -3
  289. package/src/media/templates/packages/project/index.html +0 -12
  290. package/src/media/templates/packages/project/materials/README.md +0 -8
  291. package/src/media/templates/packages/project/materials/prompt.md +0 -41
  292. package/src/media/templates/packages/project/package.json +0 -13
  293. package/src/media/templates/packages/project/public/_.gitignore.txt +0 -0
  294. package/src/media/templates/packages/project/src/App.vue +0 -12
  295. package/src/media/templates/packages/project/src/assets/_.gitignore.txt +0 -0
  296. package/src/media/templates/packages/project/src/components/_.gitignore.txt +0 -0
  297. package/src/media/templates/packages/project/src/composables/_.gitignore.txt +0 -0
  298. package/src/media/templates/packages/project/src/main.ts +0 -6
  299. package/src/media/templates/packages/project/src/style.scss +0 -0
  300. package/src/media/templates/packages/project/src/vite-env.d.ts +0 -1
  301. package/src/media/templates/packages/project/tsconfig.app.json +0 -11
  302. package/src/media/templates/packages/project/tsconfig.json +0 -7
  303. package/src/media/templates/packages/project/tsconfig.node.json +0 -7
  304. package/src/media/templates/packages/project/vite.config.ts +0 -7
  305. package/src/media/templates/prompts/aiCodeGlobalPrompt.en.md +0 -22
  306. package/src/media/templates/prompts/aiCodeGlobalPrompt.ru.md +0 -21
  307. package/src/media/templates/prompts/aiCodeVuePrompt.en.md +0 -17
  308. package/src/media/templates/prompts/aiCodeVuePrompt.ru.md +0 -17
  309. package/src/media/templates/prompts/aiDocClassPrompt.en.txt +0 -63
  310. package/src/media/templates/prompts/aiDocClassPrompt.ru.txt +0 -63
  311. package/src/media/templates/prompts/aiDocComposablePrompt.en.txt +0 -67
  312. package/src/media/templates/prompts/aiDocComposablePrompt.ru.txt +0 -67
  313. package/src/media/templates/prompts/aiDocFunctionPrompt.en.txt +0 -57
  314. package/src/media/templates/prompts/aiDocFunctionPrompt.ru.txt +0 -57
  315. package/src/media/templates/prompts/componentPrompt.en.txt +0 -182
  316. package/src/media/templates/prompts/componentPrompt.ru.txt +0 -182
  317. package/src/media/templates/prompts/demoClassEn.mdx +0 -111
  318. package/src/media/templates/prompts/demoClassRu.mdx +0 -111
  319. package/src/media/templates/prompts/demoComponentEn.mdx +0 -282
  320. package/src/media/templates/prompts/demoComponentRu.mdx +0 -282
  321. package/src/media/templates/prompts/demoComposableEn.mdx +0 -103
  322. package/src/media/templates/prompts/demoComposableRu.mdx +0 -103
  323. package/src/media/templates/prompts/demoDocEn.mdx +0 -30
  324. package/src/media/templates/prompts/demoDocRu.mdx +0 -30
  325. package/src/media/templates/viteComponentTemplateConfig.ts +0 -14
  326. package/src/types/aiTypes.ts +0 -19
  327. package/src/types/configTypes.ts +0 -69
  328. package/src/types/designTypes.ts +0 -167
  329. package/src/types/figmaApiTypes.ts +0 -337
  330. package/src/types/gitTypes.ts +0 -59
  331. package/src/types/libraryTypes.ts +0 -49
  332. package/src/types/propertyTypes.ts +0 -586
  333. package/src/types/screenshotTypes.ts +0 -55
  334. package/src/types/webTypes.ts +0 -134
  335. package/src/vite-env.d.ts +0 -1
@@ -1,282 +0,0 @@
1
- Component for creating popup menus, dropdown lists, and context menus with support for navigation and actions.
2
-
3
- Menu combines the functionality of Window (positioning and visibility management), Bars (action and tool panel), and List (displaying items, groups, and nested submenus). The component provides keyboard navigation, support for nested structures, asynchronous data loading, an optimized rendering mode for large lists, and full control over the open/close state.
4
-
5
- **Key Features:**
6
-
7
- - Integration of Window, Bars, and List components
8
- - Keyboard navigation through menu items
9
- - Nested submenus with unlimited depth
10
- - Asynchronous data loading via AJAX
11
- - Lite mode for optimizing large lists (liteThreshold)
12
- - Search and filtering of menu items
13
- - Management of selected items (selected)
14
- - Flexible positioning relative to the anchor
15
-
16
- **Typical Use Cases:**
17
-
18
- - Dropdown navigation menus
19
- - Right-click context menus
20
- - Action and operation menus
21
- - Selectors with search and filtering
22
- - Multi-level navigation menus
23
- - Menus with dynamic data loading
24
-
25
- ```html
26
- <script setup>
27
- import { ref } from 'vue'
28
-
29
- const isOpen = ref(false)
30
- const menuItems = ref([
31
- { label: 'Create', value: 'create', icon: 'add' },
32
- { label: 'Edit', value: 'edit', icon: 'edit' },
33
- { label: 'Delete', value: 'delete', icon: 'delete' },
34
- {
35
- label: 'Export',
36
- value: 'export',
37
- children: [
38
- { label: 'PDF', value: 'pdf' },
39
- { label: 'Excel', value: 'excel' },
40
- { label: 'CSV', value: 'csv' }
41
- ]
42
- }
43
- ])
44
-
45
- const handleClick = (value) => {
46
- console.log('Item selected:', value)
47
- isOpen.value = false
48
- }
49
- </script>
50
-
51
- <template>
52
- <button @click="isOpen = true">Open Menu</button>
53
-
54
- <Menu
55
- v-model:open="isOpen"
56
- :list="menuItems"
57
- @click="handleClick"
58
- >
59
- <template #control="{ onclick }">
60
- <button @click="onclick">Actions</button>
61
- </template>
62
- </Menu>
63
- </template>
64
- ```
65
-
66
- ## Navigation through Menu Items
67
-
68
- The `previous()` and `next()` methods are designed for programmatic navigation through menu items based on the current selection and the `step` property.
69
-
70
- **Methods:**
71
-
72
- - `previous()` — moves the selection to the previous item (back by `step` positions)
73
- - `next()` — moves the selection to the next item (forward by `step` positions)
74
- - `step` — number of items to skip during navigation (default: 1)
75
-
76
- The methods work in conjunction with the reactive `selected` state: when `previous()` or `next()` is called, the new position is automatically calculated relative to the currently selected item. If no item is selected, the methods select the first available item. When the list boundaries (first or last item) are reached, navigation stops at the boundary item, preventing exit from the list.
77
-
78
- ```html
79
- <script setup>
80
- import { ref } from 'vue'
81
-
82
- const menuRef = ref()
83
- const selected = ref('item2')
84
- </script>
85
-
86
- <template>
87
- <!-- Call via ref -->
88
- <button @click="menuRef?.previous()">Back</button>
89
- <button @click="menuRef?.next()">Forward</button>
90
-
91
- <Menu
92
- ref="menuRef"
93
- v-model:selected="selected"
94
- :list="[
95
- { label: 'Item 1', value: 'item1' },
96
- { label: 'Item 2', value: 'item2' },
97
- { label: 'Item 3', value: 'item3' }
98
- ]"
99
- :step="1"
100
- />
101
-
102
- <!-- Navigation in control slot -->
103
- <Menu v-model:selected="selected" :list="items">
104
- <template #control="{ previous, next, selectedNames }">
105
- <button @click="previous">◀</button>
106
- <span>{{ selectedNames[0] }}</span>
107
- <button @click="next">▶</button>
108
- </template>
109
- </Menu>
110
-
111
- <!-- With custom step -->
112
- <Menu
113
- ref="menuRef"
114
- v-model:selected="selected"
115
- :list="items"
116
- :step="2"
117
- />
118
- </template>
119
- ```
120
-
121
- ## AJAX Menu Loading
122
-
123
- The `ajax`, `request`, and `cache` properties are designed to manage asynchronous loading and caching of menu data.
124
-
125
- **Properties:**
126
-
127
- - `ajax` — enables remote data loading mode (URL string or function)
128
- - `request` — object of type `ApiFetch` with HTTP request settings
129
- - `cache` — enables caching of loaded menu items
130
-
131
- The properties work together: if `ajax` is not set or is `false`, the menu uses local data. When `ajax` is activated (URL string or `true`), `request` defines the HTTP request parameters (method, headers, body), and `cache` manages data storage. With `cache` enabled, reopening the menu uses stored data instead of new requests, reducing server load.
132
-
133
- ```html
134
- <script setup>
135
- import { ref } from 'vue'
136
-
137
- const isOpen = ref(false)
138
- </script>
139
-
140
- <template>
141
- <!-- Load from URL -->
142
- <Menu
143
- v-model:open="isOpen"
144
- ajax="/api/menu-items"
145
- :cache="true"
146
- />
147
-
148
- <!-- With request settings -->
149
- <Menu
150
- v-model:open="isOpen"
151
- ajax="/api/menu"
152
- :request="{
153
- method: 'POST',
154
- headers: { 'X-Custom': 'value' },
155
- auth: true
156
- }"
157
- :cache="true"
158
- />
159
-
160
- <!-- Loading function -->
161
- <Menu
162
- v-model:open="isOpen"
163
- :ajax="async () => {
164
- const response = await fetch('/api/menu')
165
- return response.json()
166
- }"
167
- />
168
- </template>
169
- ```
170
-
171
- ## Events
172
-
173
- ### `click`
174
-
175
- The event is triggered when the component is clicked, passing the original DOM event and component data.
176
-
177
- **Parameters:**
178
- - `event: MouseEvent` — original DOM mouse event
179
- - `value: EventClickValue` — object with component data
180
-
181
- **EventClickValue Structure:**
182
- - `type: string` — identifier of the click location, set via the `data-event-type` attribute on the element
183
- - `value: any` — component value
184
- - `detail: Record<string, any> | undefined` — additional event data
185
-
186
- ```html
187
- <script setup>
188
- const handleClick = (event, value) => {
189
- console.log('DOM event:', event)
190
- console.log('Click type:', value.type)
191
- console.log('Value:', value.value)
192
- console.log('Details:', value.detail)
193
- }
194
- </script>
195
-
196
- <template>
197
- <Component @click="handleClick">
198
- <button data-event-type="action">Click me</button>
199
- </Component>
200
- </template>
201
- ```
202
-
203
- ### `clickLite`
204
-
205
- The event is triggered when the component is clicked, passing only data without the original DOM event (lightweight version).
206
-
207
- **Parameters:**
208
- - `value: EventClickValue` — object with component data
209
-
210
- ## Expose
211
-
212
- ### `previous()`
213
-
214
- Moves the selection to the previous menu item based on the `step` property value.
215
-
216
- **Returns:** `void`
217
-
218
- ### `next()`
219
-
220
- Moves the selection to the next menu item based on the `step` property value.
221
-
222
- **Returns:** `void`
223
-
224
- ## Slots
225
-
226
- ### `control`
227
-
228
- Slot for placing the menu control element (trigger).
229
-
230
- **Parameters:**
231
- - `props: MenuControlItem` — object with menu control data
232
- - `onclick` — function to toggle menu open/close
233
- - `isSelected` — computed boolean indicating if any item is selected
234
- - `selectedNames` — computed array of labels of selected items
235
- - `selectedValues` — computed array of values of selected items
236
- - `selectedList` — computed array of selected list items
237
- - `loading` — ref indicating AJAX loading state
238
- - `previous()` — method to navigate to previous item(s)
239
- - `next()` — method to navigate to next item(s)
240
-
241
- ```html
242
- <script setup>
243
- import { ref } from 'vue'
244
-
245
- const isOpen = ref(false)
246
- const menuItems = ref([
247
- { label: 'Item 1', value: '1' },
248
- { label: 'Item 2', value: '2' },
249
- { label: 'Item 3', value: '3' }
250
- ])
251
- </script>
252
-
253
- <template>
254
- <Menu v-model:open="isOpen" :list="menuItems">
255
- <template #control="{ onclick, isSelected, selectedNames }">
256
- <button @click="onclick">
257
- {{ isSelected ? selectedNames.join(', ') : 'Select Items' }}
258
- </button>
259
- </template>
260
- </Menu>
261
- </template>
262
- ```
263
-
264
- ### `title`
265
-
266
- Slot for placing the menu window title.
267
-
268
- **Parameters:**
269
- - `props: MenuControlItem` — object with menu control data
270
-
271
- ### `footer`
272
-
273
- Slot for placing content at the bottom of the menu window (action buttons, information).
274
-
275
- **Parameters:**
276
- - `props: MenuControlItem` — object with menu control data
277
-
278
- ### `default`
279
-
280
- Main slot for placing the main content of the component.
281
-
282
- **Returns:** `VNode` — main content of the component
@@ -1,282 +0,0 @@
1
- Компонент для создания всплывающих меню, выпадающих списков и контекстных меню с поддержкой навигации и действий.
2
-
3
- Menu объединяет функциональность Window (позиционирование и управление видимостью), Bars (панель действий и инструментов) и List (отображение пунктов, групп и вложенных подменю). Компонент обеспечивает клавиатурную навигацию, поддержку вложенной структуры, асинхронную загрузку данных, режим оптимизированного рендеринга для больших списков и полный контроль над состоянием открытия/закрытия.
4
-
5
- **Основные возможности:**
6
-
7
- - Интеграция Window, Bars и List компонентов
8
- - Клавиатурная навигация по пунктам меню
9
- - Вложенные подменю с неограниченной глубиной
10
- - Асинхронная загрузка данных через AJAX
11
- - Режим lite для оптимизации больших списков (liteThreshold)
12
- - Поиск и фильтрация пунктов меню
13
- - Управление выбранными элементами (selected)
14
- - Гибкое позиционирование относительно якоря
15
-
16
- **Типичные сценарии использования:**
17
-
18
- - Выпадающие меню навигации
19
- - Контекстные меню по правому клику
20
- - Меню действий и операций
21
- - Селекторы с поиском и фильтрацией
22
- - Многоуровневые навигационные меню
23
- - Меню с динамической загрузкой данных
24
-
25
- ```html
26
- <script setup>
27
- import { ref } from 'vue'
28
-
29
- const isOpen = ref(false)
30
- const menuItems = ref([
31
- { label: 'Создать', value: 'create', icon: 'add' },
32
- { label: 'Редактировать', value: 'edit', icon: 'edit' },
33
- { label: 'Удалить', value: 'delete', icon: 'delete' },
34
- {
35
- label: 'Экспорт',
36
- value: 'export',
37
- children: [
38
- { label: 'PDF', value: 'pdf' },
39
- { label: 'Excel', value: 'excel' },
40
- { label: 'CSV', value: 'csv' }
41
- ]
42
- }
43
- ])
44
-
45
- const handleClick = (value) => {
46
- console.log('Выбран пункт:', value)
47
- isOpen.value = false
48
- }
49
- </script>
50
-
51
- <template>
52
- <button @click="isOpen = true">Открыть меню</button>
53
-
54
- <Menu
55
- v-model:open="isOpen"
56
- :list="menuItems"
57
- @click="handleClick"
58
- >
59
- <template #control="{ onclick }">
60
- <button @click="onclick">Действия</button>
61
- </template>
62
- </Menu>
63
- </template>
64
- ```
65
-
66
- ## Навигация по элементам меню
67
-
68
- Методы `previous()` и `next()` предназначены для программного перемещения по элементам меню на основе текущего выбора и свойства `step`.
69
-
70
- **Методы:**
71
-
72
- - `previous()` — перемещает выбор на предыдущий элемент (назад на `step` позиций)
73
- - `next()` — перемещает выбор на следующий элемент (вперед на `step` позиций)
74
- - `step` — количество элементов для пропуска при навигации (по умолчанию: 1)
75
-
76
- Методы работают совместно с реактивным состоянием `selected`: при вызове `previous()` или `next()` происходит автоматический расчёт новой позиции относительно текущего выделенного элемента. Если элемент не выбран, методы выбирают первый доступный элемент. При достижении границ списка (первый или последний элемент) навигация останавливается на граничном элементе, предотвращая выход за пределы списка.
77
-
78
- ```html
79
- <script setup>
80
- import { ref } from 'vue'
81
-
82
- const menuRef = ref()
83
- const selected = ref('item2')
84
- </script>
85
-
86
- <template>
87
- <!-- Вызов через ref -->
88
- <button @click="menuRef?.previous()">Назад</button>
89
- <button @click="menuRef?.next()">Вперед</button>
90
-
91
- <Menu
92
- ref="menuRef"
93
- v-model:selected="selected"
94
- :list="[
95
- { label: 'Элемент 1', value: 'item1' },
96
- { label: 'Элемент 2', value: 'item2' },
97
- { label: 'Элемент 3', value: 'item3' }
98
- ]"
99
- :step="1"
100
- />
101
-
102
- <!-- Навигация в слоте control -->
103
- <Menu v-model:selected="selected" :list="items">
104
- <template #control="{ previous, next, selectedNames }">
105
- <button @click="previous">◀</button>
106
- <span>{{ selectedNames[0] }}</span>
107
- <button @click="next">▶</button>
108
- </template>
109
- </Menu>
110
-
111
- <!-- С пользовательским шагом -->
112
- <Menu
113
- ref="menuRef"
114
- v-model:selected="selected"
115
- :list="items"
116
- :step="2"
117
- />
118
- </template>
119
- ```
120
-
121
- ## AJAX загрузка меню
122
-
123
- Свойства `ajax`, `request` и `cache` предназначены для управления асинхронной загрузкой и кэшированием данных меню.
124
-
125
- **Свойства:**
126
-
127
- - `ajax` — включает режим удалённой загрузки данных (строка URL или функция)
128
- - `request` — объект типа `ApiFetch` с настройками HTTP-запроса
129
- - `cache` — включает кэширование загруженных элементов меню
130
-
131
- Свойства работают совместно: если `ajax` не задан или равен `false`, меню использует локальные данные. При активации `ajax` (строка URL или `true`), `request` определяет параметры HTTP-запроса (метод, заголовки, тело), а `cache` управляет сохранением данных. При включённом `cache` повторные открытия меню используют сохранённые данные вместо новых запросов, снижая нагрузку на сервер.
132
-
133
- ```html
134
- <script setup>
135
- import { ref } from 'vue'
136
-
137
- const isOpen = ref(false)
138
- </script>
139
-
140
- <template>
141
- <!-- Загрузка с URL -->
142
- <Menu
143
- v-model:open="isOpen"
144
- ajax="/api/menu-items"
145
- :cache="true"
146
- />
147
-
148
- <!-- С настройками запроса -->
149
- <Menu
150
- v-model:open="isOpen"
151
- ajax="/api/menu"
152
- :request="{
153
- method: 'POST',
154
- headers: { 'X-Custom': 'value' },
155
- auth: true
156
- }"
157
- :cache="true"
158
- />
159
-
160
- <!-- Функция загрузки -->
161
- <Menu
162
- v-model:open="isOpen"
163
- :ajax="async () => {
164
- const response = await fetch('/api/menu')
165
- return response.json()
166
- }"
167
- />
168
- </template>
169
- ```
170
-
171
- ## Events
172
-
173
- ### `click`
174
-
175
- Событие срабатывает при клике на компонент, передавая оригинальное DOM событие и данные компонента.
176
-
177
- **Параметры:**
178
- - `event: MouseEvent` — оригинальное DOM событие мыши
179
- - `value: EventClickValue` — объект с данными компонента
180
-
181
- **Структура EventClickValue:**
182
- - `type: string` — идентификатор места нажатия, задается через атрибут `data-event-type` у элемента
183
- - `value: any` — значение компонента
184
- - `detail: Record<string, any> | undefined` — дополнительные данные события
185
-
186
- ```html
187
- <script setup>
188
- const handleClick = (event, value) => {
189
- console.log('DOM событие:', event)
190
- console.log('Тип клика:', value.type)
191
- console.log('Значение:', value.value)
192
- console.log('Детали:', value.detail)
193
- }
194
- </script>
195
-
196
- <template>
197
- <Component @click="handleClick">
198
- <button data-event-type="action">Нажми меня</button>
199
- </Component>
200
- </template>
201
- ```
202
-
203
- ### `clickLite`
204
-
205
- Событие срабатывает при клике на компонент, передавая только данные без оригинального DOM события (облегченная версия).
206
-
207
- **Параметры:**
208
- - `value: EventClickValue` — объект с данными компонента
209
-
210
- ## Expose
211
-
212
- ### `previous()`
213
-
214
- Перемещает выбор на предыдущий элемент меню на основе значения свойства `step`.
215
-
216
- **Возвращает:** `void`
217
-
218
- ### `next()`
219
-
220
- Перемещает выбор на следующий элемент меню на основе значения свойства `step`.
221
-
222
- **Возвращает:** `void`
223
-
224
- ## Slots
225
-
226
- ### `control`
227
-
228
- Слот для размещения элемента управления (триггера) меню.
229
-
230
- **Параметры:**
231
- - `props: MenuControlItem` — объект с данными управления меню
232
- - `onclick` — функция для переключения открытия/закрытия меню
233
- - `isSelected` — computed boolean, указывающий, выбран ли какой-либо элемент
234
- - `selectedNames` — computed массив меток выбранных элементов
235
- - `selectedValues` — computed массив значений выбранных элементов
236
- - `selectedList` — computed массив выбранных элементов списка
237
- - `loading` — ref, указывающий на состояние загрузки AJAX
238
- - `previous()` — метод для перехода к предыдущему элементу(ам)
239
- - `next()` — метод для перехода к следующему элементу(ам)
240
-
241
- ```html
242
- <script setup>
243
- import { ref } from 'vue'
244
-
245
- const isOpen = ref(false)
246
- const menuItems = ref([
247
- { label: 'Элемент 1', value: '1' },
248
- { label: 'Элемент 2', value: '2' },
249
- { label: 'Элемент 3', value: '3' }
250
- ])
251
- </script>
252
-
253
- <template>
254
- <Menu v-model:open="isOpen" :list="menuItems">
255
- <template #control="{ onclick, isSelected, selectedNames }">
256
- <button @click="onclick">
257
- {{ isSelected ? selectedNames.join(', ') : 'Выбрать элементы' }}
258
- </button>
259
- </template>
260
- </Menu>
261
- </template>
262
- ```
263
-
264
- ### `title`
265
-
266
- Слот для размещения заголовка окна меню.
267
-
268
- **Параметры:**
269
- - `props: MenuControlItem` — объект с данными управления меню
270
-
271
- ### `footer`
272
-
273
- Слот для размещения содержимого в нижней части окна меню (кнопки действий, информация).
274
-
275
- **Параметры:**
276
- - `props: MenuControlItem` — объект с данными управления меню
277
-
278
- ### `default`
279
-
280
- Основной слот для размещения главного содержимого компонента.
281
-
282
- **Возвращает:** `VNode` — основное содержимое компонента
@@ -1,103 +0,0 @@
1
- import {Meta} from '@storybook/addon-docs/blocks'
2
-
3
- <Meta title="[title]" />
4
-
5
- # Composable useToggle
6
-
7
- Composable for managing boolean state with extended toggle methods. Provides a convenient interface for working with visibility flags, modals, and other toggleable states.
8
-
9
- ## Key Features
10
-
11
- - **Simple toggling** — intuitive API for state changes
12
- - **Explicit methods** — separate functions for setting true/false
13
- - **Argument support** — ability to set specific value via toggle
14
- - **Full reactivity** — based on Vue Reactivity API
15
- - **Type safety** — strict typing of parameters and return values
16
-
17
- ## Function
18
-
19
- ### `useToggle`
20
-
21
- Creates a boolean state management object.
22
-
23
- **Parameters:**
24
- - `initialValue: boolean` — initial state value (default `false`)
25
-
26
- **Returns:** `UseToggleReturn` — object with state and management methods
27
-
28
- **UseToggleReturn:**
29
- - `value: Ref<boolean>` — reactive value
30
- - `toggle: (nextValue?: boolean) => void` — toggles value or sets the passed one
31
- - `setTrue: () => void` — sets value to true
32
- - `setFalse: () => void` — sets value to false
33
-
34
- ```javascript
35
- import { useToggle } from '@dxtmisha/demo'
36
-
37
- // Initialization
38
- const { value, toggle } = useToggle(false)
39
-
40
- // Usage
41
- toggle() // value becomes true
42
- ```
43
-
44
- ## Basic Usage
45
-
46
- ### Basic Management
47
-
48
- ```javascript
49
- import { useToggle } from '@dxtmisha/demo'
50
-
51
- const { value: isMenuOpen, toggle, setFalse: closeMenu } = useToggle()
52
-
53
- // Open menu
54
- toggle()
55
-
56
- // Close menu (explicit action)
57
- closeMenu()
58
- ```
59
-
60
- ### Usage with v-if
61
-
62
- ```javascript
63
- import { useToggle } from '@dxtmisha/demo'
64
-
65
- export default {
66
- setup() {
67
- const { value: showDetails, toggle } = useToggle(false)
68
-
69
- return { showDetails, toggle }
70
- }
71
- }
72
-
73
- // Template:
74
- // <button @click="toggle()">
75
- // {{ showDetails ? 'Hide' : 'Show' }} details
76
- // </button>
77
- // <div v-if="showDetails">
78
- // Detailed information...
79
- // </div>
80
- ```
81
-
82
- ## Working with Data Types
83
-
84
- ### Renaming
85
-
86
- ```javascript
87
- // Destructuring allows giving meaningful names
88
- const {
89
- value: isLoading,
90
- setTrue: startLoading,
91
- setFalse: stopLoading
92
- } = useToggle(false)
93
-
94
- const loadData = async () => {
95
- startLoading()
96
- try {
97
- await api.getData()
98
- } finally {
99
- stopLoading()
100
- }
101
- }
102
- ```
103
-