intelligent-system-design-language 0.3.13
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/.claude/agents/langium-language-designer.md +38 -0
- package/.claude/agents/typescript-vscode-expert.md +29 -0
- package/.claude/agents/ui-ux-designer.md +36 -0
- package/.claude/settings.local.json +33 -0
- package/.idea/inspectionProfiles/Project_Default.xml +7 -0
- package/.idea/isdl.iml +14 -0
- package/.idea/modules.xml +9 -0
- package/.idea/vcs.xml +7 -0
- package/.idea/watcherTasks.xml +4 -0
- package/.vscodeignore +18 -0
- package/LICENSE +674 -0
- package/README.md +86 -0
- package/bin/cli.js +4 -0
- package/bin/lsp.js +8 -0
- package/isdl.png +0 -0
- package/out/_backgrounds.scss +91 -0
- package/out/_handlebars.scss +505 -0
- package/out/_isdlStyles.scss +1357 -0
- package/out/_vuetifyOverrides.scss +425 -0
- package/out/_vuetifyStyles.scss +31957 -0
- package/out/cli/cli-util.js +39 -0
- package/out/cli/cli-util.js.map +1 -0
- package/out/cli/components/_backgrounds.scss +91 -0
- package/out/cli/components/_handlebars.scss +505 -0
- package/out/cli/components/_isdlStyles.scss +1357 -0
- package/out/cli/components/_vuetifyOverrides.scss +425 -0
- package/out/cli/components/_vuetifyStyles.scss +31957 -0
- package/out/cli/components/active-effect-sheet-generator.js +643 -0
- package/out/cli/components/active-effect-sheet-generator.js.map +1 -0
- package/out/cli/components/base-actor-sheet-generator.js +125 -0
- package/out/cli/components/base-actor-sheet-generator.js.map +1 -0
- package/out/cli/components/base-sheet-generator.js +525 -0
- package/out/cli/components/base-sheet-generator.js.map +1 -0
- package/out/cli/components/chat-card-generator.js +683 -0
- package/out/cli/components/chat-card-generator.js.map +1 -0
- package/out/cli/components/css-generator.js +58 -0
- package/out/cli/components/css-generator.js.map +1 -0
- package/out/cli/components/damage-roll-generator.js +173 -0
- package/out/cli/components/damage-roll-generator.js.map +1 -0
- package/out/cli/components/datamodel-generator.js +672 -0
- package/out/cli/components/datamodel-generator.js.map +1 -0
- package/out/cli/components/derived-data-generator.js +1340 -0
- package/out/cli/components/derived-data-generator.js.map +1 -0
- package/out/cli/components/hotbar-drop-hook-generator.js +95 -0
- package/out/cli/components/hotbar-drop-hook-generator.js.map +1 -0
- package/out/cli/components/init-hook-generator.js +597 -0
- package/out/cli/components/init-hook-generator.js.map +1 -0
- package/out/cli/components/keywords-generator.js +220 -0
- package/out/cli/components/keywords-generator.js.map +1 -0
- package/out/cli/components/language-generator.js +110 -0
- package/out/cli/components/language-generator.js.map +1 -0
- package/out/cli/components/measured-template-preview.js +234 -0
- package/out/cli/components/measured-template-preview.js.map +1 -0
- package/out/cli/components/method-generator.js +1812 -0
- package/out/cli/components/method-generator.js.map +1 -0
- package/out/cli/components/ready-hook-generator.js +448 -0
- package/out/cli/components/ready-hook-generator.js.map +1 -0
- package/out/cli/components/token-generator.js +138 -0
- package/out/cli/components/token-generator.js.map +1 -0
- package/out/cli/components/utils.js +176 -0
- package/out/cli/components/utils.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-attribute.js +148 -0
- package/out/cli/components/vue/base-components/vue-attribute.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-boolean.js +77 -0
- package/out/cli/components/vue/base-components/vue-boolean.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-calculator.js +106 -0
- package/out/cli/components/vue/base-components/vue-calculator.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-application.js +369 -0
- package/out/cli/components/vue/base-components/vue-damage-application.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js +225 -0
- package/out/cli/components/vue/base-components/vue-damage-bonuses.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-resistances.js +256 -0
- package/out/cli/components/vue/base-components/vue-damage-resistances.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-damage-track.js +134 -0
- package/out/cli/components/vue/base-components/vue-damage-track.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-date-time.js +55 -0
- package/out/cli/components/vue/base-components/vue-date-time.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-dice.js +111 -0
- package/out/cli/components/vue/base-components/vue-dice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-die.js +86 -0
- package/out/cli/components/vue/base-components/vue-die.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-choice.js +172 -0
- package/out/cli/components/vue/base-components/vue-document-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-choices.js +203 -0
- package/out/cli/components/vue/base-components/vue-document-choices.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-document-link.js +73 -0
- package/out/cli/components/vue/base-components/vue-document-link.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-extended-choice.js +101 -0
- package/out/cli/components/vue/base-components/vue-extended-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-inventory.js +532 -0
- package/out/cli/components/vue/base-components/vue-inventory.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-macro-choice.js +150 -0
- package/out/cli/components/vue/base-components/vue-macro-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-measured-template.js +543 -0
- package/out/cli/components/vue/base-components/vue-measured-template.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-money.js +496 -0
- package/out/cli/components/vue/base-components/vue-money.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-number.js +184 -0
- package/out/cli/components/vue/base-components/vue-number.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-paperdoll.js +56 -0
- package/out/cli/components/vue/base-components/vue-paperdoll.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js +89 -0
- package/out/cli/components/vue/base-components/vue-parent-property-reference.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-prosemirror.js +31 -0
- package/out/cli/components/vue/base-components/vue-prosemirror.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-resource.js +149 -0
- package/out/cli/components/vue/base-components/vue-resource.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js +121 -0
- package/out/cli/components/vue/base-components/vue-roll-visualizer.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-self-property-reference.js +75 -0
- package/out/cli/components/vue/base-components/vue-self-property-reference.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string-choice.js +111 -0
- package/out/cli/components/vue/base-components/vue-string-choice.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string-choices.js +216 -0
- package/out/cli/components/vue/base-components/vue-string-choices.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-string.js +73 -0
- package/out/cli/components/vue/base-components/vue-string.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-text-field.js +66 -0
- package/out/cli/components/vue/base-components/vue-text-field.js.map +1 -0
- package/out/cli/components/vue/base-components/vue-tracker.js +444 -0
- package/out/cli/components/vue/base-components/vue-tracker.js.map +1 -0
- package/out/cli/components/vue/vue-action-component-generator.js +88 -0
- package/out/cli/components/vue/vue-action-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-active-effect-sheet-generator.js +1016 -0
- package/out/cli/components/vue/vue-active-effect-sheet-generator.js.map +1 -0
- package/out/cli/components/vue/vue-base-components-generator.js +59 -0
- package/out/cli/components/vue/vue-base-components-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable-component-generator.js +307 -0
- package/out/cli/components/vue/vue-datatable-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable-sheet-class-generator.js +342 -0
- package/out/cli/components/vue/vue-datatable-sheet-class-generator.js.map +1 -0
- package/out/cli/components/vue/vue-datatable2-component-generator.js +939 -0
- package/out/cli/components/vue/vue-datatable2-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-document-creation-app.js +140 -0
- package/out/cli/components/vue/vue-document-creation-app.js.map +1 -0
- package/out/cli/components/vue/vue-document-creation-sheet.js +105 -0
- package/out/cli/components/vue/vue-document-creation-sheet.js.map +1 -0
- package/out/cli/components/vue/vue-generator.js +240 -0
- package/out/cli/components/vue/vue-generator.js.map +1 -0
- package/out/cli/components/vue/vue-mixin.js +338 -0
- package/out/cli/components/vue/vue-mixin.js.map +1 -0
- package/out/cli/components/vue/vue-pinned-datatable-component-generator.js +306 -0
- package/out/cli/components/vue/vue-pinned-datatable-component-generator.js.map +1 -0
- package/out/cli/components/vue/vue-prompt-generator.js +201 -0
- package/out/cli/components/vue/vue-prompt-generator.js.map +1 -0
- package/out/cli/components/vue/vue-prompt-sheet-class-generator.js +252 -0
- package/out/cli/components/vue/vue-prompt-sheet-class-generator.js.map +1 -0
- package/out/cli/components/vue/vue-sheet-application-generator.js +2008 -0
- package/out/cli/components/vue/vue-sheet-application-generator.js.map +1 -0
- package/out/cli/components/vue/vue-sheet-class-generator.js +484 -0
- package/out/cli/components/vue/vue-sheet-class-generator.js.map +1 -0
- package/out/cli/generator.js +659 -0
- package/out/cli/generator.js.map +1 -0
- package/out/cli/main.js +43 -0
- package/out/cli/main.js.map +1 -0
- package/out/datatables.min.css +54 -0
- package/out/datatables.min.js +178 -0
- package/out/extension/github/githubAuthProvider.js +345 -0
- package/out/extension/github/githubAuthProvider.js.map +1 -0
- package/out/extension/github/githubConfig.js +132 -0
- package/out/extension/github/githubConfig.js.map +1 -0
- package/out/extension/github/githubGistActions.js +251 -0
- package/out/extension/github/githubGistActions.js.map +1 -0
- package/out/extension/github/githubGistManager.js +255 -0
- package/out/extension/github/githubGistManager.js.map +1 -0
- package/out/extension/github/githubManager.js +1735 -0
- package/out/extension/github/githubManager.js.map +1 -0
- package/out/extension/github/githubQuickActions.js +659 -0
- package/out/extension/github/githubQuickActions.js.map +1 -0
- package/out/extension/github/githubTreeProvider.js +181 -0
- package/out/extension/github/githubTreeProvider.js.map +1 -0
- package/out/extension/github/system-workflow.yml +48 -0
- package/out/extension/main.cjs +70315 -0
- package/out/extension/main.cjs.map +7 -0
- package/out/extension/main.js +237 -0
- package/out/extension/main.js.map +1 -0
- package/out/extension/package.json +426 -0
- package/out/isdl.png +0 -0
- package/out/language/generated/ast.js +2992 -0
- package/out/language/generated/ast.js.map +1 -0
- package/out/language/generated/grammar.js +13970 -0
- package/out/language/generated/grammar.js.map +1 -0
- package/out/language/generated/module.js +20 -0
- package/out/language/generated/module.js.map +1 -0
- package/out/language/intelligent-system-design-language-formatter.js +85 -0
- package/out/language/intelligent-system-design-language-formatter.js.map +1 -0
- package/out/language/intelligent-system-design-language-module.js +69 -0
- package/out/language/intelligent-system-design-language-module.js.map +1 -0
- package/out/language/intelligent-system-design-language-quickfixes.js +37 -0
- package/out/language/intelligent-system-design-language-quickfixes.js.map +1 -0
- package/out/language/intelligent-system-design-language-validator.js +515 -0
- package/out/language/intelligent-system-design-language-validator.js.map +1 -0
- package/out/language/isdl-hover-provider.js +77 -0
- package/out/language/isdl-hover-provider.js.map +1 -0
- package/out/language/isdl-scope-provider.js +149 -0
- package/out/language/isdl-scope-provider.js.map +1 -0
- package/out/language/main.cjs +47655 -0
- package/out/language/main.cjs.map +7 -0
- package/out/language/main.js +11 -0
- package/out/language/main.js.map +1 -0
- package/out/missing-character.png +0 -0
- package/out/package.json +426 -0
- package/out/paperdoll_default.png +0 -0
- package/out/progressbar.min.js +7 -0
- package/out/styles.scss +722 -0
- package/out/test/formatting/formatter.test.js +46 -0
- package/out/test/formatting/formatter.test.js.map +1 -0
- package/out/vuetify.esm.js +30279 -0
- package/package.json +426 -0
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { expandToNode, joinToNode, toString } from 'langium/generate';
|
|
4
|
+
export function generateVueMixin(description) {
|
|
5
|
+
const generatedFileDir = path.join(description, "system", "sheets", "vue");
|
|
6
|
+
const generatedFilePath = path.join(generatedFileDir, "VueRenderingMixin.mjs");
|
|
7
|
+
if (!fs.existsSync(generatedFileDir)) {
|
|
8
|
+
fs.mkdirSync(generatedFileDir, { recursive: true });
|
|
9
|
+
}
|
|
10
|
+
const customComponents = {
|
|
11
|
+
'i-attribute': 'Attribute',
|
|
12
|
+
'i-resource': 'Resource',
|
|
13
|
+
'i-document-link': 'DocumentLink',
|
|
14
|
+
'i-prosemirror': 'ProseMirror',
|
|
15
|
+
'i-roll-visualizer': 'RollVisualizer',
|
|
16
|
+
'i-paperdoll': 'Paperdoll',
|
|
17
|
+
"i-calculator": "Calculator",
|
|
18
|
+
"i-text-field": "TextField",
|
|
19
|
+
"i-datetime": "DateTime",
|
|
20
|
+
"i-tracker": "Tracker",
|
|
21
|
+
"i-macro": "MacroField",
|
|
22
|
+
"i-measured-template": "MeasuredTemplateField",
|
|
23
|
+
"i-extended-choice": "ExtendedChoiceField",
|
|
24
|
+
"i-dice": "DiceField",
|
|
25
|
+
"i-bonuses": "DamageBonuses",
|
|
26
|
+
"i-resistances": "DamageResistances",
|
|
27
|
+
"i-boolean": "BooleanField",
|
|
28
|
+
"i-die": "DieField",
|
|
29
|
+
"i-string": "StringMethodField",
|
|
30
|
+
"i-number": "NumberField",
|
|
31
|
+
"i-string-choice": "StringChoiceField",
|
|
32
|
+
"i-string-choices": "StringChoicesField",
|
|
33
|
+
"i-parent-property-reference": "ParentPropertyReferenceField",
|
|
34
|
+
"i-self-property-reference": "SelfPropertyReferenceField",
|
|
35
|
+
"i-money": "MoneyField",
|
|
36
|
+
"i-inventory": "Inventory",
|
|
37
|
+
"i-damage-track": "DamageTrack",
|
|
38
|
+
};
|
|
39
|
+
const fileNode = expandToNode `
|
|
40
|
+
import { createApp } from "../../../lib/vue.esm-browser.js";
|
|
41
|
+
import * as Vuetify from "../../../lib/vuetify.esm.js";
|
|
42
|
+
import { ${joinToNode(Object.values(customComponents), c => expandToNode `${c}`, { separator: ", " })} } from "./components/components.vue.es.mjs";
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Vue rendering mixin for ApplicationV2.
|
|
46
|
+
*
|
|
47
|
+
* @param {Constructor} BaseApplication
|
|
48
|
+
* @returns {VueApplication}
|
|
49
|
+
*/
|
|
50
|
+
export default function VueRenderingMixin(BaseApplication) {
|
|
51
|
+
|
|
52
|
+
class VueApplication extends BaseApplication {
|
|
53
|
+
|
|
54
|
+
/** Vue application instance created with createApp(). */
|
|
55
|
+
vueApp = null;
|
|
56
|
+
|
|
57
|
+
/** Vue root for the mounted application instance. */
|
|
58
|
+
vueRoot = null;
|
|
59
|
+
|
|
60
|
+
/** Constant to force updates on change. */
|
|
61
|
+
_renderKey = 0;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Object to store vue parts.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* vueParts = {
|
|
68
|
+
* 'document-sheet': {
|
|
69
|
+
* component: DocumentSheetVue,
|
|
70
|
+
* template: \`<document-sheet :context="context">Failed to render</document-sheet>\`
|
|
71
|
+
* },
|
|
72
|
+
* 'foobar': {
|
|
73
|
+
* component: Foobar,
|
|
74
|
+
* template: \`<foobar :context="context"/>\`
|
|
75
|
+
* }
|
|
76
|
+
* }
|
|
77
|
+
*/
|
|
78
|
+
vueParts = {};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Getter for vueComponents
|
|
82
|
+
*
|
|
83
|
+
* Retrieves an object of component tags to component instances from the vueParts property.
|
|
84
|
+
*
|
|
85
|
+
* @example
|
|
86
|
+
* {
|
|
87
|
+
* 'document-sheet': DocumentSheet,
|
|
88
|
+
* 'foobar': Foobar,
|
|
89
|
+
* }
|
|
90
|
+
*
|
|
91
|
+
* @returns {object} Object with component tags mapped to components.
|
|
92
|
+
*/
|
|
93
|
+
get vueComponents() {
|
|
94
|
+
const components = {};
|
|
95
|
+
for (let [key, part] of Object.entries(this.vueParts)) {
|
|
96
|
+
if (part?.component) {
|
|
97
|
+
components[key] = part.component;
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
return components;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Getter for vueTemplates
|
|
105
|
+
*
|
|
106
|
+
* Retrieves an array of template part strings to render.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* [
|
|
110
|
+
* '<document-sheet :context="context">Failed to render</document-sheet>',
|
|
111
|
+
* '<foobar :context="context"/>'
|
|
112
|
+
* ]
|
|
113
|
+
*
|
|
114
|
+
* @returns {Array} Array of vue template mount points.
|
|
115
|
+
*/
|
|
116
|
+
get vueTemplates() {
|
|
117
|
+
return Object.values(this.vueParts).map((part) => part.template);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
vueData(context) {
|
|
121
|
+
return {
|
|
122
|
+
context: context
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
_getProvidedData() {
|
|
127
|
+
// This is a placeholder for any data you want to provide to the Vue app.
|
|
128
|
+
// You can override this method in your subclass to provide additional data.
|
|
129
|
+
return {};
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Render the outer framing HTMLElement and mount the Vue application.
|
|
134
|
+
*
|
|
135
|
+
* This occurs when the application is opened, but not on subsequent renders.
|
|
136
|
+
*
|
|
137
|
+
* @param {RenderOptions} options
|
|
138
|
+
* @returns {Promise<HTMLElement>}
|
|
139
|
+
*
|
|
140
|
+
* @protected
|
|
141
|
+
* @override
|
|
142
|
+
*/
|
|
143
|
+
async _renderFrame(options) {
|
|
144
|
+
// Retrieve the context and element.
|
|
145
|
+
const context = await this._prepareContext(options);
|
|
146
|
+
const element = await super._renderFrame(options);
|
|
147
|
+
|
|
148
|
+
// Grab our application target and render our parts.
|
|
149
|
+
const target = this.hasFrame ? element.querySelector(".window-content") : element;
|
|
150
|
+
target.innerHTML = this.vueTemplates.join("");
|
|
151
|
+
|
|
152
|
+
const aliases = {
|
|
153
|
+
collapse: 'fas fa-chevron-up',
|
|
154
|
+
complete: 'fas fa-check',
|
|
155
|
+
cancel: 'fas fa-times-circle',
|
|
156
|
+
close: 'fas fa-times',
|
|
157
|
+
delete: 'fas fa-times-circle',
|
|
158
|
+
// delete (e.g. v-chip close)
|
|
159
|
+
clear: 'fas fa-times-circle',
|
|
160
|
+
// delete (e.g. v-chip close)
|
|
161
|
+
success: 'fas fa-check-circle',
|
|
162
|
+
info: 'fas fa-info-circle',
|
|
163
|
+
warning: 'fas fa-exclamation',
|
|
164
|
+
error: 'fas fa-exclamation-triangle',
|
|
165
|
+
prev: 'fas fa-chevron-left',
|
|
166
|
+
next: 'fas fa-chevron-right',
|
|
167
|
+
checkboxOn: 'fas fa-check-square',
|
|
168
|
+
checkboxOff: 'far fa-square',
|
|
169
|
+
// note 'far'
|
|
170
|
+
checkboxIndeterminate: 'fas fa-minus-square',
|
|
171
|
+
delimiter: 'fas fa-circle',
|
|
172
|
+
// for carousel
|
|
173
|
+
sortAsc: 'fas fa-arrow-up',
|
|
174
|
+
sortDesc: 'fas fa-arrow-down',
|
|
175
|
+
expand: 'fas fa-chevron-down',
|
|
176
|
+
menu: 'fas fa-bars',
|
|
177
|
+
subgroup: 'fas fa-caret-down',
|
|
178
|
+
dropdown: 'fas fa-caret-down',
|
|
179
|
+
radioOn: 'far fa-dot-circle',
|
|
180
|
+
radioOff: 'far fa-circle',
|
|
181
|
+
edit: 'fas fa-edit',
|
|
182
|
+
ratingEmpty: 'far fa-star',
|
|
183
|
+
ratingFull: 'fas fa-star',
|
|
184
|
+
ratingHalf: 'fas fa-star-half',
|
|
185
|
+
loading: 'fas fa-sync',
|
|
186
|
+
first: 'fas fa-step-backward',
|
|
187
|
+
last: 'fas fa-step-forward',
|
|
188
|
+
unfold: 'fas fa-arrows-alt-v',
|
|
189
|
+
file: 'fas fa-paperclip',
|
|
190
|
+
plus: 'fas fa-plus',
|
|
191
|
+
minus: 'fas fa-minus',
|
|
192
|
+
calendar: 'fas fa-calendar',
|
|
193
|
+
treeviewCollapse: 'fas fa-caret-down',
|
|
194
|
+
treeviewExpand: 'fas fa-caret-right',
|
|
195
|
+
eyeDropper: 'fas fa-eye-dropper'
|
|
196
|
+
};
|
|
197
|
+
const fa = {
|
|
198
|
+
component: Vuetify.components.VClassIcon
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const vueData = this.vueData(context);
|
|
202
|
+
console.log("Vue App Data:", vueData, this.document);
|
|
203
|
+
|
|
204
|
+
// Create and store the Vue application instance.
|
|
205
|
+
this.vueApp = createApp({
|
|
206
|
+
// Data available in the template.
|
|
207
|
+
data() {
|
|
208
|
+
return vueData;
|
|
209
|
+
},
|
|
210
|
+
// Components allowed by the application.
|
|
211
|
+
components: this.vueComponents,
|
|
212
|
+
// Method to update the template data on subsequent changes.
|
|
213
|
+
methods: {
|
|
214
|
+
updateContext(newContext) {
|
|
215
|
+
// Note that 'this' refers to this.vueApp, not the full AppV2 instance.
|
|
216
|
+
for (let key of Object.keys(this.context)) {
|
|
217
|
+
if (newContext[key]) {
|
|
218
|
+
this.context[key] = newContext[key];
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
watch: {
|
|
224
|
+
"context._renderKey": {
|
|
225
|
+
handler: function (newVal, oldVal) {
|
|
226
|
+
this.$nextTick(() => {
|
|
227
|
+
const changeEvent = new Event("change", { bubbles: true });
|
|
228
|
+
this.$el.dispatchEvent(changeEvent);
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
});
|
|
234
|
+
${joinToNode(Object.keys(customComponents), c => expandToNode `this.vueApp.component("${c}", ${customComponents[c]});`, { appendNewLineIfNotEmpty: true })}
|
|
235
|
+
const vuetify = Vuetify.createVuetify({
|
|
236
|
+
icons: {
|
|
237
|
+
defaultSet: 'fa',
|
|
238
|
+
aliases,
|
|
239
|
+
sets: {
|
|
240
|
+
fa,
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
components: {
|
|
244
|
+
VNumberInput: Vuetify.components.VNumberInput
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
this.vueApp.use(vuetify);
|
|
248
|
+
|
|
249
|
+
// Expose global Foundry variables.
|
|
250
|
+
this.vueApp.config.globalProperties.game = game;
|
|
251
|
+
this.vueApp.config.globalProperties.CONFIG = CONFIG;
|
|
252
|
+
this.vueApp.config.globalProperties.foundry = foundry;
|
|
253
|
+
|
|
254
|
+
// Expose the document.
|
|
255
|
+
this.vueApp.provide("rawDocument", this.document);
|
|
256
|
+
this.vueApp.provide("rawSheet", this);
|
|
257
|
+
|
|
258
|
+
// Expose any extras
|
|
259
|
+
const providedData = this._getProvidedData();
|
|
260
|
+
for (let key of Object.keys(providedData)) {
|
|
261
|
+
this.vueApp.provide(key, providedData[key]);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
// Mount and store the vue application.
|
|
265
|
+
this.vueRoot = this.vueApp.mount(target);
|
|
266
|
+
|
|
267
|
+
return element;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/**
|
|
271
|
+
* Handle updates for the Vue application instance.
|
|
272
|
+
*
|
|
273
|
+
* Normally, this would render the HTML for the content within the application.
|
|
274
|
+
* However, for Vue, all we want to do is update the 'context' property that's
|
|
275
|
+
* passed into the Vue application instance.
|
|
276
|
+
*
|
|
277
|
+
* Unlike _renderFrame(), this occurs on every update for the application.
|
|
278
|
+
*
|
|
279
|
+
* @param {ApplicationRenderContext} context
|
|
280
|
+
* @param {RenderOptions} options
|
|
281
|
+
* @returns {Promise<string>}
|
|
282
|
+
*
|
|
283
|
+
* @protected
|
|
284
|
+
* @override
|
|
285
|
+
*/
|
|
286
|
+
async _renderHTML(context, options) {
|
|
287
|
+
// Force certain updates.
|
|
288
|
+
this._renderKey++;
|
|
289
|
+
context._renderKey = this._renderKey;
|
|
290
|
+
// Update the application root with new values.
|
|
291
|
+
this.vueRoot.updateContext(context);
|
|
292
|
+
// Return doesn't matter, Vue handles updates.
|
|
293
|
+
|
|
294
|
+
// If game.tooltip has an element, reactivate it
|
|
295
|
+
if (game.tooltip.element) {
|
|
296
|
+
const element = game.tooltip.element;
|
|
297
|
+
game.tooltip.deactivate();
|
|
298
|
+
game.tooltip.activate(element);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
/** @override */
|
|
303
|
+
_replaceHTML(result, content, options) {
|
|
304
|
+
// Pass. We don't need this in Vue land! But Foundry itself does...
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Closes the application and unmounts the vue application instance.
|
|
309
|
+
*
|
|
310
|
+
* @param {ApplicationClosingOptions} options
|
|
311
|
+
* @returns {Promise<BaseApplication>}
|
|
312
|
+
*
|
|
313
|
+
* @override
|
|
314
|
+
*/
|
|
315
|
+
async close(options = {}) {
|
|
316
|
+
if (this.options.form.submitOnClose && this.isEditable) {
|
|
317
|
+
await this.submit();
|
|
318
|
+
}
|
|
319
|
+
// Unmount the vue instance.
|
|
320
|
+
if (this.vueApp) this.vueApp.unmount();
|
|
321
|
+
await super.close(options);
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
async _onFirstRender(context) {
|
|
325
|
+
super._onFirstRender(context);
|
|
326
|
+
|
|
327
|
+
// Replace the .application class with .vue-application
|
|
328
|
+
this.element.classList.remove("application");
|
|
329
|
+
this.element.classList.add("vue-application");
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
return VueApplication;
|
|
334
|
+
}
|
|
335
|
+
`.appendNewLine();
|
|
336
|
+
fs.writeFileSync(generatedFilePath, toString(fileNode));
|
|
337
|
+
}
|
|
338
|
+
//# sourceMappingURL=vue-mixin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-mixin.js","sourceRoot":"","sources":["../../../../src/cli/components/vue/vue-mixin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAEtE,MAAM,UAAU,gBAAgB,CAAC,WAAmB;IAChD,MAAM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AAC,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBAgMrF,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyC,EAAE,CAAC,CAAC,EAAE,CAAC,YAAY,CAAA,0BAA0B,CAAC,MAAM,gBAAgB,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,uBAAuB,EAAE,IAAI,EAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KAqG/M,CAAC,aAAa,EAAE,CAAC;IAElB,EAAE,CAAC,aAAa,CAAC,iBAAiB,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC5D,CAAC"}
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
import * as path from 'node:path';
|
|
2
|
+
import * as fs from 'node:fs';
|
|
3
|
+
import { expandToNode, joinToNode, toString } from 'langium/generate';
|
|
4
|
+
import { isAction, isActor, isColorParam, isDocument, isIconParam, isLabelParam, isPage } from "../../../language/generated/ast.js";
|
|
5
|
+
import { getAllOfType } from '../utils.js';
|
|
6
|
+
import { AstUtils } from 'langium';
|
|
7
|
+
export function generatePinnedVuetifyDatatableComponent(id, document, pinnedField, destination, entry) {
|
|
8
|
+
var _a, _b;
|
|
9
|
+
const type = isActor(document) ? 'actor' : 'item';
|
|
10
|
+
const page = AstUtils.getContainerOfType(pinnedField, isPage);
|
|
11
|
+
const pageName = page ? page.name : document.name;
|
|
12
|
+
const generatedFileDir = path.join(destination, "system", "templates", "vue", type, document.name.toLowerCase(), "components", "datatables");
|
|
13
|
+
const generatedFilePath = path.join(generatedFileDir, `${document.name.toLowerCase()}${pageName}${pinnedField.name}VuetifyDatatable.vue`);
|
|
14
|
+
if (!fs.existsSync(generatedFileDir)) {
|
|
15
|
+
fs.mkdirSync(generatedFileDir, { recursive: true });
|
|
16
|
+
}
|
|
17
|
+
const iconParam = pinnedField.params.find(p => isIconParam(p));
|
|
18
|
+
const labelParam = pinnedField.params.find(p => isLabelParam(p));
|
|
19
|
+
const icon = (_a = iconParam === null || iconParam === void 0 ? void 0 : iconParam.value) !== null && _a !== void 0 ? _a : "fa-solid fa-thumbtack";
|
|
20
|
+
const label = (_b = labelParam === null || labelParam === void 0 ? void 0 : labelParam.value) !== null && _b !== void 0 ? _b : `${document.name}.${pinnedField.name}`;
|
|
21
|
+
// Create a mapping of document types to their actions
|
|
22
|
+
const documentActionsMap = new Map();
|
|
23
|
+
if (entry) {
|
|
24
|
+
// Get all documents (actors and items) from the entry
|
|
25
|
+
const allDocuments = entry.documents;
|
|
26
|
+
for (const doc of allDocuments) {
|
|
27
|
+
if (doc.body && doc.name) {
|
|
28
|
+
const actions = getAllOfType(doc.body, isAction, false);
|
|
29
|
+
if (actions.length > 0) {
|
|
30
|
+
documentActionsMap.set(doc.name.toLowerCase(), actions);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
// Helper function to get action label
|
|
36
|
+
function getActionLabel(action) {
|
|
37
|
+
const parentDocument = AstUtils.getContainerOfType(action, isDocument);
|
|
38
|
+
return `${parentDocument === null || parentDocument === void 0 ? void 0 : parentDocument.name}.${action.name}`;
|
|
39
|
+
}
|
|
40
|
+
const fileNode = expandToNode `
|
|
41
|
+
<script setup>
|
|
42
|
+
import { ref, computed, inject, onMounted, watch } from "vue";
|
|
43
|
+
|
|
44
|
+
const props = defineProps({
|
|
45
|
+
systemPath: String,
|
|
46
|
+
context: Object,
|
|
47
|
+
primaryColor: String,
|
|
48
|
+
secondaryColor: String,
|
|
49
|
+
tertiaryColor: String
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const document = inject('rawDocument');
|
|
53
|
+
const search = ref('');
|
|
54
|
+
const loading = ref(false);
|
|
55
|
+
|
|
56
|
+
// Function to get actions for a specific document type
|
|
57
|
+
const getActionsForType = (itemType) => {
|
|
58
|
+
const actionsMap = {
|
|
59
|
+
${joinToNode(Array.from(documentActionsMap.entries()), ([docType, actions]) => expandToNode `'${docType}': [${joinToNode(actions, action => {
|
|
60
|
+
var _a, _b, _c, _d;
|
|
61
|
+
return expandToNode `{
|
|
62
|
+
name: '${action.name.toLowerCase()}',
|
|
63
|
+
icon: '${(_b = (_a = action.params.find(p => isIconParam(p))) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : "fa-solid fa-bolt"}',
|
|
64
|
+
color: '${(_d = (_c = action.params.find(p => isColorParam(p))) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : "primary"}',
|
|
65
|
+
label: '${getActionLabel(action)}'
|
|
66
|
+
}`;
|
|
67
|
+
}, { separator: ', ' })}]`, { separator: ',\n ' })}
|
|
68
|
+
};
|
|
69
|
+
return actionsMap[itemType.toLowerCase()] || [];
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
// Get all pinned items from the actor's items collection
|
|
73
|
+
const data = computed(() => {
|
|
74
|
+
if (!document || !document.items) return [];
|
|
75
|
+
|
|
76
|
+
return Array.from(document.items.values())
|
|
77
|
+
.filter(item => item.system?.pinned === true)
|
|
78
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
const humanize = (str) => {
|
|
82
|
+
if (!str) return "";
|
|
83
|
+
let humanized = str.replace(/_/g, " ");
|
|
84
|
+
humanized = humanized.replace("system.", "").replaceAll(".", " ");
|
|
85
|
+
humanized = humanized.charAt(0).toUpperCase() + humanized.slice(1);
|
|
86
|
+
return humanized;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const editItem = (item) => {
|
|
90
|
+
const foundryItem = document.items.get(item._id);
|
|
91
|
+
foundryItem.sheet.render(true);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const sendItemToChat = async (item) => {
|
|
95
|
+
const foundryItem = document.items.get(item._id);
|
|
96
|
+
const chatDescription = foundryItem.description ?? foundryItem.system.description;
|
|
97
|
+
const content = await renderTemplate("systems/${id}/system/templates/chat/standard-card.hbs", {
|
|
98
|
+
cssClass: "${id}",
|
|
99
|
+
document: foundryItem,
|
|
100
|
+
hasEffects: foundryItem.effects?.size > 0,
|
|
101
|
+
description: chatDescription,
|
|
102
|
+
hasDescription: chatDescription != ""
|
|
103
|
+
});
|
|
104
|
+
ChatMessage.create({
|
|
105
|
+
content: content,
|
|
106
|
+
speaker: ChatMessage.getSpeaker(),
|
|
107
|
+
style: CONST.CHAT_MESSAGE_STYLES.IC
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const deleteItem = async (item) => {
|
|
112
|
+
const foundryItem = document.items.get(item._id);
|
|
113
|
+
const shouldDelete = await Dialog.confirm({
|
|
114
|
+
title: "Delete Confirmation",
|
|
115
|
+
content: \`<p>Are you sure you would like to delete the "\${foundryItem.name}" Item?</p>\`,
|
|
116
|
+
defaultYes: false
|
|
117
|
+
});
|
|
118
|
+
if (shouldDelete) foundryItem.delete();
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
const customItemAction = async (item, actionName) => {
|
|
122
|
+
const foundryItem = document.items.get(item._id);
|
|
123
|
+
const event = { currentTarget: { dataset: { action: actionName } } };
|
|
124
|
+
foundryItem.sheet._onAction(event);
|
|
125
|
+
};
|
|
126
|
+
|
|
127
|
+
const togglePin = async (item) => {
|
|
128
|
+
const foundryItem = document.items.get(item._id);
|
|
129
|
+
await foundryItem.update({"system.pinned": !foundryItem.system.pinned});
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const bindDragDrop = () => {
|
|
133
|
+
try {
|
|
134
|
+
if (document.sheet.element) {
|
|
135
|
+
document.sheet.dragDrop.forEach((d) => d.bind(document.sheet.element));
|
|
136
|
+
}
|
|
137
|
+
} catch (e) {
|
|
138
|
+
console.error(e);
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
// Bind drag drop after component mount
|
|
143
|
+
setTimeout(() => bindDragDrop(), 100);
|
|
144
|
+
</script>
|
|
145
|
+
|
|
146
|
+
<template>
|
|
147
|
+
<v-card flat class="isdl-datatable pt-2">
|
|
148
|
+
<v-card-title class="d-flex align-center pe-1" style="height: 40px;">
|
|
149
|
+
<v-icon icon="${icon}" size="small" />
|
|
150
|
+
{{ game.i18n.localize("${label}") }}
|
|
151
|
+
<v-spacer></v-spacer>
|
|
152
|
+
<v-text-field
|
|
153
|
+
v-model="search"
|
|
154
|
+
density="compact"
|
|
155
|
+
label="Search"
|
|
156
|
+
prepend-inner-icon="fa-solid fa-magnify"
|
|
157
|
+
variant="outlined"
|
|
158
|
+
flat
|
|
159
|
+
hide-details
|
|
160
|
+
single-line
|
|
161
|
+
clearable
|
|
162
|
+
style="margin: 0; margin-right: 8px;"
|
|
163
|
+
></v-text-field>
|
|
164
|
+
</v-card-title>
|
|
165
|
+
<v-divider></v-divider>
|
|
166
|
+
|
|
167
|
+
<v-data-table
|
|
168
|
+
v-model:search="search"
|
|
169
|
+
:items="data"
|
|
170
|
+
:search="search"
|
|
171
|
+
hover
|
|
172
|
+
density="compact"
|
|
173
|
+
hide-default-footer
|
|
174
|
+
items-per-page=-1
|
|
175
|
+
style="background: none;"
|
|
176
|
+
class="custom-datatable"
|
|
177
|
+
:sort-by="[{ key: 'system.pinned', order: 'desc' }, { key: 'name', order: 'asc' }]"
|
|
178
|
+
>
|
|
179
|
+
<template #headers>
|
|
180
|
+
<tr>
|
|
181
|
+
<th class="text-left font-weight-medium" style="width: 40px;"></th>
|
|
182
|
+
<th class="text-left font-weight-medium" style="width: 50px;">{{ game.i18n.localize("Image") }}</th>
|
|
183
|
+
<th class="text-left font-weight-medium">{{ game.i18n.localize("Name") }}</th>
|
|
184
|
+
<th class="text-center font-weight-medium" style="width: 100px;">{{ game.i18n.localize("Type") }}</th>
|
|
185
|
+
<th class="text-center font-weight-medium" style="width: 150px;">{{ game.i18n.localize("Actions") }}</th>
|
|
186
|
+
</tr>
|
|
187
|
+
</template>
|
|
188
|
+
|
|
189
|
+
<!-- Pin toggle slot -->
|
|
190
|
+
<template v-slot:item="{ item }">
|
|
191
|
+
<tr :data-item-id="item._id" :data-document-id="document._id" :data-uuid="item.uuid">
|
|
192
|
+
<td class="text-center" style="width: 40px;">
|
|
193
|
+
<v-btn
|
|
194
|
+
icon
|
|
195
|
+
size="small"
|
|
196
|
+
variant="text"
|
|
197
|
+
@click="togglePin(item)"
|
|
198
|
+
:data-tooltip="'Unpin'"
|
|
199
|
+
>
|
|
200
|
+
<v-icon
|
|
201
|
+
icon="fa-solid fa-thumbtack"
|
|
202
|
+
:color="primaryColor || '#ffd700'"
|
|
203
|
+
size="small"
|
|
204
|
+
></v-icon>
|
|
205
|
+
</v-btn>
|
|
206
|
+
</td>
|
|
207
|
+
|
|
208
|
+
<!-- Image slot -->
|
|
209
|
+
<td style="width: 50px;">
|
|
210
|
+
<v-avatar size="32" rounded="0">
|
|
211
|
+
<v-img :src="item.img" :alt="item.name" cover></v-img>
|
|
212
|
+
</v-avatar>
|
|
213
|
+
</td>
|
|
214
|
+
|
|
215
|
+
<!-- Name slot -->
|
|
216
|
+
<td>
|
|
217
|
+
<div class="d-flex align-center" :data-tooltip="item.system.description">
|
|
218
|
+
<div class="font-weight-medium">{{ item.name }}</div>
|
|
219
|
+
</div>
|
|
220
|
+
</td>
|
|
221
|
+
|
|
222
|
+
<!-- Type slot -->
|
|
223
|
+
<td class="text-center" style="width: 100px;">
|
|
224
|
+
<v-chip
|
|
225
|
+
size="small"
|
|
226
|
+
variant="outlined"
|
|
227
|
+
class="text-caption"
|
|
228
|
+
color="primary"
|
|
229
|
+
>
|
|
230
|
+
{{ item.type }}
|
|
231
|
+
</v-chip>
|
|
232
|
+
</td>
|
|
233
|
+
|
|
234
|
+
<!-- Actions slot -->
|
|
235
|
+
<td class="text-center" style="width: 150px;">
|
|
236
|
+
<div class="d-flex align-center justify-center ga-1">
|
|
237
|
+
<template v-for="action in getActionsForType(item.type)" :key="action.name">
|
|
238
|
+
<v-tooltip :text="game.i18n.localize(action.label)">
|
|
239
|
+
<template v-slot:activator="{ props }">
|
|
240
|
+
<v-btn
|
|
241
|
+
v-bind="props"
|
|
242
|
+
:icon="action.icon"
|
|
243
|
+
size="x-small"
|
|
244
|
+
variant="text"
|
|
245
|
+
:color="action.color"
|
|
246
|
+
@click="customItemAction(item, action.name)"
|
|
247
|
+
></v-btn>
|
|
248
|
+
</template>
|
|
249
|
+
</v-tooltip>
|
|
250
|
+
</template>
|
|
251
|
+
<v-tooltip text="Edit">
|
|
252
|
+
<template v-slot:activator="{ props }">
|
|
253
|
+
<v-btn
|
|
254
|
+
v-bind="props"
|
|
255
|
+
icon="fa-solid fa-edit"
|
|
256
|
+
size="x-small"
|
|
257
|
+
variant="text"
|
|
258
|
+
@click="editItem(item)"
|
|
259
|
+
></v-btn>
|
|
260
|
+
</template>
|
|
261
|
+
</v-tooltip>
|
|
262
|
+
<v-tooltip text="Send to Chat">
|
|
263
|
+
<template v-slot:activator="{ props }">
|
|
264
|
+
<v-btn
|
|
265
|
+
v-bind="props"
|
|
266
|
+
icon="fa-solid fa-message"
|
|
267
|
+
size="x-small"
|
|
268
|
+
variant="text"
|
|
269
|
+
@click="sendItemToChat(item)"
|
|
270
|
+
></v-btn>
|
|
271
|
+
</template>
|
|
272
|
+
</v-tooltip>
|
|
273
|
+
<v-tooltip text="Delete">
|
|
274
|
+
<template v-slot:activator="{ props }">
|
|
275
|
+
<v-btn
|
|
276
|
+
v-bind="props"
|
|
277
|
+
icon="fa-solid fa-trash"
|
|
278
|
+
size="x-small"
|
|
279
|
+
variant="text"
|
|
280
|
+
color="error"
|
|
281
|
+
@click="deleteItem(item)"
|
|
282
|
+
></v-btn>
|
|
283
|
+
</template>
|
|
284
|
+
</v-tooltip>
|
|
285
|
+
</div>
|
|
286
|
+
</td>
|
|
287
|
+
</tr>
|
|
288
|
+
</template>
|
|
289
|
+
|
|
290
|
+
<!-- No data slot -->
|
|
291
|
+
<template v-slot:no-data>
|
|
292
|
+
<div class="text-center pa-4">
|
|
293
|
+
<v-icon size="48" color="grey-lighten-1">fa-solid fa-thumbtack</v-icon>
|
|
294
|
+
<div class="text-h6 mt-2">No pinned items</div>
|
|
295
|
+
<div class="text-body-2 text-medium-emphasis">
|
|
296
|
+
Pin items from your inventory to see them here
|
|
297
|
+
</div>
|
|
298
|
+
</div>
|
|
299
|
+
</template>
|
|
300
|
+
</v-data-table>
|
|
301
|
+
</v-card>
|
|
302
|
+
</template>
|
|
303
|
+
`.appendNewLine();
|
|
304
|
+
fs.writeFileSync(generatedFilePath, toString(fileNode));
|
|
305
|
+
}
|
|
306
|
+
//# sourceMappingURL=vue-pinned-datatable-component-generator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"vue-pinned-datatable-component-generator.js","sourceRoot":"","sources":["../../../../src/cli/components/vue/vue-pinned-datatable-component-generator.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,EAAC,YAAY,EAAE,UAAU,EAAE,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AACpE,OAAO,EAKH,QAAQ,EACR,OAAO,EACP,YAAY,EAAE,UAAU,EACxB,WAAW,EACX,YAAY,EACZ,MAAM,EAIT,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAC,YAAY,EAAC,MAAM,aAAa,CAAC;AACzC,OAAO,EAAC,QAAQ,EAAC,MAAM,SAAS,CAAC;AAEjC,MAAM,UAA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