Skip to content

Commit

Permalink
make custom-element example usable
Browse files Browse the repository at this point in the history
  • Loading branch information
mskocik committed Jul 18, 2022
1 parent 779efba commit cd65afc
Show file tree
Hide file tree
Showing 11 changed files with 131 additions and 97 deletions.
1 change: 1 addition & 0 deletions docs/_app/immutable/chunks/index-6671f245.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

73 changes: 73 additions & 0 deletions docs/_app/immutable/chunks/index-ab5d0dde.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions docs/_app/immutable/chunks/preload-helper-b22d3b18.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/_app/immutable/pages/index.svelte-6a6ed06d.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import"../chunks/index-1e0e0ebd.js";import{R as p}from"../chunks/index-ab5d0dde.js";import"../chunks/preload-helper-b22d3b18.js";export{p as default};
75 changes: 0 additions & 75 deletions docs/_app/immutable/pages/index.svelte-a9a3ded9.js

This file was deleted.

1 change: 1 addition & 0 deletions docs/_app/immutable/start-19a3190e.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion docs/_app/immutable/start-96f8d8c3.js

This file was deleted.

44 changes: 35 additions & 9 deletions docs/_app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
".svelte-kit/runtime/client/start.js": {
"file": "immutable/start-96f8d8c3.js",
"file": "immutable/start-19a3190e.js",
"src": ".svelte-kit/runtime/client/start.js",
"isEntry": true,
"imports": [
"_index-1e0e0ebd.js"
"_index-1e0e0ebd.js",
"_preload-helper-b22d3b18.js"
],
"dynamicImports": [
".svelte-kit/runtime/components/layout.svelte",
".svelte-kit/runtime/components/error.svelte",
"src/routes/index.svelte"
"_index-ab5d0dde.js"
]
},
".svelte-kit/runtime/components/layout.svelte": {
Expand All @@ -31,22 +32,47 @@
]
},
"src/routes/index.svelte": {
"file": "immutable/pages/index.svelte-a9a3ded9.js",
"file": "immutable/pages/index.svelte-6a6ed06d.js",
"src": "src/routes/index.svelte",
"isEntry": true,
"imports": [
"_index-1e0e0ebd.js",
"_index-ab5d0dde.js",
"_preload-helper-b22d3b18.js"
]
},
"_index-1e0e0ebd.js": {
"file": "immutable/chunks/index-1e0e0ebd.js"
},
"_preload-helper-b22d3b18.js": {
"file": "immutable/chunks/preload-helper-b22d3b18.js"
},
"_index-ab5d0dde.js": {
"file": "immutable/chunks/index-ab5d0dde.js",
"isDynamicEntry": true,
"imports": [
"_index-1e0e0ebd.js"
"_index-1e0e0ebd.js",
"_preload-helper-b22d3b18.js"
],
"dynamicImports": [
"src/lib/index.js"
],
"css": [
"immutable/assets/index-a9bc93c9.css"
]
},
"_index-1e0e0ebd.js": {
"file": "immutable/chunks/index-1e0e0ebd.js"
"src/lib/index.js": {
"file": "immutable/chunks/index-6671f245.js",
"src": "src/lib/index.js",
"isDynamicEntry": true,
"imports": [
"_index-ab5d0dde.js",
"_index-1e0e0ebd.js",
"_preload-helper-b22d3b18.js"
]
},
"src/routes\\index.css": {
"index.css": {
"file": "immutable/assets/index-a9bc93c9.css",
"src": "src/routes\\index.css"
"src": "index.css"
}
}
2 changes: 1 addition & 1 deletion docs/_app/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"version":"1658175502760"}
{"version":"1658176359021"}
16 changes: 9 additions & 7 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
</style>
<meta http-equiv="content-security-policy" content="">
<link rel="stylesheet" href="/svelty-picker/_app/immutable/assets/index-a9bc93c9.css">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/start-96f8d8c3.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/start-19a3190e.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/chunks/index-1e0e0ebd.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/chunks/preload-helper-b22d3b18.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/layout.svelte-91c1ce5c.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/pages/index.svelte-a9a3ded9.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/pages/index.svelte-6a6ed06d.js">
<link rel="modulepreload" href="/svelty-picker/_app/immutable/chunks/index-ab5d0dde.js">
</head>
<body>
<a class="github-fork-ribbon right-top fixed" target="_blank" href="https://github.com/mskocik/svelty-picker" data-ribbon="Fork me on GitHub" title="Fork me on GitHub">Fork me on GitHub</a>
Expand Down Expand Up @@ -273,7 +275,7 @@ <h5 class="mt-5">📅 Full example!</h5>

