@public-ui/vue 1.7.5 → 1.7.6-rc.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.
package/dist/index.cjs CHANGED
@@ -18,7 +18,7 @@ const getElementClasses = (ref2, componentClasses, defaultClasses = []) => {
18
18
  (c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i
19
19
  );
20
20
  };
21
- const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent, externalModelUpdateEvent) => {
21
+ const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent) => {
22
22
  if (defineCustomElement !== void 0) {
23
23
  defineCustomElement();
24
24
  }
@@ -26,16 +26,13 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
26
26
  let modelPropValue = props[modelProp];
27
27
  const containerRef = vue.ref();
28
28
  const classes = new Set(getComponentClasses(attrs.class));
29
- const onVnodeBeforeMount = (vnode) => {
30
- if (vnode.el) {
29
+ const vModelDirective = {
30
+ created: (el) => {
31
31
  const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
32
32
  eventsNames.forEach((eventName) => {
33
- vnode.el.addEventListener(eventName.toLowerCase(), (e) => {
33
+ el.addEventListener(eventName.toLowerCase(), (e) => {
34
34
  modelPropValue = (e?.target)[modelProp];
35
35
  emit(UPDATE_VALUE_EVENT, modelPropValue);
36
- if (externalModelUpdateEvent) {
37
- emit(externalModelUpdateEvent, e);
38
- }
39
36
  });
40
37
  });
41
38
  }
@@ -77,8 +74,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
77
74
  let propsToAdd = {
78
75
  ref: containerRef,
79
76
  class: getElementClasses(containerRef, classes),
80
- onClick: handleClick,
81
- onVnodeBeforeMount: modelUpdateEvent ? onVnodeBeforeMount : void 0
77
+ onClick: handleClick
82
78
  };
83
79
  for (const key in props) {
84
80
  const value = props[key];
@@ -99,7 +95,8 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
99
95
  };
100
96
  }
101
97
  }
102
- return vue.h(name, propsToAdd, slots.default && slots.default());
98
+ const node = vue.h(name, propsToAdd, slots.default && slots.default());
99
+ return modelProp === void 0 ? node : vue.withDirectives(node, [[vModelDirective]]);
103
100
  };
104
101
  });
105
102
  if (typeof Container !== "function") {
@@ -112,7 +109,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
112
109
  });
113
110
  if (modelProp) {
114
111
  Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
115
- Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent];
112
+ Container.emits = [UPDATE_VALUE_EVENT];
116
113
  }
117
114
  }
118
115
  return Container;
@@ -636,10 +633,6 @@ const KolPagination = /* @__PURE__ */ defineContainer("kol-pagination", void 0,
636
633
  "_max",
637
634
  "_variant"
638
635
  ]);
639
- const KolPopover = /* @__PURE__ */ defineContainer("kol-popover", void 0, [
640
- "_align",
641
- "_show"
642
- ]);
643
636
  const KolProgress = /* @__PURE__ */ defineContainer("kol-progress", void 0, [
644
637
  "_label",
645
638
  "_max",
@@ -826,7 +819,6 @@ exports.KolLogo = KolLogo;
826
819
  exports.KolModal = KolModal;
827
820
  exports.KolNav = KolNav;
828
821
  exports.KolPagination = KolPagination;
829
- exports.KolPopover = KolPopover;
830
822
  exports.KolProgress = KolProgress;
831
823
  exports.KolQuote = KolQuote;
832
824
  exports.KolSelect = KolSelect;
package/dist/index.d.ts CHANGED
@@ -41,7 +41,6 @@ declare const KolLogo: (props: JSX.KolLogo & InputProps<string | number | boolea
41
41
  declare const KolModal: (props: JSX.KolModal & InputProps<string | number | boolean> & {}) => any;
42
42
  declare const KolNav: (props: JSX.KolNav & InputProps<string | number | boolean> & {}) => any;
43
43
  declare const KolPagination: (props: JSX.KolPagination & InputProps<string | number | boolean> & {}) => any;
44
- declare const KolPopover: (props: JSX.KolPopover & InputProps<string | number | boolean> & {}) => any;
45
44
  declare const KolProgress: (props: JSX.KolProgress & InputProps<string | number | boolean> & {}) => any;
46
45
  declare const KolQuote: (props: JSX.KolQuote & InputProps<string | number | boolean> & {}) => any;
47
46
  declare const KolSelect: (props: JSX.KolSelect & InputProps<string | number | boolean> & {}) => any;
@@ -57,4 +56,4 @@ declare const KolToast: (props: JSX.KolToast & InputProps<string | number | bool
57
56
  declare const KolToastContainer: (props: JSX.KolToastContainer & InputProps<string | number | boolean> & {}) => any;
58
57
  declare const KolVersion: (props: JSX.KolVersion & InputProps<string | number | boolean> & {}) => any;
59
58
 
60
- export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolPopover, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToast, KolToastContainer, KolVersion };
59
+ export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToast, KolToastContainer, KolVersion };
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent, ref, getCurrentInstance, inject, h } from 'vue';
1
+ import { defineComponent, ref, getCurrentInstance, inject, h, withDirectives } from 'vue';
2
2
 
3
3
  const UPDATE_VALUE_EVENT = "update:modelValue";
4
4
  const MODEL_VALUE = "modelValue";
@@ -16,7 +16,7 @@ const getElementClasses = (ref2, componentClasses, defaultClasses = []) => {
16
16
  (c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i
17
17
  );
18
18
  };
19
- const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent, externalModelUpdateEvent) => {
19
+ const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent) => {
20
20
  if (defineCustomElement !== void 0) {
21
21
  defineCustomElement();
22
22
  }
@@ -24,16 +24,13 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
24
24
  let modelPropValue = props[modelProp];
25
25
  const containerRef = ref();
26
26
  const classes = new Set(getComponentClasses(attrs.class));
27
- const onVnodeBeforeMount = (vnode) => {
28
- if (vnode.el) {
27
+ const vModelDirective = {
28
+ created: (el) => {
29
29
  const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
30
30
  eventsNames.forEach((eventName) => {
31
- vnode.el.addEventListener(eventName.toLowerCase(), (e) => {
31
+ el.addEventListener(eventName.toLowerCase(), (e) => {
32
32
  modelPropValue = (e?.target)[modelProp];
33
33
  emit(UPDATE_VALUE_EVENT, modelPropValue);
34
- if (externalModelUpdateEvent) {
35
- emit(externalModelUpdateEvent, e);
36
- }
37
34
  });
38
35
  });
39
36
  }
@@ -75,8 +72,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
75
72
  let propsToAdd = {
76
73
  ref: containerRef,
77
74
  class: getElementClasses(containerRef, classes),
78
- onClick: handleClick,
79
- onVnodeBeforeMount: modelUpdateEvent ? onVnodeBeforeMount : void 0
75
+ onClick: handleClick
80
76
  };
81
77
  for (const key in props) {
82
78
  const value = props[key];
@@ -97,7 +93,8 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
97
93
  };
98
94
  }
99
95
  }
100
- return h(name, propsToAdd, slots.default && slots.default());
96
+ const node = h(name, propsToAdd, slots.default && slots.default());
97
+ return modelProp === void 0 ? node : withDirectives(node, [[vModelDirective]]);
101
98
  };
102
99
  });
103
100
  if (typeof Container !== "function") {
@@ -110,7 +107,7 @@ const defineContainer = (name, defineCustomElement, componentProps = [], modelPr
110
107
  });
111
108
  if (modelProp) {
112
109
  Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
113
- Container.emits = [UPDATE_VALUE_EVENT, externalModelUpdateEvent];
110
+ Container.emits = [UPDATE_VALUE_EVENT];
114
111
  }
115
112
  }
