@bitrix24/b24ui-nuxt 2.1.3 → 2.1.5

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 (29) hide show
  1. package/dist/meta.d.mts +138 -113
  2. package/dist/meta.mjs +138 -113
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +1 -1
  5. package/dist/runtime/components/CheckboxGroup.vue +3 -2
  6. package/dist/runtime/components/CommandPalette.vue +8 -2
  7. package/dist/runtime/components/DashboardSearchButton.vue +4 -3
  8. package/dist/runtime/components/InputMenu.vue +15 -13
  9. package/dist/runtime/components/NavigationMenu.d.vue.ts +44 -9
  10. package/dist/runtime/components/NavigationMenu.vue +19 -11
  11. package/dist/runtime/components/NavigationMenu.vue.d.ts +44 -9
  12. package/dist/runtime/components/RadioGroup.vue +5 -5
  13. package/dist/runtime/components/SelectMenu.vue +14 -11
  14. package/dist/runtime/components/Table.d.vue.ts +2 -2
  15. package/dist/runtime/components/Table.vue +15 -2
  16. package/dist/runtime/components/Table.vue.d.ts +2 -2
  17. package/dist/runtime/components/color-mode/ColorModeButton.d.vue.ts +2 -9
  18. package/dist/runtime/components/color-mode/ColorModeButton.vue +8 -13
  19. package/dist/runtime/components/color-mode/ColorModeButton.vue.d.ts +2 -9
  20. package/dist/runtime/components/content/ContentSearchButton.vue +4 -3
  21. package/dist/runtime/utils/virtualizer.d.ts +6 -0
  22. package/dist/runtime/utils/virtualizer.js +32 -0
  23. package/dist/shared/{b24ui-nuxt.mq1NUekN.mjs → b24ui-nuxt.Dspx5yCK.mjs} +85 -49
  24. package/dist/unplugin.mjs +1 -1
  25. package/dist/vite.mjs +1 -1
  26. package/package.json +1 -1
  27. package/dist/runtime/vue/components/color-mode/ColorModeButton.d.vue.ts +0 -12
  28. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue +0 -83
  29. package/dist/runtime/vue/components/color-mode/ColorModeButton.vue.d.ts +0 -12
@@ -0,0 +1,32 @@
1
+ import { get } from "./index.js";
2
+ function hasDescription(item, descriptionKey) {
3
+ if (typeof item !== "object" || item === null) {
4
+ return false;
5
+ }
6
+ const value = get(item, descriptionKey);
7
+ return value !== void 0 && value !== null && value !== "";
8
+ }
9
+ function getSize(size, hasDescription2) {
10
+ if (hasDescription2) {
11
+ return {
12
+ xss: 40,
13
+ xs: 44,
14
+ sm: 48,
15
+ md: 52,
16
+ lg: 56,
17
+ xl: 60
18
+ }[size];
19
+ }
20
+ return {
21
+ xss: 20,
22
+ xs: 24,
23
+ sm: 28,
24
+ md: 32,
25
+ lg: 36,
26
+ xl: 40
27
+ }[size];
28
+ }
29
+ export function getEstimateSize(items, size, descriptionKey) {
30
+ const anyHasDescription = descriptionKey ? items.some((item) => hasDescription(item, descriptionKey)) : false;
31
+ return getSize(size, anyHasDescription);
32
+ }
@@ -8,7 +8,7 @@ import { globSync } from 'tinyglobby';
8
8
  import { defuFn } from 'defu';
9
9
 
10
10
  const name = "@bitrix24/b24ui-nuxt";
11
- const version = "2.1.3";
11
+ const version = "2.1.5";
12
12
 
