hx-tomselect 1.0.6 → 1.0.12

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/README.md CHANGED
@@ -2,8 +2,13 @@
2
2
 
3
3
  Provides a hx-ext="tomselect" htmx extention tag
4
4
 
5
+ <a href="https://lassebomh.github.io/htmx-playground/?url=https%253A%252F%252Fraw.githubusercontent.com%252FKiwiKid%252Fhx-tomselect%252Fmain%252Fplayground%252Fbasic.json">Playground</a>
6
+
7
+
5
8
  <a href="https://kiwikid.github.io/hx-tomselect/">Full Examples List</a>
6
9
 
10
+
11
+
7
12
  ### Install
8
13
  ```html
9
14
  <script src="https://cdn.jsdelivr.net/npm/hx-tomselect@latest/hx-tomselect.js"></script>
package/hx-tomselect.js CHANGED
@@ -1,6 +1,6 @@
1
1
  (function() {
2
2
  /** stable build*/
3
- const version = '10'
3
+ const version = '11'
4
4
 
5
5
  /**
6
6
  * @typedef {Object} SupportedAttribute
@@ -252,6 +252,7 @@
252
252
 
253
253
  let config = {
254
254
  maxItems: 999,
255
+ multiple: true,
255
256
  plugins: {}
256
257
  };
257
258
 
@@ -286,7 +287,7 @@
286
287
  if (debug) { console.info('hx-tomselect - tom-select-success - config', config) }
287
288
  const ts = new TomSelect(s, config);
288
289
  s.setAttribute('tom-select-success', `success`);
289
- s.setAttribute('hx-tom-select-version', `hx-ts-${version}_ts-${ts.version}`);
290
+ s.setAttribute('hx-tom-select-version', `hx_ts-${ts.version}`);
290
291
 
291
292
  } catch (err) {
292
293
  s.setAttribute('tom-select-error', JSON.stringify(err));
package/index.html CHANGED
@@ -21,6 +21,7 @@
21
21
 
22
22
  gtag('config', 'G-QNEWNK6T05');
23
23
  </script>
24
+ <meta name="google-site-verification" content="sxjVvIPkcjCaInV5YUF01yosZnRtagwGreWlnLQ4MlE" />
24
25
 
25
26
  </head>
26
27
 
@@ -44,17 +45,22 @@
44
45
  }
45
46
  </style>
46
47
  <p class="p-4 text-xl mb-10">
47
- <a class="underline" href="https://unpkg.com/hx-tomselect@latest/hx-tomselect.js">hx-tomselect</a> - a <a
48
+ <a class="underline" href="https://github.com/KiwiKid/hx-tomselect">hx-tomselect</a> - a <a
48
49
  class="underline" href="https://v1.htmx.org/docs/#extensions" target="_">htmx extention</a> for <a
49
50
  class="underline" href="https://tom-select.js.org/">tom-select.js</a>
50
51
  </p>
52
+ <section class="mb-20">
53
+ <a href="https://lassebomh.github.io/htmx-playground/?url=https%253A%252F%252Fraw.githubusercontent.com%252FKiwiKid%252Fhx-tomselect%252Fmain%252Fplayground%252Fbasic.json" class="underline">playground</a> / <a class="underline" href="https://github.com/KiwiKid/hx-tomselect">github</a>
54
+
55
+ </section>
56
+
51
57
  <section class="mb-20">
52
58
  <h1 class="text-xl">Install:</h1>
53
59
 
54
60
  <pre
55
61
  class="mb-2 code-container"><code class="language-markup wrap">&lt;script src="https://unpkg.com/hx-tomselect/hx-tomselect.js"&gt;&lt;/script&gt;</code></pre>
56
62
 
57
- This extention relies on <a class="underline" href="https://v1.htmx.org">htmx</a> and <a class="underline"
63
+ this extention relies on <a class="underline" href="https://v1.htmx.org">htmx</a> and <a class="underline"
58
64
  href="https://tom-select.js.org/">tom-select.js</a> being loaded before it is included:
59
65
  <pre class="mb-2 code-container"><code class="language-markup">&lt;!DOCTYPE html&gt;
60
66
  &lt;html&gt;
@@ -87,7 +93,7 @@
87
93
 
88
94
  <section class="mb-20">
89
95
  <h2 class="text-xl font-semibold mb-3">Input</h2>
90
- <p class="p-4">Allow creating new items and selecting multiple items</p>
96
+ <p class="p-4">allow creating new items and selecting multiple items</p>
91
97
 
92
98
  <select hx-ext="tomselect" ts-create="true" ts-create-on-blur="true" ts-max-items="10" ts-remove-button-title="true" multiple
93
99
  class="block w-full mb-2">
@@ -102,10 +108,16 @@
102
108
  ts-remove-button-title="true"
103
109
  multiple
104
110
  &gt;
105
- &lt;option value=""&gt;Select an option&lt;/option&gt;
106
- &lt;option value="1"&gt;Option 1&lt;/option&gt;
107
- &lt;option value="2"&gt;Option 2&lt;/option&gt;
108
- &lt;option value="3"&gt;Option 3&lt;/option&gt;
111
+ &lt;option value=""&gt;N/A&lt;/option&gt;
112
+ &lt;option selected value="1"&gt;Option 1&lt;/option&gt;
113
+ &lt;option selected value="2"&gt;Option 2&lt;/option&gt;
114
+ &lt;option selected value="3"&gt;Option 3&lt;/option&gt;
115
+ &lt;option selected value="4"&gt;Option 4&lt;/option&gt;
116
+ &lt;option selected value="5"&gt;Option 5&lt;/option&gt;
117
+ &lt;option value="6"&gt;Option 6&lt;/option&gt;
118
+ &lt;option value="7"&gt;Option 7&lt;/option&gt;
119
+ &lt;option value="8"&gt;Option 8&lt;/option&gt;
120
+ &lt;option value="9"&gt;Option 9&lt;/option&gt;
109
121
  &lt;/select&gt;</code></pre>
110
122
  </section>
111
123
 
@@ -180,7 +192,7 @@
180
192
  </section>
181
193
  <section class="mb-20">
182
194
  <h2 class="text-xl font-semibold mb-3">Create + Regex new item names</h2>
183
- <p>Allow creating new items - try typing below - ts-create-filter="true" will prevent commas in the title,
195
+ <p>allow creating new items - try typing below - ts-create-filter="true" will prevent commas in the title,
184
196
  any other string
185
197
  will be used as a regex match</p>
186
198
  <select hx-ext="tomselect" ts-create="true" ts-max-items="10" ts-create-filter="^[^,]*$">
package/package.json CHANGED
@@ -1,11 +1,8 @@
1
1
  {
2
2
  "name": "hx-tomselect",
3
- "version": "1.0.6",
3
+ "version": "1.0.12",
4
4
  "description": "Provides a hx-ext=\"tomselect\" htmx extention tag",
5
5
  "main": "hx-tomselect.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
6
  "repository": {
10
7
  "type": "git",
11
8
  "url": "git+https://github.com/KiwiKid/hx-tomselect.git"