@uzum-tech/ui 1.1.1 → 1.1.4

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 (63) hide show
  1. package/dist/index.js +396 -255
  2. package/dist/index.prod.js +2 -2
  3. package/es/_resolvers/auto-import/auto-import-resolver.d.ts +5 -0
  4. package/es/_resolvers/auto-import/auto-import-resolver.js +13 -0
  5. package/es/_resolvers/auto-import/auto-import-resolver.types.d.ts +17 -0
  6. package/es/_resolvers/auto-import/auto-import-resolver.types.js +1 -0
  7. package/es/components.d.ts +1 -0
  8. package/es/components.js +1 -0
  9. package/es/config-provider/src/internal-interface.d.ts +2 -0
  10. package/es/flex/index.d.ts +3 -0
  11. package/es/flex/index.js +1 -0
  12. package/es/flex/src/Flex.d.ts +116 -0
  13. package/es/flex/src/Flex.js +80 -0
  14. package/es/flex/src/styles/rtl.cssr.d.ts +2 -0
  15. package/es/flex/src/styles/rtl.cssr.js +4 -0
  16. package/es/flex/src/type.d.ts +3 -0
  17. package/es/flex/src/type.js +1 -0
  18. package/es/flex/styles/_common.d.ts +6 -0
  19. package/es/flex/styles/_common.js +5 -0
  20. package/es/flex/styles/dark.d.ts +3 -0
  21. package/es/flex/styles/dark.js +8 -0
  22. package/es/flex/styles/index.d.ts +4 -0
  23. package/es/flex/styles/index.js +3 -0
  24. package/es/flex/styles/light.d.ts +10 -0
  25. package/es/flex/styles/light.js +9 -0
  26. package/es/flex/styles/rtl.d.ts +2 -0
  27. package/es/flex/styles/rtl.js +5 -0
  28. package/es/themes/dark.js +3 -1
  29. package/es/themes/light.js +3 -1
  30. package/es/version.d.ts +1 -1
  31. package/es/version.js +1 -1
  32. package/lib/_resolvers/auto-import/auto-import-resolver.d.ts +5 -0
  33. package/lib/_resolvers/auto-import/auto-import-resolver.js +17 -0
  34. package/lib/_resolvers/auto-import/auto-import-resolver.types.d.ts +17 -0
  35. package/lib/_resolvers/auto-import/auto-import-resolver.types.js +2 -0
  36. package/lib/components.d.ts +1 -0
  37. package/lib/components.js +1 -0
  38. package/lib/config-provider/src/internal-interface.d.ts +2 -0
  39. package/lib/flex/index.d.ts +3 -0
  40. package/lib/flex/index.js +9 -0
  41. package/lib/flex/src/Flex.d.ts +116 -0
  42. package/lib/flex/src/Flex.js +83 -0
  43. package/lib/flex/src/styles/rtl.cssr.d.ts +2 -0
  44. package/lib/flex/src/styles/rtl.cssr.js +9 -0
  45. package/lib/flex/src/type.d.ts +3 -0
  46. package/lib/flex/src/type.js +2 -0
  47. package/lib/flex/styles/_common.d.ts +6 -0
  48. package/lib/flex/styles/_common.js +7 -0
  49. package/lib/flex/styles/dark.d.ts +3 -0
  50. package/lib/flex/styles/dark.js +13 -0
  51. package/lib/flex/styles/index.d.ts +4 -0
  52. package/lib/flex/styles/index.js +12 -0
  53. package/lib/flex/styles/light.d.ts +10 -0
  54. package/lib/flex/styles/light.js +14 -0
  55. package/lib/flex/styles/rtl.d.ts +2 -0
  56. package/lib/flex/styles/rtl.js +11 -0
  57. package/lib/themes/dark.js +3 -1
  58. package/lib/themes/light.js +3 -1
  59. package/lib/version.d.ts +1 -1
  60. package/lib/version.js +1 -1
  61. package/package.json +6 -2
  62. package/volar.d.ts +1 -0
  63. package/web-types.json +90 -1
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.flexProps = void 0;
4
+ const vue_1 = require("vue");
5
+ const seemly_1 = require("seemly");
6
+ const use_rtl_1 = require("../../_mixins/use-rtl");
7
+ const _utils_1 = require("../../_utils");
8
+ const _mixins_1 = require("../../_mixins");
9
+ const styles_1 = require("../styles");
10
+ exports.flexProps = Object.assign(Object.assign({}, _mixins_1.useTheme.props), { align: String, justify: {
11
+ type: String,
12
+ default: 'start'
13
+ }, inline: Boolean, vertical: Boolean, reverse: Boolean, size: {
14
+ type: [String, Number, Array],
15
+ default: 'medium'
16
+ }, wrap: {
17
+ type: Boolean,
18
+ default: true
19
+ } });
20
+ exports.default = (0, vue_1.defineComponent)({
21
+ name: 'Flex',
22
+ props: exports.flexProps,
23
+ setup(props) {
24
+ const { mergedClsPrefixRef, mergedRtlRef } = (0, _mixins_1.useConfig)(props);
25
+ const themeRef = (0, _mixins_1.useTheme)('Flex', '-flex', undefined, styles_1.flexLight, props, mergedClsPrefixRef);
26
+ const rtlEnabledRef = (0, use_rtl_1.useRtl)('Flex', mergedRtlRef, mergedClsPrefixRef);
27
+ return {
28
+ rtlEnabled: rtlEnabledRef,
29
+ mergedClsPrefix: mergedClsPrefixRef,
30
+ margin: (0, vue_1.computed)(() => {
31
+ const { size } = props;
32
+ if (Array.isArray(size)) {
33
+ return {
34
+ horizontal: size[0],
35
+ vertical: size[1]
36
+ };
37
+ }
38
+ if (typeof size === 'number') {
39
+ return {
40
+ horizontal: size,
41
+ vertical: size
42
+ };
43
+ }
44
+ const { self: { [(0, _utils_1.createKey)('gap', size)]: gap } } = themeRef.value;
45
+ const { row, col } = (0, seemly_1.getGap)(gap);
46
+ return {
47
+ horizontal: (0, seemly_1.depx)(col),
48
+ vertical: (0, seemly_1.depx)(row)
49
+ };
50
+ })
51
+ };
52
+ },
53
+ render() {
54
+ const { vertical, reverse, align, inline, justify, margin, wrap, mergedClsPrefix, rtlEnabled } = this;
55
+ const children = (0, _utils_1.flatten)((0, _utils_1.getSlot)(this), false);
56
+ if (!children.length) {
57
+ return null;
58
+ }
59
+ return ((0, vue_1.h)("div", { role: "none", class: [
60
+ `${mergedClsPrefix}-flex`,
61
+ rtlEnabled && `${mergedClsPrefix}-flex--rtl`
62
+ ], style: {
63
+ display: inline ? 'inline-flex' : 'flex',
64
+ flexDirection: (() => {
65
+ if (vertical && !reverse) {
66
+ return 'column';
67
+ }
68
+ if (vertical && reverse) {
69
+ return 'column-reverse';
70
+ }
71
+ if (!vertical && reverse) {
72
+ return 'row-reverse';
73
+ }
74
+ else
75
+ return 'row';
76
+ })(),
77
+ justifyContent: justify,
78
+ flexWrap: !wrap || vertical ? 'nowrap' : 'wrap',
79
+ alignItems: align,
80
+ gap: `${margin.vertical}px ${margin.horizontal}px`
81
+ } }, children));
82
+ }
83
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: import("css-render").CNode;
2
+ export default _default;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ const cssr_1 = require("../../../_utils/cssr");
7
+ exports.default = (0, cssr_1.cB)('space', [(0, cssr_1.cM)('rtl', `
8
+ direction: rtl;
9
+ `)]);
@@ -0,0 +1,3 @@
1
+ import type { Property } from 'csstype';
2
+ export type FlexAlign = Property.AlignItems;
3
+ export type FlexJustify = Property.JustifyContent;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ declare const _default: {
2
+ gapSmall: string;
3
+ gapMedium: string;
4
+ gapLarge: string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = {
4
+ gapSmall: '4px 8px',
5
+ gapMedium: '8px 12px',
6
+ gapLarge: '12px 16px'
7
+ };
@@ -0,0 +1,3 @@
1
+ import type { FlexTheme } from './light';
2
+ declare const flexDark: FlexTheme;
3
+ export default flexDark;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const _common_1 = __importDefault(require("./_common"));
7
+ const flexDark = {
8
+ name: 'Flex',
9
+ self() {
10
+ return _common_1.default;
11
+ }
12
+ };
13
+ exports.default = flexDark;
@@ -0,0 +1,4 @@
1
+ export { default as flexDark } from './dark';
2
+ export { default as flexLight } from './light';
3
+ export { flexRtl } from './rtl';
4
+ export type { FlexTheme, FlexThemeVars } from './light';
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.flexRtl = exports.flexLight = exports.flexDark = void 0;
7
+ var dark_1 = require("./dark");
8
+ Object.defineProperty(exports, "flexDark", { enumerable: true, get: function () { return __importDefault(dark_1).default; } });
9
+ var light_1 = require("./light");
10
+ Object.defineProperty(exports, "flexLight", { enumerable: true, get: function () { return __importDefault(light_1).default; } });
11
+ var rtl_1 = require("./rtl");
12
+ Object.defineProperty(exports, "flexRtl", { enumerable: true, get: function () { return rtl_1.flexRtl; } });
@@ -0,0 +1,10 @@
1
+ import type { Theme } from '../../_mixins';
2
+ declare function self(): {
3
+ gapSmall: string;
4
+ gapMedium: string;
5
+ gapLarge: string;
6
+ };
7
+ export type FlexThemeVars = ReturnType<typeof self>;
8
+ declare const flexLight: Theme<'Flex', FlexThemeVars>;
9
+ export default flexLight;
10
+ export type FlexTheme = typeof flexLight;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ const _common_1 = __importDefault(require("./_common"));
7
+ function self() {
8
+ return _common_1.default;
9
+ }
10
+ const flexLight = {
11
+ name: 'Flex',
12
+ self
13
+ };
14
+ exports.default = flexLight;
@@ -0,0 +1,2 @@
1
+ import type { RtlItem } from '../../config-provider/src/internal-interface';
2
+ export declare const flexRtl: RtlItem;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.flexRtl = void 0;
7
+ const rtl_cssr_1 = __importDefault(require("../src/styles/rtl.cssr"));
8
+ exports.flexRtl = {
9
+ name: 'Flex',
10
+ style: rtl_cssr_1.default
11
+ };
@@ -86,6 +86,7 @@ const styles_81 = require("../upload/styles");
86
86
  const styles_82 = require("../watermark/styles");
87
87
  const styles_83 = require("../toggle-button/styles");
88
88
  const styles_84 = require("../_internal/account-option/styles");
89
+ const styles_85 = require("../flex/styles");
89
90
  exports.darkTheme = {
90
91
  name: 'dark',
91
92
  common: common_1.commonDark,
@@ -172,5 +173,6 @@ exports.darkTheme = {
172
173
  Typography: styles_79.typographyDark,
173
174
  Upload: styles_81.uploadDark,
174
175
  Watermark: styles_82.watermarkDark,
175
- ToggleButton: styles_83.toggleButtonDark
176
+ ToggleButton: styles_83.toggleButtonDark,
177
+ Flex: styles_85.flexDark
176
178
  };
@@ -88,6 +88,7 @@ const styles_81 = require("../upload/styles");
88
88
  const styles_82 = require("../watermark/styles");
89
89
  const styles_83 = require("../toggle-button/styles");
90
90
  const styles_84 = require("../_internal/account-option/styles");
91
+ const styles_85 = require("../flex/styles");
91
92
  exports.lightTheme = {
92
93
  name: 'light',
93
94
  common: common_1.commonLight,
@@ -174,5 +175,6 @@ exports.lightTheme = {
174
175
  Typography: styles_78.typographyLight,
175
176
  Upload: styles_81.uploadLight,
176
177
  Watermark: styles_82.watermarkLight,
177
- ToggleButton: styles_83.toggleButtonLight
178
+ ToggleButton: styles_83.toggleButtonLight,
179
+ Flex: styles_85.flexLight
178
180
  };
package/lib/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- declare const _default: "1.1.1";
1
+ declare const _default: "1.1.4";
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.1.1';
3
+ exports.default = '1.1.4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uzum-tech/ui",
3
- "version": "1.1.1",
3
+ "version": "1.1.4",
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",
@@ -11,7 +11,7 @@
11
11
  "start": "pnpm run dev",
12
12
  "dev": "pnpm run clean && pnpm run gen-version && pnpm run gen-volar-dts && cross-env NODE_ENV=development vite",
13
13
  "build:package": "pnpm run gen-version && pnpm run clean && pnpm run gen-volar-dts && tsc -b --force tsconfig.esm.json && node scripts/pre-build/pre-cjs-build.js && tsc -b --force tsconfig.cjs.json && rollup -c && pnpm run test:umd && node scripts/post-build && rimraf {es,lib}/*.tsbuildinfo",
14
- "build:site": "./scripts/pre-build-site/pre-build-site.sh && cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 vite build && ./scripts/post-build-site/post-build-site.sh",
14
+ "build:site": "pnpm run gen-version && ./scripts/pre-build-site/pre-build-site.sh && cross-env NODE_ENV=production NODE_OPTIONS=--max-old-space-size=4096 vite build && ./scripts/post-build-site/post-build-site.sh",
15
15
  "clean": "rimraf site lib es dist node_modules/@uzum-tech/ui themes/tusimple/es themes/tusimple/lib",
16
16
  "release:package": "pnpm run test && pnpm run build:package && npm publish --no-git-checks",
17
17
  "release:changelog": "node scripts/release-changelog.mjs",
@@ -207,5 +207,9 @@
207
207
  "webpack"
208
208
  ]
209
209
  }
210
+ },
211
+ "exports": {
212
+ ".": "./lib/index.js",
213
+ "./auto-import-resolver": "./lib/_resolvers/auto-import/auto-import-resolver.js"
210
214
  }
211
215
  }
package/volar.d.ts CHANGED
@@ -142,6 +142,7 @@ declare module 'vue' {
142
142
  UUploadFileList: typeof import('@uzum-tech/ui')['UUploadFileList']
143
143
  UUploadTrigger: typeof import('@uzum-tech/ui')['UUploadTrigger']
144
144
  UWatermark: typeof import('@uzum-tech/ui')['UWatermark']
145
+ UFlex: typeof import('@uzum-tech/ui')['UFlex']
145
146
  }
146
147
  }
