@community-release/nx-ui 0.0.6 → 0.0.8

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 (68) hide show
  1. package/dist/module.d.mts +7 -0
  2. package/dist/module.d.ts +7 -2
  3. package/dist/module.json +1 -1
  4. package/dist/module.mjs +230 -9
  5. package/dist/runtime/components/accordion.vue +221 -0
  6. package/dist/runtime/components/animated-number/animateValue.d.ts +13 -0
  7. package/dist/runtime/components/animated-number/animateValue.mjs +56 -0
  8. package/dist/runtime/components/animated-number/index.vue +43 -0
  9. package/dist/runtime/components/button/index.vue +360 -0
  10. package/dist/runtime/components/button/index.vue.d.ts +81 -0
  11. package/dist/runtime/components/button/props.json +6 -0
  12. package/dist/runtime/components/card.vue +138 -0
  13. package/dist/runtime/components/checkbox.vue +227 -0
  14. package/dist/runtime/components/countdown/index.vue +64 -0
  15. package/dist/runtime/components/countdown/props.json +6 -0
  16. package/dist/runtime/components/filter/index.vue +140 -0
  17. package/dist/runtime/components/filter/props.json +4 -0
  18. package/dist/runtime/components/grid.vue +169 -0
  19. package/dist/runtime/components/grid.vue.d.ts +56 -0
  20. package/dist/runtime/components/helpers/Countdown.d.ts +0 -0
  21. package/dist/runtime/components/helpers/Countdown.mjs +143 -0
  22. package/dist/runtime/components/helpers/getEventCoord.d.ts +7 -0
  23. package/dist/runtime/components/helpers/getEventCoord.mjs +16 -0
  24. package/dist/runtime/components/helpers/isImageExist.d.ts +6 -0
  25. package/dist/runtime/components/helpers/isImageExist.mjs +20 -0
  26. package/dist/runtime/components/helpers/isMobileDevice.d.ts +5 -0
  27. package/dist/runtime/components/helpers/isMobileDevice.mjs +12 -0
  28. package/dist/runtime/components/helpers/isWebKit.d.ts +5 -0
  29. package/dist/runtime/components/helpers/isWebKit.mjs +12 -0
  30. package/dist/runtime/components/helpers/uniq.d.ts +2 -0
  31. package/dist/runtime/components/helpers/uniq.mjs +1 -0
  32. package/dist/runtime/components/icons/check.svg +1 -0
  33. package/dist/runtime/components/icons/check.white.svg +1 -0
  34. package/dist/runtime/components/impulse-indicator.vue +139 -0
  35. package/dist/runtime/components/impulse-indicator.vue.d.ts +21 -0
  36. package/dist/runtime/components/input/index.vue +241 -0
  37. package/dist/runtime/components/input/props.json +5 -0
  38. package/dist/runtime/components/label.vue +33 -0
  39. package/dist/runtime/components/loading.vue +91 -0
  40. package/dist/runtime/components/map/device-zoom-switch.vue +160 -0
  41. package/dist/runtime/components/map/index.vue +135 -0
  42. package/dist/runtime/components/map/location/index.vue +109 -0
  43. package/dist/runtime/components/map/location/list.vue +54 -0
  44. package/dist/runtime/components/map/location/nearest.vue +88 -0
  45. package/dist/runtime/components/map/openlayers/index.vue +355 -0
  46. package/dist/runtime/components/map/props.json +5 -0
  47. package/dist/runtime/components/map/store.d.ts +114 -0
  48. package/dist/runtime/components/map/store.mjs +166 -0
  49. package/dist/runtime/components/map/zoom.vue +61 -0
  50. package/dist/runtime/components/notice/index.vue +63 -0
  51. package/dist/runtime/components/notice/item.vue +118 -0
  52. package/dist/runtime/components/notice/store.d.ts +27 -0
  53. package/dist/runtime/components/notice/store.mjs +46 -0
  54. package/dist/runtime/components/radio.vue +215 -0
  55. package/dist/runtime/components/select.vue +303 -0
  56. package/dist/runtime/components/static-map.vue +345 -0
  57. package/dist/runtime/components/styles/components.less +3 -0
  58. package/dist/runtime/components/styles/mixins.less +6 -0
  59. package/dist/runtime/components/textarea/index.vue +166 -0
  60. package/dist/runtime/components/textarea/props.json +4 -0
  61. package/dist/runtime/components/tooltip.vue +137 -0
  62. package/dist/runtime/plugins/methods.d.ts +2 -0
  63. package/dist/runtime/plugins/methods.mjs +20 -0
  64. package/dist/runtime/plugins/variables.d.ts +2 -0
  65. package/dist/runtime/plugins/variables.mjs +17 -0
  66. package/dist/types.d.mts +2 -11
  67. package/dist/types.d.ts +2 -11
  68. package/package.json +4 -4
