@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
@@ -0,0 +1,14 @@
1
+ import type { OptionalKeysOf, RequiredKeysOf } from 'type-fest';
2
+ export type Branded<T, A> = A & {
3
+ __brand: T;
4
+ };
5
+ export type BrandOf<A> = [A] extends [Branded<infer R, unknown>] ? R : never;
6
+ export type Debrand<A> = A extends Branded<BrandOf<A>, infer R> ? R : never;
7
+ export type PickRequired<T> = T extends object ? Pick<T, RequiredKeysOf<T>> : never;
8
+ export type PickOptional<T> = T extends object ? Pick<T, OptionalKeysOf<T>> : never;
9
+ export type WithoutNever<T> = {
10
+ [P in keyof T as T[P] extends never ? never : P]: T[P];
11
+ };
12
+ export type UnwrapBrand<T, B> = WithoutNever<{
13
+ [K in keyof T]: BrandOf<T[K]> extends B ? Debrand<T[K]> : never;
14
+ }>;
@@ -0,0 +1 @@
1
+ export * from './vite-openapi-plugin.js';
@@ -0,0 +1,2 @@
1
+ // todo: dunno why this needs .JS, but Vite panics with ERR_MODULE_NOT_FOUND if we don't
2
+ export * from './vite-openapi-plugin.js';
@@ -0,0 +1,4 @@
1
+ export declare function openapiClientGeneratorPlugin(openapiYamlPath: string): {
2
+ name: string;
3
+ closeBundle(): void;
4
+ };
@@ -0,0 +1,58 @@
1
+ import { createHash } from 'node:crypto';
2
+ import { existsSync, readFileSync, watch } from 'node:fs';
3
+ import { rmdir } from 'node:fs/promises';
4
+ import * as OpenAPI from 'openapi-typescript-codegen';
5
+ let generatedHash = null;
6
+ export function openapiClientGeneratorPlugin(openapiYamlPath) {
7
+ const generator = getGenerator(openapiYamlPath);
8
+ return {
9
+ name: 'openapi-types-generator',
10
+ closeBundle() {
11
+ generator?.close();
12
+ }
13
+ };
14
+ }
15
+ function getGenerator(openapiYamlPath) {
16
+ if (!existsSync(openapiYamlPath)) {
17
+ console.log(`OpenAPI YAML file not found: ${openapiYamlPath}`);
18
+ return null;
19
+ }
20
+ const watcher = watch(openapiYamlPath);
21
+ watcher.on('change', () => {
22
+ // give the writes a moment to settle
23
+ setTimeout(() => generateClient(openapiYamlPath), 100);
24
+ });
25
+ generateClient(openapiYamlPath);
26
+ return {
27
+ close() {
28
+ watcher.close();
29
+ }
30
+ };
31
+ }
32
+ async function generateClient(openapiYamlPath) {
33
+ const yaml = readFileSync(openapiYamlPath, 'utf8');
34
+ const hash = createHash('sha256').update(yaml).digest('hex');
35
+ if (hash === generatedHash) {
36
+ return;
37
+ }
38
+ generatedHash = hash;
39
+ try {
40
+ try {
41
+ await rmdir('./src/openapi-client-generated', { recursive: true });
42
+ }
43
+ catch (e) {
44
+ // ignore
45
+ }
46
+ await OpenAPI.generate({
47
+ input: openapiYamlPath,
48
+ output: './src/openapi-client-generated',
49
+ clientName: 'ApiClient',
50
+ useOptions: true,
51
+ useUnionTypes: true
52
+ });
53
+ console.log(`[${new Date().toISOString()}] Generated client from ${openapiYamlPath} to ./src/openapi-client/`);
54
+ }
55
+ catch (err) {
56
+ console.error(`[${new Date().toISOString()}] Error generating client from ${openapiYamlPath}:`, err);
57
+ }
58
+ }
@@ -0,0 +1 @@
1
+ .vf-overlay{position:fixed;top:0;left:0;width:100%;height:100%;z-index:100}.vf-modal-wrap{background:rgba(0,0,0,.25);display:flex;justify-content:center;align-items:center}.vf-modal{background:white;box-shadow:0 3px 6px #00000026;min-width:200px;max-width:95%;max-height:95%;display:flex;flex-direction:column}.vf-modal-header,.vf-modal-footer{flex-shrink:0;position:relative}.vf-modal.scrolls>.vf-modal-content{overflow:auto;flex-grow:1;flex-shrink:1;flex-basis:0%}.vf-modal-wrap.vf-alert .vf-modal{max-width:800px}.vf-modal-wrap.vf-alert .vf-modal>.vf-modal-content{padding:12px}.vf-modal-wrap.vf-alert.wait .vf-modal-content{text-align:center}.vf-modal-wrap.vf-alert.destructive button.primary{color:red}.vf-smart-select{position:relative}.vf-smart-select input{width:100%;padding-right:24px!important}.vf-smart-select input.nullable::placeholder{color:#000}.vf-smart-select:after{content:" ";display:block;position:absolute;top:50%;right:8px;margin-top:-3px;width:0;height:0;border-style:solid;border-width:5px 5px 0 5px;border-color:#333333 transparent transparent transparent;pointer-events:none}.vf-smart-select.open:after{margin-top:-4px;border-width:0 5px 5px 5px;border-color:transparent transparent #333333 transparent}.vf-smart-select:not(.disabled) input{cursor:pointer}.vf-smart-select.disabled:after{opacity:.4}.vf-smart-select-options{visibility:hidden;position:absolute;min-height:20px;border:1px solid #e8e8e8;background:white;overflow:auto;z-index:101}.vf-smart-select-options .option,.vf-smart-select-options .no-results{padding:5px 8px}.vf-smart-select-options .option{cursor:pointer}.vf-smart-select-options .option.highlighted{background-color:#f5f5f5}