sprintify-ui 0.11.33 → 0.12.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.
@@ -25,6 +25,18 @@ interface Props {
25
25
  * Flatten the Gantt chart by removing the hierarchy of rows and displaying all items in a single list. This is useful when there's only one level of rows and you want to maximize the vertical space.
26
26
  */
27
27
  flatten?: boolean;
28
+ /**
29
+ * Start with every row collapsed (items hidden) by default.
30
+ */
31
+ rowsCollapsedByDefault?: boolean;
32
+ /**
33
+ * Show row bar labels rendered outside the bar.
34
+ */
35
+ showRowBarLabels?: boolean;
36
+ /**
37
+ * Show item bar labels rendered outside the bar.
38
+ */
39
+ showItemBarLabels?: boolean;
28
40
  /**
29
41
  * Relationships between items, drawn as arrows from one item to another.
30
42
  */
@@ -55,6 +67,9 @@ declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {},
55
67
  sidebarWidth: number;
56
68
  rowHeight: number;
57
69
  includeToday: boolean;
70
+ rowsCollapsedByDefault: boolean;
71
+ showRowBarLabels: boolean;
72
+ showItemBarLabels: boolean;
58
73
  relationships: GanttRelationship[];
59
74
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
60
75
  declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
@@ -2,12 +2,6 @@ import { Size } from '@/utils/sizes';
2
2
  import { ToolbarOption } from '@/types/ToolbarOption';
3
3
  type __VLS_Props = {
4
4
  modelValue: string | null | undefined;
5
- driver?: 'ckeditor' | 'tiptap';
6
- /**
7
- * Defines the CKEditor layout style.
8
- * Only applicable when `driver` is 'ckeditor'.
9
- */
10
- editor?: 'classic' | 'inline' | 'balloon';
11
5
  size?: Size;
12
6
  toolbar?: ToolbarOption[] | string[];
13
7
  placeholder?: string;
@@ -35,7 +29,5 @@ declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {
35
29
  name: string;
36
30
  hasError: boolean;
37
31
  toolbar: ToolbarOption[] | string[];
38
- editor: "classic" | "inline" | "balloon";
39
- driver: "ckeditor" | "tiptap";
40
32
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
41
33
  export default _default;
@@ -4,7 +4,8 @@ type __VLS_Props = {
4
4
  hasError?: boolean;
5
5
  disabled?: boolean;
6
6
  placeholder?: string;
7
- toolbar?: string[];
7
+ toolbar?: string[] | 'simple' | 'complete';
8
+ noMargin?: boolean;
8
9
  };
9
10
  declare const _default: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
10
11
  "update:modelValue": (...args: any[]) => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sprintify-ui",
3
- "version": "0.11.33",
3
+ "version": "0.12.0",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "generate-llm-txt": "node scripts/generate-llm-txt.js",
@@ -16,13 +16,11 @@
16
16
  "vue-tsc": "vue-tsc"
17
17
  },
18
18
  "peerDependencies": {
19
- "@ckeditor/ckeditor5-vue": "^7.3.0",
20
19
  "@tailwindcss/aspect-ratio": "^0.4.2",
21
20
  "@tailwindcss/forms": "^0.5.3",
22
21
  "@tailwindcss/typography": "^0.5.8",
23
22
  "@vueuse/core": "^10.0.0",
24
23
  "axios": "^0.26.1 || ^1.0.0",
25
- "ckeditor5": "^47.3.0",
26
24
  "croppie": "^2.6.5",
27
25
  "flatpickr": "^4.6.13",
28
26
  "humanize-duration": "^3.0.0",
@@ -47,7 +45,6 @@
47
45
  },
48
46
  "devDependencies": {
49
47
  "@babel/core": "^7.24.0",
50
- "@ckeditor/ckeditor5-vue": "^7.3.0",
51
48
  "@commitlint/cli": "^17.8.1",
52
49
  "@commitlint/config-conventional": "^17.8.1",
53
50
  "@iconify/vue": "^4.1.1",
@@ -77,7 +74,6 @@
77
74
  "autoprefixer": "^10.4.18",
78
75
  "axios": "^0.26.1",
79
76
  "babel-loader": "^8.3.0",
80
- "ckeditor5": "^47.3.0",
81
77
  "croppie": "^2.6.5",
82
78
  "cz-conventional-changelog": "^3.3.0",
83
79
  "eslint": "^8.57.0",
@@ -1,291 +1,4 @@
1
1
  body {
2
- .base-rich-text {
3
-
4
- &.error {
5
- .ck.ck-editor__top .ck-sticky-panel .ck-sticky-panel__content, .ck.ck-editor__main > .ck-editor__editable:not(.ck-focused) {
6
- @apply border-red-500;
7
- }
8
- }
9
-
10
- /** Style Prose */
11
- .ck-content {
12
-
13
- @apply p-3.5;
14
-
15
- @apply leading-snug;
16
-
17
- h1, h2, h3, h4, h5, h6 {
18
- @apply font-bold leading-snug tracking-normal;
19
- margin-top: 0;
20
- margin-bottom: 0.375em;
21
- }
22
-
23
- h1 {
24
- @apply text-4xl;
25
- }
26
-
27
- h2 {
28
- @apply text-3xl;
29
- }
30
-
31
- h3 {
32
- @apply text-2xl;
33
- }
34
-
35
- h4 {
36
- @apply text-xl;
37
- }
38
-
39
- h5 {
40
- @apply text-lg;
41
- }
42
-
43
- h6 {
44
- @apply text-base;
45
- }
46
-
47
- p {
48
- @apply text-base leading-snug;
49
- margin: 1em 0;
50
- }
51
-
52
- h1,
53
- h2,
54
- h3,
55
- h4,
56
- h5,
57
- h6,
58
- p {
59
- &:first-child {
60
- margin-top: 0;
61
- }
62
- }
63
-
64
- ol,
65
- ul {
66
- @apply text-base leading-snug;
67
- padding-left: 1.5em;
68
- margin-bottom: 1em;
69
-
70
- li {
71
- @apply leading-snug;
72
- margin: 0.3em 0;
73
-
74
- &::before {
75
- @apply text-slate-500;
76
- width: 2em;
77
- left: 3em;
78
- text-align: left;
79
- position: absolute;
80
- }
81
- }
82
- }
83
-
84
- blockquote {
85
- @apply text-base bg-slate-100;
86
- margin: 1em 0;
87
- padding: 1em;
88
- }
89
-
90
- a {
91
- @apply text-blue-600 underline;
92
- }
93
- }
94
- }
95
-
96
- /* Size: xs */
97
- .base-rich-text-xs {
98
- .ck-content {
99
-
100
- @apply p-2.5;
101
-
102
- h1 {
103
- @apply text-2xl;
104
- }
105
-
106
- h2 {
107
- @apply text-xl;
108
- }
109
-
110
- h3 {
111
- @apply text-lg;
112
- }
113
-
114
- h4 {
115
- @apply text-base;
116
- }
117
-
118
- p {
119
- @apply text-xs;
120
- }
121
-
122
- ol,
123
- ul {
124
- li {
125
- @apply text-xs;
126
- }
127
- }
128
-
129
- blockquote {
130
- @apply text-xs;
131
- }
132
-
133
- pre, .ql-syntax {
134
- @apply text-xs;
135
- }
136
- }
137
-
138
-
139
- }
140
-
141
- /* Size: sm */
142
- .base-rich-text-sm {
143
- .ck-content {
144
-
145
- @apply p-3;
146
-
147
- h1 {
148
- @apply text-3xl;
149
- }
150
-
151
- h2 {
152
- @apply text-2xl;
153
- }
154
-
155
- h3 {
156
- @apply text-xl;
157
- }
158
-
159
- h4 {
160
- @apply text-lg;
161
- }
162
-
163
- p {
164
- @apply text-sm;
165
- }
166
-
167
- ol,
168
- ul {
169
- li {
170
- @apply text-sm;
171
- }
172
- }
173
-
174
- blockquote {
175
- @apply text-sm;
176
- }
177
-
178
- pre, .ql-syntax {
179
- @apply text-sm;
180
- }
181
- }
182
- }
183
-
184
- /* Size: md */
185
- .base-rich-text-md {
186
-
187
- }
188
-
189
- /* Size: lg */
190
- .base-rich-text-lg {
191
- .ck-content {
192
-
193
- @apply p-5;
194
-
195
- h1 {
196
- @apply text-5xl;
197
- }
198
-
199
- h2 {
200
- @apply text-4xl;
201
- }
202
-
203
- h3 {
204
- @apply text-3xl;
205
- }
206
-
207
- h4 {
208
- @apply text-2xl;
209
- }
210
-
211
- p {
212
- @apply text-lg;
213
- }
214
-
215
- ol,
216
- ul {
217
- li {
218
- @apply text-lg;
219
- }
220
- }
221
-
222
- blockquote {
223
- @apply text-lg;
224
- }
225
-
226
- pre, .ql-syntax {
227
- @apply text-lg;
228
- }
229
- }
230
- }
231
-
232
- /* Size: xl */
233
- .base-rich-text-xl {
234
- .ck-content {
235
-
236
- @apply p-6;
237
-
238
- h1 {
239
- @apply text-6xl;
240
- }
241
-
242
- h2 {
243
- @apply text-5xl;
244
- }
245
-
246
- h3 {
247
- @apply text-2xl;
248
- }
249
-
250
- h4 {
251
- @apply text-xl;
252
- }
253
-
254
- p {
255
- @apply text-xl;
256
- }
257
-
258
- ol,
259
- ul {
260
- li {
261
- @apply text-xl;
262
- }
263
- }
264
-
265
- blockquote {
266
- @apply text-xl;
267
- }
268
-
269
- pre, .ql-syntax {
270
- @apply text-xl;
271
- }
272
- }
273
- }
274
-
275
- .base-rich-text-no-margin {
276
- .ck-content {
277
- h1, h2, h3, h4, h5, h6, p, ol, ul {
278
- margin: 0;
279
- }
280
-
281
- ol, ul {
282
- li {
283
- margin: 0;
284
- }
285
- }
286
- }
287
- }
288
- }
289
2
 
290
3
  /** TipTap */
291
4
 
@@ -317,3 +30,16 @@ body .tiptap {
317
30
  pointer-events: none;
318
31
  }
319
32
  }
33
+ }
34
+
35
+ body .tip-tap-no-margin .prose {
36
+ h1, h2, h3, h4, h5, h6, p, ol, ul {
37
+ margin: 0;
38
+ }
39
+
40
+ ol, ul {
41
+ li {
42
+ margin: 0;
43
+ }
44
+ }
45
+ }
@@ -11,9 +11,6 @@
11
11
  /** BaseCropper */
12
12
  @import "croppie/croppie.css";
13
13
 
14
- /** CK Editor */
15
- @import 'ckeditor5/ckeditor5.css';
16
-
17
14
  /** Global styles */
18
15
 
19
16
  @import "./flatpickr.css";
@@ -46,7 +46,6 @@ for (let i = 0; i < 10; i++) {
46
46
  id: i + 1,
47
47
  name: `Project sdf sdfg sdf gsdf gsdf gsdf g sdf sdf sdfg dsfg dsfg ${i + 1}`,
48
48
  items: items,
49
- height: 30,
50
49
  });
