@avakhula/ui 0.1.21 → 0.1.23

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 +1871 -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 -22644
  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 +34 -2
  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.21",
4
- "main": "dist/index.js",
5
- "module": "dist/index.umd.cjs",
6
- "source": "src/index.js",
3
+ "version": "0.1.23",
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: {
@@ -481,6 +481,9 @@ export default {
481
481
  type: Boolean,
482
482
  default: false
483
483
  },
484
+ initialDependencyValue: {
485
+ type: Object
486
+ },
484
487
  },
485
488
  emits: [
486
489
  "close",
@@ -571,6 +574,15 @@ export default {
571
574
  this.actualBookmarkedOptions = {};
572
575
  this.setBookmarkedOptions(this.actualOptions);
573
576
  },
577
+ initialDependencyValue(value) {
578
+ this.dependencyValue = value;
579
+
580
+ if (this.hasFilledDependency) {
581
+ this.$nextTick(() => {
582
+ this.loadValues();
583
+ });
584
+ }
585
+ },
574
586
  },
575
587
  mounted() {
576
588
  this.marker = new Mark(this.$refs.list.$el);
@@ -660,7 +672,7 @@ export default {
660
672
  },
661
673
  ...this.strings,
662
674
  },
663
- dependencyValue: null,
675
+ dependencyValue: this.initialDependencyValue,
664
676
  isInternalChange: false,
665
677
  nodeIndex: new Map()
666
678
  };
@@ -748,6 +760,9 @@ export default {
748
760
  }
749
761
  );
750
762
  this.isLoading = false;
763
+ if (!oldDependency && this.hasFilledDependency) {
764
+ this.setPreparedValues();
765
+ }
751
766
  } else {
752
767
  this.$globalEvents.$off("select-" + oldDependency + ":update");
753
768
  this.setPreparedValues().then(() => {
@@ -758,7 +773,21 @@ export default {
758
773
  });
759
774
  });
760
775
  }
761
- },
776
+ },
777
+ loadValues() {
778
+ this.setPreparedValues().then(() => {
779
+ if (!this.dependency) {
780
+ const values = Object.keys(this.selected);
781
+
782
+ // SP-13363
783
+ if (!(Array.isArray(this.options) && !this.options.length)) {
784
+ this.$globalEvents.$emit('select-' + this.filterId + ':update', {values, filter: this.filterId});
785
+ }
786
+ }
787
+
788
+ this.$emit('loaded', this.dependencyValue);
789
+ });
790
+ },
762
791
  filter(filterString, options) {
763
792
  this.filterString = filterString;
764
793
  this.$emit("search", this.filterString);
@@ -1174,6 +1203,9 @@ export default {
1174
1203
  : 0)
1175
1204
  );
1176
1205
  },
1206
+ hasFilledDependency() {
1207
+ return !!(this.dependency && this.dependencyValue && this.dependencyValue?.values && (!Array.isArray(this.dependencyValue?.values) || this.dependencyValue?.values.length));
1208
+ },
1177
1209
  },
1178
1210
  components: {
1179
1211
  IbAlert,
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
- });