@avakhula/ui 0.1.22 → 0.1.24

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 (115) hide show
  1. package/dist/App.js +23 -0
  2. package/dist/EventEmmiter.js +33 -0
  3. package/dist/chunks/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/chunks/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  5. package/dist/chunks/floating-ui.dom-D8OVFdyL.js +861 -0
  6. package/dist/chunks/vue-quill.esm-bundler-FvTqp_xR.js +9070 -0
  7. package/dist/components/Accordion/Accordion.js +81 -0
  8. package/dist/components/Alert/Alert.js +121 -0
  9. package/dist/components/Alert/constants.js +10 -0
  10. package/dist/components/Avatar/Avatar.js +75 -0
  11. package/dist/components/Avatar/constants.js +12 -0
  12. package/dist/components/Badge/Badge.js +29 -0
  13. package/dist/components/Breadcrumbs/Breadcrumbs.js +117 -0
  14. package/dist/components/Button/Button.js +140 -0
  15. package/dist/components/Button/constants.js +11 -0
  16. package/dist/components/ButtonGroup/ButtonGroup.js +14 -0
  17. package/dist/components/Chips/Chips.js +65 -0
  18. package/dist/components/Dropdown/Dropdown.js +228 -0
  19. package/dist/components/Dropdown/DropdownDivider.js +10 -0
  20. package/dist/components/Dropdown/DropdownItem.js +50 -0
  21. package/dist/components/Dropdown/DropdownList.js +104 -0
  22. package/dist/components/Dropdown/constants.js +12 -0
  23. package/dist/components/Form/CharactersCount.js +33 -0
  24. package/dist/components/Form/Checkbox/Checkbox.js +171 -0
  25. package/dist/components/Form/CheckboxGroup/CheckboxGroup.js +81 -0
  26. package/dist/components/Form/DatePicker/DatePicker.js +1782 -0
  27. package/dist/components/Form/DatePicker/Icons/chevron-back.js +8 -0
  28. package/dist/components/Form/DatePicker/Icons/chevron-forward.js +8 -0
  29. package/dist/components/Form/FormGroup/FormGroup.js +30 -0
  30. package/dist/components/Form/FormGroup/FormGroupSet.js +44 -0
  31. package/dist/components/Form/Input/Input.js +375 -0
  32. package/dist/components/Form/Input/constants.js +9 -0
  33. package/dist/components/Form/Label/Label.js +87 -0
  34. package/dist/components/Form/PhoneInput/PhoneInput.js +3811 -0
  35. package/dist/components/Form/Radio/Radio.js +91 -0
  36. package/dist/components/Form/TextEditor/TextEditor.js +422 -0
  37. package/dist/components/Form/TextEditor/Toolbar.js +291 -0
  38. package/dist/components/Form/TextEditor/icons/toolbarIcons.js +109 -0
  39. package/dist/components/Form/TextEditor/plugins/alphabetList.js +31 -0
  40. package/dist/components/Form/TextEditor/plugins/imageBlot.js +16 -0
  41. package/dist/components/Form/TextEditor/setupTextEditor.js +27 -0
  42. package/dist/components/Form/Textarea/Textarea.js +121 -0
  43. package/dist/components/Form/Toggle/Toggle.js +134 -0
  44. package/dist/components/Icon.js +37 -0
  45. package/dist/components/IconButton/IconButton.js +93 -0
  46. package/dist/components/IconButton/constants.js +15 -0
  47. package/dist/components/List.js +66 -0
  48. package/dist/components/Modal/Modal.js +198 -0
  49. package/dist/components/Modal/constants.js +9 -0
  50. package/dist/components/Pagination/LimitSelector.js +73 -0
  51. package/dist/components/Pagination/Pagination.js +226 -0
  52. package/dist/components/Panel/Panel.js +107 -0
  53. package/dist/components/Popover/Popover.js +105 -0
  54. package/dist/components/Popover/constants.js +17 -0
  55. package/dist/components/ProgressBar/ProgressBar.js +63 -0
  56. package/dist/components/ProgressBar/constants.js +10 -0
  57. package/dist/components/Sorting/Sorting.js +182 -0
  58. package/dist/components/Sorting/constants.js +12 -0
  59. package/dist/components/SplitButton/SplitButton.js +145 -0
  60. package/dist/components/SplitButton/SplitButtonItem.js +34 -0
  61. package/dist/components/SplitButton/constants.js +7 -0
  62. package/dist/components/StatusIndicator/StatusIndicator.js +29 -0
  63. package/dist/components/StatusIndicator/constants.js +13 -0
  64. package/dist/components/StatusIndicator/icons.js +44 -0
  65. package/dist/components/Table/Cells/Cell.js +39 -0
  66. package/dist/components/Table/Cells/CheckboxCell.js +37 -0
  67. package/dist/components/Table/Row.js +14 -0
  68. package/dist/components/Table/Table.js +24 -0
  69. package/dist/components/Tabs/Tab.js +47 -0
  70. package/dist/components/Tabs/TabDropdown.js +94 -0
  71. package/dist/components/Tabs/Tabs.js +128 -0
  72. package/dist/components/TagPill/TagPill.js +61 -0
  73. package/dist/components/TagPill/constants.js +12 -0
  74. package/dist/components/ToggleTip/ToggleTip.js +91 -0
  75. package/dist/components/ToggleTip/constants.js +17 -0
  76. package/dist/components/Tooltip/Tooltip.js +46 -0
  77. package/dist/components/TreeSelect/Option.js +302 -0
  78. package/dist/components/TreeSelect/Select.js +1867 -0
  79. package/dist/components/TreeSelect/mixins/InfinityLoaderMixin.js +32 -0
  80. package/dist/constants/events.js +5 -0
  81. package/dist/constants/keyCodes.js +12 -0
  82. package/dist/directives/outside/outside.js +37 -0
  83. package/dist/directives/tooltip/TooltipController.js +116 -0
  84. package/dist/directives/tooltip/textOverflowTooltip.js +23 -0
  85. package/dist/directives/tooltip/tooltip.js +48 -0
  86. package/dist/helpers/debounce.js +14 -0
  87. package/dist/helpers/generateUID.js +6 -0
  88. package/dist/helpers/getHrefFromID.js +6 -0
  89. package/dist/helpers/multiLineOverflows.js +6 -0
  90. package/dist/helpers/removeEvents.js +8 -0
  91. package/dist/helpers/stripHtml.js +6 -0
  92. package/dist/index.css +1 -1
  93. package/dist/index.js +103 -22665
  94. package/dist/main.js +10 -0
  95. package/dist/mixins/expandAnimation.js +24 -0
  96. package/package.json +7 -4
  97. package/src/components/Form/Textarea/Textarea.vue +8 -4
  98. package/src/components/TreeSelect/Select.vue +11 -11
  99. package/.babelrc.json +0 -14
  100. package/.eslintrc.cjs +0 -22
  101. package/.nvmrc +0 -1
  102. package/.prettierrc.json +0 -1
  103. package/.storybook/intelliboardTheme.js +0 -10
  104. package/.storybook/main.js +0 -25
  105. package/.storybook/manager.js +0 -7
  106. package/.storybook/preview-head.html +0 -12
  107. package/.storybook/preview.js +0 -25
  108. package/.storybook/scss-loader.scss +0 -6
  109. package/.storybook/withSource.js +0 -97
  110. package/dist/index.umd.cjs +0 -238
  111. package/index.html +0 -21
  112. package/static/Logo.svg +0 -25
  113. package/static/docks/button.pdf +0 -147566
  114. package/static/favicon.ico +0 -0
  115. package/vite.config.js +0 -47
