@flux-ui/components 3.0.0-next.65 → 3.0.0-next.67

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 (217) hide show
  1. package/dist/component/FluxAction.vue.d.ts +2 -1
  2. package/dist/component/FluxActionBar.vue.d.ts +23 -47
  3. package/dist/component/FluxActionPane.vue.d.ts +8 -17
  4. package/dist/component/FluxActionStack.vue.d.ts +7 -152
  5. package/dist/component/FluxAdaptiveGroup.vue.d.ts +6 -17
  6. package/dist/component/FluxAdaptiveSlot.vue.d.ts +8 -24
  7. package/dist/component/FluxAlert.vue.d.ts +2 -1
  8. package/dist/component/FluxAnimatedColors.vue.d.ts +2 -3
  9. package/dist/component/FluxAspectRatio.vue.d.ts +6 -13
  10. package/dist/component/FluxAvatar.vue.d.ts +2 -1
  11. package/dist/component/FluxBadge.vue.d.ts +2 -1
  12. package/dist/component/FluxBadgeStack.vue.d.ts +6 -13
  13. package/dist/component/FluxBorderShine.vue.d.ts +3 -2
  14. package/dist/component/FluxBoxedIcon.vue.d.ts +2 -1
  15. package/dist/component/FluxButton.vue.d.ts +5 -4
  16. package/dist/component/FluxButtonGroup.vue.d.ts +6 -13
  17. package/dist/component/FluxButtonStack.vue.d.ts +6 -13
  18. package/dist/component/FluxCalendar.vue.d.ts +7 -14
  19. package/dist/component/FluxCalendarItem.vue.d.ts +7 -14
  20. package/dist/component/FluxCheckbox.vue.d.ts +6 -6
  21. package/dist/component/FluxChip.vue.d.ts +2 -1
  22. package/dist/component/FluxClickablePane.vue.d.ts +7 -15
  23. package/dist/component/FluxColorPicker.vue.d.ts +6 -4
  24. package/dist/component/FluxColorSelect.vue.d.ts +6 -4
  25. package/dist/component/FluxCommandPalette.vue.d.ts +5 -38
  26. package/dist/component/FluxCommandPaletteGroup.vue.d.ts +2 -1
  27. package/dist/component/FluxCommandPaletteItem.vue.d.ts +3 -2
  28. package/dist/component/FluxComment.vue.d.ts +6 -13
  29. package/dist/component/FluxConfirm.vue.d.ts +2 -1
  30. package/dist/component/FluxContainer.vue.d.ts +6 -13
  31. package/dist/component/FluxDataTable.vue.d.ts +22 -46
  32. package/dist/component/FluxDatePicker.vue.d.ts +6 -4
  33. package/dist/component/FluxDestructiveButton.vue.d.ts +5 -10
  34. package/dist/component/FluxDisabled.vue.d.ts +7 -11
  35. package/dist/component/FluxDivider.vue.d.ts +6 -13
  36. package/dist/component/FluxDotPattern.vue.d.ts +2 -3
  37. package/dist/component/FluxDropZone.vue.d.ts +21 -46
  38. package/dist/component/FluxDynamicView.vue.d.ts +2 -1
  39. package/dist/component/FluxExpandable.vue.d.ts +24 -26
  40. package/dist/component/FluxExpandableGroup.vue.d.ts +6 -13
  41. package/dist/component/FluxFader.vue.d.ts +11 -26
  42. package/dist/component/FluxFaderItem.vue.d.ts +6 -13
  43. package/dist/component/FluxFilter.vue.d.ts +9 -16
  44. package/dist/component/FluxFilterBar.vue.d.ts +9 -15
  45. package/dist/component/FluxFilterBase.vue.d.ts +16 -30
  46. package/dist/component/FluxFilterDate.vue.d.ts +2 -1
  47. package/dist/component/FluxFilterDateRange.vue.d.ts +2 -1
  48. package/dist/component/FluxFilterOption.vue.d.ts +6 -4
  49. package/dist/component/FluxFilterOptionAsync.vue.d.ts +6 -4
  50. package/dist/component/FluxFilterOptions.vue.d.ts +6 -4
  51. package/dist/component/FluxFilterOptionsAsync.vue.d.ts +6 -4
  52. package/dist/component/FluxFilterRange.vue.d.ts +2 -1
  53. package/dist/component/FluxFilterWindow.vue.d.ts +7 -143
  54. package/dist/component/FluxFlex.vue.d.ts +6 -13
  55. package/dist/component/FluxFlexItem.vue.d.ts +6 -13
  56. package/dist/component/FluxFlickeringGrid.vue.d.ts +2 -3
  57. package/dist/component/FluxFlyout.vue.d.ts +21 -161
  58. package/dist/component/FluxFocalPointEditor.vue.d.ts +13 -19
  59. package/dist/component/FluxFocalPointImage.vue.d.ts +2 -1
  60. package/dist/component/FluxForm.vue.d.ts +7 -14
  61. package/dist/component/FluxFormColumn.vue.d.ts +6 -13
  62. package/dist/component/FluxFormDateInput.vue.d.ts +8 -158
  63. package/dist/component/FluxFormDateRangeInput.vue.d.ts +8 -158
  64. package/dist/component/FluxFormDateTimeInput.vue.d.ts +8 -158
  65. package/dist/component/FluxFormField.vue.d.ts +24 -49
  66. package/dist/component/FluxFormFieldAddition.vue.d.ts +7 -11
  67. package/dist/component/FluxFormGrid.vue.d.ts +6 -13
  68. package/dist/component/FluxFormInput.vue.d.ts +6 -6
  69. package/dist/component/FluxFormInputAddition.vue.d.ts +6 -13
  70. package/dist/component/FluxFormInputGroup.vue.d.ts +6 -13
  71. package/dist/component/FluxFormPinInput.vue.d.ts +6 -6
  72. package/dist/component/FluxFormRangeSlider.vue.d.ts +7 -78
  73. package/dist/component/FluxFormRow.vue.d.ts +6 -13
  74. package/dist/component/FluxFormSection.vue.d.ts +6 -13
  75. package/dist/component/FluxFormSelect.vue.d.ts +5 -3
  76. package/dist/component/FluxFormSelectAsync.vue.d.ts +5 -3
  77. package/dist/component/FluxFormSlider.vue.d.ts +7 -42
  78. package/dist/component/FluxFormTextArea.vue.d.ts +6 -6
  79. package/dist/component/FluxFormTimeZonePicker.vue.d.ts +5 -3
  80. package/dist/component/FluxFormTreeViewSelect.vue.d.ts +8 -176
  81. package/dist/component/FluxGallery.vue.d.ts +7 -14
  82. package/dist/component/FluxGalleryItem.vue.d.ts +3 -2
  83. package/dist/component/FluxGrid.vue.d.ts +6 -13
  84. package/dist/component/FluxGridColumn.vue.d.ts +6 -13
  85. package/dist/component/FluxGridPattern.vue.d.ts +2 -3
  86. package/dist/component/FluxIcon.vue.d.ts +2 -1
  87. package/dist/component/FluxInfo.vue.d.ts +6 -13
  88. package/dist/component/FluxInfoStack.vue.d.ts +6 -13
  89. package/dist/component/FluxItem.vue.d.ts +7 -11
  90. package/dist/component/FluxItemActions.vue.d.ts +7 -11
  91. package/dist/component/FluxItemContent.vue.d.ts +7 -11
  92. package/dist/component/FluxItemMedia.vue.d.ts +7 -11
  93. package/dist/component/FluxItemStack.vue.d.ts +7 -11
  94. package/dist/component/FluxKanban.vue.d.ts +7 -18
  95. package/dist/component/FluxKanbanColumn.vue.d.ts +10 -27
  96. package/dist/component/FluxKanbanItem.vue.d.ts +6 -17
  97. package/dist/component/FluxLayerPane.vue.d.ts +6 -13
  98. package/dist/component/FluxLayerPaneSecondary.vue.d.ts +6 -13
  99. package/dist/component/FluxLegend.vue.d.ts +2 -1
  100. package/dist/component/FluxLink.vue.d.ts +5 -10
  101. package/dist/component/FluxMenu.vue.d.ts +6 -17
  102. package/dist/component/FluxMenuCollapsible.vue.d.ts +9 -17
  103. package/dist/component/FluxMenuGroup.vue.d.ts +6 -13
  104. package/dist/component/FluxMenuItem.vue.d.ts +8 -16
  105. package/dist/component/FluxMenuOptions.vue.d.ts +10 -16
  106. package/dist/component/FluxMenuSubHeader.vue.d.ts +2 -1
  107. package/dist/component/FluxMenuTitle.vue.d.ts +2 -1
  108. package/dist/component/FluxNotice.vue.d.ts +8 -16
  109. package/dist/component/FluxNoticeStack.vue.d.ts +6 -13
  110. package/dist/component/FluxOverflowBar.vue.d.ts +10 -29
  111. package/dist/component/FluxOverlay.vue.d.ts +3 -2
  112. package/dist/component/FluxOverlayProvider.vue.d.ts +2 -1
  113. package/dist/component/FluxPagination.vue.d.ts +3 -2
  114. package/dist/component/FluxPaginationBar.vue.d.ts +3 -2
  115. package/dist/component/FluxPaginationButton.vue.d.ts +5 -10
  116. package/dist/component/FluxPane.vue.d.ts +7 -15
  117. package/dist/component/FluxPaneBody.vue.d.ts +6 -13
  118. package/dist/component/FluxPaneFooter.vue.d.ts +6 -13
  119. package/dist/component/FluxPaneGroup.vue.d.ts +6 -13
  120. package/dist/component/FluxPaneHeader.vue.d.ts +7 -15
  121. package/dist/component/FluxPaneIllustration.vue.d.ts +7 -15
  122. package/dist/component/FluxPaneMedia.vue.d.ts +2 -1
  123. package/dist/component/FluxPercentageBar.vue.d.ts +2 -1
  124. package/dist/component/FluxPersona.vue.d.ts +3 -2
  125. package/dist/component/FluxPlaceholder.vue.d.ts +8 -12
  126. package/dist/component/FluxPressable.vue.d.ts +6 -13
  127. package/dist/component/FluxPrimaryButton.vue.d.ts +5 -10
  128. package/dist/component/FluxPrimaryLinkButton.vue.d.ts +5 -10
  129. package/dist/component/FluxProgressBar.vue.d.ts +2 -1
  130. package/dist/component/FluxPrompt.vue.d.ts +4 -59
  131. package/dist/component/FluxPublishButton.vue.d.ts +2 -1
  132. package/dist/component/FluxQuantitySelector.vue.d.ts +6 -6
  133. package/dist/component/FluxRemove.vue.d.ts +3 -2
  134. package/dist/component/FluxRoot.vue.d.ts +6 -13
  135. package/dist/component/FluxScroller.vue.d.ts +6 -17
  136. package/dist/component/FluxSecondaryButton.vue.d.ts +5 -10
  137. package/dist/component/FluxSecondaryLinkButton.vue.d.ts +5 -10
  138. package/dist/component/FluxSegmentedControl.vue.d.ts +6 -7
  139. package/dist/component/FluxSegmentedView.vue.d.ts +3 -2
  140. package/dist/component/FluxSeparator.vue.d.ts +2 -1
  141. package/dist/component/FluxSlideOver.vue.d.ts +3 -2
  142. package/dist/component/FluxSnackbar.vue.d.ts +2 -1
  143. package/dist/component/FluxSnackbarProvider.vue.d.ts +2 -1
  144. package/dist/component/FluxSpacer.vue.d.ts +2 -1
  145. package/dist/component/FluxSpacing.vue.d.ts +2 -1
  146. package/dist/component/FluxSpinner.vue.d.ts +2 -1
  147. package/dist/component/FluxSplitButton.vue.d.ts +17 -35
  148. package/dist/component/FluxSplitView.vue.d.ts +6 -17
  149. package/dist/component/FluxSplitViewPane.vue.d.ts +6 -13
  150. package/dist/component/FluxStatistic.vue.d.ts +2 -1
  151. package/dist/component/FluxStepper.vue.d.ts +22 -42
  152. package/dist/component/FluxStepperStep.vue.d.ts +6 -13
  153. package/dist/component/FluxStepperSteps.vue.d.ts +3 -2
  154. package/dist/component/FluxSticky.vue.d.ts +8 -21
  155. package/dist/component/FluxTab.vue.d.ts +6 -13
  156. package/dist/component/FluxTabBar.vue.d.ts +6 -17
  157. package/dist/component/FluxTabBarItem.vue.d.ts +4 -81
  158. package/dist/component/FluxTable.vue.d.ts +11 -23
  159. package/dist/component/FluxTableActions.vue.d.ts +6 -13
  160. package/dist/component/FluxTableBar.vue.d.ts +6 -13
  161. package/dist/component/FluxTableCell.vue.d.ts +7 -15
  162. package/dist/component/FluxTableHeader.vue.d.ts +7 -14
  163. package/dist/component/FluxTableRow.vue.d.ts +9 -13
  164. package/dist/component/FluxTabs.vue.d.ts +28 -52
  165. package/dist/component/FluxTag.vue.d.ts +2 -1
  166. package/dist/component/FluxTagStack.vue.d.ts +6 -13
  167. package/dist/component/FluxTicks.vue.d.ts +2 -1
  168. package/dist/component/FluxTimeline.vue.d.ts +6 -13
  169. package/dist/component/FluxTimelineItem.vue.d.ts +6 -13
  170. package/dist/component/FluxToggle.vue.d.ts +6 -4
  171. package/dist/component/FluxToolbar.vue.d.ts +6 -13
  172. package/dist/component/FluxToolbarGroup.vue.d.ts +6 -13
  173. package/dist/component/FluxTooltip.vue.d.ts +3 -2
  174. package/dist/component/FluxTooltipProvider.vue.d.ts +2 -1
  175. package/dist/component/FluxTreeView.vue.d.ts +3 -4
  176. package/dist/component/FluxWindow.vue.d.ts +14 -28
  177. package/dist/component/calendar/FluxCalendarItemDisplay.vue.d.ts +2 -3
  178. package/dist/component/calendar/FluxCalendarMonthView.vue.d.ts +2 -1
  179. package/dist/component/calendar/FluxCalendarTimeGridView.vue.d.ts +3 -2
  180. package/dist/component/primitive/Anchor.vue.d.ts +6 -13
  181. package/dist/component/primitive/AnchorPopup.vue.d.ts +6 -17
  182. package/dist/component/primitive/CoordinatePicker.vue.d.ts +6 -6
  183. package/dist/component/primitive/CoordinatePickerThumb.vue.d.ts +3 -2
  184. package/dist/component/primitive/DialogLayout.vue.d.ts +7 -15
  185. package/dist/component/primitive/FilterBadge.vue.d.ts +2 -1
  186. package/dist/component/primitive/FilterItem.vue.d.ts +2 -1
  187. package/dist/component/primitive/FilterOptionBase.vue.d.ts +6 -4
  188. package/dist/component/primitive/SelectBase.vue.d.ts +8 -282
  189. package/dist/component/primitive/SliderBase.vue.d.ts +8 -16
  190. package/dist/component/primitive/SliderThumb.vue.d.ts +3 -2
  191. package/dist/component/primitive/SliderTrack.vue.d.ts +7 -11
  192. package/dist/component/primitive/TreeNodeRenderer.vue.d.ts +15 -14
  193. package/dist/index.css +61 -19
  194. package/dist/index.js +492 -374
  195. package/dist/index.js.map +1 -1
  196. package/dist/transition/FluxAutoHeightTransition.vue.d.ts +6 -13
  197. package/dist/transition/FluxAutoWidthTransition.vue.d.ts +6 -13
  198. package/dist/transition/FluxBreakthroughTransition.vue.d.ts +6 -13
  199. package/dist/transition/FluxFadeTransition.vue.d.ts +6 -13
  200. package/dist/transition/FluxOverlayTransition.vue.d.ts +6 -13
  201. package/dist/transition/FluxRouteTransition.vue.d.ts +6 -13
  202. package/dist/transition/FluxSlideOverTransition.vue.d.ts +6 -13
  203. package/dist/transition/FluxTooltipTransition.vue.d.ts +6 -13
  204. package/dist/transition/FluxVerticalWindowTransition.vue.d.ts +6 -13
  205. package/dist/transition/FluxWindowTransition.vue.d.ts +6 -13
  206. package/dist/vite.js.map +1 -1
  207. package/package.json +12 -8
  208. package/src/component/FluxCheckbox.vue +2 -2
  209. package/src/component/FluxDataTable.vue +160 -5
  210. package/src/component/FluxTable.vue +13 -3
  211. package/src/component/FluxTableRow.vue +6 -1
  212. package/src/css/component/Form.module.scss +24 -8
  213. package/src/css/component/LayerPane.module.scss +4 -0
  214. package/src/css/component/Overlay.module.scss +1 -1
  215. package/src/css/component/Tab.module.scss +3 -3
  216. package/src/css/component/Table.module.scss +33 -3
  217. package/src/util/createDialogRenderer.ts +0 -1