13
13
  function getDefaultConfig(theme) {
14
14
  return {
@@ -102,30 +102,32 @@ function resolveComponentDependencies(component, dependencyGraph, resolved = /*
102
102
  }
103
103
  return resolved;
104
104
  }
105
- async function detectUsedComponents(rootDir, prefix, componentDir, includeComponents) {
105
+ async function detectUsedComponents(dirs, prefix, componentDir, includeComponents) {
106
106
  const detectedComponents = /* @__PURE__ */ new Set();
107
107
  if (includeComponents && includeComponents.length > 0) {
108
108
  for (const component of includeComponents) {
109
109
  detectedComponents.add(component);
110
110
  }
111
111
  }
112
- const appFiles = globSync(["**/*.{vue,ts,js,tsx,jsx}"], {
113
- cwd: rootDir,
114
- ignore: ["node_modules/**", ".nuxt/**", "dist/**"]
115
- });
116
112
  const componentPattern = new RegExp(`<(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)|\\b(?:Lazy)?${prefix}([A-Z][a-zA-Z]+)\\b`, "g");
117
- for (const file of appFiles) {
118
- try {
119
- const filePath = join(rootDir, file);
120
- const content = await readFile(filePath, "utf-8");
121
- const matches = content.matchAll(componentPattern);
122
- for (const match of matches) {
123
- const componentName = match[1] || match[2];
124
- if (componentName) {
125
- detectedComponents.add(componentName);
113
+ for (const dir of dirs) {
114
+ const appFiles = globSync(["**/*.{vue,ts,js,tsx,jsx}"], {
115
+ cwd: dir,
116
+ ignore: ["node_modules/**", ".nuxt/**", "dist/**"]
117
+ });
118
+ for (const file of appFiles) {
119
+ try {
120
+ const filePath = join(dir, file);
121
+ const content = await readFile(filePath, "utf-8");
122
+ const matches = content.matchAll(componentPattern);
123
+ for (const match of matches) {
124
+ const componentName = match[1] || match[2];
125
+ if (componentName) {
126
+ detectedComponents.add(componentName);
127
+ }
126
128
  }
129
+ } catch {
127
130
  }
128
- } catch {
129
131
  }
130
132
  }
131
133
  if (detectedComponents.size === 0) {
@@ -1935,9 +1937,10 @@ const checkbox = {
1935
1937
  },
1936
1938
  disabled: {
1937
1939
  true: {
1938
- base: "cursor-not-allowed opacity-30",
1939
- label: "cursor-not-allowed opacity-30",
1940
- description: "cursor-not-allowed opacity-30"
1940
+ root: "opacity-30",
1941
+ base: "cursor-not-allowed",
1942
+ label: "cursor-not-allowed",
1943
+ description: "cursor-not-allowed"
1941
1944
  }
1942
1945
  },
1943
1946
  checked: {
@@ -1962,8 +1965,15 @@ const checkbox = {
1962
1965
  class: {
1963
1966
  root: "border-(--b24ui-border-color) cursor-pointer"
1964
1967
  }
1965
- }
1968
+ },
1966
1969
  // endregion ////
1970
+ {
1971
+ variant: "card",
1972
+ disabled: true,
1973
+ class: {
1974
+ root: "cursor-not-allowed"
1975
+ }
1976
+ }
1967
1977
  ],
1968
1978
  defaultVariants: {
1969
1979
  color: "air-primary",
@@ -2052,11 +2062,7 @@ const checkboxGroup = {
2052
2062
  }
2053
2063
  },
2054
2064
  disabled: {
2055
- true: {
2056
- base: "cursor-not-allowed opacity-30",
2057
- label: "cursor-not-allowed opacity-30",
2058
- item: "cursor-not-allowed opacity-30"
2059
- }
2065
+ true: {}
2060
2066
  },
2061
2067
  required: {
2062
2068
  true: {
@@ -2135,8 +2141,15 @@ const checkboxGroup = {
2135
2141
  item: "first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)",
2136
2142
  fieldset: "gap-0 -space-y-px"
2137
2143
  }
2138
- }
2144
+ },
2139
2145
  // endregion ////
2146
+ {
2147
+ variant: "table",
2148
+ disabled: true,
2149
+ class: {
2150
+ item: "cursor-not-allowed"
2151
+ }
2152
+ }
2140
2153
  ],
2141
2154
  defaultVariants: {
2142
2155
  size: "md",
@@ -2740,7 +2753,18 @@ const dashboardSearch = {
2740
2753
  const dashboardSearchButton = {
2741
2754
  slots: {
2742
2755
  base: "",
2756
+ baseLine: "",
2757
+ label: "",
2743
2758
  trailing: "hidden lg:flex items-center gap-0.5 ms-auto"
2759
+ },
2760
+ variants: {
2761
+ collapsed: {
2762
+ true: {
2763
+ baseLine: "ps-[5px] pe-[5px]",
2764
+ label: "hidden",
2765
+ trailing: "lg:hidden"
2766
+ }
2767
+ }
2744
2768
  }
2745
2769
  };
2746
2770
 
@@ -5302,7 +5326,9 @@ const navigationMenu = {
5302
5326
  orientation: "vertical",
5303
5327
  collapsed: true,
5304
5328
  class: {
5305
- childList: "grid px-0 py-(--menu-popup-padding)"
5329
+ childList: "grid px-0 py-(--menu-popup-padding)",
5330
+ linkLabel: "hidden",
5331
+ linkTrailing: "hidden"
5306
5332
  }
5307
5333
  },
5308
5334
  {
@@ -5312,21 +5338,6 @@ const navigationMenu = {
5312
5338
  link: "collapsed data-[state=open]:-mt-(--leftmenu-group-stroke-weight) data-[state=open]:-mx-(--leftmenu-group-stroke-weight)"
5313
5339
  }
5314
5340
  },
5315
- // {
5316
- // orientation: 'horizontal',
5317
- // class: {
5318
- // link: ['after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full', 'after:transition-colors']
5319
- // }
5320
- // },
5321
- // endregion ////
5322
- // region vertical ////
5323
- // {
5324
- // orientation: 'vertical',
5325
- // level: true,
5326
- // class: {
5327
- // link: ['after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-[7px] after:rounded-full', 'after:transition-colors']
5328
- // }
5329
- // },
5330
5341
  // endregion ////
5331
5342
  // region pill ////
5332
5343
  {
@@ -6541,8 +6552,10 @@ const radioGroup = {
6541
6552
  },
6542
6553
  disabled: {
6543
6554
  true: {
6544
- base: "cursor-not-allowed opacity-30",
6545
- label: "cursor-not-allowed opacity-30"
6555
+ item: "opacity-30",
6556
+ base: "cursor-not-allowed",
6557
+ label: "cursor-not-allowed",
6558
+ description: "cursor-not-allowed"
6546
6559
  }
6547
6560
  },
6548
6561
  required: {
@@ -6622,8 +6635,15 @@ const radioGroup = {
6622
6635
  item: "first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)",
6623
6636
  fieldset: "gap-0 -space-y-px"
6624
6637
  }
6625
- }
6638
+ },
6626
6639
  // endregion ////
6640
+ {
6641
+ variant: ["card", "table"],
6642
+ disabled: true,
6643
+ class: {
6644
+ item: "cursor-not-allowed"
6645
+ }
6646
+ }
6627
6647
  ],
6628
6648
  defaultVariants: {
6629
6649
  color: "air-primary",
@@ -7663,9 +7683,10 @@ const _switch = {
7663
7683
  },
7664
7684
  disabled: {
7665
7685
  true: {
7666
- base: "cursor-not-allowed opacity-30",
7667
- label: "cursor-not-allowed opacity-30",
7668
- description: "cursor-not-allowed opacity-30"
7686
+ root: "opacity-30",
7687
+ base: "cursor-not-allowed",
7688
+ label: "cursor-not-allowed",
7689
+ description: "cursor-not-allowed"
7669
7690
  }
7670
7691
  }
7671
7692
  },
@@ -10125,7 +10146,18 @@ const contentSearch = {
10125
10146
  const contentSearchButton = {
10126
10147
  slots: {
10127
10148
  base: "",
10149
+ baseLine: "",
10150
+ label: "",
10128
10151
  trailing: "hidden lg:flex items-center gap-0.5 ms-auto"
10152
+ },
10153
+ variants: {
10154
+ collapsed: {
10155
+ true: {
10156
+ baseLine: "ps-[5px] pe-[5px]",
10157
+ label: "hidden",
10158
+ trailing: "lg:hidden"
10159
+ }
10160
+ }
10129
10161
  }
10130
10162
  };
10131
10163
 
@@ -10343,8 +10375,12 @@ function getTemplates(options, uiConfig, nuxt, resolve) {
10343
10375
  async function generateSources() {
10344
10376
  let sources = "";
10345
10377
  if (!!nuxt && !!resolve && options.experimental?.componentDetection) {
10346
- const detectedComponents = await detectUsedComponents(
10378
+ const dirs = [.../* @__PURE__ */ new Set([
10347
10379
  nuxt.options.rootDir,
10380
+ ...nuxt.options._layers?.map((layer) => layer.config.rootDir).filter(Boolean) || []
10381
+ ])];
10382
+ const detectedComponents = await detectUsedComponents(
10383
+ dirs,
10348
10384
  "B24",
10349
10385
  resolve("./runtime/components"),
10350
10386
  Array.isArray(options.experimental.componentDetection) ? options.experimental.componentDetection : void 0
package/dist/unplugin.mjs CHANGED
@@ -3,7 +3,7 @@ import { join, normalize } from 'pathe';
3
3
  import { createUnplugin } from 'unplugin';
4
4
  import { defu } from 'defu';
5
5
  import tailwind from '@tailwindcss/vite';
6
- import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.mq1NUekN.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.Dspx5yCK.mjs';
7
7
  import fs from 'node:fs';
8
8
  import path from 'node:path';
9
9
  import MagicString from 'magic-string';
package/dist/vite.mjs CHANGED
@@ -4,7 +4,7 @@ import 'pathe';
4
4
  import 'unplugin';
5
5
  import 'defu';
6
6
  import '@tailwindcss/vite';
7
- import './shared/b24ui-nuxt.mq1NUekN.mjs';
7
+ import './shared/b24ui-nuxt.Dspx5yCK.mjs';
8
8
  import 'scule';
9
9
  import 'knitwork';
10
10
  import '@nuxt/kit';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitrix24/b24ui-nuxt",
3
3
  "description": "Bitrix24 UI-Kit for developing web applications REST API for NUXT & VUE",
4
- "version": "2.1.3",
4
+ "version": "2.1.5",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"
@@ -1,12 +0,0 @@
1
- import type { ButtonProps } from '../../../types';
2
- export interface ColorModeButtonProps extends Omit<ButtonProps, 'color'> {
3
- /**
4
- * @defaultValue 'air-tertiary-no-accent'
5
- */
6
- color?: ButtonProps['color'];
7
- }
8
- declare const __VLS_export: import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
9
- color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
10
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const _default: typeof __VLS_export;
12
- export default _default;
@@ -1,83 +0,0 @@
1
- <script>
2
-
3
- </script>
4
-
5
- <script setup>
6
- import { computed } from "vue";
7
- import { useForwardProps } from "reka-ui";
8
- import { reactiveOmit } from "@vueuse/core";
9
- import { useColorMode } from "#imports";
10
- import { useLocale } from "../../../composables/useLocale";
11
- import icons from "../../../dictionary/icons";
12
- import B24Button from "../../../components/Button.vue";
13
- defineOptions({ inheritAttrs: false });
14
- const props = defineProps({
15
- color: { type: null, required: false, default: "air-tertiary-no-accent" },
16
- label: { type: String, required: false },
17
- activeColor: { type: null, required: false },
18
- depth: { type: null, required: false },
19
- activeDepth: { type: null, required: false },
20
- size: { type: null, required: false },
21
- rounded: { type: Boolean, required: false },
22
- block: { type: Boolean, required: false },
23
- loadingAuto: { type: Boolean, required: false },
24
- normalCase: { type: Boolean, required: false },
25
- useWait: { type: Boolean, required: false },
26
- useClock: { type: Boolean, required: false },
27
- useDropdown: { type: Boolean, required: false },
28
- onClick: { type: [Function, Array], required: false },
29
- class: { type: null, required: false },
30
- activeClass: { type: String, required: false },
31
- inactiveClass: { type: String, required: false },
32
- b24ui: { type: null, required: false },
33
- icon: { type: [Function, Object], required: false },
34
- avatar: { type: Object, required: false },
35
- loading: { type: Boolean, required: false },
36
- as: { type: null, required: false },
37
- type: { type: null, required: false },
38
- disabled: { type: Boolean, required: false },
39
- active: { type: Boolean, required: false },
40
- exact: { type: Boolean, required: false },
41
- exactQuery: { type: [Boolean, String], required: false },
42
- exactHash: { type: Boolean, required: false },
43
- isAction: { type: Boolean, required: false },
44
- to: { type: null, required: false },
45
- href: { type: null, required: false },
46
- external: { type: Boolean, required: false },
47
- target: { type: [String, Object, null], required: false },
48
- rel: { type: [String, Object, null], required: false },
49
- noRel: { type: Boolean, required: false },
50
- prefetchedClass: { type: String, required: false },
51
- prefetch: { type: Boolean, required: false },
52
- prefetchOn: { type: [String, Object], required: false },
53
- noPrefetch: { type: Boolean, required: false },
54
- trailingSlash: { type: String, required: false },
55
- exactActiveClass: { type: String, required: false },
56
- ariaCurrentValue: { type: String, required: false },
57
- viewTransition: { type: Boolean, required: false },
58
- replace: { type: Boolean, required: false }
59
- });
60
- const { t } = useLocale();
61
- const colorMode = useColorMode();
62
- const buttonProps = useForwardProps(reactiveOmit(props, "icon"));
63
- const isDark = computed({
64
- get() {
65
- return colorMode.value === "dark";
66
- },
67
- set(_isDark) {
68
- colorMode.preference = _isDark ? "dark" : "light";
69
- }
70
- });
71
- </script>
72
-
73
- <template>
74
- <B24Button
75
- v-bind="{
76
- ...buttonProps,
77
- 'icon': props.icon || (isDark ? icons.dark : icons.light),
78
- 'aria-label': isDark ? t('colorMode.switchToLight') : t('colorMode.switchToDark'),
79
- ...$attrs
80
- }"
81
- @click="isDark = !isDark"
82
- />
83
- </template>
@@ -1,12 +0,0 @@
1
- import type { ButtonProps } from '../../../types';
2
- export interface ColorModeButtonProps extends Omit<ButtonProps, 'color'> {
3
- /**
4
- * @defaultValue 'air-tertiary-no-accent'
5
- */
6
- color?: ButtonProps['color'];
7
- }
8
- declare const __VLS_export: import("vue").DefineComponent<ColorModeButtonProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<ColorModeButtonProps> & Readonly<{}>, {
9
- color: "default" | "link" | "air-primary" | "air-primary-success" | "air-primary-alert" | "air-primary-copilot" | "air-secondary" | "air-secondary-accent" | "air-secondary-accent-1" | "air-tertiary" | "danger" | "success" | "warning" | "primary" | "secondary" | "collab" | "ai" | "air-secondary-alert" | "air-secondary-accent-2" | "air-secondary-no-accent" | "air-tertiary-accent" | "air-tertiary-no-accent" | "air-selection" | "air-boost";
10
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const _default: typeof __VLS_export;
12
- export default _default;