@bagelink/vue 0.0.140 → 0.0.145

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 (55) hide show
  1. package/dist/components/FormSchema.vue.d.ts +2 -2
  2. package/dist/components/FormSchema.vue.d.ts.map +1 -1
  3. package/dist/components/Modal.vue.d.ts.map +1 -1
  4. package/dist/components/ModalForm.vue.d.ts.map +1 -1
  5. package/dist/components/formkit/FileUploader.vue.d.ts +4 -4
  6. package/dist/components/formkit/FileUploader.vue.d.ts.map +1 -1
  7. package/dist/index.cjs +43 -15
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.mjs +44 -16
  10. package/dist/plugins/modal.d.ts.map +1 -1
  11. package/dist/style.css +1376 -57
  12. package/dist/utils/index.d.ts +1 -0
  13. package/dist/utils/index.d.ts.map +1 -1
  14. package/package.json +2 -2
  15. package/src/components/FormSchema.vue +1 -1
  16. package/src/components/Modal.vue +21 -8
  17. package/src/components/ModalForm.vue +23 -8
  18. package/src/components/formkit/FileUploader.vue +2 -2
  19. package/src/index.ts +1 -0
  20. package/src/plugins/modal.ts +12 -10
  21. package/src/styles/bagel.css +37 -0
  22. package/src/styles/buttons.css +56 -0
  23. package/src/styles/fonts/Ploni/ploni-black.eot +0 -0
  24. package/src/styles/fonts/Ploni/ploni-black.woff +0 -0
  25. package/src/styles/fonts/Ploni/ploni-black.woff2 +0 -0
  26. package/src/styles/fonts/Ploni/ploni-bold.eot +0 -0
  27. package/src/styles/fonts/Ploni/ploni-bold.woff +0 -0
  28. package/src/styles/fonts/Ploni/ploni-bold.woff2 +0 -0
  29. package/src/styles/fonts/Ploni/ploni-demibold.eot +0 -0
  30. package/src/styles/fonts/Ploni/ploni-demibold.woff +0 -0
  31. package/src/styles/fonts/Ploni/ploni-demibold.woff2 +0 -0
  32. package/src/styles/fonts/Ploni/ploni-light.eot +0 -0
  33. package/src/styles/fonts/Ploni/ploni-light.woff +0 -0
  34. package/src/styles/fonts/Ploni/ploni-light.woff2 +0 -0
  35. package/src/styles/fonts/Ploni/ploni-medium.eot +0 -0
  36. package/src/styles/fonts/Ploni/ploni-medium.woff +0 -0
  37. package/src/styles/fonts/Ploni/ploni-medium.woff2 +0 -0
  38. package/src/styles/fonts/Ploni/ploni-regular.eot +0 -0
  39. package/src/styles/fonts/Ploni/ploni-regular.woff +0 -0
  40. package/src/styles/fonts/Ploni/ploni-regular.woff2 +0 -0
  41. package/src/styles/fonts/Ploni/ploni-ultrabold.eot +0 -0
  42. package/src/styles/fonts/Ploni/ploni-ultrabold.woff +0 -0
  43. package/src/styles/fonts/Ploni/ploni-ultrabold.woff2 +0 -0
  44. package/src/styles/fonts/Ploni/ploni-ultralight.eot +0 -0
  45. package/src/styles/fonts/Ploni/ploni-ultralight.woff +0 -0
  46. package/src/styles/fonts/Ploni/ploni-ultralight.woff2 +0 -0
  47. package/src/styles/fonts/Ploni.css +71 -0
  48. package/src/styles/inputs.css +315 -0
  49. package/src/styles/layout.css +268 -0
  50. package/src/styles/modal.css +55 -54
  51. package/src/styles/scrollbar.css +18 -0
  52. package/src/styles/text.css +35 -0
  53. package/src/styles/theme.css +736 -0
  54. package/src/styles/transitions.css +47 -0
  55. package/src/utils/index.ts +6 -0