51
50
  }
52
51
 
@@ -55,7 +54,7 @@ export default {
55
54
  component: BaseGantt,
56
55
  args: {
57
56
  rows,
58
- maxHeight: 300,
57
+ maxHeight: 400,
59
58
  },
60
59
  };
61
60
 
@@ -62,7 +62,7 @@
62
62
  :row="row"
63
63
  >
64
64
  <div class="px-1 py-1 h-full flex items-center">
65
- <p class="font-semibold leading-tight truncate text-xs">
65
+ <p class="font-medium leading-tight truncate text-[13px]">
66
66
  {{ row.name }}
67
67
  </p>
68
68
  </div>
@@ -86,7 +86,7 @@
86
86
  :item="item"
87
87
  >
88
88
  <div class="pr-1 pl-4 py-1 h-full flex items-center">
89
- <p class="leading-tight truncate text-slate-600 text-xs">
89
+ <p class="leading-tight truncate text-slate-600 text-[13px]">
90
90
  {{ item.name }}
91
91
  </p>
92
92
  </div>
@@ -204,7 +204,7 @@
204
204
  >
205
205
  <button
206
206
  type="button"
207
- class="absolute flex"
207
+ class="absolute flex overflow-visible"
208
208
  :style="{
209
209
  transform: `translate(${row.x}px, ${row.y}px)`,