@@ -1,19 +1,12 @@
1
1
  import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: Readonly<{
5
- default(): VNode[];
6
- }> & {
7
- default(): VNode[];
8
- };
9
- refs: {};
10
- rootEl: any;
2
+ type __VLS_Slots = {
3
+ default(): VNode[];
11
4
  };
12
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
- declare const __VLS_component: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
14
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
5
+ declare const __VLS_base: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
15
8
  export default _default;
16
- type __VLS_WithTemplateSlots<T, S> = T & {
9
+ type __VLS_WithSlots<T, S> = T & {
17
10
  new (): {
18
11
  $slots: S;
19
12
  };
@@ -1,19 +1,12 @@
1
1
  import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
2
- declare function __VLS_template(): {
3
- attrs: Partial<{}>;
4
- slots: Readonly<{
5
- default(): VNode[];
6
- }> & {
7
- default(): VNode[];
8
- };
9
- refs: {};
10
- rootEl: any;
2
+ type __VLS_Slots = {
3
+ default(): VNode[];
11
4
  };
12
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
- declare const __VLS_component: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
14
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
5
+ declare const __VLS_base: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
6
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
+ declare const _default: typeof __VLS_export;
15
8
  export default _default;
16
- type __VLS_WithTemplateSlots<T, S> = T & {
9
+ type __VLS_WithSlots<T, S> = T & {
17
10
  new (): {
18
11
  $slots: S;
19
12
  };
@@ -3,21 +3,14 @@ type __VLS_Props = {
3
3
  readonly isBack?: boolean;
4
4
  readonly mode?: 'in-out' | 'out-in';
5
5
  };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: Readonly<{
9
- default(): VNode[];
10
- }> & {
11
- default(): VNode[];
12
- };
13
- refs: {};
14
- rootEl: any;
6
+ type __VLS_Slots = {
7
+ default(): VNode[];
15
8
  };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
19
12
  export default _default;
20
- type __VLS_WithTemplateSlots<T, S> = T & {
13
+ type __VLS_WithSlots<T, S> = T & {
21
14
  new (): {
22
15
  $slots: S;
23
16
  };
@@ -2,21 +2,14 @@ import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentPr
2
2
  type __VLS_Props = {
3
3
  readonly mode?: 'in-out' | 'out-in';
4
4
  };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: Readonly<{
8
- default(): VNode[];
9
- }> & {
10
- default(): VNode[];
11
- };
12
- refs: {};
13
- rootEl: any;
5
+ type __VLS_Slots = {
6
+ default(): VNode[];
14
7
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
8
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
18
11
  export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
12
+ type __VLS_WithSlots<T, S> = T & {
20
13
  new (): {
21
14
  $slots: S;
22
15
  };
@@ -2,21 +2,14 @@ import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentPr
2
2
  type __VLS_Props = {
3
3
  readonly mode?: 'in-out' | 'out-in';
4
4
  };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: Readonly<{
8
- default(): VNode[];
9
- }> & {
10
- default(): VNode[];
11
- };
12
- refs: {};
13
- rootEl: any;
5
+ type __VLS_Slots = {
6
+ default(): VNode[];
14
7
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
8
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
18
11
  export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
12
+ type __VLS_WithSlots<T, S> = T & {
20
13
  new (): {
21
14
  $slots: S;
22
15
  };
@@ -3,21 +3,14 @@ type __VLS_Props = {
3
3
  readonly isBack?: boolean;
4
4
  readonly mode?: 'in-out' | 'out-in';
5
5
  };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: Readonly<{
9
- default(): VNode[];
10
- }> & {
11
- default(): VNode[];
12
- };
13
- refs: {};
14
- rootEl: any;
6
+ type __VLS_Slots = {
7
+ default(): VNode[];
15
8
  };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
19
12
  export default _default;
20
- type __VLS_WithTemplateSlots<T, S> = T & {
13
+ type __VLS_WithSlots<T, S> = T & {
21
14
  new (): {
22
15
  $slots: S;
23
16
  };
@@ -2,21 +2,14 @@ import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentPr
2
2
  type __VLS_Props = {
3
3
  readonly mode?: 'in-out' | 'out-in';
4
4
  };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: Readonly<{
8
- default(): VNode[];
9
- }> & {
10
- default(): VNode[];
11
- };
12
- refs: {};
13
- rootEl: any;
5
+ type __VLS_Slots = {
6
+ default(): VNode[];
14
7
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
8
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
18
11
  export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
12
+ type __VLS_WithSlots<T, S> = T & {
20
13
  new (): {
21
14
  $slots: S;
22
15
  };
@@ -2,21 +2,14 @@ import { VNode, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentPr
2
2
  type __VLS_Props = {
3
3
  readonly mode?: 'in-out' | 'out-in';
4
4
  };
5
- declare function __VLS_template(): {
6
- attrs: Partial<{}>;
7
- slots: Readonly<{
8
- default(): VNode[];
9
- }> & {
10
- default(): VNode[];
11
- };
12
- refs: {};
13
- rootEl: any;
5
+ type __VLS_Slots = {
6
+ default(): VNode[];
14
7
  };
15
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
16
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
17
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
8
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
9
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
10
+ declare const _default: typeof __VLS_export;
18
11
  export default _default;
19
- type __VLS_WithTemplateSlots<T, S> = T & {
12
+ type __VLS_WithSlots<T, S> = T & {
20
13
  new (): {
21
14
  $slots: S;
22
15
  };
@@ -3,21 +3,14 @@ type __VLS_Props = {
3
3
  readonly isBack?: boolean;
4
4
  readonly mode?: 'in-out' | 'out-in';
5
5
  };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: Readonly<{
9
- default(): VNode[];
10
- }> & {
11
- default(): VNode[];
12
- };
13
- refs: {};
14
- rootEl: any;
6
+ type __VLS_Slots = {
7
+ default(): VNode[];
15
8
  };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
19
12
  export default _default;
20
- type __VLS_WithTemplateSlots<T, S> = T & {
13
+ type __VLS_WithSlots<T, S> = T & {
21
14
  new (): {
22
15
  $slots: S;
23
16
  };
@@ -3,21 +3,14 @@ type __VLS_Props = {
3
3
  readonly isBack?: boolean;
4
4
  readonly mode?: 'in-out' | 'out-in';
5
5
  };
6
- declare function __VLS_template(): {
7
- attrs: Partial<{}>;
8
- slots: Readonly<{
9
- default(): VNode[];
10
- }> & {
11
- default(): VNode[];
12
- };
13
- refs: {};
14
- rootEl: any;
6
+ type __VLS_Slots = {
7
+ default(): VNode[];
15
8
  };
16
- type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
17
- declare const __VLS_component: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
18
- declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
9
+ declare const __VLS_base: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
10
+ declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
11
+ declare const _default: typeof __VLS_export;
19
12
  export default _default;
20
- type __VLS_WithTemplateSlots<T, S> = T & {
13
+ type __VLS_WithSlots<T, S> = T & {
21
14
  new (): {
22
15
  $slots: S;
23
16
  };
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","names":[],"sources":["../src/vite/defineFilterMacro.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\nconst SCRIPT_SETUP_REGEX = /<script\\b([^>]*)\\bsetup\\b([^>]*)>([\\s\\S]*?)<\\/script>/gi;\n\nfunction defineFilterMacro(): Plugin {\n return {\n name: '@flux-ui/components/define-filter-macro',\n enforce: 'pre',\n\n transform(code, id) {\n if (!id.endsWith('.vue')) {\n return;\n }\n\n if (!code.includes('defineFilter')) {\n return;\n }\n\n let transformed = false;\n\n const newCode = code.replace(SCRIPT_SETUP_REGEX, (match, before, after, content) => {\n if (!content.includes('defineFilter')) {\n return match;\n }\n\n if (content.includes('__filterDefinitionFactory')) {\n return match;\n }\n\n if (containsTopLevelCall(content, 'defineOptions')) {\n return match;\n }\n\n const wrapped = wrapDefineFilter(content);\n\n if (wrapped === content) {\n return match;\n }\n\n transformed = true;\n return `<script${before}setup${after}>${wrapped}</script>`;\n });\n\n if (!transformed) {\n return;\n }\n\n return {\n code: newCode,\n map: null\n };\n }\n };\n}\n\nexport default defineFilterMacro;\n\nfunction wrapDefineFilter(content: string): string {\n const range = findTopLevelCall(content, 'defineFilter');\n\n if (!range) {\n return content;\n }\n\n const callExpression = content.slice(range.callStart, range.callEnd);\n const replacement = `defineOptions({\\n __filterDefinitionFactory: ${callExpression}\\n})`;\n\n return content.slice(0, range.callStart) + replacement + content.slice(range.callEnd);\n}\n\nfunction containsTopLevelCall(content: string, name: string): boolean {\n return findTopLevelCall(content, name) !== null;\n}\n\ntype CallRange = {\n readonly callStart: number;\n readonly callEnd: number;\n};\n\nfunction findTopLevelCall(content: string, name: string): CallRange | null {\n let parenDepth = 0;\n let braceDepth = 0;\n let bracketDepth = 0;\n let inString: string | null = null;\n let inComment: 'single' | 'multi' | null = null;\n\n let i = 0;\n\n while (i < content.length) {\n const c = content[i];\n const n = content[i + 1];\n\n if (inComment === 'single') {\n if (c === '\\n') {\n inComment = null;\n }\n\n i++;\n continue;\n }\n\n if (inComment === 'multi') {\n if (c === '*' && n === '/') {\n inComment = null;\n i += 2;\n continue;\n }\n\n i++;\n continue;\n }\n\n if (inString) {\n if (c === '\\\\') {\n i += 2;\n continue;\n }\n\n if (c === inString) {\n inString = null;\n }\n\n i++;\n continue;\n }\n\n if (c === '/' && n === '/') {\n inComment = 'single';\n i += 2;\n continue;\n }\n\n if (c === '/' && n === '*') {\n inComment = 'multi';\n i += 2;\n continue;\n }\n\n if (c === '\"' || c === '\\'' || c === '`') {\n inString = c;\n i++;\n continue;\n }\n\n if (c === '(') {\n parenDepth++;\n i++;\n continue;\n }\n\n if (c === ')') {\n parenDepth--;\n i++;\n continue;\n }\n\n if (c === '{') {\n braceDepth++;\n i++;\n continue;\n }\n\n if (c === '}') {\n braceDepth--;\n i++;\n continue;\n }\n\n if (c === '[') {\n bracketDepth++;\n i++;\n continue;\n }\n\n if (c === ']') {\n bracketDepth--;\n i++;\n continue;\n }\n\n const isTopLevel = parenDepth === 0 && braceDepth === 0 && bracketDepth === 0;\n\n if (!isTopLevel || !content.startsWith(name, i)) {\n i++;\n continue;\n }\n\n const prevChar = i > 0 ? content[i - 1] : '';\n\n if (/[A-Za-z0-9_$]/.test(prevChar)) {\n i++;\n continue;\n }\n\n const afterName = i + name.length;\n const nextChar = content[afterName];\n\n if (nextChar && /[A-Za-z0-9_$]/.test(nextChar)) {\n i++;\n continue;\n }\n\n const callOpen = skipGenericAndWhitespace(content, afterName);\n\n if (callOpen === -1 || content[callOpen] !== '(') {\n i++;\n continue;\n }\n\n const callClose = matchClosingParen(content, callOpen);\n\n if (callClose === -1) {\n return null;\n }\n\n return {\n callStart: i,\n callEnd: callClose + 1\n };\n }\n\n return null;\n}\n\nfunction skipGenericAndWhitespace(content: string, start: number): number {\n let i = start;\n\n while (i < content.length && /\\s/.test(content[i])) {\n i++;\n }\n\n if (content[i] !== '<') {\n return i;\n }\n\n let depth = 1;\n i++;\n\n while (i < content.length && depth > 0) {\n const c = content[i];\n\n if (c === '<') {\n depth++;\n } else if (c === '>') {\n depth--;\n }\n\n i++;\n }\n\n while (i < content.length && /\\s/.test(content[i])) {\n i++;\n }\n\n return i;\n}\n\nfunction matchClosingParen(content: string, openIndex: number): number {\n let depth = 1;\n let inString: string | null = null;\n let inComment: 'single' | 'multi' | null = null;\n\n let i = openIndex + 1;\n\n while (i < content.length) {\n const c = content[i];\n const n = content[i + 1];\n\n if (inComment === 'single') {\n if (c === '\\n') {\n inComment = null;\n }\n\n i++;\n continue;\n }\n\n if (inComment === 'multi') {\n if (c === '*' && n === '/') {\n inComment = null;\n i += 2;\n continue;\n }\n\n i++;\n continue;\n }\n\n if (inString) {\n if (c === '\\\\') {\n i += 2;\n continue;\n }\n\n if (c === inString) {\n inString = null;\n }\n\n i++;\n continue;\n }\n\n if (c === '/' && n === '/') {\n inComment = 'single';\n i += 2;\n continue;\n }\n\n if (c === '/' && n === '*') {\n inComment = 'multi';\n i += 2;\n continue;\n }\n\n if (c === '\"' || c === '\\'' || c === '`') {\n inString = c;\n i++;\n continue;\n }\n\n if (c === '(') {\n depth++;\n } else if (c === ')') {\n depth--;\n\n if (depth === 0) {\n return i;\n }\n }\n\n i++;\n }\n\n return -1;\n}\n"],"mappings":";AAEA,IAAM,qBAAqB;AAE3B,SAAS,oBAA4B;AACjC,QAAO;EACH,MAAM;EACN,SAAS;EAET,UAAU,MAAM,IAAI;AAChB,OAAI,CAAC,GAAG,SAAS,OAAO,CACpB;AAGJ,OAAI,CAAC,KAAK,SAAS,eAAe,CAC9B;GAGJ,IAAI,cAAc;GAElB,MAAM,UAAU,KAAK,QAAQ,qBAAqB,OAAO,QAAQ,OAAO,YAAY;AAChF,QAAI,CAAC,QAAQ,SAAS,eAAe,CACjC,QAAO;AAGX,QAAI,QAAQ,SAAS,4BAA4B,CAC7C,QAAO;AAGX,QAAI,qBAAqB,SAAS,gBAAgB,CAC9C,QAAO;IAGX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I,QAAQ;CACZ,IAAI,WAA0B;CAC9B,IAAI,YAAuC;CAE3C,IAAI,IAAI,YAAY;AAEpB,QAAO,IAAI,QAAQ,QAAQ;EACvB,MAAM,IAAI,QAAQ;EAClB,MAAM,IAAI,QAAQ,IAAI;AAEtB,MAAI,cAAc,UAAU;AACxB,OAAI,MAAM,KACN,aAAY;AAGhB;AACA;;AAGJ,MAAI,cAAc,SAAS;AACvB,OAAI,MAAM,OAAO,MAAM,KAAK;AACxB,gBAAY;AACZ,SAAK;AACL;;AAGJ;AACA;;AAGJ,MAAI,UAAU;AACV,OAAI,MAAM,MAAM;AACZ,SAAK;AACL;;AAGJ,OAAI,MAAM,SACN,YAAW;AAGf;AACA;;AAGJ,MAAI,MAAM,OAAO,MAAM,KAAK;AACxB,eAAY;AACZ,QAAK;AACL;;AAGJ,MAAI,MAAM,OAAO,MAAM,KAAK;AACxB,eAAY;AACZ,QAAK;AACL;;AAGJ,MAAI,MAAM,QAAO,MAAM,OAAQ,MAAM,KAAK;AACtC,cAAW;AACX;AACA;;AAGJ,MAAI,MAAM,IACN;WACO,MAAM,KAAK;AAClB;AAEA,OAAI,UAAU,EACV,QAAO;;AAIf;;AAGJ,QAAO"}
1
+ {"version":3,"file":"vite.js","names":[],"sources":["../src/vite/defineFilterMacro.ts"],"sourcesContent":["import type { Plugin } from 'vite';\n\nconst SCRIPT_SETUP_REGEX = /<script\\b([^>]*)\\bsetup\\b([^>]*)>([\\s\\S]*?)<\\/script>/gi;\n\nfunction defineFilterMacro(): Plugin {\n return {\n name: '@flux-ui/components/define-filter-macro',\n enforce: 'pre',\n\n transform(code, id) {\n if (!id.endsWith('.vue')) {\n return;\n }\n\n if (!code.includes('defineFilter')) {\n return;\n }\n\n let transformed = false;\n\n const newCode = code.replace(SCRIPT_SETUP_REGEX, (match, before, after, content) => {\n if (!content.includes('defineFilter')) {\n return match;\n }\n\n if (content.includes('__filterDefinitionFactory')) {\n return match;\n }\n\n if (containsTopLevelCall(content, 'defineOptions')) {\n return match;\n }\n\n const wrapped = wrapDefineFilter(content);\n\n if (wrapped === content) {\n return match;\n }\n\n transformed = true;\n return `<script${before}setup${after}>${wrapped}</script>`;\n });\n\n if (!transformed) {\n return;\n }\n\n return {\n code: newCode,\n map: null\n };\n }\n };\n}\n\nexport default defineFilterMacro;\n\nfunction wrapDefineFilter(content: string): string {\n const range = findTopLevelCall(content, 'defineFilter');\n\n if (!range) {\n return content;\n }\n\n const callExpression = content.slice(range.callStart, range.callEnd);\n const replacement = `defineOptions({\\n __filterDefinitionFactory: ${callExpression}\\n})`;\n\n return content.slice(0, range.callStart) + replacement + content.slice(range.callEnd);\n}\n\nfunction containsTopLevelCall(content: string, name: string): boolean {\n return findTopLevelCall(content, name) !== null;\n}\n\ntype CallRange = {\n readonly callStart: number;\n readonly callEnd: number;\n};\n\nfunction findTopLevelCall(content: string, name: string): CallRange | null {\n let parenDepth = 0;\n let braceDepth = 0;\n let bracketDepth = 0;\n let inString: string | null = null;\n let inComment: 'single' | 'multi' | null = null;\n\n let i = 0;\n\n while (i < content.length) {\n const c = content[i];\n const n = content[i + 1];\n\n if (inComment === 'single') {\n if (c === '\\n') {\n inComment = null;\n }\n\n i++;\n continue;\n }\n\n if (inComment === 'multi') {\n if (c === '*' && n === '/') {\n inComment = null;\n i += 2;\n continue;\n }\n\n i++;\n continue;\n }\n\n if (inString) {\n if (c === '\\\\') {\n i += 2;\n continue;\n }\n\n if (c === inString) {\n inString = null;\n }\n\n i++;\n continue;\n }\n\n if (c === '/' && n === '/') {\n inComment = 'single';\n i += 2;\n continue;\n }\n\n if (c === '/' && n === '*') {\n inComment = 'multi';\n i += 2;\n continue;\n }\n\n if (c === '\"' || c === '\\'' || c === '`') {\n inString = c;\n i++;\n continue;\n }\n\n if (c === '(') {\n parenDepth++;\n i++;\n continue;\n }\n\n if (c === ')') {\n parenDepth--;\n i++;\n continue;\n }\n\n if (c === '{') {\n braceDepth++;\n i++;\n continue;\n }\n\n if (c === '}') {\n braceDepth--;\n i++;\n continue;\n }\n\n if (c === '[') {\n bracketDepth++;\n i++;\n continue;\n }\n\n if (c === ']') {\n bracketDepth--;\n i++;\n continue;\n }\n\n const isTopLevel = parenDepth === 0 && braceDepth === 0 && bracketDepth === 0;\n\n if (!isTopLevel || !content.startsWith(name, i)) {\n i++;\n continue;\n }\n\n const prevChar = i > 0 ? content[i - 1] : '';\n\n if (/[A-Za-z0-9_$]/.test(prevChar)) {\n i++;\n continue;\n }\n\n const afterName = i + name.length;\n const nextChar = content[afterName];\n\n if (nextChar && /[A-Za-z0-9_$]/.test(nextChar)) {\n i++;\n continue;\n }\n\n const callOpen = skipGenericAndWhitespace(content, afterName);\n\n if (callOpen === -1 || content[callOpen] !== '(') {\n i++;\n continue;\n }\n\n const callClose = matchClosingParen(content, callOpen);\n\n if (callClose === -1) {\n return null;\n }\n\n return {\n callStart: i,\n callEnd: callClose + 1\n };\n }\n\n return null;\n}\n\nfunction skipGenericAndWhitespace(content: string, start: number): number {\n let i = start;\n\n while (i < content.length && /\\s/.test(content[i])) {\n i++;\n }\n\n if (content[i] !== '<') {\n return i;\n }\n\n let depth = 1;\n i++;\n\n while (i < content.length && depth > 0) {\n const c = content[i];\n\n if (c === '<') {\n depth++;\n } else if (c === '>') {\n depth--;\n }\n\n i++;\n }\n\n while (i < content.length && /\\s/.test(content[i])) {\n i++;\n }\n\n return i;\n}\n\nfunction matchClosingParen(content: string, openIndex: number): number {\n let depth = 1;\n let inString: string | null = null;\n let inComment: 'single' | 'multi' | null = null;\n\n let i = openIndex + 1;\n\n while (i < content.length) {\n const c = content[i];\n const n = content[i + 1];\n\n if (inComment === 'single') {\n if (c === '\\n') {\n inComment = null;\n }\n\n i++;\n continue;\n }\n\n if (inComment === 'multi') {\n if (c === '*' && n === '/') {\n inComment = null;\n i += 2;\n continue;\n }\n\n i++;\n continue;\n }\n\n if (inString) {\n if (c === '\\\\') {\n i += 2;\n continue;\n }\n\n if (c === inString) {\n inString = null;\n }\n\n i++;\n continue;\n }\n\n if (c === '/' && n === '/') {\n inComment = 'single';\n i += 2;\n continue;\n }\n\n if (c === '/' && n === '*') {\n inComment = 'multi';\n i += 2;\n continue;\n }\n\n if (c === '\"' || c === '\\'' || c === '`') {\n inString = c;\n i++;\n continue;\n }\n\n if (c === '(') {\n depth++;\n } else if (c === ')') {\n depth--;\n\n if (depth === 0) {\n return i;\n }\n }\n\n i++;\n }\n\n return -1;\n}\n"],"mappings":";AAEA,IAAM,qBAAqB;AAE3B,SAAS,oBAA4B;CACjC,OAAO;EACH,MAAM;EACN,SAAS;EAET,UAAU,MAAM,IAAI;GAChB,IAAI,CAAC,GAAG,SAAS,OAAO,EACpB;GAGJ,IAAI,CAAC,KAAK,SAAS,eAAe,EAC9B;GAGJ,IAAI,cAAc;GAElB,MAAM,UAAU,KAAK,QAAQ,qBAAqB,OAAO,QAAQ,OAAO,YAAY;IAChF,IAAI,CAAC,QAAQ,SAAS,eAAe,EACjC,OAAO;IAGX,IAAI,QAAQ,SAAS,4BAA4B,EAC7C,OAAO;IAGX,IAAI,qBAAqB,SAAS,gBAAgB,EAC9C,OAAO;IAGX,MAAM,UAAU,iBAAiB,QAAQ;IAEzC,IAAI,YAAY,SACZ,OAAO;IAGX,cAAc;IACd,OAAO,UAAU,OAAO,OAAO,MAAM,GAAG,QAAQ;KAClD;GAEF,IAAI,CAAC,aACD;GAGJ,OAAO;IACH,MAAM;IACN,KAAK;IACR;;EAER;;AAKL,SAAS,iBAAiB,SAAyB;CAC/C,MAAM,QAAQ,iBAAiB,SAAS,eAAe;CAEvD,IAAI,CAAC,OACD,OAAO;CAIX,MAAM,cAAc,mDADG,QAAQ,MAAM,MAAM,WAAW,MAAM,QACW,CAAe;CAEtF,OAAO,QAAQ,MAAM,GAAG,MAAM,UAAU,GAAG,cAAc,QAAQ,MAAM,MAAM,QAAQ;;AAGzF,SAAS,qBAAqB,SAAiB,MAAuB;CAClE,OAAO,iBAAiB,SAAS,KAAK,KAAK;;AAQ/C,SAAS,iBAAiB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AAK;GACxB,YAAY;GACZ,KAAK;GACL;;EAGJ,IAAI,MAAM,QAAO,MAAM,OAAQ,MAAM,KAAK;GACtC,WAAW;GACX;GACA;;EAGJ,IAAI,MAAM,KACN;OACG,IAAI,MAAM,KAAK;GAClB;GAEA,IAAI,UAAU,GACV,OAAO;;EAIf;;CAGJ,OAAO"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flux-ui/components",
3
3
  "description": "A set of opiniated UI components.",
4
- "version": "3.0.0-next.65",
4
+ "version": "3.0.0-next.67",
5
5
  "type": "module",
6
6
  "license": "MIT",
7
7
  "funding": "https://github.com/sponsors/basmilius",
@@ -50,11 +50,15 @@
50
50
  "main": "./dist/index.js",
51
51
  "module": "./dist/index.js",
52
52
  "types": "./dist/index.d.ts",
53
+ "sideEffects": [
54
+ "**/css/index.scss",
55
+ "**/dist/index.css"
56
+ ],
53
57
  "dependencies": {
54
- "@basmilius/common": "^3.25.0",
55
- "@basmilius/utils": "^3.25.0",
56
- "@flux-ui/internals": "3.0.0-next.65",
57
- "@flux-ui/types": "3.0.0-next.65",
58
+ "@basmilius/common": "^3.30.0",
59
+ "@basmilius/utils": "^3.30.0",
60
+ "@flux-ui/internals": "3.0.0-next.67",
61
+ "@flux-ui/types": "3.0.0-next.67",
58
62
  "@fortawesome/fontawesome-common-types": "^7.2.0",
59
63
  "clsx": "^2.1.1",
60
64
  "imask": "^7.6.1",
@@ -62,10 +66,10 @@
62
66
  },
63
67
  "peerDependencies": {
64
68
  "luxon": "^3.7.2",
65
- "vue": "^3.6.0-beta.10"
69
+ "vue": "^3.6.0-beta.11"
66
70
  },
67
71
  "devDependencies": {
68
- "@basmilius/vite-preset": "^3.25.0",
72
+ "@basmilius/vite-preset": "^3.30.0",
69
73
  "@types/lodash-es": "^4.17.12",
70
74
  "@types/luxon": "^3.7.1",
71
75
  "@types/node": "^25.6.0",
@@ -73,7 +77,7 @@
73
77
  "@vue/tsconfig": "^0.9.1",
74
78
  "sass-embedded": "^1.99.0",
75
79
  "typescript": "^6.0.3",
76
- "vite": "^8.0.10",
80
+ "vite": "^8.0.11",
77
81
  "vue-tsc": "^3.2.8"
78
82
  }
79
83
  }
@@ -26,12 +26,12 @@
26
26
  <FluxIcon
27
27
  v-if="isIndeterminate"
28
28
  name="minus"
29
- :size="16"/>
29
+ :size="12"/>
30
30
 
31
31
  <FluxIcon
32
32
  v-else
33
33
  name="check"
34
- :size="16"/>
34
+ :size="12"/>
35
35
  </button>
36
36
 
37
37
  <span
@@ -1,5 +1,6 @@
1
1
  <template>
2
2
  <FluxTable
3
+ ref="table"
3
4
  :fill-columns="fillColumns"
4
5
  :is-bordered="isBordered"
5
6
  :is-hoverable="isHoverable"
@@ -13,13 +14,23 @@
13
14
  </template>
14
15
 
15
16
  <template
16
- v-if="'header' in slots"
17
+ v-if="'header' in slots || selectionMode"
17
18
  #header>
18
19
  <slot
19
20
  name="filter"
20
21
  v-bind="{page, perPage, items: limitedItems, total}"/>
21
22
 
22
23
  <FluxTableRow>
24
+ <FluxTableHeader
25
+ v-if="selectionMode"
26
+ is-shrinking
27
+ :class="$style.tableCellSelection">
28
+ <FluxCheckbox
29
+ v-if="selectionMode === 'multiple'"
30
+ :model-value="selectAllState"
31
+ @update:model-value="onSelectAll"/>
32
+ </FluxTableHeader>
33
+
23
34
  <slot
24
35
  name="header"
25
36
  v-bind="{page, perPage, items: limitedItems, total}"/>
@@ -54,11 +65,22 @@
54
65
 
55
66
  <FluxTableRow
56
67
  v-for="(item, index) of limitedItems"
57
- :key="uniqueKey ? item[uniqueKey] : index">
68
+ :key="uniqueKey ? item[uniqueKey] : index"
69
+ :class="selectionMode && !treeDisabled && $style.isSelectableRow"
70
+ :is-selected="selectionMode ? isItemSelected(item) : false"
71
+ @click="onRowClick(item, $event)">
72
+ <FluxTableCell
73
+ v-if="selectionMode"
74
+ :class="$style.tableCellSelection">
75
+ <FluxCheckbox
76
+ :model-value="isItemSelected(item)"
77
+ @update:model-value="onSelectRow(item)"/>
78
+ </FluxTableCell>
79
+
58
80
  <template v-for="(_, name) of slots">
59
81
  <slot
60
82
  v-if="!IGNORED_SLOTS.includes(name as string)"
61
- v-bind="{index, item, items: limitedItems, page, perPage, total}"
83
+ v-bind="{index, item, items: limitedItems, page, perPage, total, isSelected: isItemSelected(item)}"
62
84
  :name="name"/>
63
85
  </template>
64
86
  </FluxTableRow>
@@ -69,10 +91,18 @@
69
91
  lang="ts"
70
92
  setup
71
93
  generic="T extends Record<string, any>">
72
- import { computed, type VNode } from 'vue';
94
+ import { computed, unref, useTemplateRef, type VNode, watch } from 'vue';
95
+ import { useDisabledInjection } from '~flux/components/composable';
96
+ import FluxCheckbox from './FluxCheckbox.vue';
73
97
  import FluxPaginationBar from './FluxPaginationBar.vue';
74
98
  import FluxTable from './FluxTable.vue';
99
+ import FluxTableCell from './FluxTableCell.vue';
100
+ import FluxTableHeader from './FluxTableHeader.vue';
75
101
  import FluxTableRow from './FluxTableRow.vue';
102
+ import $style from '~flux/components/css/component/Table.module.scss';
103
+
104
+ type SelectionId = string | number;
105
+ type SelectionValue = SelectionId | null | SelectionId[];
76
106
 
77
107
  const IGNORED_SLOTS: string[] = ['filter', 'header', 'footer', 'colgroups', 'pagination'];
78
108
 
@@ -81,6 +111,8 @@
81
111
  navigate: [number];
82
112
  }>();
83
113
 
114
+ const selected = defineModel<SelectionValue>('selected');
115
+
84
116
  const {
85
117
  isBordered = true,
86
118
  isHoverable = false,
@@ -88,7 +120,9 @@
88
120
  isSeparated = true,
89
121
  isStriped = false,
90
122
  items,
91
- perPage
123
+ perPage,
124
+ selectionMode,
125
+ uniqueKey
92
126
  } = defineProps<{
93
127
  readonly fillColumns?: number;
94
128
  readonly isBordered?: boolean;
@@ -100,6 +134,7 @@
100
134
  readonly limits: number[];
101
135
  readonly page: number;
102
136
  readonly perPage: number;
137
+ readonly selectionMode?: 'single' | 'multiple';
103
138
  readonly total: number;
104
139
  readonly uniqueKey?: string;
105
140
  }>();
@@ -112,6 +147,7 @@
112
147
  readonly item: T;
113
148
  readonly items: T[];
114
149
  readonly total: number;
150
+ readonly isSelected: boolean;
115
151
  }) => VNode;
116
152
 
117
153
  filter(props: {
@@ -145,5 +181,124 @@
145
181
  colgroups(): VNode;
146
182
  }>();
147
183
 
184
+ const table = useTemplateRef('table');
185
+ const treeDisabled = useDisabledInjection();
186
+
148
187
  const limitedItems = computed(() => items.slice(0, perPage));
188
+
189
+ const currentPageIds = computed<SelectionId[]>(() => {
190
+ if (!uniqueKey) {
191
+ return [];
192
+ }
193
+
194
+ return unref(limitedItems).map(item => item[uniqueKey] as SelectionId);
195
+ });
196
+
197
+ const selectAllState = computed<boolean | null>(() => {
198
+ const ids = unref(currentPageIds);
199
+ const value = unref(selected);
200
+
201
+ if (ids.length === 0 || !Array.isArray(value)) {
202
+ return false;
203
+ }
204
+
205
+ const selectedOnPage = ids.filter(id => value.includes(id)).length;
206
+
207
+ if (selectedOnPage === 0) {
208
+ return false;
209
+ }
210
+
211
+ if (selectedOnPage === ids.length) {
212
+ return true;
213
+ }
214
+
215
+ return null;
216
+ });
217
+
218
+ function getItemId(item: T): SelectionId | undefined {
219
+ if (!uniqueKey) {
220
+ return undefined;
221
+ }
222
+
223
+ return item[uniqueKey] as SelectionId;
224
+ }
225
+
226
+ function isItemSelected(item: T): boolean {
227
+ if (!selectionMode) {
228
+ return false;
229
+ }
230
+
231
+ const id = getItemId(item);
232
+
233
+ if (id === undefined) {
234
+ return false;
235
+ }
236
+
237
+ const value = unref(selected);
238
+
239
+ if (Array.isArray(value)) {
240
+ return value.includes(id);
241
+ }
242
+
243
+ return value === id;
244
+ }
245
+
246
+ function onRowClick(item: T, event: MouseEvent): void {
247
+ if (!selectionMode || unref(treeDisabled)) {
248
+ return;
249
+ }
250
+
251
+ const target = event.target as HTMLElement | null;
252
+
253
+ if (target?.closest('a, button, input, label, select, textarea, [role="button"]')) {
254
+ return;
255
+ }
256
+
257
+ onSelectRow(item);
258
+ }
259
+
260
+ function onSelectRow(item: T): void {
261
+ const id = getItemId(item);
262
+
263
+ if (id === undefined) {
264
+ return;
265
+ }
266
+
267
+ if (selectionMode === 'multiple') {
268
+ const current = Array.isArray(unref(selected)) ? unref(selected) as SelectionId[] : [];
269
+ selected.value = current.includes(id)
270
+ ? current.filter(v => v !== id)
271
+ : [...current, id];
272
+ return;
273
+ }
274
+
275
+ if (selectionMode === 'single') {
276
+ selected.value = isItemSelected(item) ? null : id;
277
+ }
278
+ }
279
+
280
+ function onSelectAll(value: boolean | null): void {
281
+ if (selectionMode !== 'multiple') {
282
+ return;
283
+ }
284
+
285
+ const ids = unref(currentPageIds);
286
+ const current = Array.isArray(unref(selected)) ? unref(selected) as SelectionId[] : [];
287
+
288
+ if (value) {
289
+ const additions = ids.filter(id => !current.includes(id));
290
+ selected.value = [...current, ...additions];
291
+ return;
292
+ }
293
+
294
+ selected.value = current.filter(id => !ids.includes(id));
295
+ }
296
+
297
+ if (import.meta.env.DEV && selectionMode && !uniqueKey) {
298
+ console.warn('[FluxDataTable] `uniqueKey` is required when `selectionMode` is set, otherwise rows cannot be tracked across renders.');
299
+ }
300
+
301
+ watch(() => items, () => {
302
+ unref(table)?.$el.scrollTo(0, 0);
303
+ });
149
304
  </script>