@@ -5,5 +5,6 @@ export declare function computeFields(modelValue: Record<string, any>): BagelFie
5
5
  export declare const copyText: (text: string, cb?: ((msg: string) => void) | undefined) => Promise<void>;
6
6
  export declare const useFormkit: () => unknown;
7
7
  export declare const initials: (...strArr: string[]) => string;
8
+ export declare function useEscape(event: KeyboardEvent, closeModel: () => void): void;
8
9
  export { formatString } from './strings';
9
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,WAG3B,CAAC;AAEZ,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,EAAE,CAmB3E;AAED,eAAO,MAAM,QAAQ,SACd,MAAM,cAED,MAAM,KAAK,IAAI,+BAI1B,CAAC;AAEF,eAAO,MAAM,UAAU,eAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAAe,MAAM,EAAE,WAAiD,CAAC;AAE9F,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAGhD,eAAO,MAAM,QAAQ,OAAQ,MAAM,IAAI,yBAGtC,CAAC;AAEF,eAAO,MAAM,UAAU,QAAS,MAAM,WAG3B,CAAC;AAEZ,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,UAAU,EAAE,CAmB3E;AAED,eAAO,MAAM,QAAQ,SACd,MAAM,cAED,MAAM,KAAK,IAAI,+BAI1B,CAAC;AAEF,eAAO,MAAM,UAAU,eAGtB,CAAC;AAEF,eAAO,MAAM,QAAQ,cAAe,MAAM,EAAE,WAAiD,CAAC;AAE9F,wBAAgB,SAAS,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,IAAI,QAIrE;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bagelink/vue",
3
3
  "type": "module",
4
- "version": "0.0.140",
4
+ "version": "0.0.145",
5
5
  "description": "Bagel core sdk packages",
6
6
  "author": {
7
7
  "name": "Neveh Allon",
@@ -51,7 +51,7 @@
51
51
  "./vite.config.ts"
52
52
  ],
53
53
  "dependencies": {
54
- "vue": "^3.3.8"
54
+ "vue": "^3.3.9"
55
55
  },