210
210
  height: row.barHeight + 'px',
@@ -218,19 +218,19 @@
218
218
  :row="row"
219
219
  >
220
220
  <div
221
- :style="{
222
- backgroundColor: 'gray',
223
- }"
224
- class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
221
+ class="relative w-full h-full hover:opacity-80 duration-200 text-slate-500"
225
222
  >
226
- <p
227
- class="text-white text-xs px-2 py-1 truncate"
228
- style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
229
- >
230
- {{ row.name }}
231
- </p>
223
+ <div class="absolute left-0 right-0 top-1/2 -translate-y-1/2 border-t-2 border-current" />
224
+ <div class="absolute left-0 top-1/2 -translate-y-1/2 h-3 border-l-2 border-current" />
225
+ <div class="absolute right-0 top-1/2 -translate-y-1/2 h-3 border-r-2 border-current" />
232
226
  </div>
233
227
  </slot>
228
+ <p
229
+ v-if="props.showRowBarLabels"
230
+ class="absolute left-full ml-2 top-1/2 -translate-y-1/2 text-[13px] leading-tight font-semibold text-slate-900 whitespace-nowrap max-w-[320px] truncate"
231
+ >
232
+ {{ row.name }}
233
+ </p>
234
234
  </button>
235
235
  </div>
236
236
 
