pangea-lib 1.8.6 → 1.9.1

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.
@@ -0,0 +1 @@
1
+ export type Message = string | (() => string);
@@ -0,0 +1,17 @@
1
+ import { Message } from './PgaDisplayText.types';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
+ text: Message;
5
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ text: Message;
7
+ }>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,3 @@
1
+ export { default as PgaIcon } from './pga-icon/PgaIcon.vue';
2
+ export { default as PgaDisplayText } from './display-components/pga-display-text/PgaDisplayText.vue';
3
+ export { default as PgaSelect } from './input-components/pga-select/PgaSelect.vue';
@@ -0,0 +1,2 @@
1
+ export type ID = any;
2
+ export type Option = any;
@@ -0,0 +1,43 @@
1
+ import { Message } from '../../display-components/pga-display-text/PgaDisplayText.types';
2
+
3
+ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<{
4
+ modelValue: {
5
+ required: true;
6
+ type: import('vue').PropType<any>;
7
+ };
8
+ options: {
9
+ type: import('vue').PropType<any[]>;
10
+ required: true;
11
+ };
12
+ emptyOptionsMsg: {
13
+ type: import('vue').PropType<Message>;
14
+ };
15
+ disabled: {
16
+ type: import('vue').PropType<boolean>;
17
+ };
18
+ }, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<{
19
+ modelValue: {
20
+ required: true;
21
+ type: import('vue').PropType<any>;
22
+ };
23
+ options: {
24
+ type: import('vue').PropType<any[]>;
25
+ required: true;
26
+ };
27
+ emptyOptionsMsg: {
28
+ type: import('vue').PropType<Message>;
29
+ };
30
+ disabled: {
31
+ type: import('vue').PropType<boolean>;
32
+ };
33
+ }>>, {}, {}>, {
34
+ dropdownOption?(_: {
35
+ option: any;
36
+ }): any;
37
+ }>;
38
+ export default _default;
39
+ type __VLS_WithTemplateSlots<T, S> = T & {
40
+ new (): {
41
+ $slots: S;
42
+ };
43
+ };
@@ -0,0 +1,5 @@
1
+ import { IconName as FontawesomeIconName } from '@fortawesome/fontawesome-svg-core';
2
+
3
+ export type IconType = 'fas' | 'far' | 'fab';
4
+ export type IconName = FontawesomeIconName;
5
+ export type Icon = [IconType, IconName];
@@ -0,0 +1,17 @@
1
+ import { IconName, Icon } from './PgaIcon.types';
2
+
3
+ declare const _default: import('vue').DefineComponent<__VLS_TypePropsToRuntimeProps<{
4
+ icon: Icon | IconName;
5
+ }>, {}, unknown, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
6
+ icon: Icon | IconName;
7
+ }>>>, {}, {}>;
8
+ export default _default;
9
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
10
+ type __VLS_TypePropsToRuntimeProps<T> = {
11
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
12
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
13
+ } : {
14
+ type: import('vue').PropType<T[K]>;
15
+ required: true;
16
+ };
17
+ };
@@ -0,0 +1,3 @@
1
+ import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome';
2
+
3
+ export { FontAwesomeIcon };
@@ -0,0 +1,4 @@
1
+ import { PangeaOptions } from './types/pangea-options';
2
+
3
+ declare const pangeaOptions: PangeaOptions;
4
+ export default pangeaOptions;
@@ -0,0 +1,5 @@
1
+ import { App } from 'vue';
2
+ import { PangeaOptions } from './types/pangea-options';
3
+
4
+ declare const _default: (app: App, userOptions?: PangeaOptions) => void;
5
+ export default _default;
@@ -0,0 +1,6 @@
1
+ export type PangeaOptions = {
2
+ colors: {
3
+ first: string;
4
+ second: string;
5
+ };
6
+ };
package/package.json CHANGED
@@ -1,31 +1,25 @@
1
1
  {
2
2
  "name": "pangea-lib",
3
- "version": "1.8.6",
3
+ "version": "1.9.1",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "dist",
8
- "src/helpers",
9
8
  "src/styles"
10
9
  ],
11
- "main": "./dist/pangea.umd.cjs",
12
- "module": "./dist/pangea.js",
10
+ "main": "./dist/index.umd.js",
11
+ "module": "./dist/index.es.js",
13
12
  "exports": {
14
13
  ".": {
15
- "import": "./dist/pangea.js",
16
- "require": "./dist/pangea.umd.cjs",
17
- "types": "./dist/index.d.ts"
14
+ "require": "./dist/pangea.umd.js",
15
+ "import": "./dist/index.es.js",
16
+ "types": "./dist/types/index.d.ts"
18
17
  },
19
- "./animation-helpers": "./src/helpers/animation.helpers.ts",
20
- "./coins-helpers": "./src/helpers/coins.helpers.ts",
21
- "./datetime-helpers": "./src/helpers/datetime.helpers.ts",
22
- "./object-helpers": "./src/helpers/object.helpers.ts",
23
- "./url-helpers": "./src/helpers/url.helpers.ts",
24
18
  "./style.css": "./dist/style.css"
25
19
  },
26
- "types": "./dist/index.d.ts",
20
+ "types": "./dist/types/index.d.ts",
27
21
  "scripts": {
28
- "build": "vue-tsc --noEmit && vite build",
22
+ "build": "vue-tsc && vite build",
29
23
  "deploy": "node deploy.js"
30
24
  },
31
25
  "keywords": [
@@ -50,9 +44,7 @@
50
44
  "@fortawesome/free-regular-svg-icons": "^6.5.1",
51
45
  "@fortawesome/free-solid-svg-icons": "^6.5.1",
52
46
  "@fortawesome/vue-fontawesome": "^3.0.5",
53
- "axios": "^1.6.8",
54
47
  "click-outside-vue3": "^4.0.1",
55
- "moment": "^2.30.1",
56
48
  "vue": "^3.4.21"
57
49
  },