<form><div class="row"><div class="col-sm-6"><div class="form-group"><span class="form-label">Full date-time picker
</span>
<input type="text" tabindex="0" name="date" value="2022-07-18 22:18" placeholder="Pick your date and time" autocomplete="off" class="form-control svelte-1pq5qho" >
<input type="text" tabindex="0" name="date" value="2022-07-18 22:32" placeholder="Pick your date and time" autocomplete="off" class="form-control svelte-1pq5qho" >
</div></div>
<div class="col-sm-4">Change format:
<select name="" id="" class="form-select"><optgroup label="Date & time"><option value="yyyy-mm-dd hh:ii">yyyy-mm-dd hh:ii</option><option value="mm/dd/yyyy hh:ii">mm/dd/yyyy hh:ii</option><option value="dd.mm.yyyy hh:ii">dd.mm.yyyy hh:ii</option><option value="dd-M-yy hh:ii">dd-M-yy hh:ii</option></optgroup><optgroup label="Date only"><option value="yyyy-mm-dd">yyyy-mm-dd</option><option value="mm/dd/yyyy">mm/dd/yyyy</option><option value="dd.mm.yyyy">dd.mm.yyyy</option><option value="dd-M-yy">dd-M-yy</option><option value="dd MM yyyy">dd MM yyyy</option></optgroup></select></div></div></form>
Expand Down Expand Up @@ -424,7 +426,7 @@ <h5 class="mt-3">🎨 Easily themable - just override CSS variables
<button class="sdt-action-btn sdt-clear-btn svelte-1pq5qho" disabled>Clear</button></div></div>
<label><input type="checkbox"> Remove all theming
</label></div></div></div>
<div class="row"><div class="col-4">Datepicker as custom element!
<div class="row"><div class="col-6"><h3>Datepicker as custom element!</h3>
<el-picker input-classes="form-control"></el-picker></div></div>

<h5 class="mt-5">💬 Event listening:
Expand All @@ -440,10 +442,10 @@ <h5 class="mt-5">💬 Event listening:
</div></div></div></div></div></div>


<script type="module" data-sveltekit-hydrate="151ryfe">
import { start } from "/svelty-picker/_app/immutable/start-96f8d8c3.js";
<script type="module" data-sveltekit-hydrate="dy5owf">
import { start } from "/svelty-picker/_app/immutable/start-19a3190e.js";
start({
target: document.querySelector('[data-sveltekit-hydrate="151ryfe"]').parentNode,
target: document.querySelector('[data-sveltekit-hydrate="dy5owf"]').parentNode,
paths: {"base":"/svelty-picker","assets":"/svelty-picker"},
session: {},
route: true,
Expand Down
13 changes: 9 additions & 4 deletions src/routes/_examples.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
// @ts-nocheck
import { onMount } from 'svelte';
import SveltyPicker from '$lib/components/SveltyPicker.svelte';
import { registerElement } from '$lib/index.js';
// import { registerElement } from '$lib/index.js';
// import settings from '$lib/settings';
// import from '$lib/custom-element.js';
let nowString = '2022-07-16T00:00:00Z';
// let now = null;
Expand All @@ -22,7 +23,11 @@
$: customTheme = themeRemoved ? '' : 'my-colors';
onMount(() => {
registerElement('el-picker');
import('./../lib/index').then(resp => {
console.log('🥳 success');
resp.registerElement && resp.registerElement('el-picker');
}).catch(e => console.log('error', e));
// registerElement && registerElement('el-picker');
});
let log = '';
Expand Down Expand Up @@ -129,8 +134,8 @@
</div>
</div>
<div class="row">
<div class="col-4">
Datepicker as custom element!
<div class="col-6">
<h3>Datepicker as custom element!</h3>
<el-picker input-classes="form-control"></el-picker>
</div>
</div>
Expand Down

0 comments on commit cd65afc

Please sign in to comment.