@uzum-tech/ui 1.12.13 → 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.
package/dist/index.js CHANGED
@@ -2194,19 +2194,6 @@
2194
2194
  });
2195
2195
  }
2196
2196
 
2197
- function useBreakpoint(screens) {
2198
- if (!isBrowser$1) return vue.computed(() => undefined);
2199
- // pass ts check
2200
- const breakpointsRef = screens !== undefined ? useBreakpoints(screens) : useBreakpoints();
2201
- return vue.computed(() => {
2202
- const {
2203
- value
2204
- } = breakpointsRef;
2205
- if (value.length === 0) return undefined;
2206
- return value[value.length - 1];
2207
- });
2208
- }
2209
-
2210
2197
  function useKeyboard$1(options = {}, enabledRef) {
2211
2198
  const state = vue.reactive({
2212
2199
  ctrl: false,
@@ -18224,7 +18211,7 @@
18224
18211
  "path",
18225
18212
  {
18226
18213
  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",
18227
- stroke: "#101010",
18214
+ stroke: "currentColor",
18228
18215
  "stroke-width": "1.66667",
18229
18216
  "stroke-linecap": "round",
18230
18217
  "stroke-linejoin": "round"
@@ -61999,6 +61986,10 @@
61999
61986
  breakpoints: Object,
62000
61987
  breakpointProps: Object,
62001
61988
  breakpointThemeOverrides: Object,
61989
+ breakpointMode: {
61990
+ type: String,
61991
+ default: "desktop-first"
61992
+ },
62002
61993
  preflightStyleDisabled: Boolean,
62003
61994
  inlineThemeDisabled: {
62004
61995
  type: Boolean,
@@ -62024,34 +62015,64 @@
62024
62015
  const {
62025
62016
  theme
62026
62017
  } = props;
62027
- if (theme === null) return void 0;
62018
+ if (theme === null) return;
62028
62019
  const inheritedTheme = UConfigProvider?.mergedThemeRef.value;
62029
62020
  return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
62030
62021
  });
62031
- const getActiveBreakpointValue = breakpointMap => {
62032
- if (!breakpointMap || !isBrowser$2) {
62033
- return void 0;
62022
+ const mergedBreakpointModeRef = vue.computed(() => {
62023
+ const {
62024
+ breakpointMode
62025
+ } = props;
62026
+ return breakpointMode || UConfigProvider?.mergedBreakpointModeRef.value || "desktop-first";
62027
+ });
62028
+ const getMergedBreakpointValues = breakpointMap => {
62029
+ if (!breakpointMap) return;
62030
+ const breakpointWidths = Object.keys(breakpointMap).map(Number).sort((leftWidth, rightWidth) => leftWidth - rightWidth);
62031
+ const mergedMap = {};
62032
+ let previousValue;
62033
+ for (const width of breakpointWidths) {
62034
+ if (previousValue !== void 0) {
62035
+ mergedMap[width] = lodashExports.merge({}, previousValue, breakpointMap[width]);
62036
+ } else {
62037
+ mergedMap[width] = breakpointMap[width];
62038
+ }
62039
+ previousValue = mergedMap[width];
62034
62040
  }
62041
+ return mergedMap;
62042
+ };
62043
+ const getActiveBreakpointValue = (breakpointMap, mode = "desktop-first") => {
62044
+ if (!breakpointMap || !isBrowser$2) return;
62045
+ const mergedMap = getMergedBreakpointValues(breakpointMap);
62046
+ if (!mergedMap) return;
62035
62047
  const currentWidth = windowWidthRef.value;
62036
- const breakpointWidths = Object.keys(breakpointMap).map(Number).filter(width => width <= currentWidth).sort((a, b) => b - a);
62037
- if (breakpointWidths.length === 0) {
62038
- return void 0;
62048
+ const breakpointWidths = Object.keys(mergedMap).map(Number).sort((leftWidth, rightWidth) => leftWidth - rightWidth);
62049
+ let matchingBreakpoints;
62050
+ if (mode === "mobile-first") {
62051
+ matchingBreakpoints = breakpointWidths.filter(width => width >= currentWidth);
62052
+ if (matchingBreakpoints.length === 0) {
62053
+ matchingBreakpoints = [breakpointWidths[breakpointWidths.length - 1]];
62054
+ }
62055
+ } else {
62056
+ matchingBreakpoints = breakpointWidths.filter(width => width <= currentWidth).reverse();
62057
+ if (matchingBreakpoints.length === 0) {
62058
+ matchingBreakpoints = [breakpointWidths[0]];
62059
+ }
62039
62060
  }
62040
- const activeBreakpoint = breakpointWidths[0];
62041
- return breakpointMap[activeBreakpoint];
62061
+ const activeBreakpoint = matchingBreakpoints[0];
62062
+ return mergedMap[activeBreakpoint];
62042
62063
  };
62043
- const activeBreakPointThemeOverridesRef = vue.computed(() => {
62064
+ const activeBreakpointThemeOverridesRef = vue.computed(() => {
62044
62065
  const {
62045
62066
  breakpointThemeOverrides
62046
62067
  } = props;
62047
62068
  const breakpointThemeOverridesToUse = breakpointThemeOverrides ?? UConfigProvider?.mergedBreakpointThemeOverridesRef.value;
62048
- return getActiveBreakpointValue(breakpointThemeOverridesToUse);
62069
+ return getActiveBreakpointValue(breakpointThemeOverridesToUse, mergedBreakpointModeRef.value);
62049
62070
  });
62050
62071
  const mergedThemeOverridesRef = vue.computed(() => {
62051
62072
  const {
62052
62073
  themeOverrides
62053
62074
  } = props;
62054
- if (themeOverrides === null) return void 0;
62075
+ if (themeOverrides === null) return;
62055
62076
  let baseThemeOverrides;
62056
62077
  if (themeOverrides === void 0) {
62057
62078
  baseThemeOverrides = UConfigProvider?.mergedThemeOverridesRef.value;
@@ -62063,14 +62084,14 @@
62063
62084
  baseThemeOverrides = lodashExports.merge({}, inheritedThemeOverrides, themeOverrides);
62064
62085
  }
62065
62086
  }
62066
- const activeBreakPointThemeOverrides = activeBreakPointThemeOverridesRef.value;
62067
- if (!activeBreakPointThemeOverrides) {
62087
+ const activeBreakpointThemeOverrides = activeBreakpointThemeOverridesRef.value;
62088
+ if (!activeBreakpointThemeOverrides) {
62068
62089
  return baseThemeOverrides;
62069
62090
  }
62070
62091
  if (!baseThemeOverrides) {
62071
- return activeBreakPointThemeOverrides;
62092
+ return activeBreakpointThemeOverrides;
62072
62093
  }
62073
- return lodashExports.merge({}, baseThemeOverrides, activeBreakPointThemeOverrides);
62094
+ return lodashExports.merge({}, baseThemeOverrides, activeBreakpointThemeOverrides);
62074
62095
  });
62075
62096
  const mergedNamespaceRef = useMemo(() => {
62076
62097
  const {
@@ -62107,26 +62128,26 @@
62107
62128
  window.removeEventListener("resize", updateWindowWidth);
62108
62129
  }
62109
62130
  });
62110
- const activeBreakPointPropsRef = vue.computed(() => {
62131
+ const activeBreakpointPropsRef = vue.computed(() => {
62111
62132
  const {
62112
62133
  breakpointProps
62113
62134
  } = props;
62114
62135
  const breakpointPropsToUse = breakpointProps ?? UConfigProvider?.mergedBreakpointPropsRef.value;
62115
- return getActiveBreakpointValue(breakpointPropsToUse);
62136
+ return getActiveBreakpointValue(breakpointPropsToUse, mergedBreakpointModeRef.value);
62116
62137
  });
62117
62138
  const mergedComponentPropsRef = vue.computed(() => {
62118
62139
  const {
62119
62140
  componentOptions
62120
62141
  } = props;
62121
62142
  const baseComponentOptions = componentOptions !== void 0 ? componentOptions : UConfigProvider?.mergedComponentPropsRef.value;
62122
- const activeBreakPointProps = activeBreakPointPropsRef.value;
62123
- if (!activeBreakPointProps) {
62143
+ const activeBreakpointProps = activeBreakpointPropsRef.value;
62144
+ if (!activeBreakpointProps) {
62124
62145
  return baseComponentOptions;
62125
62146
  }
62126
62147
  if (!baseComponentOptions) {
62127
- return activeBreakPointProps;
62148
+ return activeBreakpointProps;
62128
62149
  }
62129
- return lodashExports.merge({}, baseComponentOptions, activeBreakPointProps);
62150
+ return lodashExports.merge({}, baseComponentOptions, activeBreakpointProps);
62130
62151
  });
62131
62152
  const mergedClsPrefixRef = vue.computed(() => {
62132
62153
  const {
@@ -62200,6 +62221,9 @@
62200
62221
  mergedComponentPropsRef,
62201
62222
  mergedBreakpointPropsRef,
62202
62223
  mergedBreakpointThemeOverridesRef,
62224
+ mergedBreakpointModeRef,
62225
+ activeBreakpointPropsRef,
62226
+ activeBreakpointThemeOverridesRef,
62203
62227
  mergedBorderedRef,
62204
62228
  mergedNamespaceRef,
62205
62229
  mergedClsPrefixRef,
@@ -62207,14 +62231,14 @@
62207
62231
  const {
62208
62232
  locale
62209
62233
  } = props;
62210
- if (locale === null) return void 0;
62234
+ if (locale === null) return;
62211
62235
  return locale === void 0 ? UConfigProvider?.mergedLocaleRef.value : locale;
62212
62236
  }),
62213
62237
  mergedDateLocaleRef: vue.computed(() => {
62214
62238
  const {
62215
62239
  dateLocale
62216
62240
  } = props;
62217
- if (dateLocale === null) return void 0;
62241
+ if (dateLocale === null) return;
62218
62242
  return dateLocale === void 0 ? UConfigProvider?.mergedDateLocaleRef.value : dateLocale;
62219
62243
  }),
62220
62244
  mergedHljsRef: vue.computed(() => {
@@ -124563,12 +124587,12 @@
124563
124587
  `), cE("logo", [c$1("img", `
124564
124588
  max-height: 24px;
124565
124589
  `)])]), cM("desktop", [cE("inner-wrapper", `
124566
- width: 1300px;
124590
+ width: 100%;
124591
+ max-width: 1300px;
124567
124592
  box-sizing: border-box;
124568
124593
  display: flex;
124569
124594
  align-items: center;
124570
124595
  justify-content: space-between;
124571
- gap: var(--u-header-navigation-gap);
124572
124596
  padding: 0;
124573
124597
  position: relative;
124574
124598
  height: 80px;
@@ -124577,12 +124601,14 @@
124577
124601
  display: flex;
124578
124602
  align-items: center;
124579
124603
  justify-content: space-between;
124580
- gap: 60px;
124604
+ flex: 1;
124581
124605
  height: 100%;
124582
124606
  `)]), cE("inner", `
124607
+ width: 100%;
124583
124608
  box-sizing: border-box;
124584
124609
  display: flex;
124585
124610
  align-items: center;
124611
+ justify-content: center;
124586
124612
  gap: var(--u-header-navigation-gap);
124587
124613
  padding: 0;
124588
124614
  position: relative;
@@ -124619,7 +124645,6 @@
124619
124645
  position: relative;
124620
124646
  display: inline-flex;
124621
124647
  align-items: center;
124622
- gap: var(--u-header-action-gap);
124623
124648
  flex-shrink: 0;
124624
124649
  height: 100%;
124625
124650
  `, [cE("actions-block", `
@@ -125214,13 +125239,6 @@
125214
125239
  return option.type !== "column";
125215
125240
  }
125216
125241
 
125217
- function useIsMobile() {
125218
- const breakpointRef = useBreakpoint();
125219
- return useMemo(() => {
125220
- return breakpointRef.value === "xs";
125221
- });
125222
- }
125223
-
125224
125242
  const headerNavigationProps = {
125225
125243
  menuOptions: {
125226
125244
  type: Array,
@@ -126495,6 +126513,10 @@
126495
126513
  type: Boolean,
126496
126514
  default: true
126497
126515
  },
126516
+ isMobile: {
126517
+ type: Boolean,
126518
+ default: true
126519
+ },
126498
126520
  mobileMenuType: {
126499
126521
  type: String,
126500
126522
  default: "drawer"
@@ -126546,7 +126568,7 @@
126546
126568
  props,
126547
126569
  mergedClsPrefixRef
126548
126570
  );
126549
- const isMobileRef = useIsMobile();
126571
+ const isMobileRef = props.isMobile;
126550
126572
  const mobileMenuVisibleRef = vue.ref(false);
126551
126573
  const searchVisibleRef = vue.ref(false);
126552
126574
  vue.onBeforeMount(() => {
@@ -128561,7 +128583,7 @@
128561
128583
  watermarkProps: watermarkProps
128562
128584
  });
128563
128585
 
128564
- var version = "1.12.13";
128586
+ var version = "1.12.15";
128565
128587
 
128566
128588
  function useExposeProxy(targetRef) {
128567
128589
  return new Proxy({}, {