@@ -0,0 +1,166 @@
1
+ <template>
2
+ <section class="component-ui-textarea" :class="classes" @click="refInput.focus()">
3
+ <textarea
4
+ ref="refInput"
5
+ :value="modelValue"
6
+ :placeholder="placeholder"
7
+ :disabled="disabled"
8
+
9
+ @change="updateValue($event.target.value)"
10
+ @input="updateValue($event.target.value)"
11
+ @blur="handleBlur($event.target.value)"
12
+ @keyup.enter="updateValue($event.target.value, true, true)"
13
+
14
+ @focus="haveFocus = true"
15
+
16
+ formnovalidate
17
+ spellcheck="false"
18
+ >
19
+ </textarea>
20
+ </section>
21
+ </template>
22
+
23
+ <script setup>
24
+ // Imports
25
+ import { ref, computed } from 'vue';
26
+ import comProps from '#build/ui.textarea.mjs';
27
+
28
+ // Misc
29
+ const emit = defineEmits(['input', 'enter', 'blur', 'update:modelValue']);
30
+
31
+ // Data
32
+ const props = defineProps({
33
+ placeholder: {
34
+ default: comProps.placeholder,
35
+ },
36
+ shape: {
37
+ type: String,
38
+ default: comProps.shape,
39
+ },
40
+ modelValue: {
41
+ required: true
42
+ },
43
+ disabled: {
44
+ type: Boolean,
45
+ default: false,
46
+ },
47
+ resize: {
48
+ type: String,
49
+ default: 'on',
50
+ },
51
+ });
52
+
53
+ const refInput = ref(null);
54
+ const haveFocus = ref(false);
55
+
56
+ const classes = computed(() => {
57
+ const ar = [
58
+ `tag-resize-${props.resize}`
59
+ ];
60
+
61
+ if (props.modelValue !== '') ar.push('tag-not-empty');
62
+ if (haveFocus.value) ar.push('tag-focus');
63
+ if (props.disabled) ar.push('tag-disabled');
64
+ if (props.shape) ar.push(`tag-shape-${props.shape}`);
65
+
66
+ return ar;
67
+ });
68
+
69
+ // Methods
70
+ function updateValue(value, doTrim = false, submit = false) {
71
+ const validValue = doTrim ? value.trim() : value;
72
+
73
+ if (value !== validValue)
74
+ refInput.value.value = validValue;
75
+
76
+ emit('update:modelValue', validValue);
77
+
78
+ if (submit) emit('enter', validValue);
79
+ }
80
+
81
+ function handleBlur(v) {
82
+ haveFocus.value = false;
83
+
84
+ emit('blur', v);
85
+ updateValue(v);
86
+ }
87
+ </script>
88
+
89
+ <style lang="less">
90
+ // Misc
91
+ @com-ani-ease: var(--ui-ani-ease);
92
+
93
+ // Border radius
94
+ @com-border-radius-default: var(--ui-border-radius-default);
95
+ @com-border-radius-default-big: var(--ui-border-radius-big);
96
+
97
+ // Colors
98
+ @com-color-primary: var(--ui-color-primary);
99
+ @com-color-bg: var(--ui-color-bg);
100
+ @com-color-border-bolder: var(--ui-color-border-bolder);
101
+ @com-color-header-text: var(--ui-color-header-text);
102
+ @com-color-gray-text: var(--ui-color-gray-text);
103
+
104
+ // Padding
105
+ @com-space-default: var(--ui-space-default);
106
+ @com-space-mini: var(--ui-space-mini);
107
+ @com-space-small: var(--ui-space-small);
108
+
109
+ // Font
110
+ @com-font-text: var(--ui-font-text);
111
+
112
+ // Text size
113
+ @com-text-default: var(--ui-text-default);
114
+ @com-text-small: var(--ui-text-small);
115
+
116
+ .component-ui-textarea {
117
+ position: relative;
118
+ cursor: text;
119
+
120
+ textarea {
121
+ box-sizing: border-box;
122
+
123
+ display: block;
124
+ padding: @com-space-mini;
125
+ width: 100%;
126
+ height: 100px;
127
+
128
+ font-family: @com-font-text;
129
+ font-size: @com-text-default;
130
+ color: @com-color-header-text;
131
+
132
+ border: 1px solid @com-color-border-bolder;
133
+ border-radius: @com-border-radius-default;
134
+ background: @com-color-bg;
135
+ }
136
+
137
+ // Resize
138
+ &.tag-resize-on textarea { resize: vertical; }
139
+ &.tag-resize-off textarea { resize: none; }
140
+ &.tag-resize-both textarea { resize: both; }
141
+
142
+ // Shapes
143
+ &.tag-shape-round-square textarea {
144
+ border-radius: @com-border-radius-default-big;
145
+ }
146
+ &.tag-shape-square textarea {
147
+ border-radius: 0;
148
+ }
149
+
150
+ // Disabled
151
+ &.tag-disabled {
152
+ opacity: 0.6;
153
+ cursor: not-allowed;
154
+
155
+ textarea {
156
+ cursor: not-allowed;
157
+ }
158
+ }
159
+
160
+ // Focus
161
+ &.tag-focus textarea {
162
+ border-color: @com-color-primary;
163
+ outline: 1px solid @com-color-primary;
164
+ }
165
+ }
166
+ </style>
@@ -0,0 +1,4 @@
1
+ {
2
+ "placeholder": "",
3
+ "shape": ""
4
+ }
@@ -0,0 +1,137 @@
1
+ <template>
2
+ <div class="component-ui component-ui-tooltip" :class="classes" @click="requestHide">
3
+ <slot></slot>
4
+ </div>
5
+ </template>
6
+
7
+ <script setup>
8
+ // Imports
9
+ import { computed, watch } from 'vue';
10
+
11
+ // Data
12
+ const props = defineProps({
13
+ modelValue: {
14
+ default: false,
15
+ },
16
+ location: {
17
+ type: String,
18
+ default: 'top'
19
+ },
20
+ textColor: {
21
+ type: String,
22
+ default: 'var(--ui-color-text-on-surface)'
23
+ },
24
+ bg: {
25
+ type: String,
26
+ default: 'var(--ui-color-surface)'
27
+ }
28
+ });
29
+
30
+ const emit = defineEmits(['update:modelValue']);
31
+
32
+ let t; // timeout
33
+
34
+ const classes = computed(() => {
35
+ const result = [`tag-location-${props.location}`];
36
+
37
+ if (props.modelValue) result.push('tag-active');
38
+
39
+ return result;
40
+ });
41
+
42
+ watch(() => props.modelValue, (v) => {
43
+ if (v)
44
+ show();
45
+ else
46
+ clearTimeout(t);
47
+ });
48
+
49
+ // Methods
50
+ function show() {
51
+ clearTimeout(t);
52
+ t = setTimeout(() => {
53
+ requestHide();
54
+ }, 5000);
55
+ }
56
+
57
+ function requestHide() {
58
+ emit('update:modelValue', false);
59
+ }
60
+ </script>
61
+
62
+ <style lang="less">
63
+ @com-ani-time: var(--ui-ani-time);
64
+ @com-ani-ease: var(--ui-ani-ease);
65
+
66
+ @com-space-small: var(--ui-space-small);
67
+ @com-space-mini: var(--ui-space-mini);
68
+
69
+ @com-text-small: var(--ui-text-small);
70
+
71
+ @com-color-border-bolder: var(--ui-color-border-bolder);
72
+
73
+ @com-border-radius-default: var(--ui-border-radius-default);
74
+ @com-bs-1: var(--ui-bs-1);
75
+
76
+ .component-ui-tooltip {
77
+ --ui-tooltip-text-color: v-bind(textColor);
78
+ --ui-tooltip-bg: v-bind(bg);
79
+
80
+ transition: all @com-ani-time @com-ani-ease;
81
+
82
+ opacity: 0;
83
+ visibility: hidden;
84
+ position: absolute;
85
+ padding: @com-space-mini;
86
+ min-width: 200px;
87
+ line-height: 1.3;
88
+ font-size: @com-text-small;
89
+ color: var(--ui-tooltip-text-color);
90
+ background: var(--ui-tooltip-bg);
91
+ border-radius: @com-border-radius-default;
92
+ border: 1px solid @com-color-border-bolder;
93
+ box-shadow: @com-bs-1;
94
+
95
+ &:after {
96
+ content: '';
97
+
98
+ position: absolute;
99
+ width: 0;
100
+ height: 0;
101
+ border-style: solid;
102
+ }
103
+
104
+ &.tag-location-top {
105
+ transform: translate3d(-50%, calc(@com-space-small * -1), 0);
106
+ bottom: 100%;
107
+ left: 50%;
108
+
109
+ &:after {
110
+ transform: translate3d(-50%, 0, 0);
111
+ left: 50%;
112
+ top: 100%;
113
+ border-width: 10px 8px 0 8px;
114
+ border-color: @com-color-border-bolder transparent transparent transparent;
115
+ }
116
+ }
117
+
118
+ &.tag-location-left {
119
+ transform: translate3d(calc(@com-space-small * -1), -50%, 0);
120
+ top: 50%;
121
+ right: 100%;
122
+
123
+ &:after {
124
+ transform: translate3d(0, -50%, 0);
125
+ left: 100%;
126
+ top: 50%;
127
+ border-width: 8px 0 8px 10px;
128
+ border-color: transparent transparent transparent @com-color-border-bolder;
129
+ }
130
+ }
131
+
132
+ &.tag-active {
133
+ opacity: 1;
134
+ visibility: visible;
135
+ }
136
+ }
137
+ </style>
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { defineNuxtPlugin } from "#app";
2
+ import { useUINoticeStore } from "../components/notice/store.mjs";
3
+ export default defineNuxtPlugin(function(nuxt) {
4
+ const noticeStore = useUINoticeStore();
5
+ return {
6
+ provide: {
7
+ showNotice(duration, templateComponent, templateProps) {
8
+ const id = noticeStore.add({
9
+ duration,
10
+ templateComponent,
11
+ templateProps
12
+ });
13
+ return id;
14
+ },
15
+ hideNotice(id) {
16
+ noticeStore.remove(id);
17
+ }
18
+ }
19
+ };
20
+ });
@@ -0,0 +1,2 @@
1
+ declare const _default: any;
2
+ export default _default;
@@ -0,0 +1,17 @@
1
+ import { computed } from "vue";
2
+ import { defineNuxtPlugin } from "#app";
3
+ import { useHead } from "#imports";
4
+ import style from "#build/ui.style.mjs";
5
+ export default defineNuxtPlugin(function(nuxt) {
6
+ const computedStyle = computed(() => style);
7
+ const headData = {
8
+ style: [
9
+ {
10
+ innerHTML: () => computedStyle.value,
11
+ tagPriority: -2,
12
+ id: "nuxt-ui-style"
13
+ }
14
+ ]
15
+ };
16
+ useHead(headData);
17
+ });
package/dist/types.d.mts CHANGED
@@ -1,25 +1,16 @@
1
1
 