147
148
  export {}
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.1.1",
5
+ "version": "1.1.4",
6
6
  "js-types-syntax": "typescript",
7
7
  "contributions": {
8
8
  "html": {
@@ -16497,6 +16497,95 @@
16497
16497
  }
16498
16498
  ]
16499
16499
  }
16500
+ },
16501
+ {
16502
+ "name": "UFlex",
16503
+ "description": "Available since `2.37.0`.\n\nFrankly saying, it functions similarly to `u-space`. However use `u-flex` if possible.\n\n`u-flex` utilizes the flex layout, and note that the gap property might have compatibility issues with some older browsers.\n\nOn the other hand, `u-space` involves operations at the `VNode` level, which could lead to rendering issues in certain specific use cases.",
16504
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16505
+ "source": {
16506
+ "symbol": "UFlex"
16507
+ },
16508
+ "slots": [
16509
+ {
16510
+ "name": "default",
16511
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16512
+ "description": "Spacing content.",
16513
+ "description-sections": {
16514
+ "since": "2.37.0"
16515
+ }
16516
+ }
16517
+ ],
16518
+ "attributes": [],
16519
+ "props": [
16520
+ {
16521
+ "name": "align",
16522
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16523
+ "type": "string",
16524
+ "description": "Way to align items, see [aligu-items](https://developer.mozilla.org/zh-CN/docs/Web/CSS/aligu-items).",
16525
+ "default": "undefined",
16526
+ "description-sections": {
16527
+ "since": "2.37.0"
16528
+ }
16529
+ },
16530
+ {
16531
+ "name": "justify",
16532
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16533
+ "type": "string",
16534
+ "description": "Way to justify content, see [justify-content](https://developer.mozilla.org/zh-CN/docs/Web/CSS/justify-content).",
16535
+ "default": "'start'",
16536
+ "description-sections": {
16537
+ "since": "2.37.0"
16538
+ }
16539
+ },
16540
+ {
16541
+ "name": "inline",
16542
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16543
+ "type": "boolean",
16544
+ "description": "Whether it's display is `inline-flex`.",
16545
+ "default": "false",
16546
+ "description-sections": {
16547
+ "since": "2.37.0"
16548
+ }
16549
+ },
16550
+ {
16551
+ "name": "vertical",
16552
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16553
+ "type": "boolean",
16554
+ "description": "Whether to layout content vertically.",
16555
+ "default": "false",
16556
+ "description-sections": {
16557
+ "since": "2.37.0"
16558
+ }
16559
+ },
16560
+ {
16561
+ "name": "reverse",
16562
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16563
+ "type": "boolean"
16564
+ },
16565
+ {
16566
+ "name": "size",
16567
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16568
+ "type": "'small' | 'medium' | 'large' | number | [number, number]",
16569
+ "description": "When it's a number, it will be used as vertical and horizontal gap, or it is `[horizontalGap, verticalGap]`.",
16570
+ "default": "'medium'",
16571
+ "description-sections": {
16572
+ "since": "2.37.0"
16573
+ }
16574
+ },
16575
+ {
16576
+ "name": "wrap",
16577
+ "doc-url": "https://www.naiveui.com/en-US/os-theme/components/flex",
16578
+ "type": "boolean",
16579
+ "description": "Whether to wrap content if `u-flex`'s width is exceeded.",
16580
+ "default": "true",
16581
+ "description-sections": {
16582
+ "since": "2.37.0"
16583
+ }
16584
+ }
16585
+ ],
16586
+ "js": {
16587
+ "events": []
16588
+ }
16500
16589
  }
16501
16590
  ]
16502
16591
  }