package/dist/main.js ADDED
@@ -0,0 +1,10 @@
1
+ import { createApp as e } from "vue";
2
+ import i from "./App.js";
3
+ import n from "./EventEmmiter.js";
4
+ window.lang = (t, p, m = {}) => t;
5
+ const o = e(i);
6
+ o.config.globalProperties.$globalEvents = new n();
7
+ o.config.globalProperties.$emitEvent = function(t, ...p) {
8
+ this.$emit.apply(this, arguments), this.$emit("all", { event: t, args: p });
9
+ };
10
+ o.mount("#app");
@@ -0,0 +1,24 @@
1
+ const s = {
2
+ methods: {
3
+ enter(t) {
4
+ const i = getComputedStyle(t).width;
5
+ t.style.width = i, t.style.position = "absolute", t.style.visibility = "hidden", t.style.height = "auto";
6
+ const h = getComputedStyle(t).height;
7
+ t.style.width = null, t.style.position = null, t.style.visibility = null, t.style.height = 0, getComputedStyle(t).height, requestAnimationFrame(() => {
8
+ t.style.height = h;
9
+ });
10
+ },
11
+ afterEnter(t) {
12
+ t.style.height = "auto";
13
+ },
14
+ leave(t) {
15
+ const i = getComputedStyle(t).height;
16
+ t.style.height = i, getComputedStyle(t).height, requestAnimationFrame(() => {
17
+ t.style.height = 0;
18
+ });
19
+ }
20
+ }
21
+ };
22
+ export {
23
+ s as default
24
+ };
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "@avakhula/ui",
3
- "version": "0.1.22",
4
- "main": "dist/index.js",
5
- "module": "dist/index.umd.cjs",
6
- "source": "src/index.js",
3
+ "version": "0.1.24",
7
4
  "type": "module",