116
113
  return Container;
@@ -634,10 +631,6 @@ const KolPagination = /* @__PURE__ */ defineContainer("kol-pagination", void 0,
634
631
  "_max",
635
632
  "_variant"
636
633
  ]);
637
- const KolPopover = /* @__PURE__ */ defineContainer("kol-popover", void 0, [
638
- "_align",
639
- "_show"
640
- ]);
641
634
  const KolProgress = /* @__PURE__ */ defineContainer("kol-progress", void 0, [
642
635
  "_label",
643
636
  "_max",
@@ -787,4 +780,4 @@ const KolVersion = /* @__PURE__ */ defineContainer("kol-version", void 0, [
787
780
  "_version"
788
781
  ]);
789
782
 
790
- export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolPopover, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToast, KolToastContainer, KolVersion };
783
+ export { KolAbbr, KolAccordion, KolAlert, KolAvatar, KolBadge, KolBreadcrumb, KolButton, KolButtonGroup, KolButtonLink, KolCard, KolDetails, KolForm, KolHeading, KolIcon, KolIconFontAwesome, KolIconIcofont, KolImage, KolIndentedText, KolInputAdapterLeanup, KolInputCheckbox, KolInputColor, KolInputDate, KolInputEmail, KolInputFile, KolInputNumber, KolInputPassword, KolInputRadio, KolInputRange, KolInputText, KolKolibri, KolLink, KolLinkButton, KolLinkGroup, KolLogo, KolModal, KolNav, KolPagination, KolProgress, KolQuote, KolSelect, KolSkipNav, KolSpan, KolSpin, KolSplitButton, KolSymbol, KolTable, KolTabs, KolTextarea, KolToast, KolToastContainer, KolVersion };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@public-ui/vue",
3
- "version": "1.7.5",
3
+ "version": "1.7.6-rc.1",
4
4
  "license": "EUPL-1.2",
5
5
  "homepage": "https://public-ui.github.io",
6
6
  "repository": "https://github.com/public-ui/kolibri",
@@ -42,18 +42,18 @@
42
42
  "vue"
43
43
  ],
44
44
  "devDependencies": {
45
- "@babel/types": "7.23.0",
46
- "@public-ui/components": "1.7.5",
45
+ "@babel/types": "7.23.3",
46
+ "@public-ui/components": "1.7.6-rc.1",
47
47
  "@types/minimatch": "5.1.2",
48
- "@types/minimist": "1.2.3",
48
+ "@types/minimist": "1.2.5",
49
49
  "@types/node": "ts5.1",
50
- "@types/normalize-package-data": "2.4.2",
50
+ "@types/normalize-package-data": "2.4.4",
51
51
  "typescript": "5.2.2",
52
52
  "unbuild": "1.2.1",
53
- "vue": "3.3.4"
53
+ "vue": "3.3.8"
54
54
  },
55
55
  "peerDependencies": {
56
- "@public-ui/components": "1.7.5",
56
+ "@public-ui/components": "1.7.6-rc.1",
57
57
  "vue": ">=3"
58
58
  },
59
59
  "sideEffects": false,