@uzum-tech/ui 1.12.14 → 1.12.15

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.
@@ -1,4 +1,4 @@
1
1
  import { h } from 'vue';
2
2
  import { replaceable } from './replaceable';
3
3
  export default replaceable('logout', h("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
4
- h("path", { d: "M16 17L21 12M21 12L16 7M21 12H9M9 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H9", stroke: "#101010", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" })));
4
+ h("path", { d: "M16 17L21 12M21 12L16 7M21 12H9M9 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H9", stroke: "currentColor", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" })));
@@ -97,20 +97,24 @@ export default defineComponent({
97
97
  if (!mergedMap)
98
98
  return;
99
99
  const currentWidth = windowWidthRef.value;
100
- const breakpointWidths = Object.keys(mergedMap).map(Number);
100
+ const breakpointWidths = Object.keys(mergedMap)
101
+ .map(Number)
102
+ .sort((leftWidth, rightWidth) => leftWidth - rightWidth);
101
103
  let matchingBreakpoints;
102
104
  if (mode === 'mobile-first') {
103
- matchingBreakpoints = breakpointWidths
104
- .filter((width) => width >= currentWidth)
105
- .sort((leftWidth, rightWidth) => leftWidth - rightWidth);
105
+ matchingBreakpoints = breakpointWidths.filter((width) => width >= currentWidth);
106
+ if (matchingBreakpoints.length === 0) {
107
+ matchingBreakpoints = [breakpointWidths[breakpointWidths.length - 1]];
108
+ }
106
109
  }
107
110
  else {
108
111
  matchingBreakpoints = breakpointWidths
109
112
  .filter((width) => width <= currentWidth)
110
- .sort((leftWidth, rightWidth) => rightWidth - leftWidth);
113
+ .reverse();
114
+ if (matchingBreakpoints.length === 0) {
115
+ matchingBreakpoints = [breakpointWidths[0]];
116
+ }
111
117
  }
112
- if (matchingBreakpoints.length === 0)
113
- return;
114
118
  const activeBreakpoint = matchingBreakpoints[0];
115
119
  return mergedMap[activeBreakpoint];
116
120
  };
@@ -43,6 +43,10 @@ export declare const headerProps: {
43
43
  type: PropType<HeaderPropsInterface["responsive"]>;
44
44
  default: boolean;
45
45
  };
46
+ isMobile: {
47
+ type: PropType<HeaderPropsInterface["isMobile"]>;
48
+ default: boolean;
49
+ };
46
50
  mobileMenuType: {
47
51
  type: PropType<"drawer" | "dropdown">;
48
52
  default: string;
@@ -213,6 +217,10 @@ declare const _default: import("vue").DefineComponent<{
213
217
  type: PropType<HeaderPropsInterface["responsive"]>;
214
218
  default: boolean;
215
219
  };
220
+ isMobile: {
221
+ type: PropType<HeaderPropsInterface["isMobile"]>;
222
+ default: boolean;
223
+ };
216
224
  mobileMenuType: {
217
225
  type: PropType<"drawer" | "dropdown">;
218
226
  default: string;
@@ -388,7 +396,7 @@ declare const _default: import("vue").DefineComponent<{
388
396
  key: string | number;
389
397
  icon?: (() => import("vue").VNodeChild) | undefined;
390
398
  }>;
391
- isMobile: ComputedRef<boolean>;
399
+ isMobile: boolean | undefined;
392
400
  mobileMenuVisible: import("vue").Ref<boolean>;
393
401
  searchVisible: import("vue").Ref<boolean>;
394
402
  handleSelectLang: (key: string | number) => void;
@@ -448,6 +456,10 @@ declare const _default: import("vue").DefineComponent<{
448
456
  type: PropType<HeaderPropsInterface["responsive"]>;
449
457
  default: boolean;
450
458
  };
459
+ isMobile: {
460
+ type: PropType<HeaderPropsInterface["isMobile"]>;
461
+ default: boolean;
462
+ };
451
463
  mobileMenuType: {
452
464
  type: PropType<"drawer" | "dropdown">;
453
465
  default: string;
@@ -596,6 +608,7 @@ declare const _default: import("vue").DefineComponent<{
596
608
  menuCardMinColumnWidth: string | number | undefined;
597
609
  logoSrc: string | undefined;
598
610
  logoAlt: string | undefined;
611
+ isMobile: boolean | undefined;
599
612
  mobileActionsCollapse: boolean | undefined;
600
613
  mobileShowFooterActions: boolean | undefined;
601
614
  mobilePrimaryActionText: string | undefined;
@@ -14,7 +14,6 @@ import { useConfig, useTheme, useThemeClass } from '../../_mixins';
14
14
  import { headerLight } from '../styles';
15
15
  import { formatLength, resolveWrappedSlot, call } from '../../_utils';
16
16
  import { getMenuItemKey } from './utils';
17
- import { useIsMobile } from '../../_utils/composable/composables';
18
17
  import { UIcon } from '../../icon';
19
18
  import HeaderNavigation from './HeaderNavigation';
20
19
  import HeaderMobile from './mobile/HeaderMobile';
@@ -67,6 +66,9 @@ export const headerProps = Object.assign(Object.assign({}, useTheme.props), { me
67
66
  }, responsive: {
68
67
  type: Boolean,
69
68
  default: true
69
+ }, isMobile: {
70
+ type: Boolean,
71
+ default: true
70
72
  }, mobileMenuType: {
71
73
  type: String,
72
74
  default: 'drawer'
@@ -103,7 +105,7 @@ export default defineComponent({
103
105
  var _a, _b, _c;
104
106
  const { mergedClsPrefixRef } = useConfig(props);
105
107
  const themeRef = useTheme('Header', '-header', style, headerLight, props, mergedClsPrefixRef);
106
- const isMobileRef = useIsMobile();
108
+ const isMobileRef = props.isMobile;
107
109
  const mobileMenuVisibleRef = ref(false);
108
110
  const searchVisibleRef = ref(false);
109
111
  onBeforeMount(() => {
@@ -114,7 +114,7 @@ declare const _default: import("vue").DefineComponent<{
114
114
  readonly onSearchResultSelect: PropType<(result: HeaderSearchResult) => void>;
115
115
  }>>, {
116
116
  readonly responsive: boolean;
117
- readonly mobileActionsCollapse: boolean;
118
117
  readonly isMobile: boolean;
118
+ readonly mobileActionsCollapse: boolean;
119
119
  }, {}>;
120
120
  export default _default;
@@ -16,6 +16,7 @@ export interface HeaderProps {
16
16
  logoAlt?: string;
17
17
  logoProps?: Partial<ImageProps>;
18
18
  responsive?: boolean;
19
+ isMobile?: boolean;
19
20
  mobileMenuType?: 'drawer' | 'dropdown';
20
21
  mobileActionsCollapse?: boolean;
21
22
  mobileShowFooterActions?: boolean;
@@ -17,12 +17,12 @@ export default cB('header', `
17
17
  `), cE('logo', [c('img', `
18
18
  max-height: 24px;
19
19
  `)])]), cM('desktop', [cE('inner-wrapper', `
20
- width: 1300px;
20
+ width: 100%;
21
+ max-width: 1300px;
21
22
  box-sizing: border-box;
22
23
  display: flex;
23
24
  align-items: center;
24
25
  justify-content: space-between;
25
- gap: var(--u-header-navigation-gap);
26
26
  padding: 0;
27
27
  position: relative;
28
28
  height: 80px;
@@ -31,12 +31,14 @@ export default cB('header', `
31
31
  display: flex;
32
32
  align-items: center;
33
33
  justify-content: space-between;
34
- gap: 60px;
34
+ flex: 1;
35
35
  height: 100%;
36
36
  `)]), cE('inner', `
37
+ width: 100%;
37
38
  box-sizing: border-box;
38
39
  display: flex;
39
40
  align-items: center;
41
+ justify-content: center;
40
42
  gap: var(--u-header-navigation-gap);
41
43
  padding: 0;
42
44
  position: relative;
@@ -73,7 +75,6 @@ export default cB('header', `
73
75
  position: relative;
74
76
  display: inline-flex;
75
77
  align-items: center;
76
- gap: var(--u-header-action-gap);
77
78
  flex-shrink: 0;
78
79
  height: 100%;
79
80
  `, [cE('actions-block', `
package/es/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.12.14";
1
+ declare const _default: "1.12.15";
2
2
  export default _default;
package/es/version.js CHANGED
@@ -1 +1 @@
1
- export default '1.12.14';
1
+ export default '1.12.15';
@@ -3,4 +3,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const vue_1 = require("vue");
4
4
  const replaceable_1 = require("./replaceable");
5
5
  exports.default = (0, replaceable_1.replaceable)('logout', (0, vue_1.h)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none" },
6
- (0, vue_1.h)("path", { d: "M16 17L21 12M21 12L16 7M21 12H9M9 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H9", stroke: "#101010", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" })));
6
+ (0, vue_1.h)("path", { d: "M16 17L21 12M21 12L16 7M21 12H9M9 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21H9", stroke: "currentColor", "stroke-width": "1.66667", "stroke-linecap": "round", "stroke-linejoin": "round" })));
@@ -100,20 +100,24 @@ exports.default = (0, vue_1.defineComponent)({
100
100
  if (!mergedMap)
101
101
  return;
102
102
  const currentWidth = windowWidthRef.value;
103
- const breakpointWidths = Object.keys(mergedMap).map(Number);
103
+ const breakpointWidths = Object.keys(mergedMap)
104
+ .map(Number)
105
+ .sort((leftWidth, rightWidth) => leftWidth - rightWidth);
104
106
  let matchingBreakpoints;
105
107
  if (mode === 'mobile-first') {
106
- matchingBreakpoints = breakpointWidths
107
- .filter((width) => width >= currentWidth)
108
- .sort((leftWidth, rightWidth) => leftWidth - rightWidth);
108
+ matchingBreakpoints = breakpointWidths.filter((width) => width >= currentWidth);
109
+ if (matchingBreakpoints.length === 0) {
110
+ matchingBreakpoints = [breakpointWidths[breakpointWidths.length - 1]];
111
+ }
109
112
  }
110
113
  else {
111
114
  matchingBreakpoints = breakpointWidths
112
115
  .filter((width) => width <= currentWidth)
113
- .sort((leftWidth, rightWidth) => rightWidth - leftWidth);
116
+ .reverse();
117
+ if (matchingBreakpoints.length === 0) {
118
+ matchingBreakpoints = [breakpointWidths[0]];
119
+ }
114
120
  }
115
- if (matchingBreakpoints.length === 0)
116
- return;
117
121
  const activeBreakpoint = matchingBreakpoints[0];
118
122
  return mergedMap[activeBreakpoint];
119
123
  };
@@ -43,6 +43,10 @@ export declare const headerProps: {
43
43
  type: PropType<HeaderPropsInterface["responsive"]>;
44
44
  default: boolean;
45
45
  };
46
+ isMobile: {
47
+ type: PropType<HeaderPropsInterface["isMobile"]>;
48
+ default: boolean;
49
+ };
46
50
  mobileMenuType: {
47
51
  type: PropType<"drawer" | "dropdown">;
48
52
  default: string;
@@ -213,6 +217,10 @@ declare const _default: import("vue").DefineComponent<{
213
217
  type: PropType<HeaderPropsInterface["responsive"]>;
214
218
  default: boolean;
215
219
  };
220
+ isMobile: {
221
+ type: PropType<HeaderPropsInterface["isMobile"]>;
222
+ default: boolean;
223
+ };
216
224
  mobileMenuType: {
217
225
  type: PropType<"drawer" | "dropdown">;
218
226
  default: string;
@@ -388,7 +396,7 @@ declare const _default: import("vue").DefineComponent<{
388
396
  key: string | number;
389
397
  icon?: (() => import("vue").VNodeChild) | undefined;
390
398
  }>;
391
- isMobile: ComputedRef<boolean>;
399
+ isMobile: boolean | undefined;
392
400
  mobileMenuVisible: import("vue").Ref<boolean>;
393
401
  searchVisible: import("vue").Ref<boolean>;
394
402
  handleSelectLang: (key: string | number) => void;
@@ -448,6 +456,10 @@ declare const _default: import("vue").DefineComponent<{
448
456
  type: PropType<HeaderPropsInterface["responsive"]>;
449
457
  default: boolean;
450
458
  };
459
+ isMobile: {
460
+ type: PropType<HeaderPropsInterface["isMobile"]>;
461
+ default: boolean;
462
+ };
451
463
  mobileMenuType: {
452
464
  type: PropType<"drawer" | "dropdown">;
453
465
  default: string;
@@ -596,6 +608,7 @@ declare const _default: import("vue").DefineComponent<{
596
608
  menuCardMinColumnWidth: string | number | undefined;
597
609
  logoSrc: string | undefined;
598
610
  logoAlt: string | undefined;
611
+ isMobile: boolean | undefined;
599
612
  mobileActionsCollapse: boolean | undefined;
600
613
  mobileShowFooterActions: boolean | undefined;
601
614
  mobilePrimaryActionText: string | undefined;
@@ -43,7 +43,6 @@ const _mixins_1 = require("../../_mixins");
43
43
  const styles_1 = require("../styles");
44
44
  const _utils_1 = require("../../_utils");
45
45
  const utils_1 = require("./utils");
46
- const composables_1 = require("../../_utils/composable/composables");
47
46
  const icon_1 = require("../../icon");
48
47
  const HeaderNavigation_1 = __importDefault(require("./HeaderNavigation"));
49
48
  const HeaderMobile_1 = __importDefault(require("./mobile/HeaderMobile"));
@@ -96,6 +95,9 @@ exports.headerProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props),
96
95
  }, responsive: {
97
96
  type: Boolean,
98
97
  default: true
98
+ }, isMobile: {
99
+ type: Boolean,
100
+ default: true
99
101
  }, mobileMenuType: {
100
102
  type: String,
101
103
  default: 'drawer'
@@ -132,7 +134,7 @@ exports.default = (0, vue_1.defineComponent)({
132
134
  var _a, _b, _c;
133
135
  const { mergedClsPrefixRef } = (0, _mixins_1.useConfig)(props);
134
136
  const themeRef = (0, _mixins_1.useTheme)('Header', '-header', index_cssr_1.default, styles_1.headerLight, props, mergedClsPrefixRef);
135
- const isMobileRef = (0, composables_1.useIsMobile)();
137
+ const isMobileRef = props.isMobile;
136
138
  const mobileMenuVisibleRef = (0, vue_1.ref)(false);
137
139
  const searchVisibleRef = (0, vue_1.ref)(false);
138
140
  (0, vue_1.onBeforeMount)(() => {
@@ -114,7 +114,7 @@ declare const _default: import("vue").DefineComponent<{
114
114
  readonly onSearchResultSelect: PropType<(result: HeaderSearchResult) => void>;
115
115
  }>>, {
116
116
  readonly responsive: boolean;
117
- readonly mobileActionsCollapse: boolean;
118
117
  readonly isMobile: boolean;
118
+ readonly mobileActionsCollapse: boolean;
119
119
  }, {}>;
120
120
  export default _default;
@@ -16,6 +16,7 @@ export interface HeaderProps {
16
16
  logoAlt?: string;
17
17
  logoProps?: Partial<ImageProps>;
18
18
  responsive?: boolean;
19
+ isMobile?: boolean;
19
20
  mobileMenuType?: 'drawer' | 'dropdown';
20
21
  mobileActionsCollapse?: boolean;
21
22
  mobileShowFooterActions?: boolean;
@@ -23,12 +23,12 @@ exports.default = (0, cssr_1.cB)('header', `
23
23
  `), (0, cssr_1.cE)('logo', [(0, cssr_1.c)('img', `
24
24
  max-height: 24px;
25
25
  `)])]), (0, cssr_1.cM)('desktop', [(0, cssr_1.cE)('inner-wrapper', `
26
- width: 1300px;
26
+ width: 100%;
27
+ max-width: 1300px;
27
28
  box-sizing: border-box;
28
29
  display: flex;
29
30
  align-items: center;
30
31
  justify-content: space-between;
31
- gap: var(--u-header-navigation-gap);
32
32
  padding: 0;
33
33
  position: relative;
34
34
  height: 80px;
@@ -37,12 +37,14 @@ exports.default = (0, cssr_1.cB)('header', `
37
37
  display: flex;
38
38
  align-items: center;
39
39
  justify-content: space-between;
40
- gap: 60px;
40
+ flex: 1;
41
41
  height: 100%;
42
42
  `)]), (0, cssr_1.cE)('inner', `
43
+ width: 100%;
43
44
  box-sizing: border-box;
44
45
  display: flex;
45
46
  align-items: center;
47
+ justify-content: center;
46
48
  gap: var(--u-header-navigation-gap);
47
49
  padding: 0;
48
50
  position: relative;
@@ -79,7 +81,6 @@ exports.default = (0, cssr_1.cB)('header', `
79
81
  position: relative;
80
82
  display: inline-flex;
81
83
  align-items: center;
82
- gap: var(--u-header-action-gap);
83
84
  flex-shrink: 0;
84
85
  height: 100%;
85
86
  `, [(0, cssr_1.cE)('actions-block', `
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.12.14";
1
+ declare const _default: "1.12.15";
2
2
  export default _default;
package/lib/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.default = '1.12.14';
3
+ exports.default = '1.12.15';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "1.12.14",
3
+ "version": "1.12.15",
4
4
  "description": "A Vue 3 Component Library. Fairly Complete, Theme Customizable, Uses TypeScript, Fast",
5
5
  "main": "lib/index.js",
6
6
  "module": "es/index.js",
package/web-types.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
3
3
  "framework": "vue",
4
4
  "name": "@uzum-tech/ui",
5
- "version": "1.12.14",
5
+ "version": "1.12.15",
6
6
  "js-types-syntax": "typescript",
7
7
  "contributions": {
8
8
  "html": {
@@ -18375,6 +18375,11 @@
18375
18375
  "description": "Enable responsive/mobile adaptation.",
18376
18376
  "default": "true"
18377
18377
  },
18378
+ {
18379
+ "name": "is-mobile",
18380
+ "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/header",
18381
+ "type": "boolean"
18382
+ },
18378
18383
  {
18379
18384
  "name": "mobile-menu-type",
18380
18385
  "doc-url": "https://uzum-ui.kapitalbank.uz/en-US/os-theme/components/header",