Skip to content

Commit

Permalink
Small improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
erwinheldy committed Oct 13, 2023
1 parent 99abd4f commit 06b0589
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 11 deletions.
7 changes: 2 additions & 5 deletions src/docs/code/basic.html.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<input type="text" class="form-control example" value="html,css,js">
<input type="text" class="form-control example" placeholder="Add a tag then press comma or Enter" />
<input type="text" class="form-control" value="html,css,js" id="example-basic">

<script>
document.querySelectorAll('.example').forEach((input) => {
UseBootstrapTag(input)
})
UseBootstrapTag(document.getElementById('example-basic'))
</script>
2 changes: 1 addition & 1 deletion src/docs/code/max.html.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!-- Using data-ub-tag-max attribute: -->
<input type="text" class="form-control" placeholder="Enter tags (max 3)" data-ub-tag-max="3" id="example-max" />
<input type="text" class="form-control" placeholder="Enter tags (max 3)" data-ub-tag-max="3" id="example-max">

<script>
UseBootstrapTag(document.getElementById('example-max'))
Expand Down
2 changes: 1 addition & 1 deletion src/docs/code/methods.html.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<input type="text" class="form-control" value="html,css,js" id="example-methods" />
<input type="text" class="form-control" value="html,css,js" id="example-methods">
<button class="btn btn-sm btn-success" type="button" id="addValue-string">addValue('react')</button>
<button class="btn btn-sm btn-success" type="button" id="addValue-string-with-separator">addValue('vue,svelte')</button>
<button class="btn btn-sm btn-success" type="button" id="addValue-array">addValue(['solid', 'qwik'])</button>
Expand Down
6 changes: 6 additions & 0 deletions src/docs/code/onblur.html.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<!-- Using data-ub-tag-no-input-onblur attribute: -->
<input type="text" class="form-control" data-ub-tag-no-input-onblur id="example-no-input-onblur">

<script>
UseBootstrapTag(document.getElementById('example-no-input-onblur'))
</script>
5 changes: 5 additions & 0 deletions src/docs/code/placeholder.html.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<input type="text" class="form-control" placeholder="Add a tag then press comma or Enter" id="example-placeholder">

<script>
UseBootstrapTag(document.getElementById('example-placeholder'))
</script>
6 changes: 3 additions & 3 deletions src/docs/code/validation.html.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<form class="needs-validation vstack gap-3" novalidate>
<div>
<input type="text" class="form-control example-validation" name="tags" placeholder="Add a tag" required id="example-validation" />
<input type="text" class="form-control example-validation" name="tags" placeholder="Add a tag" required id="example-validation">
<div class="invalid-feedback">This field is required.</div>
<div class="valid-feedback">Looks good!</div>
</div>
Expand All @@ -10,11 +10,11 @@
<!-- Server side: just add "is-invalid" or "is-valid" -->
<div class="vstack gap-3">
<div>
<input type="text" class="form-control example-validation is-invalid" placeholder="Add a tag" />
<input type="text" class="form-control example-validation is-invalid" placeholder="Add a tag">
<div class="invalid-feedback">This field is required.</div>
</div>
<div>
<input type="text" class="form-control example-validation is-valid" placeholder="Add a tag" value="use,bootstrap,tag" />
<input type="text" class="form-control example-validation is-valid" placeholder="Add a tag" value="use,bootstrap,tag">
<div class="valid-feedback">Looks good!</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion vite.config.lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
dts({
include: pkg.source,
insertTypesEntry: true,
afterBuild: () => rename('dist/use-bootstrap-tag.d.ts', pkg.types),
afterBuild: () => rename(`dist/${pkg.name}.d.ts`, pkg.types),
}),
],
})

0 comments on commit 06b0589

Please sign in to comment.