@signal24/vue-foundation 3.8.0 → 4.0.0

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 (122) hide show
  1. package/.eslintrc.cjs +35 -0
  2. package/.prettierrc.json +4 -2
  3. package/dist/src/components/ajax-select.vue.d.ts +21 -0
  4. package/dist/src/components/alert-helpers.d.ts +8 -0
  5. package/dist/src/components/alert-modal.vue.d.ts +27 -0
  6. package/dist/src/components/ez-smart-select.vue.d.ts +27 -0
  7. package/dist/src/components/index.d.ts +8 -0
  8. package/dist/src/components/modal-container.d.ts +33 -0
  9. package/dist/src/components/modal.vue.d.ts +34 -0
  10. package/dist/src/components/smart-select.vue.d.ts +121 -0
  11. package/dist/src/config.d.ts +8 -0
  12. package/dist/src/directives/autofocus.d.ts +2 -0
  13. package/dist/src/directives/confirm-button.d.ts +2 -0
  14. package/dist/src/directives/date-input.d.ts +2 -0
  15. package/dist/src/directives/datetime.d.ts +2 -0
  16. package/dist/src/directives/disabled.d.ts +2 -0
  17. package/dist/src/directives/duration.d.ts +2 -0
  18. package/dist/src/directives/index.d.ts +24 -0
  19. package/dist/src/directives/infinite-scroll.d.ts +3 -0
  20. package/dist/src/directives/readonly.d.ts +2 -0
  21. package/dist/src/directives/tooltip.d.ts +41 -0
  22. package/dist/src/filters/index.d.ts +39 -0
  23. package/dist/src/helpers/array.d.ts +3 -0
  24. package/dist/src/helpers/context-menu.d.ts +13 -0
  25. package/dist/src/helpers/delay.d.ts +2 -0
  26. package/dist/src/helpers/error.d.ts +7 -0
  27. package/dist/src/helpers/index.d.ts +9 -0
  28. package/dist/src/helpers/mask.d.ts +15 -0
  29. package/dist/src/helpers/number.d.ts +1 -0
  30. package/dist/src/helpers/object.d.ts +2 -0
  31. package/dist/src/helpers/openapi.d.ts +34 -0
  32. package/dist/src/helpers/string.d.ts +5 -0
  33. package/dist/src/hooks/index.d.ts +2 -0
  34. package/dist/src/hooks/infinite-scroll.d.ts +30 -0
  35. package/dist/src/hooks/resize-watcher.d.ts +1 -0
  36. package/dist/src/index.d.ts +8 -0
  37. package/dist/src/types.d.ts +14 -0
  38. package/dist/src/vite-plugins/index.d.ts +1 -0
  39. package/dist/src/vite-plugins/index.js +2 -0
  40. package/dist/src/vite-plugins/vite-openapi-plugin.d.ts +4 -0
  41. package/dist/src/vite-plugins/vite-openapi-plugin.js +58 -0
  42. package/dist/vue-foundation.css +1 -0
  43. package/dist/vue-foundation.es.js +1129 -0
  44. package/package.json +44 -16
  45. package/src/components/ajax-select.vue +44 -23
  46. package/src/components/alert-helpers.ts +45 -0
  47. package/src/components/alert-modal.vue +68 -0
  48. package/src/components/ez-smart-select.vue +51 -0
  49. package/src/components/index.ts +10 -0
  50. package/src/components/modal-container.ts +131 -0
  51. package/src/components/modal.vue +44 -129
  52. package/src/components/smart-select.vue +196 -243
  53. package/src/config.ts +15 -0
  54. package/src/directives/autofocus.ts +20 -0
  55. package/src/directives/confirm-button.ts +50 -0
  56. package/src/directives/date-input.ts +19 -0
  57. package/src/directives/datetime.ts +48 -0
  58. package/src/directives/disabled.ts +30 -0
  59. package/src/directives/duration.ts +79 -0
  60. package/src/directives/index.ts +37 -0
  61. package/src/directives/infinite-scroll.ts +9 -0
  62. package/src/directives/readonly.ts +15 -0
  63. package/src/directives/tooltip.ts +190 -0
  64. package/src/filters/index.ts +79 -0
  65. package/src/helpers/array.ts +7 -0
  66. package/src/helpers/context-menu.ts +108 -0
  67. package/src/helpers/delay.ts +2 -0
  68. package/src/helpers/error.ts +41 -0
  69. package/src/helpers/index.ts +9 -0
  70. package/src/helpers/mask.ts +105 -0
  71. package/src/helpers/number.ts +3 -0
  72. package/src/helpers/object.ts +19 -0
  73. package/src/helpers/openapi.ts +82 -0
  74. package/src/helpers/string.ts +27 -0
  75. package/src/hooks/index.ts +2 -0
  76. package/src/hooks/infinite-scroll.ts +107 -0
  77. package/src/hooks/resize-watcher.ts +8 -0
  78. package/src/index.ts +14 -0
  79. package/src/types.ts +14 -0
  80. package/src/vite-plugins/index.ts +2 -0
  81. package/src/vite-plugins/vite-openapi-plugin.ts +71 -0
  82. package/tsconfig.app.json +22 -0
  83. package/tsconfig.json +14 -0
  84. package/tsconfig.node.json +9 -0
  85. package/tsconfig.vite-plugins.json +10 -0
  86. package/tsconfig.vitest.json +9 -0
  87. package/vite.config.js +37 -35
  88. package/vitest.config.js +17 -0
  89. package/.eslintrc.js +0 -16
  90. package/CHANGES.md +0 -13
  91. package/postcss.config.cjs +0 -5
  92. package/src/app.js +0 -25
  93. package/src/components/alert.vue +0 -130
  94. package/src/components/index.js +0 -12
  95. package/src/config.js +0 -11
  96. package/src/directives/autofocus.js +0 -17
  97. package/src/directives/confirm-button.js +0 -40
  98. package/src/directives/date-input.js +0 -18
  99. package/src/directives/datetime.js +0 -46
  100. package/src/directives/disabled.js +0 -28
  101. package/src/directives/duration.js +0 -72
  102. package/src/directives/index.js +0 -10
  103. package/src/directives/infinite-scroll.js +0 -17
  104. package/src/directives/readonly.js +0 -17
  105. package/src/directives/tooltip.js +0 -178
  106. package/src/directives/user-text.js +0 -11
  107. package/src/filters/index.js +0 -82
  108. package/src/helpers/array.js +0 -99
  109. package/src/helpers/context-menu.js +0 -66
  110. package/src/helpers/delay.js +0 -3
  111. package/src/helpers/error.js +0 -36
  112. package/src/helpers/http.js +0 -44
  113. package/src/helpers/index.js +0 -9
  114. package/src/helpers/mask.js +0 -90
  115. package/src/helpers/number.js +0 -6
  116. package/src/helpers/string.js +0 -36
  117. package/src/helpers/vue.js +0 -5
  118. package/src/index.js +0 -33
  119. package/src/plugins/index.js +0 -10
  120. package/src/plugins/infinite-scroll/hook.js +0 -30
  121. package/src/plugins/infinite-scroll.js +0 -100
  122. package/src/plugins/resize-watcher.js +0 -28
