@witchcraft/ui 0.1.0 → 0.1.1

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 (138) hide show
  1. package/dist/module.json +2 -2
  2. package/dist/module.mjs +1 -1
  3. package/dist/runtime/components/Aria/Aria.vue +5 -9
  4. package/dist/runtime/components/Aria/Aria.vue.d.ts +5 -0
  5. package/dist/runtime/components/Icon/Icon.vue +10 -31
  6. package/dist/runtime/components/Icon/Icon.vue.d.ts +21 -0
  7. package/dist/runtime/components/LibButton/LibButton.vue +58 -77
  8. package/dist/runtime/components/LibButton/LibButton.vue.d.ts +36 -0
  9. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue +48 -75
  10. package/dist/runtime/components/LibCheckbox/LibCheckbox.vue.d.ts +42 -0
  11. package/dist/runtime/components/LibColorInput/LibColorInput.vue +63 -108
  12. package/dist/runtime/components/LibColorInput/LibColorInput.vue.d.ts +63 -0
  13. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue +271 -352
  14. package/dist/runtime/components/LibColorPicker/LibColorPicker.vue.d.ts +61 -0
  15. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +32 -57
  16. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue.d.ts +22 -0
  17. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue +17 -38
  18. package/dist/runtime/components/LibDatePicker/LibDatePicker.vue.d.ts +40 -0
  19. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue +53 -82
  20. package/dist/runtime/components/LibDatePicker/LibRangeDatePicker.vue.d.ts +34 -0
  21. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue +50 -67
  22. package/dist/runtime/components/LibDatePicker/LibSingleDatePicker.vue.d.ts +34 -0
  23. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue +7 -8
  24. package/dist/runtime/components/LibDatePicker/LibTimeZonePicker.vue.d.ts +22 -0
  25. package/dist/runtime/components/LibDebug/LibDebug.vue +42 -70
  26. package/dist/runtime/components/LibDebug/LibDebug.vue.d.ts +32 -0
  27. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue +18 -31
  28. package/dist/runtime/components/LibDevOnly/LibDevOnly.vue.d.ts +22 -0
  29. package/dist/runtime/components/LibFileInput/LibFileInput.vue +113 -157
  30. package/dist/runtime/components/LibFileInput/LibFileInput.vue.d.ts +43 -0
  31. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +215 -242
  32. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.vue.d.ts +165 -0
  33. package/dist/runtime/components/LibLabel/LibLabel.vue +30 -46
  34. package/dist/runtime/components/LibLabel/LibLabel.vue.d.ts +27 -0
  35. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue +44 -59
  36. package/dist/runtime/components/LibMultiValues/LibMultiValues.vue.d.ts +29 -0
  37. package/dist/runtime/components/LibNotifications/LibNotification.vue +32 -49
  38. package/dist/runtime/components/LibNotifications/LibNotification.vue.d.ts +17 -0
  39. package/dist/runtime/components/LibNotifications/LibNotifications.vue +63 -84
  40. package/dist/runtime/components/LibNotifications/LibNotifications.vue.d.ts +13 -0
  41. package/dist/runtime/components/LibPagination/LibPagination.vue +67 -112
  42. package/dist/runtime/components/LibPagination/LibPagination.vue.d.ts +104 -0
  43. package/dist/runtime/components/LibPalette/LibPalette.vue +20 -23
  44. package/dist/runtime/components/LibPalette/LibPalette.vue.d.ts +14 -0
  45. package/dist/runtime/components/LibPopup/LibPopup.vue +314 -352
  46. package/dist/runtime/components/LibPopup/LibPopup.vue.d.ts +46 -0
  47. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue +70 -92
  48. package/dist/runtime/components/LibProgressBar/LibProgressBar.vue.d.ts +41 -0
  49. package/dist/runtime/components/LibRecorder/LibRecorder.vue +133 -178
  50. package/dist/runtime/components/LibRecorder/LibRecorder.vue.d.ts +77 -0
  51. package/dist/runtime/components/LibRoot/LibRoot.vue +73 -100
  52. package/dist/runtime/components/LibRoot/LibRoot.vue.d.ts +41 -0
  53. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue +49 -78
  54. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.vue.d.ts +35 -0
  55. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue +123 -157
  56. package/dist/runtime/components/LibSuggestions/LibSuggestions.vue.d.ts +94 -0
  57. package/dist/runtime/components/LibTable/LibTable.vue +63 -100
  58. package/dist/runtime/components/LibTable/LibTable.vue.d.ts +45 -0
  59. package/dist/runtime/components/Template/NAME.vue +15 -36
  60. package/dist/runtime/components/Template/NAME.vue.d.ts +17 -0
  61. package/dist/runtime/components/TestControls/TestControls.vue +6 -9
  62. package/dist/runtime/components/TestControls/TestControls.vue.d.ts +5 -0
  63. package/dist/runtime/directives/vResizableCols.js +89 -83
  64. package/dist/types.d.mts +2 -6
  65. package/package.json +11 -11
  66. package/src/runtime/components/Focus.stories.ts +3 -2
  67. package/src/runtime/components/Icon/Icon.vue +0 -1
  68. package/src/runtime/components/LibButton/LibButton.vue +0 -1
  69. package/src/runtime/components/LibCheckbox/LibCheckbox.vue +0 -1
  70. package/src/runtime/components/LibColorInput/LibColorInput.vue +0 -1
  71. package/src/runtime/components/LibColorPicker/utils/safeConvertToHsva.ts +0 -1
  72. package/src/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.vue +0 -1
  73. package/src/runtime/components/LibFileInput/LibFileInput.vue +0 -1
  74. package/src/runtime/components/LibInputDeprecated/LibInputDeprecated.vue +0 -1
  75. package/src/runtime/components/LibMultiValues/LibMultiValues.vue +0 -1
  76. package/src/runtime/components/LibNotifications/LibNotification.vue +0 -1
  77. package/src/runtime/components/LibNotifications/LibNotifications.vue +0 -1
  78. package/src/runtime/components/LibPagination/LibPagination.vue +0 -1
  79. package/src/runtime/components/LibPopup/LibPopup.vue +0 -1
  80. package/src/runtime/components/LibProgressBar/LibProgressBar.vue +0 -1
  81. package/src/runtime/components/LibRecorder/LibRecorder.vue +0 -1
  82. package/src/runtime/components/LibSimpleInput/LibSimpleInput.vue +0 -1
  83. package/src/runtime/components/LibSuggestions/LibSuggestions.vue +0 -1
  84. package/src/runtime/components/LibTable/LibTable.vue +0 -1
  85. package/src/runtime/directives/vResizableCols.ts +79 -73
  86. package/dist/module.cjs +0 -5
  87. package/dist/module.d.ts +0 -36
  88. package/dist/runtime/components/Focus.stories.d.ts +0 -11
  89. package/dist/runtime/components/Focus.stories.js +0 -53
  90. package/dist/runtime/components/LibButton/LibButton.stories.d.ts +0 -12
  91. package/dist/runtime/components/LibButton/LibButton.stories.js +0 -94
  92. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.d.ts +0 -14
  93. package/dist/runtime/components/LibCheckbox/LibCheckbox.stories.js +0 -29
  94. package/dist/runtime/components/LibColorInput/LibColorInput.stories.d.ts +0 -7
  95. package/dist/runtime/components/LibColorInput/LibColorInput.stories.js +0 -58
  96. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.d.ts +0 -9
  97. package/dist/runtime/components/LibColorPicker/LibColorPicker.stories.js +0 -68
  98. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.d.ts +0 -7
  99. package/dist/runtime/components/LibDarkModeSwitcher/LibDarkModeSwitcher.stories.js +0 -36
  100. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.d.ts +0 -11
  101. package/dist/runtime/components/LibDatePicker/LibDatePicker.stories.js +0 -98
  102. package/dist/runtime/components/LibDebug/LibDebug.stories.d.ts +0 -9
  103. package/dist/runtime/components/LibDebug/LibDebug.stories.js +0 -46
  104. package/dist/runtime/components/LibFileInput/LibFileInput.stories.d.ts +0 -10
  105. package/dist/runtime/components/LibFileInput/LibFileInput.stories.js +0 -63
  106. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.d.ts +0 -33
  107. package/dist/runtime/components/LibInputDeprecated/LibInputDeprecated.stories.js +0 -384
  108. package/dist/runtime/components/LibLabel/LibLabel.stories.d.ts +0 -6
  109. package/dist/runtime/components/LibLabel/LibLabel.stories.js +0 -25
  110. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.d.ts +0 -23
  111. package/dist/runtime/components/LibMultiValues/LibMultiValues.stories.js +0 -61
  112. package/dist/runtime/components/LibNotifications/LibNotification.stories.d.ts +0 -15
  113. package/dist/runtime/components/LibNotifications/LibNotification.stories.js +0 -126
  114. package/dist/runtime/components/LibNotifications/LibNotifications.stories.d.ts +0 -6
  115. package/dist/runtime/components/LibNotifications/LibNotifications.stories.js +0 -109
  116. package/dist/runtime/components/LibPagination/LibPagination.stories.d.ts +0 -6
  117. package/dist/runtime/components/LibPagination/LibPagination.stories.js +0 -40
  118. package/dist/runtime/components/LibPalette/LibPalette.stories.d.ts +0 -6
  119. package/dist/runtime/components/LibPalette/LibPalette.stories.js +0 -20
  120. package/dist/runtime/components/LibPopup/LibPopup.stories.d.ts +0 -14
  121. package/dist/runtime/components/LibPopup/LibPopup.stories.js +0 -147
  122. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.d.ts +0 -10
  123. package/dist/runtime/components/LibProgressBar/LibProgressBar.stories.js +0 -81
  124. package/dist/runtime/components/LibRecorder/LibRecorder.stories.d.ts +0 -19
  125. package/dist/runtime/components/LibRecorder/LibRecorder.stories.js +0 -63
  126. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.d.ts +0 -26
  127. package/dist/runtime/components/LibSimpleInput/LibSimpleInput.stories.js +0 -78
  128. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.d.ts +0 -27
  129. package/dist/runtime/components/LibSuggestions/LibSuggestions.stories.js +0 -112
  130. package/dist/runtime/components/LibTable/LibTable.stories.d.ts +0 -16
  131. package/dist/runtime/components/LibTable/LibTable.stories.js +0 -156
  132. package/dist/runtime/components/Reset.stories.d.ts +0 -5
  133. package/dist/runtime/components/Reset.stories.js +0 -19
  134. package/dist/runtime/components/Scrolling.stories.d.ts +0 -6
  135. package/dist/runtime/components/Scrolling.stories.js +0 -44
  136. package/dist/runtime/composables/useScrollNearContainerEdges.stories.d.ts +0 -7
  137. package/dist/runtime/composables/useScrollNearContainerEdges.stories.js +0 -85
  138. package/dist/types.d.ts +0 -7
