プラグイン初期作成
This commit is contained in:
10
vue-project/my-kintone-plugin/src/App.vue
Normal file
10
vue-project/my-kintone-plugin/src/App.vue
Normal file
@@ -0,0 +1,10 @@
|
||||
<script setup>
|
||||
import Config from './components/Config.vue'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<Config msg="Vite + Vue" />
|
||||
</template>
|
||||
|
||||
<style scoped>
|
||||
</style>
|
||||
BIN
vue-project/my-kintone-plugin/src/assets/icon.png
Normal file
BIN
vue-project/my-kintone-plugin/src/assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 110 B |
1
vue-project/my-kintone-plugin/src/assets/vue.svg
Normal file
1
vue-project/my-kintone-plugin/src/assets/vue.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" aria-hidden="true" role="img" class="iconify iconify--logos" width="37.07" height="36" preserveAspectRatio="xMidYMid meet" viewBox="0 0 256 198"><path fill="#41B883" d="M204.8 0H256L128 220.8L0 0h97.92L128 51.2L157.44 0h47.36Z"></path><path fill="#41B883" d="m0 0l128 220.8L256 0h-51.2L128 132.48L50.56 0H0Z"></path><path fill="#35495E" d="M50.56 0L128 133.12L204.8 0h-47.36L128 51.2L97.92 0H50.56Z"></path></svg>
|
||||
|
After Width: | Height: | Size: 496 B |
39
vue-project/my-kintone-plugin/src/components/Config.vue
Normal file
39
vue-project/my-kintone-plugin/src/components/Config.vue
Normal file
@@ -0,0 +1,39 @@
|
||||
<template>
|
||||
<!-- <section class="settings"> -->
|
||||
<h2 class="settings-heading">Settings for data fetch pluging</h2>
|
||||
<p class="kintoneplugin-desc">This message is displayed on the app page after the app has been updated.</p>
|
||||
<form class="js-submit-settings">
|
||||
<p class="kintoneplugin-row">
|
||||
<label for="message">
|
||||
Message:
|
||||
<input type="text" class="js-text-message kintoneplugin-input-text">
|
||||
</label>
|
||||
</p>
|
||||
<p class="kintoneplugin-row">
|
||||
<button type="button" class="js-cancel-button kintoneplugin-button-dialog-cancel">Cancel</button>
|
||||
<button class="kintoneplugin-button-dialog-ok">Save</button>
|
||||
</p>
|
||||
</form>
|
||||
<!-- </section> -->
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from 'vue';
|
||||
import '../css/51-modern-default.css';
|
||||
import '../css/config.css';
|
||||
|
||||
defineProps({
|
||||
msg: String,
|
||||
});
|
||||
|
||||
const count = ref(0)
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.settings-heading {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.kintoneplugin-input-text {
|
||||
width: 20em;
|
||||
}
|
||||
</style>
|
||||
665
vue-project/my-kintone-plugin/src/css/51-modern-default.css
Normal file
665
vue-project/my-kintone-plugin/src/css/51-modern-default.css
Normal file
File diff suppressed because one or more lines are too long
7
vue-project/my-kintone-plugin/src/css/config.css
Normal file
7
vue-project/my-kintone-plugin/src/css/config.css
Normal file
@@ -0,0 +1,7 @@
|
||||
.settings-heading {
|
||||
padding: 1em 0;
|
||||
}
|
||||
|
||||
.kintoneplugin-input-text {
|
||||
width: 20em;
|
||||
}
|
||||
10
vue-project/my-kintone-plugin/src/css/desktop.css
Normal file
10
vue-project/my-kintone-plugin/src/css/desktop.css
Normal file
@@ -0,0 +1,10 @@
|
||||
.plugin-space-heading {
|
||||
font-size: 1.5rem;
|
||||
margin: 0.8rem;
|
||||
}
|
||||
.plugin-space-message {
|
||||
display: inline-block;
|
||||
font-size: 1.2em;
|
||||
margin: 0.8rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
11
vue-project/my-kintone-plugin/src/css/mobile.css
Normal file
11
vue-project/my-kintone-plugin/src/css/mobile.css
Normal file
@@ -0,0 +1,11 @@
|
||||
.plugin-space-message {
|
||||
display: inline-block;
|
||||
font-size: 1.2em;
|
||||
margin: 0.8rem;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.plugin-space-heading {
|
||||
font-size: 1.5rem;
|
||||
margin: 0.8rem;
|
||||
}
|
||||
25
vue-project/my-kintone-plugin/src/js/config.js
Normal file
25
vue-project/my-kintone-plugin/src/js/config.js
Normal file
@@ -0,0 +1,25 @@
|
||||
(function (PLUGIN_ID) {
|
||||
const formEl = document.querySelector('.js-submit-settings');
|
||||
const cancelButtonEl = document.querySelector('.js-cancel-button');
|
||||
const messageEl = document.querySelector('.js-text-message');
|
||||
if (!(formEl && cancelButtonEl && messageEl)) {
|
||||
throw new Error('Required elements do not exist.');
|
||||
}
|
||||
|
||||
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
|
||||
if (config.message) {
|
||||
messageEl.value = config.message;
|
||||
}
|
||||
|
||||
formEl.addEventListener('submit', (e) => {
|
||||
e.preventDefault();
|
||||
kintone.plugin.app.setConfig({ message: messageEl.value }, () => {
|
||||
alert('The plug-in settings have been saved. Please update the app!');
|
||||
window.location.href = '../../flow?app=' + kintone.app.getId();
|
||||
});
|
||||
});
|
||||
|
||||
cancelButtonEl.addEventListener('click', () => {
|
||||
window.location.href = '../../' + kintone.app.getId() + '/plugin/';
|
||||
});
|
||||
})(kintone.$PLUGIN_ID);
|
||||
24
vue-project/my-kintone-plugin/src/js/desktop.js
Normal file
24
vue-project/my-kintone-plugin/src/js/desktop.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import '../css/desktop.css'
|
||||
import '../css/51-modern-default.css';
|
||||
(function (PLUGIN_ID) {
|
||||
kintone.events.on('app.record.index.show', () => {
|
||||
const spaceEl = kintone.app.getHeaderSpaceElement();
|
||||
if (spaceEl === null) {
|
||||
throw new Error('The header element is unavailable on this page.');
|
||||
}
|
||||
|
||||
const fragment = document.createDocumentFragment();
|
||||
const headingEl = document.createElement('h3');
|
||||
const messageEl = document.createElement('p');
|
||||
|
||||
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
|
||||
messageEl.textContent = config.message;
|
||||
messageEl.classList.add('plugin-space-message');
|
||||
headingEl.textContent = 'Hello kintone plugin!';
|
||||
headingEl.classList.add('plugin-space-heading');
|
||||
|
||||
fragment.appendChild(headingEl);
|
||||
fragment.appendChild(messageEl);
|
||||
spaceEl.appendChild(fragment);
|
||||
});
|
||||
})(kintone.$PLUGIN_ID);
|
||||
23
vue-project/my-kintone-plugin/src/js/mobile.js
Normal file
23
vue-project/my-kintone-plugin/src/js/mobile.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import '../css/mobile.css';
|
||||
(function (PLUGIN_ID) {
|
||||
kintone.events.on('mobile.app.record.index.show', () => {
|
||||
const spaceEl = kintone.mobile.app.getHeaderSpaceElement();
|
||||
if (spaceEl === null) {
|
||||
throw new Error('The header element is unavailable on this page.');
|
||||
}
|
||||
|
||||
const fragment = document.createDocumentFragment();
|
||||
const headingEl = document.createElement('h3');
|
||||
const messageEl = document.createElement('p');
|
||||
|
||||
const config = kintone.plugin.app.getConfig(PLUGIN_ID);
|
||||
messageEl.textContent = config.message;
|
||||
messageEl.classList.add('plugin-space-message');
|
||||
headingEl.textContent = 'Hello kintone plugin!';
|
||||
headingEl.classList.add('plugin-space-heading');
|
||||
|
||||
fragment.appendChild(headingEl);
|
||||
fragment.appendChild(messageEl);
|
||||
spaceEl.appendChild(fragment);
|
||||
});
|
||||
})(kintone.$PLUGIN_ID);
|
||||
5
vue-project/my-kintone-plugin/src/main.js
Normal file
5
vue-project/my-kintone-plugin/src/main.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import { createApp } from 'vue'
|
||||
import './style.css'
|
||||
import App from './App.vue'
|
||||
|
||||
createApp(App).mount('#app')
|
||||
45
vue-project/my-kintone-plugin/src/manifest.json
Normal file
45
vue-project/my-kintone-plugin/src/manifest.json
Normal file
@@ -0,0 +1,45 @@
|
||||
{
|
||||
"$schema": "https://raw.githubusercontent.com/kintone/js-sdk/%40kintone/plugin-manifest-validator%4010.2.0/packages/plugin-manifest-validator/manifest-schema.json",
|
||||
"manifest_version": 1,
|
||||
"version": 2,
|
||||
"type": "APP",
|
||||
"desktop": {
|
||||
"js": [
|
||||
"js/desktop.js"
|
||||
],
|
||||
"css": [
|
||||
"css/51-modern-default.css",
|
||||
"css/desktop.css"
|
||||
]
|
||||
},
|
||||
"icon": "image/icon.png",
|
||||
"config": {
|
||||
"html": "html/config.html",
|
||||
"js": [
|
||||
"js/config.js"
|
||||
],
|
||||
"css": [
|
||||
"css/51-modern-default.css",
|
||||
"css/config.css"
|
||||
],
|
||||
"required_params": [
|
||||
"message"
|
||||
]
|
||||
},
|
||||
"name": {
|
||||
"en": "data fetch pluging",
|
||||
"ja": "データ取得プラグイン"
|
||||
},
|
||||
"description": {
|
||||
"en": "create search data pluging",
|
||||
"ja": "検索結果のデータを生成するプラグインです"
|
||||
},
|
||||
"mobile": {
|
||||
"js": [
|
||||
"js/mobile.js"
|
||||
],
|
||||
"css": [
|
||||
"css/mobile.css"
|
||||
]
|
||||
}
|
||||
}
|
||||
79
vue-project/my-kintone-plugin/src/style.css
Normal file
79
vue-project/my-kintone-plugin/src/style.css
Normal file
@@ -0,0 +1,79 @@
|
||||
:root {
|
||||
font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
font-weight: 400;
|
||||
|
||||
color-scheme: light dark;
|
||||
color: rgba(255, 255, 255, 0.87);
|
||||
background-color: #242424;
|
||||
|
||||
font-synthesis: none;
|
||||
text-rendering: optimizeLegibility;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
a {
|
||||
font-weight: 500;
|
||||
color: #646cff;
|
||||
text-decoration: inherit;
|
||||
}
|
||||
a:hover {
|
||||
color: #535bf2;
|
||||
}
|
||||
|
||||
body {
|
||||
margin: 0;
|
||||
display: flex;
|
||||
place-items: center;
|
||||
min-width: 320px;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
h1 {
|
||||
font-size: 3.2em;
|
||||
line-height: 1.1;
|
||||
}
|
||||
|
||||
button {
|
||||
border-radius: 8px;
|
||||
border: 1px solid transparent;
|
||||
padding: 0.6em 1.2em;
|
||||
font-size: 1em;
|
||||
font-weight: 500;
|
||||
font-family: inherit;
|
||||
background-color: #1a1a1a;
|
||||
cursor: pointer;
|
||||
transition: border-color 0.25s;
|
||||
}
|
||||
button:hover {
|
||||
border-color: #646cff;
|
||||
}
|
||||
button:focus,
|
||||
button:focus-visible {
|
||||
outline: 4px auto -webkit-focus-ring-color;
|
||||
}
|
||||
|
||||
.card {
|
||||
padding: 2em;
|
||||
}
|
||||
|
||||
#app {
|
||||
max-width: 1280px;
|
||||
margin: 0 auto;
|
||||
padding: 2rem;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
@media (prefers-color-scheme: light) {
|
||||
:root {
|
||||
color: #213547;
|
||||
background-color: #ffffff;
|
||||
}
|
||||
a:hover {
|
||||
color: #747bff;
|
||||
}
|
||||
button {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user