@ditojs/admin 2.8.2 → 2.9.1

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.
@@ -7,14 +7,15 @@ ul.dito-checkboxes(
7
7
  v-for="option in options"
8
8
  )
9
9
  label
10
- input.dito-checkbox(
11
- ref="element"
12
- v-model="selectedOptions"
13
- type="checkbox"
14
- :value="getValueForOption(option)"
15
- v-bind="attributes"
16
- )
17
- | {{ getLabelForOption(option) }}
10
+ .dito-checkbox
11
+ input(
12
+ ref="element"
13
+ v-model="selectedOptions"
14
+ type="checkbox"
15
+ :value="getValueForOption(option)"
16
+ v-bind="attributes"
17
+ )
18
+ span {{ getLabelForOption(option) }}
18
19
  </template>
19
20
 
20
21
  <script>
@@ -51,7 +52,7 @@ export default DitoTypeComponent.register('checkboxes', {
51
52
  @extend %input-borderless;
52
53
  }
53
54
 
54
- .dito-checkbox {
55
+ input {
55
56
  margin-right: $form-spacing;
56
57
  }
57
58
  }
@@ -0,0 +1,47 @@
1
+ // This user-agent parser was lifted from Paper.js:
2
+ // https://github.com/paperjs/paper.js/blob/cc15696750035ab00e00c64c7c95daa2c85efe01/src/core/PaperScope.js#L75-L107
3
+
4
+ export function parseUserAgent(userAgent = '') {
5
+ const agent = {}
6
+ // Use replace() to get all matches, and deal with Chrome/Webkit overlap:
7
+ const ua = userAgent.toLowerCase()
8
+ const [os] =
9
+ /(iphone|ipad|linux; android|darwin|win|mac|linux|freebsd|sunos)/.exec(
10
+ ua
11
+ ) || []
12
+ const platform = (
13
+ {
14
+ 'darwin': 'mac',
15
+ 'iphone': 'ios',
16
+ 'ipad': 'ios',
17
+ 'linux; android': 'android'
18
+ }[os] ||
19
+ os
20
+ )
21
+ if (platform) {
22
+ agent.platform = platform
23
+ agent[platform] = true
24
+ }
25
+ ua.replace(
26
+ /(opera|chrome|safari|webkit|firefox|msie|trident)\/?\s*([.\d]+)(?:.*version\/([.\d]+))?(?:.*rv:v?([.\d]+))?/g,
27
+ (match, browser, v1, v2, rv) => {
28
+ // Do not set additional browsers once chrome is detected.
29
+ if (!agent.chrome) {
30
+ const version = rv || v2 || v1
31
+ if (!agent.version || browser !== 'safari') {
32
+ // Use the version we get for webkit for Safari, which is actually
33
+ // The Safari version, e.g. 16.0
34
+ agent.version = version
35
+ agent.versionNumber = parseFloat(version)
36
+ }
37
+ agent.browser = browser
38
+ agent[browser] = true
39
+ }
40
+ }
41
+ )
42
+ if (agent.chrome) {
43
+ // Can't have it both ways, Chrome.
44
+ delete agent.webkit
45
+ }
46
+ return agent
47
+ }