@bitrix24/b24ui-nuxt 2.1.4 → 2.1.6

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.
@@ -27,6 +27,10 @@ export interface LinkProps extends Partial<Omit<InertiaLinkProps, 'href' | 'onCl
27
27
  * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
28
28
  */
29
29
  rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
30
+ /**
31
+ * If set to true, no rel attribute will be added to the link
32
+ */
33
+ noRel?: boolean;
30
34
  /**
31
35
  * Value passed to the attribute `aria-current` when the link is exact active.
32
36
  *
@@ -61,8 +65,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
61
65
  as: any;
62
66
  type: "reset" | "submit" | "button";
63
67
  active: boolean;
64
- activeClass: string;
65
- inactiveClass: string;
68
+ ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
66
69
  isAction: boolean;
67
70
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
68
71
  declare const _default: typeof __VLS_export;
@@ -6,6 +6,7 @@ export interface LinkBaseProps {
6
6
  onClick?: ((e: MouseEvent) => void | Promise<void>) | Array<((e: MouseEvent) => void | Promise<void>)>;
7
7
  href?: string;
8
8
  target?: LinkProps['target'];
9
+ rel?: LinkProps['rel'];
9
10
  active?: boolean;
10
11
  isExternal?: boolean;
11
12
  }
@@ -13,6 +13,7 @@ const props = defineProps({
13
13
  onClick: { type: [Function, Array], required: false },
14
14
  href: { type: String, required: false },
15
15
  target: { type: [String, Object, null], required: false },
16
+ rel: { type: [String, Object, null], required: false },
16
17
  active: { type: Boolean, required: false },
17
18
  isExternal: { type: Boolean, required: false }
18
19
  });
@@ -35,7 +36,8 @@ function onClickWrapper(e) {
35
36
  v-if="!!href && !isExternal && !disabled"
36
37
  :href="href"
37
38
  v-bind="{
38
- target: target || (isExternal ? '_blank' : void 0),
39
+ rel,
40
+ target,
39
41
  ...$attrs
40
42
  }"
41
43
  @click="onClickWrapper"
@@ -50,7 +52,8 @@ function onClickWrapper(e) {
50
52
  'aria-disabled': disabled ? 'true' : void 0,
51
53
  'role': disabled ? 'link' : void 0,
52
54
  'tabindex': disabled ? -1 : void 0,
53
- 'target': target || (isExternal ? '_blank' : void 0),
55
+ 'rel': rel,
56
+ 'target': target,
54
57
  ...$attrs
55
58
  } : as === 'button' ? {
56
59
  as,
@@ -6,6 +6,7 @@ export interface LinkBaseProps {
6
6
  onClick?: ((e: MouseEvent) => void | Promise<void>) | Array<((e: MouseEvent) => void | Promise<void>)>;
7
7
  href?: string;
8
8
  target?: LinkProps['target'];
9
+ rel?: LinkProps['rel'];
9
10
  active?: boolean;
10
11
  isExternal?: boolean;
11
12
  }
@@ -22,6 +22,10 @@ export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /**
22
22
  * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
23
23
  */
24
24
  rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
