@uni-design-system/uni-core 0.0.23 → 0.0.24
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/cjs/core/layout/index.d.ts +1 -3
- package/dist/cjs/core/layout/index.js +1 -3
- package/dist/cjs/core/layout/index.js.map +1 -1
- package/dist/cjs/core/layout/layout.helper.d.ts +4 -0
- package/dist/cjs/core/layout/layout.helper.js +25 -0
- package/dist/cjs/core/layout/layout.helper.js.map +1 -0
- package/dist/cjs/core/layout/layout.model.d.ts +1 -1
- package/dist/cjs/core/layout/layout.types.d.ts +1 -3
- package/dist/cjs/core/layout/layout.types.js +0 -2
- package/dist/cjs/core/layout/layout.types.js.map +1 -1
- package/dist/esm/core/layout/index.d.ts +1 -3
- package/dist/esm/core/layout/index.js +1 -3
- package/dist/esm/core/layout/index.js.map +1 -1
- package/dist/esm/core/layout/layout.helper.d.ts +4 -0
- package/dist/esm/core/layout/layout.helper.js +20 -0
- package/dist/esm/core/layout/layout.helper.js.map +1 -0
- package/dist/esm/core/layout/layout.model.d.ts +1 -1
- package/dist/esm/core/layout/layout.types.d.ts +1 -3
- package/dist/esm/core/layout/layout.types.js +1 -1
- package/dist/esm/core/layout/layout.types.js.map +1 -1
- package/package.json +1 -1
- package/dist/cjs/core/layout/breakpoint.helper.d.ts +0 -2
- package/dist/cjs/core/layout/breakpoint.helper.js +0 -19
- package/dist/cjs/core/layout/breakpoint.helper.js.map +0 -1
- package/dist/cjs/core/layout/breakpoint.model.d.ts +0 -4
- package/dist/cjs/core/layout/breakpoint.model.js +0 -3
- package/dist/cjs/core/layout/breakpoint.model.js.map +0 -1
- package/dist/cjs/core/layout/layout.records.d.ts +0 -2
- package/dist/cjs/core/layout/layout.records.js +0 -11
- package/dist/cjs/core/layout/layout.records.js.map +0 -1
- package/dist/esm/core/layout/breakpoint.helper.d.ts +0 -2
- package/dist/esm/core/layout/breakpoint.helper.js +0 -15
- package/dist/esm/core/layout/breakpoint.helper.js.map +0 -1
- package/dist/esm/core/layout/breakpoint.model.d.ts +0 -4
- package/dist/esm/core/layout/breakpoint.model.js +0 -2
- package/dist/esm/core/layout/breakpoint.model.js.map +0 -1
- package/dist/esm/core/layout/layout.records.d.ts +0 -2
- package/dist/esm/core/layout/layout.records.js +0 -8
- package/dist/esm/core/layout/layout.records.js.map +0 -1
|
@@ -15,8 +15,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./layout.types"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./breakpoint.model"), exports);
|
|
20
|
-
__exportStar(require("./layout.records"), exports);
|
|
18
|
+
__exportStar(require("./layout.helper"), exports);
|
|
21
19
|
__exportStar(require("./layout.model"), exports);
|
|
22
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,kDAAgC;AAChC,iDAA+B"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getDeviceOrientation = exports.getDeviceSize = void 0;
|
|
4
|
+
function getDeviceSize(height, width) {
|
|
5
|
+
if (!height || !width)
|
|
6
|
+
return 'md';
|
|
7
|
+
const max = Math.max(height, width);
|
|
8
|
+
if (max <= 600) // Small Mobile
|
|
9
|
+
return 'xs';
|
|
10
|
+
if (max <= 960) // Large Mobile
|
|
11
|
+
return 'sm';
|
|
12
|
+
if (max <= 1264) // Tablets
|
|
13
|
+
return 'md';
|
|
14
|
+
if (max <= 1904) // Laptops & Monitors
|
|
15
|
+
return 'lg';
|
|
16
|
+
return 'xl'; // Large Monitors
|
|
17
|
+
}
|
|
18
|
+
exports.getDeviceSize = getDeviceSize;
|
|
19
|
+
function getDeviceOrientation(height, width) {
|
|
20
|
+
if (!height || !width)
|
|
21
|
+
return 'landscape';
|
|
22
|
+
return height > width ? 'portrait' : 'landscape';
|
|
23
|
+
}
|
|
24
|
+
exports.getDeviceOrientation = getDeviceOrientation;
|
|
25
|
+
//# sourceMappingURL=layout.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.helper.ts"],"names":[],"mappings":";;;AAGA,SAAgB,aAAa,CAAC,MAAc,EAAE,KAAa;IAEzD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,UAAU;QACzB,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,qBAAqB;QACpC,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA,CAAC,iBAAiB;AAC/B,CAAC;AAnBD,sCAmBC;AAED,SAAgB,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAEhE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAE1C,OAAO,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAA;AAElD,CAAC;AAND,oDAMC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/layout/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function getDeviceSize(height, width) {
|
|
2
|
+
if (!height || !width)
|
|
3
|
+
return 'md';
|
|
4
|
+
const max = Math.max(height, width);
|
|
5
|
+
if (max <= 600) // Small Mobile
|
|
6
|
+
return 'xs';
|
|
7
|
+
if (max <= 960) // Large Mobile
|
|
8
|
+
return 'sm';
|
|
9
|
+
if (max <= 1264) // Tablets
|
|
10
|
+
return 'md';
|
|
11
|
+
if (max <= 1904) // Laptops & Monitors
|
|
12
|
+
return 'lg';
|
|
13
|
+
return 'xl'; // Large Monitors
|
|
14
|
+
}
|
|
15
|
+
export function getDeviceOrientation(height, width) {
|
|
16
|
+
if (!height || !width)
|
|
17
|
+
return 'landscape';
|
|
18
|
+
return height > width ? 'portrait' : 'landscape';
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=layout.helper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"layout.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.helper.ts"],"names":[],"mappings":"AAGA,MAAM,UAAU,aAAa,CAAC,MAAc,EAAE,KAAa;IAEzD,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAEnC,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;IAEpC,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,GAAG,EAAE,eAAe;QAC7B,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,UAAU;QACzB,OAAO,IAAI,CAAC;IAEd,IAAI,GAAG,IAAI,IAAI,EAAE,qBAAqB;QACpC,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA,CAAC,iBAAiB;AAC/B,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,MAAc,EAAE,KAAa;IAEhE,IAAI,CAAC,MAAM,IAAI,CAAC,KAAK;QAAE,OAAO,WAAW,CAAC;IAE1C,OAAO,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,WAAW,CAAA;AAElD,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
2
2
|
//# sourceMappingURL=layout.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"layout.types.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.types.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getScreenSize = void 0;
|
|
4
|
-
const layout_records_1 = require("./layout.records");
|
|
5
|
-
function getScreenSize(width) {
|
|
6
|
-
if (!width)
|
|
7
|
-
return 'md';
|
|
8
|
-
if (width < layout_records_1.Breakpoints['xs'])
|
|
9
|
-
return 'xs';
|
|
10
|
-
if (width < layout_records_1.Breakpoints['sm'])
|
|
11
|
-
return 'sm';
|
|
12
|
-
if (width < layout_records_1.Breakpoints['md'])
|
|
13
|
-
return 'md';
|
|
14
|
-
if (width < layout_records_1.Breakpoints['lg'])
|
|
15
|
-
return 'lg';
|
|
16
|
-
return 'xl';
|
|
17
|
-
}
|
|
18
|
-
exports.getScreenSize = getScreenSize;
|
|
19
|
-
//# sourceMappingURL=breakpoint.helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.helper.ts"],"names":[],"mappings":";;;AACA,qDAA+C;AAE/C,SAAgB,aAAa,CAAC,KAAa;IAEzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,4BAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA;AACb,CAAC;AAjBD,sCAiBC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.model.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.model.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.records.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.records.ts"],"names":[],"mappings":";;;AAEa,QAAA,WAAW,GAAY;IAClC,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;CACX,CAAA"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Breakpoints } from './layout.records';
|
|
2
|
-
export function getScreenSize(width) {
|
|
3
|
-
if (!width)
|
|
4
|
-
return 'md';
|
|
5
|
-
if (width < Breakpoints['xs'])
|
|
6
|
-
return 'xs';
|
|
7
|
-
if (width < Breakpoints['sm'])
|
|
8
|
-
return 'sm';
|
|
9
|
-
if (width < Breakpoints['md'])
|
|
10
|
-
return 'md';
|
|
11
|
-
if (width < Breakpoints['lg'])
|
|
12
|
-
return 'lg';
|
|
13
|
-
return 'xl';
|
|
14
|
-
}
|
|
15
|
-
//# sourceMappingURL=breakpoint.helper.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.helper.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.helper.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,MAAM,UAAU,aAAa,CAAC,KAAa;IAEzC,IAAI,CAAC,KAAK;QAAE,OAAO,IAAI,CAAC;IAExB,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,IAAI,KAAK,GAAG,WAAW,CAAC,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC;IAEd,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"breakpoint.model.js","sourceRoot":"","sources":["../../../../src/core/layout/breakpoint.model.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"layout.records.js","sourceRoot":"","sources":["../../../../src/core/layout/layout.records.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,WAAW,GAAY;IAClC,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,GAAG;IACP,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,IAAI;IACR,EAAE,EAAE,MAAM;CACX,CAAA"}
|