@@ -1,81 +0,0 @@
1
- import { onUnmounted, ref } from "vue";
2
- import LibProgressBar from "./LibProgressBar.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibProgressBar,
6
- title: "Components/ProgressBar",
7
- args: {
8
- label: "Label",
9
- // @ts-expect-error .
10
- _timeout: 1e3,
11
- _add: 10,
12
- _start: 50
13
- }
14
- };
15
- export default meta;
16
- export const Primary = {
17
- render: (args) => ({
18
- components,
19
- setup: () => {
20
- const progress = ref(args._start);
21
- if (args.progress) {
22
- progress.value = args.progress;
23
- } else {
24
- const interval = setInterval(() => {
25
- if (progress.value >= 100) {
26
- progress.value = 0;
27
- } else {
28
- progress.value += args._add;
29
- }
30
- }, args._timeout);
31
- onUnmounted(() => {
32
- clearInterval(interval);
33
- });
34
- }
35
- return {
36
- args: { ...args },
37
- progress
38
- };
39
- },
40
- template: `
41
- <lib-progress-bar class="flex-1" v-bind="args" :progress="progress"></lib-progress-bar>
42
- <br/>
43
- Stretched in flexbox:
44
- <div class="flex w-full">
45
- <lib-progress-bar class="flex-1" v-bind="args" :progress="progress"></lib-progress-bar>
46
- </div>
47
- `
48
- })
49
- };
50
- export const Secondary = {
51
- ...Primary,
52
- args: {
53
- ...Primary.args
54
- }
55
- };
56
- export const ReallyLongLabel = {
57
- ...Primary,
58
- args: {
59
- ...Primary.args,
60
- label: "Really Long Label Label to See Effect Really Long Label Label to See Effect Really Long Label Label to See Effect Really Long Label Label to See Effect"
61
- }
62
- };
63
- export const Static = {
64
- ...Primary,
65
- args: {
66
- ...Primary.args,
67
- progress: 50
68
- }
69
- };
70
- export const AutoHiding = {
71
- ...Primary,
72
- args: {
73
- ...Primary.args,
74
- autohideOnComplete: 500,
75
- clamp: [10, 100],
76
- _start: 0,
77
- // keepSpaceWhenHidden: true,
78
- _timeout: 1e3,
79
- _add: 10
80
- }
81
- };
@@ -1,19 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import * as components from "../index.js.js";
3
- /**
4
- * This is a special input component designed to record any type of event.
5
- *
6
- * It requires additional setup to actually work since what and how anything is recorded is up to the needs of the application.
7
- *
8
- * This basic implementation just lists the keys. Enter accepts the recording, escape cancels back to the initial value.
9
- */
10
- declare const meta: Meta<typeof components.LibRecorder>;
11
- export default meta;
12
- type Story = StoryObj<typeof components.LibRecorder>;
13
- export declare const Primary: Story;
14
- /** Should not be tabbable or recordable. */
15
- export declare const Disabled: Story;
16
- /** *Should* be tabbable but not recordable. */
17
- export declare const Readonly: Story;
18
- /** Height should not shrink. */
19
- export declare const EmptyInitialValue: Story;
@@ -1,63 +0,0 @@
1
- import { ref, watchEffect } from "vue";
2
- import { createRecorderHandler, createRecorderWatchEffect } from "../../helpers/storybook.js";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: components.LibRecorder,
6
- title: "Components/Recorder",
7
- args: {
8
- label: "Some Label",
9
- recordingTitle: "Recording. Press enter or click away to accept. Press escape to cancel.",
10
- modelValue: "K E Y S"
11
- }
12
- };
13
- export default meta;
14
- export const Primary = {
15
- render: (args) => ({
16
- components,
17
- setup: () => {
18
- const recording = ref(false);
19
- const recordingValue = ref("");
20
- const modelValue = ref(args.modelValue);
21
- const recorderEl = ref(null);
22
- const recorder = createRecorderHandler(recordingValue, recording, modelValue, recorderEl);
23
- watchEffect(createRecorderWatchEffect(recordingValue, recording, modelValue));
24
- return {
25
- args,
26
- modelValue,
27
- recorder,
28
- recording,
29
- recordingValue,
30
- recorderEl
31
- };
32
- },
33
- template: `
34
- <lib-recorder
35
- v-bind="args"
36
- v-extract-root-el="_ => recorderEl = _"
37
- :recordingValue="recordingValue"
38
- :recorder="recorder"
39
- v-model:recording="recording"
40
- v-model="modelValue"
41
- @recorder:click="recording = !recording"
42
- />
43
- `
44
- })
45
- };
46
- export const Disabled = {
47
- ...Primary,
48
- args: {
49
- disabled: true
50
- }
51
- };
52
- export const Readonly = {
53
- ...Primary,
54
- args: {
55
- readonly: true
56
- }
57
- };
58
- export const EmptyInitialValue = {
59
- ...Primary,
60
- args: {
61
- modelValue: ""
62
- }
63
- };
@@ -1,26 +0,0 @@
1
- import type { StoryObj } from "@storybook/vue3";
2
- import * as components from "../index.js.js";
3
- declare const meta: {
4
- component: any;
5
- title: string;
6
- args: {
7
- modelValue: string;
8
- placeholder: string;
9
- };
10
- };
11
- export default meta;
12
- type Story = StoryObj<typeof components.LibSimpleInput>;
13
- /** Input */
14
- export declare const Primary: Story;
15
- /** Has more reasonable min-width inside a flexbox. */
16
- export declare const InsideAFlexbox: Story;
17
- export declare const Disabled: any;
18
- export declare const Readonly: any;
19
- export declare const Invalid: any;
20
- /**
21
- * Intended for being wrapped.
22
- * Should not have any border or focus outline styles.
23
- */
24
- export declare const Borderless: any;
25
- export declare const Numerical: any;
26
- export declare const NumericalInsideAFlexbox: any;
@@ -1,78 +0,0 @@
1
- import * as components from "../index.js";
2
- const meta = {
3
- component: components.LibSimpleInput,
4
- title: "Components/Input",
5
- args: {
6
- modelValue: "Value",
7
- placeholder: "Placeholder"
8
- }
9
- };
10
- export default meta;
11
- export const Primary = {
12
- args: {
13
- modelValue: "some value"
14
- },
15
- render: (args) => ({
16
- components,
17
- // eslint-disable-next-line no-console
18
- setup: () => ({ args, test: () => console.log("Enter") }),
19
- template: `
20
- <lib-simple-input
21
- @keydown="test"
22
- class="m-2" v-bind="args" v-model="args.modelValue" ></lib-simple-input>
23
- <lib-simple-input class="m-2" v-bind="{...args, modelValue:''}" ></lib-simple-input>
24
- `
25
- })
26
- };
27
- export const InsideAFlexbox = {
28
- render: (args) => ({
29
- components,
30
- setup: () => ({ args }),
31
- template: `
32
- Inside a flexbox:
33
- <div class="flex flex-wrap">
34
- <lib-simple-input v-bind="args" v-model="args.modelValue"></lib-simple-input>
35
- <div class="border-1 border-danger-500 flex-1 whitespace-nowrap">Flex Grow: 1</div>
36
- </div>
37
- `
38
- }),
39
- args: {
40
- stretch: true
41
- }
42
- };
43
- export const Disabled = {
44
- ...Primary,
45
- args: {
46
- disabled: true
47
- }
48
- };
49
- export const Readonly = {
50
- ...Primary,
51
- args: {
52
- readonly: true
53
- }
54
- };
55
- export const Invalid = {
56
- ...Primary,
57
- args: {
58
- valid: false
59
- }
60
- };
61
- export const Borderless = {
62
- ...Primary,
63
- args: {
64
- border: false
65
- }
66
- };
67
- export const Numerical = {
68
- ...Primary,
69
- args: {
70
- type: "number"
71
- }
72
- };
73
- export const NumericalInsideAFlexbox = {
74
- ...InsideAFlexbox,
75
- args: {
76
- type: "number"
77
- }
78
- };
@@ -1,27 +0,0 @@
1
- import type { StoryObj } from "@storybook/vue3";
2
- import LibSuggestions from "./LibSuggestions.vue.js";
3
- declare const meta: {
4
- component: any;
5
- title: string;
6
- args: {
7
- id: string;
8
- modelValue: string;
9
- label: string;
10
- border: boolean;
11
- suggestions: string[];
12
- };
13
- };
14
- export default meta;
15
- type Story = StoryObj<typeof LibSuggestions>;
16
- /**
17
- * The suggestions component is just the dropdown part.
18
- *
19
- * Here it is decoupled from the input.
20
- *
21
- * More examples can be found in the input component.
22
- */
23
- export declare const Primary: Story;
24
- export declare const RestrictToSuggestions: Story;
25
- export declare const AlwaysShowAllSuggestions: any;
26
- export declare const AlwaysShowAllSuggestionsAndNoRestrictToSuggestions: any;
27
- export declare const CustomSuggestionsObject: any;
@@ -1,112 +0,0 @@
1
- import { computed, onMounted, ref } from "vue";
2
- import LibSuggestions from "./LibSuggestions.vue";
3
- import * as components from "../index.js";
4
- const meta = {
5
- component: LibSuggestions,
6
- title: "Components/Suggestions",
7
- args: {
8
- id: "some-id",
9
- modelValue: "",
10
- label: "Some Label",
11
- border: true,
12
- suggestions: ["A", "AB", "ABC", "B", "BC", "C", "ABCDEFGHIJKLMNOPQRSTUVWXYZ"]
13
- }
14
- };
15
- export default meta;
16
- export const Primary = {
17
- render: (args) => ({
18
- components: { ...components, LibSuggestions },
19
- setup: () => {
20
- const inputValue = ref(args.modelValue);
21
- const modelValue = ref(args.modelValue);
22
- const drawer = ref(null);
23
- const keydownHandler = (e) => {
24
- drawer.value?.inputKeydownHandler(e);
25
- };
26
- const suggestions = computed(() => drawer.value?.suggestions);
27
- const blurHandler = (e) => {
28
- drawer.value?.inputBlurHandler(e);
29
- };
30
- onMounted(() => {
31
- drawer.value?.suggestions.open();
32
- });
33
- return {
34
- args,
35
- inputValue,
36
- modelValue,
37
- isOpen: ref(false),
38
- suggestions,
39
- drawer,
40
- keydownHandler,
41
- blurHandler
42
- };
43
- },
44
- template: `
45
- <div class="flex flex-col gap-3">
46
- Temporary Value: {{inputValue}}
47
- <br/>
48
- Model Value (Final Value): <span class="inline-block" data-testid="model-value">{{modelValue}}</span>
49
-
50
-
51
- <br/>
52
- Selected: {{suggestions?.filtered[suggestions.active]}}
53
- <label>Some Label</label>
54
- <lib-simple-input
55
- :class="isOpen ? 'open' : ''"
56
- v-model="inputValue"
57
- @focus="suggestions.open()"
58
- @blur="blurHandler"
59
- @keydown="keydownHandler"
60
- ></lib-simple-input>
61
- <lib-suggestions
62
- ref="drawer"
63
- v-bind="{...args}"
64
- @update:isOpen="isOpen = $event"
65
- v-model="modelValue"
66
- v-model:inputValue="inputValue"
67
- >
68
- <template #item={item}>
69
- {{item}}
70
- </template>
71
- </lib-suggestions>
72
- </div>
73
- `
74
- })
75
- };
76
- export const RestrictToSuggestions = {
77
- ...Primary,
78
- args: {
79
- ...Primary.args,
80
- restrictToSuggestions: true
81
- }
82
- };
83
- export const AlwaysShowAllSuggestions = {
84
- ...Primary,
85
- args: {
86
- ...Primary.args,
87
- restrictToSuggestions: true,
88
- suggestionsFilter: (_input, items) => items
89
- }
90
- };
91
- export const AlwaysShowAllSuggestionsAndNoRestrictToSuggestions = {
92
- ...Primary,
93
- args: {
94
- ...Primary.args,
95
- restrictToSuggestions: false,
96
- suggestionsFilter: (_input, items) => items
97
- }
98
- };
99
- export const CustomSuggestionsObject = {
100
- ...Primary,
101
- args: {
102
- ...Primary.args,
103
- restrictToSuggestions: true,
104
- suggestions: [
105
- { label: "A", other: "some data A" },
106
- { label: "AB", other: "some data AB" },
107
- { label: "ABC", other: "some data ABC" },
108
- { label: "ABCDEFGHIJKLMNOPQRSTUVWXYZ", other: "some data ABCDEFGHIJKLMNOPQRSTUVWXYZ" }
109
- ],
110
- suggestionLabel: (item) => item.label
111
- }
112
- };
@@ -1,16 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- import LibTable from "./LibTable.vue.js";
3
- declare const meta: Meta<typeof LibTable>;
4
- export default meta;
5
- type Story = StoryObj<typeof LibTable>;
6
- export declare const Primary: Story;
7
- export declare const NoCellBorders: Story;
8
- export declare const NoBorders: Story;
9
- export declare const NoCellBordersNoBorders: Story;
10
- export declare const SquareBorders: Story;
11
- export declare const NoHeader: Story;
12
- export declare const NoHeaderNoBorders: Story;
13
- export declare const NoHeaderNoCellBorders: Story;
14
- export declare const FitWidthFalse: Story;
15
- export declare const ThreeColSomeColsNotResizable: Story;
16
- export declare const FourColSomeColsNotResizable: Story;
@@ -1,156 +0,0 @@
1
- import LibTable from "./LibTable.vue";
2
- import * as components from "../index.js";
3
- const meta = {
4
- component: LibTable,
5
- title: "Components/Table"
6
- };
7
- export default meta;
8
- export const Primary = {
9
- render: (args) => ({
10
- components,
11
- setup: () => ({ args }),
12
- template: `
13
- <div class="overflow-x-scroll scrollbar-hidden">
14
- <lib-table
15
- v-bind="args"
16
- >
17
- </lib-table>
18
- </div>
19
- `
20
- }),
21
- args: {
22
- cols: ["prop1", "prop2", "prop3"],
23
- values: [
24
- { prop1: "Item1 Prop 1", prop2: "Item1 Prop 2", prop3: "Item1 Prop 3" },
25
- { prop1: "Item2 Prop 1", prop2: "Item2 Prop 2", prop3: "Item2 Prop 3" },
26
- { prop1: "Item3 Prop 1", prop2: "Item3 Prop 2", prop3: "Item3 Prop 3" }
27
- ],
28
- colConfig: { prop1: { name: "Header 1" }, prop2: { name: "Header 2" } },
29
- itemKey: "prop1"
30
- }
31
- };
32
- export const NoCellBorders = {
33
- ...Primary,
34
- args: {
35
- ...Primary.args,
36
- cellBorder: false
37
- }
38
- };
39
- export const NoBorders = {
40
- ...Primary,
41
- args: {
42
- ...Primary.args,
43
- border: false
44
- }
45
- };
46
- export const NoCellBordersNoBorders = {
47
- ...Primary,
48
- args: {
49
- ...Primary.args,
50
- cellBorder: false,
51
- border: false
52
- }
53
- };
54
- export const SquareBorders = {
55
- ...Primary,
56
- args: {
57
- ...Primary.args,
58
- rounded: false
59
- }
60
- };
61
- export const NoHeader = {
62
- ...Primary,
63
- args: {
64
- ...Primary.args,
65
- header: false
66
- }
67
- };
68
- export const NoHeaderNoBorders = {
69
- ...Primary,
70
- args: {
71
- ...Primary.args,
72
- header: false,
73
- border: false
74
- }
75
- };
76
- export const NoHeaderNoCellBorders = {
77
- ...Primary,
78
- args: {
79
- ...Primary.args,
80
- header: false,
81
- cellBorder: false
82
- }
83
- };
84
- export const FitWidthFalse = {
85
- ...Primary,
86
- args: {
87
- ...Primary.args,
88
- resizable: {
89
- fitWidth: false
90
- }
91
- }
92
- };
93
- export const ThreeColSomeColsNotResizable = {
94
- render: (args) => ({
95
- components,
96
- setup: () => ({ args }),
97
- template: `
98
- <lib-table
99
- v-bind="args"
100
- >
101
- </lib-table>
102
- <br>
103
- <lib-table
104
- v-bind="{...args, colConfig:args.colConfig2}"
105
- >
106
- </lib-table>
107
- <br>
108
- <lib-table
109
- v-bind="{...args, colConfig:args.colConfig3}"
110
- >
111
- </lib-table>
112
- `
113
- }),
114
- args: {
115
- cols: ["prop1", "prop2", "prop3"],
116
- itemKey: "prop1",
117
- values: [
118
- { prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3" }
119
- ],
120
- colConfig: { prop1: { name: "No Resize", resizable: false } },
121
- colConfig2: { prop2: { name: "No Resize", resizable: false } },
122
- colConfig3: { prop3: { name: "No Resize", resizable: false } }
123
- }
124
- };
125
- export const FourColSomeColsNotResizable = {
126
- render: (args) => ({
127
- components,
128
- setup: () => ({ args }),
129
- template: `
130
- <lib-table
131
- v-bind="args"
132
- >
133
- </lib-table>
134
- <br>
135
- <lib-table
136
- v-bind="{...args, colConfig:args.colConfig2}"
137
- >
138
- </lib-table>
139
- <br>
140
- <lib-table
141
- v-bind="{...args, colConfig:args.colConfig3}"
142
- >
143
- </lib-table>
144
- `
145
- }),
146
- args: {
147
- cols: ["prop1", "prop2", "prop3", "prop4"],
148
- values: [
149
- { prop1: "Prop 1", prop2: "Prop 2", prop3: "Prop 3", prop4: "Prop 4" }
150
- ],
151
- itemKey: "prop1",
152
- colConfig: { prop1: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
153
- colConfig2: { prop2: { name: "No Resize", resizable: false }, prop3: { name: "No Resize", resizable: false } },
154
- colConfig3: { prop1: { name: "No Resize", resizable: false }, prop4: { name: "No Resize", resizable: false } }
155
- }
156
- };
@@ -1,5 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- declare const meta: Meta<{}>;
3
- export default meta;
4
- type Story = StoryObj<{}>;
5
- export declare const Primary: Story;
@@ -1,19 +0,0 @@
1
- const meta = {
2
- title: "Other/Reset",
3
- args: {}
4
- };
5
- export default meta;
6
- export const Primary = {
7
- render: (args) => ({
8
- setup: () => ({ args }),
9
- template: `
10
- <h1>h1 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h1>
11
- <h2>h2 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h2>
12
- <h3>h3 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h3>
13
- <h4>h4 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h4>
14
- <h5>h5 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h5>
15
- <h6>h6 Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</h6>
16
- <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer ullamcorper est at dui eleifend, et egestas libero gravida. Phasellus non erat pretium, commodo massa sit amet, accumsan nisl.</p>
17
- `
18
- })
19
- };
@@ -1,6 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/vue3";
2
- declare const meta: Meta<{}>;
3
- export default meta;
4
- type Story = StoryObj<{}>;
5
- export declare const Scrollbars: Story;
6
- export declare const TextareaResizer: Story;
@@ -1,44 +0,0 @@
1
- const meta = {
2
- title: "Other/Scrolling",
3
- args: {}
4
- };
5
- export default meta;
6
- export const Scrollbars = {
7
- render: (args) => ({
8
- setup: () => ({ args }),
9
- template: `
10
- <div
11
- class="
12
- relative
13
- flex
14
- flex-col
15
- max-h-[300px]
16
- max-w-[300px]
17
- border-2
18
- border-neutral-500
19
- "
20
-
21
- >
22
- <div
23
- class="overflow-auto"
24
- >
25
- <div class="h-[1000px] w-[1000px]"/>
26
- </div>
27
- </div>
28
- `
29
- })
30
- };
31
- export const TextareaResizer = {
32
- render: (args) => ({
33
- setup: () => ({ args }),
34
- template: `
35
- <textarea class="
36
- border-2
37
- border-neutral-500
38
- min-w-[200px]
39
- min-h-[200px]
40
- [resize:both]
41
- " />
42
- `
43
- })
44
- };
@@ -1,7 +0,0 @@
1
- import type { StoryObj } from "@storybook/vue3";
2
- declare const meta: {
3
- title: string;
4
- };
5
- export default meta;
6
- type Story = StoryObj;
7
- export declare const Primary: Story;