25
+ /**
26
+ * If set to true, no rel attribute will be added to the link
27
+ */
28
+ noRel?: boolean;
25
29
  /**
26
30
  * The type of the button when not a link.
27
31
  * @defaultValue 'button'
@@ -54,9 +58,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
54
58
  as: any;
55
59
  type: "reset" | "submit" | "button";
56
60
  active: boolean;
57
- activeClass: string;
58
61
  ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
59
- inactiveClass: string;
60
62
  isAction: boolean;
61
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
62
64
  declare const _default: typeof __VLS_export;
@@ -12,6 +12,7 @@ import { hasProtocol } from "ufo";
12
12
  import { useRoute, RouterLink } from "vue-router";
13
13
  import { useAppConfig } from "#imports";
14
14
  import { tv } from "../../utils/tv";
15
+ import { mergeClasses } from "../../utils";
15
16
  import { isPartiallyEqual } from "../../utils/link";
16
17
  import B24LinkBase from "../../components/LinkBase.vue";
17
18
  defineOptions({ inheritAttrs: false });
@@ -21,18 +22,19 @@ const props = defineProps({
21
22
  external: { type: Boolean, required: false },
22
23
  target: { type: [String, Object, null], required: false },
23
24
  rel: { type: [String, Object, null], required: false },
25
+ noRel: { type: Boolean, required: false },
24
26
  type: { type: null, required: false, default: "button" },
25
27
  disabled: { type: Boolean, required: false },
26
28
  active: { type: Boolean, required: false, default: void 0 },
27
29
  exact: { type: Boolean, required: false },
28
30
  exactQuery: { type: [Boolean, String], required: false },
29
31
  exactHash: { type: Boolean, required: false },
30
- inactiveClass: { type: String, required: false, default: "" },
32
+ inactiveClass: { type: String, required: false },
31
33
  custom: { type: Boolean, required: false },
32
34
  isAction: { type: Boolean, required: false, default: false },
33
35
  raw: { type: Boolean, required: false },
34
36
  class: { type: null, required: false },
35
- activeClass: { type: String, required: false, default: "" },
37
+ activeClass: { type: String, required: false },
36
38
  exactActiveClass: { type: String, required: false },
37
39
  ariaCurrentValue: { type: String, required: false, default: "page" },
38
40
  viewTransition: { type: Boolean, required: false },
@@ -42,23 +44,20 @@ const props = defineProps({
42
44
  defineSlots();
43
45
  const route = useRoute();
44
46
  const appConfig = useAppConfig();
45
- const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class"));
47
+ const routerLinkProps = useForwardProps(reactiveOmit(props, "as", "type", "disabled", "active", "exact", "exactQuery", "exactHash", "activeClass", "inactiveClass", "to", "href", "raw", "custom", "class", "noRel"));
46
48
  const b24ui = computed(() => tv({
47
49
  extend: tv(theme),
48
50
  ...defu({
49
51
  variants: {
50
52
  active: {
51
- true: props.activeClass,
52
- false: props.inactiveClass
53
+ true: mergeClasses(appConfig.b24ui?.link?.variants?.active?.true, props.activeClass),
54
+ false: mergeClasses(appConfig.b24ui?.link?.variants?.active?.false, props.inactiveClass)
53
55
  }
54
56
  }
55
57
  }, appConfig.b24ui?.link || {})
56
58
  }));
57
59
  const to = computed(() => props.to ?? props.href);
58
60
  const isExternal = computed(() => {
59
- if (props.target === "_blank") {
60
- return true;
61
- }
62
61
  if (props.external) {
63
62
  return true;
64
63
  }
@@ -67,6 +66,19 @@ const isExternal = computed(() => {
67
66
  }
68
67
  return typeof to.value === "string" && hasProtocol(to.value, { acceptRelative: true });
69
68
  });
69
+ const hasTarget = computed(() => !!props.target && props.target !== "_self");
70
+ const rel = computed(() => {
71
+ if (props.noRel) {
72
+ return null;
73
+ }
74
+ if (props.rel !== void 0) {
75
+ return props.rel || null;
76
+ }
77
+ if (isExternal.value || hasTarget.value) {
78
+ return "noopener noreferrer";
79
+ }
80
+ return null;
81
+ });
70
82
  function isLinkActive({ route: linkRoute, isActive, isExactActive }) {
71
83
  if (props.active !== void 0) {
72
84
  return props.active;
@@ -115,9 +127,11 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
115
127
  as,
116
128
  type,
117
129
  disabled,
118
- target: props.target ? props.target : void 0,
119
130
  href,
120
131
  navigate,
132
+ rel,
133
+ target,
134
+ isExternal,
121
135
  active: isLinkActive({ route: linkRoute, isActive, isExactActive })
122
136
  }"
123
137
  />
@@ -131,7 +145,10 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
131
145
  type,
132
146
  disabled,
133
147
  href,
134
- navigate
148
+ navigate,
149
+ rel,
150
+ target,
151
+ isExternal
135
152
  }"
136
153
  :class="resolveLinkClass({ route: linkRoute, isActive, isExactActive })"
137
154
  >
@@ -149,7 +166,8 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
149
166
  type,
150
167
  disabled,
151
168
  href: to,
152
- target: isExternal ? '_blank' : void 0,
169
+ rel,
170
+ target,
153
171
  active,
154
172
  isExternal
155
173
  }"
@@ -163,7 +181,8 @@ function resolveLinkClass({ route: route2, isActive, isExactActive } = {}) {
163
181
  type,
164
182
  disabled,
165
183
  href: to,
166
- target: isExternal ? '_blank' : void 0,
184
+ rel,
185
+ target,
167
186
  isExternal
168
187
  }"
169
188
  :class="resolveLinkClass()"
@@ -22,6 +22,10 @@ export interface LinkProps extends Partial<Omit<RouterLinkProps, 'custom'>>, /**
22
22
  * A rel attribute value to apply on the link. Defaults to "noopener noreferrer" for external links.
23
23
  */
