@tulipnpm/timekit_project_selector 1.0.5 → 1.0.8

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
@@ -35,6 +35,7 @@ TimeKit Project Selector has many configuration options:
35
35
  | app_key | No | | Token required to connect to TimeKit API. Can be found at **https://admin.timekit.io/a/apps/<app_slug>/apisettings/keys** |
36
36
  | defaultUI | Yes | true | When true, will create the default user interface for the project selector. More details below |
37
37
  | embed | Yes | false | When true, the user interface will not be shown in the widget, it will be placed inside of a specified div. More details below |
38
+ | includePrivateAppointments | Yes | false | When true, private appointment types will be fetched from the TimeKit API |
38
39
  | region | Yes | | Initial filter applied when getting default list of projects. Any project that does not have the same **t_region** metadata value will not be shown on initialization |
39
40
  | selectorOptions | No | | See below for details |
40
41
  | widgetImageUrl | Yes | Tulip Appointments Icon | When using the default widget UI, change this value to your desired image URL to replace widget image |
@@ -98,6 +99,17 @@ filters: {
98
99
  't_private': false
99
100
  }
100
101
  ```
102
+
103
+ #### Geo Search Bar
104
+ Geo search bar is an alternative to the selector option bar and they shouldn't be used together.
105
+ When this option is specified, the user will be asked for their geolocation in the browser. If the user shares it, the list of the 5 closest stores will be displayed.
106
+
107
+ ``` js
108
+ geo_search_bar: {
109
+ placeholder: 'Search for a city or postal code'
110
+ }
111
+ ```
112
+
101
113
  #### Standard Strings
102
114
 
103
115
  Adding a string such as 'Select a Store' will display that hardcoded string in the place of the placeholder. This can also be used to display custom HTML elements like icons in the UI.
@@ -185,6 +197,35 @@ timekit_project_selector.init({
185
197
  });
186
198
  ```
187
199
 
200
+ ### Including private appointment types (Optional)
201
+
202
+ By default widget fetches only public appointment types, in order to change that behavior and fetch the private appointment types, `includePrivateAppointments` configuration option can be specified to `true`.
203
+
204
+ ```js
205
+ timekit_project_selector.init({
206
+ app_key: <timekit_app_key>,
207
+ ...,
208
+ includePrivateAppointments: true,
209
+ });
210
+ ```
211
+
212
+ In case if you use custom UI and you need to pull both private and public appointment types from TimeKit API, but want to display the private appointment types only when needed, filters can be used:
213
+
214
+ ```js
215
+ timekit_project_selector.init({
216
+ app_key: <timekit_app_key>,
217
+ defaultUI: false,
218
+ includePrivateAppointments: true,
219
+ selectorOptions: {
220
+ global_appointment_type_project: true,
221
+ store_project: true,
222
+ }
223
+ }).then(() => {
224
+ // Add this filter whenever you want to surface only public appointment types
225
+ globalProjectFilters['t_private'] = 0;
226
+ });
227
+ ```
228
+
188
229
  See below for how to use the exposed methods.
189
230
 
190
231
  ---
@@ -0,0 +1,3 @@
1
+ <svg width="27" height="28" viewBox="0 0 27 28" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <path fill-rule="evenodd" clip-rule="evenodd" d="M14.4965 19.8023L17.6668 11.2512C17.8997 10.6235 17.2888 10.0126 16.661 10.2455L8.10653 13.4168C7.38541 13.6846 7.44166 14.7218 8.18753 14.9097L12.0418 15.8783L13.0037 19.7202C13.1915 20.4661 14.2299 20.5235 14.4965 19.8023V19.8023Z" stroke="#214DE6" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"/>
3
+ </svg>