yuyeon 0.0.27 → 0.0.29

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.
@@ -1 +1 @@
1
- {"version":3,"file":"util.mjs","names":["getObjectValueByPath","getKeys","items","itemKey","childrenKey","keys","item","key","push","children","Array","isArray","filterTreeItem","search","textKey","text","toLocaleLowerCase","indexOf","filterTreeItems","filter","idKey","excluded","match","i","length","add"],"sources":["../../../src/components/tree-view/util.ts"],"sourcesContent":["import { getObjectValueByPath } from '../../util/common';\n\nimport { CandidateKey } from '../../types';\nimport { TreeviewFilterFn } from './types';\n\nexport function getKeys(items: any[], itemKey: string, childrenKey: string) {\n const keys: CandidateKey[] = [];\n for (const item of items) {\n const key = getObjectValueByPath(item, itemKey);\n keys.push(key);\n const children = getObjectValueByPath(item, childrenKey);\n if (Array.isArray(children)) {\n keys.push(...getKeys(children, itemKey, childrenKey));\n }\n }\n return keys;\n}\n\nexport function filterTreeItem(\n item: object,\n search: string,\n textKey: string,\n): boolean {\n const text = getObjectValueByPath(item, textKey);\n\n return text.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;\n}\n\nexport function filterTreeItems(\n filter: TreeviewFilterFn,\n item: any,\n search: string,\n idKey: string,\n textKey: string,\n childrenKey: string,\n excluded: Set<CandidateKey>,\n): boolean {\n const children = getObjectValueByPath(item, childrenKey);\n\n if (children) {\n let match = false;\n for (let i = 0; i < children.length; i++) {\n if (\n filterTreeItems(\n filter,\n children[i],\n search,\n idKey,\n textKey,\n childrenKey,\n excluded,\n )\n ) {\n match = true;\n }\n }\n\n if (match) {\n return true;\n } else if (filter(item, search, textKey)) {\n return true;\n }\n } else if (filter(item, search, textKey)) {\n return true;\n }\n\n excluded.add(getObjectValueByPath(item, idKey));\n\n return false;\n}\n"],"mappings":"SAASA,oBAAoB;AAK7B,OAAO,SAASC,OAAOA,CAACC,KAAY,EAAEC,OAAe,EAAEC,WAAmB,EAAE;EAC1E,MAAMC,I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EAAE;MACT,OAAO,IAAI;IACb,CAAC,MAAM,IAAIH,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;MACxC,OAAO,IAAI;IACb;EACF,CAAC,MAAM,IAAIK,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;IACxC,OAAO,IAAI;EACb;EAEAO,QAAQ,CAACI,GAAG,CAACzB,oBAAoB,CAACM,IAAI,EAAEc,KAAK,CAAC,CAAC;EAE/C,OAAO,KAAK;AACd"}
1
+ {"version":3,"file":"util.mjs","names":["getObjectValueByPath","getKeys","items","itemKey","childrenKey","keys","item","key","push","children","Array","isArray","filterTreeItem","search","textKey","text","toLocaleLowerCase","indexOf","filterTreeItems","filter","idKey","excluded","match","i","length","add"],"sources":["../../../src/components/tree-view/util.ts"],"sourcesContent":["import { getObjectValueByPath } from '../../util/common';\n\nimport { CandidateKey } from '../../types';\nimport { TreeviewFilterFn } from './types';\n\nexport function getKeys(items: any[], itemKey: string, childrenKey: string) {\n const keys: CandidateKey[] = [];\n for (const item of items) {\n const key = getObjectValueByPath(item, itemKey);\n keys.push(key);\n const children = getObjectValueByPath(item, childrenKey);\n if (Array.isArray(children)) {\n keys.push(...getKeys(children, itemKey, childrenKey));\n }\n }\n return keys;\n}\n\nexport function filterTreeItem(\n item: object,\n search: string,\n textKey: string,\n): boolean {\n const text = getObjectValueByPath(item, textKey);\n\n return text?.toLocaleLowerCase().indexOf(search.toLocaleLowerCase()) > -1;\n}\n\nexport function filterTreeItems(\n filter: TreeviewFilterFn,\n item: any,\n search: string,\n idKey: string,\n textKey: string,\n childrenKey: string,\n excluded: Set<CandidateKey>,\n): boolean {\n const children = getObjectValueByPath(item, childrenKey);\n\n if (children) {\n let match = false;\n for (let i = 0; i < children.length; i++) {\n if (\n filterTreeItems(\n filter,\n children[i],\n search,\n idKey,\n textKey,\n childrenKey,\n excluded,\n )\n ) {\n match = true;\n }\n }\n\n if (match) {\n return true;\n } else if (filter(item, search, textKey)) {\n return true;\n }\n } else if (filter(item, search, textKey)) {\n return true;\n }\n\n excluded.add(getObjectValueByPath(item, idKey));\n\n return false;\n}\n"],"mappings":"SAASA,oBAAoB;AAK7B,OAAO,SAASC,OAAOA,CAACC,KAAY,EAAEC,OAAe,EAAEC,WAAmB,EAAE;EAC1E,MAAMC,IAAoB,GAAG,EAAE;EAC/B,KAAK,MAAMC,IAAI,IAAIJ,KAAK,EAAE;IACxB,MAAMK,GAAG,GAAGP,oBAAoB,CAACM,IAAI,EAAEH,OAAO,CAAC;IAC/CE,IAAI,CAACG,IAAI,CAACD,GAAG,CAAC;IACd,MAAME,QAAQ,GAAGT,oBAAoB,CAACM,IAAI,EAAEF,WAAW,CAAC;IACxD,IAAIM,KAAK,CAACC,OAAO,CAACF,QAAQ,CAAC,EAAE;MAC3BJ,IAAI,CAACG,IAAI,CAAC,GAAGP,OAAO,CAACQ,QAAQ,EAAEN,OAAO,EAAEC,WAAW,CAAC,CAAC;IACvD;EACF;EACA,OAAOC,IAAI;AACb;AAEA,OAAO,SAASO,cAAcA,CAC5BN,IAAY,EACZO,MAAc,EACdC,OAAe,EACN;EACT,MAAMC,IAAI,GAAGf,oBAAoB,CAACM,IAAI,EAAEQ,OAAO,CAAC;EAEhD,OAAOC,IAAI,EAAEC,iBAAiB,CAAC,CAAC,CAACC,OAAO,CAACJ,MAAM,CAACG,iBAAiB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;AAC3E;AAEA,OAAO,SAASE,eAAeA,CAC7BC,MAAwB,EACxBb,IAAS,EACTO,MAAc,EACdO,KAAa,EACbN,OAAe,EACfV,WAAmB,EACnBiB,QAA2B,EAClB;EACT,MAAMZ,QAAQ,GAAGT,oBAAoB,CAACM,IAAI,EAAEF,WAAW,CAAC;EAExD,IAAIK,QAAQ,EAAE;IACZ,IAAIa,KAAK,GAAG,KAAK;IACjB,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGd,QAAQ,CAACe,MAAM,EAAED,CAAC,EAAE,EAAE;MACxC,IACEL,eAAe,CACbC,MAAM,EACNV,QAAQ,CAACc,CAAC,CAAC,EACXV,MAAM,EACNO,KAAK,EACLN,OAAO,EACPV,WAAW,EACXiB,QACF,CAAC,EACD;QACAC,KAAK,GAAG,IAAI;MACd;IACF;IAEA,IAAIA,KAAK,EAAE;MACT,OAAO,IAAI;IACb,CAAC,MAAM,IAAIH,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;MACxC,OAAO,IAAI;IACb;EACF,CAAC,MAAM,IAAIK,MAAM,CAACb,IAAI,EAAEO,MAAM,EAAEC,OAAO,CAAC,EAAE;IACxC,OAAO,IAAI;EACb;EAEAO,QAAQ,CAACI,GAAG,CAACzB,oBAAoB,CAACM,IAAI,EAAEc,KAAK,CAAC,CAAC;EAE/C,OAAO,KAAK;AACd"}
@@ -0,0 +1,13 @@
1
+ import { nextTick, watch } from 'vue';
2
+ export function useChoiceByLink(link, select) {
3
+ watch(() => link.isActive?.value, neo => {
4
+ if (link.isLink.value && neo && select) {
5
+ nextTick(() => {
6
+ select(true);
7
+ });
8
+ }
9
+ }, {
10
+ immediate: true
11
+ });
12
+ }
13
+ //# sourceMappingURL=choice-link.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"choice-link.mjs","names":["nextTick","watch","useChoiceByLink","link","select","isActive","value","neo","isLink","immediate"],"sources":["../../src/composables/choice-link.ts"],"sourcesContent":["import { nextTick, watch } from 'vue';\n\nimport type { UseLink } from './vue-router';\n\nexport function useChoiceByLink(\n link: UseLink,\n select?: (value: boolean, event?: Event) => void,\n) {\n watch(\n () => link.isActive?.value,\n (neo) => {\n if (link.isLink.value && neo && select) {\n nextTick(() => {\n select(true);\n });\n }\n },\n { immediate: true },\n );\n}\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,KAAK,QAAQ,KAAK;AAIrC,OAAO,SAASC,eAAeA,CAC7BC,IAAa,EACbC,MAAgD,EAChD;EACAH,KAAK,CACH,MAAME,IAAI,CAACE,QAAQ,EAAEC,KAAK,EACzBC,GAAG,IAAK;IACP,IAAIJ,IAAI,CAACK,MAAM,CAACF,KAAK,IAAIC,GAAG,IAAIH,MAAM,EAAE;MACtCJ,QAAQ,CAAC,MAAM;QACbI,MAAM,CAAC,IAAI,CAAC;MACd,CAAC,CAAC;IACJ;EACF,CAAC,EACD;IAAEK,SAAS,EAAE;EAAK,CACpB,CAAC;AACH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "yuyeon",
3
- "version": "0.0.27",
3
+ "version": "0.0.29",
4
4
  "keywords": [
5
5
  "UI Library",
6
6
  "Vue"
@@ -180,7 +180,9 @@ export declare const YButton: import("vue").DefineComponent<{
180
180
  type: BooleanConstructor;
181
181
  default: boolean;
182
182
  };
183
- }, void, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
183
+ }, {
184
+ link: import("../../composables/vue-router").UseLink;
185
+ }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
184
186
  'choice:selected': (choice: {
185
187
  value: boolean;
186
188
  }) => boolean;