2
- import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks, ModuleRuntimeHooks, ModuleRuntimeConfig, ModulePublicRuntimeConfig } from './module.js'
2
+ import type { ModuleOptions } from './module.js'
3
3
 
4
- declare module '#app' {
5
- interface RuntimeNuxtHooks extends RuntimeModuleHooks, ModuleRuntimeHooks {}
6
- }
7
4
 
8
5
  declare module '@nuxt/schema' {
9
6
  interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
10
7
  interface NuxtOptions { ['ui']?: ModuleOptions }
11
- interface NuxtHooks extends ModuleHooks {}
12
- interface RuntimeConfig extends ModuleRuntimeConfig {}
13
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
14
8
  }
15
9
 
16
10
  declare module 'nuxt/schema' {
17
11
  interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
18
12
  interface NuxtOptions { ['ui']?: ModuleOptions }
19
- interface NuxtHooks extends ModuleHooks {}
20
- interface RuntimeConfig extends ModuleRuntimeConfig {}
21
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
22
13
  }
23
14
 
24
15
 
25
- export type { default } from './module.js'
16
+ export type { ModuleOptions, default } from './module.js'
package/dist/types.d.ts CHANGED
@@ -1,25 +1,16 @@
1
1
 
2
- import type { ModuleOptions, ModuleHooks, RuntimeModuleHooks, ModuleRuntimeHooks, ModuleRuntimeConfig, ModulePublicRuntimeConfig } from './module'
2
+ import type { ModuleOptions } from './module'
3
3
 