58
50
  "devDependencies": {
@@ -61,6 +53,7 @@
61
53
  "stylus": "^0.59.0",
62
54
  "typescript": "^5.0.2",
63
55
  "vite": "^4.3.9",
56
+ "vite-plugin-dts": "^3.9.1",
64
57
  "vue-tsc": "^1.4.2",
65
58
  "yarn": "^1.22.22"
66
59
  }
@@ -1,15 +0,0 @@
1
- export function animateCSS(element: string, animation: string, prefix = 'animate__') {
2
- return new Promise((resolve) => {
3
- const animationName = `${prefix}${animation}`;
4
- const node = document.querySelector(element);
5
- if (node) {
6
- node.classList.add(`${prefix}animated`, animationName);
7
- const handleAnimationEnd = (event: { stopPropagation: () => void }) => {
8
- event.stopPropagation();
9
- node?.classList.remove(`${prefix}animated`, animationName);
10
- resolve('Animation ended');
11
- };
12
- node.addEventListener('animationend', handleAnimationEnd, { once: true });
13
- }
14
- });
15
- }
@@ -1,18 +0,0 @@
1
- import axios from 'axios';
2
-
3
- export function displayValue(value: number, maximumFractionDigits: number) {
4
- const valueToReturn = value.toLocaleString(undefined, { maximumFractionDigits });
5
- if (valueToReturn === '-0') return '0';
6
- return valueToReturn;
7
- }
8
-
9
- export function getAmountToDisplay(amount: number, significantDigits: number, coinName: string, withCoinName = true) {
10
- let amountToDisplay = displayValue(amount, significantDigits);
11
- if (withCoinName) amountToDisplay = amountToDisplay += ` ${coinName}`;
12
- return amountToDisplay;
13
- }
14
-
15
- export async function getDollarValue(): Promise<number> {
16
- const res = await axios.get('https://dolarapi.com/v1/dolares/blue');
17
- return res.data.venta;
18
- }
@@ -1,31 +0,0 @@
1
- type DisplayDatetimeConfig = {
2
- format?: 'numbers' | 'short' | 'long';
3
- withTime?: boolean;
4
- };
5
-
6
- export function displayDatetime(datetime: Date, config?: DisplayDatetimeConfig) {
7
- // config
8
- const defaultConfig: DisplayDatetimeConfig = {
9
- format: 'short',
10
- withTime: true,
11
- };
12
- const finalConfig = {
13
- ...defaultConfig,
14
- ...config,
15
- };
16
- // null
17
- if (!datetime) return '-';
18
- // options
19
- const options: Intl.DateTimeFormatOptions = {
20
- weekday: finalConfig.format === 'numbers' ? undefined : finalConfig.format,
21
- year: 'numeric',
22
- month: finalConfig.format === 'numbers' ? '2-digit' : finalConfig.format,
23
- day: '2-digit',
24
- hour: finalConfig.withTime ? '2-digit' : undefined,
25
- minute: finalConfig.withTime ? '2-digit' : undefined,
26
- hour12: false,
27
- };
28
- // return
29
- const stringDatetime = datetime.toLocaleString('es-ES', options);
30
- return stringDatetime.charAt(0).toUpperCase() + stringDatetime.slice(1);
31
- }
@@ -1,40 +0,0 @@
1
- import moment from 'moment';
2
-
3
- export function copyModelFields(objTo: any, objFrom: any, relations?: any) {
4
- if (objFrom)
5
- Object.keys(objFrom).forEach((key) => {
6
- if (!objTo.hasOwnProperty(key)) return;
7
- if (!objFrom[key]) return (objTo[key] = objFrom[key]);
8
- if (objFrom[key] instanceof File) return (objTo[key] = objFrom[key]);
9
- if (
10
- /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/.test(objFrom[key]) &&
11
- moment(objFrom[key], moment.ISO_8601, true).isValid()
12
- )
13
- return (objTo[key] = new Date(objFrom[key]));
14
- if (typeof objFrom[key] === 'object' && relations?.[key]) {
15
- if (Array.isArray(objFrom[key])) {
16
- objTo[key] = [];
17
- for (let index = 0; index < objFrom[key].length; index++) {
18
- objTo[key].push(new relations[key](objFrom[key][index]));
19
- }
20
- } else {
21
- objTo[key] = new relations[key](objFrom[key]);
22
- }
23
- } else {
24
- objTo[key] = objFrom[key];
25
- }
26
- });
27
- }
28
-
29
- export function copyAvailableFields(destinationObj?: any, originObj?: any) {
30
- if (!destinationObj || !originObj) return;
31
- for (const key in originObj) {
32
- if (originObj.hasOwnProperty(key) && destinationObj.hasOwnProperty(key)) {
33
- if (typeof originObj[key] === 'object' && originObj[key] !== null) {
34
- copyAvailableFields(destinationObj[key], originObj[key]);
35
- } else {
36
- destinationObj[key] = originObj[key];
37
- }
38
- }
39
- }
40
- }
@@ -1,15 +0,0 @@
1
- export function isCurrentUrl(url: string) {
2
- if (!url) return false;
3
- let finalUrl = url;
4
- // remove protocol
5
- const protocols = ['http://', 'https://'];
6
- for (const protocol of protocols) {
7
- if (url.startsWith(protocol)) {
8
- finalUrl = url.replace(protocol, '');
9
- break;
10
- }
11
- }
12
- // remove port number
13
- finalUrl = finalUrl.replace(/:(\d*)$/, '');
14
- return window.location.href.includes(finalUrl);
15
- }
File without changes
File without changes