@@ -0,0 +1,2 @@
1
+ import type { UseLink } from './vue-router';
2
+ export declare function useChoiceByLink(link: UseLink, select?: (value: boolean, event?: Event) => void): void;
package/types/shims.d.ts CHANGED
@@ -1,81 +1,81 @@
1
- import * as vue from 'vue';
2
- import {
3
- YAlert,
4
- YApp,
5
- YButton,
6
- YCard,
7
- YCardBody,
8
- YCardFooter,
9
- YCardHeader,
10
- YCheckbox,
11
- YChip,
12
- YDataTable,
13
- YDataTableServer,
14
- YDialog,
15
- YDividePanel,
16
- YDropdown,
17
- YExpandHTransition,
18
- YExpandVTransition,
19
- YFieldInput,
20
- YForm,
21
- YInput,
22
- YInputCheckbox,
23
- YLayer,
24
- YList,
25
- YListItem,
26
- YMenu,
27
- YPagination,
28
- YProgressBar,
29
- YSelect,
30
- YSnackbar,
31
- YSpinnerRing,
32
- YSwitch,
33
- YTab,
34
- YTable,
35
- YTabs,
36
- YTooltip,
37
- YTreeView,
38
- YTreeViewNode,
39
- } from 'yuyeon/types/components';
40
-
41
- declare module '@vue/runtime-core' {
42
- export interface GlobalComponents {
43
- // @define-components
44
- YApp: typeof YApp;
45
- YButton: typeof YButton;
46
- YChip: typeof YChip;
47
- YInput: typeof YInput;
48
- YFieldInput: typeof YFieldInput;
49
- YForm: typeof YForm;
50
- YCard: typeof YCard;
51
- YCardBody: typeof YCardBody;
52
- YCardHeader: typeof YCardHeader;
53
- YCardFooter: typeof YCardFooter;
54
- YDialog: typeof YDialog;
55
- YLayer: typeof YLayer;
56
- YSnackbar: typeof YSnackbar;
57
- YProgressBar: typeof YProgressBar;
58
- YSpinnerRing: typeof YSpinnerRing;
59
- YTooltip: typeof YTooltip;
60
- YExpandVTransition: typeof YExpandVTransition;
61
- YExpandHTransition: typeof YExpandHTransition;
62
- YDividePanel: typeof YDividePanel;
63
- YList: typeof YList;
64
- YListItem: typeof YListItem;
65
- YTreeView: typeof YTreeView;
66
- YTreeViewNode: typeof YTreeViewNode;
67
- YDataTable: typeof YDataTable;
68
- YTable: typeof YTable;
69
- YDataTableServer: typeof YDataTableServer;
70
- YMenu: typeof YMenu;
71
- YPagination: typeof YPagination;
72
- YInputCheckbox: typeof YInputCheckbox;
73
- YCheckbox: typeof YCheckbox;
74
- YSwitch: typeof YSwitch;
75
- YDropdown: typeof YDropdown;
76
- YSelect: typeof YSelect;
77
- YAlert: typeof YAlert;
78
- YTabs: typeof YTabs;
79
- YTab: typeof YTab;
80
- }
81
- }
1
+ import * as vue from 'vue';
2
+ import {
3
+ YAlert,
4
+ YApp,
5
+ YButton,
6
+ YCard,
7
+ YCardBody,
8
+ YCardFooter,
9
+ YCardHeader,
10
+ YCheckbox,
11
+ YChip,
12
+ YDataTable,
13
+ YDataTableServer,
14
+ YDialog,
15
+ YDividePanel,
16
+ YDropdown,
17
+ YExpandHTransition,
18
+ YExpandVTransition,
19
+ YFieldInput,
20
+ YForm,
21
+ YInput,
22
+ YInputCheckbox,
23
+ YLayer,
24
+ YList,
25
+ YListItem,
26
+ YMenu,
27
+ YPagination,
28
+ YProgressBar,
29
+ YSelect,
30
+ YSnackbar,
31
+ YSpinnerRing,
32
+ YSwitch,
33
+ YTab,
34
+ YTable,
35
+ YTabs,
36
+ YTooltip,
37
+ YTreeView,
38
+ YTreeViewNode,
39
+ } from 'yuyeon/types/components';
40
+
41
+ declare module '@vue/runtime-core' {
42
+ export interface GlobalComponents {
43
+ // @define-components
44
+ YApp: typeof YApp;
45
+ YButton: typeof YButton;
46
+ YChip: typeof YChip;
47
+ YInput: typeof YInput;
48
+ YFieldInput: typeof YFieldInput;
49
+ YForm: typeof YForm;
50
+ YCard: typeof YCard;
51
+ YCardBody: typeof YCardBody;
52
+ YCardHeader: typeof YCardHeader;
53
+ YCardFooter: typeof YCardFooter;
54
+ YDialog: typeof YDialog;
55
+ YLayer: typeof YLayer;
56
+ YSnackbar: typeof YSnackbar;
57
+ YProgressBar: typeof YProgressBar;
58
+ YSpinnerRing: typeof YSpinnerRing;
59
+ YTooltip: typeof YTooltip;
60
+ YExpandVTransition: typeof YExpandVTransition;
61
+ YExpandHTransition: typeof YExpandHTransition;
62
+ YDividePanel: typeof YDividePanel;
63
+ YList: typeof YList;
64
+ YListItem: typeof YListItem;
65
+ YTreeView: typeof YTreeView;
66
+ YTreeViewNode: typeof YTreeViewNode;
67
+ YDataTable: typeof YDataTable;
68
+ YTable: typeof YTable;
69
+ YDataTableServer: typeof YDataTableServer;
70
+ YMenu: typeof YMenu;
71
+ YPagination: typeof YPagination;
72
+ YInputCheckbox: typeof YInputCheckbox;
73
+ YCheckbox: typeof YCheckbox;
74
+ YSwitch: typeof YSwitch;
75
+ YDropdown: typeof YDropdown;
76
+ YSelect: typeof YSelect;
77
+ YAlert: typeof YAlert;
78
+ YTabs: typeof YTabs;
79
+ YTab: typeof YTab;
80
+ }
81
+ }