-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
314 lines (267 loc) · 16.1 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html>
<html>
<head>
<title>slgComponents Main</title>
<link href="content/font-awesome.css" rel="stylesheet" />
<link href="/node_modules/bootstrap/dist/css/bootstrap.css" rel="stylesheet" />
<!--<link href="content/bootstrap-overrides.css" rel="stylesheet" />-->
<link href="content/slgComponents.css" rel="stylesheet" />
<link href="content/slgAutoComplete.css" rel="stylesheet" />
<link href="content/slgButtonSpinner.css" rel="stylesheet" />
<link href="content/slgPleaseWait.css" rel="stylesheet" />
<link href="content/slgScrollableView.css" rel="stylesheet" />
<link href="content/slgDropdown.css" rel="stylesheet" />
<link href="content/slgTabs.css" rel="stylesheet" />
<style>
[ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak {
display: none !important;
}
</style>
</head>
<body ng-app="slgComponentsApp" ng-strict-di>
<div class="container" ng-cloak>
<div ng-controller="slgTabsCtrl" class="well">
<div class="form-group row">
<div class="col-xs-4">
<slg-tabs tab-names="tabNames" selected-index="tabIndex" on-tab-selected="onTabSelected(index)"></slg-tabs>
</div>
</div>
</div>
<div ng-controller="slgAutoCompleteTestCtrl" class="well">
<div class="form-group row">
<div class="col-xs-4">
<input type="text" class="form-control" placeholder="Search Items..." ng-model="itemsText"
slg-auto-complete
slg-auto-complete-items="items"
slg-auto-complete-min-chars="4"
slg-auto-complete-allow-free-form-text="false"
slg-auto-complete-list-text-formatter='itemsListTextFormatter(item)'
slg-auto-complete-list-html-formatter='itemsListHtmlFormatter(html)'
slg-auto-complete-textbox-formatter='itemsTextboxFormatter(item)'
slg-auto-complete-selected-model="model.selectedItemModel"
slg-auto-complete-on-select="onSelect(item)"/>
<!--<input type="text" class="form-control" placeholder="Search Items..." ng-model="itemsText"
slg-auto-complete
slg-auto-complete-get-url='http://localhost:27565/item/GetItemsBySearchText?companyid=1'
slg-auto-complete-min-chars="4"
slg-auto-complete-allow-free-form-text="false"
slg-auto-complete-list-formatter='itemsListFormatter(item)'
slg-auto-complete-textbox-formatter='itemsTextboxFormatter(item)'
slg-auto-complete-selected-model="model.selectedItemModel" />-->
Text: {{itemsText}}<br />
Model: {{model.selectedItemModel}}<br />
<button ng-click="reset();" class="btn btn-primary">Clear Text</button>
</div>
</div>
<!--<div class="form-group row">
<div class="col-xs-2">
<input type="text" id="countryAutoComplete" class="form-control" placeholder="Search Country..." ng-model="countryText"
slg-auto-complete
slg-auto-complete-data-list="countries"
slg-auto-complete-min-chars="2"
slg-auto-complete-allow-free-form-text="true"
slg-auto-complete-list-formatter='countryListFormatter(item)'
slg-auto-complete-textbox-formatter='countryTextboxFormatter(item)'
slg-auto-complete-selected-model="model.selectedCountryModel" />
Text: {{countryText | json}}<br />
Model: {{model.selectedCountryModel | json}}
</div>
</div>-->
</div>
<div ng-controller="slgButtonSpinnerTestCtrl" class="well">
<i style="color: green" class="fa fa-cro"></i><br />
The button spinner will show a visual indicator that something is happening.<br />
<br />
The slg-button-spinner attribute will be used to declare which scope variable will be used to show/hide the spinner.<br />
A value of true will show the spinner, false will hide it.<br />
<br />
<button class="btn btn-primary btn-xs" slg-button-spinner="isLoadingXSStatus" ng-click="onIsLoadingXSClicked()">Button XS</button>
<button class="btn btn-primary btn-sm" slg-button-spinner="isLoadingSMStatus" ng-click="onIsLoadingSMClicked()">Button XS</button>
<button class="btn btn-primary" slg-button-spinner="isLoadingStatus" slg-button-spinner-error-message="isLoadingXSErrorMessage" ng-click="onIsLoadingClicked()">Button Normal</button>
<button class="btn btn-primary btn-lg btn" style="width: 200px" slg-button-spinner="isLoadingLGStatus" ng-click="onIsLoadingLGClicked()">Button LG</button>
</div>
<div ng-controller="slgPleaseWaitTestCtrl" class="well">
The showPleaseWait component will render an gray overlay with a spinner that prevents any user action on the page.<br />
<br />
The service will wait a default of 300ms before showing the overlay. You can override this by passing a value into the .show().<br />
It will also timeout after 20 seconds and return to a non-overlayed status. If you don't want a timeout, use forceShow and forceHide.<br />
<br />
Usage:<br />
app.controller('slgPleaseWaitTestCtrl', ['$scope', '$timeout', 'slgPleaseWaitSvc', function ($scope, $timeout, slgPleaseWaitSvc) {<br />
   $scope.showPleaseWait = function () {<br />
      slgPleaseWaitSvc.show();<br />
<br />
      $timeout(function() {<br />
         slgPleaseWaitSvc.hide();<br />
      }, 5000)<br />
   }<br />
}]);<br />
<br />
<button class="btn btn-primary" ng-click="showPleaseWait()">Show Please Wait</button>
<button class="btn btn-primary" ng-click="showForcePleaseWait()">Show Force Please Wait</button>
<button class="btn btn-primary" ng-click="showPleaseWaitWithForceStop()">Show Please Wait With Force Stop</button>
</div>
<div ng-controller="slgScrollableViewTestCtrl" class="well">
The scrollabelView is a simple list that can be scrolled by using the keyboard or the mouse.<br />
It will automatically scroll into view whatever value is passed, if found.<br />
<br />
<div style="width: 400px">
Selected model: {{selectedModel}}<br />
<slg-scrollable-view ng-model="selectedModel"
items="items">
</slg-scrollable-view>
</div>
</div>
<div ng-controller="slgDropdownTestCtrl" class="well">
The dropdown component will acts as a typical dropdown, with a few nice features.<br />
<br />
<div style="width: 400px">
Selected Id: {{id}}<br />
Selected Text: {{selectedText}}
<slg-dropdown ng-model="id"
placeholder="-- Select --"
items="items"
selected-text="selectedText">
</slg-dropdown>
</div>
</div>
</div>
<script src="//cdnjs.cloudflare.com/ajax/libs/angular.js/1.5.8/angular.js"></script>
<script src="scripts/slgComponents.js"></script>
<script src="scripts/slgAutoComplete.js"></script>
<script src="scripts/slgButtonSpinner.js"></script>
<script src="scripts/slgPleaseWait.js"></script>
<script src="scripts/slgScrollableView.js"></script>
<script src="scripts/slgDropdown.js"></script>
<script src="scripts/slgTabs.js"></script>
<script>
var app = angular.module('slgComponentsApp', [
'slgComponents'
]);
app.controller("slgTabsCtrl", ['$scope', '$timeout', function ($scope, $timeout) {
$scope.tabNames = ['Tab 1', "<b>Tab2</b>", "This is a really long tab", 'wrapped tab', 'wrapped 2'];
$scope.tabIndex = 1;
$scope.onTabSelected = function (index) {
console.log(index);
}
}]);
app.controller("slgAutoCompleteTestCtrl", ['$scope', '$timeout', function ($scope, $timeout) {
$scope.model = {
selectedItemModel: null,
selectedCountryModel: {}
}
$scope.reset = function () {
$scope.itemsText = '';
$scope.model.selectedItemModel = {};
}
$scope.onSelect = function(item) {
console.log("Selected Item: ", item);
}
$scope.items = [{ "id": "3225", "text": "Cleaner - Wicked Cleaner", "additional": ["Cleaner"] }, { "id": "507", "text": "A0002 - Bench Bracket Custom size (allow 1 week to ship)", "additional": ["A0002"] }, { "id": "508", "text": "A0003 - Tube 6 in w/drive inserts CS3000 for A0004 (20 ft)", "additional": ["A0003"] }, { "id": "509", "text": "A0004 - Slim Flush Guide - Guide Feed Assembly", "additional": ["A0004"] }, { "id": "510", "text": "A0005 - Slim Flush Guide - End Pulley Assembly", "additional": ["A0005"] }, { "id": "511", "text": "A0006 - Slim Flush Guide - Guide Feed with Pulley", "additional": ["A0006"] }, { "id": "512", "text": "A0007 - RT/UG Right NME w/ Cone 2013", "additional": ["A0007"] }, { "id": "513", "text": "A0008 - Bench Bracket Center 15 in high 19 in wide (allow 1 week to ship)", "additional": ["A0008"] }, { "id": "514", "text": "A0009 - Slim Flush Guide - Hardware Kit", "additional": ["A0009"] }, { "id": "515", "text": "A0010 - Wheel assembly TG (pre 403) CS1800 w/LE Tube Inserts 3 in tube (std) SET", "additional": ["A0010"] }, { "id": "516", "text": "A0012 - Mechanism Coverluxe RT/UG Right 2013", "additional": ["A0012"] }, { "id": "517", "text": "A0013 - Bracket Assembly Coverluxe Mechanism Main Body", "additional": ["A0013"] }, { "id": "518", "text": "A0014 - Ladder Hinges Tube to Deck SET 1-3/4 & 1-7/8 O.D STD", "additional": ["A0014"] }, { "id": "519", "text": "A0015 - Ladder Hinges Tube to Tube SET 1-3/4 O.D. STD", "additional": ["A0015"] }, { "id": "520", "text": "A0016 - Snap unlocking tool", "additional": ["A0016"] }, { "id": "521", "text": "A0017 - TL Caliper Style Coverluxe 2013", "additional": ["A0017"] }, { "id": "522", "text": "A0019 - RT/UG Left NME w/ Cone 2013", "additional": ["A0019"] }, { "id": "523", "text": "A0020 - Cone assembly CS1800 NME (brake, cone, square plate)", "additional": ["A0020"] }, { "id": "524", "text": "A0021 - Slim Flush Guide - Guide & Housing Assembly", "additional": ["A0021"] }, { "id": "525", "text": "A0022 - Pulley endcap ASSEMBLY UG ea. (OLD STYLE)", "additional": ["A0022"] }, { "id": "526", "text": "A0024 - Mechanism Coverluxe RT/UG Left 2013", "additional": ["A0024"] }, { "id": "527", "text": "A0025 - Lid Kit Aluminum Lid 8 in hinge for 20ft guide space UG", "additional": ["A0025"] }, { "id": "528", "text": "A0026 - Lid Kit Aluminum Lid 8 in hinge for 20ft guide space TG", "additional": ["A0026"] }, { "id": "529", "text": "A0028 - Mechanism Coverluxe Deck Right 2013", "additional": ["A0028"] }, { "id": "530", "text": "A0029 - Mechanism Coverluxe Deck Left 2013", "additional": ["A0029"] }, { "id": "531", "text": "A0032 - Deck Right NME w/ Cone 2013", "additional": ["A0032"] }, { "id": "532", "text": "A0033 - Deck Left NME W/ Cone 2013", "additional": ["A0033"] }];
$scope.itemsListTextFormatter = function (item) {
return item.additional[0] + " - " + item.text;
}
$scope.itemsListHtmlFormatter = function (html) {
console.log(html);
return "<div>" + html + "</div>";
}
$scope.itemsTextboxFormatter = function (item) {
console.log(item);
return item.additional[0];
}
$scope.countryListFormatter = function (item) {
return item.additional[0] + " - " + item.text;
}
$scope.countryTextboxFormatter = function (item) {
return item.text;
}
}])
app.controller('slgButtonSpinnerTestCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
$scope.showError = true;
$scope.onIsLoadingXSClicked = function () {
$scope.isLoadingXSStatus = "showspinner";
$timeout(function () {
$scope.isLoadingXSStatus = "showok";
}, 2000);
}
$scope.onIsLoadingSMClicked = function () {
$scope.isLoadingSMStatus = "showspinner";
$timeout(function () {
$scope.isLoadingSMStatus = "showerror";
$timeout(function () {
$scope.isLoadingSMStatus = "reset";
}, 2000);
}, 2000);
}
$scope.onIsLoadingClicked = function () {
$scope.isLoadingStatus = "showspinner";
$timeout(function () {
$scope.showError = !$scope.showError;
if ($scope.showError)
$scope.isLoadingStatus = "showerror";
else
$scope.isLoadingStatus = "showok";
}, 900);
}
$scope.onIsLoadingLGClicked = function () {
$scope.isLoadingLGStatus = "showspinner";
$timeout(function () {
$scope.showError = !$scope.showError;
if ($scope.showError) {
$scope.isLoadingLGStatus = "showerror";
$timeout(function () {
$scope.isLoadingLGStatus = null;
}, 3000);
}
else
$scope.isLoadingLGStatus = "showok";
}, 3000);
}
}]);
app.controller('slgPleaseWaitTestCtrl', ['$scope', '$timeout', 'slgPleaseWaitSvc', function ($scope, $timeout, slgPleaseWaitSvc) {
$scope.showPleaseWait = function () {
slgPleaseWaitSvc.show();
$timeout(function () {
slgPleaseWaitSvc.show();
$timeout(function () {
slgPleaseWaitSvc.hide();
}, 1000);
}, 1000)
$timeout(function () {
slgPleaseWaitSvc.hide();
}, 5000)
}
$scope.showForcePleaseWait = function () {
slgPleaseWaitSvc.forceShow();
$timeout(function () {
slgPleaseWaitSvc.forceHide();
}, 5000)
}
$scope.showPleaseWaitWithForceStop = function () {
slgPleaseWaitSvc.show();
slgPleaseWaitSvc.show();
slgPleaseWaitSvc.show();
$timeout(function () {
slgPleaseWaitSvc.forceHide();
}, 5000)
}
}]);
app.controller('slgScrollableViewTestCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
$scope.items = [
{ id: '1', text: 'One', someOtherVal: 'Blarg' },
{ id: '2', text: 'Two', someOtherVal: 'Bloog' },
{ id: '3', text: 'Three', someOtherVal: 'Blerf' },
{ id: '4', text: 'Four', someOtherVal: 'Blam' }
]
}]);
app.controller('slgDropdownTestCtrl', ['$scope', '$timeout', function ($scope, $timeout) {
$scope.items = [
{ id: '1', text: 'One' },
{ id: '2', text: 'Two' },
{ id: '3', text: 'Three' },
{ id: '4', text: 'Four' }
]
}]);
</script>
</body>
</html>