24
24
  rel?: 'noopener' | 'noreferrer' | 'nofollow' | 'sponsored' | 'ugc' | (string & {}) | null;
25
+ /**
26
+ * If set to true, no rel attribute will be added to the link
27
+ */
28
+ noRel?: boolean;
25
29
  /**
26
30
  * The type of the button when not a link.
27
31
  * @defaultValue 'button'
@@ -54,9 +58,7 @@ declare const __VLS_export: __VLS_WithSlots<import("vue").DefineComponent<LinkPr
54
58
  as: any;
55
59
  type: "reset" | "submit" | "button";
56
60
  active: boolean;
57
- activeClass: string;
58
61
  ariaCurrentValue: "page" | "step" | "location" | "date" | "time" | "true" | "false";
59
- inactiveClass: string;
60
62
  isAction: boolean;
61
63
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>, LinkSlots>;
62
64
  declare const _default: typeof __VLS_export;
@@ -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.4";
11
+ const version = "2.1.6";
12
12
 
13
13
  function getDefaultConfig(theme) {
14
14
  return {
@@ -1937,9 +1937,10 @@ const checkbox = {
1937
1937
  },
1938
1938
  disabled: {
1939
1939
  true: {
1940
- base: "cursor-not-allowed opacity-30",
1941
- label: "cursor-not-allowed opacity-30",
1942
- 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"
1943
1944
  }
1944
1945
  },
1945
1946
  checked: {
@@ -1964,8 +1965,15 @@ const checkbox = {
1964
1965
  class: {
1965
1966
  root: "border-(--b24ui-border-color) cursor-pointer"
1966
1967
  }
1967
- }
1968
+ },
1968
1969
  // endregion ////
1970
+ {
1971
+ variant: "card",
1972
+ disabled: true,
1973
+ class: {
1974
+ root: "cursor-not-allowed"
1975
+ }
1976
+ }
1969
1977
  ],
1970
1978
  defaultVariants: {
1971
1979
  color: "air-primary",
@@ -2054,11 +2062,7 @@ const checkboxGroup = {
2054
2062
  }
2055
2063
  },
2056
2064
  disabled: {
2057
- true: {
2058
- base: "cursor-not-allowed opacity-30",
2059
- label: "cursor-not-allowed opacity-30",
2060
- item: "cursor-not-allowed opacity-30"
2061
- }
2065
+ true: {}
2062
2066
  },
2063
2067
  required: {
2064
2068
  true: {
@@ -2137,8 +2141,15 @@ const checkboxGroup = {
2137
2141
  item: "first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)",
2138
2142
  fieldset: "gap-0 -space-y-px"
2139
2143
  }
2140
- }
2144
+ },
2141
2145
  // endregion ////
2146
+ {
2147
+ variant: "table",
2148
+ disabled: true,
2149
+ class: {
2150
+ item: "cursor-not-allowed"
2151
+ }
2152
+ }
2142
2153
  ],
2143
2154
  defaultVariants: {
2144
2155
  size: "md",
@@ -2742,7 +2753,18 @@ const dashboardSearch = {
2742
2753
  const dashboardSearchButton = {
2743
2754
  slots: {
2744
2755
  base: "",
2756
+ baseLine: "",
2757
+ label: "",
2745
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
+ }
2746
2768
  }
2747
2769
  };
2748
2770
 
@@ -5304,7 +5326,9 @@ const navigationMenu = {
5304
5326
  orientation: "vertical",
5305
5327
  collapsed: true,
5306
5328
  class: {
5307
- childList: "grid px-0 py-(--menu-popup-padding)"
5329
+ childList: "grid px-0 py-(--menu-popup-padding)",
5330
+ linkLabel: "hidden",
5331
+ linkTrailing: "hidden"
5308
5332
  }
5309
5333
  },
5310
5334
  {
@@ -5314,21 +5338,6 @@ const navigationMenu = {
5314
5338
  link: "collapsed data-[state=open]:-mt-(--leftmenu-group-stroke-weight) data-[state=open]:-mx-(--leftmenu-group-stroke-weight)"
5315
5339
  }
5316
5340
  },
5317
- // {
5318
- // orientation: 'horizontal',
5319
- // class: {
5320
- // link: ['after:absolute after:-bottom-2 after:inset-x-2.5 after:block after:h-px after:rounded-full', 'after:transition-colors']
5321
- // }
5322
- // },
5323
- // endregion ////
5324
- // region vertical ////
5325
- // {
5326
- // orientation: 'vertical',
5327
- // level: true,
5328
- // class: {
5329
- // link: ['after:absolute after:-start-1.5 after:inset-y-0.5 after:block after:w-[7px] after:rounded-full', 'after:transition-colors']
5330
- // }
5331
- // },
5332
5341
  // endregion ////
5333
5342
  // region pill ////
5334
5343
  {
@@ -6543,8 +6552,10 @@ const radioGroup = {
6543
6552
  },
6544
6553
  disabled: {
6545
6554
  true: {
6546
- base: "cursor-not-allowed opacity-30",
6547
- 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"
6548
6559
  }
6549
6560
  },
6550
6561
  required: {
@@ -6624,8 +6635,15 @@ const radioGroup = {
6624
6635
  item: "first-of-type:rounded-t-(--ui-border-radius-md) last-of-type:rounded-b-(--ui-border-radius-md)",
6625
6636
  fieldset: "gap-0 -space-y-px"
6626
6637
  }
6627
- }
6638
+ },
6628
6639
  // endregion ////
6640
+ {
6641
+ variant: ["card", "table"],
6642
+ disabled: true,
6643
+ class: {
6644
+ item: "cursor-not-allowed"
6645
+ }
6646
+ }
6629
6647
  ],
6630
6648
  defaultVariants: {
6631
6649
  color: "air-primary",
@@ -7665,9 +7683,10 @@ const _switch = {
7665
7683
  },
7666
7684
  disabled: {
7667
7685
  true: {
7668
- base: "cursor-not-allowed opacity-30",
7669
- label: "cursor-not-allowed opacity-30",
7670
- 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"
7671
7690
  }
7672
7691
  }
7673
7692
  },
@@ -10127,7 +10146,18 @@ const contentSearch = {
10127
10146
  const contentSearchButton = {
10128
10147
  slots: {
10129
10148
  base: "",
10149
+ baseLine: "",
10150
+ label: "",
10130
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
+ }
10131
10161
  }
10132
10162
  };
10133
10163
 
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.Bs0V9FLV.mjs';
6
+ import { g as getTemplates, d as defaultOptions, a as getDefaultConfig } from './shared/b24ui-nuxt.DwYJyZL6.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.Bs0V9FLV.mjs';
7
+ import './shared/b24ui-nuxt.DwYJyZL6.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.4",
4
+ "version": "2.1.6",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "git+https://github.com/bitrix24/b24ui.git"