@siemens/ix-vue 0.0.0-pr-1724-20250305102750 → 0.0.0-pr-1974-20250624072317

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 (56) hide show
  1. package/READMEOSS.html +421 -0
  2. package/dist/_virtual/_plugin-vue_export-helper.js +10 -0
  3. package/dist/_virtual/_plugin-vue_export-helper.js.map +1 -0
  4. package/dist/components.d.ts +107 -105
  5. package/dist/components.js +1314 -1042
  6. package/dist/components.js.map +1 -1
  7. package/dist/context/IxApplicationContext.vue.d.ts +17 -0
  8. package/dist/context/IxApplicationContext.vue.js +17 -0
  9. package/dist/context/IxApplicationContext.vue.js.map +1 -0
  10. package/dist/context/IxApplicationContext.vue2.js +130 -0
  11. package/dist/context/IxApplicationContext.vue2.js.map +1 -0
  12. package/dist/context/context.d.ts +6 -0
  13. package/dist/context/context.js +11 -0
  14. package/dist/context/context.js.map +1 -0
  15. package/dist/context.d.ts +1 -0
  16. package/dist/delegate.d.ts +14 -0
  17. package/dist/delegate.js +38 -0
  18. package/dist/delegate.js.map +1 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +128 -6
  21. package/dist/index.js.map +1 -1
  22. package/dist/internal-components.js +13 -13
  23. package/dist/internal-components.js.map +1 -1
  24. package/dist/ix-icon.d.ts +2 -1
  25. package/dist/ix-icon.js +14 -4
  26. package/dist/ix-icon.js.map +1 -1
  27. package/dist/modal/IxOverlay.vue.d.ts +14 -0
  28. package/dist/modal/IxOverlay.vue.js +52 -0
  29. package/dist/modal/IxOverlay.vue.js.map +1 -0
  30. package/dist/modal/IxOverlay.vue2.js +5 -0
  31. package/dist/modal/IxOverlay.vue2.js.map +1 -0
  32. package/dist/modal/Modal.vue.d.ts +108 -0
  33. package/dist/modal/Modal.vue.js +74 -0
  34. package/dist/modal/Modal.vue.js.map +1 -0
  35. package/dist/modal/Modal.vue2.js +5 -0
  36. package/dist/modal/Modal.vue2.js.map +1 -0
  37. package/dist/modal/constants.d.ts +2 -0
  38. package/dist/modal/constants.js +6 -0
  39. package/dist/modal/constants.js.map +1 -0
  40. package/dist/modal/index.d.ts +10 -0
  41. package/dist/modal/index.js +116 -0
  42. package/dist/modal/index.js.map +1 -0
  43. package/dist/modal/ix-view.d.ts +29 -0
  44. package/dist/modal/ix-view.js +31 -0
  45. package/dist/modal/ix-view.js.map +1 -0
  46. package/dist/modal/modal-slot-props.d.ts +4 -0
  47. package/dist/plugin.js +21 -19
  48. package/dist/plugin.js.map +1 -1
  49. package/dist/toast/toast.js +16 -17
  50. package/dist/toast/toast.js.map +1 -1
  51. package/dist/vue-component-lib/utils.d.ts +1 -1
  52. package/package.json +18 -19
  53. package/dist/toast/index.js +0 -2
  54. package/dist/toast/index.js.map +0 -1
  55. package/dist/vue-component-lib/utils.js +0 -112
  56. package/dist/vue-component-lib/utils.js.map +0 -1