@@ -245,7 +245,7 @@
245
245
  >
246
246
  <button
247
247
  type="button"
248
- class="absolute flex"
248
+ class="absolute flex overflow-visible"
249
249
  :style="{
250
250
  transform: `translate(${item.x}px, ${item.y}px)`,
251
251
  height: item.barHeight + 'px',
@@ -263,15 +263,14 @@
263
263
  backgroundColor: item.color,
264
264
  }"
265
265
  class="flex w-full h-full items-center rounded hover:opacity-80 duration-200"
266
- >
267
- <p
268
- class="text-white text-xs px-2 py-1 truncate"
269
- style="text-shadow: 0.5px 0.5px rgba(0,0,0,0.1);"
270
- >
271
- {{ item.name }}
272
- </p>
273
- </div>
266
+ />
274
267
  </slot>
268
+ <p
269
+ v-if="props.showItemBarLabels"
270
+ class="absolute left-full ml-2 top-1/2 -translate-y-1/2 text-[13px] leading-tight text-slate-700 whitespace-nowrap max-w-[320px] truncate"
271
+ >
272
+ {{ item.name }}
273
+ </p>
275
274
  </button>
276
275
  </div>
277
276
  </div>
@@ -427,6 +426,18 @@ interface Props {
427
426
  * Flatten the Gantt chart by removing the hierarchy of rows and displaying all items in a single list. This is useful when there's only one level of rows and you want to maximize the vertical space.
428
427
  */
429
428
  flatten?: boolean;
429
+ /**
430
+ * Start with every row collapsed (items hidden) by default.
431
+ */
432
+ rowsCollapsedByDefault?: boolean;
433
+ /**
434
+ * Show row bar labels rendered outside the bar.
435
+ */
436
+ showRowBarLabels?: boolean;
437
+ /**
438
+ * Show item bar labels rendered outside the bar.
439
+ */
440
+ showItemBarLabels?: boolean;
430
441
  /**
431
442
  * Relationships between items, drawn as arrows from one item to another.
432
443
  */
@@ -438,6 +449,9 @@ const props = withDefaults(defineProps<Props>(), {
438
449
  rowHeight: 40,
439
450
  maxHeight: undefined,
440
451
  includeToday: true,
452
+ rowsCollapsedByDefault: false,
453
+ showRowBarLabels: true,
454
+ showItemBarLabels: true,
441
455
  relationships: () => [],
442
456
  });
443
457
 
@@ -494,7 +508,9 @@ function init() {
494
508
 
495
509
  nowLine.value = format.nowLine;
496
510
 
497
- expandedRows.value = new Set(props.rows.map((r) => r.id));
511
+ expandedRows.value = props.rowsCollapsedByDefault
512
+ ? new Set<string | number>()
513
+ : new Set(props.rows.map((r) => r.id));
498
514
 
499
515
  // Scroll to now line
500
516
 
@@ -19,10 +19,6 @@ export default {
19
19
  placeholder: "This is a custom placeholder...",
20
20
  },
21
21
  argTypes: {
22
- driver: {
23
- control: { type: "select" },
24
- options: ["ckeditor", "tiptap"],
25
- },
26
22
  editor: {
27
23
  control: { type: "select" },
28
24
  options: ["classic", "inline", "balloon"],
@@ -47,35 +43,22 @@ const Template = (args) => ({
47
43
  `,
48
44
  });
49
45
 
50
- export const TipTapEditor = Template.bind({});
51
- TipTapEditor.args = {
52
- driver: "tiptap",
53
- };
54
-
55
- export const ClassicEditor = Template.bind({});
56
- ClassicEditor.args = {
57
- editor: "classic",
58
- };
59
-
60
- export const InlineEditor = Template.bind({});
61
- InlineEditor.args = {
62
- editor: "inline",
46
+ export const Demo = Template.bind({});
47
+ Demo.args = {
63
48
  };
64
49
 
65
- export const BalloonEditor = Template.bind({});
66
- BalloonEditor.args = {
67
- editor: "balloon",
50
+ export const NoMargin = Template.bind({});
51
+ NoMargin.args = {
52
+ noMargin: true,
68
53
  };
69
54
 
70
55
  export const CustomToolbar = Template.bind({});
71
56
  CustomToolbar.args = {
72
- editor: "classic",
73
57
  toolbar: [
74
58
  "bold",
75
59
  "italic",
76
60
  "underline",
77
61
  "strikethrough",
78
- "|",
79
62
  "undo",
80
63
  "redo",
81
64
  ]
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div v-if="driver == 'tiptap'">
2
+ <div>
3
3
  <BaseTipTap
4
4
  :model-value="modelValue"
5
5
  :size="sizeInternal"
@@ -7,36 +7,10 @@
7
7
  :has-error="hasErrorInternal"
8
8
  :placeholder="placeholder"
9
9
  :toolbar="toolbar"
10
+ :no-margin="noMargin"
10
11
  @update:model-value="emitUpdate"
11
12
  />
12
13
  </div>
13
- <div
14
- v-else
15
- class="base-rich-text relative"
16
- :class="[
17
- hasErrorInternal ? 'error' : '',
18
- sizeInternal == 'xs' ? 'base-rich-text-xs' : '',
19
- sizeInternal == 'sm' ? 'base-rich-text-sm' : '',
20
- sizeInternal == 'md' ? 'base-rich-text-base' : '',
21
- sizeInternal == 'lg' ? 'base-rich-text-lg' : '',
22
- sizeInternal == 'xl' ? 'base-rich-text-xl' : '',
23
- props.noMargin ? 'base-rich-text-no-margin' : '',
24
- ]"
25
- >
26
- <BaseCkeditor
27
- ref="baseCkeditorRef"
28
- :model-value="modelValue"
29
- :editor="editor"
30
- :size="sizeInternal"
31
- :toolbar="toolbar"
32
- :placeholder="placeholder"
33
- :disabled="disabled"
34
- @update:model-value="emitUpdate"
35
- @focus="emit('focus', $event)"
36
- @blur="emit('blur', $event)"
37
- @input="emit('input', $event)"
38
- />
39
- </div>
40
14
  </template>
41
15
 
42
16
  <script lang="ts" setup>
@@ -45,16 +19,8 @@ import { Size } from '@/utils/sizes';
45
19
  import { ToolbarOption } from '@/types/ToolbarOption';
46
20
  import BaseTipTap from './BaseTipTap.vue';
47
21
 
48
- const BaseCkeditor = defineAsyncComponent(() => import('./BaseCkeditor.vue'));
49
-
50
22
  const props = withDefaults(defineProps<{
51
23
  modelValue: string | null | undefined;
52
- driver?: 'ckeditor' | 'tiptap';
53
- /**
54
- * Defines the CKEditor layout style.
55
- * Only applicable when `driver` is 'ckeditor'.
56
- */
57
- editor?: 'classic' | 'inline' | 'balloon';
58
24
  size?: Size;
59
25
  toolbar?: ToolbarOption[] | string[];
60
26
  placeholder?: string;
@@ -64,7 +30,6 @@ const props = withDefaults(defineProps<{
64
30
  hasError?: boolean;
65
31
  noMargin?: boolean;
66
32
  }>(), {
67
- driver: 'ckeditor',
68
33
  editor: 'classic',
69
34
  size: 'md',
70
35
  toolbar: undefined,
@@ -77,7 +42,7 @@ const props = withDefaults(defineProps<{
77
42
 
78
43
  const emit = defineEmits(['update:modelValue', 'focus', 'blur', 'input']);
79
44
 
80
- const { nameInternal, requiredInternal, hasErrorInternal, emitUpdate, sizeInternal, addBeforeSubmitListener } =
45
+ const { hasErrorInternal, emitUpdate, sizeInternal } =
81
46
  useField({
82
47
  name: computed(() => props.name),
83
48
  required: computed(() => props.required),
@@ -86,19 +51,4 @@ const { nameInternal, requiredInternal, hasErrorInternal, emitUpdate, sizeIntern
86
51
  emit: emit,
87
52
  });
88
53
 
89
- const baseCkeditorRef = ref<InstanceType<typeof BaseCkeditor> | null>(null);
90
-
91
- // This make sure that the latest editor data is emitted when the form is submitted
92
- // If the user types really fast, then press submit really fast, the editor data might not be up to date
93
- // This is a workaround to make sure that the latest data is emitted
94
- addBeforeSubmitListener(() => {
95
- if (!baseCkeditorRef.value) {
96
- return;
97
- }
98
-
99
- const latestData = baseCkeditorRef.value.getEditorData();
100
-
101
- emitUpdate(latestData);
102
- });
103
-
104
54
  </script>