package/src/index.js DELETED
@@ -1,33 +0,0 @@
1
- // REMINDER: if there is a node_modules folder here during development of another app linking to this dev build,
2
- // the 'Vue' imports here will _not_ be the same as the 'Vue' imports from the app due to absolute path differences
3
- // thus, nothing that's attached to Vue here will be attached to Vue there, and everything will be broken
4
-
5
- import './components';
6
- import './directives';
7
- import './helpers';
8
- import './plugins';
9
-
10
- import app, { setRootComponent } from './app';
11
- import vfConfig from './config';
12
- import { registerFilter, registerFilters } from './filters';
13
-
14
- export default {
15
- getApp,
16
- configure,
17
- mount,
18
- registerFilter,
19
- registerFilters
20
- };
21
-
22
- function configure(options) {
23
- vfConfig.set(options);
24
- }
25
-
26
- function mount(rootComponent, target) {
27
- setRootComponent(rootComponent);
28
- app.vm = app.mount(target);
29
- }
30
-
31
- function getApp() {
32
- return app;
33
- }
@@ -1,10 +0,0 @@
1
- import VueStash from 'vue-stash-nested';
2
-
3
- import app from '../app';
4
- app.use(VueStash);
5
-
6
- import InfiniteScroll from './infinite-scroll';
7
- app.use(InfiniteScroll);
8
-
9
- import ResizeWatcher from './resize-watcher';
10
- app.use(ResizeWatcher);
@@ -1,30 +0,0 @@
1
- // TODO: switch to intersection observer
2
-
3
- export default class InfiniteScrollHook {
4
- constructor(el, handler) {
5
- this.el = el;
6
- this.handler = handler;
7
-
8
- this.isTripped = false;
9
- this.onScroll = this._onScroll.bind(this);
10
- }
11
-
12
- install() {
13
- this.el.addEventListener('scroll', this.onScroll);
14
- }
15
-
16
- uninstall() {
17
- this.el.removeEventListener('scroll', this.onScroll);
18
- }
19
-
20
- _onScroll(e) {
21
- if (Math.ceil(this.el.scrollTop + this.el.clientHeight + 5) >= this.el.scrollHeight) {
22
- if (!this.isTripped) {
23
- this.handler(e);
24
- this.isTripped = true;
25
- }
26
- } else if (this.isTripped) {
27
- this.isTripped = false;
28
- }
29
- }
30
- }
@@ -1,100 +0,0 @@
1
- // TODO: switch to intersection observer
2
-
3
- import InfiniteScrollHook from './infinite-scroll/hook';
4
-
5
- class InfiniteScroll {
6
- static install(app) {
7
- const scrollableValues = ['auto', 'scroll'];
8
- const discoverScrollableAncestorEl = function (el) {
9
- el = el.parentElement;
10
- if (!el) return null;
11
-
12
- const computedStyle = window.getComputedStyle(el);
13
- if (
14
- scrollableValues.includes(computedStyle.overflow) ||
15
- scrollableValues.includes(computedStyle.overflowX) ||
16
- scrollableValues.includes(computedStyle.overflowY)
17
- ) {
18
- return el;
19
- }
20
-
21
- return discoverScrollableAncestorEl(el);
22
- };
23
-
24
- const installScrollHook = function () {
25
- if (this.$options.windowScrolledToBottom) {
26
- this._windowScrollHook = new InfiniteScrollHook(
27
- window,
28
- this.$options.windowScrolledToBottom.bind(this)
29
- );
30
- this._windowScrollHook.install();
31
- }
32
-
33
- if (this.$options.elScrolledToBottom) {
34
- this._elScrollHook = new InfiniteScrollHook(this.$el, this.$options.elScrolledToBottom.bind(this));
35
- this._elScrollHook.install();
36
- }
37
-
38
- if (this.$options.ancestorScrolledToBottom) {
39
- const scrollableAncestorEl = discoverScrollableAncestorEl(this.$el);
40
- if (scrollableAncestorEl) {
41
- this._ancestorScrollHook = new InfiniteScrollHook(
42
- scrollableAncestorEl,
43
- this.$options.ancestorScrolledToBottom.bind(this)
44
- );
45
- this._ancestorScrollHook.install();
46
- } else {
47
- console.warn('no scollable ancestor found for component:', this);
48
- }
49
- }
50
- };
51
-
52
- const reinstallScrollHook = function () {
53
- if (this._windowScrollHandler) {
54
- this._windowScrollHandler.install();
55
- }
56
-
57
- if (this._elScrollHandler) {
58
- this._elScrollHandler.install();
59
- }
60
-
61
- if (this._ancestorScrollHook) {
62
- this._ancestorScrollHook.install();
63
- }
64
- };
65
-
66
- const removeScrollHook = function () {
67
- if (this._windowScrollHandler) {
68
- this._windowScrollHandler.uninstall();
69
- }
70
-
71
- if (this._elScrollHandler) {
72
- this._elScrollHandler.uninstall();
73
- }
74
-
75
- if (this._ancestorScrollHook) {
76
- this._ancestorScrollHook.uninstall();
77
- }
78
- };
79
-
80
- app.mixin({
81
- mounted() {
82
- installScrollHook.call(this);
83
- },
84
-
85
- activated() {
86
- reinstallScrollHook.call(this);
87
- },
88
-
89
- deactivated() {
90
- removeScrollHook.call(this);
91
- },
92
-
93
- beforeUnmount() {
94
- removeScrollHook.call(this);
95
- }
96
- });
97
- }
98
- }
99
-
100
- export default InfiniteScroll;
@@ -1,28 +0,0 @@
1
- // TODO: find out if we can use the Vue options array for the functions instead of making them part of "methods"
2
-
3
- class ResizeWatcher {
4
- static install(app) {
5
- app.mixin({
6
- mounted() {
7
- if (this.$options.windowResized) {
8
- this._resizeWatcherHandler = this.$options.windowResized.bind(this);
9
- window.addEventListener('resize', this._resizeWatcherHandler);
10
- }
11
- },
12
-
13
- activated() {
14
- this._resizeWatcherHandler && window.addEventListener('resize', this._resizeWatcherHandler);
15
- },
16
-
17
- deactivated() {
18
- this._resizeWatcherHandler && window.removeEventListener('resize', this._resizeWatcherHandler);
19
- },
20
-
21
- beforeUnmount() {
22
- this._resizeWatcherHandler && window.removeEventListener('resize', this._resizeWatcherHandler);
23
- }
24
- });
25
- }
26
- }
27
-
28
- export default ResizeWatcher;