4
- declare module '#app' {
5
- interface RuntimeNuxtHooks extends RuntimeModuleHooks, ModuleRuntimeHooks {}
6
- }
7
4
 
8
5
  declare module '@nuxt/schema' {
9
6
  interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
10
7
  interface NuxtOptions { ['ui']?: ModuleOptions }
11
- interface NuxtHooks extends ModuleHooks {}
12
- interface RuntimeConfig extends ModuleRuntimeConfig {}
13
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
14
8
  }
15
9
 
16
10
  declare module 'nuxt/schema' {
17
11
  interface NuxtConfig { ['ui']?: Partial<ModuleOptions> }
18
12
  interface NuxtOptions { ['ui']?: ModuleOptions }
19
- interface NuxtHooks extends ModuleHooks {}
20
- interface RuntimeConfig extends ModuleRuntimeConfig {}
21
- interface PublicRuntimeConfig extends ModulePublicRuntimeConfig {}
22
13
  }
23
14
 
24
15
 
25
- export type { default } from './module'
16
+ export type { ModuleOptions, default } from './module'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@community-release/nx-ui",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "nx-ui - Nuxt UI library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -25,8 +25,6 @@
25
25
  "@nuxtjs/color-mode": "^3.4.2",
26
26
  "@nuxtjs/i18n": "^8.3.1",