56
56
  "devDependencies": {
57
57
  "@vue-macros/reactivity-transform": "^0.4.0"
@@ -43,7 +43,7 @@ const props = withDefaults(defineProps<{
43
43
  // eslint-disable-next-line no-unused-vars
44
44
  onDelete?: ((id: string) => void);
45
45
  // eslint-disable-next-line no-unused-vars
46
- i18nT: (key: string) => string;
46
+ i18nT?: (key: string) => string;
47
47
  }>(), {
48
48
  i18nT: (key: string) => key,
49
49
  });
@@ -31,8 +31,8 @@
31
31
  </template>
32
32
 
33
33
  <script lang="ts" setup>
34
- import { onMounted } from 'vue';
35
- import { type BtnOptions, Btn } from '@bagelink/vue';
34
+ import { onMounted, onUnmounted } from 'vue';
35
+ import { type BtnOptions, Btn, useEscape } from '@bagelink/vue';
36
36
  import '../styles/modal.css';
37
37
 
38
38
  defineProps<{
@@ -44,12 +44,6 @@ defineProps<{
44
44
 
45
45
  let isActive = $ref<boolean>(false);
46
46
 
47
- onMounted(() => {
48
- setTimeout(() => {
49
- isActive = true;
50
- }, 1);
51
- });
52
-
53
47
  const emit = defineEmits(['update:isModalVisible']);
54
48
 
55
49
  const closeModal = () => {
@@ -58,4 +52,23 @@ const closeModal = () => {
58
52
  emit('update:isModalVisible', false);
59
53
  }, 200);
60
54
  };
55
+
56
+ const escapeKeyClose = (e: KeyboardEvent) => useEscape(e, () => closeModal());
57
+
58
+ onMounted(() => {
59
+ setTimeout(() => {
60
+ isActive = true;
61
+ }, 1);
62
+
63
+ document.addEventListener(
64
+ 'keydown',
65
+ escapeKeyClose,
66
+ );
67
+ });
68
+ onUnmounted(() => {
69
+ document.removeEventListener(
70
+ 'keydown',
71
+ escapeKeyClose,
72
+ );
73
+ });
61
74
  </script>
@@ -34,8 +34,10 @@
34
34
 
35
35
  <script lang="ts" setup>
36
36
  import { type FormKitSchemaDefinition } from '@formkit/core';
37
- import { onMounted } from 'vue';
38
- import { Btn, FormSchema, BtnOptions } from '@bagelink/vue';
37
+ import { onMounted, onUnmounted } from 'vue';
38
+ import {
39
+ Btn, FormSchema, BtnOptions, useEscape,
40
+ } from '@bagelink/vue';
39
41
  import '../styles/modal.css';
40
42
 
41
43
  // import { BagelField } from '@bagelink/vue';
@@ -62,12 +64,6 @@ const computedFormSchema = $computed(() => {
62
64
 
63
65
  let isActive = $ref<boolean>(false);
64
66
 
65
- onMounted(() => {
66
- setTimeout(() => {
67
- isActive = true;
68
- }, 1);
69
- });
70
-
71
67
  const emit = defineEmits(['update:isModalVisible', 'update:modelValue']);
72
68
  const handleEmit = (value: any) => {
73
69
  emit('update:modelValue', value);
@@ -93,6 +89,25 @@ const runDelete = () => {
93
89
  props.onDelete?.(props.modelValue?.id);
94
90
  closeModal();
95
91
  };
92
+
93
+ const escapeKeyClose = (e: KeyboardEvent) => useEscape(e, () => closeModal());
94
+
95
+ onMounted(() => {
96
+ setTimeout(() => {
97
+ isActive = true;
98
+ }, 1);
99
+
100
+ document.addEventListener(
101
+ 'keydown',
102
+ escapeKeyClose,
103
+ );
104
+ });
105
+ onUnmounted(() => {
106
+ document.removeEventListener(
107
+ 'keydown',
108
+ escapeKeyClose,
109
+ );
110
+ });
96
111
  </script>
97
112
 
98
113
  <style scoped>
@@ -106,8 +106,8 @@ const files = $ref<UploadFile[]>([]);
106
106
 
107
107
  const props = withDefaults(defineProps<{
108
108
  context: Record<string, any>;
109
- dragDropLabel: string;
110
- browseLabel: string;
109
+ dragDropLabel?: string;
110
+ browseLabel?: string;
111
111
  }>(), {
112
112
  dragDropLabel: 'Drag and drop your files here',
113
113
  browseLabel: 'or browse',
package/src/index.ts CHANGED
@@ -5,3 +5,4 @@ export { ModalPlugin, useModal } from './plugins/modal';
5
5
  export * from './utils';
6
6
  export * from './types';
7
7
  export * from './components';
8
+ import './styles/bagel.css';
@@ -1,5 +1,5 @@
1
1
  import {
2
- h, InjectionKey, ref, inject, defineComponent,
2
+ h, InjectionKey, inject, defineComponent,
3
3
  } from 'vue';
4
4
  import type { Plugin } from 'vue';
5
5
  import type { BtnOptions } from '@bagelink/vue';
@@ -51,30 +51,32 @@ interface ModalComponentProps {
51
51
 
52
52
  export const ModalPlugin: Plugin = {
53
53
  install: (app) => {
54
- const modalStack = ref<ModalComponentProps[]>([]);
54
+ const modalStack = $ref<ModalComponentProps[]>([]);
55
+
56
+ const hideModal = (index: number) => {
57
+ // console.log('hideModal', index);
58
+ modalStack.splice(index, 1);
59
+ };
60
+
55
61
  const showModal = (
56
62
  isForm: boolean,
57
63
  options: ModalOptions | ModalFormOptions,
58
64
  slots: Record<string, any> = {},
59
65
  ) => {
60
- modalStack.value.push({
66
+ modalStack.push({
61
67
  modalOptions: options,
62
68
  isModalForm: isForm,
63
69
  componentSlots: slots,
64
70
  });
65
71
  };
66
72
 
67
- const hideModal = (index: number) => {
68
- // console.log('hideModal', index);
69
- modalStack.value.splice(index, 1);
70
- };
71
-
72
73
  app.provide(ModalSymbol, {
73
74
  modalForm: (options: ModalFormOptions, slots?: Record<string, any>) => showModal(true, options, slots),
74
75
  showModal: (options: ModalOptions, slots?: Record<string, any>) => showModal(false, options, slots),
75
- hideModal: (index = modalStack.value.length - 1) => hideModal(index),
76
+ hideModal: (index = modalStack.length - 1) => hideModal(index),
76
77
  // modalOptions,
77
78
  });
79
+
78
80
  const ModalComponent = defineComponent({
79
81
  data() {
80
82
  return {
@@ -82,7 +84,7 @@ export const ModalPlugin: Plugin = {
82
84
  };
83
85
  },
84
86
  render() {
85
- return modalStack.value.map((modal, index) => {
87
+ return modalStack.map((modal, index) => {
86
88
  const renderComponent = modal.isModalForm ? ModalForm : Modal;
87
89
  return h(
88
90
  renderComponent,
@@ -0,0 +1,37 @@
1
+ @import "layout.css";
2
+ @import "inputs.css";
3
+ @import "buttons.css";
4
+ @import "text.css";
5
+ @import "scrollbar.css";
6
+ @import "theme.css";
7
+ @import "transitions.css";
8
+ @import "./fonts/Ploni.css";
9
+
10
+ :root {
11
+ --transition: all 0.2s cubic-bezier(0.1, 0.5, 0.33, 1);
12
+ --transition-ease: cubic-bezier(0.1, 0.5, 0.33, 1);
13
+ }
14
+
15
+ body {
16
+ width: 100vw;
17
+ height: 100vh;
18
+ padding: 0;
19
+ margin: 0;
20
+ }
21
+
22
+ @media (min-width: 992px) {}
23
+
24
+ @media screen and (max-width: 910px) {
25
+
26
+ body {
27
+ min-height: 100vh;
28
+ min-height: -webkit-fill-available;
29
+ height: -webkit-fill-available;
30
+
31
+ }
32
+
33
+ html {
34
+ height: -webkit-fill-available;
35
+
36
+ }
37
+ }
@@ -0,0 +1,56 @@
1
+ button,
2
+ .btn,
3
+ .btn-txt,
4
+ .btn-icon {
5
+ font-family: inherit;
6
+ white-space: nowrap;
7
+ cursor: pointer;
8
+ box-sizing: border-box;
9
+ user-select: none;
10
+ border: none;
11
+ transition: var(--bgl-transition);
12
+ border-radius: var(--btn-border-radius);
13
+ line-height: var(--btn-height);
14
+ font-size: var(--input-font-size);
15
+ display: inline-block;
16
+ height: var(--btn-height);
17
+ padding: 0
18
+ }
19
+
20
+ .btn-close {
21
+ margin-top: -20px;
22
+ margin-inline-end: -20px;
23
+ margin-inline-start: auto;
24
+ margin-bottom: 15px;
25
+ transition: var(--bgl-transition);
26
+ height: 30px;
27
+ width: 30px;
28
+ opacity: 0.6;
29
+ cursor: pointer;
30
+ border-radius: 100%;
31
+ outline: 2px solid transparent;
32
+ display: flex;
33
+ align-items: center;
34
+ justify-content: center;
35
+ }
36
+
37
+ .btn-close:hover {
38
+ background: var(--bgl-gray-light);
39
+ opacity: 1;
40
+ }
41
+
42
+ .btn-close:active {
43
+ background: var(--bgl-gray);
44
+ }
45
+
46
+ .btn-close::before {
47
+ content: "close";
48
+ font-family: "Material Symbols Outlined", serif;
49
+ }
50
+
51
+
52
+ @media screen and (max-width: 910px) {
53
+ .btn {
54
+ padding: 0 20px;
55
+ }
56
+ }
@@ -0,0 +1,71 @@
1
+ @font-face {
2
+ font-family: 'Ploni';
3
+ font-style: normal;
4
+ font-weight: 200;
5
+ font-stretch: 100%;
6
+ font-display: swap;
7
+ src: url(./Ploni/ploni-ultralight.woff2) format('woff2'), url(./Ploni/ploni-ultralight.woff) format('woff'), url(./Ploni/ploni-ultralight.eot) format('eot')
8
+ }
9
+
10
+ @font-face {
11
+ font-family: 'Ploni';
12
+ font-style: normal;
13
+ font-weight: 300;
14
+ font-stretch: 100%;
15
+ font-display: swap;
16
+ src: url(./Ploni/ploni-light.woff2) format('woff2'), url(./Ploni/ploni-light.woff) format('woff'), url(./Ploni/ploni-light.eot) format('eot')
17
+ }
18
+
19
+ @font-face {
20
+ font-family: 'Ploni';
21
+ font-style: normal;
22
+ font-weight: 400;
23
+ font-stretch: 100%;
24
+ font-display: swap;
25
+ src: url(./Ploni/ploni-regular.woff2) format('woff2'), url(./Ploni/ploni-regular.woff) format('woff'), url(./Ploni/ploni-regular.eot) format('eot')
26
+ }
27
+
28
+ @font-face {
29
+ font-family: 'Ploni';
30
+ font-style: normal;
31
+ font-weight: 500;
32
+ font-stretch: 100%;
33
+ font-display: swap;
34
+ src: url(./Ploni/ploni-medium.woff2) format('woff2'), url(./Ploni/ploni-medium.woff) format('woff'), url(./Ploni/ploni-medium.eot) format('eot')
35
+ }
36
+
37
+ @font-face {
38
+ font-family: 'Ploni';
39
+ font-style: normal;
40
+ font-weight: 600;
41
+ font-stretch: 100%;
42
+ font-display: swap;
43
+ src: url(./Ploni/ploni-demibold.woff2) format('woff2'), url(./Ploni/ploni-demibold.woff) format('woff'), url(./Ploni/ploni-demibold.eot) format('eot')
44
+ }
45
+
46
+ @font-face {
47
+ font-family: 'Ploni';
48
+ font-style: normal;
49
+ font-weight: 700;
50
+ font-stretch: 100%;
51
+ font-display: swap;
52
+ src: url(./Ploni/ploni-bold.woff2) format('woff2'), url(./Ploni/ploni-bold.woff) format('woff'), url(./Ploni/ploni-bold.eot) format('eot')
53
+ }
54
+
55
+ @font-face {
56
+ font-family: 'Ploni';
57
+ font-style: normal;
58
+ font-weight: 800;
59
+ font-stretch: 100%;
60
+ font-display: swap;
61
+ src: url(./Ploni/ploni-ultrabold.woff2) format('woff2'), url(./Ploni/ploni-ultrabold.woff) format('woff'), url(./Ploni/ploni-ultrabold.eot) format('eot')
62
+ }
63
+
64
+ @font-face {
65
+ font-family: 'Ploni';
66
+ font-style: normal;
67
+ font-weight: 900;
68
+ font-stretch: 100%;
69
+ font-display: swap;
70
+ src: url(./Ploni/ploni-black.woff2) format('woff2'), url(./Ploni/ploni-black.woff) format('woff'), url(./Ploni/ploni-black.eot) format('eot')
71
+ }