@symbo.ls/datepicker 0.5.10 → 0.6.0
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/dist/index.js +11 -11
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
- package/packages/react/dist/index.js +17 -0
- package/packages/react/dist/index.js.map +1 -0
- package/packages/react/package.json +4 -4
- package/packages/react/{index.js → src/index.js} +0 -0
- package/.parcel-cache/3085beb0745a2550.txt +0 -2
- package/.parcel-cache/736b9fb319e7887f.txt +0 -2
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/packages/react/node_modules/.yarn-integrity +0 -105
- package/packages/react/node_modules/@domql/cache/LICENSE +0 -21
- package/packages/react/node_modules/@domql/cache/index.js +0 -0
- package/packages/react/node_modules/@domql/cache/package.json +0 -10
- package/packages/react/node_modules/@domql/cookie/LICENSE +0 -21
- package/packages/react/node_modules/@domql/cookie/index.js +0 -22
- package/packages/react/node_modules/@domql/cookie/package.json +0 -10
- package/packages/react/node_modules/@domql/define/LICENSE +0 -21
- package/packages/react/node_modules/@domql/define/index.js +0 -14
- package/packages/react/node_modules/@domql/define/package.json +0 -11
- package/packages/react/node_modules/@domql/domql/LICENSE +0 -21
- package/packages/react/node_modules/@domql/domql/dist/index.js +0 -93
- package/packages/react/node_modules/@domql/domql/dist/index.js.map +0 -1
- package/packages/react/node_modules/@domql/domql/package.json +0 -33
- package/packages/react/node_modules/@domql/element/LICENSE +0 -21
- package/packages/react/node_modules/@domql/element/package.json +0 -20
- package/packages/react/node_modules/@domql/element/src/assign.js +0 -22
- package/packages/react/node_modules/@domql/element/src/create.js +0 -125
- package/packages/react/node_modules/@domql/element/src/index.js +0 -8
- package/packages/react/node_modules/@domql/element/src/iterate.js +0 -80
- package/packages/react/node_modules/@domql/element/src/methods.js +0 -96
- package/packages/react/node_modules/@domql/element/src/set.js +0 -44
- package/packages/react/node_modules/@domql/element/src/update.js +0 -100
- package/packages/react/node_modules/@domql/event/LICENSE +0 -21
- package/packages/react/node_modules/@domql/event/package.json +0 -14
- package/packages/react/node_modules/@domql/event/src/can.js +0 -10
- package/packages/react/node_modules/@domql/event/src/index.js +0 -11
- package/packages/react/node_modules/@domql/event/src/is.js +0 -13
- package/packages/react/node_modules/@domql/event/src/on.js +0 -33
- package/packages/react/node_modules/@domql/event/src/store.js +0 -6
- package/packages/react/node_modules/@domql/event/src/wrappers.js +0 -14
- package/packages/react/node_modules/@domql/event/yarn-error.log +0 -44
- package/packages/react/node_modules/@domql/id/LICENSE +0 -21
- package/packages/react/node_modules/@domql/id/index.js +0 -12
- package/packages/react/node_modules/@domql/id/package.json +0 -10
- package/packages/react/node_modules/@domql/mixins/LICENSE +0 -21
- package/packages/react/node_modules/@domql/mixins/package.json +0 -12
- package/packages/react/node_modules/@domql/mixins/src/attr.js +0 -19
- package/packages/react/node_modules/@domql/mixins/src/classList.js +0 -37
- package/packages/react/node_modules/@domql/mixins/src/content.js +0 -17
- package/packages/react/node_modules/@domql/mixins/src/data.js +0 -21
- package/packages/react/node_modules/@domql/mixins/src/html.js +0 -17
- package/packages/react/node_modules/@domql/mixins/src/index.js +0 -11
- package/packages/react/node_modules/@domql/mixins/src/registry.js +0 -55
- package/packages/react/node_modules/@domql/mixins/src/state.js +0 -16
- package/packages/react/node_modules/@domql/mixins/src/style.js +0 -14
- package/packages/react/node_modules/@domql/mixins/src/text.js +0 -19
- package/packages/react/node_modules/@domql/node/LICENSE +0 -21
- package/packages/react/node_modules/@domql/node/package.json +0 -18
- package/packages/react/node_modules/@domql/node/src/cache.js +0 -53
- package/packages/react/node_modules/@domql/node/src/create.js +0 -86
- package/packages/react/node_modules/@domql/node/src/index.js +0 -5
- package/packages/react/node_modules/@domql/node/src/registry.js +0 -139
- package/packages/react/node_modules/@domql/node/yarn-error.log +0 -166
- package/packages/react/node_modules/@domql/parse/LICENSE +0 -21
- package/packages/react/node_modules/@domql/parse/index.js +0 -16
- package/packages/react/node_modules/@domql/parse/package.json +0 -10
- package/packages/react/node_modules/@domql/props/LICENSE +0 -21
- package/packages/react/node_modules/@domql/props/package.json +0 -10
- package/packages/react/node_modules/@domql/props/src/index.js +0 -62
- package/packages/react/node_modules/@domql/proto/LICENSE +0 -21
- package/packages/react/node_modules/@domql/proto/index.js +0 -66
- package/packages/react/node_modules/@domql/proto/package.json +0 -10
- package/packages/react/node_modules/@domql/react-transformer/LICENSE +0 -21
- package/packages/react/node_modules/@domql/react-transformer/dist/index.js +0 -62
- package/packages/react/node_modules/@domql/react-transformer/dist/index.js.map +0 -1
- package/packages/react/node_modules/@domql/react-transformer/package.json +0 -17
- package/packages/react/node_modules/@domql/report/LICENSE +0 -21
- package/packages/react/node_modules/@domql/report/index.js +0 -62
- package/packages/react/node_modules/@domql/report/package.json +0 -7
- package/packages/react/node_modules/@domql/state/LICENSE +0 -21
- package/packages/react/node_modules/@domql/state/package.json +0 -11
- package/packages/react/node_modules/@domql/state/src/index.js +0 -51
- package/packages/react/node_modules/@domql/tree/LICENSE +0 -21
- package/packages/react/node_modules/@domql/tree/index.js +0 -6
- package/packages/react/node_modules/@domql/tree/package.json +0 -10
- package/packages/react/node_modules/@domql/tree/root.js +0 -8
- package/packages/react/node_modules/@domql/utils/LICENSE +0 -21
- package/packages/react/node_modules/@domql/utils/package.json +0 -13
- package/packages/react/node_modules/@domql/utils/src/index.js +0 -5
- package/packages/react/node_modules/@domql/utils/src/node.js +0 -10
- package/packages/react/node_modules/@domql/utils/src/object.js +0 -193
- package/packages/react/node_modules/@domql/utils/src/protoUtils.js +0 -119
- package/packages/react/node_modules/@symbo.ls/block/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/block/packages/react/index.js +0 -1
- package/packages/react/node_modules/@symbo.ls/block/packages/react/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/block/src/index.js +0 -90
- package/packages/react/node_modules/@symbo.ls/block/src/style.js +0 -5
- package/packages/react/node_modules/@symbo.ls/datepicker/package.json +0 -12
- package/packages/react/node_modules/@symbo.ls/datepicker/packages/react/index.js +0 -1
- package/packages/react/node_modules/@symbo.ls/datepicker/packages/react/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/datepicker/src/index.js +0 -115
- package/packages/react/node_modules/@symbo.ls/datepicker/src/style.js +0 -100
- package/packages/react/node_modules/@symbo.ls/icon/package.json +0 -10
- package/packages/react/node_modules/@symbo.ls/icon/packages/react/index.js +0 -1
- package/packages/react/node_modules/@symbo.ls/icon/packages/react/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/icon/src/index.js +0 -14
- package/packages/react/node_modules/@symbo.ls/icon/src/style.js +0 -8
- package/packages/react/node_modules/@symbo.ls/shape/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/shape/packages/react/index.js +0 -1
- package/packages/react/node_modules/@symbo.ls/shape/packages/react/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/shape/src/index.js +0 -43
- package/packages/react/node_modules/@symbo.ls/shape/src/style.js +0 -102
- package/packages/react/node_modules/@symbo.ls/svg/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/svg/packages/react/index.js +0 -1
- package/packages/react/node_modules/@symbo.ls/svg/packages/react/package.json +0 -7
- package/packages/react/node_modules/@symbo.ls/svg/src/index.js +0 -14
- package/packages/react/node_modules/js-tokens/CHANGELOG.md +0 -151
- package/packages/react/node_modules/js-tokens/LICENSE +0 -21
- package/packages/react/node_modules/js-tokens/README.md +0 -240
- package/packages/react/node_modules/js-tokens/index.js +0 -23
- package/packages/react/node_modules/js-tokens/package.json +0 -30
- package/packages/react/node_modules/loose-envify/LICENSE +0 -21
- package/packages/react/node_modules/loose-envify/README.md +0 -45
- package/packages/react/node_modules/loose-envify/cli.js +0 -16
- package/packages/react/node_modules/loose-envify/custom.js +0 -4
- package/packages/react/node_modules/loose-envify/index.js +0 -3
- package/packages/react/node_modules/loose-envify/loose-envify.js +0 -36
- package/packages/react/node_modules/loose-envify/package.json +0 -36
- package/packages/react/node_modules/loose-envify/replace.js +0 -65
- package/packages/react/node_modules/object-assign/index.js +0 -90
- package/packages/react/node_modules/object-assign/license +0 -21
- package/packages/react/node_modules/object-assign/package.json +0 -42
- package/packages/react/node_modules/object-assign/readme.md +0 -61
- package/packages/react/node_modules/react/LICENSE +0 -21
- package/packages/react/node_modules/react/README.md +0 -13
- package/packages/react/node_modules/react/build-info.json +0 -8
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.development.js +0 -1203
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +0 -9
- package/packages/react/node_modules/react/cjs/react-jsx-dev-runtime.profiling.min.js +0 -9
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.development.js +0 -1221
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.production.min.js +0 -10
- package/packages/react/node_modules/react/cjs/react-jsx-runtime.profiling.min.js +0 -10
- package/packages/react/node_modules/react/cjs/react.development.js +0 -2333
- package/packages/react/node_modules/react/cjs/react.production.min.js +0 -23
- package/packages/react/node_modules/react/index.js +0 -7
- package/packages/react/node_modules/react/jsx-dev-runtime.js +0 -7
- package/packages/react/node_modules/react/jsx-runtime.js +0 -7
- package/packages/react/node_modules/react/package.json +0 -39
- package/packages/react/node_modules/react/umd/react.development.js +0 -3357
- package/packages/react/node_modules/react/umd/react.production.min.js +0 -31
- package/packages/react/node_modules/react/umd/react.profiling.min.js +0 -36
- package/packages/react/node_modules/react-dom/LICENSE +0 -21
- package/packages/react/node_modules/react-dom/README.md +0 -54
- package/packages/react/node_modules/react-dom/build-info.json +0 -8
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.browser.development.js +0 -4342
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +0 -51
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.node.development.js +0 -4383
- package/packages/react/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +0 -52
- package/packages/react/node_modules/react-dom/cjs/react-dom-test-utils.development.js +0 -2118
- package/packages/react/node_modules/react-dom/cjs/react-dom-test-utils.production.min.js +0 -43
- package/packages/react/node_modules/react-dom/cjs/react-dom.development.js +0 -26262
- package/packages/react/node_modules/react-dom/cjs/react-dom.production.min.js +0 -297
- package/packages/react/node_modules/react-dom/cjs/react-dom.profiling.min.js +0 -310
- package/packages/react/node_modules/react-dom/index.js +0 -38
- package/packages/react/node_modules/react-dom/package.json +0 -49
- package/packages/react/node_modules/react-dom/profiling.js +0 -38
- package/packages/react/node_modules/react-dom/server.browser.js +0 -7
- package/packages/react/node_modules/react-dom/server.js +0 -3
- package/packages/react/node_modules/react-dom/server.node.js +0 -7
- package/packages/react/node_modules/react-dom/test-utils.js +0 -7
- package/packages/react/node_modules/react-dom/umd/react-dom-server.browser.development.js +0 -4341
- package/packages/react/node_modules/react-dom/umd/react-dom-server.browser.production.min.js +0 -46
- package/packages/react/node_modules/react-dom/umd/react-dom-test-utils.development.js +0 -2136
- package/packages/react/node_modules/react-dom/umd/react-dom-test-utils.production.min.js +0 -35
- package/packages/react/node_modules/react-dom/umd/react-dom.development.js +0 -26292
- package/packages/react/node_modules/react-dom/umd/react-dom.production.min.js +0 -245
- package/packages/react/node_modules/react-dom/umd/react-dom.profiling.min.js +0 -252
- package/packages/react/node_modules/regenerator-runtime/LICENSE +0 -21
- package/packages/react/node_modules/regenerator-runtime/README.md +0 -31
- package/packages/react/node_modules/regenerator-runtime/package.json +0 -19
- package/packages/react/node_modules/regenerator-runtime/path.js +0 -11
- package/packages/react/node_modules/regenerator-runtime/runtime.js +0 -754
- package/packages/react/node_modules/scheduler/LICENSE +0 -21
- package/packages/react/node_modules/scheduler/README.md +0 -9
- package/packages/react/node_modules/scheduler/build-info.json +0 -8
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.development.js +0 -347
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.production.min.js +0 -9
- package/packages/react/node_modules/scheduler/cjs/scheduler-tracing.profiling.min.js +0 -16
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_mock.development.js +0 -665
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_mock.production.min.js +0 -19
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.development.js +0 -206
- package/packages/react/node_modules/scheduler/cjs/scheduler-unstable_post_task.production.min.js +0 -13
- package/packages/react/node_modules/scheduler/cjs/scheduler.development.js +0 -646
- package/packages/react/node_modules/scheduler/cjs/scheduler.production.min.js +0 -20
- package/packages/react/node_modules/scheduler/index.js +0 -7
- package/packages/react/node_modules/scheduler/package.json +0 -40
- package/packages/react/node_modules/scheduler/tracing-profiling.js +0 -7
- package/packages/react/node_modules/scheduler/tracing.js +0 -7
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.development.js +0 -80
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.production.min.js +0 -80
- package/packages/react/node_modules/scheduler/umd/scheduler-tracing.profiling.min.js +0 -80
- package/packages/react/node_modules/scheduler/umd/scheduler-unstable_mock.development.js +0 -664
- package/packages/react/node_modules/scheduler/umd/scheduler-unstable_mock.production.min.js +0 -18
- package/packages/react/node_modules/scheduler/umd/scheduler.development.js +0 -152
- package/packages/react/node_modules/scheduler/umd/scheduler.production.min.js +0 -146
- package/packages/react/node_modules/scheduler/umd/scheduler.profiling.min.js +0 -146
- package/packages/react/node_modules/scheduler/unstable_mock.js +0 -7
- package/packages/react/node_modules/scheduler/unstable_post_task.js +0 -7
- package/packages/react/yarn.lock +0 -229
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { on } from '@domql/event'
|
|
4
|
-
import { deepClone, exec, isFunction, overwriteDeep } from '@domql/utils'
|
|
5
|
-
|
|
6
|
-
export const parseState = function () {
|
|
7
|
-
const state = this
|
|
8
|
-
const parseState = {}
|
|
9
|
-
for (const param in state) {
|
|
10
|
-
if (param !== '__element' && param !== 'update' && param !== 'parse') {
|
|
11
|
-
parseState[param] = state[param]
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
return parseState
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export const updateState = function (obj, options = {}) {
|
|
18
|
-
const state = this
|
|
19
|
-
const element = state.__element
|
|
20
|
-
|
|
21
|
-
// run `on.stateUpdated`
|
|
22
|
-
if (element.on && isFunction(element.on.initStateUpdated)) {
|
|
23
|
-
on.initStateUpdated(element.on.initStateUpdated, element, state)
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
overwriteDeep(state, obj, ['update', 'parse', '__element'])
|
|
27
|
-
if (!options.preventUpdate) element.update()
|
|
28
|
-
|
|
29
|
-
// run `on.stateUpdated`
|
|
30
|
-
if (element.on && isFunction(element.on.stateUpdated)) {
|
|
31
|
-
on.stateUpdated(element.on.stateUpdated, element, state)
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export function createState (element, parent) {
|
|
36
|
-
let { state } = element
|
|
37
|
-
if (!state) return (parent && parent.state) || {}
|
|
38
|
-
if (isFunction(state)) state = exec(state, element)
|
|
39
|
-
|
|
40
|
-
state = deepClone(state, ['update', 'parse', '__element'])
|
|
41
|
-
state.__element = element
|
|
42
|
-
state.parse = parseState
|
|
43
|
-
state.update = updateState
|
|
44
|
-
|
|
45
|
-
// run `on.stateCreated`
|
|
46
|
-
if (element.on && isFunction(element.on.stateCreated)) {
|
|
47
|
-
on.stateCreated(element.on.stateCreated, element, element.state)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return state
|
|
51
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2016 rackai
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@domql/utils",
|
|
3
|
-
"version": "1.3.5",
|
|
4
|
-
"main": "src/index.js",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"vpatch": "npm version patch && npm publish --access public"
|
|
8
|
-
},
|
|
9
|
-
"dependencies": {
|
|
10
|
-
"@domql/node": "^1.3.5"
|
|
11
|
-
},
|
|
12
|
-
"gitHead": "88423b1fc5dcbfac8de478ce4bab238bf526a839"
|
|
13
|
-
}
|
|
@@ -1,193 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { NODE_REGISTRY } from '@domql/node'
|
|
4
|
-
|
|
5
|
-
export const isValidHtmlTag = arg => NODE_REGISTRY.body.indexOf(arg)
|
|
6
|
-
|
|
7
|
-
export const isObject = arg => {
|
|
8
|
-
if (arg === null) return false
|
|
9
|
-
return (typeof arg === 'object') && (arg.constructor === Object)
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export const isString = arg => typeof arg === 'string'
|
|
13
|
-
|
|
14
|
-
export const isNumber = arg => typeof arg === 'number'
|
|
15
|
-
|
|
16
|
-
export const isFunction = arg => typeof arg === 'function'
|
|
17
|
-
|
|
18
|
-
export const isArray = arg => Array.isArray(arg)
|
|
19
|
-
|
|
20
|
-
export const isObjectLike = arg => {
|
|
21
|
-
if (arg === null) return false
|
|
22
|
-
// if (isArray(arg)) return false
|
|
23
|
-
return (typeof arg === 'object')
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export const isNode = obj => {
|
|
27
|
-
return (
|
|
28
|
-
typeof window.Node === 'object'
|
|
29
|
-
? obj instanceof window.Node
|
|
30
|
-
: obj && typeof obj === 'object' && typeof obj.nodeType === 'number' && typeof obj.nodeName === 'string'
|
|
31
|
-
)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const isHtmlElement = obj => {
|
|
35
|
-
return (
|
|
36
|
-
typeof window.HTMLElement === 'object'
|
|
37
|
-
? obj instanceof window.HTMLElement // DOM2
|
|
38
|
-
: obj && typeof obj === 'object' && obj !== null && obj.nodeType === 1 && typeof obj.nodeName === 'string'
|
|
39
|
-
)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export const isDefined = arg => {
|
|
43
|
-
return isObject(arg) ||
|
|
44
|
-
isObjectLike(arg) ||
|
|
45
|
-
isString(arg) ||
|
|
46
|
-
isNumber(arg) ||
|
|
47
|
-
isFunction(arg) ||
|
|
48
|
-
isArray(arg) ||
|
|
49
|
-
isObjectLike(arg)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export const exec = (param, element, state) => {
|
|
53
|
-
if (isFunction(param)) return param(element, state || element.state)
|
|
54
|
-
return param
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const map = (obj, extention, element) => {
|
|
58
|
-
for (const e in extention) {
|
|
59
|
-
obj[e] = exec(extention[e], element)
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
export const merge = (element, obj) => {
|
|
64
|
-
for (const e in obj) {
|
|
65
|
-
const elementProp = element[e]
|
|
66
|
-
const objProp = obj[e]
|
|
67
|
-
if (elementProp === undefined) {
|
|
68
|
-
element[e] = objProp
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
return element
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
export const deepMerge = (element, proto) => {
|
|
75
|
-
// console.groupCollapsed('deepMerge:')
|
|
76
|
-
for (const e in proto) {
|
|
77
|
-
const elementProp = element[e]
|
|
78
|
-
const protoProp = proto[e]
|
|
79
|
-
// const cachedProps = cache.props
|
|
80
|
-
if (e === 'parent' || e === 'props') continue
|
|
81
|
-
if (elementProp === undefined) {
|
|
82
|
-
element[e] = protoProp
|
|
83
|
-
} else if (isObjectLike(elementProp) && isObject(protoProp)) {
|
|
84
|
-
deepMerge(elementProp, protoProp)
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
// console.groupEnd('deepMerge:')
|
|
88
|
-
return element
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export const clone = obj => {
|
|
92
|
-
const o = {}
|
|
93
|
-
for (const prop in obj) {
|
|
94
|
-
if (prop === 'node') continue
|
|
95
|
-
o[prop] = obj[prop]
|
|
96
|
-
}
|
|
97
|
-
return o
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* Deep cloning of object
|
|
102
|
-
*/
|
|
103
|
-
export const deepClone = (obj, excluding = ['parent', 'node', '__element', '__root']) => {
|
|
104
|
-
const o = {}
|
|
105
|
-
for (const prop in obj) {
|
|
106
|
-
if (excluding.indexOf(prop) > -1) continue
|
|
107
|
-
let objProp = obj[prop]
|
|
108
|
-
if (prop === 'proto' && isArray(objProp)) {
|
|
109
|
-
objProp = mergeArray(objProp)
|
|
110
|
-
}
|
|
111
|
-
if (isObjectLike(objProp)) {
|
|
112
|
-
o[prop] = deepClone(objProp)
|
|
113
|
-
} else o[prop] = objProp
|
|
114
|
-
}
|
|
115
|
-
return o
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* Overwrites object properties with another
|
|
120
|
-
*/
|
|
121
|
-
export const overwrite = (element, params, options) => {
|
|
122
|
-
const changes = {}
|
|
123
|
-
|
|
124
|
-
for (const e in params) {
|
|
125
|
-
if (e === 'props') continue
|
|
126
|
-
|
|
127
|
-
const elementProp = element[e]
|
|
128
|
-
const paramsProp = params[e]
|
|
129
|
-
|
|
130
|
-
if (paramsProp) {
|
|
131
|
-
element.__cached[e] = changes[e] = elementProp
|
|
132
|
-
element[e] = paramsProp
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
if (options.cleanExec) delete element.__exec[e]
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
return changes
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* Overwrites DEEPly object properties with another
|
|
143
|
-
*/
|
|
144
|
-
export const overwriteDeep = (obj, params, excluding = ['node', '__root']) => {
|
|
145
|
-
for (const e in params) {
|
|
146
|
-
if (excluding.indexOf(e) > -1) continue
|
|
147
|
-
const objProp = obj[e]
|
|
148
|
-
const paramsProp = params[e]
|
|
149
|
-
if (isObjectLike(objProp) && isObjectLike(paramsProp)) {
|
|
150
|
-
overwriteDeep(objProp, paramsProp)
|
|
151
|
-
} else if (paramsProp !== undefined) {
|
|
152
|
-
obj[e] = paramsProp
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return obj
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* Overwrites object properties with another
|
|
160
|
-
*/
|
|
161
|
-
export const mergeIfExisted = (a, b) => {
|
|
162
|
-
if (isObjectLike(a) && isObjectLike(b)) return deepMerge(a, b)
|
|
163
|
-
return a || b
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
/**
|
|
167
|
-
* Merges array prototypes
|
|
168
|
-
*/
|
|
169
|
-
export const mergeArray = (arr) => {
|
|
170
|
-
return arr.reduce((a, c) => deepMerge(a, deepClone(c)), {})
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
/**
|
|
174
|
-
* Merges array prototypes
|
|
175
|
-
*/
|
|
176
|
-
export const mergeAndCloneIfArray = obj => {
|
|
177
|
-
return isArray(obj) ? mergeArray(obj) : deepClone(obj)
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* Overwrites object properties with another
|
|
182
|
-
*/
|
|
183
|
-
export const flattenRecursive = (param, prop, stack = []) => {
|
|
184
|
-
const objectized = mergeAndCloneIfArray(param)
|
|
185
|
-
stack.push(objectized)
|
|
186
|
-
|
|
187
|
-
const protoOfProto = objectized[prop]
|
|
188
|
-
if (protoOfProto) flattenRecursive(protoOfProto, prop, stack)
|
|
189
|
-
|
|
190
|
-
delete objectized[prop]
|
|
191
|
-
|
|
192
|
-
return stack
|
|
193
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { isArray, isFunction, isObject } from './object'
|
|
4
|
-
|
|
5
|
-
export const generateHash = () => Math.random().toString(36).substring(2)
|
|
6
|
-
|
|
7
|
-
// hashing
|
|
8
|
-
export const protoStackRegistry = {}
|
|
9
|
-
export const protoCachedRegistry = {}
|
|
10
|
-
|
|
11
|
-
window.protoStackRegistry = protoStackRegistry
|
|
12
|
-
window.protoCachedRegistry = protoCachedRegistry
|
|
13
|
-
|
|
14
|
-
export const getHashedProto = proto => {
|
|
15
|
-
return protoStackRegistry[proto.__hash]
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export const setHashedProto = (proto, stack) => {
|
|
19
|
-
const hash = generateHash()
|
|
20
|
-
proto.__hash = hash
|
|
21
|
-
protoStackRegistry[hash] = stack
|
|
22
|
-
return protoStackRegistry[hash]
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const getProtoStackRegistry = (proto, stack) => {
|
|
26
|
-
if (proto.__hash) {
|
|
27
|
-
return stack.concat(getHashedProto(proto))
|
|
28
|
-
} else {
|
|
29
|
-
setHashedProto(proto, stack)
|
|
30
|
-
}
|
|
31
|
-
return stack // .concat(hashedProto)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
// stacking
|
|
35
|
-
export const extractArrayProto = (proto, stack) => {
|
|
36
|
-
proto.forEach(each => flattenProto(each, stack))
|
|
37
|
-
return stack
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
export const deepProto = (proto, stack) => {
|
|
41
|
-
const protoOflattenProto = proto.proto
|
|
42
|
-
if (protoOflattenProto) {
|
|
43
|
-
flattenProto(protoOflattenProto, stack)
|
|
44
|
-
}
|
|
45
|
-
return stack
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export const flattenProto = (proto, stack) => {
|
|
49
|
-
if (!proto) return stack
|
|
50
|
-
if (isArray(proto)) return extractArrayProto(proto, stack)
|
|
51
|
-
stack.push(proto)
|
|
52
|
-
if (proto.proto) deepProto(proto, stack)
|
|
53
|
-
return stack
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// merging
|
|
57
|
-
export const deepCloneProto = obj => {
|
|
58
|
-
const o = {}
|
|
59
|
-
for (const prop in obj) {
|
|
60
|
-
if (['parent', 'node', '__element', '__root', '__key'].indexOf(prop) > -1) continue
|
|
61
|
-
const objProp = obj[prop]
|
|
62
|
-
if (isObject(objProp)) {
|
|
63
|
-
o[prop] = deepCloneProto(objProp)
|
|
64
|
-
} else if (isArray(objProp)) {
|
|
65
|
-
o[prop] = objProp.map(x => x)
|
|
66
|
-
} else o[prop] = objProp
|
|
67
|
-
}
|
|
68
|
-
return o
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const deepMergeProto = (element, proto) => {
|
|
72
|
-
for (const e in proto) {
|
|
73
|
-
if (['parent', 'node', '__element', '__root'].indexOf(e) > -1) continue
|
|
74
|
-
const elementProp = element[e]
|
|
75
|
-
const protoProp = proto[e]
|
|
76
|
-
if (elementProp === undefined) {
|
|
77
|
-
element[e] = protoProp
|
|
78
|
-
} else if (isObject(elementProp) && isObject(protoProp)) {
|
|
79
|
-
deepMergeProto(elementProp, protoProp)
|
|
80
|
-
} else if (isArray(elementProp) && isArray(protoProp)) {
|
|
81
|
-
element[e] = elementProp.concat(protoProp)
|
|
82
|
-
} else if (isArray(elementProp) && isObject(protoProp)) {
|
|
83
|
-
const obj = deepMergeProto({}, elementProp)
|
|
84
|
-
element[e] = deepMergeProto(obj, protoProp)
|
|
85
|
-
} else if (elementProp === undefined && isFunction(protoProp)) {
|
|
86
|
-
element[e] = protoProp
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return element
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export const cloneAndMergeArrayProto = stack => {
|
|
93
|
-
return stack.reduce((a, c) => {
|
|
94
|
-
return deepMergeProto(a, deepCloneProto(c))
|
|
95
|
-
}, {})
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// joint stacks
|
|
99
|
-
export const jointStacks = (protoStack, childProtoStack) => {
|
|
100
|
-
return []
|
|
101
|
-
.concat(protoStack.slice(0, 1))
|
|
102
|
-
.concat(childProtoStack.slice(0, 1))
|
|
103
|
-
.concat(protoStack.slice(1))
|
|
104
|
-
.concat(childProtoStack.slice(1))
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// init
|
|
108
|
-
export const getProtoStack = proto => {
|
|
109
|
-
if (!proto) return []
|
|
110
|
-
if (proto.__hash) return getHashedProto(proto)
|
|
111
|
-
const stack = flattenProto(proto, [])
|
|
112
|
-
// console.log(stack)
|
|
113
|
-
return getProtoStackRegistry(proto, stack)
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export const getProtoMerged = proto => {
|
|
117
|
-
const stack = getProtoStack(proto)
|
|
118
|
-
return cloneAndMergeArrayProto(stack)
|
|
119
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
import { SPACING, mapSpacing } from '@symbo.ls/scratch'
|
|
4
|
-
import style from './style'
|
|
5
|
-
|
|
6
|
-
export const mapBasedOnRatio = (props, prop) => {
|
|
7
|
-
const { spacingRatio } = props
|
|
8
|
-
const val = props[prop]
|
|
9
|
-
if (spacingRatio) {
|
|
10
|
-
const params = SPACING[spacingRatio]
|
|
11
|
-
|
|
12
|
-
if (!params) {
|
|
13
|
-
SPACING[spacingRatio] = {
|
|
14
|
-
base: SPACING.base,
|
|
15
|
-
type: 'spacing',
|
|
16
|
-
ratio: spacingRatio,
|
|
17
|
-
range: [-5, +7],
|
|
18
|
-
subSequence: true,
|
|
19
|
-
sequence: {},
|
|
20
|
-
scales: {}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const result = mapSpacing(val, prop, params)
|
|
25
|
-
|
|
26
|
-
return result
|
|
27
|
-
}
|
|
28
|
-
return mapSpacing(val, prop)
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
export const Block = {
|
|
32
|
-
style,
|
|
33
|
-
|
|
34
|
-
props: {},
|
|
35
|
-
|
|
36
|
-
class: {
|
|
37
|
-
width: ({ props }) => props.width && mapBasedOnRatio(props, 'width'),
|
|
38
|
-
height: ({ props }) => props.height && mapBasedOnRatio(props, 'height'),
|
|
39
|
-
boxSize: ({ props }) => {
|
|
40
|
-
if (typeof props.boxSize !== 'string') return
|
|
41
|
-
const [width, height] = props.boxSize.split(' ')
|
|
42
|
-
return {
|
|
43
|
-
...mapSpacing(width, 'width'),
|
|
44
|
-
...mapSpacing(height, 'height')
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
maxWidth: ({ props }) => props.maxWidth && mapBasedOnRatio(props, 'maxWidth'),
|
|
49
|
-
minWidth: ({ props }) => props.minWidth && mapBasedOnRatio(props, 'minWidth'),
|
|
50
|
-
widthRange: ({ props }) => {
|
|
51
|
-
if (typeof props.widthRange !== 'string') return
|
|
52
|
-
const [minWidth, maxWidth] = props.widthRange.split(' ')
|
|
53
|
-
return {
|
|
54
|
-
...mapSpacing(minWidth, 'minWidth'),
|
|
55
|
-
...mapSpacing(maxWidth, 'maxWidth')
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
maxHeight: ({ props }) => props.maxHeight && mapBasedOnRatio(props, 'maxHeight'),
|
|
60
|
-
minHeight: ({ props }) => props.minHeight && mapBasedOnRatio(props, 'minHeight'),
|
|
61
|
-
heightRange: ({ props }) => {
|
|
62
|
-
if (typeof props.heightRange !== 'string') return
|
|
63
|
-
const [minHeight, maxHeight] = props.heightRange.split(' ')
|
|
64
|
-
return {
|
|
65
|
-
...mapSpacing(minHeight, 'minHeight'),
|
|
66
|
-
...mapSpacing(maxHeight, 'maxHeight')
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
|
|
70
|
-
aspectRatio: ({ props }) => ({ aspectRatio: props.aspectRatio }),
|
|
71
|
-
|
|
72
|
-
padding: ({ props }) => mapBasedOnRatio(props, 'padding'),
|
|
73
|
-
margin: ({ props }) => mapBasedOnRatio(props, 'margin'),
|
|
74
|
-
gap: ({ props }) => mapBasedOnRatio(props, 'gap'),
|
|
75
|
-
|
|
76
|
-
flexFlow: ({ props }) => props.flexFlow && ({
|
|
77
|
-
display: 'flex',
|
|
78
|
-
flexFlow: props.flexFlow
|
|
79
|
-
}),
|
|
80
|
-
flexAlign: ({ props }) => {
|
|
81
|
-
if (typeof props.flexAlign !== 'string') return
|
|
82
|
-
const [alignItems, justifyContent] = props.flexAlign.split(' ')
|
|
83
|
-
return {
|
|
84
|
-
display: 'flex',
|
|
85
|
-
alignItems: alignItems,
|
|
86
|
-
justifyContent: justifyContent
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@symbo.ls/datepicker",
|
|
3
|
-
"version": "0.5.3",
|
|
4
|
-
"main": "src/index.js",
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"gitHead": "f0c29fae632536241c4e803b880991748344f7c5",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"@symbo.ls/block": "^0.5.3",
|
|
9
|
-
"@symbo.ls/icon": "^0.5.3",
|
|
10
|
-
"@symbo.ls/shape": "^0.5.3"
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
'use strict'
|