27
27
  "@pinia/nuxt": "^0.5.1",
28
- "@vuedoc/md": "^4.0.0-beta8",
29
- "@vuedoc/parser": "^4.0.0-beta14",
30
28
  "ol": "^9.1.0",
31
29
  "pinia": "^2.1.7"
32
30
  },
@@ -38,6 +36,8 @@
38
36
  "@types/node": "^20.12.4",
39
37
  "@vitejs/plugin-vue": "^5.0.5",
40
38
  "@vue/test-utils": "^2.4.6",
39
+ "@vuedoc/md": "^4.0.0-beta8",
40
+ "@vuedoc/parser": "^4.0.0-beta14",
41
41
  "changelogen": "^0.5.5",
42
42
  "happy-dom": "^14.12.0",
43
43
  "less": "^3.9.0",
@@ -55,7 +55,7 @@
55
55
  "prepack": "nuxt-module-build build",
56
56
  "dev": "nuxi dev docs",
57
57
  "build": "nuxi build docs",
58
- "prepare": "nuxt-module-build build --stub && nuxt-module-build prepare && nuxi prepare docs",
58
+ "prepare": "nuxt-module-build build && nuxt-module-build prepare && nuxi prepare docs",
59
59
  "release": "npm run test && npm run prepack && changelogen --release && npm publish && git push --follow-tags",
60
60
  "test": "vitest run",
61
61
  "test:watch": "vitest watch",