@@ -0,0 +1,29 @@
1
+ import { PropType, VNode } from 'vue';
2
+ declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
+ teleportId: {
4
+ type: StringConstructor;
5
+ required: true;
6
+ };
7
+ id: {
8
+ type: StringConstructor;
9
+ required: true;
10
+ };
11
+ node: {
12
+ type: PropType<VNode>;
13
+ required: true;
14
+ };
15
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
16
+ teleportId: {
17
+ type: StringConstructor;
18
+ required: true;
19
+ };
20
+ id: {
21
+ type: StringConstructor;
22
+ required: true;
23
+ };
24
+ node: {
25
+ type: PropType<VNode>;
26
+ required: true;
27
+ };
28
+ }>> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
29
+ export default _default;
@@ -0,0 +1,31 @@
1
+ import { defineComponent as r, h as e, Teleport as i } from "vue";
2
+ import { DATA_PORTAL_ID_ATTRIBUTE as o } from "./constants.js";
3
+ const p = r({
4
+ name: "IxView",
5
+ props: {
6
+ teleportId: {
7
+ type: String,
8
+ required: !0
9
+ },
10
+ id: {
11
+ type: String,
12
+ required: !0
13
+ },
14
+ node: {
15
+ type: Object,
16
+ required: !0
17
+ }
18
+ },
19
+ render() {
20
+ const t = e(
21
+ "div",
22
+ { [o]: this.id, style: "display: contents" },
23
+ this.node
24
+ );
25
+ return e(i, { to: this.teleportId }, t);
26
+ }
27
+ });
28
+ export {
29
+ p as default
30
+ };
31
+ //# sourceMappingURL=ix-view.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ix-view.js","sources":["../../src/modal/ix-view.ts"],"sourcesContent":["import { defineComponent, h, PropType, VNode, Teleport } from 'vue';\nimport { DATA_PORTAL_ID_ATTRIBUTE } from './constants';\n\nexport default defineComponent({\n name: 'IxView',\n props: {\n teleportId: {\n type: String,\n required: true,\n },\n id: {\n type: String,\n required: true,\n },\n node: {\n type: Object as PropType<VNode>,\n required: true,\n },\n },\n render() {\n const div = h(\n 'div',\n { [DATA_PORTAL_ID_ATTRIBUTE]: this.id, style: 'display: contents' },\n this.node\n );\n\n return h(Teleport, { to: this.teleportId }, div);\n },\n});\n"],"names":["IxView","defineComponent","div","h","DATA_PORTAL_ID_ATTRIBUTE","Teleport"],"mappings":";;AAGA,MAAAA,IAAeC,EAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,IACL,YAAY;AAAA,MACV,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,IAAI;AAAA,MACF,MAAM;AAAA,MACN,UAAU;AAAA,IACZ;AAAA,IACA,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,UAAU;AAAA,IAAA;AAAA,EAEd;AAAA,EACA,SAAS;AACP,UAAMC,IAAMC;AAAA,MACV;AAAA,MACA,EAAE,CAACC,CAAwB,GAAG,KAAK,IAAI,OAAO,oBAAoB;AAAA,MAClE,KAAK;AAAA,IACP;AAEA,WAAOD,EAAEE,GAAU,EAAE,IAAI,KAAK,cAAcH,CAAG;AAAA,EAAA;AAEnD,CAAC;"}
@@ -0,0 +1,4 @@
1
+ export type ModalSlotProps = {
2
+ closeModal: <T>(reason?: T) => void;
3
+ dismissModal: <T>(reason?: T) => void;
4
+ };
package/dist/plugin.js CHANGED
@@ -1,21 +1,23 @@
1
- import { handlePlatformHelpers } from '@siemens/ix/components';
2
- function toKebabCase(name) {
3
- const kebabCase = name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2');
4
- return kebabCase.toLowerCase();
1
+ import { handlePlatformHelpers as o } from "@siemens/ix/components";
2
+ function r(e) {
3
+ return e.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
5
4
  }
6
- export const ixPlugin = {
7
- async install() {
8
- handlePlatformHelpers({
9
- ael(el, name, cb, opts) {
10
- el.addEventListener(toKebabCase(name), cb, opts);
11
- },
12
- rel(el, name, cb, opts) {
13
- el.removeEventListener(toKebabCase(name), cb, opts);
14
- },
15
- ce(name, opts) {
16
- return new CustomEvent(toKebabCase(name), opts);
17
- },
18
- });
19
- },
5
+ const l = {
6
+ async install() {
7
+ o({
8
+ ael(e, t, n, a) {
9
+ e.addEventListener(r(t), n, a);
10
+ },
11
+ rel(e, t, n, a) {
12
+ e.removeEventListener(r(t), n, a);
13
+ },
14
+ ce(e, t) {
15
+ return new CustomEvent(r(e), t);
16
+ }
17
+ });
18
+ }
20
19
  };
21
- //# sourceMappingURL=plugin.js.map
20
+ export {
21
+ l as ixPlugin
22
+ };
23
+ //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,SAAS,WAAW,CAAC,IAAY;IAC/B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,CAAC,8BAA8B,EAAE,OAAO,CAAC,CAAC;IACxE,OAAO,SAAS,CAAC,WAAW,EAAE,CAAC;AACjC,CAAC;AAED,MAAM,CAAC,MAAM,QAAQ,GAAW;IAC9B,KAAK,CAAC,OAAO;QAEX,qBAAqB,CAAC;YACpB,GAAG,CAAC,EAAe,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI;gBACjC,EAAE,CAAC,gBAAgB,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACnD,CAAC;YACD,GAAG,CAAC,EAAe,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI;gBACjC,EAAE,CAAC,mBAAmB,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;YACtD,CAAC;YACD,EAAE,CAAC,IAAI,EAAE,IAAI;gBACX,OAAO,IAAI,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC;YAClD,CAAC;SACF,CAAC,CAAC;IACL,CAAC;CACF,CAAC"}
1
+ {"version":3,"file":"plugin.js","sources":["../src/plugin.ts"],"sourcesContent":["import { Plugin } from 'vue';\nimport { handlePlatformHelpers } from '@siemens/ix/components';\n\nfunction toKebabCase(name: string) {\n const kebabCase = name.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, '$1-$2');\n return kebabCase.toLowerCase();\n}\n\nexport const ixPlugin: Plugin = {\n async install() {\n // handle vue event name conversion\n handlePlatformHelpers({\n ael(el: HTMLElement, name, cb, opts) {\n el.addEventListener(toKebabCase(name), cb, opts);\n },\n rel(el: HTMLElement, name, cb, opts) {\n el.removeEventListener(toKebabCase(name), cb, opts);\n },\n ce(name, opts) {\n return new CustomEvent(toKebabCase(name), opts);\n },\n });\n },\n};\n"],"names":["toKebabCase","name","ixPlugin","handlePlatformHelpers","el","cb","opts"],"mappings":";AAGA,SAASA,EAAYC,GAAc;AAEjC,SADkBA,EAAK,QAAQ,gCAAgC,OAAO,EACrD,YAAY;AAC/B;AAEO,MAAMC,IAAmB;AAAA,EAC9B,MAAM,UAAU;AAEQ,IAAAC,EAAA;AAAA,MACpB,IAAIC,GAAiBH,GAAMI,GAAIC,GAAM;AACnC,QAAAF,EAAG,iBAAiBJ,EAAYC,CAAI,GAAGI,GAAIC,CAAI;AAAA,MACjD;AAAA,MACA,IAAIF,GAAiBH,GAAMI,GAAIC,GAAM;AACnC,QAAAF,EAAG,oBAAoBJ,EAAYC,CAAI,GAAGI,GAAIC,CAAI;AAAA,MACpD;AAAA,MACA,GAAGL,GAAMK,GAAM;AACb,eAAO,IAAI,YAAYN,EAAYC,CAAI,GAAGK,CAAI;AAAA,MAAA;AAAA,IAChD,CACD;AAAA,EAAA;AAEL;"}
@@ -1,19 +1,18 @@
1
- import { getToastContainer, toast, } from '@siemens/ix';
2
- import { defineCustomElement as defineIxToast } from '@siemens/ix/components/ix-toast.js';
3
- import { defineCustomElement as defineIxToastContainer } from '@siemens/ix/components/ix-toast-container.js';
4
- import { defineCustomElement as defineIxIcon } from '@siemens/ix-icons/dist/components/ix-icon';
5
- export function setToastPosition(position) {
6
- getToastContainer().position = position;
1
+ import { getToastContainer as s, toast as e } from "@siemens/ix";
2
+ import { defineCustomElement as o } from "@siemens/ix/components/ix-toast.js";
3
+ import { defineCustomElement as n } from "@siemens/ix/components/ix-toast-container.js";
4
+ import { defineCustomElement as a } from "@siemens/ix-icons/components/ix-icon.js";
5
+ function p(t) {
6
+ s().position = t;
7
7
  }
8
- export async function showToast(config) {
9
- defineIxIcon();
10
- defineIxToastContainer();
11
- defineIxToast();
12
- if (typeof config.message === 'string') {
13
- const toastInstance = await toast(config);
14
- return toastInstance;
15
- }
16
- const toastInstance = await toast(Object.assign(Object.assign({}, config), { message: config.message.cloneNode(true) }));
17
- return toastInstance;
8
+ async function d(t) {
9
+ return a(), n(), o(), typeof t.message == "string" ? await e(t) : await e({
10
+ ...t,
11
+ message: t.message.cloneNode(!0)
12
+ });
18
13
  }
19
- //# sourceMappingURL=toast.js.map
14
+ export {
15
+ p as setToastPosition,
16
+ d as showToast
17
+ };
18
+ //# sourceMappingURL=toast.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"toast.js","sourceRoot":"","sources":["../../src/toast/toast.ts"],"names":[],"mappings":"AASA,OAAO,EACL,iBAAiB,EACjB,KAAK,GAEN,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,mBAAmB,IAAI,aAAa,EAAE,MAAM,oCAAoC,CAAC;AAC1F,OAAO,EAAE,mBAAmB,IAAI,sBAAsB,EAAE,MAAM,8CAA8C,CAAC;AAC7G,OAAO,EAAE,mBAAmB,IAAI,YAAY,EAAE,MAAM,2CAA2C,CAAC;AAMhG,MAAM,UAAU,gBAAgB,CAAC,QAAsC;IACrE,iBAAiB,EAAE,CAAC,QAAQ,GAAG,QAAQ,CAAC;AAC1C,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,MAAoD;IAGpD,YAAY,EAAE,CAAC;IACf,sBAAsB,EAAE,CAAC;IACzB,aAAa,EAAE,CAAC;IAEhB,IAAI,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ,EAAE;QACtC,MAAM,aAAa,GAAG,MAAM,KAAK,CAAC,MAAuB,CAAC,CAAC;QAC3D,OAAO,aAAa,CAAC;KACtB;IAED,MAAM,aAAa,GAAG,MAAM,KAAK,iCAC5B,MAAM,KACT,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,IAAI,CAAgB,IACtD,CAAC;IAEH,OAAO,aAAa,CAAC;AACvB,CAAC"}
1
+ {"version":3,"file":"toast.js","sources":["../../src/toast/toast.ts"],"sourcesContent":["/*\n * SPDX-FileCopyrightText: 2022 Siemens AG\n *\n * SPDX-License-Identifier: MIT\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport {\n getToastContainer,\n toast,\n ToastConfig as IxToastConfig,\n} from '@siemens/ix';\nimport { defineCustomElement as defineIxToast } from '@siemens/ix/components/ix-toast.js';\nimport { defineCustomElement as defineIxToastContainer } from '@siemens/ix/components/ix-toast-container.js';\nimport { defineCustomElement as defineIxIcon } from '@siemens/ix-icons/components/ix-icon.js';\n\nexport type ToastConfig = {\n message: string | HTMLElement;\n};\n\nexport function setToastPosition(position: 'bottom-right' | 'top-right') {\n getToastContainer().position = position;\n}\n\nexport async function showToast(\n config: Omit<IxToastConfig, 'message'> & ToastConfig\n) {\n // Define components upfront to prevent undefined components\n defineIxIcon();\n defineIxToastContainer();\n defineIxToast();\n\n if (typeof config.message === 'string') {\n const toastInstance = await toast(config as IxToastConfig);\n return toastInstance;\n }\n\n const toastInstance = await toast({\n ...config,\n message: config.message.cloneNode(true) as HTMLElement,\n });\n\n return toastInstance;\n}\n"],"names":["setToastPosition","position","getToastContainer","showToast","config","defineIxIcon","defineIxToastContainer","defineIxToast","toast"],"mappings":";;;;AAsBO,SAASA,EAAiBC,GAAwC;AACvE,EAAAC,EAAA,EAAoB,WAAWD;AACjC;AAEA,eAAsBE,EACpBC,GACA;AAMI,SAJSC,EAAA,GACUC,EAAA,GACTC,EAAA,GAEV,OAAOH,EAAO,WAAY,WACN,MAAMI,EAAMJ,CAAuB,IAIrC,MAAMI,EAAM;AAAA,IAChC,GAAGJ;AAAA,IACH,SAASA,EAAO,QAAQ,UAAU,EAAI;AAAA,EAAA,CACvC;AAGH;"}
@@ -1,4 +1,4 @@
1
1
  export interface InputProps<T> {
2
2
  modelValue?: T;
3
3
  }
4
- export declare const defineContainer: <Props, VModelType = string | number | boolean>(name: string, defineCustomElement: any, componentProps?: string[], modelProp?: string, modelUpdateEvent?: string) => (props: Props & InputProps<VModelType> & {}) => any;
4
+ export declare const defineContainer: <Props, VModelType = string | number | boolean>(name: string, defineCustomElement: any, componentProps?: string[], modelProp?: string, modelUpdateEvent?: string) => import("vue").DefineSetupFnComponent<Props & InputProps<VModelType>, {}, {}, Props & InputProps<VModelType> & {}, import("vue").PublicProps>;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "homepage": "https://ix.siemens.io",
4
4
  "author": "Siemens AG",
5
5
  "license": "MIT",
6
- "version": "0.0.0-pr-1724-20250305102750",
6
+ "version": "0.0.0-pr-1974-20250624072317",
7
7
  "description": "Siemens iX for Vue",
8
8
  "bugs": "https://github.com/siemens/ix/issues",
9
9
  "repository": {
@@ -11,40 +11,39 @@
11
11
  "url": "https://github.com/siemens/ix",
12
12
  "directory": "packages/vue"
13
13
  },
14
- "module": "dist/index.js",
14
+ "type": "module",
15
15
  "main": "dist/index.js",
16
16
  "types": "dist/index.d.ts",
17
17
  "files": [
18
18
  "LICENSE",
19
19
  "README.md",
20
+ "READMEOSS.html",
20
21
  "dist"
21
22
  ],
22
- "exports": {
23
- ".": {
24
- "import": "./dist/index.js"
25
- }
26
- },
27
23
  "dependencies": {
28
- "@siemens/ix": "0.0.0-pr-1724-20250305102750"
24
+ "@siemens/ix": "0.0.0-pr-1974-20250624072317",
25
+ "@stencil/vue-output-target": "^0.10.7"
29
26
  },
30
27
  "devDependencies": {
31
- "rimraf": "^3.0.2",
32
- "vue": "^3.2.45",
33
- "@typescript-eslint/eslint-plugin": "^5.45.0",
34
- "@typescript-eslint/parser": "^5.45.0",
28
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
29
+ "@typescript-eslint/parser": "^5.62.0",
35
30
  "eslint": "~8.21.0",
36
- "eslint-plugin-vue": "^9.9.0",
37
- "typescript": "^4.5.4",
38
- "@siemens/ix": "0.0.0-pr-1724-20250305102750",
31
+ "eslint-plugin-vue": "^9.27.0",
32
+ "rimraf": "^3.0.2",
33
+ "typescript": "^5.8.3",
34
+ "vue": "^3.4.34",
35
+ "vite": "^6.3.5",
36
+ "vue-tsc": "^2.2.10",
37
+ "@vitejs/plugin-vue": "^5.2.3",
38
+ "@siemens/ix": "0.0.0-pr-1974-20250624072317",
39
39
  "eslint-config-ix": "1.0.0"
40
40
  },
41
41
  "peerDependencies": {
42
- "vue": ">=3.2.45",
43
- "@siemens/ix-icons": "^2.0.0"
42
+ "@siemens/ix-icons": "^3.0.0",
43
+ "vue": ">=3.2.45"
44
44
  },
45
45
  "scripts": {
46
- "build": "pnpm clean && pnpm compile",
47
- "compile": "pnpm tsc",
46
+ "build": "pnpm clean && vite build && vue-tsc --declaration --emitDeclarationOnly --outDir dist",
48
47
  "clean": "rimraf dist",
49
48
  "lint": "eslint src"
50
49
  }
@@ -1,2 +0,0 @@
1
- export * from './toast';
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/toast/index.ts"],"names":[],"mappings":"AASA,cAAc,SAAS,CAAC"}
@@ -1,112 +0,0 @@
1
- import { defineComponent, getCurrentInstance, h, inject, ref, withDirectives } from 'vue';
2
- const UPDATE_VALUE_EVENT = 'update:modelValue';
3
- const MODEL_VALUE = 'modelValue';
4
- const ROUTER_LINK_VALUE = 'routerLink';
5
- const NAV_MANAGER = 'navManager';
6
- const ROUTER_PROP_PREFIX = 'router';
7
- const ARIA_PROP_PREFIX = 'aria';
8
- const EMPTY_PROP = Symbol();
9
- const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP };
10
- const getComponentClasses = (classes) => {
11
- return (classes === null || classes === void 0 ? void 0 : classes.split(' ')) || [];
12
- };
13
- const getElementClasses = (ref, componentClasses, defaultClasses = []) => {
14
- var _a;
15
- return [...Array.from(((_a = ref.value) === null || _a === void 0 ? void 0 : _a.classList) || []), ...defaultClasses].filter((c, i, self) => !componentClasses.has(c) && self.indexOf(c) === i);
16
- };
17
- export const defineContainer = (name, defineCustomElement, componentProps = [], modelProp, modelUpdateEvent) => {
18
- if (defineCustomElement !== undefined) {
19
- defineCustomElement();
20
- }
21
- const Container = defineComponent((props, { attrs, slots, emit }) => {
22
- var _a;
23
- let modelPropValue = props[modelProp];
24
- const containerRef = ref();
25
- const classes = new Set(getComponentClasses(attrs.class));
26
- const vModelDirective = {
27
- created: (el) => {
28
- const eventsNames = Array.isArray(modelUpdateEvent) ? modelUpdateEvent : [modelUpdateEvent];
29
- eventsNames.forEach((eventName) => {
30
- el.addEventListener(eventName, (e) => {
31
- if (e.target.tagName === el.tagName) {
32
- modelPropValue = (e === null || e === void 0 ? void 0 : e.target)[modelProp];
33
- emit(UPDATE_VALUE_EVENT, modelPropValue);
34
- }
35
- });
36
- });
37
- },
38
- };
39
- const currentInstance = getCurrentInstance();
40
- const hasRouter = (_a = currentInstance === null || currentInstance === void 0 ? void 0 : currentInstance.appContext) === null || _a === void 0 ? void 0 : _a.provides[NAV_MANAGER];
41
- const navManager = hasRouter ? inject(NAV_MANAGER) : undefined;
42
- const handleRouterLink = (ev) => {
43
- const { routerLink } = props;
44
- if (routerLink === EMPTY_PROP)
45
- return;
46
- if (navManager !== undefined) {
47
- let navigationPayload = { event: ev };
48
- for (const key in props) {
49
- const value = props[key];
50
- if (props.hasOwnProperty(key) && key.startsWith(ROUTER_PROP_PREFIX) && value !== EMPTY_PROP) {
51
- navigationPayload[key] = value;
52
- }
53
- }
54
- navManager.navigate(navigationPayload);
55
- }
56
- else {
57
- console.warn('Tried to navigate, but no router was found. Make sure you have mounted Vue Router.');
58
- }
59
- };
60
- return () => {
61
- modelPropValue = props[modelProp];
62
- getComponentClasses(attrs.class).forEach((value) => {
63
- classes.add(value);
64
- });
65
- const oldClick = props.onClick;
66
- const handleClick = (ev) => {
67
- if (oldClick !== undefined) {
68
- oldClick(ev);
69
- }
70
- if (!ev.defaultPrevented) {
71
- handleRouterLink(ev);
72
- }
73
- };
74
- let propsToAdd = {
75
- ref: containerRef,
76
- class: getElementClasses(containerRef, classes),
77
- onClick: handleClick,
78
- };
79
- for (const key in props) {
80
- const value = props[key];
81
- if ((props.hasOwnProperty(key) && value !== EMPTY_PROP) || key.startsWith(ARIA_PROP_PREFIX)) {
82
- propsToAdd[key] = value;
83
- }
84
- }
85
- if (modelProp) {
86
- if (props[MODEL_VALUE] !== EMPTY_PROP) {
87
- propsToAdd = Object.assign(Object.assign({}, propsToAdd), { [modelProp]: props[MODEL_VALUE] });
88
- }
89
- else if (modelPropValue !== EMPTY_PROP) {
90
- propsToAdd = Object.assign(Object.assign({}, propsToAdd), { [modelProp]: modelPropValue });
91
- }
92
- }
93
- const node = h(name, propsToAdd, slots.default && slots.default());
94
- return modelProp === undefined ? node : withDirectives(node, [[vModelDirective]]);
95
- };
96
- });
97
- if (typeof Container !== 'function') {
98
- Container.name = name;
99
- Container.props = {
100
- [ROUTER_LINK_VALUE]: DEFAULT_EMPTY_PROP,
101
- };
102
- componentProps.forEach((componentProp) => {
103
- Container.props[componentProp] = DEFAULT_EMPTY_PROP;
104
- });
105
- if (modelProp) {
106
- Container.props[MODEL_VALUE] = DEFAULT_EMPTY_PROP;
107
- Container.emits = [UPDATE_VALUE_EVENT];
108
- }
109
- }
110
- return Container;
111
- };
112
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/vue-component-lib/utils.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,CAAC,EAAE,MAAM,EAAE,GAAG,EAAO,cAAc,EAAE,MAAM,KAAK,CAAC;AAM/F,MAAM,kBAAkB,GAAG,mBAAmB,CAAC;AAC/C,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,iBAAiB,GAAG,YAAY,CAAC;AACvC,MAAM,WAAW,GAAG,YAAY,CAAC;AACjC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AACpC,MAAM,gBAAgB,GAAG,MAAM,CAAC;AAUhC,MAAM,UAAU,GAAG,MAAM,EAAE,CAAC;AAC5B,MAAM,kBAAkB,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AAMnD,MAAM,mBAAmB,GAAG,CAAC,OAAgB,EAAE,EAAE;IAC/C,OAAO,CAAC,OAAkB,aAAlB,OAAO,uBAAP,OAAO,CAAa,KAAK,CAAC,GAAG,CAAC,KAAI,EAAE,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,iBAA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