5
+ "module": "dist/index.js",
8
6
  "private": false,
7
+ "sideEffects": [
8
+ "*.css",
9
+ "*.scss"
10
+ ],
11
+ "files": [ "dist", "src" ],
9
12
  "publishConfig": {
10
13
  "access": "public",
11
14
  "registry": "https://registry.npmjs.org/"
@@ -1,5 +1,9 @@
1
1
  <template>
2
- <div class="textarea-wrapper" :class="{ disabled: disabled, hasActins: $slots.actions }">
2
+ <div
3
+ class="textarea-wrapper"
4
+ :class="{ disabled: disabled, hasActins: $slots.actions }"
5
+ @focusout="onFocusOut"
6
+ >
3
7
  <ib-character-count
4
8
  v-if="characterLimit"
5
9
  :character-limit="characterLimit"
@@ -16,7 +20,6 @@
16
20
  v-model="val"
17
21
  :id="id"
18
22
  @input="onInput"
19
- @blur="onBlur"
20
23
  class="ib-textarea"
21
24
  :class="classes"
22
25
  :disabled="disabled"
@@ -84,8 +87,9 @@ export default {
84
87
  onInput() {
85
88
  this.$emit("input", this.val);
86
89
  },
87
- onBlur() {
88
- this.$emit("blur", this.val);
90
+ onFocusOut(event) {
91
+ if (this.$el.contains(event.relatedTarget)) return;
92
+ this.$emit("blur", this.val);
89
93
  },
90
94
  },
91
95
  computed: {
@@ -524,10 +524,7 @@ export default {
524
524
  ) {
525
525
  this.setPreparedValues(this.actualOptions).then(() => {
526
526
  const values = Object.keys(this.selected);
527
- this.$globalEvents.$emit("select-" + this.filterId + ":update", {
528
- values,
529
- filter: this.filterId,
530
- });
527
+ this.broadcastUpdate(values);
531
528
  });
532
529
  }
533
530
  },
@@ -557,11 +554,8 @@ export default {
557
554
 
558
555
  if ((this.isInitialized && !isOptionsEqual) || this.isWatching) {
559
556
  this.setPreparedValues().then(() => {
560
- const values = Object.keys(this.selected);
561
- this.$globalEvents.$emit("select-" + this.filterId + ":update", {
562
- values,
563
- filter: this.filterId,
564
- });
557
+ const values = Object.keys(this.selected);
558
+ this.broadcastUpdate(values);
565
559
  });
566
560
  }
567
561
  },
@@ -609,6 +603,10 @@ export default {
609
603
  this.virtualizer?.measure();
610
604
  }, 1000);
611
605
 
606
+ this.broadcastUpdate = debounce(function(values) {
607
+ this.$globalEvents.$emit("select-" + this.filterId + ":update", { values, filter: this.filterId });
608
+ }, 100);
609
+
612
610
  return {
613
611
  virtualizer: null,
614
612
  initialOptions: typeof this.options === "function" ? this.options : copy(this.options),
@@ -752,7 +750,7 @@ export default {
752
750
  if (this.dependency) {
753
751
  this.$globalEvents.$on("select-" + this.dependency + ":update", (dependencyValue) => {
754
752
  this.clear();
755
- this.dependencyValue = dependencyValue;
753
+ this.dependencyValue = dependencyValue;
756
754
 
757
755
  if (this.dependencyValue && this.dependencyValue.values && (!Array.isArray(this.dependencyValue.values) || this.dependencyValue.values.length)) {
758
756
  this.setPreparedValues();
@@ -827,6 +825,7 @@ export default {
827
825
  this.$emit("input", empty);
828
826
  this.$emit("clear-value", empty);
829
827
  this.$nextTick(() => (this.isInternalChange = false));
828
+ this.broadcastUpdate(empty);
830
829
  this.setPreparedValues();
831
830
  },
832
831
  prepare(options, checkInitialVisibility = true) {
@@ -963,7 +962,7 @@ export default {
963
962
  this.$emit("input", values[0]);
964
963
  }
965
964
  this.$nextTick(() => (this.isInternalChange = false));
966
- this.$globalEvents.$emit("select-" + this.filterId + ":update", { values, filter: this.filterId });
965
+ this.broadcastUpdate(values);
967
966
  if (!this.isMultiple) this.$refs.dropdown.close();
968
967
  },
969
968
  checkIfOptionsChecked(options) {
@@ -998,6 +997,7 @@ export default {
998
997
  this.$emit("update:modelValue", values);
999
998
  this.$emit("input", values);
1000
999
  this.$nextTick(() => (this.isInternalChange = false));
1000
+ this.broadcastUpdate(values);
1001
1001
  }
1002
1002
  },
1003
1003
  toggleDuplicateOptions(options, optionId, checked) {
package/.babelrc.json DELETED
@@ -1,14 +0,0 @@
1
- {
2
- "sourceType": "unambiguous",
3
- "presets": [
4
- [
5
- "@babel/preset-env",
6
- {
7
- "targets": {
8
- "chrome": 100
9
- }
10
- }
11
- ]
12
- ],
13
- "plugins": []
14
- }
package/.eslintrc.cjs DELETED
@@ -1,22 +0,0 @@
1
- /* eslint-env node */
2
- require("@rushstack/eslint-patch/modern-module-resolution");
3
-
4
- module.exports = {
5
- root: true,
6
- extends: [
7
- "plugin:vue/vue3-essential",
8
- "eslint:recommended",
9
- "@vue/eslint-config-prettier",
10
- "plugin:storybook/recommended",
11
- ],
12
- parserOptions: {
13
- ecmaVersion: "latest",
14
- },
15
- globals: {
16
- lang: "readonly",
17
- langComponents: "readonly",
18
- },
19
- rules: {
20
- "indent": ["warm", 2]
21
- },
22
- };
package/.nvmrc DELETED
@@ -1 +0,0 @@
1
- v16.18.1
package/.prettierrc.json DELETED
@@ -1 +0,0 @@
1
- {}
@@ -1,10 +0,0 @@
1
- import { create } from '@storybook/theming';
2
- import logo from '../static/Logo.svg';
3
-
4
- export default create({
5
- base: 'light',
6
- brandTitle: 'Intelliboard UI',
7
- brandUrl: 'https://intelliboard.net/',
8
- brandImage: logo,
9
- brandTarget: '_self',
10
- });
@@ -1,25 +0,0 @@
1
- module.exports = {
2
- stories: ["../src/**/*.stories.mdx", "../src/**/*.stories.@(js|jsx|ts|tsx)"],
3
- addons: [
4
- "@storybook/addon-docs",
5
- "@storybook/addon-links",
6
- "@storybook/addon-essentials",
7
- "@storybook/addon-interactions",
8
- "@storybook/addon-a11y",
9
- "@storybook/addon-mdx-gfm",
10
- ],
11
- staticDirs: ['../static'],
12
- framework: {
13
- name: "@storybook/vue3-vite",
14
- options: {},
15
- },
16
- async viteFinal(config, options) {
17
- return config;
18
- },
19
- features: {
20
- storyStoreV7: true,
21
- },
22
- docs: {
23
- autodocs: true,
24
- },
25
- };
@@ -1,7 +0,0 @@
1
- import { addons } from '@storybook/addons';
2
- import IntelliboardTheme from "./intelliboardTheme";
3
- addons.setConfig({
4
- theme: IntelliboardTheme,
5
- isFullscreen: false,
6
- panelPosition: 'right',
7
- });
@@ -1,12 +0,0 @@
1
- <script
2
- type="module"
3
- src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"
4
- ></script>
5
- <script
6
- nomodule
7
- src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"
8
- ></script>
9
- <script>
10
- window.global = window;
11
- window.lang = (key, component, params = {}) => key
12
- </script>
@@ -1,25 +0,0 @@
1
- import { setup } from '@storybook/vue3';
2
- import { withSource } from "./withSource";
3
- import EventEmitter from "../src/EventEmmiter";
4
- import "./scss-loader.scss";
5
-
6
- setup((app) => {
7
- app.config.globalProperties.$globalEvents = new EventEmitter();
8
- app.config.globalProperties.$emitEvent = function(event, ...args) {
9
- this.$emit.apply(this, arguments);
10
- this.$emit('all', {event, args})
11
- };
12
- });
13
-
14
- const parameters = {
15
- actions: { argTypesRegex: "^on[A-Z].*" },
16
- controls: {
17
- matchers: {
18
- color: /(background|color)$/i,
19
- date: /Date$/,
20
- },
21
- },
22
- };
23
-
24
- const decorators = [withSource];
25
- export default { parameters, decorators };
@@ -1,6 +0,0 @@
1
- @import '../src/assets/scss/style.scss';
2
-
3
- // Style for documentation
4
- table {
5
- width: 100%;
6
- }
@@ -1,97 +0,0 @@
1
- import { addons, makeDecorator } from "@storybook/addons";
2
- import kebabCase from "lodash.kebabcase"
3
- import { h, onMounted } from "vue";
4
-
5
- // this value doesn't seem to be exported by addons-docs
6
- export const SNIPPET_RENDERED = `storybook/docs/snippet-rendered`;
7
-
8
- function templateSourceCode (
9
- templateSource,
10
- args,
11
- argTypes,
12
- replacing = 'v-bind="args"',
13
- ) {
14
- const componentArgs = {}
15
- for (const [k, t] of Object.entries(argTypes)) {
16
- const val = args[k]
17
- if (typeof val !== 'undefined' && t.table && t.table.category === 'props' && val !== t.defaultValue) {
18
- componentArgs[k] = val
19
- }
20
- }
21
-
22
- const propToSource = (key, val) => {
23
- const type = typeof val
24
- switch (type) {
25
- case "boolean":
26
- return val ? key : ""
27
- case "string":
28
- return `${key}="${val}"`
29
- default:
30
- return `:${key}="${val}"`
31
- }
32
- }
33
-
34
- return templateSource.replace(
35
- replacing,
36
- Object.keys(componentArgs)
37
- .map((key) => " " + propToSource(kebabCase(key), args[key]))
38
- .join(""),
39
- )
40
- }
41
-
42
- export const withSource = makeDecorator({
43
- name: "withSource",
44
- wrapper: (storyFn, context) => {
45
- const story = storyFn(context);
46
-
47
- // this returns a new component that computes the source code when mounted
48
- // and emits an events that is handled by addons-docs
49
- // this approach is based on the vue (2) implementation
50
- // see https://github.com/storybookjs/storybook/blob/next/addons/docs/src/frameworks/vue/sourceDecorator.ts
51
- return {
52
- components: {
53
- Story: story,
54
- },
55
-
56
- setup() {
57
- onMounted(() => {
58
- try {
59
- // get the story source
60
- const src = context.originalStoryFn().template;
61
-
62
- // generate the source code based on the current args
63
- const code = templateSourceCode(
64
- src,
65
- context.args,
66
- context.argTypes
67
- );
68
-
69
- const channel = addons.getChannel();
70
-
71
- const emitFormattedTemplate = async () => {
72
- const prettier = await import("prettier/standalone");
73
- const prettierHtml = await import("prettier/parser-html");
74
-
75
- // emits an event when the transformation is completed
76
- channel.emit(
77
- SNIPPET_RENDERED,
78
- (context || {}).id,
79
- prettier.format(`<template>${code}</template>`, {
80
- parser: "vue",
81
- plugins: [prettierHtml],
82
- htmlWhitespaceSensitivity: "ignore",
83
- })
84
- );
85
- };
86
-
87
- setTimeout(emitFormattedTemplate, 0);
88
- } catch (e) {
89
- console.warn("Failed to render code", e);
90
- }
91
- });
92
-
93
- return () => h(story);
94
- },
95
- };
96
- },
97
- });